1 | --- misc/shlib.orig Sun Jul 20 02:58:14 2003 |
---|
2 | +++ misc/shlib Mon Apr 4 06:08:47 2005 |
---|
3 | @@ -58,7 +58,16 @@ |
---|
4 | # Special cases: |
---|
5 | # |
---|
6 | # BeOS R4.5 uses $LIBRARY_PATH rather than $LD_LIBRARY_PATH. |
---|
7 | - |
---|
8 | +# Mac OS X uses $DYLD_LIBRARY_PATH |
---|
9 | +# |
---|
10 | +# Other cases not handled by this script: |
---|
11 | +# |
---|
12 | +# AIX uses $LIBPATH |
---|
13 | +# IRIX64 may use $LD_LIBRARY64_PATH or $LD_LIBRARYN32_PATH |
---|
14 | +# Solaris may use $LD_LIBRARY_PATH_64 |
---|
15 | +# |
---|
16 | +CDPATH= |
---|
17 | +# |
---|
18 | # |
---|
19 | # Make sure that we use the PATH that was set in run_tic.sh |
---|
20 | # |
---|
21 | @@ -67,6 +76,7 @@ |
---|
22 | export PATH |
---|
23 | fi |
---|
24 | |
---|
25 | +# Find the lib-directory for this build tree |
---|
26 | q="" |
---|
27 | for p in lib ../lib |
---|
28 | do |
---|
29 | @@ -74,21 +84,56 @@ |
---|
30 | q="$p" |
---|
31 | fi |
---|
32 | done |
---|
33 | + |
---|
34 | +# Set the environment variable. |
---|
35 | if test -n "$q" ; then |
---|
36 | - if test -n "$LD_LIBRARY_PATH"; then |
---|
37 | - LD_LIBRARY_PATH="$q:$LD_LIBRARY_PATH" |
---|
38 | + system= |
---|
39 | + if test -n "$SHLIB_HOST" ; then |
---|
40 | + system="$SHLIB_HOST" |
---|
41 | + elif test -n "$PATHEXT" ; then |
---|
42 | + system=cygwin |
---|
43 | elif test -n "$LIBRARY_PATH" ; then |
---|
44 | - LIBRARY_PATH="$q:$LIBRARY_PATH" |
---|
45 | + system=beos |
---|
46 | + elif test -n "$DYLD_LIBRARY_PATH" ; then |
---|
47 | + system=darwin |
---|
48 | + elif test -n "$LD_LIBRARY_PATH"; then |
---|
49 | + system=unix |
---|
50 | else |
---|
51 | - LD_LIBRARY_PATH="$q" |
---|
52 | + for r in $q/*.* |
---|
53 | + do |
---|
54 | + if test -f "$r" |
---|
55 | + then |
---|
56 | + case $r in |
---|
57 | + *.dll) |
---|
58 | + system=cygwin |
---|
59 | + ;; |
---|
60 | + *.dylib) |
---|
61 | + system=darwin |
---|
62 | + ;; |
---|
63 | + esac |
---|
64 | fi |
---|
65 | - export LD_LIBRARY_PATH |
---|
66 | + test -n "$system" && break |
---|
67 | + done |
---|
68 | fi |
---|
69 | |
---|
70 | -# cygwin doesn't use LD_LIBRARY_PATH, but does use PATH |
---|
71 | -if test -n "$PATHEXT" ; then |
---|
72 | - PATH=$LD_LIBRARY_PATH:$PATH; |
---|
73 | - export PATH |
---|
74 | + case .$system in |
---|
75 | + .cygwin*) |
---|
76 | + variable=PATH |
---|
77 | + ;; |
---|
78 | + .beos*) |
---|
79 | + variable=LIBRARY_PATH |
---|
80 | + ;; |
---|
81 | + .darwin*) |
---|
82 | + variable=DYLD_LIBRARY_PATH |
---|
83 | + ;; |
---|
84 | + *) |
---|
85 | + variable=LD_LIBRARY_PATH |
---|
86 | + ;; |
---|
87 | + esac |
---|
88 | + |
---|
89 | + eval 'test -z "$'$variable'" && '$variable'=":"' |
---|
90 | + eval $variable'="$q:$'$variable'"' |
---|
91 | + eval 'export '$variable |
---|
92 | fi |
---|
93 | |
---|
94 | eval "$*" |
---|