Fix clang build under mavericks (OSX 10.9)
[freeradius.git] / configure.in
1 dnl #############################################################
2 dnl #
3 dnl #  For information about autoconf, see:
4 dnl #
5 dnl #  http://www.gnu.org/software/autoconf/
6 dnl #
7 dnl #  The recommended order is:
8 dnl #
9 dnl #  AC_INIT(file)
10 dnl #  0. checks for compiler, libtool, and command line options
11 dnl #  1. checks for programs
12 dnl #  2. checks for libraries
13 dnl #  3. checks for header files
14 dnl #  4. checks for typedefs
15 dnl #  5. checks for structures and functions
16 dnl #  6. checks for compiler characteristics
17 dnl #  7. checks for library functions
18 dnl #  8. checks for system services
19 dnl #  AC_OUTPUT([file...])
20 dnl #
21 dnl #############################################################
22
23 AC_PREREQ([2.59])
24 export CFLAGS LIBS LDFLAGS CPPFLAGS
25
26 m4_define(PACKAGE_MAIN, freeradius)
27
28 AC_INIT(src/main/radiusd.c)
29 AC_CONFIG_HEADER(src/include/autoconf.h)
30
31 dnl # The version of the software
32
33 RADIUSD_MAJOR_VERSION=`cat VERSION | sed 's/\..*//'`
34 RADIUSD_MINOR_VERSION=`cat VERSION | sed 's/^[[^\.]]*\.//' | sed 's/\..*$//'`
35 RADIUSD_INCRM_VERSION=`cat VERSION | sed 's/^.*\..*\.//' | sed 's/[[\.-]].*$//'`
36
37 RADIUSD_VERSION=`echo | awk -v major="$RADIUSD_MAJOR_VERSION" \
38 -v minor="$RADIUSD_MINOR_VERSION" \
39 -v incrm="$RADIUSD_INCRM_VERSION" \
40 '{ printf "%02i%02i%02i", major, minor, incrm }'`
41
42 dnl # Still useful for custom builds
43 RADIUSD_VERSION_STRING=`cat VERSION`
44 PACKAGE=PACKAGE_MAIN
45
46 dnl #############################################################
47 dnl #
48 dnl #  0. Checks for compiler, libtool, and command line options.
49 dnl #
50 dnl #############################################################
51
52 dnl Get system information
53 AC_CANONICAL_SYSTEM
54
55 dnl #
56 dnl #  As of OSX 10.9 (Mavericks), /usr is no longer populated with the
57 dnl #  standard set of headers and libraries, instead were meant to use
58 dnl #  one of the SDKs which contains system headers and libraries for
59 dnl #  different versions of OSX and iOS.
60 dnl #
61 case "$host" in
62   *-darwin*)
63     dnl #
64     dnl #  The version of GCC apple ships with Mavericks works out of the
65     dnl #  box, and presumably selects the highest version SDK for OSX.
66     dnl #
67     AC_MSG_CHECKING([if cc is apple llvm])
68     if ! $CC --version 2>&1 | grep -I 'Apple LLVM' > /dev/null; then
69       AC_MSG_RESULT(no)
70       AC_CHECK_PROG(SW_VERS, sw_vers, yes, no)
71       AC_CHECK_PROG(XCODEBUILD, xcodebuild, yes, no)
72
73       if test "x$SW_VERS" = "xyes" && test "x$XCODEBUILD" = "xyes"; then
74         AC_MSG_NOTICE([determining OSX SDK path])
75         osx_sdk_path=$(xcodebuild -version -sdk macosx$(sw_vers -productVersion) Path)
76         AC_MSG_RESULT([$osx_sdk_path])
77
78         dnl #
79         dnl #  We need to export these, else the child configure scripts all fail
80         dnl #  their compiler checks.
81         dnl #
82         export CFLAGS="--sysroot=$osx_sdk_path $CFLAGS"
83         export CPPFLAGS="--sysroot=$osx_sdk_path $CPPFLAGS"
84         export LDFLAGS="-L$osx_sdk_path/usr/lib/ $LDFLAGS"
85       fi
86     else
87       AC_MSG_RESULT(yes)
88     fi
89     ;;
90 esac
91
92 dnl Check for GNU cc
93 AC_PROG_CC
94 AC_PROG_CXX
95
96 dnl #
97 dnl # check for AIX, to allow us to use some BSD functions
98 dnl # must be before macros that call the compiler.
99 dnl #
100 AC_AIX
101
102 AC_PROG_GCC_TRADITIONAL
103 AC_PROG_CC_SUNPRO
104 AC_PROG_RANLIB
105
106 dnl #
107 dnl # Set Default CFLAGS
108 dnl #
109 if test "x$GCC" = "xyes"; then
110     CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
111 fi
112
113 dnl Compile in large (2G+) file support.
114 AC_SYS_LARGEFILE
115
116 dnl # check for system bytesex
117 dnl # AC_DEFINES WORDS_BIGENDIAN
118 AC_C_BIGENDIAN
119
120 dnl Find GNU Make.
121 AC_CHECK_PROG(GMAKE, gmake, yes, no)
122 if test $GMAKE = no; then
123   AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
124 else
125   AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
126 fi
127 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
128 if test -z "$makever"; then
129   AC_MSG_ERROR(GNU Make is not installed.  Please download and install it
130                 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
131 fi
132
133 dnl See if we have Git.
134 AC_CHECK_PROG(GIT, git, yes, no)
135
136 AC_ARG_WITH(system-libltdl,
137 [  --with-system-libltdl   Use the libltdl installed in your system (default=use our own)],
138 [
139 LIBLTDL="-lltdl"
140 INCLTDL=-DWITH_SYSTEM_LTDL
141 LTDL_SUBDIRS=
142 ],
143 [
144 dnl If libltdl isn't installable, set it to be installable.
145 [test x"$enable_ltdl_install" = x && enable_ltdl_install=yes]
146 AC_LIBLTDL_INSTALLABLE
147
148 dnl tell Makefile to build ltdl if needed
149 if test x"$enable_ltdl_install" = x"yes"; then
150   LTDL_SUBDIRS=libltdl
151 fi
152 ])
153 AC_SUBST(LTDL_SUBDIRS)
154
155 dnl use system-wide libtool, if it exists
156 AC_ARG_WITH(system-libtool,
157 [  --with-system-libtool   Use the libtool installed in your system (default=use our own)],
158 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) AC_LIBTOOL_DLOPEN
159  AC_PROG_LIBTOOL],
160 [
161   LIBTOOL="`pwd`/libtool"
162   AC_SUBST(LIBTOOL)
163   dnl ensure that we're looking for dlopen
164   AC_LIBTOOL_DLOPEN
165
166   dnl Figure out how to build shared libraries
167   AC_PROG_LIBTOOL
168 ])
169
170
171 dnl Put this in later, when all distributed modules use autoconf.
172 dnl AC_ARG_WITH(disablemodulefoo,
173 dnl [  --without-rlm_foo       Disables module compilation.  Module list:]
174 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
175 dnl     sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
176 dnl     awk '{print "                            "$0}']))
177
178 AC_ARG_ENABLE(strict-dependencies,
179 [  --enable-strict-dependencies  Fail configure on lack of module dependancy.])
180
181 dnl extra argument: --with-docdir
182 docdir='${datadir}/doc/freeradius'
183 AC_MSG_CHECKING(docdir)
184 AC_ARG_WITH(docdir,
185 [  --with-docdir=DIR       Directory for documentation [DATADIR/doc/freeradius] ],
186 [ case "$withval" in
187     no)
188         docdir=no
189         ;;
190     yes)
191         ;;
192     [[\\/$]]* | ?:[[\\/]]* )
193         docdir="$withval"
194         ;;
195     *)
196         AC_MSG_ERROR([expected an absolute directory name for --with-docdir: $withval])
197         ;;
198   esac ]
199 )
200 AC_SUBST(docdir)
201 AC_MSG_RESULT($docdir)
202 if test "x$docdir" = xno; then
203         AC_MSG_WARN(Documentation files will NOT be installed.)
204 fi
205
206 dnl extra argument: --with-logdir
207 logdir='${localstatedir}/log/radius'
208 AC_MSG_CHECKING(logdir)
209 AC_ARG_WITH(logdir,
210 [  --with-logdir=DIR       Directory for logfiles [LOCALSTATEDIR/log/radius] ],
211 [ case "$withval" in
212     no)
213         AC_MSG_ERROR(Need logdir)
214         ;;
215     yes)
216         ;;
217     [[\\/$]]* | ?:[[\\/]]* )
218         logdir="$withval"
219         ;;
220     *)
221         AC_MSG_ERROR([expected an absolute directory name for --with-logdir: $withval])
222         ;;
223   esac ]
224 )
225 AC_SUBST(logdir)
226 AC_MSG_RESULT($logdir)
227
228 dnl extra argument: --with-radacctdir
229 radacctdir='${logdir}/radacct'
230 AC_MSG_CHECKING(radacctdir)
231 AC_ARG_WITH(radacctdir,
232 [  --with-radacctdir=DIR   Directory for detail files [LOGDIR/radacct] ],
233 [ case "$withval" in
234     no)
235         AC_MSG_ERROR(Need radacctdir)
236         ;;
237     yes)
238         ;;
239     [[\\/$]]* | ?:[[\\/]]* )
240         radacctdir="$withval"
241         ;;
242     *)
243         AC_MSG_ERROR([expected an absolute directory name for --with-radacctdir: $withval])
244         ;;
245   esac ]
246 )
247 AC_SUBST(radacctdir)
248 AC_MSG_RESULT($radacctdir)
249
250 dnl extra argument: --with-raddbdir
251 raddbdir='${sysconfdir}/raddb'
252 AC_MSG_CHECKING(raddbdir)
253 AC_ARG_WITH(raddbdir,
254 [  --with-raddbdir=DIR     Directory for config files [SYSCONFDIR/raddb] ],
255 [ case "$withval" in
256     no)
257         AC_MSG_ERROR(Need raddbdir)
258         ;;
259     yes)
260         ;;
261     [[\\/$]]* | ?:[[\\/]]* )
262         raddbdir="$withval"
263         ;;
264     *)
265         AC_MSG_ERROR([expected an absolute directory name for --with-raddbdir: $withval])
266         ;;
267   esac ]
268 )
269 AC_SUBST(raddbdir)
270 AC_MSG_RESULT($raddbdir)
271
272 dnl extra argument: --with-ascend-binary
273 ASCEND_BINARY=yes
274 AC_ARG_WITH(ascend-binary,
275 [  --with-ascend-binary    Include support for Ascend binary filter attributes (default=yes)],
276 [ case "$withval" in
277     yes)
278         ;;
279     *)
280         ASCEND_BINARY=""
281   esac ]
282 )
283 if test "X$ASCEND_BINARY" = "Xyes"; then
284   AC_DEFINE(ASCEND_BINARY, [], [Include support for Ascend binary filter attributes])
285 fi
286
287 dnl extra argument: --with-threads
288 WITH_THREADS=yes
289 AC_ARG_WITH(threads,
290 [  --with-threads          Use threads, if available.  (default=yes) ],
291 [ case "$withval" in
292     yes)
293         ;;
294     *)
295         WITH_THREADS=""
296   esac ]
297 )
298
299 dnl extra argument: --with-vmps
300 WITH_VMPS=yes
301 AC_ARG_WITH(vmps,
302 [  --with-vmps             Compile in VMPS support. (default=yes)],
303 [ case "$withval" in
304     yes)
305         ;;
306     *)
307         WITH_VMPS=no
308   esac ]
309 )
310 if test "x$WITH_VMPS" = "xyes"; then
311         AC_DEFINE(WITH_VMPS, [1], [define if you want VMPS support])
312 fi
313
314 dnl extra argument: --with-dhcp
315 WITH_DHCP=yes
316 AC_ARG_WITH(dhcp,
317 [  --with-dhcp             Compile in DHCP support. (default=yes)],
318 [ case "$withval" in
319     yes)
320         ;;
321     *)
322         WITH_DHCP=no
323   esac ]
324 )
325 if test "x$WITH_DHCP" = "xyes"; then
326         AC_DEFINE(WITH_DHCP, [1], [define if you want DHCP support])
327 fi
328
329
330 dnl extra argument: --with-post-proxy-authorize
331 WITH_POST_PROXY_AUTHORIZE=
332 AC_ARG_WITH(post-proxy-authorize,
333 [  --with-post-proxy-authorize  1.x compatibility  (default=no) ],
334 [ case "$withval" in
335     yes)
336         WITH_POST_PROXY_AUTHORIZE=""
337         ;;
338     *)
339         ;;
340   esac ]
341 )
342
343 dnl #
344 dnl #  Allow the user to specify a list of modules to be linked
345 dnl #  statically to the server.
346 dnl #
347 STATIC_MODULES=
348 AC_ARG_WITH(static_modules,
349 [  --with-static-modules=QUOTED-MODULE-LIST],[
350   for i in $withval; do
351     STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
352   done
353 ])
354
355 MODULES=
356 AC_ARG_WITH(modules,
357 [ --with-modules=QUOTED-MODULE-LIST],[
358  for i in $withval; do
359    MODULES="$MODULES $i"
360  done
361 ])
362
363 dnl #
364 dnl #  Enable developer C compiler warnings
365 dnl #
366 AC_ARG_ENABLE(developer,
367 [  --enable-developer               Enables features of interest to developers.],
368 [ case "$enableval" in
369     no)
370         developer=no
371         ;;
372     *)
373         developer=yes
374   esac ]
375 )
376
377 if test -d $srcdir/.git; then
378   if test "x$developer" != "xno"; then
379     dnl turn on the developer flag when taken from a git checkout (not a release)
380     developer="yes"
381   fi
382
383   dnl append the current git hash onto the version string
384   if test "x$GIT" = "xyes"; then
385         RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
386   fi
387 fi
388
389 dnl extra argument: --with-experimental-modules
390 EXPERIMENTAL=
391 AC_ARG_WITH(experimental-modules,
392 [  --with-experimental-modules      Use experimental and unstable modules. (default=no) ],
393 [ case "$withval" in
394     yes)
395         EXPERIMENTAL=yes
396         ;;
397     *)
398   esac ]
399 )
400
401 dnl extra argument: --with-openssl
402 WITH_OPENSSL=yes
403 AC_ARG_WITH(openssl,
404 [  --with-openssl                   Use OpenSSL. (default=yes)],
405 [ case "$withval" in
406     no)
407         WITH_OPENSSL=no
408         ;;
409     *)
410         WITH_OPENSSL=yes
411         ;;
412   esac ]
413 )
414
415 dnl #
416 dnl # extra argument: --with-openssl-includes=dir
417 dnl #
418 OPENSSL_INCLUDE_DIR=
419 AC_ARG_WITH(openssl-includes,
420 [  --with-openssl-includes=DIR      Directory to look for OpenSSL include files],
421 [ case "$withval" in
422     *) OPENSSL_INCLUDE_DIR="$withval"
423         ;;
424   esac ]
425 )
426
427 dnl #
428 dnl # extra argument: --with-openssl-libraries=dir
429 dnl #
430 OPENSSL_LIB_DIR=
431 AC_ARG_WITH(openssl-libraries,
432 [  --with-openssl-libraries=DIR     Directory to look for OpenSSL library files],
433 [ case "$withval" in
434     *) OPENSSL_LIB_DIR="$withval"
435         ;;
436   esac ]
437 )
438
439 dnl #
440 dnl #  These next two arguments don't actually do anything.  They're
441 dnl #  place holders so that the top-level configure script can tell
442 dnl #  the user how to configure lower-level modules
443 dnl #
444
445 dnl #
446 dnl # extra argument: --with-rlm-FOO-lib-dir
447 dnl #
448 AC_ARG_WITH(rlm-FOO-lib-dir,
449 [  --with-rlm-FOO-lib-dir=DIR       Directory to look for library files used by module FOO],
450 [ case "$withval" in
451     *)
452         ;;
453   esac ]
454 )
455
456 dnl #
457 dnl # extra argument: --with-rlm-FOO-include-dir
458 dnl #
459 AC_ARG_WITH(rlm-FOO-include-dir,
460 [  --with-rlm-FOO-include-dir=DIR   Directory to look for include files used by module FOO],
461 [ case "$withval" in
462     *)
463         ;;
464   esac ]
465 )
466
467 dnl See what include-style is used by the make program.
468 dnl AC_MSG_CHECKING(include style for make)
469 dnl echo "include /dev/null" > testmake.$$
470 dnl echo "all:" >> testmake.$$
471 dnl make -f testmake.$$ >/dev/null 2>&1
472 dnl if test $? = 0
473 dnl then
474 dnl     INCLUDE=include
475 dnl     IQUOTE=
476 dnl else
477 dnl     INCLUDE=.include
478 dnl     IQUOTE='"'
479 dnl fi
480 dnl rm -f testmake.$$
481 dnl AC_MSG_RESULT(" $INCLUDE")
482 dnl AC_SUBST(INCLUDE)
483 dnl AC_SUBST(IQUOTE)
484
485 dnl extra argument: --with-udpfromto
486 WITH_UDPFROMTO=no
487 AC_ARG_WITH(udpfromto,
488 [  --with-udpfromto        Compile in UDPFROMTO support. (default=no)],
489 [ case "$withval" in
490     yes)
491         WITH_UDPFROMTO=yes
492         ;;
493     *)
494         WITH_UDPFROMTO=no
495   esac ]
496 )
497
498 if test "x$WITH_UDPFROMTO" = "xyes"; then
499         AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
500 fi
501
502 dnl #############################################################
503 dnl #
504 dnl #  1. Checks for programs
505 dnl #
506 dnl #############################################################
507
508 CHECKRAD=checkrad.pl
509 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
510 if test "x$ac_cv_path_PERL" = "x"; then
511   AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
512 fi
513 AC_PATH_PROG(SNMPGET, snmpget)
514 if test "x$ac_cv_path_SNMPGET" = "x"; then
515   AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
516 fi
517
518 AC_PATH_PROG(SNMPWALK, snmpwalk)
519 if test "x$ac_cv_path_SNMPWALK" = "x"; then
520   AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
521 fi
522
523 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
524
525 dnl FIXME This is truly gross.
526 missing_dir=`cd $ac_aux_dir && pwd`
527 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
528 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
529 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
530
531 AC_PATH_PROG(LOCATE,locate)
532 AC_PATH_PROG(DIRNAME,dirname)
533 AC_PATH_PROG(GREP,grep)
534
535 dnl #############################################################
536 dnl #
537 dnl #  2. Checks for libraries
538 dnl #
539 dnl #############################################################
540
541 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
542 old_CFLAGS=$CFLAGS
543 if test "x$WITH_THREADS" = "xyes"; then
544   if test $ac_cv_prog_suncc = "yes"; then
545     CFLAGS="$CFLAGS -mt"
546   fi
547
548   AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
549
550 dnl #
551 dnl # pthread stuff is usually in -lpthread
552 dnl # or in -lc_r, on *BSD
553 dnl #
554 dnl # On Some systems, we need extra pre-processor flags, to get them to
555 dnl # to do the threading properly.
556 dnl #
557   AC_CHECK_LIB(pthread, pthread_create,
558                 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
559                   LIBS="-lpthread $LIBS" ],
560                 AC_CHECK_LIB(c_r, pthread_create,
561                             [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
562                             [ WITH_THREADS="no" ]
563                             )
564                 )
565 fi
566
567 dnl #
568 dnl # If we have NO pthread libraries, remove any knowledge of threads.
569 dnl #
570 if test "x$WITH_THREADS" != "xyes"; then
571   CFLAGS=$old_CFLAGS
572   ac_cv_header_pthread_h="no"
573   WITH_THREADS=no
574 else
575   dnl #
576   dnl #  We need sem_init() and friends, as they're the friendliest
577   dnl #  semaphore functions for threading.
578   dnl #
579   dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
580   dnl # Some systems have them in -lsem
581   dnl # Solaris has them in -lposix4
582   dnl # NetBSD has them in -lsemaphore
583
584   AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
585         [],
586         [AC_MSG_ERROR(-lsem not found.  You may want to download it from ftp://ftp.to.gd-es.com/pub/BSDI/libsem.tar.bz2 or ftp://ftp.freeradius.org/pub/radius/contrib/libsem.tar.gz)]
587    )
588 fi
589
590 dnl Check if we need -lsocket
591 AC_CHECK_LIB(socket, getsockname)
592
593 dnl Check for -lresolv
594 dnl This library may be needed later.
595 AC_CHECK_LIB(resolv, inet_aton)
596
597 dnl Check if we need -lnsl. Usually if we want to
598 dnl link against -lsocket we need to include -lnsl as well.
599 AC_CHECK_LIB(nsl, inet_ntoa)
600
601 dnl Check for OpenSSL libraries.
602 OPENSSL_LIBS=
603 if test "x$WITH_OPENSSL" = xyes; then
604   old_LIBS=$LIBS
605   old_LDFLAGS="$LDFLAGS"
606   if test "x$OPENSSL_LIB_DIR" != "x"; then
607     LDFLAGS="$LDFLAGS -L$OPENSSL_LIB_DIR"
608   fi
609   AC_CHECK_LIB(crypto, DH_new,
610     [
611         LIBS="-lcrypto $LIBS"
612         AC_DEFINE(HAVE_LIBCRYPTO, 1,
613             [Define to 1 if you have the `crypto' library (-lcrypto).])
614         AC_CHECK_LIB(ssl, SSL_new,
615             [
616                 AC_DEFINE(HAVE_LIBSSL, 1,
617                     [Define to 1 if you have the `ssl' library (-lssl).])
618                 if test "x$OPENSSL_LIB_DIR" != "x"; then
619                     OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
620                 fi
621                 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
622             ], [])
623     ], [])
624   LIBS=$old_LIBS
625   LDFLAGS="$old_LDFLAGS"
626 fi
627
628 AC_CHECK_LIB(ws2_32, htonl)
629
630 dnl Check the pcap library for the RADIUS sniffer.
631 PCAP_LIBS=
632 AC_CHECK_LIB(pcap, pcap_open_live,
633         [ PCAP_LIBS="-lpcap"
634         AC_DEFINE(HAVE_LIBPCAP, 1,
635                 [Define to 1 if you have the `pcap' library (-lpcap).])
636         ],
637         [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ])
638
639 AC_LIB_READLINE
640
641 dnl #############################################################
642 dnl #
643 dnl #  3. Checks for header files
644 dnl #
645 dnl #############################################################
646
647 dnl #
648 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
649 dnl # getopt will be #included, but won't link.  <sigh>
650 dnl #
651 dnl #
652 case "$host" in
653 *-interix*)
654         CFLAGS="$CFLAGS -D_ALL_SOURCE"
655         ;;
656 *-darwin*)
657         CFLAGS="$CFLAGS -DDARWIN"
658         LIBS="-framework DirectoryService $LIBS"
659         ;;
660 esac
661
662 AC_HEADER_DIRENT
663 AC_HEADER_STDC
664 AC_HEADER_TIME
665 AC_HEADER_SYS_WAIT
666
667 AC_CHECK_HEADERS( \
668         unistd.h \
669         crypt.h \
670         errno.h \
671         resource.h \
672         sys/resource.h \
673         getopt.h \
674         malloc.h \
675         utmp.h \
676         utmpx.h \
677         signal.h \
678         sys/select.h \
679         syslog.h \
680         inttypes.h \
681         stdint.h \
682         stdio.h \
683         netdb.h \
684         semaphore.h \
685         arpa/inet.h \
686         netinet/in.h \
687         sys/types.h \
688         sys/socket.h \
689         winsock.h \
690         sys/time.h \
691         sys/wait.h \
692         sys/security.h \
693         fcntl.h \
694         sys/fcntl.h \
695         sys/prctl.h \
696         sys/un.h \
697         glob.h \
698         prot.h \
699         pwd.h \
700         grp.h \
701         stddef.h \
702         fnmatch.h \
703         sia.h \
704         siad.h
705 )
706
707 dnl FreeBSD requires sys/socket.h before net/if.h
708 AC_CHECK_HEADERS(net/if.h, [], [],
709 [#ifdef HAVE_SYS_SOCKET_H
710 # include <sys/socket.h>
711 # endif
712 ])
713
714 REGEX=no
715 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
716 if test "x$ac_cv_header_regex_h" = "xyes"; then
717   REGEX_EXTENDED=no
718   REGEX=yes
719   AC_EGREP_CPP(yes,
720     [#include <regex.h>
721      #ifdef REG_EXTENDED
722        yes
723      #endif
724      ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
725 fi
726 AC_SUBST(REGEX)
727 AC_SUBST(REGEX_EXTENDED)
728
729 dnl #
730 dnl #  other checks which require headers
731 dnl #
732 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
733 then
734   AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
735 fi
736
737 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
738 then
739   AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
740 fi
741
742 dnl Check for OpenSSL includes.
743 OPENSSL_INCLUDE="-DNO_OPENSSL"
744 if test "x$WITH_OPENSSL" = xyes; then
745   if test "x$OPENSSL_LIBS" = "x"; then
746     AC_MSG_NOTICE([skipping test for openssl/ssl.h])
747   else
748     old_CPPFLAGS=$CPPFLAGS
749     if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
750         CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
751     fi
752     dnl # stupid RedHat shit
753     CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
754     AC_CHECK_HEADERS( \
755         openssl/ssl.h \
756         openssl/crypto.h \
757         openssl/err.h \
758         openssl/evp.h \
759         openssl/ocsp.h \
760         openssl/engine.h,
761         [],
762         OPENSSL_LIBS=
763     )
764     if test "x$OPENSSL_LIBS" != "x"; then
765         AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
766         AC_EGREP_CPP(yes,
767             [#include <openssl/crypto.h>
768              #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
769              yes
770              #endif
771             ], goodssl="yes")
772         if test "x$goodssl" != "xyes"; then
773             AC_MSG_RESULT(no)
774             OPENSSL_LIBS=
775         else
776             AC_MSG_RESULT(yes)
777             if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
778                 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
779             else
780                 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
781             fi
782         fi
783     fi
784     CPPFLAGS=$old_CPPFLAGS
785   fi
786 fi
787 AC_SUBST(OPENSSL_INCLUDE)
788 AC_SUBST(OPENSSL_LIBS)
789 export OPENSSL_LIBS
790
791 dnl Check the pcap includes for the RADIUS sniffer.
792 if test "x$PCAP_LIBS" = x; then
793     AC_MSG_NOTICE([skipping test for pcap.h.])
794 else
795     AC_CHECK_HEADER(pcap.h,
796         AC_DEFINE(HAVE_PCAP_H, 1,
797                 [Define to 1 if you have the <pcap.h> header file.]),
798         [ PCAP_LIBS=
799         AC_MSG_WARN([pcap.h not found, silently disabling the RADIUS sniffer.])
800         ])
801
802     AC_CHECK_LIB(pcap, pcap_fopen_offline,
803         [ AC_DEFINE(HAVE_PCAP_FOPEN_OFFLINE, 1,
804                 [Define to 1 if you have the function pcap_fopen_offline.])
805         ])
806     AC_CHECK_LIB(pcap, pcap_dump_fopen,
807         [ AC_DEFINE(HAVE_PCAP_DUMP_FOPEN, 1,
808                 [Define to 1 if you have the function pcap_dump_fopen.])
809         ])
810 fi
811 AC_SUBST(PCAP_LIBS)
812
813 dnl #############################################################
814 dnl #
815 dnl #  4. Checks for typedefs
816 dnl #
817 dnl #############################################################
818
819 dnl #
820 dnl # Ensure that these are defined
821 dnl #
822 AC_TYPE_OFF_T
823 AC_TYPE_PID_T
824 AC_TYPE_SIZE_T
825 AC_TYPE_UID_T
826
827 dnl check for socklen_t
828 FR_CHECK_TYPE_INCLUDE([
829 #ifdef HAVE_SYS_TYPES_H
830 #include <sys/types.h>
831 #endif
832 #ifdef HAVE_SYS_SOCKET_H
833 #include <sys/socket.h>
834 #endif
835 ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
836
837 dnl check for uint8_t
838 FR_CHECK_TYPE_INCLUDE([
839 #ifdef HAVE_INTTYPES_H
840 #include <inttypes.h>
841 #endif
842 #ifdef HAVE_STDINT_H
843 #include <stdint.h>
844 #endif
845 ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
846
847 dnl check for uint16_t
848 FR_CHECK_TYPE_INCLUDE([
849 #ifdef HAVE_INTTYPES_H
850 #include <inttypes.h>
851 #endif
852 #ifdef HAVE_STDINT_H
853 #include <stdint.h>
854 #endif
855 ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
856
857 dnl check for uint32_t
858 FR_CHECK_TYPE_INCLUDE([
859 #ifdef HAVE_INTTYPES_H
860 #include <inttypes.h>
861 #endif
862 #ifdef HAVE_STDINT_H
863 #include <stdint.h>
864 #endif
865 ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
866
867 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
868 #ifdef HAVE_NETINET_IN_H
869 #include <netinet/in.h>
870 #endif
871 ])
872
873 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
874 #ifdef HAVE_NETINET_IN_H
875 #include <netinet/in.h>
876 #endif
877 #ifdef HAVE_SYS_SOCKET_H
878 #include <sys/socket.h>
879 #endif
880 ])
881
882 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
883 #ifdef HAVE_NETINET_IN_H
884 #include <netinet/in.h>
885 #endif
886 ])
887
888 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
889 #ifdef HAVE_SYS_TYPES_H
890 #include <sys/types.h>
891 #endif
892 #ifdef HAVE_SYS_SOCKET_H
893 #include <sys/socket.h>
894 #endif
895 #ifdef HAVE_NETDB_H
896 #include <netdb.h>
897 #endif
898 ])
899
900 dnl #############################################################
901 dnl #
902 dnl #  5. Checks for structures and functions
903 dnl #
904 dnl #############################################################
905 AC_CHECK_FUNCS( \
906         getopt_long \
907         lockf \
908         strsignal \
909         sigaction \
910         sigprocmask \
911         pthread_sigmask \
912         snprintf \
913         vsnprintf \
914         setsid \
915         strncasecmp \
916         strcasecmp \
917         localtime_r \
918         ctime_r \
919         gmtime_r \
920         strsep \
921         inet_aton \
922         inet_pton \
923         inet_ntop \
924         setlinebuf \
925         setvbuf \
926         getusershell \
927         initgroups \
928         getaddrinfo \
929         getnameinfo \
930         closefrom \
931         gettimeofday \
932         getpeereid \
933         setuid \
934         setresuid \
935         getresuid \
936         strlcat \
937         strlcpy
938 )
939 RADIUSD_NEED_DECLARATIONS( \
940         crypt \
941         strncasecmp \
942         strcasecmp \
943         inet_aton \
944         setlinebuf \
945         getusershell \
946         endusershell
947 )
948
949 AC_TYPE_SIGNAL
950
951 dnl # check if we have utmpx.h
952 dnl # if so, check if struct utmpx has entry ut_xtime
953 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
954 if test "x$ac_cv_header_utmpx_h" = "xyes"
955 then
956  FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
957  if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
958  then
959    AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
960  fi
961 fi
962
963 dnl # struct ip_pktinfo
964 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
965 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
966 then
967         AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
968 fi
969
970 dnl # struct in6_pktinfo
971 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
972 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
973 then
974         AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
975 fi
976
977 dnl #############################################################
978 dnl #
979 dnl #  6. Checks for compiler characteristics
980 dnl #
981 dnl #############################################################
982
983 dnl #
984 dnl # Ensure that these are defined
985 dnl #
986 AC_C_CONST
987
988 dnl #
989 dnl # See if this is OS/2
990 dnl #
991 AC_MSG_CHECKING(type of OS)
992 OS=`uname -s`
993 AC_MSG_RESULT($OS)
994 if test "$OS" = "OS/2"; then
995         LIBPREFIX=
996 else
997         LIBPREFIX=lib
998 fi
999 AC_SUBST(LIBPREFIX)
1000
1001 AC_MSG_CHECKING(for developer gcc flags)
1002 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
1003   devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef"
1004   CFLAGS="$CFLAGS $devflags"
1005   INSTALLSTRIP=""
1006   AC_MSG_RESULT(yes.  Using $devflags)
1007 else
1008   devflags=""
1009   CFLAGS="$CFLAGS -DNDEBUG"
1010   INSTALLSTRIP=""
1011   AC_MSG_RESULT(no.)
1012 fi
1013
1014 FR_TLS
1015
1016 dnl #############################################################
1017 dnl #
1018 dnl #  7. Checks for library functions
1019 dnl #
1020 dnl #############################################################
1021
1022 old_LIBS="$LIBS"
1023 LIBS="$LIBS $LIBLTDL"
1024 AC_CHECK_FUNC(lt_dladvise_init, AC_DEFINE(HAVE_LT_DLADVISE_INIT, [], [Do we have the lt_dladvise_init function]))
1025 LIBS="$old_LIBS"
1026
1027 dnl Check for libcrypt
1028 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
1029 AC_CHECK_LIB(crypt, crypt,
1030   CRYPTLIB="-lcrypt"
1031 )
1032 if test "$CRYPTLIB" != ""; then
1033   AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
1034 else
1035   AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
1036 fi
1037
1038 dnl Check for libcipher
1039 AC_CHECK_LIB(cipher, setkey,
1040    CRYPTLIB="${CRYPTLIB} -lcipher"
1041 )
1042 AC_SUBST(CRYPTLIB)
1043
1044 dnl Check the style of gethostbyaddr, in order of preference
1045 dnl GNU (_r eight args)
1046 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
1047 dnl SYSV (_r six args)
1048 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
1049 dnl BSD (three args, may not be thread safe)
1050 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
1051 dnl Tru64 has BSD version, but it is thread safe
1052 dnl     http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
1053 dnl We need #stdio.h to define NULL on FreeBSD (at least)
1054 gethostbyaddrrstyle=""
1055 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
1056 case "$host" in
1057 *-freebsd*)
1058 dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r.
1059 dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we
1060 dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU
1061 dnl style support.
1062         AC_CHECK_DECLS([gethostbyaddr_r], [], [
1063                 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE,
1064                         [style of gethostbyaddr_r functions ])
1065                 gethostbyaddrrstyle=BSD
1066                 AC_MSG_WARN([FreeBSD overridden to BSD-style])
1067         ], [
1068 #ifdef HAVE_NETDB_H
1069 #include <netdb.h>
1070 #endif
1071 ])
1072         ;;
1073 esac
1074 if test "x$gethostbyaddrrstyle" = "x"; then
1075         AC_TRY_LINK([
1076 #include <stdio.h>
1077 #include <netdb.h>
1078 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
1079         AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
1080         gethostbyaddrrstyle=GNU
1081 ])
1082 fi
1083 if test "x$gethostbyaddrrstyle" = "x"; then
1084         AC_TRY_LINK([
1085 #include <stdio.h>
1086 #include <netdb.h>
1087 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
1088                 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
1089                 gethostbyaddrrstyle=SYSV
1090         ])
1091 fi
1092 if test "x$gethostbyaddrrstyle" = "x"; then
1093         AC_TRY_LINK([
1094 #include <stdio.h>
1095 #include <netdb.h>
1096 ], [ gethostbyaddr(NULL, 0, 0)  ], [
1097                 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
1098                 gethostbyaddrrstyle=BSD
1099         ])
1100 fi
1101
1102 if test "x$gethostbyaddrrstyle" = "x"; then
1103         AC_MSG_RESULT([none!  It must not exist, here.])
1104 else
1105         AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
1106 fi
1107
1108 if test "x$gethostbyaddrrstyle" = "xBSD"; then
1109         AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
1110 fi
1111
1112 dnl Check the style of gethostbyname, in order of preference
1113 dnl GNU (_r seven args)
1114 dnl SYSV (_r five args)
1115 dnl BSD (two args, may not be thread safe)
1116 dnl Tru64 has BSD version, but it _is_ thread safe
1117 dnl     http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
1118 dnl We need #stdio.h to define NULL on FreeBSD (at least)
1119 gethostbynamerstyle=""
1120 AC_MSG_CHECKING([gethostbyname_r() syntax])
1121 AC_TRY_LINK([
1122 #include <stdio.h>
1123 #include <netdb.h>
1124 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
1125         AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
1126         gethostbynamerstyle=GNU
1127 ])
1128 if test "x$gethostbynamerstyle" = "x"; then
1129         AC_TRY_LINK([
1130 #include <stdio.h>
1131 #include <netdb.h>
1132 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
1133                 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
1134                 gethostbynamerstyle=SYSV
1135         ])
1136 fi
1137 if test "x$gethostbynamerstyle" = "x"; then
1138         AC_TRY_LINK([
1139 #include <stdio.h>
1140 #include <netdb.h>
1141 ], [ gethostbyname(NULL)  ], [
1142                 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
1143                 gethostbynamerstyle=BSD
1144         ])
1145 fi
1146
1147 if test "x$gethostbynamerstyle" = "x"; then
1148         AC_MSG_RESULT([none!  It must not exist, here.])
1149 else
1150         AC_MSG_RESULT([${gethostbynamerstyle}-style])
1151 fi
1152
1153 if test "x$gethostbynamerstyle" = "xBSD"; then
1154         AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
1155 fi
1156
1157 dnl check for non-posix solaris ctime_r (extra buflen int arg)
1158 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
1159 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
1160 ctimerstyle=""
1161 AC_MSG_CHECKING([ctime_r() syntax])
1162 AC_TRY_LINK([
1163 #include <time.h>
1164 ], [ ctime_r(NULL, NULL, 0) ], [
1165         AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
1166         ctimerstyle="SOLARIS"
1167 ])
1168 if test "x$ctimerstyle" = "x"; then
1169         AC_TRY_LINK([
1170 #include <time.h>
1171 ], [ ctime_r(NULL, NULL) ], [
1172                 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
1173                 ctimerstyle="POSIX"
1174         ])
1175 fi
1176
1177 if test "x$ctimerstyle" = "x"; then
1178         AC_MSG_RESULT([none!  It must not exist, here.])
1179 else
1180         AC_MSG_RESULT([${ctimerstyle}-style])
1181 fi
1182
1183 AC_SUBST(HOSTINFO, $host)
1184
1185 if test "x$WITH_POST_PROXY_AUTHORIZE" != "x"; then
1186         AC_DEFINE(WITH_POST_PROXY_AUTHORIZE, 1, [1.x compatibility])
1187 fi
1188
1189 dnl #############################################################
1190 dnl #
1191 dnl #  8. Checks for system services
1192 dnl #
1193 dnl #############################################################
1194
1195 dnl #
1196 dnl # Figure out where libtool is located,
1197 dnl #
1198 top_builddir=`pwd`
1199 export top_builddir
1200 AC_MSG_RESULT([top_builddir=$top_builddir])
1201 dnl # AC_SUBST(top_builddir)
1202 AC_SUBST(LIBLTDL)
1203 AC_SUBST(INCLTDL)
1204
1205 dnl import libtool stuff
1206
1207 dnl #############################################################
1208 dnl #
1209 dnl #  Configure in any module directories.
1210 dnl #
1211 dnl #############################################################
1212
1213 mysubdirs="$LIBLTDLPATH"
1214 if test "x$EXPERIMENTAL" = "xyes"; then
1215   bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'`
1216   dnl # get rid of LF's.
1217   mysubdirs=`echo $mysubdirs $bar`
1218 else
1219   dnl #
1220   dnl # Find 'configure' in ONLY the stable modules
1221   dnl #
1222   for bar in `cat "${srcdir}"/src/modules/stable`; do
1223     if test -f "${srcdir}"/src/modules/$bar/configure; then
1224       mysubdirs="$mysubdirs src/modules/$bar"
1225     fi
1226   done
1227 fi
1228
1229 dnl ############################################################
1230 dnl # make modules by list
1231 dnl #############################################################
1232 if test "x$EXPERIMENTAL" = "xyes"; then
1233   for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do
1234     MODULES="$MODULES $foo"
1235   done
1236 else
1237    dnl #
1238    dnl # make ONLY the stable modules
1239    dnl #
1240    for foo in `cat "${srcdir}"/src/modules/stable`; do
1241     MODULES="$MODULES $foo"
1242    done
1243 fi
1244
1245 dnl #
1246 dnl #  Don't change the variable name here.  Autoconf goes bonkers
1247 dnl #  if you do.
1248 dnl #
1249 AC_CONFIG_SUBDIRS($LTDL_SUBDIRS $mysubdirs)
1250 AC_SUBST(MODULES)
1251
1252 dnl #############################################################
1253 dnl #
1254 dnl #  And finally, output the results.
1255 dnl #
1256 dnl #############################################################
1257
1258 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1259 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1260 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main   && chmod +x checkrad.pl radlast radtest)])
1261 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts    && chmod +x rc.radiusd radwatch radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
1262
1263 dnl #
1264 dnl #  Substitute whatever libraries we found to be necessary
1265 dnl #
1266 AC_SUBST(LIBS)
1267 AC_SUBST(INSTALLSTRIP)
1268
1269 USE_SHARED_LIBS=$enable_shared
1270 AC_SUBST(USE_SHARED_LIBS)
1271 USE_STATIC_LIBS=$enable_static
1272 AC_SUBST(USE_STATIC_LIBS)
1273 AC_SUBST(STATIC_MODULES)
1274 AC_SUBST(RADIUSD_MAJOR_VERSION)
1275 AC_SUBST(RADIUSD_MINOR_VERSION)
1276 AC_SUBST(RADIUSD_INCRM_VERSION)
1277 AC_SUBST(RADIUSD_VERSION)
1278 AC_SUBST(RADIUSD_VERSION_STRING)
1279 AC_SUBST(RADIUSD_VERSION_COMMIT)
1280
1281 AC_OUTPUT(\
1282         ./Make.inc \
1283         ./src/include/build-radpaths-h \
1284         ./src/main/Makefile \
1285         ./src/main/checkrad.pl \
1286         ./src/main/radlast \
1287         ./src/main/radtest \
1288         ./scripts/rc.radiusd \
1289         ./scripts/radwatch \
1290         ./scripts/radiusd.cron.daily \
1291         ./scripts/radiusd.cron.monthly \
1292         ./scripts/cryptpasswd \
1293         ./raddb/dictionary \
1294         ./raddb/radrelay.conf \
1295         ./raddb/radiusd.conf
1296 )