W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 2010

Patch for compiling under Sun

From: Mohamed Bana <mohamed@bana.org.uk>
Date: Mon, 19 Jul 2010 12:45:08 +0100
Message-ID: <AANLkTimfEFq9plBnmxTab0c01y7Ac6LZ_e4p9L0iaLmy@mail.gmail.com>
To: html-tidy@w3.org
Hi All,

Trying to compile Tidy with SunPro

cc: Sun C 5.8 2005/10/13
CC: Sun C++ 5.8 Patch 121018-20 2009/04/20

I've tried hacking the configure script, but that wasn't fruitful.

$ /usr/bin/sh build/gnuauto/setup.sh
build/gnuauto/setup.sh: !: not found

Generating the build system in

copying files into place: cd build/gnuauto && cp -R -f *
running: libtoolize --force --copy
You should update your `aclocal.m4' by running aclocal.
running: aclocal
running: automake -a -c --foreign
src/Makefile.am:60: Libtool library used but `LIBTOOL' is undefined
src/Makefile.am:60: The usual way to define `LIBTOOL' is to add
src/Makefile.am:60: to `configure.in' and run `aclocal' and `autoconf'
running: autoconf
configure.in:84: error: possibly undefined macro: AC_PROG_LIBTOOL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.

If the above commands were successful you should now be able
to build in the usual way:

        $ ./configure --prefix=/usr
        $ make
        $ make install

to get a list of configure options type: ./configure --help

Alternatively, you should be able to build outside of the source
tree. e.g.:

        $ mkdir ../build-tidy
        $ cd ../build-tidy
        $ ../tidy/configure --prefix=/usr
        $ make
        $ make install

I've had to resort to patching the Makefile, which *I'd rather not do*

Using the make file

build/gmake/make all CC="/opt/SUNWspro/bin/cc" CFLAGS="-xarch=generic64"

leads to error when the

/opt/SUNWspro/bin/cc -xarch=generic64  -D_DEBUG=1 -o obj/access.o -c
"/users/mbana/Libs/test-recompile/1.46/src/tidy-int.h", line 17: cannot find
include file: "tidy.h"
"/export/nas02/users/mbana/Libs/test-recompile/1.46/src/forward.h", line 24:
cannot find include file: "platform.h"
"/users/mbana/Libs/test-recompile/1.46/src/forward.h", line 25: cannot find
include file: "tidy.h"
"/export/nas02/users/mbana/Libs/test-recompile/1.46/src/forward.h", line 59:
warning: no explicit type given
"/users/mbana/Libs/test-recompile/1.46/src/forward.h", line 59: syntax error
before or at: prvTidyg_default_allocator
"/users/mbana/Libs/test-recompile/1.46/src/forward.h", line 59: warning:
old-style declaration or incorrect type for: prvTidyg_default_allocator

Then I apply the following, perhaps, the only relevant part is removing the
GCC specific flag.

--- 1.46/build/gmake/Makefile    2010-07-19 10:37:05.000000000 +0100
+++ ../tidy/sources/1.46/build/gmake/Makefile    2010-07-15
13:01:07.000000000 +0100
@@ -53,13 +53,13 @@
 #  acknowledgment is not required but would be appreciated.



 # Installation variables.  Spaces OK, only dir create and file copy

 bininst = ${runinst_prefix}/bin
 libinst = ${devinst_prefix}/lib
@@ -67,7 +67,7 @@
 maninst = ${devinst_prefix}/man

 # Internal variables. - No spaces allowed: libtool chokes on spaces in
directory names.
-TOPDIR = ../..
+TOPDIR = /users/mbana/Libs/tidy/sources/1.46
 INCDIR = ${TOPDIR}/include
 APPDIR = ${TOPDIR}/console
@@ -91,12 +91,12 @@
 # For optimised builds, flags such as "-O2" should be added and -D_DEBUG=1
 # disabled.
 CC= gcc
-CFLAGS= -g -pedantic -Wall -I $(INCDIR)
+#CFLAGS= -g -pedantic -Wall -I $(INCDIR) # uncommented as it's not
supported by sun
 # flags only supported with gcc 3.x
-CFLAGS += -Wunused-parameter
+#CFLAGS += -Wunused-parameter # uncommented as it's not supported by sun

 # OTHERCFLAGS+= -fvisibility=hidden
@@ -184,7 +184,7 @@

 $(OBJDIR)/%$(OBJSUF):    $(SRCDIR)/%.c $(HFILES) $(LIBHFILES) Makefile
     if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi
-    $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ -c $<
+    $(CC) $(CFLAGS) $(OTHERCFLAGS) -I$(INCDIR) -o $@ -c $<

     if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
@@ -192,7 +192,7 @@

 $(BINDIR)/tab2space: $(APPDIR)/tab2space.c
     if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi
-    $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ $(APPDIR)/tab2space.c $(LIBS)
+    $(CC) $(CFLAGS) $(OTHERCFLAGS) -I$(INCDIR) -o $@ $(APPDIR)/tab2space.c

     $(BINDIR)/$(PROJECT) -xml-help > $@

Can you please fix this as we depend on HTML Tidy.  I don't want to patch
the Makefile manually each time we decide to upgrade.

Please CC me on reply, as I'm not registered on the mailing list.


Received on Tuesday, 20 July 2010 07:03:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:58 UTC