added autoconf support

This commit is contained in:
nehalmistry 2003-05-14 15:35:26 +00:00
parent 1c9ff02c77
commit dbd64aff14
2 changed files with 253 additions and 0 deletions

72
Rules.make.in Normal file
View file

@ -0,0 +1,72 @@
## ___________ _________ _____ __
## \_ _____/______ ____ ____ \_ ___ \____________ _/ ____\/ |_
## | __) \_ __ \_/ __ \_/ __ \/ \ \/\_ __ \__ \ __\ __|
## | \ | | \/\ ___/\ ___/\ \____| | \// __ \| | | |
## \___ / |__| \___ >\___ >\______ /|__| (____ /__| |__|
## \/ \/ \/ \/ \/
## ______________________ ______________________
## T H E W A R B E G I N S
## FreeCraft - A free fantasy real time strategy game engine
##
# Compile commands
CC=gcc
CCLD=gcc
RM=rm -f
MAKE=make
# Prefix for 'make install'
PREFIX=@PREFIX@
# Use SIOD support
CCL = -DUSE_CCL
CCLLIB = -lm
# Video support
VIDEO_CFLAGS = @VIDEO_CFLAGS@
# Compression support
COMP_CFLAGS = -DUSE_ZLIB @BZ2_CFLAGS@ @ZZIPLIB_CFLAGS@
COMP_LIBS = -lz @BZ2_LIBS@ @ZZIPLIB_LIBS@
VERSION= '-DVERSION="1.18"'
TOOLLIBS=$(XLDFLAGS) -lpng -lz -lm @THREAD_LIBS@
FREECRAFT_LIBS= -lpng -lz -lm \
@VIDEO_LIBS@ @THREAD_LIBS@ $(CCLLIB) $(COMP_LIBS) \
$(ARTSCLIB) @FLAC_LIBS@ @OGG_LIBS@ @MAD_LIBS@ @CDAUDIO_LIBS@ \
-lz -lm
DISTLIST=$(TOPDIR)/distlist
TAGS=$(TOPDIR)/src/tags
# Linux
EXE=
OUTFILE=$(TOPDIR)/freecraft
ARCH=linux
OE=o
OBJDIR=obj
IFLAGS= -I$(TOPDIR)/src/include $(XIFLAGS) -I$(TOPDIR)/src/movie/vp31/include
CFLAGS=@PROFILE_CFLAGS@ @DEBUG_CFLAGS@ $(IFLAGS) \
-DUNIT_ON_MAP -DNEW_AI -DUSE_LIBMODPLUG -DUSE_HP_FOR_XP \
@PROFILE_CFLAGS@ @DEBUG_CFLAGS@ @VIDEO_CFLAGS@ @BZ2_CFLAGS@ \
@OGG_CFLAGS@ @MAD_CFLAGS@ @FLAC_CFLAGS@ @CDAUDIO_CFLAGS@ \
$(CCL) $(VERSION) $(COMP_CFLAGS) @SOUND_CFLAGS@ $(ARTSC)
CTAGSFLAGS=-i defptvS -a -f
# Locks versions with a symbolic name
LOCKVER= rcs -q -n$(NAME)
# Source code documentation
DOXYGEN= doxygen
DOCIFY= docify
DOCPP= doc++
%.doc: %.c
@$(TOPDIR)/tools/aledoc $< | $(DOCIFY) > $*-c.doc 2>/dev/null
%.doc: %.h
@$(TOPDIR)/tools/aledoc $< | $(DOCIFY) > $*-h.doc 2>/dev/null

181
configure.in Normal file
View file

