-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
126 lines (112 loc) · 2.65 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
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
118
119
120
121
122
123
124
125
126
dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)
dnl Detect the canonical target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
AM_INIT_AUTOMAKE(Maelstrom, 3.0.6)
dnl Check for tools
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
dnl The alpha architecture needs special flags for binary portability
case "$target" in
alpha*-*-linux*)
CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
;;
esac
dnl Figure out which math and networking libraries to use
case "$target" in
*-*-mingw32*)
MATHLIB=""
INETLIB="-lwsock32"
;;
*-*-beos*)
MATHLIB=""
INETLIB=""
;;
*-*-darwin*)
MATHLIB=""
INETLIB=""
;;
*)
MATHLIB="-lm"
INETLIB=""
;;
esac
AC_SUBST(MATHLIB)
AC_SUBST(INETLIB)
dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl Check for SDL_net
AC_CHECK_LIB(SDL_net, SDLNet_Init, have_SDL_net=yes)
if test x$have_SDL_net = xyes; then
LIBS="$LIBS -lSDL_net"
else
AC_MSG_ERROR([*** Can't find the SDL_net library
The SDL_net library can be found at:
http://www.devolution.com/~slouken/SDL/projects/SDL_net/
])
fi
dnl Check for RSA checksum authentication
AC_MSG_CHECKING(for RSA checksum authentication)
if test -d $HOME/RSA; then
CFLAGS="$CFLAGS -DUSE_CHECKSUM -I$HOME/RSA/source"
LIBS="$LIBS $HOME/RSA/install/rsaref.a"
use_checksum=yes
else
use_checksum=no
fi
AC_MSG_RESULT($use_checksum)
dnl Add the include directories for the object libraries
CFLAGS="$CFLAGS -I\$(top_srcdir)"
CFLAGS="$CFLAGS -I\$(top_srcdir)/netlogic"
CFLAGS="$CFLAGS -I\$(top_srcdir)/screenlib"
CFLAGS="$CFLAGS -I\$(top_srcdir)/maclib"
dnl Set up the icon object file, for Mingw32
case "$target" in
*-*-mingw32*)
cp ico_o ico.o
ICONOBJ="ico.o"
;;
*)
ICONOBJ=""
;;
esac
AC_SUBST(ICONOBJ)
dnl Set up the game data install directory
case "$target" in
*-*-mingw32*)
GAME_INSTALLDIR="."
ICONOBJ="ico.o"
;;
*-*-beos*)
ac_default_prefix=/boot/beos
GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
;;
*)
GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE"
;;
esac
AC_SUBST(GAME_INSTALLDIR)
CFLAGS="$CFLAGS -DLIBDIR=\\\"$GAME_INSTALLDIR\\\""
dnl C++ flags are the same as the C flags
CXXFLAGS="$CXXFLAGS $CFLAGS"
# Finally create all the generated files
AC_OUTPUT([
Makefile
netlogic/Makefile
screenlib/Makefile
maclib/Makefile
Images/Makefile
Docs/Makefile
Maelstrom.spec
])