X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=klibc%2FMCONFIG;h=1141b78d474bed1d9c2361240dd11d1e4ce1b9e0;hp=a7b2cb1bf36865eed26215e1674086c457c7fec8;hb=cb948532ff3cb7edf1d2eead7a5cce9e8a1a7a97;hpb=e5f053b5312a0f8d62a2bcff8ddb095052d228bc diff --git a/klibc/MCONFIG b/klibc/MCONFIG index a7b2cb1bf..1141b78d4 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -3,6 +3,14 @@ # Makefile configuration, without explicit rules # +# CROSS is the prefix used for system tools like gcc, ld etc. +CROSS = + +# KCROSS is the prefix we use for klibc installations. This is usually +# the same as CROSS, but may be different, e.g. to install an i386 +# cross-compilation suite on an x86-64 system, using the same gcc/binutils. +KCROSS ?= $(CROSS) + # Location for installation prefix = /usr bindir = $(prefix)/bin @@ -21,8 +29,11 @@ OBJROOT = $(SRCROOT) KRNLSRC = $(SRCROOT)/linux KRNLOBJ = $(SRCROOT)/linux +# klibc version information +KLIBCVER = -D__KLIBC__=$(shell cut -d. -f1 < $(SRCROOT)/version) \ + -D__KLIBC_MINOR__=$(shell cut -d. -f2 < $(SRCROOT)/version) + ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) -CROSS = CC = $(CROSS)gcc LD = $(CROSS)ld KLIBSRC = $(SRCROOT)/klibc @@ -31,7 +42,7 @@ INCLUDE = -I$(SRCROOT)/include/arch/$(ARCH) \ -I$(SRCROOT)/include/bits$(BITSIZE) \ -I$(SRCROOT)/include \ -I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include -REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -D__KLIBC__ \ +REQFLAGS = $(ARCHREQFLAGS) $(KLIBCVER) -nostdinc -iwithprefix include \ $(INCLUDE) LDFLAGS = AR = $(CROSS)ar @@ -52,7 +63,7 @@ HOST_LIBS = # Static library paths CRT0 = $(KLIBOBJ)/crt0.o KLIBC = $(KLIBOBJ)/libc.a -LIBGCC = $(shell $(CC) --print-libgcc) +LIBGCC = $(shell $(CC) $(REQFLAGS) $(OPTFLAGS) --print-libgcc) # Shared library paths CRTSHARED = $(KLIBOBJ)/interp.o