Made ALL dictionary lookups case insensitive by default, there's
[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_INIT(src/main/radiusd.c)
24 AC_CONFIG_HEADER(src/include/autoconf.h)
25 AC_REVISION($Revision$)dnl
26
27 dnl # The version of the software
28 RADIUSD_MAJOR_VERSION=0
29 RADIUSD_MINOR_VERSION=9-pre
30 RADIUSD_VERSION="${RADIUSD_MAJOR_VERSION}.${RADIUSD_MINOR_VERSION}"
31
32 dnl #############################################################
33 dnl #
34 dnl #  0. Checks for compiler, libtool, and command line options.
35 dnl #
36 dnl #############################################################
37
38 dnl Check for GNU cc
39 AC_PROG_CC
40 AC_PROG_GCC_TRADITIONAL
41 AC_PROG_CC_SUNPRO
42 AC_PROG_RANLIB
43
44 PACKAGE=freeradius
45
46 dnl #
47 dnl # check for AIX, to allow us to use some BSD functions
48 dnl # must be before macros that call the compiler.
49 dnl #
50 AC_AIX
51
52 dnl Find GNU Make.
53 AC_CHECK_PROG(GMAKE, gmake, yes, no)
54 if test $GMAKE = no; then
55   AC_PATH_PROG(MAKE, make, /usr/local/bin/make)
56 else
57   AC_PATH_PROG(MAKE, gmake, /usr/local/gnu/bin/make)
58 fi
59 makever=`$ac_cv_path_MAKE --version 2>&1 | grep "GNU Make"`
60 if test -z "$makever"; then
61   AC_MSG_ERROR(GNU Make is not installed.  Please download and install it
62                 from ftp://prep.ai.mit.edu/pub/gnu/make/ before continuing.)
63 fi
64
65 dnl libltdl is installable
66 AC_LIBLTDL_INSTALLABLE
67
68 dnl use system-wide libtool, if it exists
69 AC_ARG_WITH(system-libtool, 
70 [  --with-system-libtool              try to use libtool installed in your system [default=use our own]],
71 [ AC_PATH_PROG(LIBTOOL, libtool,,$PATH:/usr/local/bin) ],
72 [
73   LIBTOOL="`pwd`/libtool"
74   AC_SUBST(LIBTOOL)
75   dnl ensure that we're looking for dlopen
76   AC_LIBTOOL_DLOPEN
77
78   dnl Figure out how to build shared libraries
79   AC_PROG_LIBTOOL
80 ])
81
82
83 dnl Put this in later, when all distributed modules use autoconf.
84 dnl AC_ARG_WITH(disablemodulefoo,
85 dnl [  --without-rlm_foo       Disables module compilation.  Module list:]
86 dnl esyscmd([find src/modules -type d -name rlm_\* -print |\
87 dnl     sed -e 's%src/modules/.*/% (sub)- %; s%.*/%- %' |\
88 dnl     awk '{print "                            "$0}']))
89
90 AC_ARG_ENABLE(strict-dependencies,
91 [  --enable-strict-dependencies  Fail configure on lack of module dependancy.])
92
93 dnl extra argument: --with-logdir
94 logdir='${localstatedir}/log/radius'
95 AC_MSG_CHECKING(logdir)
96 AC_ARG_WITH(logdir,
97 [  --with-logdir=DIR       Directory for logfiles [LOCALSTATEDIR/log/radius] ],
98 [ case "$withval" in
99     no)
100         AC_MSG_ERROR(Need logdir)
101         ;;
102     yes)
103         ;;
104     *)
105         logdir="$withval"
106         ;;
107   esac ]
108 )
109 AC_SUBST(logdir)
110 AC_MSG_RESULT($logdir)
111
112 dnl extra argument: --with-radacctdir
113 radacctdir='${logdir}/radacct'
114 AC_MSG_CHECKING(radacctdir)
115 AC_ARG_WITH(radacctdir,
116 [  --with-radacctdir=PATH  Directory for detail files [LOGDIR/radacct] ],
117 [ case "$withval" in
118     no)
119         AC_MSG_ERROR(Need radacctdir)
120         ;;
121     yes)
122         ;;
123     *)
124         radacctdir="$withval"
125         ;;
126   esac ]
127 )
128 AC_SUBST(radacctdir)
129 AC_MSG_RESULT($radacctdir)
130
131 dnl extra argument: --with-raddbdir
132 raddbdir='${sysconfdir}/raddb'
133 AC_MSG_CHECKING(raddbdir)
134 AC_ARG_WITH(raddbdir,
135 [  --with-raddbdir=DIR     Directory for config files [SYSCONFDIR/raddb] ],
136 [ case "$withval" in
137     no)
138         AC_MSG_ERROR(Need raddbdir)
139         ;;
140     yes)
141         ;;
142     *)
143         raddbdir="$withval"
144         ;;
145   esac ]
146 )
147 AC_SUBST(raddbdir)
148 AC_MSG_RESULT($raddbdir)
149
150 dnl extra argument: --with-ascend-binary
151 ASCEND_BINARY=yes
152 AC_ARG_WITH(ascend-binary,
153 [  --with-ascend-binary    Include support for Ascend binary filter attributes (default=yes)],
154 [ case "$withval" in
155     yes)
156         ;;
157     *)
158         ASCEND_BINARY=""
159   esac ]
160 )
161 if test "X$ASCEND_BINARY" = "Xyes"; then
162   AC_DEFINE(ASCEND_BINARY)
163 fi
164
165 dnl extra argument: --with-threads
166 WITH_THREADS=yes
167 AC_ARG_WITH(threads,
168 [  --with-threads          Use threads, if available.  (default=yes) ],
169 [ case "$withval" in
170     yes)
171         ;;
172     *)
173         WITH_THREADS=""
174   esac ]
175 )
176
177 dnl extra argument: --with-snmp
178 WITH_SNMP=yes
179 AC_ARG_WITH(snmp,
180 [  --with-snmp             Compile in SNMP support. (default=yes)],
181 [ case "$withval" in
182     yes)
183         ;;
184     *)
185         WITH_SNMP=no
186   esac ]
187 )
188
189 dnl AC_ARG_ENABLE(ltdl-install,
190 dnl [  --disable-ltdl-install  do not install libltdl])
191 dnl if test x"${enable_ltdl_install+set}" != xset; then
192 dnl   enable_ltdl_install=yes
193 dnl   ac_configure_args="$ac_configure_args --enable-ltdl-install"
194 dnl fi
195 dnl AC_CONFIG_SUBDIRS(libltdl)
196
197 dnl #
198 dnl #  Allow the user to specify a list of modules to be linked
199 dnl #  statically to the server.
200 dnl #
201 STATIC_MODULES=
202 AC_ARG_WITH(static_modules,
203 [  --with-static-modules=QUOTED-MODULE-LIST],[
204   for i in $withval; do
205     STATIC_MODULES="$STATIC_MODULES -dlpreopen ../modules/rlm_$i/rlm_$i.la"
206   done
207 ])
208
209 dnl #
210 dnl #  Enable developer C compiler warnings
211 dnl #
212 AC_ARG_ENABLE(developer,
213 [  --enable-developer               Enables features of interest to developers.],
214 [ case "$withval" in
215     *)
216         developer=no
217         ;;
218     yes)
219         developer=yes
220   esac ]
221 )
222
223 if test "x$developer" != "xno" -a -d $srcdir/CVS; then
224   dnl turn on the developer flag when taken from a CVS checkout (not a release)
225   developer="yes"
226 fi
227
228 dnl extra argument: --with-experimental-modules
229 EXPERIMENTAL=
230 AC_ARG_WITH(experimental-modules,
231 [  --with-experimental-modules      Use experimental and unstable modules. (default=no) ],
232 [ case "$withval" in
233     yes)
234         EXPERIMENTAL=yes
235         ;;
236     *)
237   esac ]
238 )
239
240 dnl #
241 dnl #  These next two arguments don't actually do anything.  They're
242 dnl #  place holders so that the top-level configure script can tell
243 dnl #  the user how to configure lower-level modules
244 dnl #
245
246 dnl #
247 dnl # extra argument: --with-rlm-FOO-lib-dir
248 dnl #
249 AC_ARG_WITH(rlm-FOO-lib-dir,
250 [  --with-rlm-FOO-lib-dir=DIR       Directory to look for library files used by module FOO],
251 [ case "$withval" in
252     *)
253         ;;
254   esac ]
255 )
256
257 dnl #
258 dnl # extra argument: --with-rlm-FOO-include-dir
259 dnl #
260 AC_ARG_WITH(rlm-FOO-include-dir,
261 [  --with-rlm-FOO-include-dir=DIR   Directory to look for include files used by module FOO],
262 [ case "$withval" in
263     *)
264         ;;
265   esac ]
266 )
267
268 dnl See what include-style is used by the make program.
269 dnl AC_MSG_CHECKING(include style for make)
270 dnl echo "include /dev/null" > testmake.$$
271 dnl echo "all:" >> testmake.$$
272 dnl make -f testmake.$$ >/dev/null 2>&1
273 dnl if test $? = 0
274 dnl then
275 dnl     INCLUDE=include
276 dnl     IQUOTE=
277 dnl else
278 dnl     INCLUDE=.include
279 dnl     IQUOTE='"'
280 dnl fi
281 dnl rm -f testmake.$$
282 dnl AC_MSG_RESULT(" $INCLUDE")
283 dnl AC_SUBST(INCLUDE)
284 dnl AC_SUBST(IQUOTE)
285
286 dnl #############################################################
287 dnl #
288 dnl #  1. Checks for programs
289 dnl #
290 dnl #############################################################
291
292 CHECKRAD=checkrad.pl
293 AC_PATH_PROG(PERL, perl, /usr/local/bin/perl)
294 if test "x$ac_cv_path_PERL" = "x"; then
295   AC_MSG_WARN(perl not found - Simultaneous-Use and checkrad.pl may not work)
296 fi
297 AC_PATH_PROG(SNMPGET, snmpget)
298 if test "x$ac_cv_path_SNMPGET" = "x"; then
299   AC_MSG_WARN(snmpget not found - Simultaneous-Use and checkrad.pl may not work)
300 fi
301
302 AC_PATH_PROG(SNMPWALK, snmpwalk)
303 if test "x$ac_cv_path_SNMPWALK" = "x"; then
304   AC_MSG_WARN(snmpwalk not found - Simultaneous-Use and checkrad.pl may not work)
305 fi
306
307 AC_PATH_PROG(RUSERS, rusers, /usr/bin/rusers)
308
309 dnl FIXME This is truly gross.
310 missing_dir=`cd $ac_aux_dir && pwd`
311 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
312 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
313 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
314
315 AC_PATH_PROG(LOCATE,locate)
316 AC_PATH_PROG(DIRNAME,dirname)
317 AC_PATH_PROG(GREP,grep)
318
319 dnl #############################################################
320 dnl #
321 dnl #  2. Checks for libraries
322 dnl #
323 dnl #############################################################
324
325 dnl If using pthreads, check for -lpthread (posix) or -lc_r (*BSD)
326 old_CFLAGS=$CFLAGS
327 if test "x$WITH_THREADS" = "xyes"; then 
328   if test $ac_cv_prog_suncc = "yes"; then
329     CFLAGS="$CFLAGS -mt"
330   fi
331
332   AC_CHECK_HEADERS(pthread.h, [], [ WITH_THREADS="no" ])
333
334 dnl # 
335 dnl # pthread stuff is usually in -lpthread
336 dnl # or in -lc_r, on *BSD
337 dnl # 
338 dnl # On Some systems, we need extra pre-processor flags, to get them to
339 dnl # to do the threading properly.
340 dnl # 
341   AC_CHECK_LIB(pthread, pthread_create,
342                 [ CFLAGS="$CFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS"
343                   LIBS="$LIBS -lpthread" ],
344                 AC_CHECK_LIB(c_r, pthread_create,
345                             [ CFLAGS="$CFLAGS -pthread -D_THREAD_SAFE" ],
346                             [ WITH_THREADS="no" ]
347                             )
348                 )
349 fi
350
351 dnl # 
352 dnl # If we have NO pthread libraries, remove any knowledge of threads.
353 dnl # 
354 if test "x$WITH_THREADS" != "xyes"; then
355   CFLAGS=$old_CFLAGS
356   ac_cv_header_pthread_h="no"
357   WITH_THREADS=no
358 else
359   dnl #
360   dnl #  We need sem_init() and friends, as they're the friendliest
361   dnl #  semaphore functions for threading.
362   dnl #
363   dnl # HP/UX requires linking with librt, too, to get the sem_* symbols.
364   dnl # Some systems have them in -lsem
365   dnl # Solaris has them in -lposix4
366
367   AC_SEARCH_LIBS(sem_init, pthread sem posix4 rt,
368         [],
369         [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)]
370    )
371 fi
372
373 dnl Check if we need -lsocket
374 AC_CHECK_LIB(socket, getsockname)
375
376 dnl Check for -lresolv
377 dnl This library may be needed later.
378 AC_CHECK_LIB(resolv, inet_aton)
379
380 dnl Check if we need -lnsl. Usually if we want to
381 dnl link against -lsocket we need to include -lnsl as well.
382 AC_CHECK_LIB(nsl, inet_ntoa)
383
384 dnl #############################################################
385 dnl #
386 dnl #  3. Checks for header files
387 dnl #
388 dnl #############################################################
389
390 AC_HEADER_DIRENT
391 AC_HEADER_STDC
392 AC_HEADER_TIME
393 AC_HEADER_SYS_WAIT
394
395 AC_CHECK_HEADERS( \
396         unistd.h \
397         crypt.h \
398         errno.h \
399         resource.h \
400         getopt.h \
401         malloc.h \
402         utmp.h \
403         utmpx.h \
404         signal.h \
405         sys/select.h \
406         syslog.h \
407         inttypes.h \
408         stdint.h \
409         stdio.h \
410         netdb.h \
411         semaphore.h \
412         arpa/inet.h \
413         netinet/in.h \
414         sys/types.h \
415         sys/socket.h \
416         sys/time.h \
417         sys/wait.h \
418         sys/security.h \
419         fcntl.h \
420         sys/fcntl.h \
421         prot.h \
422         sia.h \
423         siad.h
424 )
425
426 REGEX=no
427 AC_CHECK_HEADER(regex.h, AC_DEFINE(HAVE_REGEX_H))
428 if test "x$ac_cv_header_regex_h" = "xyes"; then
429   REGEX_EXTENDED=no
430   REGEX=yes
431   AC_EGREP_CPP(yes,
432     [#include <regex.h>
433      #ifdef REG_EXTENDED
434        yes
435      #endif
436      ], [AC_DEFINE(HAVE_REG_EXTENDED) REGEX_EXTENDED=yes])
437 fi
438 AC_SUBST(REGEX)
439 AC_SUBST(REGEX_EXTENDED)
440
441 dnl #
442 dnl #  other checks which require headers
443 dnl #
444 if test "x$ac_cv_header_sys_security_h" = "xyes" && test "x$ac_cv_header_prot_h" = "xyes"
445 then
446   AC_DEFINE(OSFC2)
447 fi
448
449 if test "x$ac_cv_header_sia_h" = "xyes" && test "x$ac_cv_header_siad_h" = "xyes"
450 then
451   AC_DEFINE(OSFSIA)
452 fi
453
454
455 dnl #############################################################
456 dnl #
457 dnl #  4. Checks for typedefs
458 dnl #
459 dnl #############################################################
460
461 dnl #
462 dnl # Ensure that these are defined
463 dnl #
464 AC_TYPE_OFF_T 
465 AC_TYPE_PID_T
466 AC_TYPE_SIZE_T
467 AC_TYPE_UID_T
468
469 dnl check for socklen_t
470 AC_CHECK_TYPE_INCLUDE([
471 #ifdef HAVE_SYS_TYPES_H
472 #include <sys/types.h>
473 #endif
474 #ifdef HAVE_SYS_SOCKET_H
475 #include <sys/socket.h>
476 #endif
477 ],socklen_t, int)
478
479 dnl check for uint8_t
480 AC_CHECK_TYPE_INCLUDE([
481 #ifdef HAVE_INTTYPES_H
482 #include <inttypes.h>
483 #endif
484 #ifdef HAVE_STDINT_H
485 #include <stdint.h>
486 #endif
487 ],uint8_t, unsigned char)
488
489 dnl check for uint16_t
490 AC_CHECK_TYPE_INCLUDE([
491 #ifdef HAVE_INTTYPES_H
492 #include <inttypes.h>
493 #endif
494 #ifdef HAVE_STDINT_H
495 #include <stdint.h>
496 #endif
497 ],uint16_t, unsigned short)
498
499 dnl check for uint32_t
500 AC_CHECK_TYPE_INCLUDE([
501 #ifdef HAVE_INTTYPES_H
502 #include <inttypes.h>
503 #endif
504 #ifdef HAVE_STDINT_H
505 #include <stdint.h>
506 #endif
507 ],uint32_t, unsigned int)
508
509 dnl #############################################################
510 dnl #
511 dnl #  5. Checks for structures and functions
512 dnl #
513 dnl #############################################################
514 AC_CHECK_FUNCS( \
515         getopt_long \
516         lockf \
517         strsignal \
518         sigaction \
519         sigprocmask \
520         pthread_sigmask \
521         snprintf \
522         vsnprintf \
523         setsid \
524         strncasecmp \
525         strcasecmp \
526         localtime_r \
527         ctime_r \
528         gmtime_r \
529         strsep \
530         inet_aton \
531         gethostname \
532         setlinebuf \
533         setvbuf \
534         getusershell
535 )
536 RADIUSD_NEED_DECLARATIONS( \
537         crypt \
538         strncasecmp \
539         strcasecmp \
540         inet_aton \
541         gethostname \
542         setlinebuf \
543         getusershell \
544         endusershell
545 )
546
547 AC_TYPE_SIGNAL
548
549 dnl # check if we have utmpx.h
550 dnl # if so, check if struct utmpx has entry ut_xtime
551 dnl # if not, set it to define ut_xtime == ut_tv.tv_sec
552 if test "x$ac_cv_header_utmpx_h" = "xyes"
553 then
554  AC_CHECK_STRUCT_HAS_MEMBER([#include <utmpx.h>], [struct utmpx], ut_xtime)
555  if test "x$ac_cv_type_struct_utmpx_ut_xtime" = "x"
556  then
557    AC_DEFINE(ut_xtime,ut_tv.tv_sec)
558  fi
559 fi
560
561 dnl #############################################################
562 dnl #
563 dnl #  6. Checks for compiler characteristics
564 dnl #
565 dnl #############################################################
566
567 dnl #
568 dnl # Ensure that these are defined
569 dnl #
570 AC_C_CONST 
571
572 dnl #
573 dnl # See if this is OS/2
574 dnl #
575 AC_MSG_CHECKING(type of OS)
576 OS=`uname -s`
577 AC_MSG_RESULT($OS)
578 if test "$OS" = "OS/2"; then
579         LIBPREFIX=
580 else
581         LIBPREFIX=lib
582 fi
583 AC_SUBST(LIBPREFIX)
584
585 dnl #
586 dnl # Set Default CFLAGS
587 dnl #
588 if test "x$GCC" = "xyes"; then
589     CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
590 fi
591
592 AC_MSG_CHECKING(for developer gcc flags)
593 if test "x$developer" = "xyes" -a "x$GCC" = "xyes"; then
594   devflags="-g -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs"
595   CFLAGS="$CFLAGS $devflags"
596   INSTALLSTRIP=""
597   AC_MSG_RESULT(yes.  Using $devflags)
598 else
599   devflags=""
600   CFLAGS="$CFLAGS -DNDEBUG"
601   INSTALLSTRIP="-s"
602   AC_MSG_RESULT(no.)
603 fi
604
605 dnl #############################################################
606 dnl #
607 dnl #  7. Checks for library functions
608 dnl #
609 dnl #############################################################
610
611 dnl Check for libcrypt
612 dnl We use crypt(3) which may be in libc, or in libcrypt (eg FreeBSD)
613 AC_CHECK_LIB(crypt, crypt,
614   CRYPTLIB="-lcrypt"
615 )
616 if test "$CRYPTLIB" != ""; then
617   AC_DEFINE(HAVE_CRYPT)
618 else
619   AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT))
620 fi
621
622 dnl Check for libcipher
623 AC_CHECK_LIB(cipher, setkey,
624    CRYPTLIB="${CRYPTLIB} -lcipher"
625 )
626 AC_SUBST(CRYPTLIB)
627
628 if test "x$WITH_SNMP" = "xyes"; then
629   SNMP_CHECKS
630 fi
631
632 gethostbyaddrrstyle=""
633 AC_MSG_CHECKING([gethostbyaddr_r() syntax])
634 AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL) ] , [
635         AC_DEFINE(GETHOSTBYADDRRSTYLE, SYSVSTYLE)
636         gethostbyaddrrstyle=SYSV
637 ])
638 AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr_r(NULL, 0, 0, NULL, NULL, 0, NULL, NULL) ], [
639         AC_DEFINE(GETHOSTBYADDRRSTYLE, GNUSTYLE)
640         gethostbyaddrrstyle=GNU
641 ])
642
643 AC_TRY_COMPILE([#include <netdb.h>], [ gethostbyaddr(NULL, 0, 0)  ], [
644         AC_DEFINE(GETHOSTBYADDRRSTYLE, BSDSTYLE)
645         gethostbyaddrrstyle=BSD
646 ])
647
648 if test "x$gethostbyaddrrstyle" = "x"; then
649         AC_MSG_RESULT([none!  It must not exist, here.])
650 else
651         AC_MSG_RESULT([${gethostbyaddrrstyle}-style])
652 fi
653
654
655 dnl #############################################################
656 dnl #
657 dnl #  8. Checks for system services
658 dnl #
659 dnl #############################################################
660
661 dnl #
662 dnl # Figure out where libtool is located,
663 dnl #
664 top_builddir=`pwd`
665 AC_MSG_RESULT([top_builddir=$top_builddir])
666 AC_SUBST(top_builddir)
667 AC_SUBST(LIBLTDL)
668 AC_SUBST(INCLTDL)
669
670 dnl #
671 dnl #  Work around stupid autoconf crap
672 dnl #
673 if test "x$INCLTDL" != "x";then
674   INCLTDL='-I${top_builddir}/''libltdl'
675 fi
676
677 dnl import libtool stuff
678
679 dnl #############################################################
680 dnl #
681 dnl #  Configure in any module directories.
682 dnl #
683 dnl #############################################################
684
685 mysubdirs=
686 if test "x$EXPERIMENTAL" = "xyes"; then
687   for foo in `find src/modules -name configure -print`; do
688     bar=`echo $foo | sed 's%/configure$%%g'`
689     mysubdirs="$mysubdirs $bar"
690   done
691 else
692    dnl # 
693    dnl # Find 'configure' in ONLY the stable modules
694    dnl # 
695    for foo in `find \`cat src/modules/stable | sed 's%rlm%src/modules/rlm%g'\` -name configure -print`; do
696     bar=`echo $foo | sed 's%/configure$%%g'`
697     mysubdirs="$mysubdirs $bar"
698   done
699 fi
700
701 dnl ############################################################
702 dnl # make modules by list
703 dnl #############################################################
704 MODULES=
705 if test "x$EXPERIMENTAL" = "xyes"; then
706   for foo in `ls src/modules | grep rlm_`; do
707     MODULES="$MODULES $foo"
708   done
709 else
710    dnl #
711    dnl # make ONLY the stable modules
712    dnl #
713    for foo in `cat src/modules/stable`; do
714     MODULES="$MODULES $foo"
715    done
716 fi
717
718 dnl #
719 dnl #  Don't change the variable name here.  Autoconf goes bonkers
720 dnl #  if you do.
721 dnl #
722 AC_CONFIG_SUBDIRS($mysubdirs)
723 AC_SUBST(MODULES)
724
725 dnl #############################################################
726 dnl #
727 dnl #  And finally, output the results.
728 dnl #
729 dnl #############################################################
730
731 dnl #
732 dnl #  Substitute whatever libraries we found to be necessary
733 dnl #
734 AC_SUBST(LIBS)
735 AC_SUBST(INSTALLSTRIP)
736
737 USE_SHARED_LIBS=$enable_shared
738 AC_SUBST(USE_SHARED_LIBS)
739 USE_STATIC_LIBS=$enable_static
740 AC_SUBST(USE_STATIC_LIBS)
741 AC_SUBST(STATIC_MODULES)
742 AC_SUBST(RADIUSD_MAJOR_VERSION)
743 AC_SUBST(RADIUSD_MINOR_VERSION)
744 AC_SUBST(RADIUSD_VERSION)
745 export CFLAGS LIBS
746
747 AC_OUTPUT(\
748         ./Make.inc \
749         ./src/include/build-radpaths-h \
750         ./src/main/Makefile \
751         ./src/main/checkrad.pl \
752         ./src/main/radlast \
753         ./src/main/radtest \
754         ./scripts/rc.radiusd \
755         ./scripts/radwatch \
756         ./scripts/check-radiusd-config \
757         ./scripts/radiusd.cron.daily \
758         ./scripts/radiusd.cron.monthly \
759         ./scripts/cryptpasswd \
760         ./raddb/radiusd.conf
761 )
762
763 AC_OUTPUT_COMMANDS([echo timestamp > src/include/stamp-h])
764 AC_OUTPUT_COMMANDS([(cd ./src/include && /bin/sh ./build-radpaths-h)])
765 AC_OUTPUT_COMMANDS([(cd ./src/main   && chmod +x checkrad.pl radlast radtest)])
766 AC_OUTPUT_COMMANDS([(cd ./scripts    && chmod +x rc.radiusd radwatch check-radiusd-config radiusd.cron.daily radiusd.cron.monthly cryptpasswd)])
767 AC_OUTPUT_COMMANDS([
768 cat >> src/include/autoconf.h <<EOF
769
770 #define HOSTINFO        "$host"
771 #define RADIUSD_VERSION "$RADIUSD_VERSION"
772 EOF
773 ],host=$host)