annotate configure.in @ 13:582330cfa6e5

Added pkgconfig support
author Jamie Bullock <jamie@postlude.co.uk>
date Mon, 09 Oct 2006 10:10:05 +0000
parents 90b3a3a25d99
children 57c865715619
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@9 30 yes) pd_example=true ;;
jamie@9 31 no) pd_example=false ;;
jamie@4 32 *) AC_MSG_ERROR(bad value ${enableval} for --enable-pd_external) ;;
jamie@9 33 esac],[pd_example=false])
jamie@4 34
jamie@4 35 # libtool version: current:revision:age
jamie@4 36 #
jamie@4 37 # If the library source code has changed at all since the last update, then
jamie@4 38 # increment revision (`c:r:a' becomes `c:r+1:a').
jamie@4 39 #
jamie@4 40 # If any interfaces have been added, removed, or changed since the last update,
jamie@4 41 # increment current, and set revision to 0.
jamie@4 42 #
jamie@4 43 # If any interfaces have been added since the last public release, then
jamie@4 44 # increment age.
jamie@4 45 #
jamie@4 46 # If any interfaces have been removed since the last public release, then set
jamie@4 47 # age to 0.
jamie@1 48 XTRACT_SO_VERSION=0:0:0
jamie@4 49
jamie@9 50 CFLAGS="$CFLAGS -pedantic -ansi"
jamie@9 51 LDFLAGS="$LDFLAGS -lm"
jamie@1 52
jamie@4 53 AC_ARG_WITH(pd_dir,
jamie@4 54 [ --with-pd-dir=path pd header path (default=/usr/local/include) ],
jamie@4 55 [
jamie@7 56 CFLAGS="$CFLAGS -I$withval"
jamie@4 57 echo
jamie@4 58 echo "pd dir is $withval"
jamie@4 59 echo
jamie@4 60 ])
jamie@4 61
jamie@9 62 AC_ARG_WITH(fftw3_dir,
jamie@9 63 [ --with-fftw3-dir=path fftw3 header path (default=/usr/local/include) ],
jamie@9 64 [
jamie@9 65 CFLAGS="$CFLAGS -I$withval"
jamie@9 66 echo
jamie@9 67 echo "fftw3 dir is $withval"
jamie@9 68 echo
jamie@9 69 ])
jamie@9 70
jamie@9 71 dnl Are we building with fftw?
jamie@9 72 #if [[ "$with_vector" = "yes" ]] ; then
jamie@9 73 if [[ "$vector" = "true" ]] ; then
jamie@9 74 LDFLAGS="$LDFLAGS -lfftw3f"
jamie@9 75 AC_DEFINE([BUILD_VECTOR], [1], [Build the vector functions])
jamie@9 76 AC_CHECK_HEADER(fftw3.h, [have_fftw3_hdr=yes ], [
jamie@9 77 have_pd_hdr=no
jamie@9 78 echo
jamie@9 79 echo "no fftw3.h header found. try with option --with-fftw3-dir=/path/to/fftw3/header"
jamie@9 80 echo
jamie@9 81 exit
jamie@9 82 ])
jamie@9 83 fi
jamie@9 84
jamie@9 85 AM_CONDITIONAL(BUILD_VECTOR, test "x${vector}" = 'xtrue')
jamie@9 86
jamie@9 87 dnl Are we building the PD examples?
jamie@9 88 if [[ "$pd_example" = "true" ]] ; then
jamie@9 89 PD_SOURCES="xtract~.c"
jamie@9 90 AC_DEFINE([BUILD_PD_EXAMPLE], [1], [Build the pd example])
jamie@9 91 AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [
jamie@4 92 have_pd_hdr=no
jamie@4 93 echo
jamie@4 94 echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src"
jamie@4 95 echo
jamie@4 96 exit
jamie@4 97 ])
jamie@9 98 dnl At some point we need to support other platforms, and include checks
jamie@9 99 dnl pd_suffix=pd_linux
jamie@9 100 fi
jamie@4 101
jamie@4 102 AM_CONDITIONAL(BUILD_PD_EXAMPLE, test "x${pd_example}" = 'xtrue')
jamie@4 103
jamie@4 104 dnl ------------------------------------------
jamie@4 105 dnl ---- do some magic to gues the host opsys
jamie@4 106 dnl ---- taken from libvorbis configure.in
jamie@4 107 dnl ------------------------------------------
jamie@7 108 dnl AC_CANONICAL_HOST
jamie@4 109
jamie@9 110 dnl AC_SUBST(PD_CFLAGS,"$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1")
jamie@7 111 dnl AC_SUBST(PD_LDFLAGS,"$PD_LDFLAGS -shared")
jamie@7 112 dnl pd_ldflags="$PD_LDFLAGS -L/usr/local/lib -ldl"
jamie@4 113 if test -z "$GCC"; then
jamie@4 114 case $host in
jamie@4 115 *-*-irix*)
jamie@4 116 dnl If we're on IRIX, we wanna use cc even if gcc
jamie@4 117 dnl is there (unless the user has overriden us)...
jamie@4 118 if test -z "$CC"; then
jamie@4 119 CC=cc
jamie@4 120 fi
jamie@4 121 ;;
jamie@4 122 sparc-sun-solaris*)
jamie@4 123 PD_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
jamie@4 124 ;;
jamie@4 125 *)
jamie@4 126 PD_CFLAGS="-O"
jamie@4 127 ;;
jamie@4 128 esac
jamie@4 129 else
jamie@4 130
jamie@4 131 case $host in
jamie@4 132 *86-*-linux*)
jamie@9 133 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 134 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@4 135 dnl we could test for bad glibc here, but don't
jamie@7 136 PD_SUFFIX=pd_linux
jamie@4 137 ;;
jamie@4 138 powerpc-*-linux*)
jamie@9 139 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 "
jamie@4 140 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 141 PD_SUFFIX=pd_linux
jamie@4 142 ;;
jamie@4 143 *-*-linux*)
jamie@9 144 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1 -fPIC"
jamie@4 145 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 146 PD_SUFFIX=pd_linux
jamie@4 147 ;;
jamie@4 148 sparc-sun-*)
jamie@4 149 echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet"
jamie@4 150 ;;
jamie@4 151 *-*-darwin*)
jamie@9 152 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 "
jamie@4 153 PD_LDFLAGS="$PD_LDFLAGS -bundle -undefined suppress -flat_namespace"
jamie@7 154 PD_SUFFIX=pd_darwin
jamie@4 155 ;;
jamie@4 156 *)
jamie@4 157 dnl assume unix
jamie@9 158 PD_CFLAGS="$PD_CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1"
jamie@4 159 PD_LDFLAGS="$PD_LDFLAGS -shared"
jamie@7 160 PD_SUFFIX=pd_linux
jamie@4 161 ;;
jamie@4 162 esac
jamie@4 163 fi
jamie@4 164
jamie@9 165 PD_CFLAGS="$PD_CFLAGS -DPD"
jamie@9 166
jamie@7 167 AC_SUBST(PD_CFLAGS)
jamie@7 168 AC_SUBST(PD_LDFLAGS)
jamie@7 169 AC_SUBST(PD_SUFFIX)
jamie@9 170 AC_SUBST(PD_SOURCES)
jamie@7 171
jamie@13 172 AC_CONFIG_FILES([doc/documentation.doxygen
jamie@13 173 libxtract.pc])
jamie@2 174
jamie@7 175 AC_OUTPUT(Makefile src/Makefile xtract/Makefile doc/Makefile examples/Makefile examples/puredata/Makefile)