X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/734aad71947a79037af64f74c683f5eb36fe6065..8e029c653e0567df7ce6933dde41f5830dbbbcda:/Makefile diff --git a/Makefile b/Makefile index d640105..d8357bc 100644 --- a/Makefile +++ b/Makefile @@ -9,34 +9,73 @@ # # Yes, we build everything with -g, and strip it out later... # +# -faltivec now disables inlining, so we can't use it globally. Fortunately, +# only two files need altivec support, so we use file-specific CFLAGS to add +# the option when needed. +# LIB=c SHLIB_MAJOR= 1 SHLIB_MINOR= 0 .if (${MACHINE_ARCH} == unknown) -MACHINE_ARCH = ppc +MACHINE_ARCH != /usr/bin/arch .endif -.if (${MACHINE_ARCH} == ppc) -CFLAGS += -faltivec -DALTIVEC +.if !empty $(MACHINE_ARCH:M*64) +LP64 = 1 +.endif +CC = gcc-4.0 +# always set __DARWIN_UNIX03 to zero (variant will set to one) except for ppc64 +.ifdef LP64 +CFLAGS += -D__DARWIN_UNIX03=1 +.else +CFLAGS += -D__DARWIN_UNIX03=0 +.endif +CFLAGS += -D__LIBC__ -DNOID -I${.CURDIR}/include +.ifdef ALTLIBCHEADERS +INCLUDEDIR = ${ALTLIBCHEADERS} +CFLAGS += -I${INCLUDEDIR} .endif -CFLAGS += -DNOID -DALL_STATE -I${.CURDIR}/include -I${.CURDIR}/include/objc -PRIVINC = ${NEXT_ROOT}/System/Library/Frameworks/System.framework/PrivateHeaders -CFLAGS += -I${PRIVINC} +.ifdef ALTFRAMEWORKSPATH +PRIVINC = -F${ALTFRAMEWORKSPATH} -I${ALTFRAMEWORKSPATH}/System.framework/PrivateHeaders +.else +PRIVINC = -I${NEXT_ROOT}/System/Library/Frameworks/System.framework/PrivateHeaders +.endif +CFLAGS += ${PRIVINC} CFLAGS += -DLIBC_MAJOR=${SHLIB_MAJOR} -no-cpp-precomp -force_cpusubtype_ALL -CFLAGS += -arch ${MACHINE_ARCH} -fno-common -pipe -Wmost -g -CFLAGS += -finline-limit=5000 +CFLAGS += -fno-common -pipe -Wmost -g -D__FBSDID=__RCSID +CFLAGS += -finline-limit=1500 --param inline-unit-growth=200 -Winline AINC= -I${.CURDIR}/${MACHINE_ARCH} -no-cpp-precomp -force_cpusubtype_ALL AINC+=-arch ${MACHINE_ARCH} -g CLEANFILES+=tags INSTALL_PIC_ARCHIVE= yes PRECIOUSLIB= yes +# workaround for 3649783 +AINC += -fdollars-in-identifiers + +# ppc64 optimizer still blows up on some files, so we use -O0 to turn it +# off on a per file basis +.if (${MACHINE_ARCH} == ppc64) +OPTIMIZE-acl_entry.c = -O0 +# glob-fbsd.c fails with -static -Os (3869444) so turn off optimization +OPTIMIZE-glob-fbsd.c = -O0 +.endif + # If these aren't set give it expected defaults DSTROOT ?= / OBJROOT ?= . SRCROOT ?= ${.CURDIR} +.ifndef SYMROOT +SYMROOT = ${.CURDIR}/SYMROOT +_x_ != test -d ${SYMROOT} || mkdir -p ${SYMROOT} +.endif DESTDIR ?= ${DSTROOT} MAKEOBJDIR ?= ${OBJROOT} +CFLAGS += -I${SYMROOT} .include "${.CURDIR}/Makefile.inc" +.PATH: ${SYMROOT} .include "Makefile.xbs" +.if exists(/usr/share/mk/bsd.init.mk) +.include +.endif .include