File: configure.in

package info (click to toggle)
libdbi-drivers 0.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,148 kB
  • ctags: 1,900
  • sloc: ansic: 18,980; sh: 10,942; xml: 2,759; makefile: 577
file content (288 lines) | stat: -rw-r--r-- 8,176 bytes parent folder | download | duplicates (3)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
dnl Process this file with autoconf to produce a configure script.
AC_INIT(drivers/sqlite/dbd_sqlite.c)
AM_MAINTAINER_MODE

AM_INIT_AUTOMAKE(libdbi-drivers, 0.9.0)
AM_CONFIG_HEADER(config.h)
AC_LIBTOOL_WIN32_DLL
AC_CONFIG_MACRO_DIR([m4])

dnl library versioning currently unnecessary...
dnl dnl Library versioning
dnl LIB_CURRENT=0
dnl LIB_REVISION=4
dnl LIB_AGE=0
dnl AC_SUBST(LIB_CURRENT)
dnl AC_SUBST(LIB_REVISION)
dnl AC_SUBST(LIB_AGE)

AC_CANONICAL_HOST

driverdir=$libdir/dbd
AC_SUBST(driverdir)

dnl ====================================
dnl Fix CFLAGS to avoid the default -g option
dnl CFLAGS will still be picked up from the environment
dnl ====================================
: ${CFLAGS=""}

dnl ====================================
dnl Check for programs
dnl ====================================

AC_PROG_CC
AC_PROG_LD
AC_PROG_INSTALL
LT_INIT
dnl AM_PROG_LIBTOOL
AC_PROG_CPP

dnl ====================================
dnl Set some general compile options
dnl ====================================

dnl the configure script < 1.0 used to set compile options here. We
dnl removed these optimizations and suggest that package maintainers
dnl set up things appropriately for their particular platform. In
dnl order to give some ideas, these optimizations were used
dnl previously:

dnl if test -z "$GCC"; then
dnl        case $host in
dnl        *-*-irix*)
dnl                if test -z "$CC"; then
dnl                        CC=cc
dnl                fi
dnl                DEBUG="-g -signed"
dnl                CFLAGS="-O2 -w -signed $CFLAGS"
dnl                PROFILE="-p -g3 -O2 -signed" ;;
dnl        sparc-sun-solaris*)
dnl                DEBUG="-v -g"
dnl                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92 $CFLAGS"
dnl                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc" ;;
dnl	*-*-freebsd*)
dnl                DEBUG="-g"
dnl                CFLAGS="-O -I/usr/local/include $CFLAGS"
dnl                CPPFLAGS="-I/usr/local/include $CPPFLAGS"
dnl		LDFLAGS="-L/usr/local/lib $LDFLAGS"
dnl                PROFILE="-g -p" ;;
dnl        *)
dnl                DEBUG="-g"
dnl                CFLAGS="-O $CFLAGS"
dnl                PROFILE="-g -p" ;;
dnl        esac
dnl else

dnl        case $host in
dnl        *-*-linux*)
dnl                DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char"
dnl                CFLAGS="-O20 -ffast-math -D_REENTRANT -fsigned-char $CFLAGS"
dnl                PROFILE="-pg -g -O20 -ffast-math -D_REENTRANT -fsigned-char";;
dnl        sparc-sun-*)
dnl                DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -mv8"
dnl                CFLAGS="-O20 -ffast-math -D__NO_MATH_INLINES -fsigned-char -mv8 $CFLAGS"
dnl                PROFILE="-pg -g -O20 -D__NO_MATH_INLINES -fsigned-char -mv8" ;;
dnl	*-*-freebsd*)
dnl                DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
dnl                CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char -I/usr/local/include $CFLAGS"
dnl                CPPFLAGS="-I/usr/local/include $CPPFLAGS"
dnl		LDFLAGS="-L/usr/local/lib $LDFLAGS"
dnl                PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
dnl        *)
dnl                DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
dnl                CFLAGS="-O20 -D__NO_MATH_INLINES -fsigned-char $CFLAGS"
dnl                PROFILE="-O20 -g -pg -D__NO_MATH_INLINES -fsigned-char" ;;
dnl        esac
dnl fi

if [ test -z "$GCC" ]; then
   DEBUG="-g $CFLAGS"
   PROFILE="-g -p $CFLAGS"
else
   DEBUG="-g -std=gnu99 $CFLAGS"
   PROFILE="-g -p -std=gnu99 $CFLAGS"
   CFLAGS="-std=gnu99 $CFLAGS"
fi

AC_SUBST(DEBUG)
AC_SUBST(PROFILE)

case $host in
	*-*-*bsd*)
		dlopen_flag="RTLD_LAZY" ;;
	*)
		dlopen_flag="RTLD_NOW" ;;
esac

AC_DEFINE_UNQUOTED(DLOPEN_FLAG, $dlopen_flag, [ Specifies the mode of dlopen behavior ])

dnl ==============================
dnl Check for libraries
dnl ==============================

dnl framework and database engine client libraries
AC_CHECK_DBI
AC_CHECK_MYSQL
AC_CHECK_PGSQL
AC_CHECK_SQLITE
AC_CHECK_SQLITE3
AC_CHECK_MSQL
AC_CHECK_ORACLE
AC_CHECK_FIREBIRD_INTERBASE
AC_CHECK_FREETDS
AC_CHECK_INGRES
AC_CHECK_DB2

