summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2011-06-02 18:17:49 -0700
committerTim Rice <tim@multitalents.net>2011-06-02 18:17:49 -0700
commit90f42b07058d0813e258db90ccdd5da839844d19 (patch)
treedf11ed37c6f7d7e8984d621cc42c8a22f48b5d96 /configure.ac
parentc412c1567b6d9eac77bbb43f450b95ef47389ad1 (diff)
- (tim) [configure.ac defines.h] Run test program to detect system mail
directory. Add --with-maildir option to override. Fixed OpenServer 6 getting it wrong. Fixed many systems having MAIL=/var/mail//username ok dtucker
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac96
1 files changed, 86 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index d56bf6d36..51dea41c1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.474 2011/05/20 01:45:25 djm Exp $ 1# $Id: configure.ac,v 1.475 2011/06/03 01:17:49 tim Exp $
2# 2#
3# Copyright (c) 1999-2004 Damien Miller 3# Copyright (c) 1999-2004 Damien Miller
4# 4#
@@ -15,7 +15,7 @@
15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 16
17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) 17AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org])
18AC_REVISION($Revision: 1.474 $) 18AC_REVISION($Revision: 1.475 $)
19AC_CONFIG_SRCDIR([ssh.c]) 19AC_CONFIG_SRCDIR([ssh.c])
20AC_LANG([C]) 20AC_LANG([C])
21 21
@@ -533,7 +533,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
533 AC_DEFINE([LOCKED_PASSWD_STRING], ["*"], 533 AC_DEFINE([LOCKED_PASSWD_STRING], ["*"],
534 [String used in /etc/passwd to denote locked account]) 534 [String used in /etc/passwd to denote locked account])
535 AC_DEFINE([SPT_TYPE], [SPT_PSTAT]) 535 AC_DEFINE([SPT_TYPE], [SPT_PSTAT])
536 MAIL="/var/mail/username" 536 maildir="/var/mail"
537 LIBS="$LIBS -lsec" 537 LIBS="$LIBS -lsec"
538 AC_CHECK_LIB([xnet], [t_error], , 538 AC_CHECK_LIB([xnet], [t_error], ,
539 [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])]) 539 [AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])])
@@ -674,7 +674,7 @@ mips-sony-bsd|mips-sony-newsos4)
674 conf_lastlog_location="/usr/adm/lastlog" 674 conf_lastlog_location="/usr/adm/lastlog"
675 conf_utmp_location=/etc/utmp 675 conf_utmp_location=/etc/utmp
676 conf_wtmp_location=/usr/adm/wtmp 676 conf_wtmp_location=/usr/adm/wtmp
677 MAIL=/usr/spool/mail 677 maildir=/usr/spool/mail
678 AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT]) 678 AC_DEFINE([HAVE_NEXT], [1], [Define if you are on NeXT])
679 AC_DEFINE([BROKEN_REALPATH]) 679 AC_DEFINE([BROKEN_REALPATH])
680 AC_DEFINE([USE_PIPES]) 680 AC_DEFINE([USE_PIPES])
@@ -797,6 +797,7 @@ mips-sony-bsd|mips-sony-newsos4)
797 AC_DEFINE([PASSWD_NEEDS_USERNAME]) 797 AC_DEFINE([PASSWD_NEEDS_USERNAME])
798 case "$host" in 798 case "$host" in
799 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x 799 *-*-sysv5SCO_SV*) # SCO OpenServer 6.x
800 maildir=/var/spool/mail
800 TEST_SHELL=/u95/bin/sh 801 TEST_SHELL=/u95/bin/sh
801 AC_DEFINE([BROKEN_LIBIAF], [1], 802 AC_DEFINE([BROKEN_LIBIAF], [1],
802 [ia_uinfo routines not supported by OS yet]) 803 [ia_uinfo routines not supported by OS yet])
@@ -3479,12 +3480,87 @@ else
3479 AC_SUBST([XAUTH_PATH]) 3480 AC_SUBST([XAUTH_PATH])
3480fi 3481fi
3481 3482
3482# Check for mail directory (last resort if we cannot get it from headers) 3483dnl # --with-maildir=/path/to/mail gets top priority.
3483if test ! -z "$MAIL" ; then 3484dnl # if maildir is set in the platform case statement above we use that.
3484 maildir=`dirname $MAIL` 3485dnl # Otherwise we run a program to get the dir from system headers.
3485 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"], 3486dnl # We first look for _PATH_MAILDIR then MAILDIR then _PATH_MAIL
3486 [Set this to your mail directory if you don't have maillock.h]) 3487dnl # If we find _PATH_MAILDIR we do nothing because that is what
3487fi 3488dnl # session.c expects anyway. Otherwise we set to the value found
3489dnl # stripping any trailing slash. If for some strage reason our program
3490dnl # does not find what it needs, we default to /var/spool/mail.
3491# Check for mail directory
3492AC_ARG_WITH([maildir],
3493 [ --with-maildir=/path/to/mail Specify your system mail directory],
3494 [
3495 if test "X$withval" != X && test "x$withval" != xno && \
3496 test "x${withval}" != xyes; then
3497 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$withval"],
3498 [Set this to your mail directory if you do not have _PATH_MAILDIR])
3499 fi
3500 ],[
3501 if test "X$maildir" != "X"; then
3502 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
3503 else
3504 AC_MSG_CHECKING([Discovering system mail directory])
3505 AC_RUN_IFELSE(
3506 [AC_LANG_PROGRAM([[
3507#include <stdio.h>
3508#include <string.h>
3509#ifdef HAVE_PATHS_H
3510#include <paths.h>
3511#endif
3512#ifdef HAVE_MAILLOCK_H
3513#include <maillock.h>
3514#endif
3515#define DATA "conftest.maildir"
3516 ]], [[
3517 FILE *fd;
3518 int rc;
3519
3520 fd = fopen(DATA,"w");
3521 if(fd == NULL)
3522 exit(1);
3523
3524#if defined (_PATH_MAILDIR)
3525 if ((rc = fprintf(fd ,"_PATH_MAILDIR:%s\n", _PATH_MAILDIR)) <0)
3526 exit(1);
3527#elif defined (MAILDIR)
3528 if ((rc = fprintf(fd ,"MAILDIR:%s\n", MAILDIR)) <0)
3529 exit(1);
3530#elif defined (_PATH_MAIL)
3531 if ((rc = fprintf(fd ,"_PATH_MAIL:%s\n", _PATH_MAIL)) <0)
3532 exit(1);
3533#else
3534 exit (2);
3535#endif
3536
3537 exit(0);
3538 ]])],
3539 [
3540 maildir_what=`awk -F: '{print $1}' conftest.maildir`
3541 maildir=`awk -F: '{print $2}' conftest.maildir \
3542 | sed 's|/$||'`
3543 AC_MSG_RESULT([Using: $maildir from $maildir_what])
3544 if test "x$maildir_what" != "x_PATH_MAILDIR"; then
3545 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["$maildir"])
3546 fi
3547 ],
3548 [
3549 if test "X$ac_status" = "X2";then
3550# our test program didn't find it. Default to /var/spool/mail
3551 AC_MSG_RESULT([Using: default value of /var/spool/mail])
3552 AC_DEFINE_UNQUOTED([MAIL_DIRECTORY], ["/var/spool/mail"])
3553 else
3554 AC_MSG_RESULT([*** not found ***])
3555 fi
3556 ],
3557 [
3558 AC_MSG_WARN([cross compiling: use --with-maildir=/path/to/mail])
3559 ]
3560 )
3561 fi
3562 ]
3563) # maildir
3488 3564
3489if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then 3565if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes"; then
3490 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test]) 3566 AC_MSG_WARN([cross compiling: Disabling /dev/ptmx test])