Welcome to mirror list, hosted at ThFree Co, Russian Federation.

configure.in - github.com/lintest/myrulib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7286ad2145bc449490c42433d3da629d880609e3 (plain)
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
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)

AC_INIT([MyRuLib],[0.29.16],[mail@lintest.ru],[myrulib],[http://myrulib.lintest.ru/])

dnl Set the minimum version of toolkit libs
dnl ========================================================
SQLITE_VERSION=3.6.0
WXWIDGETS_VERSION=2.8.10

AC_CONFIG_SRCDIR([MyRuLib/MyRuLibApp.cpp])
AC_CONFIG_SRCDIR([autoconf_inc.m4])
AM_CONFIG_HEADER([config.h:sources/config.h.in])

AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CXXCPP

dnl AC_PROG_INTLTOOL
dnl AM_GNU_GETTEXT

AM_OPTIONS_WXCONFIG

AM_PATH_WXCONFIG($WXWIDGETS_VERSION, WXFOUND=1, WXFOUND=0, [aui,adv,html,core,net], [--unicode=yes])

if test "$WXFOUND" != 1; then
    AC_MSG_ERROR([
        Please check that wx-config is in path, the directory
        where wxWindows libraries are installed (returned by
        'wx-config --libs' command) is in LD_LIBRARY_PATH or
        equivalent variable and wxWindows is version 2.8.10 or above.
    ])
fi

AM_PATH_XML2(2.5.0, USE_LIBXML2="yes", USE_LIBXML2="no")

dnl ---------------------------------------------------------------------------
dnl     Check compiler options
dnl ---------------------------------------------------------------------------

AC_MSG_CHECKING([for --with-expat])
AC_ARG_WITH([expat], [AS_HELP_STRING([--with-expat], [Use Expat XML parser instead of Libxml2])], USE_EXPAT="$withval", USE_EXPAT="no")
AC_MSG_RESULT([$USE_EXPAT])

AC_MSG_CHECKING([for --with-faxpp])
AC_ARG_WITH([faxpp], [AS_HELP_STRING([--with-faxpp], [Use FAXPP (Fast XML Pull Parser) library])], USE_FAXPP="$withval", USE_FAXPP="no")
AC_MSG_RESULT([$USE_FAXPP])

if test "$USE_EXPAT.$USE_FAXPP" = "no.no" ; then 
  if test "x$USE_LIBXML2" = "xyes" ; then 
    CXXFLAGS="$CXXFLAGS $XML_CPPFLAGS -DFB_PARSE_LIBXML2"
    LIBS="$WX_LIBS $XML_LIBS"
  else
    USE_EXPAT="yes"
  fi
fi

if test "x$USE_EXPAT" != "xno" ; then 
    USE_LIBXML2="no"
    USE_FAXPP="no"
fi

if test "x$USE_FAXPP" != "xno" ; then 
    USE_LIBXML2="no"
    USE_EXPAT="no"
fi

if test "x$USE_EXPAT" = "xyes" ; then 
    AC_CHECK_HEADER(expat.h, [AC_CHECK_LIB(expat, XML_StopParser, , USE_EXPAT="builtin")], USE_EXPAT="builtin")
fi

if test "x$USE_FAXPP" != "xno" ; then 
    if test "x$USE_FAXPP" != "xbuiltin" ; then 
        AC_CHECK_HEADER(faxpp/parser.h, , USE_FAXPP="builtin")
    fi
fi

AC_MSG_CHECKING([for --with-bzip2])
AC_ARG_WITH([bzip2], [AS_HELP_STRING([--with-bzip2], [Use builtin BZip2 library])], USE_BZIP2="$withval", USE_BZIP2="no")
AC_MSG_RESULT([$USE_BZIP2])

AC_MSG_CHECKING([for --with-sqlite])
AC_ARG_WITH([sqlite], [AS_HELP_STRING([--with-sqlite], [Use builtin SQLite3 library])], USE_SQLITE="$withval", USE_SQLITE="no")
AC_MSG_RESULT([$USE_SQLITE])

AC_MSG_CHECKING([for --with-wxsqlite])
AC_ARG_WITH([wxsqlite], [AS_HELP_STRING([--with-wxsqlite], [Use builtin wxSQLite3 library])], USE_WXSQL="$withval", USE_WXSQL="yes")
AC_MSG_RESULT([$USE_WXSQL])

AC_MSG_CHECKING([for --with-icu])
AC_ARG_WITH(icu, AS_HELP_STRING([--with-icu],[Use ICU for unicode collation]), USE_LIBICU="$withval", USE_LIBICU="no")
AC_MSG_RESULT([$USE_LIBICU])

AC_MSG_CHECKING([for --with-reader])
AC_ARG_WITH([reader], [AS_HELP_STRING([--with-reader], [Use Cool Reader Engine])], USE_READER="$withval", USE_READER="no")
AC_MSG_RESULT([$USE_READER])

AC_MSG_CHECKING([for --with-syslog])
AC_ARG_WITH([syslog], [AS_HELP_STRING([--with-syslog], [Use system logger: syslog])], USE_SYSLOG="$withval", USE_SYSLOG="no")
AC_MSG_RESULT([$USE_SYSLOG])

if test "x$USE_BZIP2" == "xyes" ; then 
    USE_BZIP2="builtin"
fi

if test "x$USE_BZIP2" != "xbuiltin" ; then 
  AC_CHECK_HEADER(bzlib.h, [AC_CHECK_LIB(bz2, BZ2_bzwrite, , USE_BZIP2="builtin")], USE_BZIP2="builtin")
fi

if test "x$USE_SQLLITE" == "xyes" ; then 
    USE_SQLITE="builtin"
fi

if test "x$USE_SQLITE" != "xbuiltin" ; then 
    dnl ============================
    dnl === SQLite Version check ===
    dnl ============================
    dnl Check to see if the system SQLite package is new enough.
    PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION, , USE_SQLITE="builtin")
fi

if test "x$USE_SQLITE" != "xbuiltin" ; then 
    dnl ================================
    dnl === SQLITE_ENABLE_FTS3 check ===
    dnl ================================
    dnl check to see if the system SQLite package is compiled with
    dnl SQLITE_ENABLE_FTS3 enabled.
    AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
        AC_TRY_RUN([
            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
            }],
            ac_cv_sqlite_enable_fts3=yes,
            ac_cv_sqlite_enable_fts3=no,
            ac_cv_sqlite_enable_fts3=no
        )
    ])
    AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
        USE_SQLITE="builtin"
    fi
