File: configure.in

package info (click to toggle)
mysql-workbench 5.2.40%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 53,880 kB
  • sloc: cpp: 419,850; yacc: 74,784; xml: 54,510; python: 31,455; sh: 9,423; ansic: 4,736; makefile: 2,442; php: 529; java: 237
file content (513 lines) | stat: -rw-r--r-- 15,542 bytes parent folder | download
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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
AC_INIT(mysql-workbench, 5.2.40)
AC_CONFIG_SRCDIR(backend/wbpublic/grt/common.h)
AM_INIT_AUTOMAKE([1.9 tar-ustar])

AC_DISABLE_STATIC

AC_CONFIG_HEADER(config.h)

AC_ARG_ENABLE(debug,
[  --disable-debug   do not compile with debugging symbols], enable_debug=$enableval, enable_debug=no)

if test x"$enable_debug" = xyes; then
  debug_flags="-ggdb3 -DENABLE_DEBUG -DDEBUG"
#  optimize_flags="-O0"
#else
#  optimize_flags="-O2"
fi


AC_ARG_ENABLE(codecoverage,
[  --enable-codecoverage   instrument code for code coverage stats], enable_codecoverage=yes, enable_codecoverage=no)

if test x"$enable_codecoverage" = xyes; then
  codecoverage_flags="-fprofile-arcs -ftest-coverage"
else
  codecoverage_flags=""
fi


# Disable GRT header generation by default so that simple builds will not touch files in repo
AC_ARG_ENABLE(grt-generation,
[  --enable-grt-generation  regenerate headers used by GRT], generate_headers=$enableval, generate_headers=no)
AM_CONDITIONAL(BUILD_GRT_HEADERS, test "$generate_headers" = yes)


# Set some common flags for gcc
CFLAGS="$CFLAGS -Wextra -Wall -Wno-unused -Wsign-compare $debug_flags $optimize_flags $codecoverage_flags -DTIXML_USE_STL=1"
CXXFLAGS="$CXXFLAGS -Wextra -Wall -Wno-unused -Wno-deprecated $debug_flags $optimize_flags $codecoverage_flags -DTIXML_USE_STL=1"
LDFLAGS="$LDFLAGS $codecoverage_flags"

AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LIBTOOL
AC_LANG(C++)

AC_C_BIGENDIAN

AC_CHECK_TOOL(PKG_CONFIG, pkg-config)




AC_ARG_WITH(libzip-includes,
[  --with-libzip-includes=<path> specifies libzip includes path],
		[ac_libzip_includes="$withval"], [ac_libzip_includes="no"])

AC_ARG_WITH(libzip-libs,
[  --with-libzip-libs=<path> specifies libzip libs],
		[ac_libzip_libs="$withval"], [ac_libzip_libs="no"])



AC_CHECK_FUNCS(strtol strtoll strtold strtoull strtoimax strtoumax)

AC_ARG_ENABLE(se,
[  --enable-se       set edition to SE],
  std_edition=$enableval, std_edition=no)

if test x$std_edition = xyes; then
     echo -en "#ifndef __WB_CONFIG_H__\n#define __WB_CONFIG_H__\n#define EDITION_SE\n#define COMMERCIAL_CODE\n#endif\n" > wb_config.h
else
     echo -en "#ifndef __WB_CONFIG_H__\n#define __WB_CONFIG_H__\n#undef COMMERCIAL_CODE\n#define EDITION_OSS\n#endif\n" > wb_config.h
fi

AC_CHECK_HEADERS([sys/select.h])

AC_CHECK_HEADERS([tr1/unordered_set tr1/unordered_map])


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

PKG_CHECK_MODULES(TINYXML, [tinyxml])
AC_SUBST(TINYXML_CFLAGS)
AC_SUBST(TINYXML_LIBS)

have_zip="no"
if test x"$ac_libzip_libs" = x"no"; then
    PKG_CHECK_MODULES(ZIP, [libzip])
    have_zip="yes"
else
    ZIP_CFLAGS=-I$ac_libzip_includes
    ZIP_LIBS=-I$ac_libzip_libs
    have_zip="yes"
fi

if test x"$have_zip" = x"no"; then
echo "Libzip can not be found. Either add libzip.pc path to PKG_CONFIG_PATH, or specify includes and libs manually"
exit 1
fi

AC_SUBST(ZIP_CFLAGS)
AC_SUBST(ZIP_LIBS)

if test "$IS_MACOSX" = "yes"; then
PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0 gmodule-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 gthread-2.0 gmodule-2.0 libxml-2.0 >= 2.6.2])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

PKG_CHECK_MODULES(SIGC, [sigc++-2.0])
AC_SUBST(SIGC_CFLAGS)
AC_SUBST(SIGC_LIBS)

