xref: /titanic_51/usr/src/lib/libast/common/features/libpath.sh (revision 3e14f97f673e8a630f076077de35afdd43dc1587)
1da2e3ebdSchin########################################################################
2da2e3ebdSchin#                                                                      #
3da2e3ebdSchin#               This software is part of the ast package               #
4*3e14f97fSRoger A. Faulkner#          Copyright (c) 1985-2010 AT&T Intellectual Property          #
5da2e3ebdSchin#                      and is licensed under the                       #
6da2e3ebdSchin#                  Common Public License, Version 1.0                  #
77c2fbfb3SApril Chin#                    by AT&T Intellectual Property                     #
8da2e3ebdSchin#                                                                      #
9da2e3ebdSchin#                A copy of the License is available at                 #
10da2e3ebdSchin#            http://www.opensource.org/licenses/cpl1.0.txt             #
11da2e3ebdSchin#         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         #
12da2e3ebdSchin#                                                                      #
13da2e3ebdSchin#              Information and Software Systems Research               #
14da2e3ebdSchin#                            AT&T Research                             #
15da2e3ebdSchin#                           Florham Park NJ                            #
16da2e3ebdSchin#                                                                      #
17da2e3ebdSchin#                 Glenn Fowler <gsf@research.att.com>                  #
18da2e3ebdSchin#                  David Korn <dgk@research.att.com>                   #
19da2e3ebdSchin#                   Phong Vo <kpv@research.att.com>                    #
20da2e3ebdSchin#                                                                      #
21da2e3ebdSchin########################################################################
22da2e3ebdSchinok=0
23da2e3ebdSchinfor i in \
24da2e3ebdSchin	-x /lib/ld.so /lib/ld-*.so /usr/lib/ld.so /lib/rld \
25da2e3ebdSchin	-f /usr/shlib/libc.so /shlib/libc.so /usr/lib/libc.so \
26da2e3ebdSchin	-r /usr/shlib/libc.so /shlib/libc.so
27da2e3ebdSchindo	case $i in
28da2e3ebdSchin	-*)	op=$i; continue ;;
29da2e3ebdSchin	esac
30da2e3ebdSchin	if	test $op $i
31da2e3ebdSchin	then	ok=1
32da2e3ebdSchin		break
33da2e3ebdSchin	fi
34da2e3ebdSchin	set x $i.[0-9]*
35da2e3ebdSchin	if	test $op $2
36da2e3ebdSchin	then	ok=1
37da2e3ebdSchin		break
38da2e3ebdSchin	fi
39da2e3ebdSchindone
40da2e3ebdSchinif	test "0" != "$ok"
41da2e3ebdSchinthen	libpath=lib:LD_LIBRARY_PATH
42da2e3ebdSchin	case `package` in
43da2e3ebdSchin	sgi.*)	if	test -d /lib32
44da2e3ebdSchin		then	libpath="lib32:LD_LIBRARYN32_PATH:sgi.mips3|sgi.*-n32,$libpath"
45da2e3ebdSchin		fi
46da2e3ebdSchin		if	test -d /lib64
47da2e3ebdSchin		then	libpath="lib64:LD_LIBRARY64_PATH:sgi.mips[4-9]|sgi.*-64,$libpath"
48da2e3ebdSchin		fi
49da2e3ebdSchin		;;
50da2e3ebdSchin	sol*.*) if	test -d /lib/32
51da2e3ebdSchin		then	libpath="lib/32:LD_LIBRARY_PATH_32,$libpath"
52da2e3ebdSchin		fi
53da2e3ebdSchin		if	test -d /lib/64
54da2e3ebdSchin		then	libpath="lib/64:LD_LIBRARY_PATH_64:sol.*64*,$libpath"
55da2e3ebdSchin		fi
56da2e3ebdSchin		;;
57da2e3ebdSchin	esac
58da2e3ebdSchinelif	test -x /lib/dld.sl
59da2e3ebdSchinthen	libpath=lib:SHLIB_PATH
60da2e3ebdSchinelif	test -x /usr/lib/dyld
61da2e3ebdSchinthen	libpath=lib:DYLD_LIBRARY_PATH
62da2e3ebdSchinelse	case `package` in
63da2e3ebdSchin	ibm.*|mvs.*)
64da2e3ebdSchin		libpath=lib:LIBPATH
65da2e3ebdSchin		;;
66da2e3ebdSchin	*)	libpath=
67da2e3ebdSchin		;;
68da2e3ebdSchin	esac
69da2e3ebdSchinfi
70da2e3ebdSchincase $libpath in
71da2e3ebdSchin'')	libpath=bin ;;
72da2e3ebdSchinesac
73da2e3ebdSchinecho "#define CONF_LIBPATH	\"$libpath\""
74