1 dnl Process this file with autoconf to produce a configure script.
3 AM_INIT_AUTOMAKE(lrzsz, 0.12.20)
4 AM_CONFIG_HEADER(config.h)
7 dnl AC_C_CROSS is in AC_PROG_CC since 2.12
10 PACKAGE_VERSION="$PACKAGE-$VERSION"
11 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
12 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
13 AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
16 AC_SUBST(PACKAGE_VERSION)
25 [0-9]*.[0-9]*.[0-9]*) README_ALPHA="README-alpha";;
31 AC_ARG_ENABLE(timesync,
32 [--disable-timesync exclude support for timesync protocol],
33 [if test "$enableval" = "no" ; then
36 AC_DEFINE(ENABLE_TIMESYNC)
38 [AC_DEFINE(ENABLE_TIMESYNC)])
39 AC_SUBST(ENABLE_TIMESYNC)
41 [--enable-pubdir=/path include support for a public writeable directory],
42 [if test "$enableval" = "no" ; then
45 AC_DEFINE_UNQUOTED(PUBDIR,"$enableval")
48 [--disable-mkdir disable support for creating directories (lrz)],
49 [if test "$enableval" = "no" ; then
52 AC_DEFINE(ENABLE_MKDIR)
54 [AC_DEFINE(ENABLE_MKDIR)])
56 [--enable-syslog=FACILITY,{force,default,optional} include syslogsupport],
58 if test "$enableval" = "no" ; then
63 level=`echo $enableval|sed -e 's/^.*,//'`
64 fac=`echo $enableval|sed -e 's/,.*$//'`
65 AC_DEFINE_UNQUOTED(ENABLE_SYSLOG,$fac)
68 lookup_facility=LOG_UUCP
72 if test "$level" = "force" ; then
73 AC_DEFINE(ENABLE_SYSLOG_FORCE)
75 if test "$level" = "optional" ; then
78 AC_DEFINE(ENABLE_SYSLOG_DEFAULT)
82 AC_DEFINE(ENABLE_SYSLOG_DEFAULT)
83 lookup_facility=LOG_UUCP
86 dnl Checks for programs.
88 AC_PROG_GCC_TRADITIONAL
89 dnl AC_PROG_INSTALL included in AM_INIT_AUTOMAKE
90 dnl AC_PROG_MAKE_SET included in AM_INIT_AUTOMAKE
99 if test `hostname` = tirka.ohse.de -a "$cross_compiling" = no ; then
100 test $prefix = NONE && prefix=/usr
101 if test -z "$CFLAGS" ; then
104 CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes"
105 # -Wnested_externs entfernt wegen dcgettext()
106 CFLAGS="$CFLAGS -Wpointer-arith -Wcast-qual -Wcast-align"
107 CFLAGS="$CFLAGS -Winline -Wwrite-strings -Wshadow -Wmissing-braces"
108 CFLAGS="$CFLAGS -Wcomments -fforce-mem -fforce-addr -O2 -m486 -pipe"
109 CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2 -g3"
115 *-Wstrict-prototypes*)
116 AC_DEFINE(STRICT_PROTOTYPES)
120 dnl Checks for libraries.
122 AC_CHECK_LIB(socket,syslog,,,)
124 AC_CHECK_LIB(be,syslog,,,)
125 dnl slowlartis needs this
126 AC_CHECK_LIB(nsl,gethostbyname,,,)
128 dnl Checks for header files.
130 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h sys/times.h)
131 LRZSZ_HEADERS_TERM_IO
132 AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)
133 AC_CHECK_HEADERS(sys/mman.h utime.h syslog.h sys/syslog.h sys/param.h)
134 AC_CHECK_HEADERS(sys/select.h strings.h arpa/inet.h)
136 dnl Checks for typedefs, structures, and compiler characteristics.
143 lrzsz_HEADER_SYS_SELECT
147 dnl Checks for library functions.
148 if test $cross_compiling = no ; then
149 AC_FUNC_SETVBUF_REVERSED
152 dnl suggested by autoscan, but not really needed.
153 dnl AC_FUNC_UTIME_NULL
156 AC_EGREP_HEADER([struct.*utimbuf], utime.h, AC_DEFINE(HAVE_STRUCT_UTIMBUF))
158 AC_CHECK_FUNCS(gettimeofday settimeofday)
159 AC_CHECK_FUNCS(strchr memcpy select vprintf)
160 AC_CHECK_FUNCS(times rdchk utime syslog siginterrupt)
161 AC_REPLACE_FUNCS(mkdir mktime strerror strstr strdup strtoul strtol strpbrk)
162 AC_REPLACE_FUNCS(stpcpy strftime vasprintf)
164 AC_REPLACE_GNU_GETOPT
167 AC_DEFINE(HAVE_STRERROR)
172 dnl this is taken from taylor uucp.
173 dnl Check for the SCO buggy ftime; the code can cope with the bug,
174 dnl though it would prefer not to, so if we're cross-configuring we
175 dnl accept that ftime exists.
177 [AC_MSG_CHECKING(that ftime works correctly)
178 AC_CACHE_VAL(lrzsz_cv_sys_ftime_ok,
180 #include <sys/types.h>
181 #include <sys/timeb.h>
185 struct timeb s, slast;
191 if (s.time < slast.time
192 || (s.time == slast.time && s.millitm < slast.millitm)) {
193 fprintf(stderr,"s: %ld, %ld, slast: %ld, %ld\n",
194 s.time,s.millitm, slast.time,slast.millitm);
197 if (s.time != slast.time)
200 slast.millitm = s.millitm;
205 lrzsz_cv_sys_ftime_ok=yes,
206 lrzsz_cv_sys_ftime_ok=no,
207 lrzsz_cv_sys_ftime_ok=runtime)])
208 case $lrzsz_cv_sys_ftime_ok in
209 yes) AC_DEFINE(HAVE_FTIME) AC_MSG_RESULT(yes) ;;
210 no) AC_MSG_RESULT(no)
211 AC_MSG_WARN(ftime seems to be buggy) ;;
212 runtime) AC_DEFINE(HAVE_FTIME)
213 AC_MSG_RESULT(will check at run time) ;;
218 AC_MSG_CHECKING([for timezone variable])
219 AC_CACHE_VAL(libquark_cv_var_timezone,[
220 AC_TRY_LINK([#include <time.h>],[return(int)(timezone/2);],
221 [libquark_cv_var_timezone=yes],
222 [libquark_cv_var_timezone=no])
224 if test $libquark_cv_var_timezone = yes ; then
226 AC_DEFINE(HAVE_TIMEZONE_VAR)
230 if test "x$lookup_facility" = x ; then
233 AC_MSG_CHECKING([for $lookup_facility])
234 AC_CACHE_VAL(lrzsz_cv_lookup_facility,[
235 AC_EGREP_CPP(ihave$lookup_facility, [
239 #include <sys/syslog.h>
241 #ifdef $lookup_facility
242 ihave$lookup_facility
244 ], lrzsz_cv_lookup_facility=yes, lrzsz_cv_lookup_facility=no)
246 if test $lrzsz_cv_lookup_facility = yes ; then
248 AC_DEFINE_UNQUOTED(ENABLE_SYSLOG,$lookup_facility)
250 AC_DEFINE(ENABLE_SYSLOG,LOG_USER)
262 AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
263 AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
265 AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile \
266 man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
268 [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile;
269 chmod +x debian/rules;
270 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])