PKG_CHECK_MODULES(GNOME_KEYRING, [gnome-keyring], 
                  [PKG_CHECK_EXISTS([gnome-keyring < 1.0.0], 
                                    [AC_DEFINE_UNQUOTED(HAVE_OLD_GNOME_KEYRING, 1, "")], 
                                    [AC_DEFINE_UNQUOTED(HAVE_GNOME_KEYRING, 1, "")]
                                   )
                  ],
                  [PKG_CHECK_MODULES(GNOME_KEYRING, 
                                     [gnome-keyring-1],
                                     [PKG_CHECK_EXISTS([gnome-keyring-1 < 1.0.0], 
                                                                       [AC_DEFINE_UNQUOTED(HAVE_OLD_GNOME_KEYRING, 1, "")], 
                                                                       [AC_DEFINE_UNQUOTED(HAVE_GNOME_KEYRING, 1, "")]
                                                      )
                                     ],
                                     [GNOME_KEYRING_CFLAGS=""
                                      GNOME_KEYRING_LIBS=""
                                     ]
                                    )
                  ]
                 )
AC_SUBST(GNOME_KEYRING_CFLAGS)
AC_SUBST(GNOME_KEYRING_LIBS)

PKG_CHECK_MODULES(GNOME, [gtkmm-2.4 >= 2.12])

AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_LIBS)

PKG_CHECK_MODULES(SQLITE3, [sqlite3])
AC_SUBST(SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS)

#PKG_CHECK_MODULES(WEBKIT1, [webkit-1.0])
#AC_SUBST(WEBKIT1_CFLAGS)
#AC_SUBST(WEBKIT1_LIBS)

# Boost
AC_ARG_WITH(boost-includes,
[  --with-boost-includes=<path> specifies Boost includes path],
		[ac_boost_inc="$withval"], [ac_boost_inc="no"])

if test x"$ac_boost_inc" != x"no"; then
  CFLAGS+=" -I$ac_boost_inc "
  CXXFLAGS+=" -I$ac_boost_inc "
  (
    CPPFLAGS+=" -I$ac_boost_inc "
    AC_CHECK_HEADER(boost/foreach.hpp, , [AC_MSG_ERROR("BOOST library is missing")])
  )
else
AC_CHECK_HEADER(boost/foreach.hpp, , [AC_MSG_ERROR("BOOST library is missing")])
fi

dnl not used for now
dnl AC_MSG_CHECKING([For boost libraries])
dnl AC_LANG(C++)
dnl BOOST_LIBS="-lboost_filesystem -lboost_system"
dnl SAVED_LDFLAGS=$LDFLAGS
dnl LDFLAGS="$LDFLAGS $BOOST_LIBS"
dnl AC_LINK_IFELSE(
dnl        [AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
dnl          [boost::filesystem::is_directory(".")])],
dnl          [AC_MSG_RESULT([yes])],
dnl          [AC_MSG_ERROR([One or more of boost_filesystem, boost_system is not installed.])])
dnl LDFLAGS=$SAVED_LDFLAGS
BOOST_LIBS=""
AC_SUBST(BOOST_LIBS)

#
# mysql headers
#
AC_ARG_WITH(mysql-config,
[  --with-mysql-config=<path> specifies how to run the mysql_config script [default=mysql_config]],
		ac_mysql_config_path="$withval", ac_mysql_config_path="mysql_config")

