File: configure.in

package info (click to toggle)
mysql-query-browser 1.2.5beta-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 63,792 kB
  • ctags: 46,485
  • sloc: pascal: 249,299; ansic: 80,111; cpp: 72,467; sh: 25,271; objc: 20,015; yacc: 10,755; java: 9,917; xml: 4,580; php: 2,806; python: 1,566; sql: 1,563; makefile: 1,452; perl: 3
file content (399 lines) | stat: -rw-r--r-- 11,209 bytes parent folder | download | duplicates (2)
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
AC_INIT(mysql-gui-common, 0.6.1)
AC_CONFIG_SRCDIR(source/linux/myg_gtkutils.cc)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)

AC_CONFIG_HEADER(config.h)


# Set some common flags for gcc
CFLAGS="$CFLAGS -Wall -Wsign-compare"
CXXFLAGS="$CXXFLAGS -Wall"

AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL

AC_CHECK_TOOL(PKG_CONFIG, pkg-config)



AC_CHECK_HEADERS([sys/select.h])


if test "$(uname -s)" == "Darwin"; then
IS_MACOSX=yes
else
IS_MACOSX=no
fi


AC_ARG_ENABLE(i18n,
[  --disable-i18n	do not add support for internationalization (requires GNU gettext)],
	enable_i18n=$enableval, enable_i18n=yes)

if test x$enable_i18n = xyes; then
    #
    # Gettext
    #
    GETTEXT_PACKAGE="$PACKAGE_NAME"
    AC_SUBST(GETTEXT_PACKAGE)
    AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Translation domain used])
    dnl Add the languages which your application supports here.
    ALL_LINGUAS="ja de pt_BR pl"
    AM_GLIB_GNU_GETTEXT
fi

#
# Gtk stuff
#

AC_ARG_ENABLE(gtk,
[  --disable-gtk        do not build Gtk related libraries],
        enable_gtk=$enableval, enable_gtk=yes)

#
# gtk/libglade libraries
#

if test "$IS_MACOSX" = "yes"; then
PKG_CHECK_MODULES(GLIB, [glib-2.0])
GLIB_CFLAGS="$GLIB_CFLAGS -I/usr/include/libxml2"
GLIB_LIBS="$GLIB_LIBS -lxml2 -framework CoreFoundation"
else
PKG_CHECK_MODULES(GLIB, [glib-2.0 libxml-2.0 >= 2.6.2])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

if test "$IS_MACOSX" = "yes"; then
  PKG_CHECK_MODULES(GTHREAD, [gthread-2.0])
  GTHREAD_CFLAGS="$GTHREAD_CFLAGS -I/usr/include/libxml2"
  GTHREAD_LIBS="$GTHREAD_LIBS -lxml2 -framework CoreFoundation"
else
  PKG_CHECK_MODULES(GTHREAD, [gthread-2.0 libxml-2.0 >= 2.6.2])
fi
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)

if test "$enable_gtk" = "yes"; then
  PKG_CHECK_MODULES(GTK, [gtk+-2.0])
  AC_SUBST(GTK_CFLAGS)
  AC_SUBST(GTK_LIBS)

  PKG_CHECK_MODULES(GNOME, [libglade-2.0 gtkmm-2.4])
  AC_SUBST(GNOME_CFLAGS)
  AC_SUBST(GNOME_LIBS)
fi

#
# mysql headers
#
AC_CHECK_PROG(MYSQL_INCLUDE,mysql_config,`mysql_config --cflags`)
AC_CHECK_PROG(MYSQL_LIBS,mysql_config,`mysql_config --libs_r`)

if test -z "$MYSQL_INCLUDE"; then
        AC_MSG_ERROR([Could not find mysql_config script. Make sure the mysql client libraries are installed])
fi
AC_SUBST(MYSQL_INCLUDE)
AC_SUBST(MYSQL_LIBS)


ENABLED_MODULES=""
GRT_CFLAGS=""
GRT_LIBS=""

#
# GRT Generic RunTime Environment
#
AC_ARG_ENABLE(grt,
[  --enable-grt		enable GRT module loaders (default: no)],
	enable_grt=$enableval, enable_grt=no)

