[m-rev.] diff: eliminate more command line clutter

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Sep 19 14:41:10 AEST 2005


Reduce even further the clutter of boring command line arguments.

scripts/mgnuc.in:
	If a file named .mgnuc_opts exists in the current directory,
	read mgnuc options from it. This mechanism is very similar to the
	mechanism I added a while ago to get C compiler options from a
	file named .mgnuc_copts.

	Convert to four-space indentation.

scripts/mgnuc_file_opts.sh-subr:
	New file containing most of the option handling code that used to be
	in mgnuc.in. Now, it is is included in mgnuc twice: once for handling
	options from the command line, once for handling options from
	.mgnuc_opts files.

configure.in:
	Set up configure to insert mgnuc_file_opts.sh-subr into mgnuc.

*/.mgnuc_opts:
	New files specifying the --no-mercury-stdlibdir mgnuc option.

Mmake.workspace:
	Don't pass --no-mercury-stdlibdir on command lines anymore, since this
	is now taken care of by the .mgnuc_opts files.

Zoltan.

cvs diff: Diffing .
Index: Mmake.workspace
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/Mmake.workspace,v
retrieving revision 1.19
diff -u -b -r1.19 Mmake.workspace
--- Mmake.workspace	20 May 2005 06:15:01 -0000	1.19
+++ Mmake.workspace	18 Sep 2005 06:00:48 -0000
@@ -112,8 +112,9 @@
 endif
 
 # now in FLAGS files
-# MCFLAGS    += --no-mercury-stdlib-dir -I$(LIBRARY_DIR)
-MGNUCFLAGS   += --no-mercury-stdlib-dir
+# MCFLAGS    += -I$(LIBRARY_DIR)
+# no in .mgnuc_opt files
+# MGNUCFLAGS += --no-mercury-stdlib-dir
 C2INITFLAGS  += --trace-init-file $(BROWSER_DIR)/$(BROWSER_LIB_NAME).init \
 		--trace-init-file $(MDBCOMP_DIR)/$(MDBCOMP_LIB_NAME).init
 C2INITARGS   += $(LIBRARY_DIR)/$(STD_LIB_NAME).init \
Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.430
diff -u -b -r1.430 configure.in
--- configure.in	13 Sep 2005 06:11:02 -0000	1.430
+++ configure.in	18 Sep 2005 06:12:13 -0000
@@ -3606,6 +3606,9 @@
 PARSE_ML_OPTIONS=$top/scripts/parse_ml_options.sh-subr
 CANONICAL_GRADE=$top/scripts/canonical_grade.sh-subr
 
+# The following allows us to duplicate a subroutine in mgnuc.
+
+MGNUC_FILE_OPTS=$top/scripts/mgnuc_file_opts.sh-subr
 
 # demangling hangs on cygwin, so don't enable it.
 case "$host" in
@@ -3620,6 +3623,7 @@
 AC_SUBST_FILE(FINAL_GRADE_OPTIONS)
 AC_SUBST_FILE(PARSE_ML_OPTIONS)
 AC_SUBST_FILE(CANONICAL_GRADE)
+AC_SUBST_FILE(MGNUC_FILE_OPTS)
 AC_SUBST(DEMANGLE)
 
 # mercury_config includes configure.help to include the help for configure
