annotate configure.in @ 7:0a461b85bbb9

Fixed automake variable substitution issues
author Jamie Bullock <jamie@postlude.co.uk>
date Fri, 06 Oct 2006 07:57:56 +0000
parents 46efa5536d04
children 90b3a3a25d99
rev   line source
jamie@1 1 AC_PREREQ(2.13)
jamie@4 2 AC_INIT([libxtract], [0.11], [bugs@postlude.co.uk])
jamie@1 3
jamie@1 4 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
jamie@1 5 AM_CONFIG_HEADER(config.h)
jamie@1 6 AC_PROG_CC
jamie@1 7 AC_PROG_INSTALL
jamie@1 8 AC_ENABLE_STATIC(no)
jamie@1 9 AC_ENABLE_SHARED(yes)
jamie@1 10 AC_PROG_LIBTOOL
jamie@1 11 #AC_ARG_WITH(fftw, AC_HELP_STRING([--with-vector], [build vector features]),
jamie@1 12 # [ if test $withval = "yes"; then with_vector=yes ;
jamie@1 13 # else with_vector=no ; fi ], with_vector=no)
jamie@1 14
jamie@1 15 AC_CHECK_HEADERS([math.h])
jamie@2 16 AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], [])
jamie@2 17 AC_SUBST(DOXYGEN)
jamie@1 18
jamie@1 19 AC_ARG_ENABLE(vector,
jamie@1 20 [ --enable-vector Turn fft-based vector processing on],
jamie@1 21 [case "${enableval}" in
jamie@1 22 yes) vector=true ;;
jamie@1 23 no) vector=false ;;
jamie@1 24 *) AC_MSG_ERROR(bad value ${enableval} for --enable-vector) ;;
jamie@1 25 esac],[vector=false])
jamie@1 26
jamie@4 27 AC_ARG_ENABLE(pd_example,
jamie@4 28 [ --enable-pd_example Compile the Pure Data external example],
jamie@4 29 [case "${enableval}" in
jamie@4 30 yes) vector=true ;;
jamie@4 31 no) vector=false ;;
jamie@4 32 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
jamie@4 33 esac],[vector=false])
jamie@4 34
jamie@4 35
jamie@4 36
jamie@4 37 # libtool version: current:revision:age
jamie@4 38 #
jamie@4 39 # If the library source code has changed at all since the last update, then
jamie@4 40 # increment revision (`c:r:a' becomes `c:r+1:a').
jamie@4 41 #
jamie@4 42 # If any interfaces have been added, removed, or changed since the last update,
jamie@4 43 # increment current, and set revision to 0.
jamie@4 44 #
jamie@4 45 # If any interfaces have been added since the last public release, then
jamie@4 46 # increment age.
jamie@4 47 #
jamie@4 48 # If any interfaces have been removed since the last public release, then set
jamie@4 49 # age to 0.
jamie@1 50 XTRACT_SO_VERSION=0:0:0
jamie@4 51
jamie@1 52 CFLAGS="-pedantic -ansi"
jamie@1 53 LDFLAGS="-lm"
jamie@1 54
jamie@1 55 dnl Are we building with fftw?
jamie@1 56 #if [[ "$with_vector" = "yes" ]] ; then
jamie@1 57 if [[ "$vector" = "true" ]] ; then
jamie@1 58 LDFLAGS="$LDFLAGS -lfftw3f"
jamie@1 59 AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions])
jamie@1 60 fi
jamie@1 61
jamie@1 62 AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
jamie@1 63
jamie@4 64 if [[ "$pd_example" = "true" ]] ; then
jamie@4 65 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@4 66 dnl At some point we need to support other platforms, and include checks
jamie@4 67 pd_suffix=pd_linux
jamie@4 68 fi
jamie@4 69
jamie@4 70 dnl ------------------------------------------
jamie@4 71 dnl ---- add PureData includes dir
jamie@4 72 dnl ---- usually /usr/local/include
jamie@4 73 dnl ------------------------------------------
jamie@4 74 AC_ARG_WITH(pd_dir,
jamie@4 75 [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
jamie@4 76 [
jamie@7 77 CFLAGS="$CFLAGS -I$withval"
jamie@4 78 echo
jamie@4 79 echo "pd dir is $withval"
jamie@4 80 echo
jamie@4 81 ])
jamie@4 82
jamie@4 83 dnl ------------------------------------------
jamie@4 84 dnl ---- check for PureData Header
jamie@4 85 dnl ------------------------------------------
jamie@4 86 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@4 87 have_pd_hdr=no
jamie@4 88 echo
jamie@4 89 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@4 90 echo
jamie@4 91 exit
jamie@4 92 ])
jamie@4 93
jamie@4 94 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@4 95
jamie@4 96 dnl ------------------------------------------
jamie@4 97 dnl ---- do some magic to gues the host opsys
jamie@4 98 dnl ---- taken from libvorbis configure.in
jamie@4 99 dnl ------------------------------------------
jamie@7 100 dnl AC_CANONICAL_HOST
jamie@4 101
jamie@7 102 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@7 103 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@7 104 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@4 105 if test -z "$GCC"; then
jamie@4 106 case $host in
jamie@4 107 *-*-irix*)
jamie@4 108 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@4 109 dnl is there (unless the user has overriden us)...
jamie@4 110 if test -z "$CC"; then
jamie@4 111 CC=cc
jamie@4 112 fi
jamie@4 113 ;;
jamie@4 114 sparc-sun-solaris*)
jamie@4 115 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@4 116 ;;
jamie@4 117 *)
jamie@4 118 PD_CFLAGS="-O"
jamie@4 119 ;;
jamie@4 120 esac
jamie@4 121 else
jamie@4 122
jamie@4 123 case $host in
jamie@4 124 *86-*-linux*)
jamie@7 125 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 126 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@4 127 dnl we could test for bad glibc here, but don't
jamie@7 128 PD_SUFFIX=pd_linux
jamie@4 129 ;;
jamie@4 130 powerpc-*-linux*)
jamie@7 131 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 "
jamie@4 132 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 133 PD_SUFFIX=pd_linux
jamie@4 134 ;;
jamie@4 135 *-*-linux*)
jamie@7 136 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC"
jamie@4 137 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 138 PD_SUFFIX=pd_linux
jamie@4 139 ;;
jamie@4 140 sparc-sun-*)
jamie@4 141 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@4 142 ;;
jamie@4 143 *-*-darwin*)
jamie@7 144 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 "
jamie@4 145 PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace"
jamie@7 146 PD_SUFFIX=pd_darwin
jamie@4 147 ;;
jamie@4 148 *)
jamie@4 149 dnl assume unix
jamie@7 150 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wno-deprecated -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 151 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 152 PD_SUFFIX=pd_linux
jamie@4 153 ;;
jamie@4 154 esac
jamie@4 155 fi
jamie@4 156
jamie@7 157 AC_SUBST(PD_CFLAGS)
jamie@7 158 AC_SUBST(PD_LDFLAGS)
jamie@7 159 AC_SUBST(PD_SUFFIX)
jamie@7 160
jamie@2 161 AC_CONFIG_FILES([doc/documentation.doxygen])
jamie@2 162
jamie@7 163 AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile)