/* opie_conf.h.source: Various configuration-type pieces of information for
	OPIE. This version is designed to work with the older configuration
	system.

Portions of this software are Copyright 1995 by Randall Atkinson and Dan
McDonald, All Rights Reserved. All Rights under this copyright are assigned
to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and
License Agreement applies to this software.

	History:

        Modified at NRL for OPIE 2.11. Added HAVE_SYS_TIME_H to
		IS_A_BSD. Removed version defines.
	Modified at NRL for OPIE 2.1. Fixed sigprocmask declaration.
		Gutted for autoconf. Split up for autoconf. Lots of
		changes for autoconf-style symbols. Removed trailing
		slashes from MAIL_DIR.
	Written at NRL for OPIE 2.0.
*/
#ifdef SOLARIS
#ifndef SVR4
#define SVR4 1
#endif	/* SVR4 */
#ifndef NEED_SETENV
#define NEED_SETENV 1
#endif	/* NEED_SETENV */
#ifndef DOUTMPX
#define DOUTMPX 1
#endif	/* DOUTMPX */
#ifndef HAVE_CRYPT_H
#define HAVE_CRYPT_H 1
#endif /* HAVE_CRYPT_H */
#ifndef HAVE_SHADOW_H
#define HAVE_SHADOW_H 1
#endif /* HAVE_SHADOW_H */
#ifndef HAVE_SIGPROCMASK
#define HAVE_SIGPROCMASK 1
#endif /* HAVE_SIGPROCMASK */
#ifndef HAVE_SIGEMPTYSET
#define HAVE_SIGEMPTYSET 1
#endif /* HAVE_SIGEMPTYSET */
#ifndef HAVE_SIGADDSET
#define HAVE_SIGADDSET 1
#endif /* HAVE_SIGADDSET */
#ifndef HAVE_SHADOW
#define HAVE_SHADOW 1
#endif /* HAVE_SHADOW */
#ifndef DOTTYPROMPT
#define DOTTYPROMPT 1
#endif /* DOTTYPROMPT */
#endif	/* SOLARIS */

#ifdef linux
#ifndef IS_A_SYSV
#define IS_A_SYSV 1
#endif	/* IS_A_SYSV */
#endif /* linux */

#ifdef hpux
#ifndef IS_A_SYSV
#define IS_A_SYSV 1
#endif	/* IS_A_SYSV */
#ifndef NEED_SETENV
#define NEED_SETENV 1
#endif	/* NEED_SETENV */
#define seteuid(x) setresuid(-1, x, -1)
#define setegid(x) setresgid(-1, x, -1)
#ifndef _PATH_WTMP
#define _PATH_WTMP "/etc/wtmp"
#endif	/* _PATH_WTMP */
#ifndef DOSECURETTY
#define DOSECURETTY 1
#endif	/* DOSECURETTY */
#ifndef HAVE_SIGPROCMASK
#define HAVE_SIGPROCMASK 1
#endif /* HAVE_SIGPROCMASK */
#ifndef HAVE_SIGEMPTYSET
#define HAVE_SIGEMPTYSET 1
#endif /* HAVE_SIGEMPTYSET */
#ifndef HAVE_SIGADDSET
#define HAVE_SIGADDSET 1
#endif /* HAVE_SIGADDSET */
#endif	/* hpux */

#ifdef SUNOS
#ifndef BSD4_3
#define BSD4_3 1
#endif	/* BSD4_3 */
#ifndef HAVE_DIRENT
#define HAVE_DIRENT 1
#endif	/* HAVE_DIRENT */
#ifndef NEED_SETENV
#define NEED_SETENV 1
#endif	/* NEED_SETENV */
#ifndef NEED_STRERROR
#define NEED_STRERROR 1
#endif	/* NEED_STRERROR */
#ifndef atexit
#define atexit on_exit
#endif /* atexit */
#ifndef HAVE_DES_CRYPT_H
#define HAVE_DES_CRYPT_H 1
#endif /* HAVE_DES_CRYPT_H */
#ifndef HAVE_LASTLOG_H
#define HAVE_LASTLOG_H 1
#endif /* HAVE_LASTLOG_H */
#ifndef HAVE_TIME_H
#define HAVE_TIME_H 1
#endif /* HAVE_TIME_H */
#endif	/* SUNOS */

/* SVR4 -> IS_A_SYSV */
#ifdef SVR4
#ifndef IS_A_SYSV
#define IS_A_SYSV 1
#endif	/* IS_A_SYSV */
#ifndef HAVE_ETC_DEFAULT_LOGIN 
#define HAVE_ETC_DEFAULT_LOGIN 1
#endif /* HAVE_ETC_DEFAULT_LOGIN */
#endif	/* SVR4 */

/* BSD4_3 -> OPIE_BSD */
#ifdef BSD4_3
#ifndef IS_A_BSD
#define IS_A_BSD 1
#endif	/* IS_A_BSD */
#endif	/* BSD4_3 */

#if !defined(SYSV) && !defined(IS_A_SYSV) && defined(BSD)
#ifndef IS_A_BSD
#define IS_A_BSD 1
#endif	/* IS_A_BSD */
#endif	/* !defined(SYSV) && !defined(IS_A_SYSV) && defined(BSD) */