cvs diff: Diffing analysis
Index: analysis/.mgnuc_opts
===================================================================
RCS file: analysis/.mgnuc_opts
diff -N analysis/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ analysis/.mgnuc_opts	18 Sep 2005 06:08:04 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
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/tests
cvs diff: Diffing browser
Index: browser/.mgnuc_opts
===================================================================
RCS file: browser/.mgnuc_opts
diff -N browser/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ browser/.mgnuc_opts	18 Sep 2005 06:08:01 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing bytecode
Index: bytecode/.mgnuc_opts
===================================================================
RCS file: bytecode/.mgnuc_opts
diff -N bytecode/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bytecode/.mgnuc_opts	18 Sep 2005 06:09:48 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing compiler
Index: compiler/.mgnuc_opts
===================================================================
RCS file: compiler/.mgnuc_opts
diff -N compiler/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ compiler/.mgnuc_opts	18 Sep 2005 06:07:55 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
Index: deep_profiler/.mgnuc_opts
===================================================================
RCS file: deep_profiler/.mgnuc_opts
diff -N deep_profiler/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ deep_profiler/.mgnuc_opts	18 Sep 2005 06:07:59 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
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/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
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/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
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/odbc
cvs diff: Diffing extras/posix
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/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
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
Index: library/.mgnuc_opts
===================================================================
RCS file: library/.mgnuc_opts
diff -N library/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ library/.mgnuc_opts	18 Sep 2005 05:59:14 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing mdbcomp
Index: mdbcomp/.mgnuc_opts
===================================================================
RCS file: mdbcomp/.mgnuc_opts
diff -N mdbcomp/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mdbcomp/.mgnuc_opts	18 Sep 2005 06:08:05 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing profiler
Index: profiler/.mgnuc_opts
===================================================================
RCS file: profiler/.mgnuc_opts
diff -N profiler/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ profiler/.mgnuc_opts	18 Sep 2005 06:07:57 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/.mgnuc_opts
===================================================================
RCS file: runtime/.mgnuc_opts
diff -N runtime/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ runtime/.mgnuc_opts	18 Sep 2005 06:15:31 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
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/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
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/mgnuc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.110
diff -u -b -r1.110 mgnuc.in
--- scripts/mgnuc.in	13 Sep 2005 08:25:42 -0000	1.110
+++ scripts/mgnuc.in	18 Sep 2005 05:58:00 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-2005 The University of Melbourne.
@@ -103,46 +104,41 @@
 	-v, --verbose
 		Echo gcc command before executing it.
 	--no-ansi
-		Don't pass \`-ansi' to gcc.
-		Use the full contents of system headers,
+        Don't pass \`-ansi' to gcc. Use the full contents of system headers,
 		rather than the ANSI subset.
 	--no-check
 		Don't enable any of gcc's warnings.
 	--low-level-debug
-		Enable low-level debugging of the C code. Useful only
-		for Mercury system developers.
+        Enable low-level debugging of the C code. Useful only for Mercury
+        system developers.
 	-g, --c-debug
-		Generate object files that can debugged with C debuggers
-		such as gdb.
+        Generate object files that can debugged with C debuggers such as gdb.
 	--no-c-optimize
 		Disable optimization by the C compiler.
 	--inline-alloc
 		Inline calls to the memory allocator.
 	--split-c-files
-		This option must be specified if the argument C files were
-		generated by the Mercury compiler with --split-c-files.
+        This option must be specified if the argument C files were generated
+        by the Mercury compiler with --split-c-files.
 	--mercury-standard-library-directory <directory>
 	--mercury-stdlib-dir <directory>
-		The directory containing the installed Mercury standard
-		library.
+        The directory containing the installed Mercury standard library.
 	--no-mercury-standard-library-directory, --no-mercury-stdlib-dir
 		Don't use an installed Mercury standard library.
 
 $grade_usage
 		
 Description:
-	This runs gcc with the appropriate options for compiling Mercury
-	programs.
+    This runs gcc with the appropriate options for compiling Mercury programs.
 	Normally it invokes gcc in ANSI mode with almost all warnings enabled,
