Make SRCROOT the basis for relative paths, and let there be where the
"linux" link goes.
diff --git a/MCONFIG b/MCONFIG
index 39337be..a3a9b4e 100644
--- a/MCONFIG
+++ b/MCONFIG
@@ -7,11 +7,12 @@
CROSS =
CC = $(CROSS)gcc
LD = $(CROSS)ld
+KLIBSRC = $(SRCROOT)/klibc
REQFLAGS = -nostdinc -iwithprefix include -I$(KLIBSRC) \
-I$(KLIBSRC)/arch/$(ARCH)/include \
-I$(KLIBSRC)/include/bits$(BITSIZE) \
-DBITSIZE=$(BITSIZE) -I$(KLIBSRC)/include \
- -I$(KLIBSRC)/linux/include
+ -I$(SRCROOT)/linux/include
LDFLAGS =
AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib
diff --git a/ash/Makefile b/ash/Makefile
index 5f2e8df..99ad441 100644
--- a/ash/Makefile
+++ b/ash/Makefile
@@ -12,7 +12,7 @@
OBJS = $(OBJ1) $(OBJ2)
-KLIBSRC = ../klibc
+SRCROOT = ..
include ../MCONFIG
MAKEDEPS = -Wp,-MD,.$(subst /,-,$*).d
diff --git a/gzip/Makefile b/gzip/Makefile
index cb4f0f5..c33794f 100644
--- a/gzip/Makefile
+++ b/gzip/Makefile
@@ -16,12 +16,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-# $Id: Makefile,v 1.3 2002/08/21 08:38:07 rmk Exp $
+# $Id: Makefile,v 1.4 2002/08/23 21:06:05 hpa Exp $
#### Start of system configuration section. ####
-KLIBSRC = ../klibc
-
+SRCROOT = ..
include ../MCONFIG
include MCONFIG
diff --git a/klibc/MCONFIG b/klibc/MCONFIG
index 760ae78..71ba121 100644
--- a/klibc/MCONFIG
+++ b/klibc/MCONFIG
@@ -3,8 +3,7 @@
# Makefile configuration, without explicit rules
#
-KLIBSRC = .
-
+SRCROOT = ..
include ../MCONFIG
WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
diff --git a/klibc/README b/klibc/README
index 5e66a3a..ccbb719 100644
--- a/klibc/README
+++ b/klibc/README
@@ -7,13 +7,14 @@
The build procedure is not very polished yet, but it should work like
this:
-a) Create a symlink called "linux" pointing to a reasonably recent
- Linux kernel tree (2.4 or 2.5 should be OK.) This tree must have
- the include/asm symlink set up for the architecture you're
- compiling for, and include/linux/autoconf.h must exist. The
- easiest way to make sure of all of these is to do a "make config"
- or any of its variants on the kernel tree is question, followed by
- a "make dep".
+a) In the source root directory (the directory above the one in which
+ this file is found) create a symlink called "linux" pointing to a
+ reasonably recent Linux kernel tree (2.4 or 2.5 should be OK.)
+ This tree must have the include/asm symlink set up for the
+ architecture you're compiling for, and include/linux/autoconf.h
+ must exist. The easiest way to make sure of all of these is to do
+ a "make config" or any of its variants on the kernel tree is
+ question, followed by a "make dep".
b) If you're cross-compiling, change ARCH in the main MCONFIG file to
the appropriate architecture, and set CROSS to your toolchain
@@ -31,7 +32,8 @@
The following is the status of various architectures:
- Known to work: arm alpha i386 ppc sparc sparc64
+ Known to work: arm i386 sparc sparc64
+ Need crt0.S updates: alpha ppc
Missing setjmp: s390 s390x ppc64
May or may not work: x86_64
Need porting work: cris ia64 m68k mips64 parisc sh
diff --git a/klibc/__main.c b/klibc/__main.c
deleted file mode 100644
index 81a16f5..0000000
--- a/klibc/__main.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * __main.c
- *
- * Some architectures only have a minimal crt0.S stub. This completes
- * the initialization code.
- */
-
-#include <stdlib.h>
-#include <unistd.h>
-
-extern int main(int argc, char * const *argv, char * const *envp);
-
-void __main(int argc, char **argv, char **envp)
-{
- environ = envp;
- exit(main(argc, argv, envp));
-}
diff --git a/utils/Makefile b/utils/Makefile
index b84ee69..24f7b91 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -1,5 +1,4 @@
-KLIBSRC = ../klibc
-
+SRCROOT = ..
include ../MCONFIG
MAKEDEPS = -Wp,-MD,.$(subst /,-,$*).d