[uClibc] Patch: Building uClibc under Solaris

Stefan Allius allius at atecom.com
Thu Sep 11 08:27:47 UTC 2003


Hello,

for building the uClibc 0.9.21 under Solaris, I had to patch two
scripts. 

1. Under Solaris the test command with the 'string' argument don't
   work well. So I added the '-n' argument, which might work on all 
   plattforms.

Index: extra/scripts/fix_includes.sh
===================================================================
RCS file: /net/projects/cvs/atecom/firmware/uClibc/extra/scripts/fix_includes.sh,v
retrieving revision 1.1.1.1
diff -u -b -B -w -p -r1.1.1.1 fix_includes.sh
--- extra/scripts/fix_includes.sh	2003/09/10 07:38:09	1.1.1.1
+++ extra/scripts/fix_includes.sh	2003/09/11 08:11:02
@@ -49,11 +49,11 @@ usage () {
 }
 
 HAS_MMU="y";
-while [ "$1" ]; do
+while [ -n "$1" ]; do
     case $1 in
-	-k ) shift; if [ "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
-	-t ) shift; if [ "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
-	-n ) shift; if [ "$1" ]; then HAS_MMU="n"; shift; else usage; fi; ;;
+	-k ) shift; if [ -n "$1" ]; then KERNEL_SOURCE=$1; shift; else usage; fi; ;;
+	-t ) shift; if [ -n "$1" ]; then TARGET_ARCH=$1; shift; else usage; fi; ;;
+	-n ) shift; if [ -n "$1" ]; then HAS_MMU="n"; shift; else usage; fi; ;;
 	-* ) usage; ;;
 	* ) usage; ;;
     esac;


2. The sed under Solaris don't support the '-s' argument, which is a
   GNU extension. I changed it to '-e' which works fine for me.


Index: extra/scripts/get-needed-libgcc-objects.sh
===================================================================
RCS file: /net/projects/cvs/atecom/firmware/uClibc/extra/scripts/get-needed-libgcc-objects.sh,v
retrieving revision 1.1.1.12
diff -u -b -B -w -p -r1.1.1.12 get-needed-libgcc-objects.sh
--- extra/scripts/get-needed-libgcc-objects.sh	2003/08/25 07:32:50	1.1.1.12
+++ extra/scripts/get-needed-libgcc-objects.sh	2003/09/11 08:21:40
@@ -20,7 +20,7 @@ echo "    partial linking..."
 rm -f libc.ldr
 $LD $LDFLAGS -r -o libc.ldr $CRTOBJS --whole-archive ../libc.a
 
-if $NM --undefined-only libc.ldr 2>&1 | sed -s 's/ *$//' | sed -e 's/^.*U  *//' | grep -v "main$" | grep -v "_GLOBAL_OFFSET_TABLE_$" | grep -v "_gp_disp" | grep -v "^etext$" | grep -v "^__gmon_start__$" > sym.need ; then
+if $NM --undefined-only libc.ldr 2>&1 | sed -e 's/ *$//' | sed -e 's/^.*U  *//' | grep -v "main$" | grep -v "_GLOBAL_OFFSET_TABLE_$" | grep -v "_gp_disp" | grep -v "^etext$" | grep -v "^__gmon_start__$" > sym.need ; then
     EXIT_WITH_ERROR=0
     rm -f obj.need
     touch obj.need



Bye
Stefan

-- 
----------------------------------
Stefan Allius
senior software engineer

ATecoM GmbH
advanced telecommunication modules
Pascalstrasse 67
D-52076 Aachen
Germany

Tel: +49/2408/9596-0
Fax: +49/2408/9596-900
eMail: allius at atecom.com
URL: http://www.atecom.com
----------------------------------





More information about the uClibc mailing list