Commit | Line | Data |
---|---|---|
d9898ee8 | 1 | dnl Process this file with autoconf to produce a configure script. |
d9898ee8 | 2 | dnl |
3 | dnl Copyright 1998 - 1999 Double Precision, Inc. See COPYING for | |
4 | dnl distribution information. | |
5 | ||
6 | AC_INIT(gdbmobj, 0.10, [courier-users@lists.sourceforge.net]) | |
7 | ||
8 | >confdefs.h # Kill PACKAGE_ macros | |
9 | ||
10 | AC_CONFIG_SRCDIR(gdbmobj.c) | |
b0322a85 | 11 | AC_CONFIG_AUX_DIR(../..) |
d9898ee8 | 12 | AM_INIT_AUTOMAKE([foreign no-define]) |
d50284c4 | 13 | AC_CONFIG_HEADERS(config.h) |
d9898ee8 | 14 | |
15 | dnl Checks for programs. | |
8d138742 | 16 | AC_USE_SYSTEM_EXTENSIONS |
d9898ee8 | 17 | AC_PROG_CC |
d9898ee8 | 18 | AC_ISC_POSIX |
19 | AC_PROG_AWK | |
20 | AC_PROG_CXX | |
21 | AC_PROG_LIBTOOL | |
22 | ||
23 | dnl Checks for libraries. | |
24 | ||
25 | saveLIBS="$LIBS" | |
26 | AC_CHECK_LIB(gdbm, gdbm_open, [ LIBGDBM=-lgdbm ; LIBS="-lgdbm $LIBS" ]) | |
27 | ||
28 | AC_CHECK_FUNC(gdbm_open, FOUND_GDBM=1, FOUND_GDBM=0) | |
29 | ||
30 | if test "$FOUND_GDBM" = 1 | |
31 | then | |
32 | AC_CHECK_FUNCS(gdbm_fdesc) | |
33 | fi | |
34 | AC_CHECK_HEADERS(unistd.h fcntl.h) | |
35 | ||
36 | LIBS="$saveLIBS" | |
37 | ||
38 | AC_SUBST(LIBGDBM) | |
39 | ||
40 | AM_CONDITIONAL(FOUND_GDBM, test "$FOUND_GDBM" = 1) | |
41 | ||
42 | dnl Checks for header files. | |
43 | ||
44 | dnl Checks for typedefs, structures, and compiler characteristics. | |
45 | AC_C_CONST | |
46 | AC_TYPE_SIZE_T | |
b0322a85 | 47 | AC_SYS_LARGEFILE |
d9898ee8 | 48 | |
49 | dnl Checks for library functions. | |
50 | ||
51 | AC_LANG_CPLUSPLUS | |
52 | AC_CACHE_CHECK([if the C++ compiler needs -fhandle-exceptions], | |
8d138742 | 53 | ac_cv_need_handlexceptions, |
d9898ee8 | 54 | |
55 | AC_TRY_COMPILE([], | |
56 | [ | |
57 | throw; | |
8d138742 CE |
58 | ], ac_cv_need_handlexceptions=no, |
59 | ac_cv_need_handlexceptions=yes) | |
d9898ee8 | 60 | ) |
61 | ||
8d138742 | 62 | if test "$ac_cv_need_handlexceptions" = "yes" |
d9898ee8 | 63 | then |
64 | case "$CXXFLAGS" in | |
65 | *handle-exceptions*) | |
66 | ;; | |
67 | *) | |
68 | CXXFLAGS="-fhandle-exceptions $CXXFLAGS" | |
69 | CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2//'` | |
70 | ;; | |
71 | esac | |
72 | fi | |
73 | ||
74 | AC_OUTPUT(Makefile) |