Commit | Line | Data |
---|---|---|
d9898ee8 | 1 | dnl Process this file with autoconf to produce a configure script. |
8d138742 | 2 | dnl $Id: configure.in,v 1.15 2008/11/27 20:33:44 mrsam Exp $ |
d9898ee8 | 3 | dnl |
4 | dnl Copyright 1998 - 1999 Double Precision, Inc. See COPYING for | |
5 | dnl distribution information. | |
6 | ||
7 | AC_INIT(gdbmobj, 0.10, [courier-users@lists.sourceforge.net]) | |
8 | ||
9 | >confdefs.h # Kill PACKAGE_ macros | |
10 | ||
11 | AC_CONFIG_SRCDIR(gdbmobj.c) | |
12 | AM_INIT_AUTOMAKE([foreign no-define]) | |
13 | AM_CONFIG_HEADER(config.h) | |
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 | |
47 | ||
48 | dnl Checks for library functions. | |
49 | ||
50 | AC_LANG_CPLUSPLUS | |
51 | AC_CACHE_CHECK([if the C++ compiler needs -fhandle-exceptions], | |
8d138742 | 52 | ac_cv_need_handlexceptions, |
d9898ee8 | 53 | |
54 | AC_TRY_COMPILE([], | |
55 | [ | |
56 | throw; | |
8d138742 CE |
57 | ], ac_cv_need_handlexceptions=no, |
58 | ac_cv_need_handlexceptions=yes) | |
d9898ee8 | 59 | ) |
60 | ||
8d138742 | 61 | if test "$ac_cv_need_handlexceptions" = "yes" |
d9898ee8 | 62 | then |
63 | case "$CXXFLAGS" in | |
64 | *handle-exceptions*) | |
65 | ;; | |
66 | *) | |
67 | CXXFLAGS="-fhandle-exceptions $CXXFLAGS" | |
68 | CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-O2//'` | |
69 | ;; | |
70 | esac | |
71 | fi | |
72 | ||
73 | AC_OUTPUT(Makefile) |