dnl Core Wars. dnl Copyright (C) 1999 Walter Hofmann dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License version 2 as dnl published by the Free Software Foundation. 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 Process this file with autoconf to produce a configure script. AC_INIT([CoreWars], [0.9.13], [walterh@gmx.de], [corewars]) AC_PREREQ([2.54]) AC_CONFIG_AUX_DIR([build]) AC_CONFIG_SRCDIR([src/main.h]) AC_PROG_MAKE_SET AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) if test "$CFLAGS"; then CFLAGS_CUSTOM=yes fi dnl Checks for programs. AC_PROG_CC AC_PROG_AWK AC_PROG_YACC AM_PROG_LEX AC_PROG_LN_S COREWARS=corewars AM_PATH_GLIB(1.2.0,,COREWARS=;AC_MSG_ERROR([ ************************************************************************ *** GLIB >= 1.2.0 not installed - cannot build GUI client without it *** ************************************************************************ ])) AM_PATH_GTK(1.2.0,,COREWARS=;AC_MSG_ERROR([ ************************************************************************ *** GTK+ >= 1.2.0 not installed - cannot build GUI client without it *** ************************************************************************ ])) LIBS="$LIBS $GTK_LIBS" GTK_INCLUDE=`gtk-config --cflags` AC_SUBST(INCLUDES) INCLUDES="$INCLUDES $GTK_INCLUDE" dnl Checks for header files. AC_HEADER_DIRENT AC_STDC_HEADERS AC_CHECK_HEADERS(limits.h malloc.h string.h unistd.h) dnl Check for libc >= 2.1 COREWARSCMD= AC_CHECK_HEADERS(argp.h,COREWARSCMD=corewars-cmd,AC_MSG_WARN([ ******************************************************************************** *** glibc >= 2.1 not installed - cannot build command line client without it *** *** (but this is ok if you want the GTK+ client only) *** ******************************************************************************** ])) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. AC_FUNC_ALLOCA AC_CHECK_FUNCS(get_current_dir_name strdup) dnl Select programs AC_SUBST(COREWARS) AC_SUBST(COREWARSCMD) dnl if test -z "$COREWARS"; then dnl if test -z "$COREWARSCMD"; then dnl { echo "configure: error: nothing left that could be built" 1>&2; exit 1; } dnl fi dnl fi dnl Use option --enable-gcc-debug to enable the GCC debug code. AC_ARG_ENABLE(gcc-debug, [ --enable-gcc-debug enable the GCC DEBUG code], [enable_gcc_debug=yes], [enable_gcc_debug=no]) if test "$enable_gcc_debug" = "yes" && (test "$GCC" = "yes"); then if test -z "$CFLAGS_CUSTOM"; then CFLAGS="-Wall -g" else CFLAGS="$CFLAGS -g" fi AC_MSG_RESULT([Enabling GCC DEBUG support...]) else if test -z "$CFLAGS_CUSTOM" && (test "$GCC" = "yes"); then CFLAGS="-O2" fi fi AC_CONFIG_FILES([Makefile programs/Makefile contrib/Makefile doc/Makefile src/Makefile]) AC_OUTPUT dnl EOF