File: configure.ac

package info (click to toggle)
scorched3d 43.3.d%2Bdfsg-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 172,408 kB
  • ctags: 28,584
  • sloc: cpp: 135,481; xml: 77,266; ansic: 20,630; sh: 3,182; perl: 541; java: 209; makefile: 189; python: 188; sql: 146
file content (117 lines) | stat: -rw-r--r-- 2,964 bytes parent folder | download | duplicates (5)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
dnl Process this file with autoconf to produce a configure script.

AC_INIT(README)
AC_CANONICAL_TARGET([]) 

dnl Setup for automake
AM_INIT_AUTOMAKE(scorched3d, 43)

dnl Check for tools
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB

LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -L/usr/X11R6"
CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include -I/usr/X11R6"

if test `uname` == Darwin; then
LDFLAGS="$LDFLAGS -lmx"
CPPFLAGS="$CPPFLAGS -DFFTW_USE_DOUBLE -D__DARWIN__ -D__MACOSX__"
else
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fi

AC_CHECK_LIB(fridge, beer, echo "Hmm?!",[
	echo "Warning: No beer found in fridge!";
	echo "We highly suggest that you rectify this situation immediately."
])

AC_ARG_ENABLE(serveronly, 
	[  --enable-serveronly Enable server only compilation],
		    , enable_serveronly=no,
		    enable_serveronly=yes)

# Include the other configuration files
if test "x$enable_serveronly" = "xno" ; then
m4_include([configure-gl.m4])
m4_include([configure-al.m4])
m4_include([configure-wx.m4])
m4_include([configure-ogg.m4])
m4_include([configure-ft.m4])
m4_include([configure-fftw.m4])
S3D_SUBDIRS="launcher client server"
else
S3D_SUBDIRS="server"
fi
m4_include([configure-sdl.m4])
m4_include([configure-flt.m4])
m4_include([configure-sql.m4])

AC_SUBST(S3D_SUBDIRS)

dnl Checks for Profiling
AC_MSG_CHECKING(for profiling enabled)
AC_ARG_ENABLE(profiling, 
	[  --enable-profiling    Enable gprof code profiling],
		    , enable_profiling=no,
		    enable_profiling=yes)
if test "x$enable_profiling" = "xyes" ; then
	LIBS="$LIBS -pg"
	CFLAGS="$CFLAGS -pg"
	CPPFLAGS="$CPPFLAGS -pg"
	CXXFLAGS="$CXXFLAGS -pg"
fi
AC_MSG_RESULT($enable_profiling)

# Check for extra functions
AC_CHECK_FUNCS(vsnprintf snprintf vasprintf asprintf iconv)

# Check for extra headers
AC_CHECK_HEADERS(unistd.h iconv.h)

# FIXEME
dnl Checking for Zlib Png Jpeg
if test `uname` == Darwin; then
LIBS="$LIBS /usr/local/lib/libexpat.a -lz -framework UnixImageIO"
else
LIBS="$LIBS -lexpat -lz -lpng -ljpeg"
fi

# Directory setup stuff
dnl --with-docdir
AC_ARG_WITH(docdir,
	AC_HELP_STRING([--with-docdir=DIR],
	[Use DIR to store documentation files (default DATADIR)]),
	[with_docdir=$withval])
if test "x$with_docdir" = "x" ; then
	docdir='${datadir}/documentation'
else
	docdir=$with_docdir
fi
AC_SUBST(docdir)

AC_PREFIX_DEFAULT(/usr/local/games/scorched3d)
if test `uname` == Darwin; then
prefix=./
fi

CFLAGS="$CFLAGS -DS3D_DOCDIR=\\\"${docdir}\\\" -DS3D_DATADIR=\\\"${datadir}\\\" -DS3D_BINDIR=\\\"${bindir}\\\""
CXXFLAGS="$CXXFLAGS -DS3D_DOCDIR=\\\"${docdir}\\\" -DS3D_DATADIR=\\\"${datadir}\\\" -DS3D_BINDIR=\\\"${bindir}\\\""

# put here at end because of sdl.m4 not defining
AC_LANG_CPLUSPLUS

# Finally create all the generated files
AC_OUTPUT([
Makefile
src/Makefile
src/launcher/Makefile
src/launcher/scorched/Makefile
src/client/Makefile
src/client/scorchedc/Makefile
src/server/Makefile
src/server/scorcheds/Makefile
])