-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.in
140 lines (118 loc) · 3.39 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(SDL_console)
AC_CONFIG_SRCDIR([README])
AC_CONFIG_HEADER([config.h])
dnl Set various version strings - taken gratefully from the GTk sources
# Making releases:
# MICRO_VERSION += 1;
# INTERFACE_AGE += 1;
# BINARY_AGE += 1;
# if any functions have been added, set INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BINARY_AGE and INTERFACE_AGE to 0.
MAJOR_VERSION=2
MINOR_VERSION=1
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(INTERFACE_AGE)
AC_SUBST(BINARY_AGE)
AC_SUBST(VERSION)
# libtool versioning
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Setup for automake
AM_INIT_AUTOMAKE(SDL_console, $VERSION)
AM_MAINTAINER_MODE
dnl Check for tools
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_MAKE_SET
AC_PROG_CC
AC_C_INLINE
AC_PROG_INSTALL
AC_PROG_LN_S
# Check for SDL
SDL_VERSION=1.2.4
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
# Check command-line options
AC_ARG_ENABLE(sdlimage,
AC_HELP_STRING(--enable-sdlimage,support SDL_image (default=yes)),
,
enable_sdlimage=yes)
if test x$enable_sdlimage = xyes; then
AC_CHECK_LIB([SDL_image], [IMG_Load],have_sdlimage=yes)
if test x$have_sdlimage = xyes; then
CFLAGS="$CFLAGS -DHAVE_SDLIMAGE"
CON_LIBS="$CON_LIBS -lSDL_image"
LIBS="$LIBS $CON_LIBS"
else
enable_sdlimage=no
fi
fi
AC_SUBST(CON_LIBS)
AC_ARG_ENABLE(gldemo,
AC_HELP_STRING(--enable-opengl,enable OpenGL support for the example (default=yes)),
,
enable_gldemo=yes)
if test x$enable_gldemo = xyes; then
have_opengl=yes
AC_CHECK_LIB([GL], [glLoadIdentity],have_gl=yes,have_opengl=no)
AC_CHECK_LIB([GLU], [gluPerspective],have_glu=yes,have_opengl=no,-lGL)
AC_CHECK_LIB([glut], [glutSolidTeapot],have_glut=yes,have_opengl=no,-lGL -lGLU)
if test x$have_opengl = xyes; then
EXAMPLE_LIBS="$EXAMPLE_LIBS -lGL -lGLU -lglut"
else
enable_gldemo=no
fi
fi
AC_SUBST(EXAMPLE_LIBS)
AM_CONDITIONAL(HAVE_OPENGL,test x$enable_gldemo = xyes)
#What is that thing used for anyway???
# FIXME: Replace `main' with a function in `-lm':
#AC_CHECK_LIB([m], [main])
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([atexit memset strdup])
AC_CONFIG_FILES([Makefile
src/Makefile
include/Makefile
example/Makefile])
AC_OUTPUT
# Print some useful information
echo
echo "Configuration:"
echo " Target system type: $target"
echo " Build static library: $enable_static"
echo " Build shared library: $enable_shared"
echo " Build with SDL_image: $enable_sdlimage"
echo " Build OpenGL Demos: $enable_gldemo"
echo
echo " Headers will be installed in $prefix/include"
echo " Libraries will be installed in $prefix/lib"
echo