Hi,

I guess I know what's the really problem is.

I think I should make my problem more clear. I used to use libutil.a libpthread.a 
libcops.a to make ReqMsg.cxx executable.  now I want to use COPS.cxx and
.h files (JNI layers)  to link a java program to call ReqMsg. so I modified a little 
of you Makefile to do it.

and after that in my java code, should i just load COPS
or I need to load cops, util, pthread too?

if i need to load all the libraries, the problem is I can't not ldd libutil and 
libpthread.so alone. it gives me alot of undefined symbol errors ..

from the lib size I can see libCOPS.so doesn't include the objects in libcops, 
libpthread or libutil.so.
-rwxr-xr-x    1 kwong    kwong      360429 Oct 31 14:55 libCOPS.so*
-rw-r--r--    1 kwong    kwong     6834356 Oct 29 13:44 libcops.a
-rwxr-xr-x    1 kwong    kwong     2352811 Oct 30 15:56 libcops.so*
-rw-r--r--    1 kwong    kwong      668698 Oct 30 12:07 libpthread.a
-rwxr-xr-x    1 kwong    kwong      243595 Oct 30 18:23 libpthread.so*
-rw-r--r--    1 kwong    kwong     6469118 Oct 29 18:27 libutil.a
-rwxr-xr-x    1 kwong    kwong     3061632 Oct 31 14:56 libutil.so*

Cheers,
Kason


______________________________________________________________

.SUFFIXES : .h .c .a .so .java .class

.a.so:
 ld -shared -o $*.so --whole-archive $<
 nm $*.so >$*.symbols

.java.class:
 true

#
# location of JVM we're linking to
#
# Sun's 1.2.2
#
JAVA_HOME=/usr/local/jdk1.2.2
JAVA_INC= -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
COPS_HOME=/home/kwong/vovida/cops1.0
COPS_INC= -I$(COPS_HOME)/policy/copsstack -I$(COPS_HOME)/util \
        -I$(COPS_HOME)/build
JAVAH=/usr/local/jdk1.2.2/bin/javah

#
# gcc configurable compile options
# -H list include header names
# -g debugging code enabled
GCCOPT= -g
LDOPT=-Xlinker -t -Xlinker -Map -Xlinker /tmp/linkmap -Xlinker -cref
GCCDEF=-DIP_SUPPORT -DUNIX
#
# Where the library.so file is written
#
LIBOUT=$(HOME)/thesis/codes/lib
#
# Carol's C api libraries in their converted form
# These start as .a files, I have to convert them to
# shareable .so files for JNI to access them.
#
JAPILIBS=\
  $(LIBOUT)/libutil.so
#  $(LIBOUT)/libjnat.so \
#  $(LIBOUT)/libjudpmsg.so  \
#  $(LIBOUT)/libjuser.so  \
#  $(LIBOUT)/libjvoip.so

APISOLIBS=

APILIBS=

LINKLIBS=-L$(LIBOUT) -lpthread  -lutil -lcops -lnat -lsystem -ludpmsg -luser -lvoip -lc
#
# Project's root directory
#
PROJ=$(HOME)/thesis/codes
#
# Project's source root and classpath root
#
SRC=$(PROJ)
CLASSES=$(PROJ)/jcops
#
# base name of the library
#
LIBNAME=libCOPS
#
# C Source files for gcc command
#
CSRC=$(SRC)/COPS.cxx
#
# Java Class files
#
JCLASSES= $(CLASSES)/*.class \
  $(CLASSES)/*.class
#
# all sources lib depends upon
#
ALLSRC= $(SRC)/*.h $(SRC)/*.c $(JCLASSES)

all: $(APISOLIBS) $(JAPILIBS) $(ALLSRC) $(CLASSES)/md5_sha1

$(LIBOUT)/libCOPS.so: \
  $(SRC)/jcops_JCOPSUI.h \
  $(SRC)/COPS.cxx \
  $(CLASSES)/*.class
 - rm -f $@
 @echo Creating $@...
 gcc $(GCCOPT) $(GCCDEF) $(JAVA_INC) $(COPS_INC) -I$(SRC) \
   $(LDOPT) \
   -shared -o $@ $(SRC)/COPS.cxx \
   $(LIBOUT)/lib*.so





----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to