Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

148 рядки
4.2 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_LIBTOOL_WIN32_DLL
  20. AM_PROG_LIBTOOL
  21. AC_LIBTOOL_CXX
  22. AC_C_CONST
  23. AC_C_INLINE
  24. dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
  25. dnl now otherwise it might be set in an obscure if statement. Same thing for
  26. dnl PKG_PROG_PKG_CONFIG which needs to be called first.
  27. AC_EGREP_CPP(yes, foo)
  28. PKG_PROG_PKG_CONFIG()
  29. m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
  30. if test "${build}" != "${host}" -a "${PKG_CONFIG_LIBDIR}" = ""; then
  31. export PKG_CONFIG_LIBDIR=/dev/null
  32. fi
  33. AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
  34. ac_cv_have_getopt_long="no"
  35. AC_CHECK_FUNCS(getopt_long,
  36. [ac_cv_have_getopt_long="yes"],
  37. [AC_CHECK_LIB(gnugetopt, getopt_long,
  38. [ac_cv_have_getopt_long="yes"
  39. GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
  40. if test "$ac_cv_have_getopt_long" != "no"; then
  41. AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)
  42. fi
  43. AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
  44. AC_SUBST(GETOPT_LIBS)
  45. # Optimizations
  46. CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
  47. # Code qui fait des warnings == code de porc == deux baffes dans ta gueule
  48. CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
  49. # Use DevIL?
  50. #AC_CHECK_HEADERS(IL/il.h,
  51. # [ac_cv_my_have_il="yes"],
  52. # [ac_cv_my_have_il="no"])
  53. #CPPFLAGS="${save_CPPFLAGS}"
  54. #AM_CONDITIONAL(USE_IL, test "${ac_cv_my_have_il}" = "yes")
  55. # Use Windows?
  56. #AC_CHECK_HEADERS(olectl.h,
  57. # [ac_cv_my_have_ole="yes"],
  58. # [ac_cv_my_have_ole="no"])
  59. #CPPFLAGS="${save_CPPFLAGS}"
  60. #AM_CONDITIONAL(USE_OLE, test "${ac_cv_my_have_ole}" = "yes")
  61. # Use SDL?
  62. ac_cv_my_have_sdl="no"
  63. save_CPPFLAGS="${CPPFLAGS}"
  64. AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  65. if test "${SDL_CONFIG}" != "no"; then
  66. CPPFLAGS="${CPPFLAGS} `sdl-config --cflags`"
  67. fi
  68. AC_CHECK_HEADERS(SDL_image.h,
  69. [ac_cv_my_have_sdl="yes"],
  70. [ac_cv_my_have_sdl="no"])
  71. CPPFLAGS="${save_CPPFLAGS}"
  72. if test "${ac_cv_my_have_sdl}" != "no"; then
  73. AC_DEFINE(USE_SDL, 1, Define to 1 to use SDL_image)
  74. fi
  75. AM_CONDITIONAL(USE_SDL, test "${ac_cv_my_have_sdl}" = "yes")
  76. # Use OpenCV?
  77. ac_cv_my_have_opencv="no"
  78. OPENCV="no"
  79. PKG_CHECK_MODULES(OPENCV, opencv, [ac_cv_my_have_opencv="yes"], [:])
  80. if test "${ac_cv_my_have_opencv}" != "no"; then
  81. AC_DEFINE(USE_OPENCV, 1, Define to 1 to use OpenCV)
  82. fi
  83. AM_CONDITIONAL(USE_OPENCV, test "${ac_cv_my_have_opencv}" = "yes")
  84. # Use Imlib2?
  85. ac_cv_my_have_imlib2="no"
  86. IMLIB2="no"
  87. PKG_CHECK_MODULES(IMLIB2, imlib2, [ac_cv_my_have_imlib2="yes"], [:])
  88. if test "${ac_cv_my_have_imlib2}" != "no"; then
  89. AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
  90. fi
  91. AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
  92. # Use Windows GDI?
  93. ac_cv_my_have_gdi="no"
  94. GDI="no"
  95. AC_CHECK_HEADERS(windows.h,
  96. [ac_cv_my_have_gdi="yes"],
  97. [ac_cv_my_have_gdi="no"])
  98. if test "${ac_cv_my_have_gdi}" != "no"; then
  99. AC_DEFINE(USE_GDI, 1, Define to 1 to use GDI)
  100. fi
  101. AM_CONDITIONAL(USE_GDI, test "${ac_cv_my_have_gdi}" = "yes")
  102. 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"; then
  103. AC_MSG_ERROR([[cannot find DevIL, OLE, SDL_Image, Imlib2 or OpenCV, please install one of them]])
  104. fi
  105. # Build The Pimp?
  106. AC_PATH_PROG(GMCS, gmcs, no)
  107. PKG_CHECK_MODULES([GLADE_SHARP_20], [glade-sharp-2.0], [:])
  108. PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0], [:])
  109. PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0], [:])
  110. AM_CONDITIONAL(USE_CSHARP, test "${gmcs}" != "no")
  111. AC_CONFIG_FILES([
  112. Makefile
  113. pipi/Makefile
  114. src/Makefile
  115. genethumb/Makefile
  116. examples/Makefile
  117. test/Makefile
  118. pipi-sharp/Makefile
  119. ThePimp/Makefile
  120. ])
  121. AC_CONFIG_FILES([
  122. pipi/pipi.pc
  123. pipi-sharp/pipi-sharp.pc
  124. pipi-sharp/pipi-sharp.dll.config
  125. ])
  126. AC_OUTPUT