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