3 dnl Process this file with autoconf to produce a configure script.
5 AM_INIT_AUTOMAKE(mdsms, 1.5.3)
6 AM_CONFIG_HEADER(config.h)
9 dnl Configuration switches.
11 AC_MSG_CHECKING([whether debugging is requested])
13 [ --enable-debug enable debugging output to stderr],
14 enable_debug=$enableval, enable_debug=no)
15 AC_MSG_RESULT($enable_debug)
17 AC_MSG_CHECKING([whether included getopt is requested])
18 AC_ARG_WITH(included-getopt,
19 [ --with-included-getopt use included getopt(3)],
20 with_getopt=$withval, with_getopt=no)
21 AC_MSG_RESULT($with_getopt)
23 AC_MSG_CHECKING([for user-specified lock directory])
24 AC_ARG_WITH(lock-directory,
25 [ --with-lock-directory override default search for modem lock directory],
26 with_lock_directory=$withval, with_lock_directory=)
27 AC_MSG_RESULT($with_lock_directory)
30 [ --without-efence disable use of Electric Fence in maintainer-mode],
31 efence=$withval, efence=yes)
33 dnl Checks for programs.
35 if test "$USE_MAINTAINER_MODE" = yes;then
36 if test "$GCC" = yes;then
37 CFLAGS="$CFLAGS -Wall -ansi -pedantic -ggdb3"
38 if test x$efence != xno;then
39 AC_CHECK_LIB(efence, EF_Exit)
49 dnl Checks for pathnames.
53 AC_CHECK_HEADERS(libintl.h)
55 AC_MSG_CHECKING([for modem lock directory])
57 if test "$with_lock_directory" = no;then
58 AC_MSG_RESULT([user disabled])
60 if test yes = "$with_lock_directory" \
61 -o -z "$with_lock_directory";then
62 for dira in /usr /var ;do
63 for dirb in /spool "" ;do
64 for dirc in /uucp /locks /lock;do
65 dir="${dira}${dirb}${dirc}"
66 if test -d "$dir";then dirx="$dir";fi
68 if test -z "$dirx";then
69 AC_MSG_RESULT([none found, disabled])
71 AC_MSG_RESULT([$dirx])
74 dirx="$with_lock_directory"
75 if test -d "$dirx";then AC_MSG_RESULT([$dirx])
76 else AC_MSG_RESULT([warning - directory doesn't exist: $dirx])
80 if test -z "$dirx";then AC_DEFINE(DEF_LOCKFILE,[""])
81 else AC_DEFINE_UNQUOTED(DEF_LOCKFILE,"${dirx}/LCK..%s")
84 dnl Checks for libraries.
86 dnl Checks for header files.
89 dnl Checks for typedefs, structures, and compiler characteristics.
94 dnl Checks for library functions.
96 if test "$with_getopt" = no;then
97 AC_CHECK_FUNCS(getopt_long)
100 if test "$enable_debug" = yes;then
104 AC_MSG_CHECKING(whether to use included getopt)
105 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
106 LIBOBJS="$LIBOBJS getopt1.o getopt.o"
108 else AC_MSG_RESULT(no)
111 AC_CHECK_HEADERS(assert.h ctype.h errno.h fcntl.h limits.h signal.h stdarg.h)
112 AC_CHECK_HEADERS(stdio.h stdlib.h string.h sys/poll.h sys/stat.h sys/time.h)
113 AC_CHECK_HEADERS(sys/types.h sys/wait.h termios.h time.h unistd.h)
115 AC_MSG_CHECKING([for LINE_MAX])
119 #endif], [LINE_MAX;],
120 AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes),
121 AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no))
123 AC_MSG_CHECKING([for CBAUD])
125 #ifdef HAVE_TERMIOS_H
128 AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes),
129 AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no))
131 AC_MSG_CHECKING([for CBAUDEX])
133 #ifdef HAVE_TERMIOS_H
136 AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
137 AC_DEFINE(CBAUDEX, 0) AC_MSG_RESULT(no))
139 AC_MSG_CHECKING([for CRTSCTS])
141 #ifdef HAVE_TERMIOS_H
144 AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(yes),[
145 if test "$USE_MAINTAINER_MODE" = yes ;then
146 AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(faked for maintainer)
147 # from "RedHat: glibc-devel-2.2-5/bits/termios.h"
148 AC_DEFINE(CRTSCTS, 020000000000)
150 AC_DEFINE(CRTSCTS, 0) AC_MSG_RESULT(no)
154 AC_MSG_CHECKING([for FD_SETSIZE])
156 #ifdef HAVE_SYS_TIME_H
157 #include <sys/time.h>
159 #ifdef HAVE_SYS_TYPES_H
160 #include <sys/types.h>
164 #endif], [FD_SETSIZE;],
165 AC_DEFINE(HAVE_FD_SETSIZE) AC_MSG_RESULT(yes),
168 AC_MSG_CHECKING([for unused attribute])
170 for un in __unused__ unused;do
172 unx="__attribute__ (($un))"
176 #endif],[char untest $unx;],
177 AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx)
182 if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi
184 AC_MSG_CHECKING([for printf style attribute])
189 void testf(char *fmt,...) __attribute__((format(printf,1,2)));
190 void testf(char *fmt,...) {}], [testf("%d",1);],
191 AC_DEFINE(HAVE_PRINTFORMAT) AC_MSG_RESULT(yes),
195 AC_MSG_CHECKING([for offsetof macro])
200 struct x { int a; };], [return(offsetof(struct x,a));],
201 AC_DEFINE(HAVE_OFFSETOF) AC_MSG_RESULT(yes),
205 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF))
206 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
208 dnl FIXME: select(3) missing here but what to do anyway
209 AC_CHECK_FUNCS(siginterrupt strerror strchr strrchr memmove atexit strcasecmp poll)
214 dnl FIXME: mktime(3) missing here
215 AC_REPLACE_FUNCS(strdup usleep)
217 GCC_NEED_DECLARATION(gethostname,[
221 GCC_NEED_DECLARATION(kill,[
222 #ifdef HAVE_SYS_TYPES_H
223 #include <sys/types.h>
228 GCC_NEED_DECLARATION(snprintf,[
232 GCC_NEED_DECLARATION(vsnprintf,[
239 GCC_NEED_DECLARATION(strdup,[
243 GCC_NEED_DECLARATION(usleep,[
247 GCC_NEED_DECLARATION(strcasecmp,[
251 GCC_NEED_DECLARATION(siginterrupt,[
255 GCC_NEED_DECLARATION(popen,[
259 GCC_NEED_DECLARATION(pclose,[
263 GCC_NEED_DECLARATION(gettext,[
264 #ifdef HAVE_LIBINTL_H
270 if test "$ACLOCAL" = "aclocal";then
271 ACLOCAL="$ACLOCAL -I ."
279 intl/Makefile],[sed -e "/POTFILES =/r po/POTFILES" -e "s/ ChangeLog / /" po/Makefile.in > po/Makefile])