Substitute autoconf defines in missing.h and tls.h at build time to avoid including...
[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 WITH_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         WITH_ASCEND_BINARY=""
277   esac ]
278 )
279 if test "X$WITH_ASCEND_BINARY" = "Xyes"; then
280   AC_DEFINE(WITH_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, unless --enable-developer=yes) ],
350 [ case "$withval" in
351     yes)
352         EXPERIMENTAL=yes
353         ;;
354     no)
355         EXPERIMENTAL=no
356         ;;
357     *)
358   esac ]
359 )
360
361 dnl extra argument: --with-openssl
362 WITH_OPENSSL=yes
363 AC_ARG_WITH(openssl,
364 [  --with-openssl                   Use OpenSSL. (default=yes)],
365 [ case "$withval" in
366     no)
367         WITH_OPENSSL=no
368         ;;
369     *)
370         WITH_OPENSSL=yes
371         ;;
372   esac ]
373 )
374
375 dnl #
376 dnl # extra argument: --with-openssl-includes=dir
377 dnl #
378 OPENSSL_INCLUDE_DIR=
379 AC_ARG_WITH(openssl-includes,
380 [  --with-openssl-includes=DIR      Directory to look for OpenSSL include files],
381 [ case "$withval" in
382     *) OPENSSL_INCLUDE_DIR="$withval"
383         ;;
384   esac ]
385 )
386
387 dnl #
388 dnl # extra argument: --with-openssl-libraries=dir
389 dnl #
390 OPENSSL_LIB_DIR=
391 AC_ARG_WITH(openssl-libraries,
392 [  --with-openssl-libraries=DIR     Directory to look for OpenSSL library files],
393 [ case "$withval" in
394     *) OPENSSL_LIB_DIR="$withval"
395         ;;
396   esac ]
397 )
398
399 dnl #
400 dnl #  These next two arguments don't actually do anything.  They're
401 dnl #  place holders so that the top-level configure script can tell
402 dnl #  the user how to configure lower-level modules
403 dnl #
404
405 dnl #
406 dnl # extra argument: --with-rlm-FOO-lib-dir
407 dnl #
408 AC_ARG_WITH(rlm-FOO-lib-dir,
409 [  --with-rlm-FOO-lib-dir=DIR       Directory to look for library files used by module FOO],
410 [ case "$withval" in
411     *)
412         ;;
413   esac ]
414 )
415
416 dnl #
417 dnl # extra argument: --with-rlm-FOO-include-dir
418 dnl #
419 AC_ARG_WITH(rlm-FOO-include-dir,
420 [  --with-rlm-FOO-include-dir=DIR   Directory to look for include files used by module FOO],
421 [ case "$withval" in
422     *)
423         ;;
424   esac ]
425 )
426
427 dnl See what include-style is used by the make program.
428 dnl AC_MSG_CHECKING(include style for make)
429 dnl echo "include /dev/null" > testmake.$$
430 dnl echo "all:" >> testmake.$$
431 dnl make -f testmake.$$ >/dev/null 2>&1
432 dnl if test $? = 0
433 dnl then
434 dnl     INCLUDE=include
435 dnl     IQUOTE=
436 dnl else
437 dnl     INCLUDE=.include
438 dnl     IQUOTE='"'
439 dnl fi
440 dnl rm -f testmake.$$
441 dnl AC_MSG_RESULT(" $INCLUDE")
442 dnl AC_SUBST(INCLUDE)
443 dnl AC_SUBST(IQUOTE)
444
445 dnl extra argument: --with-udpfromto
446 WITH_UDPFROMTO=no
447 AC_ARG_WITH(udpfromto,
448 [  --with-udpfromto        Compile in UDPFROMTO support. (default=no)],
449 [ case "$withval" in
450     yes)
451         WITH_UDPFROMTO=yes
452         ;;
453     *)
454         WITH_UDPFROMTO=no
455   esac ]
456 )
457
458 if test "x$WITH_UDPFROMTO" = "xyes"; then
459         AC_DEFINE(WITH_UDPFROMTO, [], [define if you want udpfromto])
460 fi
461
462 dnl #############################################################
463 dnl #
464 dnl #  1. Checks for programs
465 dnl #
466 dnl #############################################################
467
468 CHECKRAD=checkrad.pl
469 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
470 if test "x$ac_cv_path_PERL" = "x"; then
471   AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
472 fi
473 AC_PATH_PROG(SNMPGET, snmpget)
474 if test "x$ac_cv_path_SNMPGET" = "x"; then
475   AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
476 fi
477
478 AC_PATH_PROG(SNMPWALK, snmpwalk)
479 if test "x$ac_cv_path_SNMPWALK" = "x"; then
480   AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
481 fi
482
483 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
484
485 dnl FIXME This is truly gross.
486 missing_dir=`cd $ac_aux_dir && pwd`
487 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
488 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
489 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
490
491 AC_PATH_PROG(LOCATE,locate)
492 AC_PATH_PROG(DIRNAME,dirname)
493 AC_PATH_PROG(GREP,grep)
494
495 dnl #############################################################
496 dnl #
497 dnl #  2. Checks for libraries
498 dnl #
499 dnl #############################################################
500
501 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
502 old_CFLAGS=$CFLAGS
503 if test "x$WITH_THREADS" = "xyes"; then
504   if test $ac_cv_prog_suncc = "yes"; then
505     CFLAGS="$CFLAGS -mt"
506   fi
507
508   AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
509
510 dnl #
511 dnl # pthread stuff is usually in -lpthread
512 dnl # or in -lc_r, on *BSD
513 dnl #
514 dnl # On Some systems, we need extra pre-processor flags, to get them to
515 dnl # to do the threading properly.
516 dnl #
517   AC_CHECK_LIB(pthread, pthread_create,
518                 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
519                   LIBS="-lpthread $LIBS" ],
520                 AC_CHECK_LIB(c_r, pthread_create,
521                             [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
522                             [ WITH_THREADS="no" ]
523                             )
524                 )
525 fi
526
527 dnl #
528 dnl # If we have NO pthread libraries, remove any knowledge of threads.
529 dnl #
530 if test "x$WITH_THREADS" != "xyes"; then
531   CFLAGS=$old_CFLAGS
532   ac_cv_header_pthread_h="no"
533   WITH_THREADS=no
534 else
535   dnl #
536   dnl #  We need sem_init() and friends, as they're the friendliest
537   dnl #  semaphore functions for threading.
538   dnl #
539   dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
540   dnl # Some systems have them in -lsem
541   dnl # Solaris has them in -lposix4
542   dnl # NetBSD has them in -lsemaphore
543
544   AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt semaphore,
545         [],
546         [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)]
547    )
548 fi
549
550 dnl Check if we need -lsocket
551 AC_CHECK_LIB(dl, dlopen)
552
553 dnl Check if we need -lsocket
554 AC_CHECK_LIB(socket, getsockname)
555
556 dnl Check for -lresolv
557 dnl This library may be needed later.
558 AC_CHECK_LIB(resolv, inet_aton)
559
560 dnl Check if we need -lnsl. Usually if we want to
561 dnl link against -lsocket we need to include -lnsl as well.
562 AC_CHECK_LIB(nsl, inet_ntoa)
563
564 dnl Check for OpenSSL libraries.
565 OPENSSL_LIBS=
566 if test "x$WITH_OPENSSL" = xyes; then
567   old_LIBS=$LIBS
568   old_LDFLAGS="$LDFLAGS"
569   if test "x$OPENSSL_LIB_DIR" != "x"; then
570     LDFLAGS="$LDFLAGS -L$OPENSSL_LIB_DIR"
571   fi
572   AC_CHECK_LIB(crypto, DH_new,
573     [
574         LIBS="-lcrypto $LIBS"
575         AC_DEFINE(HAVE_LIBCRYPTO, 1,
576             [Define to 1 if you have the `crypto' library (-lcrypto).])
577         AC_CHECK_LIB(ssl, SSL_new,
578             [
579                 AC_DEFINE(HAVE_LIBSSL, 1,
580                     [Define to 1 if you have the `ssl' library (-lssl).])
581                 if test "x$OPENSSL_LIB_DIR" != "x"; then
582                     OPENSSL_LIBS="-L$OPENSSL_LIB_DIR"
583                 fi
584                 OPENSSL_LIBS="$OPENSSL_LIBS -lcrypto -lssl -lcrypto"
585             ], [])
586     ], [])
587   LIBS=$old_LIBS
588   LDFLAGS="$old_LDFLAGS"
589 fi
590
591 AC_CHECK_LIB(ws2_32, htonl)
592
593 dnl Check the pcap library for the RADIUS sniffer.
594 PCAP_LIBS=
595 AC_CHECK_LIB(pcap, pcap_open_live,
596         [ PCAP_LIBS="-lpcap"
597         AC_DEFINE(HAVE_LIBPCAP, 1,
598                 [Define to 1 if you have the `pcap' library (-lpcap).])
599         ],
600         [ AC_MSG_WARN([pcap library not found, silently disabling the RADIUS sniffer.]) ])
601
602 VL_LIB_READLINE
603
604 dnl #############################################################
605 dnl #
606 dnl #  3. Checks for header files
607 dnl #
608 dnl #############################################################
609
610 dnl #
611 dnl # Interix requires us to set -D_ALL_SOURCE, otherwise
612 dnl # getopt will be #included, but won't link.  <sigh>
613 dnl #
614 dnl #
615 case "$host" in
616 *-interix*)
617         CFLAGS="$CFLAGS -D_ALL_SOURCE"
618         ;;
619 *-darwin*)
620         CFLAGS="$CFLAGS -DDARWIN"
621         LIBS="-framework DirectoryService $LIBS"
622         ;;
623 esac
624
625 AC_HEADER_DIRENT
626 AC_HEADER_STDC
627 AC_HEADER_TIME
628 AC_HEADER_SYS_WAIT
629
630 AC_CHECK_HEADERS( \
631         unistd.h \
632         crypt.h \
633         errno.h \
634         resource.h \
635         sys/resource.h \
636         getopt.h \
637         malloc.h \
638         utmp.h \
639         utmpx.h \
640         signal.h \
641         sys/select.h \
642         syslog.h \
643         inttypes.h \
644         stdint.h \
645         stdio.h \
646         netdb.h \
647         semaphore.h \
648         arpa/inet.h \
649         netinet/in.h \
650         sys/types.h \
651         sys/socket.h \
652         winsock.h \
653         utime.h \
654         sys/time.h \
655         sys/wait.h \
656         sys/security.h \
657         fcntl.h \
658         sys/fcntl.h \
659         sys/prctl.h \
660         sys/un.h \
661         glob.h \
662         prot.h \
663         pwd.h \
664         grp.h \
665         stddef.h \
666         fnmatch.h \
667         sia.h \
668         siad.h
669 )
670
671 dnl FreeBSD requires sys/socket.h before net/if.h
672 AC_CHECK_HEADERS(net/if.h, [], [],
673 [#ifdef HAVE_SYS_SOCKET_H
674 # include <sys/socket.h>
675 # endif
676 ])
677
678 REGEX=no
679 AC_CHECK_HEADER(pcreposix.h, AC_DEFINE(HAVE_PCREPOSIX_H, [], [define this if we have the <pcreposix.h> header file]))
680 if test "x$ac_cv_header_pcreposix_h" = "xyes"; then
681   AC_DEFINE(HAVE_REGEX_H, [], [define if we have any regex])
682   REGEX_EXTENDED=yes
683   REGEX_PCRE=yes
684   REGEX=yes
685   LIBS="$LIBS -lpcreposix"
686 else
687
688 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H, [], [define this if we have the <regex.h> header file]))
689 if test "x$ac_cv_header_regex_h" = "xyes"; then
690   REGEX_EXTENDED=no
691   REGEX_PCRE=no
692   REGEX=yes
693   AC_EGREP_CPP(yes,
694     [#include <regex.h>
695      #ifdef REG_EXTENDED
696        yes
697      #endif
698      ], [AC_DEFINE(HAVE_REG_EXTENDED, [], [define this if we have REG_EXTENDED (from <regex.h>)]) REGEX_EXTENDED=yes])
699 fi
700 fi
701
702 AC_SUBST(REGEX)
703 AC_SUBST(REGEX_PCRE)
704 AC_SUBST(REGEX_EXTENDED)
705
706 dnl #
707 dnl #  other checks which require headers
708 dnl #
709 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
710 then
711   AC_DEFINE(OSFC2, [], [define if you have OSFC2 authentication])
712 fi
713
714 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
715 then
716   AC_DEFINE(OSFSIA, [], [define if you have OSFSIA authentication])
717 fi
718
719 dnl Check for OpenSSL includes.
720 OPENSSL_INCLUDE="-DNO_OPENSSL"
721 if test "x$WITH_OPENSSL" = xyes; then
722   if test "x$OPENSSL_LIBS" = "x"; then
723     AC_MSG_NOTICE([skipping test for openssl/ssl.h])
724   else
725     old_CPPFLAGS=$CPPFLAGS
726     if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
727         CPPFLAGS="$CPPFLAGS -I$OPENSSL_INCLUDE_DIR"
728     fi
729     dnl # stupid RedHat shit
730     CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5"
731     AC_CHECK_HEADERS( \
732         openssl/ssl.h \
733         openssl/crypto.h \
734         openssl/err.h \
735         openssl/evp.h \
736         openssl/md5.h \
737         openssl/md4.h \
738         openssl/sha.h \
739         openssl/ocsp.h \
740         openssl/engine.h,
741         [],
742         OPENSSL_LIBS=
743     )
744     if test "x$OPENSSL_LIBS" != "x"; then
745         AC_MSG_CHECKING([for OpenSSL version >= 0.9.7])
746         AC_EGREP_CPP(yes,
747             [#include <openssl/crypto.h>
748              #if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
749              yes
750              #endif
751             ], goodssl="yes")
752         if test "x$goodssl" != "xyes"; then
753             AC_MSG_RESULT(no)
754             OPENSSL_LIBS=
755         else
756             AC_MSG_RESULT(yes)
757             if test "x$OPENSSL_INCLUDE_DIR" != "x"; then
758                 OPENSSL_INCLUDE="-I$OPENSSL_INCLUDE_DIR -DOPENSSL_NO_KRB5"
759             else
760                 OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
761             fi
762         fi
763     fi
764     CPPFLAGS=$old_CPPFLAGS
765   fi
766 fi
767 AC_SUBST(OPENSSL_INCLUDE)
768 AC_SUBST(OPENSSL_LIBS)
769 export OPENSSL_LIBS
770
771 dnl Check the pcap includes for the RADIUS sniffer.
772 if test "x$PCAP_LIBS" = x; then
773     AC_MSG_NOTICE([skipping test for pcap.h.])
774 else
775     AC_CHECK_HEADER(pcap.h,
776         AC_DEFINE(HAVE_PCAP_H, 1,
777                 [Define to 1 if you have the <pcap.h> header file.]),
778         [ PCAP_LIBS=
779         AC_MSG_WARN([pcap.h not found, silently disabling the RADIUS sniffer.])
780         ])
781
782     AC_CHECK_LIB(pcap, pcap_fopen_offline,
783         [ AC_DEFINE(HAVE_PCAP_FOPEN_OFFLINE, 1,
784                 [Define to 1 if you have the function pcap_fopen_offline.])
785         ])
786     AC_CHECK_LIB(pcap, pcap_dump_fopen,
787         [ AC_DEFINE(HAVE_PCAP_DUMP_FOPEN, 1,
788                 [Define to 1 if you have the function pcap_dump_fopen.])
789         ])
790 fi
791 AC_SUBST(PCAP_LIBS)
792
793 dnl #############################################################
794 dnl #
795 dnl #  4. Checks for typedefs
796 dnl #
797 dnl #############################################################
798
799 dnl #
800 dnl # Ensure that these are defined
801 dnl #
802 AC_TYPE_OFF_T
803 AC_TYPE_PID_T
804 AC_TYPE_SIZE_T
805 AC_TYPE_UID_T
806
807 dnl check for socklen_t
808 FR_CHECK_TYPE_INCLUDE([
809 #ifdef HAVE_SYS_TYPES_H
810 #include <sys/types.h>
811 #endif
812 #ifdef HAVE_SYS_SOCKET_H
813 #include <sys/socket.h>
814 #endif
815 ],socklen_t, int, [socklen_t is generally 'int' on systems which don't use it])
816
817 dnl check for uint8_t
818 FR_CHECK_TYPE_INCLUDE([
819 #ifdef HAVE_INTTYPES_H
820 #include <inttypes.h>
821 #endif
822 #ifdef HAVE_STDINT_H
823 #include <stdint.h>
824 #endif
825 ],uint8_t, unsigned char, [uint8_t should be the canonical 'octet' for network traffic])
826
827 dnl check for uint16_t
828 FR_CHECK_TYPE_INCLUDE([
829 #ifdef HAVE_INTTYPES_H
830 #include <inttypes.h>
831 #endif
832 #ifdef HAVE_STDINT_H
833 #include <stdint.h>
834 #endif
835 ],uint16_t, unsigned short, [uint16_t should be the canonical '2 octets' for network traffic])
836
837 dnl check for uint32_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 ],uint32_t, unsigned int, [uint32_t should be the canonical 'network integer])
846
847 AC_CHECK_TYPE(struct in6_addr, AC_DEFINE(HAVE_STRUCT_IN6_ADDR, 1, [IPv6 address structure]), [], [
848 #ifdef HAVE_NETINET_IN_H
849 #include <netinet/in.h>
850 #endif
851 ])
852
853 AC_CHECK_TYPE(struct sockaddr_storage, AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE, 1, [Generic socket addresses]), [], [
854 #ifdef HAVE_NETINET_IN_H
855 #include <netinet/in.h>
856 #endif
857 #ifdef HAVE_SYS_SOCKET_H
858 #include <sys/socket.h>
859 #endif
860 ])
861
862 AC_CHECK_TYPE(struct sockaddr_in6, AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6, 1, [IPv6 socket addresses]), [], [
863 #ifdef HAVE_NETINET_IN_H
864 #include <netinet/in.h>
865 #endif
866 ])
867
868 AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS lookups]), [], [
869 #ifdef HAVE_SYS_TYPES_H
870 #include <sys/types.h>
871 #endif
872 #ifdef HAVE_SYS_SOCKET_H
873 #include <sys/socket.h>
874 #endif
875 #ifdef HAVE_NETDB_H
876 #include <netdb.h>
877 #endif
878 ])
879
880 dnl #############################################################
881 dnl #
882 dnl #  5. Checks for structures and functions
883 dnl #
884 dnl #############################################################
885 AC_CHECK_FUNCS( \
886         getopt_long \
887         lockf \
888         strsignal \
889         sigaction \
890         sigprocmask \
891         pthread_sigmask \
892         snprintf \
893         vsnprintf \
894         setsid \
895         strncasecmp \
896         strcasecmp \
897         localtime_r \
898         ctime_r \
899         gmtime_r \
900         strsep \
901         inet_aton \
902         inet_pton \
903         inet_ntop \
904         setlinebuf \
905         setvbuf \
906         getusershell \
907         initgroups \
908         getaddrinfo \
909         getnameinfo \
910         closefrom \
911         gettimeofday \
912         getpeereid \
913         setuid \
914         setresuid \
915         getresuid \
916         strlcat \
917         strlcpy
918 )
919 RADIUSD_NEED_DECLARATIONS( \
920         crypt \
921         strncasecmp \
922         strcasecmp \
923         inet_aton \
924         setlinebuf \
925         getusershell \
926         endusershell
927 )
928
929 AC_TYPE_SIGNAL
930
931 dnl # check if we have utmpx.h
932 dnl # if so, check if struct utmpx has entry ut_xtime
933 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
934 if test "x$ac_cv_header_utmpx_h" = "xyes"
935 then
936  FR_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
937  if test "x$ac_cv_type_struct_utmpx_has_ut_xtime" = "x"
938  then
939    AC_DEFINE(ut_xtime,ut_tv.tv_sec, [define to something if you don't have ut_xtime in struct utmpx])
940  fi
941 fi
942
943 dnl # struct ip_pktinfo
944 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in_pktinfo], ipi_addr)
945 if test "x$ac_cv_type_struct_in_pktinfo_has_ipi_addr" = "xyes"
946 then
947         AC_DEFINE(HAVE_IP_PKTINFO, [], [define if you have IP_PKTINFO (Linux)])
948 fi
949
950 dnl # struct in6_pktinfo
951 FR_CHECK_STRUCT_HAS_MEMBER([#include <netinet/in.h>], [struct in6_pktinfo], ipi6_addr)
952 if test "x$ac_cv_type_struct_in6_pktinfo_has_ipi6_addr" = "xyes"
953 then
954         AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
955 fi
956
957 dnl #############################################################
958 dnl #
959 dnl #  6. Checks for compiler characteristics
960 dnl #
961 dnl #############################################################
962
963 dnl #
964 dnl # Ensure that these are defined
965 dnl #
966 AC_C_CONST
967
968 dnl #
969 dnl # See if this is OS/2
970 dnl #
971 AC_MSG_CHECKING(type of OS)
972 OS=`uname -s`
973 AC_MSG_RESULT($OS)
974 if test "$OS" = "OS/2"; then
975         LIBPREFIX=
976 else
977         LIBPREFIX=lib
978 fi
979 AC_SUBST(LIBPREFIX)
980
981 AC_MSG_CHECKING(for developer gcc flags)
982
983
984 if test "x$developer" = "xyes"; then
985   if test "x$GCC" = "xyes"; then
986     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"
987     CFLAGS="$CFLAGS $devflags"
988     INSTALLSTRIP=""
989     AC_MSG_RESULT(yes.  Using $devflags)
990   fi
991
992   if test "x$EXPERIMENTAL" != "xno"; then
993     EXPERIMENTAL = yes
994   fi
995   
996   dnl append the current git hash onto the version string
997   if test "x$GIT" = "xyes"; then
998         RADIUSD_VERSION_COMMIT=`git log --pretty=format:'%h' -n 1`
999   fi
1000 else
1001   devflags=""
1002   CFLAGS="$CFLAGS -DNDEBUG"
1003   INSTALLSTRIP=""
1004   AC_MSG_RESULT(no.)
1005 fi
1006
1007 FR_TLS
1008
1009 dnl #############################################################
1010 dnl #
1011 dnl #  7. Checks for library functions
1012 dnl #
1013 dnl #############################################################
1014
1015 old_LIBS="$LIBS"
1016 LIBS="$LIBS $LIBLTDL"
1017 AC_CHECK_FUNC(lt_dladvise_init, AC_DEFINE(HAVE_LT_DLADVISE_INIT, [], [Do we have the lt_dladvise_init function]))
1018 LIBS="$old_LIBS"
1019
1020 dnl Check for libcrypt
1021 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
1022 AC_CHECK_LIB(crypt, crypt,
1023   CRYPTLIB="-lcrypt"
1024 )
1025 if test "$CRYPTLIB" != ""; then
1026   AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function])
1027 else
1028   AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT, [], [Do we have the crypt function]))
1029 fi
1030
1031 dnl Check for libcipher
1032 AC_CHECK_LIB(cipher, setkey,
1033    CRYPTLIB="${CRYPTLIB} -lcipher"
1034 )
1035 AC_SUBST(CRYPTLIB)
1036
1037 dnl Check the style of gethostbyaddr, in order of preference
1038 dnl GNU (_r eight args)
1039 AC_DEFINE(GNUSTYLE, [1], [GNU-Style get*byaddr_r])
1040 dnl SYSV (_r six args)
1041 AC_DEFINE(SYSVSTYLE, [2], [SYSV-Style get*byaddr_r])
1042 dnl BSD (three args, may not be thread safe)
1043 AC_DEFINE(BSDSTYLE, [3], [BSD-Style get*byaddr_r])
1044 dnl Tru64 has BSD version, but it is thread safe
1045 dnl     http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1739____.HTM
1046 dnl We need #stdio.h to define NULL on FreeBSD (at least)
1047 gethostbyaddrrstyle=""
1048 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
1049 case "$host" in
1050 *-freebsd*)
1051 dnl With FreeBSD, check if there's a prototype for gethostbyaddr_r.
1052 dnl Some versions (FreeBSD 5.1?) have a symbol but no prototype - so we
1053 dnl override this test to BSDSTYLE. FreeBSD 6.2 and up have proper GNU
1054 dnl style support.
1055         AC_CHECK_DECLS([gethostbyaddr_r], [], [
1056                 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE,
1057                         [style of gethostbyaddr_r functions ])
1058                 gethostbyaddrrstyle=BSD
1059                 AC_MSG_WARN([FreeBSD overridden to BSD-style])
1060         ], [
1061 #ifdef HAVE_NETDB_H
1062 #include <netdb.h>
1063 #endif
1064 ])
1065         ;;
1066 esac
1067 if test "x$gethostbyaddrrstyle" = "x"; then
1068         AC_TRY_LINK([
1069 #include <stdio.h>
1070 #include <netdb.h>
1071 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
1072         AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE, [style of gethostbyaddr_r functions ])
1073         gethostbyaddrrstyle=GNU
1074 ])
1075 fi
1076 if test "x$gethostbyaddrrstyle" = "x"; then
1077         AC_TRY_LINK([
1078 #include <stdio.h>
1079 #include <netdb.h>
1080 ], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
1081                 AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE, [style of gethostbyaddr_r functions ])
1082                 gethostbyaddrrstyle=SYSV
1083         ])
1084 fi
1085 if test "x$gethostbyaddrrstyle" = "x"; then
1086         AC_TRY_LINK([
1087 #include <stdio.h>
1088 #include <netdb.h>
1089 ], [ gethostbyaddr(NULL, 0, 0)  ], [
1090                 AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE, [style of gethostbyaddr_r functions ])
1091                 gethostbyaddrrstyle=BSD
1092         ])
1093 fi
1094
1095 if test "x$gethostbyaddrrstyle" = "x"; then
1096         AC_MSG_RESULT([none!  It must not exist, here.])
1097 else
1098         AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
1099 fi
1100
1101 if test "x$gethostbyaddrrstyle" = "xBSD"; then
1102         AC_MSG_WARN([ ****** BSD-style gethostbyaddr might NOT be thread-safe! ****** ])
1103 fi
1104
1105 dnl Check the style of gethostbyname, in order of preference
1106 dnl GNU (_r seven args)
1107 dnl SYSV (_r five args)
1108 dnl BSD (two args, may not be thread safe)
1109 dnl Tru64 has BSD version, but it _is_ thread safe
1110 dnl     http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/1946____.HTM
1111 dnl We need #stdio.h to define NULL on FreeBSD (at least)
1112 gethostbynamerstyle=""
1113 AC_MSG_CHECKING([gethostbyname_r() syntax])
1114 AC_TRY_LINK([
1115 #include <stdio.h>
1116 #include <netdb.h>
1117 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL) ], [
1118         AC_DEFINE(GETHOSTBYNAMERSTYLE, GNUSTYLE, [style of gethostbyname_r functions ])
1119         gethostbynamerstyle=GNU
1120 ])
1121 if test "x$gethostbynamerstyle" = "x"; then
1122         AC_TRY_LINK([
1123 #include <stdio.h>
1124 #include <netdb.h>
1125 ], [ gethostbyname_r(NULL, NULL, NULL, 0, NULL) ] , [
1126                 AC_DEFINE(GETHOSTBYNAMERSTYLE, SYSVSTYLE, [style of gethostbyname_r functions ])
1127                 gethostbynamerstyle=SYSV
1128         ])
1129 fi
1130 if test "x$gethostbynamerstyle" = "x"; then
1131         AC_TRY_LINK([
1132 #include <stdio.h>
1133 #include <netdb.h>
1134 ], [ gethostbyname(NULL)  ], [
1135                 AC_DEFINE(GETHOSTBYNAMERSTYLE, BSDSTYLE, [style of gethostbyname_r functions ])
1136                 gethostbynamerstyle=BSD
1137         ])
1138 fi
1139
1140 if test "x$gethostbynamerstyle" = "x"; then
1141         AC_MSG_RESULT([none!  It must not exist, here.])
1142 else
1143         AC_MSG_RESULT([${gethostbynamerstyle}-style])
1144 fi
1145
1146 if test "x$gethostbynamerstyle" = "xBSD"; then
1147         AC_MSG_WARN([ ****** BSD-style gethostbyname might NOT be thread-safe! ****** ])
1148 fi
1149
1150 dnl check for non-posix solaris ctime_r (extra buflen int arg)
1151 AC_DEFINE(POSIXSTYLE, [1], [Posix-Style ctime_r])
1152 AC_DEFINE(SOLARISSTYLE, [2], [Solaris-Style ctime_r])
1153 ctimerstyle=""
1154 AC_MSG_CHECKING([ctime_r() syntax])
1155 AC_TRY_LINK([
1156 #include <time.h>
1157 ], [ ctime_r(NULL, NULL, 0) ], [
1158         AC_DEFINE(CTIMERSTYLE, SOLARISSTYLE, [style of ctime_r function])
1159         ctimerstyle="SOLARIS"
1160 ])
1161 if test "x$ctimerstyle" = "x"; then
1162         AC_TRY_LINK([
1163 #include <time.h>
1164 ], [ ctime_r(NULL, NULL) ], [
1165                 AC_DEFINE(CTIMERSTYLE, POSIXSTYLE, [style of ctime_r function])
1166                 ctimerstyle="POSIX"
1167         ])
1168 fi
1169
1170 if test "x$ctimerstyle" = "x"; then
1171         AC_MSG_RESULT([none!  It must not exist, here.])
1172 else
1173         AC_MSG_RESULT([${ctimerstyle}-style])
1174 fi
1175
1176 AC_SUBST(HOSTINFO, $host)
1177
1178 dnl #############################################################
1179 dnl #
1180 dnl #  8. Checks for system services
1181 dnl #
1182 dnl #############################################################
1183
1184 dnl #
1185 dnl # Figure out where libtool is located,
1186 dnl #
1187 top_builddir=`pwd`
1188 export top_builddir
1189 AC_MSG_RESULT([top_builddir=$top_builddir])
1190 dnl # AC_SUBST(top_builddir)
1191 AC_SUBST(LIBLTDL)
1192 AC_SUBST(INCLTDL)
1193
1194 dnl import libtool stuff
1195
1196 dnl #############################################################
1197 dnl #
1198 dnl #  Configure in any module directories.
1199 dnl #
1200 dnl #############################################################
1201
1202 mysubdirs=""
1203 if test "x$EXPERIMENTAL" = "xyes"; then
1204   bar=`ls -1 "${srcdir}"/src/modules/rlm_*/configure | sed 's%/configure%%'`
1205   dnl # get rid of LF's.
1206   mysubdirs=`echo $mysubdirs $bar`
1207 else
1208   dnl #
1209   dnl # Find 'configure' in ONLY the stable modules
1210   dnl #
1211   for bar in `cat "${srcdir}"/src/modules/stable`; do
1212     if test -f "${srcdir}"/src/modules/$bar/configure; then
1213       mysubdirs="$mysubdirs src/modules/$bar"
1214     fi
1215   done
1216 fi
1217
1218 dnl ############################################################
1219 dnl # make modules by list
1220 dnl #############################################################
1221 if test "x$EXPERIMENTAL" = "xyes"; then
1222   for foo in `ls -1 "${srcdir}"/src/modules | grep rlm_`; do
1223     MODULES="$MODULES $foo"
1224   done
1225 else
1226    dnl #
1227    dnl # make ONLY the stable modules
1228    dnl #
1229    for foo in `cat "${srcdir}"/src/modules/stable`; do
1230     MODULES="$MODULES $foo"
1231    done
1232 fi
1233
1234 dnl #
1235 dnl #  Don't change the variable name here.  Autoconf goes bonkers
1236 dnl #  if you do.
1237 dnl #
1238 AC_CONFIG_SUBDIRS($mysubdirs)
1239 AC_SUBST(MODULES)
1240
1241 dnl #############################################################
1242 dnl #
1243 dnl #  And finally, output the results.
1244 dnl #
1245 dnl #############################################################
1246
1247 AC_CONFIG_COMMANDS([stamp-h], [echo timestamp > src/include/stamp-h])
1248 AC_CONFIG_COMMANDS([build-radpaths-h], [(cd ./src/include && /bin/sh ./build-radpaths-h)])
1249 AC_CONFIG_COMMANDS([main-chmod], [(cd ./src/main   && chmod +x checkrad.pl radlast radtest)])
1250 AC_CONFIG_COMMANDS([scripts-chmod], [(cd ./scripts    && chmod +x rc.radiusd radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
1251
1252 dnl #
1253 dnl #  Substitute whatever libraries we found to be necessary
1254 dnl #
1255 AC_SUBST(LIBS)
1256 AC_SUBST(INSTALLSTRIP)
1257
1258 USE_SHARED_LIBS=$enable_shared
1259 AC_SUBST(USE_SHARED_LIBS)
1260 USE_STATIC_LIBS=$enable_static
1261 AC_SUBST(USE_STATIC_LIBS)
1262 AC_SUBST(STATIC_MODULES)
1263 AC_SUBST(RADIUSD_MAJOR_VERSION)
1264 AC_SUBST(RADIUSD_MINOR_VERSION)
1265 AC_SUBST(RADIUSD_INCRM_VERSION)
1266 AC_SUBST(RADIUSD_VERSION)
1267 AC_SUBST(RADIUSD_VERSION_STRING)
1268 AC_SUBST(RADIUSD_VERSION_COMMIT)
1269
1270 AC_OUTPUT(\
1271         ./Make.inc \
1272         ./src/include/build-radpaths-h \
1273         ./src/main/Makefile \
1274         ./src/main/radsniff.mk \
1275         ./src/main/checkrad.pl \
1276         ./src/main/radlast \
1277         ./src/main/radtest \
1278         ./scripts/rc.radiusd \
1279         ./scripts/radiusd.cron.daily \
1280         ./scripts/radiusd.cron.monthly \
1281         ./scripts/cryptpasswd \
1282         ./raddb/dictionary \
1283         ./raddb/radrelay.conf \
1284         ./raddb/radiusd.conf
1285 )