KSquirrel – powerful image viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11837 lines
364 KiB

  1. ## -*- autoconf -*-
  2. dnl This file is part of the KDE libraries/packages
  3. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  4. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  5. dnl This file is free software; you can redistribute it and/or
  6. dnl modify it under the terms of the GNU Library General Public
  7. dnl License as published by the Free Software Foundation; either
  8. dnl version 2 of the License, or (at your option) any later version.
  9. dnl This library is distributed in the hope that it will be useful,
  10. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. dnl Library General Public License for more details.
  13. dnl You should have received a copy of the GNU Library General Public License
  14. dnl along with this library; see the file COPYING.LIB. If not, write to
  15. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. dnl Boston, MA 02110-1301, USA.
  17. dnl IMPORTANT NOTE:
  18. dnl Please do not modify this file unless you expect your modifications to be
  19. dnl carried into every other module in the repository.
  20. dnl
  21. dnl Single-module modifications are best placed in configure.in for tdelibs
  22. dnl and tdebase or configure.in.in if present.
  23. # KDE_PATH_X_DIRECT
  24. dnl Internal subroutine of AC_PATH_X.
  25. dnl Set ac_x_includes and/or ac_x_libraries.
  26. AC_DEFUN([KDE_PATH_X_DIRECT],
  27. [
  28. AC_REQUIRE([KDE_CHECK_LIB64])
  29. if test "$ac_x_includes" = NO; then
  30. # Guess where to find include files, by looking for this one X11 .h file.
  31. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  32. # First, try using that file with no special directory specified.
  33. AC_TRY_CPP([#include <$x_direct_test_include>],
  34. [# We can compile using X headers with no special include directory.
  35. ac_x_includes=],
  36. [# Look for the header file in a standard set of common directories.
  37. # Check X11 before X11Rn because it is often a symlink to the current release.
  38. for ac_dir in \
  39. /usr/X11/include \
  40. /usr/X11R6/include \
  41. /usr/X11R5/include \
  42. /usr/X11R4/include \
  43. \
  44. /usr/include/X11 \
  45. /usr/include/X11R6 \
  46. /usr/include/X11R5 \
  47. /usr/include/X11R4 \
  48. \
  49. /usr/local/X11/include \
  50. /usr/local/X11R6/include \
  51. /usr/local/X11R5/include \
  52. /usr/local/X11R4/include \
  53. \
  54. /usr/local/include/X11 \
  55. /usr/local/include/X11R6 \
  56. /usr/local/include/X11R5 \
  57. /usr/local/include/X11R4 \
  58. \
  59. /usr/X386/include \
  60. /usr/x386/include \
  61. /usr/XFree86/include/X11 \
  62. \
  63. /usr/include \
  64. /usr/local/include \
  65. /usr/unsupported/include \
  66. /usr/athena/include \
  67. /usr/local/x11r5/include \
  68. /usr/lpp/Xamples/include \
  69. \
  70. /usr/openwin/include \
  71. /usr/openwin/share/include \
  72. ; \
  73. do
  74. if test -r "$ac_dir/$x_direct_test_include"; then
  75. ac_x_includes=$ac_dir
  76. break
  77. fi
  78. done])
  79. fi # $ac_x_includes = NO
  80. if test "$ac_x_libraries" = NO; then
  81. # Check for the libraries.
  82. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  83. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  84. # See if we find them without any special options.
  85. # Don't add to $LIBS permanently.
  86. ac_save_LIBS="$LIBS"
  87. LIBS="-l$x_direct_test_library $LIBS"
  88. AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  89. [LIBS="$ac_save_LIBS"
  90. # We can link X programs with no special library path.
  91. ac_x_libraries=],
  92. [LIBS="$ac_save_LIBS"
  93. # First see if replacing the include by lib works.
  94. # Check X11 before X11Rn because it is often a symlink to the current release.
  95. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${tdelibsuff}/` \
  96. /usr/X11/lib${tdelibsuff} \
  97. /usr/X11R6/lib${tdelibsuff} \
  98. /usr/X11R5/lib${tdelibsuff} \
  99. /usr/X11R4/lib${tdelibsuff} \
  100. \
  101. /usr/lib${tdelibsuff}/X11 \
  102. /usr/lib${tdelibsuff}/X11R6 \
  103. /usr/lib${tdelibsuff}/X11R5 \
  104. /usr/lib${tdelibsuff}/X11R4 \
  105. \
  106. /usr/local/X11/lib${tdelibsuff} \
  107. /usr/local/X11R6/lib${tdelibsuff} \
  108. /usr/local/X11R5/lib${tdelibsuff} \
  109. /usr/local/X11R4/lib${tdelibsuff} \
  110. \
  111. /usr/local/lib${tdelibsuff}/X11 \
  112. /usr/local/lib${tdelibsuff}/X11R6 \
  113. /usr/local/lib${tdelibsuff}/X11R5 \
  114. /usr/local/lib${tdelibsuff}/X11R4 \
  115. \
  116. /usr/X386/lib${tdelibsuff} \
  117. /usr/x386/lib${tdelibsuff} \
  118. /usr/XFree86/lib${tdelibsuff}/X11 \
  119. \
  120. /usr/lib${tdelibsuff} \
  121. /usr/local/lib${tdelibsuff} \
  122. /usr/unsupported/lib${tdelibsuff} \
  123. /usr/athena/lib${tdelibsuff} \
  124. /usr/local/x11r5/lib${tdelibsuff} \
  125. /usr/lpp/Xamples/lib${tdelibsuff} \
  126. /lib/usr/lib${tdelibsuff}/X11 \
  127. \
  128. /usr/openwin/lib${tdelibsuff} \
  129. /usr/openwin/share/lib${tdelibsuff} \
  130. ; \
  131. do
  132. dnl Don't even attempt the hair of trying to link an X program!
  133. for ac_extension in a so sl; do
  134. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  135. ac_x_libraries=$ac_dir
  136. break 2
  137. fi
  138. done
  139. done])
  140. fi # $ac_x_libraries = NO
  141. ])
  142. dnl ------------------------------------------------------------------------
  143. dnl Find a file (or one of more files in a list of dirs)
  144. dnl ------------------------------------------------------------------------
  145. dnl
  146. AC_DEFUN([AC_FIND_FILE],
  147. [
  148. $3=NO
  149. for i in $2;
  150. do
  151. for j in $1;
  152. do
  153. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  154. if test -r "$i/$j"; then
  155. echo "taking that" >&AC_FD_CC
  156. $3=$i
  157. break 2
  158. fi
  159. done
  160. done
  161. ])
  162. dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
  163. dnl if-not-found, test-parameter, prepend-path)
  164. dnl
  165. dnl Look for program-name in list-of-dirs+$PATH.
  166. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  167. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  168. dnl test-parameter: if set, the program is executed with this arg,
  169. dnl and only a successful exit code is required.
  170. AC_DEFUN([KDE_FIND_PATH],
  171. [
  172. AC_MSG_CHECKING([for $1])
  173. if test -n "$$2"; then
  174. kde_cv_path="$$2";
  175. else
  176. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  177. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  178. [
  179. kde_cv_path="NONE"
  180. kde_save_IFS=$IFS
  181. IFS=':'
  182. dirs=""
  183. for dir in $PATH; do
  184. dirs="$dirs $dir"
  185. done
  186. if test -z "$6"; then dnl Append dirs in PATH (default)
  187. dirs="$3 $dirs"
  188. else dnl Prepend dirs in PATH (if 6th arg is set)
  189. dirs="$dirs $3"
  190. fi
  191. IFS=$kde_save_IFS
  192. for dir in $dirs; do
  193. if test -x "$dir/$1"; then
  194. if test -n "$5"
  195. then
  196. evalstr="$dir/$1 $5 2>&1 "
  197. if eval $evalstr; then
  198. kde_cv_path="$dir/$1"
  199. break
  200. fi
  201. else
  202. kde_cv_path="$dir/$1"
  203. break
  204. fi
  205. fi
  206. done
  207. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  208. ])
  209. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  210. fi
  211. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  212. AC_MSG_RESULT(not found)
  213. $4
  214. else
  215. AC_MSG_RESULT($kde_cv_path)
  216. $2=$kde_cv_path
  217. fi
  218. ])
  219. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  220. [
  221. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  222. Please check whether you installed Qt correctly.
  223. You need to have a running moc binary.
  224. configure tried to run $ac_cv_path_moc and the test didn't
  225. succeed. If configure shouldn't have tried this one, set
  226. the environment variable MOC to the right one before running
  227. configure.
  228. ])
  229. ])
  230. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  231. [
  232. AC_MSG_WARN([No Qt ui compiler (uic) found!
  233. Please check whether you installed Qt correctly.
  234. You need to have a running uic binary.
  235. configure tried to run $ac_cv_path_uic and the test didn't
  236. succeed. If configure shouldn't have tried this one, set
  237. the environment variable UIC to the right one before running
  238. configure.
  239. ])
  240. ])
  241. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  242. [
  243. AC_MSG_CHECKING([whether uic supports -$1 ])
  244. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  245. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  246. [
  247. cat >conftest.ui <<EOT
  248. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  249. EOT
  250. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  251. if AC_TRY_EVAL(ac_uic_testrun); then
  252. eval "kde_cv_prog_uic_$kde_cache=yes"
  253. else
  254. eval "kde_cv_prog_uic_$kde_cache=no"
  255. fi
  256. rm -f conftest*
  257. ])
  258. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  259. AC_MSG_RESULT([yes])
  260. :
  261. $3
  262. else
  263. AC_MSG_RESULT([no])
  264. :
  265. $4
  266. fi
  267. ])
  268. dnl ------------------------------------------------------------------------
  269. dnl Find the meta object compiler and the ui compiler in the PATH,
  270. dnl in $TQTDIR/bin, and some more usual places
  271. dnl ------------------------------------------------------------------------
  272. dnl
  273. AC_DEFUN([AC_PATH_TQT_MOC_UIC],
  274. [
  275. AC_REQUIRE([KDE_CHECK_PERL])
  276. qt_bindirs=""
  277. for dir in $kde_qt_dirs; do
  278. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  279. done
  280. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  281. if test ! "$ac_qt_bindir" = "NO"; then
  282. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  283. fi
  284. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  285. if test -z "$UIC_NOT_NEEDED"; then
  286. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  287. if test -z "$UIC_PATH" ; then
  288. KDE_UIC_ERROR_MESSAGE
  289. exit 1
  290. else
  291. UIC=$UIC_PATH
  292. if test $kde_qtver = 3; then
  293. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  294. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  295. if test x$ac_uic_supports_libpath = xyes; then
  296. UIC="$UIC -L \$(kde_widgetdir)"
  297. fi
  298. if test x$ac_uic_supports_nounload = xyes; then
  299. UIC="$UIC -nounload"
  300. fi
  301. fi
  302. fi
  303. else
  304. UIC="echo uic not available: "
  305. fi
  306. AC_SUBST(MOC)
  307. AC_SUBST(UIC)
  308. UIC_TR="i18n"
  309. if test $kde_qtver = 3; then
  310. UIC_TR="tr2i18n"
  311. fi
  312. AC_SUBST(UIC_TR)
  313. ])
  314. AC_DEFUN([KDE_1_CHECK_PATHS],
  315. [
  316. KDE_1_CHECK_PATH_HEADERS
  317. KDE_TEST_RPATH=
  318. if test -n "$USE_RPATH"; then
  319. if test -n "$kde_libraries"; then
  320. KDE_TEST_RPATH="-R $kde_libraries"
  321. fi
  322. if test -n "$qt_libraries"; then
  323. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  324. fi
  325. if test -n "$x_libraries"; then
  326. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  327. fi
  328. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  329. fi
  330. AC_MSG_CHECKING([for KDE libraries installed])
  331. 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'
  332. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  333. AC_MSG_RESULT(yes)
  334. else
  335. AC_MSG_ERROR([your system fails at linking a small KDE application!
  336. Check, if your compiler is installed correctly and if you have used the
  337. same compiler to compile Qt and tdelibs as you did use now.
  338. For more details about this problem, look at the end of config.log.])
  339. fi
  340. if eval `TDEDIR= ./conftest 2>&5`; then
  341. kde_result=done
  342. else
  343. kde_result=problems
  344. fi
  345. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  346. kde_have_all_paths=yes
  347. KDE_SET_PATHS($kde_result)
  348. ])
  349. AC_DEFUN([KDE_SET_PATHS],
  350. [
  351. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  352. kde_htmldir=\"$kde_htmldir\" \
  353. kde_appsdir=\"$kde_appsdir\" \
  354. kde_icondir=\"$kde_icondir\" \
  355. kde_sounddir=\"$kde_sounddir\" \
  356. kde_datadir=\"$kde_datadir\" \
  357. kde_locale=\"$kde_locale\" \
  358. kde_cgidir=\"$kde_cgidir\" \
  359. kde_confdir=\"$kde_confdir\" \
  360. kde_kcfgdir=\"$kde_kcfgdir\" \
  361. kde_mimedir=\"$kde_mimedir\" \
  362. kde_toolbardir=\"$kde_toolbardir\" \
  363. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  364. kde_templatesdir=\"$kde_templatesdir\" \
  365. kde_bindir=\"$kde_bindir\" \
  366. kde_servicesdir=\"$kde_servicesdir\" \
  367. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  368. kde_moduledir=\"$kde_moduledir\" \
  369. kde_styledir=\"$kde_styledir\" \
  370. kde_widgetdir=\"$kde_widgetdir\" \
  371. xdg_appsdir=\"$xdg_appsdir\" \
  372. xdg_menudir=\"$xdg_menudir\" \
  373. xdg_directorydir=\"$xdg_directorydir\" \
  374. kde_result=$1"
  375. ])
  376. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  377. [
  378. if test "$1" = "default"; then
  379. if test -z "$kde_htmldir"; then
  380. kde_htmldir='\${datadir}/doc/tde/HTML'
  381. fi
  382. if test -z "$kde_appsdir"; then
  383. kde_appsdir='\${datadir}/applnk'
  384. fi
  385. if test -z "$kde_icondir"; then
  386. kde_icondir='\${datadir}/icons'
  387. fi
  388. if test -z "$kde_sounddir"; then
  389. kde_sounddir='\${datadir}/sounds'
  390. fi
  391. if test -z "$kde_datadir"; then
  392. kde_datadir='\${datadir}/apps'
  393. fi
  394. if test -z "$kde_locale"; then
  395. kde_locale='\${datadir}/locale'
  396. fi
  397. if test -z "$kde_cgidir"; then
  398. kde_cgidir='\${exec_prefix}/cgi-bin'
  399. fi
  400. if test -z "$kde_confdir"; then
  401. kde_confdir='\${datadir}/config'
  402. fi
  403. if test -z "$kde_kcfgdir"; then
  404. kde_kcfgdir='\${datadir}/config.kcfg'
  405. fi
  406. if test -z "$kde_mimedir"; then
  407. kde_mimedir='\${datadir}/mimelnk'
  408. fi
  409. if test -z "$kde_toolbardir"; then
  410. kde_toolbardir='\${datadir}/toolbar'
  411. fi
  412. if test -z "$kde_wallpaperdir"; then
  413. kde_wallpaperdir='\${datadir}/wallpapers'
  414. fi
  415. if test -z "$kde_templatesdir"; then
  416. kde_templatesdir='\${datadir}/templates'
  417. fi
  418. if test -z "$kde_bindir"; then
  419. kde_bindir='\${exec_prefix}/bin'
  420. fi
  421. if test -z "$kde_servicesdir"; then
  422. kde_servicesdir='\${datadir}/services'
  423. fi
  424. if test -z "$kde_servicetypesdir"; then
  425. kde_servicetypesdir='\${datadir}/servicetypes'
  426. fi
  427. if test -z "$kde_moduledir"; then
  428. if test "$kde_qtver" = "2"; then
  429. kde_moduledir='\${libdir}/kde2'
  430. else
  431. kde_moduledir='\${libdir}/trinity'
  432. fi
  433. fi
  434. if test -z "$kde_styledir"; then
  435. kde_styledir='\${libdir}/trinity/plugins/styles'
  436. fi
  437. if test -z "$kde_widgetdir"; then
  438. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  439. fi
  440. if test -z "$xdg_appsdir"; then
  441. xdg_appsdir='\${datadir}/applications/tde'
  442. fi
  443. if test -z "$xdg_menudir"; then
  444. xdg_menudir='\${sysconfdir}/xdg/menus'
  445. fi
  446. if test -z "$xdg_directorydir"; then
  447. xdg_directorydir='\${datadir}/desktop-directories'
  448. fi
  449. KDE_SET_PATHS(defaults)
  450. else
  451. if test $kde_qtver = 1; then
  452. AC_MSG_RESULT([compiling])
  453. KDE_1_CHECK_PATHS
  454. else
  455. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  456. fi
  457. fi
  458. ])
  459. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  460. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  461. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  462. test -z "$kde_datadir" || test -z "$kde_locale" ||
  463. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  464. test -z "$kde_kcfgdir" ||
  465. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  466. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  467. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  468. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  469. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  470. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  471. test "x$kde_have_all_paths" != "xyes"; then
  472. kde_have_all_paths=no
  473. fi
  474. ])
  475. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  476. [
  477. AC_MSG_ERROR([The important program $1 was not found!
  478. Please check whether you installed KDE correctly.
  479. ])
  480. ])
  481. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  482. [
  483. AC_MSG_ERROR([The important program $1 was not found!
  484. Please check whether you installed aRts correctly or use
  485. --without-arts to compile without aRts support (this will remove functionality).
  486. ])
  487. ])
  488. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  489. [
  490. 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"
  491. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  492. if test -n "$TDEDIRS"; then
  493. kde_save_IFS=$IFS
  494. IFS=:
  495. for dir in $TDEDIRS; do
  496. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  497. done
  498. IFS=$kde_save_IFS
  499. fi
  500. ])
  501. AC_DEFUN([KDE_SUBST_PROGRAMS],
  502. [
  503. AC_ARG_WITH(arts,
  504. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  505. [build_arts=$withval],
  506. [build_arts=yes]
  507. )
  508. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  509. if test "$build_arts" = "no"; then
  510. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  511. fi
  512. KDE_SET_DEFAULT_BINDIRS
  513. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  514. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  515. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  516. if test "$build_arts" '!=' "no"; then
  517. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  518. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  519. fi
  520. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  521. trinity2ornewer=1
  522. trinity3ornewer=1
  523. if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
  524. trinity2ornewer=
  525. trinity3ornewer=
  526. else
  527. if test "$kde_qtver" = "3"; then
  528. if test "$kde_qtsubver" -le 1; then
  529. trinity2ornewer=
  530. fi
  531. if test "$kde_qtsubver" -le 2; then
  532. trinity3ornewer=
  533. fi
  534. if test "$KDECONFIG" != "compiled"; then
  535. if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
  536. trinity3ornewer=
  537. fi
  538. fi
  539. fi
  540. fi
  541. if test -n "$trinity2ornewer"; then
  542. KDE_FIND_PATH(tdeconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tdeconfig_compiler)])
  543. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  544. fi
  545. if test -n "$trinity3ornewer"; then
  546. KDE_FIND_PATH(maketdewidgets, MAKETDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(maketdewidgets)])
  547. AC_SUBST(MAKETDEWIDGETS)
  548. fi
  549. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  550. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  551. kde_sharedirs="$prefix/share /opt/trinity/share /opt/trinity/share /opt/kde/share /usr/share/kde /usr/local/share /usr/share"
  552. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  553. AC_FIND_FILE(apps/ksgmltools2/customization/tde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  554. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  555. KDE_XSL_STYLESHEET=""
  556. else
  557. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/tde-chunk.xsl"
  558. fi
  559. fi
  560. DCOP_DEPENDENCIES='$(DCOPIDL)'
  561. if test -n "$trinity2ornewer"; then
  562. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  563. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  564. AC_SUBST(KCONFIG_COMPILER)
  565. AC_SUBST(KCFG_DEPENDENCIES)
  566. AC_SUBST(DCOPIDLNG)
  567. fi
  568. AC_SUBST(DCOPIDL)
  569. AC_SUBST(DCOPIDL2CPP)
  570. AC_SUBST(DCOP_DEPENDENCIES)
  571. AC_SUBST(MCOPIDL)
  572. AC_SUBST(ARTSCCONFIG)
  573. AC_SUBST(MEINPROC)
  574. AC_SUBST(KDE_XSL_STYLESHEET)
  575. AC_SUBST(XMLLINT)
  576. ])dnl
  577. AC_DEFUN([AC_CREATE_KFSSTND],
  578. [
  579. AC_REQUIRE([AC_CHECK_RPATH])
  580. AC_MSG_CHECKING([for KDE paths])
  581. kde_result=""
  582. kde_cached_paths=yes
  583. AC_CACHE_VAL(kde_cv_all_paths,
  584. [
  585. KDE_SET_DEFAULT_PATHS($1)
  586. kde_cached_paths=no
  587. ])
  588. eval "$kde_cv_all_paths"
  589. KDE_CHECK_PATHS_FOR_COMPLETENESS
  590. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  591. # wrong values were cached, may be, we can set better ones
  592. kde_result=
  593. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  594. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  595. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  596. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  597. kde_have_all_paths=
  598. kde_styledir=
  599. kde_widgetdir=
  600. xdg_appsdir = xdg_menudir= xdg_directorydir=
  601. KDE_SET_DEFAULT_PATHS($1)
  602. eval "$kde_cv_all_paths"
  603. KDE_CHECK_PATHS_FOR_COMPLETENESS
  604. kde_result="$kde_result (cache overridden)"
  605. fi
  606. if test "$kde_have_all_paths" = "no"; then
  607. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  608. Since it had compiled and linked before, it must be a strange problem on your system.
  609. Look at config.log for details. If you are not able to fix this, look at
  610. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  611. (If you're using an egcs version on Linux, you may update binutils!)
  612. ])
  613. else
  614. rm -f conftest*
  615. AC_MSG_RESULT($kde_result)
  616. fi
  617. bindir=$kde_bindir
  618. KDE_SUBST_PROGRAMS
  619. ])
  620. AC_DEFUN([AC_SUBST_KFSSTND],
  621. [
  622. AC_SUBST(kde_htmldir)
  623. AC_SUBST(kde_appsdir)
  624. AC_SUBST(kde_icondir)
  625. AC_SUBST(kde_sounddir)
  626. AC_SUBST(kde_datadir)
  627. AC_SUBST(kde_locale)
  628. AC_SUBST(kde_confdir)
  629. AC_SUBST(kde_kcfgdir)
  630. AC_SUBST(kde_mimedir)
  631. AC_SUBST(kde_wallpaperdir)
  632. AC_SUBST(kde_bindir)
  633. dnl X Desktop Group standards
  634. AC_SUBST(xdg_appsdir)
  635. AC_SUBST(xdg_menudir)
  636. AC_SUBST(xdg_directorydir)
  637. dnl for KDE 2
  638. AC_SUBST(kde_templatesdir)
  639. AC_SUBST(kde_servicesdir)
  640. AC_SUBST(kde_servicetypesdir)
  641. AC_SUBST(kde_moduledir)
  642. AC_SUBST(tdeinitdir, '$(kde_moduledir)')
  643. AC_SUBST(kde_styledir)
  644. AC_SUBST(kde_widgetdir)
  645. if test "$kde_qtver" = 1; then
  646. kde_minidir="$kde_icondir/mini"
  647. else
  648. # for KDE 1 - this breaks KDE2 apps using minidir, but
  649. # that's the plan ;-/
  650. kde_minidir="/dev/null"
  651. fi
  652. dnl AC_SUBST(kde_minidir)
  653. dnl AC_SUBST(kde_cgidir)
  654. dnl AC_SUBST(kde_toolbardir)
  655. ])
  656. AC_DEFUN([KDE_MISC_TESTS],
  657. [
  658. dnl Checks for libraries.
  659. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  660. AC_SUBST(LIBUTIL)
  661. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  662. AC_SUBST(LIBCOMPAT)
  663. kde_have_crypt=
  664. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  665. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  666. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  667. You should install libcrypt from another source or configure with PAM
  668. support])
  669. kde_have_crypt=no
  670. ]))
  671. AC_SUBST(LIBCRYPT)
  672. if test $kde_have_crypt = yes; then
  673. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  674. fi
  675. AC_CHECK_SOCKLEN_T
  676. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  677. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  678. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  679. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  680. fi
  681. AC_CHECK_FUNC(inet_ntoa)
  682. if test $ac_cv_func_inet_ntoa = no; then
  683. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  684. fi
  685. AC_CHECK_FUNC(connect)
  686. if test $ac_cv_func_connect = no; then
  687. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  688. $X_EXTRA_LIBS)
  689. fi
  690. AC_CHECK_FUNC(remove)
  691. if test $ac_cv_func_remove = no; then
  692. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  693. fi
  694. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  695. AC_CHECK_FUNC(shmat, ,
  696. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  697. # more headers that need to be explicitly included on darwin
  698. AC_CHECK_HEADERS(sys/types.h stdint.h)
  699. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  700. AC_CHECK_HEADERS(sys/bitypes.h)
  701. # darwin requires a poll emulation library
  702. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  703. # for some image handling on Mac OS X
  704. AC_CHECK_HEADERS(Carbon/Carbon.h)
  705. # CoreAudio framework
  706. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  707. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  708. FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
  709. ])
  710. AC_CHECK_RES_INIT
  711. AC_SUBST(LIB_POLL)
  712. AC_SUBST(FRAMEWORK_COREAUDIO)
  713. LIBSOCKET="$X_EXTRA_LIBS"
  714. AC_SUBST(LIBSOCKET)
  715. AC_SUBST(X_EXTRA_LIBS)
  716. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  717. AC_SUBST(LIBUCB)
  718. case $host in dnl this *is* LynxOS specific
  719. *-*-lynxos* )
  720. AC_MSG_CHECKING([LynxOS header file wrappers])
  721. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  722. AC_MSG_RESULT(disabled)
  723. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  724. ;;
  725. esac
  726. KDE_CHECK_TYPES
  727. KDE_CHECK_LIBDL
  728. KDE_CHECK_STRLCPY
  729. KDE_CHECK_PIE_SUPPORT
  730. # darwin needs this to initialize the environment
  731. AC_CHECK_HEADERS(crt_externs.h)
  732. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  733. AH_VERBATIM(_DARWIN_ENVIRON,
  734. [
  735. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  736. # include <sys/time.h>
  737. # include <crt_externs.h>
  738. # define environ (*_NSGetEnviron())
  739. #endif
  740. ])
  741. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  742. [
  743. /*
  744. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  745. * that defines bzero.
  746. */
  747. #if defined(_AIX)
  748. #include <strings.h>
  749. #endif
  750. ])
  751. AC_CHECK_FUNCS([vsnprintf snprintf])
  752. AH_VERBATIM(_TRU64,[
  753. /*
  754. * On HP-UX, the declaration of vsnprintf() is needed every time !
  755. */
  756. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  757. #if __STDC__
  758. #include <stdarg.h>
  759. #include <stdlib.h>
  760. #else
  761. #include <varargs.h>
  762. #endif
  763. #ifdef __cplusplus
  764. extern "C"
  765. #endif
  766. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  767. #ifdef __cplusplus
  768. extern "C"
  769. #endif
  770. int snprintf(char *str, size_t n, char const *fmt, ...);
  771. #endif
  772. ])
  773. ])
  774. dnl ------------------------------------------------------------------------
  775. dnl Find the header files and libraries for X-Windows. Extended the
  776. dnl macro AC_PATH_X
  777. dnl ------------------------------------------------------------------------
  778. dnl
  779. AC_DEFUN([K_PATH_X],
  780. [
  781. AC_REQUIRE([KDE_MISC_TESTS])dnl
  782. AC_REQUIRE([KDE_CHECK_LIB64])
  783. AC_ARG_ENABLE(
  784. embedded,
  785. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  786. kde_use_qt_emb=$enableval,
  787. kde_use_qt_emb=no
  788. )
  789. AC_ARG_ENABLE(
  790. qtopia,
  791. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  792. kde_use_qt_emb_palm=$enableval,
  793. kde_use_qt_emb_palm=no
  794. )
  795. AC_ARG_ENABLE(
  796. mac,
  797. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  798. kde_use_qt_mac=$enableval,
  799. kde_use_qt_mac=no
  800. )
  801. # used to disable x11-specific stuff on special platforms
  802. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  803. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  804. AC_MSG_CHECKING(for X)
  805. AC_CACHE_VAL(kde_cv_have_x,
  806. [# One or both of the vars are not set, and there is no cached value.
  807. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  808. kde_x_includes=NO
  809. else
  810. kde_x_includes=$x_includes
  811. fi
  812. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  813. kde_x_libraries=NO
  814. else
  815. kde_x_libraries=$x_libraries
  816. fi
  817. # below we use the standard autoconf calls
  818. ac_x_libraries=$kde_x_libraries
  819. ac_x_includes=$kde_x_includes
  820. KDE_PATH_X_DIRECT
  821. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  822. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  823. dnl location. The correct location is /usr/lib32 or an undefined value
  824. dnl (the linker is smart enough to pick the correct default library).
  825. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  826. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  827. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  828. dnl x_includes should be left alone.
  829. case "$host" in
  830. mips-sgi-irix6*)
  831. ;;
  832. *-*-solaris*)
  833. ;;
  834. *)
  835. _AC_PATH_X_XMKMF
  836. if test -z "$ac_x_includes"; then
  837. ac_x_includes="."
  838. fi
  839. if test -z "$ac_x_libraries"; then
  840. ac_x_libraries="/usr/lib${tdelibsuff}"
  841. fi
  842. esac
  843. #from now on we use our own again
  844. # when the user already gave --x-includes, we ignore
  845. # what the standard autoconf macros told us.
  846. if test "$kde_x_includes" = NO; then
  847. kde_x_includes=$ac_x_includes
  848. fi
  849. # for --x-libraries too
  850. if test "$kde_x_libraries" = NO; then
  851. kde_x_libraries=$ac_x_libraries
  852. fi
  853. if test "$kde_x_includes" = NO; then
  854. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  855. fi
  856. if test "$kde_x_libraries" = NO; then
  857. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  858. fi
  859. # Record where we found X for the cache.
  860. kde_cv_have_x="have_x=yes \
  861. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  862. ])dnl
  863. eval "$kde_cv_have_x"
  864. if test "$have_x" != yes; then
  865. AC_MSG_RESULT($have_x)
  866. no_x=yes
  867. else
  868. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  869. fi
  870. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  871. X_INCLUDES=""
  872. x_includes="."; dnl better than nothing :-
  873. else
  874. x_includes=$kde_x_includes
  875. X_INCLUDES="-I$x_includes"
  876. fi
  877. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
  878. X_LDFLAGS=""
  879. x_libraries="/usr/lib"; dnl better than nothing :-
  880. else
  881. x_libraries=$kde_x_libraries
  882. X_LDFLAGS="-L$x_libraries"
  883. fi
  884. all_includes="$X_INCLUDES"
  885. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  886. # Check for libraries that X11R6 Xt/Xaw programs need.
  887. ac_save_LDFLAGS="$LDFLAGS"
  888. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  889. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  890. # check for ICE first), but we must link in the order -lSM -lICE or
  891. # we get undefined symbols. So assume we have SM if we have ICE.
  892. # These have to be linked with before -lX11, unlike the other
  893. # libraries we check for below, so use a different variable.
  894. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  895. AC_CHECK_LIB(ICE, IceConnectionNumber,
  896. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  897. LDFLAGS="$ac_save_LDFLAGS"
  898. LIB_X11='-lX11 $(LIBSOCKET)'
  899. AC_MSG_CHECKING(for libXext)
  900. AC_CACHE_VAL(kde_cv_have_libXext,
  901. [
  902. kde_ldflags_safe="$LDFLAGS"
  903. kde_libs_safe="$LIBS"
  904. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  905. LIBS="-lXext -lX11 $LIBSOCKET"
  906. AC_TRY_LINK([
  907. #include <stdio.h>
  908. #ifdef STDC_HEADERS
  909. # include <stdlib.h>
  910. #endif
  911. ],
  912. [
  913. printf("hello Xext\n");
  914. ],
  915. kde_cv_have_libXext=yes,
  916. kde_cv_have_libXext=no
  917. )
  918. LDFLAGS=$kde_ldflags_safe
  919. LIBS=$kde_libs_safe
  920. ])
  921. AC_MSG_RESULT($kde_cv_have_libXext)
  922. if test "$kde_cv_have_libXext" = "no"; then
  923. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  924. can't find it itself, we stop here assuming that make wouldn't find
  925. them either.])
  926. fi
  927. LIB_XEXT="-lXext"
  928. QTE_NORTTI=""
  929. elif test "$kde_use_qt_emb" = "yes"; then
  930. dnl We're using QT Embedded
  931. CPPFLAGS=-DQWS
  932. CXXFLAGS="$CXXFLAGS -fno-rtti"
  933. QTE_NORTTI="-fno-rtti -DQWS"
  934. X_PRE_LIBS=""
  935. LIB_X11=""
  936. LIB_XEXT=""
  937. LIB_XRENDER=""
  938. LIBSM=""
  939. X_INCLUDES=""
  940. X_LDFLAGS=""
  941. x_includes=""
  942. x_libraries=""
  943. elif test "$kde_use_qt_mac" = "yes"; then
  944. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  945. dnl be included to get the information) --Sam
  946. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  947. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  948. X_PRE_LIBS=""
  949. LIB_X11=""
  950. LIB_XEXT=""
  951. LIB_XRENDER=""
  952. LIBSM=""
  953. X_INCLUDES=""
  954. X_LDFLAGS=""
  955. x_includes=""
  956. x_libraries=""
  957. fi
  958. AC_SUBST(X_PRE_LIBS)
  959. AC_SUBST(LIB_X11)
  960. AC_SUBST(LIB_XRENDER)
  961. AC_SUBST(LIBSM)
  962. AC_SUBST(X_INCLUDES)
  963. AC_SUBST(X_LDFLAGS)
  964. AC_SUBST(x_includes)
  965. AC_SUBST(x_libraries)
  966. AC_SUBST(QTE_NORTTI)
  967. AC_SUBST(LIB_XEXT)
  968. ])
  969. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  970. [
  971. AC_REQUIRE([KDE_USE_TQT])
  972. cat > conftest.$ac_ext <<EOF
  973. #include "confdefs.h"
  974. #include <qglobal.h>
  975. #include <qapplication.h>
  976. EOF
  977. if test "$kde_qtver" = "2"; then
  978. cat >> conftest.$ac_ext <<EOF
  979. #include <qevent.h>
  980. #include <qstring.h>
  981. #include <qstyle.h>
  982. EOF
  983. if test $kde_qtsubver -gt 0; then
  984. cat >> conftest.$ac_ext <<EOF
  985. #if TQT_VERSION < 210
  986. #error 1
  987. #endif
  988. EOF
  989. fi
  990. fi
  991. if test "$kde_qtver" = "3"; then
  992. cat >> conftest.$ac_ext <<EOF
  993. #include <qcursor.h>
  994. #include <qstylefactory.h>
  995. #include <private/qucomextra_p.h>
  996. EOF
  997. fi
  998. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  999. cat >> conftest.$ac_ext <<EOF
  1000. #error 1
  1001. #endif
  1002. int main() {
  1003. EOF
  1004. if test "$kde_qtver" = "2"; then
  1005. cat >> conftest.$ac_ext <<EOF
  1006. QStringList *t = new QStringList();
  1007. Q_UNUSED(t);
  1008. EOF
  1009. if test $kde_qtsubver -gt 0; then
  1010. cat >> conftest.$ac_ext <<EOF
  1011. QString s;
  1012. s.setLatin1("Elvis is alive", 14);
  1013. EOF
  1014. fi
  1015. fi
  1016. if test "$kde_qtver" = "3"; then
  1017. cat >> conftest.$ac_ext <<EOF
  1018. (void)QStyleFactory::create(QString::null);
  1019. QCursor c(Qt::WhatsThisCursor);
  1020. EOF
  1021. fi
  1022. cat >> conftest.$ac_ext <<EOF
  1023. return 0;
  1024. }
  1025. EOF
  1026. ])
  1027. AC_DEFUN([KDE_USE_TQT],
  1028. [
  1029. if test -z "$1"; then
  1030. # Current default Qt version: 3.3
  1031. kde_qtver=3
  1032. kde_qtsubver=3
  1033. else
  1034. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1035. # following is the check if subversion isnt found in passed argument
  1036. if test "$kde_qtsubver" = "$1"; then
  1037. kde_qtsubver=1
  1038. fi
  1039. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1040. if test "$kde_qtver" = "1"; then
  1041. kde_qtsubver=42
  1042. fi
  1043. fi
  1044. if test -z "$2"; then
  1045. if test "$kde_qtver" = "2"; then
  1046. if test $kde_qtsubver -gt 0; then
  1047. kde_qt_minversion=">= Qt 2.2.2"
  1048. else
  1049. kde_qt_minversion=">= Qt 2.0.2"
  1050. fi
  1051. fi
  1052. if test "$kde_qtver" = "3"; then
  1053. if test $kde_qtsubver -gt 0; then
  1054. if test $kde_qtsubver -gt 1; then
  1055. if test $kde_qtsubver -gt 2; then
  1056. kde_qt_minversion=">= Qt 3.3 and < 4.0"
  1057. else
  1058. kde_qt_minversion=">= Qt 3.2 and < 4.0"
  1059. fi
  1060. else
  1061. kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
  1062. fi
  1063. else
  1064. kde_qt_minversion=">= Qt 3.0 and < 4.0"
  1065. fi
  1066. fi
  1067. if test "$kde_qtver" = "1"; then
  1068. kde_qt_minversion=">= 1.42 and < 2.0"
  1069. fi
  1070. else
  1071. kde_qt_minversion="$2"
  1072. fi
  1073. if test -z "$3"; then
  1074. if test $kde_qtver = 3; then
  1075. if test $kde_qtsubver -gt 0; then
  1076. kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
  1077. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1078. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1079. else
  1080. kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
  1081. fi
  1082. fi
  1083. if test $kde_qtver = 2; then
  1084. if test $kde_qtsubver -gt 0; then
  1085. kde_qt_verstring="TQT_VERSION >= 222"
  1086. else
  1087. kde_qt_verstring="TQT_VERSION >= 200"
  1088. fi
  1089. fi
  1090. if test $kde_qtver = 1; then
  1091. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1092. fi
  1093. else
  1094. kde_qt_verstring="$3"
  1095. fi
  1096. if test $kde_qtver = 4; then
  1097. kde_qt_dirs="$TQTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
  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 it is 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. [
  2216. #ifdef __cplusplus
  2217. extern "C" {
  2218. #endif
  2219. void jpeg_CreateDecompress();
  2220. #ifdef __cplusplus
  2221. }
  2222. #endif
  2223. ],
  2224. [jpeg_CreateDecompress();],
  2225. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2226. eval "ac_cv_lib_jpeg_$1=no")
  2227. LIBS="$ac_save_LIBS"
  2228. CFLAGS="$ac_save_CFLAGS"
  2229. ])
  2230. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2231. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2232. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2233. else
  2234. AC_MSG_RESULT(no)
  2235. $3
  2236. fi
  2237. ])
  2238. AC_DEFUN([AC_FIND_JPEG],
  2239. [
  2240. dnl first look for libraries
  2241. KDE_FIND_JPEG_HELPER(6b, 6b,
  2242. KDE_FIND_JPEG_HELPER(normal, [],
  2243. [
  2244. LIBJPEG=
  2245. ]
  2246. )
  2247. )
  2248. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2249. dnl requires system dependent includes loaded before it)
  2250. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2251. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2252. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2253. dnl if headers _and_ libraries are missing, this is no error, and we
  2254. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2255. dnl if only one is missing, it means a configuration error, but we still
  2256. dnl only warn
  2257. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2258. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2259. else
  2260. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2261. AC_MSG_WARN([
  2262. There is an installation error in jpeg support. You seem to have only one
  2263. of either the headers _or_ the libraries installed. You may need to either
  2264. provide correct --with-extra-... options, or the development package of
  2265. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2266. Disabling JPEG support.
  2267. ])
  2268. else
  2269. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2270. fi
  2271. jpeg_incdir=
  2272. LIBJPEG=
  2273. fi
  2274. AC_SUBST(LIBJPEG)
  2275. AH_VERBATIM(_AC_CHECK_JPEG,
  2276. [/*
  2277. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2278. * headers and I'm too lazy to write a configure test as long as only
  2279. * unixware is related
  2280. */
  2281. #ifdef _UNIXWARE
  2282. #define HAVE_BOOLEAN
  2283. #endif
  2284. ])
  2285. ])
  2286. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2287. [
  2288. if test -n "$LIBJPEG"; then
  2289. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2290. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2291. [
  2292. AC_LANG_SAVE
  2293. AC_LANG_CPLUSPLUS
  2294. ac_save_LIBS="$LIBS"
  2295. LIBS="$all_libraries $USER_LDFLAGS $LIBTQT"
  2296. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2297. ac_save_CXXFLAGS="$CXXFLAGS"
  2298. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2299. AC_TRY_LINK(
  2300. [#include <qapplication.h>],
  2301. [
  2302. int argc;
  2303. char** argv;
  2304. QApplication app(argc, argv);],
  2305. eval "kde_cv_qt_jpeg=no",
  2306. eval "kde_cv_qt_jpeg=yes")
  2307. LIBS="$ac_save_LIBS"
  2308. CXXFLAGS="$ac_save_CXXFLAGS"
  2309. AC_LANG_RESTORE
  2310. fi
  2311. ])
  2312. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2313. AC_MSG_RESULT(yes)
  2314. LIBJPEG_QT='$(LIBJPEG)'
  2315. else
  2316. AC_MSG_RESULT(no)
  2317. LIBJPEG_QT=
  2318. fi
  2319. ])
  2320. AC_DEFUN([AC_FIND_ZLIB],
  2321. [
  2322. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2323. AC_MSG_CHECKING([for libz])
  2324. AC_CACHE_VAL(ac_cv_lib_z,
  2325. [
  2326. kde_save_LIBS="$LIBS"
  2327. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2328. kde_save_CFLAGS="$CFLAGS"
  2329. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2330. AC_TRY_LINK(dnl
  2331. [
  2332. #include<zlib.h>
  2333. #include<string.h>
  2334. ],
  2335. [
  2336. char buf[42];
  2337. gzFile f = (gzFile) 0;
  2338. /* this would segfault.. but we only link, don't run */
  2339. (void) gzgets(f, buf, sizeof(buf));
  2340. return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
  2341. ],
  2342. eval "ac_cv_lib_z='-lz'",
  2343. eval "ac_cv_lib_z=no")
  2344. LIBS="$kde_save_LIBS"
  2345. CFLAGS="$kde_save_CFLAGS"
  2346. ])dnl
  2347. if test ! "$ac_cv_lib_z" = no; then
  2348. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2349. LIBZ="$ac_cv_lib_z"
  2350. AC_MSG_RESULT($ac_cv_lib_z)
  2351. else
  2352. AC_MSG_ERROR(not found.
  2353. Possibly configure picks up an outdated version
  2354. installed by XFree86. Remove it from your system.
  2355. Check your installation and look into config.log)
  2356. LIBZ=""
  2357. fi
  2358. AC_SUBST(LIBZ)
  2359. ])
  2360. AC_DEFUN([KDE_TRY_TIFFLIB],
  2361. [
  2362. AC_MSG_CHECKING([for libtiff $1])
  2363. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2364. [
  2365. AC_LANG_SAVE
  2366. AC_LANG_CPLUSPLUS
  2367. kde_save_LIBS="$LIBS"
  2368. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2369. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2370. else
  2371. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2372. fi
  2373. kde_save_CXXFLAGS="$CXXFLAGS"
  2374. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2375. AC_TRY_LINK(dnl
  2376. [
  2377. #include<tiffio.h>
  2378. ],
  2379. [return (TIFFOpen( "", "r") == 0); ],
  2380. [
  2381. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2382. ], [
  2383. kde_cv_libtiff_$1=no
  2384. ])
  2385. LIBS="$kde_save_LIBS"
  2386. CXXFLAGS="$kde_save_CXXFLAGS"
  2387. AC_LANG_RESTORE
  2388. ])
  2389. if test "$kde_cv_libtiff_$1" = "no"; then
  2390. AC_MSG_RESULT(no)
  2391. LIBTIFF=""
  2392. $3
  2393. else
  2394. LIBTIFF="$kde_cv_libtiff_$1"
  2395. AC_MSG_RESULT(yes)
  2396. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2397. $2
  2398. fi
  2399. ])
  2400. AC_DEFUN([AC_FIND_TIFF],
  2401. [
  2402. AC_REQUIRE([K_PATH_X])
  2403. AC_REQUIRE([AC_FIND_ZLIB])
  2404. AC_REQUIRE([AC_FIND_JPEG])
  2405. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2406. KDE_TRY_TIFFLIB(tiff, [],
  2407. KDE_TRY_TIFFLIB(tiff34))
  2408. AC_SUBST(LIBTIFF)
  2409. ])
  2410. AC_DEFUN([KDE_FIND_LIBEXR],
  2411. [
  2412. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2413. AC_REQUIRE([AC_FIND_ZLIB])
  2414. AC_CACHE_VAL(ac_cv_libexr,
  2415. [
  2416. if test -z "$PKG_CONFIG"; then
  2417. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2418. fi
  2419. AC_MSG_CHECKING([for OpenEXR libraries])
  2420. if test "$PKG_CONFIG" = "no" ; then
  2421. AC_MSG_RESULT(no)
  2422. echo "*** The pkg-config script could not be found. Make sure it is"
  2423. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2424. echo "*** to the full path to pkg-config."
  2425. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2426. else
  2427. if !(`$PKG_CONFIG --exists OpenEXR`) ; then
  2428. AC_MSG_RESULT(no)
  2429. EXRSTATUS=no
  2430. else
  2431. if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
  2432. AC_MSG_RESULT(no)
  2433. EXRSTATUS=old
  2434. else
  2435. kde_save_LIBS="$LIBS"
  2436. LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
  2437. AC_LANG_SAVE
  2438. AC_LANG_CPLUSPLUS
  2439. kde_save_CXXFLAGS="$CXXFLAGS"
  2440. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2441. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2442. AC_TRY_LINK(dnl
  2443. [
  2444. #include <ImfRgbaFile.h>
  2445. ],
  2446. [
  2447. using namespace Imf;
  2448. RgbaInputFile file ("dummy");
  2449. return 0;
  2450. ],
  2451. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2452. eval "ac_cv_libexr=no"
  2453. )
  2454. LIBS="$kde_save_LIBS"
  2455. CXXFLAGS="$kde_save_CXXFLAGS"
  2456. AC_LANG_RESTORE
  2457. ])dnl
  2458. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2459. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2460. LIB_EXR="$ac_cv_libexr"
  2461. AC_MSG_RESULT($ac_cv_libexr)
  2462. else
  2463. AC_MSG_RESULT(no)
  2464. LIB_EXR=""
  2465. fi
  2466. fi
  2467. fi
  2468. fi
  2469. AC_SUBST(LIB_EXR)
  2470. AC_SUBST(EXR_FLAGS)
  2471. ])
  2472. AC_DEFUN([AC_FIND_PNG],
  2473. [
  2474. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2475. AC_REQUIRE([AC_FIND_ZLIB])
  2476. AC_MSG_CHECKING([for libpng])
  2477. AC_CACHE_VAL(ac_cv_lib_png,
  2478. [
  2479. kde_save_LIBS="$LIBS"
  2480. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2481. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2482. else
  2483. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2484. fi
  2485. kde_save_CFLAGS="$CFLAGS"
  2486. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2487. AC_TRY_LINK(dnl
  2488. [
  2489. #include<png.h>
  2490. ],
  2491. [
  2492. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2493. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2494. return( png_ptr != 0 );
  2495. ],
  2496. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2497. eval "ac_cv_lib_png=no"
  2498. )
  2499. LIBS="$kde_save_LIBS"
  2500. CFLAGS="$kde_save_CFLAGS"
  2501. ])dnl
  2502. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2503. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2504. LIBPNG="$ac_cv_lib_png"
  2505. AC_SUBST(LIBPNG)
  2506. AC_MSG_RESULT($ac_cv_lib_png)
  2507. else
  2508. AC_MSG_RESULT(no)
  2509. LIBPNG=""
  2510. AC_SUBST(LIBPNG)
  2511. fi
  2512. ])
  2513. AC_DEFUN([AC_FIND_JASPER],
  2514. [
  2515. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2516. AC_REQUIRE([AC_FIND_JPEG])
  2517. AC_MSG_CHECKING([for jasper])
  2518. AC_CACHE_VAL(ac_cv_jasper,
  2519. [
  2520. kde_save_LIBS="$LIBS"
  2521. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2522. kde_save_CFLAGS="$CFLAGS"
  2523. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2524. AC_TRY_LINK(dnl
  2525. [
  2526. #include<jasper/jasper.h>
  2527. ],
  2528. [
  2529. return( jas_init() );
  2530. ],
  2531. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2532. eval "ac_cv_jasper=no"
  2533. )
  2534. LIBS="$kde_save_LIBS"
  2535. CFLAGS="$kde_save_CFLAGS"
  2536. ])dnl
  2537. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2538. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2539. LIB_JASPER="$ac_cv_jasper"
  2540. AC_MSG_RESULT($ac_cv_jasper)
  2541. else
  2542. AC_MSG_RESULT(no)
  2543. LIB_JASPER=""
  2544. fi
  2545. AC_SUBST(LIB_JASPER)
  2546. ])
  2547. AC_DEFUN([AC_CHECK_BOOL],
  2548. [
  2549. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2550. ])
  2551. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2552. [
  2553. AC_MSG_CHECKING([whether $CXX supports -$1])
  2554. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2555. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2556. [
  2557. AC_LANG_SAVE
  2558. AC_LANG_CPLUSPLUS
  2559. save_CXXFLAGS="$CXXFLAGS"
  2560. CXXFLAGS="$CXXFLAGS -$1"
  2561. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2562. CXXFLAGS="$save_CXXFLAGS"
  2563. AC_LANG_RESTORE
  2564. ])
  2565. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2566. AC_MSG_RESULT(yes)
  2567. :
  2568. $2
  2569. else
  2570. AC_MSG_RESULT(no)
  2571. :
  2572. $3
  2573. fi
  2574. ])
  2575. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2576. [
  2577. AC_MSG_CHECKING([whether $CC supports -$1])
  2578. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2579. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2580. [
  2581. AC_LANG_SAVE
  2582. AC_LANG_C
  2583. save_CFLAGS="$CFLAGS"
  2584. CFLAGS="$CFLAGS -$1"
  2585. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2586. CFLAGS="$save_CFLAGS"
  2587. AC_LANG_RESTORE
  2588. ])
  2589. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2590. AC_MSG_RESULT(yes)
  2591. :
  2592. $2
  2593. else
  2594. AC_MSG_RESULT(no)
  2595. :
  2596. $3
  2597. fi
  2598. ])
  2599. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2600. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2601. dnl it's all white-space separated
  2602. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2603. [ __val=$$1
  2604. __forbid=" $2 "
  2605. if test -n "$__val"; then
  2606. __new=""
  2607. ac_save_IFS=$IFS
  2608. IFS=" "
  2609. for i in $__val; do
  2610. case "$__forbid" in
  2611. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2612. *) # Careful to not add spaces, where there were none, because otherwise
  2613. # libtool gets confused, if we change e.g. CXX
  2614. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2615. esac
  2616. done
  2617. IFS=$ac_save_IFS
  2618. $1=$__new
  2619. fi
  2620. ])
  2621. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2622. [
  2623. AC_MSG_CHECKING([whether $CC is blacklisted])
  2624. dnl In theory we have tu run this test against $CC and $CXX
  2625. dnl in C and in C++ mode, because its perfectly legal for
  2626. dnl the user to mix compiler versions, since C has a defined
  2627. dnl ABI.
  2628. dnl
  2629. dnl For now, we assume the user is not on crack.
  2630. AC_TRY_COMPILE([
  2631. #ifdef __GNUC__
  2632. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  2633. choke me
  2634. #endif
  2635. #endif
  2636. ], ,
  2637. kde_bad_compiler=no,
  2638. kde_bad_compiler=yes
  2639. )
  2640. AC_MSG_RESULT($kde_bad_compiler)
  2641. if test "$kde_bad_compiler" = "yes"; then
  2642. AC_MSG_ERROR([
  2643. This particular compiler version is blacklisted because it
  2644. is known to miscompile KDE. Please use a newer version, or
  2645. if that is not yet available, choose an older version.
  2646. Please do not report a bug or bother us reporting this
  2647. configure error. We know about it, and we introduced
  2648. it by intention to avoid untraceable bugs or crashes in KDE.
  2649. ])
  2650. fi
  2651. ])
  2652. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  2653. [
  2654. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  2655. kde_cv_opt_noinline_match,
  2656. [
  2657. kde_cv_opt_noinline_match=irrelevant
  2658. dnl if we don't use both -O2 and -fno-inline, this check is moot
  2659. if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
  2660. && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
  2661. ac_cflags_save="$CFLAGS"
  2662. CFLAGS="$CFLAGS -D_USE_GNU"
  2663. AC_TRY_LINK([
  2664. #include <string.h>
  2665. ], [ const char *pt, *et;
  2666. et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
  2667. ],
  2668. kde_cv_opt_noinline_match=yes,
  2669. kde_cv_opt_noinline_match=no
  2670. )
  2671. CFLAGS="$ac_cflags_save"
  2672. fi
  2673. ])
  2674. ])
  2675. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2676. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2677. [dnl
  2678. if test "x$kde_use_qt_emb" != "xyes"; then
  2679. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2680. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2681. else
  2682. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2683. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2684. fi
  2685. ])
  2686. AC_DEFUN([AC_CHECK_COMPILERS],
  2687. [
  2688. AC_ARG_ENABLE(debug,
  2689. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2690. [
  2691. case $enableval in
  2692. yes)
  2693. kde_use_debug_code="yes"
  2694. kde_use_debug_define=no
  2695. ;;
  2696. full)
  2697. kde_use_debug_code="full"
  2698. kde_use_debug_define=no
  2699. ;;
  2700. *)
  2701. kde_use_debug_code="no"
  2702. kde_use_debug_define=yes
  2703. ;;
  2704. esac
  2705. ],
  2706. [kde_use_debug_code="no"
  2707. kde_use_debug_define=no
  2708. ])
  2709. dnl Just for configure --help
  2710. AC_ARG_ENABLE(dummyoption,
  2711. AC_HELP_STRING([--disable-debug],
  2712. [disables debug output and debug symbols [default=no]]),
  2713. [],[])
  2714. AC_ARG_ENABLE(strict,
  2715. AC_HELP_STRING([--enable-strict],
  2716. [compiles with strict compiler options (may not work!)]),
  2717. [
  2718. if test $enableval = "no"; then
  2719. kde_use_strict_options="no"
  2720. else
  2721. kde_use_strict_options="yes"
  2722. fi
  2723. ], [kde_use_strict_options="no"])
  2724. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2725. [
  2726. if test $enableval = "no"; then
  2727. kde_use_warnings="no"
  2728. else
  2729. kde_use_warnings="yes"
  2730. fi
  2731. ], [kde_use_warnings="yes"])
  2732. dnl enable warnings for debug build
  2733. if test "$kde_use_debug_code" != "no"; then
  2734. kde_use_warnings=yes
  2735. fi
  2736. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2737. [kde_use_profiling=$enableval],
  2738. [kde_use_profiling="no"]
  2739. )
  2740. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2741. CFLAGS=" $CFLAGS"
  2742. AC_PROG_CC
  2743. AC_PROG_CPP
  2744. if test "$GCC" = "yes"; then
  2745. if test "$kde_use_debug_code" != "no"; then
  2746. if test $kde_use_debug_code = "full"; then
  2747. CFLAGS="-g3 -fno-inline $CFLAGS"
  2748. else
  2749. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  2750. fi
  2751. else
  2752. CFLAGS="-O2 $CFLAGS"
  2753. fi
  2754. fi
  2755. if test "$kde_use_debug_define" = "yes"; then
  2756. CFLAGS="-DNDEBUG $CFLAGS"
  2757. fi
  2758. case "$host" in
  2759. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2760. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2761. esac
  2762. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2763. LDFLAGS=""
  2764. fi
  2765. CXXFLAGS=" $CXXFLAGS"
  2766. AC_PROG_CXX
  2767. KDE_CHECK_FOR_BAD_COMPILER
  2768. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2769. if test "$kde_use_debug_code" != "no"; then
  2770. if test "$CXX" = "KCC"; then
  2771. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2772. else
  2773. if test "$kde_use_debug_code" = "full"; then
  2774. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2775. else
  2776. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  2777. fi
  2778. fi
  2779. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2780. dnl convenience compiler flags
  2781. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2782. AC_SUBST(WOVERLOADED_VIRTUAL)
  2783. else
  2784. if test "$CXX" = "KCC"; then
  2785. CXXFLAGS="+K3 $CXXFLAGS"
  2786. else
  2787. CXXFLAGS="-O2 $CXXFLAGS"
  2788. fi
  2789. fi
  2790. fi
  2791. if test "$kde_use_debug_define" = "yes"; then
  2792. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2793. fi
  2794. if test "$kde_use_profiling" = "yes"; then
  2795. KDE_CHECK_COMPILER_FLAG(pg,
  2796. [
  2797. CFLAGS="-pg $CFLAGS"
  2798. CXXFLAGS="-pg $CXXFLAGS"
  2799. ])
  2800. fi
  2801. if test "$kde_use_warnings" = "yes"; then
  2802. if test "$GCC" = "yes"; then
  2803. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  2804. case $host in
  2805. *-*-linux-gnu)
  2806. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE $CFLAGS"
  2807. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
  2808. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2809. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2810. ;;
  2811. esac
  2812. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2813. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2814. dnl ### FIXME: revert for KDE 4
  2815. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  2816. fi
  2817. fi
  2818. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2819. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2820. fi
  2821. AC_ARG_ENABLE(pch,
  2822. AC_HELP_STRING([--enable-pch],
  2823. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2824. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2825. HAVE_GCC_VISIBILITY=0
  2826. AC_SUBST([HAVE_GCC_VISIBILITY])
  2827. if test "$GXX" = "yes"; then
  2828. gcc_no_reorder_blocks=NO
  2829. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  2830. if test $kde_use_debug_code != "no" && \
  2831. test $kde_use_debug_code != "full" && \
  2832. test "YES" = "$gcc_no_reorder_blocks" ; then
  2833. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  2834. CFLAGS="$CFLAGS -fno-reorder-blocks"
  2835. fi
  2836. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2837. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2838. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2839. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2840. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2841. if test "$kde_use_pch" = "yes"; then
  2842. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2843. echo >conftest.h
  2844. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2845. kde_gcc_supports_pch=yes
  2846. AC_MSG_RESULT(yes)
  2847. else
  2848. kde_gcc_supports_pch=no
  2849. AC_MSG_RESULT(no)
  2850. fi
  2851. if test "$kde_gcc_supports_pch" = "yes"; then
  2852. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2853. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2854. kde_gcc_supports_pch=yes
  2855. AC_MSG_RESULT(yes)
  2856. else
  2857. kde_gcc_supports_pch=no
  2858. AC_MSG_RESULT(no)
  2859. fi
  2860. fi
  2861. rm -f conftest.h conftest.h.gch
  2862. fi
  2863. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  2864. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  2865. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  2866. fi
  2867. fi
  2868. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2869. if test "$CXX" = "KCC"; then
  2870. dnl unfortunately we currently cannot disable exception support in KCC
  2871. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2872. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2873. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2874. if test "$kde_use_pch" = "yes"; then
  2875. dnl TODO: support --pch-dir!
  2876. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2877. dnl the below works (but the dir must exist), but it's
  2878. dnl useless for a whole package.
  2879. dnl The are precompiled headers for each source file, so when compiling
  2880. dnl from scratch, it doesn't make a difference, and they take up
  2881. dnl around ~5Mb _per_ sourcefile.
  2882. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2883. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2884. fi
  2885. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2886. dnl all implementations that are defined inside the class {} declaration.
  2887. dnl because of templates-compatibility with broken gcc compilers, this
  2888. dnl can cause excessive inlining. This flag limits it to a sane level
  2889. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2890. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2891. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2892. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2893. dnl Some source files are shared between multiple executables
  2894. dnl (or libraries) and some of those need template instantiations.
  2895. dnl In that case KCC needs to compile those sources with
  2896. dnl --one_instantiation_per_object. To make it easy for us we compile
  2897. dnl _all_ objects with that flag (--one_per is a shorthand).
  2898. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2899. fi
  2900. AC_SUBST(USE_EXCEPTIONS)
  2901. dnl obsolete macro - provided to keep things going
  2902. USE_RTTI=
  2903. AC_SUBST(USE_RTTI)
  2904. case "$host" in
  2905. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2906. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2907. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2908. *-*-solaris*)
  2909. if test "$GXX" = yes; then
  2910. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2911. if test ! -f $libstdcpp; then
  2912. 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])
  2913. fi
  2914. fi
  2915. ;;
  2916. esac
  2917. AC_VALIDIFY_CXXFLAGS
  2918. AC_PROG_CXXCPP
  2919. if test "$GCC" = yes; then
  2920. NOOPT_CFLAGS=-O0
  2921. fi
  2922. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2923. AC_ARG_ENABLE(coverage,
  2924. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2925. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2926. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2927. ac_coverage_linker="-lgcc"
  2928. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2929. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2930. ac_coverage_linker=""
  2931. else
  2932. AC_MSG_ERROR([coverage with your compiler is not supported])
  2933. fi
  2934. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2935. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2936. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2937. ])
  2938. AC_SUBST(NOOPT_CXXFLAGS)
  2939. AC_SUBST(NOOPT_CFLAGS)
  2940. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2941. KDE_CHECK_NEW_LDFLAGS
  2942. KDE_CHECK_FINAL
  2943. KDE_CHECK_CLOSURE
  2944. KDE_CHECK_NMCHECK
  2945. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2946. ])
  2947. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2948. [
  2949. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2950. [
  2951. AC_LANG_SAVE
  2952. AC_LANG_CPLUSPLUS
  2953. safe_CXXFLAGS=$CXXFLAGS
  2954. safe_LDFLAGS=$LDFLAGS
  2955. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2956. LDFLAGS="$LDFLAGS -shared -fPIC"
  2957. AC_TRY_LINK(
  2958. [
  2959. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2960. #include <string>
  2961. int some_function( void ) __attribute__ ((visibility("default")));
  2962. int some_function( void )
  2963. {
  2964. std::string s("blafasel");
  2965. return 0;
  2966. }
  2967. ], [/* elvis is alive */],
  2968. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  2969. CXXFLAGS=$safe_CXXFLAGS
  2970. LDFLAGS=$safe_LDFLAGS
  2971. AC_LANG_RESTORE
  2972. ]
  2973. )
  2974. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  2975. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  2976. fi
  2977. ]
  2978. )
  2979. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  2980. [
  2981. AC_BEFORE([AC_PATH_TQT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
  2982. AC_MSG_CHECKING([grepping for visibility push/pop in headers])
  2983. if test "x$GXX" = "xyes"; then
  2984. AC_LANG_SAVE
  2985. AC_LANG_CPLUSPLUS
  2986. AC_EGREP_CPP(
  2987. [GCC visibility push],
  2988. [ #include <exception>
  2989. ],
  2990. [
  2991. AC_MSG_RESULT(yes)
  2992. kde_stdc_visibility_patched=yes ],
  2993. [
  2994. AC_MSG_RESULT(no)
  2995. AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
  2996. visibility support. Disabling -fvisibility=hidden])
  2997. kde_stdc_visibility_patched=no ])
  2998. AC_LANG_RESTORE
  2999. kde_have_gcc_visibility=no
  3000. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  3001. [
  3002. kde_have_gcc_visibility=yes
  3003. dnl the whole toolchain is just a mess, gcc is just too buggy
  3004. dnl to handle STL with visibility enabled. Lets reconsider
  3005. dnl when gcc 4.2 is out or when things get fixed in the compiler.
  3006. dnl Contact mueller@kde.org for details.
  3007. AC_ARG_ENABLE(gcc-hidden-visibility,
  3008. AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
  3009. [kde_have_gcc_visibility=$enableval],
  3010. [kde_have_gcc_visibility=no])
  3011. AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
  3012. [
  3013. AC_LANG_SAVE
  3014. AC_LANG_CPLUSPLUS
  3015. safe_CXXFLAGS=$CXXFLAGS
  3016. CXXFLAGS="$CXXFLAGS $all_includes"
  3017. AC_TRY_COMPILE(
  3018. [
  3019. #include <qglobal.h>
  3020. #if Q_EXPORT - 0 != 0
  3021. /* if this compiles, then Q_EXPORT is undefined */
  3022. /* if Q_EXPORT is nonempty, this will break compilation */
  3023. #endif
  3024. ], [/* elvis is alive */],
  3025. kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
  3026. CXXFLAGS=$safe_CXXFLAGS
  3027. AC_LANG_RESTORE
  3028. ]
  3029. )
  3030. if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
  3031. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  3032. KDE_CHECK_VISIBILITY_GCC_BUG
  3033. HAVE_GCC_VISIBILITY=1
  3034. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  3035. fi
  3036. ])
  3037. fi
  3038. ])
  3039. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  3040. [
  3041. [A]M_DEPENDENCIES(CC)
  3042. [A]M_DEPENDENCIES(CXX)
  3043. ])
  3044. dnl just a wrapper to clean up configure.in
  3045. AC_DEFUN([KDE_PROG_LIBTOOL],
  3046. [
  3047. AC_REQUIRE([AC_CHECK_COMPILERS])
  3048. AC_REQUIRE([AC_ENABLE_SHARED])
  3049. AC_REQUIRE([AC_ENABLE_STATIC])
  3050. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  3051. AC_REQUIRE([KDE_CHECK_LIB64])
  3052. AC_OBJEXT
  3053. AC_EXEEXT
  3054. AM_PROG_LIBTOOL
  3055. AC_LIBTOOL_CXX
  3056. LIBTOOL_SHELL="/bin/sh ./libtool"
  3057. # LIBTOOL="$LIBTOOL --silent"
  3058. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  3059. AC_SUBST(KDE_PLUGIN)
  3060. # This hack ensures that libtool creates shared libs for tdeunittest plugins. By default check_LTLIBRARIES makes static libs.
  3061. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
  3062. AC_SUBST(KDE_CHECK_PLUGIN)
  3063. # we patch configure quite some so we better keep that consistent for incremental runs
  3064. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  3065. ])
  3066. AC_DEFUN([KDE_CHECK_LIB64],
  3067. [
  3068. AC_ARG_ENABLE(libsuffix,
  3069. AC_HELP_STRING([--enable-libsuffix],
  3070. [/lib directory suffix (64,32,none,auto[=default])]),
  3071. tdelibsuff=$enableval, tdelibsuff="auto")
  3072. if test "$tdelibsuff" = "auto"; then
  3073. cat > conftest.c << EOF
  3074. #include <stdio.h>
  3075. int main() {
  3076. return 0;
  3077. }
  3078. EOF
  3079. tdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
  3080. s,.*/lib\([[^\/]]*\)/.*,\1,
  3081. p
  3082. }'`
  3083. rm -rf conftest.*
  3084. fi
  3085. if test "$tdelibsuff" = "no" || test "$tdelibsuff" = "none"; then
  3086. tdelibsuff=
  3087. fi
  3088. if test -z "$tdelibsuff"; then
  3089. AC_MSG_RESULT([not using lib directory suffix])
  3090. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  3091. else
  3092. if test "$libdir" = '${exec_prefix}/lib'; then
  3093. libdir="$libdir${tdelibsuff}"
  3094. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  3095. fi
  3096. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${tdelibsuff}"], Suffix for lib directories)
  3097. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  3098. fi
  3099. ])
  3100. AC_DEFUN([KDE_CHECK_TYPES],
  3101. [ AC_CHECK_SIZEOF(int, 4)dnl
  3102. AC_CHECK_SIZEOF(short)dnl
  3103. AC_CHECK_SIZEOF(long, 4)dnl
  3104. AC_CHECK_SIZEOF(char *, 4)dnl
  3105. ])dnl
  3106. dnl Not used - kept for compat only?
  3107. AC_DEFUN([KDE_DO_IT_ALL],
  3108. [
  3109. AC_CANONICAL_SYSTEM
  3110. AC_ARG_PROGRAM
  3111. AM_INIT_AUTOMAKE($1, $2)
  3112. AM_DISABLE_LIBRARIES
  3113. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  3114. AC_CHECK_COMPILERS
  3115. KDE_PROG_LIBTOOL
  3116. AM_KDE_WITH_NLS
  3117. AC_PATH_KDE
  3118. ])
  3119. AC_DEFUN([AC_CHECK_RPATH],
  3120. [
  3121. AC_MSG_CHECKING(for rpath)
  3122. AC_ARG_ENABLE(rpath,
  3123. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  3124. USE_RPATH=$enableval, USE_RPATH=yes)
  3125. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  3126. KDE_RPATH="-R \$(libdir)"
  3127. if test "$kde_libraries" != "$libdir"; then
  3128. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  3129. fi
  3130. if test -n "$qt_libraries"; then
  3131. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  3132. fi
  3133. dnl $x_libraries is set to /usr/lib in case
  3134. if test -n "$X_LDFLAGS"; then
  3135. X_RPATH="-R \$(x_libraries)"
  3136. KDE_RPATH="$KDE_RPATH $X_RPATH"
  3137. fi
  3138. if test -n "$KDE_EXTRA_RPATH"; then
  3139. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  3140. fi
  3141. fi
  3142. AC_SUBST(KDE_EXTRA_RPATH)
  3143. AC_SUBST(KDE_RPATH)
  3144. AC_SUBST(X_RPATH)
  3145. AC_MSG_RESULT($USE_RPATH)
  3146. ])
  3147. dnl Check for the type of the third argument of getsockname
  3148. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3149. [
  3150. AC_MSG_CHECKING(for socklen_t)
  3151. AC_CACHE_VAL(kde_cv_socklen_t,
  3152. [
  3153. AC_LANG_PUSH(C++)
  3154. kde_cv_socklen_t=no
  3155. AC_TRY_COMPILE([
  3156. #include <sys/types.h>
  3157. #include <sys/socket.h>
  3158. ],
  3159. [
  3160. socklen_t len;
  3161. getpeername(0,0,&len);
  3162. ],
  3163. [
  3164. kde_cv_socklen_t=yes
  3165. kde_cv_socklen_t_equiv=socklen_t
  3166. ])
  3167. AC_LANG_POP(C++)
  3168. ])
  3169. AC_MSG_RESULT($kde_cv_socklen_t)
  3170. if test $kde_cv_socklen_t = no; then
  3171. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3172. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3173. [
  3174. kde_cv_socklen_t_equiv=int
  3175. AC_LANG_PUSH(C++)
  3176. for t in int size_t unsigned long "unsigned long"; do
  3177. AC_TRY_COMPILE([
  3178. #include <sys/types.h>
  3179. #include <sys/socket.h>
  3180. ],
  3181. [
  3182. $t len;
  3183. getpeername(0,0,&len);
  3184. ],
  3185. [
  3186. kde_cv_socklen_t_equiv="$t"
  3187. break
  3188. ])
  3189. done
  3190. AC_LANG_POP(C++)
  3191. ])
  3192. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3193. fi
  3194. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3195. [type to use in place of socklen_t if not defined])
  3196. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3197. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3198. ])
  3199. dnl This is a merge of some macros out of the gettext aclocal.m4
  3200. dnl since we don't need anything, I took the things we need
  3201. dnl the copyright for them is:
  3202. dnl >
  3203. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3204. dnl This Makefile.in is free software; the Free Software Foundation
  3205. dnl gives unlimited permission to copy and/or distribute it,
  3206. dnl with or without modifications, as long as this notice is preserved.
  3207. dnl This program is distributed in the hope that it will be useful,
  3208. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3209. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3210. dnl PARTICULAR PURPOSE.
  3211. dnl >
  3212. dnl for this file it is relicensed under LGPL
  3213. AC_DEFUN([AM_KDE_WITH_NLS],
  3214. [
  3215. dnl If we use NLS figure out what method
  3216. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3217. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3218. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3219. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3220. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3221. GMSGFMT=":"
  3222. fi
  3223. MSGFMT=$GMSGFMT
  3224. AC_SUBST(GMSGFMT)
  3225. AC_SUBST(MSGFMT)
  3226. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3227. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3228. dnl Test whether we really found GNU xgettext.
  3229. if test "$XGETTEXT" != ":"; then
  3230. dnl If it is no GNU xgettext we define it as : so that the
  3231. dnl Makefiles still can work.
  3232. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3233. : ;
  3234. else
  3235. AC_MSG_RESULT(
  3236. [found xgettext programs is not GNU xgettext; ignore it])
  3237. XGETTEXT=":"
  3238. fi
  3239. fi
  3240. AC_SUBST(XGETTEXT)
  3241. ])
  3242. # Search path for a program which passes the given test.
  3243. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3244. # serial 1
  3245. # Stephan Kulow: I appended a _KDE against name conflicts
  3246. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3247. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3248. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3249. [# Extract the first word of "$2", so it can be a program name with args.
  3250. set dummy $2; ac_word=[$]2
  3251. AC_MSG_CHECKING([for $ac_word])
  3252. AC_CACHE_VAL(ac_cv_path_$1,
  3253. [case "[$]$1" in
  3254. /*)
  3255. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3256. ;;
  3257. *)
  3258. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3259. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3260. test -z "$ac_dir" && ac_dir=.
  3261. if test -f $ac_dir/$ac_word; then
  3262. if [$3]; then
  3263. ac_cv_path_$1="$ac_dir/$ac_word"
  3264. break
  3265. fi
  3266. fi
  3267. done
  3268. IFS="$ac_save_ifs"
  3269. dnl If no 4th arg is given, leave the cache variable unset,
  3270. dnl so AC_PATH_PROGS will keep looking.
  3271. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3272. ])dnl
  3273. ;;
  3274. esac])dnl
  3275. $1="$ac_cv_path_$1"
  3276. if test -n "[$]$1"; then
  3277. AC_MSG_RESULT([$]$1)
  3278. else
  3279. AC_MSG_RESULT(no)
  3280. fi
  3281. AC_SUBST($1)dnl
  3282. ])
  3283. # Check whether LC_MESSAGES is available in <locale.h>.
  3284. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3285. # serial 1
  3286. AC_DEFUN([AM_LC_MESSAGES],
  3287. [if test $ac_cv_header_locale_h = yes; then
  3288. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3289. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3290. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3291. if test $am_cv_val_LC_MESSAGES = yes; then
  3292. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3293. fi
  3294. fi])
  3295. dnl From Jim Meyering.
  3296. dnl FIXME: migrate into libit.
  3297. AC_DEFUN([AM_FUNC_OBSTACK],
  3298. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3299. [AC_TRY_LINK([#include "obstack.h"],
  3300. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3301. am_cv_func_obstack=yes,
  3302. am_cv_func_obstack=no)])
  3303. if test $am_cv_func_obstack = yes; then
  3304. AC_DEFINE(HAVE_OBSTACK)
  3305. else
  3306. LIBOBJS="$LIBOBJS obstack.o"
  3307. fi
  3308. ])
  3309. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3310. dnl FIXME: Migrate into libit
  3311. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3312. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3313. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3314. am_cv_lib_error_at_line=yes,
  3315. am_cv_lib_error_at_line=no)])
  3316. if test $am_cv_lib_error_at_line = no; then
  3317. LIBOBJS="$LIBOBJS error.o"
  3318. fi
  3319. AC_SUBST(LIBOBJS)dnl
  3320. ])
  3321. # Macro to add for using GNU gettext.
  3322. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3323. # serial 1
  3324. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  3325. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3326. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3327. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3328. AC_REQUIRE([AC_HEADER_STDC])dnl
  3329. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3330. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3331. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3332. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3333. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3334. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3335. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3336. __argz_count __argz_stringify __argz_next])
  3337. AC_MSG_CHECKING(for stpcpy)
  3338. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3339. [
  3340. kde_safe_cxxflags=$CXXFLAGS
  3341. CXXFLAGS="-Werror"
  3342. AC_LANG_SAVE
  3343. AC_LANG_CPLUSPLUS
  3344. AC_TRY_COMPILE([
  3345. #include <string.h>
  3346. ],
  3347. [
  3348. char buffer[200];
  3349. stpcpy(buffer, buffer);
  3350. ],
  3351. kde_cv_func_stpcpy=yes,
  3352. kde_cv_func_stpcpy=no)
  3353. AC_LANG_RESTORE
  3354. CXXFLAGS=$kde_safe_cxxflags
  3355. ])
  3356. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3357. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3358. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3359. fi
  3360. AM_LC_MESSAGES
  3361. if test "x$CATOBJEXT" != "x"; then
  3362. if test "x$ALL_LINGUAS" = "x"; then
  3363. LINGUAS=
  3364. else
  3365. AC_MSG_CHECKING(for catalogs to be installed)
  3366. NEW_LINGUAS=
  3367. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3368. case "$ALL_LINGUAS" in
  3369. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3370. esac
  3371. done
  3372. LINGUAS=$NEW_LINGUAS
  3373. AC_MSG_RESULT($LINGUAS)
  3374. fi
  3375. dnl Construct list of names of catalog files to be constructed.
  3376. if test -n "$LINGUAS"; then
  3377. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3378. fi
  3379. fi
  3380. ])
  3381. AC_DEFUN([AC_HAVE_XPM],
  3382. [AC_REQUIRE_CPP()dnl
  3383. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3384. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3385. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3386. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3387. xpm_test=$withval, xpm_test="yes")
  3388. if test "x$xpm_test" = xno; then
  3389. ac_cv_have_xpm=no
  3390. else
  3391. AC_MSG_CHECKING(for XPM)
  3392. AC_CACHE_VAL(ac_cv_have_xpm,
  3393. [
  3394. ac_save_ldflags="$LDFLAGS"
  3395. ac_save_cflags="$CFLAGS"
  3396. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  3397. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3398. else
  3399. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3400. fi
  3401. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3402. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3403. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3404. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3405. LDFLAGS="$ac_save_ldflags"
  3406. CFLAGS="$ac_save_cflags"
  3407. ])dnl
  3408. if test "$ac_cv_have_xpm" = no; then
  3409. AC_MSG_RESULT(no)
  3410. XPM_LDFLAGS=""
  3411. XPMINC=""
  3412. $2
  3413. else
  3414. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3415. if test "$XPM_LDFLAGS" = ""; then
  3416. XPMLIB='-lXpm $(LIB_X11)'
  3417. else
  3418. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3419. fi
  3420. if test "$XPM_INCLUDE" = ""; then
  3421. XPMINC=""
  3422. else
  3423. XPMINC="-I$XPM_INCLUDE"
  3424. fi
  3425. AC_MSG_RESULT(yes)
  3426. $1
  3427. fi
  3428. fi
  3429. AC_SUBST(XPMINC)
  3430. AC_SUBST(XPMLIB)
  3431. ])
  3432. AC_DEFUN([AC_HAVE_DPMS],
  3433. [AC_REQUIRE_CPP()dnl
  3434. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3435. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3436. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3437. DPMS_LIB=
  3438. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3439. dpms_test=$withval, dpms_test="yes")
  3440. if test "x$dpms_test" = xno; then
  3441. ac_cv_have_dpms=no
  3442. else
  3443. AC_MSG_CHECKING(for DPMS)
  3444. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3445. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3446. AC_CACHE_VAL(ac_cv_have_dpms,
  3447. [
  3448. if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
  3449. AC_MSG_RESULT(no)
  3450. ac_cv_have_dpms="no"
  3451. else
  3452. ac_save_ldflags="$LDFLAGS"
  3453. ac_save_cflags="$CFLAGS"
  3454. ac_save_libs="$LIBS"
  3455. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3456. LIBS="-lX11 -lXext $LIBSOCKET"
  3457. CFLAGS="$CFLAGS $X_INCLUDES"
  3458. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3459. AC_TRY_LINK([
  3460. #include <X11/Xproto.h>
  3461. #include <X11/X.h>
  3462. #include <X11/Xlib.h>
  3463. #include <X11/extensions/dpms.h>
  3464. int foo_test_dpms()
  3465. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3466. ac_cv_have_dpms="yes", [
  3467. LIBS="-lXdpms $LIBS"
  3468. AC_TRY_LINK([
  3469. #include <X11/Xproto.h>
  3470. #include <X11/X.h>
  3471. #include <X11/Xlib.h>
  3472. #include <X11/extensions/dpms.h>
  3473. int foo_test_dpms()
  3474. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3475. [
  3476. ac_cv_have_dpms="-lXdpms"
  3477. ],ac_cv_have_dpms="no")
  3478. ])
  3479. LDFLAGS="$ac_save_ldflags"
  3480. CFLAGS="$ac_save_cflags"
  3481. LIBS="$ac_save_libs"
  3482. fi
  3483. ])dnl
  3484. if test "$ac_cv_have_dpms" = no; then
  3485. AC_MSG_RESULT(no)
  3486. DPMS_LDFLAGS=""
  3487. DPMSINC=""
  3488. $2
  3489. else
  3490. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3491. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3492. DPMS_LIB="-lXdpms"
  3493. fi
  3494. if test "$DPMS_LDFLAGS" = ""; then
  3495. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3496. else
  3497. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3498. fi
  3499. if test "$DPMS_INCLUDE" = ""; then
  3500. DPMSINC=""
  3501. else
  3502. DPMSINC="-I$DPMS_INCLUDE"
  3503. fi
  3504. AC_MSG_RESULT(yes)
  3505. $1
  3506. fi
  3507. fi
  3508. ac_save_cflags="$CFLAGS"
  3509. CFLAGS="$CFLAGS $X_INCLUDES"
  3510. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3511. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3512. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3513. AC_CHECK_DECL(DPMSCapable,
  3514. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3515. [#include <X11/Xlib.h>
  3516. #include <X11/extensions/dpms.h>])
  3517. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3518. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3519. AC_CHECK_DECL(DPMSInfo,
  3520. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3521. [#include <X11/Xlib.h>
  3522. #include <X11/extensions/dpms.h>])
  3523. CFLAGS="$ac_save_cflags"
  3524. AC_SUBST(DPMSINC)
  3525. AC_SUBST(DPMSLIB)
  3526. ])
  3527. AC_DEFUN([AC_HAVE_GL],
  3528. [AC_REQUIRE_CPP()dnl
  3529. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3530. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3531. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3532. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3533. gl_test=$withval, gl_test="yes")
  3534. if test "x$kde_use_qt_emb" = "xyes"; then
  3535. # GL and Qt Embedded is a no-go for now.
  3536. ac_cv_have_gl=no
  3537. elif test "x$gl_test" = xno; then
  3538. ac_cv_have_gl=no
  3539. else
  3540. AC_MSG_CHECKING(for GL)
  3541. AC_CACHE_VAL(ac_cv_have_gl,
  3542. [
  3543. AC_LANG_SAVE
  3544. AC_LANG_CPLUSPLUS
  3545. ac_save_ldflags=$LDFLAGS
  3546. ac_save_cxxflags=$CXXFLAGS
  3547. ac_save_libs=$LIBS
  3548. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3549. LIBS="$LIBS -lGL -lGLU"
  3550. test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
  3551. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3552. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3553. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3554. AC_TRY_LINK([#include <GL/gl.h>
  3555. #include <GL/glu.h>
  3556. ], [],
  3557. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3558. AC_LANG_RESTORE
  3559. LDFLAGS=$ac_save_ldflags
  3560. CXXFLAGS=$ac_save_cxxflags
  3561. LIBS=$ac_save_libs
  3562. ])dnl
  3563. if test "$ac_cv_have_gl" = "no"; then
  3564. AC_MSG_RESULT(no)
  3565. GL_LDFLAGS=""
  3566. GLINC=""
  3567. $2
  3568. else
  3569. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3570. if test "$GL_LDFLAGS" = ""; then
  3571. GLLIB='-lGLU -lGL $(LIB_X11)'
  3572. else
  3573. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3574. fi
  3575. if test "$GL_INCLUDE" = ""; then
  3576. GLINC=""
  3577. else
  3578. GLINC="-I$GL_INCLUDE"
  3579. fi
  3580. AC_MSG_RESULT($ac_cv_have_gl)
  3581. $1
  3582. fi
  3583. fi
  3584. AC_SUBST(GLINC)
  3585. AC_SUBST(GLLIB)
  3586. ])
  3587. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3588. AC_DEFUN([KDE_PAM], [
  3589. AC_REQUIRE([KDE_CHECK_LIBDL])
  3590. want_pam=
  3591. AC_ARG_WITH(pam,
  3592. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3593. [ if test "x$withval" = "xyes"; then
  3594. want_pam=yes
  3595. pam_service=kde
  3596. elif test "x$withval" = "xno"; then
  3597. want_pam=no
  3598. else
  3599. want_pam=yes
  3600. pam_service=$withval
  3601. fi
  3602. ], [ pam_service=kde ])
  3603. use_pam=
  3604. PAMLIBS=
  3605. if test "x$want_pam" != xno; then
  3606. AC_CHECK_LIB(pam, pam_start, [
  3607. AC_CHECK_HEADER(security/pam_appl.h,
  3608. [ pam_header=security/pam_appl.h ],
  3609. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3610. [ pam_header=pam/pam_appl.h ],
  3611. [
  3612. AC_MSG_WARN([PAM detected, but no headers found!
  3613. Make sure you have the necessary development packages installed.])
  3614. ]
  3615. )
  3616. ]
  3617. )
  3618. ], , $LIBDL)
  3619. if test -z "$pam_header"; then
  3620. if test "x$want_pam" = xyes; then
  3621. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3622. fi
  3623. else
  3624. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3625. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3626. use_pam=yes
  3627. dnl darwin claims to be something special
  3628. if test "$pam_header" = "pam/pam_appl.h"; then
  3629. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3630. fi
  3631. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3632. AC_MSG_CHECKING(for const pam_message)
  3633. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3634. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3635. [AC_MSG_RESULT([const: Linux-type PAM])],
  3636. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3637. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3638. )],
  3639. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3640. fi
  3641. fi
  3642. AC_SUBST(PAMLIBS)
  3643. ])
  3644. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3645. AC_DEFUN([DEF_PAM_SERVICE], [
  3646. AC_ARG_WITH($1-pam,
  3647. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3648. [ if test "x$use_pam" = xyes; then
  3649. $3_PAM_SERVICE=$withval
  3650. else
  3651. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3652. You may want to enforce it by using --with-pam.])
  3653. fi
  3654. ],
  3655. [ if test "x$use_pam" = xyes; then
  3656. $3_PAM_SERVICE="$pam_service"
  3657. fi
  3658. ])
  3659. if test -n "$$3_PAM_SERVICE"; then
  3660. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3661. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3662. fi
  3663. AC_SUBST($3_PAM_SERVICE)
  3664. ])
  3665. AC_DEFUN([KDE_SHADOWPASSWD], [
  3666. AC_REQUIRE([KDE_PAM])
  3667. AC_CHECK_LIB(shadow, getspent,
  3668. [ LIBSHADOW="-lshadow"
  3669. ac_use_shadow=yes
  3670. ],
  3671. [ dnl for UnixWare
  3672. AC_CHECK_LIB(gen, getspent,
  3673. [ LIBGEN="-lgen"
  3674. ac_use_shadow=yes
  3675. ],
  3676. [ AC_CHECK_FUNC(getspent,
  3677. [ ac_use_shadow=yes ],
  3678. [ ac_use_shadow=no ])
  3679. ])
  3680. ])
  3681. AC_SUBST(LIBSHADOW)
  3682. AC_SUBST(LIBGEN)
  3683. AC_MSG_CHECKING([for shadow passwords])
  3684. AC_ARG_WITH(shadow,
  3685. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3686. [ if test "x$withval" != "xno"; then
  3687. use_shadow=yes
  3688. else
  3689. use_shadow=no
  3690. fi
  3691. ], [
  3692. use_shadow="$ac_use_shadow"
  3693. ])
  3694. if test "x$use_shadow" = xyes; then
  3695. AC_MSG_RESULT(yes)
  3696. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3697. else
  3698. AC_MSG_RESULT(no)
  3699. LIBSHADOW=
  3700. LIBGEN=
  3701. fi
  3702. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3703. dnl this still applies, if we could use it indirectly through pam.
  3704. if test "x$use_shadow" = xyes ||
  3705. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3706. case $host in
  3707. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3708. SETUIDFLAGS="-m 4755 -o root";;
  3709. *)
  3710. SETUIDFLAGS="-m 4755";;
  3711. esac
  3712. fi
  3713. AC_SUBST(SETUIDFLAGS)
  3714. ])
  3715. AC_DEFUN([KDE_PASSWDLIBS], [
  3716. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3717. AC_REQUIRE([KDE_PAM])
  3718. AC_REQUIRE([KDE_SHADOWPASSWD])
  3719. if test "x$use_pam" = "xyes"; then
  3720. PASSWDLIBS="$PAMLIBS"
  3721. else
  3722. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3723. fi
  3724. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3725. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3726. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3727. dnl may need to read /etc/master.passwd).
  3728. case $host in
  3729. *-*-freebsd*)
  3730. SETUIDFLAGS="-m 4755 -o root"
  3731. ;;
  3732. *)
  3733. ;;
  3734. esac
  3735. AC_SUBST(PASSWDLIBS)
  3736. ])
  3737. AC_DEFUN([KDE_CHECK_LIBDL],
  3738. [
  3739. AC_CHECK_LIB(dl, dlopen, [
  3740. LIBDL="-ldl"
  3741. ac_cv_have_dlfcn=yes
  3742. ])
  3743. AC_CHECK_LIB(dld, shl_unload, [
  3744. LIBDL="-ldld"
  3745. ac_cv_have_shload=yes
  3746. ])
  3747. AC_SUBST(LIBDL)
  3748. ])
  3749. AC_DEFUN([KDE_CHECK_DLOPEN],
  3750. [
  3751. KDE_CHECK_LIBDL
  3752. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3753. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3754. ac_cv_have_dlfcn=no
  3755. fi
  3756. if test "$ac_cv_header_dl_h" = "no"; then
  3757. ac_cv_have_shload=no
  3758. fi
  3759. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3760. dnl (MM)
  3761. AC_ARG_ENABLE(dlopen,
  3762. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3763. enable_dlopen=$enableval,
  3764. enable_dlopen=yes)
  3765. # override the user's opinion, if we know it better ;)
  3766. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3767. enable_dlopen=no
  3768. fi
  3769. if test "$ac_cv_have_dlfcn" = "yes"; then
  3770. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3771. fi
  3772. if test "$ac_cv_have_shload" = "yes"; then
  3773. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3774. fi
  3775. if test "$enable_dlopen" = no ; then
  3776. test -n "$1" && eval $1
  3777. else
  3778. test -n "$2" && eval $2
  3779. fi
  3780. ])
  3781. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3782. [
  3783. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3784. KDE_PROG_LIBTOOL
  3785. AC_MSG_CHECKING([dynamic loading])
  3786. eval "`egrep '^build_libtool_libs=' libtool`"
  3787. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3788. dynamic_loading=yes
  3789. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3790. else
  3791. dynamic_loading=no
  3792. fi
  3793. AC_MSG_RESULT($dynamic_loading)
  3794. if test "$dynamic_loading" = "yes"; then
  3795. $1
  3796. else
  3797. $2
  3798. fi
  3799. ])
  3800. AC_DEFUN([KDE_ADD_INCLUDES],
  3801. [
  3802. if test -z "$1"; then
  3803. test_include="Pix.h"
  3804. else
  3805. test_include="$1"
  3806. fi
  3807. AC_MSG_CHECKING([for libg++ ($test_include)])
  3808. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3809. [
  3810. kde_cv_libgpp_includes=no
  3811. for ac_dir in \
  3812. \
  3813. /usr/include/g++ \
  3814. /usr/include \
  3815. /usr/unsupported/include \
  3816. /opt/include \
  3817. $extra_include \
  3818. ; \
  3819. do
  3820. if test -r "$ac_dir/$test_include"; then
  3821. kde_cv_libgpp_includes=$ac_dir
  3822. break
  3823. fi
  3824. done
  3825. ])
  3826. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3827. if test "$kde_cv_libgpp_includes" != "no"; then
  3828. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3829. fi
  3830. ])
  3831. ])
  3832. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3833. [
  3834. dnl This code is here specifically to handle the
  3835. dnl various flavors of threading library on FreeBSD
  3836. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3837. dnl There may be an environment PTHREAD_LIBS that
  3838. dnl specifies what to use; otherwise, search for it.
  3839. dnl -pthread is special cased and unsets LIBPTHREAD
  3840. dnl below if found.
  3841. LIBPTHREAD=""
  3842. if test -n "$PTHREAD_LIBS"; then
  3843. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3844. LIBPTHREAD="PTHREAD"
  3845. else
  3846. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3847. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3848. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3849. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3850. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3851. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3852. fi
  3853. fi
  3854. dnl Is this test really needed, in the face of the Tru64 test below?
  3855. if test -z "$LIBPTHREAD"; then
  3856. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3857. fi
  3858. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3859. if test -z "$LIBPTHREAD" ; then
  3860. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3861. kde_safe_libs=$LIBS
  3862. LIBS="$LIBS -lpthread"
  3863. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3864. AC_MSG_RESULT(yes)
  3865. LIBPTHREAD="-lpthread"],[
  3866. AC_MSG_RESULT(no)])
  3867. LIBS=$kde_safe_libs
  3868. fi
  3869. dnl Un-special-case for FreeBSD.
  3870. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3871. LIBPTHREAD=""
  3872. fi
  3873. AC_SUBST(LIBPTHREAD)
  3874. ])
  3875. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3876. [
  3877. USE_THREADS=""
  3878. if test -z "$LIBPTHREAD"; then
  3879. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3880. fi
  3881. AH_VERBATIM(__svr_define, [
  3882. #if defined(__SVR4) && !defined(__svr4__)
  3883. #define __svr4__ 1
  3884. #endif
  3885. ])
  3886. case $host_os in
  3887. solaris*)
  3888. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3889. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3890. ;;
  3891. freebsd*)
  3892. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3893. ;;
  3894. aix*)
  3895. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3896. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3897. ;;
  3898. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3899. if test "$CXX" = "KCC"; then
  3900. CXXFLAGS="$CXXFLAGS --thread_safe"
  3901. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3902. fi
  3903. ;;
  3904. *)
  3905. ;;
  3906. esac
  3907. AC_SUBST(USE_THREADS)
  3908. AC_SUBST(LIBPTHREAD)
  3909. ])
  3910. AC_DEFUN([KDE_CHECK_THREADING],
  3911. [
  3912. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3913. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3914. dnl default is yes if libpthread is found and no if no libpthread is available
  3915. if test -z "$LIBPTHREAD"; then
  3916. if test -z "$USE_THREADS"; then
  3917. kde_check_threading_default=no
  3918. else
  3919. kde_check_threading_default=yes
  3920. fi
  3921. else
  3922. kde_check_threading_default=yes
  3923. fi
  3924. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3925. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3926. if test "x$kde_use_threading" = "xyes"; then
  3927. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3928. fi
  3929. ])
  3930. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3931. [
  3932. if test "$kde_python_link_found" = no; then
  3933. if test "$1" = normal; then
  3934. AC_MSG_CHECKING(if a Python application links)
  3935. else
  3936. AC_MSG_CHECKING(if Python depends on $2)
  3937. fi
  3938. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3939. [
  3940. kde_save_cflags="$CFLAGS"
  3941. CFLAGS="$CFLAGS $PYTHONINC"
  3942. kde_save_libs="$LIBS"
  3943. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3944. kde_save_ldflags="$LDFLAGS"
  3945. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3946. AC_TRY_LINK(
  3947. [
  3948. #include <Python.h>
  3949. ],[
  3950. PySys_SetArgv(1, 0);
  3951. ],
  3952. [kde_cv_try_link_python_$1=yes],
  3953. [kde_cv_try_link_python_$1=no]
  3954. )
  3955. CFLAGS="$kde_save_cflags"
  3956. LIBS="$kde_save_libs"
  3957. LDFLAGS="$kde_save_ldflags"
  3958. ])
  3959. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3960. AC_MSG_RESULT(yes)
  3961. kde_python_link_found=yes
  3962. if test ! "$1" = normal; then
  3963. LIBPYTHON="$LIBPYTHON $2"
  3964. fi
  3965. $3
  3966. else
  3967. AC_MSG_RESULT(no)
  3968. $4
  3969. fi
  3970. fi
  3971. ])
  3972. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3973. [
  3974. AC_MSG_CHECKING([for Python directory])
  3975. AC_CACHE_VAL(kde_cv_pythondir,
  3976. [
  3977. if test -z "$PYTHONDIR"; then
  3978. kde_cv_pythondir=/usr/local
  3979. else
  3980. kde_cv_pythondir="$PYTHONDIR"
  3981. fi
  3982. ])
  3983. AC_ARG_WITH(pythondir,
  3984. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3985. [
  3986. ac_python_dir=$withval
  3987. ], ac_python_dir=$kde_cv_pythondir
  3988. )
  3989. AC_MSG_RESULT($ac_python_dir)
  3990. ])
  3991. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  3992. [
  3993. AC_REQUIRE([KDE_CHECK_LIBDL])
  3994. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3995. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3996. if test -z "$1"; then
  3997. version="1.5"
  3998. else
  3999. version="$1"
  4000. fi
  4001. AC_MSG_CHECKING([for Python$version])
  4002. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  4003. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  4004. if test ! -r $python_incdir/Python.h; then
  4005. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  4006. python_incdir=$python_incdir/python$version
  4007. if test ! -r $python_incdir/Python.h; then
  4008. python_incdir=no
  4009. fi
  4010. fi
  4011. PYTHONINC=-I$python_incdir
  4012. python_libdirs="$ac_python_dir/lib$tdelibsuff /usr/lib$tdelibsuff /usr/local /usr/lib$tdelibsuff $kde_extra_libs"
  4013. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  4014. if test ! -r $python_libdir/libpython$version.so; then
  4015. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  4016. if test ! -r $python_libdir/libpython$version.a; then
  4017. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  4018. python_libdir=$python_libdir/python$version/config
  4019. if test ! -r $python_libdir/libpython$version.a; then
  4020. python_libdir=no
  4021. fi
  4022. fi
  4023. fi
  4024. PYTHONLIB=-L$python_libdir
  4025. kde_orig_LIBPYTHON=$LIBPYTHON
  4026. if test -z "$LIBPYTHON"; then
  4027. LIBPYTHON=-lpython$version
  4028. fi
  4029. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  4030. python_moddir=$python_moddir/python$version
  4031. if test ! -r $python_moddir/copy.py; then
  4032. python_moddir=no
  4033. fi
  4034. PYTHONMODDIR=$python_moddir
  4035. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  4036. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  4037. LIBPYTHON=$kde_orig_LIBPYTHON
  4038. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  4039. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  4040. $2
  4041. else
  4042. dnl Note: this test is very weak
  4043. kde_python_link_found=no
  4044. KDE_TRY_LINK_PYTHON(normal)
  4045. KDE_TRY_LINK_PYTHON(m, -lm)
  4046. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4047. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4048. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4049. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4050. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4051. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4052. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4053. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4054. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4055. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4056. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4057. [AC_MSG_WARN([it seems, Python depends on another library.
  4058. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4059. and contact the authors to let them know about this problem])
  4060. ])
  4061. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4062. AC_SUBST(PYTHONINC)
  4063. AC_SUBST(PYTHONLIB)
  4064. AC_SUBST(LIBPYTHON)
  4065. AC_SUBST(PYTHONMODDIR)
  4066. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4067. fi
  4068. ])
  4069. AC_DEFUN([KDE_CHECK_PYTHON],
  4070. [
  4071. KDE_CHECK_PYTHON_INTERN("2.5",
  4072. [KDE_CHECK_PYTHON_INTERN("2.4",
  4073. [KDE_CHECK_PYTHON_INTERN("2.3",
  4074. [KDE_CHECK_PYTHON_INTERN("2.2",
  4075. [KDE_CHECK_PYTHON_INTERN("2.1",
  4076. [KDE_CHECK_PYTHON_INTERN("2.0",
  4077. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4078. ])
  4079. ])
  4080. ])
  4081. ])
  4082. ])
  4083. ])
  4084. AC_DEFUN([KDE_CHECK_STL],
  4085. [
  4086. AC_LANG_SAVE
  4087. AC_LANG_CPLUSPLUS
  4088. ac_save_CXXFLAGS="$CXXFLAGS"
  4089. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4090. AC_MSG_CHECKING([if C++ programs can be compiled])
  4091. AC_CACHE_VAL(kde_cv_stl_works,
  4092. [
  4093. AC_TRY_COMPILE([
  4094. #include <string>
  4095. using namespace std;
  4096. ],[
  4097. string astring="Hallo Welt.";
  4098. astring.erase(0, 6); // now astring is "Welt"
  4099. return 0;
  4100. ], kde_cv_stl_works=yes,
  4101. kde_cv_stl_works=no)
  4102. ])
  4103. AC_MSG_RESULT($kde_cv_stl_works)
  4104. if test "$kde_cv_stl_works" = "yes"; then
  4105. # back compatible
  4106. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4107. else
  4108. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4109. Check config.log for details - if you're using a Linux distribution you might miss
  4110. a package named similar to libstdc++-dev.])
  4111. fi
  4112. CXXFLAGS="$ac_save_CXXFLAGS"
  4113. AC_LANG_RESTORE
  4114. ])
  4115. AC_DEFUN([AC_FIND_QIMGIO],
  4116. [AC_REQUIRE([AC_FIND_JPEG])
  4117. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4118. AC_MSG_CHECKING([for qimgio])
  4119. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4120. [
  4121. AC_LANG_SAVE
  4122. AC_LANG_CPLUSPLUS
  4123. ac_save_LIBS="$LIBS"
  4124. ac_save_CXXFLAGS="$CXXFLAGS"
  4125. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBTQT"
  4126. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  4127. AC_TRY_RUN(dnl
  4128. [
  4129. #include <qimageio.h>
  4130. #include <qstring.h>
  4131. int main() {
  4132. QString t = "hallo";
  4133. t.fill('t');
  4134. qInitImageIO();
  4135. }
  4136. ],
  4137. ac_cv_lib_qimgio=yes,
  4138. ac_cv_lib_qimgio=no,
  4139. ac_cv_lib_qimgio=no)
  4140. LIBS="$ac_save_LIBS"
  4141. CXXFLAGS="$ac_save_CXXFLAGS"
  4142. AC_LANG_RESTORE
  4143. ])dnl
  4144. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4145. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4146. AC_MSG_RESULT(yes)
  4147. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  4148. AC_SUBST(LIBQIMGIO)
  4149. else
  4150. AC_MSG_RESULT(not found)
  4151. fi
  4152. ])
  4153. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4154. [
  4155. AC_PROVIDE([AM_ENABLE_STATIC])
  4156. AC_PROVIDE([AM_ENABLE_SHARED])
  4157. enable_static=no
  4158. enable_shared=yes
  4159. ])
  4160. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4161. [
  4162. AC_MSG_CHECKING([for utmp file])
  4163. AC_CACHE_VAL(kde_cv_utmp_file,
  4164. [
  4165. kde_cv_utmp_file=no
  4166. for ac_file in \
  4167. \
  4168. /var/run/utmp \
  4169. /var/adm/utmp \
  4170. /etc/utmp \
  4171. ; \
  4172. do
  4173. if test -r "$ac_file"; then
  4174. kde_cv_utmp_file=$ac_file
  4175. break
  4176. fi
  4177. done
  4178. ])
  4179. if test "$kde_cv_utmp_file" != "no"; then
  4180. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4181. $1
  4182. AC_MSG_RESULT($kde_cv_utmp_file)
  4183. else
  4184. $2
  4185. AC_MSG_RESULT([non found])
  4186. fi
  4187. ])
  4188. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4189. [
  4190. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4191. TOPSUBDIRS=""
  4192. if test ! -s $srcdir/subdirs; then
  4193. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4194. files=`cd $srcdir && ls -1`
  4195. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4196. for i in $dirs; do
  4197. echo $i >> $srcdir/subdirs
  4198. done
  4199. fi
  4200. ac_topsubdirs=
  4201. if test -s $srcdir/inst-apps; then
  4202. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4203. elif test -s $srcdir/subdirs; then
  4204. ac_topsubdirs="`cat $srcdir/subdirs`"
  4205. fi
  4206. for i in $ac_topsubdirs; do
  4207. AC_MSG_CHECKING([if $i should be compiled])
  4208. if test -d $srcdir/$i; then
  4209. install_it="yes"
  4210. for j in $DO_NOT_COMPILE; do
  4211. if test $i = $j; then
  4212. install_it="no"
  4213. fi
  4214. done
  4215. else
  4216. install_it="no"
  4217. fi
  4218. AC_MSG_RESULT($install_it)
  4219. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4220. if test $install_it = "yes"; then
  4221. TOPSUBDIRS="$TOPSUBDIRS $i"
  4222. eval "$vari""_SUBDIR_included=yes"
  4223. else
  4224. eval "$vari""_SUBDIR_included=no"
  4225. fi
  4226. done
  4227. AC_SUBST(TOPSUBDIRS)
  4228. ])
  4229. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4230. [
  4231. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4232. AC_LANG_SAVE
  4233. AC_LANG_CPLUSPLUS
  4234. AC_TRY_COMPILE([
  4235. ],
  4236. [
  4237. namespace Foo {
  4238. extern int i;
  4239. namespace Bar {
  4240. extern int i;
  4241. }
  4242. }
  4243. int Foo::i = 0;
  4244. int Foo::Bar::i = 1;
  4245. ],[
  4246. AC_MSG_RESULT(yes)
  4247. AC_DEFINE(HAVE_NAMESPACES)
  4248. ], [
  4249. AC_MSG_RESULT(no)
  4250. ])
  4251. AC_LANG_RESTORE
  4252. ])
  4253. dnl ------------------------------------------------------------------------
  4254. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4255. dnl ------------------------------------------------------------------------
  4256. dnl
  4257. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4258. [
  4259. AC_MSG_CHECKING(for S_ISSOCK)
  4260. AC_CACHE_VAL(ac_cv_have_s_issock,
  4261. [
  4262. AC_TRY_LINK(
  4263. [
  4264. #include <sys/stat.h>
  4265. ],
  4266. [
  4267. struct stat buff;
  4268. int b = S_ISSOCK( buff.st_mode );
  4269. ],
  4270. ac_cv_have_s_issock=yes,
  4271. ac_cv_have_s_issock=no)
  4272. ])
  4273. AC_MSG_RESULT($ac_cv_have_s_issock)
  4274. if test "$ac_cv_have_s_issock" = "yes"; then
  4275. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4276. fi
  4277. AH_VERBATIM(_ISSOCK,
  4278. [
  4279. #ifndef HAVE_S_ISSOCK
  4280. #define HAVE_S_ISSOCK
  4281. #define S_ISSOCK(mode) (1==0)
  4282. #endif
  4283. ])
  4284. ])
  4285. dnl ------------------------------------------------------------------------
  4286. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4287. dnl ------------------------------------------------------------------------
  4288. dnl
  4289. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4290. [
  4291. AC_MSG_CHECKING(for MAXPATHLEN)
  4292. AC_CACHE_VAL(ac_cv_maxpathlen,
  4293. [
  4294. cat > conftest.$ac_ext <<EOF
  4295. #ifdef STDC_HEADERS
  4296. # include <stdlib.h>
  4297. #endif
  4298. #include <stdio.h>
  4299. #include <sys/param.h>
  4300. #ifndef MAXPATHLEN
  4301. #define MAXPATHLEN 1024
  4302. #endif
  4303. KDE_HELLO MAXPATHLEN
  4304. EOF
  4305. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4306. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4307. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4308. else
  4309. ac_cv_maxpathlen=1024
  4310. fi
  4311. rm conftest.*
  4312. ])
  4313. AC_MSG_RESULT($ac_cv_maxpathlen)
  4314. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4315. ])
  4316. AC_DEFUN([KDE_CHECK_HEADER],
  4317. [
  4318. kde_safe_cppflags=$CPPFLAGS
  4319. CPPFLAGS="$CPPFLAGS $all_includes"
  4320. AC_LANG_SAVE
  4321. AC_LANG_CPLUSPLUS
  4322. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4323. AC_LANG_RESTORE
  4324. CPPFLAGS=$kde_safe_cppflags
  4325. ])
  4326. AC_DEFUN([KDE_CHECK_HEADERS],
  4327. [
  4328. AH_CHECK_HEADERS([$1])
  4329. AC_LANG_SAVE
  4330. kde_safe_cppflags=$CPPFLAGS
  4331. CPPFLAGS="$CPPFLAGS $all_includes"
  4332. AC_LANG_CPLUSPLUS
  4333. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4334. CPPFLAGS=$kde_safe_cppflags
  4335. AC_LANG_RESTORE
  4336. ])
  4337. AC_DEFUN([KDE_FAST_CONFIGURE],
  4338. [
  4339. dnl makes configure fast (needs perl)
  4340. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4341. with_fast_perl=$enableval, with_fast_perl=yes)
  4342. ])
  4343. AC_DEFUN([KDE_CONF_FILES],
  4344. [
  4345. val=
  4346. if test -f $srcdir/configure.files ; then
  4347. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4348. fi
  4349. CONF_FILES=
  4350. if test -n "$val" ; then
  4351. for i in $val ; do
  4352. CONF_FILES="$CONF_FILES $i"
  4353. done
  4354. fi
  4355. AC_SUBST(CONF_FILES)
  4356. ])dnl
  4357. dnl This sets the prefix, for arts and tdelibs
  4358. dnl Do NOT use in any other module.
  4359. dnl It only looks at --prefix, TDEDIR and falls back to /usr/local/kde
  4360. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4361. [
  4362. unset CDPATH
  4363. dnl make $TDEDIR the default for the installation
  4364. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4365. if test "x$prefix" = "xNONE"; then
  4366. prefix=$ac_default_prefix
  4367. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4368. fi
  4369. # And delete superfluous '/' to make compares easier
  4370. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4371. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4372. kde_libs_prefix='$(prefix)'
  4373. kde_libs_htmldir='$(kde_htmldir)'
  4374. AC_SUBST(kde_libs_prefix)
  4375. AC_SUBST(kde_libs_htmldir)
  4376. KDE_FAST_CONFIGURE
  4377. KDE_CONF_FILES
  4378. ])
  4379. AC_DEFUN([KDE_SET_PREFIX],
  4380. [
  4381. unset CDPATH
  4382. dnl We can't give real code to that macro, only a value.
  4383. dnl It only matters for --help, since we set the prefix in this function anyway.
  4384. AC_PREFIX_DEFAULT(${TDEDIR:-the kde prefix})
  4385. KDE_SET_DEFAULT_BINDIRS
  4386. if test "x$prefix" = "xNONE"; then
  4387. dnl no prefix given: look for tde-config in the PATH and deduce the prefix from it
  4388. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4389. else
  4390. dnl prefix given: look for tde-config, preferrably in prefix, otherwise in PATH
  4391. kde_save_PATH="$PATH"
  4392. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4393. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(tde-config)], [], prepend)
  4394. PATH="$kde_save_PATH"
  4395. fi
  4396. kde_libs_prefix=`$KDECONFIG --prefix`
  4397. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4398. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  4399. This means it has been moved since you installed it.
  4400. This won't work. Please recompile tdelibs for the new prefix.
  4401. ])
  4402. fi
  4403. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4404. AC_MSG_CHECKING([where to install])
  4405. if test "x$prefix" = "xNONE"; then
  4406. prefix=$kde_libs_prefix
  4407. AC_MSG_RESULT([$prefix (as returned by tde-config)])
  4408. else
  4409. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4410. given_prefix=$prefix
  4411. AC_MSG_RESULT([$prefix (as requested)])
  4412. fi
  4413. # And delete superfluous '/' to make compares easier
  4414. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4415. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4416. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4417. AC_SUBST(KDECONFIG)
  4418. AC_SUBST(kde_libs_prefix)
  4419. AC_SUBST(kde_libs_htmldir)
  4420. KDE_FAST_CONFIGURE
  4421. KDE_CONF_FILES
  4422. ])
  4423. pushdef([AC_PROG_INSTALL],
  4424. [
  4425. dnl our own version, testing for a -p flag
  4426. popdef([AC_PROG_INSTALL])
  4427. dnl as AC_PROG_INSTALL works as it works we first have
  4428. dnl to save if the user didn't specify INSTALL, as the
  4429. dnl autoconf one overwrites INSTALL and we have no chance to find
  4430. dnl out afterwards
  4431. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4432. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4433. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4434. AC_PROG_INSTALL
  4435. if test -z "$kde_save_INSTALL_given" ; then
  4436. # OK, user hasn't given any INSTALL, autoconf found one for us
  4437. # now we test, if it supports the -p flag
  4438. AC_MSG_CHECKING(for -p flag to install)
  4439. rm -f confinst.$$.* > /dev/null 2>&1
  4440. echo "Testtest" > confinst.$$.orig
  4441. ac_res=no
  4442. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4443. if test -f confinst.$$.new ; then
  4444. # OK, -p seems to do no harm to install
  4445. INSTALL="${INSTALL} -p"
  4446. ac_res=yes
  4447. fi
  4448. fi
  4449. rm -f confinst.$$.*
  4450. AC_MSG_RESULT($ac_res)
  4451. fi
  4452. dnl the following tries to resolve some signs and wonders coming up
  4453. dnl with different autoconf/automake versions
  4454. dnl e.g.:
  4455. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4456. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4457. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4458. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4459. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4460. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4461. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4462. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4463. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4464. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4465. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4466. dnl and so does not see the -s flag in automake > 1.4
  4467. dnl to clean up that mess we:
  4468. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4469. dnl which cleans KDE's program with automake > 1.4;
  4470. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4471. dnl with automake<=1.4
  4472. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4473. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4474. dnl
  4475. dnl And to all this comes, that I even can't write in comments variable
  4476. dnl names used by automake, because it is so stupid to think I wanted to
  4477. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4478. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4479. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4480. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4481. fi
  4482. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4483. INSTALL_SCRIPT='${INSTALL}'
  4484. fi
  4485. ])dnl
  4486. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4487. [AC_LANG_CPLUSPLUS
  4488. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4489. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4490. ])
  4491. pushdef([AC_LANG_CPLUSPLUS],
  4492. [popdef([AC_LANG_CPLUSPLUS])
  4493. KDE_LANG_CPLUSPLUS
  4494. ])
  4495. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4496. [
  4497. AC_MSG_CHECKING(for long long)
  4498. AC_CACHE_VAL(kde_cv_c_long_long,
  4499. [
  4500. AC_LANG_SAVE
  4501. AC_LANG_CPLUSPLUS
  4502. AC_TRY_LINK([], [
  4503. long long foo = 0;
  4504. foo = foo+1;
  4505. ],
  4506. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4507. AC_LANG_RESTORE
  4508. ])
  4509. AC_MSG_RESULT($kde_cv_c_long_long)
  4510. if test "$kde_cv_c_long_long" = yes; then
  4511. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4512. fi
  4513. ])
  4514. AC_DEFUN([KDE_CHECK_LIB],
  4515. [
  4516. kde_save_LDFLAGS="$LDFLAGS"
  4517. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4518. kde_save_LIBS="$LIBS"
  4519. LDFLAGS="$LDFLAGS $all_libraries"
  4520. case $host_os in
  4521. aix*) LDFLAGS="-brtl $LDFLAGS"
  4522. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4523. ;;
  4524. esac
  4525. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4526. LDFLAGS="$kde_save_LDFLAGS"
  4527. LIBS="$kde_save_LIBS"
  4528. ])
  4529. AC_DEFUN([KDE_JAVA_PREFIX],
  4530. [
  4531. dir=`dirname "$1"`
  4532. base=`basename "$1"`
  4533. list=`ls -1 $dir 2> /dev/null`
  4534. for entry in $list; do
  4535. if test -d $dir/$entry/bin; then
  4536. case $entry in
  4537. $base)
  4538. javadirs="$javadirs $dir/$entry/bin"
  4539. ;;
  4540. esac
  4541. elif test -d $dir/$entry/jre/bin; then
  4542. case $entry in
  4543. $base)
  4544. javadirs="$javadirs $dir/$entry/jre/bin"
  4545. ;;
  4546. esac
  4547. fi
  4548. done
  4549. ])
  4550. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4551. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4552. [
  4553. AC_ARG_WITH(java,
  4554. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4555. [ ac_java_dir=$withval
  4556. ], ac_java_dir=""
  4557. )
  4558. AC_MSG_CHECKING([for Java])
  4559. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4560. if test "x$ac_java_dir" = "xno"; then
  4561. kde_java_bindir=no
  4562. kde_java_includedir=no
  4563. kde_java_libjvmdir=no
  4564. kde_java_libgcjdir=no
  4565. kde_java_libhpidir=no
  4566. else
  4567. if test "x$ac_java_dir" = "x"; then
  4568. dnl No option set -> collect list of candidate paths
  4569. if test -n "$JAVA_HOME"; then
  4570. KDE_JAVA_PREFIX($JAVA_HOME)
  4571. fi
  4572. KDE_JAVA_PREFIX(/usr/j2se)
  4573. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4574. KDE_JAVA_PREFIX(/usr/j*dk*)
  4575. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4576. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4577. KDE_JAVA_PREFIX(/usr/lib/java*)
  4578. KDE_JAVA_PREFIX(/usr/java*)
  4579. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4580. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4581. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4582. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4583. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4584. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4585. KDE_JAVA_PREFIX(/opt/java*)
  4586. kde_cv_path="NONE"
  4587. kde_save_IFS=$IFS
  4588. IFS=':'
  4589. for dir in $PATH; do
  4590. if test -d "$dir"; then
  4591. javadirs="$javadirs $dir"
  4592. fi
  4593. done
  4594. IFS=$kde_save_IFS
  4595. jredirs=
  4596. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4597. for dir in $javadirs; do
  4598. dnl Check for the java executable
  4599. if test -x "$dir/java"; then
  4600. sane_path=$(cd $dir; /bin/pwd)
  4601. dnl And also check for a libjvm.so somewhere under there
  4602. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4603. if test "$sane_path" != "/usr/bin"; then
  4604. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4605. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4606. jredirs="$jredirs $dir"
  4607. fi
  4608. fi
  4609. done
  4610. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4611. JAVAC=
  4612. JAVA=
  4613. kde_java_bindir=no
  4614. for dir in $jredirs; do
  4615. JAVA="$dir/java"
  4616. kde_java_bindir=$dir
  4617. if test -x "$dir/javac"; then
  4618. JAVAC="$dir/javac"
  4619. break
  4620. fi
  4621. done
  4622. if test -n "$JAVAC"; then
  4623. dnl this substitution might not work - well, we test for jni.h below
  4624. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4625. else
  4626. kde_java_includedir=no
  4627. fi
  4628. else
  4629. dnl config option set
  4630. kde_java_bindir=$ac_java_dir/bin
  4631. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4632. kde_java_includedir=no
  4633. else
  4634. kde_java_includedir=$ac_java_dir/include
  4635. fi
  4636. fi
  4637. fi
  4638. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4639. if test "x$kde_java_bindir" != "xno"; then
  4640. dnl Look for libjvm.so
  4641. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4642. dnl Look for libgcj.so
  4643. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4644. dnl Look for libhpi.so and avoid green threads
  4645. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4646. dnl Now check everything's fine under there
  4647. dnl the include dir is our flag for having the JDK
  4648. if test -d "$kde_java_includedir"; then
  4649. if test ! -x "$kde_java_bindir/javac"; then
  4650. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4651. fi
  4652. if test ! -x "$kde_java_bindir/javah"; then
  4653. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4654. fi
  4655. if test ! -x "$kde_java_bindir/jar"; then
  4656. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4657. fi
  4658. if test ! -r "$kde_java_includedir/jni.h"; then
  4659. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4660. fi
  4661. jni_includes="-I$kde_java_includedir"
  4662. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4663. dnl and under linux here..
  4664. dnl not needed for gcj
  4665. if test "x$kde_java_libgcjdir" = "x"; then
  4666. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4667. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4668. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4669. fi
  4670. else
  4671. JAVAC=
  4672. jni_includes=
  4673. fi
  4674. if test "x$kde_java_libgcjdir" = "x"; then
  4675. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4676. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4677. fi
  4678. else
  4679. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4680. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4681. fi
  4682. fi
  4683. if test ! -x "$kde_java_bindir/java"; then
  4684. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4685. fi
  4686. dnl not needed for gcj compile
  4687. if test "x$kde_java_libgcjdir" = "x"; then
  4688. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4689. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4690. fi
  4691. fi
  4692. if test -n "$jni_includes"; then
  4693. dnl Check for JNI version
  4694. AC_LANG_SAVE
  4695. AC_LANG_CPLUSPLUS
  4696. ac_cxxflags_safe="$CXXFLAGS"
  4697. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4698. AC_TRY_COMPILE([
  4699. #include <jni.h>
  4700. ],
  4701. [
  4702. #ifndef JNI_VERSION_1_2
  4703. Syntax Error
  4704. #endif
  4705. ],[ kde_jni_works=yes ],
  4706. [ kde_jni_works=no ])
  4707. if test $kde_jni_works = no; then
  4708. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4709. You need to have Java Development Kit (JDK) version 1.2.
  4710. Use --with-java to specify another location.
  4711. Use --without-java to configure without java support.
  4712. Or download a newer JDK and try again.
  4713. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4714. fi
  4715. CXXFLAGS="$ac_cxxflags_safe"
  4716. AC_LANG_RESTORE
  4717. dnl All tests ok, inform and subst the variables
  4718. JAVAC=$kde_java_bindir/javac
  4719. JAVAH=$kde_java_bindir/javah
  4720. JAR=$kde_java_bindir/jar
  4721. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4722. if test "x$kde_java_libgcjdir" = "x"; then
  4723. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4724. else
  4725. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4726. fi
  4727. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4728. else
  4729. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4730. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4731. fi
  4732. elif test -d "/Library/Java/Home"; then
  4733. kde_java_bindir="/Library/Java/Home/bin"
  4734. jni_includes="-I/Library/Java/Home/include"
  4735. JAVAC=$kde_java_bindir/javac
  4736. JAVAH=$kde_java_bindir/javah
  4737. JAR=$kde_java_bindir/jar
  4738. JVMLIBS="-Wl,-framework,JavaVM"
  4739. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4740. AC_MSG_RESULT([Apple Java Framework])
  4741. else
  4742. AC_MSG_RESULT([none found])
  4743. fi
  4744. AC_SUBST(JAVAC)
  4745. AC_SUBST(JAVAH)
  4746. AC_SUBST(JAR)
  4747. AC_SUBST(JVMLIBS)
  4748. AC_SUBST(jni_includes)
  4749. # for backward compat
  4750. kde_cv_java_includedir=$kde_java_includedir
  4751. kde_cv_java_bindir=$kde_java_bindir
  4752. ])
  4753. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4754. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4755. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4756. dnl it. (matz@kde.org)
  4757. m4_define([mm_foreach],
  4758. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4759. m4_define([mm_car], [[$1]])
  4760. m4_define([mm_car2], [[$@]])
  4761. m4_define([_mm_foreach],
  4762. [m4_if(m4_quote($2), [], [],
  4763. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4764. mm_car2(m4_shift($2)),
  4765. [$3])])])
  4766. m4_define([AC_FOREACH],
  4767. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4768. AC_DEFUN([KDE_NEED_FLEX],
  4769. [
  4770. kde_libs_safe=$LIBS
  4771. LIBS="$LIBS $USER_LDFLAGS"
  4772. AM_PROG_LEX
  4773. LIBS=$kde_libs_safe
  4774. if test -z "$LEXLIB"; then
  4775. AC_MSG_ERROR([You need to have flex installed.])
  4776. fi
  4777. AC_SUBST(LEXLIB)
  4778. ])
  4779. AC_DEFUN([AC_PATH_TQTOPIA],
  4780. [
  4781. dnl TODO: use AC_CACHE_VAL
  4782. if test -z "$1"; then
  4783. qtopia_minver_maj=1
  4784. qtopia_minver_min=5
  4785. qtopia_minver_pat=0
  4786. else
  4787. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4788. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4789. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4790. fi
  4791. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4792. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4793. AC_REQUIRE([AC_PATH_TQT])
  4794. AC_MSG_CHECKING([for Qtopia])
  4795. LIB_TQTOPIA="-lqpe"
  4796. AC_SUBST(LIB_TQTOPIA)
  4797. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4798. ac_qtopia_incdir=NO
  4799. AC_ARG_WITH(qtopia-dir,
  4800. AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
  4801. [ ac_qtopia_incdir="$withval"/include] )
  4802. qtopia_incdirs=""
  4803. for dir in $kde_qtopia_dirs; do
  4804. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4805. done
  4806. if test ! "$ac_qtopia_incdir" = "NO"; then
  4807. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4808. fi
  4809. qtopia_incdir=""
  4810. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4811. ac_qtopia_incdir="$qtopia_incdir"
  4812. if test -z "$qtopia_incdir"; then
  4813. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4814. fi
  4815. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4816. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4817. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4818. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4819. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4820. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4821. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4822. is required.])
  4823. fi
  4824. AC_LANG_SAVE
  4825. AC_LANG_CPLUSPLUS
  4826. ac_cxxflags_safe="$CXXFLAGS"
  4827. ac_ldflags_safe="$LDFLAGS"
  4828. ac_libs_safe="$LIBS"
  4829. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4830. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4831. LIBS="$LIBS $LIB_TQTOPIA $LIBTQT"
  4832. cat > conftest.$ac_ext <<EOF
  4833. #include "confdefs.h"
  4834. #include <qpe/qpeapplication.h>
  4835. #include <qpe/version.h>
  4836. int main( int argc, char **argv )
  4837. {
  4838. QPEApplication app( argc, argv );
  4839. return 0;
  4840. }
  4841. EOF
  4842. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4843. rm -f conftest*
  4844. else
  4845. rm -f conftest*
  4846. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4847. the end of config.log])
  4848. fi
  4849. CXXFLAGS="$ac_cxxflags_safe"
  4850. LDFLAGS="$ac_ldflags_safe"
  4851. LIBS="$ac_libs_safe"
  4852. AC_LANG_RESTORE
  4853. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4854. AC_SUBST(QTOPIA_INCLUDES)
  4855. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4856. ])
  4857. AC_DEFUN([KDE_INIT_DOXYGEN],
  4858. [
  4859. AC_MSG_CHECKING([for Qt docs])
  4860. kde_qtdir=
  4861. if test "${with_qt_dir+set}" = set; then
  4862. kde_qtdir="$with_qt_dir"
  4863. fi
  4864. 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)
  4865. AC_MSG_RESULT($TQTDOCDIR)
  4866. AC_SUBST(TQTDOCDIR)
  4867. KDE_FIND_PATH(dot, DOT, [], [])
  4868. if test -n "$DOT"; then
  4869. KDE_HAVE_DOT="YES"
  4870. else
  4871. KDE_HAVE_DOT="NO"
  4872. fi
  4873. AC_SUBST(KDE_HAVE_DOT)
  4874. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4875. AC_SUBST(DOXYGEN)
  4876. DOXYGEN_PROJECT_NAME="$1"
  4877. DOXYGEN_PROJECT_NUMBER="$2"
  4878. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4879. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4880. KDE_HAS_DOXYGEN=no
  4881. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $TQTDOCDIR/qsql.html; then
  4882. KDE_HAS_DOXYGEN=yes
  4883. fi
  4884. AC_SUBST(KDE_HAS_DOXYGEN)
  4885. ])
  4886. AC_DEFUN([AC_FIND_BZIP2],
  4887. [
  4888. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4889. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4890. [
  4891. AC_LANG_SAVE
  4892. AC_LANG_CPLUSPLUS
  4893. kde_save_LIBS="$LIBS"
  4894. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4895. kde_save_CXXFLAGS="$CXXFLAGS"
  4896. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4897. AC_TRY_LINK(dnl
  4898. [
  4899. #define BZ_NO_STDIO
  4900. #include<bzlib.h>
  4901. ],
  4902. [ bz_stream s; (void) bzDecompress(&s); ],
  4903. eval "ac_cv_lib_bzip2='-lbz2'",
  4904. eval "ac_cv_lib_bzip2=no")
  4905. LIBS="$kde_save_LIBS"
  4906. CXXFLAGS="$kde_save_CXXFLAGS"
  4907. AC_LANG_RESTORE
  4908. ])dnl
  4909. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4910. if test ! "$ac_cv_lib_bzip2" = no; then
  4911. BZIP2DIR=bzip2
  4912. LIBBZ2="$ac_cv_lib_bzip2"
  4913. AC_SUBST(LIBBZ2)
  4914. else
  4915. cxx_shared_flag=
  4916. ld_shared_flag=
  4917. KDE_CHECK_COMPILER_FLAG(shared, [
  4918. ld_shared_flag="-shared"
  4919. ])
  4920. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4921. cxx_shared_flag="-fPIC"
  4922. ])
  4923. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4924. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4925. [
  4926. AC_LANG_SAVE
  4927. AC_LANG_CPLUSPLUS
  4928. kde_save_LIBS="$LIBS"
  4929. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4930. kde_save_CXXFLAGS="$CXXFLAGS"
  4931. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4932. AC_TRY_LINK(dnl
  4933. [
  4934. #define BZ_NO_STDIO
  4935. #include<bzlib.h>
  4936. ],
  4937. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4938. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4939. eval "ac_cv_lib_bzip2_prefix=no")
  4940. LIBS="$kde_save_LIBS"
  4941. CXXFLAGS="$kde_save_CXXFLAGS"
  4942. AC_LANG_RESTORE
  4943. ])dnl
  4944. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4945. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4946. BZIP2DIR=bzip2
  4947. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4948. AC_SUBST(LIBBZ2)
  4949. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4950. dnl else, we just ignore this
  4951. fi
  4952. fi
  4953. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4954. ])
  4955. dnl ------------------------------------------------------------------------
  4956. dnl Try to find the SSL headers and libraries.
  4957. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4958. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4959. dnl ------------------------------------------------------------------------
  4960. dnl
  4961. AC_DEFUN([KDE_CHECK_SSL],
  4962. [
  4963. LIBSSL="-lssl -lcrypto"
  4964. AC_REQUIRE([KDE_CHECK_LIB64])
  4965. ac_ssl_includes=NO ac_ssl_libraries=NO
  4966. ssl_libraries=""
  4967. ssl_includes=""
  4968. AC_ARG_WITH(ssl-dir,
  4969. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  4970. [ ac_ssl_includes="$withval"/include
  4971. ac_ssl_libraries="$withval"/lib$tdelibsuff
  4972. ])
  4973. want_ssl=yes
  4974. AC_ARG_WITH(ssl,
  4975. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  4976. [want_ssl=$withval])
  4977. if test $want_ssl = yes; then
  4978. AC_MSG_CHECKING(for OpenSSL)
  4979. AC_CACHE_VAL(ac_cv_have_ssl,
  4980. [#try to guess OpenSSL locations
  4981. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  4982. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  4983. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  4984. ac_ssl_includes="$ssl_incdir"
  4985. 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"
  4986. if test ! "$ac_ssl_libraries" = "NO"; then
  4987. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  4988. fi
  4989. test=NONE
  4990. ssl_libdir=NONE
  4991. for dir in $ssl_libdirs; do
  4992. try="ls -1 $dir/libssl*"
  4993. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  4994. done
  4995. ac_ssl_libraries="$ssl_libdir"
  4996. ac_ldflags_safe="$LDFLAGS"
  4997. ac_libs_safe="$LIBS"
  4998. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  4999. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  5000. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  5001. ac_ssl_rsaref="yes"
  5002. ,
  5003. ac_ssl_rsaref="no"
  5004. )
  5005. LDFLAGS="$ac_ldflags_safe"
  5006. LIBS="$ac_libs_safe"
  5007. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5008. have_ssl=no
  5009. else
  5010. have_ssl=yes;
  5011. fi
  5012. ])
  5013. eval "$ac_cv_have_ssl"
  5014. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5015. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5016. AC_MSG_RESULT($ac_ssl_rsaref)
  5017. AC_MSG_CHECKING([for easter eggs])
  5018. AC_MSG_RESULT([none found])
  5019. else
  5020. have_ssl=no
  5021. fi
  5022. if test "$have_ssl" = yes; then
  5023. AC_MSG_CHECKING(for OpenSSL version)
  5024. dnl Check for SSL version
  5025. AC_CACHE_VAL(ac_cv_ssl_version,
  5026. [
  5027. cat >conftest.$ac_ext <<EOF
  5028. #include <openssl/opensslv.h>
  5029. #include <stdio.h>
  5030. int main() {
  5031. #ifndef OPENSSL_VERSION_NUMBER
  5032. printf("ssl_version=\\"error\\"\n");
  5033. #else
  5034. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5035. printf("ssl_version=\\"old\\"\n");
  5036. else
  5037. printf("ssl_version=\\"ok\\"\n");
  5038. #endif
  5039. return (0);
  5040. }
  5041. EOF
  5042. ac_save_CPPFLAGS=$CPPFLAGS
  5043. if test "$ac_ssl_includes" != "/usr/include"; then
  5044. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5045. fi
  5046. if AC_TRY_EVAL(ac_link); then
  5047. if eval `./conftest 2>&5`; then
  5048. if test $ssl_version = error; then
  5049. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5050. else
  5051. if test $ssl_version = old; then
  5052. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5053. have_ssl=no
  5054. fi
  5055. fi
  5056. ac_cv_ssl_version="ssl_version=$ssl_version"
  5057. else
  5058. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5059. Check config.log, and if you can't figure it out, send a mail to
  5060. David Faure <faure@kde.org>, attaching your config.log])
  5061. fi
  5062. else
  5063. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5064. Check config.log, and if you can't figure it out, send a mail to
  5065. David Faure <faure@kde.org>, attaching your config.log])
  5066. fi
  5067. CPPFLAGS=$ac_save_CPPFLAGS
  5068. ])
  5069. eval "$ac_cv_ssl_version"
  5070. AC_MSG_RESULT($ssl_version)
  5071. fi
  5072. if test "$have_ssl" != yes; then
  5073. LIBSSL="";
  5074. else
  5075. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5076. ac_cv_have_ssl="have_ssl=yes \
  5077. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5078. ssl_libraries="$ac_ssl_libraries"
  5079. ssl_includes="$ac_ssl_includes"
  5080. if test "$ac_ssl_rsaref" = yes; then
  5081. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5082. fi
  5083. if test $ssl_version = "old"; then
  5084. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5085. fi
  5086. fi
  5087. SSL_INCLUDES=
  5088. if test "$ssl_includes" = "/usr/include"; then
  5089. if test -f /usr/kerberos/include/krb5.h; then
  5090. SSL_INCLUDES="-I/usr/kerberos/include"
  5091. fi
  5092. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5093. SSL_INCLUDES="-I$ssl_includes"
  5094. fi
  5095. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5096. SSL_LDFLAGS=""
  5097. else
  5098. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5099. fi
  5100. AC_SUBST(SSL_INCLUDES)
  5101. AC_SUBST(SSL_LDFLAGS)
  5102. AC_SUBST(LIBSSL)
  5103. ])
  5104. AC_DEFUN([KDE_CHECK_STRLCPY],
  5105. [
  5106. AC_REQUIRE([AC_CHECK_STRLCAT])
  5107. AC_REQUIRE([AC_CHECK_STRLCPY])
  5108. AC_CHECK_SIZEOF(size_t)
  5109. AC_CHECK_SIZEOF(unsigned long)
  5110. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5111. AC_TRY_COMPILE(,[
  5112. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5113. choke me
  5114. #endif
  5115. ],AC_MSG_RESULT([yes]),[
  5116. AC_MSG_RESULT(no)
  5117. AC_MSG_ERROR([
  5118. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5119. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5120. ])
  5121. ])
  5122. ])
  5123. AC_DEFUN([KDE_CHECK_BINUTILS],
  5124. [
  5125. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5126. kde_save_LDFLAGS="$LDFLAGS"
  5127. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5128. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5129. AC_TRY_LINK([int foo;],
  5130. [
  5131. #ifdef __INTEL_COMPILER
  5132. icc apparently does not support libtools version-info and version-script
  5133. at the same time. Dunno where the bug is, but until somebody figured out,
  5134. better disable the optional version scripts.
  5135. #endif
  5136. foo = 42;
  5137. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5138. LDFLAGS="$kde_save_LDFLAGS"
  5139. rm -f conftest.map
  5140. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5141. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5142. AC_MSG_RESULT($kde_supports_versionmaps)
  5143. ])
  5144. AC_DEFUN([AM_PROG_OBJC],[
  5145. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5146. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5147. if test "x${OBJCFLAGS-unset}" = xunset; then
  5148. OBJCFLAGS="-g -O2"
  5149. fi
  5150. AC_SUBST(OBJCFLAGS)
  5151. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5152. ])
  5153. AC_DEFUN([KDE_CHECK_PERL],
  5154. [
  5155. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5156. AC_MSG_ERROR([No Perl found in your $PATH.
  5157. We need perl to generate some code.])
  5158. ])
  5159. AC_SUBST(PERL)
  5160. ])
  5161. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5162. [
  5163. AC_SYS_LARGEFILE
  5164. if test "$ac_cv_sys_file_offset_bits" != no; then
  5165. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5166. fi
  5167. if test "x$ac_cv_sys_large_files" != "xno"; then
  5168. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5169. fi
  5170. ])
  5171. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5172. dnl which allows to search for libs that get installed into the KDE prefix.
  5173. dnl
  5174. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5175. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5176. dnl also defines KSTUFF_PKG_ERRORS on error
  5177. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5178. PKG_CONFIG_PATH="$prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5179. if test "$prefix" != "$kde_libs_prefix"; then
  5180. PKG_CONFIG_PATH="$kde_libs_prefix/lib${tdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5181. fi
  5182. export PKG_CONFIG_PATH
  5183. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5184. ])
  5185. dnl Check for PIE support in the compiler and linker
  5186. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5187. [
  5188. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5189. [
  5190. AC_LANG_SAVE
  5191. AC_LANG_CPLUSPLUS
  5192. safe_CXXFLAGS=$CXXFLAGS
  5193. safe_LDFLAGS=$LDFLAGS
  5194. CXXFLAGS="$CXXFLAGS -fPIE"
  5195. LDFLAGS="$LDFLAGS -pie"
  5196. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5197. CXXFLAGS=$safe_CXXFLAGS
  5198. LDFLAGS=$safe_LDFLAGS
  5199. AC_LANG_RESTORE
  5200. ])
  5201. AC_MSG_CHECKING(if enabling -pie/fPIE support)
  5202. AC_ARG_ENABLE(pie,
  5203. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5204. [kde_has_pie_support=$enableval],
  5205. [kde_has_pie_support=detect])
  5206. if test "$kde_has_pie_support" = "detect"; then
  5207. kde_has_pie_support=$kde_cv_val_pie_support
  5208. fi
  5209. AC_MSG_RESULT([$kde_has_pie_support])
  5210. KDE_USE_FPIE=""
  5211. KDE_USE_PIE=""
  5212. AC_SUBST([KDE_USE_FPIE])
  5213. AC_SUBST([KDE_USE_PIE])
  5214. if test "$kde_has_pie_support" = "yes"; then
  5215. KDE_USE_FPIE="-fPIE"
  5216. KDE_USE_PIE="-pie"
  5217. fi
  5218. ])
  5219. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  5220. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
  5221. ## Free Software Foundation, Inc.
  5222. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5223. ##
  5224. ## This program is free software; you can redistribute it and/or modify
  5225. ## it under the terms of the GNU General Public License as published by
  5226. ## the Free Software Foundation; either version 2 of the License, or
  5227. ## (at your option) any later version.
  5228. ##
  5229. ## This program is distributed in the hope that it will be useful, but
  5230. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  5231. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  5232. ## General Public License for more details.
  5233. ##
  5234. ## You should have received a copy of the GNU General Public License
  5235. ## along with this program; if not, write to the Free Software
  5236. ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  5237. ##
  5238. ## As a special exception to the GNU General Public License, if you
  5239. ## distribute this file as part of a program that contains a
  5240. ## configuration script generated by Autoconf, you may include it under
  5241. ## the same distribution terms that you use for the rest of that program.
  5242. # serial 47 AC_PROG_LIBTOOL
  5243. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  5244. # -----------------------------------------------------------
  5245. # If this macro is not defined by Autoconf, define it here.
  5246. m4_ifdef([AC_PROVIDE_IFELSE],
  5247. [],
  5248. [m4_define([AC_PROVIDE_IFELSE],
  5249. [m4_ifdef([AC_PROVIDE_$1],
  5250. [$2], [$3])])])
  5251. # AC_PROG_LIBTOOL
  5252. # ---------------
  5253. AC_DEFUN([AC_PROG_LIBTOOL],
  5254. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  5255. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  5256. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  5257. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  5258. [AC_LIBTOOL_CXX],
  5259. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  5260. ])])
  5261. dnl And a similar setup for Fortran 77 support
  5262. AC_PROVIDE_IFELSE([AC_PROG_F77],
  5263. [AC_LIBTOOL_F77],
  5264. [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
  5265. ])])
  5266. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  5267. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  5268. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  5269. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  5270. [AC_LIBTOOL_GCJ],
  5271. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  5272. [AC_LIBTOOL_GCJ],
  5273. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  5274. [AC_LIBTOOL_GCJ],
  5275. [ifdef([AC_PROG_GCJ],
  5276. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5277. ifdef([A][M_PROG_GCJ],
  5278. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5279. ifdef([LT_AC_PROG_GCJ],
  5280. [define([LT_AC_PROG_GCJ],
  5281. defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
  5282. ])])# AC_PROG_LIBTOOL
  5283. # _AC_PROG_LIBTOOL
  5284. # ----------------
  5285. AC_DEFUN([_AC_PROG_LIBTOOL],
  5286. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  5287. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  5288. AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
  5289. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  5290. # This can be used to rebuild libtool when needed
  5291. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  5292. # Always use our own libtool.
  5293. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
  5294. AC_SUBST(LIBTOOL)dnl
  5295. # Prevent multiple expansion
  5296. define([AC_PROG_LIBTOOL], [])
  5297. ])# _AC_PROG_LIBTOOL
  5298. # AC_LIBTOOL_SETUP
  5299. # ----------------
  5300. AC_DEFUN([AC_LIBTOOL_SETUP],
  5301. [AC_PREREQ(2.50)dnl
  5302. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  5303. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  5304. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  5305. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  5306. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  5307. AC_REQUIRE([AC_PROG_CC])dnl
  5308. AC_REQUIRE([AC_PROG_LD])dnl
  5309. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  5310. AC_REQUIRE([AC_PROG_NM])dnl
  5311. AC_REQUIRE([AC_PROG_LN_S])dnl
  5312. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  5313. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  5314. AC_REQUIRE([AC_OBJEXT])dnl
  5315. AC_REQUIRE([AC_EXEEXT])dnl
  5316. dnl
  5317. AC_LIBTOOL_SYS_MAX_CMD_LEN
  5318. AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  5319. AC_LIBTOOL_OBJDIR
  5320. AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5321. _LT_AC_PROG_ECHO_BACKSLASH
  5322. case $host_os in
  5323. aix3*)
  5324. # AIX sometimes has problems with the GCC collect2 program. For some
  5325. # reason, if we set the COLLECT_NAMES environment variable, the problems
  5326. # vanish in a puff of smoke.
  5327. if test "X${COLLECT_NAMES+set}" != Xset; then
  5328. COLLECT_NAMES=
  5329. export COLLECT_NAMES
  5330. fi
  5331. ;;
  5332. esac
  5333. # Sed substitution that helps us do robust quoting. It backslashifies
  5334. # metacharacters that are still active within double-quoted strings.
  5335. Xsed='sed -e s/^X//'
  5336. [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
  5337. # Same as above, but do not quote variable references.
  5338. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
  5339. # Sed substitution to delay expansion of an escaped shell variable in a
  5340. # double_quote_subst'ed string.
  5341. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  5342. # Sed substitution to avoid accidental globbing in evaled expressions
  5343. no_glob_subst='s/\*/\\\*/g'
  5344. # Constants:
  5345. rm="rm -f"
  5346. # Global variables:
  5347. default_ofile=libtool
  5348. can_build_shared=yes
  5349. # All known linkers require a `.a' archive for static linking (except M$VC,
  5350. # which needs '.lib').
  5351. libext=a
  5352. ltmain="$ac_aux_dir/ltmain.sh"
  5353. ofile="$default_ofile"
  5354. with_gnu_ld="$lt_cv_prog_gnu_ld"
  5355. AC_CHECK_TOOL(AR, ar, false)
  5356. AC_CHECK_TOOL(RANLIB, ranlib, :)
  5357. AC_CHECK_TOOL(STRIP, strip, :)
  5358. old_CC="$CC"
  5359. old_CFLAGS="$CFLAGS"
  5360. # Set sane defaults for various variables
  5361. test -z "$AR" && AR=ar
  5362. test -z "$AR_FLAGS" && AR_FLAGS=cru
  5363. test -z "$AS" && AS=as
  5364. test -z "$CC" && CC=cc
  5365. test -z "$LTCC" && LTCC=$CC
  5366. test -z "$DLLTOOL" && DLLTOOL=dlltool
  5367. test -z "$LD" && LD=ld
  5368. test -z "$LN_S" && LN_S="ln -s"
  5369. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  5370. test -z "$NM" && NM=nm
  5371. test -z "$SED" && SED=sed
  5372. test -z "$OBJDUMP" && OBJDUMP=objdump
  5373. test -z "$RANLIB" && RANLIB=:
  5374. test -z "$STRIP" && STRIP=:
  5375. test -z "$ac_objext" && ac_objext=o
  5376. # Determine commands to create old-style static archives.
  5377. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  5378. old_postinstall_cmds='chmod 644 $oldlib'
  5379. old_postuninstall_cmds=
  5380. if test -n "$RANLIB"; then
  5381. case $host_os in
  5382. openbsd*)
  5383. old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
  5384. ;;
  5385. *)
  5386. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  5387. ;;
  5388. esac
  5389. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  5390. fi
  5391. # Only perform the check for file, if the check method requires it
  5392. case $deplibs_check_method in
  5393. file_magic*)
  5394. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  5395. AC_PATH_MAGIC
  5396. fi
  5397. ;;
  5398. esac
  5399. AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  5400. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5401. enable_win32_dll=yes, enable_win32_dll=no)
  5402. AC_ARG_ENABLE([libtool-lock],
  5403. [AC_HELP_STRING([--disable-libtool-lock],
  5404. [avoid locking (might break parallel builds)])])
  5405. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5406. AC_ARG_WITH([pic],
  5407. [AC_HELP_STRING([--with-pic],
  5408. [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  5409. [pic_mode="$withval"],
  5410. [pic_mode=default])
  5411. test -z "$pic_mode" && pic_mode=default
  5412. # Use C for the default configuration in the libtool script
  5413. tagname=
  5414. AC_LIBTOOL_LANG_C_CONFIG
  5415. _LT_AC_TAGCONFIG
  5416. ])# AC_LIBTOOL_SETUP
  5417. # _LT_AC_SYS_COMPILER
  5418. # -------------------
  5419. AC_DEFUN([_LT_AC_SYS_COMPILER],
  5420. [AC_REQUIRE([AC_PROG_CC])dnl
  5421. # If no C compiler was specified, use CC.
  5422. LTCC=${LTCC-"$CC"}
  5423. # Allow CC to be a program name with arguments.
  5424. compiler=$CC
  5425. ])# _LT_AC_SYS_COMPILER
  5426. # _LT_AC_SYS_LIBPATH_AIX
  5427. # ----------------------
  5428. # Links a minimal program and checks the executable
  5429. # for the system default hardcoded library path. In most cases,
  5430. # this is /usr/lib:/lib, but when the MPI compilers are used
  5431. # the location of the communication and MPI libs are included too.
  5432. # If we don't find anything, use the default library path according
  5433. # to the aix ld manual.
  5434. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
  5435. [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  5436. aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5437. }'`
  5438. # Check for a 64-bit object if we didn't find anything.
  5439. 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; }
  5440. }'`; fi],[])
  5441. if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  5442. ])# _LT_AC_SYS_LIBPATH_AIX
  5443. # _LT_AC_SHELL_INIT(ARG)
  5444. # ----------------------
  5445. AC_DEFUN([_LT_AC_SHELL_INIT],
  5446. [ifdef([AC_DIVERSION_NOTICE],
  5447. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  5448. [AC_DIVERT_PUSH(NOTICE)])
  5449. $1
  5450. AC_DIVERT_POP
  5451. ])# _LT_AC_SHELL_INIT
  5452. # _LT_AC_PROG_ECHO_BACKSLASH
  5453. # --------------------------
  5454. # Add some code to the start of the generated configure script which
  5455. # will find an echo command which doesn't interpret backslashes.
  5456. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  5457. [_LT_AC_SHELL_INIT([
  5458. # Check that we are running under the correct shell.
  5459. SHELL=${CONFIG_SHELL-/bin/sh}
  5460. case X$ECHO in
  5461. X*--fallback-echo)
  5462. # Remove one level of quotation (which was required for Make).
  5463. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  5464. ;;
  5465. esac
  5466. echo=${ECHO-echo}
  5467. if test "X[$]1" = X--no-reexec; then
  5468. # Discard the --no-reexec flag, and continue.
  5469. shift
  5470. elif test "X[$]1" = X--fallback-echo; then
  5471. # Avoid inline document here, it may be left over
  5472. :
  5473. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
  5474. # Yippee, $echo works!
  5475. :
  5476. else
  5477. # Restart under the correct shell.
  5478. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5479. fi
  5480. if test "X[$]1" = X--fallback-echo; then
  5481. # used as fallback echo
  5482. shift
  5483. cat <<EOF
  5484. [$]*
  5485. EOF
  5486. exit 0
  5487. fi
  5488. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5489. # if CDPATH is set.
  5490. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  5491. if test -z "$ECHO"; then
  5492. if test "X${echo_test_string+set}" != Xset; then
  5493. # find a string as large as possible, as long as the shell can cope with it
  5494. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  5495. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  5496. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  5497. echo_test_string="`eval $cmd`" &&
  5498. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  5499. then
  5500. break
  5501. fi
  5502. done
  5503. fi
  5504. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5505. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5506. test "X$echo_testing_string" = "X$echo_test_string"; then
  5507. :
  5508. else
  5509. # The Solaris, AIX, and Digital Unix default echo programs unquote
  5510. # backslashes. This makes it impossible to quote backslashes using
  5511. # echo "$something" | sed 's/\\/\\\\/g'
  5512. #
  5513. # So, first we look for a working echo in the user's PATH.
  5514. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  5515. for dir in $PATH /usr/ucb; do
  5516. IFS="$lt_save_ifs"
  5517. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  5518. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  5519. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  5520. test "X$echo_testing_string" = "X$echo_test_string"; then
  5521. echo="$dir/echo"
  5522. break
  5523. fi
  5524. done
  5525. IFS="$lt_save_ifs"
  5526. if test "X$echo" = Xecho; then
  5527. # We didn't find a better echo, so look for alternatives.
  5528. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  5529. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  5530. test "X$echo_testing_string" = "X$echo_test_string"; then
  5531. # This shell has a builtin print -r that does the trick.
  5532. echo='print -r'
  5533. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  5534. test "X$CONFIG_SHELL" != X/bin/ksh; then
  5535. # If we have ksh, try running configure again with it.
  5536. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  5537. export ORIGINAL_CONFIG_SHELL
  5538. CONFIG_SHELL=/bin/ksh
  5539. export CONFIG_SHELL
  5540. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5541. else
  5542. # Try using printf.
  5543. echo='printf %s\n'
  5544. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5545. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5546. test "X$echo_testing_string" = "X$echo_test_string"; then
  5547. # Cool, printf works
  5548. :
  5549. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5550. test "X$echo_testing_string" = 'X\t' &&
  5551. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5552. test "X$echo_testing_string" = "X$echo_test_string"; then
  5553. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  5554. export CONFIG_SHELL
  5555. SHELL="$CONFIG_SHELL"
  5556. export SHELL
  5557. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5558. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5559. test "X$echo_testing_string" = 'X\t' &&
  5560. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5561. test "X$echo_testing_string" = "X$echo_test_string"; then
  5562. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5563. else
  5564. # maybe with a smaller string...
  5565. prev=:
  5566. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  5567. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  5568. then
  5569. break
  5570. fi
  5571. prev="$cmd"
  5572. done
  5573. if test "$prev" != 'sed 50q "[$]0"'; then
  5574. echo_test_string=`eval $prev`
  5575. export echo_test_string
  5576. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  5577. else
  5578. # Oops. We lost completely, so just stick with echo.
  5579. echo=echo
  5580. fi
  5581. fi
  5582. fi
  5583. fi
  5584. fi
  5585. fi
  5586. # Copy echo and quote the copy suitably for passing to libtool from
  5587. # the Makefile, instead of quoting the original, which is used later.
  5588. ECHO=$echo
  5589. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  5590. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  5591. fi
  5592. AC_SUBST(ECHO)
  5593. ])])# _LT_AC_PROG_ECHO_BACKSLASH
  5594. # _LT_AC_LOCK
  5595. # -----------
  5596. AC_DEFUN([_LT_AC_LOCK],
  5597. [AC_ARG_ENABLE([libtool-lock],
  5598. [AC_HELP_STRING([--disable-libtool-lock],
  5599. [avoid locking (might break parallel builds)])])
  5600. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5601. # Some flags need to be propagated to the compiler or linker for good
  5602. # libtool support.
  5603. case $host in
  5604. ia64-*-hpux*)
  5605. # Find out which ABI we are using.
  5606. echo 'int i;' > conftest.$ac_ext
  5607. if AC_TRY_EVAL(ac_compile); then
  5608. case `/usr/bin/file conftest.$ac_objext` in
  5609. *ELF-32*)
  5610. HPUX_IA64_MODE="32"
  5611. ;;
  5612. *ELF-64*)
  5613. HPUX_IA64_MODE="64"
  5614. ;;
  5615. esac
  5616. fi
  5617. rm -rf conftest*
  5618. ;;
  5619. *-*-irix6*)
  5620. # Find out which ABI we are using.
  5621. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  5622. if AC_TRY_EVAL(ac_compile); then
  5623. if test "$lt_cv_prog_gnu_ld" = yes; then
  5624. case `/usr/bin/file conftest.$ac_objext` in
  5625. *32-bit*)
  5626. LD="${LD-ld} -melf32bsmip"
  5627. ;;
  5628. *N32*)
  5629. LD="${LD-ld} -melf32bmipn32"
  5630. ;;
  5631. *64-bit*)
  5632. LD="${LD-ld} -melf64bmip"
  5633. ;;
  5634. esac
  5635. else
  5636. case `/usr/bin/file conftest.$ac_objext` in
  5637. *32-bit*)
  5638. LD="${LD-ld} -32"
  5639. ;;
  5640. *N32*)
  5641. LD="${LD-ld} -n32"
  5642. ;;
  5643. *64-bit*)
  5644. LD="${LD-ld} -64"
  5645. ;;
  5646. esac
  5647. fi
  5648. fi
  5649. rm -rf conftest*
  5650. ;;
  5651. x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  5652. # Find out which ABI we are using.
  5653. echo 'int i;' > conftest.$ac_ext
  5654. if AC_TRY_EVAL(ac_compile); then
  5655. case "`/usr/bin/file conftest.o`" in
  5656. *32-bit*)
  5657. LINUX_64_MODE="32"
  5658. case $host in
  5659. x86_64-*linux*)
  5660. LD="${LD-ld} -m elf_i386"
  5661. ;;
  5662. ppc64-*linux*)
  5663. LD="${LD-ld} -m elf32ppclinux"
  5664. ;;
  5665. s390x-*linux*)
  5666. LD="${LD-ld} -m elf_s390"
  5667. ;;
  5668. sparc64-*linux*)
  5669. LD="${LD-ld} -m elf32_sparc"
  5670. ;;
  5671. esac
  5672. ;;
  5673. *64-bit*)
  5674. LINUX_64_MODE="64"
  5675. case $host in
  5676. x86_64-*linux*)
  5677. LD="${LD-ld} -m elf_x86_64"
  5678. ;;
  5679. ppc*-*linux*|powerpc*-*linux*)
  5680. LD="${LD-ld} -m elf64ppc"
  5681. ;;
  5682. s390*-*linux*)
  5683. LD="${LD-ld} -m elf64_s390"
  5684. ;;
  5685. sparc*-*linux*)
  5686. LD="${LD-ld} -m elf64_sparc"
  5687. ;;
  5688. esac
  5689. ;;
  5690. esac
  5691. fi
  5692. rm -rf conftest*
  5693. ;;
  5694. *-*-sco3.2v5*)
  5695. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  5696. SAVE_CFLAGS="$CFLAGS"
  5697. CFLAGS="$CFLAGS -belf"
  5698. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  5699. [AC_LANG_PUSH(C)
  5700. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  5701. AC_LANG_POP])
  5702. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  5703. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  5704. CFLAGS="$SAVE_CFLAGS"
  5705. fi
  5706. ;;
  5707. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5708. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  5709. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  5710. AC_CHECK_TOOL(AS, as, false)
  5711. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  5712. ;;
  5713. ])
  5714. esac
  5715. need_locks="$enable_libtool_lock"
  5716. ])# _LT_AC_LOCK
  5717. # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5718. # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  5719. # ----------------------------------------------------------------
  5720. # Check whether the given compiler option works
  5721. AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
  5722. [AC_REQUIRE([LT_AC_PROG_SED])
  5723. AC_CACHE_CHECK([$1], [$2],
  5724. [$2=no
  5725. ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  5726. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  5727. lt_compiler_flag="$3"
  5728. # Insert the option either (1) after the last *FLAGS variable, or
  5729. # (2) before a word containing "conftest.", or (3) at the end.
  5730. # Note that $ac_compile itself does not contain backslashes and begins
  5731. # with a dollar sign (not a hyphen), so the echo should work correctly.
  5732. # The option is referenced via a variable to avoid confusing sed.
  5733. lt_compile=`echo "$ac_compile" | $SED \
  5734. -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
  5735. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  5736. -e 's:$: $lt_compiler_flag:'`
  5737. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  5738. (eval "$lt_compile" 2>conftest.err)
  5739. ac_status=$?
  5740. cat conftest.err >&AS_MESSAGE_LOG_FD
  5741. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5742. if (exit $ac_status) && test -s "$ac_outfile"; then
  5743. # The compiler can only warn and ignore the option if not recognized
  5744. # So say no if there are warnings
  5745. if test ! -s conftest.err; then
  5746. $2=yes
  5747. fi
  5748. fi
  5749. $rm conftest*
  5750. ])
  5751. if test x"[$]$2" = xyes; then
  5752. ifelse([$5], , :, [$5])
  5753. else
  5754. ifelse([$6], , :, [$6])
  5755. fi
  5756. ])# AC_LIBTOOL_COMPILER_OPTION
  5757. # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5758. # [ACTION-SUCCESS], [ACTION-FAILURE])
  5759. # ------------------------------------------------------------
  5760. # Check whether the given compiler option works
  5761. AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
  5762. [AC_CACHE_CHECK([$1], [$2],
  5763. [$2=no
  5764. save_LDFLAGS="$LDFLAGS"
  5765. LDFLAGS="$LDFLAGS $3"
  5766. printf "$lt_simple_link_test_code" > conftest.$ac_ext
  5767. if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  5768. # The compiler can only warn and ignore the option if not recognized
  5769. # So say no if there are warnings
  5770. if test -s conftest.err; then
  5771. # Append any errors to the config.log.
  5772. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5773. else
  5774. $2=yes
  5775. fi
  5776. fi
  5777. $rm conftest*
  5778. LDFLAGS="$save_LDFLAGS"
  5779. ])
  5780. if test x"[$]$2" = xyes; then
  5781. ifelse([$4], , :, [$4])
  5782. else
  5783. ifelse([$5], , :, [$5])
  5784. fi
  5785. ])# AC_LIBTOOL_LINKER_OPTION
  5786. # AC_LIBTOOL_SYS_MAX_CMD_LEN
  5787. # --------------------------
  5788. AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
  5789. [# find the maximum length of command line arguments
  5790. AC_MSG_CHECKING([the maximum length of command line arguments])
  5791. AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  5792. i=0
  5793. testring="ABCD"
  5794. case $build_os in
  5795. msdosdjgpp*)
  5796. # On DJGPP, this test can blow up pretty badly due to problems in libc
  5797. # (any single argument exceeding 2000 bytes causes a buffer overrun
  5798. # during glob expansion). Even if it were fixed, the result of this
  5799. # check would be larger than it should be.
  5800. lt_cv_sys_max_cmd_len=12288; # 12K is about right
  5801. ;;
  5802. gnu*)
  5803. # Under GNU Hurd, this test is not required because there is
  5804. # no limit to the length of command line arguments.
  5805. # Libtool will interpret -1 as no limit whatsoever
  5806. lt_cv_sys_max_cmd_len=-1;
  5807. ;;
  5808. cygwin* | mingw*)
  5809. # On Win9x/ME, this test blows up -- it succeeds, but takes
  5810. # about 5 minutes as the teststring grows exponentially.
  5811. # Worse, since 9x/ME are not pre-emptively multitasking,
  5812. # you end up with a "frozen" computer, even though with patience
  5813. # the test eventually succeeds (with a max line length of 256k).
  5814. # Instead, let's just punt: use the minimum linelength reported by
  5815. # all of the supported platforms: 8192 (on NT/2K/XP).
  5816. lt_cv_sys_max_cmd_len=8192;
  5817. ;;
  5818. *)
  5819. # If test is not a shell built-in, we'll probably end up computing a
  5820. # maximum length that is only half of the actual maximum length, but
  5821. # we can't tell.
  5822. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
  5823. = "XX$testring") >/dev/null 2>&1 &&
  5824. new_result=`expr "X$testring" : ".*" 2>&1` &&
  5825. lt_cv_sys_max_cmd_len=$new_result &&
  5826. test $i != 17 # 1/2 MB should be enough
  5827. do
  5828. i=`expr $i + 1`
  5829. testring=$testring$testring
  5830. done
  5831. testring=
  5832. # Add a significant safety factor because C++ compilers can tack on massive
  5833. # amounts of additional arguments before passing them to the linker.
  5834. # It appears as though 1/2 is a usable value.
  5835. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  5836. ;;
  5837. esac
  5838. ])
  5839. if test -n $lt_cv_sys_max_cmd_len ; then
  5840. AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  5841. else
  5842. AC_MSG_RESULT(none)
  5843. fi
  5844. ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  5845. # _LT_AC_CHECK_DLFCN
  5846. # --------------------
  5847. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  5848. [AC_CHECK_HEADERS(dlfcn.h)dnl
  5849. ])# _LT_AC_CHECK_DLFCN
  5850. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  5851. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  5852. # ------------------------------------------------------------------
  5853. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  5854. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5855. if test "$cross_compiling" = yes; then :
  5856. [$4]
  5857. else
  5858. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  5859. lt_status=$lt_dlunknown
  5860. cat > conftest.$ac_ext <<EOF
  5861. [#line __oline__ "configure"
  5862. #include "confdefs.h"
  5863. #if HAVE_DLFCN_H
  5864. #include <dlfcn.h>
  5865. #endif
  5866. #include <stdio.h>
  5867. #ifdef RTLD_GLOBAL
  5868. # define LT_DLGLOBAL RTLD_GLOBAL
  5869. #else
  5870. # ifdef DL_GLOBAL
  5871. # define LT_DLGLOBAL DL_GLOBAL
  5872. # else
  5873. # define LT_DLGLOBAL 0
  5874. # endif
  5875. #endif
  5876. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  5877. find out it does not work in some platform. */
  5878. #ifndef LT_DLLAZY_OR_NOW
  5879. # ifdef RTLD_LAZY
  5880. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  5881. # else
  5882. # ifdef DL_LAZY
  5883. # define LT_DLLAZY_OR_NOW DL_LAZY
  5884. # else
  5885. # ifdef RTLD_NOW
  5886. # define LT_DLLAZY_OR_NOW RTLD_NOW
  5887. # else
  5888. # ifdef DL_NOW
  5889. # define LT_DLLAZY_OR_NOW DL_NOW
  5890. # else
  5891. # define LT_DLLAZY_OR_NOW 0
  5892. # endif
  5893. # endif
  5894. # endif
  5895. # endif
  5896. #endif
  5897. #ifdef __cplusplus
  5898. extern "C" void exit (int);
  5899. #endif
  5900. void fnord() { int i=42;}
  5901. int main ()
  5902. {
  5903. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  5904. int status = $lt_dlunknown;
  5905. if (self)
  5906. {
  5907. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  5908. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  5909. /* dlclose (self); */
  5910. }
  5911. exit (status);
  5912. }]
  5913. EOF
  5914. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  5915. (./conftest; exit; ) 2>/dev/null
  5916. lt_status=$?
  5917. case x$lt_status in
  5918. x$lt_dlno_uscore) $1 ;;
  5919. x$lt_dlneed_uscore) $2 ;;
  5920. x$lt_unknown|x*) $3 ;;
  5921. esac
  5922. else :
  5923. # compilation failed
  5924. $3
  5925. fi
  5926. fi
  5927. rm -fr conftest*
  5928. ])# _LT_AC_TRY_DLOPEN_SELF
  5929. # AC_LIBTOOL_DLOPEN_SELF
  5930. # -------------------
  5931. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  5932. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5933. if test "x$enable_dlopen" != xyes; then
  5934. enable_dlopen=unknown
  5935. enable_dlopen_self=unknown
  5936. enable_dlopen_self_static=unknown
  5937. else
  5938. lt_cv_dlopen=no
  5939. lt_cv_dlopen_libs=
  5940. case $host_os in
  5941. beos*)
  5942. lt_cv_dlopen="load_add_on"
  5943. lt_cv_dlopen_libs=
  5944. lt_cv_dlopen_self=yes
  5945. ;;
  5946. mingw* | pw32*)
  5947. lt_cv_dlopen="LoadLibrary"
  5948. lt_cv_dlopen_libs=
  5949. ;;
  5950. cygwin*)
  5951. lt_cv_dlopen="dlopen"
  5952. lt_cv_dlopen_libs=
  5953. ;;
  5954. darwin*)
  5955. # if libdl is installed we need to link against it
  5956. AC_CHECK_LIB([dl], [dlopen],
  5957. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  5958. lt_cv_dlopen="dyld"
  5959. lt_cv_dlopen_libs=
  5960. lt_cv_dlopen_self=yes
  5961. ])
  5962. ;;
  5963. *)
  5964. AC_CHECK_FUNC([shl_load],
  5965. [lt_cv_dlopen="shl_load"],
  5966. [AC_CHECK_LIB([dld], [shl_load],
  5967. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  5968. [AC_CHECK_FUNC([dlopen],
  5969. [lt_cv_dlopen="dlopen"],
  5970. [AC_CHECK_LIB([dl], [dlopen],
  5971. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  5972. [AC_CHECK_LIB([svld], [dlopen],
  5973. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  5974. [AC_CHECK_LIB([dld], [dld_link],
  5975. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  5976. ])
  5977. ])
  5978. ])
  5979. ])
  5980. ])
  5981. ;;
  5982. esac
  5983. if test "x$lt_cv_dlopen" != xno; then
  5984. enable_dlopen=yes
  5985. else
  5986. enable_dlopen=no
  5987. fi
  5988. case $lt_cv_dlopen in
  5989. dlopen)
  5990. save_CPPFLAGS="$CPPFLAGS"
  5991. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  5992. save_LDFLAGS="$LDFLAGS"
  5993. eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  5994. save_LIBS="$LIBS"
  5995. LIBS="$lt_cv_dlopen_libs $LIBS"
  5996. AC_CACHE_CHECK([whether a program can dlopen itself],
  5997. lt_cv_dlopen_self, [dnl
  5998. _LT_AC_TRY_DLOPEN_SELF(
  5999. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  6000. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  6001. ])
  6002. if test "x$lt_cv_dlopen_self" = xyes; then
  6003. LDFLAGS="$LDFLAGS $link_static_flag"
  6004. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  6005. lt_cv_dlopen_self_static, [dnl
  6006. _LT_AC_TRY_DLOPEN_SELF(
  6007. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  6008. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  6009. ])
  6010. fi
  6011. CPPFLAGS="$save_CPPFLAGS"
  6012. LDFLAGS="$save_LDFLAGS"
  6013. LIBS="$save_LIBS"
  6014. ;;
  6015. esac
  6016. case $lt_cv_dlopen_self in
  6017. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6018. *) enable_dlopen_self=unknown ;;
  6019. esac
  6020. case $lt_cv_dlopen_self_static in
  6021. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6022. *) enable_dlopen_self_static=unknown ;;
  6023. esac
  6024. fi
  6025. ])# AC_LIBTOOL_DLOPEN_SELF
  6026. # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
  6027. # ---------------------------------
  6028. # Check to see if options -c and -o are simultaneously supported by compiler
  6029. AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
  6030. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  6031. AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  6032. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  6033. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  6034. $rm -r conftest 2>/dev/null
  6035. mkdir conftest
  6036. cd conftest
  6037. mkdir out
  6038. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  6039. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  6040. # that will create temporary files in the current directory regardless of
  6041. # the output directory. Thus, making CWD read-only will cause this test
  6042. # to fail, enabling locking or at least warning the user not to do parallel
  6043. # builds.
  6044. chmod -w .
  6045. lt_compiler_flag="-o out/conftest2.$ac_objext"
  6046. # Insert the option either (1) after the last *FLAGS variable, or
  6047. # (2) before a word containing "conftest.", or (3) at the end.
  6048. # Note that $ac_compile itself does not contain backslashes and begins
  6049. # with a dollar sign (not a hyphen), so the echo should work correctly.
  6050. lt_compile=`echo "$ac_compile" | $SED \
  6051. -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
  6052. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  6053. -e 's:$: $lt_compiler_flag:'`
  6054. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  6055. (eval "$lt_compile" 2>out/conftest.err)
  6056. ac_status=$?
  6057. cat out/conftest.err >&AS_MESSAGE_LOG_FD
  6058. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  6059. if (exit $ac_status) && test -s out/conftest2.$ac_objext
  6060. then
  6061. # The compiler can only warn and ignore the option if not recognized
  6062. # So say no if there are warnings
  6063. if test ! -s out/conftest.err; then
  6064. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  6065. fi
  6066. fi
  6067. chmod u+w .
  6068. $rm conftest* out/*
  6069. rmdir out
  6070. cd ..
  6071. rmdir conftest
  6072. $rm conftest*
  6073. ])
  6074. ])# AC_LIBTOOL_PROG_CC_C_O
  6075. # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
  6076. # -----------------------------------------
  6077. # Check to see if we can do hard links to lock some files if needed
  6078. AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
  6079. [AC_REQUIRE([_LT_AC_LOCK])dnl
  6080. hard_links="nottested"
  6081. if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  6082. # do not overwrite the value of need_locks provided by the user
  6083. AC_MSG_CHECKING([if we can lock with hard links])
  6084. hard_links=yes
  6085. $rm conftest*
  6086. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6087. touch conftest.a
  6088. ln conftest.a conftest.b 2>&5 || hard_links=no
  6089. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6090. AC_MSG_RESULT([$hard_links])
  6091. if test "$hard_links" = no; then
  6092. AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  6093. need_locks=warn
  6094. fi
  6095. else
  6096. need_locks=no
  6097. fi
  6098. ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  6099. # AC_LIBTOOL_OBJDIR
  6100. # -----------------
  6101. AC_DEFUN([AC_LIBTOOL_OBJDIR],
  6102. [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  6103. [rm -f .libs 2>/dev/null
  6104. mkdir .libs 2>/dev/null
  6105. if test -d .libs; then
  6106. lt_cv_objdir=.libs
  6107. else
  6108. # MS-DOS does not allow filenames that begin with a dot.
  6109. lt_cv_objdir=_libs
  6110. fi
  6111. rmdir .libs 2>/dev/null])
  6112. objdir=$lt_cv_objdir
  6113. ])# AC_LIBTOOL_OBJDIR
  6114. # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
  6115. # ----------------------------------------------
  6116. # Check hardcoding attributes.
  6117. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  6118. [AC_MSG_CHECKING([how to hardcode library paths into programs])
  6119. _LT_AC_TAGVAR(hardcode_action, $1)=
  6120. if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
  6121. test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
  6122. test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
  6123. # We can hardcode non-existant directories.
  6124. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  6125. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  6126. # have to relink, otherwise we might link with an installed library
  6127. # when we should be linking with a yet-to-be-installed one
  6128. ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  6129. test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  6130. # Linking always hardcodes the temporary library directory.
  6131. _LT_AC_TAGVAR(hardcode_action, $1)=relink
  6132. else
  6133. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  6134. _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  6135. fi
  6136. else
  6137. # We cannot hardcode anything, or else we can only hardcode existing
  6138. # directories.
  6139. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  6140. fi
  6141. AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  6142. if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  6143. # Fast installation is not supported
  6144. enable_fast_install=no
  6145. elif test "$shlibpath_overrides_runpath" = yes ||
  6146. test "$enable_shared" = no; then
  6147. # Fast installation is not necessary
  6148. enable_fast_install=needless
  6149. fi
  6150. ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  6151. # AC_LIBTOOL_SYS_LIB_STRIP
  6152. # ------------------------
  6153. AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
  6154. [striplib=
  6155. old_striplib=
  6156. AC_MSG_CHECKING([whether stripping libraries is possible])
  6157. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  6158. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  6159. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  6160. AC_MSG_RESULT([yes])
  6161. else
  6162. # FIXME - insert some real tests, host_os isn't really good enough
  6163. case $host_os in
  6164. darwin*)
  6165. if test -n "$STRIP" ; then
  6166. striplib="$STRIP -x"
  6167. AC_MSG_RESULT([yes])
  6168. else
  6169. AC_MSG_RESULT([no])
  6170. fi
  6171. ;;
  6172. *)
  6173. AC_MSG_RESULT([no])
  6174. ;;
  6175. esac
  6176. fi
  6177. ])# AC_LIBTOOL_SYS_LIB_STRIP
  6178. # AC_LIBTOOL_SYS_DYNAMIC_LINKER
  6179. # -----------------------------
  6180. # PORTME Fill in your ld.so characteristics
  6181. AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
  6182. [AC_MSG_CHECKING([dynamic linker characteristics])
  6183. library_names_spec=
  6184. libname_spec='lib$name'
  6185. soname_spec=
  6186. shrext=".so"
  6187. postinstall_cmds=
  6188. postuninstall_cmds=
  6189. finish_cmds=
  6190. finish_eval=
  6191. shlibpath_var=
  6192. shlibpath_overrides_runpath=unknown
  6193. version_type=none
  6194. dynamic_linker="$host_os ld