dnl Process this file with -*- autoconf -*- to produce a configure script dnl dnl $Id: configure.in,v 1.1.4.4 1999/06/09 10:14:03 erik Exp $ dnl dnl configure.in -- configure script for Musica dnl Copyright (C) 1999 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl AC_REVISION([$Id: configure.in,v 1.1.4.4 1999/06/09 10:14:03 erik Exp $]) dnl Init autoconf AC_INIT(src/main.cc) AC_CONFIG_AUX_DIR(tools) dnl Init automake PACKAGE=musica MUSICA_MAJOR_VERSION=1 MUSICA_MINOR_VERSION=1 MUSICA_MICRO_VERSION=4 MUSICA_VERSION=$MUSICA_MAJOR_VERSION.$MUSICA_MINOR_VERSION.$MUSICA_MICRO_VERSION VERSION=$MUSICA_VERSION AM_INIT_AUTOMAKE($PACKAGE, $VERSION) AM_CONFIG_HEADER(include/config.h) AC_SUBST(MUSICA_MAJOR_VERSION) AC_SUBST(MUSICA_MINOR_VERSION) AC_SUBST(MUSICA_MICRO_VERSION) AC_SUBST(MUSICA_VERSION) dnl Init libtool AM_PROG_LIBTOOL dnl Init maintainer mode AM_MAINTAINER_MODE dnl Guess the host OS AC_CANONICAL_HOST dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_AIX AC_MINIX AC_ISC_POSIX AM_PROG_CC_STDC AM_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET dnl Check if run-time debug information is enabled AC_ARG_ENABLE(musica-debug, [ --enable-musica-debug Enable general run-time debug information], [musica_debug_flag=$enable_musica_debug], [musica_debug_flag=no]) if test "x$musica_debug_flag" = "xyes" ; then AC_DEFINE(MUSICA_DEBUG) fi dnl check for timing debug information AC_ARG_ENABLE(timing-debug, [ --enable-timing-debug Enable run-time timing debug information], [timing_debug_flag=$enable_timing_debug], [timing_debug_flag=no]) if test "x$timing_debug_flag" = "xyes" ; then AC_DEFINE(TIMING_DEBUG) fi dnl check for midi IO debug information AC_ARG_ENABLE(midi-debug, [ --enable-midi-debug Enable run-time MIDI I/O debug information], [midi_debug_flag=$enable_midi_debug], [midi_debug_flag=no]) if test "x$midi_debug_flag" = "xyes" ; then AC_DEFINE(MIDI_DEBUG) fi dnl Checks for libraries. AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(*** $PACKAGE $VERSION needs GTK+ >= 1.2.0 ***)) AC_CHECK_LIB(m,floor) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h linux/soundcard.h malloc.h sys/ioctl.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP AC_REPLACE_FUNCS(strdup strerror strstr) if test "x$ac_cv_func_memcmp_clean" = "xyes" ; then AC_DEFINE(HAVE_MEMCMP_CLEAN, 1) fi dnl Check if the compiler has __FILE__, __LINE__, __FUNCTION__, dnl and __PRETTY_FUNCTION__ macros AC_CACHE_CHECK(if C compiler has \"__FILE__\" macro, ac_cv_c_has_file_macro, [AC_TRY_COMPILE([#include ],[printf("%s", __FILE__);], ac_cv_c_has_file_macro=yes, ac_cv_c_has_file_macro=no) ] ) if test "$ac_cv_c_has_file_macro" = "no" ; then AC_DEFINE(__FILE__, "(no __FILE__ information)") fi AC_CACHE_CHECK(if C compiler has \"__LINE__\" macro, ac_cv_c_has_line_macro, [AC_TRY_COMPILE([#include ],[printf("%i", __LINE__);], ac_cv_c_has_line_macro=yes, ac_cv_c_has_line_macro=no) ] ) if test "$ac_cv_c_has_line_macro" = "no" ; then AC_DEFINE(__LINE__, -1) fi AC_CACHE_CHECK(if C compiler has \"__FUNCTION__\" macro, ac_cv_c_has_function_macro, [AC_TRY_COMPILE([#include ],[printf("%s", __FUNCTION__);], ac_cv_c_has_function_macro=yes, ac_cv_c_has_function_macro=no) ] ) if test "$ac_cv_c_has_function_macro" = "no" ; then AC_DEFINE(__FUNCTION__, "(no __FUNCTION__ information)") fi AC_CACHE_CHECK(if C compiler has \"__PRETTY_FUNCTION__\" macro, ac_cv_c_has_pretty_function_macro, [AC_TRY_COMPILE([#include ],[printf("%s", __PRETTY_FUNCTION__);], ac_cv_c_has_pretty_function_macro=yes, ac_cv_c_has_pretty_function_macro=no) ] ) if test "$ac_cv_c_has_pretty_function_macro" = "no" ; then if test "$ac_cv_c_has_function_macro" = "yes" ; then AC_DEFINE(__PRETTY_FUNCTION__, __FUNCTION__) else AC_DEFINE(__PRETTY_FUNCTION__, "(no __PRETTY_FUNCTION__ information)") fi fi dnl Add C flags to display more warnings AC_MSG_CHECKING(for C flags to get more warnings) ac_save_CFLAGS="$CFLAGS" if test "x$ac_cv_prog_gcc" = "xyes" ; then dnl gcc is the easiest C compiler warning_CFLAGS="-Wall" else dnl Vendor supplied C compilers are a bit tricky case "$host_os" in dnl SGI IRIX with the MipsPRO C compiler irix*) CFLAGS="$CFLAGS -fullwarn" AC_TRY_COMPILE([#include ],[printf("test");], warning_CFLAGS="-fullwarn",) ;; dnl SunOS 4.x with the SparcWorks(?) acc compiler sunos*) if "$CC" = "acc" ; then CFLAGS="$CFLAGS -vc" AC_TRY_COMPILE([#include ],[printf("test");], warning_CFLAGS="-vc",) fi ;; dnl Unknown, do nothing *) warning_CFLAGS="none" ;; esac fi CFLAGS="$ac_save_CFLAGS" if test "$warning_CFLAGS" = "none" ; then AC_MSG_RESULT(none) else CFLAGS="$CFLAGS $warning_CFLAGS" AC_MSG_RESULT($warning_CFLAGS) fi dnl Add C++ flags to display more warnings AC_MSG_CHECKING(for C++ flags to get more warnings) ac_save_CXXFLAGS="$CXXFLAGS" AC_LANG_SAVE if test "x$ac_cv_prog_gxx" = "xyes" ; then dnl g++ is the easiest C++ compiler warning_CXXFLAGS="-Wall" else dnl Vendor supplied C++ compilers are a bit tricky case "$host_os" in dnl SGI IRIX with the MipsPRO C++ compiler irix*) AC_LANG_CPLUSPLUS CXXFLAGS="$CXXFLAGS -fullwarn" AC_TRY_COMPILE([#include ],[cout<< "test";], warning_CXXFLAGS="-fullwarn",) ;; dnl Unknown, do nothing *) warning_CXXFLAGS="none" ;; esac fi AC_LANG_RESTORE CXXFLAGS="$ac_save_CXXFLAGS" if test "$warning_CXXFLAGS" = "none" ; then AC_MSG_RESULT(none) else CXXFLAGS="$CXXFLAGS $warning_CXXFLAGS" AC_MSG_RESULT($warning_CXXFLAGS) fi dnl Create output files AC_OUTPUT(Makefile examples/Makefile include/Makefile src/Makefile tools/Makefile) echo "" echo "Configuration" echo "-------------------------------------------------------------------" echo "Host OS ${host}" echo "C compiler ${CC}" echo "C++ compiler ${CXX}" echo "C flags ${CFLAGS}" echo "C++ flags ${CXXFLAGS}" echo "Linker flags ${LDFLAGS}" echo "Extra object files ${LIBOBJS}" echo "Runtime debug information ${musica_debug_flag}" echo "Runtime timing information ${timing_debug_flag}" echo "Runtime MIDI I/O information ${midi_debug_flag}" echo "" dnl Local Variables: dnl comment-start: "dnl " dnl comment-end: "" dnl comment-start-skip: "\\bdnl\\b\\s *" dnl compile-command: "autoconf" dnl End: