mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00

See http://blogs.gnome.org/desrt/2011/09/08/am_maintainer_mode-is-not-cool/ about pros and cons. Adding that line does not change behavior, it just ease downstream distribution.
208 lines
4.8 KiB
Plaintext
208 lines
4.8 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
AC_INIT(mdbtools, 0.7, [mdbtools-dev@lists.sourceforge.net])
|
|
AC_CONFIG_SRCDIR(src/extras/mdb-dump.c)
|
|
AM_INIT_AUTOMAKE
|
|
|
|
AM_MAINTAINER_MODE([enable])
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
AC_CONFIG_HEADERS(include/config.h)
|
|
|
|
AC_PROG_CC(gcc)
|
|
dnl Checks for programs.
|
|
AC_PROG_MAKE_SET
|
|
AC_PROG_LIBTOOL
|
|
AM_PROG_LEX
|
|
AC_PROG_YACC
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
|
|
AC_CHECK_HEADERS(wordexp.h)
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
AC_C_CONST
|
|
AC_TYPE_SIZE_T
|
|
|
|
AM_ICONV
|
|
|
|
# add -DHAVE_INCONV to CFLAGS. We should not use #include <config.h> in
|
|
# public headers
|
|
if test "$am_cv_func_iconv" = "yes"; then
|
|
CFLAGS="$CFLAGS -DHAVE_ICONV"
|
|
fi
|
|
|
|
dnl no optional stuff by default
|
|
OPTDIRS=""
|
|
|
|
dnl ---------------------------------------------------------------------
|
|
dnl Compile time options
|
|
dnl ---------------------------------------------------------------------
|
|
|
|
sql=true
|
|
AC_MSG_CHECKING( Are we using flex )
|
|
if test "x$LEX" = "xflex"; then
|
|
LFLAGS="$LFLAGS -i -8"
|
|
AC_MSG_RESULT( yes );
|
|
else
|
|
AC_MSG_RESULT( no - SQL engine disable);
|
|
sql=false
|
|
fi
|
|
|
|
if test "x$YACC" = "x"; then
|
|
sql=false
|
|
fi
|
|
|
|
if test "x$sql" = "xtrue"; then
|
|
CFLAGS="$CFLAGS -DSQL"
|
|
OPTDIRS="$OPTDIRS sql"
|
|
fi
|
|
|
|
AM_CONDITIONAL(SQL, test x$sql = xtrue)
|
|
AC_SUBST(SQL)
|
|
AC_SUBST(LFLAGS)
|
|
|
|
CFLAGS="$CFLAGS -Wall"
|
|
LDFLAGS="$LDFLAGS -Wl,--as-needed"
|
|
|
|
dnl check for iODBC
|
|
|
|
AC_ARG_WITH(iodbc,
|
|
[ --with-iodbc=/path/to/iodbc build odbc driver against iODBC])
|
|
if test "$with_iodbc"; then
|
|
HAVE_ODBC=true
|
|
ODBC_CFLAGS="-I$with_iodbc/include"
|
|
ODBC_LIBS="-L$with_iodbc/lib"
|
|
CFLAGS="$CFLAGS -DIODBC"
|
|
|
|
OLDLDFLAGS=$LDFLAGS
|
|
LDFLAGS="$LDFLAGS $ODBC_LIBS"
|
|
AC_CHECK_LIB(iodbcinst, SQLGetPrivateProfileString,
|
|
[ODBC_LIBS="$ODBC_LIBS -liodbcinst"
|
|
AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1,
|
|
[Define to 1 if you have the SQLGetPrivateProfileString function.])])
|
|
LDFLAGS=$OLDLDFLAGS
|
|
fi
|
|
|
|
dnl check for unixODBC
|
|
AC_ARG_WITH(unixodbc,
|
|
[ --with-unixodbc=/path/to/unixodbc build odbc driver against unixODBC])
|
|
if test "$with_unixodbc"; then
|
|
HAVE_ODBC=true
|
|
ODBC_CFLAGS="-I$with_unixodbc/include"
|
|
ODBC_LIBS="-L$with_unixodbc/lib"
|
|
CFLAGS="$CFLAGS -DUNIXODBC"
|
|
|
|
OLDLDFLAGS=$LDFLAGS
|
|
LDFLAGS="$LDFLAGS $ODBC_LIBS"
|
|
AC_CHECK_LIB(odbcinst, SQLGetPrivateProfileString,
|
|
[ODBC_LIBS="$ODBC_LIBS -lodbcinst"
|
|
AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1,
|
|
[Define to 1 if you have the SQLGetPrivateProfileString function.])])
|
|
LDFLAGS=$OLDLDFLAGS
|
|
fi
|
|
|
|
if test "x$HAVE_ODBC" = "xtrue"; then
|
|
if test "x$sql" != "xtrue" ; then
|
|
echo
|
|
echo ODBC requires flex and bison for the SQL engine
|
|
exit 1
|
|
fi
|
|
|
|
AC_SUBST(ODBC_CFLAGS)
|
|
AC_SUBST(ODBC_LIBS)
|
|
OPTDIRS="$OPTDIRS odbc"
|
|
fi
|
|
|
|
|
|
dnl check for glib/gtk/gnome
|
|
PKG_CHECK_MODULES(GLIB, glib-2.0, ,
|
|
AC_MSG_ERROR([
|
|
glib 2.0 is required by MDB Tools (runtime and devel).
|
|
It can be downloaded at www.gtk.org.
|
|
]))
|
|
|
|
PKG_CHECK_MODULES(GNOME,gtk+-2.0 >= 2.14 libglade-2.0 libgnomeui-2.0, HAVE_GNOME=true, HAVE_GNOME=false)
|
|
|
|
AC_ARG_ENABLE(gmdb2,
|
|
AC_HELP_STRING([--disable-gmdb2], [do not build gmdb2]),
|
|
[build_gmdb2=$enableval], [build_gmdb2=yes])
|
|
|
|
if test "$build_gmdb2" = "yes" ; then
|
|
if test "x$HAVE_GNOME" = "xtrue"; then
|
|
AC_SUBST(GNOME_CFLAGS)
|
|
AC_SUBST(GNOME_LIBS)
|
|
OPTDIRS="$OPTDIRS gmdb2"
|
|
fi
|
|
else
|
|
AC_MSG_NOTICE(gmdb2 disabled)
|
|
fi
|
|
|
|
AC_SUBST([OPTDIRS])
|
|
AC_CONFIG_FILES([src/Makefile])
|
|
|
|
|
|
##################################################
|
|
# Check for gtk-doc.
|
|
##################################################
|
|
|
|
AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
|
|
|
|
if test "x$with_html_dir" = "x" ; then
|
|
HTML_DIR='${datadir}/gtk-doc/html'
|
|
else
|
|
HTML_DIR=$with_html_dir
|
|
fi
|
|
|
|
AC_SUBST(HTML_DIR)
|
|
|
|
gtk_doc_min_version=1.0
|
|
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
|
|
if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
|
|
AC_MSG_RESULT(yes)
|
|
GTKDOC=true
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
GTKDOC=false
|
|
fi
|
|
|
|
dnl Let people disable the gtk-doc stuff.
|
|
AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
|
|
|
|
if test x$enable_gtk_doc = xauto ; then
|
|
if test x$GTKDOC = xtrue ; then
|
|
enable_gtk_doc=yes
|
|
else
|
|
enable_gtk_doc=no
|
|
fi
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
|
|
|
|
AM_CONDITIONAL(ENABLE_DOCBOOK, test -n "$DOCBOOK_DSL")
|
|
|
|
dnl Checks for library functions.
|
|
VL_LIB_READLINE
|
|
|
|
localedir=${datadir}/locale
|
|
AC_SUBST(localedir)
|
|
|
|
AC_OUTPUT([
|
|
libmdb.pc
|
|
libmdbsql.pc
|
|
src/util/Makefile
|
|
src/extras/Makefile
|
|
Makefile include/Makefile
|
|
src/libmdb/Makefile
|
|
src/sql/Makefile
|
|
src/odbc/Makefile
|
|
doc/Makefile
|
|
src/gmdb2/Makefile
|
|
src/gmdb2/gladefiles/Makefile
|
|
src/gmdb2/pixmaps/Makefile
|
|
src/gmdb2/help/Makefile
|
|
src/gmdb2/help/C/Makefile
|
|
mdbtools.spec
|
|
include/mdbver.h])
|
|
dnl doc/reference/libmdb/Makefile])
|