KMatplot – a gnuplot-like tool for plotting data sets in either two or three dimensions
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.
 
 
 
 
 
 

5103 lines
138 KiB

  1. dnl aclocal.m4 generated automatically by aclocal 1.4-p5
  2. dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl This program is distributed in the hope that it will be useful,
  7. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. dnl PARTICULAR PURPOSE.
  10. dnl This file is part of the KDE libraries/packages
  11. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  12. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  13. dnl This file is free software; you can redistribute it and/or
  14. dnl modify it under the terms of the GNU Library General Public
  15. dnl License as published by the Free Software Foundation; either
  16. dnl version 2 of the License, or (at your option) any later version.
  17. dnl This library is distributed in the hope that it will be useful,
  18. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. dnl Library General Public License for more details.
  21. dnl You should have received a copy of the GNU Library General Public License
  22. dnl along with this library; see the file COPYING.LIB. If not, write to
  23. dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  24. dnl Boston, MA 02111-1307, USA.
  25. dnl IMPORTANT NOTE:
  26. dnl Please do not modify this file unless you expect your modifications to be
  27. dnl carried into every other module in the repository. If you decide that you
  28. dnl really want to modify it, contact coolo@kde.org mentioning that you have
  29. dnl and that the modified file should be committed to every module.
  30. dnl
  31. dnl Single-module modifications are best placed in configure.in for kdelibs
  32. dnl and kdebase or configure.in.in if present.
  33. dnl ------------------------------------------------------------------------
  34. dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
  35. dnl thanks to Raja R Harinath.
  36. dnl ------------------------------------------------------------------------
  37. dnl
  38. ifdef([_AC_PATH_X_DIRECT],[],
  39. [AC_DEFUN([_AC_PATH_X_DIRECT],[AC_PATH_X_DIRECT])])
  40. ifdef([_AC_PATH_X_XMKMF],[],
  41. [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
  42. dnl ------------------------------------------------------------------------
  43. dnl Find a file (or one of more files in a list of dirs)
  44. dnl ------------------------------------------------------------------------
  45. dnl
  46. AC_DEFUN(AC_FIND_FILE,
  47. [
  48. $3=NO
  49. for i in $2;
  50. do
  51. for j in $1;
  52. do
  53. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  54. if test -r "$i/$j"; then
  55. echo "taking that" >&AC_FD_CC
  56. $3=$i
  57. break 2
  58. fi
  59. done
  60. done
  61. ])
  62. dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
  63. dnl if-not-found, test-parameter)
  64. AC_DEFUN(KDE_FIND_PATH,
  65. [
  66. AC_MSG_CHECKING([for $1])
  67. if test -n "$$2"; then
  68. kde_cv_path="$$2";
  69. else
  70. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  71. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  72. [
  73. kde_cv_path="NONE"
  74. dirs="$3"
  75. kde_save_IFS=$IFS
  76. IFS=':'
  77. for dir in $PATH; do
  78. dirs="$dirs $dir"
  79. done
  80. IFS=$kde_save_IFS
  81. for dir in $dirs; do
  82. if test -x "$dir/$1"; then
  83. if test -n "$5"
  84. then
  85. evalstr="$dir/$1 $5 2>&1 "
  86. if eval $evalstr; then
  87. kde_cv_path="$dir/$1"
  88. break
  89. fi
  90. else
  91. kde_cv_path="$dir/$1"
  92. break
  93. fi
  94. fi
  95. done
  96. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  97. ])
  98. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  99. fi
  100. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  101. AC_MSG_RESULT(not found)
  102. $4
  103. else
  104. AC_MSG_RESULT($kde_cv_path)
  105. $2=$kde_cv_path
  106. fi
  107. ])
  108. AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
  109. [
  110. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  111. Please check whether you installed Qt correctly.
  112. You need to have a running moc binary.
  113. configure tried to run $ac_cv_path_moc and the test didn't
  114. succeed. If configure shouldn't have tried this one, set
  115. the environment variable MOC to the right one before running
  116. configure.
  117. ])
  118. ])
  119. AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
  120. [
  121. AC_MSG_WARN([No Qt ui compiler (uic) found!
  122. Please check whether you installed Qt correctly.
  123. You need to have a running uic binary.
  124. configure tried to run $ac_cv_path_uic and the test didn't
  125. succeed. If configure shouldn't have tried this one, set
  126. the environment variable UIC to the right one before running
  127. configure.
  128. ])
  129. ])
  130. dnl ------------------------------------------------------------------------
  131. dnl Find the meta object compiler and the ui compiler in the PATH,
  132. dnl in $QTDIR/bin, and some more usual places
  133. dnl ------------------------------------------------------------------------
  134. dnl
  135. AC_DEFUN(AC_PATH_QT_MOC_UIC,
  136. [
  137. qt_bindirs=""
  138. for dir in $kde_qt_dirs; do
  139. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  140. done
  141. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  142. if test ! "$ac_qt_bindir" = "NO"; then
  143. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  144. fi
  145. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  146. if test -z "$UIC_NOT_NEEDED"; then
  147. KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC=""])
  148. if test -z "$UIC" ; then
  149. KDE_UIC_ERROR_MESSAGE
  150. exit 1
  151. fi
  152. else
  153. UIC="echo uic not available: "
  154. fi
  155. AC_SUBST(MOC)
  156. AC_SUBST(UIC)
  157. ])
  158. AC_DEFUN(KDE_1_CHECK_PATHS,
  159. [
  160. KDE_1_CHECK_PATH_HEADERS
  161. KDE_TEST_RPATH=
  162. if test -n "$USE_RPATH"; then
  163. if test -n "$kde_libraries"; then
  164. KDE_TEST_RPATH="-R $kde_libraries"
  165. fi
  166. if test -n "$qt_libraries"; then
  167. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  168. fi
  169. if test -n "$x_libraries"; then
  170. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  171. fi
  172. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  173. fi
  174. AC_MSG_CHECKING([for KDE libraries installed])
  175. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  176. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  177. AC_MSG_RESULT(yes)
  178. else
  179. AC_MSG_ERROR([your system fails at linking a small KDE application!
  180. Check, if your compiler is installed correctly and if you have used the
  181. same compiler to compile Qt and kdelibs as you did use now.
  182. For more details about this problem, look at the end of config.log.])
  183. fi
  184. if eval `KDEDIR= ./conftest 2>&5`; then
  185. kde_result=done
  186. else
  187. kde_result=problems
  188. fi
  189. KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  190. kde_have_all_paths=yes
  191. KDE_SET_PATHS($kde_result)
  192. ])
  193. AC_DEFUN(KDE_SET_PATHS,
  194. [
  195. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  196. kde_htmldir=\"$kde_htmldir\" \
  197. kde_appsdir=\"$kde_appsdir\" \
  198. kde_icondir=\"$kde_icondir\" \
  199. kde_sounddir=\"$kde_sounddir\" \
  200. kde_datadir=\"$kde_datadir\" \
  201. kde_locale=\"$kde_locale\" \
  202. kde_cgidir=\"$kde_cgidir\" \
  203. kde_confdir=\"$kde_confdir\" \
  204. kde_mimedir=\"$kde_mimedir\" \
  205. kde_toolbardir=\"$kde_toolbardir\" \
  206. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  207. kde_templatesdir=\"$kde_templatesdir\" \
  208. kde_bindir=\"$kde_bindir\" \
  209. kde_servicesdir=\"$kde_servicesdir\" \
  210. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  211. kde_moduledir=\"$kde_moduledir\" \
  212. kde_result=$1"
  213. ])
  214. AC_DEFUN(KDE_SET_DEFAULT_PATHS,
  215. [
  216. if test "$1" = "default"; then
  217. if test -z "$kde_htmldir"; then
  218. kde_htmldir='\${prefix}/share/doc/HTML'
  219. fi
  220. if test -z "$kde_appsdir"; then
  221. kde_appsdir='\${prefix}/share/applnk'
  222. fi
  223. if test -z "$kde_icondir"; then
  224. kde_icondir='\${prefix}/share/icons'
  225. fi
  226. if test -z "$kde_sounddir"; then
  227. kde_sounddir='\${prefix}/share/sounds'
  228. fi
  229. if test -z "$kde_datadir"; then
  230. kde_datadir='\${prefix}/share/apps'
  231. fi
  232. if test -z "$kde_locale"; then
  233. kde_locale='\${prefix}/share/locale'
  234. fi
  235. if test -z "$kde_cgidir"; then
  236. kde_cgidir='\${exec_prefix}/cgi-bin'
  237. fi
  238. if test -z "$kde_confdir"; then
  239. kde_confdir='\${prefix}/share/config'
  240. fi
  241. if test -z "$kde_mimedir"; then
  242. kde_mimedir='\${prefix}/share/mimelnk'
  243. fi
  244. if test -z "$kde_toolbardir"; then
  245. kde_toolbardir='\${prefix}/share/toolbar'
  246. fi
  247. if test -z "$kde_wallpaperdir"; then
  248. kde_wallpaperdir='\${prefix}/share/wallpapers'
  249. fi
  250. if test -z "$kde_templatesdir"; then
  251. kde_templatesdir='\${prefix}/share/templates'
  252. fi
  253. if test -z "$kde_bindir"; then
  254. kde_bindir='\${exec_prefix}/bin'
  255. fi
  256. if test -z "$kde_servicesdir"; then
  257. kde_servicesdir='\${prefix}/share/services'
  258. fi
  259. if test -z "$kde_servicetypesdir"; then
  260. kde_servicetypesdir='\${prefix}/share/servicetypes'
  261. fi
  262. if test -z "$kde_moduledir"; then
  263. kde_moduledir='\${exec_prefix}/lib/kde2'
  264. fi
  265. KDE_SET_PATHS(defaults)
  266. else
  267. if test $kde_qtver = 1; then
  268. AC_MSG_RESULT([compiling])
  269. KDE_1_CHECK_PATHS
  270. else
  271. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  272. fi
  273. fi
  274. ])
  275. AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
  276. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  277. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  278. test -z "$kde_datadir" || test -z "$kde_locale" ||
  279. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  280. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  281. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  282. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  283. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  284. test "$kde_have_all_paths" != "yes"; then
  285. kde_have_all_paths=no
  286. fi
  287. ])
  288. AC_DEFUN(KDE_MISSING_PROG_ERROR,
  289. [
  290. AC_MSG_ERROR([The important program $1 was not found!
  291. Please check whether you installed KDE correctly.
  292. ])
  293. ])
  294. AC_DEFUN(KDE_SUBST_PROGRAMS,
  295. [
  296. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
  297. if test -n "$KDEDIRS"; then
  298. kde_save_IFS=$IFS
  299. IFS=:
  300. for dir in $KDEDIRS; do
  301. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  302. done
  303. IFS=$kde_save_IFS
  304. fi
  305. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
  306. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  307. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  308. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
  309. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
  310. KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs])
  311. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  312. if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
  313. kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde2/share /opt/kde/share $prefix/share"
  314. test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
  315. AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  316. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  317. KDE_XSL_STYLESHEET=""
  318. else
  319. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
  320. fi
  321. fi
  322. DCOP_DEPENDENCIES='$(DCOPIDL)'
  323. AC_SUBST(DCOPIDL)
  324. AC_SUBST(DCOPIDL2CPP)
  325. AC_SUBST(DCOP_DEPENDENCIES)
  326. AC_SUBST(MCOPIDL)
  327. AC_SUBST(ARTSCCONFIG)
  328. AC_SUBST(KDECONFIG)
  329. AC_SUBST(MEINPROC)
  330. AC_SUBST(KDE_XSL_STYLESHEET)
  331. if test -x "$KDECONFIG"; then # it can be "compiled"
  332. kde_libs_prefix=`$KDECONFIG --prefix`
  333. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  334. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
  335. This means it has been moved since you installed it.
  336. This won't work. Please recompile kdelibs for the new prefix.
  337. ])
  338. fi
  339. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  340. else
  341. kde_libs_prefix='$(prefix)'
  342. kde_libs_htmldir='$(kde_htmldir)'
  343. fi
  344. AC_SUBST(kde_libs_prefix)
  345. AC_SUBST(kde_libs_htmldir)
  346. ])dnl
  347. AC_DEFUN(AC_CREATE_KFSSTND,
  348. [
  349. AC_REQUIRE([AC_CHECK_RPATH])
  350. AC_MSG_CHECKING([for KDE paths])
  351. kde_result=""
  352. kde_cached_paths=yes
  353. AC_CACHE_VAL(kde_cv_all_paths,
  354. [
  355. KDE_SET_DEFAULT_PATHS($1)
  356. kde_cached_paths=no
  357. ])
  358. eval "$kde_cv_all_paths"
  359. KDE_CHECK_PATHS_FOR_COMPLETENESS
  360. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  361. # wrong values were cached, may be, we can set better ones
  362. kde_result=
  363. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  364. kde_datadir= kde_locale= kde_cgidir= kde_confdir=
  365. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  366. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  367. kde_have_all_paths=
  368. KDE_SET_DEFAULT_PATHS($1)
  369. eval "$kde_cv_all_paths"
  370. KDE_CHECK_PATHS_FOR_COMPLETENESS
  371. kde_result="$kde_result (cache overridden)"
  372. fi
  373. if test "$kde_have_all_paths" = "no"; then
  374. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  375. Since it had compiled and linked before, it must be a strange problem on your system.
  376. Look at config.log for details. If you are not able to fix this, look at
  377. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  378. (If you're using an egcs version on Linux, you may update binutils!)
  379. ])
  380. else
  381. rm -f conftest*
  382. AC_MSG_RESULT($kde_result)
  383. fi
  384. bindir=$kde_bindir
  385. KDE_SUBST_PROGRAMS
  386. ])
  387. AC_DEFUN(AC_SUBST_KFSSTND,
  388. [
  389. AC_SUBST(kde_htmldir)
  390. AC_SUBST(kde_appsdir)
  391. AC_SUBST(kde_icondir)
  392. AC_SUBST(kde_sounddir)
  393. AC_SUBST(kde_datadir)
  394. AC_SUBST(kde_locale)
  395. AC_SUBST(kde_confdir)
  396. AC_SUBST(kde_mimedir)
  397. AC_SUBST(kde_wallpaperdir)
  398. AC_SUBST(kde_bindir)
  399. dnl for KDE 2
  400. AC_SUBST(kde_templatesdir)
  401. AC_SUBST(kde_servicesdir)
  402. AC_SUBST(kde_servicetypesdir)
  403. AC_SUBST(kde_moduledir)
  404. if test "$kde_qtver" = 1; then
  405. kde_minidir="$kde_icondir/mini"
  406. else
  407. # for KDE 1 - this breaks KDE2 apps using minidir, but
  408. # that's the plan ;-/
  409. kde_minidir="/dev/null"
  410. fi
  411. dnl AC_SUBST(kde_minidir)
  412. dnl AC_SUBST(kde_cgidir)
  413. dnl AC_SUBST(kde_toolbardir)
  414. ])
  415. AC_DEFUN(KDE_MISC_TESTS,
  416. [
  417. AC_LANG_C
  418. dnl Checks for libraries.
  419. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  420. AC_SUBST(LIBUTIL)
  421. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  422. AC_SUBST(LIBCOMPAT)
  423. kde_have_crypt=
  424. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  425. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  426. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  427. You should install libcrypt from another source or configure with PAM
  428. support])
  429. kde_have_crypt=no
  430. ]))
  431. AC_SUBST(LIBCRYPT)
  432. if test $kde_have_crypt = yes; then
  433. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  434. fi
  435. AC_CHECK_SOCKLEN_T
  436. AC_LANG_C
  437. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  438. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  439. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  440. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  441. fi
  442. AC_CHECK_FUNC(inet_ntoa)
  443. if test $ac_cv_func_inet_ntoa = no; then
  444. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  445. fi
  446. AC_CHECK_FUNC(connect)
  447. if test $ac_cv_func_connect = no; then
  448. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  449. $X_EXTRA_LIBS)
  450. fi
  451. AC_CHECK_FUNC(remove)
  452. if test $ac_cv_func_remove = no; then
  453. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  454. fi
  455. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  456. AC_CHECK_FUNC(shmat, ,
  457. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  458. # Solaris 2.6 and others need -lresolv for res_init
  459. AC_CHECK_FUNCS(res_init, , [
  460. kde_libs_safe="$LIBS"
  461. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  462. AC_TRY_LINK(
  463. [
  464. #include <resolv.h>
  465. ],
  466. [
  467. res_init();
  468. ],
  469. LIBRESOLV="-lresolv"
  470. X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
  471. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  472. )
  473. LIBS=$kde_libs_safe
  474. ])
  475. LIBSOCKET="$X_EXTRA_LIBS"
  476. AC_SUBST(LIBSOCKET)
  477. AC_SUBST(LIBRESOLV)
  478. AC_SUBST(X_EXTRA_LIBS)
  479. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  480. AC_SUBST(LIBUCB)
  481. case $host in dnl this *is* LynxOS specific
  482. *-*-lynxos* )
  483. AC_MSG_CHECKING([LynxOS header file wrappers])
  484. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  485. AC_MSG_RESULT(disabled)
  486. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  487. ;;
  488. esac
  489. KDE_CHECK_TYPES
  490. KDE_CHECK_LIBDL
  491. ])
  492. dnl ------------------------------------------------------------------------
  493. dnl Find the header files and libraries for X-Windows. Extended the
  494. dnl macro AC_PATH_X
  495. dnl ------------------------------------------------------------------------
  496. dnl
  497. AC_DEFUN(K_PATH_X,
  498. [
  499. AC_REQUIRE([AC_PROG_CPP])dnl
  500. AC_REQUIRE([KDE_MISC_TESTS])dnl
  501. AC_MSG_CHECKING(for X)
  502. AC_LANG_SAVE
  503. AC_LANG_C
  504. AC_CACHE_VAL(kde_cv_have_x,
  505. [# One or both of the vars are not set, and there is no cached value.
  506. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  507. kde_x_includes=NO
  508. else
  509. kde_x_includes=$x_includes
  510. fi
  511. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  512. kde_x_libraries=NO
  513. else
  514. kde_x_libraries=$x_libraries
  515. fi
  516. # below we use the standard autoconf calls
  517. ac_x_libraries=$kde_x_libraries
  518. ac_x_includes=$kde_x_includes
  519. _AC_PATH_X_DIRECT
  520. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  521. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  522. dnl location. The correct location is /usr/lib32 or an undefined value
  523. dnl (the linker is smart enough to pick the correct default library).
  524. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  525. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  526. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  527. dnl x_includes should be left alone.
  528. case "$host" in
  529. mips-sgi-irix6*)
  530. ;;
  531. *-*-solaris*)
  532. ;;
  533. *)
  534. _AC_PATH_X_XMKMF
  535. if test -z "$ac_x_includes"; then
  536. ac_x_includes="."
  537. fi
  538. if test -z "$ac_x_libraries"; then
  539. ac_x_libraries="/usr/lib"
  540. fi
  541. esac
  542. #from now on we use our own again
  543. # when the user already gave --x-includes, we ignore
  544. # what the standard autoconf macros told us.
  545. if test "$kde_x_includes" = NO; then
  546. kde_x_includes=$ac_x_includes
  547. fi
  548. # for --x-libraries too
  549. if test "$kde_x_libraries" = NO; then
  550. kde_x_libraries=$ac_x_libraries
  551. fi
  552. if test "$kde_x_includes" = NO; then
  553. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  554. fi
  555. if test "$kde_x_libraries" = NO; then
  556. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  557. fi
  558. # Record where we found X for the cache.
  559. kde_cv_have_x="have_x=yes \
  560. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  561. ])dnl
  562. eval "$kde_cv_have_x"
  563. if test "$have_x" != yes; then
  564. AC_MSG_RESULT($have_x)
  565. no_x=yes
  566. else
  567. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  568. fi
  569. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  570. X_INCLUDES=""
  571. x_includes="."; dnl better than nothing :-
  572. else
  573. x_includes=$kde_x_includes
  574. X_INCLUDES="-I$x_includes"
  575. fi
  576. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  577. X_LDFLAGS=""
  578. x_libraries="/usr/lib"; dnl better than nothing :-
  579. else
  580. x_libraries=$kde_x_libraries
  581. X_LDFLAGS="-L$x_libraries"
  582. fi
  583. all_includes="$X_INCLUDES"
  584. all_libraries="$X_LDFLAGS"
  585. AC_SUBST(X_INCLUDES)
  586. AC_SUBST(X_LDFLAGS)
  587. AC_SUBST(x_libraries)
  588. AC_SUBST(x_includes)
  589. # Check for libraries that X11R6 Xt/Xaw programs need.
  590. ac_save_LDFLAGS="$LDFLAGS"
  591. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  592. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  593. # check for ICE first), but we must link in the order -lSM -lICE or
  594. # we get undefined symbols. So assume we have SM if we have ICE.
  595. # These have to be linked with before -lX11, unlike the other
  596. # libraries we check for below, so use a different variable.
  597. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  598. AC_CHECK_LIB(ICE, IceConnectionNumber,
  599. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  600. AC_SUBST(LIBSM)
  601. LDFLAGS="$ac_save_LDFLAGS"
  602. AC_SUBST(X_PRE_LIBS)
  603. LIB_X11='-lX11 $(LIBSOCKET)'
  604. AC_SUBST(LIB_X11)
  605. AC_MSG_CHECKING(for libXext)
  606. AC_CACHE_VAL(kde_cv_have_libXext,
  607. [
  608. kde_ldflags_safe="$LDFLAGS"
  609. kde_libs_safe="$LIBS"
  610. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  611. LIBS="-lXext -lX11 $LIBSOCKET"
  612. AC_TRY_LINK([
  613. #include <stdio.h>
  614. #ifdef STDC_HEADERS
  615. # include <stdlib.h>
  616. #endif
  617. ],
  618. [
  619. printf("hello Xext\n");
  620. ],
  621. kde_cv_have_libXext=yes,
  622. kde_cv_have_libXext=no
  623. )
  624. LDFLAGS=$kde_ldflags_safe
  625. LIBS=$kde_libs_safe
  626. ])
  627. AC_MSG_RESULT($kde_cv_have_libXext)
  628. if test "$kde_cv_have_libXext" = "no"; then
  629. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  630. can't find it itself, we stop here assuming that make wouldn't find
  631. them either.])
  632. fi
  633. AC_MSG_CHECKING(for Xinerama)
  634. AC_ARG_WITH(xinerama,
  635. [ --with-xinerama enable support for Xinerama ],
  636. [
  637. no_xinerama=no
  638. ], [
  639. no_xinerama=yes
  640. ]
  641. )
  642. kde_save_LDFLAGS="$LDFLAGS"
  643. kde_save_CFLAGS="$CFLAGS"
  644. kde_save_LIBS="$LIBS"
  645. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  646. CFLAGS="$CFLAGS -I$x_includes"
  647. LIBS="-lXinerama -lXext"
  648. if test "x$no_xinerama" = "xno"; then
  649. AC_CACHE_VAL(ac_cv_have_xinerama,
  650. [
  651. AC_TRY_LINK([#include <X11/Xlib.h>
  652. #include <X11/extensions/Xinerama.h>],
  653. [XineramaIsActive(NULL);],
  654. [ac_cv_have_xinerama="yes"],
  655. [ac_cv_have_xinerama="no"])
  656. ])
  657. else
  658. ac_cv_have_xinerama=no;
  659. fi
  660. AC_MSG_RESULT($ac_cv_have_xinerama)
  661. LIBXINERAMA=""
  662. if test "$ac_cv_have_xinerama" = "yes"; then
  663. AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
  664. LIBXINERAMA="-lXinerama"
  665. fi
  666. AC_SUBST(LIBXINERAMA)
  667. LDFLAGS="$kde_save_LDFLAGS"
  668. CFLAGS="$kde_save_CFLAGS"
  669. LIBS="$kde_save_LIBS"
  670. AC_LANG_RESTORE
  671. ])
  672. AC_DEFUN(KDE_PRINT_QT_PROGRAM,
  673. [
  674. AC_REQUIRE([KDE_USE_QT])
  675. cat > conftest.$ac_ext <<EOF
  676. #include "confdefs.h"
  677. #include <qglobal.h>
  678. #include <qapplication.h>
  679. EOF
  680. if test "$kde_qtver" = "2"; then
  681. cat >> conftest.$ac_ext <<EOF
  682. #include <qevent.h>
  683. #include <qstring.h>
  684. #include <qstyle.h>
  685. EOF
  686. if test $kde_qtsubver -gt 0; then
  687. cat >> conftest.$ac_ext <<EOF
  688. #include <qiconview.h>
  689. EOF
  690. fi
  691. fi
  692. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  693. cat >> conftest.$ac_ext <<EOF
  694. #error 1
  695. #endif
  696. int main() {
  697. EOF
  698. if test "$kde_qtver" = "2"; then
  699. cat >> conftest.$ac_ext <<EOF
  700. QStringList *t = new QStringList();
  701. EOF
  702. if test $kde_qtsubver -gt 0; then
  703. cat >> conftest.$ac_ext <<EOF
  704. QIconView iv(0);
  705. iv.setWordWrapIconText(false);
  706. QString s;
  707. s.setLatin1("Elvis is alive", 14);
  708. int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
  709. EOF
  710. fi
  711. fi
  712. cat >> conftest.$ac_ext <<EOF
  713. return 0;
  714. }
  715. EOF
  716. ])
  717. AC_DEFUN(KDE_USE_QT,
  718. [
  719. if test -z "$1"; then
  720. kde_qtver=2
  721. kde_qtsubver=1
  722. else
  723. kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
  724. # following is the check if subversion isn´t found in passed argument
  725. if test "$kde_qtsubver" = "$1"; then
  726. kde_qtsubver=1
  727. fi
  728. kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
  729. if test "$kde_qtver" = "1"; then
  730. kde_qtsubver=42
  731. else
  732. # this is the version number fallback to 2.1, unless major version is 1 or 2
  733. if test "$kde_qtver" != "2"; then
  734. kde_qtver=2
  735. kde_qtsubver=1
  736. fi
  737. fi
  738. fi
  739. if test -z "$2"; then
  740. if test $kde_qtver = 2; then
  741. if test $kde_qtsubver -gt 0; then
  742. kde_qt_minversion=">= Qt 2.2.2"
  743. else
  744. kde_qt_minversion=">= Qt 2.0.2"
  745. fi
  746. else
  747. kde_qt_minversion=">= 1.42 and < 2.0"
  748. fi
  749. else
  750. kde_qt_minversion=$2
  751. fi
  752. if test -z "$3"; then
  753. if test $kde_qtver = 2; then
  754. if test $kde_qtsubver -gt 0; then
  755. kde_qt_verstring="QT_VERSION >= 222"
  756. else
  757. kde_qt_verstring="QT_VERSION >= 200"
  758. fi
  759. else
  760. kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
  761. fi
  762. else
  763. kde_qt_verstring=$3
  764. fi
  765. if test $kde_qtver = 2; then
  766. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  767. else
  768. kde_qt_dirs="$QTDIR /usr/lib/qt"
  769. fi
  770. ])
  771. AC_DEFUN(KDE_CHECK_QT_DIRECT,
  772. [
  773. AC_REQUIRE([KDE_USE_QT])
  774. AC_MSG_CHECKING([if Qt compiles without flags])
  775. AC_CACHE_VAL(kde_cv_qt_direct,
  776. [
  777. AC_LANG_SAVE
  778. AC_LANG_CPLUSPLUS
  779. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  780. ac_LIBRARY_PATH="$LIBRARY_PATH"
  781. ac_cxxflags_safe="$CXXFLAGS"
  782. ac_ldflags_safe="$LDFLAGS"
  783. ac_libs_safe="$LIBS"
  784. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  785. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  786. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  787. LD_LIBRARY_PATH=
  788. export LD_LIBRARY_PATH
  789. LIBRARY_PATH=
  790. export LIBRARY_PATH
  791. KDE_PRINT_QT_PROGRAM
  792. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  793. kde_cv_qt_direct="yes"
  794. else
  795. kde_cv_qt_direct="no"
  796. echo "configure: failed program was:" >&AC_FD_CC
  797. cat conftest.$ac_ext >&AC_FD_CC
  798. fi
  799. rm -f conftest*
  800. CXXFLAGS="$ac_cxxflags_safe"
  801. LDFLAGS="$ac_ldflags_safe"
  802. LIBS="$ac_libs_safe"
  803. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  804. export LD_LIBRARY_PATH
  805. LIBRARY_PATH="$ac_LIBRARY_PATH"
  806. export LIBRARY_PATH
  807. AC_LANG_RESTORE
  808. ])
  809. if test "$kde_cv_qt_direct" = "yes"; then
  810. AC_MSG_RESULT(yes)
  811. $1
  812. else
  813. AC_MSG_RESULT(no)
  814. $2
  815. fi
  816. ])
  817. dnl ------------------------------------------------------------------------
  818. dnl Try to find the Qt headers and libraries.
  819. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  820. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  821. dnl ------------------------------------------------------------------------
  822. dnl
  823. AC_DEFUN(AC_PATH_QT_1_3,
  824. [
  825. AC_REQUIRE([K_PATH_X])
  826. AC_REQUIRE([KDE_USE_QT])
  827. dnl ------------------------------------------------------------------------
  828. dnl Add configure flag to enable linking to MT version of Qt library.
  829. dnl ------------------------------------------------------------------------
  830. AC_ARG_ENABLE(
  831. mt,
  832. [ --enable-mt link to threaded Qt (experimental)],
  833. kde_use_qt_mt=$enableval,
  834. kde_use_qt_mt=no
  835. )
  836. USING_QT_MT=""
  837. dnl ------------------------------------------------------------------------
  838. dnl If we got --enable-qt-mt then adjust some vars for the host.
  839. dnl ------------------------------------------------------------------------
  840. if test "x$kde_use_qt_mt" = "xyes"; then
  841. case $host in
  842. *-*-linux-*)
  843. if test "x$GCC" = "xyes"; then
  844. CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
  845. X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
  846. else
  847. AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
  848. fi
  849. ;;
  850. *)
  851. AC_MSG_WARN([MT not yet supported on $host - disabled.])
  852. ;;
  853. esac
  854. fi
  855. kde_qt_was_given=yes
  856. dnl ------------------------------------------------------------------------
  857. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  858. dnl ------------------------------------------------------------------------
  859. if test -z "$LIBQT_GLOB"; then
  860. LIBQT_GLOB="libqt.*"
  861. fi
  862. if test -z "$LIBQT"; then
  863. LIBQT="-lqt"
  864. kde_int_qt="-lqt"
  865. dnl ------------------------------------------------------------------------
  866. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  867. dnl ------------------------------------------------------------------------
  868. if test "x$kde_use_qt_mt" = "xyes"; then
  869. case $host in
  870. *-*-linux-*)
  871. if test "x$GCC" = "xyes"; then
  872. LIBQT="-lqt-mt"
  873. kde_int_qt="-lqt-mt"
  874. LIBQT_GLOB="libqt-mt.*"
  875. USING_QT_MT="using -mt"
  876. fi
  877. ;;
  878. esac
  879. fi
  880. kde_qt_was_given=no
  881. else
  882. kde_int_qt="$LIBQT"
  883. fi
  884. if test $kde_qtver = 2; then
  885. AC_REQUIRE([AC_FIND_PNG])
  886. AC_REQUIRE([AC_FIND_JPEG])
  887. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  888. fi
  889. AC_MSG_CHECKING([for Qt])
  890. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  891. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  892. qt_libraries=""
  893. qt_includes=""
  894. AC_ARG_WITH(qt-dir,
  895. [ --with-qt-dir=DIR where the root of Qt is installed ],
  896. [ ac_qt_includes="$withval"/include
  897. ac_qt_libraries="$withval"/lib
  898. ac_qt_bindir="$withval"/bin
  899. ])
  900. AC_ARG_WITH(qt-includes,
  901. [ --with-qt-includes=DIR where the Qt includes are. ],
  902. [
  903. ac_qt_includes="$withval"
  904. ])
  905. kde_qt_libs_given=no
  906. AC_ARG_WITH(qt-libraries,
  907. [ --with-qt-libraries=DIR where the Qt library is installed.],
  908. [ ac_qt_libraries="$withval"
  909. kde_qt_libs_given=yes
  910. ])
  911. AC_CACHE_VAL(ac_cv_have_qt,
  912. [#try to guess Qt locations
  913. qt_incdirs=""
  914. for dir in $kde_qt_dirs; do
  915. qt_incdirs="$qt_incdirs $dir/include $dir"
  916. done
  917. 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 $x_includes"
  918. if test ! "$ac_qt_includes" = "NO"; then
  919. qt_incdirs="$ac_qt_includes $qt_incdirs"
  920. fi
  921. if test "$kde_qtver" = "2"; then
  922. kde_qt_header=qstyle.h
  923. else
  924. kde_qt_header=qglobal.h
  925. fi
  926. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  927. ac_qt_includes="$qt_incdir"
  928. qt_libdirs=""
  929. for dir in $kde_qt_dirs; do
  930. qt_libdirs="$qt_libdirs $dir/lib $dir"
  931. done
  932. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  933. if test ! "$ac_qt_libraries" = "NO"; then
  934. qt_libdir=$ac_qt_libraries
  935. else
  936. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  937. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  938. qt_libdir=NONE
  939. for dir in $qt_libdirs; do
  940. try="ls -1 $dir/${LIBQT_GLOB}"
  941. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  942. done
  943. fi
  944. ac_qt_libraries="$qt_libdir"
  945. AC_LANG_SAVE
  946. AC_LANG_CPLUSPLUS
  947. ac_cxxflags_safe="$CXXFLAGS"
  948. ac_ldflags_safe="$LDFLAGS"
  949. ac_libs_safe="$LIBS"
  950. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  951. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
  952. LIBS="$LIBS $LIBQT"
  953. KDE_PRINT_QT_PROGRAM
  954. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  955. rm -f conftest*
  956. else
  957. echo "configure: failed program was:" >&AC_FD_CC
  958. cat conftest.$ac_ext >&AC_FD_CC
  959. ac_qt_libraries="NO"
  960. fi
  961. rm -f conftest*
  962. CXXFLAGS="$ac_cxxflags_safe"
  963. LDFLAGS="$ac_ldflags_safe"
  964. LIBS="$ac_libs_safe"
  965. AC_LANG_RESTORE
  966. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  967. ac_cv_have_qt="have_qt=no"
  968. ac_qt_notfound=""
  969. if test "$ac_qt_includes" = NO; then
  970. if test "$ac_qt_libraries" = NO; then
  971. ac_qt_notfound="(headers and libraries)";
  972. else
  973. ac_qt_notfound="(headers)";
  974. fi
  975. else
  976. ac_qt_notfound="(libraries)";
  977. fi
  978. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  979. For more details about this problem, look at the end of config.log.])
  980. else
  981. have_qt="yes"
  982. fi
  983. ])
  984. eval "$ac_cv_have_qt"
  985. if test "$have_qt" != yes; then
  986. AC_MSG_RESULT([$have_qt]);
  987. else
  988. ac_cv_have_qt="have_qt=yes \
  989. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  990. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  991. qt_libraries="$ac_qt_libraries"
  992. qt_includes="$ac_qt_includes"
  993. fi
  994. if test ! "$kde_qt_libs_given" = "yes"; then
  995. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  996. fi
  997. AC_SUBST(qt_libraries)
  998. AC_SUBST(qt_includes)
  999. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  1000. QT_INCLUDES="";
  1001. else
  1002. QT_INCLUDES="-I$qt_includes"
  1003. all_includes="$QT_INCLUDES $all_includes"
  1004. fi
  1005. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1006. QT_LDFLAGS=""
  1007. else
  1008. QT_LDFLAGS="-L$qt_libraries"
  1009. all_libraries="$all_libraries $QT_LDFLAGS"
  1010. fi
  1011. AC_SUBST(QT_INCLUDES)
  1012. AC_SUBST(QT_LDFLAGS)
  1013. AC_PATH_QT_MOC_UIC
  1014. LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
  1015. AC_SUBST(LIB_QT)
  1016. ])
  1017. AC_DEFUN(AC_PATH_QT,
  1018. [
  1019. AC_PATH_QT_1_3
  1020. ])
  1021. AC_DEFUN(KDE_CHECK_FINAL,
  1022. [
  1023. AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
  1024. kde_use_final=$enableval, kde_use_final=no)
  1025. KDE_COMPILER_REPO
  1026. if test "x$kde_use_final" = "xyes"; then
  1027. KDE_USE_FINAL_TRUE=""
  1028. KDE_USE_FINAL_FALSE="#"
  1029. else
  1030. KDE_USE_FINAL_TRUE="#"
  1031. KDE_USE_FINAL_FALSE=""
  1032. fi
  1033. AC_SUBST(KDE_USE_FINAL_TRUE)
  1034. AC_SUBST(KDE_USE_FINAL_FALSE)
  1035. AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
  1036. kde_use_closure=$enableval, kde_use_closure=yes)
  1037. if test "x$kde_use_closure" = "xyes"; then
  1038. KDE_USE_CLOSURE_TRUE=""
  1039. KDE_USE_CLOSURE_FALSE="#"
  1040. # CXXFLAGS="$CXXFLAGS $REPO"
  1041. else
  1042. KDE_USE_CLOSURE_TRUE="#"
  1043. KDE_USE_CLOSURE_FALSE=""
  1044. fi
  1045. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1046. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1047. ])
  1048. dnl ------------------------------------------------------------------------
  1049. dnl Now, the same with KDE
  1050. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1051. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1052. dnl ------------------------------------------------------------------------
  1053. dnl
  1054. AC_DEFUN(AC_BASE_PATH_KDE,
  1055. [
  1056. AC_PREREQ([2.13])
  1057. AC_REQUIRE([AC_PATH_QT])dnl
  1058. AC_CHECK_RPATH
  1059. AC_MSG_CHECKING([for KDE])
  1060. if test "${prefix}" != NONE; then
  1061. kde_includes=${prefix}/include
  1062. ac_kde_includes=$prefix/include
  1063. if test "${exec_prefix}" != NONE; then
  1064. kde_libraries=${exec_prefix}/lib
  1065. ac_kde_libraries=$exec_prefix/lib
  1066. else
  1067. kde_libraries=${prefix}/lib
  1068. ac_kde_libraries=$prefix/lib
  1069. fi
  1070. else
  1071. ac_kde_includes=
  1072. ac_kde_libraries=
  1073. kde_libraries=""
  1074. kde_includes=""
  1075. fi
  1076. AC_CACHE_VAL(ac_cv_have_kde,
  1077. [#try to guess kde locations
  1078. if test "$kde_qtver" = 1; then
  1079. kde_check_header="ksock.h"
  1080. kde_check_lib="libkdecore.la"
  1081. else
  1082. kde_check_header="ksharedptr.h"
  1083. kde_check_lib="libkio.la"
  1084. fi
  1085. if test -z "$1"; then
  1086. kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
  1087. test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
  1088. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1089. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1090. ac_kde_includes="$kde_incdir"
  1091. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1092. AC_MSG_ERROR([
  1093. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1094. So, check this please and use another prefix!])
  1095. fi
  1096. kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
  1097. test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
  1098. kde_libdirs="$ac_kde_libraries $kde_libdirs"
  1099. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1100. ac_kde_libraries="$kde_libdir"
  1101. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1102. AC_MSG_ERROR([
  1103. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1104. So, check this please and use another prefix!])
  1105. fi
  1106. ac_kde_libraries="$kde_libdir"
  1107. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
  1108. ac_cv_have_kde="have_kde=no"
  1109. else
  1110. ac_cv_have_kde="have_kde=yes \
  1111. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1112. fi
  1113. else dnl test -z $1
  1114. ac_cv_have_kde="have_kde=no"
  1115. fi
  1116. ])dnl
  1117. eval "$ac_cv_have_kde"
  1118. if test "$have_kde" != "yes"; then
  1119. if test "${prefix}" = NONE; then
  1120. ac_kde_prefix="$ac_default_prefix"
  1121. else
  1122. ac_kde_prefix="$prefix"
  1123. fi
  1124. if test "$exec_prefix" = NONE; then
  1125. ac_kde_exec_prefix="$ac_kde_prefix"
  1126. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1127. else
  1128. ac_kde_exec_prefix="$exec_prefix"
  1129. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1130. fi
  1131. kde_libraries="${ac_kde_exec_prefix}/lib"
  1132. kde_includes=${ac_kde_prefix}/include
  1133. else
  1134. ac_cv_have_kde="have_kde=yes \
  1135. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1136. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1137. kde_libraries="$ac_kde_libraries"
  1138. kde_includes="$ac_kde_includes"
  1139. fi
  1140. AC_SUBST(kde_libraries)
  1141. AC_SUBST(kde_includes)
  1142. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1143. KDE_INCLUDES=""
  1144. else
  1145. KDE_INCLUDES="-I$kde_includes"
  1146. all_includes="$KDE_INCLUDES $all_includes"
  1147. fi
  1148. KDE_LDFLAGS="-L$kde_libraries"
  1149. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1150. all_libraries="$all_libraries $KDE_LDFLAGS"
  1151. fi
  1152. AC_SUBST(KDE_LDFLAGS)
  1153. AC_SUBST(KDE_INCLUDES)
  1154. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1155. all_libraries="$all_libraries $USER_LDFLAGS"
  1156. all_includes="$all_includes $USER_INCLUDES"
  1157. AC_SUBST(all_includes)
  1158. AC_SUBST(all_libraries)
  1159. AC_SUBST(AUTODIRS)
  1160. ])
  1161. AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
  1162. [
  1163. AC_MSG_CHECKING(for extra includes)
  1164. AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
  1165. adds non standard include paths],
  1166. kde_use_extra_includes="$withval",
  1167. kde_use_extra_includes=NONE
  1168. )
  1169. kde_extra_includes=
  1170. if test -n "$kde_use_extra_includes" && \
  1171. test "$kde_use_extra_includes" != "NONE"; then
  1172. ac_save_ifs=$IFS
  1173. IFS=':'
  1174. for dir in $kde_use_extra_includes; do
  1175. kde_extra_includes="$kde_extra_includes $dir"
  1176. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1177. done
  1178. IFS=$ac_save_ifs
  1179. kde_use_extra_includes="added"
  1180. else
  1181. kde_use_extra_includes="no"
  1182. fi
  1183. AC_SUBST(USER_INCLUDES)
  1184. AC_MSG_RESULT($kde_use_extra_includes)
  1185. kde_extra_libs=
  1186. AC_MSG_CHECKING(for extra libs)
  1187. AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
  1188. kde_use_extra_libs=$withval,
  1189. kde_use_extra_libs=NONE
  1190. )
  1191. if test -n "$kde_use_extra_libs" && \
  1192. test "$kde_use_extra_libs" != "NONE"; then
  1193. ac_save_ifs=$IFS
  1194. IFS=':'
  1195. for dir in $kde_use_extra_libs; do
  1196. kde_extra_libs="$kde_extra_libs $dir"
  1197. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1198. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1199. done
  1200. IFS=$ac_save_ifs
  1201. kde_use_extra_libs="added"
  1202. else
  1203. kde_use_extra_libs="no"
  1204. fi
  1205. AC_SUBST(USER_LDFLAGS)
  1206. AC_MSG_RESULT($kde_use_extra_libs)
  1207. ])
  1208. AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
  1209. [
  1210. AC_MSG_CHECKING([for KDE headers installed])
  1211. AC_LANG_SAVE
  1212. AC_LANG_CPLUSPLUS
  1213. cat > conftest.$ac_ext <<EOF
  1214. #ifdef STDC_HEADERS
  1215. # include <stdlib.h>
  1216. #endif
  1217. #include <stdio.h>
  1218. #include "confdefs.h"
  1219. #include <kapp.h>
  1220. int main() {
  1221. printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
  1222. printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
  1223. printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
  1224. printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
  1225. printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
  1226. printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
  1227. printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
  1228. printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
  1229. printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
  1230. printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
  1231. printf("kde_wallpaperdir=\\"%s\\"\n",
  1232. KApplication::kde_wallpaperdir().data());
  1233. printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
  1234. printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
  1235. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1236. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1237. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1238. return 0;
  1239. }
  1240. EOF
  1241. ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
  1242. if AC_TRY_EVAL(ac_compile); then
  1243. AC_MSG_RESULT(yes)
  1244. else
  1245. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1246. Check, if you installed the KDE header files correctly.
  1247. For more details about this problem, look at the end of config.log.])
  1248. fi
  1249. AC_LANG_RESTORE
  1250. ])
  1251. AC_DEFUN(KDE_CHECK_KDEQTADDON,
  1252. [
  1253. AC_MSG_CHECKING(for kde-qt-addon)
  1254. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1255. [
  1256. kde_ldflags_safe="$LDFLAGS"
  1257. kde_libs_safe="$LIBS"
  1258. kde_cxxflags_safe="$CXXFLAGS"
  1259. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1260. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
  1261. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1262. AC_TRY_LINK([
  1263. #include <qdom.h>
  1264. ],
  1265. [
  1266. QDomDocument doc;
  1267. ],
  1268. kde_cv_have_kdeqtaddon=yes,
  1269. kde_cv_have_kdeqtaddon=no
  1270. )
  1271. LDFLAGS=$kde_ldflags_safe
  1272. LIBS=$kde_libs_safe
  1273. kde_cxxflags_safe="$CXXFLAGS"
  1274. ])
  1275. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  1276. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  1277. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1278. It is a separate package (and CVS module) named kde-qt-addon.])
  1279. fi
  1280. ])
  1281. AC_DEFUN(KDE_CHECK_KIMGIO,
  1282. [
  1283. AC_REQUIRE([AC_BASE_PATH_KDE])
  1284. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1285. AC_REQUIRE([AC_FIND_TIFF])
  1286. AC_REQUIRE([AC_FIND_JPEG])
  1287. AC_REQUIRE([AC_FIND_PNG])
  1288. AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
  1289. if test "$1" = "existance"; then
  1290. AC_LANG_SAVE
  1291. AC_LANG_CPLUSPLUS
  1292. kde_save_LIBS="$LIBS"
  1293. LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
  1294. AC_CHECK_LIB(kimgio, kimgioRegister, [
  1295. LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
  1296. LIBS="$kde_save_LIBS"
  1297. AC_LANG_RESTORE
  1298. else
  1299. LIBKIMGIO_EXISTS=yes
  1300. fi
  1301. if test "$LIBKIMGIO_EXISTS" = "yes"; then
  1302. LIB_KIMGIO='-lkimgio'
  1303. else
  1304. LIB_KIMGIO=''
  1305. fi
  1306. AC_SUBST(LIB_KIMGIO)
  1307. ])
  1308. AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
  1309. [
  1310. AC_REQUIRE([KDE_MISC_TESTS])
  1311. AC_REQUIRE([KDE_CHECK_LIBDL])
  1312. AC_REQUIRE([K_PATH_X])
  1313. if test $kde_qtver = 2; then
  1314. LIB_KDECORE='-lkdecore'
  1315. AC_SUBST(LIB_KDECORE)
  1316. LIB_KDEUI='-lkdeui'
  1317. AC_SUBST(LIB_KDEUI)
  1318. LIB_KFORMULA='-lkformula'
  1319. AC_SUBST(LIB_KFORMULA)
  1320. LIB_KIO='-lkio'
  1321. AC_SUBST(LIB_KIO)
  1322. LIB_KSYCOCA='-lksycoca'
  1323. AC_SUBST(LIB_KSYCOCA)
  1324. LIB_SMB='-lsmb'
  1325. AC_SUBST(LIB_SMB)
  1326. LIB_KFILE='-lkfile'
  1327. AC_SUBST(LIB_KFILE)
  1328. LIB_KAB='-lkab'
  1329. AC_SUBST(LIB_KAB)
  1330. LIB_KHTML='-lkhtml'
  1331. AC_SUBST(LIB_KHTML)
  1332. LIB_KSPELL='-lkspell'
  1333. AC_SUBST(LIB_KSPELL)
  1334. LIB_KPARTS='-lkparts'
  1335. AC_SUBST(LIB_KPARTS)
  1336. LIB_KWRITE='-lkwrite'
  1337. AC_SUBST(LIB_KWRITE)
  1338. else
  1339. LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
  1340. AC_SUBST(LIB_KDECORE)
  1341. LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
  1342. AC_SUBST(LIB_KDEUI)
  1343. LIB_KFM='-lkfm $(LIB_KDECORE)'
  1344. AC_SUBST(LIB_KFM)
  1345. LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
  1346. AC_SUBST(LIB_KFILE)
  1347. LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
  1348. AC_SUBST(LIB_KAB)
  1349. fi
  1350. ])
  1351. AC_DEFUN(AC_PATH_KDE,
  1352. [
  1353. AC_BASE_PATH_KDE
  1354. AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
  1355. [
  1356. if test "$enableval" = "no";
  1357. then ac_use_path_checking="default"
  1358. else ac_use_path_checking=""
  1359. fi
  1360. ],
  1361. [
  1362. if test "$kde_qtver" = 1;
  1363. then ac_use_path_checking=""
  1364. else ac_use_path_checking="default"
  1365. fi
  1366. ]
  1367. )
  1368. AC_CREATE_KFSSTND($ac_use_path_checking)
  1369. AC_SUBST_KFSSTND
  1370. KDE_CREATE_LIBS_ALIASES
  1371. ])
  1372. dnl obsolete
  1373. AC_DEFUN(AC_CHECK_SETENV,
  1374. [
  1375. AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl
  1376. AC_CHECK_FUNCS([setenv unsetenv])
  1377. ])
  1378. AC_DEFUN(AC_CHECK_GETDOMAINNAME,
  1379. [
  1380. AC_MSG_CHECKING(for getdomainname)
  1381. AC_CACHE_VAL(ac_cv_func_getdomainname,
  1382. [
  1383. AC_LANG_SAVE
  1384. AC_LANG_CPLUSPLUS
  1385. save_CXXFLAGS="$CXXFLAGS"
  1386. kde_safe_LIBS="$LIBS"
  1387. LIBS="$LIBS $X_EXTRA_LIBS"
  1388. if test "$GCC" = "yes"; then
  1389. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1390. fi
  1391. AC_TRY_COMPILE([
  1392. #include <stdlib.h>
  1393. #include <unistd.h>
  1394. ],
  1395. [
  1396. char buffer[200];
  1397. getdomainname(buffer, 200);
  1398. ],
  1399. ac_cv_func_getdomainname=yes,
  1400. ac_cv_func_getdomainname=no)
  1401. CXXFLAGS="$save_CXXFLAGS"
  1402. LIBS=$kde_safe_LIBS
  1403. AC_LANG_RESTORE
  1404. ])
  1405. AC_MSG_RESULT($ac_cv_func_getdomainname)
  1406. AC_MSG_CHECKING([if getdomainname needs custom prototype])
  1407. AC_CACHE_VAL(ac_cv_proto_getdomainname,
  1408. [
  1409. AC_LANG_SAVE
  1410. AC_LANG_CPLUSPLUS
  1411. if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
  1412. ac_cv_proto_getdomainname=no
  1413. else
  1414. kde_safe_libs=$LIBS
  1415. LIBS="$LIBS $X_EXTRA_LIBS"
  1416. AC_TRY_LINK([
  1417. #include <stdlib.h>
  1418. #include <unistd.h>
  1419. extern "C" int getdomainname (char *, int);
  1420. ],
  1421. [
  1422. char buffer[200];
  1423. getdomainname(buffer, 200);
  1424. ],
  1425. ac_cv_func_getdomainname=yes
  1426. ac_cv_proto_getdomainname=yes,
  1427. AC_MSG_RESULT([fatal error])
  1428. AC_MSG_ERROR([getdomainname unavailable]))
  1429. fi
  1430. LIBS=$kde_safe_libs
  1431. AC_LANG_RESTORE
  1432. ])
  1433. AC_MSG_RESULT($ac_cv_proto_getdomainname)
  1434. if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
  1435. AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
  1436. fi
  1437. if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
  1438. AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
  1439. [Define if you have getdomainname prototype])
  1440. fi
  1441. ])
  1442. AC_DEFUN(AC_CHECK_GETHOSTNAME,
  1443. [
  1444. AC_MSG_CHECKING([for gethostname])
  1445. AC_CACHE_VAL(ac_cv_func_gethostname,
  1446. [
  1447. AC_LANG_SAVE
  1448. AC_LANG_CPLUSPLUS
  1449. save_CXXFLAGS="$CXXFLAGS"
  1450. if test "$GCC" = "yes"; then
  1451. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1452. fi
  1453. AC_TRY_LINK([
  1454. #include <stdlib.h>
  1455. #include <unistd.h>
  1456. ],
  1457. [
  1458. char buffer[200];
  1459. gethostname(buffer, 200);
  1460. ],
  1461. ac_cv_func_gethostname=yes,
  1462. ac_cv_func_gethostname=no)
  1463. CXXFLAGS="$save_CXXFLAGS"
  1464. AC_LANG_RESTORE
  1465. ])
  1466. AC_MSG_RESULT($ac_cv_func_gethostname)
  1467. AC_MSG_CHECKING([if gethostname needs custom prototype])
  1468. AC_CACHE_VAL(ac_cv_proto_gethostname,
  1469. [
  1470. AC_LANG_SAVE
  1471. AC_LANG_CPLUSPLUS
  1472. if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
  1473. ac_cv_proto_gethostname=no
  1474. else
  1475. AC_TRY_LINK([
  1476. #include <stdlib.h>
  1477. #include <unistd.h>
  1478. extern "C" int gethostname (char *, int);
  1479. ],
  1480. [
  1481. char buffer[200];
  1482. gethostname(buffer, 200);
  1483. ],
  1484. ac_cv_func_gethostname=yes
  1485. ac_cv_proto_gethostname=yes,
  1486. AC_MSG_RESULT([fatal error])
  1487. AC_MSG_ERROR(gethostname unavailable))
  1488. fi
  1489. AC_LANG_RESTORE
  1490. ])
  1491. AC_MSG_RESULT($ac_cv_proto_gethostname)
  1492. if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
  1493. AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
  1494. [Define if you have gethostname prototype])
  1495. fi
  1496. if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
  1497. AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have gethostname])
  1498. fi
  1499. ])
  1500. AC_DEFUN(AC_CHECK_USLEEP,
  1501. [
  1502. AC_MSG_CHECKING([for usleep])
  1503. AC_CACHE_VAL(ac_cv_func_usleep,
  1504. [
  1505. AC_LANG_SAVE
  1506. AC_LANG_CPLUSPLUS
  1507. ac_libs_safe="$LIBS"
  1508. LIBS="$LIBS $LIBUCB"
  1509. AC_TRY_LINK([
  1510. #include <stdlib.h>
  1511. #include <unistd.h>
  1512. ],
  1513. [
  1514. usleep(200);
  1515. ],
  1516. ac_cv_func_usleep=yes,
  1517. ac_cv_func_usleep=no)
  1518. LIBS="$ac_libs_safe"
  1519. AC_LANG_RESTORE
  1520. ])
  1521. AC_MSG_RESULT($ac_cv_func_usleep)
  1522. if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
  1523. AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
  1524. fi
  1525. ])
  1526. AC_DEFUN(AC_CHECK_RANDOM,
  1527. [
  1528. AC_MSG_CHECKING([for random])
  1529. AC_CACHE_VAL(ac_cv_func_random,
  1530. [
  1531. AC_LANG_SAVE
  1532. AC_LANG_CPLUSPLUS
  1533. ac_libs_safe="$LIBS"
  1534. LIBS="$LIBS $LIBUCB"
  1535. AC_TRY_LINK([
  1536. #include <stdlib.h>
  1537. ],
  1538. [
  1539. random();
  1540. ],
  1541. ac_cv_func_random=yes,
  1542. ac_cv_func_random=no)
  1543. LIBS="$ac_libs_safe"
  1544. AC_LANG_RESTORE
  1545. ])
  1546. AC_MSG_RESULT($ac_cv_func_random)
  1547. if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
  1548. AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
  1549. fi
  1550. ])
  1551. AC_DEFUN(AC_FIND_GIF,
  1552. [AC_MSG_CHECKING([for giflib])
  1553. AC_CACHE_VAL(ac_cv_lib_gif,
  1554. [ac_save_LIBS="$LIBS"
  1555. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  1556. AC_TRY_LINK(dnl
  1557. [
  1558. #ifdef __cplusplus
  1559. extern "C" {
  1560. #endif
  1561. int GifLastError(void);
  1562. #ifdef __cplusplus
  1563. }
  1564. #endif
  1565. /* We use char because int might match the return type of a gcc2
  1566. builtin and then its argument prototype would still apply. */
  1567. ],
  1568. [return GifLastError();],
  1569. eval "ac_cv_lib_gif=yes",
  1570. eval "ac_cv_lib_gif=no")
  1571. LIBS="$ac_save_LIBS"
  1572. ])dnl
  1573. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  1574. AC_MSG_RESULT(yes)
  1575. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  1576. else
  1577. AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
  1578. fi
  1579. ])
  1580. AC_DEFUN(KDE_FIND_JPEG_HELPER,
  1581. [
  1582. AC_MSG_CHECKING([for libjpeg$2])
  1583. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  1584. [
  1585. AC_LANG_C
  1586. ac_save_LIBS="$LIBS"
  1587. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  1588. ac_save_CFLAGS="$CFLAGS"
  1589. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1590. AC_TRY_LINK(
  1591. [/* Override any gcc2 internal prototype to avoid an error. */
  1592. struct jpeg_decompress_struct;
  1593. typedef struct jpeg_decompress_struct * j_decompress_ptr;
  1594. typedef int size_t;
  1595. #ifdef __cplusplus
  1596. extern "C" {
  1597. #endif
  1598. void jpeg_CreateDecompress(j_decompress_ptr cinfo,
  1599. int version, size_t structsize);
  1600. #ifdef __cplusplus
  1601. }
  1602. #endif
  1603. /* We use char because int might match the return type of a gcc2
  1604. builtin and then its argument prototype would still apply. */
  1605. ],
  1606. [jpeg_CreateDecompress(0L, 0, 0);],
  1607. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  1608. eval "ac_cv_lib_jpeg_$1=no")
  1609. LIBS="$ac_save_LIBS"
  1610. CFLAGS="$ac_save_CFLAGS"
  1611. ])
  1612. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  1613. LIBJPEG="$ac_cv_lib_jpeg_$1"
  1614. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  1615. else
  1616. AC_MSG_RESULT(no)
  1617. $3
  1618. fi
  1619. ])
  1620. AC_DEFUN(AC_FIND_JPEG,
  1621. [
  1622. dnl first look for libraries
  1623. KDE_FIND_JPEG_HELPER(6b, 6b,
  1624. KDE_FIND_JPEG_HELPER(normal, [],
  1625. [
  1626. LIBJPEG=
  1627. ]
  1628. )
  1629. )
  1630. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  1631. dnl requires system dependent includes loaded before it)
  1632. jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
  1633. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  1634. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  1635. dnl if headers _and_ libraries are missing, this is no error, and we
  1636. dnl continue with a warning (the user will get no jpeg support in khtml)
  1637. dnl if only one is missing, it means a configuration error, but we still
  1638. dnl only warn
  1639. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  1640. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  1641. else
  1642. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  1643. AC_MSG_WARN([
  1644. There is an installation error in jpeg support. You seem to have only one
  1645. of either the headers _or_ the libraries installed. You may need to either
  1646. provide correct --with-extra-... options, or the development package of
  1647. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  1648. Disabling JPEG support.
  1649. ])
  1650. else
  1651. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  1652. fi
  1653. jpeg_incdir=
  1654. LIBJPEG=
  1655. fi
  1656. AC_SUBST(LIBJPEG)
  1657. ])
  1658. AC_DEFUN(AC_FIND_ZLIB,
  1659. [
  1660. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1661. AC_MSG_CHECKING([for libz])
  1662. AC_CACHE_VAL(ac_cv_lib_z,
  1663. [
  1664. AC_LANG_C
  1665. kde_save_LIBS="$LIBS"
  1666. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  1667. kde_save_CFLAGS="$CFLAGS"
  1668. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1669. AC_TRY_LINK(dnl
  1670. [
  1671. #include<zlib.h>
  1672. ],
  1673. [return (zlibVersion() == ZLIB_VERSION); ],
  1674. eval "ac_cv_lib_z='-lz'",
  1675. eval "ac_cv_lib_z=no")
  1676. LIBS="$kde_save_LIBS"
  1677. CFLAGS="$kde_save_CFLAGS"
  1678. ])dnl
  1679. if test ! "$ac_cv_lib_z" = no; then
  1680. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  1681. LIBZ="$ac_cv_lib_z"
  1682. AC_SUBST(LIBZ)
  1683. AC_MSG_RESULT($ac_cv_lib_z)
  1684. else
  1685. AC_MSG_ERROR(not found. Check your installation and look into config.log)
  1686. LIBZ=""
  1687. AC_SUBST(LIBZ)
  1688. fi
  1689. ])
  1690. AC_DEFUN(KDE_TRY_TIFFLIB,
  1691. [
  1692. AC_MSG_CHECKING([for libtiff $1])
  1693. AC_CACHE_VAL(kde_cv_libtiff_$1,
  1694. [
  1695. AC_LANG_SAVE
  1696. AC_LANG_CPLUSPLUS
  1697. kde_save_LIBS="$LIBS"
  1698. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  1699. kde_save_CXXFLAGS="$CXXFLAGS"
  1700. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  1701. AC_TRY_LINK(dnl
  1702. [
  1703. #include<tiffio.h>
  1704. ],
  1705. [return (TIFFOpen( "", "r") == 0); ],
  1706. [
  1707. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  1708. ], [
  1709. kde_cv_libtiff_$1=no
  1710. ])
  1711. LIBS="$kde_save_LIBS"
  1712. CXXFLAGS="$kde_save_CXXFLAGS"
  1713. AC_LANG_RESTORE
  1714. ])
  1715. if test "$kde_cv_libtiff_$1" = "no"; then
  1716. AC_MSG_RESULT(no)
  1717. LIBTIFF=""
  1718. $3
  1719. else
  1720. LIBTIFF="$kde_cv_libtiff_$1"
  1721. AC_MSG_RESULT(yes)
  1722. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  1723. $2
  1724. fi
  1725. ])
  1726. AC_DEFUN(AC_FIND_TIFF,
  1727. [
  1728. AC_REQUIRE([K_PATH_X])
  1729. AC_REQUIRE([AC_FIND_ZLIB])
  1730. AC_REQUIRE([AC_FIND_JPEG])
  1731. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1732. KDE_TRY_TIFFLIB(tiff, [],
  1733. KDE_TRY_TIFFLIB(tiff34))
  1734. AC_SUBST(LIBTIFF)
  1735. ])
  1736. AC_DEFUN(AC_FIND_PNG,
  1737. [
  1738. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1739. AC_REQUIRE([AC_FIND_ZLIB])
  1740. AC_MSG_CHECKING([for libpng])
  1741. AC_CACHE_VAL(ac_cv_lib_png,
  1742. [
  1743. kde_save_LIBS="$LIBS"
  1744. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  1745. kde_save_CFLAGS="$CFLAGS"
  1746. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  1747. AC_LANG_C
  1748. AC_TRY_LINK(dnl
  1749. [
  1750. #include<png.h>
  1751. ],
  1752. [
  1753. png_structp png_ptr = png_create_read_struct( /* image ptr */
  1754. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  1755. return( png_ptr != 0 );
  1756. ],
  1757. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  1758. eval "ac_cv_lib_png=no"
  1759. )
  1760. LIBS="$kde_save_LIBS"
  1761. CFLAGS="$kde_save_CFLAGS"
  1762. ])dnl
  1763. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  1764. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  1765. LIBPNG="$ac_cv_lib_png"
  1766. AC_SUBST(LIBPNG)
  1767. AC_MSG_RESULT($ac_cv_lib_png)
  1768. else
  1769. AC_MSG_RESULT(no)
  1770. LIBPNG=""
  1771. AC_SUBST(LIBPNG)
  1772. fi
  1773. ])
  1774. AC_DEFUN(AC_CHECK_BOOL,
  1775. [
  1776. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  1777. ])
  1778. AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
  1779. [
  1780. AC_MSG_CHECKING(if you need GNU extensions)
  1781. AC_CACHE_VAL(ac_cv_gnu_extensions,
  1782. [
  1783. cat > conftest.c << EOF
  1784. #include <features.h>
  1785. #ifdef __GNU_LIBRARY__
  1786. yes
  1787. #endif
  1788. EOF
  1789. if (eval "$ac_cpp conftest.c") 2>&5 |
  1790. egrep "yes" >/dev/null 2>&1; then
  1791. rm -rf conftest*
  1792. ac_cv_gnu_extensions=yes
  1793. else
  1794. ac_cv_gnu_extensions=no
  1795. fi
  1796. ])
  1797. AC_MSG_RESULT($ac_cv_gnu_extensions)
  1798. if test "$ac_cv_gnu_extensions" = "yes"; then
  1799. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  1800. fi
  1801. ])
  1802. AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
  1803. [
  1804. dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50
  1805. AC_MSG_CHECKING(whether $CXX supports -$1)
  1806. kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
  1807. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  1808. [
  1809. echo 'int main() { return 0; }' >conftest.cc
  1810. eval "kde_cv_prog_cxx_$kde_cache=no"
  1811. if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
  1812. if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
  1813. eval "kde_cv_prog_cxx_$kde_cache=yes"
  1814. fi
  1815. fi
  1816. rm -f conftest*
  1817. ])
  1818. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  1819. AC_MSG_RESULT(yes)
  1820. :
  1821. $2
  1822. else
  1823. AC_MSG_RESULT(no)
  1824. :
  1825. $3
  1826. fi
  1827. ])
  1828. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  1829. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  1830. dnl it's all white-space separated
  1831. AC_DEFUN(AC_REMOVE_FORBIDDEN,
  1832. [ __val=$$1
  1833. __forbid=" $2 "
  1834. if test -n "$__val"; then
  1835. __new=""
  1836. ac_save_IFS=$IFS
  1837. IFS=" "
  1838. for i in $__val; do
  1839. case "$__forbid" in
  1840. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  1841. *) # Careful to not add spaces, where there were none, because otherwise
  1842. # libtool gets confused, if we change e.g. CXX
  1843. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  1844. esac
  1845. done
  1846. IFS=$ac_save_IFS
  1847. $1=$__new
  1848. fi
  1849. ])
  1850. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  1851. AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
  1852. [dnl
  1853. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  1854. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  1855. ])
  1856. AC_DEFUN(AC_CHECK_COMPILERS,
  1857. [
  1858. AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
  1859. [
  1860. if test $enableval = "no"; dnl
  1861. then
  1862. kde_use_debug_code="no"
  1863. kde_use_debug_define=yes
  1864. else
  1865. kde_use_debug_code="yes"
  1866. kde_use_debug_define=no
  1867. fi
  1868. ],
  1869. [kde_use_debug_code="no"
  1870. kde_use_debug_define=no
  1871. ])
  1872. dnl Just for configure --help
  1873. AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
  1874. AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
  1875. [
  1876. if test $enableval = "no"; then
  1877. kde_use_strict_options="no"
  1878. else
  1879. kde_use_strict_options="yes"
  1880. fi
  1881. ], [kde_use_strict_options="no"])
  1882. AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
  1883. [kde_use_profiling=$enableval],
  1884. [kde_use_profiling="no"]
  1885. )
  1886. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  1887. CFLAGS=" $CFLAGS"
  1888. AC_PROG_CC
  1889. if test "$GCC" = "yes"; then
  1890. if test "$kde_use_debug_code" = "yes"; then
  1891. CFLAGS="-g -O0 $CFLAGS"
  1892. case $host in
  1893. *-*-linux-gnu)
  1894. CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  1895. ;;
  1896. esac
  1897. else
  1898. CFLAGS="-O0 $CFLAGS"
  1899. fi
  1900. fi
  1901. if test "$kde_use_debug_define" = "yes"; then
  1902. CFLAGS="-DNDEBUG $CFLAGS"
  1903. fi
  1904. case "$host" in
  1905. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  1906. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  1907. esac
  1908. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  1909. LDFLAGS=""
  1910. fi
  1911. CXXFLAGS=" $CXXFLAGS"
  1912. AC_PROG_CXX
  1913. if test "$GXX" = "yes"; then
  1914. if test "$kde_use_debug_code" = "yes"; then
  1915. CXXFLAGS="-g -O0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
  1916. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  1917. KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
  1918. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  1919. case $host in dnl
  1920. *-*-linux-gnu)
  1921. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion $CXXFLAGS"
  1922. ;;
  1923. esac
  1924. if test "$kde_use_strict_options" = "yes"; then
  1925. CXXFLAGS="-Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align $CXXFLAGS"
  1926. fi
  1927. if test "$kde_very_strict" = "yes"; then
  1928. CXXFLAGS="-Wold-style-cast -Wredundant-decls -Wconversion $CXXFLAGS"
  1929. fi
  1930. else
  1931. CXXFLAGS="-O0 $CXXFLAGS"
  1932. fi
  1933. fi
  1934. if test "$kde_use_debug_define" = "yes"; then
  1935. CXXFLAGS="-DNDEBUG $CXXFLAGS"
  1936. fi
  1937. if test "$kde_use_profiling" = "yes"; then
  1938. KDE_CHECK_COMPILER_FLAG(pg,
  1939. [
  1940. CFLAGS="-pg $CFLAGS"
  1941. CXXFLAGS="-pg $CXXFLAGS"
  1942. ])
  1943. fi
  1944. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  1945. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  1946. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  1947. AC_SUBST(USE_EXCEPTIONS)
  1948. dnl obsolete macro - provided to keep things going
  1949. USE_RTTI=
  1950. AC_SUBST(USE_RTTI)
  1951. case "$host" in
  1952. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  1953. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  1954. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  1955. *-*-solaris*)
  1956. if test "$GXX" = yes; then
  1957. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  1958. if test ! -f $libstdcpp; then
  1959. 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])
  1960. fi
  1961. fi
  1962. ;;
  1963. esac
  1964. AC_VALIDIFY_CXXFLAGS
  1965. AC_PROG_CXXCPP
  1966. # the following is to allow programs, that are known to
  1967. # have problems when compiled with -O2
  1968. if test -n "$CXXFLAGS"; then
  1969. kde_safe_IFS=$IFS
  1970. IFS=" "
  1971. NOOPT_CXXFLAGS=""
  1972. for i in $CXXFLAGS; do
  1973. case $i in
  1974. -O*)
  1975. ;;
  1976. *)
  1977. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
  1978. ;;
  1979. esac
  1980. done
  1981. IFS=$kde_safe_IFS
  1982. fi
  1983. AC_SUBST(NOOPT_CXXFLAGS)
  1984. KDE_CHECK_FINAL
  1985. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  1986. KDE_CXXFLAGS=
  1987. AC_SUBST(KDE_CXXFLAGS)
  1988. ])
  1989. AC_DEFUN(KDE_ADD_DEPENDENCIES,
  1990. [
  1991. [A]M_DEPENDENCIES(CC)
  1992. [A]M_DEPENDENCIES(CXX)
  1993. ])
  1994. dnl just a wrapper to clean up configure.in
  1995. AC_DEFUN(KDE_PROG_LIBTOOL,
  1996. [
  1997. AC_REQUIRE([AC_CHECK_COMPILERS])
  1998. AC_REQUIRE([AC_ENABLE_SHARED])
  1999. AC_REQUIRE([AC_ENABLE_STATIC])
  2000. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  2001. AC_LANG_SAVE
  2002. AC_LANG_C
  2003. AC_OBJEXT
  2004. AC_EXEEXT
  2005. AC_LANG_RESTORE
  2006. AM_PROG_LIBTOOL
  2007. AC_LIBTOOL_CXX
  2008. LIBTOOL_SHELL="/bin/sh ./libtool"
  2009. # LIBTOOL="$LIBTOOL --silent"
  2010. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH)"
  2011. AC_SUBST(KDE_PLUGIN)
  2012. ])
  2013. AC_DEFUN(KDE_CHECK_TYPES,
  2014. [ AC_CHECK_SIZEOF(int, 4)dnl
  2015. AC_CHECK_SIZEOF(long, 4)dnl
  2016. AC_CHECK_SIZEOF(char *, 4)dnl
  2017. AC_CHECK_SIZEOF(char, 1)dnl
  2018. ])dnl
  2019. AC_DEFUN(KDE_DO_IT_ALL,
  2020. [
  2021. AC_CANONICAL_SYSTEM
  2022. AC_ARG_PROGRAM
  2023. AM_INIT_AUTOMAKE($1, $2)
  2024. AM_DISABLE_LIBRARIES
  2025. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  2026. AC_CHECK_COMPILERS
  2027. KDE_PROG_LIBTOOL
  2028. AM_KDE_WITH_NLS
  2029. AC_PATH_KDE
  2030. ])
  2031. AC_DEFUN(AC_CHECK_RPATH,
  2032. [
  2033. AC_MSG_CHECKING(for rpath)
  2034. AC_ARG_ENABLE(rpath,
  2035. [ --disable-rpath do not use the rpath feature of ld],
  2036. USE_RPATH=$enableval, USE_RPATH=yes)
  2037. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  2038. KDE_RPATH="-R \$(kde_libraries)"
  2039. if test -n "$qt_libraries"; then
  2040. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  2041. fi
  2042. dnl $x_libraries is set to /usr/lib in case
  2043. if test -n "$X_LDFLAGS"; then
  2044. KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
  2045. fi
  2046. if test -n "$KDE_EXTRA_RPATH"; then
  2047. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  2048. fi
  2049. fi
  2050. AC_SUBST(KDE_EXTRA_RPATH)
  2051. AC_SUBST(KDE_RPATH)
  2052. AC_MSG_RESULT($USE_RPATH)
  2053. ])
  2054. dnl Check for the type of the third argument of getsockname
  2055. AC_DEFUN(AC_CHECK_SOCKLEN_T, [
  2056. AC_MSG_CHECKING(for socklen_t)
  2057. AC_CACHE_VAL(ac_cv_socklen_t, [
  2058. AC_LANG_SAVE
  2059. AC_LANG_CPLUSPLUS
  2060. AC_TRY_COMPILE([
  2061. #include <sys/types.h>
  2062. #include <sys/socket.h>
  2063. ],[
  2064. socklen_t a=0;
  2065. getsockname(0,(struct sockaddr*)0, &a);
  2066. ],
  2067. ac_cv_socklen_t=socklen_t,
  2068. AC_TRY_COMPILE([
  2069. #include <sys/types.h>
  2070. #include <sys/socket.h>
  2071. ],[
  2072. int a=0;
  2073. getsockname(0,(struct sockaddr*)0, &a);
  2074. ],
  2075. ac_cv_socklen_t=int,
  2076. ac_cv_socklen_t=size_t
  2077. )
  2078. )
  2079. AC_LANG_RESTORE
  2080. ])
  2081. AC_MSG_RESULT($ac_cv_socklen_t)
  2082. if test "$ac_cv_socklen_t" != "socklen_t"; then
  2083. AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
  2084. [Define the real type of socklen_t])
  2085. fi
  2086. AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
  2087. ])
  2088. dnl This is a merge of some macros out of the gettext aclocal.m4
  2089. dnl since we don't need anything, I took the things we need
  2090. dnl the copyright for them is:
  2091. dnl >
  2092. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  2093. dnl This Makefile.in is free software; the Free Software Foundation
  2094. dnl gives unlimited permission to copy and/or distribute it,
  2095. dnl with or without modifications, as long as this notice is preserved.
  2096. dnl This program is distributed in the hope that it will be useful,
  2097. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  2098. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  2099. dnl PARTICULAR PURPOSE.
  2100. dnl >
  2101. dnl for this file it is relicensed under LGPL
  2102. AC_DEFUN(AM_KDE_WITH_NLS,
  2103. [
  2104. dnl If we use NLS figure out what method
  2105. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  2106. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  2107. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  2108. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  2109. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  2110. GMSGFMT=":"
  2111. fi
  2112. MSGFMT=$GMSGFMT
  2113. AC_SUBST(GMSGFMT)
  2114. AC_SUBST(MSGFMT)
  2115. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  2116. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  2117. dnl Test whether we really found GNU xgettext.
  2118. if test "$XGETTEXT" != ":"; then
  2119. dnl If it is no GNU xgettext we define it as : so that the
  2120. dnl Makefiles still can work.
  2121. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  2122. : ;
  2123. else
  2124. AC_MSG_RESULT(
  2125. [found xgettext programs is not GNU xgettext; ignore it])
  2126. XGETTEXT=":"
  2127. fi
  2128. fi
  2129. AC_SUBST(XGETTEXT)
  2130. ])
  2131. # Search path for a program which passes the given test.
  2132. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  2133. # serial 1
  2134. # Stephan Kulow: I appended a _KDE against name conflicts
  2135. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  2136. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  2137. AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
  2138. [# Extract the first word of "$2", so it can be a program name with args.
  2139. set dummy $2; ac_word=[$]2
  2140. AC_MSG_CHECKING([for $ac_word])
  2141. AC_CACHE_VAL(ac_cv_path_$1,
  2142. [case "[$]$1" in
  2143. /*)
  2144. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  2145. ;;
  2146. *)
  2147. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  2148. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  2149. test -z "$ac_dir" && ac_dir=.
  2150. if test -f $ac_dir/$ac_word; then
  2151. if [$3]; then
  2152. ac_cv_path_$1="$ac_dir/$ac_word"
  2153. break
  2154. fi
  2155. fi
  2156. done
  2157. IFS="$ac_save_ifs"
  2158. dnl If no 4th arg is given, leave the cache variable unset,
  2159. dnl so AC_PATH_PROGS will keep looking.
  2160. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  2161. ])dnl
  2162. ;;
  2163. esac])dnl
  2164. $1="$ac_cv_path_$1"
  2165. if test -n "[$]$1"; then
  2166. AC_MSG_RESULT([$]$1)
  2167. else
  2168. AC_MSG_RESULT(no)
  2169. fi
  2170. AC_SUBST($1)dnl
  2171. ])
  2172. # Check whether LC_MESSAGES is available in <locale.h>.
  2173. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2174. # serial 1
  2175. AC_DEFUN(AM_LC_MESSAGES,
  2176. [if test $ac_cv_header_locale_h = yes; then
  2177. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  2178. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  2179. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  2180. if test $am_cv_val_LC_MESSAGES = yes; then
  2181. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  2182. fi
  2183. fi])
  2184. dnl From Jim Meyering.
  2185. dnl FIXME: migrate into libit.
  2186. AC_DEFUN(AM_FUNC_OBSTACK,
  2187. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  2188. [AC_TRY_LINK([#include "obstack.h"],
  2189. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  2190. am_cv_func_obstack=yes,
  2191. am_cv_func_obstack=no)])
  2192. if test $am_cv_func_obstack = yes; then
  2193. AC_DEFINE(HAVE_OBSTACK)
  2194. else
  2195. LIBOBJS="$LIBOBJS obstack.o"
  2196. fi
  2197. ])
  2198. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  2199. dnl FIXME: Migrate into libit
  2200. AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
  2201. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  2202. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  2203. am_cv_lib_error_at_line=yes,
  2204. am_cv_lib_error_at_line=no)])
  2205. if test $am_cv_lib_error_at_line = no; then
  2206. LIBOBJS="$LIBOBJS error.o"
  2207. fi
  2208. AC_SUBST(LIBOBJS)dnl
  2209. ])
  2210. # Macro to add for using GNU gettext.
  2211. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2212. # serial 1
  2213. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  2214. AC_DEFUN(AM_KDE_GNU_GETTEXT,
  2215. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  2216. AC_REQUIRE([AC_PROG_RANLIB])dnl
  2217. AC_REQUIRE([AC_HEADER_STDC])dnl
  2218. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  2219. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  2220. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  2221. AC_REQUIRE([AC_FUNC_MMAP])dnl
  2222. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  2223. AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
  2224. AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
  2225. __argz_count __argz_stringify __argz_next])
  2226. AC_MSG_CHECKING(for stpcpy)
  2227. AC_CACHE_VAL(kde_cv_func_stpcpy,
  2228. [
  2229. kde_safe_cxxflags=$CXXFLAGS
  2230. CXXFLAGS="-Wmissing-prototypes -Werror"
  2231. AC_LANG_SAVE
  2232. AC_LANG_CPLUSPLUS
  2233. AC_TRY_COMPILE([
  2234. #include <string.h>
  2235. ],
  2236. [
  2237. char buffer[200];
  2238. stpcpy(buffer, buffer);
  2239. ],
  2240. kde_cv_func_stpcpy=yes,
  2241. kde_cv_func_stpcpy=no)
  2242. AC_LANG_RESTORE
  2243. CXXFLAGS=$kde_safe_cxxflags
  2244. ])
  2245. AC_MSG_RESULT($kde_cv_func_stpcpy)
  2246. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  2247. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  2248. fi
  2249. AM_LC_MESSAGES
  2250. if test "x$CATOBJEXT" != "x"; then
  2251. if test "x$ALL_LINGUAS" = "x"; then
  2252. LINGUAS=
  2253. else
  2254. AC_MSG_CHECKING(for catalogs to be installed)
  2255. NEW_LINGUAS=
  2256. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  2257. case "$ALL_LINGUAS" in
  2258. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  2259. esac
  2260. done
  2261. LINGUAS=$NEW_LINGUAS
  2262. AC_MSG_RESULT($LINGUAS)
  2263. fi
  2264. dnl Construct list of names of catalog files to be constructed.
  2265. if test -n "$LINGUAS"; then
  2266. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  2267. fi
  2268. fi
  2269. ])
  2270. AC_DEFUN(AC_HAVE_XPM,
  2271. [AC_REQUIRE_CPP()dnl
  2272. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2273. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  2274. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  2275. AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
  2276. xpm_test=$withval, xpm_test="yes")
  2277. if test "x$xpm_test" = xno; then
  2278. ac_cv_have_xpm=no
  2279. else
  2280. AC_MSG_CHECKING(for XPM)
  2281. AC_CACHE_VAL(ac_cv_have_xpm,
  2282. [
  2283. AC_LANG_C
  2284. ac_save_ldflags="$LDFLAGS"
  2285. ac_save_cflags="$CFLAGS"
  2286. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  2287. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  2288. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  2289. AC_TRY_LINK([#include <X11/xpm.h>],[],
  2290. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  2291. LDFLAGS="$ac_save_ldflags"
  2292. CFLAGS="$ac_save_cflags"
  2293. ])dnl
  2294. if test "$ac_cv_have_xpm" = no; then
  2295. AC_MSG_RESULT(no)
  2296. XPM_LDFLAGS=""
  2297. XPMINC=""
  2298. $2
  2299. else
  2300. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  2301. if test "$XPM_LDFLAGS" = ""; then
  2302. XPMLIB='-lXpm $(LIB_X11)'
  2303. else
  2304. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  2305. fi
  2306. if test "$XPM_INCLUDE" = ""; then
  2307. XPMINC=""
  2308. else
  2309. XPMINC="-I$XPM_INCLUDE"
  2310. fi
  2311. AC_MSG_RESULT(yes)
  2312. $1
  2313. fi
  2314. fi
  2315. AC_SUBST(XPMINC)
  2316. AC_SUBST(XPMLIB)
  2317. ])
  2318. AC_DEFUN(AC_HAVE_DPMS,
  2319. [AC_REQUIRE_CPP()dnl
  2320. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2321. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  2322. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  2323. DPMS_LIB=
  2324. AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
  2325. dpms_test=$withval, dpms_test="yes")
  2326. if test "x$dpms_test" = xno; then
  2327. ac_cv_have_dpms=no
  2328. else
  2329. AC_MSG_CHECKING(for DPMS)
  2330. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  2331. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  2332. AC_CACHE_VAL(ac_cv_have_dpms,
  2333. [
  2334. AC_LANG_C
  2335. ac_save_ldflags="$LDFLAGS"
  2336. ac_save_cflags="$CFLAGS"
  2337. ac_save_libs="$LIBS"
  2338. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2339. CFLAGS="$CFLAGS $X_INCLUDES"
  2340. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2341. AC_TRY_LINK([
  2342. #include <X11/Xproto.h>
  2343. #include <X11/X.h>
  2344. #include <X11/Xlib.h>
  2345. #include <X11/extensions/dpms.h>
  2346. int foo_test_dpms()
  2347. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2348. ac_cv_have_dpms="yes", [
  2349. LDFLAGS="$ac_save_ldflags"
  2350. CFLAGS="$ac_save_cflags"
  2351. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2352. LIBS="$LIBS -lXdpms"
  2353. CFLAGS="$CFLAGS $X_INCLUDES"
  2354. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2355. AC_TRY_LINK([
  2356. #include <X11/Xproto.h>
  2357. #include <X11/X.h>
  2358. #include <X11/Xlib.h>
  2359. #include <X11/extensions/dpms.h>
  2360. int foo_test_dpms()
  2361. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2362. [
  2363. ac_cv_have_dpms="-lXdpms"
  2364. ],ac_cv_have_dpms="no")
  2365. ])
  2366. LDFLAGS="$ac_save_ldflags"
  2367. CFLAGS="$ac_save_cflags"
  2368. LIBS="$ac_save_libs"
  2369. ])dnl
  2370. if test "$ac_cv_have_dpms" = no; then
  2371. AC_MSG_RESULT(no)
  2372. DPMS_LDFLAGS=""
  2373. DPMSINC=""
  2374. $2
  2375. else
  2376. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  2377. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  2378. DPMS_LIB="-lXdpms"
  2379. fi
  2380. if test "$DPMS_LDFLAGS" = ""; then
  2381. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  2382. else
  2383. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  2384. fi
  2385. if test "$DPMS_INCLUDE" = ""; then
  2386. DPMSINC=""
  2387. else
  2388. DPMSINC="-I$DPMS_INCLUDE"
  2389. fi
  2390. AC_MSG_RESULT(yes)
  2391. $1
  2392. fi
  2393. fi
  2394. AC_SUBST(DPMSINC)
  2395. AC_SUBST(DPMSLIB)
  2396. ])
  2397. AC_DEFUN(AC_HAVE_GL,
  2398. [AC_REQUIRE_CPP()dnl
  2399. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2400. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  2401. test -z "$GL_INCLUDE" && GL_INCLUDE=
  2402. AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
  2403. gl_test=$withval, gl_test="yes")
  2404. if test "x$gl_test" = xno; then
  2405. ac_cv_have_gl=no
  2406. else
  2407. AC_MSG_CHECKING(for GL)
  2408. AC_CACHE_VAL(ac_cv_have_gl,
  2409. [
  2410. AC_LANG_C
  2411. ac_save_ldflags="$LDFLAGS"
  2412. ac_save_cflags="$CFLAGS"
  2413. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
  2414. CFLAGS="$CFLAGS $X_INCLUDES"
  2415. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  2416. AC_TRY_LINK([#include <GL/gl.h>
  2417. #include <GL/glu.h>
  2418. ], [],
  2419. ac_cv_have_gl="mesa", ac_cv_have_gl="no")
  2420. if test "x$ac_cv_have_gl" = "xno"; then
  2421. LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
  2422. CFLAGS="$ac_save_cflags $X_INCLUDES"
  2423. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  2424. AC_TRY_LINK([#include <GL/gl.h>
  2425. #include <GL/glu.h>
  2426. ], [],
  2427. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  2428. fi
  2429. LDFLAGS="$ac_save_ldflags"
  2430. CFLAGS="$ac_save_cflags"
  2431. ])dnl
  2432. if test "$ac_cv_have_gl" = "no"; then
  2433. AC_MSG_RESULT(no)
  2434. GL_LDFLAGS=""
  2435. GLINC=""
  2436. $2
  2437. else
  2438. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  2439. if test "$GL_LDFLAGS" = ""; then
  2440. if test "$ac_cv_have_gl" = "mesa"; then
  2441. GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
  2442. else
  2443. GLLIB='-lGL -lGLU $(LIB_X11)'
  2444. fi
  2445. else
  2446. if test "$ac_cv_have_gl" = "mesa"; then
  2447. GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
  2448. else
  2449. GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
  2450. fi
  2451. fi
  2452. if test "$GL_INCLUDE" = ""; then
  2453. GLINC=""
  2454. else
  2455. GLINC="-I$GL_INCLUDE"
  2456. fi
  2457. AC_MSG_RESULT($ac_cv_have_gl)
  2458. $1
  2459. fi
  2460. fi
  2461. AC_SUBST(GLINC)
  2462. AC_SUBST(GLLIB)
  2463. ])
  2464. dnl shadow password and PAM magic - maintained by ossi@kde.org
  2465. AC_DEFUN(KDE_PAM, [
  2466. AC_REQUIRE([KDE_CHECK_LIBDL])
  2467. AC_ARG_WITH(pam,
  2468. [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
  2469. [ if test "x$withval" = "xyes"; then
  2470. use_pam=yes
  2471. pam_service=kde
  2472. elif test "x$withval" = "xno"; then
  2473. use_pam=no
  2474. else
  2475. use_pam=yes
  2476. pam_service=$withval
  2477. fi
  2478. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  2479. ], [
  2480. AC_CACHE_VAL(ac_cv_path_pam,
  2481. [ use_pam=no
  2482. AC_CHECK_LIB(pam, pam_start,
  2483. [ AC_CHECK_HEADER(security/pam_appl.h,
  2484. [ use_pam=yes
  2485. pam_service=kde ])
  2486. ], , $LIBDL)
  2487. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  2488. ])
  2489. ])
  2490. eval "$ac_cv_path_pam"
  2491. AC_MSG_CHECKING(for PAM)
  2492. if test "x$use_pam" = xno; then
  2493. AC_MSG_RESULT(no)
  2494. PAMLIBS=""
  2495. else
  2496. AC_MSG_RESULT(yes)
  2497. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  2498. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  2499. dnl test whether struct pam_message is const (Linux) or not (Sun)
  2500. AC_MSG_CHECKING(for const pam_message)
  2501. AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
  2502. [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
  2503. [AC_MSG_RESULT([const: Linux-type PAM])],
  2504. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  2505. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  2506. )],
  2507. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  2508. fi
  2509. AC_SUBST(PAMLIBS)
  2510. ])
  2511. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  2512. AC_DEFUN(DEF_PAM_SERVICE, [
  2513. AC_ARG_WITH($1-pam,
  2514. [ --with-$1-pam=[val] override PAM service from --with-pam for $2],
  2515. [ if test "x$use_pam" = xyes; then
  2516. $3_PAM_SERVICE="$withval"
  2517. else
  2518. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  2519. You may want to enforce it by using --with-pam.])
  2520. fi
  2521. ],
  2522. [ if test "x$use_pam" = xyes; then
  2523. $3_PAM_SERVICE="$pam_service"
  2524. fi
  2525. ])
  2526. if test -n "$$3_PAM_SERVICE"; then
  2527. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  2528. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  2529. fi
  2530. AC_SUBST($3_PAM_SERVICE)
  2531. ])
  2532. AC_DEFUN(KDE_SHADOWPASSWD, [
  2533. AC_REQUIRE([KDE_PAM])
  2534. AC_CHECK_LIB(shadow, getspent,
  2535. [ LIBSHADOW="-lshadow"
  2536. ac_use_shadow=yes
  2537. ],
  2538. [ dnl for UnixWare
  2539. AC_CHECK_LIB(gen, getspent,
  2540. [ LIBGEN="-lgen"
  2541. ac_use_shadow=yes
  2542. ],
  2543. [ AC_CHECK_FUNC(getspent,
  2544. [ ac_use_shadow=yes ],
  2545. [ ac_use_shadow=no ])
  2546. ])
  2547. ])
  2548. AC_SUBST(LIBSHADOW)
  2549. AC_SUBST(LIBGEN)
  2550. AC_MSG_CHECKING([for shadow passwords])
  2551. AC_ARG_WITH(shadow,
  2552. [ --with-shadow If you want shadow password support ],
  2553. [ if test "x$withval" != "xno"; then
  2554. use_shadow=yes
  2555. else
  2556. use_shadow=no
  2557. fi
  2558. ], [
  2559. use_shadow="$ac_use_shadow"
  2560. ])
  2561. if test "x$use_shadow" = xyes; then
  2562. AC_MSG_RESULT(yes)
  2563. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  2564. else
  2565. AC_MSG_RESULT(no)
  2566. LIBSHADOW=
  2567. LIBGEN=
  2568. fi
  2569. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  2570. dnl this still applies, if we could use it indirectly through pam.
  2571. if test "x$use_shadow" = xyes ||
  2572. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  2573. case $host in
  2574. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  2575. SETUIDFLAGS="-m 4755 -o root";;
  2576. *)
  2577. SETUIDFLAGS="-m 4755";;
  2578. esac
  2579. fi
  2580. AC_SUBST(SETUIDFLAGS)
  2581. ])
  2582. AC_DEFUN(KDE_PASSWDLIBS, [
  2583. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  2584. AC_REQUIRE([KDE_PAM])
  2585. AC_REQUIRE([KDE_SHADOWPASSWD])
  2586. if test "x$use_pam" = "xyes"; then
  2587. PASSWDLIBS="$PAMLIBS"
  2588. else
  2589. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  2590. fi
  2591. AC_SUBST(PASSWDLIBS)
  2592. ])
  2593. AC_DEFUN(KDE_CHECK_LIBDL,
  2594. [
  2595. AC_CHECK_LIB(dl, dlopen, [
  2596. LIBDL="-ldl"
  2597. ac_cv_have_dlfcn=yes
  2598. ])
  2599. AC_CHECK_LIB(dld, shl_unload, [
  2600. LIBDL="-ldld"
  2601. ac_cv_have_shload=yes
  2602. ])
  2603. AC_SUBST(LIBDL)
  2604. ])
  2605. AC_DEFUN(KDE_CHECK_DLOPEN,
  2606. [
  2607. KDE_CHECK_LIBDL
  2608. AC_CHECK_HEADERS(dlfcn.h dl.h)
  2609. if test "$ac_cv_header_dlfcn_h" = "no"; then
  2610. ac_cv_have_dlfcn=no
  2611. fi
  2612. if test "$ac_cv_header_dl_h" = "no"; then
  2613. ac_cv_have_shload=no
  2614. fi
  2615. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  2616. dnl (MM)
  2617. AC_ARG_ENABLE(dlopen,
  2618. [ --disable-dlopen link statically [default=no]] ,
  2619. enable_dlopen=$enableval,
  2620. enable_dlopen=yes)
  2621. # override the user's opinion, if we know it better ;)
  2622. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  2623. enable_dlopen=no
  2624. fi
  2625. if test "$ac_cv_have_dlfcn" = "yes"; then
  2626. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  2627. fi
  2628. if test "$ac_cv_have_shload" = "yes"; then
  2629. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  2630. fi
  2631. if test "$enable_dlopen" = no ; then
  2632. test -n "$1" && eval $1
  2633. else
  2634. test -n "$2" && eval $2
  2635. fi
  2636. ])
  2637. AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
  2638. [
  2639. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  2640. KDE_PROG_LIBTOOL
  2641. AC_MSG_CHECKING([dynamic loading])
  2642. eval "`egrep '^build_libtool_libs=' libtool`"
  2643. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  2644. dynamic_loading=yes
  2645. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  2646. else
  2647. dynamic_loading=no
  2648. fi
  2649. AC_MSG_RESULT($dynamic_loading)
  2650. if test "$dynamic_loading" = "yes"; then
  2651. $1
  2652. else
  2653. $2
  2654. fi
  2655. ])
  2656. AC_DEFUN(KDE_ADD_INCLUDES,
  2657. [
  2658. if test -z "$1"; then
  2659. test_include="Pix.h"
  2660. else
  2661. test_include="$1"
  2662. fi
  2663. AC_MSG_CHECKING([for libg++ ($test_include)])
  2664. AC_CACHE_VAL(kde_cv_libgpp_includes,
  2665. [
  2666. kde_cv_libgpp_includes=no
  2667. for ac_dir in \
  2668. \
  2669. /usr/include/g++ \
  2670. /usr/include \
  2671. /usr/unsupported/include \
  2672. /opt/include \
  2673. $extra_include \
  2674. ; \
  2675. do
  2676. if test -r "$ac_dir/$test_include"; then
  2677. kde_cv_libgpp_includes=$ac_dir
  2678. break
  2679. fi
  2680. done
  2681. ])
  2682. AC_MSG_RESULT($kde_cv_libgpp_includes)
  2683. if test "$kde_cv_libgpp_includes" != "no"; then
  2684. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  2685. fi
  2686. ])
  2687. ])
  2688. AC_DEFUN(KDE_CHECK_MICO,
  2689. [
  2690. AC_REQUIRE([KDE_CHECK_LIBDL])
  2691. AC_REQUIRE([KDE_MISC_TESTS])
  2692. AC_MSG_CHECKING(for MICO)
  2693. if test -z "$MICODIR"; then
  2694. kde_micodir=/usr/local
  2695. else
  2696. kde_micodir="$MICODIR"
  2697. fi
  2698. AC_ARG_WITH(micodir,
  2699. [ --with-micodir=micodir where mico is installed ],
  2700. kde_micodir=$withval,
  2701. kde_micodir=$kde_micodir
  2702. )
  2703. AC_CACHE_VAL(kde_cv_mico_incdir,
  2704. [
  2705. mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
  2706. AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
  2707. ])
  2708. kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
  2709. if test ! -r $kde_micodir/include/CORBA.h; then
  2710. AC_MSG_ERROR([No CORBA.h found, specify another micodir])
  2711. fi
  2712. AC_MSG_RESULT($kde_micodir)
  2713. MICO_INCLUDES=-I$kde_micodir/include
  2714. AC_SUBST(MICO_INCLUDES)
  2715. MICO_LDFLAGS=-L$kde_micodir/lib
  2716. AC_SUBST(MICO_LDFLAGS)
  2717. micodir=$kde_micodir
  2718. AC_SUBST(micodir)
  2719. AC_MSG_CHECKING([for MICO version])
  2720. AC_CACHE_VAL(kde_cv_mico_version,
  2721. [
  2722. AC_LANG_C
  2723. cat >conftest.$ac_ext <<EOF
  2724. #include <stdio.h>
  2725. #include <mico/version.h>
  2726. int main() {
  2727. printf("MICO_VERSION=%s\n",MICO_VERSION);
  2728. return (0);
  2729. }
  2730. EOF
  2731. ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
  2732. if AC_TRY_EVAL(ac_compile); then
  2733. if eval `./conftest 2>&5`; then
  2734. kde_cv_mico_version=$MICO_VERSION
  2735. else
  2736. AC_MSG_ERROR([your system is not able to execute a small application to
  2737. find MICO version! Check $kde_micodir/include/mico/version.h])
  2738. fi
  2739. else
  2740. AC_MSG_ERROR([your system is not able to compile a small application to
  2741. find MICO version! Check $kde_micodir/include/mico/version.h])
  2742. fi
  2743. ])
  2744. dnl installed MICO version
  2745. mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  2746. mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  2747. mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  2748. if test "x$1" = "x"; then
  2749. req_version="2.3.0"
  2750. else
  2751. req_version=$1
  2752. fi
  2753. dnl required MICO version
  2754. req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  2755. req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  2756. req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  2757. if test "$mico_v_maj" -lt "$req_v_maj" || \
  2758. ( test "$mico_v_maj" -eq "$req_v_maj" && \
  2759. test "$mico_v_mid" -lt "$req_v_mid" ) || \
  2760. ( test "$mico_v_mid" -eq "$req_v_mid" && \
  2761. test "$mico_v_min" -lt "$req_v_min" )
  2762. then
  2763. AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
  2764. at least is required. You should upgrade MICO.])
  2765. else
  2766. AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
  2767. fi
  2768. LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
  2769. AC_SUBST(LIBMICO)
  2770. if test -z "$IDL"; then
  2771. IDL='$(kde_bindir)/cuteidl'
  2772. fi
  2773. AC_SUBST(IDL)
  2774. IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
  2775. AC_SUBST(IDL_DEPENDENCIES)
  2776. idldir="\$(includedir)/idl"
  2777. AC_SUBST(idldir)
  2778. ])
  2779. AC_DEFUN(KDE_CHECK_MINI_STL,
  2780. [
  2781. AC_REQUIRE([KDE_CHECK_MICO])
  2782. AC_MSG_CHECKING(if we use mico's mini-STL)
  2783. AC_CACHE_VAL(kde_cv_have_mini_stl,
  2784. [
  2785. AC_LANG_SAVE
  2786. AC_LANG_CPLUSPLUS
  2787. kde_save_cxxflags="$CXXFLAGS"
  2788. CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
  2789. AC_TRY_COMPILE(
  2790. [
  2791. #include <mico/config.h>
  2792. ],
  2793. [
  2794. #ifdef HAVE_MINI_STL
  2795. #error "nothing"
  2796. #endif
  2797. ],
  2798. kde_cv_have_mini_stl=no,
  2799. kde_cv_have_mini_stl=yes)
  2800. CXXFLAGS="$kde_save_cxxflags"
  2801. AC_LANG_RESTORE
  2802. ])
  2803. if test "x$kde_cv_have_mini_stl" = "xyes"; then
  2804. AC_MSG_RESULT(yes)
  2805. $1
  2806. else
  2807. AC_MSG_RESULT(no)
  2808. $2
  2809. fi
  2810. ])
  2811. ])
  2812. AC_DEFUN(KDE_CHECK_LIBPTHREAD,
  2813. [
  2814. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
  2815. AC_SUBST(LIBPTHREAD)
  2816. ])
  2817. AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
  2818. [
  2819. AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
  2820. kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
  2821. if test "$kde_use_kernthreads" = "yes"; then
  2822. ac_save_CXXFLAGS="$CXXFLAGS"
  2823. ac_save_CFLAGS="$CXXFLAGS"
  2824. CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
  2825. CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
  2826. AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
  2827. CXXFLAGS="$ac_save_CXXFLAGS"
  2828. CFLAGS="$ac_save_CFLAGS"
  2829. if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
  2830. kde_use_kernthreads=no
  2831. else
  2832. dnl Add proper -I and -l statements
  2833. AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
  2834. if test "x$LIBPTHREAD" = "x"; then
  2835. kde_use_kernthreads=no
  2836. else
  2837. USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
  2838. fi
  2839. fi
  2840. else
  2841. USE_THREADS=""
  2842. if test -z "$LIBPTHREAD"; then
  2843. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
  2844. fi
  2845. fi
  2846. case $host_os in
  2847. solaris*)
  2848. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  2849. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  2850. echo "Setting Solaris pthread compilation options"
  2851. ;;
  2852. freebsd*)
  2853. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  2854. echo "Setting FreeBSD pthread compilation options"
  2855. ;;
  2856. aix*)
  2857. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  2858. LIBPTHREAD="$LIBPTHREAD -lc_r"
  2859. echo "Setting AIX pthread compilation options"
  2860. ;;
  2861. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  2862. USE_THREADS="$USE_THREADS -DPIC -fPIC"
  2863. echo "Setting Linux pthread compilation options"
  2864. ;;
  2865. *)
  2866. ;;
  2867. esac
  2868. AC_SUBST(USE_THREADS)
  2869. AC_SUBST(LIBPTHREAD)
  2870. ])
  2871. AC_DEFUN(KDE_CHECK_THREADING,
  2872. [
  2873. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  2874. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  2875. dnl default is yes if libpthread is found and no if no libpthread is available
  2876. if test -z "$LIBPTHREAD"; then
  2877. kde_check_threading_default=no
  2878. else
  2879. kde_check_threading_default=yes
  2880. fi
  2881. AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
  2882. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  2883. if test "x$kde_use_threading" = "xyes"; then
  2884. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  2885. fi
  2886. ])
  2887. AC_DEFUN(KDE_TRY_LINK_PYTHON,
  2888. [
  2889. if test "$kde_python_link_found" = no; then
  2890. if test "$1" = normal; then
  2891. AC_MSG_CHECKING(if a Python application links)
  2892. else
  2893. AC_MSG_CHECKING(if Python depends on $2)
  2894. fi
  2895. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  2896. [
  2897. AC_LANG_SAVE
  2898. AC_LANG_C
  2899. kde_save_cflags="$CFLAGS"
  2900. CFLAGS="$CFLAGS $PYTHONINC"
  2901. kde_save_libs="$LIBS"
  2902. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  2903. kde_save_ldflags="$LDFLAGS"
  2904. LDFLAGS="$LDFLAGS $PYTHONLIB"
  2905. AC_TRY_LINK(
  2906. [
  2907. #include <Python.h>
  2908. ],[
  2909. PySys_SetArgv(1, 0);
  2910. ],
  2911. [kde_cv_try_link_python_$1=yes],
  2912. [kde_cv_try_link_python_$1=no]
  2913. )
  2914. CFLAGS="$kde_save_cflags"
  2915. LIBS="$kde_save_libs"
  2916. LDFLAGS="$kde_save_ldflags"
  2917. ])
  2918. if test "$kde_cv_try_link_python_$1" = "yes"; then
  2919. AC_MSG_RESULT(yes)
  2920. kde_python_link_found=yes
  2921. if test ! "$1" = normal; then
  2922. LIBPYTHON="$LIBPYTHON $2"
  2923. fi
  2924. $3
  2925. else
  2926. AC_MSG_RESULT(no)
  2927. $4
  2928. fi
  2929. AC_LANG_RESTORE
  2930. fi
  2931. ])
  2932. AC_DEFUN(KDE_CHECK_PYTHON_DIR,
  2933. [
  2934. AC_MSG_CHECKING([for Python directory])
  2935. AC_CACHE_VAL(kde_cv_pythondir,
  2936. [
  2937. if test -z "$PYTHONDIR"; then
  2938. kde_cv_pythondir=/usr/local
  2939. else
  2940. kde_cv_pythondir="$PYTHONDIR"
  2941. fi
  2942. ])
  2943. AC_ARG_WITH(pythondir,
  2944. [ --with-pythondir=pythondir use python installed in pythondir ],
  2945. [
  2946. ac_python_dir=$withval
  2947. ], ac_python_dir=$kde_cv_pythondir
  2948. )
  2949. AC_MSG_RESULT($ac_python_dir)
  2950. ])
  2951. AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
  2952. [
  2953. AC_REQUIRE([KDE_CHECK_LIBDL])
  2954. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  2955. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  2956. if test -z "$1"; then
  2957. version="1.5"
  2958. else
  2959. version="$1"
  2960. fi
  2961. AC_MSG_CHECKING([for Python$version])
  2962. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  2963. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  2964. if test ! -r $python_incdir/Python.h; then
  2965. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  2966. python_incdir=$python_incdir/python$version
  2967. if test ! -r $python_incdir/Python.h; then
  2968. python_incdir=no
  2969. fi
  2970. fi
  2971. PYTHONINC=-I$python_incdir
  2972. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  2973. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  2974. if test ! -r $python_libdir/libpython$version.a; then
  2975. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  2976. python_libdir=$python_libdir/python$version/config
  2977. if test ! -r $python_libdir/libpython$version.a; then
  2978. python_libdir=no
  2979. fi
  2980. fi
  2981. PYTHONLIB=-L$python_libdir
  2982. kde_orig_LIBPYTHON=$LIBPYTHON
  2983. if test -z "$LIBPYTHON"; then
  2984. LIBPYTHON=-lpython$version
  2985. fi
  2986. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  2987. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  2988. python_moddir=$python_moddir/python$version
  2989. if test ! -r $python_moddir/copy.py; then
  2990. python_moddir=no
  2991. fi
  2992. PYTHONMODDIR=$python_moddir
  2993. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  2994. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  2995. LIBPYTHON=$kde_orig_LIBPYTHON
  2996. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  2997. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  2998. $2
  2999. else
  3000. dnl Note: this test is very weak
  3001. kde_python_link_found=no
  3002. KDE_TRY_LINK_PYTHON(normal)
  3003. KDE_TRY_LINK_PYTHON(m, -lm)
  3004. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  3005. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  3006. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  3007. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  3008. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  3009. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  3010. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  3011. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  3012. [AC_MSG_WARN([it seems, Python depends on another library.
  3013. Pleae use \"make LIBPYTHON='-lpython$version -lotherlib'\" to fix this
  3014. and contact the authors to let them know about this problem])
  3015. ])
  3016. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  3017. AC_SUBST(PYTHONINC)
  3018. AC_SUBST(PYTHONLIB)
  3019. AC_SUBST(LIBPYTHON)
  3020. AC_SUBST(PYTHONMODDIR)
  3021. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  3022. fi
  3023. ])
  3024. AC_DEFUN(KDE_CHECK_PYTHON,
  3025. [
  3026. KDE_CHECK_PYTHON_INTERN("2.1", [KDE_CHECK_PYTHON_INTERN("2.0",
  3027. [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
  3028. ])
  3029. ])
  3030. AC_DEFUN(KDE_CHECK_STL_SGI,
  3031. [
  3032. AC_MSG_CHECKING([if STL implementation is SGI like])
  3033. AC_CACHE_VAL(kde_cv_stl_type_sgi,
  3034. [
  3035. AC_TRY_COMPILE([
  3036. #include <string>
  3037. using namespace std;
  3038. ],[
  3039. string astring="Hallo Welt.";
  3040. astring.erase(0, 6); // now astring is "Welt"
  3041. return 0;
  3042. ], kde_cv_stl_type_sgi=yes,
  3043. kde_cv_stl_type_sgi=no)
  3044. ])
  3045. AC_MSG_RESULT($kde_cv_stl_type_sgi)
  3046. if test "$kde_cv_stl_type_sgi" = "yes"; then
  3047. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  3048. fi
  3049. ])
  3050. AC_DEFUN(KDE_CHECK_STL_HP,
  3051. [
  3052. AC_MSG_CHECKING([if STL implementation is HP like])
  3053. AC_CACHE_VAL(kde_cv_stl_type_hp,
  3054. [
  3055. AC_TRY_COMPILE([
  3056. #include <string>
  3057. using namespace std;
  3058. ],[
  3059. string astring="Hello World";
  3060. astring.remove(0, 6); // now astring is "World"
  3061. return 0;
  3062. ], kde_cv_stl_type_hp=yes,
  3063. kde_cv_stl_type_hp=no)
  3064. ])
  3065. AC_MSG_RESULT($kde_cv_stl_type_hp)
  3066. if test "$kde_cv_stl_type_hp" = "yes"; then
  3067. AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
  3068. fi
  3069. ])
  3070. AC_DEFUN(KDE_CHECK_STL,
  3071. [
  3072. AC_LANG_SAVE
  3073. AC_LANG_CPLUSPLUS
  3074. ac_save_CXXFLAGS="$CXXFLAGS"
  3075. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  3076. KDE_CHECK_STL_SGI
  3077. if test "$kde_cv_stl_type_sgi" = "no"; then
  3078. KDE_CHECK_STL_HP
  3079. if test "$kde_cv_stl_type_hp" = "no"; then
  3080. AC_MSG_ERROR("no known STL type found")
  3081. fi
  3082. fi
  3083. CXXFLAGS="$ac_save_CXXFLAGS"
  3084. AC_LANG_RESTORE
  3085. ])
  3086. AC_DEFUN(AC_FIND_QIMGIO,
  3087. [AC_REQUIRE([AC_FIND_JPEG])
  3088. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3089. AC_MSG_CHECKING([for qimgio])
  3090. AC_CACHE_VAL(ac_cv_lib_qimgio,
  3091. [
  3092. AC_LANG_SAVE
  3093. AC_LANG_CPLUSPLUS
  3094. ac_save_LIBS="$LIBS"
  3095. ac_save_CXXFLAGS="$CXXFLAGS"
  3096. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
  3097. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  3098. AC_TRY_RUN(dnl
  3099. [
  3100. #include <qimageio.h>
  3101. #include <qstring.h>
  3102. int main() {
  3103. QString t = "hallo";
  3104. t.fill('t');
  3105. qInitImageIO();
  3106. }
  3107. ],
  3108. ac_cv_lib_qimgio=yes,
  3109. ac_cv_lib_qimgio=no,
  3110. ac_cv_lib_qimgio=no)
  3111. LIBS="$ac_save_LIBS"
  3112. CXXFLAGS="$ac_save_CXXFLAGS"
  3113. AC_LANG_RESTORE
  3114. ])dnl
  3115. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  3116. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  3117. AC_MSG_RESULT(yes)
  3118. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  3119. AC_SUBST(LIBQIMGIO)
  3120. else
  3121. AC_MSG_RESULT(not found)
  3122. fi
  3123. ])
  3124. AC_DEFUN(KDE_CHECK_ANSI,
  3125. [
  3126. ])
  3127. AC_DEFUN(KDE_CHECK_INSURE,
  3128. [
  3129. AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
  3130. [
  3131. if test $enableval = "no"; dnl
  3132. then ac_use_insure="no"
  3133. else ac_use_insure="yes"
  3134. fi
  3135. ], [ac_use_insure="no"])
  3136. AC_MSG_CHECKING(if we will use Insure++ to debug)
  3137. AC_MSG_RESULT($ac_use_insure)
  3138. if test "$ac_use_insure" = "yes"; dnl
  3139. then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
  3140. fi
  3141. ])
  3142. AC_DEFUN(AM_DISABLE_LIBRARIES,
  3143. [
  3144. AC_PROVIDE([AM_ENABLE_STATIC])
  3145. AC_PROVIDE([AM_ENABLE_SHARED])
  3146. enable_static=no
  3147. enable_shared=yes
  3148. ])
  3149. AC_DEFUN(AC_CHECK_UTMP_FILE,
  3150. [
  3151. AC_MSG_CHECKING([for utmp file])
  3152. AC_CACHE_VAL(kde_cv_utmp_file,
  3153. [
  3154. kde_cv_utmp_file=no
  3155. for ac_file in \
  3156. \
  3157. /var/run/utmp \
  3158. /var/adm/utmp \
  3159. /etc/utmp \
  3160. ; \
  3161. do
  3162. if test -r "$ac_file"; then
  3163. kde_cv_utmp_file=$ac_file
  3164. break
  3165. fi
  3166. done
  3167. ])
  3168. if test "$kde_cv_utmp_file" != "no"; then
  3169. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  3170. $1
  3171. AC_MSG_RESULT($kde_cv_utmp_file)
  3172. else
  3173. $2
  3174. AC_MSG_RESULT([non found])
  3175. fi
  3176. ])
  3177. AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
  3178. [
  3179. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  3180. if test ! -s $srcdir/subdirs; then
  3181. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  3182. TOPSUBDIRS=""
  3183. files=`cd $srcdir && ls -1`
  3184. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  3185. for i in $dirs; do
  3186. echo $i >> $srcdir/subdirs
  3187. done
  3188. fi
  3189. if test -s $srcdir/inst-apps; then
  3190. ac_topsubdirs="`cat $srcdir/inst-apps`"
  3191. else
  3192. ac_topsubdirs="`cat $srcdir/subdirs`"
  3193. fi
  3194. for i in $ac_topsubdirs; do
  3195. AC_MSG_CHECKING([if $i should be compiled])
  3196. if test -d $srcdir/$i; then
  3197. install_it="yes"
  3198. for j in $DO_NOT_COMPILE; do
  3199. if test $i = $j; then
  3200. install_it="no"
  3201. fi
  3202. done
  3203. else
  3204. install_it="no"
  3205. fi
  3206. AC_MSG_RESULT($install_it)
  3207. if test $install_it = "yes"; then
  3208. TOPSUBDIRS="$TOPSUBDIRS $i"
  3209. fi
  3210. done
  3211. AC_SUBST(TOPSUBDIRS)
  3212. ])
  3213. AC_DEFUN(KDE_CHECK_NAMESPACES,
  3214. [
  3215. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  3216. AC_LANG_SAVE
  3217. AC_LANG_CPLUSPLUS
  3218. AC_TRY_COMPILE([
  3219. ],
  3220. [
  3221. namespace Foo {
  3222. extern int i;
  3223. namespace Bar {
  3224. extern int i;
  3225. }
  3226. }
  3227. int Foo::i = 0;
  3228. int Foo::Bar::i = 1;
  3229. ],[
  3230. AC_MSG_RESULT(yes)
  3231. AC_DEFINE(HAVE_NAMESPACES)
  3232. ], [
  3233. AC_MSG_RESULT(no)
  3234. ])
  3235. AC_LANG_RESTORE
  3236. ])
  3237. AC_DEFUN(KDE_CHECK_NEWLIBS,
  3238. [
  3239. ])
  3240. dnl ------------------------------------------------------------------------
  3241. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  3242. dnl ------------------------------------------------------------------------
  3243. dnl
  3244. AC_DEFUN(AC_CHECK_S_ISSOCK,
  3245. [
  3246. AC_MSG_CHECKING(for S_ISSOCK)
  3247. AC_CACHE_VAL(ac_cv_have_s_issock,
  3248. [
  3249. AC_LANG_SAVE
  3250. AC_LANG_C
  3251. AC_TRY_LINK(
  3252. [
  3253. #include <sys/stat.h>
  3254. ],
  3255. [
  3256. struct stat buff;
  3257. int b = S_ISSOCK( buff.st_mode );
  3258. ],
  3259. ac_cv_have_s_issock=yes,
  3260. ac_cv_have_s_issock=no)
  3261. AC_LANG_RESTORE
  3262. ])
  3263. AC_MSG_RESULT($ac_cv_have_s_issock)
  3264. if test "$ac_cv_have_s_issock" = "yes"; then
  3265. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  3266. fi
  3267. ])
  3268. dnl ------------------------------------------------------------------------
  3269. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  3270. dnl ------------------------------------------------------------------------
  3271. dnl
  3272. AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
  3273. [
  3274. AC_MSG_CHECKING(for MAXPATHLEN)
  3275. AC_CACHE_VAL(ac_cv_maxpathlen,
  3276. [
  3277. AC_LANG_C
  3278. cat > conftest.$ac_ext <<EOF
  3279. #ifdef STDC_HEADERS
  3280. # include <stdlib.h>
  3281. #endif
  3282. #include <stdio.h>
  3283. #include <sys/param.h>
  3284. #ifndef MAXPATHLEN
  3285. #define MAXPATHLEN 1024
  3286. #endif
  3287. KDE_HELLO MAXPATHLEN
  3288. EOF
  3289. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  3290. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  3291. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  3292. else
  3293. ac_cv_maxpathlen=1024
  3294. fi
  3295. rm conftest.*
  3296. ])
  3297. AC_MSG_RESULT($ac_cv_maxpathlen)
  3298. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  3299. ])
  3300. dnl -------------------------------------------------------------------------
  3301. dnl See if the compiler supports a template repository bero@redhat.de
  3302. dnl -------------------------------------------------------------------------
  3303. AC_DEFUN(KDE_COMPILER_REPO,
  3304. [
  3305. REPO=""
  3306. NOREPO=""
  3307. KDE_CHECK_COMPILER_FLAG(frepo,
  3308. [
  3309. REPO="-frepo"
  3310. NOREPO="-fno-repo"
  3311. ])
  3312. if test -z "$REPO"; then
  3313. KDE_CHECK_COMPILER_FLAG(instances=explicit,
  3314. [
  3315. REPO="-instances=explicit"
  3316. NOREPO="-instances=extern"
  3317. ])
  3318. fi
  3319. if test -n "$REPO"; then
  3320. AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
  3321. [C++ compiler supports template repository])
  3322. $1
  3323. fi
  3324. AC_SUBST(REPO)
  3325. AC_SUBST(NOREPO)
  3326. ])
  3327. AC_DEFUN(KDE_CHECK_HEADER,
  3328. [
  3329. AC_LANG_SAVE
  3330. kde_safe_cppflags=$CPPFLAGS
  3331. CPPFLAGS="$CPPFLAGS $all_includes"
  3332. AC_LANG_CPLUSPLUS
  3333. AC_CHECK_HEADER($1, $2, $3)
  3334. CPPFLAGS=$kde_safe_cppflags
  3335. AC_LANG_RESTORE
  3336. ])
  3337. AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
  3338. [
  3339. KDE_CHECK_HEADER(QwSpriteField.h, ,
  3340. [
  3341. AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
  3342. QwSpriteField out of kdesupport.])
  3343. $1
  3344. ])
  3345. ])
  3346. AC_DEFUN(KDE_FAST_CONFIGURE,
  3347. [
  3348. dnl makes configure fast (needs perl)
  3349. AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
  3350. with_fast_perl=$enableval, with_fast_perl=yes)
  3351. ])
  3352. AC_DEFUN(KDE_CONF_FILES,
  3353. [
  3354. val=
  3355. if test -f $srcdir/configure.files ; then
  3356. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  3357. fi
  3358. CONF_FILES=
  3359. if test -n "$val" ; then
  3360. for i in $val ; do
  3361. CONF_FILES="$CONF_FILES $i"
  3362. done
  3363. fi
  3364. AC_SUBST(CONF_FILES)
  3365. ])dnl
  3366. AC_DEFUN(KDE_SET_PREFIX,
  3367. [
  3368. unset CDPATH
  3369. dnl make $KDEDIR the default for the installation
  3370. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  3371. if test "x$prefix" = "xNONE"; then
  3372. prefix=$ac_default_prefix
  3373. ac_configure_args="$ac_configure_args --prefix $prefix"
  3374. fi
  3375. KDE_FAST_CONFIGURE
  3376. KDE_CONF_FILES
  3377. ])
  3378. pushdef([AC_PROG_INSTALL],
  3379. [
  3380. dnl our own version, testing for a -p flag
  3381. popdef([AC_PROG_INSTALL])
  3382. dnl as AC_PROG_INSTALL works as it works we first have
  3383. dnl to save if the user didn't specify INSTALL, as the
  3384. dnl autoconf one overwrites INSTALL and we have no chance to find
  3385. dnl out afterwards
  3386. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  3387. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  3388. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  3389. AC_PROG_INSTALL
  3390. if test -z "$kde_save_INSTALL_given" ; then
  3391. # OK, user hasn't given any INSTALL, autoconf found one for us
  3392. # now we test, if it supports the -p flag
  3393. AC_MSG_CHECKING(for -p flag to install)
  3394. rm -f confinst.$$.* > /dev/null 2>&1
  3395. echo "Testtest" > confinst.$$.orig
  3396. ac_res=no
  3397. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  3398. if test -f confinst.$$.new ; then
  3399. # OK, -p seems to do no harm to install
  3400. INSTALL="${INSTALL} -p"
  3401. ac_res=yes
  3402. fi
  3403. fi
  3404. rm -f confinst.$$.*
  3405. AC_MSG_RESULT($ac_res)
  3406. fi
  3407. dnl the following tries to resolve some signs and wonders coming up
  3408. dnl with different autoconf/automake versions
  3409. dnl e.g.:
  3410. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  3411. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  3412. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  3413. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  3414. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  3415. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  3416. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  3417. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  3418. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  3419. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  3420. dnl automake (due to broken Makefile.am or whatever) to install programs,
  3421. dnl and so does not see the -s flag in automake > 1.4
  3422. dnl to clean up that mess we:
  3423. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  3424. dnl which cleans KDE's program with automake > 1.4;
  3425. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  3426. dnl with automake<=1.4
  3427. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  3428. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  3429. dnl
  3430. dnl And to all this comes, that I even can't write in comments variable
  3431. dnl names used by automake, because it is so stupid to think I wanted to
  3432. dnl _use_ them, therefor I have written A_M_... instead of AM_
  3433. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  3434. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  3435. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  3436. fi
  3437. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  3438. INSTALL_SCRIPT='${INSTALL}'
  3439. fi
  3440. ])dnl
  3441. AC_DEFUN(KDE_LANG_CPLUSPLUS,
  3442. [AC_LANG_CPLUSPLUS
  3443. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  3444. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  3445. ])
  3446. pushdef([AC_LANG_CPLUSPLUS],
  3447. [popdef([AC_LANG_CPLUSPLUS])
  3448. KDE_LANG_CPLUSPLUS
  3449. ])
  3450. AC_DEFUN(KDE_CHECK_LONG_LONG,
  3451. [
  3452. AC_MSG_CHECKING(for long long)
  3453. AC_CACHE_VAL(kde_cv_c_long_long,
  3454. [
  3455. AC_LANG_SAVE
  3456. AC_LANG_CPLUSPLUS
  3457. AC_TRY_LINK([], [
  3458. long long foo = 0;
  3459. foo = foo+1;
  3460. ],
  3461. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  3462. ])
  3463. AC_MSG_RESULT($kde_cv_c_long_long)
  3464. if test "$kde_cv_c_long_long" = yes; then
  3465. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  3466. fi
  3467. ])
  3468. AC_DEFUN(KDE_CHECK_LIB,
  3469. [
  3470. kde_save_LIBS="$LIBS"
  3471. LIBS="$LIBS $all_libraries"
  3472. case $host_os in
  3473. aix*) LIBS="-brtl $LIBS"
  3474. test "$GCC" = yes && LIBS="-Wl,$LIBS"
  3475. ;;
  3476. esac
  3477. AC_CHECK_LIB($1, $2, $3, $4, $5)
  3478. LIBS="$kde_save_LIBS"
  3479. ])
  3480. AC_DEFUN(KDE_CHECK_INITGROUPS,
  3481. [
  3482. AC_REQUIRE([AC_CANONICAL_HOST])
  3483. AC_CHECK_FUNCS(initgroups)
  3484. if test "x$ac_cv_func_initgroups" = "xyes"; then
  3485. case $host_os in
  3486. aix*) AC_LANG_SAVE
  3487. AC_LANG_CPLUSPLUS
  3488. AC_MSG_CHECKING([for initgroups prototype])
  3489. AC_CACHE_VAL(kde_cv_check_initgroups_proto,
  3490. [ AC_TRY_COMPILE(
  3491. [ #include <grp.h>
  3492. ],
  3493. [ char buffer[10];
  3494. gid_t id;
  3495. int x = initgroups(buffer,id);
  3496. ],
  3497. kde_cv_check_initgroups_proto=yes,
  3498. kde_cv_check_initgroups_proto=no)
  3499. ])
  3500. AC_MSG_RESULT($kde_cv_check_initgroups_proto)
  3501. AC_LANG_RESTORE
  3502. ;;
  3503. *)
  3504. kde_cv_check_initgroups_proto=yes
  3505. ;;
  3506. esac
  3507. else
  3508. kde_cv_check_initgroups_proto=no
  3509. fi
  3510. if test "x$kde_cv_check_initgroups_proto" = "xyes"; then
  3511. kde_check_initgroups_proto=1
  3512. else
  3513. kde_check_initgroups_proto=0
  3514. fi
  3515. AC_DEFINE_UNQUOTED(HAVE_INITGROUPS_PROTO,$kde_check_initgroups_proto,
  3516. [initgroups may exist but not its prototype (e.g. AIX<4.3.3:8)])
  3517. ])
  3518. AC_DEFUN(KDE_CHECK_JAVA_DIR,
  3519. [
  3520. AC_MSG_CHECKING([for Java directory])
  3521. AC_ARG_WITH(java,
  3522. [ --with-java=javadir use java installed in javadir, --without-java disables ],
  3523. [ ac_java_dir=$withval
  3524. ], ac_java_dir=""
  3525. )
  3526. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  3527. if test "x$ac_java_dir" = xno; then
  3528. kde_cv_java_bindir=no
  3529. kde_cv_java_includedir=no
  3530. kde_cv_java_libjvmdir=no
  3531. kde_cv_java_libhpidir=no
  3532. else
  3533. if test "x$ac_java_dir" = x; then
  3534. dnl No option set -> look in $PATH
  3535. AC_CACHE_VAL(kde_cv_java_bindir,
  3536. [
  3537. dnl First look for javac in $PATH. If not found we'll look at the option.
  3538. KDE_FIND_PATH(javac, JAVAC, [], [])
  3539. if test -n "$JAVAC"; then
  3540. kde_cv_java_bindir=`echo $JAVAC | sed -e 's,/javac$,/,'`
  3541. dnl this substitution might not work - well, we test for jni.h below
  3542. kde_cv_java_includedir=`echo $kde_cv_java_bindir | sed -e 's,bin/$,include/,'`
  3543. else
  3544. kde_cv_java_bindir=no
  3545. fi
  3546. ])
  3547. else
  3548. dnl config option set
  3549. kde_cv_java_bindir=$ac_java_dir/bin
  3550. kde_cv_java_includedir=$ac_java_dir/include
  3551. fi
  3552. fi
  3553. dnl Look for libjvm.so
  3554. kde_cv_java_libjvmdir=`find $kde_cv_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  3555. dnl Look for libhpi.so and avoid green threads
  3556. kde_cv_java_libhpidir=`find $kde_cv_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,'`
  3557. dnl At this point kde_cv_java_bindir and kde_cv_java_includedir are either set or "no"
  3558. if test ! "x$kde_cv_java_bindir" = xno; then
  3559. dnl Now check everything's fine under there
  3560. if test ! -x "$kde_cv_java_bindir/javac"; then
  3561. AC_MSG_ERROR([javac not found under $kde_cv_java_bindir - it seems you passed a wrong --with-java.])
  3562. fi
  3563. if test ! -x "$kde_cv_java_bindir/javah"; then
  3564. AC_MSG_ERROR([javah not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
  3565. fi
  3566. if test ! -x "$kde_cv_java_bindir/jar"; then
  3567. AC_MSG_ERROR([jar not found under $kde_cv_java_bindir. javac was found though! Use --with-java or --without-java.])
  3568. fi
  3569. if test ! -r "$kde_cv_java_includedir/jni.h"; then
  3570. AC_MSG_ERROR([jni.h not found under $kde_cv_java_includedir. Use --with-java or --without-java.])
  3571. fi
  3572. if test ! -r "$kde_cv_java_libjvmdir/libjvm.so"; then
  3573. AC_MSG_ERROR([libjvm.so not found under $kde_cv_java_libjvmdir. Use --without-java.])
  3574. fi
  3575. if test ! -r "$kde_cv_java_libhpidir/libhpi.so"; then
  3576. AC_MSG_ERROR([libhpi.so not found under $kde_cv_java_libhpidir. Use --without-java.])
  3577. fi
  3578. jni_includes="-I$kde_cv_java_includedir"
  3579. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  3580. dnl and under linux here..
  3581. test -d "$kde_cv_java_includedir/linux" && jni_includes="$jni_includes -I$kde_cv_java_includedir/linux"
  3582. test -d "$kde_cv_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_cv_java_includedir/genunix"
  3583. dnl Check for JNI version
  3584. AC_LANG_SAVE
  3585. AC_LANG_CPLUSPLUS
  3586. ac_cxxflags_safe="$CXXFLAGS"
  3587. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  3588. AC_TRY_COMPILE([
  3589. #include <jni.h>
  3590. ],
  3591. [
  3592. #ifndef JNI_VERSION_1_2
  3593. Syntax Error
  3594. #endif
  3595. ],[
  3596. ],[ AC_MSG_ERROR([Incorrect version of $kde_cv_java_includedir/jni.h.
  3597. You need to have Java Development Kit (JDK) version 1.2.
  3598. Use --with-java to specify another location.
  3599. Use --without-java to configure without java support.
  3600. Or download a newer JDK and try again.
  3601. See e.g. http://java.sun.com/products/jdk/1.2 ])
  3602. ])
  3603. CXXFLAGS="$ac_cxxflags_safe"
  3604. AC_LANG_RESTORE
  3605. dnl All tests ok, inform and subst the variables
  3606. AC_MSG_RESULT([javac/javah/jar in $kde_cv_java_bindir, jni.h in $kde_cv_java_includedir])
  3607. JAVAC=$kde_cv_java_bindir/javac
  3608. AC_SUBST(JAVAC)
  3609. JAVAH=$kde_cv_java_bindir/javah
  3610. AC_SUBST(JAVAH)
  3611. JAR=$kde_cv_java_bindir/jar
  3612. AC_SUBST(JAR)
  3613. AC_SUBST(jni_includes)
  3614. JVMLIBS="-L$kde_cv_java_libjvmdir -ljvm -L$kde_cv_java_libhpidir -lhpi"
  3615. AC_SUBST(JVMLIBS)
  3616. fi
  3617. ])
  3618. # serial 46 AC_PROG_LIBTOOL
  3619. AC_DEFUN([AC_PROG_LIBTOOL],
  3620. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  3621. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  3622. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  3623. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  3624. [AC_LIBTOOL_CXX],
  3625. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  3626. ])])
  3627. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  3628. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  3629. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  3630. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  3631. [AC_LIBTOOL_GCJ],
  3632. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  3633. [AC_LIBTOOL_GCJ],
  3634. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  3635. [AC_LIBTOOL_GCJ],
  3636. [ifdef([AC_PROG_GCJ],
  3637. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
  3638. ])])
  3639. ifdef([A][M_PROG_GCJ],
  3640. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
  3641. ])])
  3642. ifdef([LT_AC_PROG_GCJ],
  3643. [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
  3644. ])])])])])])
  3645. AC_DEFUN([_AC_PROG_LIBTOOL],
  3646. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  3647. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  3648. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  3649. # Save cache, so that ltconfig can load it
  3650. AC_CACHE_SAVE
  3651. # Actually configure libtool. ac_aux_dir is where install-sh is found.
  3652. AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  3653. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  3654. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  3655. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  3656. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  3657. deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
  3658. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  3659. $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
  3660. || AC_MSG_ERROR([libtool configure failed])
  3661. # Reload cache, that may have been modified by ltconfig
  3662. AC_CACHE_LOAD
  3663. # This can be used to rebuild libtool when needed
  3664. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
  3665. # Always use our own libtool.
  3666. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  3667. AC_SUBST(LIBTOOL)dnl
  3668. # Redirect the config.log output again, so that the ltconfig log is not
  3669. # clobbered by the next message.
  3670. exec 5>>./config.log
  3671. ])
  3672. AC_DEFUN([AC_LIBTOOL_SETUP],
  3673. [AC_PREREQ(2.13)dnl
  3674. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  3675. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  3676. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  3677. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3678. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  3679. AC_REQUIRE([AC_PROG_CC])dnl
  3680. AC_REQUIRE([AC_PROG_LD])dnl
  3681. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  3682. AC_REQUIRE([AC_PROG_NM])dnl
  3683. AC_REQUIRE([AC_PROG_LN_S])dnl
  3684. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  3685. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  3686. AC_REQUIRE([AC_OBJEXT])dnl
  3687. AC_REQUIRE([AC_EXEEXT])dnl
  3688. dnl
  3689. # Only perform the check for file, if the check method requires it
  3690. case $deplibs_check_method in
  3691. file_magic*)
  3692. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  3693. AC_PATH_MAGIC
  3694. fi
  3695. ;;
  3696. esac
  3697. AC_CHECK_TOOL(RANLIB, ranlib, :)
  3698. AC_CHECK_TOOL(STRIP, strip, :)
  3699. # Check for any special flags to pass to ltconfig.
  3700. libtool_flags="--cache-file=$cache_file"
  3701. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  3702. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  3703. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  3704. test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
  3705. test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  3706. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
  3707. [libtool_flags="$libtool_flags --enable-dlopen"])
  3708. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  3709. [libtool_flags="$libtool_flags --enable-win32-dll"])
  3710. AC_ARG_ENABLE(libtool-lock,
  3711. [ --disable-libtool-lock avoid locking (might break parallel builds)])
  3712. test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
  3713. test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
  3714. AC_ARG_WITH(pic,
  3715. [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
  3716. pic_mode="$withval", pic_mode=default)
  3717. test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
  3718. test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
  3719. # Some flags need to be propagated to the compiler or linker for good
  3720. # libtool support.
  3721. case $host in
  3722. *-*-irix6*)
  3723. # Find out which ABI we are using.
  3724. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  3725. if AC_TRY_EVAL(ac_compile); then
  3726. case `/usr/bin/file conftest.$ac_objext` in
  3727. *32-bit*)
  3728. LD="${LD-ld} -32"
  3729. ;;
  3730. *N32*)
  3731. LD="${LD-ld} -n32"
  3732. ;;
  3733. *64-bit*)
  3734. LD="${LD-ld} -64"
  3735. ;;
  3736. esac
  3737. fi
  3738. rm -rf conftest*
  3739. ;;
  3740. *-*-sco3.2v5*)
  3741. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  3742. SAVE_CFLAGS="$CFLAGS"
  3743. CFLAGS="$CFLAGS -belf"
  3744. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  3745. [AC_LANG_SAVE
  3746. AC_LANG_C
  3747. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  3748. AC_LANG_RESTORE])
  3749. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  3750. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  3751. CFLAGS="$SAVE_CFLAGS"
  3752. fi
  3753. ;;
  3754. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  3755. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  3756. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  3757. AC_CHECK_TOOL(AS, as, false)
  3758. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  3759. # recent cygwin and mingw systems supply a stub DllMain which the user
  3760. # can override, but on older systems we have to supply one
  3761. AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
  3762. [AC_TRY_LINK([],
  3763. [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
  3764. DllMain (0, 0, 0);],
  3765. [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
  3766. case $host/$CC in
  3767. *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
  3768. # old mingw systems require "-dll" to link a DLL, while more recent ones
  3769. # require "-mdll"
  3770. SAVE_CFLAGS="$CFLAGS"
  3771. CFLAGS="$CFLAGS -mdll"
  3772. AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
  3773. [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
  3774. CFLAGS="$SAVE_CFLAGS" ;;
  3775. *-*-cygwin* | *-*-pw32*)
  3776. # cygwin systems need to pass --dll to the linker, and not link
  3777. # crt.o which will require a WinMain@16 definition.
  3778. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
  3779. esac
  3780. ;;
  3781. ])
  3782. esac
  3783. ])
  3784. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  3785. AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  3786. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  3787. AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  3788. # AC_ENABLE_SHARED - implement the --enable-shared flag
  3789. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  3790. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3791. # `yes'.
  3792. AC_DEFUN([AC_ENABLE_SHARED],
  3793. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  3794. AC_ARG_ENABLE(shared,
  3795. changequote(<<, >>)dnl
  3796. << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  3797. changequote([, ])dnl
  3798. [p=${PACKAGE-default}
  3799. case $enableval in
  3800. yes) enable_shared=yes ;;
  3801. no) enable_shared=no ;;
  3802. *)
  3803. enable_shared=no
  3804. # Look at the argument we got. We use all the common list separators.
  3805. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3806. for pkg in $enableval; do
  3807. if test "X$pkg" = "X$p"; then
  3808. enable_shared=yes
  3809. fi
  3810. done
  3811. IFS="$ac_save_ifs"
  3812. ;;
  3813. esac],
  3814. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  3815. ])
  3816. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  3817. AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3818. AC_ENABLE_SHARED(no)])
  3819. # AC_ENABLE_STATIC - implement the --enable-static flag
  3820. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  3821. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3822. # `yes'.
  3823. AC_DEFUN([AC_ENABLE_STATIC],
  3824. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  3825. AC_ARG_ENABLE(static,
  3826. changequote(<<, >>)dnl
  3827. << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  3828. changequote([, ])dnl
  3829. [p=${PACKAGE-default}
  3830. case $enableval in
  3831. yes) enable_static=yes ;;
  3832. no) enable_static=no ;;
  3833. *)
  3834. enable_static=no
  3835. # Look at the argument we got. We use all the common list separators.
  3836. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3837. for pkg in $enableval; do
  3838. if test "X$pkg" = "X$p"; then
  3839. enable_static=yes
  3840. fi
  3841. done
  3842. IFS="$ac_save_ifs"
  3843. ;;
  3844. esac],
  3845. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  3846. ])
  3847. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  3848. AC_DEFUN([AC_DISABLE_STATIC],
  3849. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3850. AC_ENABLE_STATIC(no)])
  3851. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  3852. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  3853. # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
  3854. # `yes'.
  3855. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  3856. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  3857. AC_ARG_ENABLE(fast-install,
  3858. changequote(<<, >>)dnl
  3859. << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  3860. changequote([, ])dnl
  3861. [p=${PACKAGE-default}
  3862. case $enableval in
  3863. yes) enable_fast_install=yes ;;
  3864. no) enable_fast_install=no ;;
  3865. *)
  3866. enable_fast_install=no
  3867. # Look at the argument we got. We use all the common list separators.
  3868. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  3869. for pkg in $enableval; do
  3870. if test "X$pkg" = "X$p"; then
  3871. enable_fast_install=yes
  3872. fi
  3873. done
  3874. IFS="$ac_save_ifs"
  3875. ;;
  3876. esac],
  3877. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  3878. ])
  3879. # AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
  3880. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  3881. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3882. AC_ENABLE_FAST_INSTALL(no)])
  3883. # AC_LIBTOOL_PICMODE - implement the --with-pic flag
  3884. # Usage: AC_LIBTOOL_PICMODE[(MODE)]
  3885. # Where MODE is either `yes' or `no'. If omitted, it defaults to
  3886. # `both'.
  3887. AC_DEFUN([AC_LIBTOOL_PICMODE],
  3888. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  3889. pic_mode=ifelse($#,1,$1,default)])
  3890. # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
  3891. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  3892. [AC_MSG_CHECKING([for $1])
  3893. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  3894. [case $MAGIC_CMD in
  3895. /*)
  3896. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  3897. ;;
  3898. ?:/*)
  3899. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
  3900. ;;
  3901. *)
  3902. ac_save_MAGIC_CMD="$MAGIC_CMD"
  3903. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
  3904. dnl $ac_dummy forces splitting on constant user-supplied paths.
  3905. dnl POSIX.2 word splitting is done only on the output of word expansions,
  3906. dnl not every word. This closes a longstanding sh security hole.
  3907. ac_dummy="ifelse([$2], , $PATH, [$2])"
  3908. for ac_dir in $ac_dummy; do
  3909. test -z "$ac_dir" && ac_dir=.
  3910. if test -f $ac_dir/$1; then
  3911. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  3912. if test -n "$file_magic_test_file"; then
  3913. case $deplibs_check_method in
  3914. "file_magic "*)
  3915. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  3916. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3917. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  3918. egrep "$file_magic_regex" > /dev/null; then
  3919. :
  3920. else
  3921. cat <<EOF 1>&2
  3922. *** Warning: the command libtool uses to detect shared libraries,
  3923. *** $file_magic_cmd, produces output that libtool cannot recognize.
  3924. *** The result is that libtool may fail to recognize shared libraries
  3925. *** as such. This will affect the creation of libtool libraries that
  3926. *** depend on shared libraries, but programs linked with such libtool
  3927. *** libraries will work regardless of this problem. Nevertheless, you
  3928. *** may want to report the problem to your system manager and/or to
  3929. *** bug-libtool@gnu.org
  3930. EOF
  3931. fi ;;
  3932. esac
  3933. fi
  3934. break
  3935. fi
  3936. done
  3937. IFS="$ac_save_ifs"
  3938. MAGIC_CMD="$ac_save_MAGIC_CMD"
  3939. ;;
  3940. esac])
  3941. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  3942. if test -n "$MAGIC_CMD"; then
  3943. AC_MSG_RESULT($MAGIC_CMD)
  3944. else
  3945. AC_MSG_RESULT(no)
  3946. fi
  3947. ])
  3948. # AC_PATH_MAGIC - find a file program which can recognise a shared library
  3949. AC_DEFUN([AC_PATH_MAGIC],
  3950. [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
  3951. AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
  3952. if test -z "$lt_cv_path_MAGIC_CMD"; then
  3953. if test -n "$ac_tool_prefix"; then
  3954. AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
  3955. else
  3956. MAGIC_CMD=:
  3957. fi
  3958. fi
  3959. ])
  3960. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  3961. AC_DEFUN([AC_PROG_LD],
  3962. [AC_ARG_WITH(gnu-ld,
  3963. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  3964. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  3965. AC_REQUIRE([AC_PROG_CC])dnl
  3966. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3967. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  3968. ac_prog=ld
  3969. if test "$GCC" = yes; then
  3970. # Check if gcc -print-prog-name=ld gives a path.
  3971. AC_MSG_CHECKING([for ld used by GCC])
  3972. case $host in
  3973. *-*-mingw*)
  3974. # gcc leaves a trailing carriage return which upsets mingw
  3975. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  3976. *)
  3977. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  3978. esac
  3979. case $ac_prog in
  3980. # Accept absolute paths.
  3981. [[\\/]* | [A-Za-z]:[\\/]*)]
  3982. re_direlt=['/[^/][^/]*/\.\./']
  3983. # Canonicalize the path of ld
  3984. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  3985. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  3986. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  3987. done
  3988. test -z "$LD" && LD="$ac_prog"
  3989. ;;
  3990. "")
  3991. # If it fails, then pretend we aren't using GCC.
  3992. ac_prog=ld
  3993. ;;
  3994. *)
  3995. # If it is relative, then search for the first ld in PATH.
  3996. with_gnu_ld=unknown
  3997. ;;
  3998. esac
  3999. elif test "$with_gnu_ld" = yes; then
  4000. AC_MSG_CHECKING([for GNU ld])
  4001. else
  4002. AC_MSG_CHECKING([for non-GNU ld])
  4003. fi
  4004. AC_CACHE_VAL(lt_cv_path_LD,
  4005. [if test -z "$LD"; then
  4006. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  4007. for ac_dir in $PATH; do
  4008. test -z "$ac_dir" && ac_dir=.
  4009. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  4010. lt_cv_path_LD="$ac_dir/$ac_prog"
  4011. # Check to see if the program is GNU ld. I'd rather use --version,
  4012. # but apparently some GNU ld's only accept -v.
  4013. # Break only if it was the GNU/non-GNU ld that we prefer.
  4014. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  4015. test "$with_gnu_ld" != no && break
  4016. else
  4017. test "$with_gnu_ld" != yes && break
  4018. fi
  4019. fi
  4020. done
  4021. IFS="$ac_save_ifs"
  4022. else
  4023. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  4024. fi])
  4025. LD="$lt_cv_path_LD"
  4026. if test -n "$LD"; then
  4027. AC_MSG_RESULT($LD)
  4028. else
  4029. AC_MSG_RESULT(no)
  4030. fi
  4031. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  4032. AC_PROG_LD_GNU
  4033. ])
  4034. AC_DEFUN([AC_PROG_LD_GNU],
  4035. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  4036. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  4037. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  4038. lt_cv_prog_gnu_ld=yes
  4039. else
  4040. lt_cv_prog_gnu_ld=no
  4041. fi])
  4042. with_gnu_ld=$lt_cv_prog_gnu_ld
  4043. ])
  4044. # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
  4045. # -- PORTME Some linkers may need a different reload flag.
  4046. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  4047. [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
  4048. [lt_cv_ld_reload_flag='-r'])
  4049. reload_flag=$lt_cv_ld_reload_flag
  4050. test -n "$reload_flag" && reload_flag=" $reload_flag"
  4051. ])
  4052. # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
  4053. # -- PORTME fill in with the dynamic library characteristics
  4054. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  4055. [AC_CACHE_CHECK([how to recognise dependant libraries],
  4056. lt_cv_deplibs_check_method,
  4057. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  4058. lt_cv_file_magic_test_file=
  4059. lt_cv_deplibs_check_method='unknown'
  4060. # Need to set the preceding variable on all platforms that support
  4061. # interlibrary dependencies.
  4062. # 'none' -- dependencies not supported.
  4063. # `unknown' -- same as none, but documents that we really don't know.
  4064. # 'pass_all' -- all dependencies passed with no checks.
  4065. # 'test_compile' -- check by making test program.
  4066. # 'file_magic [regex]' -- check by looking for files in library path
  4067. # which responds to the $file_magic_cmd with a given egrep regex.
  4068. # If you have `file' or equivalent on your system and you're not sure
  4069. # whether `pass_all' will *always* work, you probably want this one.
  4070. case $host_os in
  4071. aix*)
  4072. lt_cv_deplibs_check_method=pass_all
  4073. ;;
  4074. beos*)
  4075. lt_cv_deplibs_check_method=pass_all
  4076. ;;
  4077. bsdi4*)
  4078. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)']
  4079. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4080. lt_cv_file_magic_test_file=/shlib/libc.so
  4081. ;;
  4082. cygwin* | mingw* |pw32*)
  4083. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  4084. lt_cv_file_magic_cmd='$OBJDUMP -f'
  4085. ;;
  4086. darwin* | rhapsody*)
  4087. lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
  4088. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4089. case "$host_os" in
  4090. rhapsody* | darwin1.[012])
  4091. lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System'
  4092. ;;
  4093. *) # Darwin 1.3 on
  4094. lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
  4095. ;;
  4096. esac
  4097. ;;
  4098. freebsd* )
  4099. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4100. case $host_cpu in
  4101. i*86 )
  4102. # Not sure whether the presence of OpenBSD here was a mistake.
  4103. # Let's accept both of them until this is cleared up.
  4104. lt_cv_deplibs_check_method=['file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library']
  4105. lt_cv_file_magic_cmd=/usr/bin/file
  4106. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  4107. ;;
  4108. esac
  4109. else
  4110. lt_cv_deplibs_check_method=pass_all
  4111. fi
  4112. ;;
  4113. gnu*)
  4114. lt_cv_deplibs_check_method=pass_all
  4115. ;;
  4116. hpux10.20*|hpux11*)
  4117. lt_cv_deplibs_check_method=['file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library']
  4118. lt_cv_file_magic_cmd=/usr/bin/file
  4119. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  4120. ;;
  4121. irix5* | irix6*)
  4122. case $host_os in
  4123. irix5*)
  4124. # this will be overridden with pass_all, but let us keep it just in case
  4125. lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  4126. ;;
  4127. *)
  4128. case $LD in
  4129. *-32|*"-32 ") libmagic=32-bit;;
  4130. *-n32|*"-n32 ") libmagic=N32;;
  4131. *-64|*"-64 ") libmagic=64-bit;;
  4132. *) libmagic=never-match;;
  4133. esac
  4134. # this will be overridden with pass_all, but let us keep it just in case
  4135. lt_cv_deplibs_check_method=["file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"]
  4136. ;;
  4137. esac
  4138. lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  4139. lt_cv_deplibs_check_method=pass_all
  4140. ;;
  4141. # This must be Linux ELF.
  4142. linux-gnu*)
  4143. case $host_cpu in
  4144. alpha* | i*86 | powerpc* | sparc* | ia64* | s390* | m68k* | arm* | mips* | hppa* | sh* )
  4145. lt_cv_deplibs_check_method=pass_all ;;
  4146. *)
  4147. # glibc up to 2.1.1 does not perform some relocations on ARM
  4148. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'] ;;
  4149. esac
  4150. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  4151. ;;
  4152. netbsd*)
  4153. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4154. [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library']
  4155. else
  4156. [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object']
  4157. fi
  4158. lt_cv_file_magic_cmd='/usr/bin/file -L'
  4159. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  4160. ;;
  4161. openbsd* )
  4162. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  4163. case "$host_cpu" in
  4164. i*86 )
  4165. changequote(,)dnl
  4166. lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
  4167. changequote([, ])dnl
  4168. lt_cv_file_magic_cmd=/usr/bin/file
  4169. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  4170. ;;
  4171. esac
  4172. else
  4173. lt_cv_deplibs_check_method=pass_all
  4174. fi
  4175. ;;
  4176. newsos6)
  4177. [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)']
  4178. lt_cv_file_magic_cmd=/usr/bin/file
  4179. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  4180. ;;
  4181. osf3* | osf4* | osf5*)
  4182. # this will be overridden with pass_all, but let us keep it just in case
  4183. lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
  4184. lt_cv_file_magic_test_file=/shlib/libc.so
  4185. lt_cv_deplibs_check_method=pass_all
  4186. ;;
  4187. sco3.2v5*)
  4188. lt_cv_deplibs_check_method=pass_all
  4189. ;;
  4190. solaris*)
  4191. lt_cv_deplibs_check_method=pass_all
  4192. lt_cv_file_magic_test_file=/lib/libc.so
  4193. ;;
  4194. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  4195. case $host_vendor in
  4196. ncr)
  4197. lt_cv_deplibs_check_method=pass_all
  4198. ;;
  4199. motorola)
  4200. lt_cv_deplibs_check_method=['file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]']
  4201. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  4202. ;;
  4203. esac
  4204. ;;
  4205. esac
  4206. ])
  4207. file_magic_cmd=$lt_cv_file_magic_cmd
  4208. deplibs_check_method=$lt_cv_deplibs_check_method
  4209. ])
  4210. # AC_PROG_NM - find the path to a BSD-compatible name lister
  4211. AC_DEFUN([AC_PROG_NM],
  4212. [AC_MSG_CHECKING([for BSD-compatible nm])
  4213. AC_CACHE_VAL(lt_cv_path_NM,
  4214. [if test -n "$NM"; then
  4215. # Let the user override the test.
  4216. lt_cv_path_NM="$NM"
  4217. else
  4218. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  4219. for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  4220. test -z "$ac_dir" && ac_dir=.
  4221. tmp_nm=$ac_dir/${ac_tool_prefix}nm
  4222. if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
  4223. # Check to see if the nm accepts a BSD-compat flag.
  4224. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  4225. # nm: unknown option "B" ignored
  4226. # Tru64's nm complains that /dev/null is an invalid object file
  4227. if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
  4228. lt_cv_path_NM="$tmp_nm -B"
  4229. break
  4230. elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  4231. lt_cv_path_NM="$tmp_nm -p"
  4232. break
  4233. else
  4234. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  4235. continue # so that we can try to find one that supports BSD flags
  4236. fi
  4237. fi
  4238. done
  4239. IFS="$ac_save_ifs"
  4240. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  4241. fi])
  4242. NM="$lt_cv_path_NM"
  4243. AC_MSG_RESULT([$NM])
  4244. ])
  4245. # AC_CHECK_LIBM - check for math library
  4246. AC_DEFUN([AC_CHECK_LIBM],
  4247. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  4248. LIBM=
  4249. case $host in
  4250. *-*-beos* | *-*-cygwin* | *-*-pw32*)
  4251. # These system don't have libm
  4252. ;;
  4253. *-ncr-sysv4.3*)
  4254. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  4255. AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  4256. ;;
  4257. *)
  4258. AC_CHECK_LIB(m, main, LIBM="-lm")
  4259. ;;
  4260. esac
  4261. ])
  4262. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  4263. # the libltdl convenience library and INCLTDL to the include flags for
  4264. # the libltdl header and adds --enable-ltdl-convenience to the
  4265. # configure arguments. Note that LIBLTDL and INCLTDL are not
  4266. # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
  4267. # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
  4268. # with '${top_builddir}/' and INCLTDL will be prefixed with
  4269. # '${top_srcdir}/' (note the single quotes!). If your package is not
  4270. # flat and you're not using automake, define top_builddir and
  4271. # top_srcdir appropriately in the Makefiles.
  4272. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  4273. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  4274. case $enable_ltdl_convenience in
  4275. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  4276. "") enable_ltdl_convenience=yes
  4277. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  4278. esac
  4279. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  4280. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  4281. ])
  4282. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  4283. # the libltdl installable library and INCLTDL to the include flags for
  4284. # the libltdl header and adds --enable-ltdl-install to the configure
  4285. # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
  4286. # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
  4287. # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
  4288. # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
  4289. # with '${top_srcdir}/' (note the single quotes!). If your package is
  4290. # not flat and you're not using automake, define top_builddir and
  4291. # top_srcdir appropriately in the Makefiles.
  4292. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  4293. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  4294. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  4295. AC_CHECK_LIB(ltdl, main,
  4296. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  4297. [if test x"$enable_ltdl_install" = xno; then
  4298. AC_MSG_WARN([libltdl not installed, but installation disabled])
  4299. else
  4300. enable_ltdl_install=yes
  4301. fi
  4302. ])
  4303. if test x"$enable_ltdl_install" = x"yes"; then
  4304. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  4305. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  4306. INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  4307. else
  4308. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  4309. LIBLTDL="-lltdl"
  4310. INCLTDL=
  4311. fi
  4312. ])
  4313. # If this macro is not defined by Autoconf, define it here.
  4314. ifdef([AC_PROVIDE_IFELSE],
  4315. [],
  4316. [define([AC_PROVIDE_IFELSE],
  4317. [ifdef([AC_PROVIDE_$1],
  4318. [$2], [$3])])])
  4319. # AC_LIBTOOL_CXX - enable support for C++ libraries
  4320. AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
  4321. AC_DEFUN([_AC_LIBTOOL_CXX],
  4322. [AC_REQUIRE([AC_PROG_CXX])
  4323. AC_REQUIRE([AC_PROG_CXXCPP])
  4324. LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
  4325. lt_save_CC="$CC"
  4326. lt_save_CFLAGS="$CFLAGS"
  4327. dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
  4328. dnl is set to the C++ compiler.
  4329. AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
  4330. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  4331. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  4332. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  4333. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  4334. deplibs_check_method="$deplibs_check_method" \
  4335. file_magic_cmd="$file_magic_cmd" \
  4336. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
  4337. --build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
  4338. || AC_MSG_ERROR([libtool tag configuration failed])
  4339. CC="$lt_save_CC"
  4340. CFLAGS="$lt_save_CFLAGS"
  4341. # Redirect the config.log output again, so that the ltconfig log is not
  4342. # clobbered by the next message.
  4343. exec 5>>./config.log
  4344. ])
  4345. # AC_LIBTOOL_GCJ - enable support for GCJ libraries
  4346. AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
  4347. AC_DEFUN([_AC_LIBTOOL_GCJ],
  4348. [AC_REQUIRE([AC_PROG_LIBTOOL])
  4349. AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
  4350. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
  4351. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
  4352. [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
  4353. [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
  4354. [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
  4355. LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
  4356. lt_save_CC="$CC"
  4357. lt_save_CFLAGS="$CFLAGS"
  4358. dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
  4359. dnl is set to the C++ compiler.
  4360. AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
  4361. MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  4362. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
  4363. AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
  4364. objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
  4365. deplibs_check_method="$deplibs_check_method" \
  4366. file_magic_cmd="$file_magic_cmd" \
  4367. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
  4368. --build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
  4369. || AC_MSG_ERROR([libtool tag configuration failed])
  4370. CC="$lt_save_CC"
  4371. CFLAGS="$lt_save_CFLAGS"
  4372. # Redirect the config.log output again, so that the ltconfig log is not
  4373. # clobbered by the next message.
  4374. exec 5>>./config.log
  4375. ])
  4376. dnl old names
  4377. AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
  4378. AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
  4379. AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
  4380. AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
  4381. AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
  4382. AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
  4383. AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
  4384. dnl This is just to silence aclocal about the macro not being used
  4385. ifelse([AC_DISABLE_FAST_INSTALL])dnl
  4386. AC_DEFUN([LT_AC_PROG_GCJ],
  4387. [AC_CHECK_TOOL(GCJ, gcj, no)
  4388. test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
  4389. AC_SUBST(GCJFLAGS)
  4390. ])
  4391. # Do all the work for Automake. This macro actually does too much --
  4392. # some checks are only needed if your package does certain things.
  4393. # But this isn't really a big deal.
  4394. # serial 1
  4395. dnl Usage:
  4396. dnl AM_INIT_AUTOMAKE(package,version, [no-define])
  4397. AC_DEFUN([AM_INIT_AUTOMAKE],
  4398. [AC_REQUIRE([AC_PROG_INSTALL])
  4399. PACKAGE=[$1]
  4400. AC_SUBST(PACKAGE)
  4401. VERSION=[$2]
  4402. AC_SUBST(VERSION)
  4403. dnl test to see if srcdir already configured
  4404. if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
  4405. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  4406. fi
  4407. ifelse([$3],,
  4408. AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  4409. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
  4410. AC_REQUIRE([AM_SANITY_CHECK])
  4411. AC_REQUIRE([AC_ARG_PROGRAM])
  4412. dnl FIXME This is truly gross.
  4413. missing_dir=`cd $ac_aux_dir && pwd`
  4414. AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
  4415. AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
  4416. AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
  4417. AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
  4418. AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
  4419. AC_REQUIRE([AC_PROG_MAKE_SET])])
  4420. #
  4421. # Check to make sure that the build environment is sane.
  4422. #
  4423. AC_DEFUN([AM_SANITY_CHECK],
  4424. [AC_MSG_CHECKING([whether build environment is sane])
  4425. # Just in case
  4426. sleep 1
  4427. echo timestamp > conftestfile
  4428. # Do `set' in a subshell so we don't clobber the current shell's
  4429. # arguments. Must try -L first in case configure is actually a
  4430. # symlink; some systems play weird games with the mod time of symlinks
  4431. # (eg FreeBSD returns the mod time of the symlink's containing
  4432. # directory).
  4433. if (
  4434. set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
  4435. if test "[$]*" = "X"; then
  4436. # -L didn't work.
  4437. set X `ls -t $srcdir/configure conftestfile`
  4438. fi
  4439. if test "[$]*" != "X $srcdir/configure conftestfile" \
  4440. && test "[$]*" != "X conftestfile $srcdir/configure"; then
  4441. # If neither matched, then we have a broken ls. This can happen
  4442. # if, for instance, CONFIG_SHELL is bash and it inherits a
  4443. # broken ls alias from the environment. This has actually
  4444. # happened. Such a system could not be considered "sane".
  4445. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  4446. alias in your environment])
  4447. fi
  4448. test "[$]2" = conftestfile
  4449. )
  4450. then
  4451. # Ok.
  4452. :
  4453. else
  4454. AC_MSG_ERROR([newly created file is older than distributed files!
  4455. Check your system clock])
  4456. fi
  4457. rm -f conftest*
  4458. AC_MSG_RESULT(yes)])
  4459. dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
  4460. dnl The program must properly implement --version.
  4461. AC_DEFUN([AM_MISSING_PROG],
  4462. [AC_MSG_CHECKING(for working $2)
  4463. # Run test in a subshell; some versions of sh will print an error if
  4464. # an executable is not found, even if stderr is redirected.
  4465. # Redirect stdin to placate older versions of autoconf. Sigh.
  4466. if ($2 --version) < /dev/null > /dev/null 2>&1; then
  4467. $1=$2
  4468. AC_MSG_RESULT(found)
  4469. else
  4470. $1="$3/missing $2"
  4471. AC_MSG_RESULT(missing)
  4472. fi
  4473. AC_SUBST($1)])
  4474. # Like AC_CONFIG_HEADER, but automatically create stamp file.
  4475. AC_DEFUN([AM_CONFIG_HEADER],
  4476. [AC_PREREQ([2.12])
  4477. AC_CONFIG_HEADER([$1])
  4478. dnl When config.status generates a header, we must update the stamp-h file.
  4479. dnl This file resides in the same directory as the config header
  4480. dnl that is generated. We must strip everything past the first ":",
  4481. dnl and everything past the last "/".
  4482. AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
  4483. ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
  4484. <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
  4485. <<am_indx=1
  4486. for am_file in <<$1>>; do
  4487. case " <<$>>CONFIG_HEADERS " in
  4488. *" <<$>>am_file "*<<)>>
  4489. echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
  4490. ;;
  4491. esac
  4492. am_indx=`expr "<<$>>am_indx" + 1`
  4493. done<<>>dnl>>)
  4494. changequote([,]))])
  4495. # Define a conditional.
  4496. AC_DEFUN([AM_CONDITIONAL],
  4497. [AC_SUBST($1_TRUE)
  4498. AC_SUBST($1_FALSE)
  4499. if $2; then
  4500. $1_TRUE=
  4501. $1_FALSE='#'
  4502. else
  4503. $1_TRUE='#'
  4504. $1_FALSE=
  4505. fi])