Build: check for gencat
[openafs.git] / src / cf / osconf.m4
index d5f42e8..f97bbc9 100644 (file)
@@ -4,8 +4,8 @@ AC_DEFUN([OPENAFS_OSCONF], [
 dnl defaults, override in case below as needed
 RXDEBUG="-DRXDEBUG"
 SHLIB_SUFFIX="so"
-CCOBJ="$CC"
-MT_CC="$CC"
+CCOBJ="\$(CC)"
+MT_CC="\$(CC)"
 XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} ${LIB_libintl}"
 MT_LIBS='-lpthread ${XLIBS}'
 XCFLAGS=
@@ -33,14 +33,13 @@ AC_CHECK_PROGS(LD, ld, [${am_missing_run}ld])
 AC_CHECK_PROGS(CP, cp, [${am_missing_run}cp])
 AC_CHECK_PROGS(STRIP, strip, [${am_missing_run}strip])
 AC_CHECK_PROGS(LORDER, lorder, [${am_missing_run}lorder])
+AC_CHECK_PROGS(GENCAT, gencat, [${am_missing_run}gencat])
 
 dnl TODO - need to disable STRIP if we are doing debugging in any user space code
 
 case $AFS_SYSNAME in
        alpha_dux40)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                CSTATIC="-non_shared"
                DBG="-g3"
                MT_CFLAGS='-D_REENTRANT=1 -pthread'
@@ -51,8 +50,6 @@ case $AFS_SYSNAME in
 
        alpha_dux50 | alpha_dux51)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                DBG="-g3"
                CSTATIC="-non_shared"
                LWP_OPTMZ="-O2"
@@ -63,34 +60,32 @@ case $AFS_SYSNAME in
                ;;
 
        alpha_linux_22 | alpha_linux_24 | alpha_linux_26)
-               CCOBJ="${CC} -fPIC"
+               CCOBJ="\$(CC) -fPIC"
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        arm_linux_24 | arm_linux26)
-               CCOBJ="${CC} -fPIC"
+               CCOBJ="\$(CC) -fPIC"
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        hp_ux102)
                AS="/usr/ccs/bin/as"
                CC="/opt/ansic/bin/cc -Ae"
-               CCOBJ="/opt/ansic/bin/cc -Ae"
                DBM="/lib/libndbm.a"
                LD="/bin/ld"
                LEX="/opt/langtools/bin/lex"
                LWP_OPTMZ="-O"
-               MT_CC="/opt/ansic/bin/cc -Ae"
                MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
                MT_LIBS='-L/opt/dce/lib -ldce ${XLIBS}'
                MV="/bin/mv"
@@ -113,12 +108,10 @@ case $AFS_SYSNAME in
                AR="/usr/bin/ar"
                AS="/usr/ccs/bin/as"
                CC="/opt/ansic/bin/cc"
-               CCOBJ="/opt/ansic/bin/cc"
                DBM="/lib/libndbm.a"
                LD="/bin/ld   "
                LEX="/opt/langtools/bin/lex"
                LWP_OPTMZ="-O"
-               MT_CC="$CC"
                MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
                MV="/bin/mv"
                OPTMZ="-O"
@@ -141,12 +134,10 @@ case $AFS_SYSNAME in
                AR="/usr/bin/ar"
                AS="/usr/ccs/bin/as"
                CC="/opt/ansic/bin/cc"
-               CCOBJ="/opt/ansic/bin/cc"
                DBM="/lib/hpux32/libndbm.so"
                LD="/bin/ld   "
                LEX="/opt/langtools/bin/lex"
                LWP_OPTMZ=""
-               MT_CC="$CC"
                MT_CFLAGS='-D_POSIX_C_SOURCE=199506L'
                MV="/bin/mv"
                OPTMZ="-O"
@@ -170,7 +161,7 @@ case $AFS_SYSNAME in
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-pipe -fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS="-pipe"
                ;;
 
@@ -179,7 +170,7 @@ case $AFS_SYSNAME in
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-pipe -fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS="-pipe"
                ;;
 
@@ -187,7 +178,7 @@ case $AFS_SYSNAME in
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_CFLAGS="-O2 -pipe -fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS="-O2 -pipe -fPIC"
                ;;
 
@@ -197,7 +188,7 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-pipe -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS="-pipe"
                ;;
 
@@ -206,7 +197,7 @@ case $AFS_SYSNAME in
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-pipe -fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS="-pipe"
                ;;
 
@@ -218,18 +209,18 @@ case $AFS_SYSNAME in
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
                XCFLAGS="-G0"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        amd64_linux*)
-               CCOBJ="${CC} -fPIC"
+               CCOBJ="\$(CC) -fPIC"
                KERN_OPTMZ=-O2
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        ppc64_linux24 | ppc64_linux26)
@@ -238,7 +229,7 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
                SHLIB_CFLAGS="-fPIC"
-               SHLIB_LINKER="${MT_CC} -shared -m64"
+               SHLIB_LINKER="${CC} -shared -m64"
                XCFLAGS="-m64"
                XLDFLAGS="-m64"
                ASFLAGS="-a64"
