-
Notifications
You must be signed in to change notification settings - Fork 9
/
configure.in
270 lines (244 loc) · 6.6 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/crctab.c)
AM_INIT_AUTOMAKE(lrzsz, 0.12.20)
AM_CONFIG_HEADER(config.h)
dnl AC_C_CROSS is in AC_PROG_CC since 2.12
AC_PREREQ(2.12)
PACKAGE_VERSION="$PACKAGE-$VERSION"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE_VERSION)
ALL_LINGUAS="de"
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
changequote(,)dnl
case $VERSION in
[0-9]*.[0-9]*.[0-9]*) README_ALPHA="README-alpha";;
*) README_ALPHA=;;
esac
changequote([, ])dnl
AC_ARG_ENABLE(timesync,
[--disable-timesync exclude support for timesync protocol],
[if test "$enableval" = "no" ; then
:
else
AC_DEFINE(ENABLE_TIMESYNC)
fi],
[AC_DEFINE(ENABLE_TIMESYNC)])
AC_SUBST(ENABLE_TIMESYNC)
AC_ARG_ENABLE(pubdir,
[--enable-pubdir=/path include support for a public writeable directory],
[if test "$enableval" = "no" ; then
:
else
AC_DEFINE_UNQUOTED(PUBDIR,"$enableval")
fi])
AC_ARG_ENABLE(mkdir,
[--disable-mkdir disable support for creating directories (lrz)],
[if test "$enableval" = "no" ; then
:
else
AC_DEFINE(ENABLE_MKDIR)
fi],
[AC_DEFINE(ENABLE_MKDIR)])
AC_ARG_ENABLE(syslog,
[--enable-syslog=FACILITY,{force,default,optional} include syslogsupport],
[
if test "$enableval" = "no" ; then
:
else
case "$enableval" in
*,*)
level=`echo $enableval|sed -e 's/^.*,//'`
fac=`echo $enableval|sed -e 's/,.*$//'`
AC_DEFINE_UNQUOTED(ENABLE_SYSLOG,$fac)
;;
*)
lookup_facility=LOG_UUCP
level="$enableval"
;;
esac
if test "$level" = "force" ; then
AC_DEFINE(ENABLE_SYSLOG_FORCE)
else
if test "$level" = "optional" ; then
:
else
AC_DEFINE(ENABLE_SYSLOG_DEFAULT)
fi
fi
fi],[
AC_DEFINE(ENABLE_SYSLOG_DEFAULT)
lookup_facility=LOG_UUCP
])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
dnl AC_PROG_INSTALL included in AM_INIT_AUTOMAKE
dnl AC_PROG_MAKE_SET included in AM_INIT_AUTOMAKE
AC_PROG_RANLIB
AC_ISC_POSIX
AC_AIX
AC_MINIX
AM_C_PROTOTYPES
AC_C_CONST
AC_C_INLINE
if test `hostname` = tirka.ohse.de -a "$cross_compiling" = no ; then
test $prefix = NONE && prefix=/usr
if test -z "$CFLAGS" ; then
case "$CC" in
*gcc*)
CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes"
# -Wnested_externs entfernt wegen dcgettext()
CFLAGS="$CFLAGS -Wpointer-arith -Wcast-qual -Wcast-align"
CFLAGS="$CFLAGS -Winline -Wwrite-strings -Wshadow -Wmissing-braces"
CFLAGS="$CFLAGS -Wcomments -fforce-mem -fforce-addr -O2 -m486 -pipe"
CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2 -g3"
;;
esac
fi
fi
case "$CFLAGS" in
*-Wstrict-prototypes*)
AC_DEFINE(STRICT_PROTOTYPES)
;;
esac
dnl Checks for libraries.
dnl SCO needs this.
AC_CHECK_LIB(socket,syslog,,,)
dnl BeOS needs this
AC_CHECK_LIB(be,syslog,,,)
dnl slowlartis needs this
AC_CHECK_LIB(nsl,gethostbyname,,,)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h sys/times.h)
LRZSZ_HEADERS_TERM_IO
AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)
AC_CHECK_HEADERS(sys/mman.h utime.h syslog.h sys/syslog.h sys/param.h)
AC_CHECK_HEADERS(sys/select.h strings.h arpa/inet.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
LRZSZ_TYPE_SPEED_T
AC_STRUCT_ST_RDEV
AC_HEADER_TIME
lrzsz_HEADER_SYS_SELECT
AC_STRUCT_TM
LRZSZ_ERRNO_DECL
dnl Checks for library functions.
if test $cross_compiling = no ; then
AC_FUNC_SETVBUF_REVERSED
fi
AC_TYPE_SIGNAL
dnl suggested by autoscan, but not really needed.
dnl AC_FUNC_UTIME_NULL
AC_FUNC_MMAP
AC_FUNC_ALLOCA
AC_EGREP_HEADER([struct.*utimbuf], utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF))
AC_CHECK_FUNCS(gettimeofday settimeofday)
AC_CHECK_FUNCS(strchr memcpy select vprintf)
AC_CHECK_FUNCS(times rdchk utime syslog siginterrupt)
AC_REPLACE_FUNCS(mkdir mktime strerror strstr strdup strtoul strtol strpbrk)
AC_REPLACE_FUNCS(stpcpy strftime vasprintf)
AC_REPLACE_GNU_GETOPT
dnl for lib/error.c
AC_DEFINE(HAVE_STRERROR)
dnl special tests
dnl this is taken from taylor uucp.
dnl Check for the SCO buggy ftime; the code can cope with the bug,
dnl though it would prefer not to, so if we're cross-configuring we
dnl accept that ftime exists.
AC_CHECK_FUNC(ftime,
[AC_MSG_CHECKING(that ftime works correctly)
AC_CACHE_VAL(lrzsz_cv_sys_ftime_ok,
[AC_TRY_RUN([
#include <sys/types.h>
#include <sys/timeb.h>
#include <stdio.h>
main ()
{
struct timeb s, slast;
int c = 0;
ftime (&slast);
while (c < 10)
{
ftime (&s);
if (s.time < slast.time
|| (s.time == slast.time && s.millitm < slast.millitm)) {
fprintf(stderr,"s: %ld, %ld, slast: %ld, %ld\n",
s.time,s.millitm, slast.time,slast.millitm);
exit (1);
}
if (s.time != slast.time)
++c;
slast.time = s.time;
slast.millitm = s.millitm;
}
exit (0);
}
],
lrzsz_cv_sys_ftime_ok=yes,
lrzsz_cv_sys_ftime_ok=no,
lrzsz_cv_sys_ftime_ok=runtime)])
case $lrzsz_cv_sys_ftime_ok in
yes) AC_DEFINE(HAVE_FTIME) AC_MSG_RESULT(yes) ;;
no) AC_MSG_RESULT(no)
AC_MSG_WARN(ftime seems to be buggy) ;;
runtime) AC_DEFINE(HAVE_FTIME)
AC_MSG_RESULT(will check at run time) ;;
esac
])
dnl
AC_MSG_CHECKING([for timezone variable])
AC_CACHE_VAL(libquark_cv_var_timezone,[
AC_TRY_LINK([#include <time.h>],[return(int)(timezone/2);],
[libquark_cv_var_timezone=yes],
[libquark_cv_var_timezone=no])
])
if test $libquark_cv_var_timezone = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_TIMEZONE_VAR)
else
AC_MSG_RESULT(no)
fi
if test "x$lookup_facility" = x ; then
:
else
AC_MSG_CHECKING([for $lookup_facility])
AC_CACHE_VAL(lrzsz_cv_lookup_facility,[
AC_EGREP_CPP(ihave$lookup_facility, [
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#else
#include <sys/syslog.h>
#endif
#ifdef $lookup_facility
ihave$lookup_facility
#endif
], lrzsz_cv_lookup_facility=yes, lrzsz_cv_lookup_facility=no)
])
if test $lrzsz_cv_lookup_facility = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(ENABLE_SYSLOG,$lookup_facility)
else
AC_DEFINE(ENABLE_SYSLOG,LOG_USER)
AC_MSG_RESULT(no)
fi
fi
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LIBS)
AM_GNU_GETTEXT
AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile \
man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
src/lrzszbug],
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile;
chmod +x debian/rules;
test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])