[71] | 1 | # $Id: configure.ac 3045 2008-10-19 14:44:25Z jylam $ |
---|
[17] | 2 | |
---|
[2965] | 3 | AC_INIT(libcaca, 0.99.beta16) |
---|
[17] | 4 | AC_PREREQ(2.50) |
---|
[2316] | 5 | AC_CONFIG_AUX_DIR(.auto) |
---|
[17] | 6 | AC_CANONICAL_SYSTEM |
---|
[2864] | 7 | AM_INIT_AUTOMAKE([no-define tar-ustar]) |
---|
| 8 | dnl AM_MAINTAINER_MODE |
---|
[17] | 9 | |
---|
[2864] | 10 | AM_CONFIG_HEADER(config.h) |
---|
| 11 | |
---|
[2087] | 12 | LT_MAJOR="0" |
---|
| 13 | LT_MINOR="99" |
---|
[2967] | 14 | LT_MICRO="16" |
---|
[2087] | 15 | AC_SUBST(LT_MAJOR) |
---|
| 16 | AC_SUBST(LT_MINOR) |
---|
| 17 | AC_SUBST(LT_MICRO) |
---|
| 18 | LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO" |
---|
[830] | 19 | AC_SUBST(LT_VERSION) |
---|
[17] | 20 | |
---|
| 21 | AM_PROG_CC_C_O |
---|
| 22 | AC_PROG_CPP |
---|
[781] | 23 | AC_PROG_CXX |
---|
[801] | 24 | AC_PROG_CXXCPP |
---|
[1396] | 25 | _AM_DEPENDENCIES([OBJC]) |
---|
[1449] | 26 | OBJC="${CC}" |
---|
[1396] | 27 | AC_SUBST(OBJC) |
---|
| 28 | AC_SUBST(OBJCFLAGS) |
---|
[568] | 29 | AM_PROG_AS |
---|
[17] | 30 | |
---|
[475] | 31 | AC_LIBTOOL_WIN32_DLL |
---|
| 32 | AM_PROG_LIBTOOL |
---|
[781] | 33 | AC_LIBTOOL_CXX |
---|
[475] | 34 | |
---|
[344] | 35 | AC_C_CONST |
---|
| 36 | AC_C_INLINE |
---|
[348] | 37 | AC_TYPE_SIGNAL |
---|
[344] | 38 | |
---|
[157] | 39 | dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right |
---|
[747] | 40 | dnl now otherwise it might be set in an obscure if statement. Same thing for |
---|
| 41 | dnl PKG_PROG_PKG_CONFIG which needs to be called first. |
---|
[781] | 42 | AC_EGREP_CPP(yes, foo) |
---|
[747] | 43 | PKG_PROG_PKG_CONFIG() |
---|
[867] | 44 | m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) |
---|
[1198] | 45 | if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then |
---|
[867] | 46 | export PKG_CONFIG_LIBDIR=/dev/null |
---|
| 47 | fi |
---|
[157] | 48 | |
---|
[2888] | 49 | AC_MSG_CHECKING(for library suffix) |
---|
[2895] | 50 | LT_SUFFIX="`./libtool -n --mode=link gcc -o libTEST.la -no-undefined -version-number 123:666:999 -rpath / | xargs -n 1 | sed -ne 's/.*libTEST\(@<:@^, ()0-9@:>@*\)123\(@<:@^, ()0-9@:>@*\).*/\1'$LT_MAJOR'\2/p' | grep -v '\.$' | head -n 1`" |
---|
[2888] | 51 | if test "$LT_SUFFIX" = ""; then |
---|
| 52 | LT_SUFFIX=".so.$LT_MAJOR" |
---|
[2895] | 53 | AC_MSG_RESULT([unknown, defaulting to $LT_SUFFIX]) |
---|
[2888] | 54 | else |
---|
| 55 | AC_MSG_RESULT($LT_SUFFIX) |
---|
| 56 | fi |
---|
| 57 | AC_SUBST(LT_SUFFIX) |
---|
| 58 | |
---|
[346] | 59 | dnl output driver features |
---|
[284] | 60 | AC_ARG_ENABLE(slang, |
---|
[285] | 61 | [ --enable-slang slang graphics support (autodetected)]) |
---|
[231] | 62 | AC_ARG_ENABLE(ncurses, |
---|
[285] | 63 | [ --enable-ncurses ncurses graphics support (autodetected)]) |
---|
[331] | 64 | AC_ARG_ENABLE(win32, |
---|
| 65 | [ --enable-win32 Windows console support (autodetected)]) |
---|
[155] | 66 | AC_ARG_ENABLE(conio, |
---|
[331] | 67 | [ --enable-conio DOS conio.h graphics support (autodetected)]) |
---|
[251] | 68 | AC_ARG_ENABLE(x11, |
---|
[285] | 69 | [ --enable-x11 X11 support (autodetected)]) |
---|
[483] | 70 | AC_ARG_ENABLE(gl, |
---|
| 71 | [ --enable-gl OpenGL support (autodetected)]) |
---|
[1396] | 72 | AC_ARG_ENABLE(cocoa, |
---|
| 73 | [ --enable-cocoa Cocoa support (autodetected)]) |
---|
[554] | 74 | AC_ARG_ENABLE(network, |
---|
| 75 | [ --enable-network Network support (autodetected)]) |
---|
[568] | 76 | AC_ARG_ENABLE(vga, |
---|
| 77 | [ --enable-vga VGA support (default disabled)]) |
---|
[17] | 78 | |
---|
[801] | 79 | dnl language bindings |
---|
[2044] | 80 | AC_ARG_ENABLE(csharp, |
---|
| 81 | [ --enable-csharp C# bindings (autodetected)]) |
---|
[899] | 82 | AC_ARG_ENABLE(cxx, |
---|
[2053] | 83 | [ --enable-cxx C++ bindings (autodetected)]) |
---|
[1951] | 84 | AC_ARG_ENABLE(ruby, |
---|
[1953] | 85 | [ --enable-ruby Ruby bindings (autodetected)]) |
---|
[781] | 86 | |
---|
[346] | 87 | dnl example programs features |
---|
| 88 | AC_ARG_ENABLE(imlib2, |
---|
[1398] | 89 | [ --enable-imlib2 Imlib2 graphics support (autodetected)]) |
---|
[346] | 90 | |
---|
| 91 | dnl conditional builds |
---|
[1360] | 92 | AC_ARG_ENABLE(debug, |
---|
[2101] | 93 | [ --enable-debug build debug versions of the library (default no)]) |
---|
[1208] | 94 | AC_ARG_ENABLE(plugins, |
---|
[2101] | 95 | [ --enable-plugins make X11 and GL drivers plugins (default disabled)]) |
---|
[346] | 96 | AC_ARG_ENABLE(doc, |
---|
| 97 | [ --enable-doc build documentation (needs doxygen and LaTeX)]) |
---|
[2301] | 98 | AC_ARG_ENABLE(cppunit, |
---|
| 99 | [ --enable-cppunit use cppunit for unit tests (autodetected)]) |
---|
[2101] | 100 | AC_ARG_ENABLE(zzuf, |
---|
| 101 | [ --enable-zzuf use zzuf for fuzzing tests (autodetected)]) |
---|
[346] | 102 | |
---|
[2299] | 103 | AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h termios.h) |
---|
[2144] | 104 | AC_CHECK_FUNCS(signal ioctl snprintf vsnprintf getenv putenv strcasecmp htons) |
---|
[1086] | 105 | AC_CHECK_FUNCS(usleep gettimeofday) |
---|
[348] | 106 | |
---|
[2248] | 107 | ac_cv_have_getopt_long="no" |
---|
[1207] | 108 | AC_CHECK_FUNCS(getopt_long, |
---|
[2248] | 109 | [ac_cv_have_getopt_long="yes"], |
---|
[1207] | 110 | [AC_CHECK_LIB(gnugetopt, getopt_long, |
---|
[2248] | 111 | [ac_cv_have_getopt_long="yes" |
---|
[1207] | 112 | GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])]) |
---|
[2248] | 113 | if test "$ac_cv_have_getopt_long" != "no"; then |
---|
| 114 | AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.) |
---|
| 115 | fi |
---|
| 116 | AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no") |
---|
[1207] | 117 | AC_SUBST(GETOPT_LIBS) |
---|
| 118 | |
---|
[338] | 119 | AC_MSG_CHECKING(for Sleep) |
---|
| 120 | AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);], |
---|
| 121 | [AC_MSG_RESULT(yes) |
---|
[610] | 122 | AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])], |
---|
[338] | 123 | [AC_MSG_RESULT(no)]) |
---|
[657] | 124 | |
---|
[652] | 125 | AC_MSG_CHECKING(for fsin/fcos) |
---|
[2871] | 126 | AC_TRY_COMPILE([],[double x; asm volatile("fsin\n\tfcos":"=t"(x):);], |
---|
[652] | 127 | [AC_MSG_RESULT(yes) |
---|
[2871] | 128 | AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the `fsin' and `fcos' instructions.])], |
---|
[652] | 129 | [AC_MSG_RESULT(no)]) |
---|
[657] | 130 | |
---|
| 131 | AC_MSG_CHECKING(for fldln2/fxch/fyl2x) |
---|
[2871] | 132 | AC_TRY_COMPILE([],[double x; asm volatile("fldln2; fldln2; fxch; fyl2x":"=t"(x):);], |
---|
[657] | 133 | [AC_MSG_RESULT(yes) |
---|
[2871] | 134 | AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the `fldln2' and other floating point instructions.])], |
---|
[657] | 135 | [AC_MSG_RESULT(no)]) |
---|
| 136 | |
---|
[2109] | 137 | AC_CHECK_HEADERS(zlib.h) |
---|
| 138 | AC_CHECK_LIB(z, gzopen, [ZLIB_LIBS="${ZLIB_LIBS} -lz"]) |
---|
| 139 | |
---|
[333] | 140 | AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") |
---|
[222] | 141 | |
---|
[2053] | 142 | CACA_DRIVERS="" |
---|
[284] | 143 | |
---|
[285] | 144 | if test "${enable_conio}" != "no"; then |
---|
[330] | 145 | ac_cv_my_have_conio="no" |
---|
[285] | 146 | AC_CHECK_HEADERS(conio.h, |
---|
[330] | 147 | [AC_MSG_CHECKING(for ScreenUpdate in pc.h) |
---|
[331] | 148 | AC_EGREP_HEADER(ScreenUpdate, pc.h, |
---|
[330] | 149 | [ac_cv_my_have_conio="yes" |
---|
| 150 | AC_MSG_RESULT(yes) |
---|
[285] | 151 | AC_DEFINE(SCREENUPDATE_IN_PC_H, 1, |
---|
[610] | 152 | Define to 1 if <pc.h> defines ScreenUpdate.) |
---|
| 153 | AC_DEFINE(USE_CONIO, 1, Define to 1 to activate the conio.h backend driver) |
---|
[330] | 154 | CACA_DRIVERS="${CACA_DRIVERS} conio"], |
---|
| 155 | [AC_MSG_RESULT(no)])]) |
---|
[285] | 156 | if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then |
---|
| 157 | AC_MSG_ERROR([cannot find conio.h]) |
---|
| 158 | fi |
---|
[265] | 159 | fi |
---|
| 160 | |
---|
[331] | 161 | if test "${enable_win32}" != "no"; then |
---|
| 162 | ac_cv_my_have_win32="no" |
---|
| 163 | AC_CHECK_HEADERS(windows.h, |
---|
| 164 | [AC_MSG_CHECKING(for AllocConsole in windows.h) |
---|
| 165 | AC_EGREP_HEADER(AllocConsole, windows.h, |
---|
| 166 | [ac_cv_my_have_win32="yes" |
---|
| 167 | AC_MSG_RESULT(yes) |
---|
| 168 | AC_DEFINE(ALLOCCONSOLE_IN_WINDOWS_H, 1, |
---|
[610] | 169 | Define to 1 if <windows.h> defines AllocConsole.) |
---|
| 170 | AC_DEFINE(USE_WIN32, 1, Define to 1 to activate the win32 backend driver) |
---|
[331] | 171 | CACA_DRIVERS="${CACA_DRIVERS} win32"], |
---|
| 172 | [AC_MSG_RESULT(no)])]) |
---|
| 173 | if test "${ac_cv_my_have_win32}" = "no" -a "${enable_win32}" = "yes"; then |
---|
| 174 | AC_MSG_ERROR([cannot find win32 console development files]) |
---|
| 175 | fi |
---|
| 176 | fi |
---|
| 177 | |
---|
[284] | 178 | if test "${enable_slang}" != "no"; then |
---|
[330] | 179 | ac_cv_my_have_slang="no" |
---|
[309] | 180 | AC_CHECK_HEADERS(slang.h slang/slang.h, |
---|
[610] | 181 | [ac_cv_my_have_slang="yes" |
---|
| 182 | AC_DEFINE(USE_SLANG, 1, Define to 1 to activate the slang backend driver) |
---|
| 183 | AC_CHECK_LIB(slang, SLsmg_utf8_enable, |
---|
| 184 | [AC_DEFINE(HAVE_SLSMG_UTF8_ENABLE, 1, Define to 1 if you have the `SLsmg_utf8_enable' function.)]) |
---|
| 185 | CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1" |
---|
| 186 | CACA_LIBS="${CACA_LIBS} -lslang" |
---|
| 187 | CACA_DRIVERS="${CACA_DRIVERS} slang" |
---|
| 188 | break]) |
---|
[284] | 189 | if test "${ac_cv_my_have_slang}" = "no" -a "${enable_slang}" = "yes"; then |
---|
| 190 | AC_MSG_ERROR([cannot find slang development files]) |
---|
| 191 | fi |
---|
[265] | 192 | fi |
---|
| 193 | |
---|
[284] | 194 | if test "${enable_x11}" != "no"; then |
---|
[251] | 195 | AC_PATH_X |
---|
| 196 | AC_CHECK_LIB(X11, XOpenDisplay, |
---|
[284] | 197 | [ac_cv_my_have_x11="yes" |
---|
[277] | 198 | if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi |
---|
[994] | 199 | if test -n "${x_libraries}"; then X_LIBS="-L${x_libraries}"; fi |
---|
[610] | 200 | AC_DEFINE(USE_X11, 1, Define to 1 to activate the X11 backend driver) |
---|
[284] | 201 | CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" |
---|
[1208] | 202 | X11_LIBS="${X11_LIBS} -lX11 ${X_LIBS}" |
---|
[284] | 203 | CACA_DRIVERS="${CACA_DRIVERS} x11"], |
---|
| 204 | [ac_cv_my_have_x11="no"], |
---|
[955] | 205 | [[`if test -n "${x_libraries}"; then echo -L${x_libraries}; fi`]]) |
---|
[324] | 206 | AC_CHECK_HEADERS(X11/XKBlib.h) |
---|
[284] | 207 | if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then |
---|
[251] | 208 | AC_MSG_ERROR([cannot find X11 development files]) |
---|
| 209 | fi |
---|
[265] | 210 | fi |
---|
| 211 | |
---|
[483] | 212 | if test "${enable_gl}" != "no"; then |
---|
| 213 | ac_cv_my_have_gl="no" |
---|
[697] | 214 | AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h, |
---|
[610] | 215 | [AC_CHECK_HEADERS(GL/glut.h, |
---|
[799] | 216 | [AC_CHECK_LIB(glut, glutCloseFunc, |
---|
| 217 | [AC_DEFINE(HAVE_GLUTCLOSEFUNC, 1, Define to 1 if you have the `glutCloseFunc' function.)]) |
---|
| 218 | AC_CHECK_LIB(glut, glutMainLoopEvent, |
---|
| 219 | [ac_cv_my_have_gl="yes"]) |
---|
| 220 | AC_CHECK_LIB(glut, glutCheckLoop, |
---|
[694] | 221 | [ac_cv_my_have_gl="yes" |
---|
[697] | 222 | AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the `glutCheckLoop' function.)])]) |
---|
| 223 | break]) |
---|
| 224 | if test "${ac_cv_my_have_gl}" = "yes"; then |
---|
| 225 | AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver) |
---|
[1208] | 226 | GL_LIBS="${GL_LIBS} -lGL -lglut" |
---|
[697] | 227 | CACA_DRIVERS="${CACA_DRIVERS} gl" |
---|
| 228 | elif test "${enable_gl}" = "yes"; then |
---|
[483] | 229 | AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files]) |
---|
| 230 | fi |
---|
[2517] | 231 | PKG_CHECK_MODULES(FTGL, ftgl >= 2.1.3, [FTGL="yes"], [FTGL="no"]) |
---|
[483] | 232 | fi |
---|
[2539] | 233 | AM_CONDITIONAL(USE_FTGL, test "${FTGL}" = "yes") |
---|
[483] | 234 | |
---|
[1396] | 235 | if test "${enable_cocoa}" != "no"; then |
---|
| 236 | ac_cv_my_have_cocoa="no" |
---|
| 237 | AC_CHECK_HEADERS(Cocoa/Cocoa.h, |
---|
| 238 | [ac_cv_my_have_cocoa="yes"]) |
---|
| 239 | if test "${ac_cv_my_have_cocoa}" = "yes"; then |
---|
[1449] | 240 | case x${target} in |
---|
| 241 | xpowerpc*darwin*) |
---|
| 242 | # 10.3 needed to link with X11 |
---|
| 243 | MACOSX_SDK=/Developer/SDKs/MacOSX10.3.9.sdk |
---|
| 244 | GCC_VERSION=3.3 |
---|
| 245 | ARCH="-arch ppc" |
---|
| 246 | MACOSX_SDK_CFLAGS="-nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include" |
---|
| 247 | MACOSX_SDK_CXXFLAGS="-nostdinc++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++ -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/ppc-darwin -I${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION}/c++/backward" |
---|
| 248 | MACOSX_SDK_LDFLAGS="-L${MACOSX_SDK}/usr/lib/gcc/darwin -L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION} -L${MACOSX_SDK}/usr/lib" |
---|
| 249 | ;; |
---|
| 250 | x*86*darwin*) |
---|
[3045] | 251 | MACOSX_SDK=/Developer/SDKs/MacOSX10.5.sdk |
---|
[1449] | 252 | GCC_VERSION=4.0 |
---|
| 253 | ARCH="-arch i386" |
---|
| 254 | MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}" |
---|
| 255 | MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}" |
---|
| 256 | ;; |
---|
| 257 | esac |
---|
| 258 | CC=gcc-${GCC_VERSION} |
---|
| 259 | CXX=g++-${GCC_VERSION} |
---|
| 260 | MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks" |
---|
| 261 | CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}" |
---|
| 262 | CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}" |
---|
| 263 | CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}" |
---|
| 264 | OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}" |
---|
| 265 | LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}" |
---|
[1396] | 266 | AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver) |
---|
[1449] | 267 | CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa" |
---|
[1396] | 268 | CACA_DRIVERS="${CACA_DRIVERS} cocoa" |
---|
| 269 | elif test "${enable_cocoa}" = "yes"; then |
---|
| 270 | AC_MSG_ERROR([cannot find Cocoa development files]) |
---|
| 271 | fi |
---|
| 272 | fi |
---|
| 273 | AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes") |
---|
| 274 | |
---|
[265] | 275 | if test "${enable_ncurses}" != "no"; then |
---|
[330] | 276 | ac_cv_my_have_ncurses="no" |
---|
[629] | 277 | AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h, |
---|
| 278 | [ncurses="no" |
---|
| 279 | AC_CHECK_LIB(ncursesw, initscr, |
---|
| 280 | [ncurses="-lncursesw"], |
---|
| 281 | [AC_CHECK_LIB(ncurses, initscr, |
---|
| 282 | [ncurses="-lncurses"])]) |
---|
| 283 | if test "${ncurses}" = "no"; then |
---|
| 284 | continue |
---|
| 285 | fi |
---|
| 286 | ac_cv_my_have_ncurses="yes" |
---|
| 287 | AC_DEFINE(USE_NCURSES, 1, Define to 1 to activate the ncurses backend driver) |
---|
| 288 | CACA_LIBS="${CACA_LIBS} ${ncurses}" |
---|
| 289 | CACA_DRIVERS="${CACA_DRIVERS} ncurses" |
---|
| 290 | dnl Check for resizeterm or resize_term |
---|
| 291 | SAVED_LIBS="${LIBS}" |
---|
| 292 | LIBS="${LIBS} ${ncurses}" |
---|
| 293 | AC_CHECK_FUNCS(resizeterm resize_term) |
---|
| 294 | LIBS="${SAVED_LIBS}" |
---|
[610] | 295 | break]) |
---|
[284] | 296 | if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then |
---|
| 297 | AC_MSG_ERROR([cannot find ncurses development files]) |
---|
| 298 | fi |
---|
[17] | 299 | fi |
---|
| 300 | |
---|
[568] | 301 | if test "${enable_vga}" = "yes"; then |
---|
| 302 | ac_cv_my_have_vga="yes" |
---|
[2265] | 303 | CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h -fno-stack-protector" |
---|
| 304 | CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -fno-stack-protector" |
---|
| 305 | CCASFLAGS="${CCASFLAGS} -I. -fno-stack-protector" |
---|
| 306 | LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 -fno-stack-protector" |
---|
[610] | 307 | AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver) |
---|
[568] | 308 | CACA_DRIVERS="${CACA_DRIVERS} vga" |
---|
| 309 | fi |
---|
[570] | 310 | AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes") |
---|
[568] | 311 | |
---|
[1360] | 312 | if test "${enable_debug}" = "yes"; then |
---|
| 313 | AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) |
---|
| 314 | fi |
---|
| 315 | |
---|
[1208] | 316 | if test "${enable_plugins}" = "yes"; then |
---|
| 317 | ac_cv_my_have_plugins="yes" |
---|
| 318 | AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins) |
---|
| 319 | CACA_LIBS="${CACA_LIBS} -ldl" |
---|
| 320 | else |
---|
[2517] | 321 | CACA_CFLAGS="${CACA_CFLAGS} ${X11_CFLAGS} ${GL_CFLAGS} ${FTGL_CFLAGS}" |
---|
| 322 | CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS} ${FTGL_LIBS}" |
---|
[1208] | 323 | fi |
---|
| 324 | AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes") |
---|
| 325 | |
---|
[284] | 326 | AC_MSG_CHECKING(valid output drivers) |
---|
| 327 | if test -z "${CACA_DRIVERS}"; then |
---|
| 328 | AC_MSG_RESULT(no) |
---|
| 329 | AC_MSG_ERROR([no output drivers were selected!]) |
---|
| 330 | else |
---|
[1198] | 331 | CACA_DRIVERS="${CACA_DRIVERS# *}" |
---|
[284] | 332 | AC_MSG_RESULT([${CACA_DRIVERS}]) |
---|
| 333 | fi |
---|
| 334 | |
---|
[333] | 335 | AC_SUBST(MATH_LIBS) |
---|
[2109] | 336 | AC_SUBST(ZLIB_LIBS) |
---|
[1074] | 337 | AC_SUBST(GETOPT_LIBS) |
---|
[2517] | 338 | AC_SUBST(CACA_CFLAGS) |
---|
[244] | 339 | AC_SUBST(CACA_LIBS) |
---|
[2517] | 340 | AC_SUBST(X11_CFLAGS) |
---|
[1208] | 341 | AC_SUBST(X11_LIBS) |
---|
[2517] | 342 | AC_SUBST(GL_CFLAGS) |
---|
[1208] | 343 | AC_SUBST(GL_LIBS) |
---|
[17] | 344 | |
---|
[2821] | 345 | # How to get the C99 types. See caca/caca_types.h.in for details about |
---|
| 346 | # the CACA_TYPES variable |
---|
[2299] | 347 | if test "${ac_cv_my_have_vga}" = "yes"; then |
---|
[2821] | 348 | CACA_TYPES=0 |
---|
[2299] | 349 | else |
---|
| 350 | AC_CHECK_HEADERS(stdint.h, |
---|
[2821] | 351 | [CACA_TYPES=1], |
---|
[2299] | 352 | [AC_CHECK_HEADERS(inttypes.h, |
---|
[2821] | 353 | [CACA_TYPES=2], |
---|
[2312] | 354 | [AC_CHECK_HEADERS(windows.h, |
---|
[2821] | 355 | [CACA_TYPES=3], |
---|
| 356 | [CACA_TYPES=0])])]) |
---|
[2299] | 357 | fi |
---|
[2821] | 358 | AC_SUBST(CACA_TYPES) |
---|
[2299] | 359 | |
---|
[125] | 360 | # Optimizations |
---|
| 361 | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
---|
| 362 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
---|
[1439] | 363 | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" |
---|
[125] | 364 | |
---|
[2053] | 365 | CACA_BINDINGS="" |
---|
| 366 | |
---|
[837] | 367 | # Build the C++ bindings? |
---|
[899] | 368 | ac_cv_my_have_cxx="no" |
---|
[1953] | 369 | if test "${enable_cxx}" != "no"; then |
---|
[2053] | 370 | AC_MSG_CHECKING([working <iostream>]) |
---|
| 371 | AC_LANG_PUSH(C++) |
---|
| 372 | AC_TRY_COMPILE( |
---|
| 373 | [#include <iostream>], |
---|
| 374 | [], |
---|
| 375 | [ac_cv_my_have_cxx="yes" |
---|
| 376 | CACA_BINDINGS="${CACA_BINDINGS} C++"]) |
---|
| 377 | AC_LANG_POP(C++) |
---|
| 378 | AC_MSG_RESULT([$ac_cv_my_have_cxx]) |
---|
[837] | 379 | fi |
---|
[899] | 380 | AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes") |
---|
[202] | 381 | |
---|
[2044] | 382 | # Build the .NET bindings? |
---|
| 383 | ac_cv_my_have_csharp="no" |
---|
| 384 | if test "${enable_csharp}" != "no"; then |
---|
[1954] | 385 | AC_PATH_PROG(GMCS, gmcs, no) |
---|
[2072] | 386 | AC_PATH_PROG(GACUTIL, gacutil, no) |
---|
| 387 | if test "${GMCS}" != "no" -a "${GACUTIL}" != "no"; then |
---|
[2044] | 388 | ac_cv_my_have_csharp="yes" |
---|
[2053] | 389 | CACA_BINDINGS="${CACA_BINDINGS} C#" |
---|
[1954] | 390 | fi |
---|
| 391 | fi |
---|
[2044] | 392 | AM_CONDITIONAL(USE_CSHARP, test "${ac_cv_my_have_csharp}" = "yes") |
---|
[1954] | 393 | |
---|
[1951] | 394 | # Build the Ruby bindings? |
---|
| 395 | ac_cv_my_have_ruby="no" |
---|
[1953] | 396 | if test "${enable_ruby}" != "no"; then |
---|
[1951] | 397 | AC_PATH_PROG(RUBY, ruby, no) |
---|
| 398 | if test "${RUBY}" != "no"; then |
---|
[2067] | 399 | RUBY_CFLAGS="-I$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"archdir"@:>@')" |
---|
| 400 | RUBY_LIBS="-L$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"libdir"@:>@') -l$(ruby -r rbconfig -e 'print Config::CONFIG@<:@"RUBY_SO_NAME"@:>@')" |
---|
[1962] | 401 | RUBY_SITEARCHDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitearchdir"@:>@'` |
---|
[2022] | 402 | RUBY_SITELIBDIR=`ruby -r rbconfig -e 'print Config::CONFIG@<:@"sitelibdir"@:>@'` |
---|
[2067] | 403 | AC_SUBST(RUBY_CFLAGS) |
---|
| 404 | AC_SUBST(RUBY_LIBS) |
---|
[1962] | 405 | AC_SUBST(RUBY_SITEARCHDIR) |
---|
[2022] | 406 | AC_SUBST(RUBY_SITELIBDIR) |
---|
[2067] | 407 | CPPFLAGS="${CPPFLAGS} ${RUBY_CFLAGS}" |
---|
| 408 | AC_CHECK_HEADERS([ruby.h], |
---|
[2053] | 409 | [ac_cv_my_have_ruby="yes" |
---|
| 410 | CACA_BINDINGS="${CACA_BINDINGS} Ruby"]) |
---|
[1951] | 411 | fi |
---|
| 412 | fi |
---|
| 413 | AM_CONDITIONAL(USE_RUBY, test "${ac_cv_my_have_ruby}" = "yes") |
---|
| 414 | |
---|
[2053] | 415 | AC_MSG_CHECKING(available language bindings) |
---|
| 416 | if test -z "${CACA_BINDINGS}"; then |
---|
| 417 | AC_MSG_RESULT(no) |
---|
| 418 | else |
---|
| 419 | CACA_BINDINGS="${CACA_BINDINGS# *}" |
---|
| 420 | AC_MSG_RESULT([${CACA_BINDINGS}]) |
---|
| 421 | fi |
---|
| 422 | |
---|
[866] | 423 | # Build cacaserver? |
---|
[976] | 424 | ac_cv_my_have_network="no" |
---|
| 425 | AC_CHECK_HEADERS(sys/socket.h, |
---|
| 426 | [ac_cv_my_have_network="yes"]) |
---|
| 427 | AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes") |
---|
[866] | 428 | |
---|
[288] | 429 | # Use Imlib2? |
---|
| 430 | if test "${enable_imlib2}" != "no"; then |
---|
[2302] | 431 | PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [IMLIB2="no"]) |
---|
| 432 | if test "${IMLIB2}" = "yes"; then |
---|
[1398] | 433 | AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2) |
---|
[288] | 434 | fi |
---|
[224] | 435 | fi |
---|
[217] | 436 | |
---|
[747] | 437 | # Build development tools? |
---|
[2302] | 438 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [PANGOFT2="no"]) |
---|
| 439 | AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" = "yes") |
---|
[747] | 440 | |
---|
[207] | 441 | # Build documentation? |
---|
[346] | 442 | DOXYGEN="no" |
---|
| 443 | LATEX="no" |
---|
| 444 | if test "${enable_doc}" != "no"; then |
---|
| 445 | AC_PATH_PROG(DOXYGEN, doxygen, no) |
---|
[1398] | 446 | if test "${DOXYGEN}" != "no"; then |
---|
| 447 | # Build LaTeX documentation? |
---|
| 448 | AC_PATH_PROG(LATEX, pdflatex, no) |
---|
[1912] | 449 | AC_PATH_PROG(KPSEWHICH, kpsewhich, no) |
---|
[1398] | 450 | AC_PATH_PROG(DVIPS, dvips, no) |
---|
[1912] | 451 | if test "${DVIPS}" = "no" -o "${KPSEWHICH}" = "no"; then |
---|
[1398] | 452 | LATEX="no" |
---|
| 453 | fi |
---|
[1912] | 454 | if test "${LATEX}" != "no"; then |
---|
| 455 | AC_MSG_CHECKING(for a4.sty and a4wide.sty) |
---|
| 456 | if "${KPSEWHICH}" a4.sty >/dev/null 2>&1; then |
---|
| 457 | if "${KPSEWHICH}" a4wide.sty >/dev/null 2>&1; then |
---|
| 458 | AC_MSG_RESULT(yes) |
---|
| 459 | else |
---|
| 460 | LATEX="no" |
---|
| 461 | AC_MSG_RESULT(no) |
---|
| 462 | fi |
---|
[1829] | 463 | else |
---|
| 464 | LATEX="no" |
---|
| 465 | AC_MSG_RESULT(no) |
---|
| 466 | fi |
---|
[1398] | 467 | fi |
---|
[346] | 468 | fi |
---|
[313] | 469 | fi |
---|
[346] | 470 | AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no") |
---|
| 471 | AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no") |
---|
[207] | 472 | |
---|
[2301] | 473 | # Use cppunit for unit tests? |
---|
[2302] | 474 | PKG_CHECK_MODULES(CPPUNIT, cppunit, [CPPUNIT="yes"], [CPPUNIT="no"]) |
---|
| 475 | AM_CONDITIONAL(USE_CPPUNIT, test "$CPPUNIT" = "yes") |
---|
[2301] | 476 | |
---|
[2101] | 477 | # Use zzuf for fuzzing tests? |
---|
| 478 | ZZUF="no" |
---|
| 479 | if test "${enable_zzuf}" != "no"; then |
---|
| 480 | AC_PATH_PROG(ZZUF, zzuf, no) |
---|
| 481 | fi |
---|
| 482 | AM_CONDITIONAL(USE_ZZUF, test "${ZZUF}" != "no") |
---|
| 483 | |
---|
[245] | 484 | AC_CONFIG_FILES([ |
---|
[17] | 485 | Makefile |
---|
[568] | 486 | kernel/Makefile |
---|
[536] | 487 | caca/Makefile |
---|
[538] | 488 | src/Makefile |
---|
[2101] | 489 | examples/Makefile |
---|
[2103] | 490 | tests/Makefile |
---|
[742] | 491 | tools/Makefile |
---|
[2955] | 492 | caca-sharp/Makefile |
---|
[899] | 493 | cxx/Makefile |
---|
[2060] | 494 | python/Makefile |
---|
[1951] | 495 | ruby/Makefile |
---|
[207] | 496 | doc/Makefile |
---|
[2900] | 497 | win32/Makefile |
---|
[17] | 498 | ]) |
---|
[729] | 499 | AC_CONFIG_FILES([ |
---|
[2821] | 500 | caca/caca_types.h |
---|
[729] | 501 | caca/caca.pc |
---|
[2955] | 502 | caca-sharp/caca-sharp.dll.config |
---|
[2425] | 503 | cxx/caca++.pc |
---|
[729] | 504 | doc/doxygen.cfg |
---|
| 505 | ]) |
---|
[245] | 506 | AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config]) |
---|
| 507 | AC_OUTPUT |
---|
[17] | 508 | |
---|