It seems to me that in addition to doing a strcmp to cc1, I would also have needed to do a strcmp to cccp. Can someone confirm that GCC 2.8.1 and GCC 3.4.6 differ in that respect - ie there was an extra executable (cccp) in GCC 2.8.1 when doing that task of converting from C to assember (ie compile only, no assembly)?
That sounds right. cccp was integrated into cc1 around 3.0.
Thanks.
If MVS has anything like a batch file or shell script, I think it would be easier to have the gcc driver print the commands that it wants to execute to a file. Then have a batch job run gcc and then run the commands the it prints out.
It uses JCL (example below that you may find amusing), and there is a 100-character limit on the parameter. So the way I get around that problem is to link gcc, cccp, and cc1 into a single executable, and let gcc call cccp and cc1 by executing a function that takes argc and argv as parameters, like this:
ret_code = toplev_main(cnt, commands[i].argv); BFN. Paul. //GCCGEN JOB CLASS=C,REGION=0K //* //* This example is for people who don't have a PROC installed //* in their installation. It compiles an example C program. //* //CCOMP PROC GCCPREF='GCC',PDPPREF='PDPCLIB',MEMBER='', // COS1='-Os -S -ansi -pedantic-errors', // COS2='-o dd:out -' //* //COMP EXEC PGM=GCC, // PARM='&COS1 &COS2' //STEPLIB DD DSN=&GCCPREF..LINKLIB,DISP=SHR //INCLUDE DD DSN=&PDPPREF..INCLUDE,DISP=SHR //SYSINCL DD DSN=&PDPPREF..INCLUDE,DISP=SHR //OUT DD DSN=&&TEMP,DISP=(,PASS),UNIT=SYSALLDA, // DCB=(LRECL=80,BLKSIZE=6160,RECFM=FB), // SPACE=(6160,(500,500)) //SYSIN DD DSN=&PDPPREF..SOURCE(&MEMBER),DISP=SHR //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=* //* //ASM EXEC PGM=ASMA90, // PARM='DECK,NOLIST', // COND=(4,LT,COMP) //SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR,DCB=BLKSIZE=32720 // DD DSN=&PDPPREF..MACLIB,DISP=SHR //SYSUT1 DD UNIT=SYSALLDA,SPACE=(CYL,(20,10)) //SYSUT2 DD UNIT=SYSALLDA,SPACE=(CYL,(10,10)) //SYSUT3 DD UNIT=SYSALLDA,SPACE=(CYL,(10,10)) //SYSPRINT DD SYSOUT=* //SYSLIN DD DUMMY //SYSGO DD DUMMY //SYSPUNCH DD DSN=&&OBJSET,UNIT=SYSALLDA,SPACE=(80,(4000,4000)), // DISP=(,PASS) //SYSIN DD DSN=&&TEMP,DISP=(OLD,DELETE) //* //LKED EXEC PGM=IEWL,PARM='MAP', // COND=((4,LT,COMP),(4,LT,ASM)) //SYSLIN DD DSN=&&OBJSET,DISP=(OLD,DELETE) // DD DDNAME=SYSIN //SYSIN DD DUMMY //SYSLIB DD DSN=&PDPPREF..NCALIB,DISP=SHR //SYSLMOD DD DSN=&&TEMPL(&MEMBER),DISP=(OLD,PASS) //SYSUT1 DD UNIT=SYSALLDA,SPACE=(CYL,(2,1)) //SYSPRINT DD SYSOUT=* // PEND //* //S1 EXEC PGM=IEFBR14 //DD1 DD DSN=&&TEMPL,DISP=(NEW,PASS),UNIT=SYSALLDA, // SPACE=(CYL,(1,1,44)),DCB=(RECFM=U,LRECL=0,BLKSIZE=6144) //* //S2 EXEC CCOMP,MEMBER='PDPTEST' //COMP.SYSIN DD * #include <stdio.h> int main(void) { printf("Greetings from Jujitsu ...\n"); printf("the makers of MVS/380 !!!\n"); return (0); } //LKED.SYSLMOD DD DSN=&&TEMPL(PDPTEST),DISP=(OLD,PASS) //* //S3 EXEC PGM=PDPTEST //STEPLIB DD DSN=&&TEMPL,DISP=(OLD,PASS) //SYSIN DD DUMMY //SYSPRINT DD SYSOUT=* //SYSTERM DD SYSOUT=* //* //