Ken Moffat wrote:
> On Wed, May 30, 2012 at 04:55:40PM -0500, Bruce Dubbs wrote:

>> I'll try to create a dynamic udev library in my script.

OK, I was successful.  It was a bit tricky. First, the order of what is 
on the command line to link is significant.

Second, many of the programs are compiled with -fvisibility=hidden. 
that isn't good for shared libraries because I got a lot of undefined 
references.  I just turned that off.

Now, the question is what to install and where to install it.

The standard seems to be:

/lib/libudev.so.0.13.1
/lib/libudev.so.0   -> libudev.so.0.13.1
/usr/lib/libudev.so -> ../../lib/libudev.so.0.13.1
/usr/include/libudev.h
/usr/lib/libudev.la
/usr/lib/pkgconfig/libudev.pc

The first four are easy.

The pc file isn't too bad:

prefix=/usr
exec_prefix=/usr
libdir=/usr/lib
includedir=/usr/include

Name: libudev
Description: Library to access udev device information
Version: 182
Libs: -L${libdir} -ludev -lrt
Libs.private:
Cflags: -I${includedir}
-------------

The libdir looks OK, because I think it's looking for libudev.so.  I'm 
not sure what prefix and exec_prefix mean in this context.

The .la file is:

# libudev.la - a libtool library file
# Generated by libtool (GNU libtool) 2.4.2
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libudev.so.0'

# Names of this library.
library_names='libudev.so.0.13.1 libudev.so.0 libudev.so'

# The name of the static archive.
old_library=''

# Linker flags that can not go in dependency_libs.
inherited_linker_flags=''

# Libraries that this one depends upon.
dependency_libs=' -lrt'

# Names of additional weak libraries provided by this library
weak_library_names=''

# Version information for libudev.
current=13
age=13
revision=1

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/lib'

---------

Actually, in this case the file is NOT generated by libtool, but it 
looks OK.  I think the libdir is the same as the pc file in that it is 
looking for libudev.so.0.

I'll add these to the install.sh script.  I'll send a message, probably 
in a couple of hours about the new patch being available on 
www.linuxfromscratch.org.

   -- Bruce

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to