#if !defined(BSD) && !defined(IS_A_BSD) && defined(SYSV)
#ifndef IS_A_SYSV
#define IS_A_SYSV 1
#endif	/* IS_A_SYSV */
#endif	/* !defined(BSD) && !defined(IS_A_BSD) && defined(SYSV) */

#if defined(IS_A_BSD) && defined(IS_A_SYSV)
You cannot be both IS_A_BSD and IS_A_SYSV at the same time.
#endif	/* defined(IS_A_BSD) && defined(IS_A_SYSV) */

#if !defined(IS_A_BSD) && !defined(IS_A_SYSV)
     You must specify the kind of system you are on(See the Makefile).
#endif	/* !defined(IS_A_BSD) && !defined(IS_A_SYSV) */

/* If the user didn't specify, figure out what file to use for perm setting */
#ifndef PERMSFILE
#if defined(SOLARIS) || defined(linux)
#define PERMSFILE "/etc/logindevperm"
#endif	/* SOLARIS */
#ifdef SUNOS
#define PERMSFILE "/etc/fbtab"
#endif	/* SUNOS */
/* Otherwise, leave out PERMSFILE support (can we say BLOAT?) */
#endif	/* PERMSFILE */

#ifdef IS_A_BSD
 /* backwards compatibility for older BSD systems */
#ifndef HAVE_SETPRIORITY
#define HAVE_SETPRIORITY 1
#endif /* HAVE_SETPRIORITY */
#ifndef HAVE_SYS_RESOURCE_H
#define HAVE_SYS_RESOURCE_H 1
#endif /* HAVE_SYS_RESOURCE_H */
#ifndef HAVE_SYS_TIME_H
#define HAVE_SYS_TIME_H 1
#endif /* HAVE_SYS_TIME_H */
#ifndef HAVE_FCNTL_H
#define HAVE_FCNTL_H 1
#endif /* HAVE_FCNTL_H */
#ifndef pid_t
#define pid_t int
#endif /* pid_t */

#ifndef COMPAT_43
#define COMPAT_43 1
#endif	/* COMPAT_43 */
#ifndef USE_OLD_TTY
#define USE_OLD_TTY 1
#endif	/* USE_OLD_TTY */
#ifdef NEED_STRING
#ifndef strchr
#define strchr(s,c)    index((s),(c))
#endif
#ifndef strrchr
#define strrchr(s,c)   rindex((s),(c))
#endif
#endif /* NEED_STRING */

#ifndef SUNOS /* These really shouldn't need to be defined for any system
                 that is reasonably POSIX... */
#ifndef getcwd
#define getcwd(buf,t)  getwd((buf))
#endif
#endif /* !SUNOS */

#ifndef sysconf
 /* sysconf first appeared in POSIX */
#define sysconf(_SC_OPEN_MAX)        getdtablesize()
#endif

 /* BSDs sometimes don't print the group w/o -g */
#ifndef LS_COMMAND
#define LS_COMMAND "/bin/ls -lgA"
#endif	/* LS_COMAND */

 /* BSD traditionally keeps incoming mail in /usr/spool/mail */
#define MAIL_DIR          "/usr/spool/mail"
#endif

#ifdef IS_A_SYSV
/* All modern SYSV systems have the dirent directory entry structure */
#ifndef HAVE_DIRENT
#define HAVE_DIRENT 1
#endif	/* HAVE_DIRENT */
/* SYSV traditionally keeps incoming mail in /usr/mail */
#ifndef MAIL_DIR
#define MAIL_DIR       "/usr/mail"
#endif	/* MAIL_DIR */
#ifndef sigmask
/* sigmask() is a handy BSD macro that is not POSIX or SYSV */
#define sigmask(m)   (1 << ((m)-1))
#endif
#ifndef vfork
#define vfork fork	/* System Vs generally don't do vfork */
#endif

 /* SysVs sometimes don't print the owner w/ -g */
#ifndef LS_COMMAND
#define LS_COMMAND "/bin/ls -lA"
#endif	/* LS_COMAND */

#endif

#ifndef HAVETTYSLOT
#ifdef IS_A_BSD
#define HAVETTYSLOT 1	/* BSD man pages say it appeared in V7 */
#endif	/* IS_A_BSD */
#ifdef IS_A_SYSV
#define HAVETTYSLOT 0	/* But some System Vs appear to have "fixed" it */
#endif	/* IS_A_SYSV */
#endif	/* HAVETTYSLOT */

#if !HAVE_DIRENT
#define dirent direct
#endif /* !HAVE_DIRENT */

#if !defined(HAVE_GETTTYNAM) && defined(BSD4_3)
#define HAVE_GETTTYNAM 1
#endif /* HAVE_GETTTYNAM */

#ifndef HAVE_ST_BLKSIZE
#define HAVE_ST_BLKSIZE 1
#endif /* HAVE_ST_BLKSIZE */

#ifndef HAVE_SIGNAL_H
#define HAVE_SIGNAL_H 1
#endif /* HAVE_SIGNAL_H */

#ifndef DOMOTD
#define DOMOTD 1
#endif /* DOMOTD */

#if DOMOTD
#define HAVE_MOTD_IN_PROFILE 0
#define HAVE_MAILCHECK_IN_PROFILE 0
#else /* DOMOTD */
#define HAVE_MOTD_IN_PROFILE 1
#define HAVE_MAILCHECK_IN_PROFILE 1
#endif /* DOMOTD */
