Configuring udev statically

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

 



Hello,

I'm trying to get udev to link statically to create an initramfs
image, but I can't get it to do it with the autoconf configure script.
 No matter what I do, ldd reports that the binaries are dynamically
linked.  Here's my configure line:

./configure --prefix=/home/ersin/vorpo_initramfs/usr
--exec-prefix=/home/ersin/vorpo_initramfs --sysconfdir=/etc
--enable-static --disable-shared

I've also tried:

LDFLAGS="-static" ./configure --prefix=/home/ersin/vorpo_initramfs/usr
--exec-prefix=/home/ersin/vorpo_initramfs --sysconfdir=/etc
--enable-static --disable-shared
CFLAGS="-static" ./configure --prefix=/home/ersin/vorpo_initramfs/usr
--exec-prefix=/home/ersin/vorpo_initramfs --sysconfdir=/etc
--enable-static --disable-shared
LDFLAGS="-static" CFLAGS="-static" ./configure
--prefix=/home/ersin/vorpo_initramfs/usr
--exec-prefix=/home/ersin/vorpo_initramfs --sysconfdir=/etc
--enable-static --disable-shared

Here's the result from using the first configure line:

ersin@basmati:~/vorpo_source/udev-138$ ./configure
--prefix=/home/ersin/vorpo_initramfs/usr
--exec-prefix=/home/ersin/vorpo_initramfs --sysconfdir=/etc
--enable-static --disable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 98304
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for xsltproc... /usr/bin/xsltproc
checking for inotify_init in -lc... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating udev/Makefile
config.status: creating udev/lib/Makefile
config.status: creating udev/lib/libudev.pc
config.status: creating rules/Makefile
config.status: creating extras/Makefile
config.status: creating extras/ata_id/Makefile
config.status: creating extras/cdrom_id/Makefile
config.status: creating extras/edd_id/Makefile
config.status: creating extras/path_id/Makefile
config.status: creating extras/firmware/Makefile
config.status: creating extras/collect/Makefile
config.status: creating extras/floppy/Makefile
config.status: creating extras/fstab_import/Makefile
config.status: creating extras/rule_generator/Makefile
config.status: creating extras/scsi_id/Makefile
config.status: creating extras/usb_id/Makefile
config.status: creating extras/volume_id/Makefile
config.status: creating extras/volume_id/lib/Makefile
config.status: creating extras/volume_id/lib/libvolume_id.pc
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

	udev 138
	========

	prefix:			/home/ersin/vorpo_initramfs/usr
	exec_prefix:		/home/ersin/vorpo_initramfs
	udev_prefix:		${exec_prefix}
	libdir_name:		lib
	datarootdir:		${prefix}/share
	mandir:			${datarootdir}/man
	includedir:		${prefix}/include

	logging:		yes
	debug:			no
	selinux:		no

	compiler:		gcc
	cflags:			-g -O2
	ldflags:		

	xsltproc:		/usr/bin/xsltproc


Here's a sample from what I see after I type make (note no static switch):

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -include
../../config.h -DSYSCONFDIR=\"/etc\"
-DUDEV_PREFIX=\"/home/ersin/vorpo_initramfs\" -D_LIBUDEV_COMPILATION
-g -O2 -MT libudev-device.lo -MD -MP -MF .deps/libudev-device.Tpo -c
libudev-device.c -o libudev-device.o
mv -f .deps/libudev-device.Tpo .deps/libudev-device.Plo

When I set LDFLAGS and/or CFLAGS to link statically, I get a similar
result except I see the -static switch come up, but whichever way I do
it ldd reports this:

ersin@basmati:~/vorpo_source/udev-138/udev$ ldd udevd
	linux-gate.so.1 =>  (0xb7fc8000)
	libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7e5e000)
	/lib/ld-linux.so.2 (0xb7fc9000)

I'm compiling on Debian Lenny with kernel 2.6.26 and gcc 4.3.  I've
also successfully linked statically with udev 125, which was the last
version before the configure script went over to autoconf.  For 125, I
passed USE_STATIC=true, but that doesn't seem to work anymore.  Any
ideas?

Thanks,
Ersin Akinci
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux