]> Dogcows Code - chaz/yoink/blob - configure.ac
big batch of progress
[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 -g -O0 -DDEBUG"
43 CXXFLAGS="-Wall -Werror -g -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 if test x$datadir = x'${datarootdir}'
67 then
68 eval datarootdir="$datarootdir"
69 eval datadir="$datadir/yoink"
70 fi
71
72 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$datadir"],
73 [Define to path of game asset directory.])
74
75 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES],
76 ["\$HOME/.yoinkrc:/etc/yoinkrc:$datadir/yoinkrc"],
77 [Define to colon-delimited config file paths.])
78
79
80 #
81 # Checks for libraries.
82 #
83
84 AM_PATH_SDL([1.2.14],
85 [CFLAGS="$CFLAGS $SDL_CFLAGS"
86 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
87 LIBS="$LIBS $SDL_LIBS"])
88
89 #BOOST_REQUIRE([1.35])
90 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
91 BOOST_SMART_PTR
92 BOOST_STRING_ALGO
93 BOOST_BIND
94 BOOST_FUNCTION
95
96 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
97 [AC_MSG_ERROR([libSDL_image is required])])
98
99 AC_SEARCH_LIBS([glBegin], [GL],,
100 [AC_MSG_ERROR([libGL is required])])
101
102 AC_SEARCH_LIBS([clock_gettime], [rt],
103 [AC_DEFINE([HAVE_LIBRT], 1,
104 [Define to 1 if you have the 'rt' library.])])
105
106
107 #
108 # Checks for header files.
109 #
110
111 AC_HEADER_STDBOOL
112 AC_HEADER_STDC
113 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
114
115
116 #
117 # Checks for typedefs, structures, and compiler characteristics.
118 #
119
120 AC_C_STRINGIZE
121 AC_C_INLINE
122
123 AC_TYPE_UINT8_T
124 AC_TYPE_UINT16_T
125 AC_TYPE_UINT32_T
126 AC_TYPE_SIZE_T
127 AC_TYPE_SSIZE_T
128
129
130 #
131 # Checks for library functions.
132 #
133
134 AC_FUNC_ERROR_AT_LINE
135 AC_FUNC_STRTOD
136 AC_CHECK_FUNCS([strchr strcspn strrchr strstr])
137
138
139 #
140 # Find the data files to install.
141 #
142
143 DATA_FILES=$(echo $(cd data; \
144 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
145 AC_SUBST([DATA_FILES])
146
147
148 #
149 # Create the build files.
150 #
151
152 AC_CONFIG_FILES([Makefile
153 data/Makefile
154 src/Makefile
155 doc/Makefile
156 doc/yoink.6
157 yajl/Makefile])
158
159 AC_CONFIG_HEADERS([src/config.h])
160
161 AC_OUTPUT
162
163
164 #
165 # Print a friendly little message.
166 #
167
168 echo "====================================="
169 echo " Configuration complete!"
170 echo ""
171
172 echo " Prefix: $prefix"
173 echo " Data: $datadir"
174 echo ""
175
176 if test x$debug = xyes
177 then
178 echo " * Debugging enabled."
179 echo ""
180 fi
181
182 if test x$profile = xyes
183 then
184 echo " * Profiling enabled."
185 echo ""
186 fi
187
188 echo " To finish the installation, execute:"
189 echo " make"
190 echo " make install"
191 echo "====================================="
192
This page took 0.03882 seconds and 5 git commands to generate.