• R/O
  • SSH
  • HTTPS

molby: Commit


Commit MetaInfo

Revision608 (tree)
Time2017-12-16 18:11:19
Authortoshinagata1964

Log Message

Switch to the mingw-w32 cross compiler toolchain

Change Summary

Incremental Difference

--- trunk/Documents/src/doc_source.html (revision 607)
+++ trunk/Documents/src/doc_source.html (revision 608)
@@ -209,7 +209,7 @@
209209 Molby is a copyrighted product of Toshi Nagata.
210210 </p>
211211 <p>
212-Copyright (C) 2008-2016 Toshi Nagata <!-- copyright -->
212+Copyright (C) 2008-2017 Toshi Nagata <!-- copyright -->
213213 </p>
214214 <p>
215215 I ask for citation of the following paper in published works that utilize Molby:
@@ -255,7 +255,7 @@
255255 Molby: Interactive Molecular Modeling Software with Integrated Ruby Interpreter
256256 </p>
257257 <p>
258-Copyright (C) 2008-2016 Toshi Nagata <!-- copyright -->
258+Copyright (C) 2008-2017 Toshi Nagata <!-- copyright -->
259259 </p>
260260 <p>
261261 This program is free software; you can redistribute it and/or modify
@@ -278,7 +278,7 @@
278278 Molby の著作権は永田 央が保持しています。
279279 </p>
280280 <p>
281-Copyright (C) 2008-2016 Toshi Nagata <!-- copyright -->
281+Copyright (C) 2008-2017 Toshi Nagata <!-- copyright -->
282282 </p>
283283 <p>
284284 Molby を利用した成果を発表される際は、以下の論文を引用していただくようお願いします。
@@ -323,7 +323,7 @@
323323 Molby: 対話型分子モデルソフトウェア(Ruby インタプリタ内蔵)
324324 </p>
325325 <p>
326-Copyright (C) 2008-2016 Toshi Nagata <!-- copyright -->
326+Copyright (C) 2008-2017 Toshi Nagata <!-- copyright -->
327327 </p>
328328 <p>
329329 このプログラムはフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された GNU 一般公衆利用許諾契約書(バージョン2か、希望によってはそれ以降のバージョンのうちどれか)の定める条件の下で再頒布または改変することができます。
--- trunk/Makefile (revision 607)
+++ trunk/Makefile (revision 608)
@@ -14,16 +14,27 @@
1414 endif
1515
1616 ifeq ($(TARGET_PLATFORM),MSW)
17+ ifneq ($(CROSS_COMPILE),)
18+ TOOL_PREFIX = i686-w64-mingw32-
19+ CPP_EXTRA_FLAGS += -isystem /usr/local/mingw-w32/mingw/include
20+ MSW_BUILD = mswx-build
21+ LIB_SUFFIX = -3.0-i686-w64-mingw32
22+ WINE_PATH=/Applications/EasyWine.app/Contents/Resources/wine/bin
23+ else
24+ MSW_BUILD = msw-build
25+ LIB_SUFFIX = -3.0
26+ endif
1727 WX_DIR = $(PWD)/../../wxWidgets-3.0.0
18- WX_LIB_DIR = $(WX_DIR)/msw-build/lib
19- WX_ARCH_DIR = $(WX_LIB_DIR)/wx/include/msw-unicode-static-3.0
28+ WX_LIB_DIR = $(WX_DIR)/$(MSW_BUILD)/lib
29+ WX_ARCH_DIR = $(WX_LIB_DIR)/wx/include/$(TOOL_PREFIX)msw-unicode-static-3.0
2030 WX_CPPFLAGS = -isystem $(WX_ARCH_DIR) -isystem $(WX_DIR)/include -D_LARGEFIILE_SOURCE=unknown -D__WXMSW__
21- WX_LDFLAGS = -L$(WX_LIB_DIR) -Wl,--subsystem,windows -mwindows -lwx_mswu_gl-3.0 -lopengl32 -lglu32 -lwx_mswu-3.0 -lwxregexu-3.0 -lwxexpat-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lwxpng-3.0 -lwxzlib-3.0 -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
22- CPP_EXTRA_FLAGS = -isystem $(PWD)/../../CLAPACK-3.1.1.1-mingw/INCLUDE -isystem $(PWD)/../../fftw-3.3.2/msw-build/include -I$(PWD)/../MolLib
23- LD_EXTRA_FLAGS = -L$(PWD)/../../CLAPACK-3.1.1.1-mingw/lib -L$(PWD)/../../fftw-3.3.2/msw-build/lib -llapackMinGW -lblasMinGW -lf2c_nomain -lfftw3 -static-libgcc
31+ WX_LDFLAGS = -L$(WX_LIB_DIR) -Wl,--subsystem,windows -mwindows -lwx_mswu_gl$(LIB_SUFFIX) -lopengl32 -lglu32 -lwx_mswu$(LIB_SUFFIX) -lwxregexu$(LIB_SUFFIX) -lwxexpat$(LIB_SUFFIX) -lwxtiff$(LIB_SUFFIX) -lwxjpeg$(LIB_SUFFIX) -lwxpng$(LIB_SUFFIX) -lwxzlib$(LIB_SUFFIX) -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lwsock32 -lgdi32
32+ CPP_EXTRA_FLAGS = -isystem $(PWD)/../../CLAPACK-3.1.1.1-mingw/INCLUDE -isystem $(PWD)/../../fftw-3.3.2/$(MSW_BUILD)/include -I$(PWD)/../MolLib
33+ LD_EXTRA_FLAGS = -L$(PWD)/../../CLAPACK-3.1.1.1-mingw/$(MSW_BUILD)/lib -L$(PWD)/../../fftw-3.3.2/$(MSW_BUILD)/lib -llapackMinGW -lblasMinGW -lf2c_nomain -lfftw3 -static-libgcc -static-libstdc++
2434 RUBY_DIR = $(PWD)/../../ruby-2.0.0-p353
25- RUBY_CFLAGS = -isystem $(RUBY_DIR)/msw-build/include/ruby-2.0.0 -I$(RUBY_DIR) -I$(RUBY_DIR)/msw-build/include/ruby-2.0.0/i386-mingw32
26- RUBY_LDFLAGS = -L$(RUBY_DIR)/msw-build/lib -lmsvcrt-ruby200-static -lmsvcrt-ruby200 -lws2_32 -lshlwapi -limagehlp -lenc -ltrans
35+ RUBY_CFLAGS = -isystem $(RUBY_DIR)/$(MSW_BUILD)/include/ruby-2.0.0 -I$(RUBY_DIR) -I$(RUBY_DIR)/$(MSW_BUILD)/include/ruby-2.0.0/i386-mingw32
36+# RUBY_LDFLAGS = -L$(RUBY_DIR)/$(MSW_BUILD)/lib -lmsvcrt-ruby200-static -lmsvcrt-ruby200 -lws2_32 -lshlwapi -limagehlp -lenc -ltrans
37+ RUBY_LDFLAGS = -L$(RUBY_DIR)/$(MSW_BUILD)/lib -lmsvcrt-ruby200-static -lws2_32 -lshlwapi -limagehlp -lenc -ltrans
2738 EXECUTABLE = _Molby.exe_
2839 FINAL_EXECUTABLE = Molby.exe
2940 EXE_SUFFIX = .exe
@@ -41,8 +52,10 @@
4152 PRODUCT = $(PRODUCT_DIR)/$(EXECUTABLE)
4253 endif
4354
44-CPP = g++
45-CC = gcc
55+CPP = $(TOOL_PREFIX)g++
56+CC = $(TOOL_PREFIX)gcc
57+AR = $(TOOL_PREFIX)ar
58+RANLIB = $(TOOL_PREFIX)ranlib
4659
4760 ifeq ($(MAKECMDGOALS),debug)
4861 DEBUG = 1
@@ -63,7 +76,10 @@
6376 export LDFLAGS
6477 export DESTDIR
6578 export CC
79+export CPP
80+export AR
6681 export TARGET_PLATFORM
82+export RANLIB
6783
6884 release: all
6985
@@ -88,11 +104,11 @@
88104 # on the Z: drive. 2009.7.24. Toshi Nagata
89105 HOMETEMP = $(HOME)/__molby_temp_build__
90106 $(DESTPREFIX)/$(RESOURCE) : molby.rc
91- mkdir -p $(HOMETEMP)/msw_build $(HOMETEMP)/bitmaps
92- cp molby.rc $(HOMETEMP)/msw_build
107+ mkdir -p $(HOMETEMP)/$(MSW_BUILD) $(HOMETEMP)/bitmaps
108+ cp molby.rc $(HOMETEMP)/$(MSW_BUILD)
93109 cp ../bitmaps/*.ico $(HOMETEMP)/bitmaps
94- (cd $(HOMETEMP)/msw_build; windres -i molby.rc -o molby_rc.o -I$(WX_DIR)/include)
95- cp $(HOMETEMP)/msw_build/molby_rc.o $@
110+ (cd $(HOMETEMP)/$(MSW_BUILD); $(TOOL_PREFIX)windres -i molby.rc -o molby_rc.o -I$(WX_DIR)/include)
111+ cp $(HOMETEMP)/$(MSW_BUILD)/molby_rc.o $@
96112 rm -rf $(HOMETEMP)
97113 endif
98114
@@ -153,10 +169,11 @@
153169 cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT)/Contents/MacOS
154170 endif
155171 ifeq ($(TARGET_PLATFORM),MSW)
172+ echo PWD = $(PWD)
156173 rm -rf $(DESTPREFIX)/$(PRODUCT_DIR)
157174 mkdir -p $(DESTPREFIX)/$(PRODUCT_DIR)
158175 cp $(DESTPREFIX)/$(EXECUTABLE) $(DESTPREFIX)/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
159- cp `which mingwm10.dll` $(DESTPREFIX)/$(PRODUCT_DIR)
176+ cp mingwm10.dll $(DESTPREFIX)/$(PRODUCT_DIR)
160177 cp -r ../Scripts $(DESTPREFIX)/$(PRODUCT_DIR)
161178 cp -r amber11 $(DESTPREFIX)/$(PRODUCT_DIR)
162179 cp -r ortep3 $(DESTPREFIX)/$(PRODUCT_DIR)
@@ -165,9 +182,16 @@
165182 endif
166183
167184 ifeq ($(TARGET_PLATFORM),MSW)
185+install: setup
186+
168187 setup: build/release/$(PRODUCT_DIR)/$(FINAL_EXECUTABLE)
169188 mkdir -p ../latest_binaries
170- (/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/iscc molby.iss && mv Output/SetupMolbyWin.exe ../latest_binaries)
189+ifneq ($(CROSS_COMPILE),)
190+ ($(WINE_PATH)/wine ../../Inno\ Setup\ 5/ISCC.exe molby.iss || exit 1)
191+else
192+ (/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/iscc molby.iss || exit 1)
193+endif
194+ mv Output/SetupMolbyWin.exe ../latest_binaries
171195 (cd build/release/$(PRODUCT_DIR) && rm -rf $(MAKEDIR)/../latest_binaries/MolbyWin.zip && zip -r $(MAKEDIR)/../latest_binaries/MolbyWin.zip * -x \*.DS_Store \*.svn*)
172196 endif
173197
--- trunk/MolLib/MainView.h (revision 607)
+++ trunk/MolLib/MainView.h (revision 608)
@@ -25,7 +25,7 @@
2525 #else
2626 #include <GL/gl.h>
2727 #include <GL/glu.h>
28-#include <GL/glext.h>
28+/*#include <GL/glext.h> */
2929 #endif
3030
3131 #include "MolLib.h"
--- trunk/MolLib/Makefile (revision 607)
+++ trunk/MolLib/Makefile (revision 608)
@@ -19,7 +19,7 @@
1919
2020 $(DESTDIR)/MolLib.a : $(ALL_OBJECTS)
2121 $(AR) $(ARFLAGS) $(DESTDIR)/MolLib.a $(ALL_OBJECTS)
22- ranlib $(DESTDIR)/MolLib.a
22+ $(RANLIB) $(DESTDIR)/MolLib.a
2323
2424 clean:
2525 rm -f $(OBJDIR)/*.o
--- trunk/MolLib/Missing.h (revision 607)
+++ trunk/MolLib/Missing.h (revision 608)
@@ -23,7 +23,7 @@
2323 #define MISSING_ASPRINTF 1
2424 #define MISSING_STRTOK_R 1
2525 #define MISSING_MERGESORT 1
26-#define MISSING_STRDUP 1 /* For debug with 'external' malloc library */
26+/*#define MISSING_STRDUP 1 *//* For debug with 'external' malloc library */
2727 #define PATH_SEPARATOR '\\'
2828 #else
2929 #define PATH_SEPARATOR '/'
--- trunk/MolLib/Ruby_bind/Makefile (revision 607)
+++ trunk/MolLib/Ruby_bind/Makefile (revision 608)
@@ -13,7 +13,7 @@
1313
1414 $(DESTDIR)/Ruby_bind.a : $(ALL_OBJECTS)
1515 $(AR) $(ARFLAGS) $(DESTDIR)/Ruby_bind.a $(ALL_OBJECTS)
16- ranlib $(DESTDIR)/Ruby_bind.a
16+ $(RANLIB) $(DESTDIR)/Ruby_bind.a
1717
1818 clean:
1919 rm -f $(OBJDIR)/*.o
--- trunk/MolLib/Types.h (revision 607)
+++ trunk/MolLib/Types.h (revision 608)
@@ -17,6 +17,10 @@
1717 #ifndef __Types_h__
1818 #define __Types_h__
1919
20+#if defined(__WXMSW__)
21+#include <windows.h> /* Include this as early as possible */
22+#endif
23+
2024 #include <stdlib.h>
2125 #include <stdio.h>
2226 #include <math.h>
@@ -31,6 +35,16 @@
3135 #include <clapack.h>
3236 #endif
3337
38+#if defined(__WXMSW__)
39+/* MinGW may not have definition of DBL_EPSILON and FLT_EPSILON */
40+#ifndef DBL_EPSILON
41+#define DBL_EPSILON __DBL_EPSILON__
42+#endif
43+#ifndef FLT_EPSILON
44+#define FLT_EPSILON __FLT_EPSILON__
45+#endif
46+#endif
47+
3448 /* Get the eigenvalue/eigenvector for a real symmetric matrix (3x3) */
3549 #if !defined(__WXMAC__) && !defined(__CMDMAC__)
3650 typedef integer __CLPK_integer;
--- trunk/README (revision 607)
+++ trunk/README (revision 608)
@@ -29,7 +29,7 @@
2929
3030 Molby is a copyrighted product of Toshi Nagata.
3131
32- Copyright (C) 2008-2016 Toshi Nagata
32+ Copyright (C) 2008-2017 Toshi Nagata
3333
3434 Molby includes (more technically: is statically linked to) the following softwares, which are copyrighted products as described below:
3535
--- trunk/mswx-build/Makefile (nonexistent)
+++ trunk/mswx-build/Makefile (revision 608)
@@ -0,0 +1,4 @@
1+TARGET_PLATFORM = MSW
2+CROSS_COMPILE = 1
3+PWD = $(shell echo $$PWD)
4+include ../Makefile
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
--- trunk/wxSources/MyVersion.c (revision 607)
+++ trunk/wxSources/MyVersion.c (revision 608)
@@ -3,7 +3,7 @@
33 * Molby
44 *
55 * Created by Toshi Nagata on 09/10/16.
6- * Copyright 2008-2016 Toshi Nagata. All rights reserved.
6+ * Copyright 2008-2017 Toshi Nagata. All rights reserved.
77 *
88 This program is free software; you can redistribute it and/or modify
99 it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
1616 */
1717
1818 const char *gVersionString = "v1.0b3";
19-const char *gCopyrightString = "Copyright (c) 2008-2016 Toshi Nagata";
19+const char *gCopyrightString = "Copyright (c) 2008-2017 Toshi Nagata";
2020 /* The following are now defined in build/buildInfo.c, generated by record_build_date.sh */
2121 /*int gRevisionNumber = 0;
2222 char *gLastBuildString = (char *)0; */
--- trunk/wxSources/OpenGL_extensions.h (revision 607)
+++ trunk/wxSources/OpenGL_extensions.h (revision 608)
@@ -24,7 +24,7 @@
2424 #include <windows.h>
2525 #include <GL/gl.h>
2626 #include <GL/glu.h>
27-#include <GL/glext.h>
27+/*#include <GL/glext.h>*/
2828
2929 #ifdef __cplusplus
3030 extern "C" {
Show on old repository browser