]> Dogcows Code - chaz/yoink/blob - configure.ac
now using stlplus containers, especially ntree
[chaz/yoink] / configure.ac
1
2 #
3 # Yoink
4 # Process this file with autoconf to produce a configure script.
5 #
6
7 AC_PREREQ([2.60])
8
9 AC_INIT([Yoink], [0.1], [chaz@dogcows.com], [yoink])
10
11 AC_CANONICAL_TARGET
12
13 AC_CONFIG_SRCDIR([src/YoinkApp.cc])
14 AC_CONFIG_MACRO_DIR([m4])
15
16 AM_INIT_AUTOMAKE
17
18
19 #
20 # Checks for programs.
21 #
22
23 AC_PROG_CXX
24 #AC_PROG_AWK
25 AC_PROG_CC
26 AC_PROG_CPP
27 AC_PROG_INSTALL
28 #AC_PROG_LN_S
29 #AC_PROG_MAKE_SET
30 AC_PROG_LIBTOOL
31
32
33 #
34 # Checks for configuration arguments.
35 #
36
37 AC_ARG_ENABLE([debug],
38 [ --enable-debug include debugging symbols and features],
39 [debug=$enableval
40 if test x$debug = xyes
41 then
42 CFLAGS="-Wall -Werror -gstabs+ -O0 -DDEBUG"
43 CXXFLAGS="-Wall -Werror -gstabs+ -O0 -DDEBUG"
44 else
45 CFLAGS="-O2 -DNDEBUG"
46 CXXFLAGS="-O2 -DNDEBUG"
47 fi],
48 [CFLAGS="-O2 -DNDEBUG"
49 CXXFLAGS="-O2 -DNDEBUG"])
50
51 AC_ARG_ENABLE([profile],
52 [ --enable-profile make a binary for use with gprof],
53 [profile=$enableval
54 if test x$profile = xyes
55 then
56 CFLAGS="$CFLAGS -pg"
57 CXXFLAGS="$CXXFLAGS -pg"
58 fi])
59
60
61 if test x$prefix = xNONE
62 then
63 prefix="$ac_default_prefix"
64 fi
65
66 AC_ARG_WITH([assetdir],
67 [AS_HELP_STRING([--with-assetdir=DIR],
68 [real path to game assets (default: $datarootdir/yoink)])],
69 [DATADIR="$withval"],
70 [eval DATADIR="$datarootdir/yoink"])
71
72 AC_SUBST([DATADIR])
73 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
74 [Define to path of game asset directory.])
75
76 CONFIGFILES="\$HOME/.yoinkrc:/etc/yoinkrc"
77
78 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES], ["$CONFIGFILES"],
79 [Define to colon-delimited configuration file paths.])
80
81
82 #
83 # Checks for libraries.
84 #
85
86 AM_PATH_SDL([1.2.10],
87 [CFLAGS="$CFLAGS $SDL_CFLAGS"
88 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
89 LIBS="$LIBS $SDL_LIBS"])
90
91 #BOOST_REQUIRE([1.35])
92 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
93 BOOST_SMART_PTR
94 BOOST_STRING_ALGO
95 BOOST_BIND
96 BOOST_FUNCTION
97
98 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
99 [AC_MSG_ERROR([libSDL_image is required])])
100
101 AC_SEARCH_LIBS([glBegin], [GL],,
102 [AC_MSG_ERROR([libGL is required])])
103
104 AC_SEARCH_LIBS([gluPerspective], [GLU],,
105 [AC_MSG_ERROR([libGLU is required])])
106
107 AC_SEARCH_LIBS([clock_gettime], [rt],
108 [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
109 [Define to 1 if you have the 'clock_gettime' function.])])
110
111
112 #
113 # Checks for header files.
114 #
115
116 AC_HEADER_STDBOOL
117 AC_HEADER_STDC
118 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
119
120
121 #
122 # Checks for typedefs, structures, and compiler characteristics.
123 #
124
125 AC_C_STRINGIZE
126 AC_C_INLINE
127
128 AC_TYPE_UINT8_T
129 AC_TYPE_UINT16_T
130 AC_TYPE_UINT32_T
131 AC_TYPE_SIZE_T
132 AC_TYPE_SSIZE_T
133
134
135 #
136 # Checks for library functions.
137 #
138
139 AC_FUNC_ERROR_AT_LINE
140 AC_FUNC_STRTOD
141 AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
142
143
144 #
145 # Find the data files to install.
146 #
147
148 DATA_FILES=$(echo $(cd data; \
149 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
150 AC_SUBST([DATA_FILES])
151
152
153 #
154 # Create the build files.
155 #
156
157 AC_CONFIG_FILES([Makefile
158 data/Makefile
159 doc/Makefile
160 doc/yoink.6
161 extra/yoink.spec
162 src/Makefile
163 yajl/Makefile])
164
165 AC_CONFIG_HEADERS([src/config.h])
166
167 AC_OUTPUT
168
169
170 #
171 # Print a friendly little message.
172 #
173
174 echo "====================================="
175 echo " Configuration complete!"
176 echo ""
177
178 echo " Prefix: $prefix"
179 echo " Data: $DATADIR"
180 echo ""
181
182 if test x$debug = xyes
183 then
184 echo " * Debugging enabled."
185 echo ""
186 fi
187
188 if test x$profile = xyes
189 then
190 echo " * Profiling enabled."
191 echo ""
192 fi
193
194 echo " To finish the installation, execute:"
195 echo " make"
196 echo " make install"
197 echo "====================================="
198
This page took 0.037492 seconds and 4 git commands to generate.