PageRenderTime 26ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/abuse-0.7.1/configure.ac

#
m4 | 99 lines | 77 code | 13 blank | 9 comment | 0 complexity | aa8ff449e2f0b4a1c7ea8650bcb2b24c MD5 | raw file
Possible License(s): GPL-2.0
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(abuse, 0.7.1)
  3. AC_CONFIG_AUX_DIR(.auto)
  4. AM_INIT_AUTOMAKE
  5. AM_CONFIG_HEADER(config.h)
  6. dnl Checks for programs.
  7. AC_PROG_LIBTOOL
  8. AC_ISC_POSIX
  9. AC_PROG_CC
  10. AC_PROG_CPP
  11. AC_PROG_CXX
  12. AC_PROG_INSTALL
  13. AC_C_BIGENDIAN
  14. dnl Check for X
  15. AC_PATH_X
  16. X_LIBS=-L$x_libraries
  17. dnl Figure out where the datafiles will be
  18. EXPDATADIR="-DEXPDATADIR=\\\"$datadir/games/abuse\\\""
  19. AC_SUBST(EXPDATADIR)
  20. dnl Checks for libraries
  21. dnl Do we need to link against something for X shared memory support?
  22. AC_CHECK_LIB(Xext,XShmAttach,:,[
  23. AC_CHECK_LIB(XextSam,XShmAttach,LIBS="$LIBS -lXextSam",,$X_LIBS -lX11 -lXext)
  24. ],$X_LIBS -lX11)
  25. dnl Checks for Solaris compatibility
  26. AC_CHECK_LIB(m,pow,LIBS="$LIBS -lm")
  27. AC_CHECK_LIB(socket,socket,LIBS="$LIBS -lsocket")
  28. AC_CHECK_LIB(nsl,gethostbyname,LIBS="$LIBS -lnsl")
  29. dnl Check for SDL
  30. SDL_VERSION=1.1.6
  31. AM_PATH_SDL($SDL_VERSION, :,
  32. AC_MSG_ERROR([*** SDL version $SDL_VERSION or above not found!]))
  33. CFLAGS="$CFLAGS $SDL_CFLAGS"
  34. LIBS="$LIBS $SDL_LIBS $X_LIBS -L/usr/lib"
  35. # Optimizations
  36. CPPFLAGS="${CPPFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  37. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  38. CPPFLAGS="${CPPFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Waggregate-return -Wsign-compare"
  39. dnl Checks for header files
  40. AC_HEADER_DIRENT
  41. AC_HEADER_STDC
  42. AC_CHECK_HEADERS(fcntl.h malloc.h string.h sys/ioctl.h sys/time.h unistd.h)
  43. dnl Checks for functions
  44. AC_FUNC_MEMCMP
  45. AC_CHECK_FUNCS(atexit on_exit strstr gettimeofday)
  46. dnl Check for OpenGL
  47. dnl Should this be more thorough?
  48. dnl For OpenGL support on OSX it's better to use Project Builder as -lGL
  49. dnl doesn't seem to work this way.
  50. AC_MSG_CHECKING(for OpenGL support)
  51. have_opengl=no
  52. AC_TRY_COMPILE([
  53. #ifdef WIN32
  54. #include <windows.h>
  55. #elif defined(__APPLE__) && defined(__MACH__)
  56. /* #include <OpenGL/gl.h>*/
  57. #error /* Error so the compile fails on OSX */
  58. #else
  59. #include <GL/gl.h>
  60. #endif
  61. ],[
  62. ],[
  63. have_opengl=yes
  64. ])
  65. AC_MSG_RESULT($have_opengl)
  66. if test x$have_opengl = xyes; then
  67. CFLAGS="$CFLAGS -DHAVE_OPENGL"
  68. CXXFLAGS="$CXXFLAGS -DHAVE_OPENGL"
  69. LIBS="$LIBS -lGL -lpthread"
  70. fi
  71. AC_OUTPUT([
  72. Makefile
  73. abuse.6
  74. src/Makefile
  75. src/lisp/Makefile
  76. src/net/Makefile
  77. src/imlib/Makefile
  78. src/sdlport/Makefile])
  79. echo "
  80. ------ Configuration for $PACKAGE $VERSION ------
  81. Compiler: ${CC} (version `${CC} --version`)
  82. Install prefix: $prefix
  83. SDL version: `sdl-config --version`
  84. OpenGL support: $have_opengl
  85. Now type 'make' to build $PACKAGE.
  86. "