@@ -255,7 +246,7 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        i386_umlinux22 | i386_umlinux24 | i386_umlinux26)
@@ -268,7 +259,7 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        *_obsd*)
@@ -280,7 +271,7 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-pipe -fpic"
                SHLIB_CFLAGS="-fpic"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                XCFLAGS=
                ;;
 
@@ -291,13 +282,11 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        ppc_darwin_70)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
                MT_CFLAGS='-D_REENTRANT'
                KROOT=
@@ -307,15 +296,13 @@ case $AFS_SYSNAME in
                REGEX_OBJ_PIC="regex_pic.o"
                XCFLAGS="-no-cpp-precomp"
                EXTRA_VLIBOBJS="fstab.o"
-               SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
+               SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
                SHLIB_SUFFIX="dylib"
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
                ;;
 
        *_darwin_80)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                AFSD_LDFLAGS="-F/System/Library/PrivateFrameworks -framework DiskArbitration -framework SystemConfiguration -framework IOKit -framework CoreFoundation"
                MT_CFLAGS="-D_REENTRANT"
                KROOT=
@@ -326,7 +313,7 @@ case $AFS_SYSNAME in
                REGEX_OBJ="regex.o"
                REGEX_OBJ_PIC="regex_pic.o"
                EXTRA_VLIBOBJS="fstab.o"
-               SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
+               SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
                SHLIB_SUFFIX="dylib"
                RANLIB="ranlib -c"
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
@@ -344,7 +331,7 @@ case $AFS_SYSNAME in
                REGEX_OBJ="regex.o"
                REGEX_OBJ_PIC="regex_pic.o"
                EXTRA_VLIBOBJS="fstab.o"
-               SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
+               SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
                SHLIB_SUFFIX="dylib"
                RANLIB="ranlib -c"
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
@@ -364,7 +351,7 @@ case $AFS_SYSNAME in
                REGEX_OBJ="regex.o"
                TXLIBS="-lncurses"
                EXTRA_VLIBOBJS="fstab.o"
-               SHLIB_LINKER="${MT_CC} -dynamiclib"
+               SHLIB_LINKER="${CC} -dynamiclib"
                SHLIB_SUFFIX="dylib"
                RANLIB="ranlib"
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
@@ -384,7 +371,7 @@ case $AFS_SYSNAME in
                REGEX_OBJ="regex.o"
                REGEX_OBJ_PIC="regex_pic.o"
                EXTRA_VLIBOBJS="fstab.o"
-               SHLIB_LINKER="${MT_CC} \${ARCHFLAGS} -dynamiclib"
+               SHLIB_LINKER="${CC} \${ARCHFLAGS} -dynamiclib"
                SHLIB_SUFFIX="dylib"
                RANLIB="ranlib"
                XLIBS="${LIB_AFSDB} ${XBSA_XLIBS} -framework CoreFoundation"
@@ -397,12 +384,11 @@ case $AFS_SYSNAME in
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        rs_aix42)
                CC="cc"
-               CCOBJ="cc"
                DBG=""
                LIBSYS_AIX_EXP="afsl.exp"
                MT_CC="xlc_r"
@@ -416,7 +402,6 @@ case $AFS_SYSNAME in
 
        rs_aix51 | rs_aix52 | rs_aix53) 
                CC="cc"
-               CCOBJ="cc"
                DBG="-g"
                LIBSYS_AIX_EXP="afsl.exp"
                MT_CC="xlc_r"
@@ -430,7 +415,6 @@ case $AFS_SYSNAME in
 
        rs_aix61)       
                CC="cc"
-               CCOBJ="cc"
                DBG="-g"
                LIBSYS_AIX_EXP="afsl.exp"
                MT_CC="xlc_r"
@@ -445,20 +429,18 @@ case $AFS_SYSNAME in
        s390_linux22|s390_linux24|s390_linux26)
                LD="ld"
                KERN_OPTMZ=-O2
-               MT_CC="$CC"
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O2
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
                SHLIB_CFLAGS="-fPIC"
                SHLIB_LDFLAGS="-shared -Xlinker -x"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        s390x_linux24|s390x_linux26)
-               CCOBJ="${CC} -fPIC"
+               CCOBJ="\$(CC) -fPIC"
                LD="ld"
                KERN_OPTMZ=-O2
-               MT_CC="$CC"
                MT_CFLAGS='-pthread -D_REENTRANT'
                PAM_OPTMZ=-O
                PAM_CFLAGS="-Dlinux -DLINUX_PAM -fPIC"
@@ -466,13 +448,11 @@ case $AFS_SYSNAME in
                SHLIB_LDFLAGS="-shared -Xlinker -x -Xlinker -Bsymbolic"
                OPTMZ=-O
                XCFLAGS="-D__s390x__"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        sgi_62)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
                FSINCLUDES="-I/usr/include/sys/fs"
                MT_CFLAGS='-D_SGI_MP_SOURCE'