-	but this can be changed using the \`--no-ansi' or \`--no-check'
-	options.
+    but this can be changed using the \`--no-ansi' or \`--no-check' options.
 Environment variables:
 	MERCURY_DEFAULT_GRADE.
 Files:
-	If the current directory contains a file named .mgnuc_copts, then
-	mgnuc will assume that it contains C compiler options that should
-	be included on the C compiler's command line. This is usually used
-	to specify C compiler search paths.
+    If the current directory contains a file named .mgnuc_copts, then mgnuc
+    will assume that it contains C compiler options that should be included
+    on the C compiler's command line. This is usually used to specify C
+    compiler search paths.
 "
 
 while : ; do
@@ -152,75 +148,19 @@
 		exit 0
 		;;
 
-	-v|--verbose)
-		verbose=true
-		;;
-	-v-|--no-verbose)
-		verbose=false
-		;;
-
-	--assemble)
-		assemble=true
-		;;
-
-	--no-ansi)
-		ANSI_OPTS=
-		DEFINE_OPTS="$DEFINE_OPTS -D__EXTENSIONS__ -D_GNU_SOURCE"
-		;;
-
-	--no-check)
-		CHECK_OPTS=
-		;;
-
-	--split-c-files)
-		SPLIT_OPTS=-DMR_SPLIT_C_FILES ;;
-	--no-split-c-files)
-		SPLIT_OPTS= ;;
-
-	--inline-alloc)
-		INLINE_ALLOC_OPTS="-DMR_INLINE_ALLOC -DSILENT" ;;
-	--no-inline-alloc)
-		INLINE_ALLOC_OPTS="" ;;
-
-	-g|--c-debug)
-		c_debug=true ;;
-	-g-|--no-c-debug)
-		c_debug=false ;;
-
-	--c-optimize)
-		c_optimize=true ;;
-	--no-c-optimize)
-		c_optimize=false ;;
-
-	--low-level-debug)
-		low_level_debug=true ;;
-	--no-low-level-debug)
-		low_level_debug=false ;;
-
-	--use-activation-counts)
-		use_activation_counts=true ;;
-	--no-use-activation-counts)
-		use_activation_counts=false ;;
-
-	--preserve-tail-recursion)
-		preserve_tail_recursion=true ;;
-	--no-preserve-tail-recursion)
-		preserve_tail_recursion=false ;;
+ at MGNUC_FILE_OPTS@
 
 	--mercury-standard-library-directory|--mercury-stdlib-dir)
 		mercury_stdlib_dir="$2"
 		mercury_config_dir="$2"
 		shift
 		;;
-	--no-mercury-standard-library-directory|--no-mercury-stdlib-dir)
-		unset mercury_stdlib_dir
-		unset mercury_config_dir
-		;;
 
 	--mercury-config-directory|--mercury-config-dir)
 		mercury_config_dir="$2"
 		shift
 		;;
+
 	# We don't allow `MERCURY_CONFIG_DIR' to be unset
 	# without `MERCURY_STDLIB_DIR' also being unset.
 
@@ -231,6 +171,7 @@
 		shift
 		break
 		;;
+
 	*)
 		break
 		;;
@@ -238,6 +179,22 @@
     shift
 done
 
+if test -r .mgnuc_opts
+then
+    for opt in `cat .mgnuc_opts`
+    do
+        case "$opt" in
+
+ at MGNUC_FILE_OPTS@
+
+            *)
+                echo "unknown option $opt in .mgnuc_opts"
+                exit 1
+                ;;
+        esac
+    done
+fi
+
 # include the file `final_grade_options.sh-subr'
 @FINAL_GRADE_OPTIONS@
 
@@ -261,12 +218,10 @@
 # add /usr/local/include to the default search path, if needed
 ALL_LOCAL_C_INCL_DIRS=${MERCURY_ALL_LOCAL_C_INCL_DIRS=@ALL_LOCAL_C_INCL_DIRS@}
 
-#
-# convert non-grade mgnuc options into gcc options
+# Convert non-grade mgnuc options into gcc options.
 #
 # IMPORTANT: any changes here will require similar changes to
 # compiler/compile_target_code.m.
-#
 
 case $c_debug in
 	true)		C_DEBUG_OPTS="$DEBUG_OPT" ;;
@@ -323,11 +278,10 @@
 case $thread_safe in
 	true)		THREAD_OPTS="$CFLAGS_FOR_THREADS"
 			case $FULLARCH in *linux*) 
-				# Don't use -ansi under Linux or we get parse
-				# errors at sigset_t in the pthreads headers.
-				# This doesn't seem to be necessary for recent
-				# versions of Linux/glibc (e.g. glibc 2.1.2),
-				# but I've left it in so we can remain
+                    # Don't use -ansi under Linux or we get parse errors
+                    # at sigset_t in the pthreads headers. This doesn't seem
+                    # to be necessary for recent versions of Linux/glibc
+                    # (e.g. glibc 2.1.2), but I've left it in so we can remain
 				# compatible with older versions.
 				ANSI_OPTS=""
 			esac ;;
@@ -338,11 +292,10 @@
 use_msvcrt=@USE_MSVCRT@
 if test $use_msvcrt = "yes"; then
 	case $thread_safe in
