]> diplodocus.org Git - nmh/blobdiff - configure.ac
sbr/utils.c: Add HasSuffix(s, suffix).
[nmh] / configure.ac
index d3fa76ecbfce27055204033d3592dd73d6d83abc..9a8b997718d21248193d1638cceed334243eff75 100644 (file)
@@ -23,10 +23,6 @@ dnl --------------------------
 dnl CHECK COMMAND LINE OPTIONS
 dnl --------------------------
 
-dnl Do you want to debug nmh?
-AC_ARG_ENABLE([debug],
-  AS_HELP_STRING([--enable-debug],[enable nmh code debugging]))
-
 dnl Do you want client-side support for using SASL for authentication?
 dnl Note that this code will be enabled for both POP and SMTP
 AC_ARG_WITH([cyrus-sasl], AS_HELP_STRING([--with-cyrus-sasl],
@@ -96,7 +92,8 @@ dnl CHECK HEADER FILES
 dnl ------------------
 
 AC_HEADER_TIOCGWINSZ
-AC_CHECK_HEADERS([fcntl.h wchar.h wctype.h sys/param.h sys/time.h sys/stream.h])
+AC_CHECK_HEADERS([fcntl.h stdbool.h wchar.h wctype.h \
+                  sys/param.h sys/time.h sys/stream.h])
 
 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
   [Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
@@ -110,6 +107,10 @@ dnl CHECK FUNCTIONS
 dnl ---------------
 AC_CHECK_FUNCS([wcwidth mbtowc getutxent arc4random mkstemps])
 
+dnl Use custom getline for platforms that don't have it.
+AC_CONFIG_LIBOBJ_DIR([sbr])
+AC_REPLACE_FUNCS([getline])
+
 dnl -----------------------
 dnl CHECK MULTIBYTE SUPPORT
 dnl -----------------------
@@ -134,8 +135,8 @@ if test "$GCC" != yes; then
   dnl better to use an autoconf test, except -v will probably succeed
   dnl with many other compilers but have different meaning.
   AS_CASE([`${CC} -V 2>&1`],
-          [cc:\ Sun\ C*], [AM_CFLAGS=\
-"${AM_CFLAGS:+$AM_CFLAGS }-v -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"])
+          [cc:*\ Sun\ C*], [CFLAGS=\
+"${CFLAGS:+$CFLAGS }-v -errtags=yes -erroff=E_STATEMENT_NOT_REACHED"])
 fi
 
 AC_CACHE_CHECK([whether compiler supports -Wall], [nmh_cv_has_wall],
@@ -143,7 +144,7 @@ AC_CACHE_CHECK([whether compiler supports -Wall], [nmh_cv_has_wall],
                CFLAGS="$AM_CFLAGS $CFLAGS -Wall -Werror"
                AC_TRY_COMPILE([],[],nmh_cv_has_wall=yes,nmh_cv_has_wall=no)
                CFLAGS="$nmh_saved_cflags"])
-test "$nmh_cv_has_wall" = "yes"  &&  AM_CFLAGS="${AM_CFLAGS:+$AM_CFLAGS }-Wall"
+test "$nmh_cv_has_wall" = "yes"  &&  CFLAGS="${CFLAGS:+$CFLAGS }-Wall"
 
 AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra],
                [nmh_saved_cflags="$CFLAGS"
@@ -151,7 +152,7 @@ AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra],
                AC_TRY_COMPILE([],[],nmh_cv_has_wextra=yes,
                               nmh_cv_has_wextra=no)
                CFLAGS="$nmh_saved_cflags"])
-test "$nmh_cv_has_wextra" = "yes"  &&  AM_CFLAGS="${AM_CFLAGS:+$AM_CFLAGS }-Wextra"
+test "$nmh_cv_has_wextra" = "yes"  &&  CFLAGS="${CFLAGS:+$CFLAGS }-Wextra"
 
 AC_SUBST([AM_CFLAGS])