config.rpath 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. #! /bin/sh
  2. # Output a system dependent set of variables, describing how to set the
  3. # run time search path of shared libraries in an executable.
  4. #
  5. # Copyright 1996-2003 Free Software Foundation, Inc.
  6. # Taken from GNU libtool, 2001
  7. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  22. #
  23. # As a special exception to the GNU General Public License, if you
  24. # distribute this file as part of a program that contains a
  25. # configuration script generated by Autoconf, you may include it under
  26. # the same distribution terms that you use for the rest of that program.
  27. #
  28. # The first argument passed to this file is the canonical host specification,
  29. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  30. # or
  31. # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  32. # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
  33. # should be set by the caller.
  34. #
  35. # The set of defined variables is at the end of this script.
  36. # Known limitations:
  37. # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
  38. # than 256 bytes, otherwise the compiler driver will dump core. The only
  39. # known workaround is to choose shorter directory names for the build
  40. # directory and/or the installation directory.
  41. # All known linkers require a `.a' archive for static linking (except M$VC,
  42. # which needs '.lib').
  43. libext=a
  44. shrext=.so
  45. host="$1"
  46. host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  47. host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  48. host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  49. # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
  50. wl=
  51. if test "$GCC" = yes; then
  52. wl='-Wl,'
  53. else
  54. case "$host_os" in
  55. aix*)
  56. wl='-Wl,'
  57. ;;
  58. mingw* | pw32* | os2*)
  59. ;;
  60. hpux9* | hpux10* | hpux11*)
  61. wl='-Wl,'
  62. ;;
  63. irix5* | irix6* | nonstopux*)
  64. wl='-Wl,'
  65. ;;
  66. newsos6)
  67. ;;
  68. linux*)
  69. case $CC in
  70. icc|ecc)
  71. wl='-Wl,'
  72. ;;
  73. ccc)
  74. wl='-Wl,'
  75. ;;
  76. esac
  77. ;;
  78. osf3* | osf4* | osf5*)
  79. wl='-Wl,'
  80. ;;
  81. sco3.2v5*)
  82. ;;
  83. solaris*)
  84. wl='-Wl,'
  85. ;;
  86. sunos4*)
  87. wl='-Qoption ld '
  88. ;;
  89. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  90. wl='-Wl,'
  91. ;;
  92. sysv4*MP*)
  93. ;;
  94. uts4*)
  95. ;;
  96. esac
  97. fi
  98. # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
  99. hardcode_libdir_flag_spec=
  100. hardcode_libdir_separator=
  101. hardcode_direct=no
  102. hardcode_minus_L=no
  103. case "$host_os" in
  104. cygwin* | mingw* | pw32*)
  105. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  106. # When not using gcc, we currently assume that we are using
  107. # Microsoft Visual C++.
  108. if test "$GCC" != yes; then
  109. with_gnu_ld=no
  110. fi
  111. ;;
  112. openbsd*)
  113. with_gnu_ld=no
  114. ;;
  115. esac
  116. ld_shlibs=yes
  117. if test "$with_gnu_ld" = yes; then
  118. case "$host_os" in
  119. aix[3-9]*)
  120. # On AIX/PPC, the GNU linker is very broken
  121. if test "$host_cpu" != ia64; then
  122. ld_shlibs=no
  123. fi
  124. ;;
  125. amigaos*)
  126. hardcode_libdir_flag_spec='-L$libdir'
  127. hardcode_minus_L=yes
  128. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  129. # that the semantics of dynamic libraries on AmigaOS, at least up
  130. # to version 4, is to share data among multiple programs linked
  131. # with the same dynamic library. Since this doesn't match the
  132. # behavior of shared libraries on other platforms, we can use
  133. # them.
  134. ld_shlibs=no
  135. ;;
  136. beos*)
  137. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  138. :
  139. else
  140. ld_shlibs=no
  141. fi
  142. ;;
  143. cygwin* | mingw* | pw32*)
  144. # hardcode_libdir_flag_spec is actually meaningless, as there is
  145. # no search path for DLLs.
  146. hardcode_libdir_flag_spec='-L$libdir'
  147. if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  148. :
  149. else
  150. ld_shlibs=no
  151. fi
  152. ;;
  153. netbsd*)
  154. ;;
  155. solaris* | sysv5*)
  156. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  157. ld_shlibs=no
  158. elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  159. :
  160. else
  161. ld_shlibs=no
  162. fi
  163. ;;
  164. sunos4*)
  165. hardcode_direct=yes
  166. ;;
  167. *)
  168. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  169. :
  170. else
  171. ld_shlibs=no
  172. fi
  173. ;;
  174. esac
  175. if test "$ld_shlibs" = yes; then
  176. # Unlike libtool, we use -rpath here, not --rpath, since the documented
  177. # option of GNU ld is called -rpath, not --rpath.
  178. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  179. fi
  180. else
  181. case "$host_os" in
  182. aix3*)
  183. # Note: this linker hardcodes the directories in LIBPATH if there
  184. # are no directories specified by -L.
  185. hardcode_minus_L=yes
  186. if test "$GCC" = yes; then
  187. # Neither direct hardcoding nor static linking is supported with a
  188. # broken collect2.
  189. hardcode_direct=unsupported
  190. fi
  191. ;;
  192. aix[4-9]*)
  193. if test "$host_cpu" = ia64; then
  194. # On IA64, the linker does run time linking by default, so we don't
  195. # have to do anything special.
  196. aix_use_runtimelinking=no
  197. else
  198. aix_use_runtimelinking=no
  199. # Test if we are trying to use run time linking or normal
  200. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  201. # need to do runtime linking.
  202. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
  203. for ld_flag in $LDFLAGS; do
  204. if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  205. aix_use_runtimelinking=yes
  206. break
  207. fi
  208. done
  209. esac
  210. fi
  211. hardcode_direct=yes
  212. hardcode_libdir_separator=':'
  213. if test "$GCC" = yes; then
  214. case $host_os in aix4.[012]|aix4.[012].*)
  215. collect2name=`${CC} -print-prog-name=collect2`
  216. if test -f "$collect2name" && \
  217. strings "$collect2name" | grep resolve_lib_name >/dev/null
  218. then
  219. # We have reworked collect2
  220. hardcode_direct=yes
  221. else
  222. # We have old collect2
  223. hardcode_direct=unsupported
  224. hardcode_minus_L=yes
  225. hardcode_libdir_flag_spec='-L$libdir'
  226. hardcode_libdir_separator=
  227. fi
  228. esac
  229. fi
  230. # Begin _LT_AC_SYS_LIBPATH_AIX.
  231. echo 'int main () { return 0; }' > conftest.c
  232. ${CC} ${LDFLAGS} conftest.c -o conftest
  233. aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  234. }'`
  235. if test -z "$aix_libpath"; then
  236. aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  237. }'`
  238. fi
  239. if test -z "$aix_libpath"; then
  240. aix_libpath="/usr/lib:/lib"
  241. fi
  242. rm -f conftest.c conftest
  243. # End _LT_AC_SYS_LIBPATH_AIX.
  244. if test "$aix_use_runtimelinking" = yes; then
  245. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  246. else
  247. if test "$host_cpu" = ia64; then
  248. hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  249. else
  250. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  251. fi
  252. fi
  253. ;;
  254. amigaos*)
  255. hardcode_libdir_flag_spec='-L$libdir'
  256. hardcode_minus_L=yes
  257. # see comment about different semantics on the GNU ld section
  258. ld_shlibs=no
  259. ;;
  260. bsdi4*)
  261. ;;
  262. cygwin* | mingw* | pw32*)
  263. # When not using gcc, we currently assume that we are using
  264. # Microsoft Visual C++.
  265. # hardcode_libdir_flag_spec is actually meaningless, as there is
  266. # no search path for DLLs.
  267. hardcode_libdir_flag_spec=' '
  268. libext=lib
  269. ;;
  270. darwin* | rhapsody*)
  271. if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
  272. hardcode_direct=no
  273. fi
  274. ;;
  275. dgux*)
  276. hardcode_libdir_flag_spec='-L$libdir'
  277. ;;
  278. freebsd2.2*)
  279. hardcode_libdir_flag_spec='-R$libdir'
  280. hardcode_direct=yes
  281. ;;
  282. freebsd2*)
  283. hardcode_direct=yes
  284. hardcode_minus_L=yes
  285. ;;
  286. freebsd*)
  287. hardcode_libdir_flag_spec='-R$libdir'
  288. hardcode_direct=yes
  289. ;;
  290. hpux9*)
  291. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  292. hardcode_libdir_separator=:
  293. hardcode_direct=yes
  294. # hardcode_minus_L: Not really in the search PATH,
  295. # but as the default location of the library.
  296. hardcode_minus_L=yes
  297. ;;
  298. hpux10* | hpux11*)
  299. if test "$with_gnu_ld" = no; then
  300. case "$host_cpu" in
  301. hppa*64*)
  302. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  303. hardcode_libdir_separator=:
  304. hardcode_direct=no
  305. ;;
  306. ia64*)
  307. hardcode_libdir_flag_spec='-L$libdir'
  308. hardcode_direct=no
  309. # hardcode_minus_L: Not really in the search PATH,
  310. # but as the default location of the library.
  311. hardcode_minus_L=yes
  312. ;;
  313. *)
  314. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  315. hardcode_libdir_separator=:
  316. hardcode_direct=yes
  317. # hardcode_minus_L: Not really in the search PATH,
  318. # but as the default location of the library.
  319. hardcode_minus_L=yes
  320. ;;
  321. esac
  322. fi
  323. ;;
  324. irix5* | irix6* | nonstopux*)
  325. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  326. hardcode_libdir_separator=:
  327. ;;
  328. netbsd*)
  329. hardcode_libdir_flag_spec='-R$libdir'
  330. hardcode_direct=yes
  331. ;;
  332. newsos6)
  333. hardcode_direct=yes
  334. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  335. hardcode_libdir_separator=:
  336. ;;
  337. openbsd*)
  338. hardcode_direct=yes
  339. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  340. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  341. else
  342. case "$host_os" in
  343. openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
  344. hardcode_libdir_flag_spec='-R$libdir'
  345. ;;
  346. *)
  347. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  348. ;;
  349. esac
  350. fi
  351. ;;
  352. os2*)
  353. hardcode_libdir_flag_spec='-L$libdir'
  354. hardcode_minus_L=yes
  355. ;;
  356. osf3*)
  357. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  358. hardcode_libdir_separator=:
  359. ;;
  360. osf4* | osf5*)
  361. if test "$GCC" = yes; then
  362. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  363. else
  364. # Both cc and cxx compiler support -rpath directly
  365. hardcode_libdir_flag_spec='-rpath $libdir'
  366. fi
  367. hardcode_libdir_separator=:
  368. ;;
  369. sco3.2v5*)
  370. ;;
  371. solaris*)
  372. hardcode_libdir_flag_spec='-R$libdir'
  373. ;;
  374. sunos4*)
  375. hardcode_libdir_flag_spec='-L$libdir'
  376. hardcode_direct=yes
  377. hardcode_minus_L=yes
  378. ;;
  379. sysv4)
  380. case $host_vendor in
  381. sni)
  382. hardcode_direct=yes # is this really true???
  383. ;;
  384. siemens)
  385. hardcode_direct=no
  386. ;;
  387. motorola)
  388. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  389. ;;
  390. esac
  391. ;;
  392. sysv4.3*)
  393. ;;
  394. sysv4*MP*)
  395. if test -d /usr/nec; then
  396. ld_shlibs=yes
  397. fi
  398. ;;
  399. sysv4.2uw2*)
  400. hardcode_direct=yes
  401. hardcode_minus_L=no
  402. ;;
  403. sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
  404. ;;
  405. sysv5*)
  406. hardcode_libdir_flag_spec=
  407. ;;
  408. uts4*)
  409. hardcode_libdir_flag_spec='-L$libdir'
  410. ;;
  411. *)
  412. ld_shlibs=no
  413. ;;
  414. esac
  415. fi
  416. # Check dynamic linker characteristics
  417. # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
  418. libname_spec='lib$name'
  419. case "$host_os" in
  420. aix3*)
  421. ;;
  422. aix[4-9]*)
  423. ;;
  424. amigaos*)
  425. ;;
  426. beos*)
  427. ;;
  428. bsdi4*)
  429. ;;
  430. cygwin* | mingw* | pw32*)
  431. shrext=.dll
  432. ;;
  433. darwin* | rhapsody*)
  434. shrext=.dylib
  435. ;;
  436. dgux*)
  437. ;;
  438. freebsd*)
  439. ;;
  440. gnu*)
  441. ;;
  442. hpux9* | hpux10* | hpux11*)
  443. case "$host_cpu" in
  444. ia64*)
  445. shrext=.so
  446. ;;
  447. hppa*64*)
  448. shrext=.sl
  449. ;;
  450. *)
  451. shrext=.sl
  452. ;;
  453. esac
  454. ;;
  455. irix5* | irix6* | nonstopux*)
  456. case "$host_os" in
  457. irix5* | nonstopux*)
  458. libsuff= shlibsuff=
  459. ;;
  460. *)
  461. case $LD in
  462. *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
  463. *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
  464. *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
  465. *) libsuff= shlibsuff= ;;
  466. esac
  467. ;;
  468. esac
  469. ;;
  470. linux*oldld* | linux*aout* | linux*coff*)
  471. ;;
  472. linux*)
  473. ;;
  474. netbsd*)
  475. ;;
  476. newsos6)
  477. ;;
  478. nto-qnx)
  479. ;;
  480. openbsd*)
  481. ;;
  482. os2*)
  483. libname_spec='$name'
  484. shrext=.dll
  485. ;;
  486. osf3* | osf4* | osf5*)
  487. ;;
  488. sco3.2v5*)
  489. ;;
  490. solaris*)
  491. ;;
  492. sunos4*)
  493. ;;
  494. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  495. ;;
  496. sysv4*MP*)
  497. ;;
  498. uts4*)
  499. ;;
  500. esac
  501. sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
  502. escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
  503. shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
  504. escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  505. sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
  506. # How to pass a linker flag through the compiler.
  507. wl="$escaped_wl"
  508. # Static library suffix (normally "a").
  509. libext="$libext"
  510. # Shared library suffix (normally "so").
  511. shlibext="$shlibext"
  512. # Flag to hardcode \$libdir into a binary during linking.
  513. # This must work even if \$libdir does not exist.
  514. hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
  515. # Whether we need a single -rpath flag with a separated argument.
  516. hardcode_libdir_separator="$hardcode_libdir_separator"
  517. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  518. # resulting binary.
  519. hardcode_direct="$hardcode_direct"
  520. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  521. # resulting binary.
  522. hardcode_minus_L="$hardcode_minus_L"
  523. EOF