4 # Revision 1.4 1999/07/28 10:47:15 short
5 # Version bumped to 1.3.
7 # Revision 1.3 1999/07/14 01:02:51 short
8 # Version bumped to 1.2.
10 # Revision 1.2 1999/06/03 11:48:18 short
11 # Version bumped to 1.1.
13 # Revision 1.1.1.1 1999/05/26 13:06:26 short
14 # First alpha release.
17 dnl Process this file with autoconf to produce a configure script.
19 AM_INIT_AUTOMAKE(mdsms, 1.3)
20 AM_CONFIG_HEADER(config.h)
23 dnl Configuration switches.
25 AC_MSG_CHECKING([whether debugging is requested])
27 [ --enable-debug enable debugging output to stderr],
28 enable_debug=$enableval, enable_debug=no)
29 AC_MSG_RESULT($enable_debug)
31 AC_MSG_CHECKING([whether included getopt is requested])
32 AC_ARG_WITH(included-getopt,
33 [ --with-included-getopt use included getopt(3)],
34 with_getopt=$withval, with_getopt=no)
35 AC_MSG_RESULT($with_getopt)
37 AC_MSG_CHECKING([for user-specified lock directory])
38 AC_ARG_WITH(lock-directory,
39 [ --with-lock-directory override default search for modem lock directory],
40 with_lock_directory=$withval, with_lock_directory=)
41 AC_MSG_RESULT($with_lock_directory)
43 dnl Checks for programs.
45 if test "$USE_MAINTAINER_MODE" = yes;then
46 if test "$GCC" = yes;then
47 CFLAGS="-Wall -ansi -pedantic -ggdb"
48 LDFLAGS="$LDFLAGS -lefence"
57 dnl Checks for pathnames.
59 AC_MSG_CHECKING([for modem lock directory])
61 if test "$with_lock_directory" = no;then
62 AC_MSG_RESULT([user disabled])
64 if test yes = "$with_lock_directory" \
65 -o -z "$with_lock_directory";then
66 for dira in /usr /var ;do
67 for dirb in /spool "" ;do
68 for dirc in /uucp /locks /lock;do
69 dir="${dira}${dirb}${dirc}"
70 if test -d "$dir";then dirx="$dir";fi
72 if test -z "$dirx";then
73 AC_MSG_RESULT([none found, disabled])
75 AC_MSG_RESULT([$dirx])
78 dirx="$with_lock_directory"
79 if test -d "$dirx";then AC_MSG_RESULT([$dirx])
80 else AC_MSG_RESULT([warning - directory doesn't exist: $dirx])
84 if test -z "$dirx";then AC_DEFINE(DEF_LOCKFILE,[""])
85 else AC_DEFINE_UNQUOTED(DEF_LOCKFILE,"${dirx}/LCK..%s")
88 dnl Checks for libraries.
90 dnl Checks for header files.
93 dnl Checks for typedefs, structures, and compiler characteristics.
98 dnl Checks for library functions.
100 if test "$with_getopt" = no;then
101 AC_CHECK_FUNCS(getopt_long)
104 if test "$enable_debug" = yes;then
108 AC_MSG_CHECKING(whether to use included getopt)
109 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
110 LIBOBJS="$LIBOBJS getopt1.o getopt.o"
112 else AC_MSG_RESULT(no)
115 AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
116 AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
119 AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
120 AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
123 AC_MSG_CHECKING([for LINE_MAX])
124 AC_TRY_COMPILE([#include <limits.h>], [LINE_MAX;],
125 AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes),
126 AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no))
128 AC_MSG_CHECKING([for CBAUD])
129 AC_TRY_COMPILE([#include <termios.h>], [CBAUD;],
130 AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes),
131 AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no))
133 AC_MSG_CHECKING([for CBAUDEX])
134 AC_TRY_COMPILE([#include <termios.h>], [CBAUDEX;],
135 AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
136 AC_DEFINE(CBAUDEX, 0) AC_MSG_RESULT(no))
138 AC_MSG_CHECKING([for unused attribute])
140 for un in __unused__ unused;do
142 unx="__attribute__ (($un))"
143 AC_TRY_COMPILE([#include <stddef.h>],[char untest $unx;],
144 AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx)
149 if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi
151 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF))
152 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
157 AC_REPLACE_FUNCS(strdup)
158 dnl AC_MSG_CHECKING([for strdup])
159 dnl AC_TRY_COMPILE([#include <string.h>], [strdup("");],
160 dnl AC_DEFINE(HAVE_STRDUP) AC_MSG_RESULT(yes),
161 dnl LIBOBJS="$LIBOBJS strdup.o" AC_MSG_RESULT(no))
163 AC_MSG_CHECKING([for working %m in printf])
164 AC_TRY_RUN([int main() { char s[100];
166 return(!(strcmp(s,"m") && strcmp(s,"%m")));
167 }],AC_DEFINE(PRINTF_WORKS_PM) AC_MSG_RESULT(yes),AC_MSG_RESULT(no),AC_MSG_RESULT(avoiding))