Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtsanders committed Oct 7, 2020
1 parent b094151 commit f62f5d8
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 28 deletions.
6 changes: 6 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.1.10

2020-10-07 Brecht Sanders https://github.com/brechtsanders/

* fixed Makefile to detect if asprintf() is defined on Windows (needed for recent versions of MinGW-w64)

0.1.9

2020-03-07 Brecht Sanders https://github.com/brechtsanders/
Expand Down
62 changes: 35 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ifeq ($(OS),)
OS = $(shell uname -s)
ifneq ($(findstring Windows,$(OS))$(findstring MINGW32,$(OS))$(findstring MSYS,$(OS)),)
OS = Windows_NT
endif
OS = $(shell uname -s)
ifneq ($(findstring Windows,$(OS))$(findstring MINGW32,$(OS))$(findstring MSYS,$(OS)),)
OS = Windows_NT
endif
endif
PLATFORMNAME = $(OS)
ifeq ($(PLATFORMNAME),Windows_NT)
ifneq ($(findstring x86_64,$(shell gcc --version)),)
PLATFORMNAME = win64
else ifneq ($(findstring i686,$(shell gcc --version)),)
PLATFORMNAME = win32
endif
ifneq ($(findstring x86_64,$(shell gcc --version)),)
PLATFORMNAME = win64
else ifneq ($(findstring i686,$(shell gcc --version)),)
PLATFORMNAME = win32
endif
endif
PREFIX = /usr/local
CC = gcc
Expand All @@ -19,30 +19,38 @@ AR = ar
LIBPREFIX = lib
LIBEXT = .a
ifeq ($(OS),Windows_NT)
BINEXT = .exe
SOEXT = .dll
BINEXT = .exe
SOEXT = .dll
else ifeq ($(OS),Darwin)
BINEXT =
SOEXT = .dylib
BINEXT =
SOEXT = .dylib
else
BINEXT =
SOEXT = .so
BINEXT =
SOEXT = .so
endif
INCS = -Iinclude -Isrc
CFLAGS = $(INCS) -Os
CFLAGS = $(INCS) -Os
CPPFLAGS = $(INCS) -Os
ifeq ($(OS),Windows_NT)
# detect if asprintf exists (needed for recent MinGW-w64 versions)
CHECK_ASPRINTF=$(shell echo -e "#define _GNU_SOURCE\n#include <stdio.h>\nint main() {\n char* p;\n asprintf(&p, \".\");\n return 0;\n}\n"|gcc -xc - -ocheck_asprintf.exe -Wall && rm -f check_asprintf.exe && echo OK)
ifeq ($(CHECK_ASPRINTF),OK)
CFLAGS += -DHAVE_VASPRINTF -DHAVE_ASPRINTF
CXXFLAGS += -DHAVE_VASPRINTF -DHAVE_ASPRINTF
endif
endif
STATIC_CFLAGS = -DBUILD_PROXYSOCKET_STATIC
SHARED_CFLAGS = -DBUILD_PROXYSOCKET_DLL
LIBS =
LDFLAGS =
ifeq ($(OS),Darwin)
CFLAGS += -I/opt/local/include -I/opt/local/lib/libzip/include
LDFLAGS += -L/opt/local/lib
#CFLAGS += -arch i386 -arch x86_64
#LDFLAGS += -arch i386 -arch x86_64
STRIPFLAG =
CFLAGS += -I/opt/local/include -I/opt/local/lib/libzip/include
LDFLAGS += -L/opt/local/lib
#CFLAGS += -arch i386 -arch x86_64
#LDFLAGS += -arch i386 -arch x86_64
STRIPFLAG =
else
STRIPFLAG = -s
STRIPFLAG = -s
endif
MKDIR = mkdir -p
RM = rm -f
Expand All @@ -55,16 +63,16 @@ PROXYSOCKET_OBJ = src/proxysocket.o
PROXYSOCKET_LDFLAGS =
PROXYSOCKET_SHARED_LDFLAGS =
ifneq ($(OS),Windows_NT)
SHARED_CFLAGS += -fPIC
SHARED_CFLAGS += -fPIC
endif
ifeq ($(OS),Windows_NT)
PROXYSOCKET_SHARED_LDFLAGS += -Wl,--out-implib,$@$(LIBEXT) -lws2_32
PROXYSOCKET_LDFLAGS += -lws2_32
PROXYSOCKET_SHARED_LDFLAGS += -Wl,--out-implib,$@$(LIBEXT) -lws2_32
PROXYSOCKET_LDFLAGS += -lws2_32
endif
ifeq ($(OS),Darwin)
OS_LINK_FLAGS = -dynamiclib -o $@
OS_LINK_FLAGS = -dynamiclib -o $@
else
OS_LINK_FLAGS = -shared -Wl,-soname,$@ $(STRIPFLAG)
OS_LINK_FLAGS = -shared -Wl,-soname,$@ $(STRIPFLAG)
endif

TOOLS_BIN = ipify$(BINEXT)
Expand Down
2 changes: 1 addition & 1 deletion src/proxysocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extern "C" {
/*! \brief minor version number */
#define PROXYSOCKET_VERSION_MINOR 1
/*! \brief micro version number */
#define PROXYSOCKET_VERSION_MICRO 9
#define PROXYSOCKET_VERSION_MICRO 10
/*! @} */

/*! \brief proxy types
Expand Down

0 comments on commit f62f5d8

Please sign in to comment.