-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
273 lines (231 loc) · 5.76 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#
# configure -- configure newsd
#
# erco@3dsite.com
#
# Copyright 2003-2004 Michael Sweet
# Copyright 2002 Greg Ercolano
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licensse as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
AC_INIT(newsd.C)
AC_CONFIG_HEADER(config.h)
dnl Version number...
VERSION=1.46
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
dnl Get the operating system...
uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
if test "$uname" = "IRIX64"; then
uname="IRIX"
fi
dnl Clear default debugging options and set normal optimization by
dnl default unless the user asks for debugging specifically.
CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
AC_SUBST(LDFLAGS)
OPTIM="-O"
AC_SUBST(OPTIM)
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging, default=no],
if eval "test x$enable_debug = xyes"; then
OPTIM="-g"
fi)
AC_ARG_WITH(docdir, [ --with-docdir set directory for documentation],
docdir="$withval",
docdir="NONE")
AC_SUBST(docdir)
AC_ARG_WITH(sendmail, [ --with-sendmail set default sendmail program],
sendmail="$withval",
sendmail="NONE")
AC_SUBST(sendmail)
AC_ARG_WITH(spooldir, [ --with-spooldir set default directory for article files],
spooldir="$withval",
spooldir="NONE")
AC_SUBST(spooldir)
dnl Checks for programs...
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
if test "$INSTALL" = "$ac_install_sh"; then
# Use full path to install-sh script...
INSTALL="`pwd`/install-sh -c"
fi
AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(MKDIR,mkdir)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(POD2MAN,pod2man)
AC_PATH_PROG(POD2HTML,pod2html)
AC_PATH_PROG(NROFF,nroff)
if test x$NROFF = x; then
AC_PATH_PROG(GROFF,groff)
if test x$GROFF = x; then
NROFF="echo"
else
NROFF="$GROFF -T ascii"
fi
fi
AC_PATH_PROG(RM,rm)
dnl Architecture checks...
AC_C_CONST
AC_C_CHAR_UNSIGNED
dnl Checks for header files.
AC_HEADER_STDC
dnl Fix "prefix" variable if it hasn't been specified...
if test "x$prefix" = xNONE; then
prefix="/usr"
fi
dnl Fix "exec_prefix" variable if it hasn't been specified...
if test "x$exec_prefix" = NONE; then
exec_prefix="$prefix"
fi
dnl Fix "localstatedir" variable if it hasn't been specified...
if test "$localstatedir" = "\${prefix}/var"; then
if test "$prefix" = "/usr"; then
localstatedir="/var"
else
localstatedir="$prefix/var"
fi
fi
dnl Fix "sysconfdir" variable if it hasn't been specified...
if test "$sysconfdir" = "\${prefix}/etc"; then
if test "$prefix" = "/usr"; then
sysconfdir="/etc"
else
sysconfdir="$prefix/etc"
fi
fi
AC_DEFINE_UNQUOTED(CONFIG_FILE, "$sysconfdir/newsd.conf")
dnl Fix "datadir" variable if it hasn't been specified...
if test "x$datadir" = "x\${prefix}/share"; then
datadir="$prefix/share"
fi
dnl Fix "docdir" variable if it hasn't been specified...
if test "x$docdir" = xNONE; then
docdir="$datadir/doc/newsd"
fi
dnl Fix "sendmail" variable if it hasn't been specified...
if test "x$sendmail" = xNONE; then
for dir in /usr/sbin /usr/lib /usr/bin /usr/local/sbin; do
if test -x $dir/sendmail; then
sendmail="$dir/sendmail"
fi
done
fi
AC_DEFINE_UNQUOTED(SENDMAIL, "$sendmail")
dnl Fix "spooldir" variable if it hasn't been specified...
if test "x$spooldir" = xNONE; then
spooldir="$localstatedir/spool/newsd"
fi
AC_DEFINE_UNQUOTED(SPOOL_DIR, "$spooldir")
dnl Fix "mandir" variable if it hasn't been specified...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
case "$uname" in
*BSD* | Darwin* | Linux*)
# BSD, Darwin (MacOS X), and Linux
mandir="/usr/share/man"
;;
IRIX*)
# SGI IRIX
mandir="/usr/share/catman/a_man"
;;
*)
# All others
mandir="/usr/man"
;;
esac
fi
dnl More manpage stuff...
case "$uname" in
*BSD* | Darwin*)
# *BSD
CAT5EXT="0"
CAT8EXT="0"
MAN8EXT="8"
;;
IRIX*)
# IRIX
CAT5EXT="z"
CAT8EXT="z"
MAN8EXT="1m"
;;
*)
# All others
CAT5EXT="5"
CAT8EXT="8"
MAN8EXT="8"
;;
esac
AC_SUBST(CAT5EXT)
AC_SUBST(CAT8EXT)
AC_SUBST(MAN8EXT)
dnl Setup init.d locations...
if test x$rcdir = x; then
case "$uname" in
FreeBSD* | OpenBSD*)
# FreeBSD and OpenBSD
initdir=""
initddir=""
;;
NetBSD*)
# NetBSD
initdir=""
initddir="/etc/rc.d"
;;
Darwin*)
# Darwin and MacOS X...
initdir=""
initddir="/Library/StartupItems/NNTP"
;;
Linux*)
# Linux seems to choose an init.d directory at random...
if test -d /sbin/init.d; then
# SuSE
initdir="/sbin/init.d"
initddir=".."
else
if test -d /etc/rc.d; then
# RedHat
initdir="/etc/rc.d"
initddir="../init.d"
else
# Others
initdir="/etc"
initddir="../init.d"
fi
fi
;;
OSF1* | HP-UX*)
initdir="/sbin"
initddir="../init.d"
;;
AIX*)
initdir="/etc/rc.d"
initddir=".."
;;
*)
initdir="/etc"
initddir="../init.d"
;;
esac
else
initdir=""
initddir="$rcdir"
fi
AC_SUBST(initdir)
AC_SUBST(initddir)
dnl Output the makefile, list file, and config header...
AC_OUTPUT(Makefile newsd.sh newsd.conf newsd.list newsd.pod newsd.conf.pod)