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.
 
 
 
 
 
 

347 lines
12 KiB

  1. dnl =======================================================
  2. dnl FILE: ./admin/configure.in.min
  3. dnl =======================================================
  4. dnl This file is part of the KDE libraries/packages
  5. dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
  6. dnl This file is free software; you can redistribute it and/or
  7. dnl modify it under the terms of the GNU Library General Public
  8. dnl License as published by the Free Software Foundation; either
  9. dnl version 2 of the License, or (at your option) any later version.
  10. dnl This library is distributed in the hope that it will be useful,
  11. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. dnl Library General Public License for more details.
  14. dnl You should have received a copy of the GNU Library General Public License
  15. dnl along with this library; see the file COPYING.LIB. If not, write to
  16. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17. dnl Boston, MA 02110-1301, USA.
  18. # Original Author was Kalle@kde.org
  19. # I lifted it in some mater. (Stephan Kulow)
  20. # I used much code from Janos Farkas
  21. dnl Process this file with autoconf to produce a configure script.
  22. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  23. dnl This is so we can use kde-common
  24. AC_CONFIG_AUX_DIR(admin)
  25. dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
  26. unset CDPATH
  27. dnl Checking host/target/build systems, for make, install etc.
  28. AC_CANONICAL_SYSTEM
  29. dnl Perform program name transformation
  30. AC_ARG_PROGRAM
  31. dnl Automake doc recommends to do this only here. (Janos)
  32. AM_INIT_AUTOMAKE(ksquirrel, 0.8.0) dnl searches for some needed programs
  33. KDE_SET_PREFIX
  34. dnl generate the config header
  35. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  36. dnl Checks for programs.
  37. AC_CHECK_COMPILERS
  38. AC_ENABLE_SHARED(yes)
  39. AC_ENABLE_STATIC(no)
  40. KDE_PROG_LIBTOOL
  41. dnl for NLS support. Call them in this order!
  42. dnl WITH_NLS is for the po files
  43. AM_KDE_WITH_NLS
  44. KDE_USE_TQT(3.3)
  45. AC_PATH_KDE
  46. dnl =======================================================
  47. dnl FILE: configure.in.in
  48. dnl =======================================================
  49. #MIN_CONFIG(3.3)
  50. dnl PACKAGE set before
  51. sq_kipi="yes"
  52. AC_ARG_ENABLE(kipi,
  53. [AS_HELP_STRING([--disable-kipi], [don't search for KIPI plugins [default=no]])],
  54. [ case "${enableval}" in
  55. yes) sq_kipi="yes" ;;
  56. no) sq_kipi="no" ;;
  57. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  58. esac]
  59. )
  60. sq_kexif="yes"
  61. AC_ARG_ENABLE(kexif,
  62. [AS_HELP_STRING([--disable-kexif], [don't search for KEXIF [default=no]])],
  63. [ case "${enableval}" in
  64. yes) sq_kexif="yes" ;;
  65. no) sq_kexif="no" ;;
  66. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  67. esac]
  68. )
  69. have_kpart="yes"
  70. AC_ARG_ENABLE(kpart,
  71. [AS_HELP_STRING([--disable-kpart], [don't compile Konqueror integration (KPart object) [default=no]])],
  72. [ case "${enableval}" in
  73. yes) ;;
  74. no) have_kpart="no" ;;
  75. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  76. esac]
  77. )
  78. AM_CONDITIONAL(SQ_HAVE_KPART, test x$have_kpart = xyes)
  79. have_klconf="yes"
  80. AC_ARG_ENABLE(ksquirrel-libs-configurator,
  81. [AS_HELP_STRING([--disable-ksquirrel-libs-configurator], [don't compile ksquirrel-libs configurator [default=no]])],
  82. [ case "${enableval}" in
  83. yes) ;;
  84. no) have_klconf="no" ;;
  85. *) AC_MSG_ERROR([bad value ${enableval} for this parameter]) ;;
  86. esac]
  87. )
  88. AM_CONDITIONAL(SQ_HAVE_KLCONF, test x$have_klconf = xyes)
  89. # utime.h
  90. AC_CHECK_HEADER([utime.h], AC_DEFINE([HAVE_UTIME_H], [], [utime.h support]), [])
  91. PKG_CHECK_MODULES([ksquirrellibs], ksquirrellibs, [
  92. __cppflags=$CPPFLAGS
  93. CXXFLAGS="$ksquirrellibs_CFLAGS $CXXFLAGS"
  94. CPPFLAGS="$ksquirrellibs_CFLAGS $CPPFLAGS"
  95. AC_SUBST(ksquirrellibs_LIBS)
  96. AC_LANG_SAVE
  97. AC_LANG_CPLUSPLUS
  98. AC_CHECK_HEADERS([ksquirrel-libs/fileio.h], [],
  99. [AC_MSG_ERROR([Ksquirrel-libs development files are not installed. Please install them first.])])
  100. # restore language & CPPFLAGS
  101. CPPFLAGS=${__cppflags}
  102. AC_LANG_RESTORE
  103. ],
  104. [AC_MSG_ERROR([Ksquirrel-libs development file (.pc) is not installed. Please install ksquirrel-libs first.])]
  105. )
  106. KDE_CHECK_HEADER(konq_operations.h, [], AC_MSG_ERROR("Header file konq_operations.h is missing. Please install libkonq-devel package."))
  107. KDE_CHECK_HEADER(kregexpeditorinterface.h, [AC_DEFINE([SQ_HAVE_KREGEXP], [], [kregexpeditorinterface.h support])], [])
  108. # Checks for OpenGL.
  109. KDE_CHECK_HEADER([GL/gl.h], [], AC_MSG_ERROR("ksquirrel needs OpenGL (GL/gl.h, ...) and GLU (GL/glu.h) headers to be installed."))
  110. AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lGL $LDFLAGS"], [ogl="no"])
  111. if test "x$ogl" = "xno"; then
  112. AC_MSG_NOTICE([Maybe libGL requires libpthread...])
  113. unset ac_cv_lib_GL_glBegin
  114. AC_CHECK_LIB([GL], [glBegin], [LDFLAGS="-lpthread -lGL $LDFLAGS"], AC_MSG_ERROR([Cannot use -lGL]), [-lpthread])
  115. fi
  116. AM_PROG_AS
  117. # MMX test duped from tdelibs/tdefx - it should be probably moved to admin/
  118. dnl -----------------------------------------------------
  119. dnl IA32 checks
  120. dnl -----------------------------------------------------
  121. ksquirrel_asm_defs=
  122. case $host_cpu in
  123. i*86 )
  124. AC_MSG_CHECKING(for assembler support for IA32 extensions)
  125. dnl MMX check
  126. AC_TRY_COMPILE(, [ __asm__("pxor %mm0, %mm0") ],
  127. [
  128. echo $ECHO_N "MMX yes$ECHO_C"
  129. AC_DEFINE_UNQUOTED(HAVE_X86_MMX, 1, [Define to 1 if the assembler supports MMX instructions.])
  130. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_MMX"
  131. ], [ echo $ECHO_N "MMX no$ECHO_C" ])
  132. dnl SSE check
  133. AC_TRY_COMPILE(,[ __asm__("xorps %xmm0, %xmm0") ],
  134. [
  135. echo $ECHO_N ", SSE yes$ECHO_C"
  136. AC_DEFINE_UNQUOTED(HAVE_X86_SSE, 1, [Define to 1 if the assembler supports SSE instructions.])
  137. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE"
  138. ], [ echo $ECHO_N ", SSE no$ECHO_C" ])
  139. dnl SSE2 check
  140. AC_TRY_COMPILE(, [ __asm__("xorpd %xmm0, %xmm0") ],
  141. [
  142. echo $ECHO_N ", SSE2 yes$ECHO_C"
  143. AC_DEFINE_UNQUOTED(HAVE_X86_SSE2, 1, [Define to 1 if the assembler supports SSE2 instructions.])
  144. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_SSE2"
  145. ], [ echo $ECHO_N ", SSE2 no$ECHO_C" ])
  146. dnl 3DNOW check
  147. AC_TRY_COMPILE(, [ __asm__("femms") ],
  148. [
  149. echo $ECHO_N ", 3DNOW yes$ECHO_C"
  150. AC_DEFINE_UNQUOTED(HAVE_X86_3DNOW, 1, [Define to 1 if the assembler supports 3DNOW instructions.])
  151. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_X86_3DNOW"
  152. ], [ echo $ECHO_N ", 3DNOW no$ECHO_C" ])
  153. echo
  154. ;;
  155. powerpc )
  156. AC_MSG_CHECKING(for assembler support for AltiVec instructions)
  157. dnl AltiVec check
  158. AC_TRY_COMPILE(, [ __asm__("mtspr 256, %0\n\t" "vand %%v0, %%v0, %%v0" : : "r"(-1) ) ],
  159. [
  160. echo $ECHO_N " yes$ECHO_C"
  161. AC_DEFINE_UNQUOTED(HAVE_PPC_ALTIVEC, 1, [Define to 1 if the assembler supports AltiVec instructions.])
  162. ksquirrel_asm_defs="$ksquirrel_asm_defs -DHAVE_PPC_ALTIVEC"
  163. ], [ echo $ECHO_N ", AltiVec no$ECHO_C" ])
  164. echo
  165. ;;
  166. esac
  167. KSQUIRREL_ASM_DEFS="$ksquirrel_asm_defs"
  168. AC_SUBST(KSQUIRREL_ASM_DEFS)
  169. #
  170. # KIPI
  171. #
  172. have_kipi=no
  173. if test x$sq_kipi = xyes; then
  174. PKG_CHECK_MODULES([libkipi], libkipi, [
  175. _cxxflags=$CXXFLAGS
  176. _ldflags=$LDFLAGS
  177. CXXFLAGS="$libkipi_CFLAGS $CXXFLAGS"
  178. LDFLAGS="$LDFLAGS $libkipi_LIBS"
  179. KDE_CHECK_HEADER(libkipi/interface.h, have_kipi=yes, have_kipi=no)
  180. if test "$have_kipi" = "yes"; then
  181. AC_DEFINE(SQ_HAVE_KIPI, [], [If we have libkipi installed])
  182. else
  183. AC_WARN([Can't find KIPI headers, KSquirrel won't be compiled with KIPI support])
  184. fi
  185. CXXFLAGS=$_cxxflags
  186. LDFLAGS=$_ldflags
  187. ],
  188. [AC_WARN([KIPI development file (.pc) was not found. KIPI support will be disabled.])]
  189. )
  190. fi
  191. #
  192. # KEXIF
  193. #
  194. have_kexif=no
  195. if test x$sq_kexif = xyes; then
  196. PKG_CHECK_MODULES([libkexif], libkexif, [
  197. _cxxflags=$CXXFLAGS
  198. _ldflags=$LDFLAGS
  199. CXXFLAGS="$libkexif_CFLAGS $CXXFLAGS"
  200. LDFLAGS="$LDFLAGS $libkexif_LIBS"
  201. KDE_CHECK_HEADER(libkexif/kexifdata.h, have_kexif=yes, have_kexif=no)
  202. if test "$have_kexif" = "yes"; then
  203. AC_DEFINE(SQ_HAVE_KEXIF, [], [If we have libkexif installed])
  204. else
  205. AC_WARN([Can't find KEXIF headers, KSquirrel won't be compiled with KEXIF support])
  206. fi
  207. CXXFLAGS=$_cxxflags
  208. LDFLAGS=$_ldflags
  209. ],
  210. [AC_WARN([KEXIF development file (.pc) was not found. KEXIF support will be disabled.])]
  211. )
  212. fi
  213. AM_CONDITIONAL(SQ_HAVE_KIPI, test x$have_kipi = xyes)
  214. AM_CONDITIONAL(SQ_HAVE_KEXIF, test x$have_kexif = xyes)
  215. KDE_CREATE_SUBDIRSLIST
  216. AC_CONFIG_FILES([ Makefile ])
  217. AC_CONFIG_FILES([ doc/Makefile ])
  218. AC_CONFIG_FILES([ doc/ru/Makefile ])
  219. AC_CONFIG_FILES([ ksquirrel/Makefile ])
  220. AC_CONFIG_FILES([ ksquirrel/imageedit/Makefile ])
  221. AC_CONFIG_FILES([ ksquirrel/ksquirrel-libs-configurator/Makefile ])
  222. AC_CONFIG_FILES([ ksquirrel/ksquirrelpart/Makefile ])
  223. AC_CONFIG_FILES([ ksquirrel/mime/Makefile ])
  224. AC_CONFIG_FILES([ ksquirrel/sidebar/Makefile ])
  225. AC_CONFIG_FILES([ pics/Makefile ])
  226. AC_CONFIG_FILES([ pics/imageedit/Makefile ])
  227. AC_CONFIG_FILES([ pics/menu/Makefile ])
  228. AC_CONFIG_FILES([ pics/toolbar/Makefile ])
  229. AC_CONFIG_FILES([ po/Makefile ])
  230. AC_OUTPUT
  231. echo
  232. echo "Results:"
  233. echo "--------"
  234. echo
  235. echo "Version: ${VERSION}"
  236. echo "KPart object: $have_kpart"
  237. echo "ksquirrel-libs configurator: $have_klconf"
  238. echo
  239. echo "C compiler: ${CC}"
  240. echo "C++ compiler: ${CXX}"
  241. echo "CXXFLAGS: ${CXXFLAGS}"
  242. echo
  243. echo "Prefix: ${prefix}"
  244. echo "KDE prefix: ${kde_libs_prefix}"
  245. echo
  246. echo "KIPI support: ${have_kipi}"
  247. echo "KEXIF support: ${have_kexif}"
  248. echo "ASM flags: ${KSQUIRREL_ASM_DEFS}"
  249. # Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
  250. if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
  251. # And if so, warn when they don't match
  252. if test "$kde_libs_prefix" != "$given_prefix"; then
  253. # And if kde doesn't know about the prefix yet
  254. echo ":"`tde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
  255. if test $? -ne 0; then
  256. echo ""
  257. echo "Warning: you chose to install this package in $given_prefix,"
  258. echo "but KDE was found in $kde_libs_prefix."
  259. echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
  260. echo "that TDEDIRS contains it, e.g. export TDEDIRS=$given_prefix:$kde_libs_prefix"
  261. echo "Then restart KDE."
  262. echo ""
  263. fi
  264. fi
  265. fi
  266. if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
  267. echo ""
  268. echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
  269. echo "was not included. Therefore, GCC symbol visibility support remains disabled."
  270. echo ""
  271. echo "For better performance, consider including the Qt visibility supporting patch"
  272. echo "located at:"
  273. echo ""
  274. echo "http://bugs.kde.org/show_bug.cgi?id=109386"
  275. echo ""
  276. echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
  277. echo "everything will continue to work just fine without it."
  278. echo ""
  279. fi
  280. if test "$all_tests" = "bad"; then
  281. if test ! "$cache_file" = "/dev/null"; then
  282. echo ""
  283. echo "Please remove the file $cache_file after changing your setup"
  284. echo "so that configure will find the changes next time."
  285. echo ""
  286. fi
  287. else
  288. echo ""
  289. echo "Good - your configure finished. Start make now"
  290. echo ""
  291. fi