diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7facc9fc39984517b5bf41767686c666d67d2311..9b6bdb692f8b52fedb5e2e30cee1323585455703 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3836,7 +3836,9 @@ installdirs: $(mkinstalldirs) $(DESTDIR)$(includedir) $(mkinstalldirs) $(DESTDIR)$(infodir) $(mkinstalldirs) $(DESTDIR)$(man1dir) + $(mkinstalldirs) $(DESTDIR)$(man3dir) $(mkinstalldirs) $(DESTDIR)$(man7dir) + $(mkinstalldirs) $(DESTDIR)$(udfdir) PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ toplev.h $(DIAGNOSTIC_CORE_H) $(BASIC_BLOCK_H) $(HASH_TABLE_H) \ diff --git a/gcc/cobol/Make-lang.in b/gcc/cobol/Make-lang.in index df91a887972c002dc5e1a49c567afa4f9edb4c87..dd015abf735382c52f9a801e72038e03fba661af 100644 --- a/gcc/cobol/Make-lang.in +++ b/gcc/cobol/Make-lang.in @@ -177,7 +177,7 @@ cobol.install-common: installdirs $(INSTALL_PROGRAM) -v gcobol$(exeext) \ $(DESTDIR)$(bindir)/$(gcobol_INSTALL_NAME)$(exeext) $(INSTALL_PROGRAM) -v $(srcdir)/cobol/gcobc $(DESTDIR)$(bindir)/ - $(INSTALL_DATA) -v $(srcdir)/udf/stored-char-length.cbl $(udfdir)/ + $(INSTALL_DATA) -v $(srcdir)/cobol/udf/* $(udfdir)/ cobol.install-man: installdirs $(INSTALL_DATA) -v $(srcdir)/cobol/gcobol.1 $(DESTDIR)$(man1dir)/ diff --git a/gcc/cobol/gcobc b/gcc/cobol/gcobc index 3ce743eb1ae0ef346fc5593f91848ed9a3d8dea6..bc2ecfb74e4707e149a5fd637df9b412b41a5e53 100755 --- a/gcc/cobol/gcobc +++ b/gcc/cobol/gcobc @@ -11,17 +11,30 @@ # recognized by the script are passed verbatim to gcobol, which will # reject them unless of course they are gcobol options. # -# Maintainer note. In modifying this file, the following may make -# your life easier: +# User-defined variables, and their defaults: # -# - To force the script to exit, either set exit_status to 1, or call -# the error function. -# - As handled options are added, add them to the HELP here-doc. -# - The compiler can produce only one kind of output. In this -# script, that's known by $mode. Options that affect the type of -# output set the mode variable. Everything else is appended to the -# opts variable. +# Varible Default Effect +# echo none If defined, echo the gcobol command +# gcobcx none Produce verbose messages +# gcobol ./gcobol Name of the gcobol binary +# GCOBCUDF PREFIX/share/cobol/udf/ Location of UDFs to be prepended to input # +# By default, this script includes all files in $GCOBCUDF. To defeat +# that behavior, use GCOBCUDF=none. +# +# A list of supported options is produced with "gcobc -HELP". +# +## Maintainer note. In modifying this file, the following may make +## your life easier: +## +## - To force the script to exit, either set exit_status to 1, or call +## the error function. +## - As handled options are added, add them to the HELP here-doc. +## - The compiler can produce only one kind of output. In this +## script, that's known by $mode. Options that affect the type of +## output set the mode variable. Everything else is appended to the +## opts variable. +## if [ "$COBCPY" ] then @@ -33,9 +46,28 @@ then copydir="-I$COB_COPY_DIR" fi +udf_default="${0%/*}/../share/cobol/udf" +udfdir="${GCOBCUDF:-$udf_default}" + +if [ -d "$udfdir" ] +then + for F in "$udfdir"/* + do + if [ -f $F ] + then + includes="$includes -include $F " + fi + done +else + if [ "$GCOBCUDF" -a "$GCOBCUDF" != "none" ] + then + echo warning: no such directory: "'$GCOBCUDF'" + fi +fi + exit_status=0 skip_arg= -opts="$copydir ${dialect:--dialect mf}" +opts="$copydir ${dialect:--dialect mf} $includes" mode=-shared incomparable="has no comparable gcobol option"