1
0
Fork 0
This commit is contained in:
Frank Celler 2012-01-03 18:56:29 +01:00
parent c71a1fabfb
commit a931ee1a43
9 changed files with 382 additions and 33 deletions

View File

@ -53,7 +53,7 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
CPPFLAGS="${CPPFLAGS} -DGEO_TRIAGENS=1"
CPPFLAGS="${CPPFLAGS}"
CFLAGS="${CFLAGS}"
CXXFLAGS="${CXXFLAGS}"

73
m4/configure.logging Normal file
View File

@ -0,0 +1,73 @@
dnl -*- mode: Autoconf; -*-
dnl -----------------------------------------------------------------------------------------
dnl enable logger
dnl -----------------------------------------------------------------------------------------
AC_ARG_ENABLE(logger,
AS_HELP_STRING([--enable-logger], [enable logging and timing (default: yes)]),
[tr_LOGGER="$enableval"],
[tr_LOGGER="yes"]
)
if test "x$tr_LOGGER" = xyes; then
AC_DEFINE_UNQUOTED(TRI_ENABLE_LOGGER, 1, [true if logging is enabled])
AC_DEFINE_UNQUOTED(TRI_ENABLE_LOGGER_TIMING, 1, [true if timing is enabled])
fi
AM_CONDITIONAL(ENABLE_LOGGER, test "x$tr_LOGGER" = xyes)
AM_CONDITIONAL(ENABLE_LOGGER_TIMING, test "x$tr_LOGGER" = xyes)
dnl -----------------------------------------------------------------------------------------
dnl enable timing
dnl -----------------------------------------------------------------------------------------
AC_ARG_ENABLE(timing,
AS_HELP_STRING([--enable-timing], [enable timing (default: yes)]),
[tr_TIMING="$enableval"],
[tr_TIMING="yes"]
)
if test "x$tr_TIMING" = xyes; then
AC_DEFINE_UNQUOTED(TRI_ENABLE_TIMING, 1, [true if timing is enabled])
fi
AM_CONDITIONAL(ENABLE_TIMING, test "x$tr_TIMING" = xyes)
dnl -----------------------------------------------------------------------------------------
dnl enable figures
dnl -----------------------------------------------------------------------------------------
AC_ARG_ENABLE(figures,
AS_HELP_STRING([--enable-figures], [enable figures (default: yes)]),
[tr_FIGURES="$enableval"],
[tr_FIGURES="yes"]
)
if test "x$tr_FIGURES" = xyes; then
AC_DEFINE_UNQUOTED(TRI_ENABLE_FIGURES, 1, [true if figures are enabled])
fi
AM_CONDITIONAL(ENABLE_FIGURES, test "x$tr_FIGURES" = xyes)
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_LOGGER" = xyes; then
BASIC_INFO="$BASIC_INFO|LOGGER: enabled"
else
BASIC_INFO="$BASIC_INFO|LOGGER: disabled"
fi
if test "x$tr_TIMING" = xyes; then
BASIC_INFO="$BASIC_INFO|TIMING: enabled"
else
BASIC_INFO="$BASIC_INFO|TIMING: disabled"
fi
if test "x$tr_FIGURES" = xyes; then
BASIC_INFO="$BASIC_INFO|FIGURES: enabled"
else
BASIC_INFO="$BASIC_INFO|FIGURES: disabled"
fi

View File

@ -4,6 +4,10 @@ dnl ----------------------------------------------------------------------------
dnl check for boost headers and libraries
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR BOOST])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C++)
AC_LINK_IFELSE([AC_LANG_PROGRAM()]) # workaround for a bug in older autoconf
@ -11,10 +15,10 @@ AX_BOOST_BASE([1.33])
if test "x$succeeded" != xyes; then
AC_MSG_ERROR([Please install at least version 1.33 from http://www.boost.org/])
else
tr_BOOST="yes"
fi
TR_STATIC_ENABLE([boost])
dnl -----------------------------------------------------------------------------------------
dnl guess boost library suffix
dnl -----------------------------------------------------------------------------------------
@ -22,7 +26,7 @@ dnl ----------------------------------------------------------------------------
BOOST_SUFFIX=""
case $target in
*-apple-darwin9*|*-apple-darwin10*)
*-apple-darwin*)
BOOST_SUFFIX="-mt"
;;
@ -31,20 +35,6 @@ case $target in
;;
esac
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
SAVE_LIBS="$LIBS"
LIBS="$LIBS $BOOST_LIBS"
dnl -----------------------------------------------------------------------------------------
dnl fix include and static libraries
dnl -----------------------------------------------------------------------------------------
@ -74,3 +64,8 @@ dnl ----------------------------------------------------------------------------
FLAG_INFO="$FLAG_INFO|BOOST_CPPFLAGS: ${BOOST_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|BOOST_LDFLAGS: ${BOOST_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|BOOST_LIBS: ${BOOST_LIBS}"
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

View File

@ -28,6 +28,10 @@ dnl ----------------------------------------------------------------------------
dnl checks for the LIBEV library
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR LIBEV])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C++)
if test "x$LIBEV_CPPFLAGS" != x; then
@ -100,6 +104,10 @@ dnl ----------------------------------------------------------------------------
if test "x$tr_LIBEV" = xyes; then
if test "x$LIBEV" = x; then
LIB_INFO="$LIB_INFO|LIBEV support: enabled"
FLAG_INFO="$FLAG_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
else
LIB_INFO="$LIB_INFO|LIBEV support: enabled (path $LIBEV)"
fi
@ -107,13 +115,7 @@ else
LIB_INFO="$LIB_INFO|LIBEV support: disabled"
fi
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_LIBEV" = xyes; then
FLAG_INFO="$FLAG_INFO|LIBEV_CPPFLAGS: ${LIBEV_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LDFLAGS: ${LIBEV_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|LIBEV_LIBS: ${LIBEV_LIBS}"
fi
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

40
m4/external.math Normal file
View File

@ -0,0 +1,40 @@
dnl -*- mode: Autoconf; -*-
dnl -----------------------------------------------------------------------------------------
dnl checks for the MATH library
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR MATH])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C)
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
AC_CHECK_LIB([m], [sincos], [MATH_LIBS="-lm"], )
dnl -----------------------------------------------------------------------------------------
dnl add substitutions
dnl -----------------------------------------------------------------------------------------
AC_SUBST(MATH_CPPFLAGS)
AC_SUBST(MATH_LDFLAGS)
AC_SUBST(MATH_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_MATH" = xyes; then
FLAG_INFO="$FLAG_INFO|MATH_CPPFLAGS: ${MATH_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|MATH_LDFLAGS: ${MATH_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|MATH_LIBS: ${MATH_LIBS}"
fi
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

90
m4/external.ncurses Normal file
View File

@ -0,0 +1,90 @@
dnl -*- mode: Autoconf; -*-
dnl -----------------------------------------------------------------------------------------
dnl option for ncurses support
dnl -----------------------------------------------------------------------------------------
tr_NCURSES_DEFAULT="yes"
AC_ARG_ENABLE(ncurses,
AS_HELP_STRING([--enable-curses], [enable ncurses support (default: $tr_NCURSES_DEFAULT)]),
tr_NCURSES="$enableval",
tr_NCURSES="$tr_NCURSES_DEFAULT"
)
TR_STATIC_ENABLE([ncurses])
dnl -----------------------------------------------------------------------------------------
dnl checks for ncurses headers and libraries
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR NCURSES])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C)
if test "x$tr_NCURSES" = xyes; then
AC_PATH_PROG(NCURSES_CONFIG, ncurses5-config, [], [$PATH:/usr/sbin/])
if test -z "$NCURSES_CONFIG"; then
AC_PATH_PROG(NCURSES_CONFIG, ncurses6-config, [], [$PATH:/usr/sbin/])
fi
if test -n "$NCURSES_CONFIG"; then
NCURSES_LIBS="`$NCURSES_CONFIG --libs`"
NCURSES_CPPFLAGS="`$NCURSES_CONFIG --cflags`"
else
AC_MSG_WARN([Please install the ncurses library])
tr_NCURSES="no"
fi
fi
if test "x$tr_NCURSES" = xyes; then
TR_ABSOLUTE_LIBRARIES([ncurses], [NCURSES_LIBS])
if test "x$tr_libraries_found" != xyes; then
AC_MSG_ERROR([Please install the ncurses library])
fi
fi
if test "x$tr_NCURSES" = xyes; then
CPPFLAGS="$CPPFLAGS -DHAVE_NCURSES=1"
fi
dnl -----------------------------------------------------------------------------------------
dnl fix include and static libraries
dnl -----------------------------------------------------------------------------------------
TR_INCLUDE([NCURSES_CPPFLAGS])
TR_STATIC_LIBRARY([ncurses], [NCURSES_LIBS])
dnl -----------------------------------------------------------------------------------------
dnl add substitutions
dnl -----------------------------------------------------------------------------------------
AM_CONDITIONAL(ENABLE_NCURSES, test x$tr_NCURSES = xyes)
AC_SUBST(NCURSES_CPPFLAGS)
AC_SUBST(NCURSES_LDFLAGS)
AC_SUBST(NCURSES_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_NCURSES" = xyes; then
LIB_INFO="$LIB_INFO|NCURSES support: enabled"
FLAG_INFO="$FLAG_INFO|NCURSES_CPPFLAGS: ${NCURSES_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|NCURSES_LDFLAGS: ${NCURSES_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|NCURSES_LIBS: ${NCURSES_LIBS}"
else
LIB_INFO="$LIB_INFO|NCURSES support: disabled"
fi
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

View File

@ -27,6 +27,14 @@ AC_ARG_WITH(openssl-lib,
TR_STATIC_ENABLE([ssl])
dnl -----------------------------------------------------------------------------------------
dnl check for OpenSSL
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR OPENSSL])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
@ -39,10 +47,6 @@ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
SAVE_LIBS="$LIBS"
dnl -----------------------------------------------------------------------------------------
dnl check for OpenSSL
dnl -----------------------------------------------------------------------------------------
if test "$tr_OPENSSL" = "yes"; then
AC_CHECK_HEADERS([openssl/ssl.h])
@ -141,3 +145,8 @@ if test "x$tr_OPENSSL" = xyes; then
FLAG_INFO="$FLAG_INFO|OPENSSL_LDFLAGS: ${OPENSSL_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|OPENSSL_LIBS: ${OPENSSL_LIBS}"
fi
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

119
m4/external.readline Normal file
View File

