Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Make a shared library. |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 4 | # This script should be useful for projects other than Mesa. |
| 5 | # Improvements/fixes are welcome. |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 6 | |
| 7 | |
Brian Paul | 56e0ee8 | 2006-04-13 15:17:50 +0000 | [diff] [blame] | 8 | # Copyright (C) 1999-2006 Brian Paul All Rights Reserved. |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 9 | # |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 10 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 11 | # copy of this software and associated documentation files (the "Software"), |
| 12 | # to deal in the Software without restriction, including without limitation |
| 13 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 14 | # and/or sell copies of the Software, and to permit persons to whom the |
| 15 | # Software is furnished to do so, subject to the following conditions: |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 16 | # |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 17 | # The above copyright notice and this permission notice shall be included |
| 18 | # in all copies or substantial portions of the Software. |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 19 | # |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 21 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 23 | # BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
| 24 | # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 25 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 26 | |
| 27 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 28 | # |
| 29 | # Option defaults |
| 30 | # |
| 31 | LIBNAME="" |
| 32 | MAJOR=1 |
| 33 | MINOR=0 |
Brian Paul | 6e450f2 | 2004-02-21 18:08:41 +0000 | [diff] [blame] | 34 | PATCH="" |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 35 | DEPS="" |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 36 | LINK="" |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 37 | LDFLAGS="" |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 38 | CPLUSPLUS=0 |
| 39 | STATIC=0 |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 40 | DLOPEN=0 |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 41 | INSTALLDIR="." |
| 42 | ARCH="auto" |
| 43 | ARCHOPT="" |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 44 | NOPREFIX=0 |
Brian Paul | 158a251 | 2004-10-16 15:10:45 +0000 | [diff] [blame] | 45 | EXPORTS="" |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 46 | ID="" |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 47 | |
| 48 | # |
| 49 | # Parse arguments |
| 50 | # |
| 51 | while true |
| 52 | do |
| 53 | case $1 in |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 54 | '-h' | '--help') |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 55 | echo 'Usage: mklib [options] objects' |
| 56 | echo 'Create a shared library from object files.' |
| 57 | echo ' -o LIBRARY specifies the name of the resulting library, without' |
| 58 | echo ' the leading "lib" or any suffix.' |
| 59 | echo ' (eg: "-o GL" might result in "libGL.so" being made)' |
| 60 | echo ' -major N specifies major version number (default is 1)' |
| 61 | echo ' -minor N specifies minor version number (default is 0)' |
| 62 | echo ' -patch N specifies patch version number (default is 0)' |
| 63 | echo ' -lLIBRARY specifies a dependency on LIBRARY' |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 64 | echo ' -LDIR search in DIR for library dependencies at build time' |
| 65 | echo ' -RDIR search in DIR for library dependencies at run time' |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 66 | echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' |
| 67 | echo ' Not observed on all systems at this time.' |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 68 | echo ' -ldflags OPT specify any additional linker flags in OPT' |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 69 | echo ' -cplusplus link with C++ runtime' |
| 70 | echo ' -static make a static library (default is dynamic/shared)' |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 71 | echo ' -dlopen make a shared library suitable for dynamic loading' |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 72 | echo ' -install DIR put resulting library file(s) in DIR' |
| 73 | echo ' -arch ARCH override using `uname` to determine host system' |
| 74 | echo ' -archopt OPT specify an extra achitecture-specific option OPT' |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 75 | echo ' -altopts OPTS alternate options to override all others' |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 76 | echo " -noprefix don't prefix library name with 'lib' nor add any suffix" |
| 77 | echo ' -exports FILE only export the symbols listed in FILE' |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 78 | echo ' -id NAME Sets the id of the dylib (Darwin)' |
Eric Anholt | f1a2613 | 2005-08-08 03:26:18 +0000 | [diff] [blame] | 79 | echo ' -h, --help display this information and exit' |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 80 | exit 1 |
| 81 | ;; |
| 82 | '-o') |
| 83 | shift 1; |
| 84 | LIBNAME=$1 |
| 85 | ;; |
| 86 | '-major') |
| 87 | shift 1; |
| 88 | MAJOR=$1 |
| 89 | ;; |
| 90 | '-minor') |
| 91 | shift 1; |
| 92 | MINOR=$1 |
| 93 | ;; |
| 94 | '-patch') |
| 95 | shift 1; |
| 96 | PATCH=$1 |
| 97 | ;; |
| 98 | '-linker') |
| 99 | shift 1; |
| 100 | LINK=$1 |
| 101 | ;; |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 102 | '-ldflags') |
| 103 | shift 1; |
| 104 | LDFLAGS=$1 |
| 105 | ;; |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 106 | -l*) |
| 107 | DEPS="$DEPS $1" |
| 108 | ;; |
| 109 | -L*) |
| 110 | DEPS="$DEPS $1" |
| 111 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 112 | -R*) |
| 113 | DEPS="$DEPS $1" |
| 114 | ;; |
Hasso Tepper | f9c8af3 | 2008-04-09 11:03:05 -0700 | [diff] [blame] | 115 | -Wl*) |
| 116 | DEPS="$DEPS $1" |
| 117 | ;; |
Brian | ed2fddc | 2007-05-08 14:03:04 -0600 | [diff] [blame] | 118 | -pthread) |
| 119 | # this is a special case (see bugzilla 10876) |
| 120 | DEPS="$DEPS $1" |
| 121 | ;; |
Eric Anholt | 1a413b4 | 2007-06-22 10:29:54 -0700 | [diff] [blame] | 122 | '-pthread') |
| 123 | DEPS="$DEPS -pthread" |
| 124 | ;; |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 125 | '-cplusplus') |
| 126 | CPLUSPLUS=1 |
| 127 | ;; |
| 128 | '-static') |
| 129 | STATIC=1 |
| 130 | ;; |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 131 | '-dlopen') |
| 132 | DLOPEN=1 |
| 133 | ;; |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 134 | '-install') |
| 135 | shift 1; |
| 136 | INSTALLDIR=$1 |
| 137 | ;; |
| 138 | '-arch') |
| 139 | shift 1; |
| 140 | ARCH=$1 |
| 141 | ;; |
| 142 | '-archopt') |
| 143 | shift 1; |
| 144 | ARCHOPT=$1 |
| 145 | ;; |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 146 | '-altopts') |
| 147 | shift 1; |
| 148 | ALTOPTS=$1 |
| 149 | ;; |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 150 | '-noprefix') |
| 151 | NOPREFIX=1 |
| 152 | ;; |
| 153 | '-exports') |
| 154 | shift 1; |
| 155 | EXPORTS=$1 |
| 156 | ;; |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 157 | '-id') |
| 158 | shift 1; |
| 159 | ID=$1 |
| 160 | ;; |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 161 | -*) |
| 162 | echo "mklib: Unknown option: " $1 ; |
| 163 | exit 1 |
| 164 | ;; |
| 165 | *) |
| 166 | # This should be the first object file, stop parsing |
| 167 | break |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 168 | esac |
| 169 | shift 1 |
| 170 | done |
| 171 | OBJECTS=$@ |
| 172 | |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 173 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 174 | if [ ${ARCH} = "auto" ] ; then |
| 175 | ARCH=`uname` |
| 176 | fi |
| 177 | |
| 178 | |
| 179 | # |
| 180 | # Error checking |
| 181 | # |
| 182 | if [ "x${LIBNAME}" = "x" ] ; then |
| 183 | echo "mklib: Error: no library name specified" |
| 184 | exit 1 |
| 185 | fi |
| 186 | if [ "x${OBJECTS}" = "x" ] ; then |
| 187 | echo "mklib: Error: no object files specified" |
| 188 | exit 1 |
| 189 | fi |
| 190 | |
| 191 | |
| 192 | # |
| 193 | # Debugging info |
| 194 | # |
| 195 | if [ ] ; then |
| 196 | echo "-----------------" |
| 197 | echo ARCH is $ARCH |
| 198 | echo LIBNAME is $LIBNAME |
| 199 | echo MAJOR is $MAJOR |
| 200 | echo MINOR is $MINOR |
| 201 | echo PATCH is $PATCH |
| 202 | echo DEPS are $DEPS |
Brian Paul | 158a251 | 2004-10-16 15:10:45 +0000 | [diff] [blame] | 203 | echo "EXPORTS in" $EXPORTS |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 204 | echo ID is $ID |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 205 | echo "-----------------" |
| 206 | fi |
| 207 | |
| 208 | |
| 209 | # |
| 210 | # OK, make the library now |
| 211 | # |
| 212 | case $ARCH in |
| 213 | |
Hasso Tepper | f9c8af3 | 2008-04-09 11:03:05 -0700 | [diff] [blame] | 214 | 'Linux' | 'OpenBSD' | 'DragonFly' | 'GNU' | GNU/*) |
Brian Paul | 158a251 | 2004-10-16 15:10:45 +0000 | [diff] [blame] | 215 | # we assume gcc |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 216 | |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 217 | if [ "x$LINK" = "x" ] ; then |
| 218 | # -linker was not specified so set default link command now |
| 219 | if [ $CPLUSPLUS = 1 ] ; then |
| 220 | LINK=g++ |
| 221 | else |
| 222 | LINK=gcc |
| 223 | fi |
Brian Paul | c498742 | 2004-10-16 15:02:16 +0000 | [diff] [blame] | 224 | fi |
| 225 | |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 226 | if [ $NOPREFIX = 1 ] ; then |
| 227 | # No "lib" or ".so" part |
| 228 | echo "mklib: Making" $ARCH "shared library: " ${LIBNAME} |
Michel Dänzer | fc7ddea | 2007-12-04 10:46:45 +0100 | [diff] [blame] | 229 | case $ARCH in 'Linux' | 'GNU' | GNU/*) |
| 230 | OPTS="-Xlinker -Bsymbolic -shared" |
| 231 | ;; |
| 232 | *) |
| 233 | OPTS="-shared" |
| 234 | ;; |
| 235 | esac |
Ian Romanick | aba4864 | 2005-08-08 23:22:46 +0000 | [diff] [blame] | 236 | |
| 237 | # Check if objects are 32-bit and we're running in 64-bit |
| 238 | # environment. If so, pass -m32 flag to linker. |
| 239 | set ${OBJECTS} |
| 240 | ABI32=`file $1 | grep 32-bit` |
| 241 | if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then |
| 242 | OPTS="-m32 ${OPTS}" |
| 243 | fi |
| 244 | |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 245 | if [ "${ALTOPTS}" ] ; then |
| 246 | OPTS=${ALTOPTS} |
| 247 | fi |
| 248 | |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 249 | rm -f ${LIBNAME} |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 250 | # make lib |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 251 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 252 | # finish up |
| 253 | FINAL_LIBS="${LIBNAME}" |
| 254 | elif [ $STATIC = 1 ] ; then |
Brian | 98abd1b | 2007-03-27 07:58:47 -0600 | [diff] [blame] | 255 | LIBNAME="lib${LIBNAME}.a" # prefix with "lib", suffix with ".a" |
| 256 | echo "mklib: Making" $ARCH "static library: " ${LIBNAME} |
Brian Paul | 56e0ee8 | 2006-04-13 15:17:50 +0000 | [diff] [blame] | 257 | LINK="ar" |
| 258 | OPTS="-ru" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 259 | if [ "${ALTOPTS}" ] ; then |
| 260 | OPTS=${ALTOPTS} |
| 261 | fi |
Brian | 98abd1b | 2007-03-27 07:58:47 -0600 | [diff] [blame] | 262 | rm -f ${LIBNAME} |
Brian Paul | 56e0ee8 | 2006-04-13 15:17:50 +0000 | [diff] [blame] | 263 | # make lib |
Brian | 98abd1b | 2007-03-27 07:58:47 -0600 | [diff] [blame] | 264 | ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} |
| 265 | ranlib ${LIBNAME} |
Brian Paul | 1c4b711 | 2003-10-10 17:58:38 +0000 | [diff] [blame] | 266 | # finish up |
Brian | 98abd1b | 2007-03-27 07:58:47 -0600 | [diff] [blame] | 267 | FINAL_LIBS=${LIBNAME} |
Brian Paul | 1c4b711 | 2003-10-10 17:58:38 +0000 | [diff] [blame] | 268 | else |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 269 | LIBNAME="lib${LIBNAME}" # prefix with "lib" |
Brian Paul | 5beff7c | 2006-04-19 14:03:04 +0000 | [diff] [blame] | 270 | case $ARCH in 'Linux' | 'GNU' | GNU/*) |
Brian Paul | 5b9a9d4 | 2004-01-17 18:31:12 +0000 | [diff] [blame] | 271 | OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" |
Brian Paul | 5beff7c | 2006-04-19 14:03:04 +0000 | [diff] [blame] | 272 | ;; |
| 273 | *) |
Brian Paul | 5b9a9d4 | 2004-01-17 18:31:12 +0000 | [diff] [blame] | 274 | OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" |
Brian Paul | 5beff7c | 2006-04-19 14:03:04 +0000 | [diff] [blame] | 275 | ;; |
| 276 | esac |
Brian Paul | 158a251 | 2004-10-16 15:10:45 +0000 | [diff] [blame] | 277 | if [ $EXPORTS ] ; then |
| 278 | #OPTS="${OPTS} -Xlinker --retain-symbols-file ${EXPORTS}" |
| 279 | # Make the 'exptmp' file for --version-script option |
Julien Cristau | f7eb0ce | 2008-07-13 17:13:32 +0200 | [diff] [blame] | 280 | echo "{" > exptmp |
Brian Paul | 158a251 | 2004-10-16 15:10:45 +0000 | [diff] [blame] | 281 | echo "global:" >> exptmp |
| 282 | sed 's/$/;/' ${EXPORTS} >> exptmp |
| 283 | echo "local:" >> exptmp |
| 284 | echo "*;" >> exptmp |
| 285 | echo "};" >> exptmp |
| 286 | OPTS="${OPTS} -Xlinker --version-script=exptmp" |
| 287 | # exptmp is removed below |
| 288 | fi |
Brian Paul | 3e19618 | 2005-03-03 01:38:13 +0000 | [diff] [blame] | 289 | |
| 290 | # Check if objects are 32-bit and we're running in 64-bit |
| 291 | # environment. If so, pass -m32 flag to linker. |
| 292 | set ${OBJECTS} |
| 293 | ABI32=`file $1 | grep 32-bit` |
| 294 | if [ "${ABI32}" -a `uname -m` = "x86_64" ] ; then |
| 295 | OPTS="-m32 ${OPTS}" |
| 296 | fi |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 297 | if [ "${ALTOPTS}" ] ; then |
| 298 | OPTS=${ALTOPTS} |
| 299 | fi |
Brian Paul | 3e19618 | 2005-03-03 01:38:13 +0000 | [diff] [blame] | 300 | |
Brian Paul | 6e450f2 | 2004-02-21 18:08:41 +0000 | [diff] [blame] | 301 | if [ x${PATCH} = "x" ] ; then |
| 302 | VERSION="${MAJOR}.${MINOR}" |
| 303 | else |
| 304 | VERSION="${MAJOR}.${MINOR}.${PATCH}" |
| 305 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 306 | |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 307 | echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}.so.${VERSION} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 308 | |
Brian Paul | 1c4b711 | 2003-10-10 17:58:38 +0000 | [diff] [blame] | 309 | # rm any old libs |
| 310 | rm -f ${LIBNAME}.so.${VERSION} |
| 311 | rm -f ${LIBNAME}.so.${MAJOR} |
| 312 | rm -f ${LIBNAME}.so |
| 313 | |
| 314 | # make lib |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 315 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} |
Brian Paul | 1c4b711 | 2003-10-10 17:58:38 +0000 | [diff] [blame] | 316 | # make usual symlinks |
| 317 | ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} |
| 318 | ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so |
| 319 | # finish up |
| 320 | FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" |
Brian Paul | b17a1a1 | 2004-11-01 22:28:42 +0000 | [diff] [blame] | 321 | # rm -f exptmp |
Brian Paul | 1c4b711 | 2003-10-10 17:58:38 +0000 | [diff] [blame] | 322 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 323 | ;; |
| 324 | |
| 325 | 'SunOS') |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 326 | if [ $STATIC = 1 ] ; then |
| 327 | LIBNAME="lib${LIBNAME}.a" |
| 328 | echo "mklib: Making SunOS static library: " ${LIBNAME} |
| 329 | rm -f ${LIBNAME} |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 330 | ar -ruv ${LIBNAME} ${OBJECTS} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 331 | FINAL_LIBS=${LIBNAME} |
| 332 | else |
Brian Paul | 0a3a1c6 | 2006-11-10 12:47:56 +0000 | [diff] [blame] | 333 | if [ $NOPREFIX = 0 ] ; then |
| 334 | LIBNAME="lib${LIBNAME}.so" |
| 335 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 336 | echo "mklib: Making SunOS shared library: " ${LIBNAME} |
Brian Paul | 59ebe1f | 2006-04-05 13:43:02 +0000 | [diff] [blame] | 337 | |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 338 | if [ "x$LINK" = "x" ] ; then |
| 339 | # -linker was not specified, choose default linker now |
| 340 | if [ $CPLUSPLUS = 1 ] ; then |
| 341 | # determine linker and options for C++ code |
| 342 | if [ `which c++` ] ; then |
| 343 | # use Sun c++ |
| 344 | LINK="c++" |
| 345 | elif [ `type g++` ] ; then |
| 346 | # use g++ |
| 347 | LINK="g++" |
| 348 | else |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 349 | echo "mklib: warning: can't find C++ compiler, trying CC." |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 350 | LINK="CC" |
| 351 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 352 | else |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 353 | # use native Sun linker for C code |
| 354 | LINK="ld" |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 355 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 356 | fi |
Brian Paul | 59ebe1f | 2006-04-05 13:43:02 +0000 | [diff] [blame] | 357 | |
| 358 | # linker options |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 359 | if [ ${LINK} = "ld" -o ${LINK} = "cc" -o ${LINK} = "CC" ] ; then |
| 360 | # SunOS tools, -G to make shared libs |
Brian Paul | 59ebe1f | 2006-04-05 13:43:02 +0000 | [diff] [blame] | 361 | OPTS="-G" |
| 362 | else |
| 363 | # gcc linker |
| 364 | # Check if objects are 32-bit and we're running in 64-bit |
| 365 | # environment. If so, pass -m32 flag to linker. |
| 366 | set ${OBJECTS} |
| 367 | ABI32=`file $1 | grep 32-bit` |
| 368 | if [ "${ABI32}" ] ; then |
| 369 | OPTS="-m32 -shared -Wl,-Bdynamic" |
| 370 | else |
| 371 | OPTS="-m64 -shared -Wl,-Bdynamic" |
| 372 | fi |
| 373 | fi |
| 374 | |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 375 | # Check if objects are SPARC v9 |
| 376 | # file says: ELF 64-bit MSB relocatable SPARCV9 Version 1 |
| 377 | set ${OBJECTS} |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 378 | if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then |
| 379 | SPARCV9=`file $1 | grep SPARCV9` |
| 380 | if [ "${SPARCV9}" ] ; then |
| 381 | OPTS="${OPTS} -xarch=v9" |
| 382 | fi |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 383 | fi |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 384 | if [ "${ALTOPTS}" ] ; then |
| 385 | OPTS=${ALTOPTS} |
| 386 | fi |
Brian Paul | 59ebe1f | 2006-04-05 13:43:02 +0000 | [diff] [blame] | 387 | # for debug: |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 388 | #echo "mklib: linker is" ${LINK} ${OPTS} |
Brian Paul | 0a3a1c6 | 2006-11-10 12:47:56 +0000 | [diff] [blame] | 389 | if [ $NOPREFIX = 1 ] ; then |
| 390 | rm -f ${LIBNAME} |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 391 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | 0a3a1c6 | 2006-11-10 12:47:56 +0000 | [diff] [blame] | 392 | else |
| 393 | rm -f ${LIBNAME}.${MAJOR} ${LIBNAME} |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 394 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS} |
Brian Paul | 0a3a1c6 | 2006-11-10 12:47:56 +0000 | [diff] [blame] | 395 | ln -s ${LIBNAME}.${MAJOR} ${LIBNAME} |
| 396 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 397 | FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}" |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 398 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 399 | ;; |
| 400 | |
| 401 | 'FreeBSD') |
Eric Anholt | b83435f | 2005-10-18 23:36:40 +0000 | [diff] [blame] | 402 | # we assume gcc |
| 403 | |
| 404 | if [ "x$LINK" = "x" ] ; then |
| 405 | # -linker was not specified so set default link command now |
| 406 | if [ $CPLUSPLUS = 1 ] ; then |
| 407 | LINK=g++ |
| 408 | else |
| 409 | LINK=gcc |
| 410 | fi |
| 411 | fi |
| 412 | |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 413 | if [ $NOPREFIX = 1 ] ; then |
| 414 | # No "lib" or ".so" part |
| 415 | echo "mklib: Making FreeBSD shared library: " ${LIBNAME} |
Eric Anholt | b83435f | 2005-10-18 23:36:40 +0000 | [diff] [blame] | 416 | OPTS="-shared" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 417 | if [ "${ALTOPTS}" ] ; then |
| 418 | OPTS=${ALTOPTS} |
| 419 | fi |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 420 | rm -f ${LIBNAME} |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 421 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | dd74e36 | 2004-04-08 22:26:22 +0000 | [diff] [blame] | 422 | FINAL_LIBS=${LIBNAME} |
| 423 | elif [ $STATIC = 1 ] ; then |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 424 | STLIB="lib${LIBNAME}.a" |
| 425 | echo "mklib: Making FreeBSD static library: " ${STLIB} |
| 426 | rm -f ${STLIB} |
| 427 | ar cq ${STLIB} ${OBJECTS} |
| 428 | ranlib ${STLIB} |
| 429 | FINAL_LIBS=${STLIB} |
| 430 | else |
Eric Anholt | b83435f | 2005-10-18 23:36:40 +0000 | [diff] [blame] | 431 | SHLIB="lib${LIBNAME}.so.${MAJOR}" |
| 432 | OPTS="-shared -Wl,-soname,${SHLIB}" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 433 | if [ "${ALTOPTS}" ] ; then |
| 434 | OPTS=${ALTOPTS} |
| 435 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 436 | echo "mklib: Making FreeBSD shared library: " ${SHLIB} |
| 437 | rm -f ${SHLIB} |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 438 | ${LINK} ${OPTS} ${LDFLAGS} -o ${SHLIB} ${OBJECTS} ${DEPS} |
Eric Anholt | 1c04be5 | 2005-10-22 01:41:40 +0000 | [diff] [blame] | 439 | ln -sf ${SHLIB} "lib${LIBNAME}.so" |
| 440 | FINAL_LIBS="${SHLIB} lib${LIBNAME}.so" |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 441 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 442 | ;; |
| 443 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 444 | 'NetBSD') |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 445 | if [ $STATIC = 1 ] ; then |
| 446 | LIBNAME="lib${LIBNAME}_pic.a" |
| 447 | echo "mklib: Making NetBSD PIC static library: " ${LIBNAME} |
| 448 | rm -f ${LIBNAME} |
| 449 | ar cq ${LIBNAME} ${OBJECTS} |
| 450 | ranlib ${LIBNAME} |
| 451 | FINAL_LIBS=${LIBNAME} |
| 452 | else |
| 453 | LIBNAME="lib${LIBNAME}.so.${MAJOR}.${MINOR}" |
| 454 | echo "mklib: Making NetBSD PIC shared library: " ${LIBNAME} |
| 455 | rm -f ${LIBNAME} |
| 456 | ld -x -Bshareable -Bforcearchive -o ${LIBNAME} ${OBJECTS} |
| 457 | FINAL_LIBS=${LIBNAME} |
| 458 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 459 | ;; |
| 460 | |
Brian Paul | f8c31fc | 2004-01-29 15:21:47 +0000 | [diff] [blame] | 461 | 'IRIX' | 'IRIX64') |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 462 | if [ $STATIC = 1 ] ; then |
| 463 | LIBNAME="lib${LIBNAME}.a" |
| 464 | rm -f ${LIBNAME} |
| 465 | ar rc ${LIBNAME} ${OBJECTS} |
| 466 | FINAL_LIBS=${LIBNAME} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 467 | else |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 468 | LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 469 | |
| 470 | # examine first object to determine ABI |
| 471 | set ${OBJECTS} |
| 472 | ABI_O32=`file $1 | grep 'ELF 32-bit'` |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 473 | ABI_N32=`file $1 | grep 'ELF N32'` |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 474 | ABI_N64=`file $1 | grep 'ELF 64-bit'` |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 475 | if [ "${ABI_O32}" ] ; then |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 476 | OPTS="-32 -shared -all" |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 477 | ABI="o32-bit" |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 478 | elif [ "${ABI_N32}" ] ; then |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 479 | OPTS="-n32 -shared -all" |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 480 | ABI="n32-bit" |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 481 | elif [ "${ABI_N64}" ] ; then |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 482 | OPTS="-64 -shared -all" |
| 483 | ABI="64-bit" |
| 484 | else |
| 485 | echo "Error: Unexpected IRIX ABI!" |
| 486 | exit 1 |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 487 | fi |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 488 | |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 489 | if [ "${ALTOPTS}" ] ; then |
| 490 | OPTS=${ALTOPTS} |
| 491 | fi |
| 492 | |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 493 | if [ $CPLUSPLUS = 1 ] ; then |
| 494 | LINK="CC" |
| 495 | else |
| 496 | LINK="ld" |
| 497 | fi |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 498 | |
| 499 | echo "mklib: Making IRIX " ${ABI} " shared library: " ${LIBNAME} |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 500 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 501 | FINAL_LIBS=${LIBNAME} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 502 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 503 | ;; |
| 504 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 505 | 'linux-cygwin') |
| 506 | LIBNAME="lib${LIBNAME}.a" |
| 507 | echo "mklib: Making linux-cygwin library: " ${LIBNAME} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 508 | rm -f ${LIBNAME} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 509 | gnuwin32ar ruv ${LIBNAME} ${OBJECTS} |
| 510 | FINAL_LIBS=${LIBNAME} |
| 511 | ;; |
| 512 | |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 513 | 'HP-UX') |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 514 | if [ $STATIC = 1 ] ; then |
| 515 | LIBNAME="lib${LIBNAME}.a" |
Brian Paul | 52fb07e | 2004-03-30 14:47:02 +0000 | [diff] [blame] | 516 | echo "mklib: Making HP-UX static library: " ${LIBNAME} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 517 | rm -f ${LIBNAME} |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 518 | ar -ruv ${LIBNAME} ${OBJECTS} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 519 | FINAL_LIBS=${LIBNAME} |
| 520 | else |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 521 | # HP uses a .2 for their current GL/GLU libraries |
| 522 | if [ ${LIBNAME} = "GL" -o ${LIBNAME} = "GLU" ] ; then |
| 523 | MAJOR=2 |
| 524 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 525 | RUNLIB="lib${LIBNAME}.${MAJOR}" |
| 526 | DEVLIB="lib${LIBNAME}.sl" |
Brian Paul | 52fb07e | 2004-03-30 14:47:02 +0000 | [diff] [blame] | 527 | echo "mklib: Making HP-UX shared library: " ${RUNLIB} ${DEVLIB} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 528 | ld -b -o ${RUNLIB} +b ${RUNLIB} ${OBJECTS} ${DEPS} |
| 529 | ln -s ${RUNLIB} ${DEVLIB} |
Brian Paul | ac0cfee | 2004-04-25 15:13:56 +0000 | [diff] [blame] | 530 | FINAL_LIBS="${RUNLIB} ${DEVLIB}" |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 531 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 532 | ;; |
| 533 | |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 534 | 'AIX' ) |
| 535 | # examine first object to determine ABI |
| 536 | set ${OBJECTS} |
| 537 | ABI_64=`file $1 | grep '64-bit'` |
| 538 | if [ "${ABI_64}" ] ; then |
Brian Paul | b17a1a1 | 2004-11-01 22:28:42 +0000 | [diff] [blame] | 539 | X64="-X64" |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 540 | Q64="-q64" |
| 541 | OFILE=shr_64.o |
| 542 | else |
| 543 | OFILE=shr.o #Want to be consistent with the IBM libGL.a |
Brian Paul | b17a1a1 | 2004-11-01 22:28:42 +0000 | [diff] [blame] | 544 | fi |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 545 | |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 546 | if [ $STATIC = 1 ] ; then |
| 547 | LIBNAME="lib${LIBNAME}.a" |
| 548 | echo "mklib: Making AIX static library: " ${LIBNAME} |
| 549 | ar -ruv ${X64} ${LIBNAME} ${OBJECTS} |
| 550 | FINAL_LIBS=${LIBNAME} |
| 551 | else |
Karl Schultz | a16bdb5 | 2004-10-01 13:33:26 +0000 | [diff] [blame] | 552 | EXPFILE="lib${LIBNAME}.exp" |
Karl Schultz | a16bdb5 | 2004-10-01 13:33:26 +0000 | [diff] [blame] | 553 | LIBNAME="lib${LIBNAME}.a" # shared objects are still stored in the .a libraries |
Brian Paul | b3282a3 | 2006-04-18 12:56:11 +0000 | [diff] [blame] | 554 | OPTS="-bE:${EXPFILE} -bM:SRE -bnoentry ${Q64}" |
Karl Schultz | a16bdb5 | 2004-10-01 13:33:26 +0000 | [diff] [blame] | 555 | rm -f ${EXPFILE} ${OFILE} |
Brian Paul | b17a1a1 | 2004-11-01 22:28:42 +0000 | [diff] [blame] | 556 | NM="/bin/nm -eC ${X64}" |
Karl Schultz | a16bdb5 | 2004-10-01 13:33:26 +0000 | [diff] [blame] | 557 | echo "#! /usr/lib/${LIBNAME}" > ${EXPFILE} |
| 558 | ${NM} ${OBJECTS} | awk '{ |
| 559 | if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \ |
| 560 | && ( substr($1,1,1) != ".")) { |
| 561 | if (substr ($1, 1, 7) != "__sinit" && |
| 562 | substr ($1, 1, 7) != "__sterm") { |
| 563 | if (substr ($1, 1, 5) == "__tf1") |
| 564 | print (substr ($1, 7)) |
| 565 | else if (substr ($1, 1, 5) == "__tf9") |
| 566 | print (substr ($1, 15)) |
| 567 | else |
| 568 | print $1 |
| 569 | } |
| 570 | } |
| 571 | }' | sort -u >> ${EXPFILE} |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 572 | |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 573 | if [ "${ALTOPTS}" ] ; then |
| 574 | OPTS=${ALTOPTS} |
| 575 | fi |
| 576 | |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 577 | # On AIX a shared library is linked differently when |
| 578 | # you want to dlopen the file |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 579 | if [ $DLOPEN = "1" ] ; then |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 580 | cc -G ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 581 | else |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 582 | cc ${OPTS} ${LDFLAGS} -o ${OFILE} ${OBJECTS} ${DEPS} |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 583 | ar ${X64} -r ${LIBNAME} ${OFILE} |
| 584 | fi |
Brian Paul | 56e0ee8 | 2006-04-13 15:17:50 +0000 | [diff] [blame] | 585 | |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 586 | FINAL_LIBS="${LIBNAME}" |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 587 | fi |
| 588 | ;; |
| 589 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 590 | 'OpenSTEP') |
| 591 | LIBNAME="lib${LIBNAME}.a" |
| 592 | echo "mklib: Making OpenSTEP static library: " ${LIBNAME} |
| 593 | libtool -static -o ${LIBNAME} - ${OBJECTS} |
| 594 | FINAL_LIBS=${LIBNAME} |
| 595 | ;; |
| 596 | |
| 597 | 'OSF1') |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 598 | if [ $STATIC = 1 ] ; then |
| 599 | LIBNAME="lib${LIBNAME}.a" |
| 600 | echo "mklib: Making OSF/1 static library: " ${LIBNAME} |
| 601 | rm -f ${LIBNAME} |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 602 | ar -ruv ${LIBNAME} ${OBJECTS} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 603 | FINAL_LIBS=${LIBNAME} |
| 604 | else |
| 605 | VERSION="${MAJOR}.${MINOR}" |
| 606 | LIBNAME="lib${LIBNAME}.so" |
| 607 | echo "mklib: Making OSF/1 shared library: " ${LIBNAME} |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 608 | if [ "x$LINK" = "x" ] ; then |
| 609 | if [ $CPLUSPLUS = 1 ] ; then |
| 610 | LINK=cxx |
| 611 | else |
| 612 | LINK=cc |
| 613 | fi |
Brian Paul | 0d5e6cc | 2004-11-29 17:23:12 +0000 | [diff] [blame] | 614 | fi |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 615 | rm -f ${LIBNAME}.${VERSION} |
Brian Paul | 0d5e6cc | 2004-11-29 17:23:12 +0000 | [diff] [blame] | 616 | ${LINK} -o ${LIBNAME}.${VERSION} -shared -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} ${DEPS} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 617 | ln -sf ${LIBNAME}.${VERSION} ${LIBNAME} |
| 618 | FINAL_LIBS="${LIBNAME} ${LIBNAME}.${VERSION}" |
| 619 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 620 | ;; |
| 621 | |
| 622 | 'Darwin') |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 623 | if [ $STATIC = 1 ] ; then |
| 624 | LIBNAME="lib${LIBNAME}.a" |
| 625 | echo "mklib: Making Darwin static library: " ${LIBNAME} |
| 626 | LINK="ar" |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 627 | OPTS="-ruvs" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 628 | if [ "${ALTOPTS}" ] ; then |
| 629 | OPTS=${ALTOPTS} |
| 630 | fi |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 631 | ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} |
| 632 | FINAL_LIBS=${LIBNAME} |
| 633 | else |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 634 | # On Darwin a .bundle is used for a library that you want to dlopen |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 635 | if [ $DLOPEN = "1" ] ; then |
| 636 | LIBSUFFIX="bundle" |
| 637 | OPTS="${ARCHOPT} -bundle -multiply_defined suppress" |
| 638 | else |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 639 | LIBSUFFIX="dylib" |
| 640 | if [ -z "$ID" ] ; then |
| 641 | ID="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" |
| 642 | fi |
| 643 | OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name ${ID}" |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 644 | fi |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 645 | |
| 646 | if [ ${EXPORTS} ] ; then |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 647 | if [ -f ${EXPORTS}".darwin" ] ; then |
| 648 | EXPORTS=$EXPORTS".darwin" |
| 649 | fi |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 650 | OPTS="${OPTS} -exported_symbols_list ${EXPORTS}" |
Jeremy Huddleston | ac0d196 | 2008-08-11 09:17:06 -0700 | [diff] [blame^] | 651 | fi |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 652 | |
| 653 | LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}" |
| 654 | LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}" |
| 655 | LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}" |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 656 | |
| 657 | # examine first object to determine ABI |
| 658 | set ${OBJECTS} |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 659 | ABI_PPC=`file $1 | grep ' ppc'` |
| 660 | ABI_I386=`file $1 | grep ' i386'` |
| 661 | ABI_PPC64=`file $1 | grep ' ppc64'` |
| 662 | ABI_X86_64=`file $1 | grep ' x86_64'` |
| 663 | if [ "${ABI_PPC}" ] ; then |
| 664 | OPTS="${OPTS} -arch ppc" |
| 665 | fi |
| 666 | if [ "${ABI_I386}" ] ; then |
| 667 | OPTS="${OPTS} -arch i386" |
| 668 | fi |
| 669 | if [ "${ABI_PPC64}" ] ; then |
| 670 | OPTS="${OPTS} -arch ppc64" |
| 671 | fi |
| 672 | if [ "${ABI_X86_64}" ] ; then |
| 673 | OPTS="${OPTS} -arch x86_64" |
| 674 | fi |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 675 | |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 676 | if [ "${ALTOPTS}" ] ; then |
| 677 | OPTS=${ALTOPTS} |
| 678 | fi |
| 679 | |
Brian Paul | 1e1af99 | 2006-04-14 14:14:51 +0000 | [diff] [blame] | 680 | # XXX can we always add -isysroot /Developer/SDKs/MacOSX10.4u.sdk |
| 681 | # to OPTS here? |
| 682 | |
| 683 | # determine linker |
Brian Paul | 56e0ee8 | 2006-04-13 15:17:50 +0000 | [diff] [blame] | 684 | if [ $CPLUSPLUS = 1 ] ; then |
| 685 | LINK="g++" |
| 686 | else |
| 687 | LINK="cc" |
| 688 | fi |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 689 | |
Brian Paul | c50d77a | 2004-04-13 17:35:17 +0000 | [diff] [blame] | 690 | echo "mklib: Making Darwin shared library: " ${LIBNAME} |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 691 | |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 692 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 693 | ln -s ${LIBNAME} ${LINKNAME} |
Jeremy Huddleston | 9993ccc | 2008-02-19 00:54:35 -0800 | [diff] [blame] | 694 | ln -s ${LIBNAME} ${LINKNAME2} |
| 695 | FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}" |
Brian Paul | c193bd0 | 2004-03-18 15:41:59 +0000 | [diff] [blame] | 696 | fi |
| 697 | ;; |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 698 | |
| 699 | 'LynxOS') |
| 700 | LIBNAME="lib${LIBNAME}.a" |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 701 | echo "mklib: Making LynxOS static library: " ${LIBNAME} |
| 702 | rm -f ${LIBNAME} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 703 | ar ru ${LIBNAME} ${OBJECTS} |
| 704 | FINAL_LIBS=${LIBNAME} |
| 705 | ;; |
| 706 | |
| 707 | 'BeOS') |
Philippe Houdoin | ef4dd5a | 2004-08-14 10:12:38 +0000 | [diff] [blame] | 708 | if [ $STATIC = 1 ] ; then |
| 709 | LIBNAME="lib${LIBNAME}.a" |
| 710 | echo "mklib: Making BeOS static library: " ${LIBNAME} |
| 711 | ar -cru "${LIBNAME}" ${OBJECTS} |
| 712 | else |
Brian Paul | b784b8f | 2004-08-14 14:30:36 +0000 | [diff] [blame] | 713 | LIBNAME="lib${LIBNAME}.so" |
| 714 | echo "mklib: Making BeOS shared library: " ${LIBNAME} |
| 715 | gcc -nostart -Xlinker "-soname=${LIBNAME}" -L/Be/develop/lib/x86 -lbe ${DEPS} ${OBJECTS} -o "${LIBNAME}" |
| 716 | mimeset -f "${LIBNAME}" |
Brian Paul | 8dcc673 | 2005-07-25 22:59:58 +0000 | [diff] [blame] | 717 | # XXX remove the Mesa3D stuff here since mklib isn't mesa-specific. |
Brian Paul | b784b8f | 2004-08-14 14:30:36 +0000 | [diff] [blame] | 718 | setversion "${LIBNAME}" -app ${MAJOR} ${MINOR} ${PATCH} -short "Powered by Mesa3D!" -long "Powered by Mesa3D!" |
| 719 | fi |
| 720 | FINAL_LIBS=${LIBNAME} |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 721 | ;; |
| 722 | |
| 723 | 'QNX') |
| 724 | LIBNAME="lib${LIBNAME}.a" |
| 725 | echo "mklib: Making QNX library: " ${LIBNAME} |
| 726 | wlib ${LIBNAME} ${OBJECTS} |
| 727 | FINAL_LIBS=${LIBNAME} |
| 728 | ;; |
| 729 | |
Brian Paul | 65e2ab3 | 2003-10-27 18:13:37 +0000 | [diff] [blame] | 730 | 'MorphOS') |
| 731 | LIBNAME="lib${LIBNAME}.a" |
| 732 | echo "mklib: Making MorphOS library: " ${LIBNAME} |
| 733 | ppc-morphos-ar rc ${LIBNAME} ${OBJECTS} |
| 734 | FINAL_LIBS="${LIBNAME}" |
| 735 | ;; |
| 736 | |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 737 | 'icc' | 'icc-istatic') |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 738 | # Intel C compiler |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 739 | # This should get merged into the Linux code, above, since this isn't |
| 740 | # really a different architecture. |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 741 | LIBNAME="lib${LIBNAME}" # prefix with "lib" |
| 742 | |
| 743 | if [ $STATIC = 1 ] ; then |
| 744 | echo "mklib: Making Intel ICC static library: " ${LIBNAME}.a |
| 745 | LINK="ar" |
| 746 | OPTS="-ruv" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 747 | if [ "${ALTOPTS}" ] ; then |
| 748 | OPTS=${ALTOPTS} |
| 749 | fi |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 750 | # make lib |
| 751 | ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} |
| 752 | # finish up |
| 753 | FINAL_LIBS="${LIBNAME}.a" |
| 754 | else |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 755 | if [ $ARCH = icc-istatic ] ; then |
| 756 | OPTS="-shared -i-static -cxxlib-icc" |
| 757 | else |
| 758 | OPTS="-shared" |
| 759 | fi |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 760 | if [ "${ALTOPTS}" ] ; then |
| 761 | OPTS=${ALTOPTS} |
| 762 | fi |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 763 | VERSION="${MAJOR}.${MINOR}.${PATCH}" |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 764 | echo "mklib: Making Intel ICC shared library: " ${LIBNAME}.so.${VERSION} |
| 765 | |
| 766 | if [ $CPLUSPLUS = 1 ] ; then |
Brian Paul | fe14cf6 | 2006-04-13 02:23:25 +0000 | [diff] [blame] | 767 | LINK="icpc" |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 768 | else |
| 769 | LINK="icc" |
| 770 | fi |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 771 | # rm any old libs |
| 772 | rm -f ${LIBNAME}.so.${VERSION} |
| 773 | rm -f ${LIBNAME}.so.${MAJOR} |
| 774 | rm -f ${LIBNAME}.so |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 775 | # make lib |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 776 | ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.so.${VERSION} ${OBJECTS} ${DEPS} |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 777 | # make usual symlinks |
| 778 | ln -s ${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} |
| 779 | ln -s ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so |
| 780 | # finish up |
| 781 | FINAL_LIBS="${LIBNAME}.so.${VERSION} ${LIBNAME}.so.${MAJOR} ${LIBNAME}.so" |
| 782 | fi |
| 783 | ;; |
| 784 | |
Brian Paul | 12d6cae | 2004-01-10 22:12:21 +0000 | [diff] [blame] | 785 | 'aix-gcc') |
| 786 | # AIX with gcc |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 787 | if [ $STATIC = 1 ] ; then |
| 788 | LIBNAME="lib${LIBNAME}.a" |
| 789 | echo "mklib: Making AIX GCC static library: " ${LIBNAME} |
| 790 | rm -f ${LIBNAME} |
| 791 | ar ru ${LIBNAME} ${OBJECTS} |
| 792 | FINAL_LIBS=${LIBNAME} |
| 793 | else |
| 794 | LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" |
| 795 | echo "mklib: Making AIX GCC shared library: " ${LIBNAME} |
| 796 | # remove old lib |
| 797 | rm -f ${LIBNAME} |
| 798 | # make the lib |
| 799 | gcc -shared -Wl,-G ${OBJECTS} ${DEPS} -o ${LIBNAME} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 800 | # NOTE: the application linking with this library must specify |
| 801 | # the -Wl,-brtl flags to gcc |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 802 | FINAL_LIBS=${LIBNAME} |
| 803 | fi |
| 804 | ;; |
| 805 | |
| 806 | 'ultrix') |
| 807 | # XXX untested |
| 808 | if [ $STATIC = 0 ] ; then |
| 809 | echo "mklib: Warning shared libs not supported on Ultrix" |
| 810 | fi |
| 811 | LIBNAME="lib${LIBNAME}.a" |
| 812 | echo "mklib: Making static library for Ultrix: " ${LIBNAME} |
Brian Paul | 12d6cae | 2004-01-10 22:12:21 +0000 | [diff] [blame] | 813 | rm -f ${LIBNAME} |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 814 | ar ru ${LIBNAME} ${OBJECTS} |
| 815 | FINAL_LIBS="${LIBNAME}" |
Brian Paul | 12d6cae | 2004-01-10 22:12:21 +0000 | [diff] [blame] | 816 | ;; |
Brian Paul | b3b725b | 2003-12-15 16:14:55 +0000 | [diff] [blame] | 817 | |
Brian Paul | 580548d | 2004-04-22 16:16:42 +0000 | [diff] [blame] | 818 | CYGWIN*) |
| 819 | # GCC-based environment |
| 820 | CYGNAME="cyg${LIBNAME}" # prefix with "cyg" |
| 821 | LIBNAME="lib${LIBNAME}" # prefix with "lib" |
| 822 | |
| 823 | if [ $STATIC = 1 ] ; then |
| 824 | echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a |
| 825 | LINK="ar" |
| 826 | OPTS="-ru" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 827 | if [ "${ALTOPTS}" ] ; then |
| 828 | OPTS=${ALTOPTS} |
| 829 | fi |
Brian Paul | 580548d | 2004-04-22 16:16:42 +0000 | [diff] [blame] | 830 | # make lib |
| 831 | ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} |
| 832 | ranlib ${LIBNAME}.a |
| 833 | # finish up |
| 834 | FINAL_LIBS=${LIBNAME}.a |
| 835 | else |
| 836 | OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a" |
Andy Skinner | 5c0c883 | 2008-02-07 13:20:06 -0700 | [diff] [blame] | 837 | if [ "${ALTOPTS}" ] ; then |
| 838 | OPTS=${ALTOPTS} |
| 839 | fi |
Brian Paul | 580548d | 2004-04-22 16:16:42 +0000 | [diff] [blame] | 840 | echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll |
| 841 | |
| 842 | if [ $CPLUSPLUS = 1 ] ; then |
| 843 | LINK="g++" |
| 844 | else |
| 845 | LINK="gcc" |
| 846 | fi |
| 847 | |
| 848 | # rm any old libs |
| 849 | rm -f ${LIBNAME}-${MAJOR}.dll |
| 850 | rm -f ${LIBNAME}.dll.a |
| 851 | rm -f ${LIBNAME}.a |
| 852 | |
| 853 | # make lib |
Dan Nicholson | 2a3e338 | 2007-09-28 18:42:21 -0600 | [diff] [blame] | 854 | ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} |
Brian Paul | 580548d | 2004-04-22 16:16:42 +0000 | [diff] [blame] | 855 | # make usual symlinks |
| 856 | ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a |
| 857 | # finish up |
| 858 | FINAL_LIBS="${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a" |
| 859 | # special case for installing in bin |
| 860 | FINAL_BINS="${CYGNAME}-${MAJOR}.dll" |
| 861 | fi |
| 862 | ;; |
| 863 | |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 864 | 'example') |
| 865 | # If you're adding support for a new architecture, you can |
| 866 | # start with this: |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 867 | if [ $STATIC = 1 ] ; then |
| 868 | LIBNAME="lib${LIBNAME}.a" |
| 869 | echo "mklib: Making static library for example arch: " ${LIBNAME} |
| 870 | rm -f ${LIBNAME} |
| 871 | ar rv ${LIBNAME} ${OBJECTS} |
| 872 | FINAL_LIBS="${LIBNAME}" |
| 873 | else |
Brian Paul | 7c1ab40 | 2005-07-25 23:49:50 +0000 | [diff] [blame] | 874 | LIBNAME="lib${LIBNAME}.so" # prefix with "lib", suffix with ".so" |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 875 | echo "mklib: Making shared library for example arch: " ${LIBNAME} |
| 876 | ld -o ${LIBNAME} ${OBJECTS} ${DEPS} |
| 877 | FINAL_LIBS="${LIBNAME}" |
| 878 | fi |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 879 | ;; |
| 880 | |
| 881 | *) |
Brian Paul | 5396ab2 | 2004-02-12 14:48:52 +0000 | [diff] [blame] | 882 | echo "mklib: ERROR: Don't know how to make a static/shared library for" ${ARCH} |
| 883 | echo "mklib: Please add necessary commands to mklib script." |
Brian Paul | 8c20c7b | 2003-06-01 16:21:45 +0000 | [diff] [blame] | 884 | ;; |
| 885 | esac |
| 886 | |
| 887 | |
| 888 | # |
| 889 | # Put library files into installation directory if specified. |
| 890 | # |
| 891 | if [ ${INSTALLDIR} != "." ] ; then |
| 892 | echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR} |
| 893 | mv ${FINAL_LIBS} ${INSTALLDIR}/ |
| 894 | fi |