3 dnl $Id: configure.in,v 1.12 1998/04/23 13:09:24 mdw Exp $
5 dnl Source for auto configuration for `become'
7 dnl (c) 1998 Mark Wooding
10 dnl----- Licensing notice ---------------------------------------------------
12 dnl This file is part of `become'
14 dnl `Become' is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU General Public License as published by
16 dnl the Free Software Foundation; either version 2 of the License, or
17 dnl (at your option) any later version.
19 dnl `Become' is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU General Public License for more details.
24 dnl You should have received a copy of the GNU General Public License
25 dnl along with `become'; if not, write to the Free Software Foundation,
26 dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 dnl----- Revision history ---------------------------------------------------
30 dnl $Log: configure.in,v $
31 dnl Revision 1.12 1998/04/23 13:09:24 mdw
32 dnl Add new option to disable networking.
34 dnl Revision 1.11 1998/02/20 17:55:56 mdw
35 dnl Fix default HTML directory.
37 dnl Revision 1.10 1998/01/12 16:45:21 mdw
38 dnl Fix copyright date.
40 dnl Revision 1.9 1997/09/18 11:24:27 mdw
41 dnl Add `conf' directory. Add an `htmldir' installation directory too.
43 dnl Revision 1.8 1997/09/17 10:36:30 mdw
44 dnl Remove `set.c'. No longer necessary.
46 dnl Revision 1.7 1997/09/09 18:18:41 mdw
47 dnl Check for setgroups(2), to see whether subsidiary group lists need to be
50 dnl Revision 1.6 1997/09/08 13:41:14 mdw
51 dnl Check for `setreuid' for changing permissions.
53 dnl Revision 1.5 1997/09/05 11:45:18 mdw
54 dnl Add support for different login styles, and environment variable
55 dnl manipulation in a safe and useful way.
57 dnl Revision 1.4 1997/08/20 16:10:56 mdw
58 dnl Lowercase `mdw_' prefixes to macros. Add a `--with-etcdir=PATH'
59 dnl option. Update `stamp-h' as required by the Automake docs (silly
62 dnl Revision 1.3 1997/08/07 09:34:32 mdw
63 dnl Added `ElectricFence' support, and support for the `deep' package
66 dnl Revision 1.2 1997/08/04 10:24:21 mdw
67 dnl Sources placed under CVS control.
69 dnl Revision 1.1 1997/07/21 13:47:51 mdw
74 AC_CONFIG_HEADER(config.h)
77 AC_DEFINE(VERSION, "1.3pre1 (23 April 1998)")
81 dnl --- Check for compilers and things ---
86 AC_CHECK_PROG(AR, ar, ar)
91 if test "$GCC" = "yes"; then
92 CFLAGS="$CFLAGS -pedantic -Wall"
95 dnl --- Set default become style ---
97 AC_ARG_ENABLE([style],
98 [ --enable-style=STYLE set default style to preserve, setuser, or login],
100 preserve) style="l_preserve" ;;
101 su|setuser) style="l_setuser" ;;
102 login) style="l_login" ;;
103 *) AC_MSG_ERROR([unknown login style: choose preserve, setuser, or login])
106 [style="l_preserve"])
107 AC_DEFINE_UNQUOTED(DEFAULT_LOGIN_STYLE, $style)
109 dnl --- Choose networking options ---
111 AC_ARG_ENABLE([network],
112 [ --disable-network disable the client-server bits of the program],
113 [if test "$enableval" = "no"; then
117 dnl --- Set configuration directory ---
119 AC_ARG_WITH([etcdir],
120 [ --with-etcdir=PATH set directory for configuration and key files
121 [default is /etc/become]],
122 [etcdir="$withval"], [etcdir="/etc/become"])
124 AC_DEFINE_UNQUOTED(ETCDIR, "$etcdir")
126 AC_ARG_WITH([htmldir],
127 [ --with-htmldir=PATH set directory for HTML documentation
128 [default is PREFIX/html/become]],
129 [htmldir="$withval"], [htmldir='${prefix}/html/become'])
132 dnl --- Debugging stuff ---
134 AC_ARG_WITH(electric-fence,
135 [ --with-electric-fence link programs with Electric Fence],
136 [if test "$withval" = "yes"; then
137 AC_CHECK_LIB(efence, malloc)
140 AC_ARG_ENABLE(debugging,
141 [ --enable-debugging spews vast swathes of useless information],
142 [if test "$enableval" = "no"; then
145 AC_DEFINE(NDEBUG, 1))
147 AC_ARG_ENABLE(tracing,
148 [ --enable-tracing enable output of tracing information],
149 [if test "$enableval" = "yes"; then
154 dnl --- Libraries ---
156 mdw_CHECK_MANYLIBS(socket, socket,,
157 [AC_MSG_ERROR([Socket library not found])])
159 mdw_CHECK_MANYLIBS(gethostbyname, resolv nsl,,
160 [AC_MSG_ERROR([Resolver library not found])])
162 mdw_CHECK_MANYLIBS(yp_all, nsl, AC_DEFINE(HAVE_YP))
168 AC_CHECK_TYPE(ssize_t, int)
170 dnl --- Check on type sizes ---
172 AC_CHECK_SIZEOF(int, 2)
174 dnl --- Set the path separator ---
176 AC_DEFINE(PATHSEP, '/')
178 dnl --- Check for some useful functions ---
180 AC_CHECK_FUNCS(setreuid setgroups)
181 AC_CHECK_FUNCS(getrusage vtimes)
185 AC_OUTPUT(Makefile conf/Makefile src/Makefile manual/Makefile,
186 [test -z "$CONFIG_HEADERS" || echo timestamp >stamp-h])
188 dnl----- That's all, folks --------------------------------------------------