TDE System Settings – easy to use control center
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.

13294 lines
419KB

  1. # generated automatically by aclocal 1.7.9 -*- Autoconf -*-
  2. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
  3. # Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  9. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  10. # PARTICULAR PURPOSE.
  11. dnl This file is part of the KDE libraries/packages
  12. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  13. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  14. dnl This file is free software; you can redistribute it and/or
  15. dnl modify it under the terms of the GNU Library General Public
  16. dnl License as published by the Free Software Foundation; either
  17. dnl version 2 of the License, or (at your option) any later version.
  18. dnl This library is distributed in the hope that it will be useful,
  19. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. dnl Library General Public License for more details.
  22. dnl You should have received a copy of the GNU Library General Public License
  23. dnl along with this library; see the file COPYING.LIB. If not, write to
  24. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. dnl Boston, MA 02110-1301, USA.
  26. dnl IMPORTANT NOTE:
  27. dnl Please do not modify this file unless you expect your modifications to be
  28. dnl carried into every other module in the repository.
  29. dnl
  30. dnl Single-module modifications are best placed in configure.in for tdelibs
  31. dnl and tdebase or configure.in.in if present.
  32. # KDE_PATH_X_DIRECT
  33. dnl Internal subroutine of AC_PATH_X.
  34. dnl Set ac_x_includes and/or ac_x_libraries.
  35. AC_DEFUN([KDE_PATH_X_DIRECT],
  36. [
  37. AC_REQUIRE([KDE_CHECK_LIB64])
  38. if test "$ac_x_includes" = NO; then
  39. # Guess where to find include files, by looking for this one X11 .h file.
  40. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  41. # First, try using that file with no special directory specified.
  42. AC_TRY_CPP([#include <$x_direct_test_include>],
  43. [# We can compile using X headers with no special include directory.
  44. ac_x_includes=],
  45. [# Look for the header file in a standard set of common directories.
  46. # Check X11 before X11Rn because it is often a symlink to the current release.
  47. for ac_dir in \
  48. /usr/X11/include \
  49. /usr/X11R6/include \
  50. /usr/X11R5/include \
  51. /usr/X11R4/include \
  52. \
  53. /usr/include/X11 \
  54. /usr/include/X11R6 \
  55. /usr/include/X11R5 \
  56. /usr/include/X11R4 \
  57. \
  58. /usr/local/X11/include \
  59. /usr/local/X11R6/include \
  60. /usr/local/X11R5/include \
  61. /usr/local/X11R4/include \
  62. \
  63. /usr/local/include/X11 \
  64. /usr/local/include/X11R6 \
  65. /usr/local/include/X11R5 \
  66. /usr/local/include/X11R4 \
  67. \
  68. /usr/X386/include \
  69. /usr/x386/include \
  70. /usr/XFree86/include/X11 \
  71. \
  72. /usr/include \
  73. /usr/local/include \
  74. /usr/unsupported/include \
  75. /usr/athena/include \
  76. /usr/local/x11r5/include \
  77. /usr/lpp/Xamples/include \
  78. \
  79. /usr/openwin/include \
  80. /usr/openwin/share/include \
  81. ; \
  82. do
  83. if test -r "$ac_dir/$x_direct_test_include"; then
  84. ac_x_includes=$ac_dir
  85. break
  86. fi
  87. done])
  88. fi # $ac_x_includes = NO
  89. if test "$ac_x_libraries" = NO; then
  90. # Check for the libraries.
  91. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  92. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  93. # See if we find them without any special options.
  94. # Don't add to $LIBS permanently.
  95. ac_save_LIBS="$LIBS"
  96. LIBS="-l$x_direct_test_library $LIBS"
  97. AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  98. [LIBS="$ac_save_LIBS"
  99. # We can link X programs with no special library path.
  100. ac_x_libraries=],
  101. [LIBS="$ac_save_LIBS"
  102. # First see if replacing the include by lib works.
  103. # Check X11 before X11Rn because it is often a symlink to the current release.
  104. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${tdelibsuff}/` \
  105. /usr/X11/lib${tdelibsuff} \
  106. /usr/X11R6/lib${tdelibsuff} \
  107. /usr/X11R5/lib${tdelibsuff} \
  108. /usr/X11R4/lib${tdelibsuff} \
  109. \
  110. /usr/lib${tdelibsuff}/X11 \
  111. /usr/lib${tdelibsuff}/X11R6 \
  112. /usr/lib${tdelibsuff}/X11R5 \
  113. /usr/lib${tdelibsuff}/X11R4 \
  114. \
  115. /usr/local/X11/lib${tdelibsuff} \
  116. /usr/local/X11R6/lib${tdelibsuff} \
  117. /usr/local/X11R5/lib${tdelibsuff} \
  118. /usr/local/X11R4/lib${tdelibsuff} \
  119. \
  120. /usr/local/lib${tdelibsuff}/X11 \
  121. /usr/local/lib${tdelibsuff}/X11R6 \
  122. /usr/local/lib${tdelibsuff}/X11R5 \
  123. /usr/local/lib${tdelibsuff}/X11R4 \
  124. \
  125. /usr/X386/lib${tdelibsuff} \
  126. /usr/x386/lib${tdelibsuff} \
  127. /usr/XFree86/lib${tdelibsuff}/X11 \
  128. \
  129. /usr/lib${tdelibsuff} \
  130. /usr/local/lib${tdelibsuff} \
  131. /usr/unsupported/lib${tdelibsuff} \
  132. /usr/athena/lib${tdelibsuff} \
  133. /usr/local/x11r5/lib${tdelibsuff} \
  134. /usr/lpp/Xamples/lib${tdelibsuff} \
  135. /lib/usr/lib${tdelibsuff}/X11 \
  136. \
  137. /usr/openwin/lib${tdelibsuff} \
  138. /usr/openwin/share/lib${tdelibsuff} \
  139. ; \
  140. do
  141. dnl Don't even attempt the hair of trying to link an X program!
  142. for ac_extension in a so sl; do
  143. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  144. ac_x_libraries=$ac_dir
  145. break 2
  146. fi
  147. done
  148. done])
  149. fi # $ac_x_libraries = NO
  150. ])
  151. dnl ------------------------------------------------------------------------
  152. dnl Find a file (or one of more files in a list of dirs)
  153. dnl ------------------------------------------------------------------------
  154. dnl
  155. AC_DEFUN([AC_FIND_FILE],
  156. [
  157. $3=NO
  158. for i in $2;
  159. do
  160. for j in $1;
  161. do
  162. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  163. if test -r "$i/$j"; then
  164. echo "taking that" >&AC_FD_CC
  165. $3=$i
  166. break 2
  167. fi
  168. done
  169. done
  170. ])
  171. dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
  172. dnl if-not-found, test-parameter, prepend-path)
  173. dnl
  174. dnl Look for program-name in list-of-dirs+$PATH.
  175. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  176. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  177. dnl test-parameter: if set, the program is executed with this arg,
  178. dnl and only a successful exit code is required.
  179. AC_DEFUN([KDE_FIND_PATH],
  180. [
  181. AC_MSG_CHECKING([for $1])
  182. if test -n "$$2"; then
  183. kde_cv_path="$$2";
  184. else
  185. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  186. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  187. [
  188. kde_cv_path="NONE"
  189. kde_save_IFS=$IFS
  190. IFS=':'
  191. dirs=""
  192. for dir in $PATH; do
  193. dirs="$dirs $dir"
  194. done
  195. if test -z "$6"; then dnl Append dirs in PATH (default)
  196. dirs="$3 $dirs"
  197. else dnl Prepend dirs in PATH (if 6th arg is set)
  198. dirs="$dirs $3"
  199. fi
  200. IFS=$kde_save_IFS
  201. for dir in $dirs; do
  202. if test -x "$dir/$1"; then
  203. if test -n "$5"
  204. then
  205. evalstr="$dir/$1 $5 2>&1 "
  206. if eval $evalstr; then
  207. kde_cv_path="$dir/$1"
  208. break
  209. fi
  210. else
  211. kde_cv_path="$dir/$1"
  212. break
  213. fi
  214. fi
  215. done
  216. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  217. ])
  218. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  219. fi
  220. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  221. AC_MSG_RESULT(not found)
  222. $4
  223. else
  224. AC_MSG_RESULT($kde_cv_path)
  225. $2=$kde_cv_path
  226. fi
  227. ])
  228. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  229. [
  230. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  231. Please check whether you installed Qt correctly.
  232. You need to have a running moc binary.
  233. configure tried to run $ac_cv_path_moc and the test didn't
  234. succeed. If configure shouldn't have tried this one, set
  235. the environment variable MOC to the right one before running
  236. configure.
  237. ])
  238. ])
  239. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  240. [
  241. AC_MSG_WARN([No Qt ui compiler (uic) found!
  242. Please check whether you installed Qt correctly.
  243. You need to have a running uic binary.
  244. configure tried to run $ac_cv_path_uic and the test didn't
  245. succeed. If configure shouldn't have tried this one, set
  246. the environment variable UIC to the right one before running
  247. configure.
  248. ])
  249. ])
  250. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  251. [
  252. AC_MSG_CHECKING([whether uic supports -$1 ])
  253. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  254. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  255. [
  256. cat >conftest.ui <<EOT
  257. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  258. EOT
  259. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  260. if AC_TRY_EVAL(ac_uic_testrun); then
  261. eval "kde_cv_prog_uic_$kde_cache=yes"
  262. else
  263. eval "kde_cv_prog_uic_$kde_cache=no"
  264. fi
  265. rm -f conftest*
  266. ])
  267. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  268. AC_MSG_RESULT([yes])
  269. :
  270. $3
  271. else
  272. AC_MSG_RESULT([no])
  273. :
  274. $4
  275. fi
  276. ])
  277. dnl ------------------------------------------------------------------------
  278. dnl Find the meta object compiler and the ui compiler in the PATH,
  279. dnl in $QTDIR/bin, and some more usual places
  280. dnl ------------------------------------------------------------------------
  281. dnl
  282. AC_DEFUN([AC_PATH_QT_MOC_UIC],
  283. [
  284. AC_REQUIRE([KDE_CHECK_PERL])
  285. qt_bindirs=""
  286. for dir in $kde_qt_dirs; do
  287. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  288. done
  289. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  290. if test ! "$ac_qt_bindir" = "NO"; then
  291. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  292. fi
  293. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  294. if test -z "$UIC_NOT_NEEDED"; then
  295. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  296. if test -z "$UIC_PATH" ; then
  297. KDE_UIC_ERROR_MESSAGE
  298. exit 1
  299. else
  300. UIC=$UIC_PATH
  301. if test $kde_qtver = 3; then
  302. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  303. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  304. if test x$ac_uic_supports_libpath = xyes; then
  305. UIC="$UIC -L \$(kde_widgetdir)"
  306. fi
  307. if test x$ac_uic_supports_nounload = xyes; then
  308. UIC="$UIC -nounload"
  309. fi
  310. fi
  311. fi
  312. else
  313. UIC="echo uic not available: "
  314. fi
  315. AC_SUBST(MOC)
  316. AC_SUBST(UIC)
  317. UIC_TR="i18n"
  318. if test $kde_qtver = 3; then
  319. UIC_TR="tr2i18n"
  320. fi
  321. AC_SUBST(UIC_TR)
  322. ])
  323. AC_DEFUN([KDE_1_CHECK_PATHS],
  324. [
  325. KDE_1_CHECK_PATH_HEADERS
  326. KDE_TEST_RPATH=
  327. if test -n "$USE_RPATH"; then
  328. if test -n "$kde_libraries"; then
  329. KDE_TEST_RPATH="-R $kde_libraries"
  330. fi
  331. if test -n "$qt_libraries"; then
  332. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  333. fi
  334. if test -n "$x_libraries"; then
  335. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  336. fi
  337. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  338. fi
  339. AC_MSG_CHECKING([for KDE libraries installed])
  340. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -ltdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  341. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  342. AC_MSG_RESULT(yes)
  343. else
  344. AC_MSG_ERROR([your system fails at linking a small KDE application!
  345. Check, if your compiler is installed correctly and if you have used the
  346. same compiler to compile Qt and tdelibs as you did use now.
  347. For more details about this problem, look at the end of config.log.])
  348. fi
  349. if eval `TDEDIR= ./conftest 2>&5`; then
  350. kde_result=done
  351. else
  352. kde_result=problems
  353. fi
  354. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  355. kde_have_all_paths=yes
  356. KDE_SET_PATHS($kde_result)
  357. ])
  358. AC_DEFUN([KDE_SET_PATHS],
  359. [
  360. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  361. kde_htmldir=\"$kde_htmldir\" \
  362. kde_appsdir=\"$kde_appsdir\" \
  363. kde_icondir=\"$kde_icondir\" \
  364. kde_sounddir=\"$kde_sounddir\" \
  365. kde_datadir=\"$kde_datadir\" \
  366. kde_locale=\"$kde_locale\" \
  367. kde_cgidir=\"$kde_cgidir\" \
  368. kde_confdir=\"$kde_confdir\" \
  369. kde_kcfgdir=\"$kde_kcfgdir\" \
  370. kde_mimedir=\"$kde_mimedir\" \
  371. kde_toolbardir=\"$kde_toolbardir\" \
  372. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  373. kde_templatesdir=\"$kde_templatesdir\" \
  374. kde_bindir=\"$kde_bindir\" \
  375. kde_servicesdir=\"$kde_servicesdir\" \
  376. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  377. kde_moduledir=\"$kde_moduledir\" \
  378. kde_styledir=\"$kde_styledir\" \
  379. kde_widgetdir=\"$kde_widgetdir\" \
  380. xdg_appsdir=\"$xdg_appsdir\" \
  381. xdg_menudir=\"$xdg_menudir\" \
  382. xdg_directorydir=\"$xdg_directorydir\" \
  383. kde_result=$1"
  384. ])
  385. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  386. [
  387. if test "$1" = "default"; then
  388. if test -z "$kde_htmldir"; then
  389. kde_htmldir='\${datadir}/doc/tde/HTML'
  390. fi
  391. if test -z "$kde_appsdir"; then
  392. kde_appsdir='\${datadir}/applnk'
  393. fi
  394. if test -z "$kde_icondir"; then
  395. kde_icondir='\${datadir}/icons'
  396. fi
  397. if test -z "$kde_sounddir"; then
  398. kde_sounddir='\${datadir}/sounds'
  399. fi
  400. if test -z "$kde_datadir"; then
  401. kde_datadir='\${datadir}/apps'
  402. fi
  403. if test -z "$kde_locale"; then
  404. kde_locale='\${datadir}/locale'
  405. fi
  406. if test -z "$kde_cgidir"; then
  407. kde_cgidir='\${exec_prefix}/cgi-bin'
  408. fi
  409. if test -z "$kde_confdir"; then
  410. kde_confdir='\${datadir}/config'
  411. fi
  412. if test -z "$kde_kcfgdir"; then
  413. kde_kcfgdir='\${datadir}/config.kcfg'
  414. fi
  415. if test -z "$kde_mimedir"; then
  416. kde_mimedir='\${datadir}/mimelnk'
  417. fi
  418. if test -z "$kde_toolbardir"; then
  419. kde_toolbardir='\${datadir}/toolbar'
  420. fi
  421. if test -z "$kde_wallpaperdir"; then
  422. kde_wallpaperdir='\${datadir}/wallpapers'
  423. fi
  424. if test -z "$kde_templatesdir"; then
  425. kde_templatesdir='\${datadir}/templates'
  426. fi
  427. if test -z "$kde_bindir"; then
  428. kde_bindir='\${exec_prefix}/bin'
  429. fi
  430. if test -z "$kde_servicesdir"; then
  431. kde_servicesdir='\${datadir}/services'
  432. fi
  433. if test -z "$kde_servicetypesdir"; then
  434. kde_servicetypesdir='\${datadir}/servicetypes'
  435. fi
  436. if test -z "$kde_moduledir"; then
  437. if test "$kde_qtver" = "2"; then
  438. kde_moduledir='\${libdir}/kde2'
  439. else
  440. kde_moduledir='\${libdir}/trinity'
  441. fi
  442. fi
  443. if test -z "$kde_styledir"; then
  444. kde_styledir='\${libdir}/trinity/plugins/styles'
  445. fi
  446. if test -z "$kde_widgetdir"; then
  447. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  448. fi
  449. if test -z "$xdg_appsdir"; then
  450. xdg_appsdir='\${datadir}/applications/tde'
  451. fi
  452. if test -z "$xdg_menudir"; then
  453. xdg_menudir='\${sysconfdir}/xdg/menus'
  454. fi
  455. if test -z "$xdg_directorydir"; then
  456. xdg_directorydir='\${datadir}/desktop-directories'
  457. fi
  458. KDE_SET_PATHS(defaults)
  459. else
  460. if test $kde_qtver = 1; then
  461. AC_MSG_RESULT([compiling])
  462. KDE_1_CHECK_PATHS
  463. else
  464. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  465. fi
  466. fi
  467. ])
  468. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  469. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  470. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  471. test -z "$kde_datadir" || test -z "$kde_locale" ||
  472. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  473. test -z "$kde_kcfgdir" ||
  474. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  475. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  476. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  477. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  478. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  479. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  480. test "x$kde_have_all_paths" != "xyes"; then
  481. kde_have_all_paths=no
  482. fi
  483. ])
  484. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  485. [
  486. AC_MSG_ERROR([The important program $1 was not found!
  487. Please check whether you installed KDE correctly.
  488. ])
  489. ])
  490. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  491. [
  492. AC_MSG_ERROR([The important program $1 was not found!
  493. Please check whether you installed aRts correctly or use
  494. --without-arts to compile without aRts support (this will remove functionality).
  495. ])
  496. ])
  497. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  498. [
  499. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/trinity/bin /usr/kde/bin /usr/local/kde/bin"
  500. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  501. if test -n "$TDEDIRS"; then
  502. kde_save_IFS=$IFS
  503. IFS=:
  504. for dir in $TDEDIRS; do
  505. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  506. done
  507. IFS=$kde_save_IFS
  508. fi
  509. ])
  510. AC_DEFUN([KDE_SUBST_PROGRAMS],
  511. [
  512. AC_ARG_WITH(arts,
  513. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  514. [build_arts=$withval],
  515. [build_arts=yes]
  516. )
  517. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  518. if test "$build_arts" = "no"; then
  519. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  520. fi
  521. KDE_SET_DEFAULT_BINDIRS
  522. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  523. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  524. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  525. if test "$build_arts" '!=' "no"; then
  526. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  527. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  528. fi
  529. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  530. trinity2ornewer=1
  531. trinity3ornewer=1
  532. if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
  533. trinity2ornewer=
  534. trinity3ornewer=
  535. else
  536. if test "$kde_qtver" = "3"; then
  537. if test "$kde_qtsubver" -le 1; then
  538. trinity2ornewer=
  539. fi
  540. if test "$kde_qtsubver" -le 2; then
  541. trinity3ornewer=
  542. fi
  543. if test "$KDECONFIG" != "compiled"; then
  544. if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
  545. trinity3ornewer=
  546. fi
  547. fi
  548. fi
  549. fi
  550. if test -n "$trinity2ornewer"; then
  551. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  552. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  553. fi
  554. if test -n "$trinity3ornewer"; then
  555. KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
  556. AC_SUBST(MAKEKDEWIDGETS)
  557. fi
  558. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  559. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  560. kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/trinity/share /opt/kde/share $prefix/share"
  561. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  562. AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  563. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  564. KDE_XSL_STYLESHEET=""
  565. else
  566. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
  567. fi
  568. fi
  569. DCOP_DEPENDENCIES='$(DCOPIDL)'
  570. if test -n "$trinity2ornewer"; then
  571. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  572. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  573. AC_SUBST(KCONFIG_COMPILER)
  574. AC_SUBST(KCFG_DEPENDENCIES)
  575. AC_SUBST(DCOPIDLNG)
  576. fi
  577. AC_SUBST(DCOPIDL)
  578. AC_SUBST(DCOPIDL2CPP)
  579. AC_SUBST(DCOP_DEPENDENCIES)
  580. AC_SUBST(MCOPIDL)
  581. AC_SUBST(ARTSCCONFIG)
  582. AC_SUBST(MEINPROC)
  583. AC_SUBST(KDE_XSL_STYLESHEET)
  584. AC_SUBST(XMLLINT)
  585. ])dnl
  586. AC_DEFUN([AC_CREATE_KFSSTND],
  587. [
  588. AC_REQUIRE([AC_CHECK_RPATH])
  589. AC_MSG_CHECKING([for KDE paths])
  590. kde_result=""
  591. kde_cached_paths=yes
  592. AC_CACHE_VAL(kde_cv_all_paths,
  593. [
  594. KDE_SET_DEFAULT_PATHS($1)
  595. kde_cached_paths=no
  596. ])
  597. eval "$kde_cv_all_paths"
  598. KDE_CHECK_PATHS_FOR_COMPLETENESS
  599. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  600. # wrong values were cached, may be, we can set better ones
  601. kde_result=
  602. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  603. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  604. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  605. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  606. kde_have_all_paths=
  607. kde_styledir=
  608. kde_widgetdir=
  609. xdg_appsdir = xdg_menudir= xdg_directorydir=
  610. KDE_SET_DEFAULT_PATHS($1)
  611. eval "$kde_cv_all_paths"
  612. KDE_CHECK_PATHS_FOR_COMPLETENESS
  613. kde_result="$kde_result (cache overridden)"
  614. fi
  615. if test "$kde_have_all_paths" = "no"; then
  616. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  617. Since it had compiled and linked before, it must be a strange problem on your system.
  618. Look at config.log for details. If you are not able to fix this, look at
  619. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  620. (If you're using an egcs version on Linux, you may update binutils!)
  621. ])
  622. else
  623. rm -f conftest*
  624. AC_MSG_RESULT($kde_result)
  625. fi
  626. bindir=$kde_bindir
  627. KDE_SUBST_PROGRAMS
  628. ])
  629. AC_DEFUN([AC_SUBST_KFSSTND],
  630. [
  631. AC_SUBST(kde_htmldir)
  632. AC_SUBST(kde_appsdir)
  633. AC_SUBST(kde_icondir)
  634. AC_SUBST(kde_sounddir)
  635. AC_SUBST(kde_datadir)
  636. AC_SUBST(kde_locale)
  637. AC_SUBST(kde_confdir)
  638. AC_SUBST(kde_kcfgdir)
  639. AC_SUBST(kde_mimedir)
  640. AC_SUBST(kde_wallpaperdir)
  641. AC_SUBST(kde_bindir)
  642. dnl X Desktop Group standards
  643. AC_SUBST(xdg_appsdir)
  644. AC_SUBST(xdg_menudir)
  645. AC_SUBST(xdg_directorydir)
  646. dnl for KDE 2
  647. AC_SUBST(kde_templatesdir)
  648. AC_SUBST(kde_servicesdir)
  649. AC_SUBST(kde_servicetypesdir)
  650. AC_SUBST(kde_moduledir)
  651. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  652. AC_SUBST(kde_styledir)
  653. AC_SUBST(kde_widgetdir)
  654. if test "$kde_qtver" = 1; then
  655. kde_minidir="$kde_icondir/mini"
  656. else
  657. # for KDE 1 - this breaks KDE2 apps using minidir, but
  658. # that's the plan ;-/
  659. kde_minidir="/dev/null"
  660. fi
  661. dnl AC_SUBST(kde_minidir)
  662. dnl AC_SUBST(kde_cgidir)
  663. dnl AC_SUBST(kde_toolbardir)
  664. ])
  665. AC_DEFUN([KDE_MISC_TESTS],
  666. [
  667. dnl Checks for libraries.
  668. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  669. AC_SUBST(LIBUTIL)
  670. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  671. AC_SUBST(LIBCOMPAT)
  672. kde_have_crypt=
  673. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  674. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  675. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  676. You should install libcrypt from another source or configure with PAM
  677. support])
  678. kde_have_crypt=no
  679. ]))
  680. AC_SUBST(LIBCRYPT)
  681. if test $kde_have_crypt = yes; then
  682. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  683. fi
  684. AC_CHECK_SOCKLEN_T
  685. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  686. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  687. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  688. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  689. fi
  690. AC_CHECK_FUNC(inet_ntoa)
  691. if test $ac_cv_func_inet_ntoa = no; then
  692. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  693. fi
  694. AC_CHECK_FUNC(connect)
  695. if test $ac_cv_func_connect = no; then
  696. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  697. $X_EXTRA_LIBS)
  698. fi
  699. AC_CHECK_FUNC(remove)
  700. if test $ac_cv_func_remove = no; then
  701. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  702. fi
  703. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  704. AC_CHECK_FUNC(shmat, ,
  705. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  706. # more headers that need to be explicitly included on darwin
  707. AC_CHECK_HEADERS(sys/types.h stdint.h)
  708. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  709. AC_CHECK_HEADERS(sys/bitypes.h)
  710. # darwin requires a poll emulation library
  711. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  712. # for some image handling on Mac OS X
  713. AC_CHECK_HEADERS(Carbon/Carbon.h)
  714. # CoreAudio framework
  715. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  716. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  717. FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
  718. ])
  719. AC_CHECK_RES_INIT
  720. AC_SUBST(LIB_POLL)
  721. AC_SUBST(FRAMEWORK_COREAUDIO)
  722. LIBSOCKET="$X_EXTRA_LIBS"
  723. AC_SUBST(LIBSOCKET)
  724. AC_SUBST(X_EXTRA_LIBS)
  725. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  726. AC_SUBST(LIBUCB)
  727. case $host in dnl this *is* LynxOS specific
  728. *-*-lynxos* )
  729. AC_MSG_CHECKING([LynxOS header file wrappers])
  730. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  731. AC_MSG_RESULT(disabled)
  732. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  733. ;;
  734. esac
  735. KDE_CHECK_TYPES
  736. KDE_CHECK_LIBDL
  737. KDE_CHECK_STRLCPY
  738. KDE_CHECK_PIE_SUPPORT
  739. # darwin needs this to initialize the environment
  740. AC_CHECK_HEADERS(crt_externs.h)
  741. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  742. AH_VERBATIM(_DARWIN_ENVIRON,
  743. [
  744. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  745. # include <sys/time.h>
  746. # include <crt_externs.h>
  747. # define environ (*_NSGetEnviron())
  748. #endif
  749. ])
  750. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  751. [
  752. /*
  753. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  754. * that defines bzero.
  755. */
  756. #if defined(_AIX)
  757. #include <strings.h>
  758. #endif
  759. ])
  760. AC_CHECK_FUNCS([vsnprintf snprintf])
  761. AH_VERBATIM(_TRU64,[
  762. /*
  763. * On HP-UX, the declaration of vsnprintf() is needed every time !
  764. */
  765. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  766. #if __STDC__
  767. #include <stdarg.h>
  768. #include <stdlib.h>
  769. #else
  770. #include <varargs.h>
  771. #endif
  772. #ifdef __cplusplus
  773. extern "C"
  774. #endif
  775. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  776. #ifdef __cplusplus
  777. extern "C"
  778. #endif
  779. int snprintf(char *str, size_t n, char const *fmt, ...);
  780. #endif
  781. ])
  782. ])
  783. dnl ------------------------------------------------------------------------
  784. dnl Find the header files and libraries for X-Windows. Extended the
  785. dnl macro AC_PATH_X
  786. dnl ------------------------------------------------------------------------
  787. dnl
  788. AC_DEFUN([K_PATH_X],
  789. [
  790. AC_REQUIRE([KDE_MISC_TESTS])dnl
  791. AC_REQUIRE([KDE_CHECK_LIB64])
  792. AC_ARG_ENABLE(
  793. embedded,
  794. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  795. kde_use_qt_emb=$enableval,
  796. kde_use_qt_emb=no
  797. )
  798. AC_ARG_ENABLE(
  799. qtopia,
  800. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  801. kde_use_qt_emb_palm=$enableval,
  802. kde_use_qt_emb_palm=no
  803. )
  804. AC_ARG_ENABLE(
  805. mac,
  806. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  807. kde_use_qt_mac=$enableval,
  808. kde_use_qt_mac=no
  809. )
  810. # used to disable x11-specific stuff on special platforms
  811. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  812. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  813. AC_MSG_CHECKING(for X)
  814. AC_CACHE_VAL(kde_cv_have_x,
  815. [# One or both of the vars are not set, and there is no cached value.
  816. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  817. kde_x_includes=NO
  818. else
  819. kde_x_includes=$x_includes
  820. fi
  821. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  822. kde_x_libraries=NO
  823. else
  824. kde_x_libraries=$x_libraries
  825. fi
  826. # below we use the standard autoconf calls
  827. ac_x_libraries=$kde_x_libraries
  828. ac_x_includes=$kde_x_includes
  829. KDE_PATH_X_DIRECT
  830. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  831. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  832. dnl location. The correct location is /usr/lib32 or an undefined value
  833. dnl (the linker is smart enough to pick the correct default library).
  834. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  835. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  836. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  837. dnl x_includes should be left alone.
  838. case "$host" in
  839. mips-sgi-irix6*)
  840. ;;
  841. *-*-solaris*)
  842. ;;
  843. *)
  844. _AC_PATH_X_XMKMF
  845. if test -z "$ac_x_includes"; then
  846. ac_x_includes="."
  847. fi
  848. if test -z "$ac_x_libraries"; then
  849. ac_x_libraries="/usr/lib${tdelibsuff}"
  850. fi
  851. esac
  852. #from now on we use our own again
  853. # when the user already gave --x-includes, we ignore
  854. # what the standard autoconf macros told us.
  855. if test "$kde_x_includes" = NO; then
  856. kde_x_includes=$ac_x_includes
  857. fi
  858. # for --x-libraries too
  859. if test "$kde_x_libraries" = NO; then
  860. kde_x_libraries=$ac_x_libraries
  861. fi
  862. if test "$kde_x_includes" = NO; then
  863. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  864. fi
  865. if test "$kde_x_libraries" = NO; then
  866. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  867. fi
  868. # Record where we found X for the cache.
  869. kde_cv_have_x="have_x=yes \
  870. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  871. ])dnl
  872. eval "$kde_cv_have_x"
  873. if test "$have_x" != yes; then
  874. AC_MSG_RESULT($have_x)
  875. no_x=yes
  876. else
  877. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  878. fi
  879. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  880. X_INCLUDES=""
  881. x_includes="."; dnl better than nothing :-
  882. else
  883. x_includes=$kde_x_includes
  884. X_INCLUDES="-I$x_includes"
  885. fi
  886. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  887. X_LDFLAGS=""
  888. x_libraries="/usr/lib"; dnl better than nothing :-
  889. else
  890. x_libraries=$kde_x_libraries
  891. X_LDFLAGS="-L$x_libraries"
  892. fi
  893. all_includes="$X_INCLUDES"
  894. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  895. # Check for libraries that X11R6 Xt/Xaw programs need.
  896. ac_save_LDFLAGS="$LDFLAGS"
  897. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  898. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  899. # check for ICE first), but we must link in the order -lSM -lICE or
  900. # we get undefined symbols. So assume we have SM if we have ICE.
  901. # These have to be linked with before -lX11, unlike the other
  902. # libraries we check for below, so use a different variable.
  903. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  904. AC_CHECK_LIB(ICE, IceConnectionNumber,
  905. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  906. LDFLAGS="$ac_save_LDFLAGS"
  907. LIB_X11='-lX11 $(LIBSOCKET)'
  908. AC_MSG_CHECKING(for libXext)
  909. AC_CACHE_VAL(kde_cv_have_libXext,
  910. [
  911. kde_ldflags_safe="$LDFLAGS"
  912. kde_libs_safe="$LIBS"
  913. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  914. LIBS="-lXext -lX11 $LIBSOCKET"
  915. AC_TRY_LINK([
  916. #include <stdio.h>
  917. #ifdef STDC_HEADERS
  918. # include <stdlib.h>
  919. #endif
  920. ],
  921. [
  922. printf("hello Xext\n");
  923. ],
  924. kde_cv_have_libXext=yes,
  925. kde_cv_have_libXext=no
  926. )
  927. LDFLAGS=$kde_ldflags_safe
  928. LIBS=$kde_libs_safe
  929. ])
  930. AC_MSG_RESULT($kde_cv_have_libXext)
  931. if test "$kde_cv_have_libXext" = "no"; then
  932. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  933. can't find it itself, we stop here assuming that make wouldn't find
  934. them either.])
  935. fi
  936. LIB_XEXT="-lXext"
  937. QTE_NORTTI=""
  938. elif test "$kde_use_qt_emb" = "yes"; then
  939. dnl We're using QT Embedded
  940. CPPFLAGS=-DQWS
  941. CXXFLAGS="$CXXFLAGS -fno-rtti"
  942. QTE_NORTTI="-fno-rtti -DQWS"
  943. X_PRE_LIBS=""
  944. LIB_X11=""
  945. LIB_XEXT=""
  946. LIB_XRENDER=""
  947. LIBSM=""
  948. X_INCLUDES=""
  949. X_LDFLAGS=""
  950. x_includes=""
  951. x_libraries=""
  952. elif test "$kde_use_qt_mac" = "yes"; then
  953. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  954. dnl be included to get the information) --Sam
  955. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  956. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  957. X_PRE_LIBS=""
  958. LIB_X11=""
  959. LIB_XEXT=""
  960. LIB_XRENDER=""
  961. LIBSM=""
  962. X_INCLUDES=""
  963. X_LDFLAGS=""
  964. x_includes=""
  965. x_libraries=""
  966. fi
  967. AC_SUBST(X_PRE_LIBS)
  968. AC_SUBST(LIB_X11)
  969. AC_SUBST(LIB_XRENDER)
  970. AC_SUBST(LIBSM)
  971. AC_SUBST(X_INCLUDES)
  972. AC_SUBST(X_LDFLAGS)
  973. AC_SUBST(x_includes)
  974. AC_SUBST(x_libraries)
  975. AC_SUBST(QTE_NORTTI)
  976. AC_SUBST(LIB_XEXT)
  977. ])
  978. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  979. [
  980. AC_REQUIRE([KDE_USE_QT])
  981. cat > conftest.$ac_ext <<EOF
  982. #include "confdefs.h"
  983. #include <qglobal.h>
  984. #include <qapplication.h>
  985. EOF
  986. if test "$kde_qtver" = "2"; then
  987. cat >> conftest.$ac_ext <<EOF
  988. #include <qevent.h>
  989. #include <qstring.h>
  990. #include <qstyle.h>
  991. EOF
  992. if test $kde_qtsubver -gt 0; then
  993. cat >> conftest.$ac_ext <<EOF
  994. #if TQT_VERSION < 210
  995. #error 1
  996. #endif
  997. EOF
  998. fi
  999. fi
  1000. if test "$kde_qtver" = "3"; then
  1001. cat >> conftest.$ac_ext <<EOF
  1002. #include <qcursor.h>
  1003. #include <qstylefactory.h>
  1004. #include <private/qucomextra_p.h>
  1005. EOF
  1006. fi
  1007. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  1008. cat >> conftest.$ac_ext <<EOF
  1009. #error 1
  1010. #endif
  1011. int main() {
  1012. EOF
  1013. if test "$kde_qtver" = "2"; then
  1014. cat >> conftest.$ac_ext <<EOF
  1015. QStringList *t = new QStringList();
  1016. Q_UNUSED(t);
  1017. EOF
  1018. if test $kde_qtsubver -gt 0; then
  1019. cat >> conftest.$ac_ext <<EOF
  1020. QString s;
  1021. s.setLatin1("Elvis is alive", 14);
  1022. EOF
  1023. fi
  1024. fi
  1025. if test "$kde_qtver" = "3"; then
  1026. cat >> conftest.$ac_ext <<EOF
  1027. (void)QStyleFactory::create(QString::null);
  1028. QCursor c(Qt::WhatsThisCursor);
  1029. EOF
  1030. fi
  1031. cat >> conftest.$ac_ext <<EOF
  1032. return 0;
  1033. }
  1034. EOF
  1035. ])
  1036. AC_DEFUN([KDE_USE_QT],
  1037. [
  1038. if test -z "$1"; then
  1039. # Current default Qt version: 3.3
  1040. kde_qtver=3
  1041. kde_qtsubver=3
  1042. else
  1043. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1044. # following is the check if subversion isnt found in passed argument
  1045. if test "$kde_qtsubver" = "$1"; then
  1046. kde_qtsubver=1
  1047. fi
  1048. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1049. if test "$kde_qtver" = "1"; then
  1050. kde_qtsubver=42
  1051. fi
  1052. fi
  1053. if test -z "$2"; then
  1054. if test "$kde_qtver" = "2"; then
  1055. if test $kde_qtsubver -gt 0; then
  1056. kde_qt_minversion=">= Qt 2.2.2"
  1057. else
  1058. kde_qt_minversion=">= Qt 2.0.2"
  1059. fi
  1060. fi
  1061. if test "$kde_qtver" = "3"; then
  1062. if test $kde_qtsubver -gt 0; then
  1063. if test $kde_qtsubver -gt 1; then
  1064. if test $kde_qtsubver -gt 2; then
  1065. kde_qt_minversion=">= Qt 3.3 and < 4.0"
  1066. else
  1067. kde_qt_minversion=">= Qt 3.2 and < 4.0"
  1068. fi
  1069. else
  1070. kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
  1071. fi
  1072. else
  1073. kde_qt_minversion=">= Qt 3.0 and < 4.0"
  1074. fi
  1075. fi
  1076. if test "$kde_qtver" = "1"; then
  1077. kde_qt_minversion=">= 1.42 and < 2.0"
  1078. fi
  1079. else
  1080. kde_qt_minversion="$2"
  1081. fi
  1082. if test -z "$3"; then
  1083. if test $kde_qtver = 3; then
  1084. if test $kde_qtsubver -gt 0; then
  1085. kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1086. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1087. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1088. else
  1089. kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1090. fi
  1091. fi
  1092. if test $kde_qtver = 2; then
  1093. if test $kde_qtsubver -gt 0; then
  1094. kde_qt_verstring="TQT_VERSION >= 222"
  1095. else
  1096. kde_qt_verstring="TQT_VERSION >= 200"
  1097. fi
  1098. fi
  1099. if test $kde_qtver = 1; then
  1100. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1101. fi
  1102. else
  1103. kde_qt_verstring="$3"
  1104. fi
  1105. if test $kde_qtver = 4; then
  1106. kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
  1107. fi
  1108. if test $kde_qtver = 3; then
  1109. kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
  1110. fi
  1111. if test $kde_qtver = 2; then
  1112. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  1113. fi
  1114. if test $kde_qtver = 1; then
  1115. kde_qt_dirs="$QTDIR /usr/lib/qt"
  1116. fi
  1117. ])
  1118. AC_DEFUN([KDE_CHECK_QT_DIRECT],
  1119. [
  1120. AC_REQUIRE([KDE_USE_QT])
  1121. AC_MSG_CHECKING([if Qt compiles without flags])
  1122. AC_CACHE_VAL(kde_cv_qt_direct,
  1123. [
  1124. AC_LANG_SAVE
  1125. AC_LANG_CPLUSPLUS
  1126. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1127. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1128. ac_cxxflags_safe="$CXXFLAGS"
  1129. ac_ldflags_safe="$LDFLAGS"
  1130. ac_libs_safe="$LIBS"
  1131. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  1132. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1133. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1134. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  1135. else
  1136. LIBS="$LIBQT $LIBSOCKET"
  1137. fi
  1138. LD_LIBRARY_PATH=
  1139. export LD_LIBRARY_PATH
  1140. LIBRARY_PATH=
  1141. export LIBRARY_PATH
  1142. KDE_PRINT_QT_PROGRAM
  1143. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1144. kde_cv_qt_direct="yes"
  1145. else
  1146. kde_cv_qt_direct="no"
  1147. echo "configure: failed program was:" >&AC_FD_CC
  1148. cat conftest.$ac_ext >&AC_FD_CC
  1149. fi
  1150. rm -f conftest*
  1151. CXXFLAGS="$ac_cxxflags_safe"
  1152. LDFLAGS="$ac_ldflags_safe"
  1153. LIBS="$ac_libs_safe"
  1154. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1155. export LD_LIBRARY_PATH
  1156. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1157. export LIBRARY_PATH
  1158. AC_LANG_RESTORE
  1159. ])
  1160. if test "$kde_cv_qt_direct" = "yes"; then
  1161. AC_MSG_RESULT(yes)
  1162. $1
  1163. else
  1164. AC_MSG_RESULT(no)
  1165. $2
  1166. fi
  1167. ])
  1168. dnl ------------------------------------------------------------------------
  1169. dnl Try to find the Qt headers and libraries.
  1170. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  1171. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  1172. dnl ------------------------------------------------------------------------
  1173. dnl
  1174. AC_DEFUN([AC_PATH_QT_1_3],
  1175. [
  1176. AC_REQUIRE([K_PATH_X])
  1177. AC_REQUIRE([KDE_USE_QT])
  1178. AC_REQUIRE([KDE_CHECK_LIB64])
  1179. dnl ------------------------------------------------------------------------
  1180. dnl Add configure flag to enable linking to MT version of Qt library.
  1181. dnl ------------------------------------------------------------------------
  1182. AC_ARG_ENABLE(
  1183. mt,
  1184. AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
  1185. kde_use_qt_mt=$enableval,
  1186. [
  1187. if test $kde_qtver = 3; then
  1188. kde_use_qt_mt=yes
  1189. else
  1190. kde_use_qt_mt=no
  1191. fi
  1192. ]
  1193. )
  1194. USING_QT_MT=""
  1195. dnl ------------------------------------------------------------------------
  1196. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1197. dnl ------------------------------------------------------------------------
  1198. KDE_MT_LDFLAGS=
  1199. KDE_MT_LIBS=
  1200. if test "x$kde_use_qt_mt" = "xyes"; then
  1201. KDE_CHECK_THREADING
  1202. if test "x$kde_use_threading" = "xyes"; then
  1203. CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
  1204. KDE_MT_LDFLAGS="$USE_THREADS"
  1205. KDE_MT_LIBS="$LIBPTHREAD"
  1206. else
  1207. kde_use_qt_mt=no
  1208. fi
  1209. fi
  1210. AC_SUBST(KDE_MT_LDFLAGS)
  1211. AC_SUBST(KDE_MT_LIBS)
  1212. kde_qt_was_given=yes
  1213. dnl ------------------------------------------------------------------------
  1214. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1215. dnl ------------------------------------------------------------------------
  1216. if test -z "$LIBQT_GLOB"; then
  1217. if test "x$kde_use_qt_emb" = "xyes"; then
  1218. LIBQT_GLOB="libqte.*"
  1219. else
  1220. LIBQT_GLOB="libqt.*"
  1221. fi
  1222. fi
  1223. dnl ------------------------------------------------------------
  1224. dnl If we got --enable-embedded then adjust the Qt library name.
  1225. dnl ------------------------------------------------------------
  1226. if test "x$kde_use_qt_emb" = "xyes"; then
  1227. qtlib="qte"
  1228. else
  1229. qtlib="qt"
  1230. fi
  1231. kde_int_qt="-l$qtlib"
  1232. if test -z "$LIBQPE"; then
  1233. dnl ------------------------------------------------------------
  1234. dnl If we got --enable-palmtop then add -lqpe to the link line
  1235. dnl ------------------------------------------------------------
  1236. if test "x$kde_use_qt_emb" = "xyes"; then
  1237. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1238. LIB_QPE="-lqpe"
  1239. else
  1240. LIB_QPE=""
  1241. fi
  1242. else
  1243. LIB_QPE=""
  1244. fi
  1245. fi
  1246. dnl ------------------------------------------------------------------------
  1247. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1248. dnl ------------------------------------------------------------------------
  1249. if test "x$kde_use_qt_mt" = "xyes"; then
  1250. LIBQT="-l$qtlib-mt"
  1251. kde_int_qt="-l$qtlib-mt"
  1252. LIBQT_GLOB="lib$qtlib-mt.*"
  1253. USING_QT_MT="using -mt"
  1254. else
  1255. LIBQT="-l$qtlib"
  1256. fi
  1257. if test $kde_qtver != 1; then
  1258. AC_REQUIRE([AC_FIND_PNG])
  1259. AC_REQUIRE([AC_FIND_JPEG])
  1260. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  1261. fi
  1262. if test $kde_qtver = 3; then
  1263. AC_REQUIRE([KDE_CHECK_LIBDL])
  1264. LIBQT="$LIBQT $LIBDL"
  1265. fi
  1266. AC_MSG_CHECKING([for Qt])
  1267. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1268. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1269. fi
  1270. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1271. qt_libraries=""
  1272. qt_includes=""
  1273. AC_ARG_WITH(qt-dir,
  1274. AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
  1275. [ ac_qt_includes="$withval"/include
  1276. ac_qt_libraries="$withval"/lib${tdelibsuff}
  1277. ac_qt_bindir="$withval"/bin
  1278. ])
  1279. AC_ARG_WITH(qt-includes,
  1280. AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
  1281. [
  1282. ac_qt_includes="$withval"
  1283. ])
  1284. kde_qt_libs_given=no
  1285. AC_ARG_WITH(qt-libraries,
  1286. AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
  1287. [ ac_qt_libraries="$withval"
  1288. kde_qt_libs_given=yes
  1289. ])
  1290. AC_CACHE_VAL(ac_cv_have_qt,
  1291. [#try to guess Qt locations
  1292. qt_incdirs=""
  1293. for dir in $kde_qt_dirs; do
  1294. qt_incdirs="$qt_incdirs $dir/include $dir"
  1295. done
  1296. qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
  1297. if test ! "$ac_qt_includes" = "NO"; then
  1298. qt_incdirs="$ac_qt_includes $qt_incdirs"
  1299. fi
  1300. if test "$kde_qtver" != "1"; then
  1301. kde_qt_header=qstyle.h
  1302. else
  1303. kde_qt_header=qglobal.h
  1304. fi
  1305. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1306. ac_qt_includes="$qt_incdir"
  1307. qt_libdirs=""
  1308. for dir in $kde_qt_dirs; do
  1309. qt_libdirs="$qt_libdirs $dir/lib${tdelibsuff} $dir"
  1310. done
  1311. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1312. if test ! "$ac_qt_libraries" = "NO"; then
  1313. qt_libdir=$ac_qt_libraries
  1314. else
  1315. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1316. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  1317. qt_libdir=NONE
  1318. for dir in $qt_libdirs; do
  1319. try="ls -1 $dir/${LIBQT_GLOB}"
  1320. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1321. done
  1322. fi
  1323. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1324. if test -e "$a"; then
  1325. LIBQT="$LIBQT ${kde_int_qt}_incremental"
  1326. break
  1327. fi
  1328. done
  1329. ac_qt_libraries="$qt_libdir"
  1330. AC_LANG_SAVE
  1331. AC_LANG_CPLUSPLUS
  1332. ac_cxxflags_safe="$CXXFLAGS"
  1333. ac_ldflags_safe="$LDFLAGS"
  1334. ac_libs_safe="$LIBS"
  1335. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1336. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1337. LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
  1338. KDE_PRINT_QT_PROGRAM
  1339. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1340. rm -f conftest*
  1341. else
  1342. echo "configure: failed program was:" >&AC_FD_CC
  1343. cat conftest.$ac_ext >&AC_FD_CC
  1344. ac_qt_libraries="NO"
  1345. fi
  1346. rm -f conftest*
  1347. CXXFLAGS="$ac_cxxflags_safe"
  1348. LDFLAGS="$ac_ldflags_safe"
  1349. LIBS="$ac_libs_safe"
  1350. AC_LANG_RESTORE
  1351. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1352. ac_cv_have_qt="have_qt=no"
  1353. ac_qt_notfound=""
  1354. missing_qt_mt=""
  1355. if test "$ac_qt_includes" = NO; then
  1356. if test "$ac_qt_libraries" = NO; then
  1357. ac_qt_notfound="(headers and libraries)";
  1358. else
  1359. ac_qt_notfound="(headers)";
  1360. fi
  1361. else
  1362. if test "x$kde_use_qt_mt" = "xyes"; then
  1363. missing_qt_mt="
  1364. Make sure that you have compiled Qt with thread support!"
  1365. ac_qt_notfound="(library $qtlib-mt)";
  1366. else
  1367. ac_qt_notfound="(library $qtlib)";
  1368. fi
  1369. fi
  1370. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1371. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1372. else
  1373. have_qt="yes"
  1374. fi
  1375. ])
  1376. eval "$ac_cv_have_qt"
  1377. if test "$have_qt" != yes; then
  1378. AC_MSG_RESULT([$have_qt]);
  1379. else
  1380. ac_cv_have_qt="have_qt=yes \
  1381. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  1382. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  1383. qt_libraries="$ac_qt_libraries"
  1384. qt_includes="$ac_qt_includes"
  1385. fi
  1386. if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
  1387. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1388. fi
  1389. AC_SUBST(qt_libraries)
  1390. AC_SUBST(qt_includes)
  1391. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  1392. QT_INCLUDES=""
  1393. else
  1394. QT_INCLUDES="-I$qt_includes"
  1395. all_includes="$QT_INCLUDES $all_includes"
  1396. fi
  1397. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1398. QT_LDFLAGS=""
  1399. else
  1400. QT_LDFLAGS="-L$qt_libraries"
  1401. all_libraries="$QT_LDFLAGS $all_libraries"
  1402. fi
  1403. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1404. AC_SUBST(QT_INCLUDES)
  1405. AC_SUBST(QT_LDFLAGS)
  1406. AC_PATH_QT_MOC_UIC
  1407. KDE_CHECK_QT_JPEG
  1408. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1409. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
  1410. else
  1411. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
  1412. fi
  1413. test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
  1414. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1415. if test -e "$a"; then
  1416. LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
  1417. break
  1418. fi
  1419. done
  1420. AC_SUBST(LIB_QT)
  1421. AC_SUBST(LIB_QPE)
  1422. AC_SUBST(kde_qtver)
  1423. ])
  1424. AC_DEFUN([AC_PATH_QT],
  1425. [
  1426. AC_PATH_QT_1_3
  1427. ])
  1428. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1429. [
  1430. AC_REQUIRE([AC_PATH_QT_MOC_UIC])
  1431. if test x$ac_uic_supports_libpath = xyes; then
  1432. AC_MSG_CHECKING([if UIC has KDE plugins available])
  1433. AC_CACHE_VAL(kde_cv_uic_plugins,
  1434. [
  1435. cat > actest.ui << EOF
  1436. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1437. <class>NewConnectionDialog</class>
  1438. <widget class="QDialog">
  1439. <widget class="KLineEdit">
  1440. <property name="name">
  1441. <cstring>testInput</cstring>
  1442. </property>
  1443. </widget>
  1444. </widget>
  1445. </UI>
  1446. EOF
  1447. kde_cv_uic_plugins=no
  1448. kde_line="$UIC_PATH -L $kde_widgetdir"
  1449. if test x$ac_uic_supports_nounload = xyes; then
  1450. kde_line="$kde_line -nounload"
  1451. fi
  1452. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1453. if AC_TRY_EVAL(kde_line); then
  1454. # if you're trying to debug this check and think it's incorrect,
  1455. # better check your installation. The check _is_ correct - your
  1456. # installation is not.
  1457. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1458. kde_cv_uic_plugins=yes
  1459. fi
  1460. fi
  1461. rm -f actest.ui actest.cpp
  1462. ])
  1463. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1464. if test "$kde_cv_uic_plugins" != yes; then
  1465. AC_MSG_ERROR([
  1466. you need to install tdelibs first.
  1467. If you did install tdelibs, then the Qt version that is picked up by
  1468. this configure is not the same version you used to compile tdelibs.
  1469. The Qt Plugin installed by tdelibs is *ONLY* loadable if it is the
  1470. _same Qt version_, compiled with the _same compiler_ and the same Qt
  1471. configuration settings.
  1472. ])
  1473. fi
  1474. fi
  1475. ])
  1476. AC_DEFUN([KDE_CHECK_FINAL],
  1477. [
  1478. AC_ARG_ENABLE(final,
  1479. AC_HELP_STRING([--enable-final],
  1480. [build size optimized apps (experimental - needs lots of memory)]),
  1481. kde_use_final=$enableval, kde_use_final=no)
  1482. if test "x$kde_use_final" = "xyes"; then
  1483. KDE_USE_FINAL_TRUE=""
  1484. KDE_USE_FINAL_FALSE="#"
  1485. else
  1486. KDE_USE_FINAL_TRUE="#"
  1487. KDE_USE_FINAL_FALSE=""
  1488. fi
  1489. AC_SUBST(KDE_USE_FINAL_TRUE)
  1490. AC_SUBST(KDE_USE_FINAL_FALSE)
  1491. ])
  1492. AC_DEFUN([KDE_CHECK_CLOSURE],
  1493. [
  1494. AC_ARG_ENABLE(closure,
  1495. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1496. kde_use_closure=$enableval, kde_use_closure=no)
  1497. KDE_NO_UNDEFINED=""
  1498. if test "x$kde_use_closure" = "xyes"; then
  1499. KDE_USE_CLOSURE_TRUE=""
  1500. KDE_USE_CLOSURE_FALSE="#"
  1501. # CXXFLAGS="$CXXFLAGS $REPO"
  1502. else
  1503. KDE_USE_CLOSURE_TRUE="#"
  1504. KDE_USE_CLOSURE_FALSE=""
  1505. KDE_NO_UNDEFINED=""
  1506. case $host in
  1507. *-*-linux-gnu)
  1508. KDE_CHECK_COMPILER_FLAG([Wl,--no-undefined],
  1509. [KDE_CHECK_COMPILER_FLAG([Wl,--allow-shlib-undefined],
  1510. [KDE_NO_UNDEFINED="-Wl,--no-undefined -Wl,--allow-shlib-undefined"],
  1511. [KDE_NO_UNDEFINED=""])],
  1512. [KDE_NO_UNDEFINED=""])
  1513. ;;
  1514. esac
  1515. fi
  1516. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1517. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1518. AC_SUBST(KDE_NO_UNDEFINED)
  1519. ])
  1520. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1521. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1522. [
  1523. AC_ARG_ENABLE(new_ldflags,
  1524. AC_HELP_STRING([--enable-new-ldflags],
  1525. [enable the new linker flags]),
  1526. kde_use_new_ldflags=$enableval,
  1527. kde_use_new_ldflags=no)
  1528. LDFLAGS_AS_NEEDED=""
  1529. LDFLAGS_NEW_DTAGS=""
  1530. if test "x$kde_use_new_ldflags" = "xyes"; then
  1531. LDFLAGS_NEW_DTAGS=""
  1532. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1533. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1534. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1535. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1536. fi
  1537. AC_SUBST(LDFLAGS_AS_NEEDED)
  1538. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1539. ])
  1540. AC_DEFUN([KDE_CHECK_NMCHECK],
  1541. [
  1542. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1543. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1544. if test "$kde_use_nmcheck" = "yes"; then
  1545. KDE_USE_NMCHECK_TRUE=""
  1546. KDE_USE_NMCHECK_FALSE="#"
  1547. else
  1548. KDE_USE_NMCHECK_TRUE="#"
  1549. KDE_USE_NMCHECK_FALSE=""
  1550. fi
  1551. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1552. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1553. ])
  1554. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1555. savex=$exec_prefix
  1556. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1557. tmp=$$2
  1558. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1559. exec_prefix=$savex
  1560. ])
  1561. dnl ------------------------------------------------------------------------
  1562. dnl Now, the same with KDE
  1563. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1564. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1565. dnl ------------------------------------------------------------------------
  1566. dnl
  1567. AC_DEFUN([AC_BASE_PATH_KDE],
  1568. [
  1569. AC_REQUIRE([KDE_CHECK_STL])
  1570. AC_REQUIRE([AC_PATH_QT])dnl
  1571. AC_REQUIRE([KDE_CHECK_LIB64])
  1572. AC_CHECK_RPATH
  1573. AC_MSG_CHECKING([for KDE])
  1574. if test "${prefix}" != NONE; then
  1575. kde_includes=${includedir}
  1576. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1577. kde_libraries=${libdir}
  1578. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1579. else
  1580. ac_kde_includes=
  1581. ac_kde_libraries=
  1582. kde_libraries=""
  1583. kde_includes=""
  1584. fi
  1585. AC_CACHE_VAL(ac_cv_have_kde,
  1586. [#try to guess kde locations
  1587. if test "$kde_qtver" = 1; then
  1588. kde_check_header="ksock.h"
  1589. kde_check_lib="libtdecore.la"
  1590. else
  1591. kde_check_header="ksharedptr.h"
  1592. kde_check_lib="libtdeio.la"
  1593. fi
  1594. if test -z "$1"; then
  1595. kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/tde /usr/include /opt/trinity/include /opt/kde/include $x_includes $qt_includes"
  1596. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1597. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1598. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1599. ac_kde_includes="$kde_incdir"
  1600. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1601. AC_MSG_ERROR([
  1602. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1603. So, check this please and use another prefix!])
  1604. fi
  1605. kde_libdirs="$kde_libs_prefix/lib${tdelibsuff} /usr/lib/kde/lib${tdelibsuff} /usr/local/kde/lib${tdelibsuff} /usr/kde/lib${tdelibsuff} /usr/lib${tdelibsuff}/kde /usr/lib${tdelibsuff}/trinity /usr/lib${tdelibsuff} /usr/X11R6/lib${tdelibsuff} /usr/local/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/kde/lib${tdelibsuff} /usr/X11R6/kde/lib${tdelibsuff}"
  1606. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1607. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1608. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1609. ac_kde_libraries="$kde_libdir"
  1610. kde_widgetdir=NO
  1611. dnl this might be somewhere else
  1612. AC_FIND_FILE("trinity/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
  1613. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1614. AC_MSG_ERROR([
  1615. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1616. So, check this please and use another prefix!])
  1617. fi
  1618. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/kdewidgets.la"; then
  1619. AC_MSG_ERROR([
  1620. I can't find the designer plugins. These are required and should have been installed
  1621. by tdelibs])
  1622. fi
  1623. if test -n "$kde_widgetdir"; then
  1624. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1625. fi
  1626. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1627. ac_cv_have_kde="have_kde=no"
  1628. else
  1629. ac_cv_have_kde="have_kde=yes \
  1630. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1631. fi
  1632. else dnl test -z $1, e.g. from tdelibs
  1633. ac_cv_have_kde="have_kde=no"
  1634. fi
  1635. ])dnl
  1636. eval "$ac_cv_have_kde"
  1637. if test "$have_kde" != "yes"; then
  1638. if test "${prefix}" = NONE; then
  1639. ac_kde_prefix="$ac_default_prefix"
  1640. else
  1641. ac_kde_prefix="$prefix"
  1642. fi
  1643. if test "$exec_prefix" = NONE; then
  1644. ac_kde_exec_prefix="$ac_kde_prefix"
  1645. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1646. else
  1647. ac_kde_exec_prefix="$exec_prefix"
  1648. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1649. fi
  1650. kde_libraries="${libdir}"
  1651. kde_includes="${includedir}"
  1652. else
  1653. ac_cv_have_kde="have_kde=yes \
  1654. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1655. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1656. kde_libraries="$ac_kde_libraries"
  1657. kde_includes="$ac_kde_includes"
  1658. fi
  1659. AC_SUBST(kde_libraries)
  1660. AC_SUBST(kde_includes)
  1661. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1662. KDE_INCLUDES=""
  1663. else
  1664. KDE_INCLUDES="-I$kde_includes"
  1665. all_includes="$KDE_INCLUDES $all_includes"
  1666. fi
  1667. KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
  1668. KDE_LDFLAGS="-L$kde_libraries"
  1669. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1670. all_libraries="$KDE_LDFLAGS $all_libraries"
  1671. fi
  1672. AC_SUBST(KDE_LDFLAGS)
  1673. AC_SUBST(KDE_INCLUDES)
  1674. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1675. all_libraries="$all_libraries $USER_LDFLAGS"
  1676. all_includes="$all_includes $USER_INCLUDES"
  1677. AC_SUBST(all_includes)
  1678. AC_SUBST(all_libraries)
  1679. if test -z "$1"; then
  1680. KDE_CHECK_UIC_PLUGINS
  1681. fi
  1682. ac_kde_libraries="$kde_libdir"
  1683. AC_SUBST(AUTODIRS)
  1684. ])
  1685. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1686. [
  1687. AC_MSG_CHECKING(for extra includes)
  1688. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1689. kde_use_extra_includes="$withval",
  1690. kde_use_extra_includes=NONE
  1691. )
  1692. kde_extra_includes=
  1693. if test -n "$kde_use_extra_includes" && \
  1694. test "$kde_use_extra_includes" != "NONE"; then
  1695. ac_save_ifs=$IFS
  1696. IFS=':'
  1697. for dir in $kde_use_extra_includes; do
  1698. kde_extra_includes="$kde_extra_includes $dir"
  1699. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1700. done
  1701. IFS=$ac_save_ifs
  1702. kde_use_extra_includes="added"
  1703. else
  1704. kde_use_extra_includes="no"
  1705. fi
  1706. AC_SUBST(USER_INCLUDES)
  1707. AC_MSG_RESULT($kde_use_extra_includes)
  1708. kde_extra_libs=
  1709. AC_MSG_CHECKING(for extra libs)
  1710. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1711. kde_use_extra_libs=$withval,
  1712. kde_use_extra_libs=NONE
  1713. )
  1714. if test -n "$kde_use_extra_libs" && \
  1715. test "$kde_use_extra_libs" != "NONE"; then
  1716. ac_save_ifs=$IFS
  1717. IFS=':'
  1718. for dir in $kde_use_extra_libs; do
  1719. kde_extra_libs="$kde_extra_libs $dir"
  1720. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1721. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1722. done
  1723. IFS=$ac_save_ifs
  1724. kde_use_extra_libs="added"
  1725. else
  1726. kde_use_extra_libs="no"
  1727. fi
  1728. AC_SUBST(USER_LDFLAGS)
  1729. AC_MSG_RESULT($kde_use_extra_libs)
  1730. ])
  1731. AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
  1732. [
  1733. AC_MSG_CHECKING([for KDE headers installed])
  1734. AC_LANG_SAVE
  1735. AC_LANG_CPLUSPLUS
  1736. cat > conftest.$ac_ext <<EOF
  1737. #ifdef STDC_HEADERS
  1738. # include <stdlib.h>
  1739. #endif
  1740. #include <stdio.h>
  1741. #include "confdefs.h"
  1742. #include <kapp.h>
  1743. int main() {
  1744. printf("kde_htmldir=\\"%s\\"\n", TDEApplication::kde_htmldir().data());
  1745. printf("kde_appsdir=\\"%s\\"\n", TDEApplication::kde_appsdir().data());
  1746. printf("kde_icondir=\\"%s\\"\n", TDEApplication::kde_icondir().data());
  1747. printf("kde_sounddir=\\"%s\\"\n", TDEApplication::kde_sounddir().data());
  1748. printf("kde_datadir=\\"%s\\"\n", TDEApplication::kde_datadir().data());
  1749. printf("kde_locale=\\"%s\\"\n", TDEApplication::kde_localedir().data());
  1750. printf("kde_cgidir=\\"%s\\"\n", TDEApplication::kde_cgidir().data());
  1751. printf("kde_confdir=\\"%s\\"\n", TDEApplication::kde_configdir().data());
  1752. printf("kde_mimedir=\\"%s\\"\n", TDEApplication::kde_mimedir().data());
  1753. printf("kde_toolbardir=\\"%s\\"\n", TDEApplication::kde_toolbardir().data());
  1754. printf("kde_wallpaperdir=\\"%s\\"\n",
  1755. TDEApplication::kde_wallpaperdir().data());
  1756. printf("kde_bindir=\\"%s\\"\n", TDEApplication::kde_bindir().data());
  1757. printf("kde_partsdir=\\"%s\\"\n", TDEApplication::kde_partsdir().data());
  1758. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1759. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1760. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1761. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1762. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1763. printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
  1764. printf("xdg_menudir=\\"/tmp/dummy\\"\n");
  1765. printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
  1766. printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
  1767. return 0;
  1768. }
  1769. EOF
  1770. ac_save_CPPFLAGS=$CPPFLAGS
  1771. CPPFLAGS="$all_includes $CPPFLAGS"
  1772. if AC_TRY_EVAL(ac_compile); then
  1773. AC_MSG_RESULT(yes)
  1774. else
  1775. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1776. Check, if you installed the KDE header files correctly.
  1777. For more details about this problem, look at the end of config.log.])
  1778. fi
  1779. CPPFLAGS=$ac_save_CPPFLAGS
  1780. AC_LANG_RESTORE
  1781. ])
  1782. AC_DEFUN([KDE_CHECK_KDEQTADDON],
  1783. [
  1784. AC_MSG_CHECKING(for kde-qt-addon)
  1785. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1786. [
  1787. kde_ldflags_safe="$LDFLAGS"
  1788. kde_libs_safe="$LIBS"
  1789. kde_cxxflags_safe="$CXXFLAGS"
  1790. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1791. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1792. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1793. AC_TRY_LINK([
  1794. #include <qdom.h>
  1795. ],
  1796. [
  1797. QDomDocument doc;
  1798. ],
  1799. kde_cv_have_kdeqtaddon=yes,
  1800. kde_cv_have_kdeqtaddon=no
  1801. )
  1802. LDFLAGS=$kde_ldflags_safe
  1803. LIBS=$kde_libs_safe
  1804. CXXFLAGS=$kde_cxxflags_safe
  1805. ])
  1806. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  1807. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  1808. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1809. It is a separate package (and CVS module) named kde-qt-addon.])
  1810. fi
  1811. ])
  1812. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  1813. [
  1814. AC_REQUIRE([KDE_MISC_TESTS])
  1815. AC_REQUIRE([KDE_CHECK_LIBDL])
  1816. AC_REQUIRE([K_PATH_X])
  1817. if test $kde_qtver = 3; then
  1818. case $host in
  1819. *cygwin*) lib_kded="-ltdeinit_kded" ;;
  1820. *) lib_kded="" ;;
  1821. esac
  1822. AC_SUBST(LIB_KDED, $lib_kded)
  1823. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1824. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1825. AC_SUBST(LIB_KIO, "-lkio")
  1826. AC_SUBST(LIB_KJS, "-lkjs")
  1827. AC_SUBST(LIB_SMB, "-lsmb")
  1828. AC_SUBST(LIB_KAB, "-lkab")
  1829. AC_SUBST(LIB_KABC, "-lkabc")
  1830. AC_SUBST(LIB_KHTML, "-ltdehtml")
  1831. AC_SUBST(LIB_KSPELL, "-ltdespell")
  1832. AC_SUBST(LIB_KPARTS, "-ltdeparts")
  1833. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1834. AC_SUBST(LIB_KUTILS, "-ltdeutils")
  1835. AC_SUBST(LIB_TDEPIM, "-ltdepim")
  1836. AC_SUBST(LIB_KIMPROXY, "-ltdeimproxy")
  1837. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  1838. AC_SUBST(LIB_KDNSSD, "-ltdednssd")
  1839. AC_SUBST(LIB_KUNITTEST, "-ltdeunittest")
  1840. # these are for backward compatibility
  1841. AC_SUBST(LIB_KSYCOCA, "-lkio")
  1842. AC_SUBST(LIB_KFILE, "-lkio")
  1843. elif test $kde_qtver = 2; then
  1844. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1845. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1846. AC_SUBST(LIB_KIO, "-lkio")
  1847. AC_SUBST(LIB_KSYCOCA, "-ltdesycoca")
  1848. AC_SUBST(LIB_SMB, "-lsmb")
  1849. AC_SUBST(LIB_KFILE, "-ltdefile")
  1850. AC_SUBST(LIB_KAB, "-lkab")
  1851. AC_SUBST(LIB_KHTML, "-ltdehtml")
  1852. AC_SUBST(LIB_KSPELL, "-ltdespell")
  1853. AC_SUBST(LIB_KPARTS, "-ltdeparts")
  1854. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1855. else
  1856. AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_QT)")
  1857. AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
  1858. AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
  1859. AC_SUBST(LIB_KFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
  1860. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
  1861. fi
  1862. ])
  1863. AC_DEFUN([AC_PATH_KDE],
  1864. [
  1865. AC_BASE_PATH_KDE
  1866. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  1867. [
  1868. if test "$enableval" = "no";
  1869. then ac_use_path_checking="default"
  1870. else ac_use_path_checking=""
  1871. fi
  1872. ],
  1873. [
  1874. if test "$kde_qtver" = 1;
  1875. then ac_use_path_checking=""
  1876. else ac_use_path_checking="default"
  1877. fi
  1878. ]
  1879. )
  1880. AC_CREATE_KFSSTND($ac_use_path_checking)
  1881. AC_SUBST_KFSSTND
  1882. KDE_CREATE_LIBS_ALIASES
  1883. ])
  1884. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1885. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  1886. [
  1887. AC_MSG_CHECKING(for $1)
  1888. AC_CACHE_VAL(kde_cv_func_$1,
  1889. [
  1890. AC_LANG_SAVE
  1891. AC_LANG_CPLUSPLUS
  1892. save_CXXFLAGS="$CXXFLAGS"
  1893. kde_safe_LIBS="$LIBS"
  1894. LIBS="$LIBS $X_EXTRA_LIBS"
  1895. if test "$GXX" = "yes"; then
  1896. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1897. fi
  1898. AC_TRY_COMPILE([
  1899. $2
  1900. ],
  1901. [
  1902. $3
  1903. ],
  1904. kde_cv_func_$1=yes,
  1905. kde_cv_func_$1=no)
  1906. CXXFLAGS="$save_CXXFLAGS"
  1907. LIBS="$kde_safe_LIBS"
  1908. AC_LANG_RESTORE
  1909. ])
  1910. AC_MSG_RESULT($kde_cv_func_$1)
  1911. AC_MSG_CHECKING([if $1 needs custom prototype])
  1912. AC_CACHE_VAL(kde_cv_proto_$1,
  1913. [
  1914. if test "x$kde_cv_func_$1" = xyes; then
  1915. kde_cv_proto_$1=no
  1916. else
  1917. case "$1" in
  1918. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1919. kde_cv_proto_$1="yes - in libtdefakes"
  1920. ;;
  1921. *)
  1922. kde_cv_proto_$1=unknown
  1923. ;;
  1924. esac
  1925. fi
  1926. if test "x$kde_cv_proto_$1" = xunknown; then
  1927. AC_LANG_SAVE
  1928. AC_LANG_CPLUSPLUS
  1929. kde_safe_libs=$LIBS
  1930. LIBS="$LIBS $X_EXTRA_LIBS"
  1931. AC_TRY_LINK([
  1932. $2
  1933. extern "C" $4;
  1934. ],
  1935. [
  1936. $3
  1937. ],
  1938. [ kde_cv_func_$1=yes
  1939. kde_cv_proto_$1=yes ],
  1940. [kde_cv_proto_$1="$1 unavailable"]
  1941. )
  1942. LIBS=$kde_safe_libs
  1943. AC_LANG_RESTORE
  1944. fi
  1945. ])
  1946. AC_MSG_RESULT($kde_cv_proto_$1)
  1947. if test "x$kde_cv_func_$1" = xyes; then
  1948. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1949. $6
  1950. fi
  1951. if test "x$kde_cv_proto_$1" = xno; then
  1952. AC_DEFINE(HAVE_$5_PROTO, 1,
  1953. [Define if you have the $1 prototype])
  1954. fi
  1955. AH_VERBATIM([_HAVE_$5_PROTO],
  1956. [
  1957. #if !defined(HAVE_$5_PROTO)
  1958. #ifdef __cplusplus
  1959. extern "C" {
  1960. #endif
  1961. $4;
  1962. #ifdef __cplusplus
  1963. }
  1964. #endif
  1965. #endif
  1966. ])
  1967. ])
  1968. AC_DEFUN([AC_CHECK_SETENV],
  1969. [
  1970. KDE_CHECK_FUNC_EXT(setenv, [
  1971. #include <stdlib.h>
  1972. ],
  1973. [setenv("VAR", "VALUE", 1);],
  1974. [int setenv (const char *, const char *, int)],
  1975. [SETENV])
  1976. ])
  1977. AC_DEFUN([AC_CHECK_UNSETENV],
  1978. [
  1979. KDE_CHECK_FUNC_EXT(unsetenv, [
  1980. #include <stdlib.h>
  1981. ],
  1982. [unsetenv("VAR");],
  1983. [void unsetenv (const char *)],
  1984. [UNSETENV])
  1985. ])
  1986. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  1987. [
  1988. KDE_CHECK_FUNC_EXT(getdomainname, [
  1989. #include <stdlib.h>
  1990. #include <unistd.h>
  1991. #include <netdb.h>
  1992. ],
  1993. [
  1994. char buffer[200];
  1995. getdomainname(buffer, 200);
  1996. ],
  1997. [#include <sys/types.h>
  1998. int getdomainname (char *, size_t)],
  1999. [GETDOMAINNAME])
  2000. ])
  2001. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  2002. [
  2003. KDE_CHECK_FUNC_EXT(gethostname, [
  2004. #include <stdlib.h>
  2005. #include <unistd.h>
  2006. ],
  2007. [
  2008. char buffer[200];
  2009. gethostname(buffer, 200);
  2010. ],
  2011. [int gethostname (char *, unsigned int)],
  2012. [GETHOSTNAME])
  2013. ])
  2014. AC_DEFUN([AC_CHECK_USLEEP],
  2015. [
  2016. KDE_CHECK_FUNC_EXT(usleep, [
  2017. #include <unistd.h>
  2018. ],
  2019. [
  2020. usleep(200);
  2021. ],
  2022. [int usleep (unsigned int)],
  2023. [USLEEP])
  2024. ])
  2025. AC_DEFUN([AC_CHECK_RANDOM],
  2026. [
  2027. KDE_CHECK_FUNC_EXT(random, [
  2028. #include <stdlib.h>
  2029. ],
  2030. [
  2031. random();
  2032. ],
  2033. [long int random(void)],
  2034. [RANDOM])
  2035. KDE_CHECK_FUNC_EXT(srandom, [
  2036. #include <stdlib.h>
  2037. ],
  2038. [
  2039. srandom(27);
  2040. ],
  2041. [void srandom(unsigned int)],
  2042. [SRANDOM])
  2043. ])
  2044. AC_DEFUN([AC_CHECK_INITGROUPS],
  2045. [
  2046. KDE_CHECK_FUNC_EXT(initgroups, [
  2047. #include <sys/types.h>
  2048. #include <unistd.h>
  2049. #include <grp.h>
  2050. ],
  2051. [
  2052. char buffer[200];
  2053. initgroups(buffer, 27);
  2054. ],
  2055. [int initgroups(const char *, gid_t)],
  2056. [INITGROUPS])
  2057. ])
  2058. AC_DEFUN([AC_CHECK_MKSTEMPS],
  2059. [
  2060. KDE_CHECK_FUNC_EXT(mkstemps, [
  2061. #include <stdlib.h>
  2062. #include <unistd.h>
  2063. ],
  2064. [
  2065. mkstemps("/tmp/aaaXXXXXX", 6);
  2066. ],
  2067. [int mkstemps(char *, int)],
  2068. [MKSTEMPS])
  2069. ])
  2070. AC_DEFUN([AC_CHECK_MKSTEMP],
  2071. [
  2072. KDE_CHECK_FUNC_EXT(mkstemp, [
  2073. #include <stdlib.h>
  2074. #include <unistd.h>
  2075. ],
  2076. [
  2077. mkstemp("/tmp/aaaXXXXXX");
  2078. ],
  2079. [int mkstemp(char *)],
  2080. [MKSTEMP])
  2081. ])
  2082. AC_DEFUN([AC_CHECK_MKDTEMP],
  2083. [
  2084. KDE_CHECK_FUNC_EXT(mkdtemp, [
  2085. #include <stdlib.h>
  2086. #include <unistd.h>
  2087. ],
  2088. [
  2089. mkdtemp("/tmp/aaaXXXXXX");
  2090. ],
  2091. [char *mkdtemp(char *)],
  2092. [MKDTEMP])
  2093. ])
  2094. AC_DEFUN([AC_CHECK_RES_INIT],
  2095. [
  2096. AC_MSG_CHECKING([if res_init needs -lresolv])
  2097. kde_libs_safe="$LIBS"
  2098. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  2099. AC_TRY_LINK(
  2100. [
  2101. #include <sys/types.h>
  2102. #include <netinet/in.h>
  2103. #include <arpa/nameser.h>
  2104. #include <resolv.h>
  2105. ],
  2106. [
  2107. res_init();
  2108. ],
  2109. [
  2110. LIBRESOLV="-lresolv"
  2111. AC_MSG_RESULT(yes)
  2112. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  2113. ],
  2114. [ AC_MSG_RESULT(no) ]
  2115. )
  2116. LIBS=$kde_libs_safe
  2117. AC_SUBST(LIBRESOLV)
  2118. KDE_CHECK_FUNC_EXT(res_init,
  2119. [
  2120. #include <sys/types.h>
  2121. #include <netinet/in.h>
  2122. #include <arpa/nameser.h>
  2123. #include <resolv.h>
  2124. ],
  2125. [res_init()],
  2126. [int res_init(void)],
  2127. [RES_INIT])
  2128. ])
  2129. AC_DEFUN([AC_CHECK_STRLCPY],
  2130. [
  2131. KDE_CHECK_FUNC_EXT(strlcpy, [
  2132. #include <string.h>
  2133. ],
  2134. [ char buf[20];
  2135. strlcpy(buf, "KDE function test", sizeof(buf));
  2136. ],
  2137. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2138. [STRLCPY])
  2139. ])
  2140. AC_DEFUN([AC_CHECK_STRLCAT],
  2141. [
  2142. KDE_CHECK_FUNC_EXT(strlcat, [
  2143. #include <string.h>
  2144. ],
  2145. [ char buf[20];
  2146. buf[0]='\0';
  2147. strlcat(buf, "KDE function test", sizeof(buf));
  2148. ],
  2149. [unsigned long strlcat(char*, const char*, unsigned long)],
  2150. [STRLCAT])
  2151. ])
  2152. AC_DEFUN([AC_CHECK_RES_QUERY],
  2153. [
  2154. KDE_CHECK_FUNC_EXT(res_query, [
  2155. #include <sys/types.h>
  2156. #include <netinet/in.h>
  2157. #include <arpa/nameser.h>
  2158. #include <resolv.h>
  2159. #include <netdb.h>
  2160. ],
  2161. [
  2162. res_query(NULL, 0, 0, NULL, 0);
  2163. ],
  2164. [int res_query(const char *, int, int, unsigned char *, int)],
  2165. [RES_QUERY])
  2166. ])
  2167. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2168. [
  2169. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2170. #include <sys/types.h>
  2171. #include <netinet/in.h>
  2172. #include <arpa/nameser.h>
  2173. #include <resolv.h>
  2174. ],
  2175. [
  2176. dn_skipname (NULL, NULL);
  2177. ],
  2178. [int dn_skipname (unsigned char *, unsigned char *)],
  2179. [DN_SKIPNAME])
  2180. ])
  2181. AC_DEFUN([AC_FIND_GIF],
  2182. [AC_MSG_CHECKING([for giflib])
  2183. AC_CACHE_VAL(ac_cv_lib_gif,
  2184. [ac_save_LIBS="$LIBS"
  2185. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2186. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2187. else
  2188. LIBS="$all_libraries -lgif"
  2189. fi
  2190. AC_TRY_LINK(dnl
  2191. [
  2192. #ifdef __cplusplus
  2193. extern "C" {
  2194. #endif
  2195. int GifLastError(void);
  2196. #ifdef __cplusplus
  2197. }
  2198. #endif
  2199. /* We use char because int might match the return type of a gcc2
  2200. builtin and then its argument prototype would still apply. */
  2201. ],
  2202. [return GifLastError();],
  2203. eval "ac_cv_lib_gif=yes",
  2204. eval "ac_cv_lib_gif=no")
  2205. LIBS="$ac_save_LIBS"
  2206. ])dnl
  2207. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2208. AC_MSG_RESULT(yes)
  2209. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2210. else
  2211. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2212. fi
  2213. ])
  2214. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2215. [
  2216. AC_MSG_CHECKING([for libjpeg$2])
  2217. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2218. [
  2219. ac_save_LIBS="$LIBS"
  2220. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2221. ac_save_CFLAGS="$CFLAGS"
  2222. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2223. AC_TRY_LINK(
  2224. [
  2225. #ifdef __cplusplus
  2226. extern "C" {
  2227. #endif
  2228. void jpeg_CreateDecompress();
  2229. #ifdef __cplusplus
  2230. }
  2231. #endif
  2232. ],
  2233. [jpeg_CreateDecompress();],
  2234. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2235. eval "ac_cv_lib_jpeg_$1=no")
  2236. LIBS="$ac_save_LIBS"
  2237. CFLAGS="$ac_save_CFLAGS"
  2238. ])
  2239. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2240. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2241. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2242. else
  2243. AC_MSG_RESULT(no)
  2244. $3
  2245. fi
  2246. ])
  2247. AC_DEFUN([AC_FIND_JPEG],
  2248. [
  2249. dnl first look for libraries
  2250. KDE_FIND_JPEG_HELPER(6b, 6b,
  2251. KDE_FIND_JPEG_HELPER(normal, [],
  2252. [
  2253. LIBJPEG=
  2254. ]
  2255. )
  2256. )
  2257. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2258. dnl requires system dependent includes loaded before it)
  2259. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2260. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2261. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2262. dnl if headers _and_ libraries are missing, this is no error, and we
  2263. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2264. dnl if only one is missing, it means a configuration error, but we still
  2265. dnl only warn
  2266. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2267. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2268. else
  2269. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2270. AC_MSG_WARN([
  2271. There is an installation error in jpeg support. You seem to have only one
  2272. of either the headers _or_ the libraries installed. You may need to either
  2273. provide correct --with-extra-... options, or the development package of
  2274. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2275. Disabling JPEG support.
  2276. ])
  2277. else
  2278. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2279. fi
  2280. jpeg_incdir=
  2281. LIBJPEG=
  2282. fi
  2283. AC_SUBST(LIBJPEG)
  2284. AH_VERBATIM(_AC_CHECK_JPEG,
  2285. [/*
  2286. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2287. * headers and I'm too lazy to write a configure test as long as only
  2288. * unixware is related
  2289. */
  2290. #ifdef _UNIXWARE
  2291. #define HAVE_BOOLEAN
  2292. #endif
  2293. ])
  2294. ])
  2295. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2296. [
  2297. if test -n "$LIBJPEG"; then
  2298. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2299. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2300. [
  2301. AC_LANG_SAVE
  2302. AC_LANG_CPLUSPLUS
  2303. ac_save_LIBS="$LIBS"
  2304. LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
  2305. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2306. ac_save_CXXFLAGS="$CXXFLAGS"
  2307. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2308. AC_TRY_LINK(
  2309. [#include <qapplication.h>],
  2310. [
  2311. int argc;
  2312. char** argv;
  2313. QApplication app(argc, argv);],
  2314. eval "kde_cv_qt_jpeg=no",
  2315. eval "kde_cv_qt_jpeg=yes")
  2316. LIBS="$ac_save_LIBS"
  2317. CXXFLAGS="$ac_save_CXXFLAGS"
  2318. AC_LANG_RESTORE
  2319. fi
  2320. ])
  2321. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2322. AC_MSG_RESULT(yes)
  2323. LIBJPEG_QT='$(LIBJPEG)'
  2324. else
  2325. AC_MSG_RESULT(no)
  2326. LIBJPEG_QT=
  2327. fi
  2328. ])
  2329. AC_DEFUN([AC_FIND_ZLIB],
  2330. [
  2331. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2332. AC_MSG_CHECKING([for libz])
  2333. AC_CACHE_VAL(ac_cv_lib_z,
  2334. [
  2335. kde_save_LIBS="$LIBS"
  2336. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2337. kde_save_CFLAGS="$CFLAGS"
  2338. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2339. AC_TRY_LINK(dnl
  2340. [
  2341. #include<zlib.h>
  2342. ],
  2343. [
  2344. char buf[42];
  2345. gzFile f = (gzFile) 0;
  2346. /* this would segfault.. but we only link, don't run */
  2347. (void) gzgets(f, buf, sizeof(buf));
  2348. return (zlibVersion() == ZLIB_VERSION);
  2349. ],
  2350. eval "ac_cv_lib_z='-lz'",
  2351. eval "ac_cv_lib_z=no")
  2352. LIBS="$kde_save_LIBS"
  2353. CFLAGS="$kde_save_CFLAGS"
  2354. ])dnl
  2355. if test ! "$ac_cv_lib_z" = no; then
  2356. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2357. LIBZ="$ac_cv_lib_z"
  2358. AC_MSG_RESULT($ac_cv_lib_z)
  2359. else
  2360. AC_MSG_ERROR(not found.
  2361. Possibly configure picks up an outdated version
  2362. installed by XFree86. Remove it from your system.
  2363. Check your installation and look into config.log)
  2364. LIBZ=""
  2365. fi
  2366. AC_SUBST(LIBZ)
  2367. ])
  2368. AC_DEFUN([KDE_TRY_TIFFLIB],
  2369. [
  2370. AC_MSG_CHECKING([for libtiff $1])
  2371. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2372. [
  2373. AC_LANG_SAVE
  2374. AC_LANG_CPLUSPLUS
  2375. kde_save_LIBS="$LIBS"
  2376. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2377. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2378. else
  2379. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2380. fi
  2381. kde_save_CXXFLAGS="$CXXFLAGS"
  2382. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2383. AC_TRY_LINK(dnl
  2384. [
  2385. #include<tiffio.h>
  2386. ],
  2387. [return (TIFFOpen( "", "r") == 0); ],
  2388. [
  2389. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2390. ], [
  2391. kde_cv_libtiff_$1=no
  2392. ])
  2393. LIBS="$kde_save_LIBS"
  2394. CXXFLAGS="$kde_save_CXXFLAGS"
  2395. AC_LANG_RESTORE
  2396. ])
  2397. if test "$kde_cv_libtiff_$1" = "no"; then
  2398. AC_MSG_RESULT(no)
  2399. LIBTIFF=""
  2400. $3
  2401. else
  2402. LIBTIFF="$kde_cv_libtiff_$1"
  2403. AC_MSG_RESULT(yes)
  2404. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2405. $2
  2406. fi
  2407. ])
  2408. AC_DEFUN([AC_FIND_TIFF],
  2409. [
  2410. AC_REQUIRE([K_PATH_X])
  2411. AC_REQUIRE([AC_FIND_ZLIB])
  2412. AC_REQUIRE([AC_FIND_JPEG])
  2413. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2414. KDE_TRY_TIFFLIB(tiff, [],
  2415. KDE_TRY_TIFFLIB(tiff34))
  2416. AC_SUBST(LIBTIFF)
  2417. ])
  2418. AC_DEFUN([KDE_FIND_LIBEXR],
  2419. [
  2420. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2421. AC_REQUIRE([AC_FIND_ZLIB])
  2422. AC_CACHE_VAL(ac_cv_libexr,
  2423. [
  2424. if test -z "$PKG_CONFIG"; then
  2425. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2426. fi
  2427. AC_MSG_CHECKING([for OpenEXR libraries])
  2428. if test "$PKG_CONFIG" = "no" ; then
  2429. AC_MSG_RESULT(no)
  2430. echo "*** The pkg-config script could not be found. Make sure it is"
  2431. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2432. echo "*** to the full path to pkg-config."
  2433. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2434. else
  2435. if !(`$PKG_CONFIG --exists OpenEXR`) ; then
  2436. AC_MSG_RESULT(no)
  2437. EXRSTATUS=no
  2438. else
  2439. if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
  2440. AC_MSG_RESULT(no)
  2441. EXRSTATUS=old
  2442. else
  2443. kde_save_LIBS="$LIBS"
  2444. LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
  2445. AC_LANG_SAVE
  2446. AC_LANG_CPLUSPLUS
  2447. kde_save_CXXFLAGS="$CXXFLAGS"
  2448. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2449. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2450. AC_TRY_LINK(dnl
  2451. [
  2452. #include <ImfRgbaFile.h>
  2453. ],
  2454. [
  2455. using namespace Imf;
  2456. RgbaInputFile file ("dummy");
  2457. return 0;
  2458. ],
  2459. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2460. eval "ac_cv_libexr=no"
  2461. )
  2462. LIBS="$kde_save_LIBS"
  2463. CXXFLAGS="$kde_save_CXXFLAGS"
  2464. AC_LANG_RESTORE
  2465. ])dnl
  2466. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2467. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2468. LIB_EXR="$ac_cv_libexr"
  2469. AC_MSG_RESULT($ac_cv_libexr)
  2470. else
  2471. AC_MSG_RESULT(no)
  2472. LIB_EXR=""
  2473. fi
  2474. fi
  2475. fi
  2476. fi
  2477. AC_SUBST(LIB_EXR)
  2478. AC_SUBST(EXR_FLAGS)
  2479. ])
  2480. AC_DEFUN([AC_FIND_PNG],
  2481. [
  2482. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2483. AC_REQUIRE([AC_FIND_ZLIB])
  2484. AC_MSG_CHECKING([for libpng])
  2485. AC_CACHE_VAL(ac_cv_lib_png,
  2486. [
  2487. kde_save_LIBS="$LIBS"
  2488. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2489. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2490. else
  2491. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2492. fi
  2493. kde_save_CFLAGS="$CFLAGS"
  2494. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2495. AC_TRY_LINK(dnl
  2496. [
  2497. #include<png.h>
  2498. ],
  2499. [
  2500. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2501. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2502. return( png_ptr != 0 );
  2503. ],
  2504. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2505. eval "ac_cv_lib_png=no"
  2506. )
  2507. LIBS="$kde_save_LIBS"
  2508. CFLAGS="$kde_save_CFLAGS"
  2509. ])dnl
  2510. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2511. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2512. LIBPNG="$ac_cv_lib_png"
  2513. AC_SUBST(LIBPNG)
  2514. AC_MSG_RESULT($ac_cv_lib_png)
  2515. else
  2516. AC_MSG_RESULT(no)
  2517. LIBPNG=""
  2518. AC_SUBST(LIBPNG)
  2519. fi
  2520. ])
  2521. AC_DEFUN([AC_FIND_JASPER],
  2522. [
  2523. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2524. AC_REQUIRE([AC_FIND_JPEG])
  2525. AC_MSG_CHECKING([for jasper])
  2526. AC_CACHE_VAL(ac_cv_jasper,
  2527. [
  2528. kde_save_LIBS="$LIBS"
  2529. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2530. kde_save_CFLAGS="$CFLAGS"
  2531. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2532. AC_TRY_LINK(dnl
  2533. [
  2534. #include<jasper/jasper.h>
  2535. ],
  2536. [
  2537. return( jas_init() );
  2538. ],
  2539. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2540. eval "ac_cv_jasper=no"
  2541. )
  2542. LIBS="$kde_save_LIBS"
  2543. CFLAGS="$kde_save_CFLAGS"
  2544. ])dnl
  2545. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2546. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2547. LIB_JASPER="$ac_cv_jasper"
  2548. AC_MSG_RESULT($ac_cv_jasper)
  2549. else
  2550. AC_MSG_RESULT(no)
  2551. LIB_JASPER=""
  2552. fi
  2553. AC_SUBST(LIB_JASPER)
  2554. ])
  2555. AC_DEFUN([AC_CHECK_BOOL],
  2556. [
  2557. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2558. ])
  2559. AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
  2560. [
  2561. AC_MSG_CHECKING(if you need GNU extensions)
  2562. AC_CACHE_VAL(ac_cv_gnu_extensions,
  2563. [
  2564. cat > conftest.c << EOF
  2565. #include <features.h>
  2566. #ifdef __GNU_LIBRARY__
  2567. yes
  2568. #endif
  2569. EOF
  2570. if (eval "$ac_cpp conftest.c") 2>&5 |
  2571. egrep "yes" >/dev/null 2>&1; then
  2572. rm -rf conftest*
  2573. ac_cv_gnu_extensions=yes
  2574. else
  2575. ac_cv_gnu_extensions=no
  2576. fi
  2577. ])
  2578. AC_MSG_RESULT($ac_cv_gnu_extensions)
  2579. if test "$ac_cv_gnu_extensions" = "yes"; then
  2580. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  2581. fi
  2582. ])
  2583. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2584. [
  2585. AC_MSG_CHECKING([whether $CXX supports -$1])
  2586. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2587. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2588. [
  2589. AC_LANG_SAVE
  2590. AC_LANG_CPLUSPLUS
  2591. save_CXXFLAGS="$CXXFLAGS"
  2592. CXXFLAGS="$CXXFLAGS -$1"
  2593. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2594. CXXFLAGS="$save_CXXFLAGS"
  2595. AC_LANG_RESTORE
  2596. ])
  2597. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2598. AC_MSG_RESULT(yes)
  2599. :
  2600. $2
  2601. else
  2602. AC_MSG_RESULT(no)
  2603. :
  2604. $3
  2605. fi
  2606. ])
  2607. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2608. [
  2609. AC_MSG_CHECKING([whether $CC supports -$1])
  2610. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2611. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2612. [
  2613. AC_LANG_SAVE
  2614. AC_LANG_C
  2615. save_CFLAGS="$CFLAGS"
  2616. CFLAGS="$CFLAGS -$1"
  2617. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2618. CFLAGS="$save_CFLAGS"
  2619. AC_LANG_RESTORE
  2620. ])
  2621. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2622. AC_MSG_RESULT(yes)
  2623. :
  2624. $2
  2625. else
  2626. AC_MSG_RESULT(no)
  2627. :
  2628. $3
  2629. fi
  2630. ])
  2631. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2632. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2633. dnl it's all white-space separated
  2634. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2635. [ __val=$$1
  2636. __forbid=" $2 "
  2637. if test -n "$__val"; then
  2638. __new=""
  2639. ac_save_IFS=$IFS
  2640. IFS=" "
  2641. for i in $__val; do
  2642. case "$__forbid" in
  2643. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2644. *) # Careful to not add spaces, where there were none, because otherwise
  2645. # libtool gets confused, if we change e.g. CXX
  2646. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2647. esac
  2648. done
  2649. IFS=$ac_save_IFS
  2650. $1=$__new
  2651. fi
  2652. ])
  2653. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2654. [
  2655. AC_MSG_CHECKING([whether $CC is blacklisted])
  2656. dnl In theory we have tu run this test against $CC and $CXX
  2657. dnl in C and in C++ mode, because its perfectly legal for
  2658. dnl the user to mix compiler versions, since C has a defined
  2659. dnl ABI.
  2660. dnl
  2661. dnl For now, we assume the user is not on crack.
  2662. AC_TRY_COMPILE([
  2663. #ifdef __GNUC__
  2664. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  2665. choke me
  2666. #endif
  2667. #endif
  2668. ], ,
  2669. kde_bad_compiler=no,
  2670. kde_bad_compiler=yes
  2671. )
  2672. AC_MSG_RESULT($kde_bad_compiler)
  2673. if test "$kde_bad_compiler" = "yes"; then
  2674. AC_MSG_ERROR([
  2675. This particular compiler version is blacklisted because it
  2676. is known to miscompile KDE. Please use a newer version, or
  2677. if that is not yet available, choose an older version.
  2678. Please do not report a bug or bother us reporting this
  2679. configure error. We know about it, and we introduced
  2680. it by intention to avoid untraceable bugs or crashes in KDE.
  2681. ])
  2682. fi
  2683. ])
  2684. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  2685. [
  2686. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  2687. kde_cv_opt_noinline_match,
  2688. [
  2689. kde_cv_opt_noinline_match=irrelevant
  2690. dnl if we don't use both -O2 and -fno-inline, this check is moot
  2691. if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
  2692. && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
  2693. ac_cflags_save="$CFLAGS"
  2694. CFLAGS="$CFLAGS -D_USE_GNU"
  2695. AC_TRY_LINK([
  2696. #include <string.h>
  2697. ], [ const char *pt, *et;
  2698. et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
  2699. ],
  2700. kde_cv_opt_noinline_match=yes,
  2701. kde_cv_opt_noinline_match=no
  2702. )
  2703. CFLAGS="$ac_cflags_save"
  2704. fi
  2705. ])
  2706. ])
  2707. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2708. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2709. [dnl
  2710. if test "x$kde_use_qt_emb" != "xyes"; then
  2711. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2712. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2713. else
  2714. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2715. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2716. fi
  2717. ])
  2718. AC_DEFUN([AC_CHECK_COMPILERS],
  2719. [
  2720. AC_ARG_ENABLE(debug,
  2721. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2722. [
  2723. case $enableval in
  2724. yes)
  2725. kde_use_debug_code="yes"
  2726. kde_use_debug_define=no
  2727. ;;
  2728. full)
  2729. kde_use_debug_code="full"
  2730. kde_use_debug_define=no
  2731. ;;
  2732. *)
  2733. kde_use_debug_code="no"
  2734. kde_use_debug_define=yes
  2735. ;;
  2736. esac
  2737. ],
  2738. [kde_use_debug_code="no"
  2739. kde_use_debug_define=no
  2740. ])
  2741. dnl Just for configure --help
  2742. AC_ARG_ENABLE(dummyoption,
  2743. AC_HELP_STRING([--disable-debug],
  2744. [disables debug output and debug symbols [default=no]]),
  2745. [],[])
  2746. AC_ARG_ENABLE(strict,
  2747. AC_HELP_STRING([--enable-strict],
  2748. [compiles with strict compiler options (may not work!)]),
  2749. [
  2750. if test $enableval = "no"; then
  2751. kde_use_strict_options="no"
  2752. else
  2753. kde_use_strict_options="yes"
  2754. fi
  2755. ], [kde_use_strict_options="no"])
  2756. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2757. [
  2758. if test $enableval = "no"; then
  2759. kde_use_warnings="no"
  2760. else
  2761. kde_use_warnings="yes"
  2762. fi
  2763. ], [kde_use_warnings="yes"])
  2764. dnl enable warnings for debug build
  2765. if test "$kde_use_debug_code" != "no"; then
  2766. kde_use_warnings=yes
  2767. fi
  2768. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2769. [kde_use_profiling=$enableval],
  2770. [kde_use_profiling="no"]
  2771. )
  2772. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2773. CFLAGS=" $CFLAGS"
  2774. AC_PROG_CC
  2775. AC_PROG_CPP
  2776. if test "$GCC" = "yes"; then
  2777. if test "$kde_use_debug_code" != "no"; then
  2778. if test $kde_use_debug_code = "full"; then
  2779. CFLAGS="-g3 -fno-inline $CFLAGS"
  2780. else
  2781. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  2782. fi
  2783. else
  2784. CFLAGS="-O2 $CFLAGS"
  2785. fi
  2786. fi
  2787. if test "$kde_use_debug_define" = "yes"; then
  2788. CFLAGS="-DNDEBUG $CFLAGS"
  2789. fi
  2790. case "$host" in
  2791. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2792. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2793. esac
  2794. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2795. LDFLAGS=""
  2796. fi
  2797. CXXFLAGS=" $CXXFLAGS"
  2798. AC_PROG_CXX
  2799. KDE_CHECK_FOR_BAD_COMPILER
  2800. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2801. if test "$kde_use_debug_code" != "no"; then
  2802. if test "$CXX" = "KCC"; then
  2803. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2804. else
  2805. if test "$kde_use_debug_code" = "full"; then
  2806. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2807. else
  2808. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  2809. fi
  2810. fi
  2811. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2812. dnl convenience compiler flags
  2813. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2814. AC_SUBST(WOVERLOADED_VIRTUAL)
  2815. else
  2816. if test "$CXX" = "KCC"; then
  2817. CXXFLAGS="+K3 $CXXFLAGS"
  2818. else
  2819. CXXFLAGS="-O2 $CXXFLAGS"
  2820. fi
  2821. fi
  2822. fi
  2823. if test "$kde_use_debug_define" = "yes"; then
  2824. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2825. fi
  2826. if test "$kde_use_profiling" = "yes"; then
  2827. KDE_CHECK_COMPILER_FLAG(pg,
  2828. [
  2829. CFLAGS="-pg $CFLAGS"
  2830. CXXFLAGS="-pg $CXXFLAGS"
  2831. ])
  2832. fi
  2833. if test "$kde_use_warnings" = "yes"; then
  2834. if test "$GCC" = "yes"; then
  2835. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  2836. case $host in
  2837. *-*-linux-gnu)
  2838. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  2839. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
  2840. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2841. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2842. ;;
  2843. esac
  2844. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2845. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2846. dnl ### FIXME: revert for KDE 4
  2847. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  2848. fi
  2849. fi
  2850. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2851. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2852. fi
  2853. AC_ARG_ENABLE(pch,
  2854. AC_HELP_STRING([--enable-pch],
  2855. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2856. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2857. HAVE_GCC_VISIBILITY=0
  2858. AC_SUBST([HAVE_GCC_VISIBILITY])
  2859. if test "$GXX" = "yes"; then
  2860. gcc_no_reorder_blocks=NO
  2861. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  2862. if test $kde_use_debug_code != "no" && \
  2863. test $kde_use_debug_code != "full" && \
  2864. test "YES" = "$gcc_no_reorder_blocks" ; then
  2865. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  2866. CFLAGS="$CFLAGS -fno-reorder-blocks"
  2867. fi
  2868. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2869. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2870. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2871. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2872. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2873. if test "$kde_use_pch" = "yes"; then
  2874. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2875. echo >conftest.h
  2876. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2877. kde_gcc_supports_pch=yes
  2878. AC_MSG_RESULT(yes)
  2879. else
  2880. kde_gcc_supports_pch=no
  2881. AC_MSG_RESULT(no)
  2882. fi
  2883. if test "$kde_gcc_supports_pch" = "yes"; then
  2884. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2885. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2886. kde_gcc_supports_pch=yes
  2887. AC_MSG_RESULT(yes)
  2888. else
  2889. kde_gcc_supports_pch=no
  2890. AC_MSG_RESULT(no)
  2891. fi
  2892. fi
  2893. rm -f conftest.h conftest.h.gch
  2894. fi
  2895. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  2896. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  2897. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  2898. fi
  2899. fi
  2900. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2901. if test "$CXX" = "KCC"; then
  2902. dnl unfortunately we currently cannot disable exception support in KCC
  2903. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2904. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2905. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2906. if test "$kde_use_pch" = "yes"; then
  2907. dnl TODO: support --pch-dir!
  2908. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2909. dnl the below works (but the dir must exist), but it's
  2910. dnl useless for a whole package.
  2911. dnl The are precompiled headers for each source file, so when compiling
  2912. dnl from scratch, it doesn't make a difference, and they take up
  2913. dnl around ~5Mb _per_ sourcefile.
  2914. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2915. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2916. fi
  2917. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2918. dnl all implementations that are defined inside the class {} declaration.
  2919. dnl because of templates-compatibility with broken gcc compilers, this
  2920. dnl can cause excessive inlining. This flag limits it to a sane level
  2921. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2922. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2923. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2924. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2925. dnl Some source files are shared between multiple executables
  2926. dnl (or libraries) and some of those need template instantiations.
  2927. dnl In that case KCC needs to compile those sources with
  2928. dnl --one_instantiation_per_object. To make it easy for us we compile
  2929. dnl _all_ objects with that flag (--one_per is a shorthand).
  2930. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2931. fi
  2932. AC_SUBST(USE_EXCEPTIONS)
  2933. dnl obsolete macro - provided to keep things going
  2934. USE_RTTI=
  2935. AC_SUBST(USE_RTTI)
  2936. case "$host" in
  2937. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2938. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2939. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2940. *-*-solaris*)
  2941. if test "$GXX" = yes; then
  2942. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2943. if test ! -f $libstdcpp; then
  2944. AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
  2945. fi
  2946. fi
  2947. ;;
  2948. esac
  2949. AC_VALIDIFY_CXXFLAGS
  2950. AC_PROG_CXXCPP
  2951. if test "$GCC" = yes; then
  2952. NOOPT_CFLAGS=-O0
  2953. fi
  2954. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2955. AC_ARG_ENABLE(coverage,
  2956. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2957. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2958. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2959. ac_coverage_linker="-lgcc"
  2960. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2961. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2962. ac_coverage_linker=""
  2963. else
  2964. AC_MSG_ERROR([coverage with your compiler is not supported])
  2965. fi
  2966. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2967. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2968. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2969. ])
  2970. AC_SUBST(NOOPT_CXXFLAGS)
  2971. AC_SUBST(NOOPT_CFLAGS)
  2972. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2973. KDE_CHECK_NEW_LDFLAGS
  2974. KDE_CHECK_FINAL
  2975. KDE_CHECK_CLOSURE
  2976. KDE_CHECK_NMCHECK
  2977. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2978. ])
  2979. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2980. [
  2981. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2982. [
  2983. AC_LANG_SAVE
  2984. AC_LANG_CPLUSPLUS
  2985. safe_CXXFLAGS=$CXXFLAGS
  2986. safe_LDFLAGS=$LDFLAGS
  2987. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2988. LDFLAGS="$LDFLAGS -shared -fPIC"
  2989. AC_TRY_LINK(
  2990. [
  2991. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2992. #include <string>
  2993. int some_function( void ) __attribute__ ((visibility("default")));
  2994. int some_function( void )
  2995. {
  2996. std::string s("blafasel");
  2997. return 0;
  2998. }
  2999. ], [/* elvis is alive */],
  3000. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  3001. CXXFLAGS=$safe_CXXFLAGS
  3002. LDFLAGS=$safe_LDFLAGS
  3003. AC_LANG_RESTORE
  3004. ]
  3005. )
  3006. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  3007. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  3008. fi
  3009. ]
  3010. )
  3011. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  3012. [
  3013. AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
  3014. AC_MSG_CHECKING([grepping for visibility push/pop in headers])
  3015. if test "x$GXX" = "xyes"; then
  3016. AC_LANG_SAVE
  3017. AC_LANG_CPLUSPLUS
  3018. AC_EGREP_CPP(
  3019. [GCC visibility push],
  3020. [ #include <exception>
  3021. ],
  3022. [
  3023. AC_MSG_RESULT(yes)
  3024. kde_stdc_visibility_patched=yes ],
  3025. [
  3026. AC_MSG_RESULT(no)
  3027. AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
  3028. visibility support. Disabling -fvisibility=hidden])
  3029. kde_stdc_visibility_patched=no ])
  3030. AC_LANG_RESTORE
  3031. kde_have_gcc_visibility=no
  3032. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  3033. [
  3034. kde_have_gcc_visibility=yes
  3035. dnl the whole toolchain is just a mess, gcc is just too buggy
  3036. dnl to handle STL with visibility enabled. Lets reconsider
  3037. dnl when gcc 4.2 is out or when things get fixed in the compiler.
  3038. dnl Contact mueller@kde.org for details.
  3039. AC_ARG_ENABLE(gcc-hidden-visibility,
  3040. AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
  3041. [kde_have_gcc_visibility=$enableval],
  3042. [kde_have_gcc_visibility=no])
  3043. AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
  3044. [
  3045. AC_LANG_SAVE
  3046. AC_LANG_CPLUSPLUS
  3047. safe_CXXFLAGS=$CXXFLAGS
  3048. CXXFLAGS="$CXXFLAGS $all_includes"
  3049. AC_TRY_COMPILE(
  3050. [
  3051. #include <qglobal.h>
  3052. #if Q_EXPORT - 0 != 0
  3053. /* if this compiles, then Q_EXPORT is undefined */
  3054. /* if Q_EXPORT is nonempty, this will break compilation */
  3055. #endif
  3056. ], [/* elvis is alive */],
  3057. kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
  3058. CXXFLAGS=$safe_CXXFLAGS
  3059. AC_LANG_RESTORE
  3060. ]
  3061. )
  3062. if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
  3063. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  3064. KDE_CHECK_VISIBILITY_GCC_BUG
  3065. HAVE_GCC_VISIBILITY=1
  3066. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  3067. fi
  3068. ])
  3069. fi
  3070. ])
  3071. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  3072. [
  3073. [A]M_DEPENDENCIES(CC)
  3074. [A]M_DEPENDENCIES(CXX)
  3075. ])
  3076. dnl just a wrapper to clean up configure.in
  3077. AC_DEFUN([KDE_PROG_LIBTOOL],
  3078. [
  3079. AC_REQUIRE([AC_CHECK_COMPILERS])
  3080. AC_REQUIRE([AC_ENABLE_SHARED])
  3081. AC_REQUIRE([AC_ENABLE_STATIC])
  3082. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  3083. AC_REQUIRE([KDE_CHECK_LIB64])
  3084. AC_OBJEXT
  3085. AC_EXEEXT
  3086. AM_PROG_LIBTOOL
  3087. AC_LIBTOOL_CXX
  3088. LIBTOOL_SHELL="/bin/sh ./libtool"
  3089. # LIBTOOL="$LIBTOOL --silent"
  3090. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  3091. AC_SUBST(KDE_PLUGIN)
  3092. # This hack ensures that libtool creates shared libs for tdeunittest plugins. By default check_LTLIBRARIES makes static libs.
  3093. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
  3094. AC_SUBST(KDE_CHECK_PLUGIN)
  3095. # we patch configure quite some so we better keep that consistent for incremental runs
  3096. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  3097. ])
  3098. AC_DEFUN([KDE_CHECK_LIB64],
  3099. [
  3100. tdelibsuff="$kde_libs_suffix"
  3101. if test -z "$tdelibsuff"; then
  3102. tdelibsuff="no"
  3103. fi
  3104. AC_ARG_ENABLE(libsuffix,
  3105. AC_HELP_STRING([--enable-libsuffix],
  3106. [/lib directory suffix (64,32,none,auto[=default])]),
  3107. tdelibsuff=$enableval)
  3108. if test "$tdelibsuff" = "auto"; then
  3109. cat > conftest.c << EOF
  3110. #include <stdio.h>
  3111. int main() {
  3112. return 0;
  3113. }
  3114. EOF
  3115. tdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
  3116. s,.*/lib\([[^\/]]*\)/.*,\1,
  3117. p
  3118. }'`
  3119. rm -rf conftest.*
  3120. fi
  3121. if test "$tdelibsuff" = "no" || test "$tdelibsuff" = "none"; then
  3122. tdelibsuff=
  3123. fi
  3124. if test -z "$tdelibsuff"; then
  3125. AC_MSG_RESULT([not using lib directory suffix])
  3126. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  3127. else
  3128. if test "$libdir" = '${exec_prefix}/lib'; then
  3129. libdir="$libdir${tdelibsuff}"
  3130. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  3131. fi
  3132. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${tdelibsuff}"], Suffix for lib directories)
  3133. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  3134. fi
  3135. ])
  3136. AC_DEFUN([KDE_CHECK_TYPES],
  3137. [ AC_CHECK_SIZEOF(int, 4)dnl
  3138. AC_CHECK_SIZEOF(short)dnl
  3139. AC_CHECK_SIZEOF(long, 4)dnl
  3140. AC_CHECK_SIZEOF(char *, 4)dnl
  3141. ])dnl
  3142. dnl Not used - kept for compat only?
  3143. AC_DEFUN([KDE_DO_IT_ALL],
  3144. [
  3145. AC_CANONICAL_SYSTEM
  3146. AC_ARG_PROGRAM
  3147. AM_INIT_AUTOMAKE($1, $2)
  3148. AM_DISABLE_LIBRARIES
  3149. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  3150. AC_CHECK_COMPILERS
  3151. KDE_PROG_LIBTOOL
  3152. AM_KDE_WITH_NLS
  3153. AC_PATH_KDE
  3154. ])
  3155. AC_DEFUN([AC_CHECK_RPATH],
  3156. [
  3157. AC_MSG_CHECKING(for rpath)
  3158. AC_ARG_ENABLE(rpath,
  3159. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  3160. USE_RPATH=$enableval, USE_RPATH=yes)
  3161. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  3162. KDE_RPATH="-R \$(libdir)"
  3163. if test "$kde_libraries" != "$libdir"; then
  3164. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  3165. fi
  3166. if test -n "$qt_libraries"; then
  3167. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  3168. fi
  3169. dnl $x_libraries is set to /usr/lib in case
  3170. if test -n "$X_LDFLAGS"; then
  3171. X_RPATH="-R \$(x_libraries)"
  3172. KDE_RPATH="$KDE_RPATH $X_RPATH"
  3173. fi
  3174. if test -n "$KDE_EXTRA_RPATH"; then
  3175. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  3176. fi
  3177. fi
  3178. AC_SUBST(KDE_EXTRA_RPATH)
  3179. AC_SUBST(KDE_RPATH)
  3180. AC_SUBST(X_RPATH)
  3181. AC_MSG_RESULT($USE_RPATH)
  3182. ])
  3183. dnl Check for the type of the third argument of getsockname
  3184. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3185. [
  3186. AC_MSG_CHECKING(for socklen_t)
  3187. AC_CACHE_VAL(kde_cv_socklen_t,
  3188. [
  3189. AC_LANG_PUSH(C++)
  3190. kde_cv_socklen_t=no
  3191. AC_TRY_COMPILE([
  3192. #include <sys/types.h>
  3193. #include <sys/socket.h>
  3194. ],
  3195. [
  3196. socklen_t len;
  3197. getpeername(0,0,&len);
  3198. ],
  3199. [
  3200. kde_cv_socklen_t=yes
  3201. kde_cv_socklen_t_equiv=socklen_t
  3202. ])
  3203. AC_LANG_POP(C++)
  3204. ])
  3205. AC_MSG_RESULT($kde_cv_socklen_t)
  3206. if test $kde_cv_socklen_t = no; then
  3207. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3208. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3209. [
  3210. kde_cv_socklen_t_equiv=int
  3211. AC_LANG_PUSH(C++)
  3212. for t in int size_t unsigned long "unsigned long"; do
  3213. AC_TRY_COMPILE([
  3214. #include <sys/types.h>
  3215. #include <sys/socket.h>
  3216. ],
  3217. [
  3218. $t len;
  3219. getpeername(0,0,&len);
  3220. ],
  3221. [
  3222. kde_cv_socklen_t_equiv="$t"
  3223. break
  3224. ])
  3225. done
  3226. AC_LANG_POP(C++)
  3227. ])
  3228. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3229. fi
  3230. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3231. [type to use in place of socklen_t if not defined])
  3232. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3233. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3234. ])
  3235. dnl This is a merge of some macros out of the gettext aclocal.m4
  3236. dnl since we don't need anything, I took the things we need
  3237. dnl the copyright for them is:
  3238. dnl >
  3239. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3240. dnl This Makefile.in is free software; the Free Software Foundation
  3241. dnl gives unlimited permission to copy and/or distribute it,
  3242. dnl with or without modifications, as long as this notice is preserved.
  3243. dnl This program is distributed in the hope that it will be useful,
  3244. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3245. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3246. dnl PARTICULAR PURPOSE.
  3247. dnl >
  3248. dnl for this file it is relicensed under LGPL
  3249. AC_DEFUN([AM_KDE_WITH_NLS],
  3250. [
  3251. dnl If we use NLS figure out what method
  3252. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3253. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3254. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3255. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3256. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3257. GMSGFMT=":"
  3258. fi
  3259. MSGFMT=$GMSGFMT
  3260. AC_SUBST(GMSGFMT)
  3261. AC_SUBST(MSGFMT)
  3262. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3263. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3264. dnl Test whether we really found GNU xgettext.
  3265. if test "$XGETTEXT" != ":"; then
  3266. dnl If it is no GNU xgettext we define it as : so that the
  3267. dnl Makefiles still can work.
  3268. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3269. : ;
  3270. else
  3271. AC_MSG_RESULT(
  3272. [found xgettext programs is not GNU xgettext; ignore it])
  3273. XGETTEXT=":"
  3274. fi
  3275. fi
  3276. AC_SUBST(XGETTEXT)
  3277. ])
  3278. # Search path for a program which passes the given test.
  3279. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3280. # serial 1
  3281. # Stephan Kulow: I appended a _KDE against name conflicts
  3282. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3283. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3284. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3285. [# Extract the first word of "$2", so it can be a program name with args.
  3286. set dummy $2; ac_word=[$]2
  3287. AC_MSG_CHECKING([for $ac_word])
  3288. AC_CACHE_VAL(ac_cv_path_$1,
  3289. [case "[$]$1" in
  3290. /*)
  3291. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3292. ;;
  3293. *)
  3294. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3295. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3296. test -z "$ac_dir" && ac_dir=.
  3297. if test -f $ac_dir/$ac_word; then
  3298. if [$3]; then
  3299. ac_cv_path_$1="$ac_dir/$ac_word"
  3300. break
  3301. fi
  3302. fi
  3303. done
  3304. IFS="$ac_save_ifs"
  3305. dnl If no 4th arg is given, leave the cache variable unset,
  3306. dnl so AC_PATH_PROGS will keep looking.
  3307. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3308. ])dnl
  3309. ;;
  3310. esac])dnl
  3311. $1="$ac_cv_path_$1"
  3312. if test -n "[$]$1"; then
  3313. AC_MSG_RESULT([$]$1)
  3314. else
  3315. AC_MSG_RESULT(no)
  3316. fi
  3317. AC_SUBST($1)dnl
  3318. ])
  3319. # Check whether LC_MESSAGES is available in <locale.h>.
  3320. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3321. # serial 1
  3322. AC_DEFUN([AM_LC_MESSAGES],
  3323. [if test $ac_cv_header_locale_h = yes; then
  3324. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3325. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3326. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3327. if test $am_cv_val_LC_MESSAGES = yes; then
  3328. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3329. fi
  3330. fi])
  3331. dnl From Jim Meyering.
  3332. dnl FIXME: migrate into libit.
  3333. AC_DEFUN([AM_FUNC_OBSTACK],
  3334. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3335. [AC_TRY_LINK([#include "obstack.h"],
  3336. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3337. am_cv_func_obstack=yes,
  3338. am_cv_func_obstack=no)])
  3339. if test $am_cv_func_obstack = yes; then
  3340. AC_DEFINE(HAVE_OBSTACK)
  3341. else
  3342. LIBOBJS="$LIBOBJS obstack.o"
  3343. fi
  3344. ])
  3345. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3346. dnl FIXME: Migrate into libit
  3347. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3348. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3349. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3350. am_cv_lib_error_at_line=yes,
  3351. am_cv_lib_error_at_line=no)])
  3352. if test $am_cv_lib_error_at_line = no; then
  3353. LIBOBJS="$LIBOBJS error.o"
  3354. fi
  3355. AC_SUBST(LIBOBJS)dnl
  3356. ])
  3357. # Macro to add for using GNU gettext.
  3358. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3359. # serial 1
  3360. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  3361. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3362. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3363. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3364. AC_REQUIRE([AC_HEADER_STDC])dnl
  3365. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3366. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3367. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3368. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3369. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3370. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3371. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3372. __argz_count __argz_stringify __argz_next])
  3373. AC_MSG_CHECKING(for stpcpy)
  3374. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3375. [
  3376. kde_safe_cxxflags=$CXXFLAGS
  3377. CXXFLAGS="-Werror"
  3378. AC_LANG_SAVE
  3379. AC_LANG_CPLUSPLUS
  3380. AC_TRY_COMPILE([
  3381. #include <string.h>
  3382. ],
  3383. [
  3384. char buffer[200];
  3385. stpcpy(buffer, buffer);
  3386. ],
  3387. kde_cv_func_stpcpy=yes,
  3388. kde_cv_func_stpcpy=no)
  3389. AC_LANG_RESTORE
  3390. CXXFLAGS=$kde_safe_cxxflags
  3391. ])
  3392. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3393. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3394. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3395. fi
  3396. AM_LC_MESSAGES
  3397. if test "x$CATOBJEXT" != "x"; then
  3398. if test "x$ALL_LINGUAS" = "x"; then
  3399. LINGUAS=
  3400. else
  3401. AC_MSG_CHECKING(for catalogs to be installed)
  3402. NEW_LINGUAS=
  3403. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3404. case "$ALL_LINGUAS" in
  3405. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3406. esac
  3407. done
  3408. LINGUAS=$NEW_LINGUAS
  3409. AC_MSG_RESULT($LINGUAS)
  3410. fi
  3411. dnl Construct list of names of catalog files to be constructed.
  3412. if test -n "$LINGUAS"; then
  3413. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3414. fi
  3415. fi
  3416. ])
  3417. AC_DEFUN([AC_HAVE_XPM],
  3418. [AC_REQUIRE_CPP()dnl
  3419. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3420. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3421. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3422. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3423. xpm_test=$withval, xpm_test="yes")
  3424. if test "x$xpm_test" = xno; then
  3425. ac_cv_have_xpm=no
  3426. else
  3427. AC_MSG_CHECKING(for XPM)
  3428. AC_CACHE_VAL(ac_cv_have_xpm,
  3429. [
  3430. ac_save_ldflags="$LDFLAGS"
  3431. ac_save_cflags="$CFLAGS"
  3432. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  3433. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3434. else
  3435. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3436. fi
  3437. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3438. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3439. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3440. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3441. LDFLAGS="$ac_save_ldflags"
  3442. CFLAGS="$ac_save_cflags"
  3443. ])dnl
  3444. if test "$ac_cv_have_xpm" = no; then
  3445. AC_MSG_RESULT(no)
  3446. XPM_LDFLAGS=""
  3447. XPMINC=""
  3448. $2
  3449. else
  3450. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3451. if test "$XPM_LDFLAGS" = ""; then
  3452. XPMLIB='-lXpm $(LIB_X11)'
  3453. else
  3454. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3455. fi
  3456. if test "$XPM_INCLUDE" = ""; then
  3457. XPMINC=""
  3458. else
  3459. XPMINC="-I$XPM_INCLUDE"
  3460. fi
  3461. AC_MSG_RESULT(yes)
  3462. $1
  3463. fi
  3464. fi
  3465. AC_SUBST(XPMINC)
  3466. AC_SUBST(XPMLIB)
  3467. ])
  3468. AC_DEFUN([AC_HAVE_DPMS],
  3469. [AC_REQUIRE_CPP()dnl
  3470. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3471. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3472. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3473. DPMS_LIB=
  3474. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3475. dpms_test=$withval, dpms_test="yes")
  3476. if test "x$dpms_test" = xno; then
  3477. ac_cv_have_dpms=no
  3478. else
  3479. AC_MSG_CHECKING(for DPMS)
  3480. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3481. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3482. AC_CACHE_VAL(ac_cv_have_dpms,
  3483. [
  3484. if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
  3485. AC_MSG_RESULT(no)
  3486. ac_cv_have_dpms="no"
  3487. else
  3488. ac_save_ldflags="$LDFLAGS"
  3489. ac_save_cflags="$CFLAGS"
  3490. ac_save_libs="$LIBS"
  3491. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3492. LIBS="-lX11 -lXext $LIBSOCKET"
  3493. CFLAGS="$CFLAGS $X_INCLUDES"
  3494. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3495. AC_TRY_LINK([
  3496. #include <X11/Xproto.h>
  3497. #include <X11/X.h>
  3498. #include <X11/Xlib.h>
  3499. #include <X11/extensions/dpms.h>
  3500. int foo_test_dpms()
  3501. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3502. ac_cv_have_dpms="yes", [
  3503. LIBS="-lXdpms $LIBS"
  3504. AC_TRY_LINK([
  3505. #include <X11/Xproto.h>
  3506. #include <X11/X.h>
  3507. #include <X11/Xlib.h>
  3508. #include <X11/extensions/dpms.h>
  3509. int foo_test_dpms()
  3510. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3511. [
  3512. ac_cv_have_dpms="-lXdpms"
  3513. ],ac_cv_have_dpms="no")
  3514. ])
  3515. LDFLAGS="$ac_save_ldflags"
  3516. CFLAGS="$ac_save_cflags"
  3517. LIBS="$ac_save_libs"
  3518. fi
  3519. ])dnl
  3520. if test "$ac_cv_have_dpms" = no; then
  3521. AC_MSG_RESULT(no)
  3522. DPMS_LDFLAGS=""
  3523. DPMSINC=""
  3524. $2
  3525. else
  3526. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3527. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3528. DPMS_LIB="-lXdpms"
  3529. fi
  3530. if test "$DPMS_LDFLAGS" = ""; then
  3531. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3532. else
  3533. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3534. fi
  3535. if test "$DPMS_INCLUDE" = ""; then
  3536. DPMSINC=""
  3537. else
  3538. DPMSINC="-I$DPMS_INCLUDE"
  3539. fi
  3540. AC_MSG_RESULT(yes)
  3541. $1
  3542. fi
  3543. fi
  3544. ac_save_cflags="$CFLAGS"
  3545. CFLAGS="$CFLAGS $X_INCLUDES"
  3546. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3547. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3548. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3549. AC_CHECK_DECL(DPMSCapable,
  3550. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3551. [#include <X11/Xlib.h>
  3552. #include <X11/extensions/dpms.h>])
  3553. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3554. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3555. AC_CHECK_DECL(DPMSInfo,
  3556. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3557. [#include <X11/Xlib.h>
  3558. #include <X11/extensions/dpms.h>])
  3559. CFLAGS="$ac_save_cflags"
  3560. AC_SUBST(DPMSINC)
  3561. AC_SUBST(DPMSLIB)
  3562. ])
  3563. AC_DEFUN([AC_HAVE_GL],
  3564. [AC_REQUIRE_CPP()dnl
  3565. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3566. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3567. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3568. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3569. gl_test=$withval, gl_test="yes")
  3570. if test "x$kde_use_qt_emb" = "xyes"; then
  3571. # GL and Qt Embedded is a no-go for now.
  3572. ac_cv_have_gl=no
  3573. elif test "x$gl_test" = xno; then
  3574. ac_cv_have_gl=no
  3575. else
  3576. AC_MSG_CHECKING(for GL)
  3577. AC_CACHE_VAL(ac_cv_have_gl,
  3578. [
  3579. AC_LANG_SAVE
  3580. AC_LANG_CPLUSPLUS
  3581. ac_save_ldflags=$LDFLAGS
  3582. ac_save_cxxflags=$CXXFLAGS
  3583. ac_save_libs=$LIBS
  3584. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3585. LIBS="$LIBS -lGL -lGLU"
  3586. test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
  3587. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3588. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3589. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3590. AC_TRY_LINK([#include <GL/gl.h>
  3591. #include <GL/glu.h>
  3592. ], [],
  3593. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3594. AC_LANG_RESTORE
  3595. LDFLAGS=$ac_save_ldflags
  3596. CXXFLAGS=$ac_save_cxxflags
  3597. LIBS=$ac_save_libs
  3598. ])dnl
  3599. if test "$ac_cv_have_gl" = "no"; then
  3600. AC_MSG_RESULT(no)
  3601. GL_LDFLAGS=""
  3602. GLINC=""
  3603. $2
  3604. else
  3605. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3606. if test "$GL_LDFLAGS" = ""; then
  3607. GLLIB='-lGLU -lGL $(LIB_X11)'
  3608. else
  3609. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3610. fi
  3611. if test "$GL_INCLUDE" = ""; then
  3612. GLINC=""
  3613. else
  3614. GLINC="-I$GL_INCLUDE"
  3615. fi
  3616. AC_MSG_RESULT($ac_cv_have_gl)
  3617. $1
  3618. fi
  3619. fi
  3620. AC_SUBST(GLINC)
  3621. AC_SUBST(GLLIB)
  3622. ])
  3623. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3624. AC_DEFUN([KDE_PAM], [
  3625. AC_REQUIRE([KDE_CHECK_LIBDL])
  3626. want_pam=
  3627. AC_ARG_WITH(pam,
  3628. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3629. [ if test "x$withval" = "xyes"; then
  3630. want_pam=yes
  3631. pam_service=kde
  3632. elif test "x$withval" = "xno"; then
  3633. want_pam=no
  3634. else
  3635. want_pam=yes
  3636. pam_service=$withval
  3637. fi
  3638. ], [ pam_service=kde ])
  3639. use_pam=
  3640. PAMLIBS=
  3641. if test "x$want_pam" != xno; then
  3642. AC_CHECK_LIB(pam, pam_start, [
  3643. AC_CHECK_HEADER(security/pam_appl.h,
  3644. [ pam_header=security/pam_appl.h ],
  3645. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3646. [ pam_header=pam/pam_appl.h ],
  3647. [
  3648. AC_MSG_WARN([PAM detected, but no headers found!
  3649. Make sure you have the necessary development packages installed.])
  3650. ]
  3651. )
  3652. ]
  3653. )
  3654. ], , $LIBDL)
  3655. if test -z "$pam_header"; then
  3656. if test "x$want_pam" = xyes; then
  3657. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3658. fi
  3659. else
  3660. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3661. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3662. use_pam=yes
  3663. dnl darwin claims to be something special
  3664. if test "$pam_header" = "pam/pam_appl.h"; then
  3665. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3666. fi
  3667. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3668. AC_MSG_CHECKING(for const pam_message)
  3669. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3670. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3671. [AC_MSG_RESULT([const: Linux-type PAM])],
  3672. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3673. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3674. )],
  3675. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3676. fi
  3677. fi
  3678. AC_SUBST(PAMLIBS)
  3679. ])
  3680. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3681. AC_DEFUN([DEF_PAM_SERVICE], [
  3682. AC_ARG_WITH($1-pam,
  3683. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3684. [ if test "x$use_pam" = xyes; then
  3685. $3_PAM_SERVICE=$withval
  3686. else
  3687. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3688. You may want to enforce it by using --with-pam.])
  3689. fi
  3690. ],
  3691. [ if test "x$use_pam" = xyes; then
  3692. $3_PAM_SERVICE="$pam_service"
  3693. fi
  3694. ])
  3695. if test -n "$$3_PAM_SERVICE"; then
  3696. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3697. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3698. fi
  3699. AC_SUBST($3_PAM_SERVICE)
  3700. ])
  3701. AC_DEFUN([KDE_SHADOWPASSWD], [
  3702. AC_REQUIRE([KDE_PAM])
  3703. AC_CHECK_LIB(shadow, getspent,
  3704. [ LIBSHADOW="-lshadow"
  3705. ac_use_shadow=yes
  3706. ],
  3707. [ dnl for UnixWare
  3708. AC_CHECK_LIB(gen, getspent,
  3709. [ LIBGEN="-lgen"
  3710. ac_use_shadow=yes
  3711. ],
  3712. [ AC_CHECK_FUNC(getspent,
  3713. [ ac_use_shadow=yes ],
  3714. [ ac_use_shadow=no ])
  3715. ])
  3716. ])
  3717. AC_SUBST(LIBSHADOW)
  3718. AC_SUBST(LIBGEN)
  3719. AC_MSG_CHECKING([for shadow passwords])
  3720. AC_ARG_WITH(shadow,
  3721. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3722. [ if test "x$withval" != "xno"; then
  3723. use_shadow=yes
  3724. else
  3725. use_shadow=no
  3726. fi
  3727. ], [
  3728. use_shadow="$ac_use_shadow"
  3729. ])
  3730. if test "x$use_shadow" = xyes; then
  3731. AC_MSG_RESULT(yes)
  3732. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3733. else
  3734. AC_MSG_RESULT(no)
  3735. LIBSHADOW=
  3736. LIBGEN=
  3737. fi
  3738. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3739. dnl this still applies, if we could use it indirectly through pam.
  3740. if test "x$use_shadow" = xyes ||
  3741. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3742. case $host in
  3743. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3744. SETUIDFLAGS="-m 4755 -o root";;
  3745. *)
  3746. SETUIDFLAGS="-m 4755";;
  3747. esac
  3748. fi
  3749. AC_SUBST(SETUIDFLAGS)
  3750. ])
  3751. AC_DEFUN([KDE_PASSWDLIBS], [
  3752. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3753. AC_REQUIRE([KDE_PAM])
  3754. AC_REQUIRE([KDE_SHADOWPASSWD])
  3755. if test "x$use_pam" = "xyes"; then
  3756. PASSWDLIBS="$PAMLIBS"
  3757. else
  3758. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3759. fi
  3760. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3761. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3762. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3763. dnl may need to read /etc/master.passwd).
  3764. case $host in
  3765. *-*-freebsd*)
  3766. SETUIDFLAGS="-m 4755 -o root"
  3767. ;;
  3768. *)
  3769. ;;
  3770. esac
  3771. AC_SUBST(PASSWDLIBS)
  3772. ])
  3773. AC_DEFUN([KDE_CHECK_LIBDL],
  3774. [
  3775. AC_CHECK_LIB(dl, dlopen, [
  3776. LIBDL="-ldl"
  3777. ac_cv_have_dlfcn=yes
  3778. ])
  3779. AC_CHECK_LIB(dld, shl_unload, [
  3780. LIBDL="-ldld"
  3781. ac_cv_have_shload=yes
  3782. ])
  3783. AC_SUBST(LIBDL)
  3784. ])
  3785. AC_DEFUN([KDE_CHECK_DLOPEN],
  3786. [
  3787. KDE_CHECK_LIBDL
  3788. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3789. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3790. ac_cv_have_dlfcn=no
  3791. fi
  3792. if test "$ac_cv_header_dl_h" = "no"; then
  3793. ac_cv_have_shload=no
  3794. fi
  3795. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3796. dnl (MM)
  3797. AC_ARG_ENABLE(dlopen,
  3798. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3799. enable_dlopen=$enableval,
  3800. enable_dlopen=yes)
  3801. # override the user's opinion, if we know it better ;)
  3802. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3803. enable_dlopen=no
  3804. fi
  3805. if test "$ac_cv_have_dlfcn" = "yes"; then
  3806. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3807. fi
  3808. if test "$ac_cv_have_shload" = "yes"; then
  3809. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3810. fi
  3811. if test "$enable_dlopen" = no ; then
  3812. test -n "$1" && eval $1
  3813. else
  3814. test -n "$2" && eval $2
  3815. fi
  3816. ])
  3817. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3818. [
  3819. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3820. KDE_PROG_LIBTOOL
  3821. AC_MSG_CHECKING([dynamic loading])
  3822. eval "`egrep '^build_libtool_libs=' libtool`"
  3823. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3824. dynamic_loading=yes
  3825. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3826. else
  3827. dynamic_loading=no
  3828. fi
  3829. AC_MSG_RESULT($dynamic_loading)
  3830. if test "$dynamic_loading" = "yes"; then
  3831. $1
  3832. else
  3833. $2
  3834. fi
  3835. ])
  3836. AC_DEFUN([KDE_ADD_INCLUDES],
  3837. [
  3838. if test -z "$1"; then
  3839. test_include="Pix.h"
  3840. else
  3841. test_include="$1"
  3842. fi
  3843. AC_MSG_CHECKING([for libg++ ($test_include)])
  3844. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3845. [
  3846. kde_cv_libgpp_includes=no
  3847. for ac_dir in \
  3848. \
  3849. /usr/include/g++ \
  3850. /usr/include \
  3851. /usr/unsupported/include \
  3852. /opt/include \
  3853. $extra_include \
  3854. ; \
  3855. do
  3856. if test -r "$ac_dir/$test_include"; then
  3857. kde_cv_libgpp_includes=$ac_dir
  3858. break
  3859. fi
  3860. done
  3861. ])
  3862. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3863. if test "$kde_cv_libgpp_includes" != "no"; then
  3864. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3865. fi
  3866. ])
  3867. ])
  3868. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3869. [
  3870. dnl This code is here specifically to handle the
  3871. dnl various flavors of threading library on FreeBSD
  3872. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3873. dnl There may be an environment PTHREAD_LIBS that
  3874. dnl specifies what to use; otherwise, search for it.
  3875. dnl -pthread is special cased and unsets LIBPTHREAD
  3876. dnl below if found.
  3877. LIBPTHREAD=""
  3878. if test -n "$PTHREAD_LIBS"; then
  3879. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3880. LIBPTHREAD="PTHREAD"
  3881. else
  3882. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3883. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3884. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3885. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3886. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3887. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3888. fi
  3889. fi
  3890. dnl Is this test really needed, in the face of the Tru64 test below?
  3891. if test -z "$LIBPTHREAD"; then
  3892. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3893. fi
  3894. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3895. if test -z "$LIBPTHREAD" ; then
  3896. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3897. kde_safe_libs=$LIBS
  3898. LIBS="$LIBS -lpthread"
  3899. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3900. AC_MSG_RESULT(yes)
  3901. LIBPTHREAD="-lpthread"],[
  3902. AC_MSG_RESULT(no)])
  3903. LIBS=$kde_safe_libs
  3904. fi
  3905. dnl Un-special-case for FreeBSD.
  3906. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3907. LIBPTHREAD=""
  3908. fi
  3909. AC_SUBST(LIBPTHREAD)
  3910. ])
  3911. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3912. [
  3913. USE_THREADS=""
  3914. if test -z "$LIBPTHREAD"; then
  3915. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3916. fi
  3917. AH_VERBATIM(__svr_define, [
  3918. #if defined(__SVR4) && !defined(__svr4__)
  3919. #define __svr4__ 1
  3920. #endif
  3921. ])
  3922. case $host_os in
  3923. solaris*)
  3924. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3925. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3926. ;;
  3927. freebsd*)
  3928. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3929. ;;
  3930. aix*)
  3931. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3932. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3933. ;;
  3934. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3935. if test "$CXX" = "KCC"; then
  3936. CXXFLAGS="$CXXFLAGS --thread_safe"
  3937. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3938. fi
  3939. ;;
  3940. *)
  3941. ;;
  3942. esac
  3943. AC_SUBST(USE_THREADS)
  3944. AC_SUBST(LIBPTHREAD)
  3945. ])
  3946. AC_DEFUN([KDE_CHECK_THREADING],
  3947. [
  3948. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3949. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3950. dnl default is yes if libpthread is found and no if no libpthread is available
  3951. if test -z "$LIBPTHREAD"; then
  3952. if test -z "$USE_THREADS"; then
  3953. kde_check_threading_default=no
  3954. else
  3955. kde_check_threading_default=yes
  3956. fi
  3957. else
  3958. kde_check_threading_default=yes
  3959. fi
  3960. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3961. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3962. if test "x$kde_use_threading" = "xyes"; then
  3963. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3964. fi
  3965. ])
  3966. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3967. [
  3968. if test "$kde_python_link_found" = no; then
  3969. if test "$1" = normal; then
  3970. AC_MSG_CHECKING(if a Python application links)
  3971. else
  3972. AC_MSG_CHECKING(if Python depends on $2)
  3973. fi
  3974. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3975. [
  3976. kde_save_cflags="$CFLAGS"
  3977. CFLAGS="$CFLAGS $PYTHONINC"
  3978. kde_save_libs="$LIBS"
  3979. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3980. kde_save_ldflags="$LDFLAGS"
  3981. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3982. AC_TRY_LINK(
  3983. [
  3984. #include <Python.h>
  3985. ],[
  3986. PySys_SetArgv(1, 0);
  3987. ],
  3988. [kde_cv_try_link_python_$1=yes],
  3989. [kde_cv_try_link_python_$1=no]
  3990. )
  3991. CFLAGS="$kde_save_cflags"
  3992. LIBS="$kde_save_libs"
  3993. LDFLAGS="$kde_save_ldflags"
  3994. ])
  3995. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3996. AC_MSG_RESULT(yes)
  3997. kde_python_link_found=yes
  3998. if test ! "$1" = normal; then
  3999. LIBPYTHON="$LIBPYTHON $2"
  4000. fi
  4001. $3
  4002. else
  4003. AC_MSG_RESULT(no)
  4004. $4
  4005. fi
  4006. fi
  4007. ])
  4008. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  4009. [
  4010. AC_MSG_CHECKING([for Python directory])
  4011. AC_CACHE_VAL(kde_cv_pythondir,
  4012. [
  4013. if test -z "$PYTHONDIR"; then
  4014. kde_cv_pythondir=/usr/local
  4015. else
  4016. kde_cv_pythondir="$PYTHONDIR"
  4017. fi
  4018. ])
  4019. AC_ARG_WITH(pythondir,
  4020. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  4021. [
  4022. ac_python_dir=$withval
  4023. ], ac_python_dir=$kde_cv_pythondir
  4024. )
  4025. AC_MSG_RESULT($ac_python_dir)
  4026. ])
  4027. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  4028. [
  4029. AC_REQUIRE([KDE_CHECK_LIBDL])
  4030. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  4031. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  4032. if test -z "$1"; then
  4033. version="1.5"
  4034. else
  4035. version="$1"
  4036. fi
  4037. AC_MSG_CHECKING([for Python$version])
  4038. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  4039. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  4040. if test ! -r $python_incdir/Python.h; then
  4041. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  4042. python_incdir=$python_incdir/python$version
  4043. if test ! -r $python_incdir/Python.h; then
  4044. python_incdir=no
  4045. fi
  4046. fi
  4047. PYTHONINC=-I$python_incdir
  4048. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $kde_extra_libs"
  4049. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  4050. if test ! -r $python_libdir/libpython$version.so; then
  4051. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  4052. if test ! -r $python_libdir/libpython$version.a; then
  4053. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  4054. python_libdir=$python_libdir/python$version/config
  4055. if test ! -r $python_libdir/libpython$version.a; then
  4056. python_libdir=no
  4057. fi
  4058. fi
  4059. fi
  4060. PYTHONLIB=-L$python_libdir
  4061. kde_orig_LIBPYTHON=$LIBPYTHON
  4062. if test -z "$LIBPYTHON"; then
  4063. LIBPYTHON=-lpython$version
  4064. fi
  4065. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  4066. python_moddir=$python_moddir/python$version
  4067. if test ! -r $python_moddir/copy.py; then
  4068. python_moddir=no
  4069. fi
  4070. PYTHONMODDIR=$python_moddir
  4071. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  4072. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  4073. LIBPYTHON=$kde_orig_LIBPYTHON
  4074. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  4075. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  4076. $2
  4077. else
  4078. dnl Note: this test is very weak
  4079. kde_python_link_found=no
  4080. KDE_TRY_LINK_PYTHON(normal)
  4081. KDE_TRY_LINK_PYTHON(m, -lm)
  4082. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4083. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4084. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4085. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4086. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4087. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4088. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4089. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4090. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4091. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4092. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4093. [AC_MSG_WARN([it seems, Python depends on another library.
  4094. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4095. and contact the authors to let them know about this problem])
  4096. ])
  4097. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4098. AC_SUBST(PYTHONINC)
  4099. AC_SUBST(PYTHONLIB)
  4100. AC_SUBST(LIBPYTHON)
  4101. AC_SUBST(PYTHONMODDIR)
  4102. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4103. fi
  4104. ])
  4105. AC_DEFUN([KDE_CHECK_PYTHON],
  4106. [
  4107. KDE_CHECK_PYTHON_INTERN("2.4",
  4108. [KDE_CHECK_PYTHON_INTERN("2.3",
  4109. [KDE_CHECK_PYTHON_INTERN("2.2",
  4110. [KDE_CHECK_PYTHON_INTERN("2.1",
  4111. [KDE_CHECK_PYTHON_INTERN("2.0",
  4112. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4113. ])
  4114. ])
  4115. ])
  4116. ])
  4117. ])
  4118. AC_DEFUN([KDE_CHECK_STL],
  4119. [
  4120. AC_LANG_SAVE
  4121. AC_LANG_CPLUSPLUS
  4122. ac_save_CXXFLAGS="$CXXFLAGS"
  4123. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4124. AC_MSG_CHECKING([if C++ programs can be compiled])
  4125. AC_CACHE_VAL(kde_cv_stl_works,
  4126. [
  4127. AC_TRY_COMPILE([
  4128. #include <string>
  4129. using namespace std;
  4130. ],[
  4131. string astring="Hallo Welt.";
  4132. astring.erase(0, 6); // now astring is "Welt"
  4133. return 0;
  4134. ], kde_cv_stl_works=yes,
  4135. kde_cv_stl_works=no)
  4136. ])
  4137. AC_MSG_RESULT($kde_cv_stl_works)
  4138. if test "$kde_cv_stl_works" = "yes"; then
  4139. # back compatible
  4140. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4141. else
  4142. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4143. Check config.log for details - if you're using a Linux distribution you might miss
  4144. a package named similar to libstdc++-dev.])
  4145. fi
  4146. CXXFLAGS="$ac_save_CXXFLAGS"
  4147. AC_LANG_RESTORE
  4148. ])
  4149. AC_DEFUN([AC_FIND_QIMGIO],
  4150. [AC_REQUIRE([AC_FIND_JPEG])
  4151. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4152. AC_MSG_CHECKING([for qimgio])
  4153. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4154. [
  4155. AC_LANG_SAVE
  4156. AC_LANG_CPLUSPLUS
  4157. ac_save_LIBS="$LIBS"
  4158. ac_save_CXXFLAGS="$CXXFLAGS"
  4159. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
  4160. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  4161. AC_TRY_RUN(dnl
  4162. [
  4163. #include <qimageio.h>
  4164. #include <qstring.h>
  4165. int main() {
  4166. QString t = "hallo";
  4167. t.fill('t');
  4168. qInitImageIO();
  4169. }
  4170. ],
  4171. ac_cv_lib_qimgio=yes,
  4172. ac_cv_lib_qimgio=no,
  4173. ac_cv_lib_qimgio=no)
  4174. LIBS="$ac_save_LIBS"
  4175. CXXFLAGS="$ac_save_CXXFLAGS"
  4176. AC_LANG_RESTORE
  4177. ])dnl
  4178. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4179. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4180. AC_MSG_RESULT(yes)
  4181. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  4182. AC_SUBST(LIBQIMGIO)
  4183. else
  4184. AC_MSG_RESULT(not found)
  4185. fi
  4186. ])
  4187. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4188. [
  4189. AC_PROVIDE([AM_ENABLE_STATIC])
  4190. AC_PROVIDE([AM_ENABLE_SHARED])
  4191. enable_static=no
  4192. enable_shared=yes
  4193. ])
  4194. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4195. [
  4196. AC_MSG_CHECKING([for utmp file])
  4197. AC_CACHE_VAL(kde_cv_utmp_file,
  4198. [
  4199. kde_cv_utmp_file=no
  4200. for ac_file in \
  4201. \
  4202. /var/run/utmp \
  4203. /var/adm/utmp \
  4204. /etc/utmp \
  4205. ; \
  4206. do
  4207. if test -r "$ac_file"; then
  4208. kde_cv_utmp_file=$ac_file
  4209. break
  4210. fi
  4211. done
  4212. ])
  4213. if test "$kde_cv_utmp_file" != "no"; then
  4214. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4215. $1
  4216. AC_MSG_RESULT($kde_cv_utmp_file)
  4217. else
  4218. $2
  4219. AC_MSG_RESULT([non found])
  4220. fi
  4221. ])
  4222. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4223. [
  4224. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4225. TOPSUBDIRS=""
  4226. if test ! -s $srcdir/subdirs; then
  4227. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4228. files=`cd $srcdir && ls -1`
  4229. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4230. for i in $dirs; do
  4231. echo $i >> $srcdir/subdirs
  4232. done
  4233. fi
  4234. ac_topsubdirs=
  4235. if test -s $srcdir/inst-apps; then
  4236. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4237. elif test -s $srcdir/subdirs; then
  4238. ac_topsubdirs="`cat $srcdir/subdirs`"
  4239. fi
  4240. for i in $ac_topsubdirs; do
  4241. AC_MSG_CHECKING([if $i should be compiled])
  4242. if test -d $srcdir/$i; then
  4243. install_it="yes"
  4244. for j in $DO_NOT_COMPILE; do
  4245. if test $i = $j; then
  4246. install_it="no"
  4247. fi
  4248. done
  4249. else
  4250. install_it="no"
  4251. fi
  4252. AC_MSG_RESULT($install_it)
  4253. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4254. if test $install_it = "yes"; then
  4255. TOPSUBDIRS="$TOPSUBDIRS $i"
  4256. eval "$vari""_SUBDIR_included=yes"
  4257. else
  4258. eval "$vari""_SUBDIR_included=no"
  4259. fi
  4260. done
  4261. AC_SUBST(TOPSUBDIRS)
  4262. ])
  4263. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4264. [
  4265. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4266. AC_LANG_SAVE
  4267. AC_LANG_CPLUSPLUS
  4268. AC_TRY_COMPILE([
  4269. ],
  4270. [
  4271. namespace Foo {
  4272. extern int i;
  4273. namespace Bar {
  4274. extern int i;
  4275. }
  4276. }
  4277. int Foo::i = 0;
  4278. int Foo::Bar::i = 1;
  4279. ],[
  4280. AC_MSG_RESULT(yes)
  4281. AC_DEFINE(HAVE_NAMESPACES)
  4282. ], [
  4283. AC_MSG_RESULT(no)
  4284. ])
  4285. AC_LANG_RESTORE
  4286. ])
  4287. dnl ------------------------------------------------------------------------
  4288. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4289. dnl ------------------------------------------------------------------------
  4290. dnl
  4291. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4292. [
  4293. AC_MSG_CHECKING(for S_ISSOCK)
  4294. AC_CACHE_VAL(ac_cv_have_s_issock,
  4295. [
  4296. AC_TRY_LINK(
  4297. [
  4298. #include <sys/stat.h>
  4299. ],
  4300. [
  4301. struct stat buff;
  4302. int b = S_ISSOCK( buff.st_mode );
  4303. ],
  4304. ac_cv_have_s_issock=yes,
  4305. ac_cv_have_s_issock=no)
  4306. ])
  4307. AC_MSG_RESULT($ac_cv_have_s_issock)
  4308. if test "$ac_cv_have_s_issock" = "yes"; then
  4309. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4310. fi
  4311. AH_VERBATIM(_ISSOCK,
  4312. [
  4313. #ifndef HAVE_S_ISSOCK
  4314. #define HAVE_S_ISSOCK
  4315. #define S_ISSOCK(mode) (1==0)
  4316. #endif
  4317. ])
  4318. ])
  4319. dnl ------------------------------------------------------------------------
  4320. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4321. dnl ------------------------------------------------------------------------
  4322. dnl
  4323. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4324. [
  4325. AC_MSG_CHECKING(for MAXPATHLEN)
  4326. AC_CACHE_VAL(ac_cv_maxpathlen,
  4327. [
  4328. cat > conftest.$ac_ext <<EOF
  4329. #ifdef STDC_HEADERS
  4330. # include <stdlib.h>
  4331. #endif
  4332. #include <stdio.h>
  4333. #include <sys/param.h>
  4334. #ifndef MAXPATHLEN
  4335. #define MAXPATHLEN 1024
  4336. #endif
  4337. KDE_HELLO MAXPATHLEN
  4338. EOF
  4339. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4340. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4341. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4342. else
  4343. ac_cv_maxpathlen=1024
  4344. fi
  4345. rm conftest.*
  4346. ])
  4347. AC_MSG_RESULT($ac_cv_maxpathlen)
  4348. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4349. ])
  4350. AC_DEFUN([KDE_CHECK_HEADER],
  4351. [
  4352. kde_safe_cppflags=$CPPFLAGS
  4353. CPPFLAGS="$CPPFLAGS $all_includes"
  4354. AC_LANG_SAVE
  4355. AC_LANG_CPLUSPLUS
  4356. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4357. AC_LANG_RESTORE
  4358. CPPFLAGS=$kde_safe_cppflags
  4359. ])
  4360. AC_DEFUN([KDE_CHECK_HEADERS],
  4361. [
  4362. AH_CHECK_HEADERS([$1])
  4363. AC_LANG_SAVE
  4364. kde_safe_cppflags=$CPPFLAGS
  4365. CPPFLAGS="$CPPFLAGS $all_includes"
  4366. AC_LANG_CPLUSPLUS
  4367. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4368. CPPFLAGS=$kde_safe_cppflags
  4369. AC_LANG_RESTORE
  4370. ])
  4371. AC_DEFUN([KDE_FAST_CONFIGURE],
  4372. [
  4373. dnl makes configure fast (needs perl)
  4374. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4375. with_fast_perl=$enableval, with_fast_perl=yes)
  4376. ])
  4377. AC_DEFUN([KDE_CONF_FILES],
  4378. [
  4379. val=
  4380. if test -f $srcdir/configure.files ; then
  4381. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4382. fi
  4383. CONF_FILES=
  4384. if test -n "$val" ; then
  4385. for i in $val ; do
  4386. CONF_FILES="$CONF_FILES $i"
  4387. done
  4388. fi
  4389. AC_SUBST(CONF_FILES)
  4390. ])dnl
  4391. dnl This sets the prefix, for arts and tdelibs
  4392. dnl Do NOT use in any other module.
  4393. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4394. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4395. [
  4396. unset CDPATH
  4397. dnl make $TDEDIR the default for the installation
  4398. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4399. if test "x$prefix" = "xNONE"; then
  4400. prefix=$ac_default_prefix
  4401. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4402. fi
  4403. # And delete superfluous '/' to make compares easier
  4404. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4405. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4406. kde_libs_prefix='$(prefix)'
  4407. kde_libs_htmldir='$(kde_htmldir)'
  4408. AC_SUBST(kde_libs_prefix)
  4409. AC_SUBST(kde_libs_htmldir)
  4410. KDE_FAST_CONFIGURE
  4411. KDE_CONF_FILES
  4412. ])
  4413. AC_DEFUN([KDE_SET_PREFIX],
  4414. [
  4415. unset CDPATH
  4416. dnl We can't give real code to that macro, only a value.
  4417. dnl It only matters for --help, since we set the prefix in this function anyway.
  4418. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4419. KDE_SET_DEFAULT_BINDIRS
  4420. if test "x$prefix" = "xNONE"; then
  4421. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4422. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4423. else
  4424. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4425. kde_save_PATH="$PATH"
  4426. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4427. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4428. PATH="$kde_save_PATH"
  4429. fi
  4430. kde_libs_prefix=`$KDECONFIG --prefix`
  4431. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4432. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4433. This means it has been moved since you installed it.
  4434. This won't work. Please recompile tdelibs for the new prefix.
  4435. ])
  4436. fi
  4437. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4438. kde_libs_suffix=`$KDECONFIG --libsuffix` || kde_libs_suffix=auto
  4439. AC_MSG_CHECKING([where to install])
  4440. if test "x$prefix" = "xNONE"; then
  4441. prefix=$kde_libs_prefix
  4442. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4443. else
  4444. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4445. given_prefix=$prefix
  4446. AC_MSG_RESULT([$prefix (as requested)])
  4447. fi
  4448. # And delete superfluous '/' to make compares easier
  4449. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4450. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4451. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4452. AC_SUBST(KDECONFIG)
  4453. AC_SUBST(kde_libs_prefix)
  4454. AC_SUBST(kde_libs_htmldir)
  4455. KDE_FAST_CONFIGURE
  4456. KDE_CONF_FILES
  4457. ])
  4458. pushdef([AC_PROG_INSTALL],
  4459. [
  4460. dnl our own version, testing for a -p flag
  4461. popdef([AC_PROG_INSTALL])
  4462. dnl as AC_PROG_INSTALL works as it works we first have
  4463. dnl to save if the user didn't specify INSTALL, as the
  4464. dnl autoconf one overwrites INSTALL and we have no chance to find
  4465. dnl out afterwards
  4466. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4467. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4468. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4469. AC_PROG_INSTALL
  4470. if test -z "$kde_save_INSTALL_given" ; then
  4471. # OK, user hasn't given any INSTALL, autoconf found one for us
  4472. # now we test, if it supports the -p flag
  4473. AC_MSG_CHECKING(for -p flag to install)
  4474. rm -f confinst.$$.* > /dev/null 2>&1
  4475. echo "Testtest" > confinst.$$.orig
  4476. ac_res=no
  4477. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4478. if test -f confinst.$$.new ; then
  4479. # OK, -p seems to do no harm to install
  4480. INSTALL="${INSTALL} -p"
  4481. ac_res=yes
  4482. fi
  4483. fi
  4484. rm -f confinst.$$.*
  4485. AC_MSG_RESULT($ac_res)
  4486. fi
  4487. dnl the following tries to resolve some signs and wonders coming up
  4488. dnl with different autoconf/automake versions
  4489. dnl e.g.:
  4490. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4491. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4492. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4493. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4494. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4495. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4496. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4497. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4498. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4499. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4500. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4501. dnl and so does not see the -s flag in automake > 1.4
  4502. dnl to clean up that mess we:
  4503. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4504. dnl which cleans KDE's program with automake > 1.4;
  4505. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4506. dnl with automake<=1.4
  4507. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4508. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4509. dnl
  4510. dnl And to all this comes, that I even can't write in comments variable
  4511. dnl names used by automake, because it is so stupid to think I wanted to
  4512. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4513. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4514. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4515. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4516. fi
  4517. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4518. INSTALL_SCRIPT='${INSTALL}'
  4519. fi
  4520. ])dnl
  4521. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4522. [AC_LANG_CPLUSPLUS
  4523. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4524. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4525. ])
  4526. pushdef([AC_LANG_CPLUSPLUS],
  4527. [popdef([AC_LANG_CPLUSPLUS])
  4528. KDE_LANG_CPLUSPLUS
  4529. ])
  4530. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4531. [
  4532. AC_MSG_CHECKING(for long long)
  4533. AC_CACHE_VAL(kde_cv_c_long_long,
  4534. [
  4535. AC_LANG_SAVE
  4536. AC_LANG_CPLUSPLUS
  4537. AC_TRY_LINK([], [
  4538. long long foo = 0;
  4539. foo = foo+1;
  4540. ],
  4541. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4542. AC_LANG_RESTORE
  4543. ])
  4544. AC_MSG_RESULT($kde_cv_c_long_long)
  4545. if test "$kde_cv_c_long_long" = yes; then
  4546. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4547. fi
  4548. ])
  4549. AC_DEFUN([KDE_CHECK_LIB],
  4550. [
  4551. kde_save_LDFLAGS="$LDFLAGS"
  4552. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4553. kde_save_LIBS="$LIBS"
  4554. LDFLAGS="$LDFLAGS $all_libraries"
  4555. case $host_os in
  4556. aix*) LDFLAGS="-brtl $LDFLAGS"
  4557. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4558. ;;
  4559. esac
  4560. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4561. LDFLAGS="$kde_save_LDFLAGS"
  4562. LIBS="$kde_save_LIBS"
  4563. ])
  4564. AC_DEFUN([KDE_JAVA_PREFIX],
  4565. [
  4566. dir=`dirname "$1"`
  4567. base=`basename "$1"`
  4568. list=`ls -1 $dir 2> /dev/null`
  4569. for entry in $list; do
  4570. if test -d $dir/$entry/bin; then
  4571. case $entry in
  4572. $base)
  4573. javadirs="$javadirs $dir/$entry/bin"
  4574. ;;
  4575. esac
  4576. elif test -d $dir/$entry/jre/bin; then
  4577. case $entry in
  4578. $base)
  4579. javadirs="$javadirs $dir/$entry/jre/bin"
  4580. ;;
  4581. esac
  4582. fi
  4583. done
  4584. ])
  4585. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4586. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4587. [
  4588. AC_ARG_WITH(java,
  4589. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4590. [ ac_java_dir=$withval
  4591. ], ac_java_dir=""
  4592. )
  4593. AC_MSG_CHECKING([for Java])
  4594. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4595. if test "x$ac_java_dir" = "xno"; then
  4596. kde_java_bindir=no
  4597. kde_java_includedir=no
  4598. kde_java_libjvmdir=no
  4599. kde_java_libgcjdir=no
  4600. kde_java_libhpidir=no
  4601. else
  4602. if test "x$ac_java_dir" = "x"; then
  4603. dnl No option set -> collect list of candidate paths
  4604. if test -n "$JAVA_HOME"; then
  4605. KDE_JAVA_PREFIX($JAVA_HOME)
  4606. fi
  4607. KDE_JAVA_PREFIX(/usr/j2se)
  4608. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4609. KDE_JAVA_PREFIX(/usr/j*dk*)
  4610. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4611. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4612. KDE_JAVA_PREFIX(/usr/lib/java*)
  4613. KDE_JAVA_PREFIX(/usr/java*)
  4614. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4615. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4616. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4617. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4618. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4619. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4620. KDE_JAVA_PREFIX(/opt/java*)
  4621. kde_cv_path="NONE"
  4622. kde_save_IFS=$IFS
  4623. IFS=':'
  4624. for dir in $PATH; do
  4625. if test -d "$dir"; then
  4626. javadirs="$javadirs $dir"
  4627. fi
  4628. done
  4629. IFS=$kde_save_IFS
  4630. jredirs=
  4631. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4632. for dir in $javadirs; do
  4633. dnl Check for the java executable
  4634. if test -x "$dir/java"; then
  4635. dnl And also check for a libjvm.so somewhere under there
  4636. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4637. if test "$dir" != "/usr/bin"; then
  4638. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4639. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4640. jredirs="$jredirs $dir"
  4641. fi
  4642. fi
  4643. done
  4644. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4645. JAVAC=
  4646. JAVA=
  4647. kde_java_bindir=no
  4648. for dir in $jredirs; do
  4649. JAVA="$dir/java"
  4650. kde_java_bindir=$dir
  4651. if test -x "$dir/javac"; then
  4652. JAVAC="$dir/javac"
  4653. break
  4654. fi
  4655. done
  4656. if test -n "$JAVAC"; then
  4657. dnl this substitution might not work - well, we test for jni.h below
  4658. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4659. else
  4660. kde_java_includedir=no
  4661. fi
  4662. else
  4663. dnl config option set
  4664. kde_java_bindir=$ac_java_dir/bin
  4665. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4666. kde_java_includedir=no
  4667. else
  4668. kde_java_includedir=$ac_java_dir/include
  4669. fi
  4670. fi
  4671. fi
  4672. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4673. if test "x$kde_java_bindir" != "xno"; then
  4674. dnl Look for libjvm.so
  4675. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4676. dnl Look for libgcj.so
  4677. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4678. dnl Look for libhpi.so and avoid green threads
  4679. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4680. dnl Now check everything's fine under there
  4681. dnl the include dir is our flag for having the JDK
  4682. if test -d "$kde_java_includedir"; then
  4683. if test ! -x "$kde_java_bindir/javac"; then
  4684. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4685. fi
  4686. if test ! -x "$kde_java_bindir/javah"; then
  4687. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4688. fi
  4689. if test ! -x "$kde_java_bindir/jar"; then
  4690. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4691. fi
  4692. if test ! -r "$kde_java_includedir/jni.h"; then
  4693. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4694. fi
  4695. jni_includes="-I$kde_java_includedir"
  4696. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4697. dnl and under linux here..
  4698. dnl not needed for gcj
  4699. if test "x$kde_java_libgcjdir" = "x"; then
  4700. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4701. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4702. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4703. fi
  4704. else
  4705. JAVAC=
  4706. jni_includes=
  4707. fi
  4708. if test "x$kde_java_libgcjdir" = "x"; then
  4709. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4710. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4711. fi
  4712. else
  4713. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4714. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4715. fi
  4716. fi
  4717. if test ! -x "$kde_java_bindir/java"; then
  4718. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4719. fi
  4720. dnl not needed for gcj compile
  4721. if test "x$kde_java_libgcjdir" = "x"; then
  4722. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4723. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4724. fi
  4725. fi
  4726. if test -n "$jni_includes"; then
  4727. dnl Check for JNI version
  4728. AC_LANG_SAVE
  4729. AC_LANG_CPLUSPLUS
  4730. ac_cxxflags_safe="$CXXFLAGS"
  4731. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4732. AC_TRY_COMPILE([
  4733. #include <jni.h>
  4734. ],
  4735. [
  4736. #ifndef JNI_VERSION_1_2
  4737. Syntax Error
  4738. #endif
  4739. ],[ kde_jni_works=yes ],
  4740. [ kde_jni_works=no ])
  4741. if test $kde_jni_works = no; then
  4742. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4743. You need to have Java Development Kit (JDK) version 1.2.
  4744. Use --with-java to specify another location.
  4745. Use --without-java to configure without java support.
  4746. Or download a newer JDK and try again.
  4747. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4748. fi
  4749. CXXFLAGS="$ac_cxxflags_safe"
  4750. AC_LANG_RESTORE
  4751. dnl All tests ok, inform and subst the variables
  4752. JAVAC=$kde_java_bindir/javac
  4753. JAVAH=$kde_java_bindir/javah
  4754. JAR=$kde_java_bindir/jar
  4755. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4756. if test "x$kde_java_libgcjdir" = "x"; then
  4757. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4758. else
  4759. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4760. fi
  4761. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4762. else
  4763. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4764. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4765. fi
  4766. elif test -d "/Library/Java/Home"; then
  4767. kde_java_bindir="/Library/Java/Home/bin"
  4768. jni_includes="-I/Library/Java/Home/include"
  4769. JAVAC=$kde_java_bindir/javac
  4770. JAVAH=$kde_java_bindir/javah
  4771. JAR=$kde_java_bindir/jar
  4772. JVMLIBS="-Wl,-framework,JavaVM"
  4773. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4774. AC_MSG_RESULT([Apple Java Framework])
  4775. else
  4776. AC_MSG_RESULT([none found])
  4777. fi
  4778. AC_SUBST(JAVAC)
  4779. AC_SUBST(JAVAH)
  4780. AC_SUBST(JAR)
  4781. AC_SUBST(JVMLIBS)
  4782. AC_SUBST(jni_includes)
  4783. # for backward compat
  4784. kde_cv_java_includedir=$kde_java_includedir
  4785. kde_cv_java_bindir=$kde_java_bindir
  4786. ])
  4787. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4788. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4789. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4790. dnl it. (matz@kde.org)
  4791. m4_define([mm_foreach],
  4792. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4793. m4_define([mm_car], [[$1]])
  4794. m4_define([mm_car2], [[$@]])
  4795. m4_define([_mm_foreach],
  4796. [m4_if(m4_quote($2), [], [],
  4797. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4798. mm_car2(m4_shift($2)),
  4799. [$3])])])
  4800. m4_define([AC_FOREACH],
  4801. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4802. AC_DEFUN([KDE_NEED_FLEX],
  4803. [
  4804. kde_libs_safe=$LIBS
  4805. LIBS="$LIBS $USER_LDFLAGS"
  4806. AM_PROG_LEX
  4807. LIBS=$kde_libs_safe
  4808. if test -z "$LEXLIB"; then
  4809. AC_MSG_ERROR([You need to have flex installed.])
  4810. fi
  4811. AC_SUBST(LEXLIB)
  4812. ])
  4813. AC_DEFUN([AC_PATH_QTOPIA],
  4814. [
  4815. dnl TODO: use AC_CACHE_VAL
  4816. if test -z "$1"; then
  4817. qtopia_minver_maj=1
  4818. qtopia_minver_min=5
  4819. qtopia_minver_pat=0
  4820. else
  4821. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4822. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4823. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4824. fi
  4825. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4826. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4827. AC_REQUIRE([AC_PATH_QT])
  4828. AC_MSG_CHECKING([for Qtopia])
  4829. LIB_QTOPIA="-lqpe"
  4830. AC_SUBST(LIB_QTOPIA)
  4831. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4832. ac_qtopia_incdir=NO
  4833. AC_ARG_WITH(qtopia-dir,
  4834. AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
  4835. [ ac_qtopia_incdir="$withval"/include] )
  4836. qtopia_incdirs=""
  4837. for dir in $kde_qtopia_dirs; do
  4838. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4839. done
  4840. if test ! "$ac_qtopia_incdir" = "NO"; then
  4841. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4842. fi
  4843. qtopia_incdir=""
  4844. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4845. ac_qtopia_incdir="$qtopia_incdir"
  4846. if test -z "$qtopia_incdir"; then
  4847. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4848. fi
  4849. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4850. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4851. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4852. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4853. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4854. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4855. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4856. is required.])
  4857. fi
  4858. AC_LANG_SAVE
  4859. AC_LANG_CPLUSPLUS
  4860. ac_cxxflags_safe="$CXXFLAGS"
  4861. ac_ldflags_safe="$LDFLAGS"
  4862. ac_libs_safe="$LIBS"
  4863. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4864. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4865. LIBS="$LIBS $LIB_QTOPIA $LIBQT"
  4866. cat > conftest.$ac_ext <<EOF
  4867. #include "confdefs.h"
  4868. #include <qpe/qpeapplication.h>
  4869. #include <qpe/version.h>
  4870. int main( int argc, char **argv )
  4871. {
  4872. QPEApplication app( argc, argv );
  4873. return 0;
  4874. }
  4875. EOF
  4876. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4877. rm -f conftest*
  4878. else
  4879. rm -f conftest*
  4880. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4881. the end of config.log])
  4882. fi
  4883. CXXFLAGS="$ac_cxxflags_safe"
  4884. LDFLAGS="$ac_ldflags_safe"
  4885. LIBS="$ac_libs_safe"
  4886. AC_LANG_RESTORE
  4887. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4888. AC_SUBST(QTOPIA_INCLUDES)
  4889. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4890. ])
  4891. AC_DEFUN([KDE_INIT_DOXYGEN],
  4892. [
  4893. AC_MSG_CHECKING([for Qt docs])
  4894. kde_qtdir=
  4895. if test "${with_qt_dir+set}" = set; then
  4896. kde_qtdir="$with_qt_dir"
  4897. fi
  4898. AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
  4899. AC_MSG_RESULT($QTDOCDIR)
  4900. AC_SUBST(QTDOCDIR)
  4901. KDE_FIND_PATH(dot, DOT, [], [])
  4902. if test -n "$DOT"; then
  4903. KDE_HAVE_DOT="YES"
  4904. else
  4905. KDE_HAVE_DOT="NO"
  4906. fi
  4907. AC_SUBST(KDE_HAVE_DOT)
  4908. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4909. AC_SUBST(DOXYGEN)
  4910. DOXYGEN_PROJECT_NAME="$1"
  4911. DOXYGEN_PROJECT_NUMBER="$2"
  4912. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4913. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4914. KDE_HAS_DOXYGEN=no
  4915. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
  4916. KDE_HAS_DOXYGEN=yes
  4917. fi
  4918. AC_SUBST(KDE_HAS_DOXYGEN)
  4919. ])
  4920. AC_DEFUN([AC_FIND_BZIP2],
  4921. [
  4922. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4923. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4924. [
  4925. AC_LANG_SAVE
  4926. AC_LANG_CPLUSPLUS
  4927. kde_save_LIBS="$LIBS"
  4928. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4929. kde_save_CXXFLAGS="$CXXFLAGS"
  4930. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4931. AC_TRY_LINK(dnl
  4932. [
  4933. #define BZ_NO_STDIO
  4934. #include<bzlib.h>
  4935. ],
  4936. [ bz_stream s; (void) bzDecompress(&s); ],
  4937. eval "ac_cv_lib_bzip2='-lbz2'",
  4938. eval "ac_cv_lib_bzip2=no")
  4939. LIBS="$kde_save_LIBS"
  4940. CXXFLAGS="$kde_save_CXXFLAGS"
  4941. AC_LANG_RESTORE
  4942. ])dnl
  4943. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4944. if test ! "$ac_cv_lib_bzip2" = no; then
  4945. BZIP2DIR=bzip2
  4946. LIBBZ2="$ac_cv_lib_bzip2"
  4947. AC_SUBST(LIBBZ2)
  4948. else
  4949. cxx_shared_flag=
  4950. ld_shared_flag=
  4951. KDE_CHECK_COMPILER_FLAG(shared, [
  4952. ld_shared_flag="-shared"
  4953. ])
  4954. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4955. cxx_shared_flag="-fPIC"
  4956. ])
  4957. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4958. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4959. [
  4960. AC_LANG_SAVE
  4961. AC_LANG_CPLUSPLUS
  4962. kde_save_LIBS="$LIBS"
  4963. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4964. kde_save_CXXFLAGS="$CXXFLAGS"
  4965. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4966. AC_TRY_LINK(dnl
  4967. [
  4968. #define BZ_NO_STDIO
  4969. #include<bzlib.h>
  4970. ],
  4971. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4972. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4973. eval "ac_cv_lib_bzip2_prefix=no")
  4974. LIBS="$kde_save_LIBS"
  4975. CXXFLAGS="$kde_save_CXXFLAGS"
  4976. AC_LANG_RESTORE
  4977. ])dnl
  4978. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4979. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4980. BZIP2DIR=bzip2
  4981. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4982. AC_SUBST(LIBBZ2)
  4983. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4984. dnl else, we just ignore this
  4985. fi
  4986. fi
  4987. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4988. ])
  4989. dnl ------------------------------------------------------------------------
  4990. dnl Try to find the SSL headers and libraries.
  4991. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4992. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4993. dnl ------------------------------------------------------------------------
  4994. dnl
  4995. AC_DEFUN([KDE_CHECK_SSL],
  4996. [
  4997. LIBSSL="-lssl -lcrypto"
  4998. AC_REQUIRE([KDE_CHECK_LIB64])
  4999. ac_ssl_includes=NO ac_ssl_libraries=NO
  5000. ssl_libraries=""
  5001. ssl_includes=""
  5002. AC_ARG_WITH(ssl-dir,
  5003. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  5004. [ ac_ssl_includes="$withval"/include
  5005. ac_ssl_libraries="$withval"/lib$tdelibsuff
  5006. ])
  5007. want_ssl=yes
  5008. AC_ARG_WITH(ssl,
  5009. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  5010. [want_ssl=$withval])
  5011. if test $want_ssl = yes; then
  5012. AC_MSG_CHECKING(for OpenSSL)
  5013. AC_CACHE_VAL(ac_cv_have_ssl,
  5014. [#try to guess OpenSSL locations
  5015. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  5016. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  5017. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  5018. ac_ssl_includes="$ssl_incdir"
  5019. ssl_libdirs="/usr/lib$tdelibsuff /usr/local/lib$tdelibsuff /usr/ssl/lib$tdelibsuff /usr/local/ssl/lib$tdelibsuff $libdir $prefix/lib$tdelibsuff $exec_prefix/lib$tdelibsuff $kde_extra_libs"
  5020. if test ! "$ac_ssl_libraries" = "NO"; then
  5021. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  5022. fi
  5023. test=NONE
  5024. ssl_libdir=NONE
  5025. for dir in $ssl_libdirs; do
  5026. try="ls -1 $dir/libssl*"
  5027. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  5028. done
  5029. ac_ssl_libraries="$ssl_libdir"
  5030. ac_ldflags_safe="$LDFLAGS"
  5031. ac_libs_safe="$LIBS"
  5032. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  5033. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  5034. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  5035. ac_ssl_rsaref="yes"
  5036. ,
  5037. ac_ssl_rsaref="no"
  5038. )
  5039. LDFLAGS="$ac_ldflags_safe"
  5040. LIBS="$ac_libs_safe"
  5041. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5042. have_ssl=no
  5043. else
  5044. have_ssl=yes;
  5045. fi
  5046. ])
  5047. eval "$ac_cv_have_ssl"
  5048. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5049. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5050. AC_MSG_RESULT($ac_ssl_rsaref)
  5051. AC_MSG_CHECKING([for easter eggs])
  5052. AC_MSG_RESULT([none found])
  5053. else
  5054. have_ssl=no
  5055. fi
  5056. if test "$have_ssl" = yes; then
  5057. AC_MSG_CHECKING(for OpenSSL version)
  5058. dnl Check for SSL version
  5059. AC_CACHE_VAL(ac_cv_ssl_version,
  5060. [
  5061. cat >conftest.$ac_ext <<EOF
  5062. #include <openssl/opensslv.h>
  5063. #include <stdio.h>
  5064. int main() {
  5065. #ifndef OPENSSL_VERSION_NUMBER
  5066. printf("ssl_version=\\"error\\"\n");
  5067. #else
  5068. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5069. printf("ssl_version=\\"old\\"\n");
  5070. else
  5071. printf("ssl_version=\\"ok\\"\n");
  5072. #endif
  5073. return (0);
  5074. }
  5075. EOF
  5076. ac_save_CPPFLAGS=$CPPFLAGS
  5077. if test "$ac_ssl_includes" != "/usr/include"; then
  5078. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5079. fi
  5080. if AC_TRY_EVAL(ac_link); then
  5081. if eval `./conftest 2>&5`; then
  5082. if test $ssl_version = error; then
  5083. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5084. else
  5085. if test $ssl_version = old; then
  5086. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5087. have_ssl=no
  5088. fi
  5089. fi
  5090. ac_cv_ssl_version="ssl_version=$ssl_version"
  5091. else
  5092. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5093. Check config.log, and if you can't figure it out, send a mail to
  5094. David Faure <faure@kde.org>, attaching your config.log])
  5095. fi
  5096. else
  5097. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5098. Check config.log, and if you can't figure it out, send a mail to
  5099. David Faure <faure@kde.org>, attaching your config.log])
  5100. fi
  5101. CPPFLAGS=$ac_save_CPPFLAGS
  5102. ])
  5103. eval "$ac_cv_ssl_version"
  5104. AC_MSG_RESULT($ssl_version)
  5105. fi
  5106. if test "$have_ssl" != yes; then
  5107. LIBSSL="";
  5108. else
  5109. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5110. ac_cv_have_ssl="have_ssl=yes \
  5111. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5112. ssl_libraries="$ac_ssl_libraries"
  5113. ssl_includes="$ac_ssl_includes"
  5114. if test "$ac_ssl_rsaref" = yes; then
  5115. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5116. fi
  5117. if test $ssl_version = "old"; then
  5118. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5119. fi
  5120. fi
  5121. SSL_INCLUDES=
  5122. if test "$ssl_includes" = "/usr/include"; then
  5123. if test -f /usr/kerberos/include/krb5.h; then
  5124. SSL_INCLUDES="-I/usr/kerberos/include"
  5125. fi
  5126. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5127. SSL_INCLUDES="-I$ssl_includes"
  5128. fi
  5129. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5130. SSL_LDFLAGS=""
  5131. else
  5132. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5133. fi
  5134. AC_SUBST(SSL_INCLUDES)
  5135. AC_SUBST(SSL_LDFLAGS)
  5136. AC_SUBST(LIBSSL)
  5137. ])
  5138. AC_DEFUN([KDE_CHECK_STRLCPY],
  5139. [
  5140. AC_REQUIRE([AC_CHECK_STRLCAT])
  5141. AC_REQUIRE([AC_CHECK_STRLCPY])
  5142. AC_CHECK_SIZEOF(size_t)
  5143. AC_CHECK_SIZEOF(unsigned long)
  5144. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5145. AC_TRY_COMPILE(,[
  5146. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5147. choke me
  5148. #endif
  5149. ],AC_MSG_RESULT([yes]),[
  5150. AC_MSG_RESULT(no)
  5151. AC_MSG_ERROR([
  5152. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5153. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5154. ])
  5155. ])
  5156. ])
  5157. AC_DEFUN([KDE_CHECK_BINUTILS],
  5158. [
  5159. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5160. kde_save_LDFLAGS="$LDFLAGS"
  5161. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5162. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5163. AC_TRY_LINK([int foo;],
  5164. [
  5165. #ifdef __INTEL_COMPILER
  5166. icc apparently does not support libtools version-info and version-script
  5167. at the same time. Dunno where the bug is, but until somebody figured out,
  5168. better disable the optional version scripts.
  5169. #endif
  5170. foo = 42;
  5171. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5172. LDFLAGS="$kde_save_LDFLAGS"
  5173. rm -f conftest.map
  5174. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5175. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5176. AC_MSG_RESULT($kde_supports_versionmaps)
  5177. ])
  5178. AC_DEFUN([AM_PROG_OBJC],[
  5179. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5180. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5181. if test "x${OBJCFLAGS-unset}" = xunset; then
  5182. OBJCFLAGS="-g -O2"
  5183. fi
  5184. AC_SUBST(OBJCFLAGS)
  5185. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5186. ])
  5187. AC_DEFUN([KDE_CHECK_PERL],
  5188. [
  5189. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5190. AC_MSG_ERROR([No Perl found in your $PATH.
  5191. We need perl to generate some code.])
  5192. ])
  5193. AC_SUBST(PERL)
  5194. ])
  5195. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5196. [
  5197. AC_SYS_LARGEFILE
  5198. if test "$ac_cv_sys_file_offset_bits" != no; then
  5199. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5200. fi
  5201. if test "x$ac_cv_sys_large_files" != "xno"; then
  5202. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5203. fi
  5204. ])
  5205. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5206. dnl which allows to search for libs that get installed into the KDE prefix.
  5207. dnl
  5208. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5209. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5210. dnl also defines KSTUFF_PKG_ERRORS on error
  5211. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5212. PKG_CONFIG_PATH="$prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5213. if test "$prefix" != "$kde_libs_prefix"; then
  5214. PKG_CONFIG_PATH="$kde_libs_prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5215. fi
  5216. export PKG_CONFIG_PATH
  5217. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5218. ])
  5219. dnl Check for PIE support in the compiler and linker
  5220. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5221. [
  5222. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5223. [
  5224. AC_LANG_SAVE
  5225. AC_LANG_CPLUSPLUS
  5226. safe_CXXFLAGS=$CXXFLAGS
  5227. safe_LDFLAGS=$LDFLAGS
  5228. CXXFLAGS="$CXXFLAGS -fPIE"
  5229. LDFLAGS="$LDFLAGS -pie"
  5230. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5231. CXXFLAGS=$safe_CXXFLAGS
  5232. LDFLAGS=$safe_LDFLAGS
  5233. AC_LANG_RESTORE
  5234. ])
  5235. AC_MSG_CHECKING(if enabling -pie/fPIE support)
  5236. AC_ARG_ENABLE(pie,
  5237. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5238. [kde_has_pie_support=$enableval],
  5239. [kde_has_pie_support=detect])
  5240. if test "$kde_has_pie_support" = "detect"; then
  5241. kde_has_pie_support=$kde_cv_val_pie_support
  5242. fi
  5243. AC_MSG_RESULT([$kde_has_pie_support])
  5244. KDE_USE_FPIE=""
  5245. KDE_USE_PIE=""
  5246. AC_SUBST([KDE_USE_FPIE])
  5247. AC_SUBST([KDE_USE_PIE])
  5248. if test "$kde_has_pie_support" = "yes"; then
  5249. KDE_USE_FPIE="-fPIE"
  5250. KDE_USE_PIE="-pie"
  5251. fi
  5252. ])
  5253. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  5254. # serial 48 Debian 1.5.22-4 AC_PROG_LIBTO