Commits

Anonymous committed 06d3636

Correctly handle the libfloat case: download, extract and patch sub-actions.
Small improvement in messages in scipts/functions when retrieving a file.

  • Participants
  • Parent commits fd36793

Comments (0)

Files changed (7)

File patches/libfloat/990616.orig/100-libfloat_990616-3-lib-versioning.patch

+This patch comes from the Debian archive:
+  ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/libfloat_990616-3.diff.gz
+
+It was stripped of all Debian-related hunks.
+Kept is the library versioning.
+
+--- libfloat-990616.orig/Makefile
++++ libfloat-990616/Makefile
+@@ -4,15 +4,15 @@
+ #CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
+ AR=ar
+ 
+-all: libfloat.a libfloat.so
++all: libfloat.a libfloat.so.1
+ 
+ libfloat.a: softfloat.o fplib_glue.o
+ 	rm -f libfloat.a
+ 	$(AR) cq libfloat.a softfloat.o fplib_glue.o
+ 
+-libfloat.so: softfloat.os fplib_glue.os
+-	rm -f libfloat.so
+-	gcc -shared softfloat.os fplib_glue.os -o libfloat.so
++libfloat.so.1: softfloat.os fplib_glue.os
++	rm -f libfloat.so.1
++	gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
+ 
+ softfloat.o: softfloat/bits64/softfloat.c
+ 	$(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
+@@ -26,14 +26,14 @@
+ fplib_glue.os: fplib_glue.S
+ 	$(CC) -fpic -c -o fplib_glue.os fplib_glue.S
+ 
+-install: libfloat.a libfloat.so
+-	cp -a libfloat.a /usr/lib
+-	cp -a libfloat.so /usr/lib
+-	ldconfig
++install: libfloat.a libfloat.so.1
++	cp -a libfloat.a $(DESTDIR)/usr/lib
++	cp -a libfloat.so.1 $(DESTDIR)/usr/lib
++	cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
+ 
+ clean: 
+ 	rm -f *.o
+ 	rm -f *.os
+ 	rm -f libfloat.a
+-	rm -f libfloat.so
++	rm -f libfloat.so.1
+ 	rm -f *~

File patches/libfloat/990616.orig/200-cross_compile.patch

+When linking, call directly ld in place of the gcc wrapper, because the wrapper
+will try to link with -lfloat, which we don't have right now...
+
+Simplify CFLAGS to stay ABI compliant (ot so I guess)...
+
+diff -dur libfloat.orig/Makefile libfloat/Makefile
+--- libfloat.orig/Makefile	2007-02-16 19:38:55.000000000 +0100
++++ libfloat/Makefile	2007-02-16 19:46:23.000000000 +0100
+@@ -1,8 +1,11 @@
+ # Makefile for the Linux soft-float library
+ 
+-CC=gcc -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
+-#CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
+-AR=ar
++AR=$(CROSS_COMPILE)ar
++#CFLAGS=-O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
++CFLAGS=-O2 -D__LIBFLOAT__
++CC=$(CROSS_COMPILE)gcc 
++LDFLAGS=-shared -nostdlib
++LD=$(CROSS_COMPILE)ld
+ 
+ all: libfloat.a libfloat.so.1
+ 
+@@ -12,28 +13,31 @@
+ 
+ libfloat.so.1: softfloat.os fplib_glue.os
+ 	rm -f libfloat.so.1
+-	gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
++	$(LD) $(LDFLAGS) -soname=libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
+ 
+ softfloat.o: softfloat/bits64/softfloat.c
+-	$(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
++	$(CC) $(CFLAGS) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
+ 
+ fplib_glue.o: fplib_glue.S
+-	$(CC) -c -o fplib_glue.o fplib_glue.S
++	$(CC) $(CFLAGS) -c -o fplib_glue.o fplib_glue.S
+ 
+ softfloat.os: softfloat/bits64/softfloat.c
+-	$(CC) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
++	$(CC) $(CFLAGS) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
+ 
+ fplib_glue.os: fplib_glue.S
+-	$(CC) -fpic -c -o fplib_glue.os fplib_glue.S
++	$(CC) $(CFLAGS) -fpic -c -o fplib_glue.os fplib_glue.S
+ 
+ install: libfloat.a libfloat.so.1
+-	cp -a libfloat.a $(DESTDIR)/usr/lib
+-	cp -a libfloat.so.1 $(DESTDIR)/usr/lib
+-	cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
++	install -d -m 755 "$(DESTDIR)/usr/lib"
++	install -m 755 libfloat.a "$(DESTDIR)/usr/lib"
++	install -m 755 libfloat.so.1 "$(DESTDIR)/usr/lib"
++	cd $(DESTDIR)/usr/lib
++	ln -s libfloat.so.1 libfloat.so
+ 
+ clean: 
+ 	rm -f *.o
+ 	rm -f *.os
+ 	rm -f libfloat.a
+ 	rm -f libfloat.so.1
++	rm -f libfloat.so
+ 	rm -f *~

File patches/libfloat/990616/100-libfloat_990616-3-lib-versioning.patch

-This patch comes from the Debian archive:
-  ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/libfloat_990616-3.diff.gz
-
-It was stripped of all Debian-related hunks.
-Kept is the library versioning.
-
---- libfloat-990616.orig/Makefile
-+++ libfloat-990616/Makefile
-@@ -4,15 +4,15 @@
- #CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
- AR=ar
- 
--all: libfloat.a libfloat.so
-+all: libfloat.a libfloat.so.1
- 
- libfloat.a: softfloat.o fplib_glue.o
- 	rm -f libfloat.a
- 	$(AR) cq libfloat.a softfloat.o fplib_glue.o
- 
--libfloat.so: softfloat.os fplib_glue.os
--	rm -f libfloat.so
--	gcc -shared softfloat.os fplib_glue.os -o libfloat.so
-+libfloat.so.1: softfloat.os fplib_glue.os
-+	rm -f libfloat.so.1
-+	gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
- 
- softfloat.o: softfloat/bits64/softfloat.c
- 	$(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
-@@ -26,14 +26,14 @@
- fplib_glue.os: fplib_glue.S
- 	$(CC) -fpic -c -o fplib_glue.os fplib_glue.S
- 
--install: libfloat.a libfloat.so
--	cp -a libfloat.a /usr/lib
--	cp -a libfloat.so /usr/lib
--	ldconfig
-+install: libfloat.a libfloat.so.1
-+	cp -a libfloat.a $(DESTDIR)/usr/lib
-+	cp -a libfloat.so.1 $(DESTDIR)/usr/lib
-+	cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
- 
- clean: 
- 	rm -f *.o
- 	rm -f *.os
- 	rm -f libfloat.a
--	rm -f libfloat.so
-+	rm -f libfloat.so.1
- 	rm -f *~

File patches/libfloat/990616/200-cross_compile.patch

-When linking, call directly ld in place of the gcc wrapper, because the wrapper
-will try to link with -lfloat, which we don't have right now...
-
-Simplify CFLAGS to stay ABI compliant (ot so I guess)...
-
-diff -dur libfloat.orig/Makefile libfloat/Makefile
---- libfloat.orig/Makefile	2007-02-16 19:38:55.000000000 +0100
-+++ libfloat/Makefile	2007-02-16 19:46:23.000000000 +0100
-@@ -1,8 +1,11 @@
- # Makefile for the Linux soft-float library
- 
--CC=gcc -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
--#CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
--AR=ar
-+AR=$(CROSS_COMPILE)ar
-+#CFLAGS=-O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
-+CFLAGS=-O2 -D__LIBFLOAT__
-+CC=$(CROSS_COMPILE)gcc 
-+LDFLAGS=-shared -nostdlib
-+LD=$(CROSS_COMPILE)ld
- 
- all: libfloat.a libfloat.so.1
- 
-@@ -12,28 +13,31 @@
- 
- libfloat.so.1: softfloat.os fplib_glue.os
- 	rm -f libfloat.so.1
--	gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
-+	$(LD) $(LDFLAGS) -soname=libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
- 
- softfloat.o: softfloat/bits64/softfloat.c
--	$(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
-+	$(CC) $(CFLAGS) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
- 
- fplib_glue.o: fplib_glue.S
--	$(CC) -c -o fplib_glue.o fplib_glue.S
-+	$(CC) $(CFLAGS) -c -o fplib_glue.o fplib_glue.S
- 
- softfloat.os: softfloat/bits64/softfloat.c
--	$(CC) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
-+	$(CC) $(CFLAGS) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
- 
- fplib_glue.os: fplib_glue.S
--	$(CC) -fpic -c -o fplib_glue.os fplib_glue.S
-+	$(CC) $(CFLAGS) -fpic -c -o fplib_glue.os fplib_glue.S
- 
- install: libfloat.a libfloat.so.1
--	cp -a libfloat.a $(DESTDIR)/usr/lib
--	cp -a libfloat.so.1 $(DESTDIR)/usr/lib
--	cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
-+	install -d -m 755 "$(DESTDIR)/usr/lib"
-+	install -m 755 libfloat.a "$(DESTDIR)/usr/lib"
-+	install -m 755 libfloat.so.1 "$(DESTDIR)/usr/lib"
-+	cd $(DESTDIR)/usr/lib
-+	ln -s libfloat.so.1 libfloat.so
- 
- clean: 
- 	rm -f *.o
- 	rm -f *.os
- 	rm -f libfloat.a
- 	rm -f libfloat.so.1
-+	rm -f libfloat.so
- 	rm -f *~

File scripts/build/libfloat.sh

 
 # Download libfloat
 do_libfloat_get() {
-    # Please note: because the file we download, and the file we store on the
-    # file system don't have the same name, CT_GetFile will always try to
-    # download the file over and over.
-    # To avoid this, we check that the file we want already exists in the
-    # tarball directory first. This is an ugly hack that overrides the standard
-    # CT_GetFile behavior... Sight...
-    lib_float_url="ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat/"
-    ext=`CT_GetFileExtension "${CT_LIBFLOAT_FILE}"`
-    if [ -z "${ext}" ]; then
-        CT_GetFile libfloat_990616.orig "${lib_float_url}"
-        ext=`CT_GetFileExtension "libfloat_990616.orig"`
-        # Hack: remove the .orig extension, and change _ to -
-        mv -v "${CT_TARBALLS_DIR}/libfloat_990616.orig${ext}" \
-              "${CT_TARBALLS_DIR}/libfloat-990616${ext}"      2>&1 |CT_DoLog DEBUG
-    fi
+    # Ah! libfloat separates the version string from the base name with
+    # an underscore. We need to workaround this in a sane manner: soft link.
+    local libfloat_file=`echo "${CT_LIBFLOAT_FILE}" |sed -r -e 's/^libfloat-/libfloat_/;'`
+    CT_GetFile "${libfloat_file}"                                    \
+               ftp://ftp.de.debian.org/debian/pool/main/libf/libfloat
+    CT_Pushd "${CT_TARBALLS_DIR}"
+    ext=`CT_GetFileExtension "${libfloat_file}"`
+    ln -s "${libfloat_file}${ext}" "${CT_LIBFLOAT_FILE}${ext}"
+    CT_Popd
 }
 
 # Extract libfloat
 do_libfloat_extract() {
-    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
+    CT_ExtractAndPatch "${CT_LIBFLOAT_FILE}"
 }
 
 # Build libfloat
     # Here we build and install libfloat for the target, so that the C library
     # builds OK with those versions of gcc that have severed softfloat support
     # code
-    [ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] || return 0
-	CT_DoStep INFO "Installing software floating point emulation library libfloat"
+    CT_DoStep INFO "Installing software floating point emulation library libfloat"
+    mkdir build-libfloat
+    cd build-libfloat
 
     CT_Pushd "${CT_BUILD_DIR}"
     CT_DoLog EXTRA "Copying sources to build dir"
-    mkdir build-libfloat
-    cd build-libfloat
     ( cd "${CT_SRC_DIR}/${CT_LIBFLOAT_FILE}"; tar cf - . ) |tar xvf - |CT_DoLog ALL
 
     CT_DoLog EXTRA "Cleaning library"

File scripts/crosstool.sh

 CT_CC_CORE_FILE="${CT_CC_CORE}-${CT_CC_CORE_VERSION}"
 CT_CC_FILE="${CT_CC}-${CT_CC_VERSION}"
 CT_LIBC_FILE="${CT_LIBC}-${CT_LIBC_VERSION}"
-[ "${CT_ARCH_FLOAT_SW_LIBFLOAT}" = "y" ] && CT_LIBFLOAT_FILE="libfloat-990616"
+CT_LIBFLOAT_FILE="libfloat-${CT_LIBFLOAT_VERSION}"
 
 # Where will we work?
 CT_TARBALLS_DIR="${CT_TOP_DIR}/targets/tarballs"

File scripts/functions

         return 0
     fi
 
-    CT_DoLog EXTRA "Retrieving \"${file}\""
     CT_Pushd "${CT_TARBALLS_DIR}"
     # File not yet downloaded, try to get it
     got_it=0
     for ext in .tar.bz2 .tar.gz .tgz .tar; do
         if [ -r "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" -a \
              "${CT_FORCE_DOWNLOAD}" != "y" ]; then
+            CT_DoLog EXTRA "Copying \"${file}\" from local copy"
             cp -v "${CT_LOCAL_TARBALLS_DIR}/${file}${ext}" "${file}${ext}" |CT_DoLog DEBUG
             return 0
         fi
     done
     # Try to download it
+    CT_DoLog EXTRA "Retrieving \"${file}\""
     for ext in .tar.bz2 .tar.gz .tgz .tar; do
         # Try all urls in turn
         for url in "$@"; do