From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::HELP-GCC-REQUEST"  4-APR-1991 02:35:35.86
To:	ARISIA::EVERHART
CC:	
Subj:	Re: Problem Linking with GCC

From:	help-gcc-request@prep.ai.mit.edu@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.93)
	 id AA14453; Thu, 4 Apr 91 01:21:19 EST
Received: by life.ai.mit.edu (4.1/AI-4.10) id AA08741; Wed, 3 Apr 91 04:46:26 EST
Return-Path: <help-gcc-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA08715; Wed, 3 Apr 91 04:43:58 EST
Received: by tut.cis.ohio-state.edu (5.61-kk/5.910301)
	id AA09382; Wed, 3 Apr 91 04:41:48 -0500
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for help-gcc@prep.ai.mit.edu (help-gcc@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 3 Apr 91 08:00:26 GMT
From: sbcs!max!sss@louie.udel.edu  (Scott S. Snyder)
Organization: Institute for Theoretical Physics, SUNY at Stony Brook
Subject: Re: Problem Linking with GCC
Message-Id: <1991Apr3.080026.14947@max.physics.sunysb.edu>
References: <1991Mar31.170125.83@kahuna.asd-yf.wpafb.af.mil>, <31MAR91175955@eql.caltech.edu>
Sender: help-gcc-request@prep.ai.mit.edu
To: help-gcc@prep.ai.mit.edu

In newsgroup vmsnet.misc, article <1991Mar31.170125.83@kahuna.asd-yf.wpafb.af.mil>,\
 nieland_t@kahuna.asd-yf.wpafb.af.mil writes...
> Someone came to our DECUS LUG meeting asking about a problem with GCC.
> They are trying to write a DECWindows program and they are compiling the 
> program with GCC.  The program compiles fine, but when they go to link it,
> it reports lots of unresolved globals.
.. 
> The symbols it is complaining about are XALLOCNAMEDCOLOR_012C00X,
> XBLACKPIXELOFSCREEN_0A0160X, and others very similar.


As someone already mentioned, this is due to the case-hacking in GAS.
It is possible to turn off case-hacking by passing the `-h' flag to GAS.
(No, this isn't documented anywhere that I know of.)  However, the VMS
GCC driver doesn't allow passing arbitrary flags to GAS.  So I am including
below slightly modified versions of gcc.c, gcc.com, and gcc.cld.  These
recognize a qualifier `/GAS_OPTIONS' which works analogously to /CC1_OPTIONS.
Thus, to turn off case-hacking, you can say `gcc/gas_options="-h" file.c'.

However, if you are trying to use GCC to compile a program which uses Xt
you're going to be in for another nasty surprise:  in an Xt application, one
references the global class record for a widget; this is supposed pull in
the widget code at link time.  However, the VMS linker will not search
libraries for undefined C data references.  This has been discussed to death
recently, so suffice it to say that Digital's cc introduces the `globaldef'
and `globalref' keywords to solve this problem.  But GCC, as far as I can
tell, does not have anything similar.

Scott Snyder
sss@max.physics.sunysb.edu
snyder@d0hsa.fnal.gov

$! ------------------ CUT HERE -----------------------
$!
$! This archive created by VMS_SHARE Version 7.1-001  26-JUN-1989
$!   On  3-APR-1991 01:39:47.12   By user SNYDER 
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. GCC.C;6
$!       2. GCC.COM;3
$!       3. GCC.CLD;3
$!
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ if f$getsyi("version") .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete/nolog 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete/nolog 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");
buff:=CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(buff))
;LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(buff));g:=0;LOOP EXITIF MARK(NONE)=END_OF(buff);x:=
ERASE_CHARACTER(1);IF g = 0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x=
"V" THEN APPEND_LINE;MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;
IF x="+" THEN g:=1;ERASE_LINE;ENDIF;ELSE IF x="-" THEN g:=0;ENDIF;ERASE_LINE;
ENDIF;ENDLOOP;p:="`";POSITION(BEGINNING_OF(buff));LOOP r:=SEARCH(p,FORWARD);
EXITIF r=0;POSITION(r);ERASE(r);COPY_TEXT(ASCII(INT(ERASE_CHARACTER(3))));
ENDLOOP;o:=GET_INFO(COMMAND_LINE,"output_file");WRITE_FILE(buff,o);
ENDPROCEDURE;Unpacker;EXIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create/nolog 'f'
X/*
X *
X *`009A DCL driver for GNU "CC".  It accepts a CLD syntax identical to
X *`009VAX-11 "C".
X *
X *`009Since GCC consists of more than 1 pass we have to do the parsing
X *`009here and have a DCL Command (.COM) file do the real work -- so that
X *`009multiple images can be invoked WITHOUT having to resort to LIB$SPAWN.
X *
X *`009Modified by Scott Snyder (sss@max.physics.sunysb.edu): add /GAS_OPTION
VS qualifier
X */
X
Xchar *Input_Files`091100`093;`009`009/* Input file specifications */
Xchar *Defines`091100`093;`009`009/* /DEFINE specifications    */
Xchar *Includes`091100`093;`009`009/* /INCLUDE specifications   */
Xchar *Debug;`009`009`009/* /DEBUG specification`009     */
Xchar *Object;`009`009`009/* Object file name`009     */
Xint Optimize;`009`009`009/* Do optimized compile`009     */
Xint Machine_Code;`009`009/* Output assembly lang`009     */
Xint Verbose;`009`009`009/* Make noise while compiling*/
Xchar cc1_Options`091100`093;`009`009/* Options for the CC1 pass  */
Xchar gas_Options`091100`093;`009`009/* Options for the GAS pass  */
Xchar *Undefines`091100`093;`009`009/* /UNDEFINE specifications  */
X
X`012
X/*
X *`009Save a string in dynamic memory
X */
Xchar *savestr(String)
Xregister char *String;
X`123
X`009register char *cp,*New_String;
X
X`009/*
X`009 *`009Allocate it
X`009 */
X`009New_String = (char *)malloc(strlen(String)+1);
X`009/*
X`009 *`009Copy it
X`009 */
X`009cp = New_String;
X`009while((*cp++ = *String++) != 0) ;
X`009/*
X`009 *`009Return it
X`009 */
X`009return(New_String);
X`125
X
X`012
X/*
X *`009Do the parsing
X */
Xmain()
X`123
X`009register char *cp,*cp1;
X`009int i;
X`009char Temp`091256`093;   /* someone should check that we don't overrun! *
V/
X
X`009/*
X`009 *`009Get the Input files
X`009 */
X`009i = 0;
X`009while(cli_get_value("VCG$INPUT",Temp,sizeof(Temp)))
X`009`009`009`009Input_Files`091i++`093 = savestr(Temp);
X`009/*
X`009 *`009Do the /DEFINE qualifier
X`009 */
X`009if (cli_present("VCG$DEFINE")) `123
X`009`009i = 0;
X`009`009while(cli_get_value("VCG$DEFINE",Temp,sizeof(Temp))) `123
X`009`009`009`009`009Defines`091i++`093 = savestr(Temp);
X#ifdef`009notdef
X`009`009`009`009`009Euniceify(&Defines`091i-1`093);
X#endif`009notdef
X`009`009`125
X`009`125
X`009/*
X`009 *`009Do the /DEBUG qualifier
X`009 */
X`009if (cli_present("VCG$DEBUG")) `123
X`009`009/*
X`009`009 *`009Get the value (Default = ALL)
X`009`009 */
X`009`009if (!cli_get_value("VCG$DEBUG",Temp,sizeof(Temp)))
X`009`009`009strcpy(Temp,"ALL");
X`009`009/*
X`009`009 *`009Save it
X`009`009 */
X`009`009Debug = savestr(Temp);
X`009`125
X`009/*
X`009 *`009Do the "/INCLUDE_DIRECTORY" qualifier
X`009 */
X`009if (cli_present("VCG$INCLUDE")) `123
X`009`009i = 0;
X`009`009while(cli_get_value("VCG$INCLUDE",Temp,sizeof(Temp)))
X`009`009`009`009`009Includes`091i++`093 = savestr(Temp);
X`009`125
X`009/*
X`009 *`009Do the /MACHINE_CODE qualifier
X`009 */
X`009if (cli_present("VCG$MACHINE")) Machine_Code = 1;
X`009/*
X`009 *`009Do the /OBJECT qualifier
X`009 */
X`009if (cli_present("VCG$OBJECT")) `123
X`009`009cli_get_value("VCG$OBJECT",Temp,sizeof(Temp));
X`009`009Object = savestr(Temp);
X`009`125
X`009/*
X`009 *`009Do the /OPTIMIZE qualifier
X`009 */
X`009if (cli_present("VCG$OPTIM")) Optimize = 1;
X`009/*
X`009 *`009Do the /UNDEFINE qualifier
X`009 */
X`009if (cli_present("VCG$UNDEFINE")) `123
X`009`009i = 0;
X`009`009while(cli_get_value("VCG$UNDEFINE",Temp,sizeof(Temp))) `123
X`009`009`009`009`009Undefines`091i++`093 = savestr(Temp);
X#ifdef`009notdef
X`009`009`009`009`009Euniceify(&Undefines`091i-1`093);
X#endif`009notdef
X`009`009`125
X`009`125
X`009/*
X`009 *`009Do the /CC1_OPTIONS qualifier
X`009 */
X`009if (cli_present("VCG$CC1_OPTIONS"))
X`009`009cli_get_value("VCG$CC1_OPTIONS",cc1_Options,sizeof(cc1_Options));
X`009/*
X`009 *`009Do the /GAS_OPTIONS qualifier
X`009 */
X`009if (cli_present("VCG$GAS_OPTIONS"))
X`009`009cli_get_value("VCG$GAS_OPTIONS",gas_Options,sizeof(gas_Options));
X`009/*
X`009 *`009Do the /VERBOSE qualifier
X`009 */
X`009if (cli_present("VCG$VERBOSE")) Verbose = 1;
X`009/*
X`009 *`009Generate the command
X`009 */
X`009cp = Temp;
X
X`009/* Invoke the .COM file */
X`009cp1 = "@GNU_CC:`091000000`093GCC";
X`009while(*cp1) *cp++ = *cp1++;
X
X`009/* P1 = File to compile */
X`009*cp++ = ' ';
X`009cp1 = Input_Files`0910`093;
X`009while(*cp1) *cp++ = *cp1++;
X
X`009/* P2 = Options */
X`009*cp++ = ' ';
X`009if (Optimize `124`124 Debug `124`124 Machine_Code `124`124 Verbose) `123
X`009`009if (Optimize)*cp++ = 'O';
X`009`009if (Debug)*cp++ = 'D';
X`009`009if (Machine_Code)*cp++ = 'M';
X`009`009if (Verbose) *cp++ = 'V';
X`009`125 else `123
X`009`009*cp++ = '"';
X`009`009*cp++ = '"';
X`009`125
X
X`009/* P3 = Defines */
X`009*cp++ = ' ';
X`009*cp++ = '"';
X`009if (Defines`0910`093) `123
X`009`009cp1 = Defines`0910`093;
X`009`009while(*cp1) `123
X`009`009`009if (*cp1 == '"') *cp++ = '"';
X`009`009`009*cp++ = *cp1++;
X`009`009`125
X
X`009`009i = 1;
X`009`009while(Defines`091i`093) `123
X`009`009`009*cp++ = ',';
X`009`009`009cp1 = Defines`091i++`093;
X`009`009`009while(*cp1) `123
X`009`009`009`009if (*cp1 == '"') *cp++ = '"';
X`009`009`009`009*cp++ = *cp1++;
X`009`009`009`125
X`009`009`125
X`009`125
X`009*cp++ = '"';
X
X`009/* P4 = Undefines */
X`009*cp++ = ' ';
X`009*cp++ = '"';
X`009if (Undefines`0910`093) `123
X`009`009cp1 = Undefines`0910`093;
X`009`009while(*cp1) `123
X`009`009`009if (*cp1 == '"') *cp++ = '"';
X`009`009`009*cp++ = *cp1++;
X`009`009`125
X
X`009`009i = 1;
X`009`009while(Undefines`091i`093) `123
X`009`009`009*cp++ = ',';
X`009`009`009cp1 = Undefines`091i++`093;
X`009`009`009while(*cp1) `123
X`009`009`009`009if (*cp1 == '"') *cp++ = '"';
X`009`009`009`009*cp++ = *cp1++;
X`009`009`009`125
X`009`009`125
X`009`125
X`009*cp++ = '"';
X`009/* P5 = Include directories */
X`009*cp++ = ' ';
X`009*cp++ = '"';
X`009if (Includes`0910`093) `123
X`009`009cp1 = Includes`0910`093;
X`009`009while(*cp1) *cp++ = *cp1++;
X
X`009`009i = 1;
X`009`009while(Includes`091i`093) `123
X`009`009`009*cp++ = ',';
X`009`009`009cp1 = Includes`091i++`093;
X`009`009`009while(*cp1) *cp++ = *cp1++;
X`009`009`125
X`009`125
X`009*cp++ = '"';
X
X`009/* P6 = CC1 compilation phase options */
X`009cp1 = cc1_Options;
X`009*cp++ = ' ';
X`009*cp++ = '"';
X`009while(*cp1) *cp++ = *cp1++;
X`009*cp++ = '"';
X
X`009/* P7 = GAS compilation phase options */
X`009cp1 = gas_Options;
X`009*cp++ = ' ';
X`009*cp++ = '"';
X`009while(*cp1) *cp++ = *cp1++;
X`009*cp++ = '"';
X
X`009/*
X`009 *`009Do it
X`009 */
X`009lib_do_command(Temp, cp - Temp);
X`125
X
X`012
X/*
X *`009Execute the given DCL command
X */
Xlib_do_command(Text,Size)
Xchar *Text;
Xint Size;
X`123
X`009struct `123int Size; char *Ptr;`125 Descr;
X
X`009Descr.Ptr = Text;
X`009Descr.Size = Size;
X`009lib$do_command(&Descr);
X`125
X
X`012
X/************`009`009DCL PARSING ROUTINES`009`009**********/
X
X/*
X *`009See if "NAME" is present
X */
Xint cli_present(Name)
Xchar *Name;
X`123
X`009struct `123int Size; char *Ptr;`125 Descr;
X
X`009Descr.Ptr = Name;
X`009Descr.Size = strlen(Name);
X`009return((cli$present(&Descr) & 1) ? 1 : 0);
X`125
X
X/*
X *`009Get value of "NAME"
X */
Xint cli_get_value(Name,Buffer,Size)
Xchar *Name;
Xchar *Buffer;
X`123
X`009struct `123int Size; char *Ptr;`125 Descr1,Descr2;
X
X`009Descr1.Ptr = Name;
X`009Descr1.Size = strlen(Name);
X`009Descr2.Ptr = Buffer;
X`009Descr2.Size = Size-1;
X`009if (cli$get_value(&Descr1,&Descr2,&Descr2.Size) & 1) `123
X`009`009Buffer`091Descr2.Size`093 = 0;
X`009`009return(1);
X`009`125
X`009return(0);
X`125
X
X`012
X#ifdef`009notdef
X/*
X *`009TEMPORARY:  Fixup define/undefine strings for Eunice command line
X *`009`009`009processing
X */
XEuniceify(sp)
Xchar **sp;
X`123
X#define`009isupper(c) ((c >= 'A') && (c <= 'Z'))
X#define tolower(c) (c - 'A' + 'a')
X`009register char *cp,*cp1;
X`009char Local`091512`093;
X
X`009cp = *sp;
X`009cp1 = Local;
X`009while(*cp) `123
X`009`009if (isupper(*cp)) `123
X`009`009`009*cp1++ = '`094';
X`009`009`009*cp1 = tolower(*cp);
X`009`009`125 else `123
X`009`009`009*cp1 = *cp;
X`009`009`125
X`009`009cp++;
X`009`009cp1++;
X`009`125
X`009*cp1++ = 0;
X`009cp = (char *)malloc(strlen(Local)+1);
X`009strcpy(cp,Local);
X`009*sp = cp;
X`125
X#endif`009notdef
$ CALL UNPACK GCC.C;6 908934587
$ create/nolog 'f'
X$ Verifying:= 'f$verify(0)'
X$!
X$!`009GNU "CC" Compiler command file
X$!
X$!`009Invoked from the GCC compile driver via LIB$DO_COMMAND:
X$!`009`009P1 = File to compile
X$!`009`009P2 = Options: O - Optimize
X$!`009`009`009      D - Debug
X$!`009`009`009      M - Produce Machine Code
X$!`009`009`009      V - Be verbose during compilation
X$!`009`009P3 = "," separated Defines
X$!`009`009P4 = "," separated Undefines
X$!`009`009P5 = "," separated Include directories
X$!`009`009P6 = CC1 compilation phase options, including:
X$!`009`009`009-mdont-save-r2-r5`009(PCC style register saving)
X$!`009`009`009-mpcc-alignment`009`009(PCC style struct align)
X$!              P7 = GAS options
X$!
X$! Modified by Scott Snyder (sss@max.physics.sunysb.edu): add GAS options pa
Vrameter
X$!
X$!  Constants:
X$!
X$ Version:='f$trnlnm("GNU_CC_VERSION")'
X$ gcc_cpp="$GNU_CC:`091000000`093GCC-CPP"
X$ gcc_cc1="$GNU_CC:`091000000`093GCC-CC1"
X$ gcc_as= "$GNU_CC:`091000000`093GCC-AS ""-vGNU CC  V''Version'"""
X$!
X$!  Parse the options
X$!  -----------------
X$ P2_Length = f$length(P2)`009! So we only have to calculate it once
X$ Optimize = ""`009`009`009!    Default = No Optimize
X$ Debug = ""`009`009`009!    Default = No Debug
X$ Machine_Code = 0`009`009!    Default = No Machine Code
X$ Quiet = " -quiet"`009`009!    Default = Silent
X$ if f$locate("O",p2) .ne. P2_Length then Optimize = " -opt"
X$ if f$locate("D",p2) .ne. P2_Length then Debug = " ""-G"""
X$ if f$locate("M",p2) .ne. P2_Length then Machine_Code = 1
X$ if f$locate("V",p2) .ne. P2_Length then Quiet = ""
X$ Temp_File = ""`009`009! For Control_Y abort check
X$ On Control_Y then Goto Ctly_Abort
X$!
X$!`009Do the CC1 compilation phase options
X$!
X$ CC1_Options = P6
X$ Save_R2_R5 = ""
X$ if f$locate("-mdont-save-r2-r5",P6) .eq. f$length(P6) then goto 10$
X$ Save_R2_R5 = " -fcall-used-r2 -fcall-used-r3 -fcall-used-r4 -fcall-used-r5
V"
X$ l = f$locate("-mdont-save-r2-r5",P6)
X$ l1 = l + 17
X$ CC1_Options = "''f$extract(0,l,P6)'''f$extract(l1,255,P6)'"
X$ 10$:
X$ Alignment = " -mvaxc-alignment"
X$ if f$locate("-mpcc-alignment",P6) .eq. f$length(P6) then goto 20$
X$ Alignment = ""
X$ Alignment_Define = " ""-DPCC_ALIGNMENT"""
X$ l = f$locate("-mpcc-alignment",CC1_Options)
X$ l1 = l + 15
X$ CC1_Options = "''f$extract(0,l,CC1_Options)'''f$extract(l1,255,CC1_Options
V)'"
X$ 20$:
X$!
X$!  Do the filename (default to ".C")
X$!
X$ Filename:='p1'
X$ Extension:='f$parse(p1,,,"TYPE","SYNTAX_ONLY")'
X$ if Extension .eqs. "." then Filename:='p1'.C
X$!
X$!`009Do the object file
X$!
X$ Object_File:='f$parse(p1,,,"NAME","SYNTAX_ONLY")'
X$!
X$!`009Start the pre-processor invocation string
X$!
X$ cpp_args=""
X$!
X$!`009Do any defines
X$!
X$ inArg = p3
X$ if inArg .nes. "" then gosub parseList
X$!
X$!`009Do any undefines
X$!
X$ inArg = p4
X$ if inArg .nes. "" then gosub parseList
X$!
X$!`009Do any include directories
X$!
X$ Includes_Loop:
X$ if p5 .eqs. "" then goto Includes_Done
X$ l = f$locate(",",p5)
X$ l1 = l
X$ arg = f$extract(0,l,p5)
X$ l1 = l1 + 1
X$ p5 = f$extract(l1,255,p5)
X$ l = l + 5
X$ gosub doubleQuotes
X$ cpp_args = cpp_args + " ""-I" + arg + """"
X$ goto Includes_Loop
X$!
X$ Includes_Done:
X$!
X$!`009Calculate the Temp file name
X$!
X$ Temp_File:=GCC_'f$getjpi(0,"PID")'
X$!
X$!`009Do the "C" pre-processor
X$!
X$ if Quiet .eqs. "" then set verify
X$ gcc_cpp 'cpp_args''Alignment_Define' 'Filename' 'Temp_File'.CPP
X$ Status=$status
X$ l = 'f$verify(0)'
X$ if Status .nes. "%X00000001" then goto CPP_Error
X$!
X$!`009Do the "C" compilation
X$!
X$ Assembly_File:='Temp_File'.S
X$ if Machine_Code then Assembly_File:='Object_File'.S
X$ if Quiet .eqs. "" then set verify
X$ gcc_cc1 'Temp_File'.CPP'Quiet' -dumpbase 'Filename''Optimize''Debug' -mgnu
V 'CC1_Options''Save_R2_R5''Alignment' -o 'Assembly_File'
X$ Status=$status
X$ l = 'f$verify(0)'
X$ delete/nolog/noconfirm 'Temp_File'.CPP;
X$ if Status .nes. "%X00000001" then goto CC1_Error
X$!
X$!`009Do the assembly
X$!
X$ if Machine_Code then goto Exit
X$ if Quiet .eqs. "" then set verify
X$ gcc_as 'p7 'Temp_File'.S -o 'Object_File'.OBJ
X$ Status=$status
X$ l = 'f$verify(0)'
X$ delete/nolog/noconfirm 'Assembly_File';
X$ if Status .nes. "%X00000001" then goto Gas_Error
X$ goto Exit
X$!
X$!`009ERRORS:
X$!`009------
X$ Ctly_Abort:
X$ if Temp_File .eqs. "" then exit 4
X$
X$ Gas_Error:
X$ delete/nolog/noconfirm 'Temp_File'.OBJ;
X$ if verifying then set verify
X$ exit Status`009! Error in Assembly phase
X$ CC1_Error:
X$ delete/nolog/noconfirm 'Assembly_File';
X$ if verifying then set verify
X$ exit Status`009! Error in "C" Compilation phase
X$ CPP_Error:
X$ delete/nolog/noconfirm 'Temp_File'.CPP;
X$ if verifying then set verify
X$ exit Status`009! Error in "C" Pre-Processor phase
X$!
X$!`009Done
X$!
X$ Exit:
X$ if verifying then set verify
X$ exit 1
X$!
X$!`009Double up them double quotes
X$!
X$doubleQuotes:
X$ k = f$length(arg)
X$ if k .eq. 0 then goto noQuotes
X$ j = 0
X$ newArg = ""
X$ dq1$:
X$  c = f$extract(j,1,arg)
X$  if c .eqs. """" then newArg = newArg + """"
X$  newArg = newArg + c
X$  j = j+1
X$  if j .lt. k then goto dq1$
X$ arg = newArg
X$ noQuotes:
X$ return
X$!
X$!`009Parse a list of comma-separated tokens
X$!
X$!`009inArg = input string
X$!
X$parseList:
X$!echo = "write sys$output"
X$ DQUOTE = """"
X$ i = 0
X$ len = f$length(inArg)
X$ arg = ""
X$ 1$:
X$   if i .ge. len then goto noMoreDefines
X$   c = f$extract(i, 1, inArg)
X$   if c .eqs. DQUOTE then goto quotedString
X$   if c .eqs. "," then goto OneDefineDone
X$     arg = arg + c
X$     goto 4$
X$   quotedString:
X$     arg = arg + c
X$     i = i+1
X$     2$:
X$       if i .ge. len then goto noMoreDefines
X$       c = f$extract(i, 1, inArg)
X$       if c .nes. DQUOTE then goto 3$
X$       if f$extract(i+1, 1, inArg) .eqs. DQUOTE then goto 2a$
X$       arg = arg + c
X$       goto 4$
X$     2a$:
X$       arg = arg + c
X$       i = i+1
X$     3$:
X$       arg = arg + c
X$`009i = i+1
X$    goto 2$
X$    OneDefineDone:
X$      gosub doubleQuotes
X$!     echo "arg: ", arg
X$      cpp_args = cpp_args + " ""-D" + arg + """
X$      arg = ""
X$      goto 4$
X$    4$:
X$      i = i+1
X$      goto 1$
X$ noMoreDefines:
X$  if arg .eqs. "" then goto Defines_Done
X$  gosub doubleQuotes
X$! echo "arg: ", arg
X$  cpp_args = cpp_args + " " + DQUOTE + "-D" + arg + DQUOTE
X$!
X$ Defines_Done:
X$! echo "cpp_args: ", cpp_args
X$  return
$ CALL UNPACK GCC.COM;3 607727636
$ create/nolog 'f'
X!
X!`009Command language definition for GCC
X!`009(same as CC)
X!
X! Modified by Scott Snyder (sss@max.physics.sunysb.edu): add /GAS_OPTIONS qu
Valifier
X!
Xdefine type DEBUG_OPTIONS
X   keyword ALL
X   keyword NONE
X   keyword TRACEBACK
X      negatable
X   keyword SYMBOLS
X      negatable
Xdefine type MACHINE_LIST_OPTIONS
X   keyword INTERSPERSED
X   keyword AFTER
X   keyword BEFORE
Xdefine type PRECISION_OPTIONS
X   keyword SINGLE
X   keyword DOUBLE
Xdefine type SHOW_OPTIONS
X   keyword ALL
X   keyword NONE
X   keyword INCLUDE
X      negatable
X   keyword STATISTICS
X      negatable
X   keyword SYMBOLS
X      negatable
X   keyword SOURCE
X      negatable
X   keyword HEADER
X      negatable
X   keyword EXPANSION
X      negatable
X   keyword INTERMEDIATE
X      negatable
X   keyword BRIEF
X      negatable
X   keyword TERMINAL
X      negatable
X   keyword DICTIONARY
X      negatable
X   keyword TRANSLATION
X      negatable
Xdefine type STANDARD_OPTIONS
X   keyword ALL
X   keyword NONE
X   keyword PORTABLE
X      negatable
Xdefine type WARNING_OPTIONS
X   keyword ALL
X   keyword NONE
X   keyword NOINFORMATIONALS
X   keyword NOWARNINGS
Xdefine verb GCC
X   image GNU_CC:`091000000`093GCC.EXE
X   parameter P1 , label=VCG$INPUT , prompt="File"
X      value (required,list,type=$infile)
X   qualifier ANALYSIS_DATA , label=VCG$ANALYSIS_DATA_FILE
X      value (type=$outfile)
X      placement=positional
X   qualifier CROSS_REFERENCE , label=VCG$CROSS
X      placement=positional
X   qualifier DEFINE , label=VCG$DEFINE
X      value (list)
X      placement=positional
X   qualifier DEBUG , label=VCG$DEBUG
X      value (list,type=DEBUG_OPTIONS)
X      placement=positional
X   qualifier DIAGNOSTICS , label=VCG$PSE_FILE
X      value (type=$outfile)
X      placement=positional
X   qualifier G_FLOAT , label=VCG$G_FLOAT
X      placement=positional
X   qualifier INCLUDE_DIRECTORY , label=VCG$INCLUDE
X      value (required,list)
X      placement=positional
X   qualifier LIBRARY , label=VCG$LIBRARY
X      nonnegatable
X      placement=local
X   qualifier LIST , label=VCG$LISTING
X      batch
X      value (type=$outfile)
X      placement=positional
X   qualifier MACHINE_CODE , label=VCG$MACHINE
X      value (type=MACHINE_LIST_OPTIONS)
X      placement=positional
X   qualifier OBJECT , label=VCG$OBJECT
X      default
X      value (type=$outfile)
X      placement=positional
X   qualifier OPTIMIZE , label=VCG$OPTIM
X      default
X      value (list)
X      placement=positional
X   qualifier PRECISION , label=VCG$PRECISION
X      nonnegatable
X      value (required,type=PRECISION_OPTIONS)
X      placement=positional
X   qualifier SHOW , label=VCG$SHOW
X      nonnegatable
X      value (list,type=SHOW_OPTIONS)
X      placement=positional
X   qualifier STANDARD , label=VCG$CHECK
X      value (list,type=STANDARD_OPTIONS)
X      placement=positional
X   qualifier TRACE , label=VCG$DIAG
X      nonnegatable
X      value (list)
X      placement=positional
X   qualifier UNDEFINE , label=VCG$UNDEFINE
X      value (list)
X      placement=positional
X   qualifier VERBOSE, label=VCG$VERBOSE
X   qualifier WARNINGS , label=VCG$WARNING
X      default
X      value (list,type=WARNING_OPTIONS)
X      placement=positional
X   qualifier CC1_OPTIONS , label=VCG$CC1_OPTIONS
X      value (required)
X   qualifier GAS_OPTIONS , label=VCG$GAS_OPTIONS
X      value (required)
X   outputs(VCG$OBJECT,VCG$LISTING,VCG$PSE_FILE,VCG$ANALYSIS_DATA_FILE)
$ CALL UNPACK GCC.CLD;3 925904845
$ EXIT
