geom_gate userland utility improvements
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.
 
 
 
 

661 lines
18 KiB

  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-2006 Free Software Foundation, Inc.
  6. # Taken from GNU libtool, 2001
  7. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  8. #
  9. # This file is free software; the Free Software Foundation gives
  10. # unlimited permission to copy and/or distribute it, with or without
  11. # modifications, as long as this notice is preserved.
  12. #
  13. # The first argument passed to this file is the canonical host specification,
  14. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  15. # or
  16. # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  17. # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
  18. # should be set by the caller.
  19. #
  20. # The set of defined variables is at the end of this script.
  21. # Known limitations:
  22. # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
  23. # than 256 bytes, otherwise the compiler driver will dump core. The only
  24. # known workaround is to choose shorter directory names for the build
  25. # directory and/or the installation directory.
  26. # All known linkers require a `.a' archive for static linking (except MSVC,
  27. # which needs '.lib').
  28. libext=a
  29. shrext=.so
  30. host="$1"
  31. host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  32. host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  33. host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  34. # Code taken from libtool.m4's _LT_CC_BASENAME.
  35. for cc_temp in $CC""; do
  36. case $cc_temp in
  37. compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  38. distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  39. \-*) ;;
  40. *) break;;
  41. esac
  42. done
  43. cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
  44. # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
  45. wl=
  46. if test "$GCC" = yes; then
  47. wl='-Wl,'
  48. else
  49. case "$host_os" in
  50. aix*)
  51. wl='-Wl,'
  52. ;;
  53. darwin*)
  54. case $cc_basename in
  55. xlc*)
  56. wl='-Wl,'
  57. ;;
  58. esac
  59. ;;
  60. mingw* | pw32* | os2*)
  61. ;;
  62. hpux9* | hpux10* | hpux11*)
  63. wl='-Wl,'
  64. ;;
  65. irix5* | irix6* | nonstopux*)
  66. wl='-Wl,'
  67. ;;
  68. newsos6)
  69. ;;
  70. linux*)
  71. case $cc_basename in
  72. icc* | ecc*)
  73. wl='-Wl,'
  74. ;;
  75. pgcc | pgf77 | pgf90)
  76. wl='-Wl,'
  77. ;;
  78. ccc*)
  79. wl='-Wl,'
  80. ;;
  81. como)
  82. wl='-lopt='
  83. ;;
  84. *)
  85. case `$CC -V 2>&1 | sed 5q` in
  86. *Sun\ C*)
  87. wl='-Wl,'
  88. ;;
  89. esac
  90. ;;
  91. esac
  92. ;;
  93. osf3* | osf4* | osf5*)
  94. wl='-Wl,'
  95. ;;
  96. sco3.2v5*)
  97. ;;
  98. solaris*)
  99. wl='-Wl,'
  100. ;;
  101. sunos4*)
  102. wl='-Qoption ld '
  103. ;;
  104. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  105. wl='-Wl,'
  106. ;;
  107. sysv4*MP*)
  108. ;;
  109. unicos*)
  110. wl='-Wl,'
  111. ;;
  112. uts4*)
  113. ;;
  114. esac
  115. fi
  116. # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
  117. hardcode_libdir_flag_spec=
  118. hardcode_libdir_separator=
  119. hardcode_direct=no
  120. hardcode_minus_L=no
  121. case "$host_os" in
  122. cygwin* | mingw* | pw32*)
  123. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  124. # When not using gcc, we currently assume that we are using
  125. # Microsoft Visual C++.
  126. if test "$GCC" != yes; then
  127. with_gnu_ld=no
  128. fi
  129. ;;
  130. interix*)
  131. # we just hope/assume this is gcc and not c89 (= MSVC++)
  132. with_gnu_ld=yes
  133. ;;
  134. openbsd*)
  135. with_gnu_ld=no
  136. ;;
  137. esac
  138. ld_shlibs=yes
  139. if test "$with_gnu_ld" = yes; then
  140. # Set some defaults for GNU ld with shared library support. These
  141. # are reset later if shared libraries are not supported. Putting them
  142. # here allows them to be overridden if necessary.
  143. # Unlike libtool, we use -rpath here, not --rpath, since the documented
  144. # option of GNU ld is called -rpath, not --rpath.
  145. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  146. case "$host_os" in
  147. aix3* | aix4* | aix5*)
  148. # On AIX/PPC, the GNU linker is very broken
  149. if test "$host_cpu" != ia64; then
  150. ld_shlibs=no
  151. fi
  152. ;;
  153. amigaos*)
  154. hardcode_libdir_flag_spec='-L$libdir'
  155. hardcode_minus_L=yes
  156. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  157. # that the semantics of dynamic libraries on AmigaOS, at least up
  158. # to version 4, is to share data among multiple programs linked
  159. # with the same dynamic library. Since this doesn't match the
  160. # behavior of shared libraries on other platforms, we cannot use
  161. # them.
  162. ld_shlibs=no
  163. ;;
  164. beos*)
  165. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  166. :
  167. else
  168. ld_shlibs=no
  169. fi
  170. ;;
  171. cygwin* | mingw* | pw32*)
  172. # hardcode_libdir_flag_spec is actually meaningless, as there is
  173. # no search path for DLLs.
  174. hardcode_libdir_flag_spec='-L$libdir'
  175. if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  176. :
  177. else
  178. ld_shlibs=no
  179. fi
  180. ;;
  181. interix3*)
  182. hardcode_direct=no
  183. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  184. ;;
  185. linux*)
  186. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  187. :
  188. else
  189. ld_shlibs=no
  190. fi
  191. ;;
  192. netbsd*)
  193. ;;
  194. solaris*)
  195. if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
  196. ld_shlibs=no
  197. elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  198. :
  199. else
  200. ld_shlibs=no
  201. fi
  202. ;;
  203. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
  204. case `$LD -v 2>&1` in
  205. *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
  206. ld_shlibs=no
  207. ;;
  208. *)
  209. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  210. hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
  211. else
  212. ld_shlibs=no
  213. fi
  214. ;;
  215. esac
  216. ;;
  217. sunos4*)
  218. hardcode_direct=yes
  219. ;;
  220. *)
  221. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  222. :
  223. else
  224. ld_shlibs=no
  225. fi
  226. ;;
  227. esac
  228. if test "$ld_shlibs" = no; then
  229. hardcode_libdir_flag_spec=
  230. fi
  231. else
  232. case "$host_os" in
  233. aix3*)
  234. # Note: this linker hardcodes the directories in LIBPATH if there
  235. # are no directories specified by -L.
  236. hardcode_minus_L=yes
  237. if test "$GCC" = yes; then
  238. # Neither direct hardcoding nor static linking is supported with a
  239. # broken collect2.
  240. hardcode_direct=unsupported
  241. fi
  242. ;;
  243. aix4* | aix5*)
  244. if test "$host_cpu" = ia64; then
  245. # On IA64, the linker does run time linking by default, so we don't
  246. # have to do anything special.
  247. aix_use_runtimelinking=no
  248. else
  249. aix_use_runtimelinking=no
  250. # Test if we are trying to use run time linking or normal
  251. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  252. # need to do runtime linking.
  253. case $host_os in aix4.[23]|aix4.[23].*|aix5*)
  254. for ld_flag in $LDFLAGS; do
  255. if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
  256. aix_use_runtimelinking=yes
  257. break
  258. fi
  259. done
  260. ;;
  261. esac
  262. fi
  263. hardcode_direct=yes
  264. hardcode_libdir_separator=':'
  265. if test "$GCC" = yes; then
  266. case $host_os in aix4.[012]|aix4.[012].*)
  267. collect2name=`${CC} -print-prog-name=collect2`
  268. if test -f "$collect2name" && \
  269. strings "$collect2name" | grep resolve_lib_name >/dev/null
  270. then
  271. # We have reworked collect2
  272. hardcode_direct=yes
  273. else
  274. # We have old collect2
  275. hardcode_direct=unsupported
  276. hardcode_minus_L=yes
  277. hardcode_libdir_flag_spec='-L$libdir'
  278. hardcode_libdir_separator=
  279. fi
  280. ;;
  281. esac
  282. fi
  283. # Begin _LT_AC_SYS_LIBPATH_AIX.
  284. echo 'int main () { return 0; }' > conftest.c
  285. ${CC} ${LDFLAGS} conftest.c -o conftest
  286. aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  287. }'`
  288. if test -z "$aix_libpath"; then
  289. aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  290. }'`
  291. fi
  292. if test -z "$aix_libpath"; then
  293. aix_libpath="/usr/lib:/lib"
  294. fi
  295. rm -f conftest.c conftest
  296. # End _LT_AC_SYS_LIBPATH_AIX.
  297. if test "$aix_use_runtimelinking" = yes; then
  298. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  299. else
  300. if test "$host_cpu" = ia64; then
  301. hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
  302. else
  303. hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
  304. fi
  305. fi
  306. ;;
  307. amigaos*)
  308. hardcode_libdir_flag_spec='-L$libdir'
  309. hardcode_minus_L=yes
  310. # see comment about different semantics on the GNU ld section
  311. ld_shlibs=no
  312. ;;
  313. bsdi[45]*)
  314. ;;
  315. cygwin* | mingw* | pw32*)
  316. # When not using gcc, we currently assume that we are using
  317. # Microsoft Visual C++.
  318. # hardcode_libdir_flag_spec is actually meaningless, as there is
  319. # no search path for DLLs.
  320. hardcode_libdir_flag_spec=' '
  321. libext=lib
  322. ;;
  323. darwin* | rhapsody*)
  324. hardcode_direct=no
  325. if test "$GCC" = yes ; then
  326. :
  327. else
  328. case $cc_basename in
  329. xlc*)
  330. ;;
  331. *)
  332. ld_shlibs=no
  333. ;;
  334. esac
  335. fi
  336. ;;
  337. dgux*)
  338. hardcode_libdir_flag_spec='-L$libdir'
  339. ;;
  340. freebsd1*)
  341. ld_shlibs=no
  342. ;;
  343. freebsd2.2*)
  344. hardcode_libdir_flag_spec='-R$libdir'
  345. hardcode_direct=yes
  346. ;;
  347. freebsd2*)
  348. hardcode_direct=yes
  349. hardcode_minus_L=yes
  350. ;;
  351. freebsd* | kfreebsd*-gnu | dragonfly*)
  352. hardcode_libdir_flag_spec='-R$libdir'
  353. hardcode_direct=yes
  354. ;;
  355. hpux9*)
  356. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  357. hardcode_libdir_separator=:
  358. hardcode_direct=yes
  359. # hardcode_minus_L: Not really in the search PATH,
  360. # but as the default location of the library.
  361. hardcode_minus_L=yes
  362. ;;
  363. hpux10*)
  364. if test "$with_gnu_ld" = no; then
  365. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  366. hardcode_libdir_separator=:
  367. hardcode_direct=yes
  368. # hardcode_minus_L: Not really in the search PATH,
  369. # but as the default location of the library.
  370. hardcode_minus_L=yes
  371. fi
  372. ;;
  373. hpux11*)
  374. if test "$with_gnu_ld" = no; then
  375. hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  376. hardcode_libdir_separator=:
  377. case $host_cpu in
  378. hppa*64*|ia64*)
  379. hardcode_direct=no
  380. ;;
  381. *)
  382. hardcode_direct=yes
  383. # hardcode_minus_L: Not really in the search PATH,
  384. # but as the default location of the library.
  385. hardcode_minus_L=yes
  386. ;;
  387. esac
  388. fi
  389. ;;
  390. irix5* | irix6* | nonstopux*)
  391. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  392. hardcode_libdir_separator=:
  393. ;;
  394. netbsd*)
  395. hardcode_libdir_flag_spec='-R$libdir'
  396. hardcode_direct=yes
  397. ;;
  398. newsos6)
  399. hardcode_direct=yes
  400. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  401. hardcode_libdir_separator=:
  402. ;;
  403. openbsd*)
  404. hardcode_direct=yes
  405. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  406. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  407. else
  408. case "$host_os" in
  409. openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
  410. hardcode_libdir_flag_spec='-R$libdir'
  411. ;;
  412. *)
  413. hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
  414. ;;
  415. esac
  416. fi
  417. ;;
  418. os2*)
  419. hardcode_libdir_flag_spec='-L$libdir'
  420. hardcode_minus_L=yes
  421. ;;
  422. osf3*)
  423. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  424. hardcode_libdir_separator=:
  425. ;;
  426. osf4* | osf5*)
  427. if test "$GCC" = yes; then
  428. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  429. else
  430. # Both cc and cxx compiler support -rpath directly
  431. hardcode_libdir_flag_spec='-rpath $libdir'
  432. fi
  433. hardcode_libdir_separator=:
  434. ;;
  435. solaris*)
  436. hardcode_libdir_flag_spec='-R$libdir'
  437. ;;
  438. sunos4*)
  439. hardcode_libdir_flag_spec='-L$libdir'
  440. hardcode_direct=yes
  441. hardcode_minus_L=yes
  442. ;;
  443. sysv4)
  444. case $host_vendor in
  445. sni)
  446. hardcode_direct=yes # is this really true???
  447. ;;
  448. siemens)
  449. hardcode_direct=no
  450. ;;
  451. motorola)
  452. hardcode_direct=no #Motorola manual says yes, but my tests say they lie
  453. ;;
  454. esac
  455. ;;
  456. sysv4.3*)
  457. ;;
  458. sysv4*MP*)
  459. if test -d /usr/nec; then
  460. ld_shlibs=yes
  461. fi
  462. ;;
  463. sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
  464. ;;
  465. sysv5* | sco3.2v5* | sco5v6*)
  466. hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
  467. hardcode_libdir_separator=':'
  468. ;;
  469. uts4*)
  470. hardcode_libdir_flag_spec='-L$libdir'
  471. ;;
  472. *)
  473. ld_shlibs=no
  474. ;;
  475. esac
  476. fi
  477. # Check dynamic linker characteristics
  478. # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
  479. # Unlike libtool.m4, here we don't care about _all_ names of the library, but
  480. # only about the one the linker finds when passed -lNAME. This is the last
  481. # element of library_names_spec in libtool.m4, or possibly two of them if the
  482. # linker has special search rules.
  483. library_names_spec= # the last element of library_names_spec in libtool.m4
  484. libname_spec='lib$name'
  485. case "$host_os" in
  486. aix3*)
  487. library_names_spec='$libname.a'
  488. ;;
  489. aix4* | aix5*)
  490. library_names_spec='$libname$shrext'
  491. ;;
  492. amigaos*)
  493. library_names_spec='$libname.a'
  494. ;;
  495. beos*)
  496. library_names_spec='$libname$shrext'
  497. ;;
  498. bsdi[45]*)
  499. library_names_spec='$libname$shrext'
  500. ;;
  501. cygwin* | mingw* | pw32*)
  502. shrext=.dll
  503. library_names_spec='$libname.dll.a $libname.lib'
  504. ;;
  505. darwin* | rhapsody*)
  506. shrext=.dylib
  507. library_names_spec='$libname$shrext'
  508. ;;
  509. dgux*)
  510. library_names_spec='$libname$shrext'
  511. ;;
  512. freebsd1*)
  513. ;;
  514. kfreebsd*-gnu)
  515. library_names_spec='$libname$shrext'
  516. ;;
  517. freebsd* | dragonfly*)
  518. case "$host_os" in
  519. freebsd[123]*)
  520. library_names_spec='$libname$shrext$versuffix' ;;
  521. *)
  522. library_names_spec='$libname$shrext' ;;
  523. esac
  524. ;;
  525. gnu*)
  526. library_names_spec='$libname$shrext'
  527. ;;
  528. hpux9* | hpux10* | hpux11*)
  529. case $host_cpu in
  530. ia64*)
  531. shrext=.so
  532. ;;
  533. hppa*64*)
  534. shrext=.sl
  535. ;;
  536. *)
  537. shrext=.sl
  538. ;;
  539. esac
  540. library_names_spec='$libname$shrext'
  541. ;;
  542. interix3*)
  543. library_names_spec='$libname$shrext'
  544. ;;
  545. irix5* | irix6* | nonstopux*)
  546. library_names_spec='$libname$shrext'
  547. case "$host_os" in
  548. irix5* | nonstopux*)
  549. libsuff= shlibsuff=
  550. ;;
  551. *)
  552. case $LD in
  553. *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
  554. *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
  555. *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
  556. *) libsuff= shlibsuff= ;;
  557. esac
  558. ;;
  559. esac
  560. ;;
  561. linux*oldld* | linux*aout* | linux*coff*)
  562. ;;
  563. linux*)
  564. library_names_spec='$libname$shrext'
  565. ;;
  566. knetbsd*-gnu)
  567. library_names_spec='$libname$shrext'
  568. ;;
  569. netbsd*)
  570. library_names_spec='$libname$shrext'
  571. ;;
  572. newsos6)
  573. library_names_spec='$libname$shrext'
  574. ;;
  575. nto-qnx*)
  576. library_names_spec='$libname$shrext'
  577. ;;
  578. openbsd*)
  579. library_names_spec='$libname$shrext$versuffix'
  580. ;;
  581. os2*)
  582. libname_spec='$name'
  583. shrext=.dll
  584. library_names_spec='$libname.a'
  585. ;;
  586. osf3* | osf4* | osf5*)
  587. library_names_spec='$libname$shrext'
  588. ;;
  589. solaris*)
  590. library_names_spec='$libname$shrext'
  591. ;;
  592. sunos4*)
  593. library_names_spec='$libname$shrext$versuffix'
  594. ;;
  595. sysv4 | sysv4.3*)
  596. library_names_spec='$libname$shrext'
  597. ;;
  598. sysv4*MP*)
  599. library_names_spec='$libname$shrext'
  600. ;;
  601. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  602. library_names_spec='$libname$shrext'
  603. ;;
  604. uts4*)
  605. library_names_spec='$libname$shrext'
  606. ;;
  607. esac
  608. sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
  609. escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
  610. shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
  611. escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  612. escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  613. escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
  614. LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
  615. # How to pass a linker flag through the compiler.
  616. wl="$escaped_wl"
  617. # Static library suffix (normally "a").
  618. libext="$libext"
  619. # Shared library suffix (normally "so").
  620. shlibext="$shlibext"
  621. # Format of library name prefix.
  622. libname_spec="$escaped_libname_spec"
  623. # Library names that the linker finds when passed -lNAME.
  624. library_names_spec="$escaped_library_names_spec"
  625. # Flag to hardcode \$libdir into a binary during linking.
  626. # This must work even if \$libdir does not exist.
  627. hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
  628. # Whether we need a single -rpath flag with a separated argument.
  629. hardcode_libdir_separator="$hardcode_libdir_separator"
  630. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  631. # resulting binary.
  632. hardcode_direct="$hardcode_direct"
  633. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  634. # resulting binary.
  635. hardcode_minus_L="$hardcode_minus_L"
  636. EOF