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