<commit_before>NAME = libtorrent-go
CC = cc
CXX = c++
SWIG = swig
SED_I = sed -E -i
PKG_CONFIG = pkg-config

include platform_host.mk

ifeq ($(HOST_OS), darwin)
	SED_I := $(SED_I) ''
endif

ifneq ($(CROSS_TRIPLE),)
	CC := $(CROSS_ROOT)/bin/$(CROSS_TRIPLE)-$(CC)
	CXX := $(CROSS_ROOT)/bin/$(CROSS_TRIPLE)-$(CXX)
endif

include platform_target.mk

ifeq ($(TARGET_ARCH), x86)
	SWIG_INT_GO_SIZE = 32
else ifeq ($(TARGET_ARCH), x64)
	SWIG_INT_GO_SIZE = 64
else ifeq ($(TARGET_ARCH), arm)
	SWIG_INT_GO_SIZE = 32
endif

ifneq ($(CROSS_ROOT),)
	CROSS_CFLAGS = -I$(CROSS_ROOT)/include -I$(CROSS_ROOT)/$(CROSS_TRIPLE)/include
	CROSS_LDFLAGS = -L$(CROSS_ROOT)/lib
	PKG_CONFIG := PKG_CONFIG_LIBDIR=$(CROSS_ROOT)/lib/pkgconfig $(PKG_CONFIG)
endif

LIBTORRENT_CFLAGS = $(shell $(PKG_CONFIG) --cflags libtorrent-rasterbar)
LIBTORRENT_LDFLAGS = $(shell $(PKG_CONFIG) --static --libs libtorrent-rasterbar)

CC_DEFINES = $(shell echo | $(CC) -dM -E - | grep -v "__GNUC__\|__STDC__" | sed -E "s/\#define[[:space:]]+([a-zA-Z0-9_()]+)[[:space:]]+(.*)/-D'\1'='\2'/g" | tr '\n' ' ')
CC_INCLUDES = $(shell $(CC) -x c++ -v -E /dev/null 2>&1 | sed -n "/search starts here/,/End of search list./p" | grep -e "^ .*" | sed -E "s/[[:space:]]+(.*)/-I'\1'/g" | tr '\n' ' ')
CFLAGS = -O2 -Wno-deprecated -Wno-deprecated-declarations $(CROSS_CFLAGS) $(CC_INCLUDES) $(LIBTORRENT_CFLAGS)
LDFLAGS = $(CROSS_LDFLAGS)

SWIG_FLAGS = -go -c++ -D__GNUC__\
	-soname dummy \
	-intgosize $(SWIG_INT_GO_SIZE) \
	$(CROSS_CFLAGS) \
	$(LIBTORRENT_CFLAGS) \
	$(CC_DEFINES) $(CC_INCLUDES)

ifeq ($(TARGET_OS), windows)
	EXT = dll
	SWIG_FLAGS += -D_WIN32_WINNT=0x0501 -DSWIGWIN
	CFLAGS += -mthreads
	LDFLAGS += -shared $(LIBTORRENT_LDFLAGS)
else ifeq ($(TARGET_OS), linux)
	CFLAGS += -fPIC
	LDFLAGS += $(LIBTORRENT_LDFLAGS) -lm -lstdc++ -ldl
else ifeq ($(TARGET_OS), android)
	CFLAGS += -fPIC -ggdb -fstack-protector-all
	LDFLAGS += -Wl,-Bstatic $(LIBTORRENT_LDFLAGS) -lm -Wl,-Bdynamic -lstdc++
else ifeq ($(TARGET_OS), darwin)
	SWIG_FLAGS += -DSWIGMAC -DBOOST_HAS_PTHREADS
	CFLAGS += -fPIC -mmacosx-version-min=10.6
	LDFLAGS += $(LIBTORRENT_LDFLAGS) -lm -lssl -lcrypto -lstdc++
endif<commit_msg>Remove useless defines and SWIG options<commit_after>NAME = libtorrent-go
CC = cc
CXX = c++
SWIG = swig
SED_I = sed -E -i
PKG_CONFIG = pkg-config

