You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

173 lines
5.0 KiB

  1. # $Id$
  2. AC_INIT(libpipi, 0.0)
  3. AC_PREREQ(2.50)
  4. AC_CONFIG_AUX_DIR(.auto)
  5. AC_CANONICAL_SYSTEM
  6. AM_INIT_AUTOMAKE([no-define tar-ustar])
  7. dnl AM_MAINTAINER_MODE
  8. AM_CONFIG_HEADER(config.h)
  9. LT_MAJOR="0"
  10. LT_MINOR="0"
  11. LT_MICRO="0"
  12. AC_SUBST(LT_MAJOR)
  13. AC_SUBST(LT_MINOR)
  14. AC_SUBST(LT_MICRO)
  15. LT_VERSION="$LT_MAJOR:$LT_MINOR:$LT_MICRO"
  16. AC_SUBST(LT_VERSION)
  17. AM_PROG_CC_C_O
  18. AC_PROG_CPP
  19. AC_PROG_OBJC
  20. _AM_DEPENDENCIES([OBJC])
  21. OBJC="${CC}"
  22. AC_SUBST(OBJC)
  23. AC_SUBST(OBJCFLAGS)
  24. AC_LIBTOOL_WIN32_DLL
  25. AM_PROG_LIBTOOL
  26. AC_LIBTOOL_CXX
  27. AC_C_CONST
  28. AC_C_INLINE
  29. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  30. dnl now otherwise it might be set in an obscure if statement. Same thing for
  31. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  32. AC_EGREP_CPP(yes, foo)
  33. PKG_PROG_PKG_CONFIG()
  34. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  35. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  36. export PKG_CONFIG_LIBDIR=/dev/null
  37. fi
  38. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
  39. ac_cv_have_getopt_long="no"
  40. AC_CHECK_FUNCS(getopt_long,
  41. [ac_cv_have_getopt_long="yes"],
  42. [AC_CHECK_LIB(gnugetopt, getopt_long,
  43. [ac_cv_have_getopt_long="yes"
  44. GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
  45. if test "$ac_cv_have_getopt_long" != "no"; then
  46. AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
  47. fi
  48. AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
  49. AC_SUBST(GETOPT_LIBS)
  50. # Optimizations
  51. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  52. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  53. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  54. # Use DevIL?
  55. #AC_CHECK_HEADERS(IL/il.h,
  56. # [ac_cv_my_have_il="yes"],
  57. # [ac_cv_my_have_il="no"])
  58. #CPPFLAGS="${save_CPPFLAGS}"
  59. #AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
  60. # Use Windows?
  61. #AC_CHECK_HEADERS(olectl.h,
  62. # [ac_cv_my_have_ole="yes"],
  63. # [ac_cv_my_have_ole="no"])
  64. #CPPFLAGS="${save_CPPFLAGS}"
  65. #AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
  66. # Use SDL?
  67. ac_cv_my_have_sdl="no"
  68. save_CPPFLAGS="${CPPFLAGS}"
  69. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  70. if test "${SDL_CONFIG}" != "no"; then
  71. CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
  72. fi
  73. AC_CHECK_HEADERS(SDL_image.h,
  74. [ac_cv_my_have_sdl="yes"],
  75. [ac_cv_my_have_sdl="no"])
  76. CPPFLAGS="${save_CPPFLAGS}"
  77. if test "${ac_cv_my_have_sdl}" != "no"; then
  78. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
  79. fi
  80. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  81. # Use OpenCV?
  82. ac_cv_my_have_opencv="no"
  83. OPENCV="no"
  84. PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
  85. if test "${ac_cv_my_have_opencv}" != "no"; then
  86. AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
  87. fi
  88. AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
  89. # Use Imlib2?
  90. ac_cv_my_have_imlib2="no"
  91. IMLIB2="no"
  92. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  93. if test "${ac_cv_my_have_imlib2}" != "no"; then
  94. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  95. fi
  96. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  97. # Use Windows GDI?
  98. ac_cv_my_have_gdi="no"
  99. GDI="no"
  100. AC_CHECK_HEADERS(windows.h,
  101. [ac_cv_my_have_gdi="yes"],
  102. [ac_cv_my_have_gdi="no"])
  103. if test "${ac_cv_my_have_gdi}" != "no"; then
  104. AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
  105. fi
  106. AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
  107. # Use Cocoa?
  108. ac_cv_my_have_cocoa="no"
  109. AC_CHECK_HEADERS(/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h,
  110. [
  111. MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
  112. CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}"
  113. CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}"
  114. CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
  115. OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
  116. LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
  117. AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
  118. # CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
  119. # CACA_DRIVERS="${CACA_DRIVERS} cocoa"
  120. ac_cv_my_have_cocoa="yes"],
  121. [ac_cv_my_have_cocoa="no"]
  122. )
  123. AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
  124. if test "${ac_cv_my_have_il}" = "no" -a "${ac_cv_my_have_ole}" = "no" -a "${ac_cv_my_have_sdl}" = "no" -a "${ac_cv_my_have_imlib2}" = "no" -a "${ac_cv_my_have_opencv}" = "no" -a "${ac_cv_my_have_cocoa}" = "no"; then
  125. AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2, Cocoa, or OpenCV, please install one of them]])
  126. fi
  127. # Build The Pimp?
  128. AC_PATH_PROG(GMCS, gmcs, no)
  129. PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0], [:])
  130. PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:])
  131. PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:])
  132. AM_CONDITIONAL(USE_CSHARP, test "${gmcs}" != "no")
  133. AC_CONFIG_FILES([
  134. Makefile
  135. pipi/Makefile
  136. src/Makefile
  137. genethumb/Makefile
  138. examples/Makefile
  139. test/Makefile
  140. pipi-sharp/Makefile
  141. ThePimp/Makefile
  142. ])
  143. AC_CONFIG_FILES([
  144. pipi/pipi.pc
  145. pipi-sharp/pipi-sharp.pc
  146. pipi-sharp/pipi-sharp.dll.config
  147. ])
  148. AC_OUTPUT