4 # Revision 1.2 1999/06/03 11:48:18 short
5 # Version bumped to 1.1.
7 # Revision 1.1.1.1 1999/05/26 13:06:26 short
11 dnl Process this file with autoconf to produce a configure script.
13 AM_INIT_AUTOMAKE(mdsms, 1.1)
14 AM_CONFIG_HEADER(config.h)
17 dnl Configuration switches.
19 AC_MSG_CHECKING([whether debugging is requested])
21 [ --enable-debug enable debugging output to stderr],
22 enable_debug=$enableval, enable_debug=no)
23 AC_MSG_RESULT($enable_debug)
25 AC_MSG_CHECKING([whether included getopt is requested])
26 AC_ARG_WITH(included-getopt,
27 [ --with-included-getopt use included getopt(3)],
28 with_getopt=$withval, with_getopt=no)
29 AC_MSG_RESULT($with_getopt)
31 AC_MSG_CHECKING([for user-specified lock directory])
32 AC_ARG_WITH(lock-directory,
33 [ --with-lock-directory override default search for modem lock directory],
34 with_lock_directory=$withval, with_lock_directory=)
35 AC_MSG_RESULT($with_lock_directory)
37 dnl Checks for programs.
39 if test "$USE_MAINTAINER_MODE" = yes;then
40 if test "$GCC" = yes;then
41 CFLAGS="-Wall -ansi -pedantic -ggdb"
42 LDFLAGS="$LDFLAGS -lefence"
51 dnl Checks for pathnames.
53 AC_MSG_CHECKING([for modem lock directory])
55 if test "$with_lock_directory" = no;then
56 AC_MSG_RESULT([user disabled])
58 if test yes = "$with_lock_directory" \
59 -o -z "$with_lock_directory";then
60 for dira in /usr /var ;do
61 for dirb in /spool "" ;do
62 for dirc in /uucp /locks /lock;do
63 dir="${dira}${dirb}${dirc}"
64 if test -d "$dir";then dirx="$dir";fi
66 if test -z "$dirx";then
67 AC_MSG_RESULT([none found, disabled])
69 AC_MSG_RESULT([$dirx])
72 dirx="$with_lock_directory"
73 if test -d "$dirx";then AC_MSG_RESULT([$dirx])
74 else AC_MSG_RESULT([warning - directory doesn't exist: $dirx])
78 if test -z "$dirx";then AC_DEFINE(DEF_LOCKFILE,[""])
79 else AC_DEFINE_UNQUOTED(DEF_LOCKFILE,"${dirx}/LCK..%s")
82 dnl Checks for libraries.
84 dnl Checks for header files.
87 dnl Checks for typedefs, structures, and compiler characteristics.
92 dnl Checks for library functions.
94 if test "$with_getopt" = no;then
95 AC_CHECK_FUNCS(getopt_long)
98 if test "$enable_debug" = yes;then
102 AC_MSG_CHECKING(whether to use included getopt)
103 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
104 LIBOBJS="$LIBOBJS getopt1.o getopt.o"
106 else AC_MSG_RESULT(no)
109 AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
110 AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
113 AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
114 AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
117 AC_MSG_CHECKING([for LINE_MAX])
118 AC_TRY_COMPILE([#include <limits.h>], [LINE_MAX;],
119 AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes),
120 AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no))
122 AC_MSG_CHECKING([for CBAUD])
123 AC_TRY_COMPILE([#include <termios.h>], [CBAUD;],
124 AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes),
125 AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no))
127 AC_MSG_CHECKING([for CBAUDEX])
128 AC_TRY_COMPILE([#include <termios.h>], [CBAUDEX;],
129 AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
130 AC_DEFINE(CBAUDEX, 0) AC_MSG_RESULT(no))
132 AC_MSG_CHECKING([for unused attribute])
134 for un in __unused__ unused;do
136 unx="__attribute__ (($un))"
137 AC_TRY_COMPILE([#include <stddef.h>],[char untest $unx;],
138 AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx)
143 if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi
145 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF))
146 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
151 AC_REPLACE_FUNCS(strdup)
152 dnl AC_MSG_CHECKING([for strdup])
153 dnl AC_TRY_COMPILE([#include <string.h>], [strdup("");],
154 dnl AC_DEFINE(HAVE_STRDUP) AC_MSG_RESULT(yes),
155 dnl LIBOBJS="$LIBOBJS strdup.o" AC_MSG_RESULT(no))
157 AC_MSG_CHECKING([for working %m in printf])
158 AC_TRY_RUN([int main() { char s[100];
160 return(!(strcmp(s,"m") && strcmp(s,"%m")));
161 }],AC_DEFINE(PRINTF_WORKS_PM) AC_MSG_RESULT(yes),AC_MSG_RESULT(no),AC_MSG_RESULT(avoiding))