PageRenderTime 55ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/aclocal.m4

https://bitbucket.org/mike_php_net/vpop-xmlrpc
m4 | 831 lines | 793 code | 24 blank | 14 comment | 0 complexity | 8fcf3f19ec2c35d6b052a5c1f3ce5771 MD5 | raw file
  1. dnl aclocal.m4 generated automatically by aclocal 1.4-p4
  2. dnl Copyright (C) 1994, 1995-8, 1999 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. # lib-prefix.m4 serial 4 (gettext-0.14.2)
  11. dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  12. dnl This file is free software; the Free Software Foundation
  13. dnl gives unlimited permission to copy and/or distribute it,
  14. dnl with or without modifications, as long as this notice is preserved.
  15. dnl From Bruno Haible.
  16. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  17. dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  18. dnl require excessive bracketing.
  19. ifdef([AC_HELP_STRING],
  20. [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  21. [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  22. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  23. dnl to access previously installed libraries. The basic assumption is that
  24. dnl a user will want packages to use other packages he previously installed
  25. dnl with the same --prefix option.
  26. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  27. dnl libraries, but is otherwise very convenient.
  28. AC_DEFUN([AC_LIB_PREFIX],
  29. [
  30. AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  31. AC_REQUIRE([AC_PROG_CC])
  32. AC_REQUIRE([AC_CANONICAL_HOST])
  33. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  34. dnl By default, look in $includedir and $libdir.
  35. use_additional=yes
  36. AC_LIB_WITH_FINAL_PREFIX([
  37. eval additional_includedir=\"$includedir\"
  38. eval additional_libdir=\"$libdir\"
  39. ])
  40. AC_LIB_ARG_WITH([lib-prefix],
  41. [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  42. --without-lib-prefix don't search for libraries in includedir and libdir],
  43. [
  44. if test "X$withval" = "Xno"; then
  45. use_additional=no
  46. else
  47. if test "X$withval" = "X"; then
  48. AC_LIB_WITH_FINAL_PREFIX([
  49. eval additional_includedir=\"$includedir\"
  50. eval additional_libdir=\"$libdir\"
  51. ])
  52. else
  53. additional_includedir="$withval/include"
  54. additional_libdir="$withval/lib"
  55. fi
  56. fi
  57. ])
  58. if test $use_additional = yes; then
  59. dnl Potentially add $additional_includedir to $CPPFLAGS.
  60. dnl But don't add it
  61. dnl 1. if it's the standard /usr/include,
  62. dnl 2. if it's already present in $CPPFLAGS,
  63. dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  64. dnl 4. if it doesn't exist as a directory.
  65. if test "X$additional_includedir" != "X/usr/include"; then
  66. haveit=
  67. for x in $CPPFLAGS; do
  68. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  69. if test "X$x" = "X-I$additional_includedir"; then
  70. haveit=yes
  71. break
  72. fi
  73. done
  74. if test -z "$haveit"; then
  75. if test "X$additional_includedir" = "X/usr/local/include"; then
  76. if test -n "$GCC"; then
  77. case $host_os in
  78. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  79. esac
  80. fi
  81. fi
  82. if test -z "$haveit"; then
  83. if test -d "$additional_includedir"; then
  84. dnl Really add $additional_includedir to $CPPFLAGS.
  85. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  86. fi
  87. fi
  88. fi
  89. fi
  90. dnl Potentially add $additional_libdir to $LDFLAGS.
  91. dnl But don't add it
  92. dnl 1. if it's the standard /usr/lib,
  93. dnl 2. if it's already present in $LDFLAGS,
  94. dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  95. dnl 4. if it doesn't exist as a directory.
  96. if test "X$additional_libdir" != "X/usr/lib"; then
  97. haveit=
  98. for x in $LDFLAGS; do
  99. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  100. if test "X$x" = "X-L$additional_libdir"; then
  101. haveit=yes
  102. break
  103. fi
  104. done
  105. if test -z "$haveit"; then
  106. if test "X$additional_libdir" = "X/usr/local/lib"; then
  107. if test -n "$GCC"; then
  108. case $host_os in
  109. linux*) haveit=yes;;
  110. esac
  111. fi
  112. fi
  113. if test -z "$haveit"; then
  114. if test -d "$additional_libdir"; then
  115. dnl Really add $additional_libdir to $LDFLAGS.
  116. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  117. fi
  118. fi
  119. fi
  120. fi
  121. fi
  122. ])
  123. dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  124. dnl acl_final_exec_prefix, containing the values to which $prefix and
  125. dnl $exec_prefix will expand at the end of the configure script.
  126. AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  127. [
  128. dnl Unfortunately, prefix and exec_prefix get only finally determined
  129. dnl at the end of configure.
  130. if test "X$prefix" = "XNONE"; then
  131. acl_final_prefix="$ac_default_prefix"
  132. else
  133. acl_final_prefix="$prefix"
  134. fi
  135. if test "X$exec_prefix" = "XNONE"; then
  136. acl_final_exec_prefix='${prefix}'
  137. else
  138. acl_final_exec_prefix="$exec_prefix"
  139. fi
  140. acl_save_prefix="$prefix"
  141. prefix="$acl_final_prefix"
  142. eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  143. prefix="$acl_save_prefix"
  144. ])
  145. dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  146. dnl variables prefix and exec_prefix bound to the values they will have
  147. dnl at the end of the configure script.
  148. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  149. [
  150. acl_save_prefix="$prefix"
  151. prefix="$acl_final_prefix"
  152. acl_save_exec_prefix="$exec_prefix"
  153. exec_prefix="$acl_final_exec_prefix"
  154. $1
  155. exec_prefix="$acl_save_exec_prefix"
  156. prefix="$acl_save_prefix"
  157. ])
  158. # lib-link.m4 serial 6 (gettext-0.14.3)
  159. dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
  160. dnl This file is free software; the Free Software Foundation
  161. dnl gives unlimited permission to copy and/or distribute it,
  162. dnl with or without modifications, as long as this notice is preserved.
  163. dnl From Bruno Haible.
  164. AC_PREREQ(2.50)
  165. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
  166. dnl the libraries corresponding to explicit and implicit dependencies.
  167. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
  168. dnl augments the CPPFLAGS variable.
  169. AC_DEFUN([AC_LIB_LINKFLAGS],
  170. [
  171. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  172. AC_REQUIRE([AC_LIB_RPATH])
  173. define([Name],[translit([$1],[./-], [___])])
  174. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  175. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  176. AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
  177. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  178. ac_cv_lib[]Name[]_libs="$LIB[]NAME"
  179. ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
  180. ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
  181. ])
  182. LIB[]NAME="$ac_cv_lib[]Name[]_libs"
  183. LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
  184. INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
  185. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  186. AC_SUBST([LIB]NAME)
  187. AC_SUBST([LTLIB]NAME)
  188. dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
  189. dnl results of this search when this library appears as a dependency.
  190. HAVE_LIB[]NAME=yes
  191. undefine([Name])
  192. undefine([NAME])
  193. ])
  194. dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
  195. dnl searches for libname and the libraries corresponding to explicit and
  196. dnl implicit dependencies, together with the specified include files and
  197. dnl the ability to compile and link the specified testcode. If found, it
  198. dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
  199. dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
  200. dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
  201. dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
  202. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
  203. [
  204. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  205. AC_REQUIRE([AC_LIB_RPATH])
  206. define([Name],[translit([$1],[./-], [___])])
  207. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  208. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  209. dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
  210. dnl accordingly.
  211. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  212. dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
  213. dnl because if the user has installed lib[]Name and not disabled its use
  214. dnl via --without-lib[]Name-prefix, he wants to use it.
  215. ac_save_CPPFLAGS="$CPPFLAGS"
  216. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  217. AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
  218. ac_save_LIBS="$LIBS"
  219. LIBS="$LIBS $LIB[]NAME"
  220. AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
  221. LIBS="$ac_save_LIBS"
  222. ])
  223. if test "$ac_cv_lib[]Name" = yes; then
  224. HAVE_LIB[]NAME=yes
  225. AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
  226. AC_MSG_CHECKING([how to link with lib[]$1])
  227. AC_MSG_RESULT([$LIB[]NAME])
  228. else
  229. HAVE_LIB[]NAME=no
  230. dnl If $LIB[]NAME didn't lead to a usable library, we don't need
  231. dnl $INC[]NAME either.
  232. CPPFLAGS="$ac_save_CPPFLAGS"
  233. LIB[]NAME=
  234. LTLIB[]NAME=
  235. fi
  236. AC_SUBST([HAVE_LIB]NAME)
  237. AC_SUBST([LIB]NAME)
  238. AC_SUBST([LTLIB]NAME)
  239. undefine([Name])
  240. undefine([NAME])
  241. ])
  242. dnl Determine the platform dependent parameters needed to use rpath:
  243. dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
  244. dnl hardcode_direct, hardcode_minus_L.
  245. AC_DEFUN([AC_LIB_RPATH],
  246. [
  247. dnl Tell automake >= 1.10 to complain if config.rpath is missing.
  248. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
  249. AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
  250. AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
  251. AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
  252. AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
  253. AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
  254. CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
  255. ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
  256. . ./conftest.sh
  257. rm -f ./conftest.sh
  258. acl_cv_rpath=done
  259. ])
  260. wl="$acl_cv_wl"
  261. libext="$acl_cv_libext"
  262. shlibext="$acl_cv_shlibext"
  263. hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
  264. hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
  265. hardcode_direct="$acl_cv_hardcode_direct"
  266. hardcode_minus_L="$acl_cv_hardcode_minus_L"
  267. dnl Determine whether the user wants rpath handling at all.
  268. AC_ARG_ENABLE(rpath,
  269. [ --disable-rpath do not hardcode runtime library paths],
  270. :, enable_rpath=yes)
  271. ])
  272. dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
  273. dnl the libraries corresponding to explicit and implicit dependencies.
  274. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
  275. AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  276. [
  277. define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
  278. [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
  279. dnl By default, look in $includedir and $libdir.
  280. use_additional=yes
  281. AC_LIB_WITH_FINAL_PREFIX([
  282. eval additional_includedir=\"$includedir\"
  283. eval additional_libdir=\"$libdir\"
  284. ])
  285. AC_LIB_ARG_WITH([lib$1-prefix],
  286. [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
  287. --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
  288. [
  289. if test "X$withval" = "Xno"; then
  290. use_additional=no
  291. else
  292. if test "X$withval" = "X"; then
  293. AC_LIB_WITH_FINAL_PREFIX([
  294. eval additional_includedir=\"$includedir\"
  295. eval additional_libdir=\"$libdir\"
  296. ])
  297. else
  298. additional_includedir="$withval/include"
  299. additional_libdir="$withval/lib"
  300. fi
  301. fi
  302. ])
  303. dnl Search the library and its dependencies in $additional_libdir and
  304. dnl $LDFLAGS. Using breadth-first-seach.
  305. LIB[]NAME=
  306. LTLIB[]NAME=
  307. INC[]NAME=
  308. rpathdirs=
  309. ltrpathdirs=
  310. names_already_handled=
  311. names_next_round='$1 $2'
  312. while test -n "$names_next_round"; do
  313. names_this_round="$names_next_round"
  314. names_next_round=
  315. for name in $names_this_round; do
  316. already_handled=
  317. for n in $names_already_handled; do
  318. if test "$n" = "$name"; then
  319. already_handled=yes
  320. break
  321. fi
  322. done
  323. if test -z "$already_handled"; then
  324. names_already_handled="$names_already_handled $name"
  325. dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
  326. dnl or AC_LIB_HAVE_LINKFLAGS call.
  327. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
  328. eval value=\"\$HAVE_LIB$uppername\"
  329. if test -n "$value"; then
  330. if test "$value" = yes; then
  331. eval value=\"\$LIB$uppername\"
  332. test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
  333. eval value=\"\$LTLIB$uppername\"
  334. test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
  335. else
  336. dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
  337. dnl that this library doesn't exist. So just drop it.
  338. :
  339. fi
  340. else
  341. dnl Search the library lib$name in $additional_libdir and $LDFLAGS
  342. dnl and the already constructed $LIBNAME/$LTLIBNAME.
  343. found_dir=
  344. found_la=
  345. found_so=
  346. found_a=
  347. if test $use_additional = yes; then
  348. if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
  349. found_dir="$additional_libdir"
  350. found_so="$additional_libdir/lib$name.$shlibext"
  351. if test -f "$additional_libdir/lib$name.la"; then
  352. found_la="$additional_libdir/lib$name.la"
  353. fi
  354. else
  355. if test -f "$additional_libdir/lib$name.$libext"; then
  356. found_dir="$additional_libdir"
  357. found_a="$additional_libdir/lib$name.$libext"
  358. if test -f "$additional_libdir/lib$name.la"; then
  359. found_la="$additional_libdir/lib$name.la"
  360. fi
  361. fi
  362. fi
  363. fi
  364. if test "X$found_dir" = "X"; then
  365. for x in $LDFLAGS $LTLIB[]NAME; do
  366. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  367. case "$x" in
  368. -L*)
  369. dir=`echo "X$x" | sed -e 's/^X-L//'`
  370. if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
  371. found_dir="$dir"
  372. found_so="$dir/lib$name.$shlibext"
  373. if test -f "$dir/lib$name.la"; then
  374. found_la="$dir/lib$name.la"
  375. fi
  376. else
  377. if test -f "$dir/lib$name.$libext"; then
  378. found_dir="$dir"
  379. found_a="$dir/lib$name.$libext"
  380. if test -f "$dir/lib$name.la"; then
  381. found_la="$dir/lib$name.la"
  382. fi
  383. fi
  384. fi
  385. ;;
  386. esac
  387. if test "X$found_dir" != "X"; then
  388. break
  389. fi
  390. done
  391. fi
  392. if test "X$found_dir" != "X"; then
  393. dnl Found the library.
  394. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
  395. if test "X$found_so" != "X"; then
  396. dnl Linking with a shared library. We attempt to hardcode its
  397. dnl directory into the executable's runpath, unless it's the
  398. dnl standard /usr/lib.
  399. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
  400. dnl No hardcoding is needed.
  401. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  402. else
  403. dnl Use an explicit option to hardcode DIR into the resulting
  404. dnl binary.
  405. dnl Potentially add DIR to ltrpathdirs.
  406. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  407. haveit=
  408. for x in $ltrpathdirs; do
  409. if test "X$x" = "X$found_dir"; then
  410. haveit=yes
  411. break
  412. fi
  413. done
  414. if test -z "$haveit"; then
  415. ltrpathdirs="$ltrpathdirs $found_dir"
  416. fi
  417. dnl The hardcoding into $LIBNAME is system dependent.
  418. if test "$hardcode_direct" = yes; then
  419. dnl Using DIR/libNAME.so during linking hardcodes DIR into the
  420. dnl resulting binary.
  421. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  422. else
  423. if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
  424. dnl Use an explicit option to hardcode DIR into the resulting
  425. dnl binary.
  426. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  427. dnl Potentially add DIR to rpathdirs.
  428. dnl The rpathdirs will be appended to $LIBNAME at the end.
  429. haveit=
  430. for x in $rpathdirs; do
  431. if test "X$x" = "X$found_dir"; then
  432. haveit=yes
  433. break
  434. fi
  435. done
  436. if test -z "$haveit"; then
  437. rpathdirs="$rpathdirs $found_dir"
  438. fi
  439. else
  440. dnl Rely on "-L$found_dir".
  441. dnl But don't add it if it's already contained in the LDFLAGS
  442. dnl or the already constructed $LIBNAME
  443. haveit=
  444. for x in $LDFLAGS $LIB[]NAME; do
  445. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  446. if test "X$x" = "X-L$found_dir"; then
  447. haveit=yes
  448. break
  449. fi
  450. done
  451. if test -z "$haveit"; then
  452. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
  453. fi
  454. if test "$hardcode_minus_L" != no; then
  455. dnl FIXME: Not sure whether we should use
  456. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  457. dnl here.
  458. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  459. else
  460. dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
  461. dnl here, because this doesn't fit in flags passed to the
  462. dnl compiler. So give up. No hardcoding. This affects only
  463. dnl very old systems.
  464. dnl FIXME: Not sure whether we should use
  465. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  466. dnl here.
  467. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  468. fi
  469. fi
  470. fi
  471. fi
  472. else
  473. if test "X$found_a" != "X"; then
  474. dnl Linking with a static library.
  475. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
  476. else
  477. dnl We shouldn't come here, but anyway it's good to have a
  478. dnl fallback.
  479. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
  480. fi
  481. fi
  482. dnl Assume the include files are nearby.
  483. additional_includedir=
  484. case "$found_dir" in
  485. */lib | */lib/)
  486. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
  487. additional_includedir="$basedir/include"
  488. ;;
  489. esac
  490. if test "X$additional_includedir" != "X"; then
  491. dnl Potentially add $additional_includedir to $INCNAME.
  492. dnl But don't add it
  493. dnl 1. if it's the standard /usr/include,
  494. dnl 2. if it's /usr/local/include and we are using GCC on Linux,
  495. dnl 3. if it's already present in $CPPFLAGS or the already
  496. dnl constructed $INCNAME,
  497. dnl 4. if it doesn't exist as a directory.
  498. if test "X$additional_includedir" != "X/usr/include"; then
  499. haveit=
  500. if test "X$additional_includedir" = "X/usr/local/include"; then
  501. if test -n "$GCC"; then
  502. case $host_os in
  503. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  504. esac
  505. fi
  506. fi
  507. if test -z "$haveit"; then
  508. for x in $CPPFLAGS $INC[]NAME; do
  509. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  510. if test "X$x" = "X-I$additional_includedir"; then
  511. haveit=yes
  512. break
  513. fi
  514. done
  515. if test -z "$haveit"; then
  516. if test -d "$additional_includedir"; then
  517. dnl Really add $additional_includedir to $INCNAME.
  518. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
  519. fi
  520. fi
  521. fi
  522. fi
  523. fi
  524. dnl Look for dependencies.
  525. if test -n "$found_la"; then
  526. dnl Read the .la file. It defines the variables
  527. dnl dlname, library_names, old_library, dependency_libs, current,
  528. dnl age, revision, installed, dlopen, dlpreopen, libdir.
  529. save_libdir="$libdir"
  530. case "$found_la" in
  531. */* | *\\*) . "$found_la" ;;
  532. *) . "./$found_la" ;;
  533. esac
  534. libdir="$save_libdir"
  535. dnl We use only dependency_libs.
  536. for dep in $dependency_libs; do
  537. case "$dep" in
  538. -L*)
  539. additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
  540. dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
  541. dnl But don't add it
  542. dnl 1. if it's the standard /usr/lib,
  543. dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
  544. dnl 3. if it's already present in $LDFLAGS or the already
  545. dnl constructed $LIBNAME,
  546. dnl 4. if it doesn't exist as a directory.
  547. if test "X$additional_libdir" != "X/usr/lib"; then
  548. haveit=
  549. if test "X$additional_libdir" = "X/usr/local/lib"; then
  550. if test -n "$GCC"; then
  551. case $host_os in
  552. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  553. esac
  554. fi
  555. fi
  556. if test -z "$haveit"; then
  557. haveit=
  558. for x in $LDFLAGS $LIB[]NAME; do
  559. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  560. if test "X$x" = "X-L$additional_libdir"; then
  561. haveit=yes
  562. break
  563. fi
  564. done
  565. if test -z "$haveit"; then
  566. if test -d "$additional_libdir"; then
  567. dnl Really add $additional_libdir to $LIBNAME.
  568. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
  569. fi
  570. fi
  571. haveit=
  572. for x in $LDFLAGS $LTLIB[]NAME; do
  573. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  574. if test "X$x" = "X-L$additional_libdir"; then
  575. haveit=yes
  576. break
  577. fi
  578. done
  579. if test -z "$haveit"; then
  580. if test -d "$additional_libdir"; then
  581. dnl Really add $additional_libdir to $LTLIBNAME.
  582. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
  583. fi
  584. fi
  585. fi
  586. fi
  587. ;;
  588. -R*)
  589. dir=`echo "X$dep" | sed -e 's/^X-R//'`
  590. if test "$enable_rpath" != no; then
  591. dnl Potentially add DIR to rpathdirs.
  592. dnl The rpathdirs will be appended to $LIBNAME at the end.
  593. haveit=
  594. for x in $rpathdirs; do
  595. if test "X$x" = "X$dir"; then
  596. haveit=yes
  597. break
  598. fi
  599. done
  600. if test -z "$haveit"; then
  601. rpathdirs="$rpathdirs $dir"
  602. fi
  603. dnl Potentially add DIR to ltrpathdirs.
  604. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  605. haveit=
  606. for x in $ltrpathdirs; do
  607. if test "X$x" = "X$dir"; then
  608. haveit=yes
  609. break
  610. fi
  611. done
  612. if test -z "$haveit"; then
  613. ltrpathdirs="$ltrpathdirs $dir"
  614. fi
  615. fi
  616. ;;
  617. -l*)
  618. dnl Handle this in the next round.
  619. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
  620. ;;
  621. *.la)
  622. dnl Handle this in the next round. Throw away the .la's
  623. dnl directory; it is already contained in a preceding -L
  624. dnl option.
  625. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
  626. ;;
  627. *)
  628. dnl Most likely an immediate library name.
  629. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
  630. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
  631. ;;
  632. esac
  633. done
  634. fi
  635. else
  636. dnl Didn't find the library; assume it is in the system directories
  637. dnl known to the linker and runtime loader. (All the system
  638. dnl directories known to the linker should also be known to the
  639. dnl runtime loader, otherwise the system is severely misconfigured.)
  640. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  641. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
  642. fi
  643. fi
  644. fi
  645. done
  646. done
  647. if test "X$rpathdirs" != "X"; then
  648. if test -n "$hardcode_libdir_separator"; then
  649. dnl Weird platform: only the last -rpath option counts, the user must
  650. dnl pass all path elements in one option. We can arrange that for a
  651. dnl single library, but not when more than one $LIBNAMEs are used.
  652. alldirs=
  653. for found_dir in $rpathdirs; do
  654. alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
  655. done
  656. dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
  657. acl_save_libdir="$libdir"
  658. libdir="$alldirs"
  659. eval flag=\"$hardcode_libdir_flag_spec\"
  660. libdir="$acl_save_libdir"
  661. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  662. else
  663. dnl The -rpath options are cumulative.
  664. for found_dir in $rpathdirs; do
  665. acl_save_libdir="$libdir"
  666. libdir="$found_dir"
  667. eval flag=\"$hardcode_libdir_flag_spec\"
  668. libdir="$acl_save_libdir"
  669. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  670. done
  671. fi
  672. fi
  673. if test "X$ltrpathdirs" != "X"; then
  674. dnl When using libtool, the option that works for both libraries and
  675. dnl executables is -R. The -R options are cumulative.
  676. for found_dir in $ltrpathdirs; do
  677. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
  678. done
  679. fi
  680. ])
  681. dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
  682. dnl unless already present in VAR.
  683. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
  684. dnl contains two or three consecutive elements that belong together.
  685. AC_DEFUN([AC_LIB_APPENDTOVAR],
  686. [
  687. for element in [$2]; do
  688. haveit=
  689. for x in $[$1]; do
  690. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  691. if test "X$x" = "X$element"; then
  692. haveit=yes
  693. break
  694. fi
  695. done
  696. if test -z "$haveit"; then
  697. [$1]="${[$1]}${[$1]:+ }$element"
  698. fi
  699. done
  700. ])
  701. # lib-ld.m4 serial 3 (gettext-0.13)
  702. dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
  703. dnl This file is free software; the Free Software Foundation
  704. dnl gives unlimited permission to copy and/or distribute it,
  705. dnl with or without modifications, as long as this notice is preserved.
  706. dnl Subroutines of libtool.m4,
  707. dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
  708. dnl with libtool.m4.
  709. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
  710. AC_DEFUN([AC_LIB_PROG_LD_GNU],
  711. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
  712. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  713. case `$LD -v 2>&1 </dev/null` in
  714. *GNU* | *'with BFD'*)
  715. acl_cv_prog_gnu_ld=yes ;;
  716. *)
  717. acl_cv_prog_gnu_ld=no ;;
  718. esac])
  719. with_gnu_ld=$acl_cv_prog_gnu_ld
  720. ])
  721. dnl From libtool-1.4. Sets the variable LD.
  722. AC_DEFUN([AC_LIB_PROG_LD],
  723. [AC_ARG_WITH(gnu-ld,
  724. [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
  725. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  726. AC_REQUIRE([AC_PROG_CC])dnl
  727. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  728. # Prepare PATH_SEPARATOR.
  729. # The user is always right.
  730. if test "${PATH_SEPARATOR+set}" != set; then
  731. echo "#! /bin/sh" >conf$$.sh
  732. echo "exit 0" >>conf$$.sh
  733. chmod +x conf$$.sh
  734. if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
  735. PATH_SEPARATOR=';'
  736. else
  737. PATH_SEPARATOR=:
  738. fi
  739. rm -f conf$$.sh
  740. fi
  741. ac_prog=ld
  742. if test "$GCC" = yes; then
  743. # Check if gcc -print-prog-name=ld gives a path.
  744. AC_MSG_CHECKING([for ld used by GCC])
  745. case $host in
  746. *-*-mingw*)
  747. # gcc leaves a trailing carriage return which upsets mingw
  748. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  749. *)
  750. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  751. esac
  752. case $ac_prog in
  753. # Accept absolute paths.
  754. [[\\/]* | [A-Za-z]:[\\/]*)]
  755. [re_direlt='/[^/][^/]*/\.\./']
  756. # Canonicalize the path of ld
  757. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  758. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  759. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  760. done
  761. test -z "$LD" && LD="$ac_prog"
  762. ;;
  763. "")
  764. # If it fails, then pretend we aren't using GCC.
  765. ac_prog=ld
  766. ;;
  767. *)
  768. # If it is relative, then search for the first ld in PATH.
  769. with_gnu_ld=unknown
  770. ;;
  771. esac
  772. elif test "$with_gnu_ld" = yes; then
  773. AC_MSG_CHECKING([for GNU ld])
  774. else
  775. AC_MSG_CHECKING([for non-GNU ld])
  776. fi
  777. AC_CACHE_VAL(acl_cv_path_LD,
  778. [if test -z "$LD"; then
  779. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  780. for ac_dir in $PATH; do
  781. test -z "$ac_dir" && ac_dir=.
  782. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  783. acl_cv_path_LD="$ac_dir/$ac_prog"
  784. # Check to see if the program is GNU ld. I'd rather use --version,
  785. # but apparently some GNU ld's only accept -v.
  786. # Break only if it was the GNU/non-GNU ld that we prefer.
  787. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
  788. *GNU* | *'with BFD'*)
  789. test "$with_gnu_ld" != no && break ;;
  790. *)
  791. test "$with_gnu_ld" != yes && break ;;
  792. esac
  793. fi
  794. done
  795. IFS="$ac_save_ifs"
  796. else
  797. acl_cv_path_LD="$LD" # Let the user override the test with a path.
  798. fi])
  799. LD="$acl_cv_path_LD"
  800. if test -n "$LD"; then
  801. AC_MSG_RESULT($LD)
  802. else
  803. AC_MSG_RESULT(no)
  804. fi
  805. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  806. AC_LIB_PROG_LD_GNU
  807. ])