dnl ==============================
dnl Check for functions
dnl ==============================

case $host in
	*-*-win32*)
		shlib_ext=.dll ;;
	*-*-cygwin*)
		shlib_ext=.dll ;;
	*-*-mingw32*)
		shlib_ext=.dll ;;
	*)
		shlib_ext=.so ;;
esac

AC_ARG_WITH(shlib-ext,
	[  --with-shlib-ext	  Specifies the filename extension of loadable modules (usually not necessary).],
	[  shlib_ext=$withval ])

AC_DEFINE_UNQUOTED(DRIVER_EXT, "$shlib_ext", [ Specifies the filename extension of loadable modules ])

AC_CHECK_FUNCS(strtoll)
AC_REPLACE_FUNCS(atoll)
dnl i think we'll eventually get an error here...
AC_CHECK_FUNCS(vasprintf)
AC_REPLACE_FUNCS(asprintf)

dnl ==============================
dnl See whether to build the docs
dnl ==============================

ac_docs="YES"
AC_ARG_ENABLE(docs,
	[  --disable-docs	  do not build and install the documentation.],
	[  if test "$enable_docs" = "no"; then
	       ac_docs="NO"
	   fi])

if test "$ac_docs" = "YES"; then
      docs_subdirs="doc"
else
   docs_subdirs=""
fi

AC_SUBST(docs_subdirs)

AM_CONDITIONAL(BUILDDOCS, test "x$docs_subdirs" != "x")

dnl ===========================================
dnl See whether to link libdbi into the drivers
dnl     and set -no-undefined
dnl ===========================================

ac_libdbi="YES"
AC_ARG_ENABLE(libdbi,
	[  --disable-libdbi       do not link drivers against libdbi.],
	[  if test "$enable_libdbi" = "no"; then
	       ac_libdbi="NO"
	   fi ])

if test "$ac_libdbi" = "YES"; then
   LIBADD_LIBDBI="-no-undefined -ldbi"
   LIBDBI_TEST="test_libdbi.sh"
   AC_SUBST(LIBDBI_TEST)

else
   LIBADD_LIBDBI="-no-undefined"
fi

dnl ===========================================
dnl the directory for database files (for database engines that
dnl allow to write database files wherever you like)
dnl ===========================================
AC_ARG_WITH(dbi_dbdir,
	[  --with-dbi-dbdir=PATH            Directory for database files],
	[dbi_dbdir=$withval],
	[dbi_dbdir="\$(localstatedir)/lib/libdbi"],
])

AC_SUBST(dbi_dbdir)

dnl ===========================================
dnl check for the libdbi library if required
dnl ===========================================

ac_dbi_libdir="no"

AC_ARG_WITH(dbi-libdir,
	[  --with-dbi-libdir       Specifies where the libdbi library files are.],
	[  ac_dbi_libdir="$withval" ])

if test "$ac_libdbi" = "YES"; then
   AC_MSG_CHECKING(for libdbi library)
   if test "$ac_dbi_libdir" = "no"; then
	   dbi_libdirs="/usr/lib /usr/local/lib /sw/lib"
	   libdbi_libs="libdbi.so libdbi.a"
	   AC_FIND_FILE($libdbi_libs, $dbi_libdirs, ac_dbi_libdir)
	   if test "$ac_dbi_libdir" = "no"; then
		   AC_MSG_RESULT(no)
		   AC_MSG_ERROR([Invalid libdbi directory - include files not found.])
	   fi
   fi

   AC_MSG_RESULT([yes: libs in $ac_dbi_libdir])
   LIBADD_LIBDBI="$LIBADD_LIBDBI -L$ac_dbi_libdir"
	
   AC_SUBST(LIBADD_LIBDBI)

   LIBDBI_LIBDIR="$ac_dbi_libdir"
   AC_SUBST(LIBDBI_LIBDIR)

fi

dnl ==============================
dnl Checks for header files
dnl ==============================

AC_CHECK_HEADERS([string.h strings.h])

AC_OUTPUT([
	libdbi-drivers.spec
	Makefile
	doc/Makefile
	doc/include/Makefile
	drivers/Makefile
	drivers/mysql/Makefile
	drivers/pgsql/Makefile
	drivers/sqlite/Makefile
	drivers/sqlite3/Makefile
	drivers/msql/Makefile
	drivers/oracle/Makefile
	drivers/firebird/Makefile
	drivers/freetds/Makefile
	drivers/ingres/Makefile
	drivers/db2/Makefile
	tests/Makefile
	tests/cgreen/Makefile
	tests/test_dbi.cfg
    tests/plugin_settings.sh
	])
dnl doc/Makefile

if test "$ac_mysql" = "NO" && test "$ac_pgsql" = "NO" && test "$ac_sqlite" = "NO" \
	&& test "$ac_sqlite3" = "NO" && test "$ac_msql" = "NO" && test "$ac_oracle" = "NO" \
	&& test "$ac_firebird" = "NO" && test "$ac_freetds" = "NO" && test "$ac_ingres" = "NO" \
	&& test "$ac_db2" = "NO"; then
   echo
   echo "***WARNING***"
   echo "You did not request any drivers to be built. This is most likely not what you want."
   echo "Please run ./configure --help for a list of switches and select at least one driver."
fi