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
43 CXXFLAGS="-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"])
78 AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
79 [Define to path of game asset directory.])
81 CONFIGFILES="\$HOME/.yoinkrc:/etc/yoinkrc"
83 AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES], ["$CONFIGFILES"],
84 [Define to colon-delimited configuration file paths.])
88 # Checks for libraries.
92 [CFLAGS="$CFLAGS $SDL_CFLAGS"
93 CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
94 LIBS="$LIBS $SDL_LIBS"])
96 #BOOST_REQUIRE([1.35])
97 #CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
103 AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
104 [AC_MSG_ERROR([SDL_image is required])])
106 AC_SEARCH_LIBS([Sound_Init], [SDL_sound],,
107 [AC_MSG_ERROR([SDL_sound is required])])
109 AC_SEARCH_LIBS([glBegin], [GL opengl32],,
110 [AC_MSG_ERROR([OpenGL is required])])
112 AC_SEARCH_LIBS([gluPerspective], [GLU MesaGLU glu32],,
113 [AC_MSG_ERROR([GLU is required])])
115 AC_SEARCH_LIBS([alGenBuffers], [openal openal32],,
116 [AC_MSG_ERROR([OpenAL is required])])
118 AC_SEARCH_LIBS([alutInit], [alut],,
119 [AC_MSG_ERROR([alut is required])])
121 AC_SEARCH_LIBS([clock_gettime], [rt],
122 [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
123 [Define to 1 if you have the 'clock_gettime' function.])])
127 # Checks for header files.
132 AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
136 # Checks for typedefs, structures, and compiler characteristics.
150 # Checks for library functions.
153 AC_FUNC_ERROR_AT_LINE
155 AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
159 # Find the data files to install.
162 DATA_FILES=$(echo $(cd data; \
163 find . -name "*.json" \
168 AC_SUBST([DATA_FILES])
172 # Create the build files.
175 AC_CONFIG_FILES([Makefile
183 AC_CONFIG_HEADERS([src/config.h])
189 # Print a friendly little message.
192 echo "======================================"
193 echo " Configuration complete!"
196 echo " Prefix: $prefix"
197 echo " Data: $DATADIR"
200 if test x$debug = xyes
202 echo " * Debugging enabled."
206 if test x$profile = xyes
208 echo " * Profiling enabled."
212 echo " To finish the installation, execute:"
215 echo "======================================"