Delete trailing whitespace.
[freeradius.git] / src / modules / rlm_sql / configure.in
1 AC_PREREQ([2.53])
2 AC_INIT(rlm_sql.c)
3 AC_REVISION($Revision$)
4 AC_DEFUN(modname,[rlm_sql])
5
6 fail=
7 SMART_LIBS=
8 SMART_CLFAGS=
9 if test x$with_[]modname != xno; then
10
11         AC_PROG_CC
12
13         dnl extra argument: --with-experimental-modules
14         EXPERIMENTAL=
15         AC_ARG_WITH(experimental-modules,
16         [  --with-experimental-modules      Use experimental and unstable modules. (default=no) ],
17         [ case "$withval" in
18                 yes)
19                         EXPERIMENTAL=yes
20                         ;;
21                 *)
22         esac ]
23         )
24
25         mysubdirs=
26         if test "x$EXPERIMENTAL" = "xyes"; then
27           for foo in `find ./drivers -name configure -print`; do
28             bar=`echo $foo | sed 's%/configure$%%g'`
29             mysubdirs="$mysubdirs $bar"
30           done
31         else
32           for foo in `cat stable`; do
33             mysubdirs="$mysubdirs ./drivers/$foo"
34           done
35         fi
36
37         SQL_MODULES=
38         if test "x$EXPERIMENTAL" = "xyes"; then
39           for foo in `ls ./drivers | grep rlm`; do
40             SQL_MODULES="$SQL_MODULES $foo"
41           done
42         else
43           for foo in `cat stable`; do
44             SQL_MODULES="$SQL_MODULES $foo"
45           done
46         fi
47
48         dnl # don't ask... this is done to avoid autoconf stupidities.
49         ln -s ../../../install-sh install-sh
50
51         dnl #
52         dnl #  Don't change the variable name here.  Autoconf goes bonkers
53         dnl #  if you do.
54         dnl #
55         AC_CONFIG_SUBDIRS($mysubdirs)
56         rm install-sh
57
58         dnl #
59         dnl # Don't bother looking for errors in the child directories
60         dnl #
61
62         targetname=modname
63 else
64         targetname=
65         echo \*\*\* module modname is disabled.
66 fi
67
68 if test x"$fail" != x""; then
69         if test x"${enable_strict_dependencies}" = x"yes"; then
70                 AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.])
71         else
72                 AC_MSG_WARN([silently not building ]modname[.])
73                 AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.])
74                 if test x"$headersuggestion" != x; then
75                         AC_MSG_WARN([$headersuggestion])
76                 fi
77                 if test x"$libsuggestion" != x; then
78                         AC_MSG_WARN([$libsuggestion])
79                 fi
80                 targetname=""
81         fi
82 fi
83
84
85 sql_ldflags=$SMART_LIBS
86 sql_cflags=$SMART_CFLAGS
87 AC_SUBST(sql_ldflags)
88 AC_SUBST(sql_cflags)
89 AC_SUBST(targetname)
90 AC_SUBST(SQL_MODULES)
91 AC_OUTPUT(\
92         ./Makefile \
93         ./drivers/Makefile
94 )