-		# /MD states that we will use the MSVC runtime,
-		# the boehm_gc collector assumes that the collector
-		# has been built as a DLL if we are using the MSVC runtime
-		# so we need to define GC_NOT_DLL when the collector isn't
-		# built as a DLL.
+        # /MD states that we will use the MSVC runtime, the boehm_gc collector
+        # assumes that the collector has been built as a DLL if we are using
+        # the MSVC runtime so we need to define GC_NOT_DLL when the collector
+        # isn't built as a DLL.
 		true)	MSVCRT_OPTS="/MD" ;;
 		false)	MSVCRT_OPTS="/DGC_NOT_DLL /MD" ;;
 	esac
@@ -413,10 +366,8 @@
 	true,true)	progname=`basename $0`
 			echo "$progname: can't enable both forms of minimal model tabling at once"
 			exit 1 ;;
-	true,false)	MINIMAL_MODEL_OPTS="-DMR_USE_MINIMAL_MODEL_STACK_COPY"
-			;;
-	false,true)	MINIMAL_MODEL_OPTS="-DMR_USE_MINIMAL_MODEL_OWN_STACKS"
-			;;
+    true,false)     MINIMAL_MODEL_OPTS="-DMR_USE_MINIMAL_MODEL_STACK_COPY" ;;
+    false,true)     MINIMAL_MODEL_OPTS="-DMR_USE_MINIMAL_MODEL_OWN_STACKS" ;;
 	false,false)	MINIMAL_MODEL_OPTS="" ;;
 esac
 
@@ -482,23 +433,22 @@
 ARCH_OPTS=""
 case "$FULLARCH" in
 	mips-sgi-irix5.*)
-		# nonlocal gotos don't work with PIC, which is the
-		# default for Irix 5, so if nonlocal gotos are enabled
-		# we need to disable the use of shared libraries.
+        # Nonlocal gotos don't work with PIC, which is the default for Irix 5,
+        # so if nonlocal gotos are enabled we need to disable the use of
+        # shared libraries.
 		case $non_local_gotos in
 			true)
-LIBRARY_PATH="$NONSHARED_LIB_DIR:/usr/lib/nonshared:$LIBRARY_PATH"
+                LIBRARY_PATH="$NONSHARED_LIB_DIR:/usr/lib/nonshared:$LIBRARY_PATH"
 				export LIBRARY_PATH
 				AS_OPTS="-non_shared"
 			;;
 		esac
 		;;
 	i*86-*)
-		# the use of stack_pointer in the ASM_JUMP macro
-		# defined in runtime/goto.h causes lots of warnings
-		# about using possibly uninitialized variables;
-		# there's no easy way to supress them except by
-		# disabling the warning.
+        # The use of stack_pointer in the ASM_JUMP macro defined in
+        # runtime/goto.h causes lots of warnings about using possibly
+        # uninitialized variables; there's no easy way to supress them
+        # except by disabling the warning.
 		case "$COMPILER" in
 	    		gcc)
 				CHECK_OPTS="$CHECK_OPTS -Wno-uninitialized"
@@ -514,7 +464,6 @@
 		;;
 esac
 
-#
 # Kludge for gcc-2.6.3 bug on mips: if you use gcc global registers and -O2,
 # gcc 2.6.3 gets an internal error compiling library/int.c and
 # compiler/bytecode.c.  As a work-around, we compile those file with -O1.
@@ -524,7 +473,7 @@
 # Similarly for egcs-1.1 on sparc with library/lexer.c, library/string.c,
 # and compiler/{deforest,dupelim,mercury_to_mercury,modules}.c.
 # Similarly for egcs-1.1.2 on i386 with library/table_builtin.c.
-#
+
 case $COMPILER in gcc)
 	case "$FULLARCH" in
 		mips*)
@@ -578,26 +527,24 @@
 	esac ;;
 esac
 
-#
 # On sparc-sun-solaris2, we need to use -fPIC rather than -fpic if we're
 # using grade `none', because otherwise the Mercury standard library
 # overflows the fixed limit on the number of "small pic" references.
-#
+
 case "$FULLARCH" in sparc-sun-solaris2*)
 	case "$grade" in none)
 		case "$*" in *-fpic*)
 			echo "mgnuc: using -fPIC rather than -fpic"
