diff options
-rw-r--r-- | boost.pri | 13 | ||||
-rw-r--r-- | cgal.pri | 14 | ||||
-rw-r--r-- | eigen2.pri | 7 | ||||
-rw-r--r-- | glew.pri | 1 | ||||
-rw-r--r-- | openscad.pro | 10 | ||||
-rwxr-xr-x | scripts/release-common.sh | 32 | ||||
-rwxr-xr-x | scripts/update-web.sh | 22 | ||||
-rw-r--r-- | src/CSGTermEvaluator.h | 4 | ||||
-rw-r--r-- | src/dxfdata.h | 5 | ||||
-rw-r--r-- | src/lexer.l | 7 | ||||
-rw-r--r-- | src/linalg.h | 4 |
11 files changed, 98 insertions, 21 deletions
@@ -10,9 +10,14 @@ boost { } } - win32 { - LIBS += -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 - } else { - LIBS += -lboost_thread -lboost_program_options + CONFIG(mingw-cross-env) { + LIBS += -lboost_thread_win32-mt -lboost_program_options-mt + } + else { + win32 { + LIBS += -llibboost_thread-vc90-mt-s-1_46_1 -llibboost_program_options-vc90-mt-s-1_46_1 + } else { + LIBS += -lboost_thread -lboost_program_options + } } } @@ -1,5 +1,6 @@ cgal { DEFINES += ENABLE_CGAL + CONFIG(mingw-cross-env):DEFINES += BOOST_STATIC BOOST_THREAD_USE_LIB Boost_USE_STATIC_LIBS isEmpty(DEPLOYDIR) { # Optionally specify location of CGAL using the @@ -13,10 +14,15 @@ cgal { } } - win32 { - LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc90-mt-s - } else { - LIBS += -lgmp -lmpfr -lCGAL + CONFIG(mingw-cross-env) { + LIBS += -lgmp -lmpfr -lCGAL + } + else { + win32 { + LIBS += $$CGAL_DIR/auxiliary/gmp/lib/libmpfr-4.lib -lCGAL-vc90-mt-s + } else { + LIBS += -lgmp -lmpfr -lCGAL + } } QMAKE_CXXFLAGS += -frounding-math } @@ -9,6 +9,11 @@ else { INCLUDEPATH += /opt/local/include/eigen2 } else { - INCLUDEPATH += /usr/include/eigen2 + CONFIG(mingw-cross-env) { + INCLUDEPATH += mingw-cross-env/include/eigen2 + } + else { + INCLUDEPATH += /usr/include/eigen2 + } } } @@ -16,4 +16,5 @@ glew { unix:LIBS += -lGLEW win32:LIBS += -lglew32s + CONFIG(mingw-cross-env):DEFINES += GLEW_STATIC } diff --git a/openscad.pro b/openscad.pro index 3a41800..ed65a03 100644 --- a/openscad.pro +++ b/openscad.pro @@ -39,8 +39,14 @@ DEFINES += OPENSCAD_VERSION=$$VERSION OPENSCAD_YEAR=$$VERSION_YEAR OPENSCAD_MONT !isEmpty(VERSION_DAY): DEFINES += OPENSCAD_DAY=$$VERSION_DAY win32:DEFINES += _USE_MATH_DEFINES NOMINMAX _CRT_SECURE_NO_WARNINGS YY_NO_UNISTD_H -#disable warning about too long decorated names -win32:QMAKE_CXXFLAGS += -wd4503 +CONFIG(mingw-cross-env) { + LIBS += mingw-cross-env/lib/libglew32s.a mingw-cross-env/lib/libglut.a mingw-cross-env/lib/libopengl32.a mingw-cross-env/lib/libGLEW.a mingw-cross-env/lib/libglaux.a mingw-cross-env/lib/libglu32.a mingw-cross-env/lib/libopencsg.a mingw-cross-env/lib/libmpfr.a mingw-cross-env/lib/libCGAL.a + QMAKE_CXXFLAGS += -fpermissive +} +else { + #disable warning about too long decorated names + win32:QMAKE_CXXFLAGS += -wd4503 +} TEMPLATE = app diff --git a/scripts/release-common.sh b/scripts/release-common.sh index 9261d7a..e12cd9d 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -1,7 +1,9 @@ #!/bin/sh # # This script creates a binary release of OpenSCAD. -# This should work under Mac OS X and Windows (msys). Linux support pending. +# This should work under Mac OS X, Windows (msys), and Linux cross-compiling +# for windows using mingw-cross-env (use like: OS=LINXWIN release-common.sh). +# Linux support pending. # The script will create a file called openscad-<versionstring>.zip # in the current directory. # @@ -54,9 +56,23 @@ case $OS in ZIPARGS="a -tzip" TARGET=release ;; + LINXWIN) + unset CONFIG + TARGET=release + ZIP="zip" + ZIPARGS="-r" + ;; +esac + +case $OS in + LINXWIN) + i686-pc-mingw32-qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG+=mingw-cross-env CONFIG-=debug openscad.pro + ;; + *) + qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro + ;; esac -qmake VERSION=$VERSION CONFIG+=$CONFIG CONFIG-=debug openscad.pro make -s clean case $OS in MACOSX) @@ -122,4 +138,16 @@ case $OS in rm -rf openscad-$VERSION echo "Binary created: openscad-$VERSION.zip" ;; + LINXWIN) + #package + cp $TARGET/openscad.exe openscad-$VERSION + rm -f OpenSCAD-$VERSION.zip + "$ZIP" $ZIPARGS OpenSCAD-$VERSION.zip openscad-$VERSION + cp scripts/installer.nsi openscad-$VERSION/ + cd openscad-$VERSION && makensis installer.nsi && cd .. + cp openscad-$VERSION/openscad_setup.exe OpenSCAD-$VERSION-Installer.exe + rm -rf openscad-$VERSION + echo "Binary created: OpenSCAD-$VERSION.zip" + echo "Installer created: OpenSCAD-$VERSION-Installer.exe" + ;; esac diff --git a/scripts/update-web.sh b/scripts/update-web.sh index 4180d01..9036d9b 100755 --- a/scripts/update-web.sh +++ b/scripts/update-web.sh @@ -1,13 +1,27 @@ #!/bin/bash -dmgfile=$1 -if [ -z "$dmgfile" ]; then - echo "Usage: $0 <dmgfile>" +# Works with Mac OS X and Linux cross-compiling for windows using +# mingw-cross-env (use like: OS=LINXWIN update-web.sh file1.zip file2.exe). + +file1=$1 +if [ -z "$file1" ]; then + echo "Usage: $0 <file1> [<file2>]" exit 1 fi + +if [[ $OSTYPE =~ "darwin" ]]; then + OS=MACOSX +fi + indexfile=../openscad.github.com/index.html if [ -f $indexfile ]; then - sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$dmgfile\\3$dmgfile\\5/" $indexfile + if [ $OS == MACOSX ]; then + sed -i .backup -e "s/^\(.*mac-snapshot.*\)\(OpenSCAD-.*\.dmg\)\(.*\)\(OpenSCAD-.*dmg\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile + elif [ $OS == LINXWIN ]; then + file2=$2 + sed -i .backup -e "s/^\(.*win-snapshot-zip.*\)\(OpenSCAD-.*\.zip\)\(.*\)\(OpenSCAD-.*zip\)\(.*$\)/\\1$file1\\3$file1\\5/" $indexfile + sed -i .backup -e "s/^\(.*win-snapshot-exe.*\)\(OpenSCAD-.*-Installer\.exe\)\(.*\)\(OpenSCAD-.*-Installer.exe\)\(.*$\)/\\1$file2\\3$file2\\5/" $indexfile + fi echo "Web page updated. Remember to commit and push openscad.github.com" else echo "Web page not found at $indexfile" diff --git a/src/CSGTermEvaluator.h b/src/CSGTermEvaluator.h index 3a8122b..9d1fabe 100644 --- a/src/CSGTermEvaluator.h +++ b/src/CSGTermEvaluator.h @@ -7,6 +7,10 @@ #include <cstddef> #include "visitor.h" +#if defined __WIN32__ && ! defined _MSC_VER +#include <cstddef> +#endif + class CSGTermEvaluator : public Visitor { public: diff --git a/src/dxfdata.h b/src/dxfdata.h index d24541c..e2f229e 100644 --- a/src/dxfdata.h +++ b/src/dxfdata.h @@ -1,5 +1,8 @@ #ifndef DXFDATA_H_ #define DXFDATA_H_ +#ifndef EIGEN_DONT_ALIGN +#define EIGEN_DONT_ALIGN +#endif #include <vector> #include <Eigen/Dense> @@ -30,7 +33,7 @@ public: } }; - std::vector<Vector2d, Eigen::aligned_allocator<Vector2d> > points; + std::vector<Vector2d> points; std::vector<Path> paths; std::vector<Dim> dims; diff --git a/src/lexer.l b/src/lexer.l index 3cd4a19..cf5cb6d 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -35,8 +35,11 @@ #include <QDir> #include <assert.h> -//isatty for visual c++ -#ifdef _MSC_VER +//isatty for visual c++ and mingw-cross-env +#if defined __WIN32__ && ! defined _MSC_VER +#include "unistd.h" +#endif +#if defined __WIN32__ || defined _MSC_VER extern "C" int __cdecl _isatty(int _FileHandle); #define isatty _isatty #endif diff --git a/src/linalg.h b/src/linalg.h index 06991cf..eb1ed3c 100644 --- a/src/linalg.h +++ b/src/linalg.h @@ -1,6 +1,8 @@ #ifndef LINALG_H_ #define LINALG_H_ - +#ifndef EIGEN_DONT_ALIGN +#define EIGEN_DONT_ALIGN +#endif #include <Eigen/Core> #include <Eigen/Geometry> |