mirror of
https://github.com/nodejs/http-parser.git
synced 2025-10-19 12:13:00 +08:00
header: treat Wine like MinGW
PR-URL: https://github.com/joyent/http-parser/pull/259 Reviewed-By: Fedor Indutny <fedor@indutny.com>
This commit is contained in:

committed by
Fedor Indutny

parent
eb5e9928b4
commit
b36c2a9ece
2
.gitignore
vendored
2
.gitignore
vendored
@@ -12,6 +12,8 @@ parsertrace_g
|
|||||||
*.mk
|
*.mk
|
||||||
*.Makefile
|
*.Makefile
|
||||||
*.so.*
|
*.so.*
|
||||||
|
*.exe.*
|
||||||
|
*.exe
|
||||||
*.a
|
*.a
|
||||||
|
|
||||||
|
|
||||||
|
20
Makefile
20
Makefile
@@ -19,13 +19,20 @@
|
|||||||
# IN THE SOFTWARE.
|
# IN THE SOFTWARE.
|
||||||
|
|
||||||
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
||||||
|
HELPER ?=
|
||||||
|
BINEXT ?=
|
||||||
ifeq (darwin,$(PLATFORM))
|
ifeq (darwin,$(PLATFORM))
|
||||||
SONAME ?= libhttp_parser.2.5.0.dylib
|
SONAME ?= libhttp_parser.2.5.0.dylib
|
||||||
SOEXT ?= dylib
|
SOEXT ?= dylib
|
||||||
|
else ifeq (wine,$(PLATFORM))
|
||||||
|
CC = winegcc
|
||||||
|
BINEXT = .exe.so
|
||||||
|
HELPER = wine
|
||||||
else
|
else
|
||||||
SONAME ?= libhttp_parser.so.2.5.0
|
SONAME ?= libhttp_parser.so.2.5.0
|
||||||
SOEXT ?= so
|
SOEXT ?= so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CC?=gcc
|
CC?=gcc
|
||||||
AR?=ar
|
AR?=ar
|
||||||
|
|
||||||
@@ -58,8 +65,8 @@ LDFLAGS_LIB += -Wl,-soname=$(SONAME)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
test: test_g test_fast
|
test: test_g test_fast
|
||||||
./test_g
|
$(HELPER) ./test_g$(BINEXT)
|
||||||
./test_fast
|
$(HELPER) ./test_fast$(BINEXT)
|
||||||
|
|
||||||
test_g: http_parser_g.o test_g.o
|
test_g: http_parser_g.o test_g.o
|
||||||
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@
|
$(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@
|
||||||
@@ -86,7 +93,7 @@ http_parser.o: http_parser.c http_parser.h Makefile
|
|||||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
|
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
|
||||||
|
|
||||||
test-run-timed: test_fast
|
test-run-timed: test_fast
|
||||||
while(true) do time ./test_fast > /dev/null; done
|
while(true) do time $(HELPER) ./test_fast$(BINEXT) > /dev/null; done
|
||||||
|
|
||||||
test-valgrind: test_g
|
test-valgrind: test_g
|
||||||
valgrind ./test_g
|
valgrind ./test_g
|
||||||
@@ -107,10 +114,10 @@ url_parser_g: http_parser_g.o contrib/url_parser.c
|
|||||||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
|
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@
|
||||||
|
|
||||||
parsertrace: http_parser.o contrib/parsertrace.c
|
parsertrace: http_parser.o contrib/parsertrace.c
|
||||||
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace
|
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace$(BINEXT)
|
||||||
|
|
||||||
parsertrace_g: http_parser_g.o contrib/parsertrace.c
|
parsertrace_g: http_parser_g.o contrib/parsertrace.c
|
||||||
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g
|
$(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g$(BINEXT)
|
||||||
|
|
||||||
tags: http_parser.c http_parser.h test.c
|
tags: http_parser.c http_parser.h test.c
|
||||||
ctags $^
|
ctags $^
|
||||||
@@ -133,7 +140,8 @@ uninstall:
|
|||||||
clean:
|
clean:
|
||||||
rm -f *.o *.a tags test test_fast test_g \
|
rm -f *.o *.a tags test test_fast test_g \
|
||||||
http_parser.tar libhttp_parser.so.* \
|
http_parser.tar libhttp_parser.so.* \
|
||||||
url_parser url_parser_g parsertrace parsertrace_g
|
url_parser url_parser_g parsertrace parsertrace_g \
|
||||||
|
*.exe *.exe.so
|
||||||
|
|
||||||
contrib/url_parser.c: http_parser.h
|
contrib/url_parser.c: http_parser.h
|
||||||
contrib/parsertrace.c: http_parser.h
|
contrib/parsertrace.c: http_parser.h
|
||||||
|
@@ -30,7 +30,8 @@ extern "C" {
|
|||||||
#define HTTP_PARSER_VERSION_PATCH 0
|
#define HTTP_PARSER_VERSION_PATCH 0
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)
|
#if defined(_WIN32) && !defined(__MINGW32__) && \
|
||||||
|
(!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__)
|
||||||
#include <BaseTsd.h>
|
#include <BaseTsd.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
typedef __int8 int8_t;
|
typedef __int8 int8_t;
|
||||||
|
Reference in New Issue
Block a user