src/become.c: Reintroduce missing newline in usage message.
[become] / configure.in
index cae954d..5c62051 100644 (file)
@@ -1,10 +1,10 @@
-dnl -*-fundamental-*-
+dnl -*-m4-*-
 dnl
-dnl $Id: configure.in,v 1.6 1997/09/08 13:41:14 mdw Exp $
+dnl $Id$
 dnl
 dnl Source for auto configuration for `become'
 dnl
-dnl (c) 1997 Mark Wooding
+dnl (c) 1998 Mark Wooding
 dnl
 
 dnl----- Licensing notice ---------------------------------------------------
@@ -25,92 +25,41 @@ dnl You should have received a copy of the GNU General Public License
 dnl along with `become'; if not, write to the Free Software Foundation,
 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-dnl----- Revision history ---------------------------------------------------
-dnl
-dnl $Log: configure.in,v $
-dnl Revision 1.6  1997/09/08 13:41:14  mdw
-dnl Check for `setreuid' for changing permissions.
-dnl
-# Revision 1.5  1997/09/05  11:45:18  mdw
-# Add support for different login styles, and environment variable
-# manipulation in a safe and useful way.
-#
-# Revision 1.4  1997/08/20  16:10:56  mdw
-# Lowercase `mdw_' prefixes to macros.  Add a `--with-etcdir=PATH'
-# option.  Update `stamp-h' as required by the Automake docs (silly
-# me).
-#
-dnl Revision 1.3  1997/08/07 09:34:32  mdw
-dnl Added `ElectricFence' support, and support for the `deep' package
-dnl structure.
-dnl
-dnl Revision 1.2  1997/08/04 10:24:21  mdw
-dnl Sources placed under CVS control.
-dnl
-dnl Revision 1.1  1997/07/21  13:47:51  mdw
-dnl Initial revision
-dnl
-
-AC_INIT(src/icrypt.c)
-AC_CONFIG_HEADER(config.h)
-PACKAGE=become VERSION=1.2-pre
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-AC_DEFINE(VERSION, "1.2-pre (24 July 1997)")
+AC_INIT(src/become.c)
+AM_INIT_AUTOMAKE(become, 1.4.0)
+AM_CONFIG_HEADER(config.h)
 
 dnl --- Check for compilers and things ---
 
 AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LEX
+mdw_GCC_FLAGS
+AM_PROG_LEX
 AC_CHECK_PROG(AR, ar, ar)
 AC_PROG_RANLIB
-AC_PROG_MAKE_SET
 AC_PROG_YACC
-AC_ARG_PROGRAM
-if test "$ac_cv_prog_gcc" = "yes"; then
-  CFLAGS="$CFLAGS -pedantic -Wall"
-fi
-
-dnl --- Libraries ---
-
-mdw_CHECK_MANYLIBS(socket, socket,,
-  AC_MSG_ERROR([Socket library not found]))
-
-mdw_CHECK_MANYLIBS(gethostbyname, resolv nsl,,
-  AC_MSG_ERROR([Resolver library not found]))
-
-mdw_CHECK_MANYLIBS(yp_all, nsl, AC_DEFINE(HAVE_YP))
-
-dnl --- Types ---
-
-AC_TYPE_PID_T
-AC_TYPE_UID_T
-AC_CHECK_TYPE(ssize_t, int)
-
-dnl --- Check on type sizes ---
-
-AC_CHECK_SIZEOF(int, 2)
-
-dnl --- Set the path separator ---
-
-AC_DEFINE(PATHSEP, '/')
-
-dnl --- Check for some useful functions ---
-
-AC_CHECK_FUNCS(setreuid getrusage vtimes)
 
 dnl --- Set default become style ---
 
 AC_ARG_ENABLE([style],
-[  --enable-style=STYLE          set default style to preserve, su, or login],
-[case "$withval" in
+[  --enable-style=STYLE          set default style to preserve, setuser, or login],
+[case "$enableval" in
   preserve) style="l_preserve" ;;
-  su|user) style="l_user" ;;
+  su|setuser) style="l_setuser" ;;
   login) style="l_login" ;;
+  *) AC_MSG_ERROR([unknown login style: choose preserve, setuser, or login])
+     ;;
 esac],
 [style="l_preserve"])