include platform_host.mk

ifeq ($(HOST_OS), darwin)
	SED_I := $(SED_I) ''
endif

ifneq ($(CROSS_TRIPLE),)
	CC := $(CROSS_ROOT)/bin/$(CROSS_TRIPLE)-$(CC)
	CXX := $(CROSS_ROOT)/bin/$(CROSS_TRIPLE)-$(CXX)
endif

include platform_target.mk

ifeq ($(TARGET_ARCH), x86)
	SWIG_INT_GO_SIZE = 32
else ifeq ($(TARGET_ARCH), x64)
	SWIG_INT_GO_SIZE = 64
else ifeq ($(TARGET_ARCH), arm)
	SWIG_INT_GO_SIZE = 32
endif

ifneq ($(CROSS_ROOT),)
	CROSS_CFLAGS = -I$(CROSS_ROOT)/include -I$(CROSS_ROOT)/$(CROSS_TRIPLE)/include
	CROSS_LDFLAGS = -L$(CROSS_ROOT)/lib
	PKG_CONFIG := PKG_CONFIG_LIBDIR=$(CROSS_ROOT)/lib/pkgconfig $(PKG_CONFIG)
endif

LIBTORRENT_CFLAGS = $(shell $(PKG_CONFIG) --cflags libtorrent-rasterbar)
LIBTORRENT_LDFLAGS = $(shell $(PKG_CONFIG) --static --libs libtorrent-rasterbar)

CC_DEFINES = $(shell echo | $(CC) -dM -E - | grep -v "__STDC__" | sed -E "s/\#define[[:space:]]+([a-zA-Z0-9_()]+)[[:space:]]+(.*)/-D'\1'='\2'/g" | tr '\n' ' ')
CC_INCLUDES = $(shell $(CC) -x c++ -v -E /dev/null 2>&1 | sed -n "/search starts here/,/End of search list./p" | grep -e "^ .*" | sed -E "s/[[:space:]]+(.*)/-I'\1'/g" | tr '\n' ' ')
CFLAGS = -O2 -Wno-deprecated -Wno-deprecated-declarations $(CROSS_CFLAGS) $(CC_INCLUDES) $(LIBTORRENT_CFLAGS)
LDFLAGS = $(CROSS_LDFLAGS)

SWIG_FLAGS = -go -c++\
	-intgosize $(SWIG_INT_GO_SIZE) \
	$(CROSS_CFLAGS) \
	$(LIBTORRENT_CFLAGS) \
	$(CC_DEFINES) $(CC_INCLUDES)

ifeq ($(TARGET_OS), windows)
	EXT = dll
	SWIG_FLAGS += -D_WIN32_WINNT=0x0501 -DSWIGWIN
	CFLAGS += -mthreads
	LDFLAGS += -shared $(LIBTORRENT_LDFLAGS)
else ifeq ($(TARGET_OS), linux)
	CFLAGS += -fPIC
	LDFLAGS += $(LIBTORRENT_LDFLAGS) -lm -lstdc++ -ldl
else ifeq ($(TARGET_OS), android)
	CFLAGS += -fPIC -ggdb -fstack-protector-all
	LDFLAGS += -Wl,-Bstatic $(LIBTORRENT_LDFLAGS) -lm -Wl,-Bdynamic -lstdc++
else ifeq ($(TARGET_OS), darwin)
	SWIG_FLAGS += -DSWIGMAC -DBOOST_HAS_PTHREADS
	CFLAGS += -fPIC -mmacosx-version-min=10.6
	LDFLAGS += $(LIBTORRENT_LDFLAGS) -lm -lssl -lcrypto -lstdc++
endif
{'fraction_non_alphanumeric': 0.19480823199251637, 'fraction_numerical': 0.013096351730589336, 'mean_word_length': 4.561768530559168, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1382425', 'n_tokens_mistral': 1983, 'n_tokens_neox': 1858, 'n_words': 371}