Linux porting changes
[shibboleth/sp.git] / configure.ac
1 AC_PREREQ([2.50])
2 AC_INIT([shibboleth], [2.0], [shibboleth-users@internet2.edu], [shibboleth])
3 AM_CONFIG_HEADER(config.h)
4 AM_INIT_AUTOMAKE([shibboleth],[2.0])
5
6 sinclude(acx_pthread.m4)
7
8 AC_ARG_ENABLE(debug,
9     AC_HELP_STRING(--enable-debug, [Have GCC compile with symbols (Default = no)
10 ]),
11     enable_debug=$enableval, enable_debug=no)
12
13 if test "$enable_debug" = "yes" ; then
14     GCC_CFLAGS="$CFLAGS -g -D_DEBUG"
15     GCC_CXXFLAGS="$CXXFLAGS -g -D_DEBUG"
16 else
17     GCC_CFLAGS="$CFLAGS -O2 -DNDEBUG"
18     GCC_CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG"
19 fi
20
21 AC_PROG_CC([gcc gcc3 cc])
22 AC_PROG_CXX([g++ g++3 c++ CC])
23
24 if test "$GCC" = "yes" ; then
25 #    AC_HAVE_GCC_VERSION(4,0,0,0,
26 #        [
27 #        AC_DEFINE(GCC_HASCLASSVISIBILITY,1,
28 #            [Define to enable class visibility control in gcc.])
29 #        GCC_CFLAGS="$GCC_CFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
30 #        GCC_CXXFLAGS="$GCC_CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden"
31 #        ])
32     CFLAGS="-Wall $GCC_CFLAGS"
33     CXXFLAGS="-Wall $GCC_CXXFLAGS"
34 else
35 # Fix for Sun Workshop compiler in debug mode, may be Sun case #6360993
36         case "${host_cpu}-${host_os}" in
37                 *solaris*)
38                         if test "$CXX" = "CC" ; then
39                                 CXXFLAGS="$CXXFLAGS -Qoption ccfe -stabs=no%dfltlit+no%dflthlp"
40                         fi
41                 ;;
42         esac
43 fi
44
45 AC_DISABLE_STATIC
46 AC_PROG_LIBTOOL
47
48 AC_LANG(C)
49
50 # Checks for typedefs, structures, and compiler characteristics.
51 AC_C_CONST
52 AC_TYPE_SIZE_T
53 AC_STRUCT_TM
54
55 # Checks for library functions.
56 AC_FUNC_STRFTIME
57 AC_FUNC_STRERROR_R
58 AC_CHECK_FUNCS([strchr strdup strstr gmtime_r ctime_r strtok_r strcasecmp])
59
60 # checks for pthreads
61 ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"])
62 if test $enable_threads != "pthread"; then
63     AC_MSG_ERROR([unable to find pthreads, currently this is required])
64 else
65     AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
66     LIBS="$PTHREAD_LIBS $LIBS"
67     CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
68     CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS"
69 fi
70
71 AC_LANG(C++)
72
73 # C++ requirements
74 AC_CXX_REQUIRE_STL
75 AC_CXX_NAMESPACES
76
77 # log4cpp settings
78 AC_PATH_PROG(LOG4CPP_CONFIG,log4cpp-config)
79 AC_ARG_WITH(log4cpp,
80             AC_HELP_STRING([--with-log4cpp=PATH], [where log4cpp is installed]),
81             [LOG4CPP_CONFIG="${with_log4cpp}/bin/log4cpp-config"])
82 if test -f "${LOG4CPP_CONFIG}"; then
83     LDFLAGS="`${LOG4CPP_CONFIG} --libs` $LDFLAGS"
84     CPPFLAGS="`${LOG4CPP_CONFIG} --cflags` $CPPFLAGS"
85 else
86     AC_MSG_WARN([log4cpp-config not found, guessing at log4cpp build settings])
87     LIBS="-llog4cpp $LIBS"
88 fi
89 AC_CHECK_HEADER([log4cpp/Category.hh],,AC_MSG_ERROR([unable to find log4cpp header files]))
90 AC_TRY_LINK(
91         [#include <log4cpp/Category.hh>],
92         [log4cpp::Category::getInstance("foo")],
93         [AC_DEFINE(HAVE_LIBLOG4CPP,1,[Define if log4cpp library was found])],
94         [AC_MSG_ERROR([unable to link with log4cpp])])
95
96 # Xerces settings
97 AC_ARG_WITH(xerces, 
98             AC_HELP_STRING([--with-xerces=PATH], [where xerces-c is installed]),
99             [if test x_$with_xerces != x_/usr; then
100                 LDFLAGS="-L${with_xerces}/lib $LDFLAGS"
101                 CPPFLAGS="-I${with_xerces}/include $CPPFLAGS"
102             fi])
103 LIBS="-lxerces-c $LIBS"
104 AC_CHECK_HEADER([xercesc/dom/DOM.hpp],,
105                 AC_MSG_ERROR([unable to find xerces header files]))
106 AC_MSG_CHECKING([Xerces version])
107 AC_PREPROC_IFELSE(
108     [AC_LANG_PROGRAM([#include <xercesc/util/XercesVersion.hpp>],
109 [#if  _XERCES_VERSION != 20600
110 int i = 0;
111 #else
112 #error cannot use version 2.6.0
113 #endif])],
114     [AC_MSG_RESULT(OK)],
115     [AC_MSG_FAILURE([Xerces-C v2.6.0 has bugs that inhibit use with signed XML, please use a newer version])])
116 AC_TRY_LINK(
117         [#include <xercesc/util/PlatformUtils.hpp>],
118         [xercesc::XMLPlatformUtils::Initialize()],
119         [AC_DEFINE(HAVE_LIBXERCESC,1,[Define if Xerces-C library was found])],
120         [AC_MSG_ERROR([unable to link with Xerces])])
121
122
123 # XML-Security settings
124 AC_ARG_WITH(xmlsec,
125             AC_HELP_STRING([--with-xmlsec=PATH], [where xmlsec is installed]),,
126             [with_xmlsec=/usr])
127
128 if test x_$with_xmlsec != x_/usr; then
129     LDFLAGS="-L${with_xmlsec}/lib $LDFLAGS"
130     CPPFLAGS="-I${with_xmlsec}/include $CPPFLAGS"
131 fi        
132 XMLSEC_LIBS="-lxml-security-c"
133
134 # save and append master libs
135 save_LIBS="$LIBS"
136 LIBS="$XMLSEC_LIBS $LIBS"
137
138 AC_CHECK_HEADER([xsec/utils/XSECPlatformUtils.hpp],,AC_MSG_ERROR([unable to find XML-Security header files]))
139 AC_MSG_CHECKING([XML-Security version])
140 AC_PREPROC_IFELSE(
141     [AC_LANG_PROGRAM([#include <xsec/utils/XSECPlatformUtils.hpp>],
142     [#if XSEC_VERSION_MAJOR > 1 || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM > 3) || (XSEC_VERSION_MAJOR == 1 && XSEC_VERSION_MEDIUM == 3 && XSEC_VERSION_MINOR > 0)
143 int i = 0;
144 #else
145 #error need version 1.3.1 or later
146 #endif])],
147     [AC_MSG_RESULT(OK)],
148     [AC_MSG_FAILURE([XML-Security version 1.3.1 or greater is required.])])
149 AC_TRY_LINK(
150         [#include <xsec/utils/XSECPlatformUtils.hpp>],
151         [XSECPlatformUtils::Initialise()],,
152         [AC_MSG_ERROR([unable to link with XML-Sec])])
153
154 # restore master libs
155 LIBS="$save_LIBS"
156
157 # OpenSAML settings
158 AC_ARG_WITH(saml,
159     AC_HELP_STRING([--with-saml=PATH], [where saml is installed]),
160     [if test x_$with_saml != x_/usr; then
161         LDFLAGS="-L${with_saml}/lib $LDFLAGS"
162         CPPFLAGS="-I${with_saml}/include $CPPFLAGS"
163     fi])
164 XMLSEC_LIBS="-lsaml $XMLSEC_LIBS"
165
166 # save and append master libs
167 save_LIBS="$LIBS"
168 LIBS="$XMLSEC_LIBS $LIBS"
169
170 AC_CHECK_HEADER([saml/saml.h],,
171                 AC_MSG_ERROR([unable to find saml header files]))
172 AC_TRY_LINK(
173         [#include <saml/SAMLConfig.h>
174 #include <saml/version.h>],
175         [#if _OPENSAML_VERSION >= 20000
176 opensaml::SAMLConfig::getConfig();
177 #else
178 #error Need OpenSAML version 2.0 or higher
179 #endif],
180         [AC_DEFINE(HAVE_SAML,1,[Define if saml library was found])],
181         [AC_MSG_ERROR([unable to link with OpenSAML, or version was too old])])
182
183 # restore master libs
184 LIBS="$save_LIBS"
185
186 AC_SUBST(XMLSEC_LIBS)
187
188 # output the underlying makefiles
189 WANT_SUBDIRS="doc schemas configs shibsp shibd util"
190 AC_CONFIG_FILES([Makefile doc/Makefile schemas/Makefile \
191         configs/Makefile shibsp/Makefile shibd/Makefile \
192         util/Makefile selinux/Makefile])
193
194 #
195 # Build NSAPI module?
196 #
197 AC_MSG_CHECKING(for NSAPI module option)
198 AC_ARG_WITH(nsapi,
199         AC_HELP_STRING([--with-nsapi=DIR], [Build NSAPI module for Netscape/iPlanet/SunONE]),
200         [WANT_NSAPI=$withval],[WANT_NSAPI=no])
201 AC_MSG_RESULT($WANT_NSAPI)
202
203 if test "$WANT_NSAPI" != "no"; then
204   if test ! -d $WANT_NSAPI/bin ; then
205     AC_MSG_ERROR(Please specify the path to the root of your Netscape/iPlanet/SunONE server using --with-nsapi=DIR)
206   fi
207   AC_MSG_CHECKING(for NSAPI include files)
208   if test -d $WANT_NSAPI/include ; then
209     NSAPI_INCLUDE=$WANT_NSAPI/include
210     AC_MSG_RESULT(Netscape-Enterprise 3.x style)
211     AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
212     NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
213   fi
214   if test -d $WANT_NSAPI/plugins/include ; then
215     test -n "$NSAPI_INCLUDE" && NSAPI_INC_DIR="-I$NSAPI_INCLUDE"
216     NSAPI_INCLUDE="$WANT_NSAPI/plugins/include"
217     AC_MSG_RESULT(iPlanet 4.x / SunONE 6.x style)
218     AC_CHECK_HEADERS([$NSAPI_INCLUDE/nsapi.h])
219     NSAPI_INCLUDE="$NSAPI_INC_DIR -I$NSAPI_INCLUDE"
220   fi
221   if test "$NSAPI_INCLUDE" = ""; then
222     AC_MSG_ERROR(Please check you have nsapi.h in either $WANT_NSAPI/include or $WANT_NSAPI/plugins/include)
223   fi
224 fi
225
226 AC_SUBST(NSAPI_INCLUDE)
227
228 # always output the Makefile, even if you don't use it
229 AC_CONFIG_FILES([nsapi_shib/Makefile])
230 AM_CONDITIONAL(BUILD_NSAPI,test ! "$WANT_NSAPI" = "no")
231
232 # add the NSAPI module to the list of wanted subdirs..
233 if test ! "$WANT_NSAPI" = "no" ; then
234     WANT_SUBDIRS="$WANT_SUBDIRS nsapi_shib"
235 fi
236
237 #
238 # If no --enable-apache-xx specified 
239 # find a default and fake the specific parameters
240 #
241
242 # simple macro to peek at an enable or a with
243 AC_DEFUN([Peek],
244 if test "[${[$1]_][$2]+set}" = set; then
245   peekval="${[$1]_[$2]}"
246   $3
247 fi; dnl
248 )
249
250 AC_MSG_CHECKING(if default apache needed)
251 need_default=yes
252 Peek(enable,apache_13,need_default=no)
253 Peek(enable,apache_20,need_default=no)
254 Peek(enable,apache_22,need_default=no)
255 AC_MSG_RESULT($need_default)
256
257 if test "$need_default" = "yes"; then
258   # find an apxs, then the httpd
259   xs=
260   Peek(with,apxs,xs="$peekval")
261   Peek(with,apxs2,xs="$peekval")
262   Peek(with,apxs22,xs="$peekval")
263   if test "x$xs" = "x"; then
264      AC_PATH_PROGS(xs, apxs2 apxs,
265         AC_MSG_ERROR(No apxs, no apache found.  Try --with-apxs),
266         [/usr/local/apache2/bin:/usr/local/apache/bin:/usr/sbin:$PATH])
267   fi
268   # ask the daemon for the version and set parameters
269   AC_MSG_CHECKING(default apache version)
270   httpd="`$xs -q SBINDIR`/`$xs -q TARGET`"
271   if test "x$httpd" != "x"; then
272      v=`$httpd -v|$SED -n -e 's/.*Apache\/\.*//p'`
273      case $v in
274        1.3*)   [enable_apache_13]=yes
275                [with_apxs]=$xs
276                AC_MSG_RESULT(1.3)
277                ;;
278        2.0*)   [enable_apache_20]=yes
279                [with_apxs2]=$xs
280                AC_MSG_RESULT(2.0)
281                ;;
282        2.2*)   [enable_apache_22]=yes
283                [with_apxs22]=$xs
284                AC_MSG_RESULT(2.2)
285                ;;
286        *)      AC_MSG_ERROR(unusable apache versions: $v. Try setting --with-apxs)
287      esac
288   else 
289      AC_MSG_RESULT(cannot determine version.  Try setting --with-apxs)
290   fi
291 fi
292
293 # Apache 1.3 (mod_shib_13)
294 #   --enable-apache-13
295 #   --with-apxs      (DSO build, the normal way, uses apxs to derive build flags)
296
297 AC_ARG_ENABLE(apache-13,
298         AC_HELP_STRING([--enable-apache-13], [enable the Apache 1.3 module]),
299         [ if test "x$enableval" = "x" ; then
300               WANT_APACHE_13=yes
301           else
302               WANT_APACHE_13="$enableval"
303           fi
304         ],[ WANT_APACHE_13=no ])
305 AC_MSG_CHECKING(whether to build Apache 1.3 module)
306 if test "$WANT_APACHE_13" != yes && test "$WANT_APACHE_13" != no ; then
307    WANT_APACHE_13=yes
308 fi
309 AC_MSG_RESULT($WANT_APACHE_13)
310
311 if test "$WANT_APACHE_13" = "yes" ; then
312     AC_ARG_WITH(apxs, 
313         AC_HELP_STRING([--with-apxs=FILE], [Specifies where to find the Apache 1.3 apxs script.]),
314         [
315         AC_MSG_CHECKING(for user-specified apxs name/location)
316         if test "$withval" != "no" ; then
317           if test "$withval" != "yes"; then
318             APXS=$withval
319             AC_MSG_RESULT("$withval")
320           fi
321         fi
322         ],
323         [
324         AC_PATH_PROG(APXS, apxs, no)
325         if test "$APXS" = "no" ; then
326           for i in /usr/sbin /usr/local/apache/bin ; do
327             if test "$APXS" = "no" && test -f "$i/apxs"; then
328               APXS="$i/apxs"
329             fi
330           done
331         fi
332         ])
333
334     AC_MSG_CHECKING([to see if apxs was located])
335     if test ! -f "$APXS" ; then
336         AC_MSG_RESULT(no)
337         AC_MSG_ERROR([Unable to locate apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs option.])
338     fi
339     AC_MSG_RESULT($APXS)
340     AC_SUBST(APXS)
341
342     # extract settings we need from APXS -q
343     APXS_CC="`$APXS -q CC`"
344     APXS_CFLAGS="`$APXS -q CPPFLAGS` `$APXS -q CFLAGS` `$APXS -q CFLAGS_SHLIB`"
345     APXS_INCLUDE="`$APXS -q INCLUDEDIR`"
346 fi
347
348 AC_SUBST(APXS_CFLAGS)
349 AC_SUBST(APXS_INCLUDE)
350
351
352 # Apache 2.0 (mod_shib_20)
353 #   --enable-apache-20
354 #   --with-apxs2      (DSO build, the normal way, uses apxs to derive build flags)
355 #       --with-apr        (DSO build, APR development package installed separately)
356
357 AC_ARG_ENABLE(apache-20,
358         AC_HELP_STRING([--enable-apache-20], [enable the Apache 2.0 module]),
359         [ if test "x$enableval" = "x" ; then
360               WANT_APACHE_20=yes
361           else
362               WANT_APACHE_20="$enableval"
363           fi
364         ],[ WANT_APACHE_20=no ])
365 AC_MSG_CHECKING(whether to build Apache 2.0 module)
366 if test "$WANT_APACHE_20" != yes && test "$WANT_APACHE_20" != no ; then
367    WANT_APACHE_20=yes
368 fi
369 AC_MSG_RESULT($WANT_APACHE_20)
370
371 if test "$WANT_APACHE_20" = "yes" ; then
372     AC_ARG_WITH(apxs2, 
373         AC_HELP_STRING([--with-apxs2=FILE], [Specifies where to find the Apache 2.0 apxs script.]),
374         [
375         AC_MSG_CHECKING(for user-specified Apache2 apxs name/location)
376         if test "$withval" != "no" ; then
377           if test "$withval" != "yes"; then
378             APXS2=$withval
379             AC_MSG_RESULT("$withval")
380           fi
381         fi
382         ],
383         [
384         AC_PATH_PROG(APXS2, apxs2, no)
385         if test "$APXS2" = "no" ; then
386             AC_PATH_PROG(APXS2, apxs, no)
387         fi
388         if test "$APXS2" = "no" ; then
389           for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
390             if test "$APXS2" = "no" && test -f "$i/apxs2" ; then
391               APXS2="$i/apxs2"
392             fi
393           done
394           if test "$APXS2" = "no" ; then
395             for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
396               if test "$APXS2" = "no" && test -f "$i/apxs" ; then
397                 APXS2="$i/apxs"
398               fi
399             done
400           fi
401         fi
402         ])
403
404     AC_MSG_CHECKING([to see if Apache2 apxs was located])
405     if test ! -f "$APXS2" ; then
406         AC_MSG_RESULT(no)
407         AC_MSG_ERROR([Unable to locate Apache2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs2 option.])
408     fi
409     AC_MSG_RESULT($APXS2)
410     AC_SUBST(APXS2)
411
412     # APR settings
413     AC_ARG_WITH(apr, 
414         AC_HELP_STRING([--with-apr=PATH], [where apr-config is installed]),
415         [
416         AC_MSG_CHECKING(for user-specified apr-config name/location)
417         if test "$withval" != "no" ; then
418             if test "$withval" != "yes"; then
419                 APR_CONFIG=$withval
420                 AC_MSG_RESULT("$withval")
421             fi
422         fi
423         ],
424         [
425         AC_PATH_PROG(APR_CONFIG, apr-config)
426         ])
427         if test -f "${APR_CONFIG}"; then
428         APR_CFLAGS="`${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags` `${APR_CONFIG} --includes`"
429     else
430         AC_MSG_ERROR([Unable to locate apr-config, may need --with-apr option.])
431     fi
432
433     # extract settings we need from APXS2 -q
434     APXS2_CC="`$APXS2 -q CC`"
435     APXS2_CFLAGS="`$APXS2 -q CPPFLAGS` `$APXS2 -q CFLAGS` `$APXS2 -q CFLAGS_SHLIB` $APR_CFLAGS"
436     APXS2_INCLUDE="`$APXS2 -q INCLUDEDIR`"
437 fi
438
439 AC_SUBST(APXS2_CFLAGS)
440 AC_SUBST(APXS2_INCLUDE)
441
442
443 # Apache 2.2 (mod_shib_22)
444 #   --enable-apache-22
445 #   --with-apxs22     (DSO build, the normal way, uses apxs to derive build flags)
446 #       --with-apr1       (DSO build, APR development package installed separately)
447
448 AC_ARG_ENABLE(apache-22,
449         AC_HELP_STRING([--enable-apache-22], [enable the Apache 2.2 module]),
450         [ if test "x$enableval" = "x" ; then
451               WANT_APACHE_22=yes
452           else
453               WANT_APACHE_22="$enableval"
454           fi
455         ],[ WANT_APACHE_22=no ])
456 AC_MSG_CHECKING(whether to build Apache 2.2 module)
457 if test "$WANT_APACHE_22" != yes && test "$WANT_APACHE_22" != no ; then
458    WANT_APACHE_22=yes
459 fi
460 AC_MSG_RESULT($WANT_APACHE_22)
461
462 if test "$WANT_APACHE_22" = "yes" ; then
463     AC_ARG_WITH(apxs22, 
464         AC_HELP_STRING([--with-apxs22=FILE], [Specifies where to find the Apache 2.2 apxs script.]),
465         [
466         AC_MSG_CHECKING(for user-specified Apache2.2 apxs name/location)
467         if test "$withval" != "no" ; then
468           if test "$withval" != "yes"; then
469             APXS22=$withval
470             AC_MSG_RESULT("$withval")
471           fi
472         fi
473         ],
474         [
475         AC_PATH_PROG(APXS22, apxs2, no)
476         if test "$APXS22" = "no" ; then
477             AC_PATH_PROG(APXS22, apxs, no)
478         fi
479         if test "$APXS22" = "no" ; then
480           for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
481             if test "$APXS22" = "no" && test -f "$i/apxs2" ; then
482               APXS22="$i/apxs2"
483             fi
484           done
485           if test "$APXS22" = "no" ; then
486             for i in /usr/sbin /usr/local/apache2/bin /usr/local/apache/bin ; do
487               if test "$APXS22" = "no" && test -f "$i/apxs" ; then
488                 APXS22="$i/apxs"
489               fi
490             done
491           fi
492         fi
493         ])
494
495     AC_MSG_CHECKING([to see if Apache2.2 apxs was located])
496     if test ! -f "$APXS22" ; then
497         AC_MSG_RESULT(no)
498         AC_MSG_ERROR([Unable to locate Apache2.2 apxs script. An Apache development package may be missing from your server, or you may need to use the --with-apxs22 option.])
499     fi
500     AC_MSG_RESULT($APXS22)
501     AC_SUBST(APXS22)
502
503     # APR1 settings
504     AC_ARG_WITH(apr1, 
505         AC_HELP_STRING([--with-apr1=PATH], [where apr-1-config is installed]),
506         [
507         AC_MSG_CHECKING(for user-specified apr-1-config name/location)
508         if test "$withval" != "no" ; then
509             if test "$withval" != "yes"; then
510                 APR1_CONFIG=$withval
511                 AC_MSG_RESULT("$withval")
512             fi
513         fi
514         ],
515         [
516         AC_PATH_PROG(APR1_CONFIG, apr-1-config)
517         ])
518         if test -f "${APR1_CONFIG}"; then
519         APR1_CFLAGS="`${APR1_CONFIG} --cflags` `${APR1_CONFIG} --cppflags` `${APR1_CONFIG} --includes`"
520     else
521         AC_MSG_ERROR([Unable to locate apr-1-config, may need --with-apr1 option.])
522     fi
523
524     # extract settings we need from APXS22 -q
525     APXS22_CC="`$APXS22 -q CC`"
526     APXS22_CFLAGS="`$APXS22 -q CPPFLAGS` `$APXS22 -q CFLAGS` `$APXS22 -q CFLAGS_SHLIB` $APR1_CFLAGS"
527     APXS22_INCLUDE="`$APXS22 -q INCLUDEDIR`"
528 fi
529
530 AC_SUBST(APXS22_CFLAGS)
531 AC_SUBST(APXS22_INCLUDE)
532
533 # always output the Makefile, even if you don't use it
534 AC_CONFIG_FILES([apache/Makefile])
535 AM_CONDITIONAL(BUILD_AP13,test "$WANT_APACHE_13" = "yes")
536 AM_CONDITIONAL(BUILD_AP20,test "$WANT_APACHE_20" = "yes")
537 AM_CONDITIONAL(BUILD_AP22,test "$WANT_APACHE_22" = "yes")
538
539 # add the apache module to the list of wanted subdirs..
540 if test "$WANT_APACHE_13" = "yes" || test "$WANT_APACHE_20" = "yes" || test "$WANT_APACHE_22" = "yes" ; then
541     WANT_SUBDIRS="$WANT_SUBDIRS apache"
542 fi
543
544
545 #
546 # Implement the checks of the ODBC Credential Cache
547 #
548 # 1) Assume the user wants ODBC; if it's not found then just continue without
549 # 2) If the user specifically requested odbc, look for it and ERROR if not found
550 # 3) If the user specifically requested no-odbc, don't build it.
551 #
552
553 #AC_CONFIG_FILES([odbc_ccache/Makefile])
554
555 # determine whether we should enable the odbc ccache
556 #AC_ARG_ENABLE([odbc],
557 #       AC_HELP_STRING([--disable-odbc], [disable the ODBC Credential Cache]),
558 #       [odbc_enabled=$enableval], [odbc_enabled=default])
559
560 #if test "x$odbc_enabled" = "x" ; then
561 #   odbc_enabled=yes
562 #fi
563
564 # Are we trying to build ODBC?
565 #AC_MSG_CHECKING(whether to build the ODBC ccache)
566 #if test "$odbc_enabled" = "yes" ; then
567 #   build_odbc=yes
568 #   AC_MSG_RESULT(yes)
569 #elif test "$odbc_enabled" = "default" ; then
570 #   build_odbc=yes
571 #   AC_MSG_RESULT([yes, if it can be found])
572 #else
573 #   build_odbc=no
574 #   AC_MSG_RESULT(no)
575 #fi
576
577 # If we're trying to build ODBC, try to find the odbc_config program.
578 #if test "$build_odbc" = "yes" ; then
579 #   odbc_dir=""
580 #   AC_ARG_WITH(odbc,
581 #       AC_HELP_STRING([--with-odbc=PATH], [directory where odbc is installed]),
582 #           [if test "$with_odbc" = no ; then
583 #               AC_MSG_ERROR([Try running --disable-odbc instead.])
584 #             elif test "$with_odbc" != yes ; then
585 #               odbc_dir="$with_odbc/bin"
586 #             fi ])
587
588    # Try to find the mysql_config program
589 #   AC_PATH_PROG(ODBC_CONFIG, odbc_config, no, $odbc_dir $PATH )
590
591 #   if test "$ODBC_CONFIG" = no ; then
592 #      if test "$odbc_enabled" = "yes" ; then
593 #        AC_MSG_ERROR(Cannot find odbc_config)
594 #      else
595 #        AC_MSG_WARN(ODBC not found, skipping.)
596 #      fi
597 #   fi
598 #fi
599
600 #if test "$build_odbc" = yes ; then
601 #   ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
602 #   ODBC_CFLAGS=`eval echo $ODBC_CFLAGS`
603 #   ODBC_LIBS=`$ODBC_CONFIG --libs`
604 #   ODBC_LIBS=`eval echo $ODBC_LIBS`
605
606 #   save_CPPFLAGS="$CPPFLAGS"
607 #   CPPFLAGS="$CPPFLAGS $ODBC_CFLAGS"
608
609 #   AC_CHECK_HEADER([sql.h], [have_sql_h=yes], [have_sql_h=no])
610 #   if test "$have_sql_h" = no -a "$odbc_enabled" = "yes" ; then
611 #     AC_MSG_ERROR(unable to find ODBC header files)
612 #   fi
613
614 #   if test "$have_sql_h" = yes ; then
615 #      save_LIBS="$LIBS"
616 #      LIBS="$LIBS $ODBC_LIBS"
617 #      AC_MSG_CHECKING(if we can link againt ODBC)
618 #      AC_TRY_LINK(
619 #        [#include <sql.h>
620 #         #include <sqlext.h>
621 #         #include <stdio.h>],
622 #        [SQLSetEnvAttr(SQL_NULL_HANDLE, SQL_ATTR_CONNECTION_POOLING, (void*)SQL_CP_ONE_PER_HENV, 0)],
623 #        [have_odbc_libs=yes],
624 #        [have_odbc_libs=no])
625 #      LIBS="$save_LIBS"
626
627 #      if test "$have_odbc_libs" = no ; then
628 #         if test "$odbc_enabled" = "yes" ; then
629 #            AC_MSG_ERROR([unable to link with ODBC Library])
630 #         else
631 #            AC_MSG_RESULT(no, skipping ODBC)
632 #         fi
633 #      fi
634 #   fi
635
636 #   CPPFLAGS="$save_CPPFLAGS"
637 #fi
638
639 # if have_odbc_libs=yes then go ahead with building ODBC
640 #if test "$have_odbc_libs" = yes ; then
641 #   # this AC_MSG_RESULT is from above!
642 #   AC_MSG_RESULT(yes)
643 #   WANT_SUBDIRS="$WANT_SUBDIRS odbc_ccache"
644 #   AC_SUBST(ODBC_CFLAGS)
645 #   AC_SUBST(ODBC_LIBS)
646 #fi
647
648
649 AC_SUBST(WANT_SUBDIRS)
650
651 if test -n "$APXS_CC" && test "$APXS_CC" != "$CC" ; then
652   echo "=================================================================="
653   echo "WARNING: You have chosen to compile Apache-1.3 modules with a different"
654   echo "         compiler than the one used to compile Apache."
655   echo ""
656   echo "    Current compiler:      $CC"
657   echo "   Apache's compiler:      $APXS_CC"
658   echo ""
659   echo "This could cause problems."
660   echo "=================================================================="
661 fi
662
663 if test -n "$APXS2_CC" && test "$APXS2_CC" != "$CC" ; then
664   echo "=================================================================="
665   echo "WARNING: You have chosen to compile Apache-2.0 modules with a different"
666   echo "         compiler than the one used to compile Apache."
667   echo ""
668   echo "    Current compiler:      $CC"
669   echo "   Apache's compiler:      $APXS2_CC"
670   echo ""
671   echo "This could cause problems."
672   echo "=================================================================="
673 fi
674
675 if test -n "$APXS22_CC" && test "$APXS22_CC" != "$CC" ; then
676   echo "=================================================================="
677   echo "WARNING: You have chosen to compile Apache-2.2 modules with a different"
678   echo "         compiler than the one used to compile Apache."
679   echo ""
680   echo "    Current compiler:      $CC"
681   echo "   Apache's compiler:      $APXS22_CC"
682   echo ""
683   echo "This could cause problems."
684   echo "=================================================================="
685 fi
686
687 LIBTOOL="$LIBTOOL --silent"
688
689 AC_OUTPUT
690