-AC_DEFINE_UNQUOTED(DEFAULT_LOGIN_STYLE, $style)
+AC_DEFINE_UNQUOTED([DEFAULT_LOGIN_STYLE], [$style],
+                   [Default login style: l_preserve, l_setuser or l_login.])
+
+dnl --- Choose networking options ---
+
+AC_ARG_ENABLE([network],
+[  --disable-network      disable the client-server bits of the program],
+  [if test "$enableval" = "no"; then
+    AC_DEFINE([NONETWORK], [1], [Define to disable network support.])
+  fi])
 
 dnl --- Set configuration directory ---
 
@@ -119,33 +68,68 @@ AC_ARG_WITH([etcdir],
                          [default is /etc/become]],
 [etcdir="$withval"], [etcdir="/etc/become"])
 AC_SUBST(etcdir)
-AC_DEFINE_UNQUOTED(ETCDIR, "$etcdir")
+
+AC_ARG_WITH([pidfile],
+[  --with-pidfile=PATH   set filename for pidfile 
+                          [default is ETCDIR/become/pid]],
+[pidfile="$withval"], [pidfile="${etcdir}/become.pid"])
+AC_SUBST(pidfile)
+
+AC_ARG_WITH([htmldir],
+[  --with-htmldir=PATH   set directory for HTML documentation
+                         [default is PREFIX/html/become]],
+[htmldir="$withval"], [htmldir='${prefix}/html/become'])
+AC_SUBST(htmldir)
+
+AH_TEMPLATE([ETCDIR], [Where Become should look for its configuration.])
+AH_TEMPLATE([file_PID], [Where Become should write its process-id.])
+mdw_DEFINE_PATHS([
+  mdw_DEFINE_PATH([ETCDIR], [$etcdir])
+  mdw_DEFINE_PATH([file_PID], [$pidfile])
+])
 
 dnl --- Debugging stuff ---
 
-AC_ARG_WITH(electric-fence,
-[  --with-electric-fence         link programs with Electric Fence],
-  [if test "$withval" = "yes"; then
-    AC_CHECK_LIB(efence, malloc)
-  fi])
+mdw_OPT_EFENCE
+mdw_OPT_NDEBUG
+mdw_OPT_TRACE
 
-AC_ARG_ENABLE(debugging,
-[  --enable-debugging    spews vast swathes of useless information],
-  [if test "$enableval" = "no"; then
-    AC_DEFINE(NDEBUG, 1)
-  fi],
-  AC_DEFINE(NDEBUG, 1))
+dnl --- Libraries ---
+
+mdw_MLIB(2.0.1)
+mdw_CATACOMB(2.1.0)
+
+mdw_CHECK_MANYLIBS(socket, socket,,
+  [AC_MSG_ERROR([Socket library not found.])])
+
+mdw_CHECK_MANYLIBS(gethostbyname, resolv nsl,,
+  [AC_MSG_ERROR([Resolver library not found.])])
+
+mdw_CHECK_MANYLIBS([yp_all], [nsl], 
+  [AC_DEFINE([HAVE_YP], [1], 
+             [Define if you have (and want to use) the Yellow Peril.])])
+
+dnl --- Other functions ---
+
+AC_CHECK_FUNCS([sigprocmask])
+
+dnl --- Types ---
+
+AC_TYPE_PID_T
+AC_TYPE_UID_T
+mdw_TYPE_SSIZE_T
+
+dnl --- Set the path separator ---
+
+AC_DEFINE([PATHSEP], ['/'], [Your operating system's path separator.])
+
+dnl --- Check for some useful functions ---
 
-AC_ARG_ENABLE(tracing,
-[  --enable-tracing      enable output of tracing information],
-  [if test "$enableval" = "yes"; then
-    AC_DEFINE(TRACING)
-  fi],
-  AC_DEFINE(TRACING))
+AC_CHECK_FUNCS(setreuid setgroups)
+AC_CHECK_FUNCS(getrusage vtimes)
 
 dnl --- Done ---
 
-AC_OUTPUT(Makefile src/Makefile manual/Makefile,
-          [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
+AC_OUTPUT(Makefile conf/Makefile src/Makefile manual/Makefile)
 
 dnl----- That's all, folks --------------------------------------------------