1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-07-31 02:43:06 +03:00

integrated mingw into jscript configure

This commit is contained in:
Igor Zlatkovic
2002-11-14 17:48:25 +00:00
parent 8c1282f458
commit f69de936e6
3 changed files with 355 additions and 9 deletions

319
win32/Makefile.mingw Normal file
View File

@ -0,0 +1,319 @@
# Makefile for libxslt, specific for Windows, GCC (mingw) and GNU make.
#
# 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 libxslt 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.
#
# November 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de>
AUTOCONF = .\config.mingw
# 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 = 1
#DEBUG = 0
#STATIC = 0
#PREFIX = . # set this to the right value.
#BINPREFIX = $(PREFIX)\bin
#INCPREFIX = $(PREFIX)\include
#LIBPREFIX = $(PREFIX)\lib
#SOPREFIX = $(PREFIX)\lib
#INCLUDE += ;$(INCPREFIX)
#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_A = $(XSLT_BASENAME).a
EXSLT_NAME = exslt
EXSLT_BASENAME = lib$(EXSLT_NAME)
EXSLT_SO = $(EXSLT_BASENAME).dll
EXSLT_IMP = $(EXSLT_BASENAME).lib
EXSLT_A = $(EXSLT_BASENAME).a
# Places where intermediate files produced by the compiler go
XSLT_INTDIR = $(XSLT_BASENAME).int
XSLT_INTDIR_A = $(XSLT_BASENAME)_a.int
EXSLT_INTDIR = $(EXSLT_BASENAME).int
EXSLT_INTDIR_A = $(EXSLT_BASENAME)_a.int
UTILS_INTDIR = utils.int
# The preprocessor and its options.
CPP = gcc.exe -E
CPPFLAGS +=
# The compiler and its options.
CC = gcc.exe
CFLAGS += -DWIN32 -D_WINDOWS -D_MBCS
CFLAGS += -I$(BASEDIR) -I$(XSLT_SRCDIR) -I$(INCPREFIX)
# The linker and its options.
LD = gcc.exe
LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX)
LIBS = -lwsock32
# The archiver and its options.
AR = ar.exe
ARFLAGS = -r
# Optimisation and debug symbols.
ifeq ($(DEBUG),1)
CFLAGS += -D_DEBUG -g
LDFLAGS +=
else
CFLAGS += -DNDEBUG -O2
LDFLAGS +=
endif
# Libxslt object files.
XSLT_OBJS = $(XSLT_INTDIR)/attributes.o\
$(XSLT_INTDIR)/documents.o\
$(XSLT_INTDIR)/extensions.o\
$(XSLT_INTDIR)/extra.o\
$(XSLT_INTDIR)/functions.o\
$(XSLT_INTDIR)/imports.o\
$(XSLT_INTDIR)/keys.o\
$(XSLT_INTDIR)/namespaces.o\
$(XSLT_INTDIR)/numbers.o\
$(XSLT_INTDIR)/pattern.o\
$(XSLT_INTDIR)/preproc.o\
$(XSLT_INTDIR)/security.o\
$(XSLT_INTDIR)/templates.o\
$(XSLT_INTDIR)/transform.o\
$(XSLT_INTDIR)/variables.o\
$(XSLT_INTDIR)/xslt.o\
$(XSLT_INTDIR)/xsltutils.o
XSLT_SRCS = $(subst .o,.c,$(subst $(XSLT_INTDIR)/,$(XSLT_SRCDIR)/,$(XSLT_OBJS)))
# Static libxslt object files.
XSLT_OBJS_A = $(XSLT_INTDIR_A)/attributes.o\
$(XSLT_INTDIR_A)/documents.o\
$(XSLT_INTDIR_A)/extensions.o\
$(XSLT_INTDIR_A)/extra.o\
$(XSLT_INTDIR_A)/functions.o\
$(XSLT_INTDIR_A)/imports.o\
$(XSLT_INTDIR_A)/keys.o\
$(XSLT_INTDIR_A)/namespaces.o\
$(XSLT_INTDIR_A)/numbers.o\
$(XSLT_INTDIR_A)/pattern.o\
$(XSLT_INTDIR_A)/preproc.o\
$(XSLT_INTDIR_A)/security.o\
$(XSLT_INTDIR_A)/templates.o\
$(XSLT_INTDIR_A)/transform.o\
$(XSLT_INTDIR_A)/variables.o\
$(XSLT_INTDIR_A)/xslt.o\
$(XSLT_INTDIR_A)/xsltutils.o
# Libexslt object files.
EXSLT_OBJS = $(EXSLT_INTDIR)/common.o\
$(EXSLT_INTDIR)/date.o\
$(EXSLT_INTDIR)/exslt.o\
$(EXSLT_INTDIR)/functions.o\
$(EXSLT_INTDIR)/math.o\
$(EXSLT_INTDIR)/saxon.o\
$(EXSLT_INTDIR)/sets.o\
$(EXSLT_INTDIR)/strings.o\
$(EXSLT_INTDIR)/dynamic.o
EXSLT_SRCS = $(subst .o,.c,$(subst $(EXSLT_INTDIR)/,$(EXSLT_SRCDIR)/,$(EXSLT_OBJS)))
# Static libexslt object files.
EXSLT_OBJS_A = $(EXSLT_INTDIR_A)/common.o\
$(EXSLT_INTDIR_A)/date.o\
$(EXSLT_INTDIR_A)/exslt.o\
$(EXSLT_INTDIR_A)/functions.o\
$(EXSLT_INTDIR_A)/math.o\
$(EXSLT_INTDIR_A)/saxon.o\
$(EXSLT_INTDIR_A)/sets.o\
$(EXSLT_INTDIR_A)/strings.o\
$(EXSLT_INTDIR_A)/dynamic.o
# Xsltproc and friends executables.
UTILS = $(BINDIR)/xsltproc.exe
all : dep libxslt libxslta libexslt libexslta utils
libxslt : $(BINDIR)/$(XSLT_SO)
libxslta : $(BINDIR)/$(XSLT_A)
libexslt : $(BINDIR)/$(EXSLT_SO)
libexslta : $(BINDIR)/$(EXSLT_A)
utils : $(UTILS)
clean :
if exist $(XSLT_INTDIR) rmdir /S /Q $(XSLT_INTDIR)
if exist $(XSLT_INTDIR_A) rmdir /S /Q $(XSLT_INTDIR_A)
if exist $(EXSLT_INTDIR) rmdir /S /Q $(EXSLT_INTDIR)
if exist $(EXSLT_INTDIR_A) rmdir /S /Q $(EXSLT_INTDIR_A)
if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
if exist $(BINDIR) rmdir /S /Q $(BINDIR)
rebuild : clean all
distclean : clean
if exist config.* del config.*
if exist Makefile del Makefile
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) PREFIX=$(BDPREFIX) BINPREFIX=$(BDPREFIX)/util install
cscript //NoLogo configure.js genreadme $(XSLT_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
# Creates the dependency files
dep :
$(CC) $(CFLAGS) -M $(XSLT_SRCS) > depends.mingw
$(CC) $(CFLAGS) -M $(EXSLT_SRCS) >> depends.mingw
# 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)
# Makes the static libxslt intermediate directory.
$(XSLT_INTDIR_A) :
if not exist $(XSLT_INTDIR_A) mkdir $(XSLT_INTDIR_A)
# An implicit rule for libxslt compilation.
$(XSLT_INTDIR)/%.o : $(XSLT_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $@ -c $<
# An implicit rule for static libxslt compilation.
$(XSLT_INTDIR_A)/%.o : $(XSLT_SRCDIR)/%.c
$(CC) $(CFLAGS) -DLIBXML_STATIC -DLIBXSLT_STATIC -o $@ -c $<
# Compiles libxslt source. Uses the implicit rule for commands.
$(XSLT_OBJS) : $(XSLT_INTDIR)
# Compiles static libxslt source. Uses the implicit rule for commands.
$(XSLT_OBJS_A) : $(XSLT_INTDIR_A)
# Creates the libxslt shared object.
XSLTSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(XSLT_IMP)
XSLTSO_LDFLAGS += -Wl,--major-image-version,$(LIBXSLT_MAJOR_VERSION)
XSLTSO_LDFLAGS += -Wl,--minor-image-version,$(LIBXSLT_MINOR_VERSION)
$(BINDIR)/$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS)
$(LD) $(XSLTSO_LDFLAGS) -o $(BINDIR)/$(XSLT_SO) $(XSLT_OBJS) $(LIBS) -llibxml2
# Creates the libxslt archive.
$(BINDIR)/$(XSLT_A) : $(BINDIR) $(XSLT_OBJS_A)
$(AR) $(ARFLAGS) $(BINDIR)/$(XSLT_A) $(XSLT_OBJS_A)
# Creates the libexslt intermediate directory.
$(EXSLT_INTDIR) :
if not exist $(EXSLT_INTDIR) mkdir $(EXSLT_INTDIR)
# Creates the static libexslt intermediate directory.
$(EXSLT_INTDIR_A) :
if not exist $(EXSLT_INTDIR_A) mkdir $(EXSLT_INTDIR_A)
# An implicit rule for libexslt compilation.
$(EXSLT_INTDIR)/%.o : $(EXSLT_SRCDIR)/%.c
$(CC) $(CFLAGS) -I$(EXSLT_SRCDIR) -o $@ -c $<
# An implicit rule for static libexslt compilation.
$(EXSLT_INTDIR_A)/%.o : $(EXSLT_SRCDIR)/%.c
$(CC) $(CFLAGS) -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC \
-I$(EXSLT_SRCDIR) -o $@ -c $<
# Compiles libxslt source. Uses the implicit rule for commands.
$(EXSLT_OBJS) : $(EXSLT_INTDIR)
# Compiles libxslt source. Uses the implicit rule for commands.
$(EXSLT_OBJS_A) : $(EXSLT_INTDIR_A)
# Creates the libexslt shared object.
EXSLTSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(EXSLT_IMP)
EXSLTSO_LDFLAGS += -Wl,--major-image-version,$(LIBEXSLT_MAJOR_VERSION)
EXSLTSO_LDFLAGS += -Wl,--minor-image-version,$(LIBEXSLT_MINOR_VERSION)
$(BINDIR)/$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) libxslt
$(LD) $(EXSLTSO_LDFLAGS) -o $(BINDIR)/$(EXSLT_SO) $(EXSLT_OBJS) $(LIBS) -l$(XSLT_BASENAME) -llibxml2
# Creates the libexslt archive.
$(BINDIR)/$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta
$(AR) $(ARFLAGS) $(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS_A)
# Creates the utils intermediate directory.
$(UTILS_INTDIR) :
if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
# An implicit rule for xsltproc and friends.
APPLIBS = $(LIBS)
APPLIBS += -llibxml2 -l$(XSLT_BASENAME) -l$(EXSLT_BASENAME)
APP_LDFLAGS = $(LDFLAGS)
APP_LDFLAGS += -Wl,--major-image-version,$(LIBXSLT_MAJOR_VERSION)
APP_LDFLAGS += -Wl,--minor-image-version,$(LIBXSLT_MINOR_VERSION)
ifeq ($(STATIC),1)
CFLAGS += -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
APP_LDFLAGS += -Bstatic
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
$(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F))
else
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
$(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F))
endif
# Builds xsltproc and friends. Uses the implicit rule for commands.
$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt libxslta libexslt libexslta
# Source dependencies
#-include depends.mingw

