diff options
Diffstat (limited to 'desiredata/src/configure.in')
-rw-r--r-- | desiredata/src/configure.in | 213 |
1 files changed, 213 insertions, 0 deletions
diff --git a/desiredata/src/configure.in b/desiredata/src/configure.in new file mode 100644 index 00000000..752551ec --- /dev/null +++ b/desiredata/src/configure.in @@ -0,0 +1,213 @@ +# This file is part of DesireData +# If you want to build Thomas Grill's devel_0_39, you need to use scons instead. +# +# ./configure is not a source file (not written by someone), it's generated from +# ./configure.in, but it's still put in the CVS and releases so that people don't +# have to have autoconf installed. + +AC_INIT(kernel.c) +AC_SUBST(oss, yes) +AC_SUBST(alsa, yes) +AC_SUBST(jack, yes) +AC_SUBST(portaudio, yes) +AC_SUBST(portmidi, yes) +AC_SUBST(fftw, yes) +AC_SUBST(CPPFLAGS) +AC_SUBST(MORECFLAGS) +AC_SUBST(EXT) +AC_SUBST(USE_DEBUG_CFLAGS, no) +AC_SUBST(AUDIOSRC) +AC_SUBST(MIDISRC) +AC_SUBST(STRIPFLAG) +AC_SUBST(EXTERNTARGET) +AC_SUBST(LIBSUFFIX) +AC_SUBST(LDSOFLAGS) + +dnl Checks for features. +AC_ARG_ENABLE(alsa, [ --enable-oss audio via OSS], alsa=$enableval) +AC_ARG_ENABLE(alsa, [ --enable-alsa audio via ALSA], alsa=$enableval) +AC_ARG_ENABLE(jack, [ --enable-jack audio via JACK], jack=$enableval) +AC_ARG_ENABLE(portaudio,[ --enable-portaudio audio via PortAudio], portaudio=$enableval) +AC_ARG_ENABLE(portmidi, [ --enable-portmidi MIDI via PortMidi], portmidi=$enableval) +AC_ARG_ENABLE(debug, [ --enable-debug debugging support], USE_DEBUG_CFLAGS=$enableval) +AC_ARG_ENABLE(static, [ --enable-static link statically], static=$enableval) +AC_ARG_ENABLE(fftw, [ --enable-fftw use FFTW package], fftw=$enableval) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_CPP + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_HEADER_TIME + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h sys/time.h unistd.h bstring.h) + +dnl Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_TYPE_SIGNAL +AC_FUNC_VPRINTF +AC_CHECK_FUNCS(gettimeofday select socket strerror) +AC_FUNC_ALLOCA + +# audio APIs may accumulate, but there must be only one MIDI API (??) +AUDIOSRC="" +MIDISRC="s_midi_none.c" + +if test `uname -s` = Linux; then + LDFLAGS="-Wl,-export-dynamic " + EXT=pd_linux + LIBSUFFIX=.so + CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD" + MORECFLAGS="-fno-strict-aliasing" + STRIPFLAG=-s + LDSOFLAGS="-shared" +fi + +if test `uname -s` = Darwin; then + LDFLAGS="" + EXT=pd_darwin + LIBSUFFIX=.dylib + CPPFLAGS="-DMACOSX -DUNISTD -I/usr/X11R6/include -DPA_USE_COREAUDIO" + CPPFLAGS=$CPPFLAGS" -DDL_OPEN" # 0.40 + MORECFLAGS="" + STRIPFLAG="" +# LDSOFLAGS="-dylib -bundle -flat_namespace -undefined suppress" +# LDSOFLAGS="-dylib -flat_namespace" +# Charles Turner told me to use this: + LDSOFLAGS="-dynamiclib -Wl,-single_module" + EXTERNTARGET=pd_darwin +### this comes from pd 0.40 +# if test `uname -r` = 7.9.0; then +# CPPFLAGS=$CPPFLAGS" -DMACOSX3" +# EXTERNTARGET=d_ppc +# else +# CPPFLAGS=$CPPFLAGS" -isysroot /Developer/SDKs/MacOSX10.4u.sdk" +# MORECFLAGS=$MORECFLAGS" -arch i386 -arch ppc" +# EXTERNTARGET=d_fat +# LDFLAGS=$LDFLAGS" -arch i386 -arch ppc" +# fi +fi + +if test `uname -s | cut -f1 -d_` = CYGWIN; then + LDFLAGS="-Wl,-export-dynamic " + EXT=pd_linux + LIBSUFFIX=.dll + CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD" + MORECFLAGS="-fno-strict-aliasing" + STRIPFLAG=-s + LDSOFLAGS="-shared" +fi + +if test `uname -m` = x86_64; then + MORECFLAGS=$MORECFLAGS" -fPIC" +fi + +if test "$static" = yes; then LDFLAGS="$LDFLAGS -static"; fi + +dnl Checking for `dlopen' function in -ldl: +AC_CHECK_LIB(dl, dlopen,LDFLAGS="$LDFLAGS -ldl", echo "dynamic link support required" || exit 1) +dnl Checking for `sin' function in -lffm (ffm is the fast math library on the alpha) +AC_CHECK_LIB(ffm, sin,LDFLAGS="$LDFLAGS -lffm") +dnl Checking for `sin' function in -lm: +AC_CHECK_LIB(m, sin,LDFLAGS="$LDFLAGS -lm", echo "math library required" || exit 1) +dnl Checking for `pthread_create' function in -pthread +AC_CHECK_LIB(pthread, pthread_create,LDFLAGS="$LDFLAGS -lpthread", echo "pthreads required" || exit 1) + +if test x$oss = xyes; then + AC_CHECK_HEADER(linux/soundcard.h,oss="yes",oss="no") +fi + +dnl This should be fixed so Pd can use ALSA shared libraries where appropriate. +if test x$alsa = xyes; then + AC_CHECK_LIB(asound,snd_pcm_info,LDFLAGS="$LDFLAGS -lasound" ; alsa="yes",alsa="no") +fi + +if test x$jack = xyes; then + AC_CHECK_LIB(rt,shm_open,LIBS="$LIBS -lrt") + AC_CHECK_LIB(jack,jack_set_xrun_callback,jack=xrun,jack=no) + AC_CHECK_LIB(jack,jack_set_error_function,jack=yes,jack=no) +fi + +dnl This should be fixed so Pd can use ALSA shared libraries where appropriate. +if test x$portaudio = xyes; then + AC_CHECK_LIB(portaudio,Pa_GetDeviceCount,LDFLAGS=$LDFLAGS" -lportaudio" ; portaudio=yes,portaudio=no) +fi + +if test x$portmidi = xyes; then + AC_CHECK_LIB(porttime,Pt_Started ,LDFLAGS=$LDFLAGS" -lporttime") + AC_CHECK_LIB(portmidi,Pm_Initialize,LDFLAGS=$LDFLAGS" -lportmidi" ; portmidi=yes,portmidi=no) +fi + +if test x$USE_DEBUG_CFLAGS = xyes; then + MORECFLAGS=$MORECFLAGS" -O1 -g" +else + MORECFLAGS=$MORECFLAGS" -O3 -funroll-loops -fomit-frame-pointer" +fi + +if test x$oss = xyes; then + AUDIOSRC=$AUDIOSRC" s_audio_oss.c" + MIDISRC="s_midi_oss.c" + CPPFLAGS=$CPPFLAGS" -DUSEAPI_OSS" +fi + +if test x$alsa = xyes; then + # the alsa midi is weird, it needs to have another MIDI module at once, so i put it in "audio" instead. + AUDIOSRC=$AUDIOSRC" s_audio_alsa.c s_audio_alsamm.c s_midi_alsa.c" + CPPFLAGS=$CPPFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA" + LDFLAGS=$LDFLAGS" -lasound" +fi + +if test x$jack = xyes; then + AUDIOSRC=$AUDIOSRC" s_audio_jack.c" + if test x$jack != xno; then + if test `uname -s` = Linux; then + if test x$jack = "xyes"; then LDFLAGS=$LDFLAGS" -lrt -ljack"; fi + if test x$jack = "xrun"; then LDFLAGS=$LDFLAGS" -lrt -ljack"; fi + fi + if test `uname -s` = Darwin; then + LDFLAGS=$LDFLAGS" -framework Jack" # 0.39 + LDFLAGS=$LDFLAGS" -weak_framework Jack" # 0.40 + else + LIBS="$LIBS -ljack" + fi + CPPFLAGS=$CPPFLAGS" -DUSEAPI_JACK" + fi + if test x$jack = "xrun"; then CPPFLAGS=$CPPFLAGS" -DJACK_XRUN"; fi +fi + +if test x$portaudio = xyes; then + CPPFLAGS=$CPPFLAGS" -DUSEAPI_PORTAUDIO -DPA19" + AUDIOSRC=$AUDIOSRC" s_audio_portaudio.c" + if test `uname -s` = Darwin; then + LDFLAGS=$LDFLAGS" -framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework Carbon" + fi +fi + +if test x$portmidi = xyes; then + MIDISRC="s_midi_pm.c" + MIDIFLAGS="-DUSEAPI_PORTMIDI" + if test `uname -s` = Darwin; then + LDFLAGS=$LDFLAGS" -framework CoreMIDI" + fi +fi + +CPPFLAGS=$CPPFLAGS" $MIDIFLAGS" + +if test x$fftw = "xyes"; then + AC_CHECK_LIB(fftw3f, fftwf_forget_wisdom ,LDFLAGS=$LDFLAGS" -lfftw3f",fftw=no) +fi + +AC_C_BIGENDIAN(bigendian=yes,bigendian=no,bigendian=maybe) +if test x$bigendian = "xyes"; then + CPPFLAGS=$CPPFLAGS" -DBIGENDIAN" +fi + +AC_OUTPUT(makefile) + |