[m-rev.] for review: fix an ml bug introduced with the latest ssdb changes
Zoltan Somogyi
zs at csse.unimelb.edu.au
Thu Nov 8 16:57:15 AEDT 2007
For review by Julien. The fix is still bootchecking, but I am pretty sure
my bug identification is correct.
Zoltan.
Fix a bug introduced with the last ssdb change to ml.in. The context of the bug
was the renaming of a bunch of sh variables from TRACE_xxx to TRACE_BASE_xxx
(for several values of xxx). The bug itself was that the defining occurrence
of one such variable (TRACE_LIBS_SYSTEM) was renamed, but a reference to it
(in the true arm of the switch of $trace_base) was not. The result was a
reference to an undefined variable, which the shell replaced with "".
Since $TRACE_LIBS_SYSTEM should have contained -ldl on some systems (including
my laptop), the upshot was that all attempts to link debuggable executables
failed, with the linker unable to find the definitions of the functions defined
in libdl.a.
scripts/ml.in:
Fix that bug.
Change to four-space indentation, though using tabs (for speed of
interpretation) rather than spaces in order to avoid bad line breaks.
Fix deviations from good sh programming style, including missing ;;s
at the end of case arms.
configure.in:
Rename TRACE_LIBS_SYSTEM to TRACE_BASE_LIBS_SYSTEM, since having the
TRACE_BASE_LIBS_SYSTEM sh variable in ml.in get its value from a
configure variable named TRACE_LIBS_SYSTEM is confusing (since ml.in
also has a sh variable named TRACE_LIBS_SYSTEM).
scripts/ml.in:
scripts/Mercury.config.in:
scripts/Mercury.config.bootstrap.in:
Conform to the change to configure.in.
cvs diff: Diffing .
Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.507
diff -u -b -r1.507 configure.in
--- configure.in 25 Oct 2007 06:53:39 -0000 1.507
+++ configure.in 8 Nov 2007 04:05:22 -0000
@@ -4389,8 +4389,8 @@
LIBS="$save_LIBS"
fi
-TRACE_LIBS_SYSTEM="$SOCKET_LIBRARY $NSL_LIBRARY $DL_LIBRARY"
-AC_SUBST(TRACE_LIBS_SYSTEM)
+TRACE_BASE_LIBS_SYSTEM="$SOCKET_LIBRARY $NSL_LIBRARY $DL_LIBRARY"
+AC_SUBST(TRACE_BASE_LIBS_SYSTEM)
#-----------------------------------------------------------------------------#
#
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
Index: scripts/Mercury.config.bootstrap.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mercury.config.bootstrap.in,v
retrieving revision 1.7
diff -u -b -r1.7 Mercury.config.bootstrap.in
--- scripts/Mercury.config.bootstrap.in 21 Mar 2007 21:03:31 -0000 1.7
+++ scripts/Mercury.config.bootstrap.in 8 Nov 2007 04:05:14 -0000
@@ -76,7 +76,7 @@
--ranlib-flags "@RANLIBFLAGS@" \
--link-executable-command "@LINK_EXE@" \
--link-shared-lib-command "@LINK_SHARED_OBJ@" \
- --trace-libs "@TRACE_LIBS_SYSTEM@" \
+ --trace-libs "@TRACE_BASE_LIBS_SYSTEM@" \
--thread-libs "@THREAD_LIBS@" \
--shared-libs "@SHARED_LIBS@" \
--math-lib "@MATH_LIB@" \
Index: scripts/Mercury.config.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.18
diff -u -b -r1.18 Mercury.config.in
--- scripts/Mercury.config.in 20 Jul 2007 01:22:05 -0000 1.18
+++ scripts/Mercury.config.in 8 Nov 2007 04:05:14 -0000
@@ -80,7 +80,7 @@
--ranlib-flags "@RANLIBFLAGS@" \
--link-executable-command "@LINK_EXE@" \
--link-shared-lib-command "@LINK_SHARED_OBJ@" \
- --trace-libs "@TRACE_LIBS_SYSTEM@" \
+ --trace-libs "@TRACE_BASE_LIBS_SYSTEM@" \
--thread-libs "@THREAD_LIBS@" \
--shared-libs "@SHARED_LIBS@" \
--math-lib "@MATH_LIB@" \
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.120
diff -u -b -r1.120 ml.in
--- scripts/ml.in 1 Nov 2007 06:11:32 -0000 1.120
+++ scripts/ml.in 8 Nov 2007 04:23:34 -0000
@@ -1,4 +1,5 @@
#! /bin/sh
+# vim: ts=4 sw=4 noet
# @configure_input@
#---------------------------------------------------------------------------#
# Copyright (C) 1995-2006 The University of Melbourne.
@@ -49,7 +50,7 @@
LDFLAGS_FOR_TRACE="@LDFLAGS_FOR_TRACE@"
LD_LIBFLAGS_FOR_THREADS="@LD_LIBFLAGS_FOR_THREADS@"
THREAD_LIBS="@THREAD_LIBS@"
-TRACE_BASE_LIBS_SYSTEM="@TRACE_LIBS_SYSTEM@"
+TRACE_BASE_LIBS_SYSTEM="@TRACE_BASE_LIBS_SYSTEM@"
TMPDIR=${TMPDIR=/tmp}
MATH_LIB=${MERCURY_MATH_LIB="@MATH_LIB@"}
@@ -106,36 +107,50 @@
MAYBE_STATIC_OPT=""
case $debug in
- true) trace=true ;;
- false) ;;
+ true)
+ trace=true
+ ;;
+ false)
+ ;;
esac
trace_base=false
case $trace in
- true) trace_base=true ;;
- false) ;;
+ true)
+ trace_base=true
+ ;;
+ false)
+ ;;
esac
-
case $ss_debug in
- true) trace_base=true ;;
- false) ;;
+ true)
+ trace_base=true
+ ;;
+ false)
+ ;;
esac
case "$mercury_stdlib_dir" in
- "") LIBDIR= ;;
- *) LIBDIR=$mercury_stdlib_dir/lib ;;
+ "")
+ LIBDIR=
+ ;;
+ *)
+ LIBDIR=$mercury_stdlib_dir/lib
+ ;;
esac
# If you haven't set mercury_libs, set it to the default value
# (shared on most systems). Note that if you have set all_libs,
# it will also have set mercury_libs.
-case $mercury_libs in default)
+case $mercury_libs in
+ default)
mercury_libs=shared
case $FULLARCH in
i*86-*-linux*|i*86-*-freebsd*|i*86-*-cygwin*|i*86-*-solaris*)
# shared libraries are not the default on x86
#systems that use ELF -- see README.Linux
- case $make_shared_lib in false)
+ case $make_shared_lib in
+ false)
mercury_libs=static
;;
esac
@@ -145,19 +160,20 @@
# If you haven't set all_libs, set it to the default value
# (shared on most systems).
-case $all_libs in default)
+case $all_libs in
+ default)
all_libs=shared
case $FULLARCH in
i*86-*-linux*|i*86-*-freebsd*|i*86-*-cygwin*)
- # shared libraries are not the default on Linux
- # -- see README.Linux
- # Likewise for FreeBSD and Cygwin
+ # Shared libraries are not the default on Linux
+ # -- see README.Linux. Likewise for FreeBSD and Cygwin.
#
# We don't do this for Solaris/x86 because -ldl is
# only available for dynamically linked executables
# XXX With these defaults linking with Mercury
# libraries other than the standard library will fail.
- case $make_shared_lib in false)
+ case $make_shared_lib in
+ false)
all_libs=static
;;
esac
@@ -168,8 +184,10 @@
# Defaults have been set, now set options.
-case $all_libs in static)
+case $all_libs in
+ static)
MAYBE_STATIC_OPT=$LD_STATIC_FLAGS
+ ;;
esac
#
@@ -181,40 +199,54 @@
# if the --print-grade option is specified,
# then all we do is print the grade and then exit
-case "$print_grade" in true)
+case "$print_grade" in
+ true)
echo $GRADE
exit 0
+ ;;
esac
# Compute the gc grade from the grade
case "$GRADE" in
*.par*.gcd*.prof*)
- gc_grade=par_gc_debug_prof ;;
+ gc_grade=par_gc_debug_prof
+ ;;
*.par*.gcd*)
- gc_grade=par_gc_debug ;;
+ gc_grade=par_gc_debug
+ ;;
*.gcd*.prof*)
- gc_grade=gc_debug_prof ;;
+ gc_grade=gc_debug_prof
+ ;;
*.gcd*)
- gc_grade=gc_debug ;;
+ gc_grade=gc_debug
+ ;;
*.par*.gc*.prof*)
- gc_grade=par_gc_prof ;;
+ gc_grade=par_gc_prof
+ ;;
*.par*.gc*)
- gc_grade=par_gc ;;
+ gc_grade=par_gc
+ ;;
*.gc*.prof*)
- gc_grade=gc_prof ;;
+ gc_grade=gc_prof
+ ;;
*.gc*)
- gc_grade=gc ;;
+ gc_grade=gc
+ ;;
*.mps*)
- gc_grade=mps ;;
+ gc_grade=mps
+ ;;
*)
- gc_grade=nogc ;;
+ gc_grade=nogc
+ ;;
esac
# if the --print-gc-grade option is specified,
# then all we do is print the gc grade and then exit
-case "$print_gc_grade" in true)
+case "$print_gc_grade" in
+ true)
echo $gc_grade
exit 0
+ ;;
esac
case "$gc_grade" in
@@ -224,22 +256,25 @@
;;
*)
LIBGC="-l$gc_grade"
- LIBGC_STATIC=`$FIX_PATH_FOR_LINKER \
- $LIBDIR/lib$gc_grade. at LIB_SUFFIX@`
+ LIBGC_STATIC=`$FIX_PATH_FOR_LINKER $LIBDIR/lib$gc_grade. at LIB_SUFFIX@`
;;
esac
case $readline in
- true) ;;
- false) READLINE_LIBRARIES=
+ true)
+ ;;
+ false)
+ READLINE_LIBRARIES=
;;
esac
case $trace_base in
- true) TRACE_BASE_LIBS="-l$EVENTSPEC_LIB_NAME \
+ true)
+ TRACE_BASE_LIBS="-l$EVENTSPEC_LIB_NAME \
-l$BROWSER_LIB_NAME -l$MDBCOMP_LIB_NAME"
- TRACE_BASE_LIBS_SYSTEM="$TRACE_LIBS_SYSTEM $READLINE_LIBRARIES"
+ TRACE_BASE_LIBS_SYSTEM="$TRACE_BASE_LIBS_SYSTEM \
+ $READLINE_LIBRARIES"
TRACE_BASE_STATIC_LIBS="\
`$FIX_PATH_FOR_LINKER \
$LIBDIR/$GRADE/lib$EVENTSPEC_LIB_NAME. at LIB_SUFFIX@` \
@@ -248,68 +283,88 @@
`$FIX_PATH_FOR_LINKER \
$LIBDIR/$GRADE/lib$MDBCOMP_LIB_NAME. at LIB_SUFFIX@`"
;;
- false) TRACE_BASE_LIBS=
+ false)
+ TRACE_BASE_LIBS=
TRACE_BASE_LIBS_SYSTEM=
TRACE_BASE_STATIC_LIBS=
;;
esac
case $trace in
- true) TRACE_LIBS="-l$TRACE_LIB_NAME $TRACE_BASE_LIBS"
+ true)
+ TRACE_LIBS="-l$TRACE_LIB_NAME $TRACE_BASE_LIBS"
TRACE_LIBS_SYSTEM="$TRACE_BASE_LIBS_SYSTEM"
TRACE_STATIC_LIBS="\
`$FIX_PATH_FOR_LINKER \
$LIBDIR/$GRADE/lib$TRACE_LIB_NAME. at LIB_SUFFIX@` \
$TRACE_BASE_STATIC_LIBS"
;;
- false) TRACE_LIBS=
+ false)
+ TRACE_LIBS=
TRACE_LIBS_SYSTEM=
TRACE_STATIC_LIBS=
;;
esac
case $ss_debug in
- true) SSDB_LIBS="-l$SSDB_LIB_NAME"
+ true)
+ SSDB_LIBS="-l$SSDB_LIB_NAME"
SSDB_STATIC_LIBS="\
`$FIX_PATH_FOR_LINKER \
$LIBDIR/$GRADE/lib$SSDB_LIB_NAME. at LIB_SUFFIX@`"
;;
- false) SSDB_LIBS=
+ false)
+ SSDB_LIBS=
SSDB_STATIC_LIBS=
;;
esac
case $strip in
- true) STRIP_OPTS="-s" ;;
- false) STRIP_OPTS="" ;;
+ true)
+ STRIP_OPTS="-s"
+ ;;
+ false)
+ STRIP_OPTS=""
+ ;;
esac
# Determine whether to link the executable with debugging symbols when using
# MSVC.
-if [ $strip = "false" -a $COMPILER = "cl" ]
+if test $strip = "false" -a $COMPILER = "cl"
then
DEBUG_FLAG="/DEBUG"
else
DEBUG_FLAG=""
fi
-case $gc_method in mps)
- use_thread_libs=true ;;
+case $gc_method in
+ mps)
+ use_thread_libs=true
+ ;;
esac
-case $thread_safe in true)
- use_thread_libs=true ;;
+case $thread_safe in
+ true)
+ use_thread_libs=true
+ ;;
esac
case $use_thread_libs.$make_shared_lib in
- true.false) ARCH_OPTS=$LDFLAGS_FOR_THREADS ;;
- true.true) ARCH_OPTS=$LD_LIBFLAGS_FOR_THREADS ;;
- false.*) THREAD_LIBS="" ;;
+ true.false)
+ ARCH_OPTS=$LDFLAGS_FOR_THREADS
+ ;;
+ true.true)
+ ARCH_OPTS=$LD_LIBFLAGS_FOR_THREADS
+ ;;
+ false.*)
+ THREAD_LIBS=""
+ ;;
esac
# Set the correct flags if we're to use the MS Visual C runtime.
use_msvcrt=@USE_MSVCRT@
-if test $use_msvcrt = "yes"; then
- MSVCRT_OPTS="/MD" # enable linking with the MS Visual C runtime
+if test $use_msvcrt = "yes"
+then
+ MSVCRT_OPTS="/MD" # Enable linking with the MS Visual C runtime.
NODEFAULTLIB_FLAG="/nodefaultlib:libc"
else
MSVCRT_OPTS=""
@@ -320,14 +375,20 @@
true)
LINKER="$LINK_SHARED_OBJ"
case $allow_undef in
- true) UNDEF_OPT="$ALLOW_UNDEFINED" ;;
- false) UNDEF_OPT="$ERROR_UNDEFINED" ;;
+ true)
+ UNDEF_OPT="$ALLOW_UNDEFINED"
+ ;;
+ false)
+ UNDEF_OPT="$ERROR_UNDEFINED"
+ ;;
esac
RPATH_OPT="$SHLIB_RPATH_OPT"
RPATH_SEP="$SHLIB_RPATH_SEP"
STDLIBS="$SHARED_LIBS $THREAD_LIBS"
- case $trace in true)
+ case $trace in
+ true)
ARCH_OPTS="$ARCH_OPTS $LD_LIBFLAGS_FOR_TRACE"
+ ;;
esac
;;
false)
@@ -336,26 +397,32 @@
RPATH_OPT="$EXE_RPATH_OPT"
RPATH_SEP="$EXE_RPATH_SEP"
STDLIBS="$MATH_LIB $THREAD_LIBS"
- case $trace in true)
+ case $trace in
+ true)
ARCH_OPTS="$ARCH_OPTS $LDFLAGS_FOR_TRACE"
+ ;;
esac
;;
esac
-# if the --print-link-command option is specified,
+# If the --print-link-command option is specified,
# then all we do is print the command used to link executables
# and then exit.
-case "$print_link_command" in true)
+case "$print_link_command" in
+ true)
echo $LINKER
exit 0
+ ;;
esac
-# if the --print-shared-lib-command option is specified,
+# If the --print-shared-lib-command option is specified,
# then all we do is print the command used to link executables
# and then exit.
-case "$print_shared_lib_link_command" in true)
+case "$print_shared_lib_link_command" in
+ true)
echo $LINK_SHARED_OBJ
exit 0
+ ;;
esac
if $print_map
@@ -371,7 +438,8 @@
"
system_libdir_opts=
for dir in $ALL_LOCAL_C_LIB_DIRS kludge_for_broken_shells; do
- if [ "$dir" != "kludge_for_broken_shells" ]; then
+ if test "$dir" != "kludge_for_broken_shells"
+ then
system_libdir_opts="@LIB_LIBPATH@$dir $system_libdir_opts"
fi
done
@@ -396,20 +464,26 @@
LIBS=${LIBS="$MERCURY_LIBS $TRACE_LIBS_SYSTEM $STDLIBS"}
merc_shlib_dirs=""
;;
- none) LIBS="$TRACE_LIBS_SYSTEM $STDLIBS"
+ none)
+ LIBS="$TRACE_LIBS_SYSTEM $STDLIBS"
LIBDIR_OPTS="$user_libdir_opts $system_libdir_opts"
merc_shlib_dirs=""
;;
esac
case $all_libs in
- shared) system_shlib_dirs=$ALL_LOCAL_C_LIB_DIRS ;;
- static) system_shlib_dirs="" ;;
+ shared)
+ system_shlib_dirs=$ALL_LOCAL_C_LIB_DIRS
+ ;;
+ static)
+ system_shlib_dirs=""
+ ;;
esac
RPATH_OPT_LIST=
# only set RPATH_OPT_LIST if the system supports shared libraries
-case $EXT_FOR_SHARED_LIB in so)
+case $EXT_FOR_SHARED_LIB in
+ so)
prev=""
for dir in $user_shlib_dirs $merc_shlib_dirs \
$system_shlib_dirs 'kludge for broken shells'
@@ -419,8 +493,12 @@
;;
*)
case "$prev" in
- "") RPATH_OPT_LIST="$RPATH_OPT$dir" ;;
- *) RPATH_OPT_LIST="$RPATH_OPT_LIST$RPATH_SEP$dir" ;;
+ "")
+ RPATH_OPT_LIST="$RPATH_OPT$dir"
+ ;;
+ *)
+ RPATH_OPT_LIST="$RPATH_OPT_LIST$RPATH_SEP$dir"
+ ;;
esac
;;
esac
@@ -431,7 +509,9 @@
case "$MKFIFO" in
- none) demangle=false ;;
+ none)
+ demangle=false
+ ;;
esac
LINKER_PRE_FLAGS="$MSVCRT_OPTS $PRINT_MAP_OPT $UNDEF_OPT $STRIP_OPTS $MAYBE_STATIC_OPT $ARCH_OPTS"
@@ -454,12 +534,12 @@
case $demangle in
true)
- # we would like to just run $CC and pipe the result into $DEMANGLER,
+ # We would like to just run $CC and pipe the result into $DEMANGLER,
# but `$CC | $DEMANGLER' would return the wrong exit status, so
# we need to use a named pipe; if the system doesn't have named
- # pipes, then we don't use the demangler
+ # pipes, then we don't use the demangler.
- # create the pipe, making sure we remove it if interrupted
+ # Create the pipe, making sure we remove it if interrupted.
old_umask=`umask`
umask 022
try=0
@@ -471,37 +551,46 @@
do
try="`expr $try + 1`"
# give up after 20 tries
- case "$try" in 20)
- echo "ml: unable to create temporary directory" \
- "for pipe" 1>&2
+ case "$try" in
+ 20)
+ echo "ml: unable to create temporary directory for pipe" \
+ 1>&2
exit 1
+ ;;
esac
done
trap 'rm -rf $ML_TMPDIR; exit 1' 1 2 3 13 15
umask $old_umask
$MKFIFO $PIPE
- # execute the demangler in the background, with stdin
- # coming from the pipe and with stdout redirected to stderr
+ # Execute the demangler in the background, with stdin coming from
+ # the pipe and with stdout redirected to stderr.
exec $DEMANGLER --explain-link-errors 1>&2 < $PIPE &
- # execute $CC with stdout & stderr redirected to
- # go via the pipe to $DEMANGLER and then to stderr
+ # Execute $CC with stdout & stderr redirected to go via the pipe
+ # to $DEMANGLER and then to stderr.
case $# in
- 0) $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS >$PIPE 2>&1 ;;
- *) $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS \
- >$PIPE 2>&1 ;;
+ 0)
+ $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS >$PIPE 2>&1
+ ;;
+ *)
+ $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS >$PIPE 2>&1
+ ;;
esac
linker_status=$?
- # now we can remove the pipe; since is an open file, it will
- # stay around until $DEMANGLER exits
+ # Now we can remove the pipe; since is an open file, it will stay
+ # around until $DEMANGLER exits.
rm -rf $ML_TMPDIR
- # wait for the demangler to exit before exiting ourselves
+ # Wait for the demangler to exit before exiting ourselves.
wait
exit $linker_status
;;
-false)
+ false)
case $# in
- 0) exec $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS ;;
- *) exec $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS ;;
+ 0)
+ exec $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS
+ ;;
+ *)
+ exec $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS
+ ;;
esac
;;
esac
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list