Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Android: -lpthread not needed

Use compiler #define's to determine what platform we're on, so cross compiling works.
  • Loading branch information...
commit c6371d562dd4ea14cd4757e03b1e5dbb7ce58bed 1 parent 2ca1671
@vasi authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 squashfs-tools/Makefile
View
9 squashfs-tools/Makefile
@@ -107,10 +107,13 @@ CFLAGS += $(EXTRA_CFLAGS) $(INCLUDEDIR) -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -D_GNU_SOURCE -DCOMP_DEFAULT=\"$(COMP_DEFAULT)\" \
-Wall
-OS := $(shell uname -s)
-ifeq ($(OS),QNX)
+PLATDEF := $(shell echo | $(CC) $(CPPFLAGS) $(CFLAGS) -E - -dM)
+ifneq ($(findstring __QNX__,$(PLATDEF)),)
LIBS += -lm -lnbutil -lsocket
-else ifneq ($(OS),Haiku)
+else ifneq ($(findstring __ANDROID__,$(PLATDEF)),)
+ LIBS += -lm
+else ifeq ($(findstring __HAIKU__,$(PLATDEF)),)
+ # Not Haiku
LIBS += -lm -lpthread
endif
Please sign in to comment.
Something went wrong with that request. Please try again.