Mercurial > hg > mxe
view tools/make-shared-from-static @ 3066:4e8c0723e3d2
remove installed .la files for lcms1
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 28 Nov 2012 20:15:02 -0500 |
parents | 1c18d3bb1829 |
children |
line wrap: on
line source
#!/usr/bin/env bash set -e LD= AR= infile= outfile= LIBS= topdir=$(pwd) tmpdir=$topdir/make-shared-from-static.$$ trap "cd $topdir; rm -rf $tmpdir" 1 2 15 for arg do case "$1" in --ld) shift if [ $# -gt 0 ]; then LD="$1" shift else echo "make-shared-from-static: expecting argument for --ld option" 1>&2 exit 1 fi ;; --ar) shift if [ $# -gt 0 ]; then AR="$1" shift else echo "make-shared-from-static: expecting argument for --ar option" 1>&2 exit 1 fi ;; -l*) LIBS="$LIBS $1" shift ;; *.a) if [ -z "$infile" ]; then case "$1" in /*) infile="$1" ;; *) infile=$(pwd)/$1 ;; esac outfile=$(echo $infile | sed 's/\.a$/.dll/') shift else echo "make-shared-from-static: only one input file allowed" 1>&2 exit 1 fi ;; esac done if [ -z "$outfile" ]; then echo "make-shared-from-static: no output file specified" 1>&2 exit 1 fi mkdir $tmpdir ( cd $tmpdir $AR x $infile $LD -shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--out-implib=$outfile.a -o $outfile *.o $LIBS ) rm -rf $tmpdir