25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 6.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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 --tag CC --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`"
  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. # How to get the C99 types. See pipi/pipi_types.h.in for details about
  60. # the PIPI_TYPES variable
  61. if test "${ac_cv_my_have_vga}" = "yes"; then
  62. PIPI_TYPES=0
  63. else
  64. AC_CHECK_HEADERS(stdint.h,
  65. [PIPI_TYPES=1],
  66. [AC_CHECK_HEADERS(inttypes.h,
  67. [PIPI_TYPES=2],
  68. [AC_CHECK_HEADERS(windows.h,
  69. [PIPI_TYPES=3],
  70. [PIPI_TYPES=0])])])
  71. fi
  72. AC_SUBST(PIPI_TYPES)
  73. # Optimizations
  74. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  75. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  76. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  77. # Use DevIL?
  78. #AC_CHECK_HEADERS(IL/il.h,
  79. # [ac_cv_my_have_il="yes"],
  80. # [ac_cv_my_have_il="no"])
  81. #CPPFLAGS="${save_CPPFLAGS}"
  82. #AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
  83. # Use Windows?
  84. #AC_CHECK_HEADERS(olectl.h,
  85. # [ac_cv_my_have_ole="yes"],
  86. # [ac_cv_my_have_ole="no"])
  87. #CPPFLAGS="${save_CPPFLAGS}"
  88. #AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
  89. # Use SDL?
  90. ac_cv_my_have_sdl="no"
  91. save_CPPFLAGS="${CPPFLAGS}"
  92. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  93. if test "${SDL_CONFIG}" != "no"; then
  94. CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
  95. fi
  96. AC_CHECK_HEADERS(SDL_image.h,
  97. [ac_cv_my_have_sdl="yes"],
  98. [ac_cv_my_have_sdl="no"])
  99. CPPFLAGS="${save_CPPFLAGS}"
  100. if test "${ac_cv_my_have_sdl}" != "no"; then
  101. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
  102. fi
  103. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  104. # Use OpenCV?
  105. ac_cv_my_have_opencv="no"
  106. OPENCV="no"
  107. PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
  108. if test "${ac_cv_my_have_opencv}" != "no"; then
  109. AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
  110. fi
  111. AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
  112. # Use Imlib2?
  113. ac_cv_my_have_imlib2="no"
  114. IMLIB2="no"
  115. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  116. if test "${ac_cv_my_have_imlib2}" != "no"; then
  117. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  118. fi
  119. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  120. # Use Windows GDI?
  121. ac_cv_my_have_gdi="no"
  122. GDI="no"
  123. AC_CHECK_HEADERS(windows.h,
  124. [ac_cv_my_have_gdi="yes"],
  125. [ac_cv_my_have_gdi="no"])
  126. if test "${ac_cv_my_have_gdi}" != "no"; then
  127. AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
  128. fi
  129. AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
  130. # Use Cocoa?
  131. ac_cv_my_have_cocoa="no"
  132. AC_CHECK_HEADERS(/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h,
  133. [
  134. MACOSX_SDK_FRAMEWORKS="-F${MACOSX_SDK}/System/Library/Frameworks"
  135. CPPFLAGS="${CPPFLAGS} ${ARCH} ${MACOSX_SDK_FRAMEWORKS} -I/Developer//SDKs/MacOSX10.5.sdk/System/Library/Frameworks/QuartzCore.framework/Versions/A/Headers/"
  136. CFLAGS="${CFLAGS} ${MACOSX_SDK_CFLAGS} -I/Developer//SDKs/MacOSX10.5.sdk/System/Library/Frameworks/QuartzCore.framework/Versions/A/Headers/"
  137. CXXFLAGS="${CXXFLAGS} ${MACOSX_SDK_CXXFLAGS}"
  138. OBJCFLAGS="${OBJCFLAGS} ${MACOSX_SDK_CFLAGS}"
  139. LDFLAGS="${ARCH} ${MACOSX_SDK_LDFLAGS} ${LDFLAGS}"
  140. AC_DEFINE(USE_COCOA, 1, Define to 1 to activate the Cocoa backend driver)
  141. # CACA_LIBS="${CACA_LIBS} -Wl,-syslibroot,${MACOSX_SDK},-framework,Cocoa"
  142. # CACA_DRIVERS="${CACA_DRIVERS} cocoa"
  143. ac_cv_my_have_cocoa="yes"],
  144. [ac_cv_my_have_cocoa="no"]
  145. )
  146. AM_CONDITIONAL(USE_COCOA, test "${ac_cv_my_have_cocoa}" = "yes")
  147. 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
  148. AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2, Cocoa, or OpenCV, please install one of them]])
  149. fi
  150. # Build pipi-sharp?
  151. AC_PATH_PROG(GMCS, gmcs, no)
  152. AM_CONDITIONAL(USE_CSHARP, test "${gmcs}" != "no")
  153. # Build The Pimp?
  154. ac_cv_my_have_gtksharp=yes
  155. PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0], [:], [ac_cv_my_have_gtksharp=no])
  156. PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:], [ac_cv_my_have_gtksharp=no])
  157. PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:], [ac_cv_my_have_gtksharp=no])
  158. AM_CONDITIONAL(USE_GTKSHARP, test "${ac_cv_my_have_gtksharp}" != no)
  159. AC_CONFIG_FILES([
  160. Makefile
  161. pipi/Makefile
  162. src/Makefile
  163. genethumb/Makefile
  164. examples/Makefile
  165. test/Makefile
  166. pipi-sharp/Makefile
  167. ThePimp/Makefile
  168. win32/Makefile
  169. ])
  170. AC_CONFIG_FILES([
  171. pipi/pipi_types.h
  172. pipi/pipi.pc
  173. pipi-sharp/pipi-sharp.pc
  174. pipi-sharp/pipi-sharp.dll.config
  175. ])
  176. AC_OUTPUT