From 088493d499a544bcb6e37f0fd59d10034837262f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nirgal=20Vourg=C3=A8re?= Date: Tue, 9 Jul 2013 18:39:03 +0200 Subject: [PATCH] Update autoconf/automake standards Generated files config.guess config.sub depcomp install-sh ltmain.sh missing and ylwrap have been moved to build-aux/ Ran autoupdate Replaced AC_TRY_LINK/AC_TRY_COMPILE by AC_LINK_IFELSE/AC_COMPILE_IFELSE Droped -I$(top_srcdir)/include from CFLAGS since AC_CONFIG_HEADERS already adds the -I Fixed bison detection Added AM_PROG_AR as required by autoreconf -i -Wall Updated NEWS and .gitignore --- .gitignore | 8 +------- NEWS | 10 +++++++++- acinclude.m4 | 27 ++++++++++++++------------- configure.ac | 18 ++++++++++-------- src/extras/Makefile.am | 2 +- src/gmdb2/Makefile.am | 3 +-- src/libmdb/Makefile.am | 4 ++-- src/odbc/Makefile.am | 6 +++--- src/sql/Makefile.am | 2 +- src/util/Makefile.am | 2 +- 10 files changed, 43 insertions(+), 39 deletions(-) diff --git a/.gitignore b/.gitignore index fbb34fe..81ff915 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,10 @@ .libs/ aclocal.m4 autom4te.cache/ -config.guess +build-aux/ config.log config.status -config.sub configure -depcomp dumptypes.c dumptypes.h Makefile.in @@ -20,15 +18,11 @@ include/config.h include/config.h.in include/mdbver.h include/stamp-h1 -install-sh libmdb.pc libmdbsql.pc libtool -ltmain.sh mdbtools.spec -missing types.h -ylwrap src/extras/mdb-hexdump src/gmdb2/gmdb2 src/gmdb2/help/C/omf_timestamp diff --git a/NEWS b/NEWS index df684df..c4364c1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,14 @@ Version 0.7.1 ============= -An experimental version of ODBC driver is now available: libmdbodbcW.so +An experimental (buggy) version of ODBC driver that supports UCS-2 interface +is now available: libmdbodbcW.so +Note that libmdbodbc supports UTF-8 really well, so that this is usually not +needed. + +autoconf/automake has been updates to more recent standards. +- config.guess config.sub depcomp install-sh ltmain.sh missing ylwrap + files are now in build-aux/ directory +You'll now need autoconf >= 2.58 Version 0.3 =========== diff --git a/acinclude.m4 b/acinclude.m4 index f6666e0..958b7d9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -43,15 +43,15 @@ AC_DEFUN([VL_LIB_READLINE], [ AC_SUBST(LIBREADLINE) ])dnl -dnl From Bruno Haible. +dnl From Bruno Haible. AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix], -AC_HELP_STRING([--with-libiconv-prefix=DIR], [search for libiconv in DIR/include and DIR/lib]), [ +AS_HELP_STRING([--with-libiconv-prefix=DIR], [search for libiconv in DIR/include and DIR/lib]), [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi @@ -61,22 +61,22 @@ AC_HELP_STRING([--with-libiconv-prefix=DIR], [search for libiconv in DIR/include AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no - AC_TRY_LINK([#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], + iconv_close(cd);])], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" - AC_TRY_LINK([#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); - iconv_close(cd);], - am_cv_lib_iconv=yes - am_cv_func_iconv=yes) + iconv_close(cd);])], + [am_cv_lib_iconv=yes + am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) @@ -84,7 +84,7 @@ AC_HELP_STRING([--with-libiconv-prefix=DIR], [search for libiconv in DIR/include AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include extern @@ -96,8 +96,8 @@ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, si #else size_t iconv(); #endif -], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) +], [])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) @@ -111,15 +111,16 @@ size_t iconv(); AC_SUBST(LIBICONV) ]) + dnl Check whether the target supports symbol aliases. dnl Code copied from libgomp AC_DEFUN([AM_GCC_ATTRIBUTE_ALIAS], [ AC_CACHE_CHECK([whether the target supports symbol aliases], am_cv_gcc_have_attribute_alias, [ - AC_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([ void foo(void) { } extern void bar(void) __attribute__((alias("foo")));], - [bar();], am_cv_gcc_have_attribute_alias=yes, am_cv_gcc_have_attribute_alias=no)]) + [bar();])], am_cv_gcc_have_attribute_alias=yes, am_cv_gcc_have_attribute_alias=no)]) if test $am_cv_gcc_have_attribute_alias = yes; then AC_DEFINE(HAVE_ATTRIBUTE_ALIAS, 1, [Define to 1 if the target supports __attribute__((alias(...))).]) diff --git a/configure.ac b/configure.ac index 35be064..300f088 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(mdbtools, 0.7, [mdbtools-dev@lists.sourceforge.net]) +AC_INIT([mdbtools],[0.7],[mdbtools-dev@lists.sourceforge.net]) +AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR(src/extras/mdb-dump.c) AM_INIT_AUTOMAKE @@ -11,8 +12,9 @@ AC_CONFIG_HEADERS(include/config.h) AC_PROG_CC(gcc) dnl Checks for programs. AC_PROG_MAKE_SET -AC_PROG_LIBTOOL -AM_PROG_LEX +AM_PROG_AR +LT_INIT +AC_PROG_LEX AC_PROG_YACC dnl Checks for header files. @@ -53,7 +55,7 @@ AC_MSG_RESULT( no - SQL engine disable); sql=false fi -if ! which $YACC > /dev/null; then +if ! $YACC -V >/dev/null 2>&1; then sql=false fi @@ -72,8 +74,7 @@ CFLAGS="$CFLAGS -Wall" dnl Enable -Wl,--as-needed by default to prevent overlinking AC_ARG_ENABLE([as-needed], - AC_HELP_STRING([--disable-as-needed], - [Disable overlinking protection]), + AS_HELP_STRING([--disable-as-needed],[Disable overlinking protection]), [enable_as_needed=$enableval], [enable_as_needed=yes]) if test "x$enable_as_needed" != "xno"; then @@ -151,7 +152,7 @@ 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]), + AS_HELP_STRING([--disable-gmdb2],[do not build gmdb2]), [build_gmdb2=$enableval], [build_gmdb2=yes]) if test "$build_gmdb2" = "yes" ; then @@ -228,7 +229,7 @@ VL_LIB_READLINE localedir=${datadir}/locale AC_SUBST(localedir) -AC_OUTPUT([ +AC_CONFIG_FILES([ libmdb.pc libmdbsql.pc src/util/Makefile @@ -245,4 +246,5 @@ src/gmdb2/help/Makefile src/gmdb2/help/C/Makefile mdbtools.spec include/mdbver.h]) +AC_OUTPUT dnl doc/reference/libmdb/Makefile]) diff --git a/src/extras/Makefile.am b/src/extras/Makefile.am index 4f1d439..b51b4a4 100644 --- a/src/extras/Makefile.am +++ b/src/extras/Makefile.am @@ -1,6 +1,6 @@ bin_PROGRAMS = mdb-hexdump mdb_hexdump_SOURCES = mdb-dump.c mdbsupport.c EXTRA_DIST = mdbsupport.h -AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) +AM_CFLAGS = $(GLIB_CFLAGS) LDADD = ../libmdb/libmdb.la LIBS = $(GLIB_LIBS) diff --git a/src/gmdb2/Makefile.am b/src/gmdb2/Makefile.am index c9dae18..077f90d 100644 --- a/src/gmdb2/Makefile.am +++ b/src/gmdb2/Makefile.am @@ -4,8 +4,7 @@ include_HEADERS = gmdb.h gmdb2_SOURCES = main2.c file.c table.c info.c table_def.c table_data.c table_export.c debug.c sql.c schema.c prefs.c LIBS = -rdynamic $(GNOME_LIBS) @LIBS@ @LEXLIB@ -AM_CPPFLAGS = -I$(top_srcdir)/include \ - $(GNOME_CFLAGS) \ +AM_CFLAGS = $(GNOME_CFLAGS) \ -DDATADIR="\"$(datadir)\"" \ -DGMDB_ICONDIR="\"$(datadir)/gmdb/glade/\"" \ -DGMDB_GLADEDIR="\"$(datadir)/gmdb/glade/\"" diff --git a/src/libmdb/Makefile.am b/src/libmdb/Makefile.am index 31cf94d..71b79a4 100644 --- a/src/libmdb/Makefile.am +++ b/src/libmdb/Makefile.am @@ -1,5 +1,5 @@ lib_LTLIBRARIES = libmdb.la libmdb_la_SOURCES= catalog.c mem.c file.c table.c data.c dump.c backend.c money.c sargs.c index.c like.c write.c stats.c map.c props.c worktable.c options.c iconv.c libmdb_la_LDFLAGS = -version-info 2:1:0 -export-symbols-regex '^(mdb_|_mdb_put_int16$$|_mdb_put_int32$$)' -AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) -LIBS = $(GLIB_LIBS) @LIBS@ +AM_CFLAGS = $(GLIB_CFLAGS) +LIBS = $(GLIB_LIBS) @LIBS@ @LIBICONV@ diff --git a/src/odbc/Makefile.am b/src/odbc/Makefile.am index fbfdc3d..97035c1 100644 --- a/src/odbc/Makefile.am +++ b/src/odbc/Makefile.am @@ -1,15 +1,15 @@ noinst_PROGRAMS = unittest lib_LTLIBRARIES = libmdbodbc.la -AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(ODBC_CFLAGS) +AM_CFLAGS = $(GLIB_CFLAGS) $(ODBC_CFLAGS) libmdbodbc_la_SOURCES = odbc.c connectparams.c mdbodbc.h connectparams.h libmdbodbc_la_LIBADD = ../libmdb/libmdb.la ../sql/libmdbsql.la libmdbodbc_la_LDFLAGS = -avoid-version -export-symbols-regex '^(SQL|ODBCINST)' if ICONV lib_LTLIBRARIES += libmdbodbcW.la libmdbodbcW_la_SOURCES = $(libmdbodbc_la_SOURCES) -libmdbodbcW_la_LIBADD = $(libmdbodbc_la_LIBADD) +libmdbodbcW_la_LIBADD = $(libmdbodbc_la_LIBADD) @LIBICONV@ libmdbodbcW_la_LDFLAGS = $(libmdbodbc_la_LDFLAGS) -libmdbodbcW_la_CFLAGS = -D ENABLE_ODBC_W=1 +libmdbodbcW_la_CFLAGS = $(AM_CFLAGS) -D ENABLE_ODBC_W=1 endif LIBS = @LEXLIB@ $(GLIB_LIBS) $(ODBC_LIBS) unittest_LDADD = libmdbodbc.la ../libmdb/libmdb.la ../sql/libmdbsql.la diff --git a/src/sql/Makefile.am b/src/sql/Makefile.am index 3d9acc6..f4e0cc4 100644 --- a/src/sql/Makefile.am +++ b/src/sql/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libmdbsql.la libmdbsql_la_SOURCES= mdbsql.c parser.y lexer.l libmdbsql_la_LDFLAGS = -version-info 2:0:0 -export-symbols-regex '^mdb_sql_' CLEANFILES = parser.c parser.h lexer.c -AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) +AM_CFLAGS = $(GLIB_CFLAGS) LIBS = $(GLIB_LIBS) libmdbsql_la_LIBADD = ../libmdb/libmdb.la YACC = @YACC@ -d diff --git a/src/util/Makefile.am b/src/util/Makefile.am index 6e9e413..570b445 100644 --- a/src/util/Makefile.am +++ b/src/util/Makefile.am @@ -2,7 +2,7 @@ bin_PROGRAMS = mdb-export mdb-array mdb-schema mdb-tables mdb-parsecsv mdb-heade noinst_PROGRAMS = mdb-import prtable prcat prdata prkkd prdump prole updrow prindex LIBS = $(GLIB_LIBS) @LIBS@ @LEXLIB@ DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\" -AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) +AM_CFLAGS = $(GLIB_CFLAGS) LDADD = ../libmdb/libmdb.la if SQL mdb_sql_LDADD = ../libmdb/libmdb.la ../sql/libmdbsql.la $(LIBREADLINE)