aboutsummaryrefslogtreecommitdiffstats
path: root/macros/gnome-guile-checks.m4
diff options
context:
space:
mode:
authorMartin Baulig <martin@src.gnome.org>1998-06-03 20:59:23 +0800
committerMartin Baulig <martin@src.gnome.org>1998-06-03 20:59:23 +0800
commit8ab35d7ba084934eca8550eef0f873e5125b3545 (patch)
treeedcf585c01b639aeecbe781ba80ebcc055f73d1c /macros/gnome-guile-checks.m4
parentd20c8a382f1cb532f0f75f3e6e346e0ba672da7f (diff)
downloadgsoc2013-evolution-8ab35d7ba084934eca8550eef0f873e5125b3545.tar.gz
gsoc2013-evolution-8ab35d7ba084934eca8550eef0f873e5125b3545.tar.zst
gsoc2013-evolution-8ab35d7ba084934eca8550eef0f873e5125b3545.zip
Looks also in $GNOME_LIBDIR; added failflag: GNOME_CHECK_GUILE(fail) will
* gnome-guile-checks.m4 (GNOME_CHECK_GUILE): Looks also in $GNOME_LIBDIR; added failflag: GNOME_CHECK_GUILE(fail) will abort if guile cannot be found. svn path=/trunk/; revision=243
Diffstat (limited to 'macros/gnome-guile-checks.m4')
-rw-r--r--macros/gnome-guile-checks.m489
1 files changed, 78 insertions, 11 deletions
diff --git a/macros/gnome-guile-checks.m4 b/macros/gnome-guile-checks.m4
index df1e9f0665..5651f4dae5 100644
--- a/macros/gnome-guile-checks.m4
+++ b/macros/gnome-guile-checks.m4
@@ -1,23 +1,90 @@
+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,main,[
- QTTHREADS_LIB="-lqthreads"
- AC_CHECK_LIB(termcap,main,TERMCAP_LIB="-ltermcap")
- AC_CHECK_LIB(readline,main,READLINE_LIB="-lreadline")
+ QTTHREADS_LIB="-lqthreads"
],[
- AC_CHECK_LIB(qt, qt_null, QTTHREADS_LIB="-lqt")
+ 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)
- AC_SUBST(QTTHREADS_LIB)
- AC_CHECK_LIB(guile, scm_boot_guile,[
- GUILE_LIBS="-lguile"
- ac_cv_guile_found=yes
+ AC_CHECK_PROG(BUILD_GUILE, build-guile, yes, no)
+
+ if test "x$BUILD_GUILE" = "xyes"; then
+ AC_MSG_CHECKING(whether build-guile works)
+ if test x`build-guile --version >/dev/null 2>&1 || \
+ echo no` = xno; then
+ BUILD_GUILE=no
+ fi
+ AC_MSG_RESULT($BUILD_GUILE)
+ fi
+
+ AC_CHECK_LIB(m, sin)
+
+ if test "x$BUILD_GUILE" = "xyes"; then
+ AC_MSG_CHECKING(for guile libraries)
+ GUILE_LIBS="-L`build-guile info libdir` `build-guile link`"
+ AC_MSG_RESULT($GUILE_LIBS)
+ AC_MSG_CHECKING(for guile headers)
+ GUILE_INCS="-I`build-guile info includedir`"
+ 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, main, GUILE_LIBS="-lqt $GUILE_LIBS")
+ AC_CHECK_LIB(dl, dlopen, GUILE_LIBS="-ldl $GUILE_LIBS")
+ GUILE_LIBS="-lguile $GUILE_LIBS $QTTHREADS_LIB $TERMCAP_LIB $READLINE_LIB"
+ fi
+
+ AC_SUBST(GUILE_LIBS)
+ AC_SUBST(GUILE_INCS)
+
+ LDFLAGS="$saved_ldflags $GUILE_LIBS"
+ CPPFLAGS="$saved_cppflags $GUILE_INCS"
+
+ AC_MSG_CHECKING(whether guile works)
+ AC_TRY_LINK([
+ #include <libguile.h>
+ #include <guile/gh.h>
],[
- AC_MSG_WARN(Can not find Guile 1.2 on the system)
- ac_cv_guile_found=no
- ], $QTTHREADS_LIB $LIBS)
+ gh_eval_str("(newline)");
+ scm_boot_guile(0,NULL,NULL,NULL);
+ ],[
+ ac_cv_guile_found=yes
+ AC_DEFINE(HAVE_GUILE)
+ ],[
+ 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 1.2 on this system)
+ else
+ AC_MSG_WARN(Can not find Guile 1.2 on this system)
+ fi
+ ac_cv_guile_found=no
+ fi
+
+ LDFLAGS="$saved_ldflags"
+ CPPFLAGS="$saved_cppflags"
+
AC_SUBST(GUILE_LIBS)
AM_CONDITIONAL(GUILE, test x$ac_cv_guile_found = xyes)
])