Enclosed is a patch to add Mac OS X command line build support to Xalan C.
Could somebody apply it please? I'm a committer on for Xerces-C,
specializing in the Mac support for that project...but it's time to get
Xalan supported as well.

The only thing slightly strange here (apart for some support for a bit of
missing wide character support under Mac OS X currently) is that I've
regenerated the configure file from configure.in using autoconf. In doing
so, it appears that this has perhaps not been done recently...I've edited
configure.in sufficiently to make the autoconf output match the current
version of configure [with the addition of my changes, of course].

-jdb

--
/**********************************
 James D. Berry
 mailto:[EMAIL PROTECTED]
 vox:503.265.1213 fax:503.222.3020
 **********************************/


PatchMacOSX.txt

cvs -q diff 

Index: Makefile.in
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/Makefile.in,v
retrieving revision 1.42
diff -u -r1.42 Makefile.in
--- Makefile.in 2001/06/27 19:21:43     1.42
+++ Makefile.in 2001/06/28 15:26:35
@@ -265,9 +265,23 @@
 
 endif
 
+#============ MacOSX SPECIFIC OPTIONS ============================
+ifeq ($(PLATFORM), MACOSX)
+
+       SUPPORTED = TRUE
+       PLATFORM_COMPILE_OPTIONS = -Wall -D${PLATFORM} -D_REENTRANT 
+-DXALAN_USE_XERCES_LOCAL_CODEPAGE_TRANSCODERS
+       ALLLIBS = ${LIBS} -L/usr/lib -L/usr/local/lib 
+       SHLIBSUFFIX=.dylib
+       CC1 = ${CXX} $(CXXFLAGS) $(PLATFORM_COMPILE_OPTIONS)
+       MAKE_SHARED = ${CXX} $(CXXFLAGS) -D${PLATFORM} -dynamiclib
+       LINK = ${CXX} $(CXXFLAGS) ${PLATFORM_COMPILE_OPTIONS}
+
+endif
+
+
 ifndef SUPPORTED
 nogood:
-       @echo Linux, Solaris, AIX, Compaq Tru64, OS/390, and HP-UX are the only 
platforms supported.
+       @echo Linux, Solaris, AIX, Compaq, Tru64, OS/390, MacOSX, and HP-UX are the 
+only platforms supported.
 endif
 
 # We need the Xerces library
Index: configure
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/configure,v
retrieving revision 1.4
diff -u -r1.4 configure
--- configure   2001/04/13 02:53:20     1.4
+++ configure   2001/06/28 15:26:35
@@ -1309,6 +1309,7 @@
                         esac;;
         *-*-mvs*)       platform=OS390 ;;
         *-*-osf*)       platform=TRU64 ;;
+        *-apple-darwin*)       platform=MACOSX ;;
         *)              platform=UNKNOWN ;;
 esac
 
@@ -1419,7 +1420,7 @@
 s%\]%\\&%g
 s%\$%$$%g
 EOF
-DEFS=`sed -f conftest.defs confdefs.h | tr '\n' ' '`
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
 rm -f conftest.defs
 
 
Index: configure.in
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/configure.in,v
retrieving revision 1.2
diff -u -r1.2 configure.in
--- configure.in        2001/04/13 02:53:20     1.2
+++ configure.in        2001/06/28 15:26:36
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script
-AC_INIT(util/XML4CDefs.hpp)
+AC_INIT(PlatformSupport/PlatformSupportDefinitions.hpp)
 dnl AC_CONFIG_HEADER(common/icucfg.h)
 
 dnl Checks for programs
@@ -41,6 +41,7 @@
                         esac;;
         *-*-mvs*)       platform=OS390 ;;
         *-*-osf*)       platform=TRU64 ;;
+        *-apple-darwin*)       platform=MACOSX ;;
         *)              platform=UNKNOWN ;;
 esac
 AC_SUBST(platform)
@@ -79,16 +80,4 @@
 AC_SUBST(transcoder)
 
 dnl output the Makefiles