if test "$enable_grt" = yes; then

# ........................................................................
# Java
# ........................................................................
AC_ARG_ENABLE(java-modules,
[  --enable-java-modules	enable Java module loader support (default: yes)],
	enable_java=$enableval, enable_java=yes)

if test "$enable_java" = yes; then
  # JNI headers
  JNI_CFLAGS=
  JNI_LDFLAGS=

  AC_ARG_WITH(java-includes, 
  [  --with-java-includes 	directory where JDK include files are located],
  	[JNI_CFLAGS="-I$withval"])

  AC_ARG_WITH(java-ldflags, 
  [  --with-java-ldflags 		linker flags for linking with JVM],
  	[JNI_LDFLAGS="$withval"])

  save_cppflags="$CPPFLAGS"
  CPPFLAGS="$JNI_CFLAGS"
  AC_CHECK_HEADER(jni.h, ac_found_jni=yes, ac_found_jni=no)
  CPPFLAGS=$save_cppflags
  save_ldflags="$LDFLAGS"
  LDFLAGS="$JNI_LDFLAGS"
  AC_CHECK_LIB(jvm, JNI_GetDefaultJavaVMInitArgs, ac_found_jvm=yes, ac_found_jvm=no)
  LDFLAGS="$save_cppflags"
  if test x$ac_found_jvm = xyes; then
    JNI_LDFLAGS="$JNI_LDFLAGS -ljvm"
    ENABLED_MODULES="$ENABLED_MODULES"
  else
    JNI_CFLAGS="$JNI_CFLAGS -DDLOAD_JVM"
  fi
  if test x$ac_found_jni = xyes; then
    ENABLED_MODULES="$ENABLED_MODULES -DENABLE_JAVA_MODULES"
  fi
  GRT_CFLAGS="$GRT_CFLAGS $JNI_CFLAGS"
  GRT_LIBS="$GRT_LIBS $JNI_LDFLAGS"
  AC_SUBST(JNI_LDFLAGS)
fi

#......................................................................
# Lua Stuff
#......................................................................

LUA_CFLAGS=
LUA_LDFLAGS=
AC_ARG_WITH(lua-includes,
[  --with-lua-includes		directory where Lua headers are located],
	[LUA_CFLAGS=-I$withval])
AC_ARG_WITH(lua-libs,
[  --with-lua-libs              directory where Lua libraries are located],
        [LUA_LDFLAGS="$withval -llua -llualib"])

if test x"$LUA_CFLAGS$LUA_LDFLAGS" = "x"; then
  AC_CHECK_PROG(LUA_CFLAGS,lua-config,`lua-config --include`)
  AC_CHECK_PROG(LUA_LDFLAGS,lua-config,`lua-config --libs`)
fi

