Re: make check on solaris failed to compile, had to edit a Makefile

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
2009/2/5 Christos Zoulas <[email protected]>:
> On Feb 5,  1:49pm, [email protected] (Knut Behrends) wrote:
> -- Subject: [freetds] make check on solaris failed to compile, had to edit a
>
> | To whom it may concern:
> |
> | I always got linker errors after trying to run make check
> |
> | /bin/bash ../../../libtool --tag=CC --mode=link gcc -D_REENTRANT
> | - -pthreads -g -O2 -Wdeclaration-after-statement -no-install -L../.libs
> | - -Wl,--rpath,../.libs -L/opt/unixodbc/lib -o t0001  t0001.o common.o
> | ../libsybdb.la ../../replacements/libreplacements.la -lnsl -lsocket
> | mkdir .libs
> | gcc -D_REENTRANT -pthreads -g -O2 -Wdeclaration-after-statement
> | - -Wl,--rpath -Wl,../.libs -o t0001 t0001.o common.o
> | - -L/opt/install/icdp/freetds-0.83.dev.20090104/src/dblib/.libs
> | - -L/opt/unixodbc/lib ../.libs/libsybdb.so
> | ../../replacements/.libs/libreplacements.a -lnsl -lsocket
> | - -R/opt/install/icdp/freetds-0.83.dev.20090104/src/dblib/.libs
> | - -R/opt/unixodbc/lib
> | /usr/ccs/bin/ld: illegal option -- rpath
> |
> | cd freetds-0.83.dev.20090104/src/<ctlib,dblib,tds,odbc>/unittests
> |
> |
> | Then I edited each Makefile and removed the --rpath option .
> | More specifically, I changed it the following way:
> |
> | # diff  Makefile.bak Makefile
> | 331c331
> | < AM_LDFLAGS = -no-install -L../.libs -Wl,--rpath,../.libs
> | - ---
> | > AM_LDFLAGS = -no-install -L../.libs -Wl,-R../.libs
> |
> | Then I was able to run make check. All files in the unittests directory
> | compiled.
> |
> | Maybe it's a bug/misconfiguration in the configure* scripts somewhere?
> | Just saying.
>
> I think it is more portable to use -Wl,-R than -Wl,--rpath.
>
> christos

Mmm... we use libtool so I think the better option would be to let
libtool do the job. Looking at help (see "./libtool --mode=link
--help")

...
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
...

so -R (not -Wl,-R, only -R) should be the best

freddy77
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.