dnl Process this file with autoconf to produce a configure script. AC_INIT AC_PREREQ(2.59) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/chunk.c]) AC_CANONICAL_HOST AC_CANONICAL_TARGET MHW_VERSION=1.4.24 AM_INIT_AUTOMAKE(mhWaveEdit,$MHW_VERSION) # This is disabled in releases because timestamps can not be preserved through # the current Github-based release flow. AM_MAINTAINER_MODE([disable]) dnl Check for libintl AM_GNU_GETTEXT([external]) PKG_PROG_PKG_CONFIG dnl Various options AC_ARG_WITH(double-samples, [ --with-double-samples Use double precision floating point numbers for sound processing (slows down program but may increase quality for 24/32-bit samplerates).], AC_DEFINE([USE_DOUBLE_SAMPLES],[], [Use gdouble instead of gfloat as sample data type]) MHW_DOUBLE="yes") AC_DEFUN([AC_WITHOUT_CHECK_CASTS],[ if test "x$withval" = "xno" ; then AC_DEFINE(GTK_NO_CHECK_CASTS,[],[If defined, disables GTK+ type checking]) fi ]) AC_ARG_WITH(check-casts, [ --without-check-casts Do not type-check GTK casts.],AC_WITHOUT_CHECK_CASTS) AC_DEFUN([AC_ENABLE_WERROR],[ if test "x$enableval" = "xyes" ; then AM_CFLAGS="$AM_CFLAGS -Werror" fi ]) AC_ARG_ENABLE(werror, [ --enable-werror Treat warnings as errors during compilation], AC_ENABLE_WERROR) DEFAULT_DRIVER=auto AC_ARG_WITH(default-driver, [ --with-default-driver=driver Choose default sound driver (one of oss,alsa,pulse, jack,sun,pa,sdl,esound,arts,auto; default: auto)], DEFAULT_DRIVER=$withval) AC_DEFINE_UNQUOTED(DEFAULT_DRIVER,"${DEFAULT_DRIVER}",[Default sound driver]) DEFAULT_LADSPA_PATH="/usr/lib/ladspa:/usr/local/lib/ladspa" AC_ARG_WITH(default-ladspa-path, [ --with-default-ladspa-path=path Path to use if LADSPA_PATH variable is not set (default: "/usr/lib/ladspa:/usr/local/lib/ladspa")], DEFAULT_LADSPA_PATH=$withval) AC_DEFINE_UNQUOTED(DEFAULT_LADSPA_PATH,"${DEFAULT_LADSPA_PATH}",[Default path for LADSPA plugins]) DEFAULT_MIXERAPP=xmixer AC_ARG_WITH(default-mixerapp, [ --with-default-mixerapp=appname Default command for "launch mixer" button (default: "xmixer")], DEFAULT_MIXERAPP=$withval) AC_DEFINE_UNQUOTED(DEFAULT_MIXERAPP,"${DEFAULT_MIXERAPP}",[Default mixer application]) FIXED_DATE_STR="__DATE__ (actual compile date)" FIXED_TIME_STR="__TIME__ (actual compile time)" AC_ARG_WITH(build-date, [ --with-build-date=str Fixed string to use instead of __DATE__], if test "x$withval" != "xno" ; then AC_DEFINE_UNQUOTED(FIXED_DATE,"${withval}",[Fixed build date]) FIXED_DATE_STR=${withval} fi ) AC_ARG_WITH(build-time, [ --with-build-time=str Fixed string to use instead of __TIME__], if test "x$withval" != "xno" ; then AC_DEFINE_UNQUOTED(FIXED_TIME,"${withval}",[Fixed build date]) FIXED_TIME_STR=${withval} fi ) dnl Checks for programs. AC_PROG_CC AC_PROG_GCC_TRADITIONAL AC_PROG_LN_S AC_PROG_MAKE_SET dnl Checks for libraries. dnl Replace `main' with a function in -libs: AC_CHECK_LIB(ibs, main) AC_CHECK_LIB(m, round) dnl This is needed for PortAudio under GNU/Linux... AC_CHECK_LIB(pthread,pthread_create) dnl Check for libsndfile HAVE_SNDFILE=yes SKIP_SNDFILE_CHECK=no SNDFILE_LIBS="" SNDFILE_CFLAGS="" AC_DEFUN([AC_WITH_LIBSNDFILE],[ if test "x$withval" = "xno" ; then HAVE_SNDFILE=no else SNDFILE_LIBS="-L$withval/lib -lsndfile -lm" SNDFILE_CFLAGS="-I$withval/include" SKIP_SNDFILE_CHECK=yes fi ]) AC_ARG_WITH(libsndfile,[ --with-libsndfile=prefix Prefix where libsndfile is installed (optional) --without-libsndfile Don't use libsndfile library],AC_WITH_LIBSNDFILE) if test "x$HAVE_SNDFILE" = "xyes" -a "x$SKIP_SNDFILE_CHECK" = "xno"; then PKG_CHECK_MODULES(SNDFILE, sndfile, , HAVE_SNDFILE=no) fi if test "x$HAVE_SNDFILE" = "xyes" ; then AC_DEFINE(HAVE_LIBSNDFILE,[],[Use libsndfile library]) fi AC_SUBST(SNDFILE_LIBS) AC_SUBST(SNDFILE_CFLAGS) dnl Check for libsamplerate HAVE_LIBSAMPLERATE=yes SKIP_LIBSAMPLERATE_CHECK=no LIBSAMPLERATE_LIBS="" LIBSAMPLERATE_CFLAGS="" AC_DEFUN([AC_WITH_LIBSAMPLERATE],[ if test "x$withval" = "xno" ; then HAVE_LIBSAMPLERATE=no else LIBSAMPLERATE_LIBS="-L$withval/lib -lsamplerate" LIBSAMPLERATE_CFLAGS="-I$withval/include" SKIP_LIBSAMPLERATE_CHECK=yes fi ]) AC_ARG_WITH(libsamplerate,[ --with-libsamplerate=prefix Prefix where libsamplerate is installed (optional) --without-libsamplerate Don't use libsamplerate library],AC_WITH_LIBSAMPLERATE) if test "x$HAVE_LIBSAMPLERATE" = "xyes" -a "x$SKIP_LIBSAMPLERATE_CHECK" = "xno"; then PKG_CHECK_MODULES(LIBSAMPLERATE, samplerate, , HAVE_LIBSAMPLERATE=no) fi if test "x$HAVE_LIBSAMPLERATE" = "xyes" ; then AC_DEFINE(HAVE_LIBSAMPLERATE,[],[Use libsamplerate library]) fi AC_SUBST(LIBSAMPLERATE_LIBS) AC_SUBST(LIBSAMPLERATE_CFLAGS) dnl Check for PortAudio PORTAUDIO_LIBS="" MHW_HAVE_PORTAUDIO=yes AC_ARG_WITH(portaudio,[ --without-portaudio Don't use portaudio library], if test "x$withval" = "xno"; then MHW_HAVE_PORTAUDIO=no fi ) AC_CHECK_HEADER(portaudio.h,mhw_found_header=yes,mhw_found_header=no) if test "x$mhw_found_header" = "xno"; then MHW_HAVE_PORTAUDIO=no fi if test "x$MHW_HAVE_PORTAUDIO" = "xyes"; then AC_CHECK_LIB(portaudio,Pa_Initialize,MHW_HAVE_PORTAUDIO=yes,MHW_HAVE_PORTAUDIO=no) fi if test "x$MHW_HAVE_PORTAUDIO" = "xyes"; then AC_CHECK_TYPE(PaTimestamp,,MHW_HAVE_PORTAUDIO=no,[[#include ]]) fi if test "x$MHW_HAVE_PORTAUDIO" = "xyes"; then AC_DEFINE(HAVE_PORTAUDIO,[],[Enable PortAudio sound driver]) PORTAUDIO_LIBS="-lportaudio $PORTAUDIO_LIBS" fi AC_SUBST(PORTAUDIO_LIBS) dnl Check for SDL SKIP_SDL_TEST=no MHW_HAVE_SDL=no AC_DEFUN([AC_WITHOUT_SDL],[ if test "x$withval" = "xno" ; then SKIP_SDL_TEST=yes fi ]) AC_ARG_WITH(sdl,[ --without-sdl Don't use SDL library],AC_WITHOUT_SDL) if test "x$SKIP_SDL_TEST" = "xno"; then AM_PATH_SDL(1.2.3, AC_DEFINE(HAVE_SDL,[],[Enable SDL sound driver]) MHW_HAVE_SDL=yes) fi dnl Check for AlsaLib ALSALIB_LIBS="" AC_CHECK_LIB(asound,snd_pcm_open,HAVE_ALSALIB=yes,HAVE_ALSALIB=no) AC_DEFUN([AC_WITHOUT_ALSALIB],[ if test "x$withval" = "xno" ; then HAVE_ALSALIB=no fi ]) AC_ARG_WITH(alsalib,[ --without-alsalib Don't compile ALSA-lib driver],AC_WITHOUT_ALSALIB) AC_CHECK_HEADER(alsa/asoundlib.h,mhw_found_header=yes,mhw_found_header=no) if test "x$mhw_found_header" = "xno"; then HAVE_ALSALIB="no" fi if test "x$HAVE_ALSALIB" = "xyes"; then ALSALIB_LIBS="-lasound" AC_DEFINE(HAVE_ALSALIB,[],[Enable ALSA sound driver]) fi AC_SUBST(ALSALIB_LIBS) dnl Check for OSS HAVE_OSS=yes AC_DEFUN([AC_WITHOUT_OSS],[ if test "x$withval" = "xno" ; then HAVE_OSS=no fi ]) AC_ARG_WITH(oss,[ --without-oss Don't compile OSS driver],AC_WITHOUT_OSS) dnl Check for libossaudio, needed for OSS on OpenBSD AC_CHECK_LIB(ossaudio,_oss_ioctl) mhw_found_one=no AC_CHECK_HEADERS(soundcard.h sys/soundcard.h,mhw_found_one=yes) if test "x$mhw_found_one" = "xno"; then HAVE_OSS=no fi if test "x$HAVE_OSS" = "xyes"; then AC_DEFINE(HAVE_OSS,[],[Enable OSS sound driver]) fi dnl Check for JACK MHW_HAVE_JACK=no MHW_SKIP_JACKTEST=no AC_DEFUN([AC_WITHOUT_JACK],[ if test "x$withval" = "xno" ; then MHW_SKIP_JACKTEST='yes' fi ]) AC_ARG_WITH(jack,[ --without-jack Don't compile JACK driver],AC_WITHOUT_JACK) if test "x$MHW_SKIP_JACKTEST" = "xno" then PKG_CHECK_MODULES(JACK,jack >= 0.98.0,MHW_HAVE_JACK=yes,MHW_HAVE_JACK=no) fi if test "x$MHW_HAVE_JACK" = "xyes" ; then AC_DEFINE(HAVE_JACK,[],[Enable JACK sound driver]) fi dnl Check for PulseAudio MHW_HAVE_PULSE=no MHW_SKIP_PULSETEST=no AC_DEFUN([AC_WITHOUT_PULSE],[ if test "x$withval" = "xno" ; then MHW_SKIP_PULSETEST='yes' fi ]) AC_ARG_WITH(pulse,[ --without-pulse Don't compile PulseAudio driver],AC_WITHOUT_PULSE) if test "x$MHW_SKIP_PULSETEST" = "xno" then PKG_CHECK_MODULES(PULSE,libpulse >= 0.9.10,MHW_HAVE_PULSE=yes,MHW_HAVE_PULSE=no) fi if test "x$MHW_HAVE_PULSE" = "xyes" ; then AC_DEFINE(HAVE_PULSEAUDIO,[],[Enable PulseAudio sound driver]) fi dnl Check for Esound MHW_HAVE_ESOUND=yes AC_ARG_WITH(esound,[ --without-esound Don't compile EsounD driver], if test "x$withval" = "xno"; then MHW_HAVE_ESOUND=no fi ) if test "x$MHW_HAVE_ESOUND" = "xyes" then PKG_CHECK_MODULES(ESOUND,esound >= 0.2.0,MHW_HAVE_ESOUND=yes,MHW_HAVE_ESOUND=no) fi if test "x$MHW_HAVE_ESOUND" = "xyes"; then AC_DEFINE(HAVE_ESOUND,[],[Enable EsounD sound driver]) fi dnl Check for Sun audio MHW_HAVE_SUNAUDIO=yes AC_DEFUN([AC_WITHOUT_SUNAUDIO],[ if test "x$withval" = "xno" ; then MHW_HAVE_SUNAUDIO=no fi ]) AC_ARG_WITH(sun,[ --without-sun Don't compile Sun audio driver],AC_WITHOUT_SUNAUDIO) AC_CHECK_HEADER(sys/audio.h,mhw_found_one=yes,mhw_found_one=no) if test "x$mhw_found_one" = "xno"; then MHW_HAVE_SUNAUDIO=no fi if test "x$MHW_HAVE_SUNAUDIO" = "xyes"; then AC_DEFINE(HAVE_SUN,[],[Enable Sun audio sound driver]) fi dnl Check for aRts C interface MHW_HAVE_ARTSC=yes ARTSC_LIBS="" ARTSC_CFLAGS="" AC_DEFUN([AC_WITHOUT_ARTSC],[ if test "x$withval" = "xno"; then MHW_HAVE_ARTSC=no fi ]) AC_ARG_WITH(arts, [ --without-arts Don't compile aRts driver],AC_WITHOUT_ARTSC) ARTSC_CONFIG=no if test "x$MHW_HAVE_ARTSC" = "xyes"; then AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no) fi if test "x$ARTSC_CONFIG" = "xno"; then MHW_HAVE_ARTSC=no else ARTSC_CFLAGS=`$ARTSC_CONFIG --cflags` ARTSC_LIBS=`$ARTSC_CONFIG --libs` AC_DEFINE(HAVE_ARTSC,[],[Enable aRts driver]) fi AC_SUBST(ARTSC_CFLAGS) AC_SUBST(ARTSC_LIBS) dnl Check for GTK+ AC_DEFUN([AC_DISABLE_GTK2],[ if test "x$enableval" = "xno" ; then DISABLE_GTK2='yes' fi ]) AC_ARG_ENABLE(gtk2, [ --disable-gtk2 Don't use GTK+ 2, use 1.2 instead], AC_DISABLE_GTK2, DISABLE_GTK2='no') dnl Check for GTK+ without gthread FOUND_GTK="no" USES_GTK2="no" if test "x$FOUND_GTK" = "xno"; then if test "x$DISABLE_GTK2" != "xyes"; then AM_PATH_GTK_2_0(2.0.0,USES_GTK2="yes" FOUND_GTK="yes") fi fi if test "x$FOUND_GTK" = "xno"; then AM_PATH_GTK(1.2.5,FOUND_GTK="yes",AC_MSG_ERROR(mhWaveEdit requires GTK+ version 1.2.5 or higher...)) fi dnl Check for gthread if we're using GTK+ 2 dnl Not needed by the app itself, but needed for some aRts versions. GTHREAD_CFLAGS="" GTHREAD_LIBS="" HAVE_GTHREAD="no" if test "x$USES_GTK2" = "xyes"; then HAVE_GTHREAD="yes" PKG_CHECK_MODULES(GTHREAD, gthread-2.0, , HAVE_GTHREAD="no") fi if test "x$HAVE_GTHREAD" = "xyes"; then AC_DEFINE(HAVE_GTHREAD,[],[Defined if Glib thread support is available]) fi AC_SUBST(GTHREAD_CFLAGS) AC_SUBST(GTHREAD_LIBS) dnl Check for large file support AC_SYS_LARGEFILE AC_DEFINE(_LARGEFILE_SOURCE,[],[Defined to get fseeko/ftello prototypes]) AC_CHECK_SIZEOF(off_t) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/time.h time.h sys/ioctl.h sys/types.h unistd.h fcntl.h sched.h libintl.h locale.h]) dnl Ladspa HAVE_LADSPA=yes HAVE_LADSPA_GLOBAL=yes AC_CHECK_HEADER(ladspa.h,,HAVE_LADSPA_GLOBAL=no) AC_ARG_ENABLE(ladspa, [ --disable-ladspa Don't include any Ladspa support], [if test "x$enableval" = "xno"; then HAVE_LADSPA=no; fi]) if test "x$HAVE_LADSPA" = "xyes"; then AC_CHECK_HEADER(dlfcn.h,,HAVE_LADSPA=no) fi if test "x$HAVE_LADSPA" = "xyes"; then AC_CHECK_LIB(dl,dlopen,LIBS="-ldl $LIBS",HAVE_LADSPA=no) fi if test "x$HAVE_LADSPA" = "xyes"; then AC_DEFINE(HAVE_LADSPA,[],[Enable LADSPA support]) fi if test "x$HAVE_LADSPA_GLOBAL" = "xyes"; then AC_DEFINE(HAVE_SYS_LADSPA_H,[],[Use system LADSPA header]) fi dnl Checks for typedefs, structures, and compiler characteristics. AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIGNAL AC_HEADER_TIME AC_HEADER_DIRENT AC_HEADER_SYS_WAIT AC_C_CONST AC_C_VOLATILE dnl Check return type of unsetenv AC_MSG_CHECKING([whether unsetenv returns a value]) HAVE_INT_UNSETENV=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include ],[int i; i = unsetenv("dummy"); return 0;])],HAVE_INT_UNSETENV=yes) if test "x$HAVE_INT_UNSETENV" = "xyes"; then AC_DEFINE(UNSETENV_RETVAL,[],[Defined if unsetenv returns an integer]) fi AC_MSG_RESULT([$HAVE_INT_UNSETENV]) dnl Checks for library functions. AC_FUNC_MEMCMP AC_CHECK_FUNCS([gettimeofday mkdir strerror strtod strtol sched_yield ceill setlocale fseeko ftello lrint lrintf dup2 memchr memmove memset pow putenv select sqrt strchr strrchr strstr strtoul]) AC_FUNC_CLOSEDIR_VOID AC_FUNC_FORK AC_FUNC_SELECT_ARGTYPES AC_FUNC_STAT AC_FUNC_STRTOD dnl Write output AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in m4/Makefile share/Makefile ]) AC_OUTPUT dnl Display configuration echo echo echo "------------------------" echo "mhWaveEdit configuration" echo "------------------------" echo echo "Version: $MHW_VERSION" echo echo "Libraries: " echo -n " GTK+ version: " if test "x$USES_GTK2" = "xyes"; then echo "2.x" else echo "1.2" fi echo " Libsndfile: $HAVE_SNDFILE" echo " Libsamplerate: $HAVE_LIBSAMPLERATE" echo echo "Sound drivers:" INCLUDED_DRIVERS="" EXCLUDED_DRIVERS="" AC_DEFUN([CHECKDRV], [ if test "x$1" = "xyes"; then INCLUDED_DRIVERS="$INCLUDED_DRIVERS $2"; else EXCLUDED_DRIVERS="$EXCLUDED_DRIVERS $2"; fi; ]) CHECKDRV([$HAVE_OSS],[OSS]) CHECKDRV([$HAVE_ALSALIB],[ALSA]) CHECKDRV([$MHW_HAVE_JACK],[JACK]) CHECKDRV([$MHW_HAVE_SUNAUDIO],[Sun]) CHECKDRV([$MHW_HAVE_PORTAUDIO],[PortAudio]) CHECKDRV([$MHW_HAVE_SDL],[SDL]) CHECKDRV([$MHW_HAVE_ESOUND],[EsounD]) CHECKDRV([$MHW_HAVE_ARTSC],[aRts]) CHECKDRV([$MHW_HAVE_PULSE],[PulseAudio]) echo " Included drivers: $INCLUDED_DRIVERS" echo " Drivers not included: $EXCLUDED_DRIVERS" echo -n " Default sound driver: $DEFAULT_DRIVER " if test "x$DEFAULT_DRIVER" = "xauto"; then echo -n "(detect at startup)" fi echo echo echo "Other settings:" echo " LADSPA Support: $HAVE_LADSPA" if test "x$HAVE_LADSPA" = "xyes"; then echo -n " ladspa.h header file: " if test "x$HAVE_LADSPA_GLOBAL" = "xyes"; then echo "system" else echo "local" fi echo " Default plugin path: $DEFAULT_LADSPA_PATH" fi echo -n " Floating-point samples: " if test "x$MHW_DOUBLE" = "xyes"; then echo "double precision" else echo "normal precision" fi echo " Default mixer app: $DEFAULT_MIXERAPP" echo echo "Build settings:" echo -n " Compiler options: " echo $CFLAGS echo " Build date string: ${FIXED_DATE_STR}" echo " Build time string: ${FIXED_TIME_STR}" echo if test "x$USES_GTK2$MHW_HAVE_ARTSC" = "xnoyes"; then echo "---------------------------------------------------------------" echo "WARNING: There are known issues when building with GTK+ 1.2 " echo "and newer versions of aRts. If you are experiencing problems," echo "try running configure with the --without-arts option to disable " echo "aRts support" echo "---------------------------------------------------------------" echo fi echo "Type make (or gmake) to compile mhWaveEdit!"