if test x"$LUA_LDFLAGS" = "x"; then
  AC_CHECK_LIB(lua, lua_open, ac_lua_found=yes, ac_lua_found=no, $LUA_LDFLAGS)

  if test $ac_lua_found = no; then
    AC_MSG_ERROR([lua 5.0 is required to build GRT support but was not found.
Please specify its location with --with-lua-includes and --with-lua-libs or
install it if it's not.])
  fi
  LUA_LDFLAGS="-llua -llualib"

  save_cppflags=$CPPFLAGS
  CPPFLAGS="$LUA_CFLAGS $CPPFLAGS"
  AC_CHECK_HEADER(lua.h, ac_found_lua=yes, ac_found_lua=no)
  CPPFLAGS=$save_cppflags
fi

ENABLED_MODULES="$ENABLED_MODULES -DENABLE_LUA_MODULES"


LUA_LDFLAGS="$LUA_LDFLAGS -lexpat"


# Check if slang present and if so, build newt
SLANG_LIB=""
AC_CHECK_LIB(slang-utf8, SLang_init_tty, SLANG_LIB="-lslang-utf8",
	AC_CHECK_LIB(slang, SLang_init_tty, SLANG_LIB="-lslang", [], "-L/sw/lib"), "-L/sw/lib")
AC_SUBST(SLANG_LIB)

# Check if we need -luuid
AC_CHECK_LIB(uuid, uuid_generate, [LUA_LDFLAGS="$LUA_LDFLAGS -luuid"])

GRT_CFLAGS="$GRT_CFLAGS $LUA_CFLAGS"
GRT_LIBS="$GRT_LIBS $LUA_LDFLAGS"
AC_SUBST(LUA_LDFLAGS)

# PHP headers
AC_ARG_ENABLE(php-modules,
[  --enable-php-modules 		whether to support PHP scripting],
	enable_php=$enableval, enable_php=no)

if test $enable_php = yes; then
  AC_MSG_CHECKING(for php)
  PHP_LIBS="[$(php-config --libs)]"
  if test "$PHP_LIBS" = ""; then
    AC_MSG_RESULT(not found)
  else
# php-config --prefix ?
    PHP_LIBS="/usr/lib/php5/lib/libphp5.a -L[$(php-config --extension-dir)] $PHP_LIBS"
    PHP_CFLAGS=[$(php-config --includes)]
    ENABLED_MODULES="$ENABLED_MODULES -DENABLE_PHP_MODULES"
    AC_MSG_RESULT($PHP_LIBS)
  fi
fi
GRT_CFLAGS="$GRT_CFLAGS $PHP_CFLAGS"
GRT_LIBS="$GRT_LIBS $PHP_LIBS"

# Python headers
AC_ARG_ENABLE(python-modules,
[  --enable-python-modules	  whether to support Python scripting],
	enable_python=$enableval, enable_python=no)

if test $enable_python = yes; then
  AC_MSG_CHECKING(for Python)
  PYTHON_LIBS=[$(python -c "from distutils import sysconfig
print '/'.join(sysconfig.get_config_vars('LIBPL','LIBRARY'))+' '+sysconfig.get_config_var('LIBS')+' '+sysconfig.get_config_var('LINKFORSHARED')")]
  PYTHON_CFLAGS=[$(python -c "from distutils import sysconfig
print sysconfig.get_python_inc()")]
  PYTHON_CFLAGS="-I$PYTHON_CFLAGS"
  if test "$PYTHON_LIBS" = ""; then
    AC_MSG_RESULT(not found)
  else
    ENABLED_MODULES="$ENABLED_MODULES -DENABLE_PYTHON_MODULES"
    AC_MSG_RESULT($PYTHON_LIBS)
  fi
fi
GRT_CFLAGS="$GRT_CFLAGS $PYTHON_CFLAGS"
GRT_LIBS="$GRT_LIBS $PYTHON_LIBS"

# FastCGI
AC_ARG_ENABLE(fastcgi,
[  --enable-fastcgi                whether to include fastcgi support],
	enable_cgi=yes, enable_cgi=no)

if test $enable_cgi = yes; then
  AC_CHECK_HEADER(fastcgi.h, , [AC_MSG_ERROR("fastcgi.h header not found")])
  GRT_LIBS="$GRT_LIBS -lfcgi"
  ENABLED_MODULES="$ENABLED_MODULES -DENABLE_FASTCGI"
fi

# enable_grt
fi

AC_SUBST(GRT_CFLAGS)
AC_SUBST(GRT_LIBS)
AC_SUBST(ENABLED_MODULES)

AC_ARG_ENABLE(readline,
[ --enable-readline	use readline in grtsh],
	use_readline=$enableval, use_readline=no)

#
# Generic Canvas
#
AC_ARG_ENABLE(canvas,
[  --enable-canvas      enable Generic Canvas build (default: no)],
        enable_canvas=$enableval, enable_canvas=no)

if test "$enable_canvas" = yes; then
  AC_CHECK_PROG(GCDEPS_CFLAGS, freetype-config, `freetype-config --cflags`)
  AC_CHECK_PROG(GCDEPS_LIBS, freetype-config, `freetype-config --libs`)

  if test "$GCDEPS_CFLAGS$GCDEPS_LIBS" = ""; then
    PKG_CHECK_MODULES(GCDEPS, [freetype2])
  fi

  AC_CHECK_HEADERS([GL/gl.h GL/glu.h], ac_opengl_headers=yes, ac_opengl_headers=no)
  if test $ac_opengl_headers = no; then
    AC_MSG_ERROR([OpenGL headers not found. Please install OpenGL development files.])
  fi
fi
AC_SUBST(GCDEPS_CFLAGS)
AC_SUBST(GCDEPS_LIBS)



AM_CONDITIONAL(BUILD_GTK, test "x$enable_gtk" = "xyes")
AM_CONDITIONAL(BUILD_GRT, test "x$enable_grt" = "xyes")
AM_CONDITIONAL(BUILD_JAVA, test "x$ac_found_jni" = "xyes")
AM_CONDITIONAL(BUILD_GC, test "x$enable_canvas" = "xyes")
AM_CONDITIONAL(BUILD_PHP, test "x$enable_php" = "xyes")
AM_CONDITIONAL(BUILD_NEWT, ! test "x$SLANG_LIB" = "x")
AM_CONDITIONAL(USE_READLINE, test "x$use_readline" = "xyes")
AM_CONDITIONAL(BUILD_FASTCGI, test "x$enable_cgi" = "xyes")

#
# pcre
#
AC_CHECK_PROG(PCRE_CFLAGS,pcre-config,[yes])
if test "$PCRE_CFLAGS" != yes; then
        AC_MSG_ERROR([Could not find pcre-config script. Make sure the pcre libraries are installed])
else
        PCRE_CFLAGS=`pcre-config --cflags`
fi
AC_SUBST(PCRE_CFLAGS)
                                                                                
                                                                                
AC_CHECK_PROG(PCRE_LIBS,pcre-config,`pcre-config --libs`)
if test x"$PCRE_LIBS" = x; then
        AC_MSG_ERROR([Could not find pcre-config script. Make sure the pcre libraries are installed])
fi
AC_SUBST(PCRE_LIBS)

# path mangling
DLEXT=.so
if test "$IS_MACOSX" = "yes"; then
	DLEXT=.dylib
	DLMAKE="gcc -arch i386 -arch ppc -dynamiclib -flat_namespace -undefined suppress"
elif test "$(uname -s)" = "SunOS"; then
	DLMAKE="gcc -shared -mimpure-text"
else
	DLMAKE="gcc -shared"
fi 
AC_SUBST(DLEXT)
AC_SUBST(DLMAKE)

DATADIRNAME=`echo $datadir|sed -e "s@${prefix}/@@" -e 's@${prefix}/@@'`
AC_SUBST(DATADIRNAME)

commondirname="common"
AC_ARG_WITH(commondirname, 
	[  --with-commondirname		sets the common data directory name],
	[commondirname="$withval"])

# name of the common data directory
MA_COMMONDIR=$commondirname
AC_SUBST(MA_COMMONDIR)

# installation directory for datafiles
mydatadir='$(datadir)'/mysql-gui/$commondirname
AC_SUBST(mydatadir)

AC_CONFIG_FILES([Makefile
library/Makefile
library/base-library/Makefile
library/base-library/source/Makefile
library/utilities/Makefile
library/utilities/source/Makefile
library/generic-runtime/Makefile
library/generic-runtime/newt/Makefile
library/generic-runtime/source/Makefile
library/grt-wb-controller/Makefile
library/grt-wb-controller/source/Makefile
library/grt-modules/Makefile
library/grt-modules/source/Makefile
library/generic-canvas/Makefile
library/generic-canvas/source/Makefile
library/generic-canvas/ftgl/Makefile
library/generic-canvas/ftgl/src/Makefile
library/mysql-resultset/Makefile
library/mysql-resultset/source/Makefile
library/sql-parser/Makefile
library/sql-parser/source/Makefile
source/Makefile 
source/linux/Makefile
source/java/Makefile
source/lua/Makefile
source/php/Makefile
source/php/modules/Makefile
tools/Makefile
tools/grtsh/Makefile
images/Makefile
images/png/Makefile
images/icons/Makefile
images/icons/png/Makefile
images/grt/Makefile
images/grt/icons/Makefile
images/grt/icons/db/Makefile
images/grt/structs/Makefile
res/Makefile
po/Makefile.in
res/grt/Makefile
res/linux/Makefile
grt_config])

AC_OUTPUT()