Mercurial > mxe-octave
annotate tools/make-shared-from-static @ 3645:75a1f1a468b9
qscintilla: update to 2.8.3
* src/qscintilla.mk: update to v2.8.3.
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sun, 06 Jul 2014 07:15:26 -0400 |
parents | 5f4998342dca |
children |
rev | line source |
---|---|
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 #!/usr/bin/env bash |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 set -e |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 LD= |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 AR= |
2997 | 7 INSTALL= |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 infile= |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 outfile= |
2997 | 10 libdir= |
11 bindir= | |
12 install=false | |
13 windowsdll=false | |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
14 msvc=false |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
15 msvclibmode=false |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
16 libprefix= |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
17 libsuffix= |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 LIBS= |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 topdir=$(pwd) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 tmpdir=$topdir/make-shared-from-static.$$ |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
2997 | 23 #trap "cd $topdir; rm -rf $tmpdir" 1 2 15 |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 for arg |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 do |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 case "$1" in |
2997 | 28 --install) |
29 install=true | |
30 shift | |
31 if [ $# -gt 0 ]; then | |
32 INSTALL="$1" | |
33 shift | |
34 else | |
35 echo "make-shared-from-static: expecting argument for --install option" 1>&2 | |
36 exit 1 | |
37 fi | |
38 ;; | |
39 --windowsdll) | |
40 shift | |
41 windowsdll=true | |
42 ;; | |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
43 --msvc) |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
44 shift |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
45 msvc=true |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
46 ;; |
2997 | 47 --bindir) |
48 shift | |
49 if [ $# -gt 0 ]; then | |
50 bindir="$1" | |
51 shift | |
52 else | |
53 echo "make-shared-from-static: expecting argument for --bindir option" 1>&2 | |
54 exit 1 | |
55 fi | |
56 ;; | |
57 --libdir) | |
58 shift | |
59 if [ $# -gt 0 ]; then | |
60 libdir="$1" | |
61 shift | |
62 else | |
63 echo "make-shared-from-static: expecting argument for --libdir option" 1>&2 | |
64 exit 1 | |
65 fi | |
66 ;; | |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 --ld) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 if [ $# -gt 0 ]; then |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 LD="$1" |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 else |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 echo "make-shared-from-static: expecting argument for --ld option" 1>&2 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 exit 1 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 fi |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 ;; |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 --ar) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 if [ $# -gt 0 ]; then |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 AR="$1" |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 else |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 echo "make-shared-from-static: expecting argument for --ar option" 1>&2 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 exit 1 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 fi |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 ;; |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
87 --libprefix) |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
88 shift |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
89 if [ $# -gt 0 ]; then |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
90 libprefix="$1" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
91 shift |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
92 else |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
93 echo "make-shared-from-static: expecting argument for --libprefix option" 1>&2 |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
94 exit 1 |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
95 fi |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
96 ;; |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
97 --libsuffix) |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
98 shift |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
99 if [ $# -gt 0 ]; then |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
100 libsuffix="$1" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
101 shift |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
102 else |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
103 echo "make-shared-from-static: expecting argument for --libsuffix option" 1>&2 |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
104 exit 1 |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
105 fi |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
106 ;; |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
107 -l*) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
108 LIBS="$LIBS $1" |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
109 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
110 ;; |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
111 *.a) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 if [ -z "$infile" ]; then |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
113 case "$1" in |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
114 /*) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 infile="$1" |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
116 ;; |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
117 *) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
118 infile=$(pwd)/$1 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
119 ;; |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
120 esac |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
121 shift |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
122 else |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
123 echo "make-shared-from-static: only one input file allowed" 1>&2 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
124 exit 1 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 fi |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
126 ;; |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
127 esac |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
128 done |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
129 |
2997 | 130 if [ -n "$infile" ]; then |
131 base_infile=$(basename $infile) | |
132 if $windowsdll; then | |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
133 if $msvc; then |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
134 base_name=`echo $base_infile | sed -n -e 's/^lib\(.*\)\.a$/\1/p'` |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
135 outfile="${libprefix}${base_name}${libsuffix}.dll" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
136 implibfile="$base_name.lib" |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
137 # Modern libtool won't create .a files, but will create directly .lib files. |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
138 # If the .a file does not exist, check for an existing .lib file. |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
139 if [ ! -f "$infile" ]; then |
3284
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
140 msvc_infiles="`echo $infile | sed -e 's/\.a$/.lib/'` \ |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
141 `dirname \"$infile\"`/`echo $base_infile | sed -e 's/\.a$/.lib/' -e 's/^lib//'`" |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
142 for msvc_infile in $msvc_infiles; do |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
143 if [ -f "$msvc_infile" ]; then |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
144 infile="$msvc_infile" |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
145 msvclibmode=true |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
146 break |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
147 fi |
5f4998342dca
* tools/make-shared-from-static: Look for libXXX.lib and XXX.lib in MSVC mode.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3073
diff
changeset
|
148 done |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
149 fi |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
150 else |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
151 outfile=$(echo $base_infile | sed 's/\.a$/.dll/') |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
152 implibfile="$outfile.a" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
153 fi |
2997 | 154 else |
155 outfile=$(echo $base_infile | sed 's/\.a$/.so/') | |
156 fi | |
157 else | |
158 echo "make-shared-from-static: no input file specified" 1>&2 | |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
159 exit 1 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
160 fi |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
162 NM=nm |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
163 SED=sed |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
164 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*_\\([_A-Za-z][_A-iZa-z0-9]*\\)\\{0,1\\}\$/\\1 _\\2 \\2/p' | sed '/ __gnu_lto/d'" |
3070
d89eccc2edd3
[MSVC] enable zlib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3062
diff
changeset
|
165 # Ignore DATA symbols for now. They should be be properly exported from |
d89eccc2edd3
[MSVC] enable zlib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3062
diff
changeset
|
166 # the source code using dllexport. They can't be re-exported manually like |
d89eccc2edd3
[MSVC] enable zlib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3062
diff
changeset
|
167 # this using MSVC. |
d89eccc2edd3
[MSVC] enable zlib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3062
diff
changeset
|
168 #export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/s/.*[ ]\\\\([^ ]*\\\\)/\\\\1,DATA/' | \$SED -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq >> \$export_symbols" |
d89eccc2edd3
[MSVC] enable zlib compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3062
diff
changeset
|
169 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED -e '/^[BCDGRS][ ]/d' | \$SED -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq >> \$export_symbols" |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
170 |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
171 mkdir $tmpdir |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
172 |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
173 ( |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
174 cd $tmpdir |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
175 |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
176 $msvclibmode || $AR x $infile |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
177 |
2997 | 178 LIBDIR_ARGS= |
179 if [ -n "$libdir" ]; then | |
180 LIBDIR_ARGS="-L$libdir" | |
181 fi | |
182 | |
183 if $windowsdll; then | |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
184 if $msvc; then |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
185 export_symbols="$base_name.def" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
186 echo EXPORTS > $export_symbols |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
187 if $msvclibmode; then |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
188 libobjs="$infile" |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
189 else |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
190 libobjs="*.o" |
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
191 fi |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
192 convenience= |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
193 eval cmd=\"$export_symbols_cmds\" |
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
194 eval "$cmd" |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
195 link_args="-Wl,-def:$export_symbols $libobjs" |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
196 else |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
197 link_args="-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base *.o" |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
198 fi |
3073
a46b4b6fc26f
[MSVC] enable ARPACK compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents:
3070
diff
changeset
|
199 $LD -shared $link_args -Wl,--out-implib="$implibfile" -o "$outfile" $LIBDIR_ARGS $LIBS |
2997 | 200 else |
201 $LD -shared -o $outfile *.o $LIBDIR_ARGS $LIBS | |
202 fi | |
203 | |
204 if $install; then | |
205 if $windowsdll; then | |
206 $INSTALL -d "$libdir" | |
207 $INSTALL -d "$bindir" | |
3062
4c047285ea8a
Make BLAS compilable with MSVC.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
2997
diff
changeset
|
208 $INSTALL -m755 "$implibfile" "$libdir/$implibfile" |
2997 | 209 $INSTALL -m755 "$outfile" "$bindir/$outfile" |
210 else | |
211 $INSTALL -d "$libdir" | |
212 $INSTALL -m755 "$outfile" "$libdir/$outfile" | |
213 fi | |
214 fi | |
2858
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
215 ) |
7c6b29399d05
New script to make shared libraries from static libraries. This
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
216 |
2868
1c18d3bb1829
Include suitesparse as a dependency of Octave
John W. Eaton <jwe@octave.org>
parents:
2858
diff
changeset
|
217 rm -rf $tmpdir |