View File

@ -12,7 +12,7 @@
# #
# March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de> # March 2002, Igor Zlatkovic <igor@stud.fh-frankfurt.de>
AUTOCONF = .\configure.txt AUTOCONF = .\config.msvc
# If you cannot run the configuration script, which would take the burden of # If you cannot run the configuration script, which would take the burden of
# editing this file from your back, then remove the following line... # editing this file from your back, then remove the following line...
@ -182,6 +182,10 @@ clean :
rebuild : clean all rebuild : clean all
distclean : clean
if exist config.* del config.*
if exist Makefile del Makefile
install : all install : all
if not exist $(INCPREFIX)\$(XSLT_BASENAME) mkdir $(INCPREFIX)\$(XSLT_BASENAME) if not exist $(INCPREFIX)\$(XSLT_BASENAME) mkdir $(INCPREFIX)\$(XSLT_BASENAME)
if not exist $(INCPREFIX)\$(EXSLT_BASENAME) mkdir $(INCPREFIX)\$(EXSLT_BASENAME) if not exist $(INCPREFIX)\$(EXSLT_BASENAME) mkdir $(INCPREFIX)\$(EXSLT_BASENAME)
@ -285,7 +289,7 @@ $(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) lib
$(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib
# Creates the libexslt archive. # Creates the libexslt archive.
$(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) $(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta
$(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS_A) $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS_A)

View File

@ -20,7 +20,7 @@ var baseNameExslt = "libexslt";
/* Configure file which contains the version and the output file where /* Configure file which contains the version and the output file where
we can store our build configuration. */ we can store our build configuration. */
var configFile = baseDir + "\\configure.in"; var configFile = baseDir + "\\configure.in";
var versionFile = ".\\configure.txt"; var versionFile = ".\\config.msvc";
/* Input and output files regarding the lib(e)xml features. The second /* Input and output files regarding the lib(e)xml features. The second
output file is there for the compatibility reasons, otherwise it output file is there for the compatibility reasons, otherwise it
is identical to the first. */ is identical to the first. */
@ -39,11 +39,13 @@ var verMajorExslt;
var verMinorExslt; var verMinorExslt;
var verMicroExslt; var verMicroExslt;
/* Libxslt features. */ /* Libxslt features. */
var withTrio = false;
var withXsltDebug = true; var withXsltDebug = true;
var withMemDebug = false; var withMemDebug = false;
var withDebugger = true; var withDebugger = true;
var withIconv = true; var withIconv = true;
/* Win32 build options. */ /* Win32 build options. */
var compiler = "msvc";
var buildDebug = 0; var buildDebug = 0;
var buildStatic = 0; var buildStatic = 0;
var buildPrefix = "."; var buildPrefix = ".";
@ -61,11 +63,11 @@ var error = 0;
function boolToStr(opt) function boolToStr(opt)
{ {
if (opt == false) if (opt == false)
return "Disabled"; return "no";
else if (opt == true) else if (opt == true)
return "Enabled"; return "yes";
error = 1; error = 1;
return "Undefined"; return "*** undefined ***";
} }
/* Helper function, transforms the argument string into the boolean /* Helper function, transforms the argument string into the boolean
@ -90,11 +92,13 @@ function usage()
txt += "Options can be specified in the form <option>=<value>, where the value is\n"; txt += "Options can be specified in the form <option>=<value>, where the value is\n";
txt += "either 'yes' or 'no'.\n\n"; txt += "either 'yes' or 'no'.\n\n";
txt += "XSLT processor options, default value given in parentheses:\n\n"; txt += "XSLT processor options, default value given in parentheses:\n\n";
txt += " trio: Enable TRIO string manipulator (" + (withTrio? "yes" : "no") + ")\n";
txt += " xslt_debug: Enable XSLT debbugging module (" + (withXsltDebug? "yes" : "no") + ")\n"; txt += " xslt_debug: Enable XSLT debbugging module (" + (withXsltDebug? "yes" : "no") + ")\n";
txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n"; txt += " mem_debug: Enable memory debugger (" + (withMemDebug? "yes" : "no") + ")\n";
txt += " debugger: Enable external debugger support (" + (withDebugger? "yes" : "no") + ")\n"; txt += " debugger: Enable external debugger support (" + (withDebugger? "yes" : "no") + ")\n";
txt += " iconv: Use iconv library (" + (withIconv? "yes" : "no") + ")\n"; txt += " iconv: Use iconv library (" + (withIconv? "yes" : "no") + ")\n";
txt += "\nWin32 build options, default value given in parentheses:\n\n"; txt += "\nWin32 build options, default value given in parentheses:\n\n";
txt += " compiler: Compiler to be used [msvc|mingw] (" + compiler + ")\n";
txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n"; txt += " debug: Build unoptimised debug executables (" + (buildDebug? "yes" : "no") + ")\n";
txt += " static: Link xsltproc statically to libxslt (" + (buildStatic? "yes" : "no") + ")\n"; txt += " static: Link xsltproc statically to libxslt (" + (buildStatic? "yes" : "no") + ")\n";
txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n"; txt += " prefix: Base directory for the installation (" + buildPrefix + ")\n";
@ -121,6 +125,10 @@ function discoverVersion()
var fso, cf, vf, ln, s; var fso, cf, vf, ln, s;
fso = new ActiveXObject("Scripting.FileSystemObject"); fso = new ActiveXObject("Scripting.FileSystemObject");
cf = fso.OpenTextFile(configFile, 1); cf = fso.OpenTextFile(configFile, 1);
if (compiler == "msvc")
versionFile = ".\\config.msvc";
else if (compiler == "mingw")
versionFile = ".\\config.mingw";
vf = fso.CreateTextFile(versionFile, true); vf = fso.CreateTextFile(versionFile, true);
vf.WriteLine("# " + versionFile); vf.WriteLine("# " + versionFile);
vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + "."); vf.WriteLine("# This file is generated automatically by " + WScript.ScriptName + ".");
@ -154,6 +162,7 @@ function discoverVersion()
vf.WriteLine("EXSLT_SRCDIR=" + srcDirExslt); vf.WriteLine("EXSLT_SRCDIR=" + srcDirExslt);
vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils); vf.WriteLine("UTILS_SRCDIR=" + srcDirUtils);
vf.WriteLine("BINDIR=" + binDir); vf.WriteLine("BINDIR=" + binDir);
vf.WriteLine("WITH_TRIO=" + (withTrio? "1" : "0"));
vf.WriteLine("WITH_DEBUG=" + (withXsltDebug? "1" : "0")); vf.WriteLine("WITH_DEBUG=" + (withXsltDebug? "1" : "0"));
vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0")); vf.WriteLine("WITH_MEM_DEBUG=" + (withMemDebug? "1" : "0"));
vf.WriteLine("WITH_DEBUGGER=" + (withDebugger? "1" : "0")); vf.WriteLine("WITH_DEBUGGER=" + (withDebugger? "1" : "0"));
@ -165,8 +174,13 @@ function discoverVersion()
vf.WriteLine("INCPREFIX=" + buildIncPrefix); vf.WriteLine("INCPREFIX=" + buildIncPrefix);
vf.WriteLine("LIBPREFIX=" + buildLibPrefix); vf.WriteLine("LIBPREFIX=" + buildLibPrefix);
vf.WriteLine("SOPREFIX=" + buildSoPrefix); vf.WriteLine("SOPREFIX=" + buildSoPrefix);
if (compiler == "msvc") {
vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude); vf.WriteLine("INCLUDE=$(INCLUDE);" + buildInclude);
vf.WriteLine("LIB=$(LIB);" + buildLib); vf.WriteLine("LIB=$(LIB);" + buildLib);
} else if (compiler == "mingw") {
vf.WriteLine("INCLUDE+=;" + buildInclude);
vf.WriteLine("LIB+=;" + buildLib);
}
vf.Close(); vf.Close();
} }
@ -187,6 +201,8 @@ function configureXslt()
} else if (s.search(/\@LIBXSLT_VERSION_NUMBER\@/) != -1) { } else if (s.search(/\@LIBXSLT_VERSION_NUMBER\@/) != -1) {
of.WriteLine(s.replace(/\@LIBXSLT_VERSION_NUMBER\@/, of.WriteLine(s.replace(/\@LIBXSLT_VERSION_NUMBER\@/,
verMajorXslt*10000 + verMinorXslt*100 + verMicroXslt*1)); verMajorXslt*10000 + verMinorXslt*100 + verMicroXslt*1));
} else if (s.search(/\@WITH_TRIO\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_TRIO\@/, withTrio? "1" : "0"));
} else if (s.search(/\@WITH_XSLT_DEBUG\@/) != -1) { } else if (s.search(/\@WITH_XSLT_DEBUG\@/) != -1) {
of.WriteLine(s.replace(/\@WITH_XSLT_DEBUG\@/, withXsltDebug? "1" : "0")); of.WriteLine(s.replace(/\@WITH_XSLT_DEBUG\@/, withXsltDebug? "1" : "0"));
} else if (s.search(/\@WITH_MEM_DEBUG\@/) != -1) { } else if (s.search(/\@WITH_MEM_DEBUG\@/) != -1) {
@ -302,6 +318,8 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
buildDebug = strToBool(arg.substring(opt.length + 1, arg.length)); buildDebug = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "iconv") else if (opt == "iconv")
buildIconv = strToBool(arg.substring(opt.length + 1, arg.length)); buildIconv = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "compiler")
compiler = arg.substring(opt.length + 1, arg.length);
else if (opt == "static") else if (opt == "static")
buildStatic = strToBool(arg.substring(opt.length + 1, arg.length)); buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
else if (opt == "prefix") else if (opt == "prefix")
@ -366,12 +384,16 @@ if (error != 0) {
// Create the Makefile. // Create the Makefile.
var fso = new ActiveXObject("Scripting.FileSystemObject"); var fso = new ActiveXObject("Scripting.FileSystemObject");
fso.CopyFile(".\\Makefile.msvc", ".\\Makefile", true); var makefile = ".\\Makefile.msvc";
if (compiler == "mingw")
makefile = ".\\Makefile.mingw";
fso.CopyFile(makefile, ".\\Makefile", true);
WScript.Echo("Created Makefile."); WScript.Echo("Created Makefile.");
// Display the final configuration. // Display the final configuration.
var txtOut = "\nXSLT processor configuration\n"; var txtOut = "\nXSLT processor configuration\n";
txtOut += "----------------------------\n"; txtOut += "----------------------------\n";
txtOut += " Trio: " + boolToStr(withTrio) + "\n";
txtOut += " Debugging module: " + boolToStr(withXsltDebug) + "\n"; txtOut += " Debugging module: " + boolToStr(withXsltDebug) + "\n";
txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n"; txtOut += " Memory debugging: " + boolToStr(withMemDebug) + "\n";
txtOut += " Debugger support: " + boolToStr(withDebugger) + "\n"; txtOut += " Debugger support: " + boolToStr(withDebugger) + "\n";
@ -379,6 +401,7 @@ txtOut += " Use iconv: " + boolToStr(withIconv) + "\n";
txtOut += "\n"; txtOut += "\n";
txtOut += "Win32 build configuration\n"; txtOut += "Win32 build configuration\n";
txtOut += "-------------------------\n"; txtOut += "-------------------------\n";
txtOut += " Compiler: " + compiler + "\n";
txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n"; txtOut += " Debug symbols: " + boolToStr(buildDebug) + "\n";
txtOut += " Static xsltproc: " + boolToStr(buildStatic) + "\n"; txtOut += " Static xsltproc: " + boolToStr(buildStatic) + "\n";
txtOut += " Install prefix: " + buildPrefix + "\n"; txtOut += " Install prefix: " + buildPrefix + "\n";