f



Switching make from Sun's cc to GNU's gcc ...

Hi guys,

Don't know if this is the best place for this topic,
if it isn't please redirect me to the right newsgroup.

I have installed Oracle 8.1.7, Pro*C and OCI on
a Unix machine, and I am trying to compile the
Pro*C program samples. I have a big problem
though: everything is set to the Sun default of
cc and CC. I only have the gnu tools, gcc and
g++, and I want to switch from Sun's set of tools
to GNU's.

I know I have to modify the following files
(and maybe there are others):

/usr/share/lib/make/make.rules
/usr/share/lib/make/svr4.make.rules

and the file sourced by demo_proc.mk:

${ORACLE_HOME}/precomp/lib/env_precomp.mk

I've changed in these files the following items:
CC=gcc
CCC=g++
CC_EXT=cxx
CPP=cxx

I also had to take out the -K PIC and -Xa
options as they are not recognized by the
gcc compiler.

But when I try and compile the samples
I get these error messages:

=======
bucuresti:/home/zamolxe/PRO_C> make -f demo_proc.mk sample2

make -f /u01/app/oracle/product/8.1.7/precomp/demo/proc/demo_proc.mk
OBJS=sample2.o EXE=sample2 build

gcc  -x     -I. -I/u01/app/oracle/product/8.1.7/precomp/public -I/u01/app/or
acle/product/8.1.7/rdbms/public -I/u01/app/oracle/product/8.1.7/rdbms/demo -
I/u01/app/oracle/product/8.1.7/plsql/public
-I/u01/app/oracle/product/8.1.7/network/public -DSLMXMX_ENABLE -DSLTS_ENABLE
 -D_REENTRANT -DUNIFIED_INTEL -DSOL_X86 -DSVR4 -Di386     -c sample2.c

gcc: language -I. not recognized
gcc: sample2.c: linker input file unused since linking not done

gcc -o sample2 sample2.o -L/u01/app/oracle/product/8.1.7/lib/ -lclntsh
`cat /u01/app/oracle/product/8.1.7/lib/sysliblist`  `if [ "SOL" = "SOL" ];
then echo "-laio" ;
else echo "" ; fi`    -lm -lthread

gcc: sample2.o: No such file or directory
*** Error code 1

make: Fatal error: Command failed for target `build'

Current working directory /home/zamolxe/PRO_C
*** Error code 1
make: Fatal error: Command failed for target `sample2'
=======

Somehow I get the '-x' after gcc, and I don't
know where that '-x' is coming from, I know it
is supposed to be the language option, like c
or cpp, but I can't find it where it's set so
I can get rid of it or correct it.

Thank you,
Gerula.



0
gerula (1)
6/24/2003 2:37:33 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (350) is leader. Post Follow

4 Replies
880 Views

Similar Articles

[PageSpeed] 32

llewelly <llewelly.at@xmission.dot.com> wrote:
>> gcc  -x     -I. -I/u01/app/oracle/product/8.1.7/precomp/public
>> -I/u01/app/or

> For other compilers -x has a quite different meaning. You'll
>     have to read the sun cc man page to figure out what it does - oh,
>     wait, without the package you won't have the man page. Hm. Scour
>     sun's site for online documentation of sun cc, and find out what
>     -x does for it. Then read the gcc docs at gcc.gnu.org/onlinedocs
>     for an equivalent flag. Finally, look for a variable like CFLAGS
>     to set, or edit the makefiles appropriately.

> You could also try just removing the '-x' flag. Maybe that will
>     work. I don't know.

it tells the compiler to store debug-information in the executable, making
it more self-contained.  One side-effect is that it fixes a bug/feature of
the linker, allowing it to chain shared libraries.  The equivalent of that
in gcc is to use the rpath option.

(the Solaris manpage isn't very clear anyway - should probably be rewritten)

-- 
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com
0
Thomas
6/25/2003 1:57:29 PM
llewelly wrote:
> "Gerula" <gerula@sympatico.ca> writes:
[snip]
> Often a makefile variable, possibly in a .rules files, typically named
>     CFLAGS is used for things like this. If you have xargs, you could
>     use something like this:
> 
>     $ find . -type f -name '*akefile*' -print | xargs grep -n -C 'CFLAGS.*='
> 
>     to find all assignments to CFLAGS.
> 
>     if you don't have xargs, use this:
> 
>     $ find . -type f -name '*akefile*' -exec grep -n -C 'CFLAGS.*=' {} \;
> 

I get an error for the -C option of grep,
what is it for? I have only GNU tools, so
my make has only a -c option and not a -C
option.

Thank you,
Gerula
0
Gerula
6/28/2003 11:35:46 AM
llewelly wrote:
> "Gerula" <gerula@sympatico.ca> writes:
[snip]
> > Somehow I get the '-x' after gcc, and I don't
> > know where that '-x' is coming from,
> 
> Often a makefile variable, possibly in a .rules files, typically named
>     CFLAGS is used for things like this. If you have xargs, you could
>     use something like this:
> 
>     $ find . -type f -name '*akefile*' -print | xargs grep -n -C 'CFLAGS.*='
> 
>     to find all assignments to CFLAGS.
> 
>     if you don't have xargs, use this:
> 
>     $ find . -type f -name '*akefile*' -exec grep -n -C 'CFLAGS.*=' {} \;
[snip]

I get an error for the -C option,
my grep has only a -c option, for
count, I only have GNU tools, maybe
this is for Sun's grep- what does 
it do?

Thank you,
Gerula.
0
Gerula
6/28/2003 11:58:19 AM
Gerula <gerula@sympatico.ca> writes:

> llewelly wrote:
>> "Gerula" <gerula@sympatico.ca> writes:
> [snip]
>> Often a makefile variable, possibly in a .rules files, typically named
>>     CFLAGS is used for things like this. If you have xargs, you could
>>     use something like this:
>> 
>>     $ find . -type f -name '*akefile*' -print | xargs grep -n -C 'CFLAGS.*='
>> 
>>     to find all assignments to CFLAGS.
>> 
>>     if you don't have xargs, use this:
>> 
>>     $ find . -type f -name '*akefile*' -exec grep -n -C 'CFLAGS.*=' {} \;
>> 
>
> I get an error for the -C option of grep,
> what is it for?

Context. The two lines preceeding and the two lines following the
    match are also printed. You could leave it out.

> I have only GNU tools,

Weird - I tested those examples with gnu grep 2.4d . Maybe you could
    try '-C 2' instead ?

> so
> my make has only a -c option and not a -C
> option.

Make? I thought we were talking about grep ?
0
llewelly
6/28/2003 6:19:27 PM
Reply: