Error Compiling Sablotron on FreeBSD
Posted February 12th, 2004 in Linux/Unix/BSD (Updated May 23rd, 2007)
Until February 2004 I had only ever compiled Sablotron on Linux and had never had any problems (with the exception of compiling PHP with Sablotron and Expat) but I discovered a compilation problem when I set up a FreeBSD server to host the Electric Toolbox website.
The two versions of Sablotron I attempted to compile were 0.98 and 1.01; 0.98 has two errors and 1.01 has one. The second error in version 0.98 is the same as the issue with 1.01. Note that there are some issues running PHP with Sablotron 1.01 which are dealt with in another article so I would suggest using 0.98 until a newer version is released. I have used 0.98 on production Linux machines for 12 months at the time of writing this article (Feb 2004) and have had no issues with it.
"Makefile", line 483: Need an operator
This error affects the 0.98 but not the 1.01 release of Sablotron on FreeBSD 4.9; it may affect earlier and/or later releases of FreeBSD and Sablotron as well but I cannot test this as I only have access to a FreeBD 4.9 server and do not have other sources of Sablotron.
This error affects 0.98 but not 1.01 on FreeBSD 4.9; it may affect earlier and/or later releases of FreeBSD as well but I cannot test this as I only have access to a FreeBD 4.9 server.
To configure Sablotron and begin compilation you would issue the following:
0.98: ./configure
--with-expat-prefix=/usr/local
OR
1.01: ./configure
--with-expat=/usr/local
THEN
make
where /usr/local is the location the expat libraries were
installed to.
After running make you will get the following error for
Sablotron 0.98:
Making all in src
Making all in
engine
"Makefile", line 483: Need an operator
make: fatal errors encountered -- cannot continue
*** Error code
1
Stop in /path/to/Sablot-0.98/src.
*** Error code 1
Stop in /path/to/src/Sablot-0.98.
To fix this, open up the file src/engine/Makefile in your
favourite text editor and jump to the end of the file. The last 4 lines in
the file look like so:
dnl CXXFLAGS = -g -O2 -I/usr/local/include
-Wall -W -Winline -Wno-unused-parameter
# Tell versions [3.59,3.63) of
GNU make to not export all variables.
# Otherwise a system limit (for
SysV at least) may be exceeded.
.NOEXPORT
The first of these lines starts with "dn1" which is a type of commenting out used in sendmail configuration files (and presumably other software files as well). All you need to do is comment out the line with a # and then run make again. The resulting code from above will now look like so:
#dnl CXXFLAGS = -g -O2
-I/usr/local/include -Wall -W -Winline -Wno-unused-parameter
# Tell
versions [3.59,3.63) of GNU make to not export all variables.
#
Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT
After running make now Sablotron will begin to compile.
This make take a couple of minutes or so and then you'll get the next
error, which is detailed on the don't know how to make ./jsdom-ref/complete page.
The Sablotron and Expat libraries are very fast at running XSL transformations and are available for download from The Ginger Alliance (Sablotron) and Sourceforge (Expat).
Subscribe!
If you found this post interesting and would like to be notified the next time something is posted, please subscribe to my RSS Feed. Thanks for visiting!
