home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-07-27 | 68.4 KB | 1,830 lines |
- #########################################################################
- # High C / Professional Pascal / Lahey Fortran configuration file.
- # Copyright (C) 1989-1992 MetaWare Incorporated. All rights reserved.
- #########################################################################
- # You may modify this file upon compiler installation.
- # Things you must do:
- # Change HCDIR to the directory in which you installed High C compiler,
- # or define HCDIR in the environment.
- # Change PPDIR to the directory in which you installed Pascal compiler,
- # or define PPDIR in the environment.
- # Change LFDIR to the directory in which you installed Lahey Fortran
- # compiler, or define LFDIR in the environment.
- #########################################################################
- # Here, define them if you wish; take out the leading # that comments
- # out the line:
- #HCDIR=/where/you/loadedHC
- #PPDIR=/where/you/loadedPP
- #LFDIR=/where/you/loadedLF
- #TOOLSDIR=/where/your/tools/are
- #########################################################################
- # Enable C++ compilation.
- # Uncomment the following line if you wish to enable C++ compilation.
- # This option requires additional software supplied only with C++ compilers,
- # so do not enable C++ unless you have licensed the C++ compiler.
- #########################################################################
- #CPP_OK=true
- #########################################################################
- # Enable -Hloc C++ compilation.
- # Enable -Hloclib C++ Compilation -- stream library won't work here.
- # CAUTION: These features will not be supported in the future.
- #########################################################################
- #GLOC_CPP=true
- #LOCLIB_CPP=true
- # Allow user to specify C++ in environment
- ?%eCPP_OK ?!$CPP_OK CPP_OK=%e$CPP_OK
- #########################################################################
- # Append default specifications to ARGS
- #########################################################################
- # Supply any default parameters that are prepended to the actual command
- # line here.
- #
- # You could supply -c for those compilers that can't link on the host.
- # You could supply -S for those compilers that can't assemble on the host.
- #########################################################################
- ARGS=
- #########################################################################
- # Things you might do:
- # Change TOOLSDIR to the directory where the assembler, linker, and UNIX
- # cpp reside.
- # Change the AS, LINKER, or CPP definition below to specify individually
- # where the assembler, linker, or UNIX cpp reside.
- # Change the LINKER definition below to indicate different libraries or
- # other parameters for the link.
- # Change the HCINC or PPINC variables to indicate different directories
- # containing include files.
- # For DOS/OS2/VMS, add a definition for TMPPREFIX which the driver will
- # prepend before any argument temp file constructed when the command
- # line exceeds 128 characters. Or, supply such definition in
- # the environment.
- # Changes beyond this scope require reading the "configuration language"
- # section of the Installation Guide.
- #########################################################################
-
- #########################################################################
- # Determine default directories to be referenced to access various
- # components required by compilation.
- #########################################################################
- # If XXDIR exists in the environment, choose environment version instead.
- #########################################################################
- ?%eHCDIR ?!$HCDIR HCDIR=%e$HCDIR
- ?%ePPDIR ?!$PPDIR PPDIR=%e$PPDIR
- ?%eMFDIR ?!$MFDIR MFDIR=%e$MFDIR
- ?%eLFDIR ?!$LFDIR LFDIR=%e$LFDIR
- ?%eTOOLSDIR ?!$TOOLSDIR TOOLSDIR=%e$TOOLSDIR
- ?%eOS2LIB ?!$OS2LIB OS2LIB=%e$OS2LIB
- ?!$TMPPREFIX ?%eTMPPREFIX TMPPREFIX=%e$TMPPREFIX %; \
- # This will access a value in the environment if present.
-
- ?!$HCDIR HCDIR=/you/must/specify/HCDIR
- ?!$PPDIR PPDIR=/you/must/specify/PPDIR
- ASSUME_LF=1 %; # Assume LF if neither MFDIR/LFDIR set.
- #ASSUME_MF=1 %; # Assume MF if neither MFDIR/LFDIR set.
- ?!$LFDIR ?$ASSUME_LF LFDIR=/you/must/specify/LFDIR
- ?!$MFDIR ?$ASSUME_MF MFDIR=/you/must/specify/MFDIR
- # Now we assume one of MFDIR/LFDIR are set.
- ?!$TOOLSDIR TOOLSDIR=
- DEFS= %; MDEFS= %; # MDEFS = mandatory; Hansi will not remove them.
-
- #########################################################################
- # This is the subdirectory under $HCDIR where the driver will look for
- # executables. If you want them somewhere else, change this variable.
- #########################################################################
- bin=bin
-
- #########################################################################
- # Define the target machine
- #########################################################################
- # Compiler definition target and technology.
- # Only one line should be appropriate.
- #########################################################################
- #OS=MSDOS %; CPU=I386 %; MACH=386 %; TARG=d386 %; MODELS=1 %; HC1x=1 %; PP2x=1 %; LOC=1
- OS=MSDOS %; CPU=I386 %; MACH=386 %; TARG=d386 %; MODELS=1
- # Be sure to set LFLAG for target 29k as MRI or IPT to specify the assembler
- # and the linker to be used.
- # Also make sure that NATIVERUN is set to either "ebmon" or "runpceb".
- # MODELS = Does it support -Mx switch?
-
- __CNF_VERSION=5
-
- #########################################################################
- # HOST definition. Uncomment one and only one.
- #########################################################################
-
- ?!$HOST #exit HOST not specified in driver config file!
- ?!$TARG #exit TARG not specified in driver config file!
-
- # TARGET_IS_MSDOS is true for OS2, CDOS, and MSDOS -- things are similar.
- TARGET_IS_MSDOS=1
- ?|^ ?=# $HOST # dx86 # ^ ?=# $HOST # d386 # ^ \
- ?=# $HOST # o286 # ^ ?=# $HOST # o386 # ^ \
- ?=# $HOST # f286 # ^| HOST_IS_MSDOS=1
-
- slash=/ %; ?$HOST_IS_MSDOS slash=\ %;
- bin=$slash$bin %; # Prepend appropriate dir seperator to "bin" designator
-
- ?=^ $DRVPATH ^^ DRVPATH=./ %; # In case pgm name has no directory, supply .
- ?=^ $DRVPARENT ^^ DRVPARENT=. %; \
- # In case pgm name has no directory, supply .
-
- #########################################################################
- # Front-end stuff to which processor-specific code may append options.
- #########################################################################
- festuff= %; # Stuff that pertains to all front-ends
- festuff_LOC= %; # Stuff that pertains to HC1.x and PP2.x front-ends
- festuff_GOC= %; # Stuff that pertains to HC2/3.x and PP3.x front-ends
- MFstuff= %; # Stuff that pertains to MF x.x front-end
- PPstuff= %; # Stuff that pertains to PP front ends only
- HCstuff= %; # Stuff that pertains to HC front ends only
- bestuff= %; # Stuff that pertains to HC2/3.x and PP 3.x back-ends
- CPPOPTS= %; # Options to be passed to outboard C preprocessor
- CPPDEFS= %; # -Dxxx=1 to be passed to outboard C preprocessor
-
- #########################################################################
- # Define procedures for predefining preprocessor symbols
- #########################################################################
- #proc predef name fval
- # These names are legal even in ANSI mode:
- val = $fval %; ?=^$?fval^^ val=1
- festuff += -def "$name $val"
- CPPOPTS += -D$name$)=$val
- #endp
- #proc predef_non_ansi name fval
- # These names are not legal if in ANSI mode:
- val = $fval %; ?=^$?fval^^ val=1
- ?!-Hansi DEFS += -def "$name $val" %; CPPDEFS += -D$name$)=$val
- #endp
- #proc no_ansi_defs
- DEFS = %; CPPDEFS =
- #endp
-
- ##########################################################################
- # Figure out what kind of driver I am.
- ##########################################################################
- # What kind of driver am I? C? Pascal? Fortran? Depends upon my base name.
- dn = $~tolower~DRVNAME
- # If any of these strings are in the executable's name, it tells us what
- # kind of driver we are.
- ?!=^ $~str:hc~dn ^ ^ CDRV=1
- ?!=^ $~str:cc~dn ^ ^ CDRV=1
- ?!=^ $~str:pp~dn ^ ^ PDRV=1
- ?!=^ $~str:lf~dn ^ ^ FDRV=1
- ?!=^ $~str:ff~dn ^ ^ FDRV=1
- ?!=^ $~str:mf~dn ^ ^ FDRV=1
- ?!=^ $~str:xref~dn ^ ^ XDRV=1 %; # I can be xref at the same time.
- ?!|^ ?$CDRV ^ ?$PDRV ^ ?$FDRV ^| #print I do not know what kind of \
- driver I am: C, Pascal, or Fortran. %; \
- #exit The name of the driver must be such that I can figure this out.
- ?$CDRV ?$PDRV #exit I can't be both a C and Pascal driver.
- ?$CDRV ?$FDRV #exit I can't be both a C and Fortran driver.
- ?$PDRV ?$FDRV #exit I can't be both a Pascal and Fortran driver.
-
-
- ######################################################################
- # For DOS or DOS 386, include DOS variables file after this comment
- ######################################################################
- ARGS2=$ARGS %; ARGS=
- # The set files will reset ARGS.
- ?!$XDRV #include $DRVNAME$)set.cnf
- ?$XDRV HCDIR=$DRVPARENT
- ARGS=$ARGS2 $ARGS
-
-
- #########################################################################
- # There must be no more settings of ARGS after this:
- ARGV=$ARGS %; # Specify arguments to driver.
-
- #########################################################################
- # Define source file suffixes recognized by the driver.
- #########################################################################
- # Place CPP as the first element of these lists to say for which languages
- # CPP is supported. Currently, just for C. Do not confuse CPP as "C++".
- PEXT=.p .pas %; # Pascal
- FEXT=CPP .f .for .qc .ftn %; # Fortran
- AEXT=.s .asm %; # Assembly
- CEXT=CPP .c .i %; # C
- CPPEXT=CPP .cc .cpp %; # C++
-
-
- # Allow user-specification of C++ extensions on command line.
- -Hcppext=? %; # E.g., -Hcppext=c,cpp,foo
- #if ?$-Hcppext=?
- CPPEXT=CPP
- #foreach^ $~sep,~?-Hcppext=? ^ arg CPPEXT+= .$arg
- # Now Rewrite CEXT, excluding those things in CPPEXT.
- NEWCEXT=CPP
- #proc addit x
- #foreach^ $CPPEXT ^ argcpp ?=^ $arg ^ $argcpp ^ #return
- NEWCEXT += $x
- #endp
- #foreach^ $CEXT ^ arg #call addit $arg
- CEXT=$NEWCEXT
- #endif
-
- #########################################################################
- # Procedure for handling mutually exclusive arguments
- #########################################################################
-
- #proc lastopt optlist
- # Find the last opt specified in the optlist.
- optmax=- %; # Default: junk.
- #foreach^ $*optlist ^X ?$*X ?>^ $?#*X ^ $?#*optmax ^ optmax=$X
- #endp
- #proc mutex optlist default
- #call lastopt $optlist
- # If there exists a maximum option among them, kill the others off:
- #if ?!=^ $optmax ^ - ^
- #foreach^ $*optlist ^X ?!=^ $X ^ $optmax ^ #killopt $X
- #else
- # None of the options were set at all, so set the default one.
- ?!=^ $default ^^ #setopt $default
- #endif
- #endp
-
- # CLCC=1
- #if ?$CLCC
- -dryrun ?-dryrun __BATCH=1 %; __NOBATCHTMP=1
- -cpp=? ?-cpp=? CPPEXE=$-cpp=?
- # -traditional by default.
- CLOPTLIST=-ansi -Xa -Xt -traditional %; # -Xc omitted; invalid for CLCC.
- #call mutex CLOPTLIST -traditional
- # -list ?-list list=-on list %; -lines=? ?-lines=? list+=-lines $-lines=?
- -proto ?-proto festuff_GOC = -on print_protos
- -ansi ?-ansi #setopt -Hansi -Hansilib
- -traditional
- ?-traditional #setopt -Hcpp -Hpcc -Hnoansilib -fdouble %; \
- festuff+= -on use_up_rules double_return %; ?!-w #setopt -w2 %; \
- # Set -w2 if -w wasn't given.
- -target. -V # Consume these two.
- bestuff += -off optimize_divmod %; # .udivmod not in sun's library.
- ?-g festuff_GOC += -on g_include_info
- -M ?-M #setopt -Hmake
- -MM ?-MM #setopt -Hmake -Hrel
- -anno ?-anno #setopt -Hanno
- x_stuff_needed=1
- #call predef __CLCC__ 1
- #call predef __unix__ 1
- #call predef __$~tolower~CPU$)__
- #call predef __$~tolower~OS$)__
- #setopt -Hunixerr
- #endif
-
- #########################################################################
- # Other default arguments.
- #########################################################################
-
- ?!$LOC #call predef _GOC
- ?$LOC #call predef _LOC
- # CPU/OS defines.
- # If 386, wait to define CPU later. It may actually be a 286
- #call predef _$OS
- # For most CPUs, add lower-case version of CPU:
-
- #call predef_non_ansi $~tolower~CPU
-
- #foreach^ $?PREDEFS ^X #call predef_non_ansi $X 1
-
- # Define "ATT_UNIX" variable if AT&T System V.3 or V.4
-
- # -v means something different for AT&T V.4 and possibly for V.3.
-
- -v ?-v __VERBOSE=1
-
-
- #########################################################################
- # Error message header format. Match UNIX or Microsoft C.
- #########################################################################
- # Format string: %f = file %l = line %c = column %q = " %m = , %t = tab
- -Hunixerr -Hmscerr -Hturboerr -Hefmat=? -Hwfmat=?
- ?-Hunixerr EF=-efmat "%q%f%q%m line %l: " -wfmat "%q%f%q%m line %l: warning: "
- ?-Hmscerr EF=-efmat "%f(%l) : error %n: " -wfmat "%f(%l) : warning %n: "
- ?-Hturboerr EF=-efmat "Error %f %l: " -wfmat "Warning %f %l: "
- ?$EF festuff+=$EF
- ?$EF bestuff+=$EF
- # Perhaps he specified his own arbitrary format. Send to front and back end.
- ?$-Hefmat=? festuff += -efmat $-Hefmat=? %; bestuff += -efmat $-Hefmat=?
- ?$-Hwfmat=? festuff += -wfmat $-Hwfmat=? %; bestuff += -wfmat $-Hwfmat=?
-
- #########################################################################
- # DOS help facility.
- #########################################################################
- #if ?$HOST_IS_MSDOS
- # Use our supplied fgrep program to produce on-line help.
- -h? # Help toggle.
- # If help wanted, just find it and quit processing.
- ?-h? #exec $DRVPARENT/bin/fgrep -q( $-h? $DRVPARENT/bin/hc386.hlp %; \
- #exit1 %; # Quit; no compilations.
- #endif
-
- #########################################################################
- # Determine where errors are sent (efile).
- # For DOS and VMS, they are sent to standard output
- # Otherwise, they are sent to standard error
- # Determine suffix for executable of compiler:
- # For DOS and VMS, it is ".exe"
- # Others do not have a suffix.
- #########################################################################
-
- # TAH=target at host; TAT=target at target (for native compilers).
- #if ?|^ ?$HOST_IS_MSDOS ^ ?=# $HOST # mvax # ^|
- # Errors to stdout; files end in .exe.
- efile=@ %; exe=.exe
- ?=^ $HOST ^ f286 ^ exe=.286
- -HV?
- ?-HV? com=$-HV? %; exever=$com
- TAH = $TARG %; AH = $TARG %; TAT = $TARG %; AT = $TARG
- ?=# $HOST # mvax # TAH= %; AH= %; TAT= %; AT =
- # ?!=# $HOST # mvax # TAH= %; AH= %; TAT= %; AT =
- #else
- com=com %; efile=@E %; exe=
- TAH=$TARG@$HOST %; AH=@$HOST %; TAT=$TARG@$TARG %; AT = @$TARG
- #endif
- # TAH=Composite name of a com file: target@host.
- EXESUFFIX=$exe %; # Inform driver.
-
- # Determine suffix for object file: .obj for DOS and VMS; .o otherwise
- OBJSUFFIX=.o
- # MSDOS/VMS targets use .obj files.
- OBJSUFFIX=.obj
- # If exactly one source file being processed and -c/-S specified, allow -o
- # to specify the output. SINGLEOBJFILE is ignored unless source count = 1.
- ?|^ ?-c ^ ?-S ^| ?-o? SINGLEOBJFILE=$-o?
-
- #proc Ensure_directory thing
- # Make sure *thing, if defined, ends in \ or /.
- ?$*thing ?!=^ $~tail:1~*thing ^ / ^ ?!=^ $~tail:1~*thing ^ \ ^ \
- *thing = $*thing$)
- #endp
- # If object prefix specified, make sure it's a directory.
- ?$HOST_IS_MSDOS #call Ensure_directory OBJPREFIX
-
- # For xreffing GOC output, there is no .xrf suffix on xrf files.
- XIEXT=$?:^ ?!$LOC ^ -iext " " ^^
- # LOC compilers expect a .(c/p) as suffix for input. Tell them not to.
- IEXT=$?:^ ?$LOC ^ -iext " " ^^
- # LOC compilers don't expect arguments in batch files to be quoted:
- ?$LOC __NOQ=x %; # Tell driver.
-
- #proc old_driver
- #exit Need driver V$1.$2$?3 or later. You have version $__major.$__minor.
- #endp
-
- # If TOOLSEARCH is set we will search paths for assembler and linker (UNIX \
- only)
- # if the file doesn't exist as specified.
- #proc pathsearch var path shortname
- # If we shouldn't be searching, or the full name exists,
- # just use the full name.
- fullname=$path$slash$shortname
- # Don't return the name with ".exe" appended if required to find it.
- # In this way -native works properly for the tools on a .exe-host \
- machine.
- fullname2=$fullname
- ?!=^ $?exe ^ ^ fullname2=$fullname$exe
- ?|^ ?!$TOOLSEARCH ^ ?%i$fullname2 ^| *var = $fullname $*var %; #return
- ?<^ $__minor ^ 6 ^ #print $fullname not found and path search \
- unavailable: %; #call old_driver 1 0 6
- # Otherwise set to short name and prefix with search character :.
- *var=:$shortname $*var
- #endp
-
- #########################################################################
- # Customized location of compiler executables and library
- #########################################################################
- # If you want to change where HC1COM/HC2COM lives, set these lines.
- # HC1COM=yourhc1com
- # HC2COM=yourhc2com
- # INLCOM=your inliner
- # If you want to change where libraries live, set these lines:
- # CLIB=yourCLIB
- # PLIB=yourPLIB
- # MWLIB=yourMWLIB
- # If you want to change where include directory lives, set these lines.
- # PPINC=-Iwhatever -Iandthensome
- # HCINC=-Iwhatever -Iandthensome
- # Change location of usr/include by changing USRINC.
- #########################################################################
- ?!$USRINC USRINC=/usr/include
-
- # -D %; # Uncomment this line for truly copious debugging information.
-
- #######################################################################
- # May be invoking driver on output of preprocessed text (e.g., cfront, yacc)
- # If so, alter the name of the source file for sake of debugger and annotator
- #########################################################################
- -Hsrc=?
- ?-Hsrc=? __SOURCE=$?-Hsrc=?
-
-
-
- ############################################################################
- # If Pascal range-checking is to be ON, by default, comment out the \
- following
- ############################################################################
- PPstuff+=-off CHECK_RANGE CHECK_SUBSCRIPT
-
- ############################################################################
- # CPP/NOCPP options.
- ############################################################################
- -Hcpp -Hnocpp ?>^$?#-Hnocpp^$?#-Hcpp^ #killopt -Hcpp
-
- ############################################################################
- # Suppress object module?
- ############################################################################
- -Hnoobj? -noobj?
- ?|^?-Hnoobj^?-noobj^| __NOOBJECT=1 %; festuff_LOC += -noobj
-
- ############################################################################
- # Define profiling flags: -pg -p
- ############################################################################
- -p -pg ?|^?-p^?-pg^| festuff_LOC += -p %; ?!$HOST_IS_MSDOS bestuff += -p
- ?$HOST_IS_MSDOS ?-p festuff_GOC += -p
-
- ############################################################################
- # Define floating point flags: -f -fsingle -fsingle
- ############################################################################
- -f -fsingle -fdouble -fsingle2
- ?>^$?#-fsingle^$?#-fdouble^ festuff += -off DOUBLE_MATH_ONLY %; fsingle=1
- ?>^$?#-f^$?#-fdouble^ festuff += -off DOUBLE_MATH_ONLY %; fsingle=1
- ?-fdouble ?>^$?#-fdouble^$?#-fsingle^ festuff += -on DOUBLE_MATH_ONLY
- ?-fsingle2 HCstuff += -off WIDEN_FLOAT_ARGS
-
- ############################################################################
- # PCC option. If given, look like pcc as much as possible.
- ############################################################################
- -Hpcc
- # ?!-Hpcc ?!$HC1x HCstuff+= -def "__STDC__ 1"
- #if ?-Hpcc
- ?$LOC festuff_LOC+=-on long_enums -on pcc
- ?!$LOC HCstuff+= -on long_enums -on pcc -pcc
- #endif
-
-
- ############################################################################
- # ANSI processing: define parse/scan tables and switches.
- ############################################################################
- -Hansi
- #proc do_ansi
- ?-Hkanji #exit Can't specify both -Hansi and -Hkanji
- ?!$HCANSI_PT HCANSI_PT=$HCDIR$bin/hcansi.pt
- ?!$HCANSI_ST HCANSI_ST=$HCDIR$bin/hcansi.st
- ?!$HCANSI_SPT HCANSI_SPT=$HCDIR$bin/hcansip.pt
- ?!$PPANSI_PT PPANSI_PT=$PPDIR$bin/ppansi.pt
- ?!$PPANSI_ST PPANSI_ST=$PPDIR$bin/ppansi.st
- CANSI=-pt $HCANSI_PT -spt $HCANSI_SPT -st $HCANSI_ST -ansi -on trigraphs
- PANSI=-pt $PPANSI_PT -st $PPANSI_ST -ansi
- #call no_ansi_defs %; # This may break lots of code, but ansi means ansi.
- #endp
- #if ?-Hansi
- #call do_ansi
- #endif
-
- ############################################################################
- # VS Pascal compatibility
- ############################################################################
- -Hvs -vs
- #if ?|^ ?-Hvs ^ ?-vs ^|
- ?!$VS_PT VS_PT =$PPDIR/bin/vs.pt
- ?!$VS_ST VS_ST =$PPDIR/bin/vs.st
- ?!$VS_SPT VS_SPT=$PPDIR/bin/vspre.pt
- VS=-pt $VS_PT -st $VS_ST -spt $VS_SPT -vs
- PPstuff+=$VS
- ?-Hansi #print Cannot specify both -Hansi and -Hvs.
- #endif
-
- ############################################################################
- # Microsoft Pascal compatibility
- ############################################################################
- #if ?$PDRV # Avoid introducing non-H option -ms unless Pascal driver.
- -Hms -ms
- #if ?|^ ?-Hms ^ ?-ms ^|
- PPstuff += -mset -on pad_aggregates pad_byte_arrays align_variants align_2
- bestuff += -mset
- #endif
- #endif
-
- #########################################################################
- # Define __HIGHC__ if -Hansi and -Hpcc not specified
- #########################################################################
- ?!-Hansi ?!-Hpcc CPPHC=-D__HIGHC__=1
- -Hloclib
- -Hloc
- -Hcpp_ok
- # There are various reasons we can't have C++; consider them all here only:
- ?-Hloc ?!$GLOC_CPP FORCE_NOCPP=1
- ?-Hloclib ?!$LOCLIB_CPP FORCE_NOCPP=1
-
- # DO_CPP means do c++: CPP_OK is 1 and FORCE_NOCPP hasn't been set.
- # Don't change FORCE_NOCPP after this point; it won't have effect.
- ?$CPP_OK ?!$FORCE_NOCPP DO_CPP=1
-
- ?-Hcpp_ok ?!$DO_CPP -Hcpp_ok CPP_OK=1
- ?-Hloc ?$DO_CPP festuff_GOC+=-def "__GLOC__ 1"
- #proc c_wrap
- # Wrap C files for C++.
- ?$DO_CPP festuff_GOC+=-c_wrap ^$USRINC
- #endp
-
-
- #########################################################################
- # Handle -Hunixlib and -Hmwlib
- # IF user specified -Hunixlib then
- # 1) Reference UNIX header files only,
- # 2) Don't link in MetaWare ANSI library
- #########################################################################
- -Hunixlib -Hmwlib
- # There are synonyms that made sense in the past when UNIX had no ansi lib:
- -ansilib -noansilib -Hansilib -Hnoansilib
- ?-Hnoansilib #setopt -Hunixlib
- ?-noansilib #setopt -Hunixlib
- ?-Hansilib #setopt -Hmwlib
- ?-ansilib #setopt -Hmwlib
-
- OPTLIST=-Hunixlib -Hmwlib
- # Option is mwlib by default unless UNIXLIB has been set.
- #call mutex OPTLIST $?:^ ?$UNIXLIB ^ -Hunixlib ^ -Hmwlib ^
-
- #if ?-Hunixlib
- #if ?!$HCINC
- HCINC=-I$USRINC %; # Reference UNIX header files only
- #call c_wrap
- #endif
- noansilib=1
- ?!$CLIB CLIB= %; # Suppress MetaWare ANSI library
- #endif
-
- #########################################################################
- # Include files.
- #########################################################################
- ?$HCDIR ?!$HCINC HCINC=-I$HCDIR$slash$)inc
- #if ?-Hloclib
- HCINC=-I$HCDIR$slash$)v1x$slash$)inc
- ?$DO_CPP festuff_GOC+=-c_wrap ^v1x$slash$)inc
- #endif
- ?$DO_CPP CCINC=-I$HCDIR$slash$)incc %; HCINC+=$CCINC
- ?$PPDIR ?!$PPINC PPINC=-I$PPDIR$slash$)inc
- ?!$HOST_IS_MSDOS HCINC+= -I$USRINC
-
- #########################################################################
- # Debugger switches set by -g
- #########################################################################
- #if ?-g
-
- ?!$HCDEBUG HCDEBUG=
- #if ?$LOC
- festuff_LOC +=$HCDEBUG
- #else
- bestuff +=$HCDEBUG
- #endif
-
- #endif
-
- #########################################################################
- # Miscellaneous options.
- # Those ending in ? can have a value; the rest cannot.
- #########################################################################
- -HX? -O? -w? -g? -Hasm -Hanno -Hlist -Hlist=? -Hsuffix=? -Hkanji -H+w -Hmbcs
- ?-Hlist list=-on list
- ?-Hlist=? list=-on list -list $-Hlist=? %; bestuff += -out $-Hlist=?
- #if ?-w
- #if ?$LOC
- festuff_LOC+=-off warn
- #else
- #if ?!$-w?
- warn_level=0
- #else
- #foreach^ 0 1 2 3 4 ^N ?=^$N^$-w?^ warn_level=$-w?
- ?!$warn_level #print Invalid warning level specification: $-w
- #endif
- #if ?$warn_level
- HCstuff += -pragma "warning_level $warn_level"
- #if ?=^$warn_level^0^
- nowarn=-off warn
- ?$PDRV bestuff += $nowarn
- #endif
- ?$FDRV MFstuff+= -w $warn_level
- ?!<^$warn_level^4^ HCstuff += -on VP_UP_WARN
- ?<^$warn_level^2^ HCstuff += -off PROTOTYPE_CONVERSION_WARN
- #endif
- #endif
- #endif
-
- #################################################################
- # Process optimization level (-O switch)
- #################################################################
- # Define meaning of optimization levels
- # -O<level> Optimize for speed at level <level>
- # If no level is specified, 2 is assumed.
- # If -O not specified, level is 1.
- # If -Os, this means optimize-for-space.
- # If you wish, you can name your own optimization levels (see below).
- ##############################################################
- #if ?-O # if -O specified
- O_level=2 %; # Default, if level number not specified (-O).
- ?$-O? O_level = $-O?
- #else
- O_level = 1
- #endif
-
- #############################################################
- # Set procedure opt_<level> to the appropriate options code
- # for optimization level <level>.
- # If no -O is specified, the default level is 1.
- # If -O is specified without a level number, the default is 2
- #
- # To turn on optimization toggle: -on toggle_name...
- # To turn on loop-unrolling: -L factor,size
- #
- # To turn on inlining: set HIT and/or HIC to appropriate values
- #############################################################
- #proc opt_s
- bestuff += -on cross_jump optimize_for_space preload_args_from_memory local_cse_iterate live_dead_iterate mem_refs_from_loop loop_reg_rename reg_alloc_enhance reduce_reg_contention
- #endp
-
- #proc opt_0
- bestuff += -on SOURCE_CODE_ORDER
- #endp
-
- #proc opt_1
- #call opt_0
- bestuff += PRELOAD_ARGS_FROM_MEMORY
- ?!-g bestuff += CROSS_JUMP
- #endp
-
- #proc opt_2
- # Notice that opt_2 is _not_ opt_1 with more things.
- bestuff += -on BACK_SUBSTITUTE_EPILOG HIGH_LEVEL_SCHEDULING GLOBAL_CSE LOCAL_CSE_ITERATE LIVE_DEAD_ITERATE CROSS_JUMP MEM_REFS_FROM_LOOP LOOP_REG_RENAME REG_ALLOC_ENHANCE REDUCE_REG_CONTENTION
- #endp
-
- #proc opt_3
- #call opt_2
- bestuff += -on LOW_LEVEL_SCHEDULING CLEANUP_SPILLS
- ?$NCR HIT=20 %; HIC=4
- #endp
-
- #proc opt_4
- #call opt_3
- bestuff += -on BEHAVED
- HCstuff += -on behaved %; # Keep in sync with above.
- HIT=20 %; HIC=4
- #endp
-
- #proc opt_5
- #call opt_4
- bestuff += -on STRENGTH_REDUCE INDUCTION_ELIM
- #endp
-
- # Add loop unrolling and (for 860) software pipelining.
- #proc opt_6
- #call opt_5
- bestuff += -L 4,64
- #endp
-
- #proc opt_7
- #call opt_6
- # Extra optimization for Intel 860
- #endp
-
- #############################################################
- # If you want to have your own optimization designation,
- # set the value here. E.g.,
- # opt_fred = -on this -off that
- # Then you can say -Ofred.
- #############################################################
-
- # Now access the appropriate opt_xxx procedure:
- whichopt=opt_$O_level
- #if ?$*whichopt
- #call $whichopt
- #else
- #print Unknown optimization designation: $-O. Opt level 0 assumed.
- #call opt_0
- #endif
- bestuff += -l$O_level %; # Pass opt-level to back-end
-
- #####################################################
- # End of processing optimization levels
- #####################################################
-
- # Loop unrolling parameters appear after opt levels
- # so user's spec takes precedence.
- ?!$LOC -Hunroll=? ?-Hunroll=? #foreach^ $~all>~-Hunroll=? ^ X bestuff += -L \
- $X
-
- #################################################################
- # Handle other switches
- #################################################################
-
- ?-Hasm festuff_LOC += -on asm %; bestuff+=-a -on asm
- ?-Hanno bestuff+= -a
- -Htmpprefix=? ?-Htmpprefix=? TMPPREFIX=$-Htmpprefix=?
- # Be sure the TMPPREFIX ends in a directory separator.
- ?$TMPPREFIX ?!=^ $~tail:1~TMPPREFIX ^ / ^ ?!=^ $~tail:1~TMPPREFIX ^ \ ^ \
- TMPPREFIX=$TMPPREFIX/
- ?-g festuff_LOC+= -debug %; festuff_GOC += -g
- ?-Hsuffix=? OBJSUFFIX=$-Hsuffix=?
- ?-Hkanji kanji=-st $HCDIR$bin/ck.st -kanji %; bestuff += -dbcs %; \
- # Define Kanji scan tables.
- # Define Multibyte scan tables and pass -dbcs switch to front and back end..
- #if ?-Hmbcs
- festuff_GOC += -def _MBCS
- #if ?=^$OS$CPU^AIXIBM370^
- festuff_GOC += -mbcs %; bestuff += -mbcs
- #elif ?=^$OS^SUN^
- festuff_GOC += -kanji %; bestuff += -kanji
- #else
- festuff_GOC += -dbcs -st $HCDIR$bin/cmbcs.st %; bestuff += -dbcs
- #endif
- #endif
- ?-Hsuffix=? OBJSUFFIX=$-Hsuffix=?
- ?-E E=-ppo @
- ?-P P=-ppo %s.i %; # Put preprocessing output in the .i file.
- ?-H+w HCstuff+= -off pcc_msgs
- ?!$LOC bestuff+=-e %; \
- # Force optimizer to send warnings and errors to stdout.
- ?-Hmset bestuff+= -XM %; # Use Microsoft sets
-
- #########################################################################
- # Deal with targets that support multiple memory models
- #########################################################################
- #if ?$MODELS %; # Does this support memory models?
- -M? # Declare option -M with argument. Now check the arguments:
- #if ?-M
- #foreach(^ l s m c b ^ large small medium compact big ^) v1 v2 ?=^ $-M? ^ $v1 ^ model=$v2 %; \
- mletter=$v1
- #endif
- #if ?!$model
- # if model wasn't defined, but -M was, complain.
- ?-M #exit Invalid memory model specification: $?-M
- model = small %; mletter = s %; # default if no other specified.
- #else
- # Don't force the model unless specified; this allows a
- # profile to specify it.
- festuff += -mm $model
- #endif
- ?-Hloclib model1x=v1x$slash$)$model
- #endif
-
- #########################################################################
- # Define libraries to be referenced in the generic case
- #########################################################################
- lib=lib
- ?$model lib=$lib/$model
-
- ?$PDRV langname=PP %; ?!$LIBDIR LIBDIR=$PPDIR$slash$lib
- ?$CDRV langname=HC %; ?!$LIBDIR LIBDIR=$HCDIR$slash$lib
- #if ?$FDRV
- #if ?$MFDIR
- langname=MF %; ?!$LIBDIR LIBDIR=$MFDIR$slash$lib
- #elif ?$LFDIR
- langname=LF %; ?!$LIBDIR LIBDIR=$LFDIR$slash$lib
- FSTART=$LIBDIR/fcrt0.o %; \
- # Additional start-up routine for Lahey fortran.
- #endif
- #endif
- CRT=crt
- START=$LIBDIR/$CRT$)0.o %; # Start, if using MW libraries.
- ENTRY=_start
-
- SYSLIB=/lib
- # For UNIX V.4, /lib is now in the C compilation system (ccs) directory.
-
- # Set PLIB_USER_DEFINED if PLIB was set, etc.
- #foreach^ PLIB CLIB CCLIB FLIB MWLIB ^ N X=$N$)_USER_DEFINED %; ?$*N *X=1
-
- ?!$PLIB PLIB=$LIBDIR/libpp.a
- FLIBNAME=$?:# ?$MFDIR # libf.a # lf$TARG.a #
- ?!$FLIB FLIB=$LIBDIR/$FLIBNAME
- ?!$CLIB CLIB=$LIBDIR/libc.a
- ?$DO_CPP ?!$CCLIB CCLIB=$LIBDIR/libcc.a
- ?!$MWLIB MWLIB=$LIBDIR/libmw.a
-
- ?$LOC CLIB= %; # If LOC compilers, no MW-supplied libc.a.
- lc = -lc %; # Default.
- ldname=ld %; # Default.
-
- #proc checkpath
- # See if $2 exists on path $*1. We pass indirect in case $*1 is blank.
- # If so call $3 with the full name.
- # Be sure not to check for the existence of files like "C:\/link.exe".
- # DOS gets a file open error (although C:/bin\/link.exe is OK),
- # and the 3COM network gives a "Abort, Retry, Fail" (!!!) message.
- # So this procedure overcomes the DOS and 3COM bugs:
- path=$*1
- # The slash variable was getting clobbered, so I had to copy into a
- # local variable and use the local. This way, it doesn't matter if
- # it gets clobbered. JT 1/30/90
- localslash=$slash
- # #print looking for $path$localslash$2
- ?$HOST_IS_MSDOS ?|# ?=^ $~tail:1~path ^ / ^ # ?=^ $~tail:1~path ^ \ ^ # \
- | localslash=
- ?%i$path$localslash$2 #call $3 $path$localslash$2
- #endp
-
- #########################################################################
- # Library search mechanism.
- #########################################################################
- # Library search should be used when under non-UNIX systems or when
- # the libraries are independent of the host UNIX.
- # -Lxxx specifies a directory xxx to search in finding a library.
- # -lxxx specifies a library to search for.
- # If targetted to DOS, libraries are assumed to end in .lib.
- # Otherwise, they start with lib (unless -lxxx contains "lib") and
- # end in $LIBEXT
-
- #NOTE: AM29K usurps "-lregs=xxx". Therefore we must declare it before -l?
- # We must also intercept -lm so as to insert 29000 version of 29050 version
-
-
- LIBSEARCH=1
- # dotlib necessary due to .l86 default in Pharlap cross linker and
- # different FlexOS 286 convention.
- dotlib=.lib
- ?=. $TARG . f286 . dotlib=.l86[li]
-
-
- #if ?$LIBSEARCH
- -L? -l? # Library search path -L and library specification -l.
- LIBEXT=a %; # Unix lib extension; may be altered in machine-specific
- # sections below prior to calling libsearch
- #proc libsearch model_directory %; # Parameter relevant only to DOS.
- # ?<^ $__minor ^ 5 ^ #call old_driver 1 0 5
- EXTRALIBS=
- set="EXTRALIBS+=%$1 %; FOUND=1"
- #proc find_lib libname libsuffix
- FOUND=0
- ln=$libname
-
- # Do we need a . character?
- ?=^ $~basename~~str:.~ln ^ ^ ln=$ln$dotlib
- # Search as normal name first.
- ?%i$ln #call set $ln %; #return
- # Then in libpaths:
- #foreach^ $~all>~?-L? ^ libpath #call checkpath libpath $ln set
- # Then in distribution:
- ?<^ $FOUND ^ 1 ^ #call checkpath model_directory $ln set
- ln=$libname %; # For message below.
-
- ?<^ $FOUND ^ 1 ^ #print Warning: Library $ln not found, hence is \
- omitted from link.
- #endp
-
- # Handle the AM29K -cl option
- #
-
-
- #foreach^ $~all>~?-l? ^ libwanted #call find_lib $libwanted $?libappendix
- #endp
- #endif
-
- #########################################################################
- # OS MS-DOS Dependencies
- #########################################################################
-
- -Hnogloc
- ?-Hnogloc bestuff += -Xn
- -fsoft # For GOC only.
- -Hl=? # Coprocessor/emulator library selection.
- -Hlib=? # This is now obsolete.
- mletter= %; # Only small model for 386.
-
- # Default to coprocessor for cross-compilers
- #if ?$HOST_IS_MSDOS
- whichlib=e
- # Change default if host machine has 8087 (MS-DOS/OS2 driver only).
- ?$__87_EXISTS whichlib=c
- #else
- whichlib=c
- #endif
- ?=^ $?-Hl=? ^ c ^ whichlib=c
- ?=^ $?-Hl=? ^ e ^ whichlib=e
- #if ?$LOC
- -femc87
- ?-486 festuff_LOC += -on 486
- ?-fsoft whichlib=e %; festuff_LOC += -off floating_point
- na=$slash$)na
- ?-f287 whichlib=c %; festuff_LOC += -on floating_point
- ?-f387 whichlib=c %; festuff_LOC += -on 387 -on floating_point
- ?-f1167 whichlib=e %; festuff_LOC += -on 1167 -def "__1167 1"
- ?-f3167 whichlib=e %; festuff_LOC += -on 3167 -def "__1167 1"
- ?-f4167 whichlib=e %; festuff_LOC += -on 3167 -def "__1167 1"
- ?-femc87 whichlib=c %; festuff_LOC += -on emc87
- #else
- na=$slash$)hcna
- ?=^ $whichlib ^ e ^ whichlib=soft
- ?=^ $whichlib ^ c ^ whichlib=387
- ?-fsoft whichlib=soft
- ?-f287 whichlib=287
- ?-f387 whichlib=387
- ?-f1167 whichlib=1167
- ?-f3167 whichlib=3167
- ?-f4167 whichlib=3167
- ?-486sx ?!-f287 ?!-f387 ?!-1167 ?!-3167 ?!-f4167 whichlib=soft
- #if ?|/ ?-Hloc / ?-Hloclib /|
- ?=^$whichlib^287^ whichlib=loc %; whichgloclib=287 %; which1xlib=c
- ?=^$whichlib^387^ whichlib=loc387 %; whichgloclib=387 %; which1xlib=c
- ?=^$whichlib^soft^ whichlib=loc %; whichgloclib=soft %; which1xlib=e
- ?=^$whichlib^1167^ whichlib=1167 %; whichgloclib=1167 %; which1xlib=e
- ?=^$whichlib^3167^ whichlib=3167 %; whichgloclib=3167 %; which1xlib=e
- na1x=$slash$)na
- #endif
- #if ?|/ ?-Hloc / ?-Hloclib /|
- festuff += -pragma "calling_convention(_DEFAULT_CALLING_CONVENTION|_LOC_COMPAT,_DEFAULT)"
- festuff += -pragma "calling_convention(_DEFAULT_CALLING_CONVENTION)"
- festuff += -pragma "Align_members(1)"
- bestuff += -Xl %; # Tell back-end about -Hloc switch
- #endif
- #endif
- _dir=$langname$)DIR %; _dir=$*_dir
- #call libsearch $_dir$slash$model %; # Find any libraries; add to EXTRALIBS.
- # Windows 3.0 support
- INITOBJS= %; DOSLIB=
- -Hwin
- #if ?-Hwin
- DOSLIB= $_dir$slash$model$slash$)mwlibw$dotlib
- #if ?-Hloclib
- INITOBJS= $_dir$slash$model1x$slash$)initwin.obj %n
- #else
- INITOBJS= $_dir$slash$model$slash$)initwin.obj %n
- #endif
- #endif
- -Hads
- #if ?-Hads
- #if ?-Hloclib
- INITOBJS= $_dir$slash$model1x$slash$)initads.obj $_dir$slash$model1x$slash$)dosads.obj %n
- #else
- INITOBJS= $_dir$slash$model$slash$)initads.obj $_dir$slash$model$slash$)mwintads.obj %n
- #endif
- #endif
- -Hadi
- #if ?-Hadi
- #if ?-Hloclib
- INITOBJS= $_dir$slash$model1x$slash$)initadi.obj $_dir$slash$model1x$slash$)dosadi.obj %n
- #else
- INITOBJS= $_dir$slash$model$slash$)initadi.obj $_dir$slash$model$slash$)mwintadi.obj %n
- #endif
- #endif
-
- #if ?$HOST_IS_MSDOS
- ULN=USERLIB$~toupper~mletter$~toupper~whichlib
- #else
- ULN=userlib$~tolower~mletter$~tolower~whichlib
- #endif
- #if ?|/ ?-f1167 / ?-f3167 / ?-f4167 /|
- # for weitek link with high speed lib
- EXTRALIBS = $?EXTRALIBS $_dir$slash$)small$slash$)hcwp$dotlib
- #endif
- ?-Hlib=? EXTRALIBS= $?EXTRALIBS $~all>~?-Hlib=?
- #if ?$LOC
- DOSLIB+=$?EXTRALIBS $?*ULN
- #else
- DOSLIB+=$?EXTRALIBS $?USERLIB386 $?*ULN $?USERLIBNA
- #endif
- #
- # Support for Rational's DOS4G. The converted libraries currently
- # reside in small/dos4g. The toggles have different names for LOC and
- # GOC.
- #
- -Hdos4g
- #if ?-Hdos4g
- festuff_GOC+=-on os2_obj
- festuff_LOC+=-on os2_obj
- LINKNAME=glu
- ASNAME=masm386
- #endif
- ?$DO_CPP ?!-Hloclib DOSLIB+= $_dir$slash$model$slash$)hcc$mletter$)386$dotlib
- #if ?-Hloc
- ?$DO_CPP DOSLIB+= \
- $_dir$slash$model$slash$)hcc$mletter$whichgloclib$dotlib
- #elif ?!-Hloclib
- ?$DO_CPP DOSLIB+= $_dir$slash$model$slash$)hcc$mletter$whichlib$dotlib
- #endif
- #if ?!$LOC ?!-Hloclib
- DOSLIB+= $_dir$slash$model$slash$~tolower~langname$mletter$)386$dotlib
- DOSLIB+= $_dir$slash$model$slash$~tolower~langname$mletter$whichlib$dotlib
- #if ?$FDRV ?$MFDIR
- # Add C stuff after the fortran stuff.
- DOSLIB+= $_dir$slash$model$slash$)hc$mletter$)386$dotlib
- DOSLIB+= $_dir$slash$model$slash$)hc$mletter$whichlib$dotlib
- #endif
- #endif
- ?-Hloclib DOSLIB+= \
- $_dir$slash$model1x$slash$~tolower~langname$mletter$which1xlib$dotlib
-
- # HC non-ansi library for MS-DOS:
- #if ?|^ ?$CDRV ^ ?$FDRV ^| ?!-Hansi ?!=^ $OS ^ OS2 ^ ?!=^ $OS ^ CDOS ^
- #if ?-Hloclib
- DOSLIB+=$_dir$slash$model1x$na1x$mletter$dotlib
- #else
- DOSLIB+=$_dir$slash$model$na$mletter$dotlib
- #endif
- #endif
- ?-Hloclib DOSLIB+= $_dir$slash$model1x$slash$mletter$)ldstub$dotlib
- # OS2 libraries; typically, DOSCALLS is always needed, ANSI or not.
-
- #proc check_link_as ldname asname
-
- #proc find varname toolname
- ?!$*varname set="*varname=%$1" %; ?%i$toolname *varname=$toolname
- # Split the path by : if on UNIX and ; if on DOS.
- elements=$?:^ ?$HOST_IS_MSDOS ^ %e$~sep;~PATH ^ %e$~sep:~PATH ^
- #foreach^ $TOOLSDIR $elements ^ dir #call checkpath dir $toolname set %; \
- ?$*varname #break
- ?!$*varname *varname=/$toolname/not/found/in/TOOLSDIR/or/PATH
- #endp
-
- add=
- #if ?$HOST_IS_MSDOS
- #if ?=^ $HOST ^ f286 ^
- ?=^ $~str:.286~ldname ^ ^ add=$exe
- #else
- ?=^ $~str:.exe~ldname ^ ^ add=$exe
- #endif
- #endif
- #call find LINKER $ldname$add
-
- #call find AS $asname$add
-
- # #call find LINKER $ldname %; #call find AS $asname
-
- #endp
- #proc dos_as_ld_opt
- # Define and inspect arbitrary linker/assembler.
- -Hldopt=? ldflags= %; #foreach^ $~sep,~~all>~?-Hldopt=? ^X ldflags += $X
- -Hasopt=? asflags= %; #foreach^ $~sep,~~all>~?-Hasopt=? ^X asflags += $X
- ?-p ldflags += -realbreak end_real %n %; \
- INITOBJS+=$_dir$slash$model$slash$)mwprof.obj %n
- #endp
-
- #proc MS_format_link
- # Microsoft format linker command line.
-
- LINKER+= @ %+%c %foreach %o %f + %n %end , %n %O %n , %n $DOSLIB /seg:500 $?ldflags
-
- #endp
- #proc MS_format_asm
- AS+= %s , %o $?asflags ;
- #endp
-
- #if ?|^ ?$x_stuff_needed ^ ?$ATT_UNIX ^|
- #proc x_stuff
- -X? # Ensure declared.
- #if ?!-Hansi
- xflag = -Xa %; # Default value for -X flag
- #else
- xflag = -Xm
- #endif
- ?!$NCR xflag = -Xm %; # Use -Xm except for NCR
- #if ?-X
- #if ?-Hansi
- #print Warning: -Hansi overrides -X setting.
- #elif ?=^$-X?^t^
- xflag=-Xt
- #elif ?=^$-X?^a^
- xflag=-Xa
- #elif ?=^$-X?^c^
- xflag=-Xc
- #elif ?=^$-X?^m^
- # MetaWare Default option
- xflag=-Xm
- #else
- #print Warning: Unrecognized option: $-X
- #endif
- #endif
-
- # When AT&T gets long-double support, remove the
- # -nolongdouble or -doubleonly flags
- #
- #if ?=^$xflag^-Xt^
- HCstuff+= -on PCC USE_UP_RULES VP_UP_WARN -asm_reserve -unpragma -def "_ALLOCA _ALLOCA"
- bestuff += -on GLOBALS_VOLATILE
- ?!$fsingle HCstuff += -on double_math_only
- #call predef __STDC__ 0
- ?$NCR HCstuff += -nolongdouble
- ?-Hcpp CPPOPTS += -Xt
- #elif ?=^$xflag^-Xa^
- HCstuff+= -on PCC VP_UP_WARN TRIGRAPHS -asm_reserve -unpragma -def "_ALLOCA _ALLOCA"
- #call predef __STDC__ 0
- ?!$fsingle HCstuff += -on double_math_only
- ?$NCR HCstuff += -nolongdouble
- ?-Hcpp CPPOPTS += -Xa
- #elif ?=^$xflag^-Xc^
- HCstuff += -on TRIGRAPHS -unpragma
- ?$NCR HCstuff += -doubleonly %; bestuff += -XD
- # Enforce strict ANSI conformance in regard to floating point
- bestuff += -Xf
- #call no_ansi_defs %; # No non-ANSI predefined names permitted.
- ?-Hcpp CPPOPTS += -Xc
- #else
- ?!-Hansi HCstuff += -asm_reserve
- xflag=-Xc %; # Link with -Xc libraries
- #endif
- #endp
-
- #endif
-
-
-
- ?$CLCC HCstuff += -on LONG_ENUMS -off CHAR_DEFAULT_UNSIGNED %; #call x_stuff
-
- # Allow -sched (old) and -Hsched (for V.4). This requires newer driver.
- # If you have an older driver, use commented-out line.
- -Hsched -sched test_sched=?|^ ?-Hsched ^ ?-sched ^|
- $test_sched bestuff+=-on low_level_scheduling high_level_scheduling
- # ?-sched bestuff+=-on low_level_scheduling high_level_scheduling
-
-
- #########################################################################
- # Intel 386 Dependencies
- #########################################################################
- -f387 -f1167 -B -B- -f3167 -f4167 -NB -486 -486r -PI -386 -f287 -fsoft -fieee
- -286 -80286 -80186 -8086 -8088 -088 -182 -086 -186
- -fstrict -486sx
- -f86 # Nexgen's F86 mode
- -weitek # provided for Weitek as a way of passing default optimizations
- # Following options only apply to MSDOS target
-
- -Hw67flat # weitek flat model with wtlbase
- -Hw67seg # weitek segmented model for MSDOS
-
-
- #
- # -Hansi forces ANSI_FP tog to be turned on so that transcendentals set errno
- # Never mind, STRICT_ANSI_MATH must be turned on to surpress
- # transendental recognition altogether. This is because the side-effect
- # of setting "errno" gets lost.
- #
- ?-Hansi bestuff+=-on ANSI_FP %; festuff_GOC += -on STRICT_ANSI_MATH
- ?-Hansi bestuff += -Xf %; # Strict ANSI-conformance in floating point
-
- # Choose which target processor
- OPTLIST=-PI -486 -486r -386 -f86 -486sx -286 -80286 -80186 -8086 -8088 -088 -186 -086 -186
- #call mutex OPTLIST -386
-
- OPTLIST=-f287 -f387 -f1167 -f3167 -fsoft -f4167
- #if ?|^?-286^?-80286^?-186^?-80186^?-8086^?-8088^?-088^|
- fdefault=-f287
- #else
- fdefault=-f387
- #endif
- ?$HOST_IS_MSDOS ?$TARGET_IS_MSDOS ?!$__87_EXISTS fdefault=-fsoft
- # -486sx defaults -fsoft
- ?$TARGET_IS_MSDOS ?-486sx fdefault=-fsoft
- #call mutex OPTLIST $fdefault
-
- # We don't yet support direct ELF output. Always go thru assembler
-
- ?!-S ?!>^$?#-NB^$?#-B^ __BFLAG=BIN
-
- #if ?!$LOC
- # If -f287 specified after -f387, -f1167, -f3167 and -f4167, then...
- ?-f287 festuff_GOC += -def "_I287 1" %; MACH=287 %; COPROC=1 %; \
- fltopt=-f287
- #if ?|/ ?-f1167 / ?-Hon=1167 /|
- bestuff+= -XW %; festuff_LOC+=-on 1167 %; COPROC=1 %; MACH=386w %; \
- WEITEK=1 %; fltopt=-f1167
- #endif
- #if ?|/ ?-f3167 / ?-f4167 / ?-Hon=3167 / ?-Hon=4167 /|
- bestuff+= -XWY %; festuff_LOC+=-on 3167 %; COPROC=1 %; \
- MACH=386w %; WEITEK=1 %; fltopt=-f3167
- #endif
- #if ?-fsoft
-
- CLIB=$LIBDIR/libc.fsoft.a %; PLIB=$LIBDIR/libpp.fsoft.a %; \
- CCLIB=$LIBDIR/libcc.fsoft.a %; MACH=386s %; fltopt=-fsoft %; \
- COPROC=1
-
- #endif
-
- #If no coprocesor selected, assume 387
- ?!$COPROC festuff_LOC+=-on 387 %; COPROC=1 %; \
- festuff_GOC += -def "_I387 1" %; fltopt=-f387
-
- #if ?$WEITEK
- MACH=386w %; festuff_GOC += -def "_WEITEK 1"
- #if ?-f1167
- CLIB=$LIBDIR/1167.a $LIBDIR/libc.1167.a %; \
- CCLIB=$LIBDIR/libcc.1167.a %; \
- PLIB=$LIBDIR/libpp.1167.a
- #elif ?-f3167
- CLIB=$LIBDIR/1167.a $LIBDIR/libc.3167.a %; \
- CCLIB=$LIBDIR/libcc.3167.a %; \
- PLIB=$LIBDIR/libpp.3167.a
- #else
- CLIB=$LIBDIR/1167.a $LIBDIR/libc.4167.a %; \
- CCLIB=$LIBDIR/libcc.4167.a %; \
- PLIB=$LIBDIR/libpp.4167.a
- #endif
- ?-lm #exit Cannot specify -lm with -f1167, -f3167, or -f4167
- ?$noansilib #exit Cannot specify -Hnoansilib with -f1167 -f3167 or \
- -f4167
-
- -Hw67flat
- -Hw67seg
- ?-Hw67flat ?!-Hw67seg bestuff += -off \
- segmented_1167 -on use_wtlbase_for_weitek
- ?-Hw67seg ?!-Hw67flat bestuff += -on segmented_1167 %; \
- ?-Hw67flat #exit Cannot specify -w67seg with -Hw67flat
-
- #else
- ?-lm1167 #exit Cannot specify -lm1167 unless -f1167, -f3167, or \
- -f4167 is specified.
- #if ?|/ ?-Hw67seg / ?-Hw67flat / ?-weitek /|
-
- #exit Cannot specify -weitek or -Hw67seg or -Hw67flat without -f1167 or -f3167 or -f4167
-
- #endif
- #endif
-
-
- ?-f86 bestuff+= -XN -on scheduling
- # -f4167 implies -486 and 4167
- #if ?|/ ?-086 / ?-8086 / ?-8088 / ?-088 /|
- MACH=086 %; b16=1
- ?-fsoft MACH=186s
- ?$WEITEK MACH=086w
- #elif ?|/ ?-186 / ?-80186 /|
- MACH=186 %; b16=1 %; ?-fsoft MACH=186s
- ?$WEITEK MACH=186w
- #elif ?|/ ?-286 / ?-80286 /|
- MACH=286 %; b16=1 %; ?-fsoft MACH=286s
- ?$WEITEK MACH=286w
- #elif ?|/ ?-486 / ?-f4167 / ?-f86 / ?-486sx / ?-PI /| # Nexgen f86 => \
- 486 as well
- #if ?-PI
- MACH=PI
- #else
- bestuff += -X4
- MACH=486 %; #80486 switch
- #endif
- ?-fsoft MACH=486s %; # Some 486 chips have no floating point.
- # ?|/?-486/?-486sx/| CLIB=$LIBDIR/libc.486.a %; \
- CCLIB=$LIBDIR/libcc.486.a
- # ?-f86 CLIB=$LIBDIR/libc.f86.a %; CCLIB=$LIBDIR/libcc.f86.a
- #endif
-
- # MICROSOFT library doesn't have our math check routines. Don't inline \
- transc.
- #if ?$b16
- bestuff += -XM %; festuff_GOC += -on strict_ansi_math
- #call predef _I286
- #else
- #call predef _I386
- #endif
-
- ?-486r bestuff += -X4R %; MACH=486r %; \
- ?!-f387 #exit Cannot specify both $fltopt and -486r.
- #if ?|/ ?-486 / ?-486r / ?-f4167 / ?-f486sx /| # weitek for 486
- #if ?|/ ?-f4167 / ?-f3167 /|
- CLIB=$LIBDIR/1167.a $LIBDIR/libc.4167.a $?CLIB
- C CLIB=$LIBDIR/libcc.4167.a
- #if ?-486r
- MACH=486wr
- #else
- MACH=486w
- #endif
- #endif
- #endif
- #if ?-weitek
- # ?!$-O? bestuff += -O
-
- ?!-Hw67flat bestuff += -off segmented_1167 -on use_wtlbase_for_weitek
- ?-Hw67seg #exit Cannot specify -Hw67seg when -weitek is specified
-
- #endif
- ?$TARGET_IS_MSDOS ?!$FDRV festuff_GOC += -pragma "stack_size_warn (4096)"
-
- ?-fieee bestuff += -Xi %; # IEEE floating point
- ?-fstrict bestuff += -Xf %; # Strict ANSI-conformance in floating point
- #endif
-
- #####################################################################
- # 386/Protected mode <<>>
- #####################################################################
- #call dos_as_ld_opt
- # Directories to search for include files
- -I?
- #if ?-I?
- __CNF_DOES_I=x
- #if ?!$LOC
- #foreach^ $~all>~-I? ^dir festuff_GOC+= -dir $dir
- #else
- #foreach^ $~all>~-I? ^dir festuff_LOC+= -dir $dir
- #endif
- #endif
- IPATH=IPATH
- -Hipname=? ?-Hipname=? IPATH=$~toupper~-Hipname=?
- #if ?!$LOC
- ?%e$IPATH #foreach^ %e$~sep;~*IPATH ^dir festuff_GOC+= -dir $dir
- #else
- ?%e$IPATH #foreach^ %e$~sep;~*IPATH ^dir festuff_LOC+= -dir $dir
- #endif
-
- #if ?!$LOC
- festuff_GOC+= -off common_can_export
- #if ?-Hwin
- festuff_GOC+= -on multiple_var_defs relax_func_ptr_rules char_is_rep -off prototype_conversion_warn char_default_unsigned
- #else
- festuff_GOC+= -off multiple_var_defs
- #endif
- -Hinfo ?-Hinfo bestuff += -on print_info
- -Hobj=?
- #if ?-Hobj=
- #print Warning:
- #print -Hobj=filename is no longer supported.
- #print Please use the -o filename option instead.
- #print See the Command-Line Options chapter of
- #exit the Programmer's Guide for more information.
- #endif
- #else
- ?-Hwin festuff_LOC+= -on multiple_var_defs -off \
- prototype_conversion_warn far_conversion_warnings \
- prototype_override_warnings size_change_warnings \
- unused_parm_warnings public_var_warnings
- #endif
-
- # Use Pharlap's linker and assemblers as defaults for d386;
- # use Microsoft's for o386.
- # Read LINKNAME from environment if set.
- ?%eLINKNAME LINKNAME=%e$LINKNAME
- #if ?!$LINKNAME
- ?=^ $TARG ^ d386 ^ LINKNAME=386link
- ?=^ $TARG ^ o386 ^ LINKNAME=link386
- ?=^ $HOST ^ mvax ^ LINKNAME=xl386
- #endif
- #if ?!$ASNAME
- ?=^ $TARG ^ d386 ^ ASNAME=386asm
- ?=^ $TARG ^ o386 ^ ASNAME=masm386
- ?=^ $HOST ^ mvax ^ ASNAME=xa386
- #endif
- #call check_link_as $LINKNAME $ASNAME %; # Computes LINKER and AS.
- EXE=$?:^ ?-o? ^ -exe $-o? ^^
- #if ?=^ $TARG ^ d386 ^
- #proc ensure_dot_lib varname
- ?=^ $~str:.lib~*varname ^ ^ *varname=$*varname$).lib
- #endp
- # Must be sure libraries end in .lib, since there is no
- # other way to distinguish libraries from object modules.
- # The objects end in comma; we have to make sure we don't
- # end the libraries in a comma. We assume that we'll have
- # at least one library.
- #if ?!=^ $~str:glu~LINKNAME^ ^
- #proc add_lib libname
- L2=$libname
- ?=^ $~str:.lib~L2 ^ ^ L2=$L2$).lib
- LINKER+=$L2 %n
- #endp
- # Rational's GLU linker.
- EXE=$?:^ ?-o ^ exp($-o?) ^^
- #ldopt -abterr. -acg -noacg -auto -buffer. -checksum \
- -nochecksum -cob -nocob -codeview -dataseg. -dbg -dms. \
- -dosseg -dpmi -dsperr. -exclude. -farcall -nofarcall -fcl \
- -format. -gdtsize. -group. -ignore -noignore -include. \
- -init00 -initff -keyboard -map -mfl -mfx -mpl -mpx -ncl -nod \
- -nosegs16 -notruncate -novcpi -nrt -nts. -option. -overload \
- -ovf -package -rotate -rt -rtnerr. -sel -stack. -stub. -ts \
- -verbose -xmax. -xmin.
- # exp. map. log. info.
- LINKER += @ %+%c.lnk %foreach %o %f %n %end
- #foreach^ $DOSLIB ^ foo #call add_lib $foo
- LINKER+= $EXE %u -format lin %n
- ?$RATIONAL_LOADER LINKER+= -stub $RATIONAL_LOADER %n
- ?$RATIONAL_LINKDEBUG ?-g LINKER+=$RATIONAL_LINKDEBUG %n
- LINKER+=%n $?ldflags
- #elif ?!=^ $~str:mlk~LINKNAME^ ^
- comma=
- #proc add_lib libname
- L2=$libname
- ?=^ $~str:.lib~L2 ^ ^ L2=$L2$).lib
- LINKER+=$comma $L2 %n
- comma=,
- #endp
- # mlk linker.
- EXE=$?:^ ?-o ^ -output($-o?) ^^
- LINKER += @ %+%c.lnk $INITOBJS %foreach %o %f , %n %end
- #foreach^ $DOSLIB ^ foo #call add_lib $foo
- LINKER+= $EXE %u -exp -flat %n $?ldflags
- ?$MLK_LINKDEBUG ?-g LINKER+=$MLK_LINKDEBUG %n
- #elif ?=^ $~str:l32.~LINKNAME ^ ^
- # Pharlap format linker; specify popular options.
- __OPT_WARN=1 %; # Warn of unknown options.
- #ldopt -lib. -exe. -map. -nomap -mapnames. -mapwidth. -fullseg \
- -warn -nowarn -fullwarn -symbols -stack. -mindata. \
- -maxdata. -minreal. -maxreal. -offset. -onecase \
- -priv -twocase -tc
- ?!|/ ?-Hwin / ?-Hads / ?-Hadi /| LINKER+= -pack
- #if ?|/ ?-Hads / ?-Hadi /|
- LINKER+= -twocase @ %+%c.lnk $EXE %n %foreach %o %f %n %end
- LINKER+= $INITOBJS %n
- #else
- LINKER+= -twocase @ %+%c.lnk $EXE %n $INITOBJS %foreach %o %f %n %end
- #endif
- ?$PHARLAP_LOADER LINKER+= $PHARLAP_LOADER %n
- #foreach^ $DOSLIB ^ foo LINKER+= -lib $foo %n
- LINKER+= %u
- ?$PHARLAP_LINKDEBUG ?-g LINKER+=$PHARLAP_LINKDEBUG %n
- LINKER+= %n $?ldflags
- #else
- #call MS_format_link %; # Lahey linker uses Microsoft format.
- LINKER+= ;
- #endif
- #if ?=^ $~str:masm.exe~ASNAME ^ ^
- AS+= %s -twocase -object %o $?asflags
- #else
- #call MS_format_asm %; # Lahey customers usually use masm.
- #endif
- #elif ?=^ $TARG ^ o386 ^
- #call MS_format_link %; #call MS_format_asm
- # Supply the default .def file anyway so user can modify it.
- LINKER+= , $?DEF ;
- #endif
- #if ?|/ ?-Hwin / ?-Hads / ?-Hadi / ?-p /|
- #proc LINKPROC
- #if ?!=^ $~str:mlk~LINKNAME^ ^
- ?!-o LINKER += -output($__EXE_NAME)
- #elif ?=^ $LINKNAME ^ 386link ^
- ?!-o LINKER += -exe $__EXE_NAME
- #endif
- #exec $LINKER
- #endp
- #endif
- #if ?-Hdos4g ?-g
- #proc LINKPROC
- #exec $LINKER
- ?>^ $RETCODE ^ 0 ^ #return %; # Return if error code.
- # #exec :makdbg32 $__EXE_NAME
- #endp
- #endif
-
-
-
-
- #########################################################################
- # Finish library definitions after processor-specific modifications.
- #########################################################################
- # These are the libraries. If you prefer others, or have moved
- # the libraries, rewrite these lines:
- # If -noansilib specified, make sure -lc is searched first. There may still
- # be High-C - specific functions referenced, therefore search CLIB and MWLIB
- # afterwards.
- #if ?!$LIBS
- ?!$DO_CPP CCLIB= %; # Kill C++ library if not in C++ mode.
- #if ?$noansilib
- ?$PDRV LIBS=$PLIB $lc $CLIB $MWLIB
- ?$CDRV LIBS=$?CCLIB $lc $CLIB $MWLIB
- ?$FDRV LIBS=$FLIB $lc $CLIB $MWLIB
- #else
- ?$PDRV LIBS=$PLIB $CLIB $MWLIB $lc
- ?$CDRV LIBS=$?CCLIB $CLIB $MWLIB $lc
- ?$FDRV LIBS=$FLIB $CLIB $MWLIB $lc
- #endif
- #endif
-
-
- #########################################################################
- # Sun Make compatibility
- #########################################################################
-
- # The Sun make program sets the environment variable SUNPRO_DEPENDENCIES
- # to a filename followed by the target names for targets which need
- # dependency rules built by the compiler. The Sun compiler does this on
- # the fly while compiling the module. Here we catch the environment
- # variable and set the necessary switches to make the same thing happen.
- # We produce dependency entries for each source file being compiled,
- # regardless of whether it was requested in the environment variable.
- # Hopefully this won't cause any problems.
-
- #if ?!$LOC
- #if ?%eSUNPRO_DEPENDENCIES
- # Declare -Hmake so the driver will let me run the back end.
- -Hmake -Hrel -Hmakeof -Hforcecom
- # The output filename is the first item in the environment variable.
- #foreach^ %e$SUNPRO_DEPENDENCIES ^ val MAKEOUTF=$val %; #break
- MAKEOFCMD=-makeof $MAKEOUTF
- # If no output file was found, let the dependency entry go to stdout.
- ?=^ $MAKEOUTF ^ ^ MAKEOFCMD=
- festuff_GOC+=-make -rel $MAKEOFCMD -forcecom
- #endif
- #endif
-
- #########################################################################
- # Define compiler commands.
- #########################################################################
- # Define compiler temporary files.
- # hc2 and pascal can share the same temp file.
- varfile=%t0 %; ILfile=%t1 %; hc2tmp=%t2 %; ptmp=%t2 %; deffile=%t3
- hc2tmp2=%t3 %; # hc2tmp2 and deffile can share
-
- # Common XX1COM/XXCOM stuff.
- festuff_GOC += -mach $MACH -vfile $varfile -ofile $ILfile $?list -dfile $deffile $?kanji $?E
- more_stuff= $festuff $?list $?nowarn $?asm -fn -silent -efile $efile $?kanji $?E $?DEFS $?MDEFS $?P
- # Put GOC- and LOC-specific stuff at end of general FE list
- # so things can be overriden if necessary
- festuff_GOC = $more_stuff $festuff_GOC
- festuff_LOC = $more_stuff $IEXT $festuff_LOC
- LF_stuff = -il $ILfile -vf $varfile
-
- #########################################################################
- # Inliner for globally optimizing compiler.
- #########################################################################
- #if ?-native # Compiler running native on CPU?
- 1com=$AT %; # GOC front-end, target-hosted.
- 2com=$TAT %; # GOC back-end, target-hosted.
- #else
- 1com=$AH %; # GOC front-end
- 2com=$TAH %; # GOC back-end
- #endif
- 0com=$1com$?com
- ?$HOST_IS_MSDOS ?!$XDRV real1com=$?com
- ?!$HOST_IS_MSDOS real1com=$?com
- 1com=$1com$)1$?real1com
- 2com=$2com$)2$?com
- loccom=$TAH$?com %; # Locally-optimizing compilers front & back end.
-
- #proc check_com cname default_dir default_name
- # If command-line override present for compiler name, use it;
- # otherwise, use present value or, if not set, use default.
- cswitch = -H$~tolower~cname$)=?
- #if ?$*cswitch
- # Check for -Hxxxcom=. First see if exists; if doesn't, try
- # compiler bin directory.
- *cname=$*cswitch
- ?!%i$*cname *cname=$default_dir$bin/$*cname
- #endif
- ?!$*cname *cname=$default_dir$bin/$default_name
- #endp
-
- #########################################################################
- # Inliner for globally optimizing compiler.
- #########################################################################
- #if ?!|^ ?$HC1x ^ ?$PP2x ^| # Don't define if we're using LOC compilers.
- -Hit=? -Hic=? -Hib=? -His=?
- -Hir -Hix -Hin -Hia -Hih -Hid -Hip -Hi -Hiw -Hiu -Him
- # Do inliner if we've seen any of the flags.
- #foreach^ r x n a h d p u m ^ N X=-Hi$N %; ?$*X IARGS=$?IARGS -$N %; \
- # If -Hir, add -r; etc.
- #foreach^ t c b s ^ N X=-Hi$N$)= %; Y=$X$)? %; ?$*X IARGS=$?IARGS -$N $*Y %; \
- # If -Hit=5, add -t 5, etc.
- ?-Hi IARGS = $?IARGS %; # Make sure defined.
- ?-Hiw IARGS = $?IARGS %; # Make sure defined.
- -Hinliner=?
- # HIC and HIT will be predefined if inliner is to be invoked due to
- # optimization level. In such a case, turn on the "safe_only" switch to
- # only inline those functions that the front-end has guaranteed are
- # called consistently.
- #if ?!-Hit= ?!-Hic= %; # If neither, then:
- ?$HIT ?!-g IARGS = $?IARGS -t $HIT
- ?$HIC ?!-g IARGS = $?IARGS -c $HIC
- #endif
- # Pascal can't handle INLINER
- -Hnoinline # Allow turning off inliner manually.
- #if ?$IARGS ?!$PDRV ?!-Hnoinline
- #if ?-g
- #print Inliner cannot be used with -g; inliner invocation suppressed.
- #else
- IARGS = -s 256 $IARGS %; # Don't inline fcns with stksize > 256.
- varfile2=%t3 %; ILfile2=%t4
- ?$INLCOM INLINER=$INLCOM
- #call check_com INLINER $HCDIR inl$0com
- # If multiple-module inlining, tell driver about it with -I.
- #if ?-Hiw
- INLINER+= $?INLINER_SUFFIX -I <source> $ILfile $ILfile2 $varfile $varfile2 $IARGS
- #else
- INLINER+= $?INLINER_SUFFIX %c.-Vi $varfile -Vo $varfile2 -i $ILfile -o $ILfile2 $IARGS
- #endif
- ILfile=$ILfile2 %; varfile = $varfile2
- #endif
- #endif
- #endif
-
- # Here define the compiler front and back-ends.
-
- ##### Front ends. #####
- ?!$HC1x -Hhc1com=? #call check_com HC1COM $HCDIR hc$1com %; \
- HC_FRONTEND=$HC1COM %; \
- HC1COM+=$?1SUFFIX %s $?CANSI $festuff_GOC $HCstuff -os $OS
- ?!$PP2x -Hpp1com=? #call check_com PP1COM $PPDIR pp$1com %; \
- PP1COM+=$?1SUFFIX $?PANSI $festuff_GOC $PPstuff -tfile $ptmp -os $OS
- -HZ? LFARGS= %; #foreach^ $~all>~?-HZ? ^ X LFARGS += -$X
- ?$LFDIR -Hftn1com=? #call check_com FTN1COM $LFDIR lf$1com %; \
- FTN1COM+=$?1SUFFIX %s $LF_stuff -ftndir $DRVPATH -mach $MACH $LFARGS -bdatatf $hc2tmp -drvname $DRVNAME -exe $exe
- -Hmf1com=? ?$MFDIR #call check_com MF1COM $MFDIR mf$1com %; \
- MF1COM+=$?1SUFFIX %s $festuff_GOC $MFstuff -os $OS
-
- #if ?!$LOC
- HCPP1COM=$HC1COM -cpp 2 -on fe_inlining -pt $HCDIR$bin/opc.pt -spt $HCDIR$bin/opcpre.pt
- # Outboard inliner doesn't support vartab 13 currently.
- ?-g HCPP1COM += -vartab 13
- # type checking for 370 is on for ESA, so use vartab 14.
- -Hcpp=? -Hcpplvl=? # Detect specification of cpp level so we can override cpp 2 above.
- # -Hcpp is obsolescent; replaced by -Hcpplvl.
- # If we specify -Hcpplvl with a C program, we need fe_inlining to support
- # C++ features.
- ?-Hcpp=? HC1COM+= -cpp $-Hcpp=? -on fe_inlining
- ?-Hcpp=? ?$HCPP1COM HCPP1COM+= -cpp $-Hcpp=?
- ?-Hcpplvl=? HC1COM+= -cpp $-Hcpplvl=? -on fe_inlining
- ?-Hcpplvl=? ?$HCPP1COM HCPP1COM+= -cpp $-Hcpplvl=?
- #endif
-
- ##### Back ends. #####
- -Hhc2com=? #call check_com HC2COM $HCDIR hc$2com
- # %c. is so that batch files for DOS start with $ILfile.
- ?-HX XFLAGS=-X$-HX?
- ?!$LOC HC2COM+=$?2SUFFIX %c.-i $ILfile -V $varfile -T \
- $hc2tmp -T $hc2tmp2 $?XFLAGS $?-g $bestuff -os $OS -efile \
- $efile
- ?$LFDIR -Hftn2com=? #call check_com FTN2COM $LFDIR hc$2com %; \
- # Just the names only, please.
- ?$MFDIR -Hmf2com=? #call check_com MF2COM $MFDIR hc$2com %; \
- # Just the names only, please.
- -Hpp2com=? #call check_com PP2COM $PPDIR hc$2com
- # Have the driver supply the temp file names to the LOC compilers.
- festuff_LOC+=-tmpi1 %t0 -tmpi2 %t1 -tmptp %t2
- ?$PP2x -Hppcom=? #call check_com PPCOM $PPDIR pp$loccom %; \
- PPCOM+=$?PANSI $festuff_LOC $PPstuff
- ?$HC1x -Hhccom=? #call check_com HCCOM $HCDIR hc$loccom %; \
- HCCOM+=$?CANSI $festuff_LOC $HCstuff
-
- #if ?$PFDIR # Do for Promula Fortran:
- PFTMP=$%t3
- -Hpfarg=? pfflags= %; #foreach^ $~sep,~~all>~?-Hpfarg=? ^X pfflags += $X
- -Hpf0com=? #call check_com PF0COM $PFDIR pfc %; \
- PF0COM+=%s O$PFTMP $pfflags
- -Hpf2com=? #call check_com PF2COM $HCDIR hc$2com %; \
- # Just the names only, please.
- ?!$HC1x -Hpf1com=? #call check_com PF1COM $HCDIR hc$1com %; \
- PF1COM+=$?1SUFFIX $PFTMP $?CANSI $festuff_GOC $HCstuff -os $OS
- ?$HC1x -Hpfcom=? #call check_com PFCOM $HCDIR hc$loccom %; \
- PFCOM+=$PFTMP -anno %s $?CANSI $festuff_LOC $HCstuff -iext " "
- ?$HCINC HCINC+=-I$PFDIR/lib
- ?$EXTRALIBS EXTRALIBS+=$PFDIR/lib/pfchc.lib
- #endif
-
- # Define xref; use either PP or HC directory, depending upon driver type.
- #if ?$XDRV
-
- Xname=xref$?exever
-
- ?$CDRV XREF=$HCDIR$bin/$Xname %s $XIEXT
- ?$PDRV XREF=$PPDIR/bin/$Xname $XIEXT
- ?$PP2x PPCOM+=-noobj
- ?$HC1x HCCOM+=-noobj
- #endif
-
- #########################################################################
- # Define assembler command (if not already defined)
- #########################################################################
- ?!$AS AS=-o %o $?asflags %s %; \
- #call pathsearch AS $TOOLSDIR/bin $?toolprefix$)as$?toolsuffix
-
- #########################################################################
- # Define LINKER command (if not already defined)
- #########################################################################
- # %o = user objects; %u = user-specified link options (e.g. -lm).
- ?-o? EXE=-o $-o?
- ?!=^$ENTRY^^ ldflags = $?ldflags -e $ENTRY %; # Add entry specification
- ?<^ $__minor ^ 8 ^ #call old_driver 1 0 8
-
- #if ?$DO_CPP ?!$TARGET_IS_MSDOS # No prelinking needed for MS-DOS.
- # If this is potentially a C++ program, we have to do special \
- processing
- # at link time. The prelinker is run, and if necessary generates a new
- # C module that calls any static initialization routines required by the
- # program. This new module must then be compiled and included in the \
- link.
- # Because of this additional processing, we have to define a couple
- # procedures to do the linking, instead of just letting the driver take
- # care of it like it would for a normal C program.
-
- # All prelinker arguments start with -HP
- # The prelinker also recognizes some of the standard ld options, such
- # as -L and -l. Those options that are not recognized and do not start
- # with -HP will be quietly ignored. Erroneous -HP arguments will produce
- # a warning from the prelinker.
- # P_SYS must be defined for each host, and must contain -HPS system
- # appropriate to that system. Current systems are SUN, VR3, VR4.
- # -HPu specifies that the compiler prepends an underscore onto external
- # names. The prelinker needs to know about this so it can properly
- # resolve symbols.
-
- PLARGS= %; # Pre-linker arguments
- -HPi # Announce location of initializer routines
- -HPD # debug level
- ?-HPi PLARGS+=-HPi
- ?-HPD PLARGS+=-HPD
- #proc PRELINKPROC
- PLINKDIR=$HCDIR$bin
- PLINK=prelink
- ?=^$TARG^sun4^ P_SYS=-HPS SUN -HPu \
- -HPF`+t`t.seg`s`qdata`q`n.align`t4`n \
- -HPF`iv(.globl`t`v;`v:`n`if(.word`t`f`n).word`t0`n) %; \
- use_as=1
- ?=^$TARG^sun3^ P_SYS=-HPS SUN -HPu
- ?=^$TARG^v386^ P_SYS=-HPS VR3
- ?=^$TARG^w386^ P_SYS=-HPS VR4
- ?=^$TARG^hob^ P_SYS=-HPS MW -HPu \
- -HPF`+t`tdata`nalign`t4`n \
- -HPF`iv(global`t`v;`v:`nsize`t`v,`c*4+4`n \
- -HPF`if(long`t`f`n)long`t0`n)eof`n %; use_as = 1
- ?=^$TARG^a370^ P_SYS=-HPS MW -HPu
- # This overrides the previous:
- ?=^$TARG^a370^ ?=^$MACH^esa370^ P_SYS=-HPS MW \
- -HPFLxxP0`tssect`n`tds`s0f`n`iv(`v`tequ`t*`+t`nentry`t`v`n \
- -HPF`if(extrn`t`f`ndc`tal4(`f)`n)dc`tal4(0)`n`-t`n)`tend`n %; \
- use_as = 1
- ?=^$TARG^w860^ P_SYS=-HPS MW
- ?=^$TARG^ 860^ P_SYS=-HPS MW -HPu \
- -HPF`+t`t.data`n.align`t4`n \
- -HPF`iv(.globl`t`v;`v:`n`if(.long`t`f`n).long`t0`n) %; \
- use_as=1
- ?!$P_SYS #exit C++ Prelinker arguments not set for this system
- P_OUT=$%t6
- PLINKARGS=-HPo $P_OUT.cpp $P_SYS $PLARGS
- PRELINKER=$PLINKDIR/$PLINK $PLINKARGS $START $?FSTART $%o $%u $?EXTRALIBS $LIBS $?END
- ?-native PRELINKER=$NATIVERUN $PRELINKER %; \
- # NATIVETOOLS not checked.
- #exec $PRELINKER
- # The prelinker returns 0 if it produced a C file that needs to be
- # compiled and linked. It returns non-zero if something went wrong.
- #if ?=^ $RETCODE ^ 0 ^
- # Compile or assemble $P_OUT.cpp
- #if ?$use_as
- asname= %; # Scan AS for assembler name:
- #foreach^ $OLDAS^X asname=$X %; #break
- ?-native asname=$NATIVERUN $asname
- #exec $asname -o $P_OUT.o $?asflags $P_OUT.cpp
- #else
- PCOMP=$DRIVER -c -Hnocopyr $P_OUT.cpp -o $P_OUT.o
- #exec :$PCOMP
- #endif
- PCRET=$RETCODE
- ?!=^ $PCRET ^ 0 ^ #exit Compilation failed
- PLOBJ=$P_OUT.o
- #endif
- #remove $P_OUT.cpp
- #endp
-
- #if ?!$LINKER
- LINKER=$?ldflags $START $?FSTART
- LINKFILES=$?EXTRALIBS $LIBS $?END $?EXE
- #call pathsearch LINKER $TOOLSDIR/bin $?toolprefix$ldname$?toolsuffix
- #endif
- #if ?!$LINKPROC_DEFINED
- #proc LINKPROC
- #call PRELINKPROC
- LINKER+=$?PLOBJ $%L $LINKFILES
- #exec $LINKER
- #remove $P_OUT.o
- #endp
- LINKPROC_DEFINED=yes
- #endif
-
- #else
- # Standard linker setup
- ?!$LINKER LINKER=$?ldflags $START $?FSTART %L $?EXTRALIBS $LIBS \
- $?END $?EXE %; \
- #call pathsearch LINKER $TOOLSDIR/bin $?toolprefix$ldname$?toolsuffix
-
- #endif # CPP_OK
-
- ############################################################################
- # Define outboard C preprocessor command (if not already defined)
- # Run cpp if -Hcpp specified, unless -Hnocpp specified.
- ############################################################################
- ?!$CPPEXE CPPEXE=$SYSLIB/cpp %; # Full path name of cpp.
- # >= version 1.7 of the driver we call CPP_PROC below; before, only HC could \
- have CPP.
- ?-Hcpp CPP=$CPPEXE %; ?<^ $__minor ^ 7 ^ CPP+=$?CPPHC
-
- #proc CPP_PROC Language infile outfile ifile_of_infile
- # If invoking CPP on assembler file, then assume an ASM_CPP_PROC
- # ?=^ $Language ^ ASM ^ #call ASM_CPP_PROC $infile $outfile \
- $ifile_of_infile %; # #return
- # $CPP now contains all the -Ds and the -I arguments.
- ADD=
- ?=^ $Language ^ HC ^ ADD=$HCINC $?CPPHC $?HCCINC
- ?=^ $Language ^ PP ^ ADD=$PPINC
- out=$outfile
- # Olivetti claims that you must pass -P to CPP to tell it not to
- # emit line control information.
- ?-P out=$ifile_of_infile %; ADD+=-P
- ?-E out= %; # If -E, output to stdout only.
- # System V CPP requires infile and outfile at end of list.
- #exec $CPP $?ADD $CPPOPTS $CPPDEFS $infile $out
- #endp
-
- # Tools running native on CPU?
- # Add any tools you also run native.
- # WARNING: If one back end is specified as native, all backends must be.
- # Thus it is not possible to have HC2COM in the list but not FTN2COM.
- NATIVETOOLS=HC1COM HCPP1COM HC2COM INLINER FTN1COM FTN2COM XREF
- ?$PRELINKPROC OLDAS=$AS %; # Prelinker needs old name of AS.
- ?-native #foreach^ $NATIVETOOLS ^ N ?$*N *N=$NATIVERUN $*N
-
- # Allow use of Eclipse's OS386 to run the unbound executables for HC LOC/GOC.
- ?$HOST_IS_MSDOS -os386 ?-os386 #foreach^ HC1COM HC2COM HCCOM INLINER \
- ^N ?$*N *N=:up $*N
-
- # If we specified to print branch profile info, do so and quit.
-
-