-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
74 lines (61 loc) · 1.88 KB
/
configure.in
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
######## Process this file with autoconf to produce a configure script.
dnl
AC_PREREQ(2.13)
AC_INIT(README)
AM_INIT_AUTOMAKE(velatron, 0.0.4)
SDL_VERSION=1.1.5
######## Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
######## Check for tools
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
######## Check for compiler environment
AC_C_CONST
######## Figure out which math library to use
case "$target" in
*-*-mingw32*)
LIBS="$LIBS -lwsock32"
MATHLIB=""
;;
*-*-beos*)
MATHLIB=""
;;
*)
MATHLIB="-lm"
;;
esac
AC_SUBST(MATHLIB)
######## Check for SDL
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
######## Just some defs to speed up my cross compiling
#CFLAGS="$CFLAGS -I/usr/cross-tools/include"
######## Check for headers
AC_CHECK_HEADERS(png.h, , AC_MSG_ERROR(Your system is missing png.h! You will probably have to install the png-devel package))
AC_CHECK_HEADERS(zlib.h, , AC_MSG_ERROR(Your system is missing zlib.h! You will probably have to install the zlib-devel package))
AC_CHECK_HEADERS(math.h, , AC_MSG_ERROR(Your system is missing math.h! ))
######## Check for other libs
AC_CHECK_LIB(z, main, , AC_MSG_ERROR(Your system is missing libz!))
AC_CHECK_LIB(m, main, , AC_MSG_ERROR(Your system is missing libm!))
AC_CHECK_LIB(png, main, , AC_MSG_ERROR(Your system is missing libpng!))
AC_CHECK_LIB(SDL_mixer, main, SOUND="-lSDL_mixer";CFLAGS="$CFLAGS -DUSE_SOUND", , SDL)
#if $MIXER_INCLUDED; then
# SOUND="-lSDL_mixer -Imixer"
# CFLAGS="$CFLAGS -DUSE_SOUND -Imixer";
#fi
######## Set compiler flags and libraries
CFLAGS="$CFLAGS $SDL_CFLAGS -DDATADIR=\"\\\"$datadir/castle-combat\\\"\" -Wall"
#LIBS="$SDL_LIBS -lSDL_net -lSDL -lm $LIBS"
LIBS="$SDL_LIBS -lSDL -lSDL_image -lSDL_gfx $LIBS"
AC_SUBST(SOUND)
######## Finally create all the generated files
AC_OUTPUT([
Makefile
src/Makefile
data/Makefile
])