dnl --- dnl configure.in for ecawave dnl last modified: 20030529-3 dnl -- dnl ------------------------------------------------------------------ dnl --- dnl Process this file with autoconf to produce a configure script. dnl --- AC_INIT(src/ecawave.h) dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "1. Section: Basic setup" echo "------------------------------------------------------------------" dnl --- dnl Init automake dnl --- AM_INIT_AUTOMAKE(ecawave, 0.6.1) AM_CONFIG_HEADER(config.h) 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 CXXFLAGS. 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 --- AC_LANG_C AC_SEARCH_LIBS(pthread_create, pthread c_r, [], AC_MSG_ERROR([** POSIX.4 threads not installed or broken **])) AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "2. Section: Options for the configure script" echo "------------------------------------------------------------------" 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 ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "3. Section: Programs " echo "------------------------------------------------------------------" dnl --- dnl Checks for programs. dnl --- AC_CHECK_CXX_NAMESPACE_SUPPORT dnl -- dnl Autotools and libtool dnl -- AC_LANG_C AC_PROG_LIBTOOL AC_LANG_CPLUSPLUS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "4. Section: Libraries" echo "------------------------------------------------------------------" dnl --- dnl Check for qt dnl --- AC_PATH_QT if test x$qt_includes = x ; then AC_MSG_ERROR([** Couldn't find Qt header files! **]) fi if test x$qt_libraries = x ; then AC_MSG_ERROR([** Couldn't find Qt libries! **]) fi 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 ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "5. Section: Headers" echo "------------------------------------------------------------------" dnl --- dnl Checks for header files. dnl --- AC_STDC_HEADERS dnl ------------------------------------------------------------------ echo "------------------------------------------------------------------" echo "6. Section: Typedefs and structures" echo "------------------------------------------------------------------" dnl --- dnl Checks for typedefs, structures, and compiler characteristics. dnl --- dnl AC_C_CONST dnl AC_C_INLINE 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 ecawave.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 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 ------------------------------------------------------------------