From fa941f56561513f39cf581ef4369818ae9794568 Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Thu, 13 Mar 2008 15:16:39 +0200 Subject: [PATCH] bglibs: Marked to build at stage 0 and 1 if cross-compiling is requested Note: Because of the special "nature" of the bglibs build system this change also introduces 2 patches and a 'bg-config.in' to adjust build system settings while cross-compiling! Please take a look at the patches and conf files for further comments! --- develop/bglibs/bg-config.in | 26 +++++ develop/bglibs/bglibs.conf | 4 + develop/bglibs/bglibs.desc | 2 +- develop/bglibs/crc-gentab-native.patch.cross | 106 +++++++++++++++++++ develop/bglibs/installer-conf.patch.cross | 104 ++++++++++++++++++ 5 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 develop/bglibs/bg-config.in create mode 100644 develop/bglibs/crc-gentab-native.patch.cross create mode 100644 develop/bglibs/installer-conf.patch.cross diff --git a/develop/bglibs/bg-config.in b/develop/bglibs/bg-config.in new file mode 100644 index 000000000..bcb053df8 --- /dev/null +++ b/develop/bglibs/bg-config.in @@ -0,0 +1,26 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../bglibs/bg-config.in +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +# adjust conf-cc and conf-ld files for using the cross-compiler +pkg_bg_crosscc() { + sed -i -e "s,gcc,$CC,g" conf-cc + sed -i -e "s,gcc,$CC,g" conf-ld + echo "$AR" > conf-ar + echo "$RANLIB" > conf-ranlib + echo "$root/usr/bin/libtool" > conf-libtool + # use the native bg-installer and crc-gentab we built at stage 0 + echo "$root/TOOLCHAIN/tools.cross/usr/bglibs/bin/bg-installer" > conf-installer + echo "$root/TOOLCHAIN/tools.cross/usr/bglibs/bin/crc-gentab" > conf-crc-gentab-native +} +atstage cross && hook_add preconf 5 'pkg_bg_crosscc' diff --git a/develop/bglibs/bglibs.conf b/develop/bglibs/bglibs.conf index 33ac57c4d..5c45fb4f4 100644 --- a/develop/bglibs/bglibs.conf +++ b/develop/bglibs/bglibs.conf @@ -2,6 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../bglibs/bglibs.conf +# Copyright (C) 2008 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. @@ -11,6 +12,9 @@ # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- SDE-COPYRIGHT-NOTE-END --- + +. $base/package/*/bglibs/bg-config.in + if [ "$prefix_auto" = 1 ]; then prefix="usr/bglibs" set_confopt diff --git a/develop/bglibs/bglibs.desc b/develop/bglibs/bglibs.desc index 178ede56b..c90886c39 100644 --- a/develop/bglibs/bglibs.desc +++ b/develop/bglibs/bglibs.desc @@ -30,6 +30,6 @@ [L] GPL [S] Stable [V] 1.104 -[P] X -----5---9 177.600 +[P] X ??---5---9 177.600 [D] 936274518 bglibs-1.104.tar.gz http://untroubled.org/bglibs/ diff --git a/develop/bglibs/crc-gentab-native.patch.cross b/develop/bglibs/crc-gentab-native.patch.cross new file mode 100644 index 000000000..b7c6d70c0 --- /dev/null +++ b/develop/bglibs/crc-gentab-native.patch.cross @@ -0,0 +1,106 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../bglibs/crc-gentab-native.patch.cross +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +Author: Christian Wiese +Origin: OpenSDE (http://opensde.org) +Description: While cross-compiling we have to use a 'native' crc-gentab + for being able to generate some source files. + For this purpuse we introduce 'conf-crc-gentab-native' where + the path to the natively built crc-gentab can be stored, to + generate the 'crc-gentab-native' wrapper script which is used + for generating the files. + +--- bglibs-1.102/Makefile.orig 2008-03-13 04:10:16.000000000 +0200 ++++ bglibs-1.102/Makefile 2008-03-13 04:16:24.000000000 +0200 +@@ -241,14 +241,21 @@ + ) >compile + chmod 755 compile + ++crc-gentab-native: conf-crc-gentab-native ++ ( \ ++ echo '#!/bin/sh';\ ++ echo exec `head -n 1 conf-crc-gentab-native` '"$$@"' ; \ ++ ) >crc-gentab-native ++ chmod 755 crc-gentab-native ++ + crc-gentab: crc-gentab.o load libbg-msg.a libbg-iobuf.a libbg-sysdeps.a + ./load crc-gentab libbg-msg.a libbg-iobuf.a libbg-sysdeps.a + + crc-gentab.o: compile crc-gentab.c sysdeps.h iobuf/iobuf.h iobuf/common.h iobuf/ibuf.h iobuf/common.h iobuf/obuf.h iobuf/common.h msg/msg.h + ./compile crc-gentab.c + +-crc/crc16_arc_table.c: crc-gentab +- ./crc-gentab crc16_arc 16 0x8005 reflected >$@ ++crc/crc16_arc_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc16_arc 16 0x8005 reflected >$@ + + crc/crc16_arc_table.lo: libcompile crc/crc16_arc_table.c crc/crc16_arc.h crc/gcrc.h sysdeps.h + ./libcompile crc/crc16_arc_table.c +@@ -256,8 +263,8 @@ + crc/crc16_arc_table.o: compile crc/crc16_arc_table.c crc/crc16_arc.h crc/gcrc.h sysdeps.h + ./compile crc/crc16_arc_table.c + +-crc/crc16_ccitt_table.c: crc-gentab +- ./crc-gentab crc16_ccitt 16 0x1021 normal >$@ ++crc/crc16_ccitt_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc16_ccitt 16 0x1021 normal >$@ + + crc/crc16_ccitt_table.lo: libcompile crc/crc16_ccitt_table.c crc/crc16_ccitt.h crc/gcrc.h sysdeps.h + ./libcompile crc/crc16_ccitt_table.c +@@ -265,8 +272,8 @@ + crc/crc16_ccitt_table.o: compile crc/crc16_ccitt_table.c crc/crc16_ccitt.h crc/gcrc.h sysdeps.h + ./compile crc/crc16_ccitt_table.c + +-crc/crc16_xmodem_table.c: crc-gentab +- ./crc-gentab crc16_xmodem 16 0x8408 reflected >$@ ++crc/crc16_xmodem_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc16_xmodem 16 0x8408 reflected >$@ + + crc/crc16_xmodem_table.lo: libcompile crc/crc16_xmodem_table.c crc/crc16_xmodem.h uint16.h sysdeps.h uintnn.h + ./libcompile crc/crc16_xmodem_table.c +@@ -274,8 +281,8 @@ + crc/crc16_xmodem_table.o: compile crc/crc16_xmodem_table.c crc/crc16_xmodem.h uint16.h sysdeps.h uintnn.h + ./compile crc/crc16_xmodem_table.c + +-crc/crc32_table.c: crc-gentab +- ./crc-gentab crc32 32 0x04C11DB7 reflected >$@ ++crc/crc32_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc32 32 0x04C11DB7 reflected >$@ + + crc/crc32_table.lo: libcompile crc/crc32_table.c crc/crc32.h crc/gcrc.h sysdeps.h uint32.h sysdeps.h uintnn.h + ./libcompile crc/crc32_table.c +@@ -283,8 +290,8 @@ + crc/crc32_table.o: compile crc/crc32_table.c crc/crc32.h crc/gcrc.h sysdeps.h uint32.h sysdeps.h uintnn.h + ./compile crc/crc32_table.c + +-crc/crc32c_table.c: crc-gentab +- ./crc-gentab crc32c 32 0x1EDC6F41 reflected >$@ ++crc/crc32c_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc32c 32 0x1EDC6F41 reflected >$@ + + crc/crc32c_table.lo: libcompile crc/crc32c_table.c crc/crc32c.h crc/gcrc.h sysdeps.h + ./libcompile crc/crc32c_table.c +@@ -292,8 +299,8 @@ + crc/crc32c_table.o: compile crc/crc32c_table.c crc/crc32c.h crc/gcrc.h sysdeps.h + ./compile crc/crc32c_table.c + +-crc/crc64_table.c: crc-gentab +- ./crc-gentab crc64 64 0x42F0E1EBA9EA3693 normal >$@ ++crc/crc64_table.c: crc-gentab crc-gentab-native ++ ./crc-gentab-native crc64 64 0x42F0E1EBA9EA3693 normal >$@ + + crc/crc64_table.lo: libcompile crc/crc64_table.c crc/crc64.h crc/gcrc.h sysdeps.h + ./libcompile crc/crc64_table.c diff --git a/develop/bglibs/installer-conf.patch.cross b/develop/bglibs/installer-conf.patch.cross new file mode 100644 index 000000000..b9f3902d2 --- /dev/null +++ b/develop/bglibs/installer-conf.patch.cross @@ -0,0 +1,104 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../bglibs/installer-conf.patch.cross +# Copyright (C) 2008 The OpenSDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- SDE-COPYRIGHT-NOTE-END --- + +Author: Christian Wiese +Origin: OpenSDE (http://opensde.org) +Description: Add support for defining which installer has to be used, because + for cross-compiling bglibs we need to use a bg-installer that was + built 'natively' with the compiler of the build system. + Instead of using 'bg-installer' directly we create the 'installer' + wrapper script for being able to explicitely define the path to + the installer we want to use via 'conf-installer'. + +diff -ruN bglibs-1.102/Makefile bglibs-1.102-cross-conf/Makefile +--- bglibs-1.102/Makefile 2006-10-30 23:11:21.000000000 +0200 ++++ bglibs-1.102-cross/Makefile 2007-04-14 05:50:39.767276500 +0300 +@@ -601,9 +601,16 @@ + fmt/unum.o: compile fmt/unum.c fmt/number.h selftest.c iobuf/iobuf.h iobuf/common.h iobuf/ibuf.h iobuf/common.h iobuf/obuf.h iobuf/common.h msg/msg.h str/str.h + ./compile fmt/unum.c + +-install: bg-installer INSTHIER conf-bin conf-include conf-lib conf-man +- ./bg-installer -v installer ++ chmod 755 installer ++ ++install: bg-installer INSTHIER installer conf-bin conf-include conf-lib conf-man ++ ./installer -v /dev/null 2>&1; then tag='--tag=CC'; fi; \ + echo '#!/bin/sh'; \ + echo 'source=$$1; shift'; \ + echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \ +- echo exec libtool --mode=compile --silent `head -n 1 conf-cc` -I. '-o $${base}.lo -c $$source $${1+"$$@"}'; \ ++ echo exec `head -n 1 conf-libtool` --mode=compile --silent $$tag `head -n 1 conf-cc` -I. '-o $${base}.lo -c $$source $${1+"$$@"}'; \ + ) >libcompile + chmod 755 libcompile + +@@ -1023,17 +1030,17 @@ + ( echo '#!/bin/sh'; \ + echo 'main="$$1"; shift';\ + echo 'rm -f "$$main"';\ +- echo 'ar cr "$$main" $${1+"$$@"}';\ +- echo 'ranlib "$$main"';\ ++ echo '`head -n 1 conf-ar` cr "$$main" $${1+"$$@"}';\ ++ echo '`head -n 1 conf-ranlib` "$$main"';\ + ) >makelib + chmod 755 makelib + + makeshlib: conf-ld conf-lib LIBVERSION Makefile +- ( if libtool --tag=CC --help >/dev/null 2>&1; then tag='--tag=CC'; fi; \ ++ ( if `head -n 1 conf-libtool` --tag=CC --help >/dev/null 2>&1; then tag='--tag=CC'; fi; \ + echo '#!/bin/sh'; \ + echo 'lib="$$1"; shift';\ + echo 'rm -f "$$lib"';\ +- echo libtool --mode=link --silent $$tag `head -n 1 conf-ld` '-o "$$lib" -rpath' `head -n 1 conf-lib` -version-info `head -n 1 LIBVERSION` '$${1+"$$@"}';\ ++ echo `head -n 1 conf-libtool` --mode=link --silent $$tag `head -n 1 conf-ld` '-o "$$lib" -rpath' `head -n 1 conf-lib` -version-info `head -n 1 LIBVERSION` '$${1+"$$@"}';\ + ) >makeshlib + chmod 755 makeshlib + +diff -ruN bglibs-1.102/conf-ar bglibs-1.102-cross-conf/conf-ar +--- bglibs-1.102/conf-ar 1970-01-01 02:00:00.000000000 +0200 ++++ bglibs-1.102-cross-conf/conf-ar 2007-04-14 04:48:21.373641500 +0300 +@@ -0,0 +1 @@ ++ar +diff -ruN bglibs-1.102/conf-installer bglibs-1.102-cross-conf/conf-installer +--- bglibs-1.102/conf-installer 1970-01-01 02:00:00.000000000 +0200 ++++ bglibs-1.102-cross-conf/conf-installer 2007-04-14 20:00:21.109411250 +0300 +@@ -0,0 +1 @@ ++./bg-installer +diff -ruN bglibs-1.102/conf-libtool bglibs-1.102-cross-conf/conf-libtool +--- bglibs-1.102/conf-libtool 1970-01-01 02:00:00.000000000 +0200 ++++ bglibs-1.102-cross-conf/conf-libtool 2007-04-14 04:27:44.956370250 +0300 +@@ -0,0 +1 @@ ++libtool +diff -ruN bglibs-1.102/conf-ranlib bglibs-1.102-cross-conf/conf-ranlib +--- bglibs-1.102/conf-ranlib 1970-01-01 02:00:00.000000000 +0200 ++++ bglibs-1.102-cross-conf/conf-ranlib 2007-04-14 04:27:03.289766250 +0300 +@@ -0,0 +1 @@ ++ranlib