macos: tell the compiler the system include path 36/13936/9
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Fri, 8 Nov 2019 02:56:13 +0000 (23:56 -0300)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 20 Dec 2019 15:42:12 +0000 (10:42 -0500)
In order to support multiple SDKs, macOS Catalina no longer has the
/usr/include directory. As a result, the compiler needs to know where
these headers can be found. To successfully build OpenAFS on OSX 10.15,
set KROOT so the compiler knows the correct location of these headers.

Change-Id: I5ef33b34b6a4e6111983a63a2d34326ca4af9d30
Reviewed-on: https://gerrit.openafs.org/13936
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>

src/cf/osconf.m4
src/config/Makefile.config.in
src/libafs/MakefileProto.DARWIN.in

index 24413ac..e5e484a 100644 (file)
@@ -333,6 +333,25 @@ case $AFS_SYSNAME in
                XLIBS="${LIB_AFSDB} -framework CoreFoundation"
                ;;
 
+       *_darwin_190)
+               AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
+               MT_CFLAGS="-D_REENTRANT"
+               MT_LIBS='${XLIBS}'
+               KROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'
+               KINCLUDES='-I$(KROOT)/System/Library/Frameworks/Kernel.framework/Headers'
+               LD="cc"
+               KERN_OPTMZ="-Os"
+               LWP_OPTMZ="-Os"
+               OPTMZ="-Os"
+               PAM_LIBS="-lpam"
+               REGEX_OBJ="regex.lo"
+               EXTRA_VLIBOBJS="fstab.o"
+               SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
+               SHLIB_SUFFIX="dylib"
+               RANLIB="ranlib"
+               XLIBS="${LIB_AFSDB} -framework CoreFoundation"
+               ;;
+
        ppc_linux*)
                KERN_OPTMZ=-O2
                MT_CFLAGS='-pthread -D_REENTRANT'
@@ -699,6 +718,8 @@ AC_SUBST(XLIBELFA)
 AC_SUBST(XLIBKVM)
 AC_SUBST(XLIBS)
 AC_SUBST(YACC)
+AC_SUBST(KROOT)
+AC_SUBST(KINCLUDES)
 
 
 ])
index a274925..3c908e7 100644 (file)
@@ -120,6 +120,8 @@ XLIBELFA = @XLIBELFA@
 XLIBKVM = @XLIBKVM@
 XLIBS = @XLIBS@
 YACC = @YACC@
+KROOT = @KROOT@
+KINCLUDES = @KINCLUDES@
 
 #
 # Install targets
index ef82474..95acd10 100644 (file)
@@ -40,7 +40,6 @@ AFS_OS_NONFSOBJS = osi_vfsops.o
 KDEFS=
 DBUG = 
 DEFINES= -D_KERNEL -DKERNEL -DKERNEL_PRIVATE -DDIAGNOSTIC -DUSE_SELECT -DMACH_USER_API -DMACH_KERNEL
-KINCLUDES=-I${KROOT}/System/Library/Frameworks/Kernel.framework/Headers
 
 <ppc_darwin_70 ppc_darwin_80 x86_darwin_80>
 KOPTS_DBUG=-g