Files
mercury/scripts/c2init.in
Simon Taylor 5c9f6f5841 Combine the options for ml and c2init. Once mmake has been
Estimated hours taken: 1
Branches: main

Combine the options for ml and c2init. Once mmake has been
altered to pass MLFLAGS to c2init users will be able to
mostly ignore the existence of c2init.

This change requires an installed compiler which uses `--init-c-file'
rather than `-o' to name c2init's output file. This is difficult to
test for in configure.in.

Bootstrap CVS tag: bootstrap_20011203_init_c_file_c2init_option

scripts/parse_ml_options.sh-subr.in:
	Parse the combined options for ml and c2init.

	The `-o' and `--output' options for c2init have been removed
	(`-o' conflicts with a linker option), use `--init-c-file' instead.

configure.in:
	Add parse_ml_options.sh-subr.in to the list of files to substitute.

scripts/ml.in:
scripts/c2init.in:
	Include parse_ml_options.sh-subr.

scripts/Mmakefile:
	ml and c2init depend on parse_ml_options.sh-subr.
2001-12-03 03:11:26 +00:00

78 lines
2.1 KiB
Bash
Executable File

#! /bin/sh
# @configure_input@
#---------------------------------------------------------------------------#
# Copyright (C) 1995-2001 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.
#---------------------------------------------------------------------------#
# C2INIT - Convert *.c to *_init.c
#
# This script outputs an appropriate init.c, given the .c files.
# Type `c2init --help' for usage message.
#
Usage="\
Name: c2init - Create Mercury initialization file.
Usage: c2init [options] *.c *.init ..."
FULLARCH=@FULLARCH@
DEFAULT_GRADE=${MERCURY_DEFAULT_GRADE=@DEFAULT_GRADE@}
# include the file `parse_ml_options.sh-subr'
@PARSE_ML_OPTIONS@
# If you change these, you will also need to change Mmake.common.in,
# scripts/ml.in, tools/bootcheck, tools/binary, tools/binary_step and
# tools/linear.
RT_LIB_NAME=mer_rt
STD_LIB_NAME=mer_std
TRACE_LIB_NAME=mer_trace
BROWSER_LIB_NAME=mer_browser
MERCURY_MOD_LIB_DIR=${MERCURY_MOD_LIB_DIR=@LIBDIR@/modules}
MERCURY_TRACE_LIB_DIR=${MERCURY_TRACE_LIB_DIR=@LIBDIR@/modules}
MKINIT=${MERCURY_MKINIT=mkinit}
case $require_tracing in
true)
trace_opt="-t" ;;
esac
case $stack_trace in
true)
init_opt="-i" ;;
esac
MERCURY_MOD_LIB_MODS=${MERCURY_MOD_LIB_MODS="\
$MERCURY_MOD_LIB_DIR/$RT_LIB_NAME.init \
$MERCURY_MOD_LIB_DIR/$STD_LIB_NAME.init"}
MERCURY_TRACE_LIB_MODS=${MERCURY_TRACE_LIB_MODS="\
$MERCURY_TRACE_LIB_DIR/$BROWSER_LIB_NAME.init"}
case "$trace_opt" in
-t)
init_opt="-i"
MERCURY_ALL_LIB_MODS="$MERCURY_MOD_LIB_MODS\
$MERCURY_TRACE_LIB_MODS"
;;
*)
MERCURY_ALL_LIB_MODS="$MERCURY_MOD_LIB_MODS"
;;
esac
case $# in
0) exec $MKINIT $aditi_opt -c"$maxcalls" $init_opt $trace_opt \
$library_opt $defentry_opt $extra_inits_opt \
-o "$init_c_file" \
$extra_init_dirs $EXTRA_INIT_FILES $MERCURY_ALL_LIB_MODS
;;
*) exec $MKINIT $aditi_opt -c"$maxcalls" $init_opt $trace_opt \
$library_opt $defentry_opt $extra_inits_opt \
-o "$init_c_file" \
$extra_init_dirs "$@" $EXTRA_INIT_FILES $MERCURY_ALL_LIB_MODS
;;
esac