Bug 570 - configure in samba-3.0.0 ignores LDFLAGS environment variable
configure in samba-3.0.0 ignores LDFLAGS environment variable
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
All All
: P3 normal
: none
Assigned To: Tim Potter
: 663 785 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2003-10-05 19:24 UTC by MORIYAMA Masayuki
Modified: 2005-08-24 10:23 UTC (History)
2 users (show)

See Also:

The patch of configure.in (337 bytes, patch)
2003-10-05 19:27 UTC, MORIYAMA Masayuki
no flags Details
configure (923.84 KB, patch)
2004-05-12 00:12 UTC, momo
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description MORIYAMA Masayuki 2003-10-05 19:24:38 UTC
I executed the following command.

$ LD_LIBRARY_PATH=/opt/libiconv/lib \
LDFLAGS=-Wl,-rpath,/opt/libiconv/lib \
./configure --with-libiconv=/opt/libiconv
checking for iconv in /opt/libiconv... yes

checking can we convert from CP850 to UCS2-LE?... CP850
checking can we convert from ASCII to UCS2-LE?... ASCII
checking can we convert from UTF-8 to UCS2-LE?... UTF-8
checking for Linux kernel oplocks... yes
Using libraries:
    LIBS = -lcrypt -lresolv -lnsl -ldl   -liconv
    KRB5_LIBS = -L/usr/kerberos/lib  -lcom_err -lk5crypto -lcrypto -lkrb5 -lgssa
    LDAP_LIBS =  -llber -lldap
    AUTH_LIBS = -lcrypt 
checking configure summary... yes
configure: creating ./config.status
config.status: creating include/stamp-h
config.status: creating Makefile
config.status: creating script/findsmb
config.status: creating smbadduser
config.status: creating script/gen-8bit-gap.sh
config.status: creating include/config.h

LDFLAGS of Makefile which were created are as follows.

LDFLAGS= -L/opt/libiconv/lib -L/opt/libiconv/lib -L/usr/kerberos/lib

I wish the following setup.

LDFLAGS= -Wl,-rpath,/opt/libiconv/lib -L/opt/libiconv/lib -L/usr/kerberos/lib

I made patch.
Comment 1 MORIYAMA Masayuki 2003-10-05 19:27:52 UTC
Created attachment 180 [details]
The patch of configure.in
Comment 2 Gerald (Jerry) Carter 2003-11-06 09:24:04 UTC
This looks correct to me.  Applying it to the CVS tree.
Comment 3 Gerald (Jerry) Carter 2003-11-07 06:23:00 UTC
*** Bug 663 has been marked as a duplicate of this bug. ***
Comment 4 Gerald (Jerry) Carter 2003-11-17 08:12:57 UTC
not fixed apparently
Comment 5 Gerald (Jerry) Carter 2003-11-17 08:13:39 UTC
Additional comment:

The LDFLAGS aren't set properly when checking conversion

From my config.log

configure:19755: cc -o conftest -xarch=v9a -D__EXTENSIONS__ -I/usr/local/include
-I/usr/local/openldap/include -I/usr/local/sasl/include
-I/usr/local/kerberos/include -I/usr/local/BerkeleyDB.4.1/include
-I/usr/local/openssl/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/local/include -L/usr/local/lib/sparcv9 -L/usr/local/openldap/lib
-L/usr/local/sasl/lib -L/usr/local/kerberos/lib -L/usr/local/BerkeleyDB.4.1/lib
-L/usr/local/openssl/lib -R/usr/local/samba/lib -R/opt/samba/lib
-R\$$ORIGIN/../lib -R/usr/local/lib/sparcv9 -R/usr/local/openldap/lib
-R/usr/local/sasl/lib -R/usr/local/kerberos/lib -R/usr/local/BerkeleyDB.4.1/lib
-R/usr/local/openssl/lib -L/usr/local/lib conftest.c  -liconv >&5
configure:19758: $? = 0
configure:19761: test -s conftest
configure:19764: $? = 0
configure:19805: result: yes
configure:19849: checking can we convert from CP850 to UCS2-LE?
configure:19869: cc -o conftest -xarch=v9a -D__EXTENSIONS__ -I/usr/local/include
-I/usr/local/openldap/include -I/usr/local/sasl/include
-I/usr/local/kerberos/include -I/usr/local/BerkeleyDB.4.1/include
-I/usr/local/openssl/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/local/include -I/usr/local/include  -L/usr/local/lib conftest.c -lsec
-lgen -lresolv -lsocket -lnsl -ldl  -L/usr/local/lib -liconv >&5
ld: fatal: library -liconv: not found
ld: fatal: File processing errors. No output written to conftest

Note that the compile line for 

   checking can we convert from CP850 to UCS2-LE

is missing the proper LDFLAGS.
Comment 6 Gerald (Jerry) Carter 2003-11-17 08:13:54 UTC
*** Bug 785 has been marked as a duplicate of this bug. ***
Comment 7 Gerald (Jerry) Carter 2004-01-29 06:04:00 UTC
my stupid typo.
Comment 8 momo 2004-05-12 00:12:55 UTC
Created attachment 507 [details]
Comment 9 Gerald (Jerry) Carter 2005-08-24 10:23:37 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.