AC_MSG_CHECKING([for mysql headers and libraries])
MYSQL_INCLUDE=`$ac_mysql_config_path --cflags`
MYSQL_LIBS=`$ac_mysql_config_path --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])
else
	AC_MSG_RESULT(CFLAGS="$MYSQL_INCLUDE"   LIBS="$MYSQL_LIBS")
fi
AC_SUBST(MYSQL_INCLUDE)
AC_SUBST(MYSQL_LIBS)


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

PKG_CHECK_MODULES(LIBUUID, uuid, AC_DEFINE([HAVE_LIBUUID], 1, [uuid library]))
CFLAGS="$CFLAGS $UUID_CFLAGS"

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

PKG_CHECK_MODULES(LUA, lua5.1, , [PKG_CHECK_MODULES(LUA, [lua >= 5.1])])

ENABLED_MODULES="$ENABLED_MODULES -DENABLE_LUA_MODULES"

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

GRT_CFLAGS="$GRT_CFLAGS $LUA_CFLAGS"
GRT_LIBS="$GRT_LIBS $LUA_LIBS"

# We need either python 2.6 or 2.7 for MySQL Utilities
AC_CHECK_PROG(PYTHON26, python2.6, [yes])
AC_CHECK_PROG(PYTHON27, python2.7, [yes])
# Python headers
AC_MSG_CHECKING(for Python libraries)
PYTHON_LIBS=[$(python -c "from distutils import sysconfig
import os 
cfg=sysconfig.get_config_vars()
lib = os.path.join(cfg['LIBDIR'], cfg['LDLIBRARY'])
if os.path.exists(lib):
    print \"-L\" + cfg['LIBDIR'] + \" -l\" + cfg['LDLIBRARY'].lstrip(\"lib\").rstrip(\".so\")")]
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)
  AC_MSG_ERROR([Python C development headers/libraries not found])
else
  ENABLED_MODULES="$ENABLED_MODULES -DENABLE_PYTHON_MODULES"
  AC_MSG_RESULT($PYTHON_LIBS)
fi
AC_SUBST(PYTHON_CFLAGS)
AC_SUBST(PYTHON_LIBS)

GRT_CFLAGS="$GRT_CFLAGS $PYTHON_CFLAGS"
GRT_LIBS="$GRT_LIBS $PYTHON_LIBS"


GRT_CFLAGS="$GRT_CFLAGS $ENABLED_MODULES"

AC_SUBST(GRT_CFLAGS)
AC_SUBST(GRT_LIBS)


dnl Check whether mysql-utilities and connector sources are present
AC_ARG_ENABLE(mysql-utilities,
[  --enable-mysql-utilities  whether the command line MySQL Utilities should be built and installed],
                        bundle_utilities="$enableval", bundle_utilities=no)

if test x$bundle_utilities = xyes; then
    if test "$ac_cv_prog_PYTHON26" != "yes" -a "$ac_cv_prog_PYTHON27" != "yes"; then
        AC_MSG_ERROR([mysql-utilities enabled, but required Python 2.6 or 2.7 not found])
        exit 1
    fi
    AC_MSG_CHECKING(mysql-utilities)
    if ! test -d ext/mysql-utilities; then
        AC_MSG_RESULT([optional mysql-utilities repository not found, skipping])
        bundle_utilities=no
    elif ! test -d ext/connector-python; then
        AC_MSG_RESULT([optional connector-python repository not found, skipping])
        bundle_utilities=no
    else
        MYSQL_UTILITIES_PROGRAMS=[$(python -c 'import os;print " ".join([f[:-3] for f in os.listdir("ext/mysql-utilities/scripts") if f.endswith(".py")])')]
        AC_SUBST(MYSQL_UTILITIES_PROGRAMS)
        AC_MSG_RESULT([$MYSQL_UTILITIES_PROGRAMS])
        bundle_utilities=yes
    fi
fi

AC_ARG_WITH(cairo-prefix,
[  --with-cairo-prefix=<path> specifies cairo location],
		ac_cairo_prefix="$withval", ac_cairo_prefix="no")

if test x"$ac_cairo_prefix" != x"no"; then
CAIRO_CFLAGS="-I$ac_cairo_prefix"/include
CAIRO_LIBS="-I$ac_cairo_prefix"/lib
fi

PKG_CHECK_MODULES(CAIRO, [cairo >= 1.5.12 gl])

# check for opengl and glx headers
#AC_CHECK_HEADERS([GL/gl.h GL/glx.h], [], AC_MSG_ERROR([OpenGL headers not found]))

#AC_CHECK_LIB(GL, glNewList, CAIRO_LIBS="$CAIRO_LIBS -lGL", AC_MSG_ERROR([OpenGL library not found]))


# check if ctemplate is installed in system, otherwise use the bundled one
AC_CHECK_HEADER(ctemplate/template.h, ac_system_ctemplate=yes, ac_system_ctemplate=no)

AC_ARG_WITH(bundled-ctemplate,
[  --with-bundled-ctemplate  force use of bundled ctemplate library],
    ac_bundled_ctemplate=yes, ac_bundled_ctemplate=no)

if test "$ac_bundled_ctemplate" = yes; then
  AC_MSG_RESULT([Using bundled ctemplate])
  CTEMPLATE_CFLAGS="-I\$(top_srcdir)/ext/ctemplate/ctemplate-src/src"
  CTEMPLATE_LIBS="\$(top_srcdir)/ext/ctemplate/ctemplate-src/libctemplate_wb.la"
else
  if test "$ac_system_ctemplate" = yes; then
    CTEMPLATE_LIBS=-lctemplate
  else
    AC_MSG_ERROR([Library ctemplate not found in system. Install package libctemplate-devel, ctemplate-devel or libctemplate-dev])
  fi
fi
AC_SUBST(CTEMPLATE_CFLAGS)
AC_SUBST(CTEMPLATE_LIBS)


#AM_CONDITIONAL(BUILD_JAVA, test "x$ac_found_jni" = "xyes")
#AM_CONDITIONAL(BUILD_PHP, test "x$enable_php" = "xyes")
AM_CONDITIONAL(USE_READLINE, test "x$use_readline" = "xyes")
#AM_CONDITIONAL(BUILD_FASTCGI, test "x$enable_cgi" = "xyes")
AM_CONDITIONAL(BUILD_CTEMPLATE, test "x$ac_system_ctemplate" = "xyes")
AM_CONDITIONAL(BUILD_SE, test "x$std_edition" = "xyes")
AM_CONDITIONAL(BUNDLE_UTILITIES, test "x$bundle_utilities" = "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,[yes])
if test x"$PCRE_LIBS" = x; then
        AC_MSG_ERROR([Could not find pcre-config script. Make sure the pcre libraries are installed])
else
        PCRE_LIBS=`pcre-config --libs`
fi
AC_SUBST(PCRE_LIBS)


# check if pcre has support for unicode
AC_MSG_CHECKING([for unicode support in pcre])
ac_savelibs=$LIBS
ac_savecpp=$CPPFLAGS
LIBS=`pcre-config --libs`
CPPFLAS=`pcre-config --cflags`
AC_RUN_IFELSE([[#include <pcre.h>
int main()
{
  char *err= NULL;
  int o;
  if (pcre_compile("(?:\\\\pL(?:\\\\pL|\\\\pN|\\\\pM|\\\\p{Pc}|\\\\p{Pd}|\\\\pS}|_)*)", PCRE_UTF8, &err, &o, NULL))
    return 0;
  return 1;
}
]], [HAVE_UNICODE_PCRE=1], [HAVE_UNICODE_PCRE=0])
if test $HAVE_UNICODE_PCRE; then
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi
CPPFLAGS=$ac_savecpp
LIBS=$ac_savelibs
AC_DEFINE(HAVE_UNICODE_PCRE, [], [whether pcre was compiled with unicode properties support])


######################################################################################3



# 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"])


AC_CONFIG_FILES([Makefile
build/mysql-workbench.spec
res/Makefile
res/grt/Makefile
res/grtdata/Makefile
res/wbdata/Makefile
res/mysql.profiles/Makefile
res/sqlidedata/Makefile
ext/Makefile
ext/scintilla/gtk/Makefile
ext/cppconn/Makefile
ext/cppconn/driver/Makefile
ext/vsqlite++/Makefile
ext/vsqlite++/src/sqlite/Makefile
backend/Makefile
backend/wbpublic/Makefile
backend/wbprivate/Makefile
images/Makefile
images/icons/Makefile
images/icons/linux/Makefile
images/icons/linux/48x48/Makefile
images/icons/linux/128x128/Makefile
images/icons/linux/16x16/Makefile
images/grt/Makefile
images/ui/Makefile
images/toolbar/Makefile
images/cursors/Makefile
images/admin/Makefile
images/home/Makefile
library/Makefile
library/canvas/Makefile
library/canvas/src/Makefile
library/grt/Makefile
library/grt/src/Makefile
library/base/Makefile
library/sshtunnel/Makefile
library/sql-parser/Makefile
library/sql-parser/source/Makefile
library/forms/Makefile
library/forms/swig/Makefile
library/dbc/Makefile
tools/Makefile
tools/genobj/Makefile
tools/genwrap/Makefile
modules/Makefile
modules/db/Makefile
modules/db.mysql/Makefile
modules/db.mysql.query/Makefile
modules/db.mysql.sqlparser/Makefile
modules/db.mysql.sqlide/Makefile
modules/grt.forms/Makefile
modules/wb.model/Makefile
modules/wb.mysql.import/Makefile
modules/wb.validation/Makefile
modules/wb.mysql.validation/Makefile
modules/db.checks/Makefile
modules/wb.utils/Makefile
plugins/Makefile
plugins/db.mysql/frontend/Makefile
plugins/db.mysql.diff.reporting/frontend/Makefile
plugins/db.mysql.editors/linux/Makefile
plugins/wb.admin/frontend/Makefile
plugins/wb.doclib/Makefile
plugins/wb.model.editors/linux/Makefile
plugins/wb.model.reporting/frontend/Makefile
plugins/wb.printing/linux/Makefile
plugins/wb.model.snippets/Makefile
plugins/wb.bugreport/Makefile
frontend/Makefile
frontend/linux/Makefile
frontend/linux/sqlide/Makefile
frontend/linux/linux_utilities/Makefile
frontend/linux/workbench/Makefile
generated/Makefile
testing/tut/Params.inc
])


AC_OUTPUT()

if test "$ac_system_ctemplate" = no; then
(
  cd ./ext/ctemplate/ctemplate-src &&
  autoreconf -i -s; 
  ./configure --prefix=$prefix --libdir=$libdir/mysql-workbench --disable-dependency-tracking --disable-dynamic
)    
fi