aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--flx/Makefile2
-rw-r--r--ifenslave/Makefile10
-rw-r--r--include/rules.make18
-rw-r--r--lcd/Makefile4
-rw-r--r--mii/Makefile6
-rw-r--r--mktmp/Makefile4
-rw-r--r--remount/Makefile4
-rwxr-xr-xscripts/pkg43
-rw-r--r--wd/Makefile4
10 files changed, 69 insertions, 30 deletions
diff --git a/ChangeLog b/ChangeLog
index 55e8ca3..b94fb29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -84,3 +84,7 @@
- fixed a bug in fct1.c where two different but valid links would
not be reported as different.
+2005/03/01 :
+ - pkg 0.5.0 provides some cross-compilation variables
+ - some makefiles have been modified to support cross-compilation
+ - release 0.1.28
diff --git a/flx/Makefile b/flx/Makefile
index 23e1491..4d0c460 100644
--- a/flx/Makefile
+++ b/flx/Makefile
@@ -33,7 +33,7 @@ SRC=main.c arg.c utils.c md5.c flx.c fct1.c check.c sign.c \
OBJ=$(SRC:.c=.o)
COPTS=-O2
CFLAGS= -Wall $(COPTS) -DMEM_OPTIM -DPROGRAM_NAME=\"$(NAME)\" -DPROGRAM_VERSION=\"$(VERSION)\"
-LDFLAGS=-L.
+LDFLAGS=-L. -Wl,--gc-sections
all: $(NAME)
diff --git a/ifenslave/Makefile b/ifenslave/Makefile
index 09c0e35..6d6aa6c 100644
--- a/ifenslave/Makefile
+++ b/ifenslave/Makefile
@@ -1,7 +1,7 @@
OBJS=ifenslave-1.0.11 ifenslave-1.0.12 ifenslave
# include ../../include/rules.make
include ../include/rules.make
-CC=gcc
+CC := $(CC_ORIG)
CFLAGS+=-Wstrict-prototypes -I/usr/src/linux/include
#CFLAGS+=-Wstrict-prototypes -I/usr/src/linux/include -momit-leaf-frame-pointer
@@ -16,14 +16,14 @@ ifenslave:
ifenslave-1.0.11: ifenslave-1.0.11.o
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
# sstrip $@
ifenslave-1.0.12: ifenslave-1.0.12.o
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
# sstrip $@
diff --git a/include/rules.make b/include/rules.make
index b2b6336..b1b5f17 100644
--- a/include/rules.make
+++ b/include/rules.make
@@ -1,22 +1,24 @@
-CC=diet gcc
+CC_ORIG := $(CC)
+CC := diet $(CC)
+
CFLAGS=$(GCC_ARCH_SMALL) $(GCC_CPU_SMALL) $(GCC_OPT_SMALL)
#-mpreferred-stack-boundary=2 -malign-jumps=0 -malign-loops=0 -malign-functions=0 -Os -march=i386 -mcpu=i386
-LDFLAGS=-s
+LDFLAGS=-s -Wl,--gc-sections
all: $(OBJS)
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
- objdump -h $@ | grep -q '\.sbss[ ]*00000000' && strip -R .sbss $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
+ $(OBJDUMP) -h $@ | grep -q '\.sbss[ ]*00000000' && $(STRIP) -R .sbss $@ || true
-sstrip $@
%-debug: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -DDEBUG -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
- objdump -h $@ | grep -q '\.sbss[ ]*00000000' && strip -R .sbss $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
+ $(OBJDUMP) -h $@ | grep -q '\.sbss[ ]*00000000' && $(STRIP) -R .sbss $@ || true
clean:
@rm -f *.[ao] *~ core
diff --git a/lcd/Makefile b/lcd/Makefile
index 06e0926..573dad8 100644
--- a/lcd/Makefile
+++ b/lcd/Makefile
@@ -4,6 +4,6 @@ CFLAGS+=-fomit-frame-pointer
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
sstrip $@
diff --git a/mii/Makefile b/mii/Makefile
index 9f06237..0192d09 100644
--- a/mii/Makefile
+++ b/mii/Makefile
@@ -1,14 +1,14 @@
OBJS=starfire-diag tulip-diag mii-diag
include ../include/rules.make
-CC=gcc
+CC := $(CC_ORIG)
#CFLAGS+=-momit-leaf-frame-pointer
all: $(OBJS)
%-diag: %-diag.o libmii.o
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
sstrip $@
%.o: %.c
diff --git a/mktmp/Makefile b/mktmp/Makefile
index e4e9ccc..a430169 100644
--- a/mktmp/Makefile
+++ b/mktmp/Makefile
@@ -4,6 +4,6 @@ include ../include/rules.make
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
sstrip $@
diff --git a/remount/Makefile b/remount/Makefile
index 718de45..71633d5 100644
--- a/remount/Makefile
+++ b/remount/Makefile
@@ -7,6 +7,6 @@ remountw : remountr
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
sstrip $@
diff --git a/scripts/pkg b/scripts/pkg
index 271fc81..d65a14b 100755
--- a/scripts/pkg
+++ b/scripts/pkg
@@ -1,8 +1,8 @@
#!/bin/bash
-# pkg - Formilux package builder - version 0.4.3 - 2004-01-23
+# pkg - Formilux package builder - version 0.5.0 - 2005-03-01
#
-# Copyright (C) 2001-2003 Benoit Dolez & Willy Tarreau
+# Copyright (C) 2001-2005 Benoit Dolez & Willy Tarreau
# mailto: benoit@ant-computing.com,willy@ant-computing.com
#
# This program is licenced under GPLv2 ( http://www.gnu.org/licenses/gpl.txt )
@@ -861,9 +861,9 @@ function do_strip {
echo "Error: directory $ROOTDIR doesn't exist. Make sure you did 'prepack'."
exit 1
fi
- #find $ROOTDIR/. -type f | xargs file | grep ":.*executable.*not stripped" | cut -f1 -d: | xargs strip -x --strip-unneeded -R .note -R .comment > /dev/null 2>&1
+ #find $ROOTDIR/. -type f | xargs file | grep ":.*executable.*not stripped" | cut -f1 -d: | xargs ${STRIP} -x --strip-unneeded -R .note -R .comment > /dev/null 2>&1
# allow executable and shared (.so), but not relocatable (.o), both stripped or not stripped
- find $ROOTDIR/. -type f | xargs file | grep ":.*ELF.*\(executable\|\shared\).*stripped" | cut -f1 -d: | xargs strip -x --strip-unneeded -R .note -R .comment > /dev/null 2>&1
+ find $ROOTDIR/. -type f | xargs file | grep ":.*ELF.*\(executable\|\shared\).*stripped" | cut -f1 -d: | xargs ${STRIP} -x --strip-unneeded -R .note -R .comment > /dev/null 2>&1
return 0
}
@@ -1139,6 +1139,39 @@ function set_compiler_options {
*) arch=${arch:-i586} cpu=${cpu:-i686} basearch=${basearch:-i386} ;;
esac
+ # Handling of cross-compilers :
+ # - setting CC will force both HOSTCC and FLXCROSSCC
+ # - setting HOSTCC will keep it
+ # - setting FLXCROSS will set CC
+ # - setting FLXCROSSCC will set CC whatever FLXCROSS is.
+
+ if [ -z "$FLX_CROSS_OPT_SET" ]; then
+ CC=${CC:-gcc}
+ AS=${AS:-as}
+ LD=${LD:-ld}
+ AR=${AR:-ar}
+ STRIP=${STRIP:-strip}
+ OBJDUMP=${OBJDUMP:-objdump}
+
+ HOSTCC=${HOSTCC:-$CC}
+ HOSTAS=${HOSTAS:-$AS}
+ HOSTLD=${HOSTLD:-$LD}
+ HOSTAR=${HOSTAR:-$AR}
+ HOSTSTRIP=${HOSTSTRIP:-$STRIP}
+ HOSTOBJDUMP=${HOSTOBJDUMP:-$OBJDUMP}
+
+ if [ -n "$FLXCROSS" ]; then
+ CC=${FLXCROSS}${CC} ; CC=${FLXCROSSCC:-$CC}
+ AS=${FLXCROSS}${AS} ; AS=${FLXCROSSAS:-$AS}
+ LD=${FLXCROSS}${LD} ; LD=${FLXCROSSLD:-$LD}
+ AR=${FLXCROSS}${AR} ; AR=${FLXCROSSAR:-$AR}
+ STRIP=${FLXCROSS}${STRIP} ; STRIP=${FLXCROSSSTRIP:-$STRIP}
+ OBJDUMP=${FLXCROSS}${OBJDUMP} ; OBJDUMP=${FLXCROSSOBJDUMP:-$OBJDUMP}
+ fi
+ # specify that we don't want to do this again
+ FLX_CROSS_OPT_SET=1
+ fi
+
case "$FLXARCH" in
*86)
CC=${CC:-gcc}
@@ -1226,7 +1259,7 @@ function set_compiler_options {
esac
export FLX_ARCH_CURRENT FLX_ARCH_COMMON FLX_ARCH_SMALL
- export CC GCC_ARCH_CURRENT GCC_ARCH_COMMON GCC_ARCH_SMALL
+ export CC AS LD AR STRIP OBJDUMP GCC_ARCH_CURRENT GCC_ARCH_COMMON GCC_ARCH_SMALL
export GCC_CPU_CURRENT GCC_CPU_COMMON GCC_CPU_SMALL
export GCC_OPT_FASTEST GCC_OPT_FAST GCC_OPT_SMALL
diff --git a/wd/Makefile b/wd/Makefile
index a093caa..58650df 100644
--- a/wd/Makefile
+++ b/wd/Makefile
@@ -4,6 +4,6 @@ CFLAGS+=-fomit-frame-pointer
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
sstrip $@