Re: cc command line arguments

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 28 May 1998 21:03:30 GMT
Message-ID: <3574d0a2.31418247_at_192.86.155.100>


A copy of this was sent to ron_at_nova.umuc.edu (Ron Maltz) (if that email address didn't require changing) On 28 May 1998 16:15:43 -0400, you wrote:

>We just upgraded to Oracle server 8.0.3 on a Sun Enterprise 3000 running
>Solaris 2.6. Now our attention is focused on PRO*C. The old cc command
>line arguments don't work with our new environment. The Oracle library and
>include directories have all changed. And the PRO*C book doesn't give a clue
>as to what is needed. Does anybody have the correct cc command line arguments
>that will compile a file processed through PRO*C under Solaris 2.6?
>
>Many thanks in advance.
>
>---------
>Ron Maltz
>UMUC Systems Staff
>ron_at_nova.umuc.edu

The makefile I like to use is fairly simple. It works with 7.0, 7.1, 7.2, 7.3 and 8.0. It is:



TARGET = programname
SOURCE = file1.pc file2.pc file3.pc

$(TARGET): $(SOURCE) $(SOURCE:.pc=.c) $(SOURCE:.pc=.o)

    $(CC) $(LDFLAGS) -t -o $(TARGET) \

        $(SOURCE:.pc=.o) -L$(ORACLE_HOME)/lib $(PROLDLIBS)

include $(ORACLE_PROC_MAKEFILE)

PROCFLAGS= ireclen=255 lines=yes include=$(ORACLE_HOME)/proc/lib PROFLAGS=$(PROCFLAGS) CFLAGS=-I. -g


You define TARGET, eg: TARGET = myprog , it will be the resulting binary.

You define SOURCE, eg: SOURCE = a.pc b.pc c.pc d.pc, it is a list of the .pc files that make up the application

You also define ORACLE_PROC_MAKEFILE it will be one of:

o70: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o71: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o72: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/proc/demo/proc.mk
o73: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/proc.mk
o8: setenv ORACLE_PROC_MAKEFILE $ORACLE_HOME/precomp/demo/proc/demo_proc.mk

The symbolic PROLDLIBS will give you all fo the libraries you need.

You can add your own libraries as needed to the link line either before or after PROLDLIBS.. Your CFLAGS are up to you, it shouldn't matter what ones you use...

I have PROCFLAGS and PROFLAGS in there because in 7.2 and before, the default rule for .pc to .c used PROFLAGS, in 7.3 and up they use PROCFLAGS.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu May 28 1998 - 23:03:30 CEST

Original text of this message