From cca430c86275439f3ae53c5c187bed872de65fd6 Mon Sep 17 00:00:00 2001 From: dquinlan Date: Mon, 21 Sep 2009 20:11:56 +0000 Subject: [PATCH] Added pkg.m4 macro file to aclocal directory (for libffi). git-svn-id: file:///usr/casc/overture/ROSE/svn/ROSE/trunk/ROSE@7443 a27c51de-2d2b-4d1b-a6e8-f7f87814f453 --- acmacros/pkg.m4 | 57 ++++++++++++++++++++++++++++++++++++++++ config/support-libffi.m4 | 7 ++--- configure.in | 13 ++++++++- 3 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 acmacros/pkg.m4 diff --git a/acmacros/pkg.m4 b/acmacros/pkg.m4 new file mode 100644 index 00000000000..f2bfc2d49f9 --- /dev/null +++ b/acmacros/pkg.m4 @@ -0,0 +1,57 @@ + +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN([PKG_CHECK_MODULES], [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) + + diff --git a/config/support-libffi.m4 b/config/support-libffi.m4 index 01daec75397..9f1cae457f3 100644 --- a/config/support-libffi.m4 +++ b/config/support-libffi.m4 @@ -1,12 +1,13 @@ AC_DEFUN([ROSE_SUPPORT_LIBFFI], [ -# DQ (9/19/2009): This fails on OSX (ninjai.llnl.gov) -# PKG_CHECK_MODULES([LIBFFI],[libffi],[with_libffi=yes],[with_libffi=no]) +# DQ (9/21/2009): Added pkg.m4 to local ROSE/aclocal +# DQ (9/19/2009): This fails on OSX (ninjai.llnl.gov) (added by Peter to support ROSE interpreter). +PKG_CHECK_MODULES([LIBFFI],[libffi],[with_libffi=yes],[with_libffi=no]) # DQ (9/19/2009): This fails on Mac OSX (this variable is needed # for an automake conditional that will be built in configure.in) -with_libffi=no +# with_libffi=no ] ) diff --git a/configure.in b/configure.in index 32d2eeff773..3beedeee137 100644 --- a/configure.in +++ b/configure.in @@ -394,6 +394,12 @@ AM_CONDITIONAL(ROSE_USE_MYSQL_DATABASE,[test "x$MYSQL_VERSION" != "x"]) # Setup Automake conditional in ROSE/projects/DataBase/Makefile.am AM_CONDITIONAL(ROSE_USE_SQLITE_DATABASE,[test "x$SQLITE3_VERSION" != "x"]) +# DQ (9/21/2009): Debugging for RH release 5 +echo "Testing the value of CC: (CC = $CC)" +echo "Testing the value of CPPFLAGS: (CPPFLAGS = $CPPFLAGS)" + +# exit 1 + # Call supporting macro for MAPLE ROSE_SUPPORT_MAPLE @@ -421,7 +427,8 @@ ROSE_SUPPORT_DWARF # Setup Automake conditional in --- (not yet distributed) AM_CONDITIONAL(ROSE_USE_DWARF,test ! "$with_dwarf" = no) -# Call supporting macro for libffi +# Call supporting macro for libffi (Foreign Function Interface library) +# This library is used by Peter's work on the Interpreter in ROSE. ROSE_SUPPORT_LIBFFI # Setup Automake conditional in projects/interpreter/Makefile.am @@ -1093,6 +1100,10 @@ AM_CONDITIONAL(ROSE_USE_ASSEMBLY_SEMANTICS, [test "x$enable_assembly_semantics" PACKAGE_VERSION_NUMERIC=`echo $PACKAGE_VERSION | sed -e 's/\([[a-z]]\+\)/\.\1/; y/a-i/1-9/'` AC_SUBST(PACKAGE_VERSION_NUMERIC) +# DQ (9/21/2009): Debugging for RH release 5 +echo "Testing the value of CC: (CC = $CC)" +echo "Testing the value of CPPFLAGS: (CPPFLAGS = $CPPFLAGS)" + echo "subdirs $subdirs" AC_CONFIG_SUBDIRS([libltdl src/3rdPartyLibraries/libharu-2.1.0])