3 # This script will automates the steps used to producing a win32 package
6 # It is used on a Fedora box with mingw32 cross compiler and wine to
9 # It will optionally package up VC++ version of wget if found in
14 # The following command lines were used to generate the external libraries
17 # Needed for libltdl support.
20 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
22 # yum install ming32-libpng mingw32-libpng-static
25 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
27 # yum install mingw32-wavpack
29 # cd ../wavpack-4.70.0
30 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
32 # yum install mingw32-flac
34 # Need to disable optional ogg support to prevent duplicate symbols during
36 # Edited Makefile and removed "examples" from SUBDIRS.
38 # mingw32-configure --disable-ogg --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
40 # yum install mingw32-libogg
43 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
45 # yum install mingw32-libvorbis
47 # cd ../libvorbis-1.3.4
48 # mingw32-configure --disable-shared --enable-static;mingw-32-make;sudo mingw32-make install
50 # FIXME: Install libsndfile
51 # Compile libsndfile after FLAC and ogg vorbis so that it will include
53 # MINGW work around: Can either add -lwsock32 to end of *_LDADD for any
54 # failed program links or modify top leve Makefile and remove
55 # "programs", "examples", "regtests", and "tests" from SUBDIRS.
56 # cd ../libsndfile-1.0.25
57 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
59 # yum install mingw32-libid3tag
61 # libid3tag does not like to be compiled shared on mingw32 cross compiler.
62 # cd ../libid3tag-0.15.1b
63 # mingw32-configure --disable-shared --enable-static;mingw32-make;sudo mingw32-make install
65 # To get MP3 header files used to enable MP3 support (no libraries used):
67 # yum install mingw32-libmad
69 # MINGW work around: Edit Makefile and remove -fforce-mem from CFLAGS
70 # cd ../libmad-0.15.1b
71 # mingw32-configure --enable-shared --disable-static;mingw32-make;sudo mingw32-make install
73 [ ! -x configure
] && autoreconf
-i
75 SYS_ROOT
="/usr/i686-w64-mingw32/sys-root"
76 CONFIGURE
=mingw32-configure
78 DOCS
="sox.pdf soxformat.pdf soxi.pdf"
79 TMP_SNDFILE_LIBS
="-lsndfile -lFLAC -lvorbisenc -lvorbisfile -lvorbis -logg"
80 STRIP
=i686-pc-mingw32-strip
82 # Some versions of autoconf (2.63?) seem to get easily confused about
83 # CPP variable. If you see warning messages about header files
84 # rejected by preprocessor then its most likely from that.
85 # Force the value of CPP=cpp works around that bug.
86 # static versions of libsndfile do not advertise when they have
87 # FLAC or ogg vorbis support. Need to force the link ourselves.
88 if [ $# -ne 0 -o ! -r Makefile
]; then
91 --enable-dl-lame --enable-dl-mad --enable-dl-amrnb --enable-dl-amrwb \
92 LDFLAGS
="-L/usr/local/lib" CPPFLAGS
=-I/usr
/local
/include \
93 SNDFILE_LIBS
="${TMP_SNDFILE_LIBS}" \
97 # Reduce total size of sox.exe by over half.
98 make -s all txt
$DOC_TARGETS ||
exit 1
100 ${STRIP} src
/.libs
/sox.exe
102 dir
=sox-
`grep Version: sox.pc | cut -d ' ' -f 2`
103 rm -rf $dir $dir-win32.
zip
106 for f
in ChangeLog LICENSE.GPL README README.win32
; do
111 binaries
=src
/.libs
/sox.exe
113 dlls
=`/usr/i686-w64-mingw32/bin/objdump -p src/.libs/libsox-3.dll | grep "DLL Name:" | sed "s|DLL Name: |${SYS_ROOT}/mingw/bin/|" | grep -v KERNEL32.dll | grep -v msvcrt.dll | grep -v USER32.dll | grep -v WINMM.DLL`
114 dlls
="$dlls src/.libs/libsox-3.dll"
115 dlls
="$dlls ${SYS_ROOT}/mingw/bin/libwinpthread-1.dll"
121 scripts
/batch-example.bat \
124 # Special case fixup for nsiswrapper. Rename libFLAC-8.dll to libflac-8.dll.
125 mv $dir/libFLAC-8.dll
$dir/libflac-8.dll
127 unix2dos
$dir/batch-example.bat
129 if test -r "../wget-1.11.4/wget.exe"; then
130 cp ..
/wget-1.11
.4/wget.exe
$dir
131 cp ..
/wget-1.11
.4/wget.ini
$dir
134 zip -r $dir-win32.
zip $dir
136 # Optionally, create windows installer if nsiswrapper exists.
137 if test -r "/usr/bin/nsiswrapper"; then
140 nsiswrapper
--run --name $dir --outfile ..
/${dir}-win32.exe
*.exe
*.dll
*.ini
*.txt
*.pdf
*.bat