| 1 | # $Id$ |
|---|
| 2 | |
|---|
| 3 | AC_INIT(caca/caca.c) |
|---|
| 4 | |
|---|
| 5 | AC_PREREQ(2.50) |
|---|
| 6 | AC_CONFIG_AUX_DIR(autotools) |
|---|
| 7 | AC_CANONICAL_SYSTEM |
|---|
| 8 | |
|---|
| 9 | AM_INIT_AUTOMAKE(libcaca, 0.99.beta12) |
|---|
| 10 | LT_VERSION="99:0:99" |
|---|
| 11 | AC_SUBST(LT_VERSION) |
|---|
| 12 | AM_CONFIG_HEADER(config.h) |
|---|
| 13 | |
|---|
| 14 | AM_PROG_CC_C_O |
|---|
| 15 | AC_PROG_CPP |
|---|
| 16 | AC_PROG_CXX |
|---|
| 17 | AC_PROG_CXXCPP |
|---|
| 18 | _AM_DEPENDENCIES([OBJC]) |
|---|
| 19 | OBJC="${CC}" |
|---|
| 20 | AC_SUBST(OBJC) |
|---|
| 21 | AC_SUBST(OBJCFLAGS) |
|---|
| 22 | AM_PROG_AS |
|---|
| 23 | |
|---|
| 24 | AC_LIBTOOL_WIN32_DLL |
|---|
| 25 | AM_PROG_LIBTOOL |
|---|
| 26 | AC_LIBTOOL_CXX |
|---|
| 27 | |
|---|
| 28 | AC_C_CONST |
|---|
| 29 | AC_C_INLINE |
|---|
| 30 | AC_TYPE_SIGNAL |
|---|
| 31 | |
|---|
| 32 | dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right |
|---|
| 33 | dnl now otherwise it might be set in an obscure if statement. Same thing for |
|---|
| 34 | dnl PKG_PROG_PKG_CONFIG which needs to be called first. |
|---|
| 35 | AC_EGREP_CPP(yes, foo) |
|---|
| 36 | PKG_PROG_PKG_CONFIG() |
|---|
| 37 | m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) |
|---|
| 38 | if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then |
|---|
| 39 | export PKG_CONFIG_LIBDIR=/dev/null |
|---|
| 40 | fi |
|---|
| 41 | |
|---|
| 42 | dnl output driver features |
|---|
| 43 | AC_ARG_ENABLE(slang, |
|---|
| 44 | [ --enable-slang slang graphics support (autodetected)]) |
|---|
| 45 | AC_ARG_ENABLE(ncurses, |
|---|
| 46 | [ --enable-ncurses ncurses graphics support (autodetected)]) |
|---|
| 47 | AC_ARG_ENABLE(win32, |
|---|
| 48 | [ --enable-win32 Windows console support (autodetected)]) |
|---|
| 49 | AC_ARG_ENABLE(conio, |
|---|
| 50 | [ --enable-conio DOS conio.h graphics support (autodetected)]) |
|---|
| 51 | AC_ARG_ENABLE(x11, |
|---|
| 52 | [ --enable-x11 X11 support (autodetected)]) |
|---|
| 53 | AC_ARG_ENABLE(gl, |
|---|
| 54 | [ --enable-gl OpenGL support (autodetected)]) |
|---|
| 55 | AC_ARG_ENABLE(cocoa, |
|---|
| 56 | [ --enable-cocoa Cocoa support (autodetected)]) |
|---|
| 57 | AC_ARG_ENABLE(network, |
|---|
| 58 | [ --enable-network Network support (autodetected)]) |
|---|
| 59 | AC_ARG_ENABLE(vga, |
|---|
| 60 | [ --enable-vga VGA support (default disabled)]) |
|---|
| 61 | |
|---|
| 62 | dnl language bindings |
|---|
| 63 | AC_ARG_ENABLE(cxx, |
|---|
| 64 | [ --enable-cxx C++ bindings (default disabled)]) |
|---|
| 65 | |
|---|
| 66 | dnl example programs features |
|---|
| 67 | AC_ARG_ENABLE(imlib2, |
|---|
| 68 | [ --enable-imlib2 Imlib2 graphics support (autodetected)]) |
|---|
| 69 | |
|---|
| 70 | dnl conditional builds |
|---|
| 71 | AC_ARG_ENABLE(debug, |
|---|
| 72 | [ --enable-debug build debug versions of the library]) |
|---|
| 73 | AC_ARG_ENABLE(plugins, |
|---|
| 74 | [ --enable-plugins build X11 and GL drivers as plugins]) |
|---|
| 75 | AC_ARG_ENABLE(doc, |
|---|
| 76 | [ --enable-doc build documentation (needs doxygen and LaTeX)]) |
|---|
| 77 | |
|---|
| 78 | AC_CHECK_HEADERS(stdio.h stdarg.h signal.h sys/ioctl.h sys/time.h inttypes.h endian.h unistd.h arpa/inet.h netinet/in.h winsock2.h errno.h locale.h getopt.h dlfcn.h) |
|---|
| 79 | AC_CHECK_FUNCS(signal ioctl vsnprintf getenv putenv strcasecmp htons) |
|---|
| 80 | AC_CHECK_FUNCS(usleep gettimeofday) |
|---|
| 81 | |
|---|
| 82 | AC_CHECK_FUNCS(getopt_long, |
|---|
| 83 | [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)], |
|---|
| 84 | [AC_CHECK_LIB(gnugetopt, getopt_long, |
|---|
| 85 | [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.) |
|---|
| 86 | GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])]) |
|---|
| 87 | AC_SUBST(GETOPT_LIBS) |
|---|
| 88 | |
|---|
| 89 | AC_MSG_CHECKING(for Sleep) |
|---|
| 90 | AC_TRY_COMPILE([#include <windows.h>],[Sleep(42);], |
|---|
| 91 | [AC_MSG_RESULT(yes) |
|---|
| 92 | AC_DEFINE(HAVE_SLEEP, 1, [Define to 1 if you have the `Sleep' function.])], |
|---|
| 93 | [AC_MSG_RESULT(no)]) |
|---|
| 94 | |
|---|
| 95 | AC_MSG_CHECKING(for fsin/fcos) |
|---|
| 96 | AC_TRY_COMPILE([],[asm("fsin\n\tfcos");], |
|---|
| 97 | [AC_MSG_RESULT(yes) |
|---|
| 98 | AC_DEFINE(HAVE_FSIN_FCOS, 1, [Define to 1 if you have the `fsin' and `fcos' operands.])], |
|---|
| 99 | [AC_MSG_RESULT(no)]) |
|---|
| 100 | |
|---|
| 101 | AC_MSG_CHECKING(for fldln2/fxch/fyl2x) |
|---|
| 102 | AC_TRY_COMPILE([],[asm("fldln2; fldln2; fxch; fyl2x");], |
|---|
| 103 | [AC_MSG_RESULT(yes) |
|---|
| 104 | AC_DEFINE(HAVE_FLDLN2, 1, [Define to 1 if you have the `fldln2' and other floating points operands.])], |
|---|
| 105 | [AC_MSG_RESULT(no)]) |
|---|
| 106 | |
|---|
| 107 | AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm") |
|---|
| 108 | |
|---|
| 109 | CACA_DRIVERS="" |
|---|
| 110 | |
|---|
| 111 | if test "${enable_conio}" != "no"; then |
|---|
| 112 | ac_cv_my_have_conio="no" |
|---|
| 113 | AC_CHECK_HEADERS(conio.h, |
|---|
| 114 | [AC_MSG_CHECKING(for ScreenUpdate in pc.h) |
|---|
| 115 | AC_EGREP_HEADER(ScreenUpdate, pc.h, |
|---|
| 116 | [ac_cv_my_have_conio="yes" |
|---|
| 117 | AC_MSG_RESULT(yes) |
|---|
| 118 | AC_DEFINE(SCREENUPDATE_IN_PC_H, 1, |
|---|
| 119 | Define to 1 if <pc.h> defines ScreenUpdate.) |
|---|
| 120 | AC_DEFINE(USE_CONIO, 1, Define to 1 to activate the conio.h backend driver) |
|---|
| 121 | CACA_DRIVERS="${CACA_DRIVERS} conio"], |
|---|
| 122 | [AC_MSG_RESULT(no)])]) |
|---|
| 123 | if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then |
|---|
| 124 | AC_MSG_ERROR([cannot find conio.h]) |
|---|
| 125 | fi |
|---|
| 126 | fi |
|---|
| 127 | |
|---|
| 128 | if test "${enable_win32}" != "no"; then |
|---|
| 129 | ac_cv_my_have_win32="no" |
|---|
| 130 | AC_CHECK_HEADERS(windows.h, |
|---|
| 131 | [AC_MSG_CHECKING(for AllocConsole in windows.h) |
|---|
| 132 | AC_EGREP_HEADER(AllocConsole, windows.h, |
|---|
| 133 | [ac_cv_my_have_win32="yes" |
|---|
| 134 | AC_MSG_RESULT(yes) |
|---|
| 135 | AC_DEFINE(ALLOCCONSOLE_IN_WINDOWS_H, 1, |
|---|
| 136 | Define to 1 if <windows.h> defines AllocConsole.) |
|---|
| 137 | AC_DEFINE(USE_WIN32, 1, Define to 1 to activate the win32 backend driver) |
|---|
| 138 | CACA_DRIVERS="${CACA_DRIVERS} win32"], |
|---|
| 139 | [AC_MSG_RESULT(no)])]) |
|---|
| 140 | if test "${ac_cv_my_have_win32}" = "no" -a "${enable_win32}" = "yes"; then |
|---|
| 141 | AC_MSG_ERROR([cannot find win32 console development files]) |
|---|
| 142 | fi |
|---|
| 143 | fi |
|---|
| 144 | |
|---|
| 145 | if test "${enable_slang}" != "no"; then |
|---|
| 146 | ac_cv_my_have_slang="no" |
|---|
| 147 | AC_CHECK_HEADERS(slang.h slang/slang.h, |
|---|
| 148 | [ac_cv_my_have_slang="yes" |
|---|
| 149 | AC_DEFINE(USE_SLANG, 1, Define to 1 to activate the slang backend driver) |
|---|
| 150 | AC_CHECK_LIB(slang, SLsmg_utf8_enable, |
|---|
| 151 | [AC_DEFINE(HAVE_SLSMG_UTF8_ENABLE, 1, Define to 1 if you have the `SLsmg_utf8_enable' function.)]) |
|---|
| 152 | CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1" |
|---|
| 153 | CACA_LIBS="${CACA_LIBS} -lslang" |
|---|
| 154 | CACA_DRIVERS="${CACA_DRIVERS} slang" |
|---|
| 155 | break]) |
|---|
| 156 | if test "${ac_cv_my_have_slang}" = "no" -a "${enable_slang}" = "yes"; then |
|---|
| 157 | AC_MSG_ERROR([cannot find slang development files]) |
|---|
| 158 | fi |
|---|
| 159 | fi |
|---|
| 160 | |
|---|
| 161 | if test "${enable_x11}" != "no"; then |
|---|
| 162 | AC_PATH_X |
|---|
| 163 | AC_CHECK_LIB(X11, XOpenDisplay, |
|---|
| 164 | [ac_cv_my_have_x11="yes" |
|---|
| 165 | if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi |
|---|
| 166 | if test -n "${x_libraries}"; then X_LIBS="-L${x_libraries}"; fi |
|---|
| 167 | AC_DEFINE(USE_X11, 1, Define to 1 to activate the X11 backend driver) |
|---|
| 168 | CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}" |
|---|
| 169 | X11_LIBS="${X11_LIBS} -lX11 ${X_LIBS}" |
|---|
| 170 | CACA_DRIVERS="${CACA_DRIVERS} x11"], |
|---|
| 171 | [ac_cv_my_have_x11="no"], |
|---|
| 172 | [[`if test -n "${x_libraries}"; then echo -L${x_libraries}; fi`]]) |
|---|
| 173 | AC_CHECK_HEADERS(X11/XKBlib.h) |
|---|
| 174 | if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then |
|---|
| 175 | AC_MSG_ERROR([cannot find X11 development files]) |
|---|
| 176 | fi |
|---|
| 177 | fi |
|---|
| 178 | |
|---|
| 179 | if test "${enable_gl}" != "no"; then |
|---|
| 180 | ac_cv_my_have_gl="no" |
|---|
| 181 | AC_CHECK_HEADERS(GL/gl.h OpenGL/gl.h, |
|---|
| 182 | [AC_CHECK_HEADERS(GL/glut.h, |
|---|
| 183 | [AC_CHECK_LIB(glut, glutCloseFunc, |
|---|
| 184 | [AC_DEFINE(HAVE_GLUTCLOSEFUNC, 1, Define to 1 if you have the `glutCloseFunc' function.)]) |
|---|
| 185 | AC_CHECK_LIB(glut, glutMainLoopEvent, |
|---|
| 186 | [ac_cv_my_have_gl="yes"]) |
|---|
| 187 | AC_CHECK_LIB(glut, glutCheckLoop, |
|---|
| 188 | [ac_cv_my_have_gl="yes" |
|---|
| 189 | AC_DEFINE(HAVE_GLUTCHECKLOOP, 1, Define to 1 if you have the `glutCheckLoop' function.)])]) |
|---|
| 190 | break]) |
|---|
| 191 | if test "${ac_cv_my_have_gl}" = "yes"; then |
|---|
| 192 | AC_DEFINE(USE_GL, 1, Define to 1 to activate the OpenGL backend driver) |
|---|
| 193 | GL_LIBS="${GL_LIBS} -lGL -lglut" |
|---|
| 194 | CACA_DRIVERS="${CACA_DRIVERS} gl" |
|---|
| 195 | elif test "${enable_gl}" = "yes"; then |
|---|
| 196 | AC_MSG_ERROR([cannot find OpenGL+FreeGLUT development files]) |
|---|
| 197 | fi |
|---|
| 198 | fi |
|---|
| 199 | |
|---|
| 200 | if test "${enable_cocoa}" != "no"; then |
|---|
| 201 | ac_cv_my_have_cocoa="no" |
|---|
| 202 | AC_CHECK_HEADERS(Cocoa/Cocoa.h, |
|---|
| 203 | [ac_cv_my_have_cocoa="yes"]) |
|---|
| 204 | if test "${ac_cv_my_have_cocoa}" = "yes"; then |
|---|
| 205 | case x${target} in |
|---|
| 206 | xpowerpc*darwin*) |
|---|
| 207 | # 10.3 needed to link with X11 |
|---|
| 208 | MACOSX_SDK=/Developer/SDKs/MacOSX10.3.9.sdk |
|---|
| 209 | GCC_VERSION=3.3 |
|---|
| 210 | ARCH="-arch ppc" |
|---|
| 211 | MACOSX_SDK_CFLAGS="-nostdinc -isystem ${MACOSX_SDK}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOSX_SDK}/usr/include" |
|---|
| 212 | 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" |
|---|
| 213 | MACOSX_SDK_LDFLAGS="-L${MACOSX_SDK}/usr/lib/gcc/darwin -L${MACOSX_SDK}/usr/lib/gcc/darwin/${GCC_VERSION} -L${MACOSX_SDK}/usr/lib" |
|---|
| 214 | ;; |
|---|
| 215 | x*86*darwin*) |
|---|
| 216 | MACOSX_SDK=/Developer/SDKs/MacOSX10.4u.sdk |
|---|
| 217 | GCC_VERSION=4.0 |
|---|
| 218 | ARCH="-arch i386" |
|---|
| 219 | MACOSX_SDK_CFLAGS="-isysroot ${MACOSX_SDK}" |
|---|
| 220 | MACOSX_SDK_CXXFLAGS="${MACOSX_SDK_CFLAGS}" |
|---|
| 221 | ;; |
|---|
| 222 | esac |
|---|
| 223 | CC=gcc-${GCC_VERSION} |
|---|
| 224 | CXX=g++-${GCC_VERSION} |
|---|
| 225 | MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks" |
|---|
| 226 | CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}" |
|---|
| 227 | CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}" |
|---|
| 228 | CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}" |
|---|
| 229 | OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}" |
|---|
| 230 | LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}" |
|---|
| 231 | AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver) |
|---|
| 232 | CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa" |
|---|
| 233 | CACA_DRIVERS="${CACA_DRIVERS} cocoa" |
|---|
| 234 | elif test "${enable_cocoa}" = "yes"; then |
|---|
| 235 | AC_MSG_ERROR([cannot find Cocoa development files]) |
|---|
| 236 | fi |
|---|
| 237 | fi |
|---|
| 238 | AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes") |
|---|
| 239 | |
|---|
| 240 | if test "${enable_ncurses}" != "no"; then |
|---|
| 241 | ac_cv_my_have_ncurses="no" |
|---|
| 242 | AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses/ncurses.h ncurses.h curses.h, |
|---|
| 243 | [ncurses="no" |
|---|
| 244 | AC_CHECK_LIB(ncursesw, initscr, |
|---|
| 245 | [ncurses="-lncursesw"], |
|---|
| 246 | [AC_CHECK_LIB(ncurses, initscr, |
|---|
| 247 | [ncurses="-lncurses"])]) |
|---|
| 248 | if test "${ncurses}" = "no"; then |
|---|
| 249 | continue |
|---|
| 250 | fi |
|---|
| 251 | ac_cv_my_have_ncurses="yes" |
|---|
| 252 | AC_DEFINE(USE_NCURSES, 1, Define to 1 to activate the ncurses backend driver) |
|---|
| 253 | CACA_LIBS="${CACA_LIBS} ${ncurses}" |
|---|
| 254 | CACA_DRIVERS="${CACA_DRIVERS} ncurses" |
|---|
| 255 | dnl Check for resizeterm or resize_term |
|---|
| 256 | SAVED_LIBS="${LIBS}" |
|---|
| 257 | LIBS="${LIBS} ${ncurses}" |
|---|
| 258 | AC_CHECK_FUNCS(resizeterm resize_term) |
|---|
| 259 | LIBS="${SAVED_LIBS}" |
|---|
| 260 | break]) |
|---|
| 261 | if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then |
|---|
| 262 | AC_MSG_ERROR([cannot find ncurses development files]) |
|---|
| 263 | fi |
|---|
| 264 | fi |
|---|
| 265 | |
|---|
| 266 | if test "${enable_vga}" = "yes"; then |
|---|
| 267 | ac_cv_my_have_vga="yes" |
|---|
| 268 | CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h" |
|---|
| 269 | CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall" |
|---|
| 270 | CCASFLAGS="${CCASFLAGS} -I." |
|---|
| 271 | LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000" |
|---|
| 272 | AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver) |
|---|
| 273 | CACA_DRIVERS="${CACA_DRIVERS} vga" |
|---|
| 274 | fi |
|---|
| 275 | AM_CONDITIONAL(USE_KERNEL, test "${ac_cv_my_have_vga}" = "yes") |
|---|
| 276 | |
|---|
| 277 | if test "${enable_debug}" = "yes"; then |
|---|
| 278 | AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) |
|---|
| 279 | fi |
|---|
| 280 | |
|---|
| 281 | if test "${enable_plugins}" = "yes"; then |
|---|
| 282 | ac_cv_my_have_plugins="yes" |
|---|
| 283 | AC_DEFINE(USE_PLUGINS, 1, Define to 1 to activate plugins) |
|---|
| 284 | CACA_LIBS="${CACA_LIBS} -ldl" |
|---|
| 285 | else |
|---|
| 286 | CACA_LIBS="${CACA_LIBS} ${X11_LIBS} ${GL_LIBS}" |
|---|
| 287 | fi |
|---|
| 288 | AM_CONDITIONAL(USE_PLUGINS, test "${ac_cv_my_have_plugins}" = "yes") |
|---|
| 289 | |
|---|
| 290 | AC_MSG_CHECKING(valid output drivers) |
|---|
| 291 | if test -z "${CACA_DRIVERS}"; then |
|---|
| 292 | AC_MSG_RESULT(no) |
|---|
| 293 | AC_MSG_ERROR([no output drivers were selected!]) |
|---|
| 294 | else |
|---|
| 295 | CACA_DRIVERS="${CACA_DRIVERS# *}" |
|---|
| 296 | AC_MSG_RESULT([${CACA_DRIVERS}]) |
|---|
| 297 | fi |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | AC_SUBST(MATH_LIBS) |
|---|
| 301 | AC_SUBST(GETOPT_LIBS) |
|---|
| 302 | AC_SUBST(CACA_LIBS) |
|---|
| 303 | AC_SUBST(X11_LIBS) |
|---|
| 304 | AC_SUBST(GL_LIBS) |
|---|
| 305 | |
|---|
| 306 | # Optimizations |
|---|
| 307 | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
|---|
| 308 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
|---|
| 309 | # [Jylam] Removed -Wshadow in order to avoid ncurses/gl conflict |
|---|
| 310 | # (Comme quoi on n'est pas les seuls porcs) |
|---|
| 311 | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" |
|---|
| 312 | |
|---|
| 313 | # Build the C++ bindings? |
|---|
| 314 | ac_cv_my_have_cxx="no" |
|---|
| 315 | if test "${enable_cxx}" = "yes"; then |
|---|
| 316 | ac_cv_my_have_cxx="yes" |
|---|
| 317 | fi |
|---|
| 318 | AM_CONDITIONAL(USE_CXX, test "${ac_cv_my_have_cxx}" = "yes") |
|---|
| 319 | |
|---|
| 320 | # Build cacaserver? |
|---|
| 321 | ac_cv_my_have_network="no" |
|---|
| 322 | AC_CHECK_HEADERS(sys/socket.h, |
|---|
| 323 | [ac_cv_my_have_network="yes"]) |
|---|
| 324 | AM_CONDITIONAL(USE_NETWORK, test "${ac_cv_my_have_network}" = "yes") |
|---|
| 325 | |
|---|
| 326 | # Use Imlib2? |
|---|
| 327 | if test "${enable_imlib2}" != "no"; then |
|---|
| 328 | IMLIB2="no" |
|---|
| 329 | PKG_CHECK_MODULES(IMLIB2, imlib2, [IMLIB2="yes"], [AC_MSG_RESULT(no)]) |
|---|
| 330 | if test "${IMLIB2}" != "no"; then |
|---|
| 331 | AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2) |
|---|
| 332 | fi |
|---|
| 333 | fi |
|---|
| 334 | |
|---|
| 335 | # Build development tools? |
|---|
| 336 | PANGOFT2="no" |
|---|
| 337 | PKG_CHECK_MODULES(PANGOFT2, pangoft2, [PANGOFT2="yes"], [AC_MSG_RESULT(no)]) |
|---|
| 338 | AM_CONDITIONAL(USE_PANGO, test "${PANGOFT2}" != "no") |
|---|
| 339 | |
|---|
| 340 | # Build documentation? |
|---|
| 341 | DOXYGEN="no" |
|---|
| 342 | LATEX="no" |
|---|
| 343 | if test "${enable_doc}" != "no"; then |
|---|
| 344 | AC_PATH_PROG(DOXYGEN, doxygen, no) |
|---|
| 345 | if test "${DOXYGEN}" != "no"; then |
|---|
| 346 | # Build LaTeX documentation? |
|---|
| 347 | AC_PATH_PROG(LATEX, pdflatex, no) |
|---|
| 348 | AC_PATH_PROG(DVIPS, dvips, no) |
|---|
| 349 | if test "${DVIPS}" = "no"; then |
|---|
| 350 | LATEX="no" |
|---|
| 351 | fi |
|---|
| 352 | AC_MSG_CHECKING(for a4wide.sty) |
|---|
| 353 | if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then |
|---|
| 354 | AC_MSG_RESULT(yes) |
|---|
| 355 | elif test -f /usr/share/texmf-tetex/tex/latex/a4wide/a4wide.sty; then |
|---|
| 356 | AC_MSG_RESULT(yes) |
|---|
| 357 | elif test -f /usr/share/texmf-texlive/tex/latex/ltxmisc/a4wide.sty; then |
|---|
| 358 | AC_MSG_RESULT(yes) |
|---|
| 359 | else |
|---|
| 360 | LATEX="no" |
|---|
| 361 | AC_MSG_RESULT(no) |
|---|
| 362 | fi |
|---|
| 363 | fi |
|---|
| 364 | fi |
|---|
| 365 | AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no") |
|---|
| 366 | AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no") |
|---|
| 367 | |
|---|
| 368 | AC_CONFIG_FILES([ |
|---|
| 369 | Makefile |
|---|
| 370 | kernel/Makefile |
|---|
| 371 | cucul/Makefile |
|---|
| 372 | caca/Makefile |
|---|
| 373 | src/Makefile |
|---|
| 374 | test/Makefile |
|---|
| 375 | tools/Makefile |
|---|
| 376 | cxx/Makefile |
|---|
| 377 | doc/Makefile |
|---|
| 378 | autotools/Makefile |
|---|
| 379 | msvc/Makefile |
|---|
| 380 | ]) |
|---|
| 381 | AC_CONFIG_FILES([ |
|---|
| 382 | cucul/cucul.pc |
|---|
| 383 | caca/caca.pc |
|---|
| 384 | doc/doxygen.cfg |
|---|
| 385 | ]) |
|---|
| 386 | AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config]) |
|---|
| 387 | AC_OUTPUT |
|---|
| 388 | |
|---|