After all the macros expand, autotools patching, autoreconfig, libtool patching, libtoolizing, we hit the magic call to ./configure:
This one is really ugly, I'll spoiler it:
Notice that somebody/something trashed LDFLAGS after I dealt with them.
The gcc format sysroot option got stuffed into LDFLAGS and notice also that the gcc format sysroot option is missing from CFLAGS, CXXFLAGS and FCFLAGS.
The only reason this one isn't blowing up is because it links with gcc (via libtool) rather than ld and there is a bunch of stuff in there that makes up for the missing sysroot.
Spoiler:
If you think this is bad, remember it started out as a single line command before I broke it up:
Code:
>>> This is: $(auto.reconfig-env) autoreconfig $(auto.reconfig-args)
(
cd /var2/k2-work/k2-rel/build/libtirpc-0.3.2/ && \
PATH=\
"/var2/k2-work/k2-rel/./host/bin:\
/var2/k2-work/k2-rel/./host/sbin:\
/var2/k2-work/k2-rel/./host/usr/bin:\
/var2/k2-work/k2-rel/./host/usr/sbin:\
/usr/local/sbin:\
/usr/local/bin:\
/usr/sbin:\
/usr/bin:\
/sbin:\
/bin:\
/usr/games" \
AR="/usr/bin/ar" \
AS="/usr/bin/as" \
LD="/usr/bin/ld" \
NM="/usr/bin/nm" \
CC="/usr/bin/gcc" \
GCC="/usr/bin/gcc" \
CXX="/usr/bin/g++" \
CPP="/usr/bin/cpp" \
OBJCOPY="/usr/bin/objcopy" \
RANLIB="/usr/bin/ranlib" \
CPPFLAGS="-I/var2/k2-work/k2-rel/./host/usr/include" \
CFLAGS="-O2 -I/var2/k2-work/k2-rel/./host/usr/include" \
CXXFLAGS="-O2 -I/var2/k2-work/k2-rel/./host/usr/include" \
LDFLAGS="-L/var2/k2-work/k2-rel/./host/lib -L/var2/k2-work/k2-rel/./host/usr/lib \
-Wl,-rpath,/var2/k2-work/k2-rel/./host/usr/lib" \
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
PKG_CONFIG="/var2/k2-work/k2-rel/./host/usr/bin/pkg-config" \
PKG_CONFIG_SYSROOT_DIR="/" \
PKG_CONFIG_LIBDIR="/var2/k2-work/k2-rel/./host/usr/lib/pkgconfig:\
/var2/k2-work/k2-rel/./host/usr/share/pkgconfig" \
LD_LIBRARY_PATH="/var2/k2-work/k2-rel/./host/usr/lib" \
INTLTOOL_PERL=/usr/bin/perl \
ACLOCAL="/var2/k2-work/k2-rel/./host/usr/bin/aclocal \
-I /var2/k2-work/k2-rel/./host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/share/aclocal" \
AUTOCONF="/var2/k2-work/k2-rel/./host/usr/bin/autoconf" \
AUTOHEADER="/var2/k2-work/k2-rel/./host/usr/bin/autoheader" \
AUTOMAKE="/var2/k2-work/k2-rel/./host/usr/bin/automake" \
AUTOPOINT=/bin/true \
/var2/k2-work/k2-rel/./host/usr/bin/autoreconf -f -i \
-I "/var2/k2-work/k2-rel/./host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/share/aclocal" \
-I "/var2/k2-work/k2-rel/./host/usr/share/aclocal"
>>> This is: $(configure-env) ./configure $(configure-args)
(
cd /var2/k2-work/k2-rel/build/libtirpc-0.3.2/ && \
rm -rf config.cache && \
PATH="/var2/k2-work/k2-rel/./host/bin:\
/var2/k2-work/k2-rel/./host/sbin:\
/var2/k2-work/k2-rel/./host/usr/bin:\
/var2/k2-work/k2-rel/./host/usr/sbin:\
/usr/local/sbin:\
/usr/local/bin:\
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
AR="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-ar" \
AS="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-as" \
LD="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-ld" \
NM="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-nm" \
CC="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-gcc" \
GCC="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-gcc" \
CPP="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-cpp" \
CXX="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-g++" \
FC="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-gfortran" \
RANLIB="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-ranlib" \
READELF="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-readelf" \
STRIP="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-strip" \
OBJCOPY="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-objcopy" \
OBJDUMP="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-objdump" \
AR_FOR_BUILD="/usr/bin/ar" \
AS_FOR_BUILD="/usr/bin/as" \
CC_FOR_BUILD="/usr/bin/gcc" \
GCC_FOR_BUILD="/usr/bin/gcc" \
CXX_FOR_BUILD="/usr/bin/g++" \
LD_FOR_BUILD="/usr/bin/ld" \
CPPFLAGS_FOR_BUILD="-I/var2/k2-work/k2-rel/./host/usr/include" \
CFLAGS_FOR_BUILD="-O2 -I/var2/k2-work/k2-rel/./host/usr/include" \
CXXFLAGS_FOR_BUILD="-O2 -I/var2/k2-work/k2-rel/./host/usr/include" \
LDFLAGS_FOR_BUILD="-L/var2/k2-work/k2-rel/./host/lib -L/var2/k2-work/k2-rel/./host/usr/lib \
-Wl,-rpath,/var2/k2-work/k2-rel/./host/usr/lib" \
FCFLAGS_FOR_BUILD="" \
DEFAULT_ASSEMBLER="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-as" \
DEFAULT_LINKER="/var2/k2-work/k2-rel/./host/usr/bin/arm-linux-ld" \
GCCFLAGS="-Wl,-I/mnt/base-us/esys/lib/ld-linux-armhf.so.3" \
CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" \
CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 \
-Wl,-I/mnt/base-us/esys/lib/ld-linux-armhf.so.3" \
CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2
-Wl,-I/mnt/base-us/esys/lib/ld-linux-armhf.so.3" \
LDFLAGS="-I/mnt/base-us/esys/lib/ld-2.21.so" \
FCFLAGS="" \
PKG_CONFIG="/var2/k2-work/k2-rel/./host/usr/bin/pkg-config" \
STAGING_DIR="/var2/k2-work/k2-rel/./host/usr/arm-buildroot-linux-gnueabihf/sysroot" \
INTLTOOL_PERL=/usr/bin/perl \
ac_cv_lbl_unaligned_fail=yes \
ac_cv_func_mmap_fixed_mapped=yes \
ac_cv_func_memcmp_working=yes \
ac_cv_have_decl_malloc=yes \
gl_cv_func_malloc_0_nonnull=yes \
ac_cv_func_malloc_0_nonnull=yes \
ac_cv_func_calloc_0_nonnull=yes \
ac_cv_func_realloc_0_nonnull=yes \
lt_cv_sys_lib_search_path_spec="" \
ac_cv_c_bigendian=no \
CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 \
-Wl,-I/mnt/base-us/esys/lib/ld-linux-armhf.so.3 -DGQ" \
CONFIG_SITE=/dev/null \
./configure \
--target=arm-buildroot-linux-gnueabihf \
--host=arm-buildroot-linux-gnueabihf \
--build=i686-pc-linux-gnu \
--prefix=/usr \
--exec-prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--program-prefix="" \
--disable-gtk-doc \
--disable-gtk-doc-html \
--disable-doc \
--disable-docs \
--disable-documentation \
--with-xmlto=no \
--with-fop=no \
--disable-dependency-tracking \
--enable-ipv6 \
--disable-static \
--enable-shared \
--disable-gssapi
)
)
Which reminds me -
It would be a good thing to add menu entries that over-ride:
--sysconfdir=/etc and --localstatedir=/var
to put those into the writable: /mnt/base-us/esys/* tree.
Well, enough for tonight, more tomorrow.