Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

134 linhas
3.8 KiB

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