4 # Revision 1.1.1.1 1999/05/26 13:06:26 short
8 dnl Process this file with autoconf to produce a configure script.
10 AM_INIT_AUTOMAKE(mdsms, 1.0)
11 AM_CONFIG_HEADER(config.h)
14 dnl Configuration switches.
16 AC_MSG_CHECKING([whether debugging is requested])
18 [ --enable-debug enable debugging output to stderr],
19 enable_debug=$enableval, enable_debug=no)
20 AC_MSG_RESULT($enable_debug)
22 AC_MSG_CHECKING([whether included getopt is requested])
23 AC_ARG_WITH(included-getopt,
24 [ --with-included-getopt use included getopt(3)],
25 with_getopt=$withval, with_getopt=no)
26 AC_MSG_RESULT($with_getopt)
28 AC_MSG_CHECKING([for user-specified lock directory])
29 AC_ARG_WITH(lock-directory,
30 [ --with-lock-directory override default search for modem lock directory],
31 with_lock_directory=$withval, with_lock_directory=)
32 AC_MSG_RESULT($with_lock_directory)
34 dnl Checks for programs.
36 if test "$USE_MAINTAINER_MODE" = yes;then
37 if test "$GCC" = yes;then
38 CFLAGS="-Wall -ansi -pedantic -ggdb"
39 LDFLAGS="$LDFLAGS -lefence"
48 dnl Checks for pathnames.
50 AC_MSG_CHECKING([for modem lock directory])
52 if test "$with_lock_directory" = no;then
53 AC_MSG_RESULT([user disabled])
55 if test yes = "$with_lock_directory" \
56 -o -z "$with_lock_directory";then
57 for dira in /usr /var ;do
58 for dirb in /spool "" ;do
59 for dirc in /uucp /locks /lock;do
60 dir="${dira}${dirb}${dirc}"
61 if test -d "$dir";then dirx="$dir";fi
63 if test -z "$dirx";then
64 AC_MSG_RESULT([none found, disabled])
66 AC_MSG_RESULT([$dirx])
69 dirx="$with_lock_directory"
70 if test -d "$dirx";then AC_MSG_RESULT([$dirx])
71 else AC_MSG_RESULT([warning - directory doesn't exist: $dirx])
75 if test -z "$dirx";then AC_DEFINE(DEF_LOCKFILE,[""])
76 else AC_DEFINE_UNQUOTED(DEF_LOCKFILE,"${dirx}/LCK..%s")
79 dnl Checks for libraries.
81 dnl Checks for header files.
84 dnl Checks for typedefs, structures, and compiler characteristics.
89 dnl Checks for library functions.
91 if test "$with_getopt" = no;then
92 AC_CHECK_FUNCS(getopt_long)
95 if test "$enable_debug" = yes;then
99 AC_MSG_CHECKING(whether to use included getopt)
100 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
101 LIBOBJS="$LIBOBJS getopt1.o getopt.o"
103 else AC_MSG_RESULT(no)
106 AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
107 AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
110 AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
111 AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
114 AC_MSG_CHECKING([for LINE_MAX])
115 AC_TRY_COMPILE([#include <limits.h>], [LINE_MAX;],
116 AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes),
117 AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no))
119 AC_MSG_CHECKING([for CBAUD])
120 AC_TRY_COMPILE([#include <termios.h>], [CBAUD;],
121 AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes),
122 AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no))
124 AC_MSG_CHECKING([for CBAUDEX])
125 AC_TRY_COMPILE([#include <termios.h>], [CBAUDEX;],
126 AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
127 AC_DEFINE(CBAUDEX, 0) AC_MSG_RESULT(no))
129 AC_MSG_CHECKING([for unused attribute])
131 for un in __unused__ unused;do
133 unx="__attribute__ (($un))"
134 AC_TRY_COMPILE([#include <stddef.h>],[char untest $unx;],
135 AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx)
140 if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi
142 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF))
143 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
148 AC_REPLACE_FUNCS(strdup)
149 dnl AC_MSG_CHECKING([for strdup])
150 dnl AC_TRY_COMPILE([#include <string.h>], [strdup("");],
151 dnl AC_DEFINE(HAVE_STRDUP) AC_MSG_RESULT(yes),
152 dnl LIBOBJS="$LIBOBJS strdup.o" AC_MSG_RESULT(no))
154 AC_MSG_CHECKING([for working %m in printf])
155 AC_TRY_RUN([int main() { char s[100];
157 return(!(strcmp(s,"m") && strcmp(s,"%m")));
158 }],AC_DEFINE(PRINTF_WORKS_PM) AC_MSG_RESULT(yes),AC_MSG_RESULT(no),AC_MSG_RESULT(avoiding))