autoconf: use AC_CHECK_TOOL for as and ld
[openafs.git] / src / cf / osconf.m4
index 69fd19c..42cddb5 100644 (file)
@@ -25,10 +25,10 @@ PAM_OPTMZ=
 
 dnl standard programs
 AC_PROG_RANLIB
-AC_CHECK_PROGS(AS, as, [false])
+AC_CHECK_TOOL(AS, as, [false])
 AC_CHECK_PROGS(MV, mv, [false])
 AC_CHECK_PROGS(RM, rm, [false])
-AC_CHECK_PROGS(LD, ld, [false])
+AC_CHECK_TOOL(LD, ld, [false])
 AC_CHECK_PROGS(CP, cp, [false])
 AC_CHECK_PROGS(GENCAT, gencat, [false])
 
@@ -197,7 +197,7 @@ case $AFS_SYSNAME in
                SHLIB_LINKER="${CC} -shared"
                ;;
 
-       ppc64_linux26)
+       ppc64_linux26|ppc64le_linux26)
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
@@ -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'
@@ -603,6 +622,7 @@ CFLAGS_NOERROR=
 CFLAGS_NOSTRICT=-fno-strict-aliasing
 CFLAGS_NOUNUSED=
 CFLAGS_NOOLDSTYLE=
+CFLAGS_NOIMPLICIT_FALLTHROUGH=
 XCFLAGS_NOCHECKING="$XCFLAGS"
 
 if test "x$GCC" = "xyes"; then
@@ -610,12 +630,14 @@ if test "x$GCC" = "xyes"; then
     XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith"
   fi
   if test "x$enable_checking" != "xno"; then
-    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith"
+    XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith -fno-common"
     CFLAGS_WERROR="-Werror"
     if test "x$enable_checking" != "xall"; then
       CFLAGS_NOERROR="-Wno-error"
       CFLAGS_NOUNUSED="-Wno-unused"
       CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
+      AX_APPEND_COMPILE_FLAGS([-Wno-implicit-fallthrough],
+                               [CFLAGS_NOIMPLICIT_FALLTHROUGH])
       AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
     else
       CFLAGS_NOSTRICT=
@@ -639,6 +661,11 @@ else
   esac
 fi
 
+dnl add additional checks if compilers support the flags
+AS_IF([test "x$enable_checking" != "xno"],
+      [AX_APPEND_COMPILE_FLAGS([-Wimplicit-fallthrough], [XCFLAGS])
+])
+
 dnl horribly cheating, assuming double / is ok.
 case $INSTALL in
   ./* ) 
@@ -691,6 +718,7 @@ AC_SUBST(CFLAGS_NOERROR)
 AC_SUBST(CFLAGS_NOSTRICT)
 AC_SUBST(CFLAGS_NOUNUSED)
 AC_SUBST(CFLAGS_NOOLDSTYLE)
+AC_SUBST(CFLAGS_NOIMPLICIT_FALLTHROUGH)
 AC_SUBST(CFLAGS_WERROR)
 AC_SUBST(XCFLAGS64)
 AC_SUBST(XLDFLAGS)
@@ -699,6 +727,8 @@ AC_SUBST(XLIBELFA)
 AC_SUBST(XLIBKVM)
 AC_SUBST(XLIBS)
 AC_SUBST(YACC)
+AC_SUBST(KROOT)
+AC_SUBST(KINCLUDES)
 
 
 ])