chiark / gitweb /
updated MinGW scripts
authorSteven G. Johnson <stevenj@alum.mit.edu>
Sat, 2 Nov 2013 19:04:28 +0000 (15:04 -0400)
committerSteven G. Johnson <stevenj@alum.mit.edu>
Sat, 2 Nov 2013 19:04:28 +0000 (15:04 -0400)
.gitignore
BUILD-MINGW32.sh [moved from BUILD-MINGW.sh with 62% similarity]
BUILD-MINGW64.sh

index a72addf2db67f58935d3e936fe2c88c0a990f5b0..3e75b31d4b0650b51b44e94009b40e024a67d017 100644 (file)
@@ -9,6 +9,7 @@
 *.dSYM
 *.mex*
 *.oct
+*.zip
 
 # generated code
 api/nlopt.f
@@ -21,6 +22,9 @@ swig/nlopt-python.cpp
 swig/nlopt.py
 swig/nlopt.scm
 swig/nlopt.scm.in
+README-WINDOWS
+mingw32
+mingw64
 
 # executables
 test/testopt
similarity index 62%
rename from BUILD-MINGW.sh
rename to BUILD-MINGW32.sh
index 142ee57165f22bcc6b5a243029d6e77b1957db68..1a3d18c45bd7eefeb58576477eba899b9d3cd81d 100755 (executable)
@@ -1,20 +1,25 @@
 #!/bin/sh
-set -e
+set -ev
 
-rm -rf mingw
+rm -rf mingw32
+make distclean || true
 
-./configure --prefix=`pwd`/mingw --host=i586-mingw32msvc --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile --without-threadlocal && make -j4 && make install
+echo "COMPILING..."
 
-cd mingw/bin
+./configure --prefix=`pwd`/mingw32 --host=i686-w64-mingw32 --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile --without-threadlocal && make -j4 && make install
+
+echo "POST-PROCESSING..."
+
+cd mingw32/bin
 for dll in *.dll; do
     def=`basename $dll .dll`.def
     echo "LIBRARY $dll" > $def
     echo EXPORTS >> $def
-    i586-mingw32msvc-nm $dll | grep ' T _' | sed 's/.* T _//' | egrep 'nlopt|nlo_' >> $def
+    i686-w64-mingw32-nm $dll | grep ' T _' | sed 's/.* T _//' | egrep 'nlopt|nlo_' >> $def
 done
 cd ../..
 
-perl -pi -e 's,^ * #define NLOPT_DLL,*/\n#define NLOPT_DLL\n/*,' mingw/include/nlopt.h
+perl -pi -e 's,^ * #define NLOPT_DLL,*/\n#define NLOPT_DLL\n/*,' mingw32/include/nlopt.h
 
 cat > README-WINDOWS <<EOF
 This .zip archive contains DLL libraries and the associated header (.h)
@@ -35,22 +40,22 @@ installed), do:
 
 They were compiled by the GNU C compiler for MinGW, specifically:
 EOF
-i586-mingw32msvc-gcc --version |head -1 >> README-WINDOWS
+i686-w64-mingw32-gcc --version |head -1 >> README-WINDOWS
 
-# grep -v "nlopt-util.h" octave/nlopt_minimize_constrained-mex.c > mingw/nlopt_minimize_constrained.c
+# grep -v "nlopt-util.h" octave/nlopt_minimize_constrained-mex.c > mingw32/nlopt_minimize_constrained.c
 
 nlopt_vers=`grep PACKAGE_VERSION config.h |cut -d" " -f3 |tr -d \"`
 
-mkdir mingw/matlab
+mkdir mingw32/matlab
 cd octave
