[go: up one dir, main page]

Menu

[64e628]: / configure.ac  Maximize  Restore  History

Download this file

291 lines (247 with data), 8.4 kB

### Package information
AC_PREREQ(2.61)
AC_INIT(ViLE,0.3.23,basf@vilevn.org)
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE(ViLE,0.3.23)
AC_DEFINE(PACKAGE_LINE,"Deviant","Name of current line")


### Checks for compiler and core header files
AC_PROG_CXX
AC_PROG_CC
AC_HEADER_STDC

#AC_CHECK_HEADER([SDL.h],
#			[AC_DEFINE([INCLUDE_SDL_H],["SDL.h"],[SDL Development libraries])],
#			[AC_CHECK_HEADER([SDL/SDL.h],
#				[AC_DEFINE([INCLUDE_SDL_H],["SDL/SDL.h"],
#					[SDL Development libraries])],
#				[AC_MSG_ERROR([Cannot find SDL headers])],
#				[AC_INCLUDES_DEFAULT])],
#			[AC_INCLUDES_DEFAULT])

#AC_CHECK_HEADER([SDL_gfxPrimitives.h],
#			[AC_DEFINE([INCLUDE_SDL_GFX_H],["SDL_gfxPrimitives.h"],
#				[SDL graphic primitives])],
#			[AC_CHECK_HEADER([SDL/SDL_gfxPrimitives.h],
#				[AC_DEFINE([INCLUDE_SDL_GFX_H],["SDL/SDL_gfxPrimitives.h"],
#					[SDL graphic primitives])],
#				[AC_MSG_ERROR([Cannot find SDL_gfx headers])],
#				[AC_INCLUDES_DEFAULT])],
#			[AC_INCLUDES_DEFAULT])


### Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
AC_FUNC_VPRINTF
AC_CHECK_FUNC([gettimeofday],
			  [AC_DEFINE(HAVE_GETTIMEOFDAY,1,Handles timezone and days)],
			  [AC_MSG_ERROR([Cannot find gettimeofday function])])

AC_CHECK_FUNC([memset],
			  [AC_DEFINE(HAVE_MEMSET,1,Updates blocks of ram)],
			  [AC_MSG_ERROR([Cannot find memset function])])

AC_CHECK_HEADER([wordexp.h],
			  [AC_DEFINE(HAVE_WORDEXP_H,1,Updates blocks of ram)])



### Detect target platform
case "$host" in
	*-*-linux*)
		vile_arch_linux=true
		;;
	*-*-freebsd*)
		vile_arch_freebsd=true
		;;
	*-*-cygwin* | *-*-mingw32*)
		vile_arch_win32=true
		;;
	*)
		AC_MSG_ERROR([*** Invalid host])
		;;
esac

AC_ARG_ENABLE(audio,
		[  --disable-audio         Disable audio capabilities ],
		[ vile_feature_audio="" ],
		[ vile_feature_audio="true" ])

AC_ARG_ENABLE(video,
		[  --disable-video         Disable video capabilities ],
		[ vile_feature_video="" ],
		[ vile_feature_video="true" ])

AC_ARG_ENABLE(crowd,
		[  --disable-crowd         Dont support Crowd titles ],
		[ vile_support_crowd="" ],
		[ vile_support_crowd="true" ])

AC_ARG_ENABLE(ikura,
		[  --disable-ikura         Dont support ikurabased titles ],
		[ vile_support_ikura="" ],
		[ vile_support_ikura="true" ])

AC_ARG_ENABLE(windy,
		[  --disable-windy         Dont support windybased titles ],
		[ vile_support_windy="" ],
		[ vile_support_windy="true" ])

AC_ARG_ENABLE(jast,
		[  --disable-jast          Dont support jast titles ],
		[ vile_support_jast="" ],
		[ vile_support_jast="true" ])

AC_ARG_ENABLE(logging,
		[  --disable-logging       Discard logging information ],
		[ vile_logging_enabled="" ],
		[ vile_logging_enabled="true" ])

