can"t seem to statically link DBD-mysql against libmysqlclient.a

can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 00:58:26 von jason

howdy

I'm using DBD-mysql-2.1011, perl 5.005_003 (same problem on 5.6)

here's my command line:

perl Makefile.PL LIB=/opt/foo PREFIX=/opt/foo "--libs=../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm" "--cflags=-I../pathto/include -I../pathto/otherinclude"

and it tells me this:

....

cflags (Users choice) = -I../pathto/include -I../pathto/otherinclude
libs (Users choice) = ../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm
nocatchstderr (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testuser (default ) =

....

Unrecognized argument in LIBS ignored: './pathto/libmysqlclient.a'


I've also tried absolute paths, no luck. What am I missing?

--
Jason Burnett
jason@jnj.org
~ No witty signature available at this time ~

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1845@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 05:48:53 von kip

You need to use '--libs=-L./path -lmysqlclient'
You didn't see the -L

On Wed, 3 Jul 2002, Jason wrote:

> howdy
>
> I'm using DBD-mysql-2.1011, perl 5.005_003 (same problem on 5.6)
>
> here's my command line:
>
> perl Makefile.PL LIB=/opt/foo PREFIX=/opt/foo "--libs=../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm" "--cflags=-I../pathto/include -I../pathto/otherinclude"
>
> and it tells me this:
>
> ...
>
> cflags (Users choice) = -I../pathto/include -I../pathto/otherinclude
> libs (Users choice) = ../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm
> nocatchstderr (default ) = 0
> testdb (default ) = test
> testhost (default ) =
> testpassword (default ) =
> testuser (default ) =
>
> ...
>
> Unrecognized argument in LIBS ignored: './pathto/libmysqlclient.a'
>
>
> I've also tried absolute paths, no luck. What am I missing?
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1846@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 05:48:53 von kip

You need to use '--libs=-L./path -lmysqlclient'
You didn't see the -L

On Wed, 3 Jul 2002, Jason wrote:

> howdy
>
> I'm using DBD-mysql-2.1011, perl 5.005_003 (same problem on 5.6)
>
> here's my command line:
>
> perl Makefile.PL LIB=/opt/foo PREFIX=/opt/foo "--libs=../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm" "--cflags=-I../pathto/include -I../pathto/otherinclude"
>
> and it tells me this:
>
> ...
>
> cflags (Users choice) = -I../pathto/include -I../pathto/otherinclude
> libs (Users choice) = ../pathto/libmysqlclient.a -lz -lnsl -lcrypt -lm
> nocatchstderr (default ) = 0
> testdb (default ) = test
> testhost (default ) =
> testpassword (default ) =
> testuser (default ) =
>
> ...
>
> Unrecognized argument in LIBS ignored: './pathto/libmysqlclient.a'
>
>
> I've also tried absolute paths, no luck. What am I missing?
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1846@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:07:55 von jason

On Wed, Jul 03, 2002 at 11:48:53PM -0400, Kip C. Lubliner wrote:
> You need to use '--libs=-L./path -lmysqlclient'
> You didn't see the -L
>

that does dynamic linking. I want to link statically. In a normal make
environment, if you want dynamic linking, you do:

cc object1.o object2.o -o program -lsomelib

whereas if you want to link statically, you do:

cc object1.o object2.o /path/to/libsomelib.a -o program

I ended up having to use a hacked up copy of ExtUtils/MM_unix.pm from the
standard perl library to get it to work. There doesn't seem to be a way to do
it with recent versions of makemaker...

--
Jason Burnett
jason@jnj.org
~ No witty signature available at this time ~

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1847@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:07:55 von jason

On Wed, Jul 03, 2002 at 11:48:53PM -0400, Kip C. Lubliner wrote:
> You need to use '--libs=-L./path -lmysqlclient'
> You didn't see the -L
>

that does dynamic linking. I want to link statically. In a normal make
environment, if you want dynamic linking, you do:

cc object1.o object2.o -o program -lsomelib

whereas if you want to link statically, you do:

cc object1.o object2.o /path/to/libsomelib.a -o program

I ended up having to use a hacked up copy of ExtUtils/MM_unix.pm from the
standard perl library to get it to work. There doesn't seem to be a way to do
it with recent versions of makemaker...

--
Jason Burnett
jason@jnj.org
~ No witty signature available at this time ~

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1847@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:12:50 von kip

You must create a dynamicly loadable file for DynaLoader to work. If you
want to create a staticly linked file, you must recompile perl. And thats
a pain.

If you have a libmysqlclient.a, you can create a dynamically loadable
mysql.so and have that work. It worked for me, in any case.

On Wed, 3 Jul 2002, Jason wrote:

> On Wed, Jul 03, 2002 at 11:48:53PM -0400, Kip C. Lubliner wrote:
> > You need to use '--libs=-L./path -lmysqlclient'
> > You didn't see the -L
> >
>
> that does dynamic linking. I want to link statically. In a normal make
> environment, if you want dynamic linking, you do:
>
> cc object1.o object2.o -o program -lsomelib
>
> whereas if you want to link statically, you do:
>
> cc object1.o object2.o /path/to/libsomelib.a -o program
>
> I ended up having to use a hacked up copy of ExtUtils/MM_unix.pm from the
> standard perl library to get it to work. There doesn't seem to be a way to do
> it with recent versions of makemaker...
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1848@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:12:50 von kip

You must create a dynamicly loadable file for DynaLoader to work. If you
want to create a staticly linked file, you must recompile perl. And thats
a pain.

If you have a libmysqlclient.a, you can create a dynamically loadable
mysql.so and have that work. It worked for me, in any case.

On Wed, 3 Jul 2002, Jason wrote:

> On Wed, Jul 03, 2002 at 11:48:53PM -0400, Kip C. Lubliner wrote:
> > You need to use '--libs=-L./path -lmysqlclient'
> > You didn't see the -L
> >
>
> that does dynamic linking. I want to link statically. In a normal make
> environment, if you want dynamic linking, you do:
>
> cc object1.o object2.o -o program -lsomelib
>
> whereas if you want to link statically, you do:
>
> cc object1.o object2.o /path/to/libsomelib.a -o program
>
> I ended up having to use a hacked up copy of ExtUtils/MM_unix.pm from the
> standard perl library to get it to work. There doesn't seem to be a way to do
> it with recent versions of makemaker...
>
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1848@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:23:04 von jason

On Thu, Jul 04, 2002 at 12:12:50AM -0400, Kip C. Lubliner wrote:
> You must create a dynamicly loadable file for DynaLoader to work. If you
> want to create a staticly linked file, you must recompile perl. And thats
> a pain.
>
> If you have a libmysqlclient.a, you can create a dynamically loadable
> mysql.so and have that work. It worked for me, in any case.
>

right, the second one is what I want. I could find no way to get makemaker
to let me supply libmysqlclient.a as an object to link into mysql.so.

The MM_unix hack works fine, but it obviously wasn't a simple solution :)

--
Jason Burnett
jason@jnj.org
~ No witty signature available at this time ~

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1849@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: can"t seem to statically link DBD-mysql against libmysqlclient.a

am 04.07.2002 06:23:04 von jason

On Thu, Jul 04, 2002 at 12:12:50AM -0400, Kip C. Lubliner wrote:
> You must create a dynamicly loadable file for DynaLoader to work. If you
> want to create a staticly linked file, you must recompile perl. And thats
> a pain.
>
> If you have a libmysqlclient.a, you can create a dynamically loadable
> mysql.so and have that work. It worked for me, in any case.
>

right, the second one is what I want. I could find no way to get makemaker
to let me supply libmysqlclient.a as an object to link into mysql.so.

The MM_unix hack works fine, but it obviously wasn't a simple solution :)

--
Jason Burnett
jason@jnj.org
~ No witty signature available at this time ~

------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1849@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.