Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Combine OCI whitin a C Cartridge - Writing a Makefile

Re: Combine OCI whitin a C Cartridge - Writing a Makefile

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 06 Apr 1999 17:25:05 GMT
Message-ID: <370f4233.22900979@192.86.155.100>


A copy of this was sent to uri bargil <uri_at_trans-planet.com> (if that email address didn't require changing) On Tue, 06 Apr 1999 14:30:27 +0300, you wrote:

>Im writing a c cartridge in Oracle Application Server version 4.0.7.
>The data base is also oracle version 8.0
>The system is running on sun solaris 2.6 .
>I would like to combine OCI (Oracle Class Interface) into the c
>cartridge in order to make a connection to the database (oracle).
>In order to do it I have to create a Makefile.
>
>I receive an example , given here after but I still have some problems
>with it :
>=================================================================================
>
>DB_OHOME=/d01/oracle8
>ORACLE_HOME=DB_OHOME
>WEB_OHOME=/d02/oas4
>
>all: owarepl.so zlib/zlib.a
>
>cleanup:
> rm *.o zlib/*.a zlib/*.o
>
>include $(DB_OHOME)/rdbms/demo/demo_rdbms.mk
>
>OBJS = wrb.o utils.o startup.o heap.o \
> logon.o timing.o postqury.o \
> selinto.o ldimage.o cgienv.o \
> ociblock.o ocidesc.o owai.o \
> owassi.o getpage.o ssiblk.o \
> wrbio.o
>
>WEBINCL = $(WEB_OHOME)/ows/4.0/public
>DBINCL = $(DB_OHOME)/rdbms/demo
>CRYPTO = SSLeay-0.8.0/include
>
>zlib/zlib.a:
> (cd zlib; make -f Makefile.UNX)
>
>owarepl.so: $(OBJS) zlib/zlib.a owarepl.h
> echo ++++ We are expecting a series of WRB* warnings, its allright
>++++
> /usr/ccs/bin/ld -o $@ -G -B symbolic $(OBJS) \
> zlib/zlib.a SSLeay-0.8.0/libcrypto.a \
> -L$(DB_OHOME)/lib $(SSDBED) $(DEF_ON) $(OCISTATICLIBS)
> ( cd ../bin; mv ../src/owarepl.so . )
> echo ++++ We are expecting a series of WRB* warnings, its allright
>++++
>
>CFLAGS= -g -I. -I$(WEBINCL) -I$(DBINCL) -Wall -DERROR_BROKEN -I$(CRYPTO)
>
>===================================================================================
>
>When trying to compile it , the makefile doesn't recognize this files :
>wrb.o utils.o startup.o heap.o.
>
>What can be the problem ?
>
>Im using oracle example - formdata which creates the csamples.so
>How should I combine the formdata within the make file ?
>
>Thank you
>Uri

I'm sorry, i posted the original exapmle. OBJS=wrb.o utils.o.... is *MY* code for *MY* program. I thought you just wanted an example makefile from an existing application to show you how to link.

Let me try again:

# set this to your database Oracle Home DB_OHOME=/d01/oracle8
ORACLE_HOME=DB_OHOME # set this to the Oracle Home of your OAS install, probably different WEB_OHOME=/d02/oas4

# replace owarepl.so with YOUR cartridge name all: owarepl.so

# do "make cleanup" to get rid of your object code after you build # free space
cleanup:

    rm *.o

# this pulls in the demo oracle makefile to get the defines # for libs and such
include $(DB_OHOME)/rdbms/demo/demo_rdbms.mk

# replace this list of .o files with YOUR source code names # the makefile will automagically turn your .c into .o files OBJS = wrb.o utils.o startup.o heap.o

WEBINCL     =   $(WEB_OHOME)/ows/4.0/public
DBINCL      =   $(DB_OHOME)/rdbms/demo

# replace owarepl with YOUR name of YOUR program

owarepl.so: $(OBJS)

    echo ++++ We are expecting a series of WRB* warnings, its allright     /usr/ccs/bin/ld -o $@ -G -B symbolic $(OBJS) \     -L$(DB_OHOME)/lib $(SSDBED) $(DEF_ON) $(OCISTATICLIBS)     echo ++++ We are expecting a series of WRB* warnings, its allright

CFLAGS= -g -I. -I$(WEBINCL) -I$(DBINCL) -Wall  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

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



Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Apr 06 1999 - 12:25:05 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US