-cp `grep 'MFILES =' Makefile.am | cut -d= -f2` ../mingw/matlab
-cp `grep 'm_DATA =' Makefile.am | cut -d\) -f2` ../mingw/matlab
-cp nlopt_optimize-mex.c ../mingw/matlab/nlopt_optimize.c
+cp `grep 'MFILES =' Makefile.am | cut -d= -f2` ../mingw32/matlab
+cp `grep 'm_DATA =' Makefile.am | cut -d\) -f2` ../mingw32/matlab
+cp nlopt_optimize-mex.c ../mingw32/matlab/nlopt_optimize.c
 cd ..
 
-mkdir mingw/python
-cp swig/nlopt.py swig/nlopt-python.cpp mingw/python
-cat > mingw/python/setup.py <<EOF
+mkdir mingw32/python
+cp swig/nlopt.py swig/nlopt-python.cpp mingw32/python
+cat > mingw32/python/setup.py <<EOF
 from distutils.core import setup, Extension
 nlopt_module = Extension('_nlopt',
                            sources=['nlopt-python.cpp'],
@@ -68,10 +73,12 @@ setup (name = 'nlopt',
 EOF
 
 nlopt_vers=`grep PACKAGE_VERSION config.h |cut -d" " -f3 |tr -d \"`
-zip=nlopt-${nlopt_vers}-dll.zip
+zip=nlopt-${nlopt_vers}-dll32.zip
 rm -f $zip
-zip -vj $zip mingw/bin/*.dll mingw/bin/*.exe
-zip -vjgl $zip mingw/bin/*.def mingw/include/* mingw/python/* README COPYING COPYRIGHT NEWS README-WINDOWS
+zip -vj $zip mingw32/bin/*.dll mingw32/bin/*.exe
+zip -vjgl $zip mingw32/bin/*.def mingw32/include/* mingw32/python/* README COPYING COPYRIGHT NEWS README-WINDOWS
+
+echo "PACKAGING $zip..."
 
 cd mingw
 zip -vgl ../$zip matlab/*
index c0ffc31a4a99f085f46705e3208d52ae18e87d88..62a47adbbf5079cc9103a5c9189f92077ff7a650 100755 (executable)
@@ -1,16 +1,21 @@
 #!/bin/sh
-set -e
+set -ev
 
 rm -rf mingw64
+make distclean || true
 
-./configure --prefix=`pwd`/mingw64 --host=amd64-mingw32msvc --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile --without-threadlocal && make -j4 && make install
+echo "COMPILING..."
+
+./configure --prefix=`pwd`/mingw64 --host=x86_64-w64-mingw32 --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile --without-threadlocal && make -j4 && make install
+
+echo "POST-PROCESSING..."
 
 cd mingw64/bin
 for dll in *.dll; do
     def=`basename $dll .dll`.def
     echo "LIBRARY $dll" > $def
     echo EXPORTS >> $def
-    amd64-mingw32msvc-nm $dll | grep ' T _' | sed 's/.* T _//' | egrep 'nlopt|nlo_' >> $def
+    x86_64-w64-mingw32-nm $dll | grep ' T ' | sed 's/.* T //' | egrep 'nlopt|nlo_' >> $def
 done
 cd ../..
 
@@ -35,7 +40,7 @@ installed), do:
 
 They were compiled by the GNU C compiler for MinGW, specifically:
 EOF
-amd64-mingw32msvc-gcc --version |head -1 >> README-WINDOWS
+x86_64-w64-mingw32-gcc --version |head -1 >> README-WINDOWS
 
 # grep -v "nlopt-util.h" octave/nlopt_minimize_constrained-mex.c > mingw64/nlopt_minimize_constrained.c
 
@@ -73,6 +78,8 @@ rm -f $zip
 zip -vj $zip mingw64/bin/*.dll mingw64/bin/*.exe
 zip -vjgl $zip mingw64/bin/*.def mingw64/include/* mingw64/python/* README COPYING COPYRIGHT NEWS README-WINDOWS
 
+echo "PACKAGING $zip..."
+
 cd mingw64
 zip -vgl ../$zip matlab/*
 cd ..