fi

if test "x$USE_SQLITE" != "xbuiltin" ; then 
  if test "x$USE_LIBICU" == "xyes" ; then 
    dnl ===============================
    dnl === SQLITE_ENABLE_ICU check ===
    dnl ===============================
    dnl check to see if the system SQLite package is compiled with
    dnl SQLITE_ENABLE_ICU enabled.
    AC_MSG_CHECKING(for SQLITE_ENABLE_ICU support in system SQLite)
    _SAVE_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $SQLITE_CFLAGS"
    _SAVE_LIBS="$LIBS"
    LIBS="$LIBS $SQLITE_LIBS"
    AC_CACHE_VAL(ac_cv_sqlite_enable_icu,[
        AC_TRY_RUN([
            #include "sqlite3.h"

            int main(int argc, char **argv){
              return !sqlite3_compileoption_used("SQLITE_ENABLE_ICU");
            }],
            ac_cv_sqlite_enable_icu=yes,
            ac_cv_sqlite_enable_icu=no,
            ac_cv_sqlite_enable_icu=no
        )
    ])
    AC_MSG_RESULT($ac_cv_sqlite_enable_icu)
    CFLAGS="$_SAVE_CFLAGS"
    LIBS="$_SAVE_LIBS"
    if test "x$ac_cv_sqlite_enable_icu" = "xno"; then
        USE_SQLITE="builtin"
    fi
  fi
fi

if test "x$USE_WXSQL" == "xyes" ; then 
    USE_WXSQL="builtin"
fi

AC_MSG_CHECKING([for --with-locale])
AC_ARG_WITH([locale], [AS_HELP_STRING([--with-locale], [Include locale files into executable])], USE_LOCALE="$withval", USE_LOCALE="no")
AC_MSG_RESULT([$USE_LOCALE])

