Steven Rowe wrote:
> Attached is a patch to 0.34 which compiles on both Solaris 2.5.1 and
> 2.6, using the system ld (instead of GNU linker), GNU make, and
> gcc/g++.
>
> I have GNU make aliased as 'gmake', so the command I used to build
> from the BASH shell was 'CC=gcc gmake'.
>
> Hope this helps.
>
> Steve Rowe
> MNIS-TextWise Labs
>
>
> ------------------------------------------------------------------------
>
> diff -Naur Sablot-0.34/Expat/Linux/Makefile
> Sablot-0.34-Solaris/Expat/Linux/Makefile
> --- Sablot-0.34/Expat/Linux/Makefile Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Expat/Linux/Makefile Wed May 10 15:39:09
> 2000
> @@ -14,8 +14,10 @@
> ../xmlwf/codepage.o \
> ../xmlwf/xmlfile.o
>
> -LT_PARAMS = -Wl,-soname,libxmltok.so.1
> -LP_PARAMS = -Wl,-soname,libxmlparse.so.1
> +#LT_PARAMS = -Wl,-soname,libxmltok.so.1
> +#LP_PARAMS = -Wl,-soname,libxmlparse.so.1
> +LT_PARAMS = -hlibxmltok.so.1
> +LP_PARAMS = -hlibxmlparse.so.1
>
> TOKLIB = libxmltok.so.1.0
> PARSELIB = libxmlparse.so.1.0
> diff -Naur Sablot-0.34/Expat/Makefile
> Sablot-0.34-Solaris/Expat/Makefile
> --- Sablot-0.34/Expat/Makefile Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Expat/Makefile Wed May 10 15:39:09 2000
> @@ -4,7 +4,7 @@
> # use -DXML_BYTE_ORDER=21 for big-endian (network) byte order.
> # -DXML_NS adds support for checking of lexical aspects of XML
> namespaces spec
> # -DXML_MIN_SIZE makes a smaller but slower parser
> -CFLAGS=-O2 -Ixmltok -Ixmlparse -DXML_NS
> +CFLAGS=-O2 -Ixmltok -Ixmlparse -DXML_NS -DXML_BYTE_ORDER=21
> # Use one of the next two lines; unixfilemap is better if it works.
> FILEMAP_OBJ=xmlwf/unixfilemap.o
> #FILEMAP_OBJ=xmlwf/readfilemap.o
> diff -Naur Sablot-0.34/Expat/xmlparse/xmlparse.h
> Sablot-0.34-Solaris/Expat/xmlparse/xmlparse.h
> --- Sablot-0.34/Expat/xmlparse/xmlparse.h Tue May 9 12:03:56
> 2000
> +++ Sablot-0.34-Solaris/Expat/xmlparse/xmlparse.h Wed May 10
> 15:39:09 2000
> @@ -36,7 +36,7 @@
> #endif
>
> #ifndef XMLPARSEAPI
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__unix)
> #define XMLPARSEAPI
> #else //Win32?
> #define XMLPARSEAPI __declspec( dllexport )
> diff -Naur Sablot-0.34/Expat/xmltok/xmltok.h
> Sablot-0.34-Solaris/Expat/xmltok/xmltok.h
> --- Sablot-0.34/Expat/xmltok/xmltok.h Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Expat/xmltok/xmltok.h Wed May 10 15:39:10
> 2000
> @@ -36,7 +36,7 @@
> #endif
>
> #ifndef XMLTOKAPI
> -#ifdef __linux__
> +#if defined (__linux__) || defined (__unix)
> #define XMLTOKAPI
> #else //win32??
> #define XMLTOKAPI __declspec( dllexport )
> diff -Naur Sablot-0.34/Sablot/Linux/Makefile
> Sablot-0.34-Solaris/Sablot/Linux/Makefile
> --- Sablot-0.34/Sablot/Linux/Makefile Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Sablot/Linux/Makefile Wed May 10 15:39:10
> 2000
> @@ -2,6 +2,7 @@
> CHARLIE_HOME=../..
> endif
>
> +CCC=g++
> VPATH = ..
> CODE_FLG = -O2
> CPPFLAGS=$(CODE_FLG) -fPIC -I$(CHARLIE_HOME)/include
> @@ -19,32 +20,20 @@
>
> LIB_NAME=libsablot.so.0.3
> LIB_SONAME=libsablot.so.0
> +#LINKER_OPTS=-Wl,-soname,$(LIB_SONAME)
> +LINKER_OPTS=-h$(LIB_SONAME)
>
> all:: sablotron install
>
> sablotron: $(LIB_NAME) sabcmdline
>
> $(LIB_NAME): $(OBJS) #expatlinks
> - g++ $(CODE_FLG) -shared -Wl,-soname,$(LIB_SONAME) -o
> $(LIB_NAME) \
> + g++ $(CODE_FLG) -shared $(LINKER_OPTS) -o $(LIB_NAME) \
> $(OBJS) $(EXPAT_LIBS)
>
> sabcmdline:
> g++ $(CODE_FLG) -o sabcmd ../sabcmd/sabcmd.c $(LIB_NAME)
> $(EXPAT_LIBS)
>
> -
> -base.o: base.cpp $(HEADERS)
> -context.o: context.cpp $(HEADERS)
> -datastr.o: datastr.cpp $(HEADERS)
> -error.o: error.cpp $(HEADERS)
> -expr.o: expr.cpp $(HEADERS)
> -proc.o: proc.cpp $(HEADERS)
> -sablot.o: sablot.cpp $(HEADERS)
> -situa.o: situa.cpp $(HEADERS)
> -tree.o: tree.cpp $(HEADERS)
> -uri.o: uri.cpp $(HEADERS)
> -vars.o: vars.cpp $(HEADERS)
> -verts.o: verts.cpp $(HEADERS)
> -
> .PHONY: clean realclean
> clean:
> rm -f $(OBJS)
> @@ -67,8 +56,5 @@
> .c.o:
> $(CC) $(CPPFLAGS) -c -o $@ $<
>
> -
> -
> -
> -
> -
> +%.o : %.cpp $(HEADERS)
> + $(CCC) $(CPPFLAGS) -c -o $@ $<
> diff -Naur Sablot-0.34/Sablot/base.cpp
> Sablot-0.34-Solaris/Sablot/base.cpp
> --- Sablot-0.34/Sablot/base.cpp Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Sablot/base.cpp Wed May 10 15:39:10 2000
> @@ -214,7 +214,7 @@
>
> int sablotNewHandler(size_t size)
> {
> -#if defined(WIN32) || defined(__linux__)
> +#if defined(WIN32) || defined(__linux__) || defined(__unix)
> throw(E_MEMORY);
> #else
> situation.error(E_MEMORY, theEmptyString, theEmptyString);
> diff -Naur Sablot-0.34/Sablot/expr.cpp
> Sablot-0.34-Solaris/Sablot/expr.cpp
> --- Sablot-0.34/Sablot/expr.cpp Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Sablot/expr.cpp Wed May 10 15:39:11 2000
> @@ -1012,7 +1012,7 @@
>
> Bool Number::isNaN()
> {
> -#ifdef __linux__
> +#if defined(__linux__) || defined(__unix)
> return (Bool) (_NaN || isnan(x));
> #elif defined(WIN32)
> return (Bool) (_NaN || _isnan(x));
> diff -Naur Sablot-0.34/Sablot/proc.cpp
> Sablot-0.34-Solaris/Sablot/proc.cpp
> --- Sablot-0.34/Sablot/proc.cpp Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Sablot/proc.cpp Wed May 10 15:39:11 2000
> @@ -29,7 +29,7 @@
> /*
> include direct.h for getcwd()
> */
> -#if defined(__linux__)
> +#if defined(__linux__) || defined(__unix)
> #include <unistd.h>
> #elif defined(WIN32)
> #include <direct.h>
> @@ -193,7 +193,7 @@
> char buf[256];
> #if defined(WIN32)
> _getcwd(buf, 256);
> -#else //if defined(__linux__) || defined(__BORLANDC__)
> +#else //if defined(__linux__) || defined(__BORLANDC__) ||
> defined(__unix)
> getcwd(buf,256);
> #endif
> dir = buf;
> diff -Naur Sablot-0.34/Sablot/sablot.h
> Sablot-0.34-Solaris/Sablot/sablot.h
> --- Sablot-0.34/Sablot/sablot.h Tue May 9 12:03:56 2000
> +++ Sablot-0.34-Solaris/Sablot/sablot.h Wed May 10 15:39:12 2000
> @@ -30,15 +30,15 @@
>
> #include "shandler.h"
>
> -#if defined(__linux__) || defined(__BORLANDC__)
> +#if defined(__linux__) || defined(__BORLANDC__) || defined(__unix)
> #define DllImpExp extern
> -#else //__linux__ || __BORLANDC__
> +#else //__linux__ || __BORLANDC__ || __unix
> #ifdef SablotAsExport
> #define DllImpExp __declspec( dllexport )
> #else //ifdef SablotAsExport
> #define DllImpExp __declspec( dllimport )
> #endif //SablotAsExport
> -#endif //__linux__ || __BORLANDC__
> +#endif //__linux__ || __BORLANDC__ || __unix
>
>
> /*****************************************************************
--
Petr Cimprich
Ginger Alliance Ltd.
www.gingerall.com