[m-dev.] for review: add --disable-extern-debug option to configure

Fergus Henderson fjh at cs.mu.OZ.AU
Sat May 22 13:46:35 AEST 1999


Currently the weekly tests on munta are failing.
The following patch is an attempt to fix that.

Comments?

--------------------

Estimated hours taken: 0.5

configure.in:
	Add a new option `--disable-extern-debug' for disabling the external debugger
	support; this is needed because the autodetection for sockets doesn't work
	properly on our SGI machine (munta), and so we need to manually override it.

tools/test_mercury:
	For munta, pass --disable-extern-debug to configure.


Workspace: /home/mercury0/fjh/mercury-other
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.169
diff -u -r1.169 configure.in
--- configure.in	1999/05/22 03:40:37	1.169
+++ configure.in	1999/05/22 03:40:46
@@ -1909,6 +1909,9 @@
 AC_SUBST_FILE(FINAL_GRADE_OPTIONS)
 
 #-----------------------------------------------------------------------------#
+#
+# Check whether sockets work (we need them for the external debugger)
+#
 
 #
 # check whether we need -lsocket
@@ -2080,12 +2083,10 @@
 ],[mercury_cv_sockets_work=yes],[mercury_cv_sockets_work=no]))
 
 #
-# figure out whether the test succeeded, and if so,
-# enable the external debugger
+# figure out whether the test succeeded
 #
 if test "$mercury_cv_sockets_work" = yes; then
 	AC_MSG_RESULT(yes)
-	AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
 else
 	AC_MSG_RESULT(no)
 fi
@@ -2094,6 +2095,36 @@
 # restore the previous value of LIBS
 #
 LIBS="$save_LIBS"
+
+#-----------------------------------------------------------------------------#
+#
+# Add an option that enables the external debugger support.
+# By default, external debugger support is enabled if and only if
+# sockets work.  But it is also possible to explicitly disable this
+# by passing the `--disable-extern-debug' option.  This is needed on
+# some platforms because the test for sockets working sometimes gets
+# some false positives (e.g. if they work with dynamic linking but
+# not static linking, then the test will pass, but it will cause
+# problems later on when we try to link things statically).
+#
+AC_ARG_ENABLE(external-debug,
+[  --disable-extern-debug  disable the external (separate process) debugger],
+mercury_cv_enable_extern_debug="$enableval",
+mercury_cv_enable_extern_debug="$mercury_cv_sockets_work")
+
+AC_MSG_CHECKING(whether to enable the external debugger)
+if test "$mercury_cv_enable_extern_debug" = "yes"; then
+	if test "$mercury_cv_sockets_work" = yes; then
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
+	else
+		AC_MSG_RESULT(no)
+		AC_MSG_ERROR(Cannot enable external debugger)
+		AC_MSG_ERROR(because sockets do not work)
+	fi		
+else
+	AC_MSG_RESULT(no)
+fi
 #-----------------------------------------------------------------------------#
 MERCURY_CHECK_READLINE
 #-----------------------------------------------------------------------------#
Index: tools/test_mercury
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/test_mercury,v
retrieving revision 1.95
diff -u -r1.95 test_mercury
--- test_mercury	1999/03/22 16:28:01	1.95
+++ test_mercury	1999/05/22 03:43:46
@@ -150,9 +150,18 @@
 #-----------------------------------------------------------------------------#
 
 case $HOST in
-	murlibobo)	CONFIG_OPTS=--enable-all-grades ;;
-	kryten)		CONFIG_OPTS=--enable-all-grades ;;
-	*)		CONFIG_OPTS="" ;;
+	murlibobo)
+		CONFIG_OPTS=--enable-all-grades ;;
+	kryten)		
+		CONFIG_OPTS=--enable-all-grades ;;
+	munta)		
+		# On munta, we need to disable the external debugger,
+		# because it uses sockets, and munta doesn't have
+		# the static versions of the socket libraries
+		# installed.
+		CONFIG_OPTS=--disable-extern-debug ;;
+	*)	
+		CONFIG_OPTS="" ;;
 esac
 
 #-----------------------------------------------------------------------------#
-- 
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