Commit 0ad7829a authored by Igor Zlatkovic's avatar Igor Zlatkovic
Browse files

introduced a more flexible thread build

parent 2103b053
......@@ -71,7 +71,7 @@ UTILS_INTDIR = utils.int
# The preprocessor and its options.
CPP = cl.exe /EP
CPPFLAGS = /nologo /I$(XML_SRCDIR)\include
!if "$(WITH_THREADS)" == "1"
!if "$(WITH_THREADS)" != "no"
CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
!endif
......@@ -79,9 +79,16 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
CC = cl.exe
CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W3 /MD
CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
!if "$(WITH_THREADS)" == "1"
!if "$(WITH_THREADS)" != "no"
CFLAGS = $(CFLAGS) /D "_REENTRANT"
!endif
!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls"
CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS" /D "HAVE_COMPILER_TLS"
!else if "$(WITH_THREADS)" == "native"
CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS"
!else if "$(WITH_THREADS)" == "posix"
CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
!endif
!if "$(WITH_ZLIB)" == "1"
CFLAGS = $(CFLAGS) /D "HAVE_ZLIB_H"
!endif
......@@ -100,6 +107,9 @@ LIBS = $(LIBS) iconv.lib
!if "$(WITH_ZLIB)" == "1"
LIBS = $(LIBS) zlib.lib
!endif
!if "$(WITH_THREADS)" == "posix"
LIBS = $(LIBS) pthreadVC.lib
!endif
# The archiver and its options.
AR = lib.exe
......@@ -192,6 +202,11 @@ UTILS = $(BINDIR)\xmllint.exe\
$(BINDIR)\testSchemas.exe\
$(BINDIR)\testURI.exe\
$(BINDIR)\testXPath.exe
!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
!else if "$(WITH_THREADS)" == "posix"
UTILS = $(UTILS) $(BINDIR)\testThreads.exe
!endif
all : libxml libxmla utils
......@@ -282,7 +297,7 @@ $(UTILS_INTDIR) :
!else
{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
$(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
$(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(UTILS_INTDIR)\$(<B).obj
$(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
!endif
# Builds xmllint and friends. Uses the implicit rule for commands.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment