dnl --- dnl configure.in for ecamegapedal dnl last modified: 20030531-8 dnl -- dnl ------------------------------------------------------------------ AC_INIT(src/ecamegapedal.cpp) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "1. Section: Basic setup" echo "------------------------------------------------------------------" dnl --- dnl Init automake dnl --- AM_INIT_AUTOMAKE(ecamegapedal, 0.4.4) AM_CONFIG_HEADER(config.h) dnl ------------------------------------------------------------------ dnl -- dnl Initialize default flags dnl -- AC_PROG_CC AC_PROG_CXX AC_PROG_CPP AC_LANG_CPLUSPLUS AC_CANONICAL_HOST dnl ------------------------------------------------------------------ dnl --- dnl Set compiler flags. dnl --- EXTRAFLAGS="-D_REENTRANT" EXTRAGCCFLAGS="$EXTRAFLAGS -ffast-math -fstrict-aliasing -funroll-loops" if test x${GXX} = xyes; then CXXFLAGS="$CXXFLAGS $EXTRAFLAGS $EXTRAGCCFLAGS" fi if test x${GCC} = xyes; then CFLAGS="$CFLAGS $EXTRAFLAGS $EXTRAGCCFLAGS" fi dnl ------------------------------------------------------------------ dnl --- dnl Set up some operating system specific options for POSIX threads dnl --- case "$host" in *-*-openbsd*) CFLAGS="$CFLAGS -pthread" CXXFLAGS="$CXXFLAGS -pthread" echo "Setting OpenBSD compilation options for POSIX threads" ;; *-*-freebsd*) CFLAGS="$CFLAGS -pthread" CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" CXXFLAGS="$CXXFLAGS -pthread" echo "Setting FreeBSD compilation options for POSIX threads" ;; *-*-solaris*) CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS" LIBS="$LIBS -lposix4 -mt -lpthread" echo "Setting Solaris compilation options for POSIX threads" if test x$CXX = xCC; then CXXFLAGS="$CXXFLAGS -instances=static" echo "Sun Workshop C++ compiler detected. Enabling static template instantation." fi ;; *) echo "Using generic settings for POSIX thread support." ;; esac dnl ------------------------------------------------------------------ dnl --- dnl Check pthread support dnl --- dnl switch to C while testing for pthread support AC_LANG_C AC_SEARCH_LIBS(pthread_create, pthread c_r, [], AC_MSG_ERROR([** POSIX.4 threads not installed or broken **])) dnl switch back to C++ AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ dnl --- dnl Sets datadir variable dnl --- dnl Define myprefix depending on wether our user gives us one or not if test "x${prefix}" = "xNONE"; then myprefix=${ac_default_prefix} else myprefix=${prefix} fi dnl Set PACKAGE_DATA_DIR AC_SUBST(PACKAGE_DATA_DIR) AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${myprefix}/share/${PACKAGE}") dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "2. Section: Options for the configure script" echo "------------------------------------------------------------------" dnl --- dnl Check whether to enable debugging dnl dnl defines: ECA_AM_DEBUG_MODE, CXXFLAGS, CFLAGS dnl --- AC_MSG_CHECKING(whether to enable debugging) AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (default = no)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) include_debug=yes ;; n | no) AC_MSG_RESULT(no) include_debug=no ;; *) AC_MSG_ERROR([Invalid parameter value for --enable-debug: $enableval]) ;; esac ] ) AM_CONDITIONAL(ECA_AM_DEBUG_MODE, test x$include_debug = xyes) if test x$include_debug = xyes; then EXTRADEBUGFLAGS="-Wall -Wstrict-prototypes -O0" else EXTRADEBUGFLAGS="-DNDEBUG" fi CXXFLAGS="$CXXFLAGS $EXTRADEBUGFLAGS" CFLAGS="$CFLAGS $EXTRADEBUGFLAGS" dnl ------------------------------------------------------------------ AC_MSG_CHECKING(whether to check design-by-contract assertions) enable_dbc_d=yes AC_ARG_ENABLE(dbc, [ --disable-dbc Don't check design-by-contract assertions (default = check)], [ case "$enableval" in y | yes) AC_MSG_RESULT(yes) enable_dbc_d=yes ;; n | no) AC_MSG_RESULT(no) enable_dbc_d=no ;; *) AC_MSG_ERROR([Invalid parameter value for --disable-dbc: $enableval]) ;; esac ],[ AC_MSG_RESULT(yes) ] ) if test x$enable_dbc_d = xyes; then CXXFLAGS="$CXXFLAGS -DENABLE_DBC" fi dnl -- dnl Check for JACK support dnl dnl defines: ECA_AM_COMPILE_JACK, ECA_S_JACK_LIBS, ECA_S_JACK_INCLUDES, dnl ECA_COMPILE_JACK dnl -- AC_CHECK_HEADER(jack/jack.h,jack_support=yes,jack_support=no) AC_ARG_WITH(jack, [ --with-jack=DIR Compile against JACK installed in DIR], [ ECA_S_JACK_LIBS="-L${withval}/lib" ECA_S_JACK_INCLUDES="-I${withval}/include" jack_support=yes ]) AC_ARG_ENABLE(jack, [ --disable-jack Disable JACK support (default = no)], jack_support=no) AM_CONDITIONAL(ECA_AM_COMPILE_JACK, test x$jack_support = xyes) if test x$jack_support = xyes; then ECA_S_JACK_LIBS="${ECA_S_JACK_LIBS} -ljack" AC_DEFINE(ECA_COMPILE_JACK) fi AC_SUBST(ECA_S_JACK_LIBS) AC_SUBST(ECA_S_JACK_INCLUDES) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "3. Section: Programs " echo "------------------------------------------------------------------" dnl --- dnl Checks for programs. dnl --- AC_CHECK_CXX_NAMESPACE_SUPPORT dnl ------------------------------------------------------------------ dnl -- dnl Autotools and libtool dnl -- AC_LANG_C AC_PROG_LIBTOOL AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "4. Section: Libraries" echo "------------------------------------------------------------------" dnl --- dnl Checks for libraries. dnl --- dnl switch to C for testing AC_LANG_C AC_SEARCH_LIBS(sin, m,, AC_MSG_ERROR([*** required sin() function not found! ***])) dnl switch back to C++ AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ dnl --- dnl Ecasound libs dnl dnl defines: ECA_S_PREFIX, ECA_S_LIBS, ECA_S_LDFLAGS, $ECA_S_CFLAGS dnl --- AC_CHECK_LIBECASOUND(9) dnl --- dnl Check for qt dnl --- AC_PATH_QT if test x$qt_includes = x ; then AC_MSG_ERROR([Qt include files not found!]) fi if test x$qt_libraries = x ; then qt_support=no AC_MSG_ERROR([Qt libraries not found!]) fi [ case "$qt_libraries" in /usr/lib | /lib ) set_qt_rpath="" ;; *) set_qt_rpath="-rpath $qt_libraries";; esac ] AC_SUBST([ECA_QT_RPATH],["$set_qt_rpath"]) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "5. Section: Headers" echo "------------------------------------------------------------------" dnl --- dnl Checks for header files. dnl --- AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(signal.h sys/types.h unistd.h inttypes.h) AC_CHECK_HEADER(map,nostlmap=0,nostlmap=1) if test "x$nostlmap" = "x1" ; then AC_MSG_ERROR([C++ header files not found! Searched for '' (STL).]) fi dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "6. Section: Typedefs and structures" echo "------------------------------------------------------------------" dnl --- dnl Checks for typedefs, structures, and compiler characteristics. dnl --- AC_LANG_C AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "7. Section: Functions" echo "------------------------------------------------------------------" dnl ------------------------------------------------------------------ dnl --- dnl Check whether to disable all use of shared libs dnl dnl Note! Must be run after all other autoconf tests as dnl 'ld' doesn't understand -all-static. dnl dnl modifies: CXXFLAGS, CFLAGS, LDFLAGS dnl --- AC_ARG_ENABLE(all-static, [ --enable-all-static Build only static binaries (default = no)], enable_all_static=yes) if test x$enable_all_static = xyes; then CXXFLAGS="$CXXFLAGS -static" CFLAGS="$CFLAGS -static" LDFLAGS="$LDFLAGS -Bstatic -all-static" fi dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "8. Section: Output" echo "------------------------------------------------------------------" dnl --- dnl Create outputs dnl --- AC_OUTPUT([ Makefile ecamegapedal.spec src/Makefile Documentation/Makefile ]) dnl --- dnl Print summary of the configured options dnl --- echo "-----------------------------------------------------------------" echo "Following features were selected:" if test x$include_debug = xyes ; then echo "Debugging info: yes" else echo "Debugging info: no" fi if test x$jack_support = xyes ; then echo "JACK support yes" else echo "JACK support no" fi echo "" echo "Ecasound library setup:" echo "Linker flags: $ECA_S_LIBS $ECA_S_LDFLAGS" echo "Compiler flags: $ECA_S_CFLAGS" echo "" echo "Following directories are used:" echo "Directory prefix: "$prefix echo "Qt-moc: "$MOC echo "Qt-libraries: "$qt_libraries echo "Qt-libname: "$qt_libname echo "Qt-includes: "$qt_includes echo "-----------------------------------------------------------------" echo "Type 'make' to compile the package and 'make install' to install." echo "Remember to use GNU Make, often installed as 'gmake'." echo "-----------------------------------------------------------------" dnl ------------------------------------------------------------------ dnl X. Section: End dnl ------------------------------------------------------------------