summaryrefslogtreecommitdiff
path: root/extra/gcc-uClibc
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-04-06 20:17:32 +0000
committerEric Andersen <andersen@codepoet.org>2001-04-06 20:17:32 +0000
commite990ae71cb9dd42420def6c832f0094500722219 (patch)
tree20045df0b69120d02bd3d4a6a6d8f9004ec0afd0 /extra/gcc-uClibc
parentd4d02ff6bdd4003ca80294f31d9ddd5e5585c199 (diff)
Make a naming change to be consistent with other cross compiling tools.
Set up a default lib dir off the root of the uClibc compile dir. This really needs more thought, but is good enough for now I think.
Diffstat (limited to 'extra/gcc-uClibc')
-rw-r--r--extra/gcc-uClibc/Makefile30
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c8
2 files changed, 12 insertions, 26 deletions
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile
index 4038142bf..7878c880f 100644
--- a/extra/gcc-uClibc/Makefile
+++ b/extra/gcc-uClibc/Makefile
@@ -1,4 +1,3 @@
-
TOPDIR = ../../
include $(TOPDIR)Rules.mak
@@ -16,16 +15,10 @@ GCC_BIN = $(CC)
GCC_LIB = $(shell $(CC) -print-libgcc-file-name )
#GCCINCDIR inherited from Rules.mak
-NATIVE_ARCH = $(shell uname -m | sed -e 's/i.86/i386/' -e 's/sparc.*/sparc/' -e 's/arm.*/arm/g' -e 's/m68k.*/m68k/')
-GCC_UCLIBC = gcc-uClibc-cross
-ifeq ($(TARGET_ARCH), $(NATIVE_ARCH))
- GCC_UCLIBC = gcc-uClibc-native
-endif
-
-all: $(GCC_UCLIBC)
+all: gcc-uClibc
clean:
- rm -f gcc-uClibc.h gcc-uClibc-* core
+ rm -f gcc-uClibc.h *-gcc-uclibc core
gcc-uClibc.h: clean
@echo "/* this file is created by make */" > gcc-uClibc.h
@@ -36,21 +29,6 @@ gcc-uClibc.h: clean
@echo "#define TARGET_ARCH " \"$(TARGET_ARCH)\" >> gcc-uClibc.h
@echo "#define DYNAMIC_LINKER " \"$(DYNAMIC_LINKER)\" >> gcc-uClibc.h
-# uClibc built for native environment, so why not use it ;-)
-# Use the system libc instead of uClibc, to facilitate bootstrapping
-# new architectures.
-#gcc-uClibc-native: gcc-uClibc.h gcc-uClibc.c
-# $(CC) $(CFLAGS) -nostdinc -I$(UCLIBC_DIR)/include -I$(GCC_INC) \
-# -Wl,-static gcc-uClibc.c \
-# $(UCLIBC_DIR)/crt0.o \
-# -nostdlib $(GCC_LIB) $(UCLIBC_DIR)/libc.a \
-# -s -o gcc-uClibc-$(TARGET_ARCH) #-DDEBUG
-
-gcc-uClibc-native: gcc-uClibc.h gcc-uClibc.c
-# don't use CFLAGS since may not be appropriate
- gcc -s gcc-uClibc.c -o gcc-uClibc-$(TARGET_ARCH)
-
-gcc-uClibc-cross: gcc-uClibc.h gcc-uClibc.c
-# don't use CFLAGS since may not be appropriate
- gcc -s gcc-uClibc.c -o gcc-uClibc-$(TARGET_ARCH)
+gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
+ gcc -Wall -O2 -s gcc-uClibc.c -o $(TARGET_ARCH)-uclibc-gcc
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c
index a628705ea..5abad4c8f 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -48,6 +48,14 @@ int main(int argc, char **argv)
char ** gcc_argv;
source_count = 0;
+ /* FIXME: We need to work out the install vs use-in-built-dir
+ * issue..*/
+ /* Apparently gcc doesn't accept this stuff via the command line */
+ setenv("COMPILER_PATH", UCLIBC_DIR"extra/gcc-uClibc/", 1);
+ setenv("LIBRARY_PATH", UCLIBC_DIR"lib/", 1);
+ /* The double '/' works around a gcc bug */
+ setenv("GCC_EXEC_PREFIX", UCLIBC_DIR"extra/gcc-uClibc//", 1);
+
for ( i = 1 ; i < argc ; i++ ) {
if (argv[i][0] == '-') { /* option */