source: npl/mailserver/dspam/dspam-3.10.2/configure.ac @ c5c522c

gcc484ntopperl-5.22
Last change on this file since c5c522c was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 25.7 KB
Line 
1dnl $Id: configure.ac,v 1.86 2011/06/28 00:13:48 sbajic Exp $
2dnl
3dnl    autoconf (GNU Autoconf) 2.59
4dnl    ltmain.sh (GNU libtool) 1.5.6
5dnl    automake (GNU automake) 1.9.2
6dnl
7AC_PREREQ(2.59)
8AC_COPYRIGHT([Copyright (C) 2002-2012 DSPAM Project])
9AC_INIT([dspam],[3.10.2],[dspam-devel@lists.sourceforge.net])
10AC_CONFIG_SRCDIR(./src)
11
12AM_INIT_AUTOMAKE([1.7 foreign])
13
14AC_CANONICAL_HOST
15
16#---------------------------------------------------------
17#       C language relative
18AC_LANG(C)
19AC_PROG_CC
20#AC_PROG_CPP
21AC_PROG_LIBTOOL
22AC_PROG_MAKE_SET
23
24AC_C_INLINE
25
26AC_DEFINE_UNQUOTED(CONFIGURE_ARGS, ["$ac_configure_args"],
27    [Configure Arguments])
28
29# Check for various flavors of varargs macros
30AC_MSG_CHECKING([for ISO C99 varargs macros in C])
31AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
32        [[
33            int a(int, int, int);
34#           define call_a(...) a(1,__VA_ARGS__)
35        ]],
36        [[ call_a(2,3); ]])
37    ],  dnl AC_LANG_PROGRAM() end
38    [
39        # action if-found
40        AC_MSG_RESULT([yes])
41        AC_DEFINE([HAVE_ISO_VARARGS], 1,
42                  [Define if you have ISO C99 vararg macros])
43    ],
44    [
45        # action if-not-found
46        AC_MSG_RESULT([no])
47    ])
48
49#---------------------------------------------------------
50#   Libc features
51#
52AC_CHECK_HEADERS(string.h)
53AC_CHECK_HEADERS(math.h)
54AC_CHECK_HEADERS(sys/time.h)
55AC_HEADER_TIME
56AC_CHECK_FUNCS(strlcpy)
57AC_CHECK_FUNCS(strsep)
58AC_CHECK_FUNCS(strtok_r)
59AC_CHECK_FUNCS(getpwnam_r)
60AC_CHECK_FUNCS(getpwuid_r)
61AC_CHECK_FUNCS([memcpy memset])
62AC_CHECK_FUNCS(localtime_r)
63DS_CHECK_FUNC_INET_NTOA_R
64AC_CHECK_FUNCS(strcasestr)
65
66LIBS=
67
68#   Daemon support
69#
70AC_ARG_ENABLE(daemon,
71    [AS_HELP_STRING(--enable-daemon,
72                        Enable support for DSPAM to run in --daemon mode
73                    )])
74AC_MSG_CHECKING([whether to enable daemon mode])
75case x"$enable_daemon" in
76    xyes)   # daemon output enabled explicity
77            ;;
78    xno)    # daemon output disabled explicity
79            ;;
80    x)      # daemon output disabled by default
81            enable_daemon=no
82            ;;
83    *)      AC_MSG_ERROR([unexpected value $enable_daemon for --{enable,disable}-daemon configure option])
84            ;;
85esac
86if test x"$enable_daemon" != xyes
87then
88    enable_daemon=no
89else
90    enable_daemon=yes    # overkill, but convenient
91    AC_DEFINE(DAEMON, 1, [Defined if daemon support is enabled])
92fi
93AC_MSG_RESULT([$enable_daemon])
94
95#
96#   Determine how to compile with pthreads support
97#
98if test x"$enable_daemon" = xyes
99then
100  DS_PTHREADS(PT_CPPFLAGS, PT_LDFLAGS, PT_LIBS, [success=yes], [success=no])
101  if test x"$success" != xyes
102  then
103    AC_MSG_FAILURE([unable to determine how to compile with pthreads])
104  fi
105fi
106
107CPPFLAGS="$CPPFLAGS $PT_CPPFLAGS"
108LDFLAGS="$LDFLAGS $PT_LDFLAGS"
109LIBS="$LIBS $PT_LIBS"
110
111#
112#   Network related libraries on Solaris is another game...
113#   Needed for dspam_ngstat and mysql driver.
114#
115AC_CHECK_HEADERS([sys/types.h sys/socket.h netinet/in.h arpa/inet.h])
116
117DS_NETLIBS(NETLIBS, [success=yes], [success=no])
118if test x"$success" != xyes
119then
120    AC_MSG_FAILURE([required libraries are not found or not usable])
121fi
122AC_SUBST(NETLIBS)
123
124#
125#   Dynamic linker libraries (usually -ldl)
126#
127DS_DLLIBS(DLLIBS, [success=yes], [success=no])
128if test x"$success" != xyes
129then
130    AC_MSG_FAILURE([required libraries are not found or not usable])
131fi
132AC_SUBST(DLLIBS)
133
134#---------------------------------------------------------
135#   DSPAM features
136#
137
138#
139#  SPLIT_CONFIG -- enable split configuration file support
140#
141DS_SPLIT_CONFIG()
142
143#
144#  EXT_LOOKUP -- enable external user lookup
145#
146DS_EXT_LOOKUP()
147
148#
149#   DSPAM_HOME -- directory where pre-user dictionaries, signatures,
150#              etc. should be stored.
151#
152#   This variable is AC_SUBST'ed, not AC_DEFINE'd because used not only
153#   for C-code, but for Makefile rules also.
154#
155### dspam_home='$(prefix)/var/dspam'
156dspam_home='$(prefix)/var/dspam'
157AC_ARG_WITH(dspam_home,
158    [AS_HELP_STRING(--with-dspam-home=DIR,
159                        [Specify directory where per-user dictionaries,
160                        signatures, etc. should be stored.]
161                        @<:@default: /var/dspam@:>@
162                    )],
163            [ dspam_home="$withval" ])
164AC_SUBST(dspam_home)
165AC_MSG_CHECKING([for dspam_home])
166AC_MSG_RESULT([$dspam_home])
167
168if test -d /var/dspam
169then
170  AC_MSG_WARN([the default location for dspam_home has changed. please be sure to update your configuration or filesystem to reflect this.])
171fi
172
173# DSPAM_HOME ownership
174AC_ARG_WITH(dspam_home_mode,
175    [AS_HELP_STRING(--with-dspam-home-mode=MODE,
176                        Set access mode for DSPAM_HOME[,] default 770
177                    )],
178    [ dspam_home_mode="$withval" ],
179    [ dspam_home_mode='770' ]
180    )
181AC_ARG_WITH(dspam_home_owner,
182    [AS_HELP_STRING(--with-dspam-home-owner=OWNER,
183                        Set owner for DSPAM_HOME[,] default root
184                    )],
185    [ dspam_home_owner="$withval" ],
186    [ dspam_home_owner='root' ]
187    )
188AC_ARG_WITH(dspam_home_group,
189    [AS_HELP_STRING(--with-dspam-home-group=GROUP,
190                        Set group for DSPAM_HOME[,] default mail
191                    )],
192    [ dspam_home_group="$withval" ],
193    [ dspam_home_group='mail' ]
194    )
195AC_SUBST(dspam_home_mode)
196AC_SUBST(dspam_home_owner)
197AC_SUBST(dspam_home_group)
198
199AC_ARG_WITH(logfile,
200    [AS_HELP_STRING(--with-logfile=LOGFILE,
201                        Set flat logfile pathname for logging
202                    )],
203    [ AC_DEFINE_UNQUOTED(LOGFILE, ["$withval"], [Logfile]) ],
204    [ logfile='' ]
205    )
206
207# dspam binary ownership
208case x"$host" in
209    *-freebsd*)     default_dspam_mode=4510;;
210    *)              default_dspam_mode=2510;;
211esac
212
213case "$host" in
214    *-linux*)       LDFLAGS="$LDFLAGS -rdynamic";;
215    *-freebsd*)     LDFLAGS="$LDFLAGS -rdynamic";;
216esac
217
218AC_ARG_WITH(dspam_mode,
219    [AS_HELP_STRING(--with-dspam-mode=MODE,
220                        Set access mode for dspam binary[,] default 2510
221                    )],
222    [ dspam_mode="$withval" ],
223    [ dspam_mode="$default_dspam_mode" ]
224    )
225AC_ARG_WITH(dspam_owner,
226    [AS_HELP_STRING(--with-dspam-owner=OWNER,
227                        Set owner for dspam binary[,] default root
228                    )],
229    [ dspam_owner="$withval" ],
230    [ dspam_owner='root' ]
231    )
232AC_ARG_WITH(dspam_group,
233    [AS_HELP_STRING(--with-dspam-group=GROUP,
234                        Set group for dspam binary[,] default mail
235                    )],
236    [ dspam_group="$withval" ],
237    [ dspam_group='mail' ]
238    )
239AC_SUBST(dspam_mode)
240AC_SUBST(dspam_owner)
241AC_SUBST(dspam_group)
242
243#
244#   Local delivery Agent
245#
246AC_MSG_CHECKING([which delivery agent to activate in dspam.conf])
247default_delivery_agent="/usr/bin/procmail"
248case "$host" in
249    *-linux*)       default_delivery_agent="/usr/bin/procmail";;
250    *-freebsd*)     default_delivery_agent="/usr/libexec/mail.local";;
251    *-solaris2*)    default_delivery_agent="/usr/bin/mail";;
252    *-cygwin*)      default_delivery_agent="/usr/bin/procmail";;
253esac
254AC_ARG_WITH(delivery_agent,
255    [AS_HELP_STRING(--with-delivery-agent=BINARY @<:@ARGS@:>@,
256                        Override the default delivery agent.  This sets only
257                        the default[,] which may be changed in dspam.conf.
258                    )],
259    [ delivery_agent="$withval" ],
260    [ delivery_agent="$default_delivery_agent" ]
261    )
262AC_MSG_RESULT([$delivery_agent])
263AC_SUBST(delivery_agent)
264
265#
266#   Trusted User Security
267#
268AC_ARG_ENABLE(trusted_user_security,
269    [AS_HELP_STRING(--disable-trusted-user-security,Disable trusted user security (enabled by default))])
270AC_MSG_CHECKING([whether to enable trusted user security])
271case x"$enable_trusted_user_security" in
272    xyes)   # trusted user security enabled explicity
273            ;;
274    xno)    # trusted user security disabled explicity
275            enable_trusted_user_security=no
276            ;;
277    x)      # trusted user security enabled by default
278            enable_trusted_user_security=yes
279            ;;
280    *)      AC_MSG_ERROR([unexpected value $enable_trusted_user_security for --{enable,disable}-trusted-user-security configure option])
281            ;;
282esac
283if test x"$enable_trusted_user_security" != xyes
284then
285    enable_trusted_user_security=no
286else
287    enable_trusted_user_security=yes    # overkill, but convenient
288    AC_DEFINE(TRUSTED_USER_SECURITY, 1,
289              [Defined if trusted user security are enabled])
290fi
291AC_MSG_RESULT([$enable_trusted_user_security])
292
293#           
294#   Clam/AV Support
295#
296AC_ARG_ENABLE(clamav,
297    [AS_HELP_STRING(--enable-clamav,
298                        Enable Clam/AV support for DSPAM.
299                    )])
300AC_MSG_CHECKING([whether to enable clamav])
301case x"$enable_clamav" in
302    xyes)   # clamav output enabled explicity
303            ;;
304    xno)    # clamav output disabled explicity
305            ;;
306    x)      # clamav output disabled by default
307            enable_clamav=no
308            ;;   
309    *)      AC_MSG_ERROR([unexpected value $enable_clamav for --{enable,disable}-clamav configure option])
310            ;;
311esac
312if test x"$enable_clamav" != xyes
313then
314    enable_clamav=no
315else
316    enable_clamav=yes    # overkill, but convenient
317    AC_DEFINE(CLAMAV, 1, [Defined if clamav is enabled])
318fi
319AC_MSG_RESULT([$enable_clamav])
320
321#
322#   Debug support
323#
324AC_ARG_ENABLE(debug,
325    [AS_HELP_STRING(--enable-debug,
326                        Enable debugging support for DSPAM.
327                        Don't enable this unless something needs testing!
328                    )])
329AC_MSG_CHECKING([whether to enable debug output])
330case x"$enable_debug" in
331    xyes)   # debug output enabled explicity
332            ;;
333    xno)    # debug output disabled explicity
334            ;;
335    x)      # debug output disabled by default
336            enable_debug=no
337            ;;
338    *)      AC_MSG_ERROR([unexpected value $enable_debug for --{enable,disable}-debug configure option])
339            ;;
340esac
341if test x"$enable_debug" != xyes
342then
343    enable_debug=no
344else
345    enable_debug=yes    # overkill, but convenient
346    AC_DEFINE(DEBUG, 1, [Defined if debug output is enabled])
347fi
348AC_MSG_RESULT([$enable_debug])
349
350#
351#   Enable syslog
352#
353AC_ARG_ENABLE(syslog,
354    [AS_HELP_STRING(--enable-syslog,
355                        Enable (or disable) syslog support
356                    )])
357AC_MSG_CHECKING([whether to enable syslog output])
358case x"$enable_syslog" in
359    xyes)   # enabled explicity
360            ;;
361    xno)    # disabled explicity
362            ;;
363    x)      # enabled by default
364            enable_syslog=yes
365            ;;
366    *)      AC_MSG_ERROR([unexpected value $enable_syslog for --{enable,disable}-syslog configure option])
367            ;;
368esac
369if test x"$enable_syslog" != xyes
370then
371    enable_syslog=no
372else
373    enable_syslog=yes    # overkill, but convenient
374    AC_DEFINE(USE_SYSLOG, 1, [Defined if syslog is enabled])
375fi
376AC_MSG_RESULT([$enable_syslog])
377
378#
379#   BNR Debug
380#
381AC_ARG_ENABLE(bnr-debug,
382    [AS_HELP_STRING(--enable-bnr-debug,
383                        Activates debugging output for Bayesian Noise Reduction
384                    )])
385AC_MSG_CHECKING([whether to enable debug output for BNR])
386case x"$enable_bnr_debug" in
387    xyes)   # enabled explicity
388            ;;
389    xno)    # disabled explicity
390            ;;
391    x)      # disabled by default
392            enable_bnr_debug=no
393            ;;
394    *)      AC_MSG_ERROR([unexpected value $enable_bnr_debug for --{enable,disable}-bnr-debug configure option])
395            ;;
396esac
397if test x"$enable_bnr_debug" != xyes
398then
399    enable_bnr_debug=no
400else
401    enable_bnr_debug=yes    # overkill, but convenient
402    AC_DEFINE(LIBBNR_DEBUG, 1, [Defined if BNR Debug is enabled])
403fi
404AC_MSG_RESULT([$enable_bnr_debug])
405
406
407#
408#   Homedir support
409#
410AC_ARG_ENABLE(homedir,
411    [AS_HELP_STRING(--enable-homedir,
412                        Enable home directory filesystem storage.
413                    )])
414AC_MSG_CHECKING([whether to enable home directory support])
415case x"$enable_homedir" in
416    xyes)   # homedir enabled explicity
417            ;;
418    xno)    # homedir disabled explicity
419            ;;
420    x)      # homedir disabled by default
421            enable_homedir=no
422            ;;
423    *)      AC_MSG_ERROR([unexpected value $enable_homedir for --{enable,disable}-homedir configure option])
424            ;;
425esac
426if test x"$enable_homedir" != xyes
427then
428    enable_homedir=no
429else
430    enable_homedir=yes    # overkill, but convenient
431    AC_DEFINE(HOMEDIR, 1, [Defined if home directory support is enabled])
432fi
433AC_MSG_RESULT([$enable_homedir])
434
435#
436#   MySQL4 Initialization
437#
438AC_ARG_ENABLE(mysql4-initialization,
439    [AS_HELP_STRING(--disable-mysql4-initialization,
440                        Performs Initialization and Cleanup of MySQL client
441                        libraries v4.1+.
442                    )])
443AC_MSG_CHECKING([whether to enable MySQL client initialization])
444case x"$enable_mysql4_initialization" in
445    xyes)   # enabled explicity
446            enable_mysql4_initialization=yes
447            ;;
448    xno)    # disabled explicity
449            enable_mysql4_initialization=no
450            ;;
451    x)      # disabled by default
452            enable_mysql4_initialization=yes
453            ;;
454    *)      AC_MSG_ERROR([unexpected value $enable_mysql4_initialization for --{enable,disable}-mysql4-initialization configure option])
455            ;;
456esac
457if test x"$enable_mysql4_initialization" != xyes
458then
459    enable_mysql4_initialization=no
460else
461    enable_mysql4_initialization=yes    # overkill, but convenient
462    AC_DEFINE(MYSQL4_INITIALIZATION, 1, [Defined if mysql4-initialization is enabled])
463fi
464AC_MSG_RESULT([$enable_mysql4_initialization])
465
466#
467#   Preferences Extension
468#   For storage drivers with preferences extension, the driver's extension is
469#   used instead of the built-in file-based function
470#
471AC_ARG_ENABLE(preferences-extension,
472    [AS_HELP_STRING(--enable-preferences-extension,
473                        Enable if storage driver supports preferences extension
474                    )])
475AC_MSG_CHECKING([whether to enable preferences-extension])
476case x"$enable_preferences_extension" in
477    xyes)   # enabled explicity
478            ;;
479    xno)    # disabled explicity
480            ;;
481    x)      # disabled by default
482            enable_preferences_extension=no
483            ;;
484    *)      AC_MSG_ERROR([unexpected value $enable_preferences_extension for --{enable,disable}-preferences-extension configure option])
485            ;;
486esac
487if test x"$enable_preferences_extension" != xyes
488then
489    enable_preferences_extension=no
490else
491    enable_preferences_extension=yes    # overkill, but convenient
492    AC_DEFINE(PREFERENCES_EXTENSION, 1, [Defined if storage driver supports preferences extension])
493fi
494AC_MSG_RESULT([$enable_preferences_extension])
495
496#
497#   Verbose debug output
498#
499AC_ARG_ENABLE(verbose-debug,
500    [AS_HELP_STRING(--enable-verbose-debug,
501                        Cause DSPAM produce verbose debug output and
502                        write them into LOGDIR/dspam.debug file.
503                        Implies '--enable-debug'.
504                        Never enable this for production builds!
505                    )])
506AC_MSG_CHECKING([whether to enable verbose debug output])
507case x"$enable_verbose_debug" in
508    xyes)   # debug output enabled explicity
509            ;;
510    xno)    # debug output disabled explicity
511            ;;
512    x)      # debug output disabled by default
513            enable_verbose_debug=no
514            ;;
515    *)      AC_MSG_ERROR([unexpected value $enable_verbose_debug for --{enable,disable}-verbose-debug configure option])
516            ;;
517esac
518if test x"$enable_verbose_debug" != xyes
519then
520    enable_verbose_debug=no
521else
522    enable_verbose_debug=yes    # overkill, but convenient
523    AC_DEFINE(DEBUG, 1, [Defined if debug output is enabled])
524    AC_DEFINE(VERBOSE, 1, [Defined if verbose debug output is enabled])
525fi
526AC_MSG_RESULT([$enable_verbose_debug])
527
528#
529#   Long Usernames
530#
531AC_ARG_ENABLE(long-usernames,
532    [AS_HELP_STRING(--enable-long-usernames,
533                        Cause DSPAM to support long usernames.  The default
534                        is to use the same length on usernames as the operating
535                        system.
536                    )])
537AC_MSG_CHECKING([whether to enable long usernames])
538case x"$enable_long_usernames" in
539    xyes)   # debug output enabled explicity
540            ;;
541    xno)    # debug output disabled explicity
542            ;;
543    x)      # debug output disabled by default
544            enable_long_usernames=no
545            ;;
546    *)      AC_MSG_ERROR([unexpected value $enable_long_usernames for --{enable,disable}-long-usernames configure option])
547            ;;
548esac
549if test x"$enable_long_usernames" != xyes
550then
551    enable_long_usernames=no
552else
553    enable_long_usernames=yes    # overkill, but convenient
554    AC_DEFINE(LONG_USERNAMES, 1, [Defined if long usernames is enabled])
555fi
556AC_MSG_RESULT([$enable_long_usernames])
557
558#
559#   Large scale implementation
560#
561AC_ARG_ENABLE(large-scale,
562    [AS_HELP_STRING(--enable-large-scale,Manage file structure for a large scale implementation)])
563AC_MSG_CHECKING([whether to enable large scale implementation])
564case x"$enable_large_scale" in
565    xyes)   # large-scale enabled explicitly
566            ;;
567    xno)    # large-scale disabled explicitly
568            ;;
569    x)      # large-scale disabled by default
570            enable_large_scale=no
571            ;;
572    *)      AC_MSG_ERROR([unexpected value $enable_large_scale for --{enable,disable}-large-scale configure option])
573            ;;
574esac
575if test x"$enable_large_scale" != xyes
576then
577    enable_large_scale=no
578else
579    enable_large_scale=yes    # overkill, but convenient
580    AC_DEFINE(LARGESCALE, 1, [Defined if large_scale is enabled])
581fi
582AC_MSG_RESULT([$enable_large_scale])
583
584#
585#   Domain Scale Filesystem
586#
587AC_ARG_ENABLE(domain-scale,
588    [AS_HELP_STRING(--enable-domain-scale,Manage file structure to support a domain implementation)])
589AC_MSG_CHECKING([whether to enable domain structure implementation])
590case x"$enable_domain_scale" in
591    xyes)   # domain-scale enabled explicitly
592            ;;
593    xno)    # domain-scale disabled explicitly
594            ;;
595    x)      # domain-scale disabled by default
596            enable_domain_scale=no
597            ;;
598    *)      AC_MSG_ERROR([unexpected value $enable_domain_scale for --{enable,disable}-domain-scale configure option])
599            ;;
600esac
601if test x"$enable_domain_scale" != xyes
602then
603    enable_domain_scale=no
604else
605    enable_domain_scale=yes    # overkill, but convenient
606    AC_DEFINE(DOMAINSCALE, 1, [Defined if domain_scale is enabled])
607fi
608AC_MSG_RESULT([$enable_domain_scale])
609
610if test x"$enable_domain_scale$enable_large_scale" = xyesyes
611then
612  AC_MSG_ERROR([you may not have domain-scale and large-scale implemented simultaneously])
613elif test x"$enable_domain_scale$enable_homedir" = xyesyes
614then
615  AC_MSG_ERROR([you may not have domain-scale and homedir implemented simultaneously])
616elif test x"$enable_large_scale$enable_homedir" = xyesyes
617then
618  AC_MSG_ERROR([you may not have large-scale and homedir implemented simultaneously])
619fi
620
621#
622#   Log Directory
623#
624
625logdir="$dspam_home/log"
626AC_ARG_WITH(logdir,
627    [AS_HELP_STRING(--with-logdir=DIR,
628                        Specify directory where logfiles are to be written.
629                        @<:@default: $dspam_home/log@:>@
630                    )],
631            [ logdir="$withval" ])
632AC_SUBST(logdir)
633AC_MSG_CHECKING([for logdir])
634AC_MSG_RESULT([$logdir])
635
636#---------------------------------------------------------
637#   storage driver selection
638storagedrv=hash_drv
639storage_drv_subdirs=""
640active_driver=""
641static_driver=yes
642AC_ARG_WITH(storage-driver,
643   [AS_HELP_STRING(--with-storage-driver=LIST,Specify storage drivers to enable. @<:@default: hash_drv@:>@)],
644    [ storagedrv="$withval" ])
645
646AC_MSG_CHECKING([which storage drivers to build])
647AC_MSG_RESULT([$storagedrv])
648
649#---------------------------------------------------------
650#   Libraries for storage drivers
651#
652
653ac_save_IFS=$IFS; IFS=,
654for drv in $storagedrv; do
655  IFS=$ac_save_IFS
656
657  if test x"$active_driver" = x
658  then
659    active_driver=$drv
660    AC_SUBST(active_driver)
661  else
662    static_driver=no
663  fi
664
665if test x"$drv" = xhash_drv
666then
667  hash_drv=yes
668  storage_drv_subdirs="$storage_drv_subdirs tools.hash_drv"
669fi
670
671if test x"$drv" = xmysql_drv
672then
673    DS_MYSQL(MYSQL_CPPFLAGS, MYSQL_LDFLAGS, MYSQL_LIBS,
674             [success=yes], [success=no])
675    if test x"$success" != xyes
676    then
677        AC_MSG_ERROR([Required version of libmysqlclient not found])
678    fi
679    libmysql_drv_cppflags="$MYSQL_CPPFLAGS $CPPFLAGS"
680    libmysql_drv_libs="$MYSQL_LIBS $LIBS"
681    libmysql_drv_ldflags="$MYSQL_LDFLAGS $LDFLAGS"
682
683    AC_SUBST(libmysql_drv_cppflags)
684    AC_SUBST(libmysql_drv_libs)
685    AC_SUBST(libmysql_drv_ldflags)
686    mysql_drv=yes
687    storage_drv_subdirs="$storage_drv_subdirs tools.mysql_drv"
688fi
689
690if test x"$drv" = xpgsql_drv
691then
692    DS_PGSQL(PGSQL_CPPFLAGS, PGSQL_LDFLAGS, PGSQL_LIBS,
693             [success=yes], [success=no])
694    if test x"$success" != xyes
695    then
696        AC_MSG_ERROR([Required version of libpq not found])
697    fi
698    libpgsql_drv_cppflags="$PGSQL_CPPFLAGS $CPPFLAGS"
699    libpgsql_drv_libs="$PGSQL_LIBS $LIBS"
700    libpgsql_drv_ldflags="$PGSQL_LDFLAGS $LDFLAGS"
701    AC_SUBST(libpgsql_drv_cppflags)
702    AC_SUBST(libpgsql_drv_libs)
703    AC_SUBST(libpgsql_drv_ldflags)
704    pgsql_drv=yes
705    storage_drv_subdirs="$storage_drv_subdirs tools.pgsql_drv"
706fi
707                                                                               
708if test x"$drv" = xsqlite_drv
709then
710    DS_SQLITE(SQLITE_CPPFLAGS, SQLITE_LDFLAGS, SQLITE_LIBS,
711              [sqlite_version_major], [], [],
712              [success=yes], [success=no])
713    if test x"$success" != xyes
714    then
715        AC_MSG_ERROR([Required version of libsqlite not found])
716    fi
717    if test x"$sqlite_version_major" != x2
718    then
719        AC_MSG_ERROR([Version mismatch: sqlite_drv requires libsqlite version 2])
720    fi
721
722    libsqlite_drv_cppflags="$SQLITE_CPPFLAGS $CPPFLAGS"
723    libsqlite_drv_libs="$SQLITE_LIBS $LIBS"
724    libsqlite_drv_ldflags="$SQLITE_LDFLAGS $LDFLAGS"
725    AC_SUBST(libsqlite_drv_cppflags)
726    AC_SUBST(libsqlite_drv_libs)
727    AC_SUBST(libsqlite_drv_ldflags)
728    sqlite_drv=yes
729    storage_drv_subdirs="$storage_drv_subdirs tools.sqlite_drv"
730fi
731
732if test x"$drv" = xsqlite3_drv
733then
734    DS_SQLITE3(SQLITE3_CPPFLAGS, SQLITE3_LDFLAGS, SQLITE3_LIBS,
735              [sqlite_version_major], [], [],
736              [success=yes], [success=no])
737    if test x"$success" != xyes
738    then
739        AC_MSG_ERROR([Required version of libsqlite not found])
740    fi
741    if test x"$sqlite_version_major" != x3
742    then
743        AC_MSG_ERROR([Version mismatch: sqlite3_drv requires libsqlite version 3])
744    fi
745
746    libsqlite3_drv_cppflags="$SQLITE3_CPPFLAGS $CPPFLAGS"
747    libsqlite3_drv_libs="$SQLITE3_LIBS $LIBS"
748    libsqlite3_drv_ldflags="$SQLITE3_LDFLAGS $LDFLAGS"
749    AC_SUBST(libsqlite3_drv_cppflags)
750    AC_SUBST(libsqlite3_drv_libs)
751    AC_SUBST(libsqlite3_drv_ldflags)
752    sqlite3_drv=yes
753    storage_drv_subdirs="$storage_drv_subdirs tools.sqlite_drv"
754fi
755done
756
757AM_CONDITIONAL([BUILD_DB4_DRV], [ test x"$db4_drv" = xyes ])
758AM_CONDITIONAL([BUILD_DB3_DRV], [ test x"$db3_drv" = xyes ])
759AM_CONDITIONAL([BUILD_HASH_DRV], [ test x"$hash_drv" = xyes ])
760AM_CONDITIONAL([BUILD_SQLITE_DRV], [ test x"$sqlite_drv" = xyes ])
761AM_CONDITIONAL([BUILD_SQLITE3_DRV], [ test x"$sqlite3_drv" = xyes ])
762AM_CONDITIONAL([BUILD_MYSQL_DRV], [ test x"$mysql_drv" = xyes ])
763AM_CONDITIONAL([BUILD_PGSQL_DRV], [ test x"$pgsql_drv" = xyes ])
764AM_CONDITIONAL([STATIC_DRIVER], [ test x"$static_driver" = xyes ])
765AM_CONDITIONAL([DYNAMIC_DRIVER], [ test x"$static_driver" = xno ])
766AM_CONDITIONAL([BUILD_EXT_LOOKUP], [ test x"$enable_external_lookup" = xyes ])
767
768AC_MSG_CHECKING([whether we are building a single, static storage driver])
769
770if test x"$static_driver" = xyes
771then
772AC_DEFINE([STATIC_DRIVER], 1,
773          [Define if using a single, statically linked storage driver])
774AC_MSG_RESULT([yes])
775CPPFLAGS="$CPPFLAGS $libmysql_drv_cppflags $libpgsql_drv_cppflags $libsqlite_drv_cppflags $libsqlite3_drv_cppflags $libhash_drv_cppflags"
776LIBS="$LIBS $libmysql_drv_libs $libpgsql_drv_libs $libsqlite_drv_libs $libsqlite3_drv_libs $libhash_drv_libs"
777LDFLAGS="$LDFLAGS $libmysql_drv_ldflags $libpgsql_drv_ldflags $libsqlite_drv_ldflags $libsqlite3_drv_ldflags $libhash_drv_ldflags"
778else
779AC_MSG_RESULT([no])
780fi
781 
782AC_SUBST(storage_drv_subdirs)
783
784if test x"$storage_drv_subdirs" = x
785then
786    AC_MSG_ERROR([no valid storage drivers specified])
787fi
788
789if test x"$enable_daemon" = xyes && test x"$mysql_drv" != xyes && test x"$pgsql_drv" != xyes && test x"$hash_drv" != xyes
790then
791  AC_MSG_ERROR([daemon mode requires one of the following storage drivers: mysql_drv pgsql_drv hash_drv])
792fi
793
794
795#---------------------------------------------------------
796#   Libraries (other)
797#
798
799#---------------------------------------------------------
800#   Documentation generation tools
801#
802### AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
803### AC_CHECK_PROG([HAVE_DOT], [dot], [yes], [no])
804### AM_CONDITIONAL([HAVE_DOXYGEN], [ test x"$HAVE_DOXYGEN" = xyes ])
805
806#----------------------------------------------------------
807# final cut
808#
809GCC_BUILD_OPTIONS
810
811AC_CONFIG_HEADERS(src/auto-config.h)
812AH_TOP([
813#ifndef __auto_config_h
814#define __auto_config_h
815])
816AH_BOTTOM([
817#endif /* !__auto_config_h */
818])
819
820AC_CONFIG_FILES([Makefile src/tools/Makefile webui/Makefile m4/Makefile])
821AC_CONFIG_FILES([src/tools.mysql_drv/Makefile])
822AC_CONFIG_FILES([txt/Makefile src/tools.pgsql_drv/Makefile ])
823AC_CONFIG_FILES([src/Makefile webui/cgi-bin/templates/Makefile])
824AC_CONFIG_FILES([webui/cgi-bin/templates/cs/Makefile])
825AC_CONFIG_FILES([webui/cgi-bin/templates/de/Makefile])
826AC_CONFIG_FILES([webui/cgi-bin/templates/es-es/Makefile])
827AC_CONFIG_FILES([webui/cgi-bin/templates/fr/Makefile])
828AC_CONFIG_FILES([webui/cgi-bin/templates/he/Makefile])
829AC_CONFIG_FILES([webui/cgi-bin/templates/pt-br/Makefile])
830AC_CONFIG_FILES([webui/cgi-bin/templates/ro/Makefile])
831AC_CONFIG_FILES([webui/cgi-bin/templates/ru/Makefile])
832AC_CONFIG_FILES([src/tools.sqlite_drv/Makefile man/Makefile])
833AC_CONFIG_FILES([src/dspam.pc src/dspam-uninstalled.pc])
834AC_CONFIG_FILES([doc/Makefile src/tools.hash_drv/Makefile])
835AC_CONFIG_FILES([webui/cgi-bin/Makefile webui/htdocs/Makefile])
836AC_CONFIG_FILES([contrib/Makefile])
837AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.