File: configure.in

package info (click to toggle)
tworld 1.3.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,600 kB
  • ctags: 1,403
  • sloc: ansic: 12,442; perl: 2,465; makefile: 165; sh: 9
file content (89 lines) | stat: -rw-r--r-- 1,990 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
dnl
dnl	configure.in script for Tile World
dnl

AC_INIT(tworld.c)

test -z "$CC" && CC="gcc"
test -z "$CFLAGS" && CFLAGS=" -Wall -W -O2 -fomit-frame-pointer -DNDEBUG"
test -z "$LDFLAGS" && LDFLAGS=" -Wall -W -s"

dnl
dnl	--with-debug turns on debugging options
dnl

AC_ARG_WITH(debug,
	    [  --with-debug            Build with debugging info],
	    [if test $withval = yes ; then
	       CFLAGS=" -Wall -W -ggdb"
	       LDFLAGS=" -Wall -W -ggdb"
	     fi])

LOADLIBES=""
OSHWCFLAGS=$CFLAGS
sharedir='${datadir}/tworld'
otherobjs=""

dnl
dnl	--with-sharedir=DIR overrides default value of $datadir/tworld
dnl	for the shared data directory.
dnl

AC_ARG_WITH(sharedir,
	    [  --with-sharedir=DIR     Explicitly set the shared data directory],
	    [sharedir=$withval])

dnl
dnl	--with-sdl selects SDL as the OS/hardware layer.
dnl	(Currently this is the only OS/hardware layer option.)
dnl

OSHWDIR="sdl"

AC_ARG_WITH(sdl,
	    [  --with-sdl              Build SDL version (default)],
	    [if test $withval = yes ; then
	       OSHWDIR="sdl"
	     fi])

if test -d "oshw-$OSHWDIR" ; then
  echo using $OSHWDIR for OS/hardware layer ...
  rm -f oshw
  ln -s oshw-$OSHWDIR oshw
else
  AC_MSG_ERROR([OS/hardware layer "$OSHWDIR" not available])
fi

if test "$OSHWDIR" = "sdl" ; then
  AC_CHECK_PROG(sdlpresent, sdl-config, yes, no)
  if test -z "$sdlpresent" ; then
    AC_MSG_ERROR([SDL installation not found.])
  fi
  OSHWCFLAGS=$OSHWCFLAGS' $(shell sdl-config --cflags)'
  LOADLIBES=$LOADLIBES' $(shell sdl-config --libs)'
fi

dnl
dnl	--with-win32 puts some Windows-specific lines in the Makefile
dnl

AC_ARG_WITH(win32,
	    [  --with-win32            Set defaults for a windows build],
	    [if test $withval = yes ; then
	       sharedir="."
	       otherobjs=" tworldres.o"
	     fi])

dnl
dnl	Done with processing.
dnl

AC_SUBST(CC)
AC_SUBST(CFLAGS)
AC_SUBST(OSHWCFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LOADLIBES)
AC_SUBST(sharedir)
AC_SUBST(otherobjs)

AC_OUTPUT(Makefile oshw/Makefile)