-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathconfigure.ac
118 lines (95 loc) · 2.85 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([Open COBOL ESQL], [1.4.0], [[email protected]])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build_aux])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_AWK
AM_PROG_LEX
AC_PROG_YACC
AC_PROG_LIBTOOL
LT_INIT([dlopen win32-dll])
# Configure options.
GEN_DEBUG_OPT="no"
AC_ARG_ENABLE(debug,
[ --enable-debug (OCESQL) enable -g C compiler debug option],
[if test "$enable_debug" = "yes"
then
GEN_DEBUG_OPT="yes"
fi])
if test "$GEN_DEBUG_OPT" = "no"
then
CFLAGS=`echo "$CFLAGS" | sed -e 's/^-g//' -e 's/-g$//' -e 's/-g / /'`
fi
DISABLE_COMPILER=no
AC_ARG_ENABLE(precompiler,
[ --disable-precompiler (OCESQL) disable OCESQL precompiler install],
[if test "$enable_precompiler" = "no"
then
DISABLE_COMPILER=yes
fi])
AM_CONDITIONAL(DISABLE_OCESQL, test $DISABLE_COMPILER = yes)
# set PKG_CONFIG to use (cross-compile aware)
PKG_PROG_PKG_CONFIG
curr_libs="$LIBS"; curr_cppflags="$CPPFLAGS"
PKG_CHECK_MODULES([LIBPQ], [libpq >= 8.4.0], [], [#
])
if test -n "$LIBPQ_CFLAGS"; then
CPPFLAGS="$CPPFLAGS $LIBPQ_CFLAGS"
fi
if test -z "${LIBPQ_LIBS+x}"; then
LIBPQ_LIBS="-lpq"
fi
LIBS="$LIBS $LIBPQ_LIBS"
# Checks for PostgreSQL.
AC_CHECK_HEADERS([libpq-fe.h], [
#AC_CHECK_LIB([pq], [PQconnectdb])
#AC_MSG_CHECKING([if linking against libgmp with "$GMP_LIBS" works])
#AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gmp.h>]],
# [[mpz_t integ; mpz_init (integ);]])],
# [AC_MSG_RESULT([yes])
# curr_cppflags=$CPPFLAGS # for the include in cobc generated modules
# LIBCOB_LIBS="$LIBCOB_LIBS $GMP_LIBS"
# USE_MATH=gmp],
# [AC_MSG_RESULT([no])
# if test "$USE_MATH" = "gmp"; then
# AC_MSG_ERROR([[GMP is required for --with-math=gmp, you may adjust GMP_LIBS]])
# fi
# LIBS="$curr_libs"; CPPFLAGS="$curr_cppflags"]
#)
], [AC_MSG_ERROR([libpq-fe.h is required, you may adjust LIBPQ_CFLAGS])
])
LIBESQL_LIBS=$LIBPQ_LIBS
LIBESQL_CPPFLAGS=$LIBPQ_CFLAGS
LIBS=$curr_libs
CPPFLAGS=$curr_cppflags
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([inttypes.h libintl.h locale.h malloc.h stddef.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memmove memset setenv strcasecmp strchr strdup strrchr strstr])
AC_CONFIG_FILES([Makefile dblib/Makefile ocesql/Makefile
copy/Makefile sample/Makefile])
AC_SUBST([LIBESQL_LIBS])
AC_SUBST([LIBESQL_CPPFLAGS])
AC_OUTPUT