-			OVERRIDE_OPTS="$OVERRIDE_OPTS -fPIC" ;;
+            OVERRIDE_OPTS="$OVERRIDE_OPTS -fPIC"
+            ;;
 		esac ;;
 	esac ;;
 esac
 
-#
-# The -floop-optimize option is incompatible
-# with the global register code we generated on Darwin PowerPC.
-# See the hard_coded/ppc_bug test case for an example
-# program which fails with this optimization.
-#
+# The -floop-optimize option is incompatible with the global register code
+# we generated on Darwin PowerPC. See the hard_coded/ppc_bug test case
+# for an example program which fails with this optimization.
+
 case $FULLARCH in powerpc*apple*darwin*) 
 	case $highlevel_code in false)
 		case $global_regs in true) 
Index: scripts/mgnuc_file_opts.sh-subr
===================================================================
RCS file: scripts/mgnuc_file_opts.sh-subr
diff -N scripts/mgnuc_file_opts.sh-subr
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ scripts/mgnuc_file_opts.sh-subr	18 Sep 2005 06:06:23 -0000
@@ -0,0 +1,78 @@
+#---------------------------------------------------------------------------#
+# Copyright (C) 2005 The University of Melbourne.
+# This file may only be copied under the terms of the GNU General
+# Public License - see the file COPYING in the Mercury distribution.
+#---------------------------------------------------------------------------#
+#
+# mgnuc_file_opts.sh-subr:
+#
+# An `sh' subroutine for processing the mgnuc options that can be set from
+# .mgnuc_opts files. It is included twice in mgnuc. Its implementation is
+# bound tightly to the code of mgnuc.in; all the variables it manipulates
+# come from there.
+#
+# At the moment, this includes only options that do not have arguments.
+# This is because processing options with arguments is hard to do without
+# overriding the argument vector, and there is no simple way to preserve
+# the exact structure of the original argument vector *including* any spaces
+# inside individual arguments. There is no real need (at least right now)
+# for putting such options into .mgnuc_opts files.
+#
+#---------------------------------------------------------------------------#
+
+        -v|--verbose)
+            verbose=true
+            ;;
+        -v-|--no-verbose)
+            verbose=false ;;
+
+        --assemble)
+            assemble=true ;;
+
+        --no-ansi)
+            ANSI_OPTS=
+            DEFINE_OPTS="$DEFINE_OPTS -D__EXTENSIONS__ -D_GNU_SOURCE"
+            ;;
+
+        --no-check)
+            CHECK_OPTS= ;;
+
+        --split-c-files)
+            SPLIT_OPTS=-DMR_SPLIT_C_FILES ;;
+        --no-split-c-files)
+            SPLIT_OPTS= ;;
+
+        --inline-alloc)
+            INLINE_ALLOC_OPTS="-DMR_INLINE_ALLOC -DSILENT" ;;
+        --no-inline-alloc)
+            INLINE_ALLOC_OPTS="" ;;
+
+        -g|--c-debug)
+            c_debug=true ;;
+        -g-|--no-c-debug)
+            c_debug=false ;;
+
+        --c-optimize)
+            c_optimize=true ;;
+        --no-c-optimize)
+            c_optimize=false ;;
+
+        --low-level-debug)
+            low_level_debug=true ;;
+        --no-low-level-debug)
+            low_level_debug=false ;;
+
+        --use-activation-counts)
+            use_activation_counts=true ;;
+        --no-use-activation-counts)
+            use_activation_counts=false ;;
+
+        --preserve-tail-recursion)
+            preserve_tail_recursion=true ;;
+        --no-preserve-tail-recursion)
+            preserve_tail_recursion=false ;;
+
+        --no-mercury-standard-library-directory|--no-mercury-stdlib-dir)
+            unset mercury_stdlib_dir
+            unset mercury_config_dir
+            ;;
cvs diff: Diffing slice
Index: slice/.mgnuc_opts
===================================================================
RCS file: slice/.mgnuc_opts
diff -N slice/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ slice/.mgnuc_opts	18 Sep 2005 06:08:02 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
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/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/.mgnuc_opts
===================================================================
RCS file: trace/.mgnuc_opts
diff -N trace/.mgnuc_opts
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ trace/.mgnuc_opts	18 Sep 2005 06:15:34 -0000
@@ -0,0 +1 @@
+--no-mercury-stdlib-dir
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:  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