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