From 9aca06cdb70c3fc9595beb82713eedd90a7e1d16 Mon Sep 17 00:00:00 2001 From: Ales Hvezda Date: Fri, 4 Jan 2008 12:57:58 -0500 Subject: [PATCH] Added checks at the autogen.sh stage for missing m4 macros This commit adds a autoconf friendly m4 macro to check for undefined macros (originally written by Peter Brett). This macro is used in configure.ac.in to check for a few troublesome macros (guile, nls, gettext, intltool) that are usually missing because a required -dev package is not installed/missing. --- gschem/autogen.sh | 7 ++++++- libgeda/acinclude.m4 | 18 ++++++++++++++++++ libgeda/autogen.sh | 7 ++++++- libgeda/configure.ac.in | 6 ++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 libgeda/acinclude.m4 diff --git a/gschem/autogen.sh b/gschem/autogen.sh index bd66f9bcc..cc0c7cfda 100755 --- a/gschem/autogen.sh +++ b/gschem/autogen.sh @@ -165,9 +165,14 @@ do fi fi - echo "autogen.sh running: aclocal $aclocalinclude ..." aclocal $aclocalinclude + status=$? + if test ! "$status" = 0; then + echo autogen.sh exiting... + exit $status + fi + if grep "^AM_CONFIG_HEADER" $configure_script >/dev/null; then echo "autogen.sh running: autoheader ..." autoheader diff --git a/libgeda/acinclude.m4 b/libgeda/acinclude.m4 new file mode 100644 index 000000000..df6b582c1 --- /dev/null +++ b/libgeda/acinclude.m4 @@ -0,0 +1,18 @@ + +dnl This macro checks that a m4 macro is define. The primary use of +dnl this macro is to inform users that they haven't installed required +dnl -devel packages at autogen.sh time. This macro is based on a +dnl prototype macro created by Peter Brett. + +AC_DEFUN([AC_GEDA_MACRO_CHECK], +[ + ifdef( [$1], + true, dnl NOP + [ + AC_FATAL( + [m4 macro `$1' is not defined. Ensure that `$2' is installed in your aclocal search path. Maybe you are missing a -dev package?], + ) + ] + ) +]) + diff --git a/libgeda/autogen.sh b/libgeda/autogen.sh index bd66f9bcc..cc0c7cfda 100755 --- a/libgeda/autogen.sh +++ b/libgeda/autogen.sh @@ -165,9 +165,14 @@ do fi fi - echo "autogen.sh running: aclocal $aclocalinclude ..." aclocal $aclocalinclude + status=$? + if test ! "$status" = 0; then + echo autogen.sh exiting... + exit $status + fi + if grep "^AM_CONFIG_HEADER" $configure_script >/dev/null; then echo "autogen.sh running: autoheader ..." autoheader diff --git a/libgeda/configure.ac.in b/libgeda/configure.ac.in index 6789c0f97..99f44c48f 100644 --- a/libgeda/configure.ac.in +++ b/libgeda/configure.ac.in @@ -70,6 +70,7 @@ AC_PROG_MAKE_SET # Internationalisation start # # Set USE_NLS +AC_GEDA_MACRO_CHECK([AM_NLS], [nls.m4]) AM_NLS # Set package name for translations @@ -80,10 +81,12 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"]) AC_SUBST(GETTEXT_PACKAGE) # Initialise gettext +AC_GEDA_MACRO_CHECK([AM_GNU_GETTEXT], [gettext.m4]) AM_GNU_GETTEXT AM_GNU_GETTEXT_VERSION([%INSTALLED_GETTEXT_VERSION%]) # Initialise intltool +AC_GEDA_MACRO_CHECK([IT_PROG_INTLTOOL], [intltool.m4]) IT_PROG_INTLTOOL(0.35.0) # @@ -93,6 +96,9 @@ IT_PROG_INTLTOOL(0.35.0) ############################################################################ # Check for guile start # + +# Find about the installed guile +AC_GEDA_MACRO_CHECK([GUILE_FLAGS], [guile.m4]) GUILE_FLAGS # Check Guile version -- 2.11.4.GIT