summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
Diffstat (limited to 'extra')
-rw-r--r--extra/Configs/Config.arm33
-rw-r--r--extra/Configs/Config.i38633
-rw-r--r--extra/Configs/Config.m68k33
-rw-r--r--extra/Configs/Config.mips33
-rw-r--r--extra/Configs/Config.mipsel33
-rw-r--r--extra/Configs/Config.powerpc33
-rw-r--r--extra/Configs/Config.sh34
-rw-r--r--extra/Configs/Config.x8633
-rw-r--r--extra/gcc-uClibc/Makefile25
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c82
10 files changed, 204 insertions, 168 deletions
diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
index 603ae7e07..85f3cab74 100644
--- a/extra/Configs/Config.arm
+++ b/extra/Configs/Config.arm
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.i386 b/extra/Configs/Config.i386
index 47d422289..0897d9a1f 100644
--- a/extra/Configs/Config.i386
+++ b/extra/Configs/Config.i386
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.m68k b/extra/Configs/Config.m68k
index f1f8ed8e7..8ae75d2fb 100644
--- a/extra/Configs/Config.m68k
+++ b/extra/Configs/Config.m68k
@@ -129,23 +129,26 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = true
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /opt/uClinux/$(TARGET_ARCH)-pic-elf
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /opt/uClinux/$(TARGET_ARCH)-pic-elf
+TARGET_PREFIX =
#
# ARCH_CFLAGS if your have something special to add to the CFLAGS
diff --git a/extra/Configs/Config.mips b/extra/Configs/Config.mips
index a3a45c623..ea989a596 100644
--- a/extra/Configs/Config.mips
+++ b/extra/Configs/Config.mips
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.mipsel b/extra/Configs/Config.mipsel
index a3a45c623..ea989a596 100644
--- a/extra/Configs/Config.mipsel
+++ b/extra/Configs/Config.mipsel
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.powerpc b/extra/Configs/Config.powerpc
index 703298958..6b96f8c77 100644
--- a/extra/Configs/Config.powerpc
+++ b/extra/Configs/Config.powerpc
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.sh b/extra/Configs/Config.sh
index 77a0b0b1a..82ff6daf3 100644
--- a/extra/Configs/Config.sh
+++ b/extra/Configs/Config.sh
@@ -150,21 +150,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /opt/uClinux/$(TARGET_ARCH)-pic-elf
-
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /opt/uClinux/$(TARGET_ARCH)-pic-elf
+TARGET_PREFIX =
diff --git a/extra/Configs/Config.x86 b/extra/Configs/Config.x86
index 47d422289..0897d9a1f 100644
--- a/extra/Configs/Config.x86
+++ b/extra/Configs/Config.x86
@@ -129,20 +129,23 @@ DOLFS = false
# disabled. This is off by default.
INCLUDE_RPC = false
-# Installation location. For the default uClinux installation from
-# Lineo for m68k, it should be:
-# /opt/uClinux/m68k-pic-coff
-# so includes installed in: /opt/uClinux/m68k-pic-coff/include
-# libc.a and crt0.o in: /opt/uClinux/m68k-pic-coff/lib
-#
-# For ARM it should be:
-# /opt/uClinux/arm-pic-elf
-# so includes installed in: /opt/uClinux/arm-pic-elf/include
-# libc.a and crt0.o in: /opt/uClinux/arm-pic-elf/lib
+# ROOT_DIR is the base directory which will be compiled into the uClibc
+# runtime environment. When compiled as a shared library, the shared
+# library loader will look in <ROOT_DIR>/lib and <ROOT_DIR>/usr/lib
+# for shared libraries.
#
-# For x86 this should be:
-# /usr/i386-linux-uclibc
-# so includes installed in: /usr/i386-linux-uclibc/include
-# libc.a, libc.so.#, crt0.o in: /usr/i386-linux-uclibc/lib
+# DEVEL_PREFIX is the base directory which will be compiled into the uClibc
+# development environment. The uClibc development environment will
+# look for the uClibc header files under <DEVEL_PREFIX><ROOT_DIR>/usr/include,
+# and for static libs and crt0.o in <DEVEL_PREFIX><ROOT_DIR>/usr/lib.
+# Also, 'make install' will install the compiler tools to
+# <DEVEL_PREFIX><ROOT_DIR>/bin and <DEVEL_PREFIX><ROOT_DIR>/usr/bin.
#
-INSTALL_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+# TARGET_PREFIX is the directory under which 'make install' will install the
+# uClibc runtime environment. This path does not get compiled into anything,
+# and is provided simply to make it easier to build standalone target systems.
+# Note: This doesn't do anything if there are no shared libs.
+
+DEVEL_PREFIX =
+ROOT_DIR = /usr/$(TARGET_ARCH)-linux-uclibc
+TARGET_PREFIX =
diff --git a/extra/gcc-uClibc/Makefile b/extra/gcc-uClibc/Makefile
index 71e31620c..3cfdad478 100644
--- a/extra/gcc-uClibc/Makefile
+++ b/extra/gcc-uClibc/Makefile
@@ -11,7 +11,8 @@ all: gcc-uClibc ld-uClibc
gcc-uClibc.h: clean
@echo "/* this file was autogenerated by make */" > gcc-uClibc.h
- @echo "#define UCLIBC_INSTALL_DIR " \"$(INSTALL_DIR)/\" >> gcc-uClibc.h
+ @echo "#define UCLIBC_ROOT_DIR " \"$(ROOT_DIR)\" >> gcc-uClibc.h
+ @echo "#define UCLIBC_DEVEL_PREFIX " \"$(DEVEL_PREFIX)\" >> gcc-uClibc.h
@echo "#define UCLIBC_BUILD_DIR " \"$(UCLIBC_DIR)/\" >> gcc-uClibc.h
@echo "#define GCC_BIN " \"$(GCC_BIN)\" >> gcc-uClibc.h
@echo "#define GCC_LIB " \"$(GCC_LIB)\" >> gcc-uClibc.h
@@ -25,28 +26,28 @@ gcc-uClibc: gcc-uClibc.h gcc-uClibc.c
ld-uClibc:
@echo "#!/bin/sh" > $(TARGET_ARCH)-uclibc-ld
@echo "# This file was autogenerated by make" >> $(TARGET_ARCH)-uclibc-ld
- @echo "$(LD_BIN) -L- -L$(INSTALL_DIR)/lib -L$(INSTALL_DIR)/usr/lib "\
+ @echo "$(LD_BIN) -L- -L$(DEVEL_PREFIX)$(ROOT_DIR)/lib -L$(DEVEL_PREFIX)$(ROOT_DIR)/usr/lib "\
"-L$(UCLIBC_DIR) \$$@" >> $(TARGET_ARCH)-uclibc-ld
chmod a+x $(TARGET_ARCH)-uclibc-ld
install: all
- install -d $(INSTALL_DIR)/bin;
- install -d $(INSTALL_DIR)/usr/bin;
+ install -d $(DEVEL_PREFIX)$(ROOT_DIR)/bin;
+ install -d $(DEVEL_PREFIX)$(ROOT_DIR)/usr/bin;
if [ -x ./$(TARGET_ARCH)-uclibc-gcc ] ; then \
- install -m 755 $(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/usr/bin/ ; \
- install -m 755 $(TARGET_ARCH)-uclibc-ld $(INSTALL_DIR)/usr/bin/ ; \
- ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/cc; \
- ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/bin/gcc; \
- ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-ld $(INSTALL_DIR)/bin/ld; \
- ln -fs $(TARGET_ARCH)-uclibc-gcc $(INSTALL_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-cc; \
+ install -m 755 $(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)$(ROOT_DIR)/usr/bin/ ; \
+ install -m 755 $(TARGET_ARCH)-uclibc-ld $(DEVEL_PREFIX)$(ROOT_DIR)/usr/bin/ ; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)$(ROOT_DIR)/bin/cc; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)$(ROOT_DIR)/bin/gcc; \
+ ln -fs ../usr/bin/$(TARGET_ARCH)-uclibc-ld $(DEVEL_PREFIX)$(ROOT_DIR)/bin/ld; \
+ ln -fs $(TARGET_ARCH)-uclibc-gcc $(DEVEL_PREFIX)$(ROOT_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-cc; \
fi;
for app in addr2line ar as cpp gasp nm objcopy \
objdump ranlib readelf size strings strip; do \
- ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/bin/$${app}; \
+ ln -fs `which $(CROSS)$${app}` $(DEVEL_PREFIX)$(ROOT_DIR)/bin/$${app}; \
done;
for app in addr2line ar as cpp gasp nm objcopy \
objdump ranlib readelf size strings strip; do \
- ln -fs `which $(CROSS)$${app}` $(INSTALL_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-$${app}; \
+ ln -fs `which $(CROSS)$${app}` $(DEVEL_PREFIX)$(ROOT_DIR)/usr/bin/$(TARGET_ARCH)-uclibc-$${app}; \
done;
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c
index 9c6cec3eb..2cbf7f3d4 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -36,6 +36,29 @@
*
* The wrapper now displays the command line passed to gcc when '-v' is used.
*
+ * May 31, 2001
+ *
+ * "rpath" and "build" behavior are now decoupled. You can of course get
+ * the old "build" behavior by setting UCLIBC_GCC="rpath-build". Order
+ * isn't important here, as only the substrings are searched for.
+ *
+ * Added environment variable check for UCLIBC_GCC_DLOPT to let user specify
+ * an alternative dynamic linker at runtime without using command line args.
+ * Since this wouldn't commonly be used, I made it easy on myself. You have
+ * to match the option you would have passed to the gcc wrapper. As an
+ * example,
+ *
+ * export UCLIBC_GCC_DLOPT="-Wl,--dynamic-linker,/lib/ld-alt-linker.so.3"
+ *
+ * This is really only useful if target arch == devel arch and DEVEL_PREFIX
+ * isn't empty. It involves a recompile, but you can at least test apps
+ * on your devel system if combined with the "rpath" behavor if by using
+ * LD_LIBRARY_PATH, etc.
+ *
+ * Also added check for "-Wl,--dynamic-linker" on the command line. The
+ * use default dynamic linker or the envirnment-specified dynamic linker
+ * is disabled in that case.
+ *
*/
/*
@@ -51,34 +74,32 @@
#include "gcc-uClibc.h"
-#if 0
static char *rpath_link[] = {
- "-Wl,-rpath-link,"UCLIBC_INSTALL_DIR"lib",
- "-Wl,-rpath-link,"UCLIBC_BUILD_DIR"lib"
+ "-Wl,-rpath-link,"UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/lib",
+ "-Wl,-rpath-link,"UCLIBC_BUILD_DIR"/lib"
};
static char *rpath[] = {
- "-Wl,-rpath,"UCLIBC_INSTALL_DIR"lib",
- "-Wl,-rpath,"UCLIBC_BUILD_DIR"lib"
+ "-Wl,-rpath,"UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/lib",
+ "-Wl,-rpath,"UCLIBC_BUILD_DIR"/lib"
};
-#endif
static char *uClibc_inc[] = {
- "-I"UCLIBC_INSTALL_DIR"usr/include/",
- "-I"UCLIBC_BUILD_DIR"include/"
+ "-I"UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/usr/include/",
+ "-I"UCLIBC_BUILD_DIR"/include/"
};
static char *crt0_path[] = {
- UCLIBC_INSTALL_DIR"lib/crt0.o",
- UCLIBC_BUILD_DIR"lib/crt0.o"
+ UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/usr/lib/crt0.o",
+ UCLIBC_BUILD_DIR"/lib/crt0.o"
};
static char *lib_path[] = {
- "-L"UCLIBC_INSTALL_DIR"lib",
- "-L"UCLIBC_BUILD_DIR"lib"
+ "-L"UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/lib",
+ "-L"UCLIBC_BUILD_DIR"/lib"
};
-static char *usr_lib_path = "-L"UCLIBC_INSTALL_DIR"usr/lib";
+static char *usr_lib_path = "-L"UCLIBC_DEVEL_PREFIX UCLIBC_ROOT_DIR"/usr/lib";
static char static_linking[] = "-static";
static char nostdinc[] = "-nostdinc";
@@ -93,8 +114,14 @@ int main(int argc, char **argv)
int source_count = 0, use_rpath = 0, verbose = 0;
int i, j;
char ** gcc_argv;
+ char *dlstr;
char *ep;
+ dlstr = getenv("UCLIBC_GCC_DLOPT");
+ if (!dlstr) {
+ dlstr = "-Wl,--dynamic-linker," DYNAMIC_LINKER;
+ }
+
ep = getenv("UCLIBC_GCC");
if (!ep) {
ep = "";
@@ -102,7 +129,8 @@ int main(int argc, char **argv)
if ((strstr(argv[0],"build") != 0) || (strstr(ep,"build") != 0)) {
use_build_dir = 1;
- }
+
+}
if ((strstr(argv[0],"rpath") != 0) || (strstr(ep,"rpath") != 0)) {
use_rpath = 1;
@@ -144,6 +172,9 @@ int main(int argc, char **argv)
if (strstr(argv[i],static_linking) != 0) {
use_static_linking = 1;
}
+ if (strstr(argv[i],"--dynamic-linker") != 0) {
+ dlstr = 0;
+ }
}
break;
case '-':
@@ -177,33 +208,14 @@ int main(int argc, char **argv)
}
if (linking && source_count) {
if (!use_static_linking) {
- if (DYNAMIC_LINKER[0]) { /* not empty string */
-#if 1
- gcc_argv[i++] = "-Wl,--dynamic-linker,"DYNAMIC_LINKER;
- if (strstr(DYNAMIC_LINKER,"uclibc") != 0) { /* custom linker */
- use_rpath = 0; /* so -rpath not needed for normal case */
- }
-#else
- char *dlstr = "-Wl,--dynamic-linker,"DYNAMIC_LINKER;
- if (strstr(DYNAMIC_LINKER,"uclibc") != 0) { /* custom linker */
- use_rpath = 0; /* so -rpath not needed for normal case */
- if (use_build_dir) {
- dlstr = "-Wl,--dynamic-linker," \
- UCLIBC_BUILD_DIR DYNAMIC_LINKER;
- }
- }
+ if (dlstr) {
gcc_argv[i++] = dlstr;
-#endif
}
-#if 0
- if (use_build_dir || use_rpath) {
+ if (use_rpath) {
gcc_argv[i++] = rpath[use_build_dir];
}
-#endif
}
-#if 0
gcc_argv[i++] = rpath_link[use_build_dir]; /* just to be safe */
-#endif
gcc_argv[i++] = lib_path[use_build_dir];
if (!use_build_dir) {
gcc_argv[i++] = usr_lib_path;