AC_ARG_ENABLE(logstd,
		[  --disable-logstd        Do not log to standard output ],
		[ vile_logging_logstd="" ],
		[ vile_logging_logstd="true" ])

AC_ARG_ENABLE(unittest,
		[  --enable-unittest       Enable compiled-in unittesting],
		[ vile_feature_unittest="true" ],
		[ vile_feature_unittest="" ])

AC_ARG_ENABLE(btrace,
		[  --enable-btrace         Enable Blob resource tracking],
		[ vile_feature_btrace="true" ],
		[ vile_feature_btrace="" ])

AC_ARG_ENABLE(efence,
		[  --enable-efence         Enable efence mmalloc debugging (SLOW!)],
		[ vile_feature_efence="true" ],
		[ vile_feature_efence="" ])

AC_ARG_ENABLE(logdirect,
		[  --enable-logdirect      Flush logged information to file ],
		[ vile_logging_logdirect="true" ],
		[ vile_logging_logdirect="" ])

AC_ARG_ENABLE(logdebug,
		[  --enable-logdebug       Enable game debugging features (Slow!) ],
		[ vile_logging_debug="true" ],
		[ vile_logging_debug="" ])



## Record git revision code
AC_PATH_PROG(gitcmd,git)
if test "X$gitcmd" != "X"; then
	AC_MSG_RESULT(Recording current git revision code)
	`$gitcmd rev-parse --short HEAD > scmtest.txt 2>/dev/null`
	if test -e scmtest.txt; then
		if test -s scmtest.txt; then
			mv scmtest.txt scmrevision.txt
		else
			rm scmtest.txt
		fi
	fi
fi
AC_DEFINE_UNQUOTED(SCM_VERSION,["`cat scmrevision.txt`"], "SCM Revision")


### Record compilation date
AC_PATH_PROG(datecmd, date)
if test "X$datecmd" = "X"; then
	AC_DEFINE_UNQUOTED(COMPILATION_DATE,["UNKNOWN"],"Compilation date")
else
	AC_MSG_RESULT(Recording compilation date)
	AC_DEFINE_UNQUOTED(COMPILATION_DATE,["`date`"],"Compilation date")
fi


## Check Features
if test "$vile_feature_audio"
then
	AC_MSG_RESULT(Building with audio features)
	AC_DEFINE(VILE_FEATURE_AUDIO,1,"Building with audio features enabled")
else
	AC_MSG_RESULT(Disabling audio features)
fi
if test "$vile_feature_video"
then
	AC_MSG_RESULT(Building with video features)
	AC_DEFINE(VILE_FEATURE_VIDEO,1,"Building with video features enabled")
else
	AC_MSG_RESULT(Disabling video features)
fi
if test "$vile_feature_unittest"
then
	AC_MSG_RESULT(Building with unittests compiled-in)
	AC_DEFINE(VILE_FEATURE_UNITTEST,1,"Building with unittests enabled")
fi

if test "$vile_feature_btrace"
then
	AC_MSG_RESULT(Building with Blob resource tracking)
	AC_DEFINE(VILE_FEATURE_BTRACE,1,"Building with Blob trace enabled")
fi
if test "$vile_feature_efence"
then
	AC_MSG_RESULT(Building with Electric Fence)
	AC_DEFINE(VILE_FEATURE_EFENCE,1,"Building with Electric Fence enabled")
fi


## Check Support
if test "$vile_support_crowd"
then
	AC_MSG_RESULT(Building with support for Crowd titles)
	AC_DEFINE(VILE_SUPPORT_CROWD,1,"Building with crowd support")
fi
if test "$vile_support_ikura"
then
	AC_MSG_RESULT(Building with support for Ikura GDL titles)
	AC_DEFINE(VILE_SUPPORT_IKURA,1,"Building with ikura support")
