-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.in
153 lines (122 loc) · 3.32 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
dnl ===========================
dnl === Initialize autoconf ===
dnl ===========================
AC_INIT(Race Into Space,1.0.0,[email protected],raceintospace)
AC_CONFIG_MACRO_DIR([m4])
ACLOCAL="$ACLOCAL -I m4 $ACLOCAL_FLAGS"
dnl ==========================
dnl === Check for programs ===
dnl ==========================
AC_PROG_CC
dnl ===========================
dnl === Check for libraries ===
dnl ===========================
AC_CHECK_LIB(m,main)
dnl Check for SDL
dnl FIXME: what exact version is enough???
AM_PATH_SDL(1.2.0,:,
AC_MSG_ERROR([[*** SDL library is required ***]]))
dnl OGG and friends
XIPH_PATH_OGG(,
AC_MSG_ERROR([[*** Ogg library is required ***]]))
XIPH_PATH_VORBIS(,
AC_MSG_ERROR([[*** Vorbis library is required ***]]))
XIPH_PATH_THEORA(,
AC_MSG_ERROR([[*** Theora library is required ***]]))
dnl ==============================
dnl === Check for header files ===
dnl ==============================
AC_HEADER_DIRENT
dnl =======================
dnl === Check for types ===
dnl =======================
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AX_CREATE_STDINT_H(int_types.h)
dnl ==========================
dnl === Check for compiler ===
dnl ==========================
AC_C_INLINE
AC_C_CONST
AC_C_BIGENDIAN(
AC_DEFINE([__BIG_ENDIAN__], 1,
[Define to 1 if building for big endian machine.]))
dnl ===========================
dnl === Check for functions ===
dnl ===========================
AC_FUNC_MKDIR
AC_CHECK_FUNC(getenv,
AC_DEFINE([HAVE_GETENV], 1,
[Define to 1 if you have the `getenv' function.]))
dnl Probably another approach is to check for higher SDL library version.
save_libs="$LIBS";
save_cflags="$CFLAGS"
LIBS="$SDL_LIBS $LIBS";
CFLAGS="$CFLAGS $SDL_CFLAGS"
AC_MSG_CHECKING([[for SDL_getenv]])
AC_LINK_IFELSE([
AC_LANG_PROGRAM(
[[#include <SDL.h>]],
[[SDL_getenv("HOME")]])],
[
AC_DEFINE([HAVE_SDL_GETENV], 1,
[Define to 1 if you have the `SDL_getenv' function.])
AC_MSG_RESULT(yes)
],
AC_MSG_RESULT(no))
LIBS="$save_libs"
CFLAGS="$save_cflags"
dnl =============================
dnl === Check system services ===
dnl =============================
dnl Get the operating system and version number...
uname=`uname`
dnl cross-compile specific configuration
cross=""
if test "x$cross_compiling" = xyes ; then
cross="${host}-"
case "$host" in
i?86-mingw32msvc)
dnl Windows/CygWin configuration
AC_DEFINE([CONFIG_WIN32], 1,
[Define to 1 if building for win32 platform.])
build_win=yes
;;
*)
dnl Everyone else
dnl PROG_NAME=raceintospace
dnl LIBS="`sdl-config --libs` $LIBS"
;;
esac
fi
AC_SUBST([CROSS], $cross)
dnl XXX: this gives the build configuration, not host configuration!
if test -z "$build_win" ; then
case "$uname" in
Darwin)
dnl Darwin/Mac OS X configuration
AC_DEFINE([CONFIG_MACOSX], 1,
[Define to 1 if building for Mac OS X.])
;;
Linux)
AC_DEFINE([CONFIG_LINUX], 1,
[Define to 1 if building for Linux])
;;
CYGWIN*)
dnl Cygwin
dnl CYGWIN already defines __CYGWIN__
;;
*)
dnl unknown system
;;
esac
fi
dnl =================================
dnl === Write configuration files ===
dnl =================================
AC_CONFIG_HEADER(race.h)
if test -n "$build_win" ; then
AC_CONFIG_FILES(installer.nsi, chmod a-w installer.nsi)
fi
AC_CONFIG_FILES(mkrpm raceintospace.spec, chmod a+x mkrpm)
AC_OUTPUT(Makefile, chmod a-w Makefile race.h)