3 # Copyright (C) 2006 Erik de Castro Lopo <erikd@mega-nerd.com>
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
17 # * Neither the author nor the names of any contributors may be used
18 # to endorse or promote products derived from this software without
19 # specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 if [ $# -lt 1 ] || [ $# -gt 2 ]; then
36 echo "Usage : Mingw-make-dist.sh <source tarball>."
41 if [ ! -f $TARGZ ]; then
42 echo "Can't find source tarball."
46 if [ ! -f $TARGZ.asc ]; then
47 echo "Can't find source tarball signature."
51 if [ x$UNAME != "xMINGW32_NT-5.1" ]; then
52 echo "Not able to build Win32 binaries on this platform."
55 echo "Building MinGW binary/source zip file."
57 VERSION=`pwd | sed -e "s#.*/##" | sed -e s/libsndfile-//`
58 BUILD=`echo $VERSION | sed -e "s/\./_/g"`
59 INSTALL="libsndfile-$BUILD"
60 ZIPNAME="$INSTALL.zip"
62 if [ -z "$BUILD" ]; then
63 echo "Bad BUILD variable : '$BUILD'"
67 if [ ! -d $INSTALL/ ]; then
71 if [ ! -f config.status ]; then
72 ./configure --prefix=`pwd`/$INSTALL/
74 teststr=`grep "with options" config.status | grep -- --prefix=`
75 if [ -z "$teststr" ]; then
76 # --disable-static doesn't work.
77 ./configure --prefix=`pwd`/$INSTALL/
81 if [ ! -f src/.libs/libsndfile-1.dll ]; then
85 if [ ! -f $INSTALL/bin/libsndfile-1.dll ]; then
87 rm -f $INSTALL/bin/sndfile-regtest.exe
88 strip $INSTALL/bin/*.*
89 mv $INSTALL/bin/*.* $INSTALL/include/*.* $INSTALL/
92 rmdir $INSTALL/include
93 cp src/libsndfile.def $INSTALL/
94 cp Win32/README-precompiled-dll.txt $INSTALL/
97 if [ ! -f $INSTALL/libsndfile-$VERSION.tar.gz ]; then
99 if [ -f $TARGZ.asc ]; then
100 cp $TARGZ.asc $INSTALL/
104 if [ ! -f $ZIPNAME ]; then
105 zip -r $ZIPNAME $INSTALL/
109 # Do not edit or modify anything in this comment block.
110 # The following line is a file identity tag for the GNU Arch
111 # revision control system.
113 # arch-tag: 3f82cd8a-f800-48d7-9646-2cdcf03c81a0