dnl Process this file with autoconf to produce a configure script. dnl Copyright (c) 1999-2004 Philip Kendall dnl $Id: configure.in,v 1.35.2.3 2007/05/11 07:04:59 pak21 Exp $ dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl dnl Author contact information: dnl dnl E-mail: philip-fuse@shadowmagic.org.uk AC_INIT(libspectrum.c) AM_CONFIG_HEADER(config.h) dnl Use automake to produce `Makefile.in' AM_INIT_AUTOMAKE(libspectrum, 0.3.0.1) dnl Checks for programs. AC_PROG_CC dnl Setup for compiling build tools (make-perl) AC_MSG_CHECKING([for a C compiler for build tools]) if test $cross_compiling = yes; then AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) else CC_FOR_BUILD=$CC fi AC_MSG_RESULT([$CC_FOR_BUILD]) AC_SUBST(CC_FOR_BUILD) AM_PROG_LIBTOOL AC_PATH_PROG(PERL, perl) AC_SUBST(PERL) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(stdint.h strings.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Check for big endianness AC_C_BIGENDIAN dnl Check for functions AC_CHECK_FUNCS(_snprintf _stricmp _strnicmp snprintf strcasecmp strncasecmp) dnl Allow the user to say that various libraries are in one place AC_ARG_WITH(local-prefix, [ --with-local-prefix=PFX local libraries installed in PFX (optional)], CPPFLAGS="$CPPFLAGS -I$withval/include"; LDFLAGS="$LDFLAGS -L$withval/lib", if test "$prefix" != "NONE"; then CPPFLAGS="$CPPFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib" fi) dnl Check for zlib (the UNIX version is called z, Win32 zdll) AC_CHECK_HEADERS( zlib.h, AC_SEARCH_LIBS(compress2, z zdll) ) dnl Check for libgcrypt AC_CHECK_HEADERS(gcrypt.h,LIBS="$LIBS -lgcrypt") dnl Check for libbz2 1.0 or greater AC_CHECK_HEADER( bzlib.h, AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) ) dnl Either find glib or use the replacement AC_MSG_CHECKING(whether to use glib) AC_ARG_WITH(glib, [ --without-glib don't use glib], if test "$withval" = no; then glib=no; else glib=yes; fi, glib=yes) AC_MSG_RESULT($glib) if test "$glib" = yes; then glib2=no AM_PATH_GLIB_2_0( 2.0.0, glib2=yes AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]) LIBS="$LIBS `pkg-config --libs glib-2.0`", ) if test "$glib2" = no; then AM_PATH_GLIB( 1.2.0, AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]) LIBS="$LIBS `glib-config --libs`", AC_MSG_WARN(glib not found - using internal replacement) ) fi fi dnl If it appears we're using gcc as our compiler, turn on warnings if test "$ac_cv_prog_gcc" = yes; then CFLAGS="$CFLAGS -Wall" dnl And possibly lots of warnings AC_MSG_CHECKING(whether lots of warnings requested) AC_ARG_ENABLE(warnings, [ --enable-warnings give lots of warnings if using gcc], if test "$enableval" = yes; then warnings=yes; else warnings=no; fi, warnings=no) AC_MSG_RESULT($warnings) if test "$warnings" = yes; then CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -W -Wsign-compare" fi fi AC_OUTPUT( Makefile doc/Makefile hacking/Makefile libspectrum.qpg myglib/Makefile )