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.
 
 
 
 
 
 

183 lines
5.4 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_MSG_CHECKING(for library suffix)
  39. LT_SUFFIX="`./libtool -n --mode=link gcc -o libTEST.la -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`"
  40. if test "$LT_SUFFIX" = ""; then
  41. LT_SUFFIX=".so.$LT_MAJOR"
  42. AC_MSG_RESULT(unknown, defaulting to $LT_SUFFIX)
  43. else
  44. AC_MSG_RESULT($LT_SUFFIX)
  45. fi
  46. AC_SUBST(LT_SUFFIX)
  47. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
  48. ac_cv_have_getopt_long="no"
  49. AC_CHECK_FUNCS(getopt_long,
  50. [ac_cv_have_getopt_long="yes"],
  51. [AC_CHECK_LIB(gnugetopt, getopt_long,
  52. [ac_cv_have_getopt_long="yes"
  53. GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
  54. if test "$ac_cv_have_getopt_long" != "no"; then
  55. AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
  56. fi
  57. AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
  58. AC_SUBST(GETOPT_LIBS)
  59. # Optimizations
  60. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  61. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  62. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  63. # Use DevIL?
  64. #AC_CHECK_HEADERS(IL/il.h,
  65. # [ac_cv_my_have_il="yes"],
  66. # [ac_cv_my_have_il="no"])
  67. #CPPFLAGS="${save_CPPFLAGS}"
  68. #AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
  69. # Use Windows?
  70. #AC_CHECK_HEADERS(olectl.h,
  71. # [ac_cv_my_have_ole="yes"],
  72. # [ac_cv_my_have_ole="no"])
  73. #CPPFLAGS="${save_CPPFLAGS}"
  74. #AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
  75. # Use SDL?
  76. ac_cv_my_have_sdl="no"
  77. save_CPPFLAGS="${CPPFLAGS}"
  78. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  79. if test "${SDL_CONFIG}" != "no"; then
  80. CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
  81. fi
  82. AC_CHECK_HEADERS(SDL_image.h,
  83. [ac_cv_my_have_sdl="yes"],
  84. [ac_cv_my_have_sdl="no"])
  85. CPPFLAGS="${save_CPPFLAGS}"
  86. if test "${ac_cv_my_have_sdl}" != "no"; then
  87. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
  88. fi
  89. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  90. # Use OpenCV?
  91. ac_cv_my_have_opencv="no"
  92. OPENCV="no"
  93. PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
  94. if test "${ac_cv_my_have_opencv}" != "no"; then
  95. AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
  96. fi
  97. AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
  98. # Use Imlib2?
  99. ac_cv_my_have_imlib2="no"
  100. IMLIB2="no"
  101. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  102. if test "${ac_cv_my_have_imlib2}" != "no"; then
  103. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  104. fi
  105. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  106. # Use Windows GDI?
  107. ac_cv_my_have_gdi="no"
  108. GDI="no"
  109. AC_CHECK_HEADERS(windows.h,
  110. [ac_cv_my_have_gdi="yes"],
  111. [ac_cv_my_have_gdi="no"])
  112. if test "${ac_cv_my_have_gdi}" != "no"; then
  113. AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
  114. fi
  115. AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
  116. # Use Cocoa?
  117. ac_cv_my_have_cocoa="no"
  118. AC_CHECK_HEADERS(/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h,
  119. [
  120. MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
  121. CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS}"
  122. CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS}"
  123. CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
  124. OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
  125. LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
  126. AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
  127. # CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
  128. # CACA_DRIVERS="${CACA_DRIVERS} cocoa"
  129. ac_cv_my_have_cocoa="yes"],
  130. [ac_cv_my_have_cocoa="no"]
  131. )
  132. AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
  133. 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
  134. AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2, Cocoa, or OpenCV, please install one of them]])
  135. fi
  136. # Build The Pimp?
  137. AC_PATH_PROG(GMCS, gmcs, no)
  138. PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0], [:])
  139. PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:])
  140. PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:])
  141. AM_CONDITIONAL(USE_CSHARP, test "${gmcs}" != "no")
  142. AC_CONFIG_FILES([
  143. Makefile
  144. pipi/Makefile
  145. src/Makefile
  146. genethumb/Makefile
  147. examples/Makefile
  148. test/Makefile
  149. pipi-sharp/Makefile
  150. ThePimp/Makefile
  151. ])
  152. AC_CONFIG_FILES([
  153. pipi/pipi.pc
  154. pipi-sharp/pipi-sharp.pc
  155. pipi-sharp/pipi-sharp.dll.config
  156. ])
  157. AC_OUTPUT