Skip to content

Commit 6ffa414

Browse files
committed
Update stlplus
1 parent 9f4c11a commit 6ffa414

File tree

840 files changed

+45585
-10688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

840 files changed

+45585
-10688
lines changed

deps/makefiles/README.txt

100755100644
File mode changed.

deps/makefiles/build.mak

100755100644
Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
ifeq ($(PLATFORM),SOLARIS)
1717
# have to explicitly pull in the socket library
18-
LOADLIBES += -lsocket
18+
LDLIBS += -lsocket
1919
endif
2020

2121
ifeq ($(PLATFORM),NETBSD)
2222
# have to explicitly state that the maths library should be included
23-
LOADLIBES += -lm
23+
LDLIBS += -lm
2424
endif
2525

2626
ifeq ($(BUILD),LINUX-alpha)
@@ -35,22 +35,41 @@ endif
3535

3636
ifeq ($(PLATFORM),MINGW)
3737
# need to explicitly add the Windows sockets 2 library
38-
LOADLIBES += -lWs2_32
38+
LDLIBS += -lWs2_32
3939
# gcc handling of DLLs on Windows
4040
LDFLAGS += -Wl,--enable-auto-import
41+
# $(CC) is used for C compiles and link operations. This defaults to cc which on most platforms then maps to gcc
42+
# However, MinGW platforms do not have a mapping from cc to gcc so builds fail. This is a work-round of this problem
43+
CC := gcc
4144
endif
4245

46+
ifeq ($(PLATFORM),MACOS)
47+
CXX := clang -m64
48+
endif
49+
50+
# need to build PIC on some platforms in order to use code in shared libraries
51+
# Note: I use PIC in all compiles on these platforms assuming that the historic lower performance of PIC is now negligible
4352
ifeq ($(PLATFORM),GNULINUX)
44-
# need to build PIC in order to use code in shared libraries
53+
CFLAGS += -fPIC
54+
CXXFLAGS += -fPIC
55+
else ifeq ($(PLATFORM),FREEBSD)
56+
CFLAGS += -fPIC
57+
CXXFLAGS += -fPIC
58+
else ifeq ($(PLATFORM),NETBSD)
59+
CFLAGS += -fPIC
60+
CXXFLAGS += -fPIC
61+
else ifeq ($(PLATFORM),OPENBSD)
4562
CFLAGS += -fPIC
4663
CXXFLAGS += -fPIC
4764
endif
4865

66+
# manage switch between static and dynamic linking of runtime library
4967
ifeq ($(STATIC),on)
5068
# switch on static linking with C/C++ runtimes
5169
LDFLAGS += -static-libgcc -static-libstdc++
5270
else
53-
LOADLIBES += -lstdc++
71+
# dynamic linking options - create a linker dependency on C++ runtime
72+
LDLAST += -lstdc++
5473
endif
5574

5675
################################################################################
@@ -198,7 +217,7 @@ build:: $(LIBRARY) $(ARCHIVE_LIBRARIES) $(IMAGE) $(SHARED_SO)
198217
$(SUBDIR)/%.o: %.cpp
199218
@echo "$(LIBNAME):$(SUBDIR): C++ compiling $<"
200219
@mkdir -p $(SUBDIR)
201-
@$(CXX) -x c++ -c -MMD $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $< -o $@
220+
$(CXX) -x c++ -c -MMD $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $< -o $@
202221

203222
# the rule for compiling a C source file
204223
$(SUBDIR)/%.o: %.c
@@ -250,8 +269,8 @@ $(SHARED_SO): $(LIBRARY) $(ARCHIVES)
250269
@echo "$(LIBNAME):$(SUBDIR): $(BUILD_TYPE) Linking Shared Library $(SHARED_SO)"
251270
@echo "$(LIBNAME):$(SUBDIR): flags: $(LDFLAGS)"
252271
@for l in $(LIBRARY) $(ARCHIVES); do echo "$(LIBNAME):$(SUBDIR): using: $$l"; done
253-
@echo "$(LIBNAME):$(SUBDIR): libs: $(LOADLIBES)"
254-
@gcc -shared -o $(SHARED_SO) $(LDFLAGS) $(RC_OBJECTS) -Wl,--whole-archive $(LIBRARY) -Wl,--no-whole-archive $(ARCHIVES) $(LOADLIBES)
272+
@echo "$(LIBNAME):$(SUBDIR): libs: $(LDLIBS) $(LDLAST)"
273+
@$(CC) -shared -o $(SHARED_SO) $(LDFLAGS) $(RC_OBJECTS) -Wl,--whole-archive $(LIBRARY) -Wl,--no-whole-archive $(ARCHIVES) $(LDLIBS) $(LDLAST)
255274

256275
endif
257276

@@ -267,13 +286,15 @@ $(ARCHIVE_LIBRARIES): FORCE
267286
@$(MAKE) -C $@
268287

269288
# the rule for linking an image
289+
# Note: I used to link with $(CXX) which maps onto g++ but there's a bug see: http://sourceforge.net/p/tdm-gcc/bugs/291/
290+
# I now link with $(CC) which maps onto cc by default but should then map onto gcc
270291
$(IMAGE): $(LIBRARY) $(ARCHIVES)
271292
@echo "$(LIBNAME):$(SUBDIR): $(BUILD_TYPE) Linking $(IMAGE)"
272293
@echo "$(LIBNAME):$(SUBDIR): flags: $(LDFLAGS)"
273294
@for l in $(LIBRARY) $(ARCHIVES); do echo "$(LIBNAME):$(SUBDIR): using: $$l"; done
274-
@echo "$(LIBNAME):$(SUBDIR): libs: $(LOADLIBES)"
295+
@echo "$(LIBNAME):$(SUBDIR): libs: $(LDLIBS) $(LDLAST)"
275296
@mkdir -p $(dir $(IMAGE))
276-
@gcc -o $(IMAGE) $(LDFLAGS) $(RC_OBJECTS) $^ $(LOADLIBES)
297+
@$(CC) -o $(IMAGE) $(LDFLAGS) $(RC_OBJECTS) $^ $(LDLIBS) $(LDLAST)
277298

278299
endif
279300

deps/makefiles/docs/button.png

100755100644
File mode changed.

deps/makefiles/docs/file.png

100755100644
File mode changed.

deps/makefiles/docs/folder.png

100755100644
File mode changed.

deps/makefiles/docs/header.png

100755100644
File mode changed.

0 commit comments

Comments
 (0)