automake causing linker to look in /usr/lib/.libs for file

automake causing linker to look in /usr/lib/.libs for file

Post by Brigitte Gagn » Thu, 19 Sep 2002 04:57:43



I hope I'm posting to the right group with this question. I appoligize
for the length, please let me know if you need more info. :)

My problem is that when I try to build (of my custom app), the linker
looks for the a lib (popt) in the wrong place. I have rpm 4.0.4 insalled
(and thus popt 1.6.4), redhat 7.2.

I have two subdirs of my application that both make use of the popt lib.
One works fine (if I specify the exact path to the library in my
Makefile.am), the other fails with a link error (below).

The "working" Makefile.am has:
LIBS    = -L/usr/lib -lCryptoki2 /usr/lib/libpopt.so -ldl

The other one has (it uses a few more dynamic libs):
LIBS    = -L/usr/lib /usr/lib/libpopt.so -lCryptoki2 -lssl -lcrypto
-lrpm -lrpmbuild -lrpmdb -lrpmio -ldl

First, you may ask why I am using the full path of hte popt lib in my
file. I ask this too --- but it works... in the first case. (Without the
full path it went looking in /usr/lib/./libs for libpopt.so).

When I do a make in the 'bad' dir, I get the following error:
 -L/usr/lib -lCryptoki2 -lssl -lcrypto /usr/lib/librpmbuild.so
/usr/lib/librpm.so /usr/lib/librpmdb.so /usr/lib/librpmio.so
/usr/lib/.libs/libpopt.so -L/usr/local/lib -lz -lbz2 -lrt -lpthread -ldl
-Wl,--rpath -Wl,/usr/local/lib
c++: /usr/lib/.libs/libpopt.so: No such file or directory

I've searched (grep) through all my files in the tree to references to
.lib to see where it could be getting this, but I couldn't find
anything. I've done several rounds of make clean, make distclean, then
redoing the autoconf/configure stuff. I'm not an automake/autoconf guru
my any means, but I am very frustrated that I haven't been able to
figure this out.

