File: configure.ac

package info (click to toggle)
maildrop 2.9.3-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,104 kB
  • sloc: ansic: 26,822; cpp: 9,085; sh: 4,868; makefile: 753; perl: 94
file content (79 lines) | stat: -rw-r--r-- 1,624 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
dnl Process this file with autoconf to produce a configure script.
dnl
dnl Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for
dnl distribution information.

AC_INIT(bdbobj, 0.10, [courier-users@lists.sourceforge.net])

>confdefs.h  # Kill PACKAGE_ macros

AC_CONFIG_SRCDIR(bdbobj.h)
AC_CONFIG_AUX_DIR(../..)
AM_INIT_AUTOMAKE([foreign no-define])
AC_CONFIG_HEADERS(config.h)

dnl Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_PROG_AWK
AC_PROG_CXX
AC_ISC_POSIX
AC_PROG_LIBTOOL

dnl Checks for libraries.

saveLIBS="$LIBS"
AC_CHECK_LIB(db, dbopen, [ LIBDB=-ldb ; LIBS="-ldb $LIBS" ],
	AC_CHECK_LIB(db, db_open, [ LIBDB=-ldb ; LIBS="-ldb $LIBS"],
	AC_CHECK_LIB(db, db_env_create, [ LIBDB=-ldb; LIBS="-ldb $LIBS"])
	))

FOUND_DB=0
AC_CHECK_FUNC(dbopen, FOUND_DB=1)
AC_CHECK_FUNC(db_open, FOUND_DB=1)
AC_CHECK_FUNC(db_env_create, FOUND_DB=1)

LIBS="$saveLIBS"

AC_SUBST(LIBDB)

AM_CONDITIONAL(FOUND_DB, test "$FOUND_DB" != 0)

dnl Checks for header files.

AC_CHECK_HEADERS(limits.h fcntl.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_SYS_LARGEFILE

AC_LANG_CPLUSPLUS
AC_CACHE_CHECK([if the C++ compiler needs -fhandle-exceptions],
	ac_cv_need_handlexceptions,

AC_TRY_COMPILE([],
[
throw;
], ac_cv_need_handlexceptions=no,
ac_cv_need_handlexceptions=yes)
)

if test "$ac_cv_need_handlexceptions" = "yes"
then
	case "$CXXFLAGS" in
	*handle-exceptions*)
		;;
	*)
		CXXFLAGS="-fhandle-exceptions $CXXFLAGS"
		CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2//'`
		;;
	esac
fi

if test "$GCC" = "yes"
then
	CFLAGS="-Wall $CFLAGS"
fi

AC_OUTPUT(Makefile)