-
Notifications
You must be signed in to change notification settings - Fork 16
/
configure.ac
97 lines (83 loc) · 2.86 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
dnl INIT
AC_CONFIG_MACRO_DIRS([m4])
AC_INIT([GL4Dummies], [0.1.7])
AM_INIT_AUTOMAKE([subdir-objects])
dnl Verifier le type de systeme
AC_CANONICAL_HOST
dnl Trouver le compilateur C approprie
AC_LANG(C)
AC_PROG_CC
dnl Utiliser la libtool
dnl AC_PROG_LIBTOOL
dnl Verifie l'existance des headers C standards
dnl AC_CONFIG_HEADERS
AC_HEADER_STDC
AM_CONDITIONAL(USE_VERSION_RC, false)
AC_CHECK_TOOL(DOXYGEN, doxygen)
dnl AC_PATH_PROGS([SDL_CONFIG], [sdl2-config sdl20-config], [none], [$PATH])
dnl Here are a set of rules to help you update your library version
dnl information:
dnl 1. Start with version information of ‘0:0:0’ for each libtool
dnl library.
dnl 2. Update the version information only immediately before a public
dnl release of your software. More frequent updates are unnecessary, and
dnl only guarantee that the current interface number gets larger faster.
dnl 3. If the library source code has changed at all since the last
dnl update, then increment revision (‘c:r:a’ becomes ‘c:r+1:a’).
dnl 4. If any interfaces have been added, removed, or changed since
dnl the last update, increment current, and set revision to 0.
dnl 5. If any interfaces have been added since the last public
dnl release, then increment age.
dnl 6. If any interfaces have been removed or changed since the last
dnl public release, then set age to 0.
m4_define(LT_CURRENT, 7)
m4_define(LT_REVISION, 0)
m4_define(LT_AGE, 0)
VERSION_INFO="LT_CURRENT():LT_REVISION():LT_AGE()"
AC_SUBST(VERSION_INFO)
LT_INIT
dnl Check for SDL2
SDL_VERSION=2.0.0
AC_SUBST(SDL_VERSION)
AM_PATH_SDL2($SDL_VERSION, :,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="-Wall -Wextra -O3"
LDFLAGS="-lm"
echo " *** Configuring for ... $host ***"
case "$host" in
dnl MACOS X
*-*-darwin*)
AC_DEFINE_UNQUOTED(MACOSX, 1, [If we are on macosx plateform.])
MACOSX_DEPLOYMENT_TARGET="10.8"
CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
CFLAGS="$CFLAGS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
LDFLAGS="$LDFLAGS -framework OpenGL -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
;;
dnl FREEBSD
*-*-freebsd*)
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
LDFLAGS="-L/usr/local/lib $LDFLAGS -lGL"
;;
dnl CYGWIN
*-*-cygwin*)
AC_DEFINE_UNQUOTED(CYGWIN,1, [If we are on cygwin plateform.])
LDFLAGS="$LDFLAGS -lopengl32 -lmingw32"
dnl AM_CONDITIONAL([WINDOWS], [true])
;;
dnl MINGW32
*-*-mingw32)
AC_DEFINE_UNQUOTED(MINGW32,1, [If we are on mingw32 plateform.])
LDFLAGS="$LDFLAGS -lopengl32 -lmingw32"
;;
dnl Cross-compiling MINGW32
i386-pc-mingw32msvc)
AC_DEFINE_UNQUOTED(MINGW32,1, [If we are on mingw32 plateform.])
LDFLAGS="$LDFLAGS -lopengl32 -lmingw32"
;;
dnl OTHER SYSTEMS
*)
LDFLAGS="$LDFLAGS -lGL"
;;
esac
AC_OUTPUT([Makefile] [lib_src/Makefile] [lib_src/documentation/Makefile] [samples/demo/Makefile])