142 lines
3.5 KiB
Plaintext
142 lines
3.5 KiB
Plaintext
AC_INIT(bas.c)
|
|
AC_CONFIG_HEADER(config.h)
|
|
AC_CANONICAL_HOST
|
|
VERSION=2.4
|
|
UPDATED='October 25, 2014'
|
|
|
|
ALL_LINGUAS="de"
|
|
|
|
case $host in
|
|
*-linux-*)
|
|
if test "$prefix" = NONE
|
|
then
|
|
prefix=/usr
|
|
AC_MSG_RESULT([using prefix $prefix])
|
|
fi
|
|
;;
|
|
hppa1.1-hp-hpux11.00)
|
|
EXTRA_CFLAGS='+O2 +Onolimit -D_XOPEN_SOURCE_EXTENDED '
|
|
EXTRA_LDFLAGS='-z '
|
|
EXTRA_GCFLAGS='-D_XOPEN_SOURCE_EXTENDED '
|
|
EXTRA_LDFLAGS='-Wl,-z '
|
|
;;
|
|
*-cygwin)
|
|
AC_DEFINE(USE_SELECT)
|
|
;;
|
|
*)
|
|
prefix=$ac_default_prefix
|
|
;;
|
|
esac
|
|
|
|
AC_PROG_CC
|
|
if test "$GCC" = yes
|
|
then
|
|
CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
|
|
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
|
|
else
|
|
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
|
|
LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
|
|
fi
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CHECK_HEADERS(termcap.h,have_termcap_h=yes)
|
|
if test "$have_termcap_h" != yes; then
|
|
AC_CHECK_HEADERS(curses.h,have_curses_h=yes)
|
|
fi
|
|
|
|
AC_MSG_CHECKING(for tputs return type)
|
|
AC_TRY_COMPILE([#ifdef HAVE_TERMCAP_H
|
|
#include <termcap.h>
|
|
#else
|
|
#include <curses.h>
|
|
#endif
|
|
static int outc(int c){ return c; }
|
|
],[return tputs((char*)0,0,outc);
|
|
],AC_MSG_RESULT(int),AC_DEFINE(TPUTS_RETURNS_VOID) AC_MSG_RESULT(void))
|
|
|
|
AC_CHECK_FUNC(fmod, [have_fmod=yes])
|
|
if test "$have_fmod" != yes; then
|
|
AC_CHECK_LIB(m, fmod, [have_fmod=yes; LIBS="-lm $LIBS"])
|
|
fi
|
|
if test "$have_fmod" != yes
|
|
then
|
|
AC_MSG_RESULT([no fmod() found, configure failed.])
|
|
exit 1
|
|
fi
|
|
|
|
AC_CHECK_HEADERS(tgmath.h,have_tgmath_h=yes)
|
|
AC_CHECK_FUNCS(lrint)
|
|
AC_CHECK_FUNCS(nanosleep)
|
|
|
|
AC_CHECK_FUNCS(tgetent,have_tgetent=yes)
|
|
if test "$have_tgetent" != yes; then
|
|
AC_CHECK_LIB(curses, tgetent,AC_DEFINE(HAVE_TGETENT) have_tgetent=yes; LIBS="-lcurses $LIBS")
|
|
fi
|
|
if test "$have_tgetent" != yes; then
|
|
AC_CHECK_LIB(termcap, tgetent, AC_DEFINE(HAVE_TGETENT) [have_tgetent=yes; LIBS="-ltermcap $LIBS"])
|
|
fi
|
|
# The following applies to sick Linux distributions.
|
|
if test "$have_tgetent" != yes; then
|
|
AC_CHECK_LIB(ncurses, tgetent, AC_DEFINE(HAVE_TGETENT) [have_tgetent=yes; LIBS="-lncurses $LIBS"])
|
|
fi
|
|
|
|
AC_ARG_WITH(dmalloc,
|
|
[ --with-dmalloc=DIR dmalloc include/library installation prefix],
|
|
[CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include"
|
|
LDFLAGS="$LDFLAGS -L$with_dmalloc/lib"
|
|
LIBS="$LIBS -ldmalloc"
|
|
AC_DEFINE(USE_DMALLOC)]
|
|
)
|
|
|
|
AC_ARG_WITH(efence,
|
|
[ --with-efence=DIR efence include/library installation prefix],
|
|
[CPPFLAGS="$CPPFLAGS -I$with_efence/include"
|
|
LDFLAGS="$LDFLAGS -L$with_efence/lib"
|
|
LIBS="$LIBS -lefence"]
|
|
)
|
|
|
|
AC_ARG_WITH(valgrind,
|
|
[ --with-valgrind run regression tests with valgrind],
|
|
[VALGRIND="valgrind"
|
|
AC_SUBST(VALGRIND)]
|
|
)
|
|
|
|
AC_MSG_CHECKING(whether to use LR0 parser)
|
|
AC_ARG_ENABLE(lr0,
|
|
[ --enable-lr0 use LR0 parser (default is recursive descending)],
|
|
[
|
|
case "$enableval" in
|
|
yes)
|
|
AC_DEFINE(USE_LR0)
|
|
AC_MSG_RESULT(yes)
|
|
;;
|
|
no)
|
|
AC_MSG_RESULT(no)
|
|
;;
|
|
esac],
|
|
[AC_MSG_RESULT(no)]
|
|
)
|
|
|
|
USE_NLS=no
|
|
AC_CHECK_PROG(MSGFMT,msgfmt,yes,no)
|
|
if test "$MSGFMT" = yes
|
|
then
|
|
AC_CHECK_HEADERS(libintl.h,[LIBINTL=yes])
|
|
if test "$LIBINTL" = yes
|
|
then
|
|
AC_SEARCH_LIBS(gettext,intl,[AC_DEFINE(HAVE_GETTEXT) USE_NLS=yes])
|
|
fi
|
|
fi
|
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_DEFINE_UNQUOTED(VERSION,"$VERSION")
|
|
AC_SUBST(VERSION)
|
|
AC_SUBST(UPDATED)
|
|
AC_SUBST(USE_NLS)
|
|
AC_OUTPUT(Makefile bas.1 test/runbas)
|
|
chmod 755 test/runbas
|