@ -0,0 +1,119 @@
dnl -*- mode: Autoconf; -*-
dnl -----------------------------------------------------------------------------------------
dnl option for READLINE support
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR READLINE])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_ARG_ENABLE(readline,
AS_HELP_STRING([--enable-readline], [enable readline support (default: yes)]),
tr_READLINE="$enableval",
tr_READLINE="maybe"
)
AC_ARG_WITH(readline,
AS_HELP_STRING([--with-readline=DIR], [where the readline library and includes are located]),
[READLINE_CPPFLAGS="-I$withval/include"
READLINE_LDFLAGS="-L$withval/lib"
READLINE="$withval"]
)
AC_ARG_WITH(readline-lib,
AS_HELP_STRING([--with-readline-lib=DIR], [where the readline library is located]),
[READLINE_LDFLAGS="-L$withval"]
)
TR_STATIC_ENABLE([readline])
dnl -----------------------------------------------------------------------------------------
dnl checks for the READLINE library
dnl -----------------------------------------------------------------------------------------
AC_LANG(C++)
if test "x$READLINE_CPPFLAGS" != x; then
TR_INCLUDE([READLINE_CPPFLAGS])
fi
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $READLINE_CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $READLINE_LDFLAGS"
SAVE_LIBS="$LIBS"
dnl -----------------------------------------------------------------------------------------
dnl check for header and library
dnl -----------------------------------------------------------------------------------------
if test "x$tr_READLINE" = xyes -o "x$tr_READLINE" = xmaybe; then
ch_READLINE="$tr_READLINE"
AC_CHECK_HEADERS(readline/readline.h, [tr_READLINE="yes"], [tr_READLINE="no"])
if test "x$tr_READLINE" = xyes; then
TR_FIND_C_LIBRARY([readline], [readline], [READLINE_LIBS], [readline])
tr_READLINE=$tr_library_found
fi
if test "x$tr_READLINE" = xyes; then
TR_STATIC_LIBRARY([readline], [READLINE_LIBS])
else
if test "x$ch_READLINE" = xyes; then
AC_MSG_ERROR([Please install readline support])
fi
fi
fi
dnl -----------------------------------------------------------------------------------------
dnl add substitutions
dnl -----------------------------------------------------------------------------------------
AM_CONDITIONAL(ENABLE_READLINE, test "x$tr_READLINE" = xyes)
AC_SUBST(READLINE_CPPFLAGS)
AC_SUBST(READLINE_LDFLAGS)
AC_SUBST(READLINE_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
LIBS="$SAVE_LIBS"
LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
if test "x$tr_READLINE" = xyes; then
CPPFLAGS="$CPPFLAGS -DHAVE_READLINE=1"
fi
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------
if test "x$tr_READLINE" = xyes; then
if test "x$READLINE" = x; then
LIB_INFO="$LIB_INFO|READLINE support: enabled"
else
LIB_INFO="$LIB_INFO|READLINE support: enabled (path $READLINE)"
fi
FLAG_INFO="$FLAG_INFO|READLINE_CPPFLAGS: ${READLINE_CPPFLAGS}"
FLAG_INFO="$FLAG_INFO|READLINE_LDFLAGS: ${READLINE_LDFLAGS}"
FLAG_INFO="$FLAG_INFO|READLINE_LIBS: ${READLINE_LIBS}"
else
LIB_INFO="$LIB_INFO|READLINE support: disabled"
fi
dnl Local Variables:
dnl mode: outline-minor
dnl outline-regexp: "^\\(dnl --SECTION--\\)"
dnl End:

View File

@ -21,13 +21,27 @@ AC_ARG_WITH(v8-lib,
TR_STATIC_ENABLE([v8])
dnl -----------------------------------------------------------------------------------------
dnl save flags
dnl -----------------------------------------------------------------------------------------
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $V8_CPPFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $V8_LDFLAGS"
dnl -----------------------------------------------------------------------------------------
dnl checks for the V8 library
dnl -----------------------------------------------------------------------------------------
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_MSG_NOTICE([CHECKING FOR NCURSES])
AC_MSG_NOTICE([--------------------------------------------------------------------------------])
AC_LANG(C++)
V8_LIBS=-lv8
AC_CHECK_LIB([v8], [main], [V8_LIBS="-lv8"], )
if test "x$V8_CPPFLAGS" != x; then
TR_INCLUDE([V8_CPPFLAGS])
@ -41,6 +55,13 @@ AC_SUBST(V8_CPPFLAGS)
AC_SUBST(V8_LDFLAGS)
AC_SUBST(V8_LIBS)
dnl -----------------------------------------------------------------------------------------
dnl restore flags
dnl -----------------------------------------------------------------------------------------
LDFLAGS="$SAVE_LDFLAGS"
CPPFLAGS="$SAVE_CPPFLAGS"
dnl -----------------------------------------------------------------------------------------
dnl informational output
dnl -----------------------------------------------------------------------------------------