You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Tomo <sh...@yahoo.com> on 2002/12/18 01:10:43 UTC

libapreq for C only tests

My DSO module compiles ok with apxs...
gcc -DSOLARIS2=260 -DMOD_SSL=208101 -DEAPI -DEAPI_MM -DUSE_EXPAT
-I../lib/expat-lite -fpic -DSHARED_MODULE
-I/home/acunzoth/dump/Apache/include  -c mod_teldir.c
ld -G -o mod_teldir.so mod_teldir.o -lldap
# 
But when starting apache I get...
Cannot load /home/acunzoth/dump/Apache/libexec/mod_teldir.so into
server: ld.so.1: /sbclocal/web/run/pd/apache/1.3.19/bin/httpd: fatal:
relocation error: file
/home/acunzoth/dump/Apache/libexec/mod_teldir.so: symbol
ApacheRequest_new: referenced symbol not found

I thought it may be a linker problem...
# ld -G -o mod_teldir.so mod_teldir.o -lldap -lapreq
ld: fatal: library -lapreq: not found
ld: fatal: File processing errors. No output written to mod_teldir.so

I downloaded the libapreq-1.0 package and untar'd it. I'm not going to
use the perl. All I need is the C parts of this. I had only copied the
apache_request.* files to my apache include/ directory.

Is there something missing to get the C parts working?
I want to avoid recompiling apache.

My environment does not support 'make' or 'configure' without some
serious mess arounds.

Regards,
Tomo

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: libapreq for C only tests

Posted by "David N. Welton" <da...@dedasys.com>.
Here is what I do:

apache_multipart_buffer.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include -DTCL_THREADED=0 -c apache_multipart_buffer.c
apache_request.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include -DTCL_THREADED=0 -c apache_request.c
Output: apache_request.c:245: warning: `urlword_dlm' defined but not used
rivetChannel.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetChannel.c
rivetParser.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetParser.c
rivetCore.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetCore.c
mod_rivet.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c mod_rivet.c
Output: mod_rivet.c:93: warning: `sendMutex' defined but not used
TclWebapache.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c TclWebapache.c
mod_rivet.so :
        Command: gcc -pipe -shared -o mod_rivet.so apache_multipart_buffer.o apache_request.o rivetChannel.o rivetParser.o rivetCore.o mod_rivet.o TclWebapache.o -L/usr/lib -ltcl8.4 -ldl  -lieee -lm -lcrypt
rivetList.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetList.c
rivetCrypt.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetCrypt.c
rivetWWW.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetWWW.c
rivetPkgInit.o :
        Command: gcc -pipe -g -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC -I/usr/include/apache-1.3 -I/usr/include   -DTCL_THREADED=0 -c rivetPkgInit.c
librivet.so :
        Command: gcc -pipe -shared -o librivet.so rivetList.o rivetCrypt.o rivetWWW.o rivetPkgInit.o -L/usr/lib -ltcl8.4 -ldl  -lieee -lm -lcrypt

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

Re: libapreq for C only tests

Posted by Tomo <sh...@yahoo.com>.
I'm just using an include / header file to add to my apache module.

You avoid answering any of my direct questions. If you compiled files
together with special options and don't get linker errors you should
specify what you did. I put down what I had done in previous mails.

Using #Include apache_request.h with apxs compiles fine but apache does
not like it during startup.

Please don't chop off the trails as I want useful feedback on this.

--- "David N. Welton" <da...@dedasys.com> wrote:
> Tomo <sh...@yahoo.com> writes:
> 
> > I had first tried compiling them but didn't know to link them.  For
> > example I used the ldap api and linked it with: '-lldap' flag.
>  
> > What flag do I need to link libareq properley?
> 
> Well, if you are compiling it in directly (ie compiling the C files
> together with yours), you obviously don't need to link to the
> library.
> 
> > I thought it may be a linker problem...
> 
> I think you might want to check out a good book on C development.
> Unfortunately, I don't have any good recommendations that explain how
> to compile and link multiple files.
> 
> -- 
> David N. Welton
>    Consulting: http://www.dedasys.com/
>      Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
>    Apache Tcl: http://tcl.apache.org/


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: libapreq for C only tests

Posted by "David N. Welton" <da...@dedasys.com>.
Tomo <sh...@yahoo.com> writes:

> I had first tried compiling them but didn't know to link them.  For
> example I used the ldap api and linked it with: '-lldap' flag.
 
> What flag do I need to link libareq properley?

Well, if you are compiling it in directly (ie compiling the C files
together with yours), you obviously don't need to link to the library.

> I thought it may be a linker problem...

I think you might want to check out a good book on C development.
Unfortunately, I don't have any good recommendations that explain how
to compile and link multiple files.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

Re: libapreq for C only tests

Posted by Tomo <sh...@yahoo.com>.
Ok
I had first tried compiling them but didn't know to link them.
For example I used the ldap api and linked it with: '-lldap' flag.

