From 7b45ce23a1e3ef4c5ff3c889eca134e326f430b1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 18 Dec 2000 18:45:44 +0000 Subject: [PATCH] Add support for BeOS, which doesn't have libm. --- ChangeLog | 5 +++++ src/Makefile.in | 2 +- src/configure | 43 +++++++++++++++++++++++++++++++++++++++++++ src/configure.in | 5 +++++ 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3f83305..0023a5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-12-18 Bruno Haible + + * src/configure.in: Add check for rand() in libm. Needed for BeOS. + * src/Makefile.in (LIBS): Use @GPERF_LIBM@ instead of hardwiring -lm. + 2000-11-20 Bruno Haible * doc/help2man: Update to version 1.23. diff --git a/src/Makefile.in b/src/Makefile.in index 60f73c7..208598e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -61,7 +61,7 @@ VPATH = $(srcdir) OBJECTS = new.o options.o iterator.o main.o gen-perf.o key-list.o list-node.o \ hash-table.o bool-array.o read-line.o trace.o vectors.o version.o -LIBS = ../lib/libgp.a -lm +LIBS = ../lib/libgp.a @GPERF_LIBM@ CPPFLAGS = -I. -I$(srcdir)/../lib TARGETPROG = gperf diff --git a/src/configure b/src/configure index edd1fd7..848959f 100755 --- a/src/configure +++ b/src/configure @@ -1304,6 +1304,48 @@ done fi fi +echo $ac_n "checking for rand in -lm""... $ac_c" 1>&6 +echo "configure:1309: checking for rand in -lm" >&5 +ac_lib_var=`echo m'_'rand | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + GPERF_LIBM="-lm" +else + echo "$ac_t""no" 1>&6 +GPERF_LIBM="" +fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -1444,6 +1486,7 @@ s%@CXXCPP@%$CXXCPP%g s%@INSTALL@%$INSTALL%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@GPERF_LIBM@%$GPERF_LIBM%g CEOF EOF diff --git a/src/configure.in b/src/configure.in index e8880d5..82adad2 100644 --- a/src/configure.in +++ b/src/configure.in @@ -66,6 +66,11 @@ AC_CHECK_FUNCS(setrlimit) fi fi dnl +dnl checks for libraries +dnl +AC_CHECK_LIB(m, rand, GPERF_LIBM="-lm", GPERF_LIBM="") +AC_SUBST(GPERF_LIBM) +dnl dnl That's it. dnl AC_OUTPUT(Makefile)