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