The only other clue that I have is that I have made a special popt
package that replaces the libpopt.so and popt.h files. When popt builds
(from the popt-1.6.4.tar.gz file), it puts its binaries in .libs. I copy
them from there during my make rpm with the following (sorry for the
ugliness, I'm unsure of a better way to do this). Is there something in
my RPM construction that is causing this? (You can see below that I have
also tried copying the files from the .libs dir before grabbing them for
packaging.)

Makefile.am excerpt
==============

RPM_PATH=/tmp/CITS-rpm
ROOT_PATH=$(RPM_PATH)/temp
LUNA_PATH=$(ROOT_PATH)

rpm:


   rm -rf $(RPM_PATH)
   mkdir -p $(LUNA_PATH)/lib
   mkdir -p $(LUNA_PATH)/include
   mkdir -p $(LUNA_PATH)/local/include
   #cp libs/libpopt.so.0.0.0 .
   #mv libpopt.so.0.0.0 $(LUNA_PATH)/lib
   cp .libs/libpopt.so.0.0.0 $(LUNA_PATH)/lib
  cp ./libs/libpopt.a .
   cp .libs/libpopt.la $(LUNA_PATH)/lib
   cp popt.h $(LUNA_PATH)/include
   cp popt.h $(LUNA_PATH)/local/include
   VER=1.6.4; \
   mv $(RPM_PATH)/temp "$(RPM_PATH)/popt-$$VER/" ; \
   cd $(RPM_PATH) ; \
   tar -czvf "./popt-$$VER.tar.gz" ./popt-"$$VER"/* ; \
   cp "./popt-$$VER.tar.gz" /usr/src/redhat/SOURCES/
   rpm -bb ./popt-rpm.spec

spec file excerpt:
===========

%prep

%setup

%build

%install
mkdir -p $RPM_BUILD_ROOT/%{_prefix}
mkdir -p $RPM_BUILD_ROOT/%{_prefix_h}
mkdir -p $RPM_BUILD_ROOT/%{_prefix_h2}
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.so.0.0.0
$RPM_BUILD_ROOT/%{_prefix}/libpopt.so.0.0.0
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.a
$RPM_BUILD_ROOT/%{_prefix}/libpopt.a
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.la
$RPM_BUILD_ROOT/%{_prefix}/libpopt.la
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/include/popt.h
$RPM_BUILD_ROOT/%{_prefix_h}/popt.h
install $RPM_BUILD_DIR/%{name}-%{sourced_version}/include/popt.h
$RPM_BUILD_ROOT/%{_prefix_h2}/popt.h

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

%post

%files
/usr/lib/libpopt.so.0.0.0
/usr/lib/libpopt.a
/usr/lib/libpopt.la
/usr/include/popt.h
/usr/local/include/popt.h

%postun

Any advice is appreciated.

 - Brigitte


 
 
 

automake causing linker to look in /usr/lib/.libs for file

Post by Brigitte Gagn » Thu, 19 Sep 2002 21:18:29


A bit more info I tried uninstalling my special popt package, then putting
the lib and header files in the expected locations (/usr/include and
/usr/lib) and now the problem described below is gone. Can anyone please
help me with my rpm?

Thanks,

Brigitte


> I hope I'm posting to the right group with this question. I appoligize
> for the length, please let me know if you need more info. :)

> My problem is that when I try to build (of my custom app), the linker
> looks for the a lib (popt) in the wrong place. I have rpm 4.0.4 insalled
> (and thus popt 1.6.4), redhat 7.2.

> I have two subdirs of my application that both make use of the popt lib.
> One works fine (if I specify the exact path to the library in my
> Makefile.am), the other fails with a link error (below).

> The "working" Makefile.am has:
> LIBS    = -L/usr/lib -lCryptoki2 /usr/lib/libpopt.so -ldl

> The other one has (it uses a few more dynamic libs):
> LIBS    = -L/usr/lib /usr/lib/libpopt.so -lCryptoki2 -lssl -lcrypto
> -lrpm -lrpmbuild -lrpmdb -lrpmio -ldl

> First, you may ask why I am using the full path of hte popt lib in my
> file. I ask this too --- but it works... in the first case. (Without the
> full path it went looking in /usr/lib/./libs for libpopt.so).

> When I do a make in the 'bad' dir, I get the following error:
>  -L/usr/lib -lCryptoki2 -lssl -lcrypto /usr/lib/librpmbuild.so
> /usr/lib/librpm.so /usr/lib/librpmdb.so /usr/lib/librpmio.so
> /usr/lib/.libs/libpopt.so -L/usr/local/lib -lz -lbz2 -lrt -lpthread -ldl
> -Wl,--rpath -Wl,/usr/local/lib
> c++: /usr/lib/.libs/libpopt.so: No such file or directory

> I've searched (grep) through all my files in the tree to references to
> .lib to see where it could be getting this, but I couldn't find
> anything. I've done several rounds of make clean, make distclean, then
> redoing the autoconf/configure stuff. I'm not an automake/autoconf guru
> my any means, but I am very frustrated that I haven't been able to
> figure this out.

> The only other clue that I have is that I have made a special popt
> package that replaces the libpopt.so and popt.h files. When popt builds
> (from the popt-1.6.4.tar.gz file), it puts its binaries in .libs. I copy
> them from there during my make rpm with the following (sorry for the
> ugliness, I'm unsure of a better way to do this). Is there something in
> my RPM construction that is causing this? (You can see below that I have
> also tried copying the files from the .libs dir before grabbing them for
> packaging.)

> Makefile.am excerpt
> ==============

> RPM_PATH=/tmp/CITS-rpm
> ROOT_PATH=$(RPM_PATH)/temp
> LUNA_PATH=$(ROOT_PATH)

> rpm:


>    rm -rf $(RPM_PATH)
>    mkdir -p $(LUNA_PATH)/lib
>    mkdir -p $(LUNA_PATH)/include
>    mkdir -p $(LUNA_PATH)/local/include
>    #cp libs/libpopt.so.0.0.0 .
>    #mv libpopt.so.0.0.0 $(LUNA_PATH)/lib
>    cp .libs/libpopt.so.0.0.0 $(LUNA_PATH)/lib
>   cp ./libs/libpopt.a .
>    cp .libs/libpopt.la $(LUNA_PATH)/lib
>    cp popt.h $(LUNA_PATH)/include
>    cp popt.h $(LUNA_PATH)/local/include
>    VER=1.6.4; \
>    mv $(RPM_PATH)/temp "$(RPM_PATH)/popt-$$VER/" ; \
>    cd $(RPM_PATH) ; \
>    tar -czvf "./popt-$$VER.tar.gz" ./popt-"$$VER"/* ; \
>    cp "./popt-$$VER.tar.gz" /usr/src/redhat/SOURCES/
>    rpm -bb ./popt-rpm.spec

> spec file excerpt:
> ===========

> %prep

> %setup

> %build

> %install
> mkdir -p $RPM_BUILD_ROOT/%{_prefix}
> mkdir -p $RPM_BUILD_ROOT/%{_prefix_h}
> mkdir -p $RPM_BUILD_ROOT/%{_prefix_h2}
> install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.so.0.0.0
> $RPM_BUILD_ROOT/%{_prefix}/libpopt.so.0.0.0
> install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.a
> $RPM_BUILD_ROOT/%{_prefix}/libpopt.a
> install $RPM_BUILD_DIR/%{name}-%{sourced_version}/lib/libpopt.la
> $RPM_BUILD_ROOT/%{_prefix}/libpopt.la
> install $RPM_BUILD_DIR/%{name}-%{sourced_version}/include/popt.h
> $RPM_BUILD_ROOT/%{_prefix_h}/popt.h
> install $RPM_BUILD_DIR/%{name}-%{sourced_version}/include/popt.h
> $RPM_BUILD_ROOT/%{_prefix_h2}/popt.h

> %clean
> [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT

> %post

> %files
> /usr/lib/libpopt.so.0.0.0
> /usr/lib/libpopt.a
> /usr/lib/libpopt.la
> /usr/include/popt.h
> /usr/local/include/popt.h

> %postun

> Any advice is appreciated.

>  - Brigitte




 
 
 

1. /usr/lib/gcc-lib/i386-linux and /usr/lib/gcc-lib/i486-linux

Hi Linuxers,

I just got a new copy of gcc-2.4.5 and source code of the pl11.
After having done the installation of gcc-2.4.5, I realised that
I have an extra directory: /usr/lib/gcc-lib/i386-linux.
The question is whether I need to keep the old gcc stuff under
the i386-linux.  I really like to clean it up so as to save 5.1
meg disk space (another poor Linux user  ;-( ).

Your answer is very appreciated.  Please send answer directly
to my address or the corresponding interest parties to reduce
the network load.  Thank you in advance.

Wing



2. COMMERCIAL: "Official" Red Hat 3.0.3 Linux Available.

3. /usr/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include/asm causing errors...

4. A tale of terrible .tar troubles...

5. Tell "configure" to use /usr/local/lib/sparcv9/ instead of /usr/local/lib/

6. Networking 2 linux boxes

7. /usr/openwin/lib/libtt.so vs /usr/dt/lib/libtt.so (and ttsession) ?

8. Help needed with soundcard setup under SUSE

9. linking /usr/local/lib/* to /usr/lib/

10. /usr/X386/lib/X11 <-> /usr/lib/X11

11. Shared libs in /usr/lib and elsewhere

12. can't load library /usr/lib/lib?????

13. Help - shared libs lib****.so.4 lib***.so.5