]> Dogcows Code - chaz/yoink/blob - configure.ac
datarootdir autotools fix
[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 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
74 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
75 [Define to path of game asset directory.])
76
77 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES],
78 ["\$HOME/.yoinkrc:/etc/yoinkrc:$DATADIR/yoinkrc"],
79 [Define to colon-delimited config 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([clock_gettime], [rt],
105 [AC_DEFINE([HAVE_LIBRT], 1,
106 [Define to 1 if you have the 'rt' library.])])
107
108
109 #
110 # Checks for header files.
111 #
112
113 AC_HEADER_STDBOOL
114 AC_HEADER_STDC
115 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
116
117
118 #
119 # Checks for typedefs, structures, and compiler characteristics.
120 #
121
122 AC_C_STRINGIZE
123 AC_C_INLINE
124
125 AC_TYPE_UINT8_T
126 AC_TYPE_UINT16_T
127 AC_TYPE_UINT32_T
128 AC_TYPE_SIZE_T
129 AC_TYPE_SSIZE_T
130
131
132 #
133 # Checks for library functions.
134 #
135
136 AC_FUNC_ERROR_AT_LINE
137 AC_FUNC_STRTOD
138 AC_CHECK_FUNCS([strchr strcspn strrchr strstr])
139
140
141 #
142 # Find the data files to install.
143 #
144
145 DATA_FILES=$(echo $(cd data; \
146 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
147 AC_SUBST([DATA_FILES])
148
149
150 #
151 # Create the build files.
152 #
153
154 AC_CONFIG_FILES([Makefile
155 data/Makefile
156 src/Makefile
157 doc/Makefile
158 doc/yoink.6
159 yajl/Makefile])
160
161 AC_CONFIG_HEADERS([src/config.h])
162
163 AC_OUTPUT
164
165
166 #
167 # Print a friendly little message.
168 #
169
170 echo "====================================="
171 echo " Configuration complete!"
172 echo ""
173
174 echo " Prefix: $prefix"
175 echo " Data: $DATADIR"
176 echo ""
177
178 if test x$debug = xyes
179 then
180 echo " * Debugging enabled."
181 echo ""
182 fi
183
184 if test x$profile = xyes
185 then
186 echo " * Profiling enabled."
187 echo ""
188 fi
189
190 echo " To finish the installation, execute:"
191 echo " make"
192 echo " make install"
193 echo "====================================="
194
This page took 0.038581 seconds and 4 git commands to generate.