b0f66028 |
1 | dnl -*-m4-*- |
c4f2d992 |
2 | dnl |
15547517 |
3 | dnl $Id: configure.in,v 1.22 2004/04/17 10:46:08 mdw Exp $ |
c4f2d992 |
4 | dnl |
5 | dnl Source for auto configuration for `become' |
6 | dnl |
c758e654 |
7 | dnl (c) 1998 Mark Wooding |
c4f2d992 |
8 | dnl |
9 | |
03f996bd |
10 | dnl----- Licensing notice --------------------------------------------------- |
c4f2d992 |
11 | dnl |
12 | dnl This file is part of `become' |
13 | dnl |
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. |
18 | dnl |
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. |
23 | dnl |
24 | dnl You should have received a copy of the GNU General Public License |
03f996bd |
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. |
c4f2d992 |
27 | |
f60a3434 |
28 | AC_INIT(src/become.c) |
29 | AM_INIT_AUTOMAKE(become, 1.4.0) |
b6ea915c |
30 | AM_CONFIG_HEADER(config.h) |
c4f2d992 |
31 | |
32 | dnl --- Check for compilers and things --- |
33 | |
34 | AC_PROG_CC |
b6ea915c |
35 | mdw_GCC_FLAGS |
36 | AM_PROG_LEX |
c4f2d992 |
37 | AC_CHECK_PROG(AR, ar, ar) |
38 | AC_PROG_RANLIB |
39 | AC_PROG_YACC |
c4f2d992 |
40 | |
387501ae |
41 | dnl --- Set default become style --- |
42 | |
43 | AC_ARG_ENABLE([style], |
ffbfa517 |
44 | [ --enable-style=STYLE set default style to preserve, setuser, or login], |
f36dccc8 |
45 | [case "$enableval" in |
387501ae |
46 | preserve) style="l_preserve" ;; |
ffbfa517 |
47 | su|setuser) style="l_setuser" ;; |
387501ae |
48 | login) style="l_login" ;; |
f36dccc8 |
49 | *) AC_MSG_ERROR([unknown login style: choose preserve, setuser, or login]) |
50 | ;; |
387501ae |
51 | esac], |
52 | [style="l_preserve"]) |
53 | AC_DEFINE_UNQUOTED(DEFAULT_LOGIN_STYLE, $style) |
54 | |
45732897 |
55 | dnl --- Choose networking options --- |
56 | |
57 | AC_ARG_ENABLE([network], |
58 | [ --disable-network disable the client-server bits of the program], |
59 | [if test "$enableval" = "no"; then |
60 | AC_DEFINE(NONETWORK) |
61 | fi]) |
62 | |
f81d049a |
63 | dnl --- Set configuration directory --- |
64 | |
65 | AC_ARG_WITH([etcdir], |
66 | [ --with-etcdir=PATH set directory for configuration and key files |
67 | [default is /etc/become]], |
68 | [etcdir="$withval"], [etcdir="/etc/become"]) |
69 | AC_SUBST(etcdir) |
b0f66028 |
70 | |
71 | AC_ARG_WITH([pidfile], |
72 | [ --with-pidfile=PATH set filename for pidfile |
73 | [default is ETCDIR/become/pid]], |
74 | [pidfile="$withval"], [pidfile="${etcdir}/become.pid"]) |
75 | AC_SUBST(pidfile) |
f81d049a |
76 | |
df962e20 |
77 | AC_ARG_WITH([htmldir], |
78 | [ --with-htmldir=PATH set directory for HTML documentation |
79 | [default is PREFIX/html/become]], |
07981d85 |
80 | [htmldir="$withval"], [htmldir='${prefix}/html/become']) |
df962e20 |
81 | AC_SUBST(htmldir) |
82 | |
b0f66028 |
83 | mdw_DEFINE_PATHS([ |
84 | mdw_DEFINE_PATH([ETCDIR], [$etcdir]) |
85 | mdw_DEFINE_PATH([file_PID], [$pidfile]) |
86 | ]) |
87 | |
c4f2d992 |
88 | dnl --- Debugging stuff --- |
89 | |
f60a3434 |
90 | mdw_OPT_EFENCE |
91 | mdw_OPT_NDEBUG |
92 | mdw_OPT_TRACE |
c4f2d992 |
93 | |
f36dccc8 |
94 | dnl --- Libraries --- |
95 | |
f60a3434 |
96 | mdw_MLIB(2.0.1) |
15547517 |
97 | mdw_CATACOMB(2.1.0) |
f60a3434 |
98 | |
f36dccc8 |
99 | mdw_CHECK_MANYLIBS(socket, socket,, |
c758e654 |
100 | [AC_MSG_ERROR([Socket library not found])]) |
f36dccc8 |
101 | |
102 | mdw_CHECK_MANYLIBS(gethostbyname, resolv nsl,, |
c758e654 |
103 | [AC_MSG_ERROR([Resolver library not found])]) |
f36dccc8 |
104 | |
105 | mdw_CHECK_MANYLIBS(yp_all, nsl, AC_DEFINE(HAVE_YP)) |
106 | |
82399d0a |
107 | dnl --- Other functions --- |
108 | |
109 | AC_CHECK_FUNCS(sigprocmask) |
110 | |
f36dccc8 |
111 | dnl --- Types --- |
112 | |
113 | AC_TYPE_PID_T |
114 | AC_TYPE_UID_T |
98661ef5 |
115 | mdw_TYPE_SSIZE_T |
f36dccc8 |
116 | |
f36dccc8 |
117 | dnl --- Set the path separator --- |
118 | |
119 | AC_DEFINE(PATHSEP, '/') |
120 | |
121 | dnl --- Check for some useful functions --- |
122 | |
123 | AC_CHECK_FUNCS(setreuid setgroups) |
124 | AC_CHECK_FUNCS(getrusage vtimes) |
125 | |
c4f2d992 |
126 | dnl --- Done --- |
127 | |
b6ea915c |
128 | AC_OUTPUT(Makefile conf/Makefile src/Makefile manual/Makefile) |
c4f2d992 |
129 | |
130 | dnl----- That's all, folks -------------------------------------------------- |