]> arthur.barton.de Git - netatalk.git/blob - configure.in
Fix enable/disable debug
[netatalk.git] / configure.in
1 dnl configure.in for netatalk
2
3 AC_INIT(bin/adv1tov2/adv1tov2.c)
4
5 NETATALK_VERSION=`cat VERSION`
6 AC_SUBST(NETATALK_VERSION)
7
8 AC_CANONICAL_SYSTEM
9 AM_INIT_AUTOMAKE(netatalk, ${NETATALK_VERSION})
10 AM_CONFIG_HEADER(config.h)
11
12 dnl Reset locations to proper places
13 AC_PREFIX_DEFAULT(/usr)
14
15 dnl Checks for programs.
16 AC_PROG_AWK
17 AC_PROG_CC
18 AC_PROG_INSTALL
19 AC_PROG_LN_S
20 AC_PROG_MAKE_SET
21 AC_PROG_LIBTOOL
22
23 dnl *********************************************************************
24 dnl FIXME! FIXME! These should be selectable properly, and should produce
25 dnl the proper flags and defines...
26 dnl *********************************************************************
27
28 dnl Checks for libraries.
29 dnl Replace `main' with a function in -labs:
30 AC_CHECK_LIB(abs, main)
31 dnl Replace `main' with a function in -laudit:
32 AC_CHECK_LIB(audit, main)
33 dnl Replace `main' with a function in -lauth:
34 AC_CHECK_LIB(auth, main)
35 dnl Replace `main' with a function in -lcmd:
36 AC_CHECK_LIB(cmd, main)
37 dnl Replace `main' with a function in -lcom_err:
38 AC_CHECK_LIB(com_err, main)
39 dnl Replace `main' with a function in -lcrypt:
40 AC_CHECK_LIB(crypt, main)
41 dnl Replace `main' with a function in -lcrypto:
42 AC_CHECK_LIB(crypto, main)
43 dnl Replace `main' with a function in -ld:
44 AC_CHECK_LIB(d, main)
45 dnl Replace `main' with a function in -ldb:
46 AC_CHECK_LIB(db, main)
47 dnl Replace `main' with a function in -ldes:
48 AC_CHECK_LIB(des, main)
49 dnl Replace `main' with a function in -ldl:
50 AC_CHECK_LIB(dl, main)
51 dnl Replace `main' with a function in -lkauth:
52 AC_CHECK_LIB(kauth, main)
53 dnl Replace `main' with a function in -lkrb:
54 AC_CHECK_LIB(krb, main)
55 dnl Replace `main' with a function in -llwp:
56 AC_CHECK_LIB(lwp, main)
57 dnl Replace `main' with a function in -ln:
58 AC_CHECK_LIB(n, main)
59 dnl Replace `main' with a function in -lnsl:
60 AC_CHECK_LIB(nsl, main)
61 dnl Replace `main' with a function in -lprot:
62 AC_CHECK_LIB(prot, main)
63 dnl Replace `main' with a function in -lresolv:
64 AC_CHECK_LIB(resolv, main)
65 dnl Replace `main' with a function in -lrpcsvc:
66 AC_CHECK_LIB(rpcsvc, main)
67 dnl Replace `main' with a function in -lrx:
68 AC_CHECK_LIB(rx, main)
69 dnl Replace `main' with a function in -lrxkad:
70 AC_CHECK_LIB(rxkad, main)
71 dnl Replace `main' with a function in -lsocket:
72 AC_CHECK_LIB(socket, main)
73 dnl Replace `main' with a function in -lsys:
74 AC_CHECK_LIB(sys, main)
75 dnl Replace `main' with a function in -lubik:
76 AC_CHECK_LIB(ubik, main)
77
78 dnl Checks for header files.
79 AC_HEADER_DIRENT
80 AC_HEADER_STDC
81 AC_HEADER_SYS_WAIT
82 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
83
84 dnl --- check for openssl headers ... if so, add proper flags
85 AC_CHECK_HEADER(openssl/cast.h,
86         AC_DEFINE(OPENSSL_DHX,  1)
87         AC_DEFINE(UAM_DHX,      1)
88         AC_MSG_RESULT([including openssl libraries])
89         compile_dhx=yes
90 )
91
92 dnl Checks for typedefs, structures, and compiler characteristics.
93 AC_C_CONST
94 AC_TYPE_UID_T
95 AC_C_INLINE
96 AC_TYPE_MODE_T
97 AC_TYPE_OFF_T
98 AC_TYPE_PID_T
99 AC_TYPE_SIZE_T
100 AC_STRUCT_ST_RDEV
101 AC_HEADER_TIME
102 AC_STRUCT_TM
103
104 dnl Checks for library functions.
105 AC_TYPE_GETGROUPS
106 AC_PROG_GCC_TRADITIONAL
107 AC_FUNC_MEMCMP
108 AC_HEADER_MAJOR
109 AC_FUNC_MMAP
110 AC_TYPE_SIGNAL
111 AC_FUNC_UTIME_NULL
112 AC_FUNC_WAIT3
113 AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strstr strtoul)
114
115 dnl --------------------------------------------------------------------------
116 dnl specific configuration comes in here:
117 dnl --------------------------------------------------------------------------
118
119 AC_ARG_WITH(admin-group,
120         [  --with-admin-group=grp  enable and set administrative group],
121         admin_grp="$withval"
122         AC_DEFINE_UNQUOTED(ADMIN_GRP, "$admin_grp")
123         AC_MSG_RESULT([enabling administrative group "$admin_grp"]),
124 )
125
126 AC_ARG_WITH(auth-printing-dir,
127         [  --with-auth-printing-dir=path
128               path to authenticated printing directory],
129                 cap_dir="$withval"
130                 AC_DEFINE_UNQUOTED(CAPDIR, "$cap_dir")
131                 AC_DEFINE(USE_CAP)
132                 AC_MSG_RESULT([enabling authenticated printing support]),
133 )
134
135 AC_ARG_WITH(config-dir,
136         [  --with-config-dir=path  path to config files [default=/etc/atalk]],
137                 config_dir="$withval",
138                 config_dir="/etc/atalk"
139 )
140 AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
141         [path to config dir [default=/etc/atalk]])
142 CONFIG_DIR="$config_dir"
143 AC_SUBST(CONFIG_DIR)
144 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
145
146 AC_ARG_WITH(cracklib,
147         [  --with-cracklib=dict    enable/set location of cracklib dictionary],
148         cracklib="$withval"
149         AC_CHECK_LIB(crack, main,
150                 AC_DEFINE(USE_CRACKLIB) 
151                 LIBS="$LIBS -lcrack"
152                 AC_MSG_RESULT([enabling cracklib support])
153                 if test "$cracklib" = "yes"; then
154                         cracklib="/usr/lib/cracklib_dict"
155                 fi
156                 AC_DEFINE_UNQUOTED(_PATH_CRACKLIB, "$cracklib",
157                         [path to cracklib dictionary])
158                 AC_MSG_RESULT([setting cracklib dictionary to $cracklib]),
159                 AC_MSG_ERROR([cracklib not found!])
160         )
161 )
162
163 AC_ARG_ENABLE(ddp,
164         [  --disable-ddp           disable DDP],
165         if test "$enableval" = "no"; then 
166                 AC_DEFINE(NO_DDP, 1)
167                 AC_MSG_RESULT([disabling DDP])
168         fi
169 )
170
171 AC_ARG_ENABLE(debug,
172         [  --enable-debug          enable debug code],
173         if test "$enableval" != "no"; then
174                 if test "$enableval" = "yes"; then
175                         AC_DEFINE(DEBUG, 1)
176                 else
177                         AC_DEFINE_UNQUOTED(DEBUG, $enableval)
178                 fi 
179                 AC_MSG_RESULT([enabling debugging code])
180         else
181                 AC_DEFINE(DEBUG, 0)
182         fi
183 )
184
185
186 dnl ----------- A NOTE ABOUT DROPKLUDGE
187 dnl The trouble with this fix is that if you know what the file is called, it
188 dnl can be read from the Unix side.  That's okay for most academic institutions
189 dnl since the students don't have telnet access to the Mac servers.  There is
190 dnl currently no one working on further development/fixes of DROPKLUDGE.
191 dnl -----------
192
193 AC_ARG_ENABLE(dropkludge,
194         [  --enable-dropkludge    enable the experimental dropbox fix (INSECURE!) ],
195         AC_DEFINE(DROPKLUDGE, 1)
196         AC_MSG_RESULT([enabling experimental dropbox support])
197 )
198
199 msg_dir=""
200 AC_ARG_WITH(message-dir,
201         [  --with-msg-dir=path     path to message files [default=/etc/atalk/msg]],
202                 msg_dir="$withval"
203                 if test x"$msg_dir" = "x"; then
204                         msg_dir="$CONFIG_DIR/msg"
205                 fi
206                 AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
207                         [path to message dir [default=$CONFIG_DIR/msg]])
208                 SERVERTEXT="$msg_dir"
209                 AC_SUBST(SERVERTEXT)
210 )
211
212 AC_ARG_WITH(pam,
213         [  --with-pam              enable password authentication modules support],
214         AC_CHECK_LIB(pam, main,
215                 AC_DEFINE(USE_PAM)
216                 LIBS="$LIBS -lpam"
217                 AC_MSG_RESULT([enabling pam modules support])
218         )
219 )
220
221 AC_ARG_WITH(shadow,
222         [  --with-shadow           enable shadow password support],
223         AC_MSG_RESULT([enabling shadow password support])
224         AC_DEFINE(SHADOWPW)
225 )
226
227 AC_ARG_WITH(flock-locks,
228         [  --with-flock-locks      enable flock locks support],
229         AC_MSG_RESULT([enabling flock locks])
230         AC_DEFINE(USE_FLOCK_LOCKS)
231 )
232
233 AC_ARG_WITH(tcp-wrappers,
234         [  --with-tcp-wrappers     enable TCP wrappers support],
235         AC_CHECK_LIB(wrap, main,
236                 AC_DEFINE(TCPWRAP)
237                 LIBS="$LIBS -lwrap"
238                 AC_MSG_RESULT([enabling TCP wrappers support])
239         )
240 )
241
242 AC_ARG_WITH(uams-path,
243         [  --with-uams-path=path   path to UAMs [default=/etc/atalk/uams]],
244         uams_path="$withval",
245         uams_path="/etc/atalk/uams"
246 )
247 AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
248         [path to UAMs [default=/etc/atalk/uams]])
249 UAMS_PATH="$uams_path"
250 AC_SUBST(UAMS_PATH)
251
252 dnl --------------------------------------------------------------------------
253 dnl drop in includes for top level directory structures here...
254 dnl --------------------------------------------------------------------------
255 LIBS="$LIBS -L\$(top_srcdir)/libatalk/"
256 CFLAGS="$CFLAGS -I\$(top_srcdir)/include -I\$(top_srcdir)/sys"
257
258 dnl --------------------------------------------------------------------------
259 dnl specific configuration comes in here:
260 dnl --------------------------------------------------------------------------
261
262 dnl --------------------- determine operating system from "target"
263 case "$ac_cv_target_os" in
264         *freebsd*)                      this_os=freebsd ;;
265         *linux*)                        this_os=linux ;;
266         *openbsd*)                      this_os=openbsd ;;
267         *netbsd*)                       this_os=netbsd ;;
268         *solaris*)                      this_os=solaris ;;
269 esac
270
271 case "$ac_cv_target_cpu" in
272         i386|i486|i586|i686|k7)         this_cpu=x86 ;;
273         alpha)                          this_cpu=alpha ;;
274         mips)                           this_cpu=mips ;;
275         powerpc|ppc)                    this_cpu=ppc ;;
276 esac
277
278 dnl --------------------- operating system specific flags (port from sys/*)
279
280 dnl ----- FreeBSD specific -----
281 if test x"$this_os" = "xfreebsd"; then 
282         AC_MSG_RESULT([ * FreeBSD specific configuration])
283         AC_DEFINE(BSD4_4)
284         AC_DEFINE(SENDFILE_FLAVOR_BSD)
285 fi
286
287 dnl ----- Linux specific -----
288 if test x"$this_os" = "xlinux"; then 
289         AC_MSG_RESULT([ * Linux specific configuration])
290         AC_DEFINE(SENDFILE_FLAVOR_LINUX)
291
292         dnl ----- check if we need the quotactl wrapper
293         AC_CHECK_HEADER(sys/quota.h,,
294                 AC_MSG_RESULT([enabling quotactl wrapper])
295                 AC_DEFINE(NEED_QUOTACTL_WRAPPER)
296         )
297
298         dnl ----- Linux/alpha specific -----
299         if test x"$this_cpu" = "xalpha"; then 
300                 AC_MSG_RESULT([enabling gcc memcpy bug workaround])
301                 AC_DEFINE(HAVE_GCC_MEMCPY_BUG)
302         fi
303 fi
304
305 dnl ----- NetBSD specific -----
306 if test x"$this_os" = "xnetbsd"; then 
307         AC_MSG_RESULT([ * NetBSD specific configuration])
308         AC_DEFINE(BSD4_4)
309         AC_DEFINE(DLSYM_PREPEND_UNDERSCORE)
310         CFLAGS="-I\$(top_srcdir)/sys/netbsd -I/usr/include/kerberosIV $CFLAGS"
311 fi
312
313 dnl ----- OpenBSD specific -----
314 if test x"$this_os" = "xopenbsd"; then 
315         AC_MSG_RESULT([ * OpenBSD specific configuration])
316         AC_DEFINE(BSD4_4)
317 fi
318
319 dnl ----- Solaris specific -----
320 if test x"$this_os" = "xsolaris"; then 
321         AC_MSG_RESULT([ * Solaris specific configuration])
322         AC_DEFINE(__svr4__)
323         AC_DEFINE(_ISOC9X_SOURCE)
324         AC_DEFINE(NO_STRUCT_TM_GMTOFF)
325         AC_DEFINE(SOLARIS)
326 fi
327
328
329 dnl --------------------- last minute substitutions
330
331 AC_SUBST(LIBS)
332 AC_SUBST(CFLAGS)
333 AM_CONDITIONAL(USE_DHX, test x$compile_dhx = xyes)
334
335 dnl --------------------- generate files
336
337 AC_OUTPUT([Makefile
338         bin/Makefile
339         bin/adv1tov2/Makefile
340         bin/aecho/Makefile
341         bin/afile/Makefile
342         bin/afppasswd/Makefile
343         bin/getzones/Makefile
344         bin/megatron/Makefile
345         bin/nbp/Makefile
346         bin/pap/Makefile
347         bin/psorder/Makefile
348         config/Makefile
349         contrib/Makefile
350         contrib/nu/Makefile
351         contrib/printing/Makefile
352         contrib/shell_utils/Makefile
353         contrib/timelord/Makefile
354         distrib/Makefile
355         distrib/config/Makefile
356         distrib/config/netatalk-config
357         distrib/initscripts/Makefile
358         distrib/initscripts/rc.atalk.redhat
359         distrib/m4/Makefile
360         etc/Makefile
361         etc/afpd/Makefile
362         etc/afpd/nls/Makefile
363         etc/atalkd/Makefile
364         etc/uams/Makefile
365         etc/papd/Makefile
366         etc/psf/Makefile
367         include/Makefile
368         include/atalk/Makefile
369         libatalk/Makefile
370         libatalk/adouble/Makefile
371         libatalk/asp/Makefile
372         libatalk/atp/Makefile
373         libatalk/compat/Makefile
374         libatalk/dsi/Makefile
375         libatalk/nbp/Makefile
376         libatalk/netddp/Makefile
377         libatalk/util/Makefile
378         man/Makefile
379         man/man1/Makefile
380         man/man3/Makefile
381         man/man4/Makefile
382         man/man8/Makefile
383         sys/Makefile
384         sys/netatalk/Makefile
385         ],
386         [chmod a+x distrib/config/netatalk-config contrib/shell_utils/apple_*]
387 )
388