-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathconfigure.ac
110 lines (90 loc) · 2.97 KB
/
configure.ac
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
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([yatc],[0.3.3SVN])
AC_CONFIG_SRCDIR([spritesdl.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_REVISION($Revision: 1.0 $)
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
AC_ARG_ENABLE(debug, [ --enable-debug enable debug], [
DEBUG_FLAGS=-DDEBUGLEVEL_BUILDTIME=5
AC_SUBST(DEBUG_FLAGS)
],[
DEBUG_FLAGS=-DDEBUGLEVEL_BUILDTIME=0
AC_SUBST(DEBUG_FLAGS)
])
AC_ARG_ENABLE(assert, [ --enable-assert enable assertions], [
AC_HEADER_ASSERT
ASSERT_FLAGS=-DUSEASSERT
AC_SUBST(ASSERT_FLAGS)
])
AC_ARG_ENABLE(opengl, [ --disable-opengl don't use opengl], [
AM_CONDITIONAL(USE_OPENGL, false)
],[
OPENGL_FLAGS=-DUSE_OPENGL
AC_SUBST(OPENGL_FLAGS)
AM_CONDITIONAL(USE_OPENGL, true)
])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])
#
AC_FUNC_MALLOC
AC_FUNC_REALLOC
#
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([getenv])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_SIZE_T
#check GMP
AC_CHECK_HEADERS([gmp.h], ,[AC_MSG_ERROR("*** GMP header not found.")])
AC_CHECK_LIB(gmp, __gmpz_init2, ,[AC_MSG_ERROR("*** GMP library not found or < 4.0.")])
if test -n "$OPENGL_FLAGS"; then
#check GL
AC_CHECK_HEADERS(GL/gl.h, ,[AC_MSG_ERROR("*** OpenGL header not found. (You may want to use --disable-opengl, more info in INSTALL)")])
AC_CHECK_LIB(GL, glLoadIdentity, ,[
AC_CHECK_LIB(opengl32, glLoadIdentity, , [AC_MSG_ERROR("*** OpenGL library not found. (You may want to use --disable-opengl, more info in INSTALL)")])
])
#check GLU
AC_CHECK_HEADERS(GL/glu.h, ,[AC_MSG_ERROR("*** GLU header not found.")])
AC_CHECK_LIB(GLU, gluBuild2DMipmaps, ,[
AC_CHECK_LIB(glu32, gluBuild2DMipmaps, , [AC_MSG_ERROR("*** GLU library not found.")])
])
fi
# check for GLICT
AC_CHECK_HEADERS([GLICT/globals.h],,[AC_MSG_ERROR("*** GLICT header not found.")])
LIBS="$LIBS -lGLICT"
#check 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"
AC_SUBST(SDL_LIBS)
#check SDL-gfx
AC_CHECK_HEADERS([SDL/SDL_rotozoom.h], ,[AC_MSG_ERROR("*** SDL_gfx headers not found.")])
## Following test does not work with any Windows-targetting compiler (mingw and mingw32ce included)
## More precisely, over there SDL wants SDL_main and not main, which the standard AC test does
## not provide.
#AC_CHECK_LIB(SDL_gfx, rotozoomSurfaceXY, ,[AC_MSG_ERROR("*** SDL_gfx library not found.")])
LIBS="$LIBS -lSDL_gfx"
# a lame check for libintl. is there a right way to do this?
AC_CHECK_HEADERS(libintl.h, HAVE_LIBINTL_H=1)
# output files
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT