#! /bin/sh set -x date resize PATH='/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/bin:/opt/sbin:/opt/schplurtz/bin:/opt/schplurtz/sbin' prefix=/opt/schplurtz id env | grep -v SSH pwd sudo opkg list_installed sudo ipkg list_installed test -r icu4c-49_1_2-src.tgz || time curl -O http://download.icu-project.org/files/icu4c/49.1.2/icu4c-49_1_2-src.tgz test -r icu4c-49_1_2-data.zip || time : curl -O http://download.icu-project.org/files/icu4c/49.1.2/icu4c-49_1_2-data.zip time rm -rf icu time tar xf icu4c-49_1_2-src.tgz cd icu #( # cd source # time unzip -o ../../icu4c-49_1_2-data.zip #) set -e # We have to patch the file icu/source/common/Makefile.in and add /opt/schplurtz/lib/linux-atomic.o in the # dependencies of libicuuc.so . linux-atomic.o contains functions such as __sync_add_and_fetch_4 # those functions are needed. modern gcc do have those functions more or less as internal function # The file linux-atomic.o was compiled as stated here : http://schplurtz.free.fr/wiki/private/nslu2/solve-_sync_add_and_fetch_4 # The source file was gcc-4.6.3/gcc/config/arm/linux-atomic.c in gcc-core-4.6.3.tgz archive. # Initial ideas and solution was found here : http://vincesoft.blogspot.fr/2012/04/how-to-solve-undefined-reference-to.html # Here is the kind of error you get if you don't patch icu/source/common/Makefile.in on an nslu2 running slugosBE 5.3 # g++ -DU_CHARSET_IS_UTF8=1 -O3 -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long -o ../../bin/makeconv makeconv.o ucnvstat.o genmbcs.o gencnvex.o -L../.. # /lib -licutu -L../../lib -licui18n -L../../lib -licuuc -L../../stubdata -licudata -lpthread -ldl -lm # ../../lib/libicuuc.so: undefined reference to `__sync_val_compare_and_swap_4' # ../../lib/libicuuc.so: undefined reference to `__sync_add_and_fetch_4' # ../../lib/libicuuc.so: undefined reference to `__sync_sub_and_fetch_4' # collect2: ld returned 1 exit status # make[2]: *** [../../bin/makeconv] Error 1 # make[2]: Leaving directory `/home/src/icu/BUILD/tools/makeconv' cp -a source/common/Makefile.in source/common/Makefile.in.org >/dev/null 2>&1 || cp source/common/Makefile.in source/common/Makefile.in.org sed -i -e 's,icudataver.o icuplug.o,& /opt/schplurtz/lib/linux-atomic.o,' source/common/Makefile.in echo patched source/common/Makefile.in ls -l source/common/Makefile* diff -Naur source/common/Makefile.in.org source/common/Makefile.in || : # Pour éviter ce problème : # probleme: make[2]: Entering directory `/home/cmartin/Replicated/SOFT/nslu2/ICU/icu/BUILD/data' # probleme: rm -rf icupkg.inc # probleme: make[2]: Leaving directory `/home/cmartin/Replicated/SOFT/nslu2/ICU/icu/BUILD/data' # probleme: LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH ../bin/icupkg -tb ../../source/data/in/icudt49l.dat ./out/icudt49b.dat # probleme: udata_swapDataHeader(): header size mismatch - headerSize 32768 infoSize 5120 length 1024 # probleme: make[1]: *** [out/icudt49b.dat] Error 8 # probleme: make[1]: Leaving directory `/home/cmartin/Replicated/SOFT/nslu2/ICU/icu/BUILD/data' # probleme: make: *** [all-recursive] Error 2 # probleme: Command exited with non-zero status 2 # la solution est sur cette archive de liste de compilation de TeX # Live qui a le même problème avec une autre architecture. Le problème # est que, ./configure détecte bien que l'architecture est BigEndian # mais le resultat de cette detection n'est pas utilisé partout et # d'autres parties utilisent d'autres methodes de detection du boutisme. # Et ca foire car ces autres methodes ne connaissent pas toutes les # combinaisons possibles de plateforme-OS (sans parler de ARM qui # peut tourner en BE ou en LE). La solution donnee sur la liste est # de passer CPPFLAGS=-DU_IS_BIG_ENDIAN=1 en variable d'environnement # a l'execution de "make". Je vais plutôt essayer de mettre ces flags # dans des fichiers. L'adresse du fil de la liste est : # http://tug.org/pipermail/tlbuild/2012q2/thread.html#2266 Il faut # lire tous les messages, la solution est dans le dernier. mkdir BUILD cd BUILD time env \ CXXFLAGS=-DU_CHARSET_IS_UTF8=1 \ CFLAGS=-DU_CHARSET_IS_UTF8=1 \ CPPFLAGS=-DU_IS_BIG_ENDIAN=1 \ ../source/runConfigureICU \ Linux \ --prefix="$prefix" \ --disable-renaming test -r uconfig.h.prepend && time sed -i -e "/^#define __UCONFIG_H__/r uconfig.h.prepend" ../source/common/unicode/uconfig.h time make time make check touch NOW sleep 2 time sudo env PATH=$PATH make install date find "$prefix" -newer NOW ! -type d | tar cTf - nslu2-slugosbe-icu4c-49.1.2.tar tar tvf nslu2-slugosbe-icu4c-49.1.2.tar date