cannam@85: dnl -*- m4 -*- cannam@85: dnl cannam@85: dnl libid3tag - ID3 tag manipulation library cannam@85: dnl Copyright (C) 2000-2004 Underbit Technologies, Inc. cannam@85: dnl cannam@85: dnl This program is free software; you can redistribute it and/or modify cannam@85: dnl it under the terms of the GNU General Public License as published by cannam@85: dnl the Free Software Foundation; either version 2 of the License, or cannam@85: dnl (at your option) any later version. cannam@85: dnl cannam@85: dnl This program is distributed in the hope that it will be useful, cannam@85: dnl but WITHOUT ANY WARRANTY; without even the implied warranty of cannam@85: dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the cannam@85: dnl GNU General Public License for more details. cannam@85: dnl cannam@85: dnl You should have received a copy of the GNU General Public License cannam@85: dnl along with this program; if not, write to the Free Software cannam@85: dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA cannam@85: dnl cannam@85: AC_REVISION([$Id: configure.ac,v 1.12 2004/01/23 23:22:46 rob Exp $])dnl cannam@85: cannam@85: dnl Process this file with autoconf to produce a configure script. cannam@85: cannam@85: AC_INIT([ID3 Tag], [0.15.1b], [support@underbit.com], [libid3tag]) cannam@85: AC_PREREQ(2.53) cannam@85: cannam@85: AC_CONFIG_SRCDIR([id3tag.h]) cannam@85: cannam@85: AM_INIT_AUTOMAKE cannam@85: cannam@85: AM_CONFIG_HEADER([config.h]) cannam@85: cannam@85: dnl System type. cannam@85: cannam@85: AC_CANONICAL_HOST cannam@85: cannam@85: dnl Checks for programs. cannam@85: cannam@85: AC_PROG_CC cannam@85: cannam@85: if test "$GCC" = yes cannam@85: then cannam@85: case "$host" in cannam@85: *-*-mingw*) cannam@85: case "$build" in cannam@85: *-*-cygwin*) cannam@85: CPPFLAGS="$CPPFLAGS -mno-cygwin" cannam@85: LDFLAGS="$LDFLAGS -mno-cygwin" cannam@85: ;; cannam@85: esac cannam@85: esac cannam@85: cannam@85: dnl case "$host" in cannam@85: dnl *-*-cygwin* | *-*-mingw*) cannam@85: dnl LDFLAGS="$LDFLAGS -no-undefined -mdll" cannam@85: dnl ;; cannam@85: dnl esac cannam@85: fi cannam@85: cannam@85: dnl Support for libtool. cannam@85: cannam@85: dnl AC_DISABLE_SHARED cannam@85: dnl AC_LIBTOOL_WIN32_DLL cannam@85: AC_PROG_LIBTOOL cannam@85: cannam@85: AC_SUBST(LIBTOOL_DEPS) cannam@85: cannam@85: dnl Compiler options. cannam@85: cannam@85: arch="" cannam@85: debug="" cannam@85: optimize="" cannam@85: profile="" cannam@85: cannam@85: set -- $CFLAGS cannam@85: CFLAGS="" cannam@85: cannam@85: if test "$GCC" = yes cannam@85: then cannam@85: CFLAGS="-Wall" cannam@85: fi cannam@85: cannam@85: while test $# -gt 0 cannam@85: do cannam@85: case "$1" in cannam@85: -Wall) cannam@85: if test "$GCC" = yes cannam@85: then cannam@85: : cannam@85: else cannam@85: CFLAGS="$CFLAGS $1" cannam@85: fi cannam@85: shift cannam@85: ;; cannam@85: -g) cannam@85: debug="-g" cannam@85: shift cannam@85: ;; cannam@85: -mno-cygwin) cannam@85: shift cannam@85: ;; cannam@85: -m*) cannam@85: arch="$arch $1" cannam@85: shift cannam@85: ;; cannam@85: -fomit-frame-pointer) cannam@85: shift cannam@85: ;; cannam@85: -O*|-f*) cannam@85: optimize="$1" cannam@85: shift cannam@85: ;; cannam@85: *) cannam@85: CFLAGS="$CFLAGS $1" cannam@85: shift cannam@85: ;; cannam@85: esac cannam@85: done cannam@85: cannam@85: dnl Checks for header files. cannam@85: cannam@85: AC_HEADER_STDC cannam@85: AC_CHECK_HEADERS(assert.h unistd.h) cannam@85: cannam@85: AC_CHECK_HEADER(zlib.h, [], [ cannam@85: AC_MSG_ERROR([zlib.h was not found cannam@85: *** You must first install zlib (libz) before you can build this package. cannam@85: *** If zlib is already installed, you may need to use the CPPFLAGS cannam@85: *** environment variable to specify its installed location, e.g. -I.]) cannam@85: ]) cannam@85: cannam@85: dnl Checks for typedefs, structures, and compiler characteristics. cannam@85: cannam@85: AC_C_CONST cannam@85: AC_C_INLINE cannam@85: cannam@85: dnl Checks for library functions. cannam@85: cannam@85: AC_CHECK_FUNCS(ftruncate) cannam@85: cannam@85: AC_CHECK_LIB(z, compress2, [], [ cannam@85: AC_MSG_ERROR([libz was not found cannam@85: *** You must first install zlib (libz) before you can build this package. cannam@85: *** If zlib is already installed, you may need to use the LDFLAGS cannam@85: *** environment variable to specify its installed location, e.g. -L.]) cannam@85: ]) cannam@85: cannam@85: dnl handle --enable and --disable options cannam@85: cannam@85: AC_CACHE_SAVE cannam@85: cannam@85: AC_MSG_CHECKING([whether to enable profiling]) cannam@85: AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling], cannam@85: [generate profiling code]), cannam@85: [ cannam@85: case "$enableval" in cannam@85: yes) profile="-pg" ;; cannam@85: esac cannam@85: ]) cannam@85: AC_MSG_RESULT(${enable_profiling-no}) cannam@85: cannam@85: AC_MSG_CHECKING([whether to enable debugging]) cannam@85: AC_ARG_ENABLE(debugging, AC_HELP_STRING([--enable-debugging], cannam@85: [enable diagnostic debugging support]) cannam@85: AC_HELP_STRING([--disable-debugging], cannam@85: [do not enable debugging and use more optimization]), cannam@85: [ cannam@85: case "$enableval" in cannam@85: yes) cannam@85: AC_DEFINE(DEBUG, 1, cannam@85: [Define to enable diagnostic debugging support.]) cannam@85: optimize="" cannam@85: ;; cannam@85: no) cannam@85: if test -n "$profile" cannam@85: then cannam@85: AC_MSG_ERROR(--enable-profiling and --disable-debugging are incompatible) cannam@85: fi cannam@85: cannam@85: AC_DEFINE(NDEBUG, 1, cannam@85: [Define to disable debugging assertions.]) cannam@85: debug="" cannam@85: if test "$GCC" = yes cannam@85: then cannam@85: optimize="$optimize -fomit-frame-pointer" cannam@85: fi cannam@85: ;; cannam@85: esac cannam@85: ]) cannam@85: AC_MSG_RESULT(${enable_debugging-default}) cannam@85: AM_CONDITIONAL(DEBUG, test ${enable_debugging-default} = yes) cannam@85: cannam@85: dnl Create output files. cannam@85: cannam@85: test -n "$arch" && CFLAGS="$CFLAGS $arch" cannam@85: test -n "$debug" && CFLAGS="$CFLAGS $debug" cannam@85: test -n "$optimize" && CFLAGS="$CFLAGS $optimize" cannam@85: test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile" cannam@85: cannam@85: dnl LTLIBOBJS=`echo "$LIBOBJS" | sed -e 's/\.o/.lo/g'` cannam@85: dnl AC_SUBST(LTLIBOBJS) cannam@85: cannam@85: AC_CONFIG_FILES([Makefile msvc++/Makefile \ cannam@85: libid3tag.list]) cannam@85: AC_OUTPUT