bug-texinfo
[Top][All Lists]
Advanced

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

Re: cygwin build problem: sys/bitypes.h: No such file or directory


From: Brian Dessent
Subject: Re: cygwin build problem: sys/bitypes.h: No such file or directory
Date: Tue, 31 Oct 2006 15:50:34 -0800

Karl Berry wrote:

> I updated to the current sources in gnulib.  Is it any better?
> If not, please continue to provide the exact error messages, and I'll
> ask address@hidden  (Or feel free to write there yourself. :)  I
> might be doing something wrong in my usage of all the modules, but
> nothing is clear-cut ...
> 
> There were changes in gnulib stdint, so please retry that too.

I tried a fresh checkout, but it's the same error with sys/bitypes.h,
regardless of vpath build or no.  I think I've tracked that down,
though.  It seems that gnulib/lib/stdint.h is a generated file
(processed with substitutions from stdint_.h) but it is checked into
CVS.  The problemmatic part is this in stdint_.h:

#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
  /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
     int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it
is
     included by <sys/types.h>.  */
# include <sys/bitypes.h>
#endif

However, in my config.status HAVE_SYS_BITYPES is not set (nor it is even
checked during configure, probably due to not having glibc) so this
should not ever be compiled, yet it is substituted into the stdint.h in
CVS as set:

#if 1 && ! defined __BIT_TYPES_DEFINED__
  /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
     int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it
is
     included by <sys/types.h>.  */
# include <sys/bitypes.h>
#endif

If I delete this $srcdir/gnulib/lib/stdint.h, the problem goes away. 
Indeed, stdint.h isn't even regenerated as it seems to be needed only on
platforms with a non-C99 stdint.h, which thankfully appears to not be
Cygwin:

checking whether stdint.h conforms to C99... yes

But unfortunately I'm back to the rpl_strcasecmp error in the lib/ dir. 
This is caused by the fact that system.h tries to include the
replacement version of str{,n}casecmp but on Cygwin this is provided in
/usr/include/string.h and it complains about the duplicated definition. 
The problem is that system.h has this:

#if !HAVE_STRNCASECMP || !HAVE_STRCASECMP
# include "strcase.h"
#endif

...but the generated configure script never even checks for either
function and thus HAVE_STRNCASECMP and HAVE_STRCASECMP are always unset,
so there's not even a chance that this is correct.  I did this:

Index: configure.ac
===================================================================
RCS file: /sources/texinfo/texinfo/configure.ac,v
retrieving revision 1.66
diff -u -p -r1.66 configure.ac
--- configure.ac        22 Sep 2006 10:24:53 -0000      1.66
+++ configure.ac        31 Oct 2006 23:25:37 -0000
@@ -82,7 +82,7 @@ AC_FUNC_VPRINTF
 # that anyone compiling new texinfo still has such a thing? we'll see.
 # AC_FUNC_SETVBUF_REVERSED
 AC_CHECK_FUNCS(bzero getcwd memset setvbuf sigaction sigprocmask \
-               sigsetmask strchr)
+               sigsetmask strchr strcasecmp strncasecmp)
 AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
 
 # We want to recognize djgpp to avoid the useless warning about no

...and now configure checks for them, finds them, and sets the HAVE_*
values in config.h to 1, and the build continues.

The next problem occurs when linking the binaries:

make[2]: Entering directory `/build/texinfo/info'
gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/src/texinfo/info  -I/usr/src/texinfo
-I/usr/src/texinfo/gnulib/lib -I../gnulib/lib
-DLOCALEDIR=\"/usr/local/share/locale\"
-DINFODIR=\"/usr/local/share/info\"
-DINFODIR2=\"/usr/local/share/info\"   -g -O2 -MT makedoc.o -MD -MP -MF
.deps/makedoc.Tpo -c -o makedoc.o /usr/src/texinfo/info/makedoc.c
mv -f .deps/makedoc.Tpo .deps/makedoc.Po
gcc  -g -O2   -o makedoc.exe makedoc.o ../lib/libtxi.a
../gnulib/lib/libgnu.a -lncurses -lintl 
../gnulib/lib/libgnu.a(error.o): In function `error':
/usr/src/texinfo/gnulib/lib/error.c:250: undefined reference to
`_program_name'
../gnulib/lib/libgnu.a(error.o): In function `error_at_line':
/usr/src/texinfo/gnulib/lib/error.c:309: undefined reference to
`_program_name'
collect2: ld returned 1 exit status

This seems to be another issue that is shielded on glibc systems by this
in gnulib/lib/error.c:

#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this.  */

# define program_name program_invocation_name

However, on non-glibc the program_name variable must be declared, which
is it not (in the case of info/makedoc.c) or declared static.  I did
this:

Index: info/info.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/info.c,v
retrieving revision 1.14
diff -u -p -r1.14 info.c
--- info/info.c 13 Aug 2006 23:36:22 -0000      1.14
+++ info/info.c 31 Oct 2006 23:17:53 -0000
@@ -28,7 +28,7 @@
 #  include "man.h"
 #endif /* HANDLE_MAN_PAGES */
 
-static char *program_name = "info";
+char *program_name = "info";
 
 /* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
 static int apropos_p = 0;
Index: info/infokey.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/infokey.c,v
retrieving revision 1.11
diff -u -p -r1.11 infokey.c
--- info/infokey.c      19 Aug 2005 22:23:54 -0000      1.11
+++ info/infokey.c      31 Oct 2006 23:17:53 -0000
@@ -26,7 +26,7 @@
 #include "key.h"
 #include "getopt.h"
 
-static char *program_name = "infokey";
+char *program_name = "infokey";
 
 /* Non-zero means print version info only. */
 static int print_version_p = 0;
Index: info/makedoc.c
===================================================================
RCS file: /sources/texinfo/texinfo/info/makedoc.c,v
retrieving revision 1.5
diff -u -p -r1.5 makedoc.c
--- info/makedoc.c      15 May 2005 00:00:07 -0000      1.5
+++ info/makedoc.c      31 Oct 2006 23:17:53 -0000
@@ -28,6 +28,8 @@
 #include "info.h"
 #include "infokey.h"
 
+char *program_name = "makedoc";
+
 static void fatal_file_error (char *filename);
 
 /* Name of the header file which receives the declarations of
functions. */
Index: util/texindex.c
===================================================================
RCS file: /sources/texinfo/texinfo/util/texindex.c,v
retrieving revision 1.17
diff -u -p -r1.17 texindex.c
--- util/texindex.c     24 Oct 2006 22:28:28 -0000      1.17
+++ util/texindex.c     31 Oct 2006 23:17:54 -0000
@@ -21,7 +21,7 @@
 #include "system.h"
 #include <getopt.h>
 
-static char *program_name = "texindex";
+char *program_name = "texindex";
 
 #if defined (emacs)
 #  include "../src/config.h"


... and the build continued.  The next problem was building in the po/
directory:

make[2]: Entering directory `/build/texinfo/po'
make texinfo.pot-update
make[3]: Entering directory `/build/texinfo/po'
make[3]: *** No rule to make target `/usr/src/texinfo/lib/getopt.c',
needed by `texinfo.pot-update'.  Stop.
make[3]: Leaving directory `/build/texinfo/po'

It looks like this is simply a case of POTFILES.in becoming out of
sync.  I did this:

Index: po/POTFILES.in
===================================================================
RCS file: /sources/texinfo/texinfo/po/POTFILES.in,v
retrieving revision 1.4
diff -u -p -r1.4 POTFILES.in
--- po/POTFILES.in      18 Aug 2006 13:03:13 -0000      1.4
+++ po/POTFILES.in      31 Oct 2006 23:24:41 -0000
@@ -23,8 +23,8 @@ info/session.c
 info/tilde.c
 info/variables.c
 info/window.c
-lib/getopt.c
-lib/system.h
+gnulib/lib/getopt.c
+system.h
 makeinfo/cmds.c
 makeinfo/defun.c
 makeinfo/files.c

And the build finally succeeded.  The testsuite looks as follows:

Making check in gnulib/lib
make[1]: Entering directory `/build/texinfo/gnulib/lib'
make  check-am
make[2]: Entering directory `/build/texinfo/gnulib/lib'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/build/texinfo/gnulib/lib'
make[1]: Leaving directory `/build/texinfo/gnulib/lib'
Making check in lib
make[1]: Entering directory `/build/texinfo/lib'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/build/texinfo/lib'
Making check in info
make[1]: Entering directory `/build/texinfo/info'
make  check-am
make[2]: Entering directory `/build/texinfo/info'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/build/texinfo/info'
make[1]: Leaving directory `/build/texinfo/info'
Making check in makeinfo
make[1]: Entering directory `/build/texinfo/makeinfo'
Making check in tests
make[2]: Entering directory `/build/texinfo/makeinfo/tests'
make  check-TESTS
make[3]: Entering directory `/build/texinfo/makeinfo/tests'
PASS: accent
PASS: accentenc
PASS: cond
PASS: copying
PASS: defxcond
PASS: emph-option
PASS: html-docdesc
PASS: html-extrali
PASS: html-min
PASS: html-manuals
PASS: html-para
PASS: html-title
PASS: html-top
PASS: include-value
PASS: macro-at
PASS: menu-whitespace
nul: Bad address
makeinfo: Removing output file `nul' due to errors; use --force to
preserve.
FAIL: no-headers
PASS: node-expand
PASS: node-value
PASS: node-whitespace
PASS: quote-args
PASS: top
PASS: twofiles
====================================
1 of 23 tests failed
Please report to address@hidden
====================================
make[3]: *** [check-TESTS] Error 1
make[3]: Leaving directory `/build/texinfo/makeinfo/tests'
make[2]: *** [check-am] Error 2
make[2]: Target `check' not remade because of errors.
make[2]: Leaving directory `/build/texinfo/makeinfo/tests'
make[2]: Entering directory `/build/texinfo/makeinfo'
make[2]: Nothing to be done for `check-am'.
make[2]: Leaving directory `/build/texinfo/makeinfo'
make[1]: *** [check-recursive] Error 1
make[1]: Target `check' not remade because of errors.
make[1]: Leaving directory `/build/texinfo/makeinfo'
Making check in po
make[1]: Entering directory `/build/texinfo/po'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/build/texinfo/po'
Making check in util
make[1]: Entering directory `/build/texinfo/util'
make  defs
make[2]: Entering directory `/build/texinfo/util'
make[2]: `defs' is up to date.
make[2]: Leaving directory `/build/texinfo/util'
make  check-TESTS
make[2]: Entering directory `/build/texinfo/util'
SKIP: bibtex.test
FAIL: dvipdf.test
SKIP: latex2html.test
PASS: local.test
FAIL: texi2dvi.test
====================================
2 of 3 tests failed
(2 tests were not run)
Please report to address@hidden
====================================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/build/texinfo/util'
make[1]: *** [check-am] Error 2
make[1]: Target `check' not remade because of errors.
make[1]: Leaving directory `/build/texinfo/util'
Making check in doc
make[1]: Entering directory `/build/texinfo/doc'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/build/texinfo/doc'
make[1]: Entering directory `/build/texinfo'
make[1]: Leaving directory `/build/texinfo'
make: *** [check-recursive] Error 1
make: Target `check' not remade because of errors.


The no-headers test fails because it tries to use a filename 'nul'.

# Test may fail on Cygwin, if we say `-o /dev/null',
# but is ok if we substitute the Win32 native `nul' device,
# (seen by `test -e', but not char-special in `test -c').
test -e nul && nulldev=nul || nulldev=/dev/null

The logic here seems opposite of what it should be.  /dev/null is the
correct thing to use on Cygwin, and the test passes if I just change it
to "nulldev=/dev/null" unconditionally.  I think this might have been a
problem in prior versions of Cygwin but AFAIK /dev/null has been the
correct thing to use for a long time now.

I don't know why dvipdf.test and texi2dvi.test are failing.  I'm fairly
ignorant of TeX and probably don't know enough to debug these without
instruction.  I do have /usr/bin/etex set to a symlink to pdfetex rather
than its own binary, which was a requirement to get a working texi2pdf
in the past.  I'm not sure if that's relevant here.  I tried to do a
"make install" to get a texi2pdf that I could test on existing .texi
sources, but I get a problem in the po directory:

Making install in po
make[1]: Entering directory `/build/texinfo/po'
/bin/sh @MKINSTALLDIRS@ /opt/bleeding/share
/bin/sh: @MKINSTALLDIRS@: No such file or directory
make[1]: *** [install-data-yes] Error 127
make[1]: Leaving directory `/build/texinfo/po'
make: *** [install-recursive] Error 1

(/opt/bleeding is the --prefix).  I'm sure this is something trivial but
I just worked around it with "make -k install".  I then tried the newly
installed /opt/bleeding/bin/texi2pdf on coreutils.texi and it seemed to
work fine, generating a nice 212 page PDF.  However, I did not replace
the existing packaged 4.8 texinfo.tex in the TEXMF dir with the latest
ones from CVS, so this may not actually be testing the CVS version
correctly.

Brian




reply via email to

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