@@ -485,8 +465,6 @@ case $AFS_SYSNAME in
 
        sgi_63)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                AFSD_LIBS="/usr/lib/libdwarf.a /usr/lib/libelf.a"
                FSINCLUDES="-I/usr/include/sys/fs"
                MT_CFLAGS='-D_SGI_MP_SOURCE'
@@ -499,8 +477,6 @@ case $AFS_SYSNAME in
 
        sgi_64)
                CC="cc"
-               CCOBJ="cc"
-               MT_CC="cc"
                AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
                FSINCLUDES="-I/usr/include/sys/fs"
                MT_CFLAGS='-D_SGI_MP_SOURCE'
@@ -514,10 +490,8 @@ case $AFS_SYSNAME in
        sgi_65)
                AFSD_LIBS="/usr/lib32/libdwarf.a /usr/lib32/libelf.a"
                CC="/usr/bin/cc"
-               CCOBJ="/usr/bin/cc"
                FSINCLUDES="-I/usr/include/sys/fs"
                LD="/usr/bin/ld"
-               MT_CC="/usr/bin/cc"
                MT_CFLAGS='-D_SGI_MP_SOURCE'
                XCFLAGS64="-64 -mips3"
                XCFLAGS="-n32 -mips3 -woff 1009,1014,1110,1116,1164,1171,1177,1183,1185,1204,1233,1515,1516,1548,1169,1174,1177,1196,1498,1506,1552,3201 -Wl,-woff,84,-woff,15"
@@ -535,14 +509,12 @@ case $AFS_SYSNAME in
                SHLIB_LDFLAGS="-shared -Xlinker -x"
                XCFLAGS64="-m64"
                XLDFLAGS64="-m64"
-               SHLIB_LINKER="${MT_CC} -shared"
+               SHLIB_LINKER="${CC} -shared"
                ;;
 
        sun4x_58|sun4x_59)
                CC=$SOLARISCC
-               CCOBJ=$SOLARISCC
                LD="/usr/ccs/bin/ld"
-               MT_CC=$SOLARISCC
                MT_CFLAGS='-mt'
                PAM_CFLAGS="-KPIC"
                PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
@@ -559,9 +531,7 @@ case $AFS_SYSNAME in
 
        sun4x_510)
                CC=$SOLARISCC
-               CCOBJ=$SOLARISCC
                LD="/usr/ccs/bin/ld"
-               MT_CC=$SOLARISCC
                MT_CFLAGS='-mt'
                PAM_CFLAGS="-KPIC"
                PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
@@ -578,9 +548,7 @@ case $AFS_SYSNAME in
 
        sun4x_511)
                CC=$SOLARISCC
-               CCOBJ=$SOLARISCC
                LD="/usr/ccs/bin/ld"
-               MT_CC=$SOLARISCC
                MT_CFLAGS='-mt'
                PAM_CFLAGS="-KPIC"
                PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
@@ -597,9 +565,7 @@ case $AFS_SYSNAME in
 
        sunx86_58|sunx86_59)
                CC=$SOLARISCC
-               CCOBJ=$SOLARISCC
                LD="/usr/ccs/bin/ld"
-               MT_CC=$SOLARISCC
                MT_CFLAGS='-mt'
                PAM_CFLAGS="-KPIC"
                PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
@@ -627,9 +593,8 @@ case $AFS_SYSNAME in
                        XARCHFLAGS="-m64"
                fi
                CC=$SOLARISCC
-               CCOBJ=$SOLARISCC
+               CFLAGS="$CFLAGS $XARCHFLAGS"
                LD="/usr/ccs/bin/ld"
-               MT_CC=$SOLARISCC
                MT_CFLAGS='-mt'
                PAM_CFLAGS="-KPIC"
                PAM_LIBS="-lc -lpam -lsocket -lnsl -lm"
@@ -652,6 +617,20 @@ esac
 MT_CFLAGS="${MT_CFLAGS} -DAFS_PTHREAD_ENV"
 
 #
+# Defaults for --enable-optimize-kernel
+#
+if test "x$enable_optimize_kernel" = "x" ; then
+  AS_CASE([$AFS_SYSNAME],
+    [sunx86_510|sunx86_511],
+      dnl Somewhere around Solaris Studio 12.*, the compiler started adding SSE
+      dnl instructions to optimized code, without any ability to turn it off.
+      dnl So just default to not optimizing kernel code for the relevant
+      dnl platforms, until we get a better autoconf test for this.
+      [enable_optimize_kernel=no],
+    [enable_optimize_kernel=yes])
+fi
+
+#
 # Special build targets
 #
 case $AFS_SYSNAME in
@@ -665,6 +644,12 @@ case $AFS_SYSNAME in
                AC_SUBST(install_XFS_SIZE_CHECK)
                AC_SUBST(dest_XFS_SIZE_CHECK)
        ;;
+       *_fbsd_*)
+               if test "x$enable_debug_kernel" = "xyes"; then
+                       DEBUG_FLAGS=-g
+                       AC_SUBST(DEBUG_FLAGS)
+               fi
+       ;;
 esac
 
 dnl Disable the default for debugging/optimization if not enabled