[m-rev.] diff: fix bindist bug

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Oct 11 05:39:25 AEST 2002


Estimated hours taken: 0.5
Branches: main

Fix a bug in the binary distribution introduced by stayl's 2002/02/11
change, where bindist/bindist.configure.in was referring to
mercury_check_header, which only defined in configure.in, not
in aclocal.m4.

aclocal.m4:
configure.in:
	Move the definition of mercury_check_header from configure.in
	to aclocal.m4, for use by MERCURY_CHECK_READLINE, which is
	invoked by bindist/bindist.configure.in.
	This required changing mercury_check_header from a shell functiona
	to an autoconf macro, and hence renaming it as uppercase.

Workspace: /home/ceres/fjh/ws-ceres2/mercury
Index: aclocal.m4
===================================================================
RCS file: /home/mercury1/repository/mercury/aclocal.m4,v
retrieving revision 1.11
diff -u -d -r1.11 aclocal.m4
--- aclocal.m4	3 Oct 2002 03:25:00 -0000	1.11
+++ aclocal.m4	10 Oct 2002 19:28:18 -0000
@@ -12,6 +12,18 @@
 # bindist/bindist.configure.in into this file...
 #
 #-----------------------------------------------------------------------------#
+AC_DEFUN(MERCURY_CHECK_FOR_HEADERS,
+[
+    for mercury_cv_header in $1; do
+	mercury_cv_header_define="MR_HAVE_`echo $mercury_cv_header | \
+		tr abcdefghijklmnopqrstuvwxyz./ ABCDEFGHIJKLMNOPQRSTUVWXYZ__`"
+	AC_CHECK_HEADER($mercury_cv_header, [
+		AC_DEFINE_UNQUOTED($mercury_cv_header_define)
+		eval "$mercury_cv_header_define=1"
+	])
+    done
+])
+#-----------------------------------------------------------------------------#
 #
 # Turn off MacOS's so-called "smart" C preprocessor, if present,
 # since it causes lots of spurious warning messages,
@@ -52,7 +64,7 @@
 if test "$mercury_cv_with_readline" = yes; then
 
 	# check for the readline header files
-	mercury_check_for_headers readline/readline.h readline/history.h
+	MERCURY_CHECK_FOR_HEADERS(readline/readline.h readline/history.h)
 
 	# check for the libraries that readline depends on
 	MERCURY_MSG('looking for termcap or curses (needed by readline)...')
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.323
diff -u -d -r1.323 configure.in
--- configure.in	10 Oct 2002 13:46:15 -0000	1.323
+++ configure.in	10 Oct 2002 19:30:23 -0000
@@ -481,27 +481,14 @@
 		access
 
 #-----------------------------------------------------------------------------#
-# This is also used by MERCURY_CHECK_READLINE in aclocal.m4.
-mercury_check_for_headers () {
-    for mercury_cv_header in "$@"
-    do
-	mercury_cv_header_define="MR_HAVE_`echo $mercury_cv_header | \
-		tr abcdefghijklmnopqrstuvwxyz./ ABCDEFGHIJKLMNOPQRSTUVWXYZ__`"
-	AC_CHECK_HEADER($mercury_cv_header, [
-		AC_DEFINE_UNQUOTED($mercury_cv_header_define)
-		eval "$mercury_cv_header_define=1"
-	])
-    done
-}
-
-mercury_check_for_headers \
+MERCURY_CHECK_FOR_HEADERS( \
 		unistd.h sys/wait.h sys/siginfo.h sys/signal.h ucontext.h \
 		asm/sigcontext.h sys/param.h sys/time.h sys/times.h \
 		sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \
-		sys/stropts.h
+		sys/stropts.h)
 
 if test "$MR_HAVE_UCONTEXT_H" != 1; then
-	mercury_check_for_headers sys/ucontext.h
+	MERCURY_CHECK_FOR_HEADERS(sys/ucontext.h)
 fi
 #-----------------------------------------------------------------------------#
 #
@@ -3040,7 +3027,7 @@
 [  --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
-	mercury_check_for_headers dlfcn.h
+	MERCURY_CHECK_FOR_HEADERS(dlfcn.h)
 	AC_CHECK_LIB(dl, dlopen, DL_LIBRARY="-ldl", DL_LIBRARY="")
 	AC_SUBST(DL_LIBRARY)
 

-- 
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