Rename 'cvs2cl.pl' to the more common 'cvs2cl'.
[mdsms.git] / configure.in
index d750ae6..8eb7ceb 100644 (file)
@@ -2,7 +2,7 @@
 
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(mdsms.c)
-AM_INIT_AUTOMAKE(mdsms, 1.5.0)
+AM_INIT_AUTOMAKE(mdsms, 1.5.3)
 AM_CONFIG_HEADER(config.h)
 AM_MAINTAINER_MODE
 
@@ -26,11 +26,15 @@ AC_ARG_WITH(lock-directory,
      with_lock_directory=$withval, with_lock_directory=)
 AC_MSG_RESULT($with_lock_directory)
 
+AC_ARG_WITH(efence,
+[  --without-efence        disable use of Electric Fence in maintainer-mode],
+    efence=$withval, efence=yes)
+
 dnl Checks for programs.
 AC_PROG_CC
 if test "$USE_MAINTAINER_MODE" = yes;then
        if test "$GCC" = yes;then
-               CFLAGS="$CFLAGS -Wall -ansi -pedantic -ggdb"
+               CFLAGS="$CFLAGS -Wall -ansi -pedantic -ggdb3"
                if test x$efence != xno;then
                        AC_CHECK_LIB(efence, EF_Exit)
                fi
@@ -44,6 +48,10 @@ AC_PROG_CPP
 
 dnl Checks for pathnames.
 
+ALL_LINGUAS="cs"
+AM_GNU_GETTEXT
+AC_CHECK_HEADERS(libintl.h)
+
 AC_MSG_CHECKING([for modem lock directory])
 dirx=""
 if test "$with_lock_directory" = no;then
@@ -95,22 +103,16 @@ if test "$enable_debug" = yes;then
 
 AC_MSG_CHECKING(whether to use included getopt)
 if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then
-       LIBOBJS="$LIBOBJS getopt1.o getopt.o"
-          AC_MSG_RESULT(yes)
+       AC_LIBOBJ(getopt)
+       AC_LIBOBJ(getopt1)
+       AC_LIBSOURCE(getopt.h)
+       AC_MSG_RESULT(yes)
 else AC_MSG_RESULT(no)
 fi
 
 AC_CHECK_HEADERS(assert.h ctype.h errno.h fcntl.h limits.h signal.h stdarg.h)
 AC_CHECK_HEADERS(stdio.h stdlib.h string.h sys/poll.h sys/stat.h sys/time.h)
-AC_CHECK_HEADERS(sys/types.h termios.h time.h unistd.h)
-
-AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
-       AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
-       )
-
-AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
-       AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
-       )
+AC_CHECK_HEADERS(sys/types.h sys/wait.h termios.h time.h unistd.h)
 
 AC_MSG_CHECKING([for LINE_MAX])
 AC_TRY_COMPILE([
@@ -136,6 +138,33 @@ AC_TRY_COMPILE([
        AC_DEFINE(HAVE_CBAUDEX) AC_MSG_RESULT(yes),
        AC_DEFINE(CBAUDEX, 0)   AC_MSG_RESULT(no))
 
+AC_MSG_CHECKING([for CRTSCTS])
+AC_TRY_COMPILE([
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif], [CRTSCTS;],
+       AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(yes),[
+       if test "$USE_MAINTAINER_MODE" = yes ;then
+               AC_DEFINE(HAVE_CRTSCTS) AC_MSG_RESULT(faked for maintainer)
+               # from "RedHat: glibc-devel-2.2-5/bits/termios.h"
+               AC_DEFINE(CRTSCTS, 020000000000)
+       else
+               AC_DEFINE(CRTSCTS, 0)   AC_MSG_RESULT(no)
+       fi
+       ])
+
+AC_MSG_CHECKING([for _POSIX_VDISABLE])
+AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif], [_POSIX_VDISABLE;],
+       AC_DEFINE(HAVE__POSIX_VDISABLE)    AC_MSG_RESULT(yes),[
+       AC_DEFINE(_POSIX_VDISABLE, ['\0']) AC_MSG_RESULT(no)
+       ])
+
 AC_MSG_CHECKING([for FD_SETSIZE])
 AC_TRY_COMPILE([
 #ifdef HAVE_SYS_TIME_H
@@ -245,6 +274,10 @@ GCC_NEED_DECLARATION(pclose,[
 #ifdef HAVE_STDIO_H
 #include <stdio.h>
 #endif])
+GCC_NEED_DECLARATION(gettext,[
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif])
 
 # Final output.
 
@@ -252,6 +285,14 @@ if test "$ACLOCAL" = "aclocal";then
   ACLOCAL="$ACLOCAL -I ."
 fi
 
-AC_SUBST(LIBOBJS)
+AC_OUTPUT([Makefile
+mdsms.spec
+macros/Makefile
+po/Makefile.in
+intl/Makefile])
+
+dnl FIXME: Why is "po/POTFILES" being substituted?
+echo mdsms.c >po/POTFILES.in
+make -C po Makefile
 
-AC_OUTPUT(Makefile)
+echo done.