Replace guile configure check by PKG_CHECK_MODULE so that it also works in cross-compiling.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20585 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-04-22 19:43:39 +00:00
parent 85019c5b80
commit 85e77079b7
3 changed files with 12 additions and 135 deletions

View File

@ -45,7 +45,6 @@ EXTRA_DIST = \
macros/binreloc.m4 \
macros/compiler-flags.m4 \
macros/ac_pkg_swig.m4 \
macros/gnome-guile-checks.m4 \
macros/legacy_macros.m4 \
po/gnucash.pot \
po/POTFILES.in \

View File

@ -368,8 +368,18 @@ if test "x$GUILE_INCS" != x; then
saved_GUILE_INCS="$GUILE_INCS"
fi
GUILE_LIBS=""
GNOME_CHECK_GUILE
# Look up GUILE_CFLAGS and GUILE_LIBS, and version check
PKG_CHECK_MODULES(GUILE, [guile-1.8 >= 1.8.5], , [AC_MSG_ERROR([
guile does not appear to be installed correctly, or is not in the
correct version range. Perhaps you have not installed the guile
development packages? Gnucash requires at least version 1.8.5 to build.
])])
# Look up GUILE executable
AC_PATH_PROG(GUILE, guile)
GUILE_INCS="${GUILE_CFLAGS}"
if test "x$saved_GUILE_LIBS" != x; then
GUILE_LIBS="$saved_GUILE_LIBS"
fi
@ -379,26 +389,12 @@ fi
AS_SCRUB_INCLUDE(GUILE_INCS)
AC_SUBST(GUILE_LIBS)
AM_GUILE_VERSION_CHECK(1.8.5, , , [AC_MSG_ERROR([
guile does not appear to be installed correctly, or is not in the
correct version range. Perhaps you have not installed the guile
development packages? Gnucash requires at least version 1.8.5 to build.
])])
AC_SUBST(GUILE)
AC_DEFINE_UNQUOTED(GNC_GUILE_MAJOR_VERSION, ${guile_major_version},
[Guile Major version number])
AC_DEFINE_UNQUOTED(GNC_GUILE_MINOR_VERSION, ${guile_minor_version},
[Guile Minor version number])
AC_DEFINE_UNQUOTED(GNC_GUILE_MICRO_VERSION, ${guile_micro_version},
[Guile Micro version number])
AS_SCRUB_INCLUDE(CFLAGS)
### Check size of long_long - some guile's are broken.
AC_MSG_CHECKING(if guile long_long is at least as big as gint64)
AS_SCRUB_INCLUDE(CFLAGS)
GNC_OLDCFLAGS="$CFLAGS"
GNC_OLDLDFLAGS="$LDFLAGS"
CFLAGS="${GNOME_CFLAGS} ${GUILE_INCS} ${CFLAGS} ${GLIB_CFLAGS}"

View File

@ -1,118 +0,0 @@
dnl
dnl GNOME_CHECK_GUILE (failflag)
dnl
dnl if failflag is "fail" then GNOME_CHECK_GUILE will abort if guile is not found.
dnl
AC_DEFUN([GNOME_CHECK_GUILE],
[
saved_ldflags="$LDFLAGS"
saved_cppflags="$CPPFLAGS"
LDFLAGS="$LDFLAGS $GNOME_LIBDIR"
AC_CHECK_LIB(qthreads,qt_null,[
QTTHREADS_LIB="-lqthreads"
],[
AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt")
],$LIBS)
AC_SUBST(QTTHREADS_LIB)
AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap")
AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline",,$TERMCAP_LIB)
AC_SUBST(TERMCAP_LIB)
AC_SUBST(READLINE_LIB)
if test "x$cross_compiling" = "xyes" ; then
name_build_guile="$target_alias-guile-config"
else
name_build_guile="guile-config"
fi
AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
if test "x$BUILD_GUILE" = "xyes"; then
AC_MSG_CHECKING(whether $name_build_guile works)
if test x`$name_build_guile --version >/dev/null 2>&1 || \
echo no` = xno; then
BUILD_GUILE=no
fi
AC_MSG_RESULT($BUILD_GUILE)
else
if test "x$cross_compiling" = "xyes" ; then
name_build_guile="$target_alias-build-guile"
else
name_build_guile="build-guile"
fi
AC_CHECK_PROG(BUILD_GUILE, $name_build_guile, yes, no)
if test "x$BUILD_GUILE" = "xyes"; then
AC_MSG_CHECKING(whether $name_build_guile works)
if test x`$name_build_guile --version >/dev/null 2>&1 || \
echo no` = xno; then
BUILD_GUILE=no
fi
AC_MSG_RESULT($BUILD_GUILE)
fi
fi
AC_CHECK_LIB(m, sin)
if test "x$BUILD_GUILE" = "xyes"; then
AC_MSG_CHECKING(for guile libraries)
GUILE_LIBS="`$name_build_guile link`"
AC_MSG_RESULT($GUILE_LIBS)
AC_MSG_CHECKING(for guile headers)
GUILE_INCS="`$name_build_guile compile`"
AC_MSG_RESULT($GUILE_INCS)
else
GUILE_LIBS="$GNOME_LIBDIR"
GUILE_INCS="$GNOME_INCLUDEDIR"
AC_CHECK_LIB(rx, main, GUILE_LIBS="-lrx $GUILE_LIBS")
AC_CHECK_LIB(qt, qt_null, GUILE_LIBS="-lqt $GUILE_LIBS")
AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS")
AC_CHECK_LIB(nsl, t_accept, GUILE_LIBS="$GUILE_LIBS -lnsl")
AC_CHECK_LIB(socket, socket, GUILE_LIBS="$GUILE_LIBS -lsocket")
GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $READLINE_LIB $TERMCAP_LIB"
fi
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_INCS)
saved_LIBS="$LIBS"
LIBS="$LIBS $GUILE_LIBS"
CPPFLAGS="$saved_cppflags $GUILE_INCS"
AC_MSG_CHECKING(whether guile works)
AC_TRY_LINK([
#include <libguile.h>
],[
scm_c_eval_string("(newline)");
scm_boot_guile(0,NULL,NULL,NULL);
],[
ac_cv_guile_found=yes
AC_DEFINE(HAVE_GUILE,1,[Guile present])
],[
ac_cv_guile_found=no
])
AC_MSG_RESULT($ac_cv_guile_found)
if test x$ac_cv_guile_found = xno ; then
if test x$1 = xfail ; then
AC_MSG_ERROR(Can not find Guile on this system)
else
AC_MSG_WARN(Can not find Guile on this system)
fi
ac_cv_guile_found=no
GUILE_LIBS= GUILE_INCS=
fi
LIBS="$saved_LIBS"
LDFLAGS="$saved_ldflags"
CPPFLAGS="$saved_cppflags"
AC_SUBST(GUILE_LIBS)
AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes)
])