Hi Jerome,

Jerome Kelleher wrote:
Program: any compilations using the options returned by gsl-config will fail.

Please let me know if I can provide any more information. I would be happy to test any patches to fix this; I'm afraid I don't know enough about the GSL autoconf setup to propose a fix.

I think the patch enclosed would fix this problem, but I haven't tested it on any Haiku machine. If you could please try it out and it will be easier for Brian to consider the patch.

Thanks,
Peter

--
Peter Johansson

svndigest maintainer, http://dev.thep.lu.se/svndigest
yat maintainer,       http://dev.thep.lu.se/yat

diff --git a/ChangeLog b/ChangeLog
index 4d90d85..d3ac4b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-05-25  Peter Johansson  <[email protected]>
+
+	* configure.ac: added variable GSL_LIBM from macro AC_CHECK_LIBM
+	* Makefile.am: added GSL_LIBM in edit substitution
+	* gsl-config.in: using variable $GSL_LIBM rather than hrad-coded -libm
+	* gsl.pc.in: using variable $GSL_LIBM rather than hrad-coded -libm
+
 2010-04-24  Brian Gough  <[email protected]>
 
 	* configure.ac: added macro for substituting isfinite by
diff --git a/Makefile.am b/Makefile.am
index 45b7c15..6ddf033 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -55,6 +55,7 @@ edit = $(SED) \
 	-e 's|@libd...@]|$(libdir)|g' \
 	-e 's|@included...@]|$(includedir)|g' \
 	-e 's|@gsl_cfla...@]|$(GSL_CFLAGS)|g' \
+	-e 's|@gsl_li...@]|$(GSL_LIBM)|g' \
 	-e 's|@gsl_li...@]|$(GSL_LIBS)|g' \
 	-e 's|@li...@]|$(LIBS)|g' \
 	-e 's|@versi...@]|$(VERSION)|g'
diff --git a/configure.ac b/configure.ac
index ff6915b..041025b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,9 +101,13 @@ AC_C_CHAR_UNSIGNED
 
 GSL_CFLAGS="-I$includedir"
 GSL_LIBS="-L$libdir -lgsl"
+dnl macro from libtool - can be replaced with LT_LIB_M when we require libtool 2
+AC_CHECK_LIBM
+GSL_LIBM=$LIBM
 
 AC_SUBST(GSL_CFLAGS)
 AC_SUBST(GSL_LIBS)
+AC_SUBST(GSL_LIBM)
 
 if test "$ac_cv_c_inline" != no ; then 
 dnl Check for "extern inline", using a modified version of the test
diff --git a/gsl-config.in b/gsl-config.in
index 29092f6..3662532 100755
--- a/gsl-config.in
+++ b/gsl-config.in
@@ -63,11 +63,11 @@ while test $# -gt 0; do
 
     --libs)
         : ${GSL_CBLAS_LIB=-lgslcblas}
-       	echo @GSL_LIBS@ $GSL_CBLAS_LIB -lm
+       	echo @GSL_LIBS@ $GSL_CBLAS_LIB @GSL_LIBM@
        	;;
 
     --libs-without-cblas)
-       	echo @GSL_LIBS@ -lm
+       	echo @GSL_LIBS@ @GSL_LIBM@
        	;;
     *)
 	usage
diff --git a/gsl.pc.in b/gsl.pc.in
index 7309232..1ccd439 100644
--- a/gsl.pc.in
+++ b/gsl.pc.in
@@ -6,5 +6,5 @@ included...@includedir@
 Name: GSL
 Description: GNU Scientific Library
 Version: @VERSION@
-Libs: @GSL_LIBS@ -lgslcblas @LIBS@
+Libs: @GSL_LIBS@ -lgslcblas @GSL_LIBM@ @LIBS@
 Cflags: @GSL_CFLAGS@
_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl

Reply via email to