mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
CONFIG: Fix GC checking on Debian-based systems
This changes GC checking to use the EL_CHECK_OPTIONAL_LIBRARY macro to reduce redundancy. This means that there is --with-gc instead of --enable-gc so you can pass it a path, which is needed on Debian systems where <gc.h> resides in /usr/include/gc/gc.h. The macro is adapted accordingly to serve the above purpose. That is, "$withval/include" and "$withval/lib" is only appended to CFLAGS and LIBS if they exist (else "$withval" is appended to CFLAGS).
This commit is contained in:
parent
3f878c6ce7
commit
7eaa1bb2f9
42
configure.in
42
configure.in
@ -395,9 +395,22 @@ AC_DEFUN([EL_CHECK_OPTIONAL_LIBRARY],
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
EL_SAVE_FLAGS
|
EL_SAVE_FLAGS
|
||||||
if test -n "$withval" && test -d "$withval"; then
|
if test -n "$withval" && test -d "$withval"; then
|
||||||
CFLAGS="$CFLAGS -I$withval/include";
|
# Be a little more careful when setting
|
||||||
CPPFLAGS="$CPPFLAGS -I$withval/include";
|
# include and lib directories. This way
|
||||||
LDFLAGS="$LDFLAGS -L$withval/lib";
|
# $withval will work when includes are
|
||||||
|
# there but the library is in the common
|
||||||
|
# /usr/lib ... Does the right thing when
|
||||||
|
# looking for gc on Debian.
|
||||||
|
if test -d "$withval/include"; then
|
||||||
|
CFLAGS="$CFLAGS -I$withval/include"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
||||||
|
else
|
||||||
|
CFLAGS="$CFLAGS -I$withval"
|
||||||
|
CPPFLAGS="$CPPFLAGS -I$withval"
|
||||||
|
fi
|
||||||
|
if test -d "$withval/lib"; then
|
||||||
|
LDFLAGS="$LDFLAGS -L$withval/lib"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_HEADERS([$3], [$1=yes], [$1=no; break;])
|
AC_CHECK_HEADERS([$3], [$1=yes], [$1=no; break;])
|
||||||
@ -446,6 +459,9 @@ EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen,
|
|||||||
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
|
||||||
[ --without-idn disable international domain names support])
|
[ --without-idn disable international domain names support])
|
||||||
|
|
||||||
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GC, gc, gc.h, gc, GC_init,
|
||||||
|
[ --with-gc enable Boehm's garbage collector])
|
||||||
|
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
dnl Bookmark and XBEL support
|
dnl Bookmark and XBEL support
|
||||||
dnl ===================================================================
|
dnl ===================================================================
|
||||||
@ -1253,26 +1269,6 @@ EL_ARG_ENABLE(CONFIG_OWN_LIBC, own-libc, [Own libc stubs],
|
|||||||
EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary],
|
EL_ARG_ENABLE(CONFIG_SMALL, small, [Small binary],
|
||||||
[ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)])
|
[ --enable-small reduce binary size as far as possible (but see the bottom of doc/small.txt!)])
|
||||||
|
|
||||||
EL_ARG_ENABLE(CONFIG_GC, gc, [Garbage collector],
|
|
||||||
[ --enable-gc enable Boehm's garbage collector])
|
|
||||||
|
|
||||||
EL_SAVE_FLAGS
|
|
||||||
if test "x${enable_gc}" = xyes; then
|
|
||||||
CFLAGS="$CFLAGS -I/usr/include/gc"
|
|
||||||
# -lgc might already be added by SEE
|
|
||||||
AC_TRY_LINK([#include <gc.h>
|
|
||||||
], [void *p = GC_MALLOC(1);], CONFIG_GC=yes, CONFIG_GC=no)
|
|
||||||
if test "$CONFIG_GC" != yes; then
|
|
||||||
LIBS="$LIBS -lgc"
|
|
||||||
AC_TRY_LINK([#include <gc.h>
|
|
||||||
], [void *p = GC_MALLOC(1);], CONFIG_GC=yes, CONFIG_GC=no)
|
|
||||||
fi
|
|
||||||
if test "$CONFIG_GC" != yes; then
|
|
||||||
EL_RESTORE_FLAGS
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AC_SUBST(CONFIG_GC)
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(weehoofooboomookerchoo,
|
AC_ARG_ENABLE(weehoofooboomookerchoo,
|
||||||
[
|
[
|
||||||
Also check out the features.conf file for more information about features!
|
Also check out the features.conf file for more information about features!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user