fi
if test "$vile_support_windy"
then
	AC_MSG_RESULT(Building with support for Windy titles)
	AC_DEFINE(VILE_SUPPORT_WINDY,1,"Building with windy support")
fi
if test "$vile_support_jast"
then
	AC_MSG_RESULT(Building with support for JAST titles)
	AC_DEFINE(VILE_SUPPORT_JAST,1,"Building with jast support")
fi

## Check debug features
if test "$vile_logging_enabled"
then
	AC_MSG_RESULT(Building with embedded logging information)
	AC_DEFINE(VILE_LOGGING_ENABLED,1,"Build with logging information")
fi
if test "$vile_logging_logstd"
then
	AC_MSG_RESULT(Building with logging to standard output enabled)
	AC_DEFINE(VILE_LOGGING_LOGSTD,1,"Build with logging to standard output")
fi
if test "$vile_logging_logdirect"
then
	AC_MSG_RESULT(Building with logging to flushed file enabled)
	AC_DEFINE(VILE_LOGGING_DIRECT,1,"Build with logging to flushed file")
fi

if test "$vile_logging_debug"
then
	AC_MSG_RESULT(Building with embedded debugging information)
	AC_DEFINE(VILE_LOGGING_DEBUG,1,"Build with debug information")
fi


### Report arch
if test "$vile_arch_linux"
then
	AC_MSG_RESULT(Building Linux targets)
	AC_DEFINE(VILE_ARCH_LINUX,1,"Compile code for a linuxbased target")
fi
if test "$vile_arch_freebsd"
then
	AC_MSG_RESULT(Building FreeBSD targets)
	AC_DEFINE(VILE_ARCH_FREEBSD,1,"Compile code for a BSD based target")
fi
if test "$vile_arch_win32"
then
	AC_MSG_RESULT(Building Windows targets)
	AC_DEFINE(VILE_ARCH_MICROSOFT,1,"Compile code for wintendo")
fi
if test `uname -o` == "Msys"
then
	AC_MSG_RESULT(Building Msys compatible Makefile)
	AC_DEFINE(VILE_USING_MSYS,1,Build a native msys makefile)
fi


### Declare automake macros
AM_CONDITIONAL(VILE_FEATURE_AUDIO,test "$vile_feature_audio")
AM_CONDITIONAL(VILE_FEATURE_VIDEO,test "$vile_feature_video")
AM_CONDITIONAL(VILE_FEATURE_UNITTEST,test "$vile_feature_unittest")
AM_CONDITIONAL(VILE_FEATURE_BTRACE,test "$vile_feature_btrace")
AM_CONDITIONAL(VILE_FEATURE_EFENCE,test "$vile_feature_efence")
AM_CONDITIONAL(VILE_SUPPORT_CROWD,test "$vile_support_crowd")
AM_CONDITIONAL(VILE_SUPPORT_IKURA,test "$vile_support_ikura")
AM_CONDITIONAL(VILE_SUPPORT_WINDY,test "$vile_support_windy")
AM_CONDITIONAL(VILE_SUPPORT_JAST,test "$vile_support_jast")
AM_CONDITIONAL(VILE_LOGGING_ENABLED,test "$vile_logging_enabled")
AM_CONDITIONAL(VILE_LOGGING_LOGSTD,test "$vile_logging_logstd")
AM_CONDITIONAL(VILE_LOGGING_LOGDIRECT,test "$vile_logging_logdirect")
AM_CONDITIONAL(VILE_LOGGING_DEBUG,test "$vile_logging_debug")
AM_CONDITIONAL(VILE_ARCH_LINUX,test "$vile_arch_linux")
AM_CONDITIONAL(VILE_ARCH_FREEBSD,test "$vile_arch_freebsd")
AM_CONDITIONAL(VILE_ARCH_MICROSOFT,test "$vile_arch_win32")
AM_CONDITIONAL(VILE_USING_MSYS,test `uname -o` == "Msys")


# Generate output
AC_CONFIG_HEADER([src/common/config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT