AC_VALIDATE_CACHE_SYSTEM_TYPE
SAMBA_MAINTAINER_MODE
+#
+# Config CPPFLAG settings for strange OS's that must be set
+# before other tests.
+#
+case "$host_os" in
+# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
+ *hpux*)
+ AC_PROG_CC_FLAG(Ae)
+ if test $ac_cv_prog_cc_Ae = yes; then
+ CPPFLAGS="$CPPFLAGS -Ae"
+ fi
+ ;;
+#
+# AIX4.x is *so* broken. It doesn't even admit to having large
+# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
+#
+ *aix4*)
+ CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
+ ;;
+esac
+
AC_INLINE
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
+AC_CHECK_HEADERS(sys/param.h ctype.h )
AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/route.h net/if.h)
AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h )
AC_CHECK_HEADERS(sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
#
-# These next two checks are needed for DEC OSF1
-# but don't hurt anywhere else.
+# Check for the functions putprpwnam, set_auth_parameters,
+# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
+# Needed for OSF1 and HPUX.
#
+
if test x"$ac_cv_func_putprpwnam" = x"no"; then
- AC_CHECK_LIB(security, putprpwnam, [LIBS="$LIBS -lsecurity";
- AC_DEFINE(HAVE_PUTPRPWNAM)])
+ case "$LIBS" in
+ *-lsecurity*) ;;
+ *) AC_CHECK_LIB(security, putprpwnam) ;;
+ esac
+ case "$LIBS" in
+ *-lsec*) ;;
+ *) AC_CHECK_LIB(sec, putprpwnam) ;;
+ esac
+ if test x"$ac_cv_lib_security_putprpwnam" = x"yes" ||
+ test x"$ac_cv_lib_sec_putprpwnam" = x"yes"; then
+ AC_DEFINE(HAVE_PUTPRPWNAM)
+ fi
fi
if test x"$ac_cv_func_set_auth_parameters" = x"no"; then
- AC_CHECK_LIB(security, set_auth_parameters, [LIBS="$LIBS -lsecurity";
- AC_DEFINE(HAVE_SET_AUTH_PARAMETERS)])
+ case "$LIBS" in
+ *-lsecurity*) ;;
+ *) AC_CHECK_LIB(security, set_auth_parameters) ;;
+ esac
+ case "$LIBS" in
+ *-lsec*) ;;
+ *) AC_CHECK_LIB(sec, set_auth_parameters) ;;
+ esac
+ if test x"$ac_cv_lib_security_set_auth_parameters" = x"yes" ||
+ test x"$ac_cv_lib_sec_set_auth_parameters" = x"yes"; then
+ AC_DEFINE(HAVE_SET_AUTH_PARAMETERS)
+ fi
+fi
+
+if test x"$ac_cv_func_getspnam" = x"no"; then
+ case "$LIBS" in
+ *-lsecurity*) ;;
+ *) AC_CHECK_LIB(security, getspnam) ;;
+ esac
+ case "$LIBS" in
+ *-lsec*) ;;
+ *) AC_CHECK_LIB(sec, getspnam) ;;
+ esac
+ if test x"$ac_cv_lib_security_getspnam" = x"yes" ||
+ test x"$ac_cv_lib_sec_getspnam" = x"yes"; then
+ AC_DEFINE(HAVE_GETSPNAM)
+ fi
+fi
+
+if test x"$ac_cv_func_bigcrypt" = x"no"; then
+ case "$LIBS" in
+ *-lsecurity*) ;;
+ *) AC_CHECK_LIB(security, bigcrypt) ;;
+ esac
+ case "$LIBS" in
+ *-lsec*) ;;
+ *) AC_CHECK_LIB(sec, bigcrypt) ;;
+ esac
+ if test x"$ac_cv_lib_security_bigcrypt" = x"yes" ||
+ test x"$ac_cv_lib_sec_bigcrypt" = x"yes"; then
+ AC_DEFINE(HAVE_BIGCRYPT)
+ fi
+fi
+
+if test x"$ac_cv_func_getprpwnam" = x"no"; then
+ case "$LIBS" in
+ *-lsecurity*) ;;
+ *) AC_CHECK_LIB(security, getprpwnam) ;;
+ esac
+ case "$LIBS" in
+ *-lsec*) ;;
+ *) AC_CHECK_LIB(sec, getprpwnam) ;;
+ esac
+ if test x"$ac_cv_lib_security_getprpwnam" = x"yes" ||
+ test x"$ac_cv_lib_sec_getprpwnam" = x"yes"; then
+ AC_DEFINE(HAVE_GETPRPWNAM)
+ fi
fi
# this bit needs to be modified for each OS that is suported by