-AC_OUTPUT([Makefile \
-DOMSupport/Makefile \
-Include/Makefile \
-PlatformSupport/Makefile \
-TestXPath/Makefile \
-TestXSLT/Makefile \
-XMLSupport/Makefile \
-XPath/Makefile \
-XSLT/Makefile \
-XercesInit/Makefile \
-XercesParserLiaison/Makefile \
-XercesPlatformSupport/Makefile \
-../obj/Makefile])
+AC_OUTPUT([Makefile])
Index: runConfigure
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/runConfigure,v
retrieving revision 1.4
diff -u -r1.4 runConfigure
--- runConfigure        2001/05/18 18:24:12     1.4
+++ runConfigure        2001/06/28 15:26:36
@@ -95,7 +95,7 @@
     echo "runConfigure: Helper script to run \"configure\" for one of the supported 
platforms"
     echo "Usage: runConfigure \"options\""
     echo "       where options may be any of the following:"
-    echo "       -p <platform> (accepts 'aix', 'linux', 'solaris', 'hp-10', 'hp-11', 
'irix', 'tru64' )"
+    echo "       -p <platform> (accepts 'aix', 'linux', 'solaris', 'hp-10', 'hp-11', 
+'irix', 'tru64', 'macosx' )"
     echo "       -c <C compiler name> (e.g. gcc, cc, xlc)"
     echo "       -x <C++ compiler name> (e.g. g++, CC, xlC)"
     echo "       -d (specifies that you want to build debug version)"
@@ -186,7 +186,7 @@
 #
 
 case $platform in
-   aix | linux | solaris | hp-10 | hp-11 | irix | tru64)
+   aix | linux | solaris | hp-10 | hp-11 | irix | tru64 | macosx)
        # platform has been recognized
        ;;
    *)
Index: Include/GCCDefinitions.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/Include/GCCDefinitions.hpp,v
retrieving revision 1.13
diff -u -r1.13 GCCDefinitions.hpp
--- Include/GCCDefinitions.hpp  2001/02/21 22:53:20     1.13
+++ Include/GCCDefinitions.hpp  2001/06/28 15:26:48
@@ -84,12 +84,15 @@
 #define XALAN_POSIX2_AVAILABLE
 
 
-
 // This will change, depending upon the target platform.
 #if defined(SOLARIS)
 #define XALAN_BIG_ENDIAN
 #elif defined(__i386__)
 #define XALAN_LITLE_ENDIAN
+#elif defined(__BIG_ENDIAN__)
+#define XALAN_BIG_ENDIAN
+#elif defined(__LITTLE_ENDIAN__)
+#define XALAN_LITTLE_ENDIAN
 #else
 #error XALAN_BIG_ENDIAN or XALAN_LITTLE_ENDIAN must be defined for this platform!
 #endif
Index: PlatformSupport/DOMStringHelper.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
retrieving revision 1.58
diff -u -r1.58 DOMStringHelper.cpp
--- PlatformSupport/DOMStringHelper.cpp 2001/06/14 18:53:57     1.58
+++ PlatformSupport/DOMStringHelper.cpp 2001/06/28 15:26:51
@@ -1791,3 +1791,28 @@
 
        return true;
 }
+
+
+
+#if defined(MACOSX)
+       //
+       //      These functions are not currently available on MacOS X,
+       //      as of the 10.0.x releases. Presumably this will be fixed
+       //      soon, at which time these hacky definitions can go away.
+       //
+
+       #include <ctype.h>
+
+       wchar_t
+       towlower(wchar_t c)
+       {
+               return (c >= 'A' and c <= 'Z') ? tolower(c) : c;
+       }
+
+
+       wchar_t
+       towupper(wchar_t c)
+       {
+               return (c >= 'a' and c <= 'z') ? toupper(c) : c;
+       }
+#endif
\ No newline at end of file
Index: PlatformSupport/DOMStringHelper.hpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.hpp,v
retrieving revision 1.45
diff -u -r1.45 DOMStringHelper.hpp
--- PlatformSupport/DOMStringHelper.hpp 2001/06/25 20:08:52     1.45
+++ PlatformSupport/DOMStringHelper.hpp 2001/06/28 15:26:51
@@ -83,6 +83,16 @@
 
 #if defined(AIX) || defined(OS390)
 #include <wchar.h>
+#elif defined(MACOSX)
+
+       //
+       //      The wchar.h header is not available on MacOS X
+       //      as of the 10.0.x releases. Presumably this will be fixed
+       //      soon, at which time these hacky declarations can go away.
+       //
+       extern "C" wchar_t towlower(wchar_t c);
+       extern "C" wchar_t towupper(wchar_t c);
+
 #elif defined(__GNUC__)
 #include <wctype.h>
 #endif

Reply via email to