config.rpath 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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-2002 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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. # All known linkers require a `.a' archive for static linking (except M$VC,
  37. # which needs '.lib').
  38. libext=a
  39. shlibext=
  40. host="$1"
  41. host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  42. host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  43. host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  44. wl=
  45. if test "$GCC" = yes; then
  46. wl='-Wl,'
  47. else
  48. case "$host_os" in
  49. aix3* | aix4* | aix5*)
  50. wl='-Wl,'
  51. ;;
  52. hpux9* | hpux10* | hpux11*)
  53. wl='-Wl,'
  54. ;;
  55. irix5* | irix6*)
  56. wl='-Wl,'
  57. ;;
  58. linux*)
  59. echo '__INTEL_COMPILER' > conftest.$ac_ext
  60. if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
  61. then
  62. :
  63. else
  64. # Intel icc
  65. wl='-Qoption,ld,'
  66. fi
  67. ;;
  68. osf3* | osf4* | osf5*)
  69. wl='-Wl,'
  70. ;;
  71. solaris*)
  72. wl='-Wl,'
  73. ;;
  74. sunos4*)
  75. wl='-Qoption ld '
  76. ;;
  77. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  78. if test "x$host_vendor" = xsni; then
  79. wl='-LD'
  80. else
  81. wl='-Wl,'
  82. fi
  83. ;;
  84. esac
  85. fi
  86. hardcode_libdir_flag_spec=
  87. hardcode_libdir_separator=
  88. hardcode_direct=no
  89. hardcode_minus_L=no
  90. case "$host_os" in
  91. cygwin* | mingw* | pw32*)
  92. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  93. # When not using gcc, we currently assume that we are using
  94. # Microsoft Visual C++.
  95. if test "$GCC" != yes; then
  96. with_gnu_ld=no
  97. fi
  98. ;;
  99. openbsd*)
  100. with_gnu_ld=no
  101. ;;
  102. esac
  103. ld_shlibs=yes
  104. if test "$with_gnu_ld" = yes; then
  105. case "$host_os" in
  106. aix3* | aix4* | aix5*)
  107. # On AIX, the GNU linker is very broken
  108. ld_shlibs=no
  109. ;;
  110. amigaos*)
  111. hardcode_libdir_flag_spec='-L$libdir'
  112. hardcode_minus_L=yes
  113. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  114. # that the semantics of dynamic libraries on AmigaOS, at least up
  115. # to version 4, is to share data among multiple programs linked
  116. # with the same dynamic library. Since this doesn't match the
  117. # behavior of shared libraries on other platforms, we can use
  118. # them.
  119. ld_shlibs=no
  120. ;;
  121. beos*)
  122. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  123. :
  124. else
  125. ld_shlibs=no
  126. fi
  127. ;;
  128. cygwin* | mingw* | pw32*)
  129. # hardcode_libdir_flag_spec is actually meaningless, as there is
  130. # no search path for DLLs.
  131. hardcode_libdir_flag_spec='-L$libdir'
  132. ;;
  133. solaris* | sysv5*)
  134. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  135. ld_shlibs=no
  136. elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  137. :
  138. else
  139. ld_shlibs=no
  140. fi
  141. ;;
  142. sunos4*)
  143. hardcode_direct=yes
  144. ;;
  145. *)
  146. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  147. :
  148. else
  149. ld_shlibs=no
  150. fi
  151. ;;
  152. esac
  153. if test "$ld_shlibs" = yes; then
  154. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  155. fi
  156. else
  157. case "$host_os" in
  158. aix3*)
  159. # Note: this linker hardcodes the directories in LIBPATH if there
  160. # are no directories specified by -L.
  161. hardcode_minus_L=yes
  162. if test "$GCC" = yes; then
  163. # Neither direct hardcoding nor static linking is supported with a
  164. # broken collect2.
  165. hardcode_direct=unsupported
  166. fi
  167. ;;
  168. aix4* | aix5*)
  169. if test "$host_cpu" = ia64; then
  170. # On IA64, the linker does run time linking by default, so we don't
  171. # have to do anything special.
  172. aix_use_runtimelinking=no
  173. else
  174. aix_use_runtimelinking=no
  175. # Test if we are trying to use run time linking or normal
  176. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  177. # need to do runtime linking.
  178. case $host_os in aix4.[23]|aix4.[23].*|aix5*)
  179. for ld_flag in $LDFLAGS; do
  180. if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  181. aix_use_runtimelinking=yes
  182. break
  183. fi
  184. done
  185. esac
  186. fi
  187. hardcode_direct=yes
  188. hardcode_libdir_separator=':'
  189. if test "$GCC" = yes; then
  190. case $host_os in aix4.[012]|aix4.[012].*)
  191. collect2name=`${CC} -print-prog-name=collect2`
  192. if test -f "$collect2name" && \
  193. strings "$collect2name" | grep resolve_lib_name >/dev/null
  194. then
  195. # We have reworked collect2
  196. hardcode_direct=yes
  197. else
  198. # We have old collect2
  199. hardcode_direct=unsupported
  200. hardcode_minus_L=yes
  201. hardcode_libdir_flag_spec='-L$libdir'
  202. hardcode_libdir_separator=
  203. fi
  204. esac
  205. fi
  206. if test "$aix_use_runtimelinking" = yes; then
  207. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
  208. else
  209. if test "$host_cpu" = ia64; then
  210. hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  211. else
  212. hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
  213. fi
  214. fi
  215. ;;
  216. amigaos*)
  217. hardcode_libdir_flag_spec='-L$libdir'
  218. hardcode_minus_L=yes
  219. # see comment about different semantics on the GNU ld section
  220. ld_shlibs=no
  221. ;;
  222. cygwin* | mingw* | pw32*)
  223. # When not using gcc, we currently assume that we are using
  224. # Microsoft Visual C++.
  225. # hardcode_libdir_flag_spec is actually meaningless, as there is
  226. # no search path for DLLs.
  227. hardcode_libdir_flag_spec=' '
  228. libext=lib
  229. ;;
  230. darwin* | rhapsody*)
  231. hardcode_direct=yes
  232. ;;
  233. freebsd1*)
  234. ld_shlibs=no
  235. ;;
  236. freebsd2.2*)
  237. hardcode_libdir_flag_spec='-R$libdir'
  238. hardcode_direct=yes
  239. ;;
  240. freebsd2*)
  241. hardcode_direct=yes
  242. hardcode_minus_L=yes
  243. ;;
  244. freebsd*)
  245. hardcode_libdir_flag_spec='-R$libdir'
  246. hardcode_direct=yes
  247. ;;
  248. hpux9* | hpux10* | hpux11*)
  249. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  250. hardcode_libdir_separator=:
  251. hardcode_direct=yes
  252. hardcode_minus_L=yes # Not in the search PATH, but as the default
  253. # location of the library.
  254. ;;
  255. irix5* | irix6*)
  256. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  257. hardcode_libdir_separator=:
  258. ;;
  259. netbsd*)
  260. hardcode_libdir_flag_spec='-R$libdir'
  261. hardcode_direct=yes
  262. ;;
  263. newsos6)
  264. hardcode_direct=yes
  265. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  266. hardcode_libdir_separator=:
  267. ;;
  268. openbsd*)
  269. hardcode_direct=yes
  270. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  271. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  272. else
  273. case "$host_os" in
  274. openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
  275. hardcode_libdir_flag_spec='-R$libdir'
  276. ;;
  277. *)
  278. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  279. ;;
  280. esac
  281. fi
  282. ;;
  283. os2*)
  284. hardcode_libdir_flag_spec='-L$libdir'
  285. hardcode_minus_L=yes
  286. ;;
  287. osf3*)
  288. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  289. hardcode_libdir_separator=:
  290. ;;
  291. osf4* | osf5*)
  292. if test "$GCC" = yes; then
  293. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  294. else
  295. # Both cc and cxx compiler support -rpath directly
  296. hardcode_libdir_flag_spec='-rpath $libdir'
  297. fi
  298. hardcode_libdir_separator=:
  299. ;;
  300. sco3.2v5*)
  301. ;;
  302. solaris*)
  303. hardcode_libdir_flag_spec='-R$libdir'
  304. ;;
  305. sunos4*)
  306. hardcode_libdir_flag_spec='-L$libdir'
  307. hardcode_direct=yes
  308. hardcode_minus_L=yes
  309. ;;
  310. sysv4)
  311. if test "x$host_vendor" = xsno; then
  312. hardcode_direct=yes # is this really true???
  313. else
  314. hardcode_direct=no # Motorola manual says yes, but my tests say they lie
  315. fi
  316. ;;
  317. sysv4.3*)
  318. ;;
  319. sysv5*)
  320. hardcode_libdir_flag_spec=
  321. ;;
  322. uts4*)
  323. hardcode_libdir_flag_spec='-L$libdir'
  324. ;;
  325. dgux*)
  326. hardcode_libdir_flag_spec='-L$libdir'
  327. ;;
  328. sysv4*MP*)
  329. if test -d /usr/nec; then
  330. ld_shlibs=yes
  331. fi
  332. ;;
  333. sysv4.2uw2*)
  334. hardcode_direct=yes
  335. hardcode_minus_L=no
  336. ;;
  337. sysv5uw7* | unixware7*)
  338. ;;
  339. *)
  340. ld_shlibs=no
  341. ;;
  342. esac
  343. fi
  344. # Check dynamic linker characteristics
  345. libname_spec='lib$name'
  346. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  347. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  348. case "$host_os" in
  349. aix3*)
  350. shlibext=so
  351. ;;
  352. aix4* | aix5*)
  353. shlibext=so
  354. ;;
  355. amigaos*)
  356. shlibext=ixlibrary
  357. ;;
  358. beos*)
  359. shlibext=so
  360. ;;
  361. bsdi4*)
  362. shlibext=so
  363. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  364. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  365. ;;
  366. cygwin* | mingw* | pw32*)
  367. case $GCC,$host_os in
  368. yes,cygwin*)
  369. shlibext=dll.a
  370. ;;
  371. yes,mingw*)
  372. shlibext=dll
  373. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
  374. ;;
  375. yes,pw32*)
  376. shlibext=dll
  377. ;;
  378. *)
  379. shlibext=dll
  380. ;;
  381. esac
  382. ;;
  383. darwin* | rhapsody*)
  384. shlibext=dylib
  385. ;;
  386. freebsd1*)
  387. ;;
  388. freebsd*)
  389. shlibext=so
  390. ;;
  391. gnu*)
  392. shlibext=so
  393. ;;
  394. hpux9* | hpux10* | hpux11*)
  395. shlibext=sl
  396. ;;
  397. irix5* | irix6*)
  398. shlibext=so
  399. case "$host_os" in
  400. irix5*)
  401. libsuff= shlibsuff=
  402. ;;
  403. *)
  404. case $LD in
  405. *-32|*"-32 ") libsuff= shlibsuff= ;;
  406. *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
  407. *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
  408. *) libsuff= shlibsuff= ;;
  409. esac
  410. ;;
  411. esac
  412. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  413. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  414. ;;
  415. linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  416. ;;
  417. linux-gnu*)
  418. shlibext=so
  419. ;;
  420. netbsd*)
  421. shlibext=so
  422. ;;
  423. newsos6)
  424. shlibext=so
  425. ;;
  426. openbsd*)
  427. shlibext=so
  428. ;;
  429. os2*)
  430. libname_spec='$name'
  431. shlibext=dll
  432. ;;
  433. osf3* | osf4* | osf5*)
  434. shlibext=so
  435. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  436. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  437. ;;
  438. sco3.2v5*)
  439. shlibext=so
  440. ;;
  441. solaris*)
  442. shlibext=so
  443. ;;
  444. sunos4*)
  445. shlibext=so
  446. ;;
  447. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  448. shlibext=so
  449. case "$host_vendor" in
  450. motorola)
  451. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  452. ;;
  453. esac
  454. ;;
  455. uts4*)
  456. shlibext=so
  457. ;;
  458. dgux*)
  459. shlibext=so
  460. ;;
  461. sysv4*MP*)
  462. if test -d /usr/nec; then
  463. shlibext=so
  464. fi
  465. ;;
  466. esac
  467. sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
  468. escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
  469. escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  470. escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  471. escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  472. sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
  473. # How to pass a linker flag through the compiler.
  474. wl="$escaped_wl"
  475. # Static library suffix (normally "a").
  476. libext="$libext"
  477. # Shared library suffix (normally "so").
  478. shlibext="$shlibext"
  479. # Flag to hardcode \$libdir into a binary during linking.
  480. # This must work even if \$libdir does not exist.
  481. hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
  482. # Whether we need a single -rpath flag with a separated argument.
  483. hardcode_libdir_separator="$hardcode_libdir_separator"
  484. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  485. # resulting binary.
  486. hardcode_direct="$hardcode_direct"
  487. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  488. # resulting binary.
  489. hardcode_minus_L="$hardcode_minus_L"
  490. # Compile-time system search path for libraries
  491. sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
  492. # Run-time system search path for libraries
  493. sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
  494. EOF