diff options
author | Igor Zlatkovic <igor@src.gnome.org> | 2002-03-24 21:04:43 +0000 |
---|---|---|
committer | Igor Zlatkovic <igor@src.gnome.org> | 2002-03-24 21:04:43 +0000 |
commit | cc532f426ce2ed2fff9acaef4afbfdad954afcd5 (patch) | |
tree | 9c13be8b4188af1bfefb72c3062ff013c997b34a | |
parent | 81345a9e4439aebe7bf9d22a76ee3d9cbc122e2b (diff) | |
download | libxslt-cc532f426ce2ed2fff9acaef4afbfdad954afcd5.tar.gz libxslt-cc532f426ce2ed2fff9acaef4afbfdad954afcd5.tar.bz2 libxslt-cc532f426ce2ed2fff9acaef4afbfdad954afcd5.zip |
Windows command-line build components added.
-rw-r--r-- | win32/Makefile.msvc | 251 | ||||
-rw-r--r-- | win32/Readme.txt | 129 | ||||
-rw-r--r-- | win32/configure.js | 365 | ||||
-rw-r--r-- | win32/libexslt.def.src | 36 | ||||
-rw-r--r-- | win32/libxslt.def.src | 314 | ||||
-rw-r--r-- | win32/readme.msvc | 43 |
6 files changed, 1095 insertions, 43 deletions
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 <igor@stud.fh-frankfurt.de> + +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)\$(<B).obj +!else +{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< + $(LD) $(LDFLAGS) /OUT:$@ $(XSLT_IMP) $(EXSLT_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj +!endif + +# Builds xsltproc and friends. Uses the implicit rule for commands. +$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt libexslt + +# Source dependences should be autogenerated somehow here, but how to +# do it? I have no clue. + diff --git a/win32/Readme.txt b/win32/Readme.txt new file mode 100644 index 00000000..a8006d08 --- /dev/null +++ b/win32/Readme.txt @@ -0,0 +1,129 @@ + + Windows port + ------------ + +This directory contains the files required to build this software on the +native Windows platform. + +As a rule of thumb, the root of this directory contains files needed +to build the library using the command-line tools, while various +subdirectories contain project files for various IDEs. + + + 1. Building from the command-line + ================================= + +This is the easiest, preferred and currently supported method. + +In order to build from the command-line you need to make sure that +your compiler works from the command line. This is not always the +case, often the required environment variables are missing. If you are +not sure, test if this works first. If it doesn't, you will first have +to configure your compiler suite to run from the command-line - please +refer to your compiler's documentation regarding that. + +The first thing you want to do is configure the source. You can have +the configuration script do this automatically for you. The +configuration script is written in JScript, a Microsoft's +implementation of the ECMS scripting language. Almost every Windows +machine can execute this through the Windows Scripting Host. If your +system lacks the ability to execute JScript for some reason, you must +perform the configuration manually. + +The second step is compiling the source and, optionally, installing it +to the location of your choosing. + + + 1.1 Configuring the source automatically + ---------------------------------------- + +The configuration script accepts numerous options. Some of these +affect features which will be available in the compiled software, +others affect the way the software is built and installed. To see a +full list of options supported by the configuration script, run + + cscript configure.js help + +from the win32 subdirectory. The configuration script will present you +the options it accepts and give a biref explanation of these. In every +case you will have two sets of options. The first set is specific to +the software you are building and the second one is specific to the +Windows port. + +Once you have decided which options suit you, run the script with that +options. Here is an example: + + cscript configure.js prefix=c:\opt include=c:\opt\include + lib=c:\opt\lib debug=yes + +The previous example will configure the process to install the library +in c:\opt, use c:\opt\include and c:\opt\lib as additional search +paths for the compiler and the linker and build executables with debug +symbols. + +Note: Please do not use path names which contain spaces. This will +fail. Allowing this would require me to put almost everything in the +Makefile in quotas and that looks quite ugly with my +syntax-highlighting engine. If you absolutely must use spaces in paths +send me an email and tell me why. If there are enough of you out there +who need this, or if a single one has a very good reason, I will +modify the Makefile to allow spaces in paths. + + + 1.2 (Not) Configuring the source manually + ----------------------------------------- + +The manual configuration is pretty straightforward, but I would +suggest rather to get a JScript engine and let the configure script do +it for you. This process involves editing the apropriate Makefile to +suit your needs, as well as manually generating certain *.h files from +their *.h.in sources. + +If you really have no idea what I am talking about and ask yourself +what in Gods name do I mean with '*.h files and their *.h.in sources', +then you really should do an automatic configuration. Which files must +be generated and what needs to be done with their sources in order to +generate them is something people who have built this software before +allready know. You will not find any explanations for that +here. Please configure the source manually only if you allready know +what you must do. Otherwise, you have the choice of either getting a +precompiled binary distribution, or performing the automatic +configuration. + + + 1.3 Compiling + ------------- + +After the configuration stage has been completed, you want to build +the software. To do that, type + + nmake + +in the win32 subdirectory.When the building completes, you will find +the executable files in win32\binaries directory. + +You can install the software into the directory you specified to the +configure script during the configure stage by typing + + nmake install + +That would be it, enjoy. + + + 2. Building with the IDE + ======================== + +Each supported IDE has its project files placed in a subdirectory of +win32. If you use a particular IDE, you should be able to +instinctively recognise its project files. When you have found your +favourites, load them into the IDE and do whatever you would do with +any other project files. If you are a novice and puzzled about how to +use particular project files with a particular IDE, check for a readme +file in that IDEs subdirectory. I won't discuss any particular IDE +here, because I would like to keep this document as general as +possible, and there is also a chance that support exists for IDEs +which I have never seen. + + +March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de> + 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 <igor@stud.fh-frankfurt.de> + */ + +/* 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 + " <options>\n"; + txt += " cscript " + WScript.ScriptName + " help\n\n"; + txt += "Options can be specified in the form <option>=<value>, where the value is\n"; + txt += "either 'yes' or 'no'.\n\n"; + txt += "XSLT processor options, default value given in parentheses:\n\n"; + txt += " xslt_debug: Enable XSLT debbugging module (" + (withXsltDebug? "yes" : "no") + ")\n"; + txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n"; + txt += " debugger: Enable external debugger support (" + (withDebugger? "yes" : "no") + ")\n"; + txt += "\nWin32 build options, default value given in parentheses:\n\n"; + txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n"; + txt += " static: Link xsltproc statically to libxslt (" + (buildStatic? "yes" : "no") + ")\n"; + txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n"; + txt += " bindir: Directory where xsltproc and friends should be installed\n"; + txt += " (" + buildBinPrefix + ")\n"; + txt += " incdir: Directory where headers should be installed\n"; + txt += " (" + buildIncPrefix + ")\n"; + txt += " libdir: Directory where static and import libraries should be\n"; + txt += " installed (" + buildLibPrefix + ")\n"; + txt += " sodir: Directory where shared libraries should be installed\n"; + txt += " (" + buildSoPrefix + ")\n"; + txt += " include: Additional search path for the compiler, particularily\n"; + txt += " where libxml headers can be found (" + buildInclude + ")\n"; + txt += " lib: Additional search path for the linker, particularily\n"; + txt += " where libxml library can be found (" + buildLib + ")\n"; + WScript.Echo(txt); +} + +/* Discovers the version we are working with by reading the apropriate + configuration file. Despite its name, this also writes the configuration + file included by our makefile. */ +function discoverVersion() +{ + var fso, cf, vf, ln, s; + fso = new ActiveXObject("Scripting.FileSystemObject"); + cf = fso.OpenTextFile(configFile, 1); + vf = fso.CreateTextFile(versionFile, true); + vf.WriteLine("# " + versionFile); + vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + "."); + vf.WriteBlankLines(1); + while (cf.AtEndOfStream != true) { + ln = cf.ReadLine(); + s = new String(ln); + if (s.search(/^LIBXSLT_MAJOR_VERSION/) != -1) { + vf.WriteLine(s); + verMajorXslt = s.substring(s.indexOf("=") + 1, s.length) + } else if(s.search(/^LIBXSLT_MINOR_VERSION/) != -1) { + vf.WriteLine(s); + verMinorXslt = s.substring(s.indexOf("=") + 1, s.length) + } else if(s.search(/^LIBXSLT_MICRO_VERSION/) != -1) { + vf.WriteLine(s); + verMicroXslt = s.substring(s.indexOf("=") + 1, s.length) + } else if (s.search(/^LIBEXSLT_MAJOR_VERSION/) != -1) { + vf.WriteLine(s); + verMajorExslt = s.substring(s.indexOf("=") + 1, s.length) + } else if(s.search(/^LIBEXSLT_MINOR_VERSION/) != -1) { + vf.WriteLine(s); + verMinorExslt = s.substring(s.indexOf("=") + 1, s.length) + } else if(s.search(/^LIBEXSLT_MICRO_VERSION/) != -1) { + vf.WriteLine(s); + verMicroExslt = s.substring(s.indexOf("=") + 1, s.length) + } + } + cf.Close(); + vf.WriteLine("BASEDIR=" + baseDir); + vf.WriteLine("XSLT_SRCDIR=" + srcDirXslt); + vf.WriteLine("EXSLT_SRCDIR=" + srcDirExslt); + vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils); + vf.WriteLine("BINDIR=" + binDir); + vf.WriteLine("WITH_DEBUG=" + (withXsltDebug? "1" : "0")); + vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0")); + vf.WriteLine("WITH_DEBUG=" + (withDebugger? "1" : "0")); + vf.WriteLine("DEBUG=" + (buildDebug? "1" : "0")); + vf.WriteLine("STATIC=" + (buildStatic? "1" : "0")); + vf.WriteLine("PREFIX=" + buildPrefix); + vf.WriteLine("BINPREFIX=" + buildBinPrefix); + vf.WriteLine("INCPREFIX=" + buildIncPrefix); + vf.WriteLine("LIBPREFIX=" + buildLibPrefix); + vf.WriteLine("SOPREFIX=" + buildSoPrefix); + vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude); + vf.WriteLine("LIB=$(LIB);" + buildLib); + vf.Close(); +} + +/* Configures libxslt. This one will generate xsltconfig.h from xsltconfig.h.in + taking what the user passed on the command line into account. */ +function configureXslt() +{ + var fso, ofi, of, ln, s; + fso = new ActiveXObject("Scripting.FileSystemObject"); + ofi = fso.OpenTextFile(optsFileInXslt, 1); + of = fso.CreateTextFile(optsFileXslt, true); + while (ofi.AtEndOfStream != true) { + ln = ofi.ReadLine(); + s = new String(ln); + if (s.search(/\@VERSION\@/) != -1) { + of.WriteLine(s.replace(/\@VERSION\@/, + verMajorXslt + "." + verMinorXslt + "." + verMicroXslt)); + } else if (s.search(/\@LIBXSLT_VERSION_NUMBER\@/) != -1) { + of.WriteLine(s.replace(/\@LIBXSLT_VERSION_NUMBER\@/, + verMajorXslt*10000 + verMinorXslt*100 + verMicroXslt*1)); + } else if (s.search(/\@WITH_XSLT_DEBUG\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_XSLT_DEBUG\@/, withXsltDebug? "1" : "0")); + } else if (s.search(/\@WITH_MEM_DEBUG\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_MEM_DEBUG\@/, withMemDebug? "1" : "0")); + } else if (s.search(/\@WITH_DEBUGGER\@/) != -1) { + of.WriteLine(s.replace(/\@WITH_DEBUGGER\@/, withDebugger? "1" : "0")); + } else + of.WriteLine(ln); + } + ofi.Close(); + of.Close(); + fso.CopyFile(optsFileXslt, optsFileXslt2, true); +} + +/* Configures libexslt. This one will generate exsltconfig.h from exsltconfig.h.in + taking what the user passed on the command line into account. */ +function configureExslt() +{ + var fso, ofi, of, ln, s; + fso = new ActiveXObject("Scripting.FileSystemObject"); + ofi = fso.OpenTextFile(optsFileInExslt, 1); + of = fso.CreateTextFile(optsFileExslt, true); + while (ofi.AtEndOfStream != true) { + ln = ofi.ReadLine(); + s = new String(ln); + if (s.search(/\@VERSION\@/) != -1) { + of.WriteLine(s.replace(/\@VERSION\@/, + verMajorExslt + "." + verMinorExslt + "." + verMicroExslt)); + } else if (s.search(/\@LIBEXSLT_VERSION_NUMBER\@/) != -1) { + of.WriteLine(s.replace(/\@LIBEXSLT_VERSION_NUMBER\@/, + verMajorExslt*10000 + verMinorExslt*100 + verMicroExslt*1)); + } else + of.WriteLine(ln); + } + ofi.Close(); + of.Close(); + fso.CopyFile(optsFileExslt, optsFileExslt2, true); +} + +/* Creates the readme file for the binary distribution of 'bname', for the + version 'ver' in the file 'file'. This one is called from the Makefile when + generating a binary distribution. The parameters are passed by make. */ +function genReadme(bname, ver, file) +{ + var fso, f; + fso = new ActiveXObject("Scripting.FileSystemObject"); + f = fso.CreateTextFile(file, true); + f.WriteLine(" " + bname + " " + ver); + f.WriteLine(" --------------"); + f.WriteBlankLines(1); + f.WriteLine(" This is " + bname + ", version " + ver + ", binary package for the native Win32/IA32"); + f.WriteLine("platform."); + f.WriteBlankLines(1); + f.WriteLine(" The directory named 'include' contains the header files. Place its"); + f.WriteLine("contents somewhere where it can be found by the compiler."); + f.WriteLine(" The directory which answers to the name 'lib' contains the static and"); + f.WriteLine("dynamic libraries. Place them somewhere where they can be found by the"); + f.WriteLine("linker. The files whose names end with '_a.lib' are aimed for static"); + f.WriteLine("linking, the other files are lib/dll pairs."); + f.WriteLine(" The directory called 'util' contains various programs which count as a"); + f.WriteLine("part of " + bname + "."); + f.WriteBlankLines(1); + f.WriteLine(" If there is something you cannot keep for yourself, such as a problem,"); + f.WriteLine("a cheer of joy, a comment or a suggestion, feel free to contact me using"); + f.WriteLine("the address below."); + f.WriteBlankLines(1); + f.WriteLine(" Igor Zlatkovic (igor@stud.fh-frankfurt.de)"); + f.Close(); +} + +/* + * main(), + * Execution begins here. + */ + +/* Parse the command-line arguments. */ +for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) { + var arg, opt; + arg = WScript.Arguments(i); + opt = arg.substring(0, arg.indexOf("=")); + if (opt.length == 0) + opt = arg.substring(0, arg.indexOf(":")); + if (opt.length > 0) { + if (opt == "xslt_debug") + withXsltDebug = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "mem_debug") + withMemDebug = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "debugger") + withDebugger = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "debug") + buildDebug = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "static") + buildStatic = strToBool(arg.substring(opt.length + 1, arg.length)); + else if (opt == "prefix") + buildPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "incdir") + buildIncPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "bindir") + buildBinPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "libdir") + buildLibPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "sodir") + buildSoPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "incdir") + buildIncPrefix = arg.substring(opt.length + 1, arg.length); + else if (opt == "include") + buildInclude = arg.substring(opt.length + 1, arg.length); + else if (opt == "lib") + buildLib = arg.substring(opt.length + 1, arg.length); + else + error = 1; + } else if (i == 0) { + if (arg == "genreadme") { + // This command comes from the Makefile and will not be checked + // for errors, because Makefile will always supply right parameters. + genReadme(WScript.Arguments(1), WScript.Arguments(2), WScript.Arguments(3)); + WScript.Quit(0); + } else if (arg == "help") { + usage(); + WScript.Quit(0); + } + } else + error = 1; +} +// If we have an error here, it is because the user supplied bad parameters. +if (error != 0) { + usage(); + WScript.Quit(error); +} + +// Discover the version. +discoverVersion(); +if (error != 0) { + WScript.Echo("Version discovery failed, aborting."); + WScript.Quit(error); +} +WScript.Echo(baseNameXslt + " version: " + verMajorXslt + "." + verMinorXslt + "." + verMicroXslt); +WScript.Echo(baseNameExslt + " version: " + verMajorExslt + "." + verMinorExslt + "." + verMicroExslt); + +// Configure libxslt. +configureXslt(); +if (error != 0) { + WScript.Echo("Configuration failed, aborting."); + WScript.Quit(error); +} + +// Configure libexslt. +configureExslt(); +if (error != 0) { + WScript.Echo("Configuration failed, aborting."); + WScript.Quit(error); +} + +// Create the Makefile. +var fso = new ActiveXObject("Scripting.FileSystemObject"); +fso.CopyFile(".\\Makefile.msvc", ".\\Makefile", true); +WScript.Echo("Created Makefile."); + +// Display the final configuration. +var txtOut = "\nXSLT processor configuration\n"; +txtOut += "----------------------------\n"; +txtOut += " Debugging module: " + boolToStr(withXsltDebug) + "\n"; +txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n"; +txtOut += " Debugger support: " + boolToStr(withDebugger) + "\n"; +txtOut += "\n"; +txtOut += "Win32 build configuration\n"; +txtOut += "-------------------------\n"; +txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n"; +txtOut += " Static xsltproc: " + boolToStr(buildStatic) + "\n"; +txtOut += " Install prefix: " + buildPrefix + "\n"; +txtOut += " Put tools in: " + buildBinPrefix + "\n"; +txtOut += " Put headers in: " + buildIncPrefix + "\n"; +txtOut += "Put static libs in: " + buildLibPrefix + "\n"; +txtOut += "Put shared libs in: " + buildSoPrefix + "\n"; +txtOut += " Include path: " + buildInclude + "\n"; +txtOut += " Lib path: " + buildLib + "\n"; +WScript.Echo(txtOut); + +// Done. diff --git a/win32/libexslt.def.src b/win32/libexslt.def.src new file mode 100644 index 00000000..b3a8486f --- /dev/null +++ b/win32/libexslt.def.src @@ -0,0 +1,36 @@ +/* win32/libxeslt.def.src + Pseudo-source used to create a .DEF file for proper dynamic linkage. + + Assuming you use Microsoft's C compiler, you run a + + cl /EP libexslt.def.src > libexslt.def + + in order to get the right .DEF file. Basically, all you do is + preprocess this file using a C/C++ preprocessor and the right + .DEF file should come out. + + Should you need a function which does not seem to be exported + from the libexslt.dll, its name is most certainly missing here. + Add the name of the offending function to this file and rebuild. + + 21.03.2002, Igor Zlatkovic (igor@stud.fh-frankfurt.de) +*/ + +LIBRARY libexslt +EXPORTS + +/* exslt.h + --------------------------------------------------------------------- */ + exsltLibraryVersion DATA + exsltLibexsltVersion DATA + exsltLibxsltVersion DATA + exsltLibxmlVersion DATA + exsltCommonRegister + exsltMathRegister + exsltSetsRegister + exsltFuncRegister + exsltStrRegister + exsltDateRegister + exsltSaxonRegister + exsltRegisterAll +
\ No newline at end of file diff --git a/win32/libxslt.def.src b/win32/libxslt.def.src new file mode 100644 index 00000000..a7acba2a --- /dev/null +++ b/win32/libxslt.def.src @@ -0,0 +1,314 @@ +/* win32/libxslt.def.src + Pseudo-source used to create a .DEF file for proper dynamic linkage. + + Assuming you use Microsoft's C compiler, you run a + + cl /EP libxslt.def.src > libxslt.def + + in order to get the right .DEF file. Basically, all you do is + preprocess this file using a C/C++ preprocessor and the right + .DEF file should come out. + + Should you need a function which does not seem to be exported + from the libxslt.dll, its name is most certainly missing here. + Add the name of the offending function to this file and rebuild. + + 21.03.2002, Igor Zlatkovic (igor@stud.fh-frankfurt.de) +*/ + +LIBRARY libxslt +EXPORTS + +/* attributes.h + --------------------------------------------------------------------- */ + xsltParseStylesheetAttributeSet + xsltFreeAttributeSetsHashes + xsltApplyAttributeSet + + +/* documents.h + --------------------------------------------------------------------- */ + xsltNewDocument + xsltLoadDocument + xsltFindDocument + xsltFreeDocuments + xsltLoadStyleDocument + xsltNewStyleDocument + xsltFreeStyleDocuments + + +/* extensions.h + --------------------------------------------------------------------- */ + xsltRegisterExtModule + xsltRegisterExtModuleFull + xsltUnregisterExtModule + xsltGetExtData + xsltStyleGetExtData + xsltShutdownCtxtExts + xsltShutdownExts + xsltXPathGetTransformContext + + /* extension functions */ + xsltRegisterExtModuleFunction + // xsltExtFunctionLookup + xsltExtModuleFunctionLookup + xsltUnregisterExtModuleFunction + + /* extension elements */ + xsltNewElemPreComp + xsltInitElemPreComp + xsltRegisterExtModuleElement + xsltExtElementLookup + xsltExtModuleElementLookup + xsltExtModuleElementPreComputeLookup + xsltUnregisterExtModuleElement + + /* top-level elements */ + xsltRegisterExtModuleTopLevel + xsltExtModuleTopLevelLookup + xsltUnregisterExtModuleTopLevel + + /* These 2 functions are deprecated for use within modules. */ + xsltRegisterExtFunction + xsltRegisterExtElement + + /* Extension Prefix handling API. + Those are used by the XSLT (pre)processor. */ + xsltRegisterExtPrefix + xsltCheckExtPrefix + xsltInitCtxtExts + xsltFreeCtxtExts + xsltFreeExts + xsltPreComputeExtModuleElement + + /* Test module http://xmlsoft.org/XSLT/ */ + xsltRegisterTestModule + + +/* extra.h + --------------------------------------------------------------------- */ + xsltFunctionNodeSet + xsltDebug + xsltRegisterExtras + xsltRegisterAllExtras + + +/* functions.h + --------------------------------------------------------------------- */ + /* Interfaces for the functions implementations. */ + xsltDocumentFunction + xsltKeyFunction + xsltUnparsedEntityURIFunction + xsltFormatNumberFunction + xsltGenerateIdFunction + xsltSystemPropertyFunction + xsltElementAvailableFunction + xsltFunctionAvailableFunction + + /* And the registration */ + xsltRegisterAllFunctions + + +/* imports.h + --------------------------------------------------------------------- */ + /* Module interfaces */ + xsltParseStylesheetImport + xsltParseStylesheetInclude + xsltNextImport + xsltNeedElemSpaceHandling + xsltFindElemSpaceHandling + xsltFindTemplate + + +/* keys.h + --------------------------------------------------------------------- */ + xsltAddKey + xsltGetKey + xsltInitCtxtKeys + xsltFreeKeys + xsltFreeDocumentKeys + + +/* namespaces.h + --------------------------------------------------------------------- */ + xsltNamespaceAlias + xsltGetNamespace + xsltGetSpecialNamespace + xsltCopyNamespace + xsltCopyNamespaceList + xsltFreeNamespaceAliasHashes + + +/* numberInternals.h + --------------------------------------------------------------------- */ + /*** No functions exported from this file ***/ + + +/* pattern.h + --------------------------------------------------------------------- */ + /* Pattern related interfaces. */ + xsltCompilePattern + xsltFreeCompMatchList + xsltTestCompMatchList + + /* Template related interfaces. */ + xsltAddTemplate + xsltGetTemplate + xsltFreeTemplateHashes + xsltCleanupTemplates + #if 0 + xsltMatchPattern + #endif + + +/* preproc.h + --------------------------------------------------------------------- */ + xsltDocumentComp + xsltStylePreCompute + xsltFreeStylePreComps + + +/* templates.h + --------------------------------------------------------------------- */ + xsltEvalXPathPredicate + xsltEvalTemplateString + xsltEvalAttrValueTemplate + xsltEvalStaticAttrValueTemplate + + /* TODO: this is obviously broken ... the namespaces should be passed too ! */ + xsltEvalXPathString + xsltTemplateProcess + xsltAttrListTemplateProcess + xsltAttrTemplateProcess + xsltAttrTemplateValueProcess + + +/* transform.h + --------------------------------------------------------------------- */ + /* XInclude default processing. */ + xsltSetXIncludeDefault + xsltGetXIncludeDefault + + /* Export context to users. */ + xsltNewTransformContext + xsltFreeTransformContext + xsltApplyStylesheetUser + + /* Private Interfaces. */ + xsltApplyStripSpaces + xsltExtElementLookup + xsltApplyStylesheet + xsltProfileStylesheet + xsltRunStylesheet + xsltApplyOneTemplate + xsltDocumentElem + xsltSort + xsltCopy + xsltText + xsltElement + xsltComment + xsltAttribute + xsltProcessingInstruction + xsltCopyOf + xsltValueOf + xsltNumber + xsltApplyImports + xsltCallTemplate + xsltApplyTemplates + xsltChoose + xsltIf + xsltForEach + xsltRegisterAllElement + + /* Hook for the debugger if activated. */ + xslHandleDebugger + + +/* variables.h + --------------------------------------------------------------------- */ + /* Interfaces for the variable module. */ + xsltEvalGlobalVariables + xsltEvalUserParams + xsltQuoteUserParams + xsltEvalOneUserParam + xsltQuoteOneUserParam + xsltParseGlobalVariable + xsltParseGlobalParam + xsltParseStylesheetVariable + xsltParseStylesheetParam + xsltParseStylesheetCallerParam + xsltAddStackElemList + xsltFreeGlobalVariables + xsltVariableLookup + xsltXPathVariableLookup + + +/* xslt.h + --------------------------------------------------------------------- */ + xsltMaxDepth DATA + xsltEngineVersion DATA + xsltLibxsltVersion DATA + xsltLibxmlVersion DATA + xsltCleanupGlobals + + +/* xsltInternals.h + --------------------------------------------------------------------- */ + /* Functions associated to the internal types */ + // xsltDecimalFormatGetByName + xsltNewStylesheet + xsltParseStylesheetFile + xsltFreeStylesheet + xsltIsBlank + xsltFreeStackElemList + xsltDecimalFormatGetByName + xsltParseStylesheetProcess + xsltParseStylesheetOutput + xsltParseStylesheetDoc + xsltLoadStylesheetPI + xsltNumberFormat + xsltFormatNumberConversion + xsltParseTemplateContent + xsltAllocateExtra + xsltAllocateExtraCtxt + + +/* xsltInternals.h + --------------------------------------------------------------------- */ + /* Our own version of namespaced atributes lookup. */ + xsltGetNsProp + + /* XSLT specific error and debug reporting functions. */ + xsltGenericError DATA + xsltGenericErrorContext DATA + xsltGenericDebug DATA + xsltGenericDebugContext DATA + xsltPrintErrorContext + xsltMessage + xsltSetGenericErrorFunc + xsltSetGenericDebugFunc + + /* Sorting. */ + xsltDocumentSortFunction + xsltDoSortFunction + + /* QNames handling. */ + xsltGetQNameURI + + /* Output, reuse libxml I/O buffers. */ + xsltSaveResultTo + xsltSaveResultToFilename + xsltSaveResultToFile + xsltSaveResultToFd + + /* Profiling. */ + xsltSaveProfiling + xsltTimestamp + xsltCalibrateAdjust + + /* Hooks for the debugger. */ + xslDebugStatus DATA + xsltSetDebuggerCallbacks + xslAddCall + xslDropCall + diff --git a/win32/readme.msvc b/win32/readme.msvc deleted file mode 100644 index 6dd5bb2e..00000000 --- a/win32/readme.msvc +++ /dev/null @@ -1,43 +0,0 @@ -libxslt Readme For Usage With MSVC
-----------------------------------
-
-If you would like to compile libxslt using Microsoft Visual
-C/C++ IDE, then you must know that it cannot work out of the
-box. You have to modify the project files.
-
-This is not happening just in order to be inconvenient. The fact
-is that libxslt needs libxml in order to compile and work and that
-I have no way to know where you keep libxml on your system.
-
-In order to compile, you must tell the compiler where to look
-for the libxml headers. Likewise, you must tell the linker where
-to look for libxml library.
-
-
-Adapting The Header Search Path
--------------------------------
-
-In the MSVC IDE, go to Project->Settings and choose the C/C++
-options and select the Preprocessor category. Now, there is a list
-of additional include directories, separated by comma. The last
-entry is the location of libxml headers and this is the one which
-you must adapt to your environment.
-
-Adapting The Library Search Path
---------------------------------
-
-In the MSVC IDE, go to Project->Settings and choose the Link
-options and select the Input category. Now, there is an Additional
-Library Path which contains the list of additional directories,
-separated by comma. The last entry is the location of the libxml
-library and this is the one which you must adapt to your environment.
-
-If Something Goes Wrong
------------------------
-
-Don't panic. Use your common sense and investigate the problem.
-If you cannot escape the dread, send me an email and tell me your
-problems
-
-
-27. July 2001, Igor Zlatkovic [igor@stud.fh-frankfurt.de]
\ No newline at end of file |