From: oetiker Date: Thu, 12 May 2005 22:03:33 +0000 (+0000) Subject: make sure the header gets tested twice X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cb7e9e67ca8504ec45d51eddaf37cdf5b4822853;p=rrdtool.git make sure the header gets tested twice git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@551 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/acinclude.m4 b/acinclude.m4 index 6ada55c..0143cb4 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -21,7 +21,7 @@ AC_DEFUN([EX_CHECK_ALL], ex_check_save_CPPFLAGS=${CPPFLAGS} ex_check_save_LDFLAGS=${LDPFLAGS} if test "x$7" != "x"; then - CPPFLAGS="-I$7 $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$7" fi dnl try compiling naked first AC_CHECK_LIB($1,$2, [ @@ -37,7 +37,10 @@ AC_DEFUN([EX_CHECK_ALL], LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l $4` dnl remove the cached value and test again unset ac_cv_lib_$1_$2 - AC_CHECK_LIB($1,$2,[ AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[])],[]) + AC_CHECK_LIB($1,$2,[ + unset ac_cv_header_`echo $3 | sed "s/[^a-z]/_/"` + AC_CHECK_HEADER($3,[EX_CHECK_STATE=YES],[]) + ],[]) else AC_MSG_WARN([ ---------------------------------------------------------------------------- diff --git a/configure.ac b/configure.ac index 912e68b..fd6f52e 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,10 @@ AC_STRUCT_TM dnl Checks for libraries. AC_CHECK_FUNC(acos, , AC_CHECK_LIB(m, acos)) +dnl Use libiconv if we have one but fall back to libc otherwhise +AC_CHECK_LIB(iconv, iconv_open, , [ + AC_CHECK_FUNC(iconv_open,,) + ]) dnl add pic flag in any case this makes sure all our code is relocatable eval `./libtool --config | grep pic_flag`