<commit_before>M4 = m4

prefix = /usr/local/lua52
libdir = $(prefix)/lib
datadir = $(prefix)/share
includedir = $(prefix)/include
lua52include = $(includedir)/lua/5.2
lua52path = $(datadir)/lua/5.2
lua52cpath = $(libdir)/lua/5.2

VENDOR.OS = $(shell ../mk/vendor.os)
VENDOR.CC = $(shell env CC="${CC}" ../mk/vendor.cc)

cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
            > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)

all: cqueues.so

CPPFLAGS = -D_GNU_SOURCE -I$(DESTDIR)$(lua52include) # -DSOCKET_DEBUG
CPPFLAGS += -DCQUEUES_COMMIT='"$(shell git show --pretty='%H' HEAD 2>/dev/null | sed -n '1p')"'

ifeq ($(VENDOR.CC), gcc)
DFLAGS = -Wall -Wextra $(call cc-option, -Wno-override-init) -Wno-unused -g
CFLAGS = -O2 -std=gnu99 -fPIC $(DFLAGS)
endif

ifeq ($(VENDOR.CC), clang)
DFLAGS = -Wall -Wextra -Wno-initializer-overrides -Wno-unused -g
CFLAGS = -O2 -std=gnu99 -fPIC $(DFLAGS)
endif

ifeq ($(VENDOR.CC), sunpro)
DFLAGS = -g
CFLAGS = -xcode=pic13 $(DFLAGS)
endif

ifeq ($(VENDOR.OS), SunOS)
CPPFLAGS += -Usun
endif

ifeq ($(VENDOR.OS), Darwin)
DFLAGS += -Wno-deprecated-declarations
endif

ifeq ($(VENDOR.OS), $(filter $(VENDOR.OS), OpenBSD NetBSD FreeBSD Darwin))
CPPFLAGS += -DDNS_RANDOM=arc4random
else<commit_msg>fix SunOS flags to expose CMSG macros<commit_after>M4 = m4

prefix = /usr/local/lua52
libdir = $(prefix)/lib
datadir = $(prefix)/share
includedir = $(prefix)/include
lua52include = $(includedir)/lua/5.2
lua52path = $(datadir)/lua/5.2
lua52cpath = $(libdir)/lua/5.2

VENDOR.OS = $(shell ../mk/vendor.os)
VENDOR.CC = $(shell env CC="${CC}" ../mk/vendor.cc)

cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \
            > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;)

all: cqueues.so

CPPFLAGS = -D_GNU_SOURCE -I$(DESTDIR)$(lua52include) # -DSOCKET_DEBUG
CPPFLAGS += -DCQUEUES_COMMIT='"$(shell git show --pretty='%H' HEAD 2>/dev/null | sed -n '1p')"'

ifeq ($(VENDOR.CC), gcc)
DFLAGS = -Wall -Wextra $(call cc-option, -Wno-override-init) -Wno-unused -g
CFLAGS = -O2 -std=gnu99 -fPIC $(DFLAGS)
endif

ifeq ($(VENDOR.CC), clang)
DFLAGS = -Wall -Wextra -Wno-initializer-overrides -Wno-unused -g
CFLAGS = -O2 -std=gnu99 -fPIC $(DFLAGS)
endif

ifeq ($(VENDOR.CC), sunpro)
DFLAGS = -g
CFLAGS = -xcode=pic13 $(DFLAGS)
endif

ifeq ($(VENDOR.OS), SunOS)
CPPFLAGS += -Usun -D_XPG4_2 -D__EXTENSIONS__
endif

ifeq ($(VENDOR.OS), Darwin)
DFLAGS += -Wno-deprecated-declarations
endif

ifeq ($(VENDOR.OS), $(filter $(VENDOR.OS), OpenBSD NetBSD FreeBSD Darwin))
CPPFLAGS += -DDNS_RANDOM=arc4random
else
{'fraction_non_alphanumeric': 0.19821220365332298, 'fraction_numerical': 0.027205596579867857, 'mean_word_length': 3.921606118546845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5779128', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1079, 'n_words': 253}