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 AC_ARG_WITH([assetdir],
67 [AS_HELP_STRING([--with-assetdir=DIR],
68 [real path to game assets (default: $datarootdir/yoink)])],
70 [eval DATADIR="$datarootdir/yoink"])
74 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
75 [Define to path of game asset directory.])
77 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES],
78 ["\$HOME/.yoinkrc:/etc/yoinkrc:$DATADIR/yoinkrc"],
79 [Define to colon-delimited config file paths.])
83 # Checks for libraries.
87 [CFLAGS="$CFLAGS $SDL_CFLAGS"
88 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
89 LIBS="$LIBS $SDL_LIBS"])
91 #BOOST_REQUIRE([1.35])
92 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
98 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
99 [AC_MSG_ERROR([libSDL_image is required])])
101 AC_SEARCH_LIBS([glBegin], [GL],,
102 [AC_MSG_ERROR([libGL is required])])
104 AC_SEARCH_LIBS([clock_gettime], [rt],
105 [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
106 [Define to 1 if you have the 'clock_gettime' function.])])
110 # Checks for header files.
115 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
119 # Checks for typedefs, structures, and compiler characteristics.
133 # Checks for library functions.
136 AC_FUNC_ERROR_AT_LINE
138 AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
142 # Find the data files to install.
145 DATA_FILES=$(echo $(cd data; \
146 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
147 AC_SUBST([DATA_FILES])
151 # Create the build files.
154 AC_CONFIG_FILES([Makefile
161 AC_CONFIG_HEADERS([src/config.h])
167 # Print a friendly little message.
170 echo "====================================="
171 echo " Configuration complete!"
174 echo " Prefix: $prefix"
175 echo " Data: $DATADIR"
178 if test x$debug = xyes
180 echo " * Debugging enabled."
184 if test x$profile = xyes
186 echo " * Profiling enabled."
190 echo " To finish the installation, execute:"
193 echo "====================================="