KSquirrel – powerful image viewer
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.

205 lines
6.9KB

  1. #MIN_CONFIG(3.3)
  2. KDE_ENABLE_HIDDEN_VISIBILITY
  3. AM_INIT_AUTOMAKE(ksquirrel,0.8.0)
  4. sq_kipi="yes"
  5. AC_ARG_ENABLE(kipi,
  6. [AS_HELP_STRING([--disable-kipi], [don't search for KIPI plugins [default=no]])],
  7. [ case "${enableval}" in
  8. yes) sq_kipi="yes" ;;
  9. no) sq_kipi="no" ;;
  10. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  11. esac]
  12. )
  13. sq_kexif="yes"
  14. AC_ARG_ENABLE(kexif,
  15. [AS_HELP_STRING([--disable-kexif], [don't search for KEXIF [default=no]])],
  16. [ case "${enableval}" in
  17. yes) sq_kexif="yes" ;;
  18. no) sq_kexif="no" ;;
  19. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  20. esac]
  21. )
  22. have_kpart="yes"
  23. AC_ARG_ENABLE(kpart,
  24. [AS_HELP_STRING([--disable-kpart], [don't compile Konqueror integration (KPart object) [default=no]])],
  25. [ case "${enableval}" in
  26. yes) ;;
  27. no) have_kpart="no" ;;
  28. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  29. esac]
  30. )
  31. AM_CONDITIONAL(SQ_HAVE_KPART, test x$have_kpart = xyes)
  32. have_klconf="yes"
  33. AC_ARG_ENABLE(ksquirrel-libs-configurator,
  34. [AS_HELP_STRING([--disable-ksquirrel-libs-configurator], [don't compile ksquirrel-libs configurator [default=no]])],
  35. [ case "${enableval}" in
  36. yes) ;;
  37. no) have_klconf="no" ;;
  38. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  39. esac]
  40. )
  41. AM_CONDITIONAL(SQ_HAVE_KLCONF, test x$have_klconf = xyes)
  42. # utime.h
  43. AC_CHECK_HEADER([utime.h], AC_DEFINE([HAVE_UTIME_H], [], [utime.h support]), [])
  44. KDE_PKG_CHECK_MODULES([ksquirrellibs], ksquirrellibs, [
  45. __cppflags=$CPPFLAGS
  46. CXXFLAGS="$ksquirrellibs_CFLAGS $CXXFLAGS"
  47. CPPFLAGS="$ksquirrellibs_CFLAGS $CPPFLAGS"
  48. AC_SUBST(ksquirrellibs_LIBS)
  49. AC_LANG_SAVE
  50. AC_LANG_CPLUSPLUS
  51. AC_CHECK_HEADERS([ksquirrel-libs/fileio.h], [],
  52. [AC_MSG_ERROR([Ksquirrel-libs development files are not installed. Please install them first.])])
  53. # restore language & CPPFLAGS
  54. CPPFLAGS=${__cppflags}
  55. AC_LANG_RESTORE
  56. ],
  57. [AC_MSG_ERROR([Ksquirrel-libs development file (.pc) is not installed. Please install ksquirrel-libs first.])]
  58. )
  59. KDE_CHECK_HEADER(konq_operations.h, [], AC_MSG_ERROR("Header file konq_operations.h is missing. Please install libkonq-devel package."))
  60. KDE_CHECK_HEADER(kregexpeditorinterface.h, [AC_DEFINE([SQ_HAVE_KREGEXP], [], [kregexpeditorinterface.h support])], [])
  61. # Checks for OpenGL.
  62. KDE_CHECK_HEADER([GL/gl.h], [], AC_MSG_ERROR("ksquirrel needs OpenGL (GL/gl.h, ...) and GLU (GL/glu.h) headers to be installed."))
  63. AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"])
  64. if test "x$ogl" = "xno"; then
  65. AC_MSG_NOTICE([Maybe libGL requires libpthread...])
  66. unset ac_cv_lib_GL_glBegin
  67. AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"], AC_MSG_ERROR([Cannot use -lGL]), [-lpthread])
  68. fi
  69. AM_PROG_AS
  70. # MMX test duped from tdelibs/tdefx - it should be probably moved to admin/
  71. dnl -----------------------------------------------------
  72. dnl IA32 checks
  73. dnl -----------------------------------------------------
  74. ksquirrel_asm_defs=
  75. case $host_cpu in
  76. i*86 )
  77. AC_MSG_CHECKING(for assembler support for IA32 extensions)
  78. dnl MMX check
  79. AC_TRY_COMPILE(, [ __asm__("pxor %mm0, %mm0") ],
  80. [
  81. echo $ECHO_N "MMX yes$ECHO_C"
  82. AC_DEFINE_UNQUOTED(HAVE_X86_MMX, 1, [Define to 1 if the assembler supports MMX instructions.])
  83. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_MMX"
  84. ], [ echo $ECHO_N "MMX no$ECHO_C" ])
  85. dnl SSE check
  86. AC_TRY_COMPILE(,[ __asm__("xorps %xmm0, %xmm0") ],
  87. [
  88. echo $ECHO_N ", SSE yes$ECHO_C"
  89. AC_DEFINE_UNQUOTED(HAVE_X86_SSE, 1, [Define to 1 if the assembler supports SSE instructions.])
  90. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE"
  91. ], [ echo $ECHO_N ", SSE no$ECHO_C" ])
  92. dnl SSE2 check
  93. AC_TRY_COMPILE(, [ __asm__("xorpd %xmm0, %xmm0") ],
  94. [
  95. echo $ECHO_N ", SSE2 yes$ECHO_C"
  96. AC_DEFINE_UNQUOTED(HAVE_X86_SSE2, 1, [Define to 1 if the assembler supports SSE2 instructions.])
  97. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE2"
  98. ], [ echo $ECHO_N ", SSE2 no$ECHO_C" ])
  99. dnl 3DNOW check
  100. AC_TRY_COMPILE(, [ __asm__("femms") ],
  101. [
  102. echo $ECHO_N ", 3DNOW yes$ECHO_C"
  103. AC_DEFINE_UNQUOTED(HAVE_X86_3DNOW, 1, [Define to 1 if the assembler supports 3DNOW instructions.])
  104. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_3DNOW"
  105. ], [ echo $ECHO_N ", 3DNOW no$ECHO_C" ])
  106. echo
  107. ;;
  108. powerpc )
  109. AC_MSG_CHECKING(for assembler support for AltiVec instructions)
  110. dnl AltiVec check
  111. AC_TRY_COMPILE(, [ __asm__("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0" : : "r"(-1) ) ],
  112. [
  113. echo $ECHO_N " yes$ECHO_C"
  114. AC_DEFINE_UNQUOTED(HAVE_PPC_ALTIVEC, 1, [Define to 1 if the assembler supports AltiVec instructions.])
  115. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_PPC_ALTIVEC"
  116. ], [ echo $ECHO_N ", AltiVec no$ECHO_C" ])
  117. echo
  118. ;;
  119. esac
  120. KSQUIRREL_ASM_DEFS="$ksquirrel_asm_defs"
  121. AC_SUBST(KSQUIRREL_ASM_DEFS)
  122. #
  123. # KIPI
  124. #
  125. have_kipi=no
  126. if test x$sq_kipi = xyes; then
  127. KDE_PKG_CHECK_MODULES([libkipi], libkipi, [
  128. _cxxflags=$CXXFLAGS
  129. _ldflags=$LDFLAGS
  130. CXXFLAGS="$libkipi_CFLAGS $CXXFLAGS"
  131. LDFLAGS="$LDFLAGS $libkipi_LIBS"
  132. KDE_CHECK_HEADER(libkipi/interface.h, have_kipi=yes, have_kipi=no)
  133. if test "$have_kipi" = "yes"; then
  134. AC_DEFINE(SQ_HAVE_KIPI, [], [If we have libkipi installed])
  135. else
  136. AC_WARN([Can't find KIPI headers, KSquirrel won't be compiled with KIPI support])
  137. fi
  138. CXXFLAGS=$_cxxflags
  139. LDFLAGS=$_ldflags
  140. ],
  141. [AC_WARN([KIPI development file (.pc) was not found. KIPI support will be disabled.])]
  142. )
  143. fi
  144. #
  145. # KEXIF
  146. #
  147. have_kexif=no
  148. if test x$sq_kexif = xyes; then
  149. KDE_PKG_CHECK_MODULES([libkexif], libkexif, [
  150. _cxxflags=$CXXFLAGS
  151. _ldflags=$LDFLAGS
  152. CXXFLAGS="$libkexif_CFLAGS $CXXFLAGS"
  153. LDFLAGS="$LDFLAGS $libkexif_LIBS"
  154. KDE_CHECK_HEADER(libkexif/kexifdata.h, have_kexif=yes, have_kexif=no)
  155. if test "$have_kexif" = "yes"; then
  156. AC_DEFINE(SQ_HAVE_KEXIF, [], [If we have libkexif installed])
  157. else
  158. AC_WARN([Can't find KEXIF headers, KSquirrel won't be compiled with KEXIF support])
  159. fi
  160. CXXFLAGS=$_cxxflags
  161. LDFLAGS=$_ldflags
  162. ],
  163. [AC_WARN([KEXIF development file (.pc) was not found. KEXIF support will be disabled.])]
  164. )
  165. fi
  166. AM_CONDITIONAL(SQ_HAVE_KIPI, test x$have_kipi = xyes)
  167. AM_CONDITIONAL(SQ_HAVE_KEXIF, test x$have_kexif = xyes)