@ -0,0 +1,181 @@
AC_INIT(configure.in)
AC_PREREQ([2.50])
dnl AC_CANONICAL_TARGET
echo `uname -a`
AC_CHECK_HEADERS(zlib.h,, AC_MSG_ERROR(could not find zlib.h))
AC_CHECK_HEADERS(png.h,, AC_MSG_ERROR(could not find png.h))
AC_ARG_ENABLE(static,
[ --enable-static Compile a static binary (default: no)])
AC_ARG_ENABLE(profile,
[ --enable-profile Enable profiling support, implies --enable-debug (default: no)])
if test "$enable_profile" != "yes"; then
PROFILE_CFLAGS=""
else
PROFILE_CFLAGS="-pg"
fi
AC_SUBST(PROFILE_CFLAGS)
AC_ARG_ENABLE(debug,
[ --enable-debug [Enable debug, implies --disable-optimization (default: no)]])
if test "$enable_debug" != "yes" -o "$enable_profile" != "yes"; then
DEBUG_CFLAGS=""
else
DEBUG_CFLAGS="-g -O1 -fsigned-char -Wall -Werror -DDEBUG"
fi
AC_SUBST(DEBUG_CFLAGS)
dnl AC_ARG_ENABLE(optimization,
dnl [ --enable-optimization [Enable detection of optimization flags (default: no)]])
dnl FIXME: todo
AC_ARG_WITH(client,
[ --with-client=sdl,x11,svgalib
[Select which client (default: sdl)]])
THREAD_LIBS=
if test "$with_client" = "x11"; then
AC_CHECK_HEADERS(X11/Xlib.h,, AC_MSG_ERROR(could not find X11/Xlib.h))
VIDEO_CFLAGS="-DUSE_X11"
VIDEO_LIBS="-lXext -lX11 -L/usr/X11R6/lib -I/usr/X11R6/include"
THREAD_LIBS="-lpthread"
elif test "$with_client" = "svgalib"; then
VIDEO_CFLAGS="-DUSE_SVGALIB"
VIDEO_LIBS="-lvga"
else
AC_CHECK_HEADERS(SDL/SDL.h,, AC_MSG_ERROR(could not find SDL/SDL.h))
VIDEO_CFLAGS="-DUSE_SDL -DUSE_SDLA `sdl-config --cflags`"
if test "$enable_static" != "yes"; then
VIDEO_LIBS="`sdl-config --libs`"
else
VIDEO_LIBS="`sdl-config --static-libs`"
fi
fi
AC_SUBST(VIDEO_CFLAGS)
AC_SUBST(VIDEO_LIBS)
AC_SUBST(THREAD_LIBS)
dnl --- CHECK FOR BZIP2 --------
AC_ARG_WITH(bzip2,
[ --with-bzip2 [Use bzip2 (default: enabled)]], BZIP2="$with_bzip2",)
if test "$BZIP2" != "no"; then
BZ2_CFLAGS="-DUSE_BZ2LIB"
BZ2_LIBS="-lbz2"
else
BZ2_CFLAGS=""
BZ2_LIBS=""
fi
AC_SUBST(BZ2_CFLAGS)
AC_SUBST(BZ2_LIBS)
dnl ----------------------------
dnl --- CHECK FOR ZZIPLIB ------
AC_ARG_WITH(zziplib,
[ --with-zziplib [Use zziplib (default: disabled)]], ZZIPLIB="$with_zziplib")
if test "$ZZIPLIB" != "yes"; then
ZZIPLIB_CFLAGS=""
ZZIPLIB_LIBS=""
else
ZZIPLIB_CFLAGS="-DUSE_ZZIPLIB"
ZZIPLIB_LIBS="-lzzip"
fi
AC_SUBST(ZZIPLIB_CFLAGS)
AC_SUBST(ZZIPLIB_LIBS)
dnl ----------------------------
dnl --- CHECK FOR WITH SOUND ---
AC_ARG_WITH(sound,
[ --with-sound [Use sound (default: yes)]], SOUND="$with_sound")
SOUND_CFLAGS=
if test "$SOUND" != "no"; then
SOUND_CFLAGS="-DWITH_SOUND"
fi
AC_SUBST(SOUND_CFLAGS)
dnl ----------------------------
dnl --- CHECK FOR OGG VORBIS ---
AC_ARG_WITH(ogg,
[ --with-ogg [Use ogg (default: autodetect)]], OGG="$with_ogg")
OGG_CFLAGS=
OGG_LIBS=
if test "$OGG" != "no"; then
MAD="yes"
AC_CHECK_HEADERS(ogg.h,, OGG=no)
AC_CHECK_HEADERS(vorbis.h,, OGG=no)
if test "$OGG" != "no"; then
OGG_CFLAGS="-DUSE_OGG"
OGG_LIBS="-lvorbisfile -lvorbis -logg"
fi
fi
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
dnl ----------------------------
dnl --- CHECK FOR MAD LIB ------
AC_ARG_WITH(mad,
[ --with-mad [Use mad mp3 (default: autodetect)]], MAD="$with_mad")
MAD_CFLAGS=
MAD_LIBS=
if test "$MAD" != "no"; then
AC_CHECK_HEADERS(mad.h, MAD=yes, MAD=no)
if test "$MAD" != "no"; then
MAD_CFLAGS="-DUSE_MAD"
MAD_LIBS="-lmad"
fi
fi
AC_SUBST(MAD_CFLAGS)
AC_SUBST(MAD_LIBS)
dnl ----------------------------
dnl --- CHECK FOR FLAC LIB -----
AC_ARG_WITH(flac,
[ --with-flac [Use FLAC (default: autodetect)]], FLAC="$with_flac")
dnl if test -z "$MAD
if test "$FLAC" != "no"; then
FLAC_CFLAGS="-DUSE_FLAC"
FLAC_LIBS="-lFLAC"
else
FLAC_CFLAGS=""
FLAC_LIBS=""
fi
AC_SUBST(FLAC_CFLAGS)
AC_SUBST(FLAC_LIBS)
dnl ----------------------------
dnl --- CHECK FOR CDAUDIO ------
AC_ARG_WITH(cdaudio,
[ --with-cdaudio=libcda,sdlcd,cdda,no
[Enable CD Audio support (default: libcda)]], CDAUDIO="$with_cdaudio")
if test "$CDAUDIO" = "sdl"; then
CDAUDIO_CFLAGS="`sdl-config --cflags`"
if test "$enable_static" != "yes"; then
CDAUDIO_LIBS="`sdl-config --libs`"
else
CDAUDIO_LIBS="`sdl-config --static-libs`"
fi
elif test "$CDAUDIO" = "cdda"; then
CDAUDIO_CFLAGS="-DUSE_CDDA"
CDAUDIO_LIBS=""
elif test "$CDAUDIO" = "no"; then
CDAUDIO_CFLAGS=""
CDAUDIO_LIBS=""
else
CDAUDIO_CFLAGS="-DUSE_LIBCDA"
CDAUDIO_LIBS=""
fi
AC_SUBST(CDAUDIO_CFLAGS)
AC_SUBST(CDAUDIO_LIBS)
dnl ----------------------------
if test "$prefix" = "NONE"; then
PREFIX=/usr/local
else
PREFIX="$prefix"
fi
AC_SUBST(PREFIX)
AC_OUTPUT(Rules.make)