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