4 # Revision 1.3 1999/07/14 01:02:51 short
5 # Version bumped to 1.2.
7 # Revision 1.2 1999/06/03 11:48:18 short
8 # Version bumped to 1.1.
10 # Revision 1.1.1.1 1999/05/26 13:06:26 short
11 # First alpha release.
14 dnl Process this file with autoconf to produce a configure script.
16 AM_INIT_AUTOMAKE(mdsms, 1.2)
17 AM_CONFIG_HEADER(config.h)
20 dnl Configuration switches.
22 AC_MSG_CHECKING([whether debugging is requested])
24 [ --enable-debug enable debugging output to stderr],
25 enable_debug=$enableval, enable_debug=no)
26 AC_MSG_RESULT($enable_debug)
28 AC_MSG_CHECKING([whether included getopt is requested])
29 AC_ARG_WITH(included-getopt,
30 [ --with-included-getopt use included getopt(3)],
31 with_getopt=$withval, with_getopt=no)
32 AC_MSG_RESULT($with_getopt)
34 AC_MSG_CHECKING([for user-specified lock directory])
35 AC_ARG_WITH(lock-directory,
36 [ --with-lock-directory override default search for modem lock directory],
37 with_lock_directory=$withval, with_lock_directory=)
38 AC_MSG_RESULT($with_lock_directory)
40 dnl Checks for programs.
42 if test "$USE_MAINTAINER_MODE" = yes;then
43 if test "$GCC" = yes;then
44 CFLAGS="-Wall -ansi -pedantic -ggdb"
45 LDFLAGS="$LDFLAGS -lefence"
54 dnl Checks for pathnames.
56 AC_MSG_CHECKING([for modem lock directory])
58 if test "$with_lock_directory" = no;then
59 AC_MSG_RESULT([user disabled])
61 if test yes = "$with_lock_directory" \
62 -o -z "$with_lock_directory";then
63 for dira in /usr /var ;do
64 for dirb in /spool "" ;do
65 for dirc in /uucp /locks /lock;do
66 dir="${dira}${dirb}${dirc}"
67 if test -d "$dir";then dirx="$dir";fi
69 if test -z "$dirx";then
70 AC_MSG_RESULT([none found, disabled])
72 AC_MSG_RESULT([$dirx])
75 dirx="$with_lock_directory"
76 if test -d "$dirx";then AC_MSG_RESULT([$dirx])
77 else AC_MSG_RESULT([warning - directory doesn't exist: $dirx])
81 if test -z "$dirx";then AC_DEFINE(DEF_LOCKFILE,[""])
82 else AC_DEFINE_UNQUOTED(DEF_LOCKFILE,"${dirx}/LCK..%s")
85 dnl Checks for libraries.
87 dnl Checks for header files.
90 dnl Checks for typedefs, structures, and compiler characteristics.
95 dnl Checks for library functions.
97 if test "$with_getopt" = no;then
98 AC_CHECK_FUNCS(getopt_long)
101 if test "$enable_debug" = yes;then
105 AC_MSG_CHECKING(whether to use included getopt)
106 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
107 LIBOBJS="$LIBOBJS getopt1.o getopt.o"
109 else AC_MSG_RESULT(no)
112 AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
113 AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
116 AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
117 AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
120 AC_MSG_CHECKING([for LINE_MAX])
121 AC_TRY_COMPILE([#include <limits.h>], [LINE_MAX;],
122 AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes),
123 AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no))
125 AC_MSG_CHECKING([for CBAUD])
126 AC_TRY_COMPILE([#include <termios.h>], [CBAUD;],
127 AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes),
128 AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no))
130 AC_MSG_CHECKING([for CBAUDEX])
131 AC_TRY_COMPILE([#include <termios.h>], [CBAUDEX;],
132 AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
133 AC_DEFINE(CBAUDEX, 0) AC_MSG_RESULT(no))
135 AC_MSG_CHECKING([for unused attribute])
137 for un in __unused__ unused;do
139 unx="__attribute__ (($un))"
140 AC_TRY_COMPILE([#include <stddef.h>],[char untest $unx;],
141 AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx)
146 if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi
148 AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF))
149 AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF))
154 AC_REPLACE_FUNCS(strdup)
155 dnl AC_MSG_CHECKING([for strdup])
156 dnl AC_TRY_COMPILE([#include <string.h>], [strdup("");],
157 dnl AC_DEFINE(HAVE_STRDUP) AC_MSG_RESULT(yes),
158 dnl LIBOBJS="$LIBOBJS strdup.o" AC_MSG_RESULT(no))
160 AC_MSG_CHECKING([for working %m in printf])
161 AC_TRY_RUN([int main() { char s[100];
163 return(!(strcmp(s,"m") && strcmp(s,"%m")));
164 }],AC_DEFINE(PRINTF_WORKS_PM) AC_MSG_RESULT(yes),AC_MSG_RESULT(no),AC_MSG_RESULT(avoiding))