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"])
73 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
74 [Define to path of game asset directory.])
76 CONFIGFILES="\$HOME/.yoinkrc:/etc/yoinkrc:$DATADIR/yoinkrc"
78 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES], ["$CONFIGFILES"],
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([gluPerspective], [GLU],,
105 [AC_MSG_ERROR([libGLU is required])])
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.])])
113 # Checks for header files.
118 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
122 # Checks for typedefs, structures, and compiler characteristics.
136 # Checks for library functions.
139 AC_FUNC_ERROR_AT_LINE
141 AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
145 # Find the data files to install.
148 DATA_FILES=$(echo $(cd data; \
149 find . -name "*.png" -o -name "*.json" -o -name yoinkrc))
150 AC_SUBST([DATA_FILES])
154 # Create the build files.
157 AC_CONFIG_FILES([Makefile
164 AC_CONFIG_HEADERS([src/config.h])
170 # Print a friendly little message.
173 echo "====================================="
174 echo " Configuration complete!"
177 echo " Prefix: $prefix"
178 echo " Data: $DATADIR"
181 if test x$debug = xyes
183 echo " * Debugging enabled."
187 if test x$profile = xyes
189 echo " * Profiling enabled."
193 echo " To finish the installation, execute:"
196 echo "====================================="