1 1.1 christos #! /bin/sh 2 1.1 christos # Output a system dependent set of variables, describing how to set the 3 1.1 christos # run time search path of shared libraries in an executable at run time. 4 1.1 christos # 5 1.1 christos # Copyright 1996-2005 Free Software Foundation, Inc. 6 1.1 christos # Taken from GNU libtool, 2003 7 1.1 christos # Originally by Gordon Matzigkeit <gord (at] gnu.ai.mit.edu>, 1996 8 1.1 christos # 9 1.1 christos # This program is free software; you can redistribute it and/or modify 10 1.1 christos # it under the terms of the GNU General Public License as published by 11 1.1 christos # the Free Software Foundation; either version 2 of the License, or 12 1.1 christos # (at your option) any later version. 13 1.1 christos # 14 1.1 christos # This program is distributed in the hope that it will be useful, but 15 1.1 christos # WITHOUT ANY WARRANTY; without even the implied warranty of 16 1.1 christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 1.1 christos # General Public License for more details. 18 1.1 christos # 19 1.1 christos # You should have received a copy of the GNU General Public License 20 1.1 christos # along with this program; if not, write to the Free Software Foundation, 21 1.1 christos # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 1.1 christos # 23 1.1 christos # As a special exception to the GNU General Public License, if you 24 1.1 christos # distribute this file as part of a program that contains a 25 1.1 christos # configuration script generated by Autoconf, you may include it under 26 1.1 christos # the same distribution terms that you use for the rest of that program. 27 1.1 christos # 28 1.1 christos # The first argument passed to this file is the canonical host specification, 29 1.1 christos # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM 30 1.1 christos # or 31 1.1 christos # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM 32 1.1 christos # The environment variable LD should be set by the caller. 33 1.1 christos # 34 1.1 christos # The set of defined variables is at the end of this script. 35 1.1 christos 36 1.1 christos host="$1" 37 1.1 christos host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 38 1.1 christos host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 39 1.1 christos host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 40 1.1 christos 41 1.1 christos shlibpath_var= 42 1.1 christos case $host_os in 43 1.1 christos aix3*) 44 1.1 christos shlibpath_var=LIBPATH 45 1.1 christos ;; 46 1.1 christos aix4* | aix5*) 47 1.1 christos if test "$host_cpu" = ia64; then 48 1.1 christos # AIX 5 supports IA64 49 1.1 christos shlibpath_var=LD_LIBRARY_PATH 50 1.1 christos else 51 1.1 christos shlibpath_var=LIBPATH 52 1.1 christos fi 53 1.1 christos ;; 54 1.1 christos beos*) 55 1.1 christos shlibpath_var=LIBRARY_PATH 56 1.1 christos ;; 57 1.1 christos bsdi4*) 58 1.1 christos shlibpath_var=LD_LIBRARY_PATH 59 1.1 christos ;; 60 1.1 christos cygwin* | mingw* | pw32*) 61 1.1 christos # FIXME: first we should search . and the directory the executable is in 62 1.1 christos shlibpath_var=PATH 63 1.1 christos ;; 64 1.1 christos darwin* | rhapsody*) 65 1.1 christos shlibpath_var=DYLD_LIBRARY_PATH 66 1.1 christos ;; 67 1.1 christos freebsd1*) 68 1.1 christos ;; 69 1.1 christos kfreebsd*-gnu) 70 1.1 christos shlibpath_var=LD_LIBRARY_PATH 71 1.1 christos ;; 72 1.1 christos freebsd*) 73 1.1 christos shlibpath_var=LD_LIBRARY_PATH 74 1.1 christos ;; 75 1.1 christos gnu*) 76 1.1 christos shlibpath_var=LD_LIBRARY_PATH 77 1.1 christos ;; 78 1.1 christos hpux9* | hpux10* | hpux11*) 79 1.1 christos shlibpath_var=SHLIB_PATH 80 1.1 christos ;; 81 1.1 christos irix5* | irix6* | nonstopux*) 82 1.1 christos case $host_os in 83 1.1 christos irix5* | nonstopux*) 84 1.1 christos shlibsuff= 85 1.1 christos ;; 86 1.1 christos *) 87 1.1 christos case $LD in # libtool.m4 will add one of these switches to LD 88 1.1 christos *-32|*"-32 ") shlibsuff= ;; 89 1.1 christos *-n32|*"-n32 ") shlibsuff=N32 ;; 90 1.1 christos *-64|*"-64 ") shlibsuff=64 ;; 91 1.1 christos *) shlibsuff= ;; 92 1.1 christos esac 93 1.1 christos ;; 94 1.1 christos esac 95 1.1 christos shlibpath_var=LD_LIBRARY${shlibsuff}_PATH 96 1.1 christos ;; 97 1.1 christos linux-gnu*) 98 1.1 christos shlibpath_var=LD_LIBRARY_PATH 99 1.1 christos ;; 100 1.1 christos knetbsd*-gnu) 101 1.1 christos shlibpath_var=LD_LIBRARY_PATH 102 1.1 christos ;; 103 1.1 christos netbsd*) 104 1.1 christos shlibpath_var=LD_LIBRARY_PATH 105 1.1 christos ;; 106 1.1 christos newsos6) 107 1.1 christos shlibpath_var=LD_LIBRARY_PATH 108 1.1 christos ;; 109 1.1 christos openbsd*) 110 1.1 christos shlibpath_var=LD_LIBRARY_PATH 111 1.1 christos ;; 112 1.1 christos os2*) 113 1.1 christos shlibpath_var=LIBPATH 114 1.1 christos ;; 115 1.1 christos osf3* | osf4* | osf5*) 116 1.1 christos shlibpath_var=LD_LIBRARY_PATH 117 1.1 christos ;; 118 1.1 christos sco3.2v5*) 119 1.1 christos shlibpath_var=LD_LIBRARY_PATH 120 1.1 christos ;; 121 1.1 christos solaris*) 122 1.1 christos shlibpath_var=LD_LIBRARY_PATH 123 1.1 christos ;; 124 1.1 christos sunos4*) 125 1.1 christos shlibpath_var=LD_LIBRARY_PATH 126 1.1 christos ;; 127 1.1 christos sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) 128 1.1 christos shlibpath_var=LD_LIBRARY_PATH 129 1.1 christos ;; 130 1.1 christos uts4*) 131 1.1 christos shlibpath_var=LD_LIBRARY_PATH 132 1.1 christos ;; 133 1.1 christos dgux*) 134 1.1 christos shlibpath_var=LD_LIBRARY_PATH 135 1.1 christos ;; 136 1.1 christos sysv4*MP*) 137 1.1 christos if test -d /usr/nec ;then 138 1.1 christos shlibpath_var=LD_LIBRARY_PATH 139 1.1 christos fi 140 1.1 christos ;; 141 1.1 christos esac 142 1.1 christos 143 1.1 christos LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF 144 1.1 christos 145 1.1 christos # This is the shared library path variable. 146 1.1 christos shlibpath_var=$shlibpath_var 147 1.1 christos 148 1.1 christos EOF 149