AC_MSG_CHECKING([for --with-links])
AC_ARG_WITH([links], [AS_HELP_STRING([--with-links], [Include links to the online collections])], USE_LINKS="$withval", USE_LINKS="yes")
AC_MSG_RESULT([$USE_LINKS])

AC_MSG_CHECKING([for --with-strip])
AC_ARG_WITH([strip], [AS_HELP_STRING([--with-strip], [Discard debug symbols from the executable file])], USE_STRIP="$withval", USE_STRIP="yes")
AC_MSG_RESULT([$USE_STRIP])

if test "x$USE_READER" == "xyes" ; then 
  AC_CHECK_FT2( 2.3.0 , FOUND_FT2="yes")
fi

AC_BAKEFILE([m4_include(autoconf_inc.m4)])

dnl   NB: After the wxMSW configuration use the following command.
dnl   $ sed -i 's/-mthreads//g' Makefile"

WX_CFLAGS=`echo $WX_CFLAGS | sed "s|-mthreads||g"`
WX_CXXFLAGS=`echo $WX_CXXFLAGS | sed "s|-mthreads||g"`
WX_CPPFLAGS=`echo $WX_CPPFLAGS | sed "s|-mthreads||g"`
WX_LIBS=`echo $WX_LIBS | sed "s|-mthreads||g"`

dnl =================
dnl === USE_BZIP2 ===
dnl =================

if test "x$USE_BZIP2" = "xbuiltin"; then
  CXXFLAGS="$CXXFLAGS -I\$(srcdir)/3rdparty/bzip2"
  WX_LIBS="$WX_LIBS -lmrl_bzip2"
fi

dnl =================
dnl === USE_FAXPP ===
dnl =================

if test "x$USE_FAXPP" = "xbuiltin" ; then 
  CXXFLAGS="$CXXFLAGS -I\$(srcdir)/3rdparty/faxpp/include -DFB_PARSE_FAXPP"
  WX_LIBS="$WX_LIBS -lmrl_faxpp"
fi

if test "x$USE_FAXPP" = "xyes" ; then 
  CXXFLAGS="$CXXFLAGS -DFB_PARSE_FAXPP"
  WX_LIBS="$WX_LIBS -lfaxpp"
fi

dnl =================
dnl === USE_EXPAT ===
dnl =================

if test "x$USE_EXPAT" = "xbuiltin" ; then 
  CXXFLAGS="$CXXFLAGS -I\$(srcdir)/3rdparty/expat -DFB_PARSE_EXPAT"
  WX_LIBS="$WX_LIBS -lmrl_expat"
fi

if test "x$USE_EXPAT" = "xyes" ; then 
  CXXFLAGS="$CXXFLAGS -DFB_PARSE_EXPAT"
  WX_LIBS="$WX_LIBS -lexpat"
fi

dnl ==================
dnl === USE_SQLITE ===
dnl ==================

if test "x$USE_SQLITE" = "xbuiltin" ; then 
  CXXFLAGS="$CXXFLAGS -I\$(srcdir)/3rdparty/sqlite3"
  WX_LIBS="$WX_LIBS -lmrl_sqlite3"
else
  CXXFLAGS="$CXXFLAGS $SQLITE_CFLAGS"
  WX_LIBS="$WX_LIBS $SQLITE_LIBS"
fi

dnl =================
dnl === USE_WXSQL ===
dnl =================

if test "x$USE_WXSQL" = "xbuiltin" ; then 
  WX_CXXFLAGS="-I\$(srcdir)/3rdparty/wxsqlite3/include $WX_CXXFLAGS"
  WX_LIBS="-lmrl_wxsqlite3 $WX_LIBS"
else
  WX_LIBS="-lwxcode_gtk2u_wxsqlite3-2.8 $WX_LIBS"
fi

dnl ==================
dnl === USE_LIBICU ===
dnl ==================

if test "x$USE_LIBICU" = "xyes" ; then 
  AC_PATH_PROG(ICU_CONFIG, icu-config, no)
  if test "$ICU_CONFIG" = "no" ; then
    WX_LIBS="$WX_LIBS -licui18n -licuuc -licudata"
  else
    ICU_LIBS=`$ICU_CONFIG --ldflags`
    WX_LIBS="$WX_LIBS $ICU_LIBS"
  fi
  CFLAGS="$CXXFLAGS -DSQLITE_ENABLE_ICU"
  CXXFLAGS="$CXXFLAGS -DSQLITE_ENABLE_ICU"
