-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
104 lines (83 loc) · 3.27 KB
/
configure.ac
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
dnl AM_CONFIG_HEADER(src/config.h) - keep it simple
dnl package name and version number
PACKAGE=dfsch-postgres
VERSION=0.1
AC_INIT(dfsch-postgres, 0.1)
AC_CONFIG_SRCDIR(src/postgres.c)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
dnl AC_CONFIG_AUX_DIR(config)
dnl checks for programs
dnl AC_PROG_INTLTOOL - We dont want i18n
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
dnl AC_C_INLINE
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h strings.h unistd.h],, [not_posix="1"])
AC_FUNC_MALLOC
AC_CHECK_FUNCS([memmove memset strcasecmp strchr strerror strpbrk],, [not_posix="1"])
if test x$not_posix == x1; then
AC_MSG_RESULT()
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT(Your system lacks some of standard C features)
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT()
AC_MSG_ERROR(Seems like you are going to make a new port...)
fi
AC_CHECK_HEADERS(gc/gc.h, [have_gc="1"], [have_gc="0"])
AC_CHECK_LIB(gc, GC_malloc,, [have_gc="0"], [-ldl -lpthread])
if test x$have_gc != x1; then
AC_MSG_RESULT()
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT(Boehm Garbage Collector (gc) not found!)
AC_MSG_RESULT()
AC_MSG_RESULT(See http://www.hpl.hp.com/personal/Hans_Boehm/gc/index.html)
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT()
AC_MSG_ERROR(Cannot compile without gc!)
fi
AC_ARG_WITH([dfsch],
AC_HELP_STRING([--with-dfsch=PATH], [Path to dfsch installation]),
CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}"
LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}")
AC_CHECK_HEADERS(dfsch/dfsch.h, [have_dfsch="1"], [have_dfsch="0"])
AC_CHECK_LIB(dfsch, dfsch_cons,, [have_dfsch="0"])
if test x$have_dfsch != x1; then
AC_MSG_RESULT()
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT(dfsch not found!)
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT()
AC_MSG_ERROR(There is little point in dfsch extension without dfsch.)
fi
AC_ARG_WITH([pq],
AC_HELP_STRING([--with-pq=PATH], [Path to libpq installation]),
CPPFLAGS="$CPPFLAGS -I${withval}/include -I${withval}"
LDFLAGS="$LDFLAGS -L${withval}/lib -L${withval}")
AC_CHECK_HEADERS(postgresql/libpq-fe.h, [have_pq="1"], [have_pq="0"])
AC_CHECK_LIB(pq, PQconnectdb,, [have_pq="0"])
if test x$have_pq != x1; then
AC_MSG_RESULT()
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT(libpq not found!)
AC_MSG_RESULT(****************************************************************)
AC_MSG_RESULT()
AC_MSG_ERROR(libpq is reguired for PostgreSQL access.)
fi
CFLAGS="$CFLAGS -D_REENTRANT -DGC_THREADS -D_POSIX_C_SOURCE=200112L"
AC_SYS_LARGEFILE
dfschlibexecdir="$libdir/dfsch/"
AC_SUBST(dfschlibexecdir)
dnl automake stuff
AM_MAINTAINER_MODE
dnl create makefiles
AC_OUTPUT(Makefile)