What flag do I need to link libareq properley?

I thought it may be a linker problem...
# ld -G -o mod_teldir.so mod_teldir.o -lldap -lapreq
ld: fatal: library -lapreq: not found
ld: fatal: File processing errors. No output written to mod_teldir.so

Thanks, for you help.

Regards,
Tomo
--- "David N. Welton" <da...@dedasys.com> wrote:
> Tomo <sh...@yahoo.com> writes:
> 
> > "You aren't compiling in the apache_request* stuff."  I did not
> > compile anything when untaring the package.  Can you give me more
> > detail or example of the meaning?
> 
> I took the C sources, put them in the directory where I needed them,
> and compiled them, together with my other files that I wrote.  At
> that
> point, I use the linker to make a loadable shared object (.so) out of
> the whole mess.  Don't bother with the apreq build system, use your
> "own".
> 
> -- 
> David N. Welton
>    Consulting: http://www.dedasys.com/
>      Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
>    Apache Tcl: http://tcl.apache.org/


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: libapreq for C only tests

Posted by "David N. Welton" <da...@dedasys.com>.
Tomo <sh...@yahoo.com> writes:

> "You aren't compiling in the apache_request* stuff."  I did not
> compile anything when untaring the package.  Can you give me more
> detail or example of the meaning?

I took the C sources, put them in the directory where I needed them,
and compiled them, together with my other files that I wrote.  At that
point, I use the linker to make a loadable shared object (.so) out of
the whole mess.  Don't bother with the apreq build system, use your
"own".

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

Re: libapreq for C only tests

Posted by Tomo <sh...@yahoo.com>.
Hi Dave
"You aren't compiling in the apache_request* stuff."
I did not compile anything when untaring the package. 
Can you give me more detail or example of the meaning?

As for installing libapreq like in INSTALL notes..

I tried a make on the Makefile.noperl
(No Errors. What do I do now?)
# /Net/satools/tools/bin/.SunOS/.5.8/make
gcc -c `../../Apache/apxs -q CFLAGS` -I`../../Apache/apxs -q
INCLUDEDIR`  apache_request.c
gcc -c `../../Apache/apxs -q CFLAGS` -I`../../Apache/apxs -q
INCLUDEDIR`  apache_multipart_buffer.c
rm -rf libapreq.a
/usr/ccs/bin/ar cr libapreq.a apache_request.o apache_cookie.o
apache_multipart_buffer.o && : libapreq.a
chmod 755 libapreq.a
#

I also tried 'configure --with-apache-includes/blah/blah'
and ran make
....
gcc -shared  apache_cookie.lo apache_request.lo
apache_multipart_buffer.lo  -lc  -Wl,-soname -Wl,libapreq.so.1 -o
.libs/libapreq.so.1.0.0
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libapreq.so.1: cannot open file: No such file or
directory
ld: fatal: File processing errors. No output written to
.libs/libapreq.so.1.0.0
collect2: ld returned 1 exit status
make: *** [libapreq.la] Error 1

I just want to get my #include apache_request.h to work in module
without change my environment much.

Regards,
Tomo

--- "David N. Welton" <da...@dedasys.com> wrote:
> Tomo <sh...@yahoo.com> writes:
> 
> > My DSO module compiles ok with apxs...
> > gcc -DSOLARIS2=260 -DMOD_SSL=208101 -DEAPI -DEAPI_MM -DUSE_EXPAT
> > -I../lib/expat-lite -fpic -DSHARED_MODULE
> > -I/home/acunzoth/dump/Apache/include  -c mod_teldir.c
> > ld -G -o mod_teldir.so mod_teldir.o -lldap
> 
> You aren't compiling in the apache_request* stuff.
> 
> > Is there something missing to get the C parts working?
> 
> I use the C parts just fine with Apache Rivet - I just copy it over.
> I do my own compiles though, and only use apxs to query for compile
> information.
> 
> -- 
> David N. Welton
>    Consulting: http://www.dedasys.com/
>      Personal: http://www.dedasys.com/davidw/
> Free Software: http://www.dedasys.com/freesoftware/
>    Apache Tcl: http://tcl.apache.org/


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: libapreq for C only tests

Posted by "David N. Welton" <da...@dedasys.com>.
Tomo <sh...@yahoo.com> writes:

> My DSO module compiles ok with apxs...
> gcc -DSOLARIS2=260 -DMOD_SSL=208101 -DEAPI -DEAPI_MM -DUSE_EXPAT
> -I../lib/expat-lite -fpic -DSHARED_MODULE
> -I/home/acunzoth/dump/Apache/include  -c mod_teldir.c
> ld -G -o mod_teldir.so mod_teldir.o -lldap

You aren't compiling in the apache_request* stuff.

> Is there something missing to get the C parts working?

I use the C parts just fine with Apache Rivet - I just copy it over.
I do my own compiles though, and only use apxs to query for compile
information.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/