Imported Upstream version 1.6.8p5
[debian/sudo] / aclocal.m4
index 8a156b0fe618e7b5e7d57b6fc97616addf850f55..e6c29943e6a591e22c822df76f181de88722933e 100644 (file)
@@ -1,6 +1,6 @@
 dnl Local m4 macors for autoconf (used by sudo)
 dnl
-dnl Copyright (c) 1994-1996,1998-2002 Todd C. Miller <Todd.Miller@courtesan.com>
+dnl Copyright (c) 1994-1996,1998-2003 Todd C. Miller <Todd.Miller@courtesan.com>
 dnl
 dnl XXX - should cache values in all cases!!!
 dnl
@@ -144,10 +144,14 @@ elif test -d "/var/run"; then
     AC_MSG_RESULT(/var/run/sudo)
     SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo")
     timedir="/var/run/sudo"
+elif test -d "/var/adm"; then
+    AC_MSG_RESULT(/var/adm/sudo)
+    SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/adm/sudo")
+    timedir="/var/adm/sudo"
 else
-    AC_MSG_RESULT(/tmp/.odus)
-    SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus")
-    timedir="/tmp/.odus"
+    AC_MSG_RESULT(/usr/adm/sudo)
+    SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/usr/adm/sudo")
+    timedir="/usr/adm/sudo"
 fi
 ])dnl
 
@@ -206,30 +210,6 @@ dnl
 AC_DEFUN(SUDO_TYPE_INO_T,
 [SUDO_CHECK_TYPE(ino_t, unsigned int)])
 
-dnl
-dnl check for POSIX utime() using struct utimbuf
-dnl
-AC_DEFUN(SUDO_FUNC_UTIME_POSIX,
-[AC_MSG_CHECKING(for POSIX utime)
-AC_CACHE_VAL(sudo_cv_func_utime_posix,
-[rm -f conftestdata; > conftestdata
-AC_TRY_RUN([#include <sys/types.h>
-#include <sys/time.h>
-#include <utime.h>
-main() {
-struct utimbuf ut;
-ut.actime = ut.modtime = time(0);
-utime("conftestdata", &ut);
-exit(0);
-}], sudo_cv_func_utime_posix=yes, sudo_cv_func_utime_posix=no,
-  sudo_cv_func_utime_posix=no)
-rm -f core core.* *.core])dnl
-AC_MSG_RESULT($sudo_cv_func_utime_posix)
-if test $sudo_cv_func_utime_posix = yes; then
-  AC_DEFINE(HAVE_UTIME_POSIX, 1, [Define if you have a POSIX utime() (uses struct utimbuf).])
-fi
-])
-
 dnl
 dnl check for working fnmatch(3)
 dnl
@@ -308,7 +288,7 @@ main() {
   if ((f = fopen("conftestdata", "w")) == NULL)
     exit(1);
 
-  (void) sprintf(b, "%u", u);
+  (void) sprintf(b, "%lu", (unsigned long) u);
   (void) fprintf(f, "%d\n", strlen(b));
   (void) fclose(f);
   exit(0);
@@ -328,6 +308,20 @@ AC_TRY_LINK(, [long long foo = 1000; foo /= 10;], AC_DEFINE(HAVE_LONG_LONG, 1, [
 [AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD, 1, [Define if sizeof(long) == sizeof(long long).]))]
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))])
 
+dnl
+dnl append a libpath to an LDFLAGS style variable
+dnl
+AC_DEFUN(SUDO_APPEND_LIBPATH, [
+    if test X"$with_rpath" = X"yes"; then
+       $1="${$1} -L$2 -R$2"
+    else
+       $1="${$1} -L$2"
+    fi
+    if test X"$blibpath" != X"" -a "$1" = "SUDO_LDFLAGS"; then
+       blibpath_add="${blibpath_add}:$2"
+    fi
+])
+
 dnl
 dnl private versions of AC_DEFINE and AC_DEFINE_UNQUOTED that don't support
 dnl tracing that we use to define paths for pathnames.h so autoheader doesn't