fi

dnl ==================
dnl === USE_READER ===
dnl ==================

if test "x$USE_READER" = "xyes" ; then 
  if test "x$WX_LIBS_STATIC" = "x"; then
    AC_CHECK_LIB(jpeg, jpeg_std_error, , AC_MSG_ERROR([no jpeglib.h; please install libjpeg62-dev or equivalent]))
    AC_CHECK_LIB(png, png_sig_cmp, , AC_MSG_ERROR([no png.h; please install libpng12-dev or equivalent]))
  fi
  CXXFLAGS="$CXXFLAGS -DFB_INCLUDE_READER -I\$(srcdir)/3rdparty/crengine/include"
  WX_LIBS="$WX_LIBS -lmrl_crengine"
  AC_DEFINE(FB_INCLUDE_READER)
fi

if test "x$FOUND_FT2" == "xyes" ; then 
  CXXFLAGS="$CXXFLAGS $FT2_CFLAGS"
  WX_LIBS="$WX_LIBS $FT2_LIBS"
fi

dnl ==================
dnl === USE_SYSLOG ===
dnl ==================

if test "x$USE_SYSLOG" = "xyes" ; then 
  CXXFLAGS="$CXXFLAGS -DFB_SYSLOG_LOGGING"
fi

dnl ==================
dnl === USE_LINKS  ===
dnl ==================

if test "x$USE_LINKS" = "xyes" ; then 
  AC_DEFINE(FB_INCLUDE_LINKS)
fi

dnl ==================
dnl === USE_LOCALE ===
dnl ==================

if test "x$USE_LOCALE" = "xyes" ; then 
  CXXFLAGS="$CXXFLAGS -DFB_INCLUDE_LOCALE"
  AC_DEFINE(FB_INCLUDE_LOCALE)
fi

dnl =================
dnl === USE_STRIP ===
dnl =================

if test "x$USE_STRIP" = "xyes" ; then 
  STRIP_COMMAND="\$(STRIP) ./myrulib\$(EXEEXT)"
else
  STRIP_COMMAND=""
fi
AC_SUBST(STRIP_COMMAND)

dnl ==================
dnl === WX_MACPORT ===
dnl ==================

if test "$WX_MACPORT" != "0"; then 
  MACOS_COMMAND=""
else
  MACOS_COMMAND=""
fi

dnl =================

AC_CONFIG_FILES([Makefile])

if test "x$WX_LIBS_STATIC" = "x"; then
  USE_WX_STATIC=no
else
  USE_WX_STATIC=yes
fi

BUILD_VERSION=`echo "$PACKAGE_VERSION" | sed -e 's/\./,/g'`,0
AC_DEFINE_UNQUOTED(BUILD_VERSION, ${BUILD_VERSION})

AC_OUTPUT

dnl report how we have been configured
echo
echo "Configured ${PACKAGE_STRING} for \`${target}' wxWidgets ${WX_VERSION}"
echo 
echo "  Use Libxml2 parser library (default)?         ${USE_LIBXML2}"
echo "  Use Expat XML parser instead of Libxml2?      ${USE_EXPAT}"
echo "  Use FAXPP (Fast XML Pull Parser) library?     ${USE_FAXPP}"
echo "  Use builtin BZip2 library?                    ${USE_BZIP2}"
echo "  Use builtin SQLite3 library?                  ${USE_SQLITE}"
echo "  Use builtin wxSQLite3 library?                ${USE_WXSQL}"
echo "  Use ICU for unicode collation?                ${USE_LIBICU}"
echo "  Use Cool Reader Engine?                       ${USE_READER}"
echo "  Use system logger: syslog?                    ${USE_SYSLOG}"
echo "  Include locale files into executable?         ${USE_LOCALE}"
echo "  Include links to the online collections?      ${USE_LINKS}"
echo "  Strip the executable file?                    ${USE_STRIP}"
echo "  Link wxWidgets as a static library?           ${USE_WX_STATIC}"
echo