From db5c7b0f324c9a029eee9518b6acd60b21e556a7 Mon Sep 17 00:00:00 2001 From: Marc Andre Tanner Date: Sat, 27 Feb 2010 00:29:31 +0100 Subject: [PATCH] Link qi-bootmenu statically by default Signed-off-by: Marc Andre Tanner --- config | 8 ++++++-- sources/sections/busybox.sh | 6 +++++- sources/sections/ecore.sh | 2 +- sources/sections/eet.sh | 2 +- sources/sections/eina.sh | 4 ++-- sources/sections/evas.sh | 4 ++-- sources/sections/freetype.sh | 2 +- sources/sections/kexec-tools.sh | 8 ++++++-- sources/sections/libjpeg.sh | 2 +- sources/sections/libpng.sh | 2 +- sources/sections/qi-bootmenu.sh | 4 ++-- sources/sections/tslib.sh | 4 ++-- sources/sections/zlib.sh | 2 +- 13 files changed, 31 insertions(+), 19 deletions(-) diff --git a/config b/config index 317c514..0ee59b3 100644 --- a/config +++ b/config @@ -4,13 +4,17 @@ # own version, or to set these as environment variables on the command line. # Specify Openmoko device to build for (GTA01 or GTA02 which is the default). + # export MACHINE=GTA02 -# Build qi-bootmenu statically and don't install the shared libraries -# in the resulting initramfs. +# Link all executables (busybox, kexec, dropbear statically) # export STATIC=1 +# Link qi-bootmenu against shared libraries + +# export QI_BOOTMENU_SHARED=1 + # Build with debug flags # export DEBUG=1 diff --git a/sources/sections/busybox.sh b/sources/sections/busybox.sh index 421f645..b217966 100644 --- a/sources/sections/busybox.sh +++ b/sources/sections/busybox.sh @@ -1,6 +1,10 @@ setupfor busybox -make allnoconfig KCONFIG_ALLCONFIG="$CONFIG_DIR/miniconfig-busybox" && +cp "$CONFIG_DIR/miniconfig-busybox" config + +[ ! -z "$STATIC" ] && echo CONFIG_STATIC=y >> config + +make allnoconfig KCONFIG_ALLCONFIG="config" && cp .config "$CONFIG_DIR/config-busybox" && diff --git a/sources/sections/ecore.sh b/sources/sections/ecore.sh index ea0ff59..cf9bf03 100644 --- a/sources/sections/ecore.sh +++ b/sources/sections/ecore.sh @@ -43,7 +43,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libecore*.so* $ROOT_DIR/usr/lib || dienow fi diff --git a/sources/sections/eet.sh b/sources/sections/eet.sh index 3db9f0f..0271e7c 100644 --- a/sources/sections/eet.sh +++ b/sources/sections/eet.sh @@ -21,7 +21,7 @@ sed -i 's/^link_all_deplibs=no$/link_all_deplibs=unknown/g' libtool make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libeet.so* $ROOT_DIR/usr/lib || dienow fi diff --git a/sources/sections/eina.sh b/sources/sections/eina.sh index ee50f87..7cee088 100644 --- a/sources/sections/eina.sh +++ b/sources/sections/eina.sh @@ -2,7 +2,7 @@ setupfor eina [ ! -e ./configure ] && NOCONFIGURE=y ./autogen.sh -[ -z "$STATIC" ] && ENABLE="yes" || ENABLE="static" +[ ! -z "$QI_BOOTMENU_SHARED" ] && ENABLE="yes" || ENABLE="static" LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix=/usr \ --disable-cpu-mmx \ @@ -24,7 +24,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -[ -z "$STATIC" ] && install_shared_library eina +[ ! -z "$QI_BOOTMENU_SHARED" ] && install_shared_library eina pkgconfig_fixup_prefix eina libtool_fixup_libdir eina diff --git a/sources/sections/evas.sh b/sources/sections/evas.sh index 274393d..e1d7893 100644 --- a/sources/sections/evas.sh +++ b/sources/sections/evas.sh @@ -2,7 +2,7 @@ setupfor evas [ ! -e ./configure ] && NOCONFIGURE=y ./autogen.sh -[ -z "$STATIC" ] && ENABLE="yes" || ENABLE="static" +[ ! -z "$QI_BOOTMENU_SHARED" ] && ENABLE="yes" || ENABLE="static" LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix=/usr \ --enable-fb=$ENABLE \ @@ -68,7 +68,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then install_shared_library evas # delete all savers because we don't need them rm -rf "$ROOT_DIR/usr/lib/evas/modules/savers" diff --git a/sources/sections/freetype.sh b/sources/sections/freetype.sh index 7f849ab..940b149 100644 --- a/sources/sections/freetype.sh +++ b/sources/sections/freetype.sh @@ -22,7 +22,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libfreetype.so* $ROOT_DIR/usr/lib || dienow fi diff --git a/sources/sections/kexec-tools.sh b/sources/sections/kexec-tools.sh index ddb2682..13811fc 100644 --- a/sources/sections/kexec-tools.sh +++ b/sources/sections/kexec-tools.sh @@ -2,8 +2,12 @@ setupfor kexec-tools [ ! -e ./configure ] && ./bootstrap -LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix=/usr \ - --exec-prefix=/usr && +[ ! -z "$STATIC" ] && KEXEC_LDFLAGS="-static" + +LDFLAGS="$LDFLAGS $KEXEC_LDFLAGS " CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS \ + --prefix=/usr \ + --exec-prefix=/usr \ + --without-zlib && make && cp build/sbin/kexec "$ROOT_DIR/sbin" || dienow diff --git a/sources/sections/libjpeg.sh b/sources/sections/libjpeg.sh index 77b24ec..e4209b4 100644 --- a/sources/sections/libjpeg.sh +++ b/sources/sections/libjpeg.sh @@ -4,7 +4,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libjpeg.so* $ROOT_DIR/usr/lib || dienow fi diff --git a/sources/sections/libpng.sh b/sources/sections/libpng.sh index 5c08eda..7af1cc5 100644 --- a/sources/sections/libpng.sh +++ b/sources/sections/libpng.sh @@ -7,7 +7,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libpng*.so* $ROOT_DIR/usr/lib || dienow fi diff --git a/sources/sections/qi-bootmenu.sh b/sources/sections/qi-bootmenu.sh index 3067408..e55fd42 100644 --- a/sources/sections/qi-bootmenu.sh +++ b/sources/sections/qi-bootmenu.sh @@ -1,8 +1,8 @@ setupfor qi-bootmenu -[ ! -z "$STATIC" ] && TARGET="static" +[ -z "$QI_BOOTMENU_SHARED" ] && TARGET="static" -LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" make $TARGET && +LDFLAGS="$LDFLAGS -Wl,--gc-section" CFLAGS="$CFLAGS -ffunction-sections -fdata-sections" make $TARGET && make PREFIX=/usr DESTDIR="$ROOT_DIR" install diff --git a/sources/sections/tslib.sh b/sources/sections/tslib.sh index e056951..22348f2 100644 --- a/sources/sections/tslib.sh +++ b/sources/sections/tslib.sh @@ -2,7 +2,7 @@ setupfor tslib [ ! -e ./configure ] && ./autogen.sh -[ -z "$STATIC" ] && ENABLE="yes" || ENABLE="static" +[ ! -z "$QI_BOOTMENU_SHARED" ] && ENABLE="yes" || ENABLE="static" LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix=/usr \ --enable-static \ @@ -22,7 +22,7 @@ LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure $CROSS_CONFIGURE_FLAGS --prefix= make && make DESTDIR="$STAGING_DIR" install || dienow -[ -z "$STATIC" ] && install_shared_library ts +[ ! -z "$QI_BOOTMENU_SHARED" ] && install_shared_library ts pkgconfig_fixup_prefix ts libtool_fixup_libdir ts diff --git a/sources/sections/zlib.sh b/sources/sections/zlib.sh index 8f8e8bc..3ba6dbd 100644 --- a/sources/sections/zlib.sh +++ b/sources/sections/zlib.sh @@ -9,7 +9,7 @@ make prefix="$STAGING_DIR/usr" install || dienow LDFLAGS="$LDFLAGS" CFLAGS="$CFLAGS" ./configure --prefix=/usr --shared && make prefix="$STAGING_DIR/usr" install || dienow -if [ -z "$STATIC" ]; then +if [ ! -z "$QI_BOOTMENU_SHARED" ]; then cp -P $STAGING_DIR/usr/lib/libz.so* $ROOT_DIR/usr/lib || dienow fi -- 2.11.4.GIT