OK, now the xsrc build is compiling expat as a host tool again but this
time it blows up!

(As an aside I must say I'm dismayed by how expat_config.h wants to
include a header file unconditionally to figure out what the byte order
is -- that's been unnecessary for a decade or more (e.g. gcc-4.6.4
provides __BYTE_ORDER__ back in 2010).  Even without __BYTE_ORDER__
there have been well known CPP expressions that can detect byte order
reliably for most compilers and systems.  You have to go all the way
back to gcc-4.5 before __BYTE_ORDER_ is left missing!  Heck even pcc-1.2
from 2015 has it!  Even worse I find -DXML_BYTE_ORDER=0 in the
command-line below!  Autoconf has actually killed portability.)

I don't know how to properly fix this botch other than by just modifying
the Autoconf generated expat_config.h file.

diff --git a/src/external/mit/expat/lib/libexpat/expat_config.h 
b/src/external/mit/expat/lib/libexpat/expat_config.h
index ce8bb9a7a864..65c8e8f156bf 100644
--- a/external/mit/expat/lib/libexpat/expat_config.h
+++ b/external/mit/expat/lib/libexpat/expat_config.h
@@ -5,8 +5,12 @@
 /* #undef AC_APPLE_UNIVERSAL_BUILD */

 /* 1234 = LILENDIAN, 4321 = BIGENDIAN */
+#ifdef __BYTE_ORDER__
+#define BYTEORDER __BYTE_ORDER__
+#else
 #include <endian.h>
 #define BYTEORDER _BYTE_ORDER
+#endif

 /* Define to 1 if you have the `arc4random' function. */
 /* #undef HAVE_ARC4RANDOM */


    compile  fc-cache/xmlrole.lo
In file included from 
/Volumes/work/woods/g-NetBSD-src/external/mit/expat/dist/lib/xmlrole.c:41:
/Volumes/work/woods/g-NetBSD-src/external/mit/expat/dist/../lib/libexpat/expat_config.h:8:10:
 fatal error: 'endian.h' file not found
    8 | #include <endian.h>
      |          ^~~~~~~~~~
1 error generated.
--- xmlrole.lo ---

*** Failed target: xmlrole.lo
*** In directory: 
/Volumes/work/woods/g-NetBSD-src/external/mit/xorg/tools/fc-cache
*** Failed commands:
        ${_MKTARGET_COMPILE}
        => @echo '   ' "compile " fc-cache/xmlrole.lo
        ${HOST_COMPILE.c} -o ${.TARGET}.o ${COPTS.${.IMPSRC:T}} 
${CPUFLAGS.${.IMPSRC:T}} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
        => cc -O -O2  
-DFONTCONFIG_PATH='"/Users/woods/build/woods/very.local/trunk-amd64-destdir/etc/X11/fonts"'
  -DFC_DEFAULT_FONTS='"/usr/X11R7/lib/X11/fonts/Type1"'  
-DFC_TEMPLATEDIR='"/Users/woods/build/woods/very.local/trunk-amd64-destdir/usr/X11R7/lib/X11/fonts"'
  
-DFC_CACHEDIR='"/Users/woods/build/woods/very.local/trunk-amd64-destdir/var/cache/fontconfig"'
  
-DCONFIGDIR='"/Users/woods/build/woods/very.local/trunk-amd64-destdir/etc/fonts/conf.d"'
  -DFC_GPERF_SIZE_T=unsigned  -DFC_NO_MT=1  -DALIGNOF_VOID_P=8  
-DSIZEOF_VOID_P=8  -DHAVE_FT_BITMAP_SIZE_Y_PPEM  -DHAVE_FT_GET_BDF_PROPERTY  
-DHAVE_FT_GET_NEXT_CHAR  -DHAVE_FT_GET_PS_FONT_INFO  
-DHAVE_FT_GET_X11_FONT_FORMAT  -DHAVE_FT_HAS_PS_GLYPH_NAMES  -DHAVE_EXPAT 
-DXFREE86_FT2 -DHAVE_INTTYPES_H  -DFT2_BUILD_LIBRARY  -DXML_BYTE_ORDER=0 
-DHAVE_MEMMOVE=1  -DHAVE_STDINT_H -DHAVE_RANDOM -DDARWIN_NO_CARBON  
-DHAVE_SYS_TYPES_H -DHAVE_FCNTL_H -DHAVE_SYS_STAT_H  -DHAVE_MKSTEMP  
-DHAVE_SCANDIR  -DFLEXIBLE_ARRAY_MEMBER="/**/"  -DHAVE_DIRENT_H 
 -DHAVE_UNISTD_H -DFT_CONFIG_OPTION_DISABLE_BZIP2 
-I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/fontconfig/dist 
-I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/freetype/dist  
-I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/freetype/dist/include 
-I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/freetype/dist/include/freetype 
 -I/Volumes/work/woods/g-NetBSD-src/external/mit/expat/dist/lib 
-I/Volumes/work/woods/g-NetBSD-src/external/mit/expat/dist/../lib/libexpat  
-I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/fontconfig/dist/../include  
-I/Users/woods/build/woods/very.local/trunk-amd64-destdir/usr/X11R7/include -I. 
 -I/Volumes/work/woods/g-NetBSD-xsrc/external/mit/fontconfig/dist/../include 
-DXML_POOR_ENTROPY -DTOOL_FCCACHE -c -o xmlrole.lo.o    
/Volumes/work/woods/g-NetBSD-src/external/mit/expat/dist/lib/xmlrole.c

--
                                        Greg A. Woods <gwo...@acm.org>

Kelowna, BC     +1 250 762-7675           RoboHack <wo...@robohack.ca>
Planix, Inc. <wo...@planix.com>     Avoncote Farms <wo...@avoncote.ca>

Attachment: pgp0EImxPzXeS.pgp
Description: OpenPGP Digital Signature

Reply via email to