[m-rev.] diff: don't link with `-lm' for Mingw

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 13 19:03:29 AEDT 2003


Branches: main, release
Estimated hours taken: 1

configure.in:
	Don't link in `-lm' when cross-compiling to Mingw,
	since doing so causes cygwin1.dll to be linked in,
	which we don't want.

Workspace: /home/fjh/ws/hermes
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.353
diff -u -d -r1.353 configure.in
--- configure.in	10 Feb 2003 15:20:09 -0000	1.353
+++ configure.in	13 Feb 2003 07:59:57 -0000
@@ -496,7 +496,13 @@
 AC_PROG_CPP
 #-----------------------------------------------------------------------------#
 # Check for `-lm': some systems, e.g. MacOS X (Darwin), don't have it.
+# When cross-compiling from Cygwin to Mingw (and perhaps also on
+# native Mingw?), `-lm' exists, but it is not needed and in fact we must
+# not use it, because if we do then it causes cygwin1.dll to be linked in.
 AC_CHECK_LIB(m, sin, [MATH_LIB=-lm], [MATH_LIB=])
+case "$CC" in *"-mno-cygwin")
+	MATH_LIB=
+esac
 AC_SUBST(MATH_LIB)
 #-----------------------------------------------------------------------------#
 AC_MSG_CHECKING(for use of a Microsoft C compiler)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list