122347Spstdnl configure.in: Input for Autoconf
222347Spstdnl
329964Sachednl %%% portions-copyright-cmetz-96
492906Smarkmdnl Portions of this software are Copyright 1996-1999 by Craig Metz, All Rights
522347Spstdnl Reserved. The Inner Net License Version 2 applies to these portions of
622347Spstdnl the software.
722347Spstdnl You should have received a copy of the license with this software. If
822347Spstdnl you didn't get a copy, you may request one from <license@inner.net>.
922347Spstdnl
1022347Spstdnl Portions of this software are Copyright 1995 by Randall Atkinson and Dan
1122347Spstdnl McDonald, All Rights Reserved. All Rights under this copyright are assigned
1222347Spstdnl to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and
1322347Spstdnl License Agreement applies to this software.   
1422347Spstdnl
1522347Spstdnl	History:
1622347Spstdnl
1792906Smarkmdnl	Modified by cmetz for OPIE 2.4. Add --enable-opieauto option. Check
1892906Smarkmdnl	     for ut_id and ut_syslen. Make disable-wtmp disable wtmp not utmp.
1992906Smarkmdnl	     Define HAVE_foo if foo is found by the libmissing function check.
2092906Smarkmdnl	     Added checks for libmissing functions that were there but never
2192906Smarkmdnl	     actually checked for and therefore available.
2259118Skrisdnl	Modified by cmetz for OPIE 2.32. Substitute default for LOCK_DIR.
2359118Skrisdnl	     Fix the --disable-user-locking bug. AC_DEFINE variables to 1.
2459118Skrisdnl          Really check for ut_host.
2529964Sachednl	Modified by cmetz for OPIE 2.31. Put back manual utmp[x]/wtmp[x]
2629964Sachednl          checks -- too many OSs can't be trusted to tell us where they are.
2729964Sachednl	     Check for sys/select.h. Spell endutent right. Replace strtoul()
2829964Sachednl	     if needed. Removed duplicate check for sysconf. Added check for
2929964Sachednl          SunOS C2 shadow passwords (may need more work). Replace
3029964Sachednl          setutent. Added options to disable use of utmp/wtmp. Replace
3129964Sachednl          seteuid and setegid. Check for usleep. Moved options.h options
3229964Sachednl          here as enable/disable options.
3322347Spstdnl     Modified by cmetz for OPIE 2.3. Removed redundant memset/memcpy.
3422347Spstdnl	     Changed ls -g test around. Changed logindevperm/fbtab defines.
3522347Spstdnl	     Added check for /etc/environment and /etc/src.sh. Check for
3622347Spstdnl          /var/adm/sulog. Check for {get,put}utxline, provide libmissing
3722347Spstdnl          versionf of {get,put}utline. Added --enable option for anonymous
3822347Spstdnl          FTP. Got rid of a few unneeded checks. Check for functions only
3922347Spstdnl	     used by libmissing only if the replacement function that needs
4022347Spstdnl	     them is itself needed.
4122347Spstdnl	Modified by cmetz for OPIE 2.22. Check for Solaris drain bamaged ls.
4222347Spstdnl          Check for setlogin(). Removed duplicate checks for some funcs.
4322347Spstdnl     Modified by cmetz for OPIE 2.21. Filename must be in utmp[x]/wtmp[x]
4422347Spstdnl          defines.
4522347Spstdnl     Modified by cmetz for OPIE 2.2. Misc changes. Changed for libmissing
4622347Spstdnl          support and building its target object list. Changed to support
4722347Spstdnl          FUNCTION declaration et al. Added a LOT of checks and a LOT of
4822347Spstdnl          fixes.
4922347Spstdnl	Created at NRL for OPIE 2.1.
5022347Spst
5122347SpstAC_INIT(README)
5222347SpstAC_CONFIG_HEADER(config.h)
5329964SacheAC_ARG_ENABLE(access-file, [  --enable-access-file=FILENAME
5429964Sache                          Enable the OPIE access file FILENAME], AC_DEFINE_UNQUOTED(PATH_ACCESS_FILE, "$enable_access_file") echo "Using the access file in $enable_access_file -- don't say we didn't warn you!")
5529964SacheACCESS_FILE="$enable_access_file"
5629964SacheAC_SUBST(ACCESS_FILE)
5729964SacheAC_ARG_ENABLE(server-md4, [  --enable-server-md4     Use MD4 instead of MD5 for the server], AC_DEFINE(MDX, 4), AC_DEFINE(MDX, 5))
5829964Sache
5929964SacheAC_ARG_ENABLE(user-locking, [  --disable-user-locking  Disable user locking
6029964Sache  --enable-user-locking[=DIR]
6159118Skris                          Put user lock files in DIR [/etc/opielocks]],,)
6259118Skrisif test "$enable_user_locking" != no;
6329964Sachethen
6429964Sache  if test -z "$enable_user_locking"
6529964Sache  then
6629964Sache    AC_DEFINE(OPIE_LOCK_DIR, "/etc/opielocks")
6759118Skris    LOCK_DIR="/etc/opielocks"
6829964Sache  else
6929964Sache    AC_DEFINE_UNQUOTED(OPIE_LOCK_DIR, "$enable_user_locking")
7059118Skris    LOCK_DIR="$enable_user_locking"
7129964Sache  fi
7229964Sachefi
7329964SacheAC_SUBST(LOCK_DIR)
7429964Sache
7559118SkrisAC_ARG_ENABLE(retype, [  --enable-retype         Ask users to re-type their secret pass phrases], AC_DEFINE(RETYPE, 1))
7659118SkrisAC_ARG_ENABLE(su-star-check, [  --enable-su-star-check  Refuse to switch to disabled accounts], AC_DEFINE(SU_STAR_CHECK, 1))
7759118SkrisAC_ARG_ENABLE(new-prompts, [  --disable-new-prompts   Use more compatible (but less informative) prompts],, AC_DEFINE(NEW_PROMPTS, 1))
7829964SacheAC_ARG_ENABLE(insecure-override, [  --enable-insecure-override
7959118Skris                          Allow users to override insecure checks], AC_DEFINE(INSECURE_OVERRIDE, 1))
8092906SmarkmAC_ARG_ENABLE(anonymous-ftp, [  --enable-anonymous-ftp  Enable anonymous FTP support], AC_DEFINE(DOANONYMOUS, 1) echo "enabling anonymous FTP support in ftp -- don't say we didn't warn you!")
8192906SmarkmAC_ARG_ENABLE(utmp, [  --disable-utmp          Disable utmp logging], AC_DEFINE(DISABLE_UTMP, 1) echo "disabling utmp logging")
8292906SmarkmAC_ARG_ENABLE(wtmp, [  --disable-wtmp          Disable wtmp logging], AC_DEFINE(DISABLE_WTMP, 1) echo "disabling wtmp logging")
8392906SmarkmAC_ARG_ENABLE(opieauto, [  --enable-opieauto       Enable support for opieauto], AC_DEFINE(OPIEAUTO, 1) OPIEAUTO=opieauto; echo "enabling opieauto support")
8492906SmarkmAC_SUBST(OPIEAUTO)
8522347Spst
8622347Spstdnl Checks for programs.
8722347SpstAC_PROG_CC
8822347SpstAC_PROG_CPP
8922347SpstAC_PROG_LN_S
9022347SpstAC_PROG_RANLIB
9122347SpstAC_PROG_YACC
9222347Spst
9322347SpstAC_AIX
9422347SpstAC_ISC_POSIX
9522347SpstAC_MINIX
9622347Spst
9722347Spstdnl We'd put PATH in these checks, but it turns out that autoconf doesn't
9822347Spstdnl work as documented when it comes to the colon separator...
9922347Spst
10022347SpstAC_PATH_PROG(CHOWN, chown, /bin/chown, /usr/bin /bin /usr/sbin /sbin /usr/etc /etc)
10122347Spst
10222347SpstAC_PATH_PROG(SU, su, /bin/su, /usr/bin /bin)
10322347SpstAC_PATH_PROG(ALT_SU, su,, /usr/sbin /sbin)
10422347Spst
10522347SpstAC_PATH_PROG(SCHEME, scheme,, /usr/lib/iaf/scheme)
10622347SpstAC_PATH_PROG(LOGIN, login, /bin/login, /usr/bin /bin)
10722347Spstdnl AC_DEFINE_UNQUOTED(PATH_LOGIN, "$LOGIN")
10822347Spst
10922347Spstif test ! -z "$SCHEME";
11022347Spstthen
11122347Spst	LOGIN="$SCHEME";
11222347Spstfi
11322347Spst
11422347SpstAC_PATH_PROG(FTPD, ftpd,, /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin)
11522347SpstAC_PATH_PROG(INFTPD, in.ftpd,, /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin)
11622347Spst
11722347Spstif test -z "$FTPD"
11822347Spstthen
11922347Spst	if test ! -z "$INFTPD"
12022347Spst	then
12122347Spst		FTPD="$INFTPD"
12222347Spst	fi
12322347Spstfi
12422347Spst
12522347SpstAC_MSG_CHECKING(for default PATH entries)
12622347Spstdefault_path=""
12722347Spstsave_IFS="$IFS"
12822347SpstIFS=" "
12922347Spstfor i in /usr/bin /bin /usr/ucb /usr/sbin /usr/bsd /sbin /usr/bin/X11 /etc /usr/local/X11/bin /usr/X11R6/bin /your-system-is-broken
13022347Spstdo
13122347Spst	IFS=":"
13222347Spst	for j in $PATH
13322347Spst	do
13422347Spst		if test "$i" = "$j"
13522347Spst		then
13622347Spst			if test -d "$i"
13722347Spst			then
13822347Spst				if test -z "$default_path"
13922347Spst				then
14022347Spst					default_path="$i"
14122347Spst				else
14222347Spst					default_path="$default_path:$i"
14322347Spst				fi
14422347Spst			fi
14522347Spst		fi
14622347Spst	done
14722347Spst	IFS=" "
14822347Spstdone
14922347SpstAC_DEFINE_UNQUOTED(DEFAULT_PATH, "$default_path")
15022347SpstAC_MSG_RESULT($default_path)
15122347Spst
15222347SpstAC_MSG_CHECKING(for test -e flag)
15322347Spstif sh config.testeflag
15422347Spstthen
15522347Spst	result=yes
15622347Spst	EXISTS="-e"
15722347Spstelse
15822347Spst	result=no
15922347Spst	EXISTS="-f"
16022347Spstfi
16122347SpstAC_SUBST(EXISTS)
16222347SpstAC_MSG_RESULT($result)
16322347Spst
16422347SpstAC_MSG_CHECKING(for mkdir -p flag)
16522347Spstif test -d config.tmpdir
16622347Spstthen
16722347Spst	rmdir config.tmpdir/foo/bar >/dev/null 2>/dev/null
16822347Spst	rmdir config.tmpdir/foo >/dev/null 2>/dev/null
16922347Spst	rmdir config.tmpdir >/dev/null 2>/dev/null
17022347Spstfi
17122347Spst
17222347Spstresult=no
17322347Spstif mkdir -p config.tmpdir/foo/bar >/dev/null 2>/dev/null
17422347Spstthen
17522347Spst	if test -d config.tmpdir
17622347Spst	then
17722347Spst		if test -d config.tmpdir/foo
17822347Spst		then
17922347Spst			if test -d config.tmpdir/foo/bar
18022347Spst			then
18122347Spst				result=yes
18222347Spst				rmdir config.tmpdir/foo/bar >/dev/null 2>/dev/null
18322347Spst			fi
18422347Spst			rmdir config.tmpdir/foo >/dev/null 2>/dev/null
18522347Spst		fi
18622347Spst		rmdir config.tmpdir >/dev/null 2>/dev/null
18722347Spst	fi
18822347Spstfi
18922347Spst
19022347Spstif test "$result" = yes
19122347Spstthen
19222347Spst	MKDIR="mkdir -p"
19322347Spstelse
19422347Spst	MKDIR="mkdir"
19522347Spstfi
19622347SpstAC_SUBST(MKDIR)
19722347SpstAC_MSG_RESULT($result)
19822347Spst
19922347SpstAC_MSG_CHECKING(for ls group field)
20022347Spstlsg=`/bin/ls -ldg / | wc -w | awk '{print $1}'`;
20122347Spstls=`/bin/ls -ld / | wc -w | awk '{print $1}'`;
20222347Spstresult="no"
20322347Spstif test $ls = 9;
20422347Spstthen
20522347Spst	result="yes"
20622347Spstelse
20722347Spst	if test "$ls" = 8 -a "$lsg" = 9;
20822347Spst	then
20922347Spst		result="yes, with -g"
21022347Spst		AC_DEFINE(HAVE_LS_G_FLAG)
21122347Spst	fi
21222347Spstfi
21322347SpstAC_MSG_RESULT($result)
21422347Spst
21522347Spstdnl Checks for various system characteristics
21622347SpstAC_MSG_CHECKING(for /etc/default/login)
21722347Spstif test $EXISTS /etc/default/login
21822347Spstthen
21922347Spst	result=yes
22022347Spst	AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
22122347Spstelse
22222347Spst	result=no
22322347Spstfi
22422347SpstAC_MSG_RESULT($result)
22522347Spst
22622347SpstAC_MSG_CHECKING(for /etc/securetty)
22722347Spstif test $EXISTS /etc/securetty
22822347Spstthen
22922347Spst	result=yes
23022347Spst	AC_DEFINE(HAVE_SECURETTY)
23122347Spstelse
23222347Spst	result=no
23322347Spstfi
23422347SpstAC_MSG_RESULT($result)
23522347Spst
23622347SpstAC_MSG_CHECKING(for /etc/logindevperm)
23722347Spstif test $EXISTS /etc/logindevperm
23822347Spstthen
23922347Spst	AC_MSG_RESULT(yes)
24022347Spst	AC_DEFINE(HAVE_LOGIN_PERMFILE, "/etc/logindevperm")
24122347Spstelse
24222347Spst	AC_MSG_RESULT(no)
24322347Spst
24422347Spst	AC_MSG_CHECKING(for /etc/fbtab)
24522347Spst	if test $EXISTS /etc/fbtab
24622347Spst	then
24722347Spst		result=yes
24822347Spst		AC_DEFINE(HAVE_LOGIN_PERMFILE, "/etc/fbtab")
24922347Spst	else
25022347Spst		result=no
25122347Spst	fi
25222347Spst	AC_MSG_RESULT($result)
25322347Spstfi
25422347Spst
25522347SpstAC_MSG_CHECKING(for /etc/environment)
25622347Spstif test $EXISTS /etc/environment
25722347Spstthen
25822347Spst	AC_MSG_RESULT(yes)
25922347Spst	AC_DEFINE(HAVE_LOGIN_ENVFILE, "/etc/environment")
26022347Spstelse
26122347Spst	AC_MSG_RESULT(no)
26222347Spst
26322347Spst	AC_MSG_CHECKING(for /etc/src.sh)
26422347Spst	if test $EXISTS /etc/src.sh
26522347Spst	then
26622347Spst		result=yes
26722347Spst		AC_DEFINE(HAVE_LOGIN_ENVFILE, "/etc/src.sh")
26822347Spst	else
26922347Spst		result=no
27022347Spst	fi
27122347Spst	AC_MSG_RESULT($result)
27222347Spstfi
27322347Spst
27422347SpstAC_MSG_CHECKING(for /etc/shadow)
27522347Spstif test $EXISTS /etc/shadow
27622347Spstthen
27722347Spst	result=yes
27822347Spst	AC_DEFINE(HAVE_ETC_SHADOW)
27922347Spstelse
28029964Sache	AC_MSG_RESULT(no)
28129964Sache
28229964Sache	AC_MSG_CHECKING(for /etc/security/passwd.adjunct)
28329964Sache	if test $EXISTS /etc/security/passwd.adjunct
28429964Sache	then
28529964Sache		result=yes
28629964Sache		AC_DEFINE(HAVE_SUNOS_C2_SHADOW)
28729964Sache		LIBOBJS="$LIBOBJS getspnam.o endspent.o"
28829964Sache	else
28929964Sache		result=no
29029964Sache	fi
29122347Spstfi
29222347SpstAC_MSG_RESULT($result)
29322347Spst
29422347SpstAC_MSG_CHECKING(for /var/adm/sulog)
29522347Spstif test $EXISTS /var/adm/sulog
29622347Spstthen
29722347Spst	result=yes
29822347Spst	AC_DEFINE(HAVE_SULOG)
29922347Spstelse
30022347Spst	result=no
30122347Spstfi
30222347SpstAC_MSG_RESULT($result)
30322347Spst
30422347SpstAC_MSG_CHECKING(mail spool location)
30522347Spstmail_spool=""
30622347Spstfor i in /var/mail /usr/mail /var/spool/mail /usr/spool/mail
30722347Spstdo
30822347Spst	if test -d $i
30922347Spst	then
31022347Spst		mail_spool="$i"
31122347Spst	fi
31222347Spstdone
31322347Spstif test -z "$mail_spool"
31422347Spstthen
31522347Spst	result="not found"
31622347Spstelse
31722347Spst	result="$mail_spool"
31822347Spst	AC_DEFINE_UNQUOTED(PATH_MAIL, "$mail_spool")
31922347Spstfi
32022347SpstAC_MSG_RESULT($result)
32122347Spst
32229964SacheAC_MSG_CHECKING(where your system puts the utmp file)
32329964Sacheutmp_path=""
32429964Sachefor i in /var/run /var/adm /usr/adm /etc
32529964Sachedo
32629964Sache	if test $EXISTS $i/utmp
32729964Sache	then
32829964Sache		utmp_path="$i"
32929964Sache	fi
33029964Sachedone
33129964Sacheif test -z "$utmp_path"
33229964Sachethen
33329964Sache	result="not found"
33429964Sacheelse
33529964Sache	result="$utmp_path"
33629964Sache	AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmp")
33729964Sachefi
33829964SacheAC_MSG_RESULT($result)
33922347Spst
34029964SacheAC_MSG_CHECKING(where your system puts the utmpx file)
34129964Sacheutmp_path=""
34229964Sachefor i in /var/run /var/adm /usr/adm /etc
34329964Sachedo
34429964Sache	if test $EXISTS $i/utmp
34529964Sache	then
34629964Sache		utmp_path="$i"
34729964Sache	fi
34829964Sachedone
34929964Sacheif test -z "$utmp_path"
35029964Sachethen
35129964Sache	result="not found"
35229964Sache	AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmpx")
35329964Sachefi
35429964SacheAC_MSG_RESULT($result)
35522347Spst
35629964SacheAC_MSG_CHECKING(where your system puts the wtmp file)
35729964Sachewtmp_path=""
35829964Sachefor i in /var/run /var/log /var/adm /usr/adm /etc
35929964Sachedo
36029964Sache	if test $EXISTS $i/wtmp
36129964Sache	then
36229964Sache		wtmp_path="$i"
36329964Sache	fi
36429964Sachedone
36529964Sacheif test -z "$wtmp_path"
36629964Sachethen
36729964Sache	result="not found"
36829964Sacheelse
36929964Sache	result="$wtmp_path"
37029964Sache	AC_DEFINE_UNQUOTED(PATH_WTMP_AC, "$wtmp_path/wtmp")
37129964Sachefi
37229964SacheAC_MSG_RESULT($result)
37329964Sache
37429964SacheAC_MSG_CHECKING(where your system puts the wtmpx file)
37529964Sachewtmpx_path=""
37629964Sachefor i in /var/run /var/log /var/adm /usr/adm /etc
37729964Sachedo
37829964Sache	if test $EXISTS $i/wtmpx
37929964Sache	then
38029964Sache		wtmpx_path="$i"
38129964Sache	fi
38229964Sachedone
38329964Sacheif test -z "$wtmpx_path"
38429964Sachethen
38529964Sache	result="not found"
38629964Sacheelse
38729964Sache	result="$wtmpx_path"
38829964Sache	AC_DEFINE_UNQUOTED(PATH_WTMPX_AC, "$wtmpx_path/wtmpx")
38929964Sachefi
39029964SacheAC_MSG_RESULT($result)
39129964Sache
39222347SpstAC_MSG_CHECKING(whether the system profile displays the motd)
39322347Spstresult=no
39422347Spstif test $EXISTS /etc/profile
39522347Spstthen
39622347Spst	if grep motd /etc/profile >/dev/null 2>/dev/null
39722347Spst	then
39822347Spst		result=yes
39922347Spst	fi
40022347Spstfi
40122347Spstif test "$result" = yes
40222347Spstthen
40322347Spst	AC_DEFINE(HAVE_MOTD_IN_PROFILE)
40422347Spstfi
40522347SpstAC_MSG_RESULT($result)
40622347Spst
40722347SpstAC_MSG_CHECKING(whether the system profile checks for mail)
40822347Spstresult=no
40922347Spstif test $EXISTS /etc/profile
41022347Spstthen
41122347Spst	if grep 'mail\.' /etc/profile >/dev/null 2>/dev/null
41222347Spst	then
41322347Spst		result=yes
41422347Spst	fi
41522347Spstfi
41622347Spstif test "$result" = yes
41722347Spstthen
41822347Spst	AC_DEFINE(HAVE_MAILCHECK_IN_PROFILE)
41922347Spstfi
42022347SpstAC_MSG_RESULT($result)
42122347Spst
42222347Spstdnl Random checks
42322347SpstAC_C_CONST
42422347Spst
42522347SpstAC_MSG_CHECKING(to see if your compiler can handle void arguments)
42622347SpstAC_TRY_COMPILE(foo(void) { },, AC_DEFINE(HAVE_VOIDARG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
42722347Spst
42822347SpstAC_MSG_CHECKING(to see if your compiler can handle void return values)
42922347SpstAC_TRY_COMPILE(void foo() { },, AC_DEFINE(HAVE_VOIDRET) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
43022347Spst
43122347SpstAC_MSG_CHECKING(to see if your compiler can handle void pointers)
43222347SpstAC_TRY_COMPILE(foo() { void *bar = (void *)0x42; bar = bar + 1; },, AC_DEFINE(HAVE_VOIDPTR) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
43322347Spst
43422347SpstAC_MSG_CHECKING(to see if your compiler can handle ANSI argument lists)
43522347SpstAC_TRY_COMPILE(int foo(int bar, int baz) { return 0; },, AC_DEFINE(HAVE_ANSIDECL) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
43622347Spst
43722347SpstAC_MSG_CHECKING(to see if your compiler can handle ANSI prototypes)
43822347SpstAC_TRY_COMPILE(extern int foo(int, int);,, AC_DEFINE(HAVE_ANSIPROTO) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
43922347Spst
44022347SpstAC_MSG_CHECKING(to see if your compiler can handle ANSI variable arguments)
44122347SpstAC_TRY_COMPILE([#include <stdarg.h>
44222347Spstint foo(int arg, ...) {
44322347Spst	va_list ap;
44422347Spst	va_start(ap, arg);
44522347Spst	va_end(ap);
44622347Spst	return 0;
44722347Spst}],, AC_DEFINE(HAVE_ANSISTDARG) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
44822347Spst
44922347SpstAC_MSG_CHECKING(to see if you have an ANSI-style sprintf)
45022347SpstAC_TRY_RUN([#include <stdio.h>
45122347Spstint main(argc, argv)
45222347Spstint argc;
45322347Spstchar *argv[];
45422347Spst{
45522347Spst  char buf[5];
45622347Spst  int i = 2;
45722347Spst  i += sprintf(buf, "1234");
45822347Spst  return (i == 6) ? 0 : -1;
45922347Spst}], AC_DEFINE(HAVE_ANSISPRINTF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no))
46022347Spst
46122347Spstdnl Checks for libraries.
46222347SpstAC_CHECK_LIB(crypt, crypt)
46322347SpstAC_CHECK_LIB(nsl, gethostname)
46422347SpstAC_CHECK_LIB(posix, main)
46522347SpstAC_CHECK_LIB(socket, socket)
46622347Spst
46722347Spstdnl Checks for header files.
46822347SpstAC_HEADER_DIRENT
46922347SpstAC_HEADER_SYS_WAIT
47029964SacheAC_CHECK_HEADERS(crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h sys/select.h)
47122347Spst
47222347Spstdnl Checks for typedefs, structures, and compiler characteristics.
47322347Spstdnl AC_TYPE_UID_T
47422347Spstdnl AC_TYPE_OFF_T
47522347Spstdnl AC_TYPE_PID_T
47622347Spstdnl AC_STRUCT_ST_BLKSIZE
47722347Spstdnl AC_STRUCT_TM
47822347Spst
47922347SpstAC_MSG_CHECKING(for ut_pid in struct utmp)
48022347SpstAC_TRY_COMPILE([#include <sys/types.h>
48122347Spst#include <utmp.h>], [struct utmp foo; return (int)foo.ut_pid;], AC_DEFINE(HAVE_UT_PID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
48222347SpstAC_MSG_CHECKING(for ut_type in struct utmp)
48322347SpstAC_TRY_COMPILE([#include <sys/types.h>
48422347Spst#include <utmp.h>], [struct utmp foo; return (int)foo.ut_type;], AC_DEFINE(HAVE_UT_TYPE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
48522347SpstAC_MSG_CHECKING(for ut_name in struct utmp)
48622347SpstAC_TRY_COMPILE([#include <sys/types.h>
48722347Spst#include <utmp.h>], [struct utmp foo; return (int)foo.ut_name[0];], AC_DEFINE(HAVE_UT_NAME) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
48822347Spstdnl AC_MSG_CHECKING(for ut_user in struct utmp)
48922347Spstdnl AC_TRY_COMPILE([#include <sys/types.h>
49022347Spstdnl #include <utmp.h>], [struct utmp foo; return (int)foo.ut_user[0];], AC_DEFINE(HAVE_UT_USER) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
49159118SkrisAC_MSG_CHECKING(for ut_host in struct utmp)
49259118SkrisAC_TRY_COMPILE([#include <sys/types.h>
49359118Skris#include <utmp.h>], [struct utmp foo; return (int)foo.ut_host[0];], AC_DEFINE(HAVE_UT_HOST) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
49492906SmarkmAC_MSG_CHECKING(for ut_id in struct utmp)
49592906SmarkmAC_TRY_COMPILE([#include <sys/types.h>
49692906Smarkm#include <utmp.h>], [struct utmp foo; return (int)foo.ut_id[0];], AC_DEFINE(HAVE_UT_ID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
49792906Smarkm#AC_MSG_CHECKING(for ut_syslen in struct utmp)
49892906Smarkm#AC_TRY_COMPILE([#include <sys/types.h>
49992906Smarkm##include <utmp.h>], [struct utmp foo; return (int)foo.ut_syslen;], AC_DEFINE(HAVE_UT_SYSLEN) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
50092906SmarkmAC_MSG_CHECKING(for ut_syslen in struct utmpx)
50192906SmarkmAC_TRY_COMPILE([#include <sys/types.h>
50292906Smarkm#include <utmpx.h>], [struct utmpx foo; return (int)foo.ut_syslen;], AC_DEFINE(HAVE_UTX_SYSLEN) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
50322347Spst
50422347Spstdnl Checks for library functions.
50522347Spstdnl AC_PROG_GCC_TRADITIONAL
50622347SpstAC_TYPE_SIGNAL
50729964SacheAC_CHECK_FUNCS(gettimeofday socket strftime strstr setpriority getttynam setvbuf getspnam endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline usleep)
50822347Spst
50922347Spstdnl Libmissing...
51022347SpstAC_FUNC_MEMCMP
51122347SpstAC_FUNC_ALLOCA
51222347SpstAC_REPLACE_FUNCS(getusershell sigaddset sigemptyset strerror strncasecmp)
51329964SacheMISSING="$LIBOBJS $ALLOCA " ;
51492906Smarkm
51592906Smarkmdnl These should be simplified by a macro
51692906SmarkmAC_CHECK_FUNC(atexit,      AC_DEFINE(HAVE_ATEXIT),      MISSING="${MISSING}atexit.o "; AC_CHECK_FUNCS(on_exit))
51792906SmarkmAC_CHECK_FUNC(endutent,    AC_DEFINE(HAVE_ENDUTENT),    MISSING="${MISSING}endutent.o ")
51892906SmarkmAC_CHECK_FUNC(initgroups,  AC_DEFINE(HAVE_INITGROUPS),  MISSING="${MISSING}initgroups.o ")
51992906SmarkmAC_CHECK_FUNC(memcmp,      AC_DEFINE(HAVE_MEMCMP),      MISSING="${MISSING}memcmp.o ")
52092906SmarkmAC_CHECK_FUNC(memcpy,      AC_DEFINE(HAVE_MEMCPY),      MISSING="${MISSING}memcpy.o "; AC_CHECK_FUNCS(bcopy))
52192906SmarkmAC_CHECK_FUNC(memset,      AC_DEFINE(HAVE_MEMSET),      MISSING="${MISSING}memset.o "; AC_CHECK_FUNCS(bzero))
52292906SmarkmAC_CHECK_FUNC(getcwd,      AC_DEFINE(HAVE_GETCWD),      MISSING="${MISSING}getcwd.o "; AC_CHECK_FUNCS(getwd))
52392906SmarkmAC_CHECK_FUNC(getenv,      AC_DEFINE(HAVE_GETENV),      MISSING="${MISSING}env.o ")
52492906SmarkmAC_CHECK_FUNC(getutline,   AC_DEFINE(HAVE_GETUTLINE),   MISSING="${MISSING}getutline.o "; AC_CHECK_FUNCS(ttyslot))
52592906SmarkmAC_CHECK_FUNC(pututline,   AC_DEFINE(HAVE_PUTUTLINE),   MISSING="${MISSING}pututline.o "; AC_CHECK_FUNCS(ttyslot))
52692906SmarkmAC_CHECK_FUNC(setenv,      AC_DEFINE(HAVE_SETENV),      MISSING="${MISSING}env.o ")
52792906SmarkmAC_CHECK_FUNC(setegid,     AC_DEFINE(HAVE_SETEGID),     MISSING="${MISSING}setegid.o "; AC_CHECK_FUNCS(setregid setresgid))
52892906SmarkmAC_CHECK_FUNC(seteuid,     AC_DEFINE(HAVE_SETEUID),     MISSING="${MISSING}seteuid.o "; AC_CHECK_FUNCS(setreuid setresuid))
52992906SmarkmAC_CHECK_FUNC(setutent,    AC_DEFINE(HAVE_SETUTENT),    MISSING="${MISSING}setutent.o ")
53092906SmarkmAC_CHECK_FUNC(sigprocmask, AC_DEFINE(HAVE_SIGPROCMASK), MISSING="${MISSING}sigprocmask.o "; AC_CHECK_FUNCS(sigblock sigsetmask))
53192906SmarkmAC_CHECK_FUNC(strchr,      AC_DEFINE(HAVE_STRCHR),      MISSING="${MISSING}strchr.o "; AC_CHECK_FUNCS(index))
53292906SmarkmAC_CHECK_FUNC(strrchr,     AC_DEFINE(HAVE_STRRCHR),     MISSING="${MISSING}strrchr.o "; AC_CHECK_FUNCS(rindex))
53392906SmarkmAC_CHECK_FUNC(strtoul,     AC_DEFINE(HAVE_STRTOUL),     MISSING="${MISSING}strtoul.o ")
53492906SmarkmAC_CHECK_FUNC(sysconf,     AC_DEFINE(HAVE_SYSCONF),     MISSING="${MISSING}sysconf.o "; AC_CHECK_FUNCS(getdtablesize))
53592906SmarkmAC_CHECK_FUNC(uname,       AC_DEFINE(HAVE_UNAME),       MISSING="${MISSING}uname.o "; AC_CHECK_FUNCS(gethostname))
53692906SmarkmAC_CHECK_FUNC(unsetenv,    AC_DEFINE(HAVE_UNSETENV),    MISSING="${MISSING}env.o ")
53722347SpstAC_SUBST(MISSING)
53822347Spst
53922347SpstAC_MSG_CHECKING(for nonstandard gettimeofday)
54022347SpstAC_TRY_COMPILE([
54122347Spst#if HAVE_SYS_TIME_H
54222347Spst#include <sys/time.h>
54322347Spst#endif /* HAVE_SYS_TIME_H */
54422347Spst#if HAVE_UNISTD_H
54522347Spst#include <unistd.h>
54622347Spst#endif /* HAVE_UNISTD_H */
54722347Spst],
54822347Spst[struct timeval tv;
54922347Spstgettimeofday(&tv, NULL)], AC_MSG_RESULT(no), AC_MSG_RESULT(maybe) AC_TRY_COMPILE([
55022347Spst#if HAVE_SYS_TIME_H
55122347Spst#include <sys/time.h>
55222347Spst#endif /* HAVE_SYS_TIME_H */
55322347Spst#if HAVE_UNISTD_H
55422347Spst#include <unistd.h>
55522347Spst#endif /* HAVE_UNISTD_H */
55622347Spst],
55722347Spst[struct timeval tv;
55822347Spstgettimeofday(&tv)], AC_DEFINE(HAVE_ONE_ARG_GETTIMEOFDAY) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)))
55922347Spst
56022347Spst# Munge out LOCALBIN and LOCALMAN in canonical (no bletch) form
56122347SpstAC_OUTPUT(configure.munger libmissing/Makefile libopie/Makefile Makefile.munge:Makefile.in)
56222347Spstsh configure.munger
563