annotate configure.in @ 26:6417baefffc8

Added help string support, minor fixes.
author Jamie Bullock <jamie@postlude.co.uk>
date Wed, 18 Oct 2006 18:33:09 +0000
parents 5754315fe169
children 43332188a780
rev   line source
jamie@1 1 AC_PREREQ(2.13)
jamie@26 2 # Increment for major API changes, release status changes
jamie@23 3 m4_define(libxtract_major_version, 0)
jamie@23 4 # Increment for feature additions and enhancements
jamie@26 5 m4_define(libxtract_minor_version, 2)
jamie@23 6 # Increment for fixes
jamie@26 7 m4_define(libxtract_fix_version, 0)
jamie@23 8
jamie@23 9 m4_define(libxtract_version, libxtract_major_version.libxtract_minor_version.libxtract_fix_version)
jamie@23 10
jamie@18 11 PACKAGE=libxtract
jamie@18 12
jamie@23 13 AC_INIT(libxtract, libxtract_version, bugs@postlude.co.uk)
jamie@23 14 AC_DEFINE(LIBXTRACT_VERSION, libxtract_version, [LibXtract Version])
jamie@23 15 AM_INIT_AUTOMAKE($PACKAGE, $LIBXTRACT_VERSION)
jamie@1 16 AM_CONFIG_HEADER(config.h)
jamie@1 17 AC_PROG_CC
jamie@17 18 AC_PROG_LIBTOOL
jamie@1 19 AC_PROG_INSTALL
jamie@17 20 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
jamie@1 21 AC_ENABLE_STATIC(no)
jamie@1 22 AC_ENABLE_SHARED(yes)
jamie@1 23 AC_PROG_LIBTOOL
jamie@1 24 #AC_ARG_WITH(fftw, AC_HELP_STRING([--with-vector], [build vector features]),
jamie@1 25 # [ if test $withval = "yes"; then with_vector=yes ;
jamie@1 26 # else with_vector=no ; fi ], with_vector=no)
jamie@1 27
jamie@17 28 AC_CHECK_HEADERS([math.h, stdlib.h, stdio.h])
jamie@2 29 AC_CHECK_PROG([DOXYGEN], [doxygen], [doc], [])
jamie@2 30 AC_SUBST(DOXYGEN)
jamie@1 31
jamie@1 32 AC_ARG_ENABLE(vector,
jamie@1 33 [ --enable-vector Turn fft-based vector processing on],
jamie@1 34 [case "${enableval}" in
jamie@1 35 yes) vector=true ;;
jamie@1 36 no) vector=false ;;
jamie@1 37 *) AC_MSG_ERROR(bad value ${enableval} for --enable-vector) ;;
jamie@1 38 esac],[vector=false])
jamie@1 39
jamie@4 40 AC_ARG_ENABLE(pd_example,
jamie@4 41 [ --enable-pd_example Compile the Pure Data external example],
jamie@4 42 [case "${enableval}" in
jamie@9 43 yes) pd_example=true ;;
jamie@9 44 no) pd_example=false ;;
jamie@4 45 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
jamie@9 46 esac],[pd_example=false])
jamie@4 47
jamie@4 48 # libtool version: current:revision:age
jamie@4 49 #
jamie@4 50 # If the library source code has changed at all since the last update, then
jamie@4 51 # increment revision (`c:r:a' becomes `c:r+1:a').
jamie@4 52 #
jamie@4 53 # If any interfaces have been added, removed, or changed since the last update,
jamie@4 54 # increment current, and set revision to 0.
jamie@4 55 #
jamie@4 56 # If any interfaces have been added since the last public release, then
jamie@4 57 # increment age.
jamie@4 58 #
jamie@4 59 # If any interfaces have been removed since the last public release, then set
jamie@4 60 # age to 0.
jamie@1 61 XTRACT_SO_VERSION=0:0:0
jamie@4 62
jamie@17 63 CFLAGS="$CFLAGS -pedantic -ansi -O3"
jamie@9 64 LDFLAGS="$LDFLAGS -lm"
jamie@1 65
jamie@4 66 AC_ARG_WITH(pd_dir,
jamie@4 67 [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
jamie@4 68 [
jamie@7 69 CFLAGS="$CFLAGS -I$withval"
jamie@4 70 echo
jamie@4 71 echo "pd dir is $withval"
jamie@4 72 echo
jamie@4 73 ])
jamie@4 74
jamie@9 75 AC_ARG_WITH(fftw3_dir,
jamie@9 76 [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ],
jamie@9 77 [
jamie@9 78 CFLAGS="$CFLAGS -I$withval"
jamie@9 79 echo
jamie@9 80 echo "fftw3 dir is $withval"
jamie@9 81 echo
jamie@9 82 ])
jamie@9 83
jamie@9 84 dnl Are we building with fftw?
jamie@9 85 #if [[ "$with_vector" = "yes" ]] ; then
jamie@9 86 if [[ "$vector" = "true" ]] ; then
jamie@9 87 LDFLAGS="$LDFLAGS -lfftw3f"
jamie@9 88 AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions])
jamie@9 89 AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
jamie@9 90 have_pd_hdr=no
jamie@9 91 echo
jamie@9 92 echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header"
jamie@9 93 echo
jamie@9 94 exit
jamie@9 95 ])
jamie@9 96 fi
jamie@9 97
jamie@17 98
jamie@9 99 AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
jamie@9 100
jamie@9 101 dnl Are we building the PD examples?
jamie@9 102 if [[ "$pd_example" = "true" ]] ; then
jamie@9 103 PD_SOURCES="xtract~.c"
jamie@9 104 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@9 105 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@4 106 have_pd_hdr=no
jamie@4 107 echo
jamie@4 108 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@4 109 echo
jamie@4 110 exit
jamie@4 111 ])
jamie@9 112 fi
jamie@4 113
jamie@4 114 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@4 115
jamie@17 116 dnl Enable debugging (no)
jamie@17 117 AC_ARG_ENABLE(debug,
jamie@17 118 [ --enable-debug[[=value]] compile with debug [[default=no]]],
jamie@17 119 with_debug="yes",
jamie@17 120 with_debug="no")
jamie@17 121 if test "$with_debug" = "yes"
jamie@17 122 then
jamie@17 123 AC_DEFINE(DEBUG,1,[Define to enable debug])
jamie@17 124 CFLAGS="-O0 -ggdb -g -pedantic -ansi"
jamie@17 125 fi
jamie@17 126
jamie@4 127 dnl ------------------------------------------
jamie@4 128 dnl ---- do some magic to gues the host opsys
jamie@4 129 dnl ---- taken from libvorbis configure.in
jamie@4 130 dnl ------------------------------------------
jamie@7 131 dnl AC_CANONICAL_HOST
jamie@4 132
jamie@9 133 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@7 134 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@7 135 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@4 136 if test -z "$GCC"; then
jamie@4 137 case $host in
jamie@4 138 *-*-irix*)
jamie@4 139 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@4 140 dnl is there (unless the user has overriden us)...
jamie@4 141 if test -z "$CC"; then
jamie@4 142 CC=cc
jamie@4 143 fi
jamie@4 144 ;;
jamie@4 145 sparc-sun-solaris*)
jamie@4 146 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@4 147 ;;
jamie@4 148 *)
jamie@4 149 PD_CFLAGS="-O"
jamie@4 150 ;;
jamie@4 151 esac
jamie@4 152 else
jamie@4 153
jamie@4 154 case $host in
jamie@4 155 *86-*-linux*)
jamie@17 156 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@17 157 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@4 158 dnl we could test for bad glibc here, but don't
jamie@7 159 PD_SUFFIX=pd_linux
jamie@4 160 ;;
jamie@4 161 powerpc-*-linux*)
jamie@17 162 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@4 163 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 164 PD_SUFFIX=pd_linux
jamie@4 165 ;;
jamie@4 166 *-*-linux*)
jamie@17 167 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -fPIC"
jamie@17 168 PD_LDFLAGS="$PD_LDFLAGS -shared -export_dynamic"
jamie@7 169 PD_SUFFIX=pd_linux
jamie@4 170 ;;
jamie@4 171 sparc-sun-*)
jamie@4 172 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@4 173 ;;
jamie@17 174 *86-*-darwin*)
jamie@17 175 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@17 176 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch i686 -undefined suppress -flat_namespace"
jamie@7 177 PD_SUFFIX=pd_darwin
jamie@17 178 ;;
jamie@17 179 *-*-darwin*)
jamie@17 180 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes"
jamie@17 181 PD_LDFLAGS="$PD_LDFLAGS -bundle -arch ppc -undefined suppress -flat_namespace"
jamie@17 182 PD_SUFFIX=pd_darwin
jamie@17 183 ;;
jamie@17 184
jamie@4 185 *)
jamie@4 186 dnl assume unix
jamie@9 187 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 188 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 189 PD_SUFFIX=pd_linux
jamie@4 190 ;;
jamie@4 191 esac
jamie@4 192 fi
jamie@4 193
jamie@9 194 PD_CFLAGS="$PD_CFLAGS -DPD"
jamie@9 195
jamie@7 196 AC_SUBST(PD_CFLAGS)
jamie@7 197 AC_SUBST(PD_LDFLAGS)
jamie@7 198 AC_SUBST(PD_SUFFIX)
jamie@9 199 AC_SUBST(PD_SOURCES)
jamie@7 200
jamie@13 201 AC_CONFIG_FILES([doc/documentation.doxygen
jamie@13 202 libxtract.pc])
jamie@2 203
jamie@7 204 AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile)
jamie@16 205
jamie@16 206 echo
jamie@16 207 echo "**************************************************************"
jamie@16 208 echo "Summary:"
jamie@16 209
jamie@17 210 echo you are using the ${host} architecture
jamie@16 211
jamie@17 212 if test "$vector" = "true"; then
jamie@16 213 echo "Fftw3: yes (using fftw3f)"
jamie@16 214 else
jamie@17 215 echo "Fftw3: no (not using fftw3, the vector functions will not work)"
jamie@16 216 fi
jamie@17 217 if test "$pd_example" = "true"; then
jamie@16 218 echo "PD external: yes"
jamie@16 219 else
jamie@16 220 echo "PD external: no"
jamie@16 221 fi
jamie@16 222 echo "**************************************************************"
jamie@16 223 echo Configuration completed successfully. Type \'make\' to build ${PACKAGE}
jamie@16 224
jamie@16 225