Skip to content

Commit c60e3dd

Browse files
committed
Initial Autotools and FLTK support
With this commit, SolveSpace gains an Autotools build system and a new platform-dependent backend implemented using the FLTK GUI toolkit. These will allow the application to be built and run on Linux and other Unix-like operating systems, and prospectively, MacOS X. A number of new files have been added: * Makefile.am: Automake makefile template; this contains some experimental support for MinGW and MSVC++ builds that needs further development * ac-aux/ax_fltk.m4: Autoconf M4 macro to locate and query the system's installation of FLTK; this will eventually be contributed to the GNU Autoconf Archive * autogen.sh: Script to bootstrap the Autotools build system, usually for a tree just checked out from source control * configure.ac: Source for the Autoconf configure script; note that this file specifies a version of 2.1, near the top * fltk/fltkmain.cpp: Main FLTK backend implementation * fltk/fltkutil.cpp: Utility functions for the FLTK backend * fltk/xFl_Gl_Window_Group.{H,cxx}: Implementation of a new Fl_Gl_Window_Group widget for FLTK, needed to facilitate drawing FLTK widgets on top of OpenGL graphics as SolveSpace does. This has been submitted to the FLTK project for (hopefully) eventual upstream inclusion: http://www.fltk.org/str.php?L2992 The following minor changes are also a part of this commit: * Makefile.msvc: Define PACKAGE_VERSION=2.1 for the benefit of solvespace.cpp in MSVC++ builds * solvespace.cpp: In the About dialog text, use PACKAGE_VERSION rather than hard-coding the version of the program * solvespace.h: Don't define the C99 integer types if HAVE_C99_INTEGER_TYPES is defined, to facilitate MinGW builds
1 parent 7ca137f commit c60e3dd

File tree

11 files changed

+2355
-3
lines changed

11 files changed

+2355
-3
lines changed

