4 # Process this file with autoconf to produce a configure script.
9 AC_INIT([Yoink], [0.1], [chaz@dogcows.com], [yoink])
13 AC_CONFIG_SRCDIR([src/YoinkApp.cc])
14 AC_CONFIG_MACRO_DIR([m4])
20 # Checks for programs.
34 # Checks for configuration arguments.
37 AC_ARG_ENABLE([debug],
38 [ --enable-debug include debugging symbols and features],
40 if test x$debug = xyes
42 CFLAGS="-Wall -Werror -g -O0 -DDEBUG"
43 CXXFLAGS="-Wall -Werror -g -O0 -DDEBUG"
46 CXXFLAGS="-O2 -DNDEBUG"
48 [CFLAGS="-O2 -DNDEBUG"
49 CXXFLAGS="-O2 -DNDEBUG"])
51 AC_ARG_ENABLE([profile],
52 [ --enable-profile make a binary for use with gprof],
54 if test x$profile = xyes
57 CXXFLAGS="$CXXFLAGS -pg"
61 if test x$prefix = xNONE
63 prefix="$ac_default_prefix"
66 if test x$datadir = x'${datarootdir}'
68 eval datarootdir="$datarootdir"
69 eval datadir="$datadir/yoink"
72 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$datadir"],
73 [Define to path of game asset directory.])
75 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES],
76 ["\$HOME/.yoinkrc:/etc/yoinkrc:$datadir/yoinkrc"],
77 [Define to colon-delimited config file paths.])
81 # Checks for libraries.
85 [CFLAGS="$CFLAGS $SDL_CFLAGS"
86 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
87 LIBS="$LIBS $SDL_LIBS"])
89 #BOOST_REQUIRE([1.35])
90 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
96 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
97 [AC_MSG_ERROR([libSDL_image is required])])
99 AC_SEARCH_LIBS([glBegin], [GL],,
100 [AC_MSG_ERROR([libGL is required])])
102 AC_SEARCH_LIBS([clock_gettime], [rt],
103 [AC_DEFINE([HAVE_LIBRT], 1,
104 [Define to 1 if you have the 'rt' library.])])
108 # Checks for header files.
113 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
117 # Checks for typedefs, structures, and compiler characteristics.
131 # Checks for library functions.
134 AC_FUNC_ERROR_AT_LINE
136 AC_CHECK_FUNCS([strchr strcspn strrchr strstr])
140 # Find the data files to install.
143 DATA_FILES=$(echo $(cd data; \
144 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
145 AC_SUBST([DATA_FILES])
149 # Create the build files.
152 AC_CONFIG_FILES([Makefile
159 AC_CONFIG_HEADERS([src/config.h])
165 # Print a friendly little message.
168 echo "====================================="
169 echo " Configuration complete!"
172 echo " Prefix: $prefix"
173 echo " Data: $datadir"
176 if test x$debug = xyes
178 echo " * Debugging enabled."
182 if test x$profile = xyes
184 echo " * Profiling enabled."
188 echo " To finish the installation, execute:"
191 echo "====================================="