KSplash engine Moodin - splash screen engine
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.

12607 lines
392KB

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