KnowIt – tool for managing notes
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.
 
 
 

12041 lines
374 KiB

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