groff
[Top][All Lists]
Advanced

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

[Groff] Re: [Mingw-users] Problems Building "GROFF" with MinGW


From: MARSHALL Keith
Subject: [Groff] Re: [Mingw-users] Problems Building "GROFF" with MinGW
Date: Fri, 18 Jul 2003 16:21:32 +0100

Earlier, I asked how I might work around this problem ...
>> 
>>    make[2]: Entering directory 
`/home/rgbl0264/groff-1.18.1/src/roff/groff'
>>    g++ -g -O2  -o groff.exe groff.o pipeline.o
>>    /home/rgbl0264/groff-1.18.1/src/libs/libgroff/libgroff.a  -lm
>>    Info: resolving __sys_errlist by linking to __imp___sys_errlist 
(auto-import)
>>    fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname'
>>    nmth000000.o(.idata$4+0x0): undefined reference to 
`_nm___sys_errlist'
>>    make[2]: *** [groff.exe] Error 1
>>    make[2]: Leaving directory 
`/home/rgbl0264/groff-1.18.1/src/roff/groff'

Earnie Boyd <address@hidden> replied ...
>
>  Make sure that the package isn't defining or declaring it's own 
versions 
>  of sys_errlist.  Include stdlib.h instead.
>
>  Earnie.

This advice led me to extend my patch for "strerror.c" ...

diff -Naur org/strerror.c new/strerror.c
--- org/strerror.c      Wed Jul 16 12:54:12 2003
+++ new/strerror.c      Fri Jul 18 16:05:18 2003
@@ -22,13 +22,21 @@
 #endif
 
 #include <stdio.h>
+#ifdef __MINGW32__
+/* added 17-Jul-2003 by Keith Marshall <address@hidden> ...
+ * so we can find declaration of "sys_nerr" in MinGW */
+#include <stdlib.h>
+#endif
 
 #define INT_DIGITS 19          /* enough for 64 bit integer */
 
 #ifndef HAVE_SYS_NERR
 extern int sys_nerr;
 #endif
-#ifndef HAVE_SYS_ERRLIST
+#if !( defined HAVE_SYS_ERRLIST || defined __MINGW32__ )
+/* modified 18-Jul-2003 by Keith Marshall <address@hidden> ...
+ * even though we don't HAVE_SYS_ERRLIST, MinGW doesn't want this ...
+ * because it is defined as a macro in <stdlib.h> */
 extern char *sys_errlist[];
 #endif
 
... which resolved the problem, and let "make" proceed considerably 
farther;
thanks Earnie.

Greg Chicares <address@hidden> replied with ...
>
>  What happens if, instead of
>
>>    g++ -g -O2  -o groff.exe groff.o pipeline.o
>>    /home/rgbl0264/groff-1.18.1/src/libs/libgroff/libgroff.a  -lm
>
>  you try
>
>>   g++ -g -O2  -o groff.exe groff.o pipeline.o \
>>   -L /home/rgbl0264/groff-1.18.1/src/libs/libgroff -lgroff -lm
>
>  ? Sort of a shot in the dark.
>
Short answer here is "I don't know -- probably just the same error".
I didn't actually try this, since Earnie's reply had already led me
to a working patch.

Greg also asked ...
>
>  Did you build a groff.dll using '-shared', as opposed to
>  using dlltool?
>
In this case, I don't think either is relevant -- GROFF is a GNU package
so I just followed the conventional GNU build sequence for UNIX ...

        ./configure
        make

This wouldn't be expected to build any groff.dll -- just a statically 
linked
libgroff.a !

Thanks for your help, guys.  I have now got a lot further with the build,
but tripped up again with ...

make[2]: Entering directory `/home/rgbl0264/groff-1.18.1/src/preproc/html'
g++ -I. -I/home/rgbl0264/groff-1.18.1/src/preproc/html 
-I/home/rgbl0264/groff-1.18.1/src/include 
-I/home/rgbl0264/groff-1.18.1/src/include -DHAVE_CONFIG_H -g -O2  -c 
pre-html.cc
d:/mingw/include/io.h: In function `void checkImageDir()':
d:/mingw/include/io.h:145: too many arguments to function `int mkdir(const 

   char*)'
pre-html.cc:471: at this point in file
pre-html.cc: In function `void waitForChild(int)':
pre-html.cc:1068: `wait' undeclared (first use this function)
pre-html.cc:1068: (Each undeclared identifier is reported only once for 
each 
   function it appears in.)
pre-html.cc: In member function `int char_buffer::do_html(int, char**)':
pre-html.cc:1186: `pipe' undeclared (first use this function)
pre-html.cc:1189: `fork' undeclared (first use this function)
make[2]: *** [pre-html.o] Error 1
make[2]: Leaving directory `/home/rgbl0264/groff-1.18.1/src/preproc/html'
make[1]: *** [src/preproc/html] Error 2
make[1]: Leaving directory `/home/rgbl0264/groff-1.18.1'
make: *** [all] Error 2

I haven't really looked into this yet, but I already know how to fix the
"mkdir" problem, and I expect to find the "fork" and "wait" will be
coupled with an "exec...", which I can replace with the corresponding
"spawn..." -- do I need to #include <process.h>, as I used to with MSC-6?

Any tips on implementing an equivalent of the "pipe" function, or will 
this
depend on how "do_html" is using it?

Regards,
Keith Marshall

reply via email to

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