summaryrefslogtreecommitdiffstats
path: root/debian/openslp-dfsg/openslp-dfsg-1.2.1/configure.in
blob: 10bf76b4c93c620fedfc6df7b08c2e1ce9635dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
dnl ***********************************************************************
dnl Process this file with autoconf to produce a configure script.
dnl ***********************************************************************
AC_PREREQ(2.50)
AC_INIT(openslp, 1.2.1, openslp-devel@lists.sourceforge.net)
AC_CONFIG_SRCDIR(slpd/slpd_main.c)
AM_INIT_AUTOMAKE

AC_CONFIG_HEADERS(config.h)

dnl ***********************************************************************
dnl We don't want /usr/etc or /usr/var
dnl ***********************************************************************
test "$prefix" = NONE && prefix=/usr
if test "$prefix" = '/usr'; then 
    # We don't want /usr/etc and /usr/var
    test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
    test "$sharedstatedir" = '${prefix}/com' && localstatedir=/var
    test "$localstatedir" = '${prefix}/var' && localstatedir=/var
fi

dnl ***********************************************************************
dnl Take care of the debug stuff
dnl ***********************************************************************
AC_ARG_ENABLE(debug,
[  --enable-debug          Turn on debugging (default off)],
debug=$enableval,
debug=no)

CFLAGS="${CFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"

case "$debug" in
  yes) CFLAGS="-g -DDEBUG -D_REENTRANT=1 $CFLAGS" ;;
  no)  CFLAGS="-DNDEBUG -D_REENTRANT=1 $CFLAGS" ;;
  *) AC_MSG_ERROR(bad value ${debug} for --enable-debug) ;;
esac


dnl ***********************************************************************
dnl System type macros
dnl ***********************************************************************
AC_CANONICAL_HOST
case "$host_os" in
  *linux*) CFLAGS="$CFLAGS -DLINUX" ;;
  *solaris*) CFLAGS="$CFLAGS -DSOLARIS";;
  *aix*) CFLAGS="$CFLAGS -DAIX";;
  *hpux*) CFLAGS="$CFLAGS -DHPUX";;
esac


dnl ***********************************************************************
dnl SLPv1 support can be turned off
dnl ***********************************************************************
AC_ARG_ENABLE(slpv1,
[  --enable-slpv1          Turn on SLPv1 support (default on)],
slpv1=$enableval,
slpv1=yes)

dnl Conditional for optional SLPv1 support
AM_CONDITIONAL(ENABLE_SLPv1, test "$slpv1" = "yes")

if test "$slpv1" = "yes"; then
    AC_DEFINE(ENABLE_SLPv1, 1, [defined if struct sigaction has member sa_restorer])
fi

dnl ***********************************************************************
dnl Handle Predicates 
dnl ***********************************************************************
AC_ARG_ENABLE(predicates,
[  --disable-predicates    Turn off predicates],
predicates=$enableval,
predicates=yes)

dnl Conditional for optional predicates support
AM_CONDITIONAL(ENABLE_PREDICATES, test "$predicates" = "yes")

if test "$predicates" = "yes"; then
    AC_DEFINE(ENABLE_PREDICATES, 1, [defined if predicates are enabled])
fi

dnl ***********************************************************************
dnl Enable asyncronous support in libslp SLP API library 
dnl ***********************************************************************
AC_ARG_ENABLE(async-api,
[  --enable-async-api      Turn on asyncronous support (default off)],
asyncapi=$enableval,
asyncapi=no)

dnl Conditional for optional asyncronous support in libslp SLP API library
AM_CONDITIONAL(ENABLE_ASYNC_API, test "$asyncapi" = "yes")

if test "$asyncapi" = "yes"; then
    AC_DEFINE(ENABLE_ASYNC_API, 1, [defined if the async SLP API support is enabled])
fi

dnl ***********************************************************************
dnl Enable security support 
dnl ***********************************************************************
AC_ARG_ENABLE(slpv2-security,
[  --enable-slpv2-security Turn on security support (default off)],
slpv2security=$enableval,
slpv2security=no)

AC_CHECK_LIB(crypto, DSA_sign) 
AC_CHECK_FUNCS(DSA_verify DSA_size DSA_free SHA1)

dnl Conditional for optional security support in libslp SLP API library
AM_CONDITIONAL(ENABLE_SLPv2_SECURITY, test "$slpv2security" = "yes")
if test "$slpv2security" = "yes"; then
    AC_DEFINE(ENABLE_SLPv2_SECURITY, 1, [defined if the SLPv2 authentication support is enabled])
fi


dnl ***********************************************************************
dnl Checks for programs.
dnl ***********************************************************************
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_LIBTOOL
AM_PROG_LEX
AC_PROG_YACC

dnl ***********************************************************************
dnl Set C/C++ compiler specific warning/optimization flags
dnl ***********************************************************************
if test X"$GCC" = X"yes"; then        
    CFLAGS="$CFLAGS -Wall"
    if test X"$debug" = X"yes"; then
       CFLAGS="$CFLAGS -Werror"
    fi
    if test X"$debug" = X"no"; then 
       OPTFLAGS="-O3"
    fi
    
elif $CC -V 2>&1 | grep "WorkShop Compilers"; then
    dnl Allow C++ style comments
    CFLAGS="$CFLAGS -xCC" 
    if test X"$debug" = X"no"; then
        OPTFLAGS="-fast"
        if echo $CC | grep "xarch=v9"; then
            dnl "-fast" sets -xarch=v8 disabling 64-bit mode, enable it again
            OPTFLAGS="$OPTFLAGS -xarch=v9"
        fi
    fi
elif echo $host_os | grep -i "osf" >/dev/null; then
    CFLAGS="$CFLAGS -std"
    if test X"$debug" = X"no"; then
        OPTFLAGS="-O"
    fi
else
    if test X"$debug" = X"no"; then
        OPTFLAGS="-O"
    fi
fi
CFLAGS="$CFLAGS $OPTFLAGS"

dnl ***********************************************************************
dnl Checks for header files.
dnl ***********************************************************************
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h sys/types.h stdint.h netinet/in.h)

dnl ***********************************************************************
dnl Checks for data types.
dnl ***********************************************************************
OPENSLP_CHECK_TYPE(socklen_t, int, [defined to size_t if <sys/socket.h> does not support socklen_t data type])
OPENSLP_STRUCT_SA_RESTORER

dnl ***********************************************************************
dnl Checks for libraries.
dnl ***********************************************************************
AC_CHECK_LIB(resolv, inet_aton)
AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, gethostbyname)
dnl AC_CHECK_LIB(m, main)
dnl AC_CHECK_FUNCS(ceil log10 strncasecmp strcasecmp )
AC_CHECK_FUNCS(strncasecmp strcasecmp)
dnl AC_OUTPUT( Makefile common/Makefile libslpattr/Makefile libslp/Makefile 
dnl 	slpd/Makefile slptool/Makefile test/Makefile slp.list )
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ common/Makefile ])
AC_CONFIG_FILES([ libslpattr/Makefile ])
AC_CONFIG_FILES([ libslp/Makefile ])
AC_CONFIG_FILES([ slpd/Makefile ])
AC_CONFIG_FILES([ slptool/Makefile ])
AC_CONFIG_FILES([ test/Makefile ])
AC_CONFIG_FILES([ slp.list ])
AC_OUTPUT