[m-dev.] diff: add `--disable-dynamic-link' configure option

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 20 12:13:05 AEST 1999


Estimated hours taken: 0.25

configure.in:
	Add a configure option `--disable-dynamic-link' for disabling
	dynamic linking.  This is needed for munta (which is running
	mips-sgi-irix5.2), because munta has a dynamic (`-shared')
	version of -ldl, but no `-non_shared' version, and the
	current configure test does not detect that.

[Here's the diff with `-w', which ignores indentation changes]

cvs diff -w configure.in
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.182
diff -u -d -w -r1.182 configure.in
--- configure.in	1999/10/11 06:29:27	1.182
+++ configure.in	1999/10/20 01:58:24
@@ -267,6 +267,14 @@
 	AC_DEFINE(HAVE_SYS_STAT_H)
 fi
 #-----------------------------------------------------------------------------#
+#
+# Check for dynamic linking, unless the --disable-dynamic-link option
+# was specified.
+#
+AC_ARG_ENABLE(dynamic-link,
+[  --disable-dynamic-link  disable the use of dynamic linking],
+mercury_cv_enable_dynamic_link="$enableval",mercury_cv_enable_dynamic_link=yes)
+if test "$mercury_cv_enable_dynamic_link" = "yes"; then
 AC_CHECK_HEADER(dlfcn.h, HAVE_DLFCN_H=1)
 if test "$HAVE_DLFCN_H" = 1; then
 	AC_DEFINE(HAVE_DLFCN_H)
@@ -282,6 +290,7 @@
 
 # restore old value of LIBS
 LIBS="$save_LIBS"
+fi
 #-----------------------------------------------------------------------------#
 #
 # check the basics of sigaction

[Here's the same diff again, without the `-w', to show the indentation.]

Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.182
diff -u -d -r1.182 configure.in
--- configure.in	1999/10/11 06:29:27	1.182
+++ configure.in	1999/10/20 01:58:24
@@ -267,21 +267,30 @@
 	AC_DEFINE(HAVE_SYS_STAT_H)
 fi
 #-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(dlfcn.h, HAVE_DLFCN_H=1)
-if test "$HAVE_DLFCN_H" = 1; then
-	AC_DEFINE(HAVE_DLFCN_H)
-fi
-AC_CHECK_LIB(dl, dlopen, DL_LIBRARY="-ldl", DL_LIBRARY="")
-AC_SUBST(DL_LIBRARY)
+#
+# Check for dynamic linking, unless the --disable-dynamic-link option
+# was specified.
+#
+AC_ARG_ENABLE(dynamic-link,
+[  --disable-dynamic-link  disable the use of dynamic linking],
+mercury_cv_enable_dynamic_link="$enableval",mercury_cv_enable_dynamic_link=yes)
+if test "$mercury_cv_enable_dynamic_link" = "yes"; then
+	AC_CHECK_HEADER(dlfcn.h, HAVE_DLFCN_H=1)
+	if test "$HAVE_DLFCN_H" = 1; then
+		AC_DEFINE(HAVE_DLFCN_H)
+	fi
+	AC_CHECK_LIB(dl, dlopen, DL_LIBRARY="-ldl", DL_LIBRARY="")
+	AC_SUBST(DL_LIBRARY)
 
-# temporarily add $DL_LIBRARY to LIBS while we check for dlopen etc.
-save_LIBS="$LIBS"
-LIBS="$LIBS $DL_LIBRARY"
+	# temporarily add $DL_LIBRARY to LIBS while we check for dlopen etc.
+	save_LIBS="$LIBS"
+	LIBS="$LIBS $DL_LIBRARY"
 
-AC_HAVE_FUNCS(dlopen dlclose dlsym dlerror)
+	AC_HAVE_FUNCS(dlopen dlclose dlsym dlerror)
 
-# restore old value of LIBS
-LIBS="$save_LIBS"
+	# restore old value of LIBS
+	LIBS="$save_LIBS"
+fi
 #-----------------------------------------------------------------------------#
 #
 # check the basics of sigaction

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list