libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrong library path when building .deb package


From: Bill Moseley
Subject: Wrong library path when building .deb package
Date: Fri, 16 May 2003 11:23:46 -0700
User-agent: Mutt/1.5.3i

I'm using libtool to build swish-e.  Libtool builds libswish-e and then the 
swish-e
binary is linked against that.  

All works fine, for example I can build with a prefix and have the run-time 
linkages
correct:

   address@hidden:~/f$ ../swish-e/configure --prefix=$HOME/f2 >/dev/null \
                                           ^^^^^^^^^^^^^^^^^
                && make >/dev/null
                && make install >/dev/null

   address@hidden:~/f$ ldd ~/f2/bin/swish-e
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4001b000)
        libswish-e.so.2 => /home/moseley/f2/lib/libswish-e.so.2 (0x400fc000)
                           ^^^^^^^^^^^^^^^^^^^^
        libz.so.1 => /lib/libz.so.1 (0x40118000)
        libm.so.6 => /lib/libm.so.6 (0x40125000)
        libc.so.6 => /lib/libc.so.6 (0x40146000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Now, I've built swish-e before on my machine and so I also have libswish-e in 
/usr/local/lib (where it would normally be installed, of course).

Debian has a system to build .deb packages.  It's basically a makefile called 
"rules" and
it builds the package about the same way as above, but installs it into a 
directory to be
packaged up. 

The problem is when I build the package using the debian "rules" makefile I get 
the wrong
run-time linkages.  The debian build system sets --prefix=/usr, yet it's 
looking for
libswish-e in the wrong location:

Here's the binary build by the "rules" make file:

  address@hidden:~/b/swish-e-2.3.6/debian$ ldd swish-e/usr/bin/swish-e
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4001b000)
        libswish-e.so.2 => /usr/local/lib/libswish-e.so.2 (0x400fc000)
                           ^^^^^^^^^^^^^^
        libz.so.1 => /lib/libz.so.1 (0x40118000)
        libm.so.6 => /lib/libm.so.6 (0x40125000)
        libc.so.6 => /lib/libc.so.6 (0x40146000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

Why is that /user/local/lib instead of /usr/lib as set by the prefix?


Here's the bulk of the "rules" make file.  "binary" is the target that builds 
the .deb,
and all those dh_* programs just help setup the debian environment.

binary: binary-indep binary-arch

binary-arch: build install
        dh_testdir
        dh_testroot
        dh_installchangelogs
        dh_installdocs
        dh_installexamples
        dh_installman
        dh_link
        dh_strip
        dh_compress
        dh_fixperms
        dh_installdeb
        dh_shlibdeps
        dh_gencontrol
        dh_md5sums
        dh_builddeb


config.status: configure
        dh_testdir
        # Add here commands to configure the package.
        ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) 
--prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info

build: build-stamp

build-stamp:  config.status
        dh_testdir

        # Add here commands to compile the package.
        $(MAKE)
        #/usr/bin/docbook-to-man debian/swish-e.sgml > swish-e.1

        touch build-stamp

install: build
        dh_testdir
        dh_testroot
        dh_clean -k
        dh_installdirs

        # Add here commands to install the package into debian/swish-e.
        $(MAKE) install DESTDIR=$(CURDIR)/debian/swish-e




-- 
Bill Moseley
address@hidden





reply via email to

[Prev in Thread] Current Thread [Next in Thread]