From e8e374fae3fcc88aeb4e94ae5ba1148459078030 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 20 Jan 2018 09:23:53 +0100 Subject: [PATCH] New autogen.sh. --- .gitignore | 2 ++ autogen.sh | 53 +++++++++++++++++++++++++++++------------- config.h.in | 65 ---------------------------------------------------- configure.ac | 7 ++++-- tests/test.c | 6 ++--- 5 files changed, 46 insertions(+), 87 deletions(-) delete mode 100644 config.h.in diff --git a/.gitignore b/.gitignore index d4cf8a5..a0f8da4 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,5 @@ Rules-quot .cproject .project .settings +compile +config.h.in \ No newline at end of file diff --git a/autogen.sh b/autogen.sh index 24e7bd5..c32ddd7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,23 +1,44 @@ -#!/bin/bash +#!/bin/sh # Run this to generate all the initial makefiles, etc. +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. +olddir=`pwd` -PKG_NAME="libdbtransformer" +cd $srcdir -(test -f $srcdir/configure.ac \ - && test -d $srcdir/src \ - && test -f $srcdir/src/libdbtransformer.h) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level libdbtransformer directory" - exit 1 +(test -f configure.ac) || { + echo "*** ERROR: Directory "\`$srcdir\'" does not look like the top-level project directory ***" + exit 1 } -which gnome-autogen.sh || { - echo "You need to install gnome-common from GNOME and make" - echo "sure the gnome-autogen.sh script is in your \$PATH." - exit 1 -} +PKG_NAME=`autoconf --trace 'AC_INIT:$1' configure.ac` + +if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then + echo "*** WARNING: I am going to run \`configure' with no arguments." >&2 + echo "*** If you wish to pass any to it, please specify them on the" >&2 + echo "*** \`$0\' command line." >&2 + echo "" >&2 +fi + +set -x +aclocal --install || exit 1 +glib-gettextize --force --copy || exit 1 +gtkdocize --copy || exit 1 +intltoolize --force --copy --automake || exit 1 +autoreconf --verbose --force --install -Wno-portability || exit 1 + +cd $olddir +if [ "$NOCONFIGURE" = "" ]; then + $srcdir/configure "$@" || exit 1 + + if [ "$1" = "--help" ]; then + exit 0 + else + echo "Now type \`make\' to compile $PKG_NAME" || exit 1 + fi +else + echo "Skipping configure process." +fi -USE_GNOME2_MACROS=1 . gnome-autogen.sh +{ set +x; } 2>/dev/null diff --git a/config.h.in b/config.h.in deleted file mode 100644 index 8ee95d7..0000000 --- a/config.h.in +++ /dev/null @@ -1,65 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const diff --git a/configure.ac b/configure.ac index 03b251a..64e8829 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,10 @@ AC_INIT([libdbtransformers], [0.0.1], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/dbtransformer.c]) AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE(-Wall) + +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + AM_MAINTAINER_MODE AC_CONFIG_MACRO_DIR([m4]) @@ -29,7 +32,7 @@ AC_PROG_RANLIB GTK_DOC_CHECK # Checks for libraries. -PKG_CHECK_MODULES(DBT, [libgda-4.0 >= 4.1.8 +PKG_CHECK_MODULES(DBT, [libgda-5.0 libxslt >= 1.0.0]) AC_SUBST(DBT_CFLAGS) diff --git a/tests/test.c b/tests/test.c index f7937b0..41bccca 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Andrea Zagli + * Copyright (C) 2010-2018 Andrea Zagli * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,8 +23,6 @@ Dbt *dbt; int main (int argc, char **argv) { - g_type_init (); - dbt = dbt_new (); dbt_set_db_connection_from_string (dbt, "SQLite://DB_DIR=tests;DB_NAME=test.db"); @@ -33,7 +31,7 @@ main (int argc, char **argv) if (dbt_db_is_updated (dbt)) { g_message ("Database is updated."); - return; + return 0; } else { -- 2.49.0