From cc532f426ce2ed2fff9acaef4afbfdad954afcd5 Mon Sep 17 00:00:00 2001 From: Igor Zlatkovic Date: Sun, 24 Mar 2002 21:04:43 +0000 Subject: [PATCH] Windows command-line build components added. --- win32/Makefile.msvc | 251 ++++++++++++++++++++++++++++ win32/Readme.txt | 129 +++++++++++++++ win32/configure.js | 365 +++++++++++++++++++++++++++++++++++++++++ win32/libexslt.def.src | 36 ++++ win32/libxslt.def.src | 314 +++++++++++++++++++++++++++++++++++ win32/readme.msvc | 43 ----- 6 files changed, 1095 insertions(+), 43 deletions(-) create mode 100644 win32/Makefile.msvc create mode 100644 win32/Readme.txt create mode 100644 win32/configure.js create mode 100644 win32/libexslt.def.src create mode 100644 win32/libxslt.def.src delete mode 100644 win32/readme.msvc diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc new file mode 100644 index 00000000..d6e1e82c --- /dev/null +++ b/win32/Makefile.msvc @@ -0,0 +1,251 @@ +# Makefile for libxslt, specific for Windows, MSVC and NMAKE. +# +# Take a look at the beginning and modify the variables to suit your +# environment. Having done that, you can do a +# +# nmake [all] to build the libxml and the accompanying utilities. +# nmake clean to remove all compiler output files and return to a +# clean state. +# nmake rebuild to rebuild everything from scratch. This basically does +# a 'nmake clean' and then a 'nmake all'. +# nmake install to install the library and its header files. +# +# March 2002, Igor Zlatkovic + +AUTOCONF = .\configure.txt + +# If you cannot run the configuration script, which would take the burden of +# editing this file from your back, then remove the following line... +!include $(AUTOCONF) +# ...and enable the following lines and adapt them to your environment. +#BASEDIR = .. +#XSLT_SRCDIR = $(BASEDIR)\libxslt +#EXSLT_SRCDIR = $(BASEDIR)\libexslt +#UTILS_SRCDIR = $(BASEDIR)\xsltproc +#BINDIR = binaries +#LIBXSLT_MAJOR_VERSION = 0 # set this to the right value. +#LIBXSLT_MINOR_VERSION = 0 # set this to the right value. +#LIBXSLT_MICRO_VERSION = 0 # set this to the right value. +#LIBEXSLT_MAJOR_VERSION = 0 # set this to the right value. +#LIBEXSLT_MINOR_VERSION = 0 # set this to the right value. +#LIBEXSLT_MICRO_VERSION = 0 # set this to the right value. +#WITH_XSLT_DEBUG = 1 +#WITH_MEM_DEBUG = 0 +#WITH_DEBUGGER = 0 +#DEBUG = 0 +#STATIC = 0 +#PREFIX = . # set this to the right value. +#BINPREFIX = $(PREFIX)\bin +#INCPREFIX = $(PREFIX)\include +#LIBPREFIX = $(PREFIX)\lib +#SOPREFIX = $(PREFIX)\lib +#INCLUDE = $(INCLUDE);$(INCPREFIX) +#LIB = $(LIB);$(LIBPREFIX) + + +# There should never be a need to modify anything below this line. +# ---------------------------------------------------------------- + + +# Names of various input and output components. +XSLT_NAME = xslt +XSLT_BASENAME = lib$(XSLT_NAME) +XSLT_SO = $(XSLT_BASENAME).dll +XSLT_IMP = $(XSLT_BASENAME).lib +XSLT_DEF = $(XSLT_BASENAME).def +XSLT_A = $(XSLT_BASENAME)_a.lib +EXSLT_NAME = exslt +EXSLT_BASENAME = lib$(EXSLT_NAME) +EXSLT_SO = $(EXSLT_BASENAME).dll +EXSLT_IMP = $(EXSLT_BASENAME).lib +EXSLT_DEF = $(EXSLT_BASENAME).def +EXSLT_A = $(EXSLT_BASENAME)_a.lib + +# Places where intermediate files produced by the compiler go +XSLT_INTDIR = $(XSLT_BASENAME).int +EXSLT_INTDIR = $(EXSLT_BASENAME).int +UTILS_INTDIR = utils.int + +# The preprocessor and its options. +CPP = cl.exe /EP +CPPFLAGS = /nologo + +# The compiler and its options. +CC = cl.exe +CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W3 /MD +CFLAGS = $(CFLAGS) /I$(BASEDIR) /I$(XSLT_SRCDIR) + +# The linker and its options. +LD = link.exe +LDFLAGS = /nologo +LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) +LIBS = +!if "$(STATIC)" == "1" +LIBS = libxml2_a.lib iconv_a.lib wsock32.lib +!else +LIBS = libxml2.lib +!endif + +# The archiver and its options. +AR = lib.exe +ARFLAGS = /nologo + +# Optimisation and debug symbols. +!if "$(DEBUG)" == "1" +CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7 +LDFLAGS = $(LDFLAGS) /DEBUG +!else +CFLAGS = $(CFLAGS) /D "NDEBUG" /O2 +LDFLAGS = $(LDFLAGS) /OPT:NOWIN98 +!endif + +# Libxslt object files. +XSLT_OBJS = $(XSLT_INTDIR)\attributes.obj\ + $(XSLT_INTDIR)\documents.obj\ + $(XSLT_INTDIR)\extensions.obj\ + $(XSLT_INTDIR)\extra.obj\ + $(XSLT_INTDIR)\functions.obj\ + $(XSLT_INTDIR)\imports.obj\ + $(XSLT_INTDIR)\keys.obj\ + $(XSLT_INTDIR)\namespaces.obj\ + $(XSLT_INTDIR)\numbers.obj\ + $(XSLT_INTDIR)\pattern.obj\ + $(XSLT_INTDIR)\preproc.obj\ + $(XSLT_INTDIR)\templates.obj\ + $(XSLT_INTDIR)\transform.obj\ + $(XSLT_INTDIR)\variables.obj\ + $(XSLT_INTDIR)\xslt.obj\ + $(XSLT_INTDIR)\xsltutils.obj + +# Libexslt object files. +EXSLT_OBJS = $(EXSLT_INTDIR)\common.obj\ + $(EXSLT_INTDIR)\date.obj\ + $(EXSLT_INTDIR)\exslt.obj\ + $(EXSLT_INTDIR)\functions.obj\ + $(EXSLT_INTDIR)\math.obj\ + $(EXSLT_INTDIR)\saxon.obj\ + $(EXSLT_INTDIR)\sets.obj\ + $(EXSLT_INTDIR)\strings.obj + +# Xsltproc and friends executables. +UTILS = $(BINDIR)\xsltproc.exe + +all : libxslt libexslt utils + +libxslt : $(BINDIR)\$(XSLT_SO) $(BINDIR)\$(XSLT_A) + +libexslt : $(BINDIR)\$(EXSLT_SO) $(BINDIR)\$(EXSLT_A) + +utils : $(UTILS) + +clean : + if exist $(XSLT_INTDIR) rmdir /S /Q $(XSLT_INTDIR) + if exist $(EXSLT_INTDIR) rmdir /S /Q $(EXSLT_INTDIR) + if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR) + if exist $(BINDIR) rmdir /S /Q $(BINDIR) + +rebuild : clean all + +install : all + if not exist $(INCPREFIX)\$(XSLT_BASENAME) mkdir $(INCPREFIX)\$(XSLT_BASENAME) + if not exist $(INCPREFIX)\$(EXSLT_BASENAME) mkdir $(INCPREFIX)\$(EXSLT_BASENAME) + if not exist $(BINPREFIX) mkdir $(BINPREFIX) + if not exist $(LIBPREFIX) mkdir $(LIBPREFIX) + copy $(XSLT_SRCDIR)\*.h $(INCPREFIX)\$(XSLT_BASENAME) + copy $(EXSLT_SRCDIR)\*.h $(INCPREFIX)\$(EXSLT_BASENAME) + copy $(BINDIR)\$(XSLT_SO) $(SOPREFIX) + copy $(BINDIR)\$(XSLT_A) $(LIBPREFIX) + copy $(BINDIR)\$(XSLT_IMP) $(LIBPREFIX) + copy $(BINDIR)\$(EXSLT_SO) $(SOPREFIX) + copy $(BINDIR)\$(EXSLT_A) $(LIBPREFIX) + copy $(BINDIR)\$(EXSLT_IMP) $(LIBPREFIX) + copy $(BINDIR)\*.exe $(BINPREFIX) + +# This is a target for me, to make a binary distribution. Not for the public use, +# keep your hands off :-) +BDVERSION = $(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION).$(LIBXSLT_MICRO_VERSION) +BDPREFIX = $(XSLT_BASENAME)-$(BDVERSION).win32 +bindist : all + $(MAKE) /nologo PREFIX=$(BDPREFIX) BINPREFIX=$(BDPREFIX)\util install + cscript //NoLogo configure.js genreadme $(XSLT_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt + +# Makes the compiler output directory. +$(BINDIR) : + if not exist $(BINDIR) mkdir $(BINDIR) + + +# Makes the libxslt intermediate directory. +$(XSLT_INTDIR) : + if not exist $(XSLT_INTDIR) mkdir $(XSLT_INTDIR) + +# An implicit rule for libxslt compilation. +{$(XSLT_SRCDIR)}.c{$(XSLT_INTDIR)}.obj:: + $(CC) $(CFLAGS) /Fo$(XSLT_INTDIR)\ /c $< + +# Compiles libxslt source. Uses the implicit rule for commands. +$(XSLT_OBJS) : $(XSLT_INTDIR) + +# Creates the export definition file (DEF) for libxslt. +$(XSLT_INTDIR)\$(XSLT_DEF) : $(XSLT_INTDIR) $(XSLT_DEF).src + $(CPP) $(CPPFLAGS) $(XSLT_DEF).src > $(XSLT_INTDIR)\$(XSLT_DEF) + +# Creates the libxslt shared object. +$(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) + $(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \ + /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ + $(XSLT_OBJS) $(LIBS) + +# Creates the libxslt archive. +$(BINDIR)\$(XSLT_A) : $(BINDIR) $(XSLT_OBJS) + $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XSLT_A) $(XSLT_OBJS) + + +# Creates the libxslt intermediate directory. +$(EXSLT_INTDIR) : + if not exist $(EXSLT_INTDIR) mkdir $(EXSLT_INTDIR) + +# An implicit rule for libexslt compilation. +{$(EXSLT_SRCDIR)}.c{$(EXSLT_INTDIR)}.obj:: + $(CC) /D /I$(EXSLT_SRCDIR) $(CFLAGS) /Fo$(EXSLT_INTDIR)\ /c $< + +# Compiles libxslt source. Uses the implicit rule for commands. +$(EXSLT_OBJS) : $(EXSLT_INTDIR) + +# Creates the export definition file (DEF) for libxslt. +$(EXSLT_INTDIR)\$(EXSLT_DEF) : $(EXSLT_INTDIR) $(EXSLT_DEF).src + $(CPP) $(CPPFLAGS) $(EXSLT_DEF).src > $(EXSLT_INTDIR)\$(EXSLT_DEF) + +# Creates the libexslt shared object. +$(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt + $(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \ + /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ + $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) + +# Creates the libexslt archive. +$(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS) + $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS) + + +# Creates the utils intermediate directory. +$(UTILS_INTDIR) : + if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR) + +# An implicit rule for xmllint and friends. +!if "$(STATIC)" == "1" +{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< + $(LD) $(LDFLAGS) /OUT:$@ $(XSLT_A) $(EXSLT_A) $(LIBS) $(UTILS_INTDIR)\$( + diff --git a/win32/configure.js b/win32/configure.js new file mode 100644 index 00000000..8bdf80de --- /dev/null +++ b/win32/configure.js @@ -0,0 +1,365 @@ +/* Configure script for libxslt, specific for Windows with Scripting Host. + * + * This script will configure the libxslt build process and create necessary files. + * Run it with an 'help', or an invalid option and it will tell you what options + * it accepts. + * + * March 2002, Igor Zlatkovic + */ + +/* The source directory, relative to the one where this file resides. */ +var baseDir = ".."; +var srcDirXslt = baseDir + "\\libxslt"; +var srcDirExslt = baseDir + "\\libexslt"; +var srcDirUtils = baseDir + "\\xsltproc"; +/* The directory where we put the binaries after compilation. */ +var binDir = "binaries"; +/* Base name of what we are building. */ +var baseNameXslt = "libxslt"; +var baseNameExslt = "libexslt"; +/* Configure file which contains the version and the output file where + we can store our build configuration. */ +var configFile = baseDir + "\\configure.in"; +var versionFile = ".\\configure.txt"; +/* Input and output files regarding the lib(e)xml features. The second + output file is there for the compatibility reasons, otherwise it + is identical to the first. */ +var optsFileInXslt = srcDirXslt + "\\xsltconfig.h.in"; +var optsFileXslt = srcDirXslt + "\\xsltconfig.h"; +var optsFileXslt2 = srcDirXslt + "\\xsltwin32config.h"; +var optsFileInExslt = srcDirExslt + "\\exsltconfig.h.in"; +var optsFileExslt = srcDirExslt + "\\exsltconfig.h"; +var optsFileExslt2 = srcDirExslt + "\\exsltwin32config.h"; +/* Version strings for the binary distribution. Will be filled later + in the code. */ +var verMajorXslt; +var verMinorXslt; +var verMicroXslt; +var verMajorExslt; +var verMinorExslt; +var verMicroExslt; +/* Libxslt features. */ +var withXsltDebug = true; +var withMemDebug = false; +var withDebugger = true; +/* Win32 build options. */ +var buildDebug = 0; +var buildStatic = 0; +var buildPrefix = "."; +var buildBinPrefix = "$(PREFIX)\\bin"; +var buildIncPrefix = "$(PREFIX)\\include"; +var buildLibPrefix = "$(PREFIX)\\lib"; +var buildSoPrefix = "$(PREFIX)\\lib"; +var buildInclude = "."; +var buildLib = "."; +/* Local stuff */ +var error = 0; + +/* Helper function, transforms the option variable into the 'Enabled' + or 'Disabled' string. */ +function boolToStr(opt) +{ + if (opt == false) + return "Disabled"; + else if (opt == true) + return "Enabled"; + error = 1; + return "Undefined"; +} + +/* Helper function, transforms the argument string into the boolean + value. */ +function strToBool(opt) +{ + if (opt == "0" || opt == "no") + return false; + else if (opt == "1" || opt == "yes") + return true; + error = 1; + return false; +} + +/* Displays the details about how to use this script. */ +function usage() +{ + var txt; + txt = "Usage:\n"; + txt += " cscript " + WScript.ScriptName + " \n"; + txt += " cscript " + WScript.ScriptName + " help\n\n"; + txt += "Options can be specified in the form