groff
[Top][All Lists]
Advanced

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

[Groff] Compiling groff 1.18.2 with gcc3 under Cygwin


From: Alejandro Lopez-Valencia
Subject: [Groff] Compiling groff 1.18.2 with gcc3 under Cygwin
Date: Tue, 31 Dec 2002 10:24:33 -0500

I think I have tracked down failure to compilegroff with gcc 3.x to a problem with the supplied GNU getopt header. The folowing patch works:

$ diff -u groff/src/include/getopt.h groff_build/src/include/getopt.h
--- groff/src/include/getopt.h  2002-12-06 05:54:49.000000000 -0500
+++ groff_build/src/include/getopt.h    2002-12-30 11:56:46.000000000 -0500
@@ -138,7 +138,7 @@
    `getopt'.  */

 #if (defined __STDC__ && __STDC__) || defined __cplusplus
-# ifdef __GNU_LIBRARY__
+# if (defined __GNU_LIBRARY__ || __CYGWIN__ || __MINGW32__)
 /* Many other libraries have conflicting prototypes for getopt, with
    differences in the consts, in stdlib.h.  To avoid compilation
    errors, only prototype getopt for the GNU C library.  */

That is, gcc3 needs this prototype declared:

extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)

Notice that the Mingw32 build fails due to other problems with differences in the mingw prototypes for mktemp and related functions:

g++ -mno-cygwin -mconsole -I. -I/home/alv/groff/src/libs/libgroff -I/home/alv/gr off_w32/src/include -I/home/alv/groff/src/include -DHAVE_CONFIG_H -g -O2 -c /ho
me/alv/groff/src/libs/libgroff/tmpname.cc
/usr/include/mingw/io.h: In function `int gen_tempname(char*, int)':
/usr/include/mingw/io.h:145: too many arguments to function `int mkdir(const
   char*)'
/home/alv/groff/src/libs/libgroff/tmpname.cc:105: at this point in file
make[2]: *** [tmpname.o] Error 1
make[2]: Leaving directory `/home/alv/groff_w32/src/libs/libgroff'
make[1]: *** [src/libs/libgroff] Error 2
make[1]: Leaving directory `/home/alv/groff_w32'
make: *** [all] Error 2

I guess that might be a bug in mingw's headers and needs to be reported elsewhere.

Can anyone test if forcing the declaration of the getopt prototype makes possible compiling groff in MacOSX with gcc3 (You may need to update your gcc3 to version 3.2.1, I am using cygwin binaries based on a CVS snapshot one or two weeks before gold release)?


reply via email to

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