Makefile.am

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
## Makefile.am
2+
3+
ACLOCAL_AMFLAGS = -I ac-aux
4+
5+
AM_CPPFLAGS = $(FLTK_CXXFLAGS)
6+
7+
if WIN32
8+
AM_CPPFLAGS += \
9+
-I$(srcdir)/extlib/libpng \
10+
-I$(srcdir)/extlib/si \
11+
-I$(srcdir)/extlib/zlib
12+
endif
13+
14+
bin_PROGRAMS = solvespace
15+
16+
icons_src = \
17+
icons.h \
18+
icons-proto.h
19+
20+
BUILT_SOURCES = $(icons_src)
21+
22+
solvespace_SOURCES = \
23+
$(icons_src) \
24+
bsp.cpp \
25+
clipboard.cpp \
26+
confscreen.cpp \
27+
constraint.cpp \
28+
constrainteq.cpp \
29+
describescreen.cpp \
30+
draw.cpp \
31+
drawconstraint.cpp \
32+
drawentity.cpp \
33+
dsc.h \
34+
entity.cpp \
35+
export.cpp \
36+
exportstep.cpp \
37+
exportvector.cpp \
38+
expr.h \
39+
expr.cpp \
40+
file.cpp \
41+
generate.cpp \
42+
glhelper.cpp \
43+
graphicswin.cpp \
44+
group.cpp \
45+
groupmesh.cpp \
46+
mesh.cpp \
47+
modify.cpp \
48+
mouse.cpp \
49+
polygon.h \
50+
polygon.cpp \
51+
request.cpp \
52+
sketch.h \
53+
solvespace.h \
54+
solvespace.cpp \
55+
style.cpp \
56+
system.cpp \
57+
textscreens.cpp \
58+
textwin.cpp \
59+
toolbar.cpp \
60+
ttf.cpp \
61+
ui.h \
62+
undoredo.cpp \
63+
util.cpp \
64+
view.cpp \
65+
srf/boolean.cpp \
66+
srf/curve.cpp \
67+
srf/merge.cpp \
68+
srf/ratpoly.cpp \
69+
srf/raycast.cpp \
70+
srf/surface.h \
71+
srf/surface.cpp \
72+
srf/surfinter.cpp \
73+
srf/triangulate.cpp
74+
75+
if HAVE_FLTK
76+
solvespace_SOURCES += \
77+
fltk/xFl_Gl_Window_Group.H \
78+
fltk/xFl_Gl_Window_Group.cxx \
79+
fltk/fltkmain.cpp \
80+
fltk/fltkutil.cpp
81+
82+
solvespace_LDADD = $(FLTK_LDSTATICFLAGS) -lGLU
83+
endif
84+
85+
if WIN32
86+
solvespace_SOURCES += \
87+
win32/freeze.h \
88+
win32/freeze.cpp \
89+
win32/w32main.cpp \
90+
win32/w32util.cpp
91+
92+
if MINGW
93+
solvespace_LDFLAGS = \
94+
-llibpng \
95+
-lzlib \
96+
-luser32 -lgdi32 -lcomctl32 -ladvapi32 -lshell32 \
97+
-lopengl32 -lglu32
98+
else
99+
solvespace_LDFLAGS = -link \
100+
-libpath:$(srcdir)/extlib/libpng libpng.lib \
101+
-libpath:$(srcdir)/extlib/zlib zlib.lib \
102+
user32.lib gdi32.lib comctl32.lib advapi32.lib shell32.lib \
103+
opengl32.lib glu32.lib
104+
endif # MINGW
105+
endif # WIN32
106+
107+
icons = \
108+
icon.ico \
109+
icons/angle.png \
110+
icons/arc.png \
111+
icons/assemble.png \
112+
icons/bezier.png \
113+
icons/char-0-check-false.png \
114+
icons/char-1-check-true.png \
115+
icons/char-2-radio-false.png \
116+
icons/char-3-radio-true.png \
117+
icons/circle.png \
118+
icons/constraint.png \
119+
icons/construction.png \
120+
icons/edges.png \
121+
icons/equal.png \
122+
icons/extrude.png \
123+
icons/faces.png \
124+
icons/hidden-lines.png \
125+
icons/horiz.png \
126+
icons/in3d.png \
127+
icons/length.png \
128+
icons/line.png \
129+
icons/mesh.png \
130+
icons/normal.png \
131+
icons/ontoworkplane.png \
132+
icons/other-supp.png \
133+
icons/parallel.png \
134+
icons/perpendicular.png \
135+
icons/point.png \
136+
icons/pointonx.png \
137+
icons/rectangle.png \
138+
icons/ref.png \
139+
icons/same-orientation.png \
140+
icons/shaded.png \
141+
icons/sketch-in-3d.png \
142+
icons/sketch-in-plane.png \
143+
icons/step-rotate.png \
144+
icons/step-translate.png \
145+
icons/symmetric.png \
146+
icons/tangent-arc.png \
147+
icons/text.png \
148+
icons/trim.png \
149+
icons/vert.png \
150+
icons/workplane.png
151+
152+
tables = \
153+
bitmapextra.table.h \
154+
bitmapfont.table.h \
155+
font.table.h
156+
157+
exposed = \
158+
exposed/CDemo.c \
159+
exposed/DOC.txt \
160+
exposed/Makefile \
161+
exposed/VbDemo.vb \
162+
exposed/lib.cpp \
163+
exposed/slvs.h
164+
165+
EXTRA_DIST = \
166+
$(icons) \
167+
$(tables) \
168+
$(exposed) \
169+
COPYING.txt \
170+
Makefile.msvc \
171+
extlib/build-fltk.sh \
172+
png2c.pl \
173+
pngchar2c.pl \
174+
tools/Makefile \
175+
tools/ttf2c.cpp \
176+
wishlist.txt \
177+
win32/manifest.xml \
178+
win32/resource.rc
179+
180+
optional_dist = \
181+
extlib/libpng/png.h \
182+
extlib/libpng/pngconf.h \
183+
extlib/libpng/pnglibconf.h \
184+
extlib/libpng/libpng.lib \
185+
extlib/si/si.h \
186+
extlib/si/siSync.h \
187+
extlib/si/siSyncPriv.h \
188+
extlib/si/siapp.h \
189+
extlib/si/spwdata.h \
190+
extlib/si/spwerror.h \
191+
extlib/si/spwmacro.h \
192+
extlib/si/siapp.lib \
193+
extlib/zlib/zconf.h \
194+
extlib/zlib/zlib.h \
195+
extlib/zlib/zutil.h \
196+
extlib/zlib/zlib.lib \
197+
extlib/fltk-1.3.2-source.tar.gz
198+
199+
dist-hook:
200+
for file in $(optional_dist); do \
201+
test -f $(srcdir)/$$file || continue; \
202+
dir=`dirname $$file`; \
203+
test -d $(distdir)/$$dir || mkdir $(distdir)/$$dir || exit; \
204+
cp -p $(srcdir)/$$file $(distdir)/$$file || exit; \
205+
done
206+
@if fgrep '/DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\""' $(srcdir)/Makefile.msvc >/dev/null; \
207+
then :; \
208+
else \
209+
echo 'error: /DPACKAGE_VERSION flag in Makefile.msvc is out-of-date'; \
210+
echo '(current package version is $(PACKAGE_VERSION))'; \
211+
exit 1; \
212+
fi
213+
214+
if MAINTAINER_MODE
215+
216+
icons.h: $(icons) $(srcdir)/png2c.pl
217+
$(PERL) $(srcdir)/png2c.pl $@ icons-proto.h $(srcdir)
218+
219+
icons-proto.h: icons.h
220+
@exit 0
221+
222+
bitmapextra.table.h: $(icons) $(srcdir)/pngchar2c.pl
223+
$(PERL) $(srcdir)/pngchar2c.pl $(srcdir) >$@.tmp
224+
mv -f $@.tmp $@
225+
226+
endif # MAINTAINER_MODE
227+
228+
run-valgrind: solvespace$(EXEEXT)
229+
@test -z "$$VALGRIND_OPTS" || echo VALGRIND_OPTS = $$VALGRIND_OPTS
230+
valgrind \
231+
--tool=memcheck \
232+
--verbose \
233+
--track-fds=yes \
234+
--log-file=vg.%p.out \
235+
--num-callers=50 \
236+
--error-limit=no \
237+
--read-var-info=yes \
238+
--leak-check=full \
239+
--leak-resolution=high \
240+
--show-reachable=yes \
241+
--track-origins=yes \
242+
--malloc-fill=0xac \
243+
--free-fill=0xde \
244+
./solvespace$(EXEEXT)
245+
246+
## end Makefile.am

Makefile.msvc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
HAVE_SPACEWARE_INPUT = 1
55

6-
DEFINES = /D_WIN32_WINNT=0x500 /DISOLATION_AWARE_ENABLED /D_WIN32_IE=0x500 /DWIN32_LEAN_AND_MEAN /DWIN32
6+
DEFINES = /D_WIN32_WINNT=0x500 /DISOLATION_AWARE_ENABLED /D_WIN32_IE=0x500 /DWIN32_LEAN_AND_MEAN /DWIN32 /DPACKAGE_VERSION="\"2.1\""
77
# Use the multi-threaded static libc because libpng and zlib do; not sure if anything bad
88
# happens if those mix, but don't want to risk it.
99
CXXFLAGS = /W3 /nologo /MT /D_DEBUG /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /I. /Iextlib /Zi /EHs # /O2

0 commit comments

Comments
 (0)