X-Git-Url: http://git.jankratochvil.net/?p=mdsms.git;a=blobdiff_plain;f=configure.in;h=26fc971ccf14c3b4aef99ca131667664288e02bf;hp=9fe174b693369d5ae6509071e783ba96bf7d89d2;hb=ccae85e6528209df1411f090dd02193f6dd91030;hpb=b56358ce77537daa7d462cb45030b71117452f5c diff --git a/configure.in b/configure.in index 9fe174b..26fc971 100644 --- a/configure.in +++ b/configure.in @@ -1,13 +1,8 @@ # $Id$ -# -# $Log$ -# Revision 1.1.1.1 1999/05/26 13:06:26 short -# First alpha release. -# dnl Process this file with autoconf to produce a configure script. AC_INIT(mdsms.c) -AM_INIT_AUTOMAKE(mdsms, 1.0) +AM_INIT_AUTOMAKE(mdsms, 1.5.1) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE @@ -31,22 +26,32 @@ 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="-Wall -ansi -pedantic -ggdb" - LDFLAGS="$LDFLAGS -lefence" + if test "$GCC" = yes;then + CFLAGS="$CFLAGS -Wall -ansi -pedantic -ggdb3" + if test x$efence != xno;then + AC_CHECK_LIB(efence, EF_Exit) fi + fi else LDFLAGS="-s" - AC_DEFINE(NDEBUG) - fi + AC_DEFINE(NDEBUG) +fi 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 @@ -103,6 +108,10 @@ if test "$with_getopt" = yes -o "$ac_cv_func_getopt_long" != yes ;then 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 sys/wait.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)) ) @@ -112,26 +121,67 @@ AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) , ) AC_MSG_CHECKING([for LINE_MAX]) -AC_TRY_COMPILE([#include ], [LINE_MAX;], +AC_TRY_COMPILE([ +#ifdef HAVE_LIMITS_H +#include +#endif], [LINE_MAX;], AC_DEFINE(HAVE_LINE_MAX) AC_MSG_RESULT(yes), AC_DEFINE(LINE_MAX, 4096) AC_MSG_RESULT(no)) AC_MSG_CHECKING([for CBAUD]) -AC_TRY_COMPILE([#include ], [CBAUD;], +AC_TRY_COMPILE([ +#ifdef HAVE_TERMIOS_H +#include +#endif], [CBAUD;], AC_DEFINE(HAVE_CBAUD) AC_MSG_RESULT(yes), AC_DEFINE(CBAUD, 0) AC_MSG_RESULT(no)) AC_MSG_CHECKING([for CBAUDEX]) -AC_TRY_COMPILE([#include ], [CBAUDEX;], +AC_TRY_COMPILE([ +#ifdef HAVE_TERMIOS_H +#include +#endif], [CBAUDEX;], 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 +#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 FD_SETSIZE]) +AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif], [FD_SETSIZE;], + AC_DEFINE(HAVE_FD_SETSIZE) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + AC_MSG_CHECKING([for unused attribute]) uns=true for un in __unused__ unused;do if $uns;then unx="__attribute__ (($un))" - AC_TRY_COMPILE([#include ],[char untest $unx;], + AC_TRY_COMPILE([ +#ifdef HAVE_STDDEF_H +#include +#endif],[char untest $unx;], AC_DEFINE_UNQUOTED(ATTR_UNUSED, $unx) AC_MSG_RESULT($un) uns=false) @@ -139,26 +189,95 @@ for un in __unused__ unused;do done if $uns;then AC_DEFINE(ATTR_UNUSED,) AC_MSG_RESULT(no);fi +AC_MSG_CHECKING([for printf style attribute]) +AC_TRY_COMPILE([ +#ifdef HAVE_STDDEF_H +#include +#endif +void testf(char *fmt,...) __attribute__((format(printf,1,2))); +void testf(char *fmt,...) {}], [testf("%d",1);], + AC_DEFINE(HAVE_PRINTFORMAT) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + +AC_MSG_CHECKING([for offsetof macro]) +AC_TRY_COMPILE([ +#ifdef HAVE_STDDEF_H +#include +#endif +struct x { int a; };], [return(offsetof(struct x,a));], + AC_DEFINE(HAVE_OFFSETOF) AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + ) + AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF)) AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF)) +dnl FIXME: select(3) missing here but what to do anyway +AC_CHECK_FUNCS(siginterrupt strerror strchr strrchr memmove atexit strcasecmp poll) + AC_TYPE_SIGNAL AC_TYPE_PID_T -AC_REPLACE_FUNCS(strdup) -dnl AC_MSG_CHECKING([for strdup]) -dnl AC_TRY_COMPILE([#include ], [strdup("");], -dnl AC_DEFINE(HAVE_STRDUP) AC_MSG_RESULT(yes), -dnl LIBOBJS="$LIBOBJS strdup.o" AC_MSG_RESULT(no)) +dnl FIXME: mktime(3) missing here +AC_REPLACE_FUNCS(strdup usleep) -AC_MSG_CHECKING([for working %m in printf]) -AC_TRY_RUN([int main() { char s[100]; - sprintf(s,"%m"); - return(!(strcmp(s,"m") && strcmp(s,"%m"))); - }],AC_DEFINE(PRINTF_WORKS_PM) AC_MSG_RESULT(yes),AC_MSG_RESULT(no),AC_MSG_RESULT(avoiding)) +GCC_NEED_DECLARATION(gethostname,[ +#ifdef HAVE_UNISTD_H +#include +#endif]) +GCC_NEED_DECLARATION(kill,[ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SIGNAL_H +#include +#endif]) +GCC_NEED_DECLARATION(snprintf,[ +#ifdef HAVE_STDIO_H +#include +#endif]) +GCC_NEED_DECLARATION(vsnprintf,[ +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_STDARG_H +#include +#endif]) +GCC_NEED_DECLARATION(strdup,[ +#ifdef HAVE_STRING_H +#include +#endif]) +GCC_NEED_DECLARATION(usleep,[ +#ifdef HAVE_UNISTD_H +#include +#endif]) +GCC_NEED_DECLARATION(strcasecmp,[ +#ifdef HAVE_STRING_H +#include +#endif]) +GCC_NEED_DECLARATION(siginterrupt,[ +#ifdef HAVE_SIGNAL_H +#include +#endif]) +GCC_NEED_DECLARATION(popen,[ +#ifdef HAVE_STDIO_H +#include +#endif]) +GCC_NEED_DECLARATION(pclose,[ +#ifdef HAVE_STDIO_H +#include +#endif]) # Final output. +if test "$ACLOCAL" = "aclocal";then + ACLOCAL="$ACLOCAL -I ." +fi + AC_SUBST(LIBOBJS) -AC_OUTPUT(Makefile) +AC_OUTPUT([Makefile +mdsms.spec +po/Makefile.in +intl/Makefile],[sed -e "/POTFILES =/r po/POTFILES" -e "s/ ChangeLog / /" po/Makefile.in > po/Makefile])