bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems building 1.22.2 on Solaris with vendor compiler


From: Albert Chin
Subject: Re: Problems building 1.22.2 on Solaris with vendor compiler
Date: Fri, 30 Aug 2013 14:16:06 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 29, 2013 at 11:18:52PM +0200, Werner LEMBERG wrote:
> 
> > I've tried building groff-1.22.2 on Solaris with the vendor compiler:
> >   ...
> >   "env.cpp", line 22:
> >     Error: Could not open include file <src/libs/gnulib/config.h>.
> 
> Line 22?  Are you sure?  This corresponds to
> 
>   #include "dictionary.h"
> 
> which doesn't fit the error message at all.  Either the line number is
> incorrect, or the Solaris compiler has a bug...  Or maybe you aren't
> using the upstream version of groff but a patched one?

Ignore the above. This was from my patching env.cpp to include
"src/libs/gnulib/config.h". The compiler error is:
  ...
  gmake[2]: Entering directory `/opt/build/groff-1.22.2/src/roff/troff'
  CC -I. -I. -I/opt/build/groff-1.22.2/src/include 
-I/opt/build/groff-1.22.2/src/include 
-I/opt/build/groff-1.22.2/src/libs/gnulib/lib -DHAVE_CONFIG_H -xO2 
-xtarget=ultra2 -m32 -xarch=sparcvis  -c  env.cpp
  "/opt/build/groff-1.22.2/src/libs/gnulib/lib/wctype.h", line 682: Error: "," 
expected instead of "extern".
  "/opt/solstudio12.2/prod/include/CC/exception", line 19: Error: "," expected 
instead of "namespace".
  "/opt/solstudio12.2/prod/include/CC/exception", line 24: Error: exception is 
not defined.
  "/opt/solstudio12.2/prod/include/CC/exception", line 26: Error: exception is 
not defined.
  "/opt/solstudio12.2/prod/include/CC/exception", line 27: Error: A declaration 
was expected instead of "}".
  "/opt/solstudio12.2/prod/include/CC/exception", line 28: Error: 'operator' 
referenced in #pragma should be global and previously declared.
  "/opt/solstudio12.2/prod/include/CC/exception", line 29: Error: "virtual" is 
not allowed here.
  ...

> > So, should we modify env.cpp and any other file with the above
> > problem to #include "src/libs/gnulib/config.h" and -I$(top_builddir)
> > as the solution?
> 
> I very much dislike this.  As far as I know, this is not how gnulib
> should be used.  The `wcwidth' module gets provided as a drop-in (via
> `libgnu.a') in case the functionality is not provided by the OS, and
> by including the standard `wchar.h' header (via `-I
> src/libs/gnulib/lib'), everything should be fine.  In particular,
> `config.h' should *not* be included.  Calling gnulib-tool, you see
> messages like below; the example is for `strdup':

No, `config.h' *should* be included. But, you have two config.h files.
That's the problem. You have one for gnulib and one for groff. If you
had just one config shared between both groff/gnulib (lots of programs
using gnulib do this), there would be no problem.

If you bring in src/libs/gnulib/lib/wctype.h for any groff program,
how is the following code suppose to work (line 58) if
_GL_INLINE_HEADER_BEGIN is defined in src/libs/gnulib/config.h and
*not* src/include/config.h?
  _GL_INLINE_HEADER_BEGIN

So, what you should really be doing is not having a separate
./configure for gnulib and a separate ./configure for groff. Merge
them and the problem will go away.

>  You may need to add #include directives for the following .h files.
>    #include <string.h>
>
>  Don't forget to
>    - add "lib/Makefile" to AC_CONFIG_FILES in ./configure.ac,
>    - mention "lib" in SUBDIRS in Makefile.am,
>    - mention "-I m4" in ACLOCAL_AMFLAGS in Makefile.am,
>    - invoke gl_EARLY in ./configure.ac, right after AC_PROG_CC,
>    - invoke gl_INIT in ./configure.ac.

The above message from gnulib assumes gnulib is merged as part of the
build process for the program in question, not being built separately
and only relying on the libgnu.a as a result.

-- 
albert chin (address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]