compile demos on Cygwin

This commit is contained in:
zhengshuxin 2022-08-06 23:32:00 +08:00
parent 1ebb4554b6
commit 97f66b265e
15 changed files with 193 additions and 34 deletions

View File

@ -59,6 +59,33 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lrt -ldl
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB += -liconv
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB += -liconv
RPATH = mingw
endif
# For MSYS
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB += -liconv
RPATH = mingw
endif
# For Darwin
ifeq ($(findstring Darwin, $(OSNAME)), Darwin)
# CC += -arch x86_64 -arch arm64

View File

@ -74,12 +74,24 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
UNIXTYPE = LINUX
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS2
ifeq ($(findstring MSYS2, $(UNIXNAME)), MSYS2)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For SunOS
ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS)
ifeq ($(findstring 86, $(UNIXNAME)), 86)

View File

@ -88,16 +88,23 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lcrypt -ldl -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif

View File

@ -57,9 +57,17 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lcrypt -ldl -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw

View File

@ -57,9 +57,17 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
CFLAGS += -DLINUX2 -D_REENTRANT
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -67,7 +75,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -57,9 +57,17 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
CFLAGS += -DLINUX2 -D_REENTRANT
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -67,7 +75,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -48,9 +48,17 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
CFLAGS += -DLINUX2 -D_REENTRANT
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -58,7 +66,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -53,6 +53,30 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
SYSLIB += -lcrypt
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys
endif
#Path for SunOS
ifeq ($(findstring SunOS, $(UNIXNAME)), SunOS)
ifeq ($(findstring 86, $(UNIXNAME)), 86)

View File

@ -61,9 +61,17 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lcrypt -ldl -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -71,7 +79,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz -ldl
SYSLIB = -lpthread -liconv -lz -ldl
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -56,9 +56,17 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lcrypt -ldl -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -66,7 +74,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz -ldl
SYSLIB = -lpthread -liconv -lz -ldl
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -61,9 +61,17 @@ ifeq ($(findstring Linux, $(OSNAME)), Linux)
SYSLIB += -lcrypt -ldl -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(OSNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(OSNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv -lz
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = mingw
@ -71,7 +79,7 @@ endif
# For MSYS
ifeq ($(findstring MSYS, $(OSNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv -lz -ldl
SYSLIB = -lpthread -liconv -lz -ldl
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
RPATH = msys

View File

@ -62,7 +62,7 @@ ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
SYSLIB += -liconv -rdynamic
SYSLIB += -liconv -rdynamic -lz
RPATH = macos
endif
@ -78,19 +78,26 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
RPATH = linux64
endif
CFLAGS += -DLINUX2 -D_REENTRANT
SYSLIB += -lcrypt
SYSLIB += -lcrypt -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif

View File

@ -66,7 +66,7 @@ ifeq ($(findstring Darwin, $(UNIXNAME)), Darwin)
CFLAGS += -DMACOSX -Wno-invalid-source-encoding \
-Wno-invalid-offsetof
UNIXTYPE = MACOSX
SYSLIB += -liconv -rdynamic
SYSLIB += -liconv -rdynamic -lz
RPATH = macos
endif
@ -82,19 +82,26 @@ ifeq ($(findstring Linux, $(UNIXNAME)), Linux)
RPATH = linux64
endif
CFLAGS += -DLINUX2 -D_REENTRANT
SYSLIB += -lcrypt
SYSLIB += -lcrypt -lz
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
SYSLIB = -lpthread-2 -liconv
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
SYSLIB = -lpthread-2 -liconv
SYSLIB = -lpthread -liconv -lz
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif

View File

@ -144,12 +144,21 @@ ifeq ($(findstring exist, $(EXECINFO_H_EXIST)), exist)
CFLAGS += -DHAS_EXECINFO_HEAD
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB = -lpthread -liconv
RPATH = mingw
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB = -lpthread-2
SYSLIB = -lpthread -liconv
RPATH = mingw
endif
@ -158,16 +167,7 @@ ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB = -lpthread-2
RPATH = mingw
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
CFLAGS += -DLINUX2 -DMINGW
CFLAGS += -O3
UNIXTYPE = LINUX
SYSLIB = -lpthread-2
SYSLIB = -lpthread -liconv
RPATH = mingw
endif

View File

@ -77,6 +77,25 @@ ifeq ($(findstring HP-UX, $(UNIXNAME)), HP-UX)
PLAT_NAME=hp-ux
endif
# For CYGWIN
ifeq ($(findstring CYGWIN, $(UNIXNAME)), CYGWIN)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MINGW
ifeq ($(findstring MINGW, $(UNIXNAME)), MINGW)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
# For MSYS
ifeq ($(findstring MSYS, $(UNIXNAME)), MSYS)
CFLAGS += -DLINUX2 -DMINGW
UNIXTYPE = LINUX
endif
#Find system type.
ifneq ($(SYSPATH),)
CHECKSYSRES = @echo "System is $(shell uname -sm)"