From c258690ec22495cbe78c5c6c5041ffaec158a41e Mon Sep 17 00:00:00 2001 From: Niels Sascha Reedijk Date: Tue, 20 Jun 2023 20:06:04 +0000 Subject: [PATCH] GCC: Add recipe for 13.1.0 Currently set all supported platforms as unstable, as the recipe requires Haiku hrev56977 or later to build. --- sys-devel/gcc/gcc-13.1.0_2023_06_20.recipe | 535 ++ .../patches/gcc-13.1.0_2023_06_20.patchset | 8276 +++++++++++++++++ 2 files changed, 8811 insertions(+) create mode 100644 sys-devel/gcc/gcc-13.1.0_2023_06_20.recipe create mode 100644 sys-devel/gcc/patches/gcc-13.1.0_2023_06_20.patchset diff --git a/sys-devel/gcc/gcc-13.1.0_2023_06_20.recipe b/sys-devel/gcc/gcc-13.1.0_2023_06_20.recipe new file mode 100644 index 000000000..dcd213c5c --- /dev/null +++ b/sys-devel/gcc/gcc-13.1.0_2023_06_20.recipe @@ -0,0 +1,535 @@ +SUMMARY="C/C++ compiler for target ${effectiveTargetMachineTriple}" +DESCRIPTION="The standard compiler for non-legacy Haiku (i.e. for all \ +architectures other than x86_gcc2)." +HOMEPAGE="https://gcc.gnu.org/" +COPYRIGHT="1988-2023 Free Software Foundation, Inc." +LICENSE="GNU GPL v3 + GNU LGPL v3" +REVISION="1" +gccVersion="${portVersion%%_*}" +SOURCE_URI="https://ftpmirror.gnu.org/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz + https://ftp.gnu.org/gnu/gcc/gcc-$gccVersion/gcc-$gccVersion.tar.xz" +CHECKSUM_SHA256="61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86" +SOURCE_DIR="gcc-$gccVersion" +PATCHES="gcc-$portVersion.patchset" + +ARCHITECTURES="?all !x86_gcc2" +SECONDARY_ARCHITECTURES="?x86" + +libatomicSoVersion="1" +libatomicLibVersion="1.2.0" + +libgccSoVersion="1" +libgccLibVersion="1" + +libgfortranSoVersion="5" +libgfortranLibVersion="5.0.0" + +libgompSoVersion="1" +libgompLibVersion="1.0.0" + +libquadmathSoVersion="0" +libquadmathLibVersion="0.0.0" + +libsspSoVersion="0" +libsspLibVersion="0.0.0" + +libstdcxxSoVersion="6" +libstdcxxLibVersion="6.0.31" + +PROVIDES=" + gcc$secondaryArchSuffix = $portVersion compat >= 7 + cmd:c++$secondaryArchSuffix = $portVersion compat >= 7 + cmd:cc$secondaryArchSuffix = $portVersion compat >= 7 + cmd:cpp$secondaryArchSuffix = $portVersion compat >= 7 + cmd:g++$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcc$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcc_ar$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcc_nm$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcc_ranlib$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcov$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcov_dump$secondaryArchSuffix = $portVersion compat >= 7 + cmd:gcov_tool$secondaryArchSuffix = $portVersion compat >= 7 + cmd:lto_dump$secondaryArchSuffix = $portVersion compat >= 7 + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:as$secondaryArchSuffix + lib:libgmp$secondaryArchSuffix + lib:libmpc$secondaryArchSuffix + lib:libmpfr$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +SUMMARY_fortran="C/C++-runtime static libraries and C++ headers, needed for gfortran" +DESCRIPTION_fortran="This package is not of general interest - it \ +contains the set of gcc's C/C++-runtime libraries and headers that is \ +required by gfortran to build fortran source code." +PROVIDES_fortran=" + gcc${secondaryArchSuffix}_fortran = $portVersion compat >= 7 + cmd:gfortran$secondaryArchSuffix = $portVersion compat >= 7 + cmd:f951$secondaryArchSuffix = $portVersion compat >= 7 + devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion + devel:libcaf_single$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion + " +REQUIRES_fortran=" + haiku$secondaryArchSuffix + gcc${secondaryArchSuffix}_syslibs == $portVersion base + " + +SUMMARY_syslibs="C/C++-runtime shared libraries, needed to execute C/C++ programs" +DESCRIPTION_syslibs="The C/C++-runtime libraries that are part of the gcc \ +distribution. This package contains the shared libraries for the runtime \ +loader, so it is required for executing most c/c++ programs." +PROVIDES_syslibs=" + gcc${secondaryArchSuffix}_syslibs = $portVersion compat >= 7 + lib:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion + lib:libgcc_s$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + lib:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion + lib:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion + lib:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion + lib:libssp$secondaryArchSuffix = $libsspLibVersion compat >= $libsspSoVersion + lib:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion + lib:libsupc++$secondaryArchSuffix = $portVersion compat >= 7 + " +REQUIRES_syslibs=" + haiku$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +SUMMARY_syslibs_devel="C/C++-runtime static libraries and C++ headers, needed to build Haiku" +DESCRIPTION_syslibs_devel="This package is not of general interest - it \ +contains the set of gcc's C/C++-runtime libraries and headers that is \ +required by Haiku's build system when building Haiku." +PROVIDES_syslibs_devel=" + gcc${secondaryArchSuffix}_syslibs_devel = $portVersion compat >= 7 + devel:libatomic$secondaryArchSuffix = $libatomicLibVersion compat >= $libatomicSoVersion + devel:libgcc$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_boot$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_eh$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_eh_boot$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_eh_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_kernel$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgcc_s$secondaryArchSuffix = $libgccLibVersion compat >= $libgccSoVersion + devel:libgfortran$secondaryArchSuffix = $libgfortranLibVersion compat >= $libgfortranSoVersion + devel:libgomp$secondaryArchSuffix = $libgompLibVersion compat >= $libgompSoVersion + devel:libquadmath$secondaryArchSuffix = $libquadmathLibVersion compat >= $libquadmathSoVersion + devel:libssp$secondaryArchSuffix = $libsspLibVersion compat >= $libsspSoVersion + devel:libssp_nonshared$secondaryArchSuffix = $libsspLibVersion + devel:libstdc++$secondaryArchSuffix = $libstdcxxLibVersion compat >= $libstdcxxSoVersion + devel:libstdc++exp$secondaryArchSuffix = $portVersion compat >= 7 + devel:libsupc++$secondaryArchSuffix = $portVersion compat >= 7 + devel:libsupc++_boot$secondaryArchSuffix = $portVersion compat >= 7 + devel:libsupc++_kernel$secondaryArchSuffix = $portVersion compat >= 7 + " +REQUIRES_syslibs_devel="" + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libgmp$secondaryArchSuffix >= 10.4.1 + devel:libmpc$secondaryArchSuffix >= 3.2.1 + devel:libmpfr$secondaryArchSuffix >= 6.2 + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:autoconf + cmd:awk + cmd:find + cmd:flex + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:make + cmd:makeinfo + cmd:sed + cmd:strip + cmd:tar + cmd:xargs + " + +relativeInstallDir="develop/tools$secondaryArchSubDir" +installDir="$prefix/$relativeInstallDir" +objectsDir=$sourceDir/../${portVersionedName}-obj +gccLibDir=lib/gcc/$effectiveTargetMachineTriple/$gccVersion + +defineDebugInfoPackage gcc$secondaryArchSuffix \ + "$gccLibDir"/cc1 \ + "$gccLibDir"/cc1obj \ + "$gccLibDir"/cc1plus \ + "$gccLibDir"/collect2 \ + "$gccLibDir"/g++-mapper-server \ + "$gccLibDir"/libatomic.so.$libatomicLibVersion \ + "$gccLibDir"/libgcc_s.so.$libgccSoVersion \ + "$gccLibDir"/libgfortran.so.$libgfortranLibVersion \ + "$gccLibDir"/libgomp.so.$libgompLibVersion \ + "$gccLibDir"/libquadmath.so.$libquadmathLibVersion \ + "$gccLibDir"/libssp.so.$libsspLibVersion \ + "$gccLibDir"/libstdc++.so.$libstdcxxLibVersion \ + "$gccLibDir"/lto1 \ + "$gccLibDir"/lto-wrapper \ + "$installDir/bin"/cpp \ + "$installDir/bin"/g++ \ + "$installDir/bin"/gcc \ + "$installDir/bin"/gcc-ar \ + "$installDir/bin"/gcc-nm \ + "$installDir/bin"/gcc-ranlib \ + "$installDir/bin"/gcov \ + "$installDir/bin"/gcov-dump \ + "$installDir/bin"/gcov-tool \ + "$installDir/bin"/lto-dump \ + "$(getPackagePrefix fortran)/$relativeInstallDir"/bin/gfortran \ + "$(getPackagePrefix fortran)/$relativeInstallDir/$gccLibDir"/f951 \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libatomic.so.$libatomicLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libgcc_s.so.$libgccSoVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libgfortran.so.$libgfortranLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libgomp.so.$libgompLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libquadmath.so.$libquadmathLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libssp.so.$libsspLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libstdc++.so.$libstdcxxLibVersion \ + "$(getPackagePrefix syslibs)/$relativeLibDir"/libsupc++.so + +BUILD() +{ + rm -rf $objectsDir + + mkdir -p $objectsDir + cd $objectsDir + + local additionalConfigureFlags + if [ -n "$secondaryArchSuffix" ]; then + additionalConfigureFlags="\ + --with-hybrid-secondary=${effectiveTargetArchitecture}" + fi + local kernelCcFlags="-D_KERNEL_MODE" + if [ $effectiveTargetArchitecture == x86_64 ]; then + # disable multilib support, as x86_64 by default tries to build the + # 32-bit libraries, too, which fails as no 32-bit libroot is available + additionalConfigureFlags+=" --disable-multilib" + + # deactivate red zone for x86_64 + kernelCcFlags="$kernelCcFlags -mno-red-zone" + fi + + "$sourceDir/configure" \ + --build=$effectiveTargetMachineTriple \ + --prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \ + --docdir=$docDir --enable-threads=posix \ + --disable-nls --enable-shared --with-gnu-ld --with-gnu-as \ + --enable-version-specific-runtime-libs \ + --enable-languages=c,c++,fortran,objc --enable-lto \ + --enable-frame-pointer \ + --with-pkgversion=$(echo $portVersion | cut -d_ -f2-) \ + --enable-__cxa-atexit --with-system-zlib --enable-checking=release \ + --with-bug-url=http://dev.haiku-os.org/ \ + --with-default-libstdcxx-abi=gcc4-compatible \ + --enable-libssp \ + $additionalConfigureFlags + + make $jobArgs + + echo "#################### building special libraries ####################" + + echo "### libgcc-kernel ###" + + # build kernel versions of libgcc.a and libgcc_eh.a (no threads or TLS) + cd $objectsDir/$effectiveTargetMachineTriple/libgcc + mkdir -p saved + mv libgcc.a libgcc_eh.a libgcc_s* libgcov* saved/ + make clean + ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h + make $jobArgs CFLAGS="-ffreestanding -O2 $kernelCcFlags" CXXFLAGS="-ffreestanding -O2 $kernelCcFlags" + mv libgcc.a libgcc-kernel.a + mv libgcc_eh.a libgcc_eh-kernel.a + ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h + mv saved/* . + rmdir saved + + echo "### libsupc++-kernel ###" + + # build kernel version of libsupc++.a (without threads or TLS) + cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ + mkdir -p saved + mv .libs/libsupc++* saved/ + cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ + "../config.h" \ + "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ + saved/ + make clean + cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ + "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" + sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ + "../config.h" + sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ + "../include/$effectiveTargetMachineTriple/bits/c++config.h" + make $jobArgs CFLAGS="-ffreestanding -O2 $kernelCcFlags" CXXFLAGS="-ffreestanding -O2 $kernelCcFlags" + mv .libs/libsupc++.a .libs/libsupc++-kernel.a + mv saved/libsupc++* .libs/ + mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" + mv saved/config.h .. + mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" + rmdir saved + + local bootCcFlags + if [ $effectiveTargetArchitecture == arm ]; then + # EFI arm (32-bit) requires software fp + bootCcFlags+="-mfloat-abi=soft -nostartfiles -fshort-wchar"; + fi + + echo "### libgcc-boot ###" + + # build bootloader version of libgcc and libgcc_eh.a (no threads, TLS) + cd $objectsDir/$effectiveTargetMachineTriple/libgcc + mkdir -p saved + mv libgcc.a libgcc_eh.a libgcc_s* libgcov* libgcc-kernel.a libgcc_eh-kernel.a saved/ + make clean + ln -sfn "$sourceDir/libgcc/gthr-single.h" gthr-default.h + make $jobArgs CFLAGS="-ffreestanding -O2 $bootCcFlags" CXXFLAGS="-ffreestanding -O2 $bootCcFlags" + mv libgcc.a libgcc-boot.a + mv libgcc_eh.a libgcc_eh-boot.a + ln -sfn "$sourceDir/libgcc/gthr-posix.h" gthr-default.h + mv saved/* . + rmdir saved + + echo "### libsupc++-boot ###" + + # build bootloader version of libsupc++.a (without threads or TLS) + cd $objectsDir/$effectiveTargetMachineTriple/libstdc++-v3/libsupc++ + mkdir -p saved + mv .libs/libsupc++* saved/ + cp "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" \ + "../config.h" \ + "../include/$effectiveTargetMachineTriple/bits/c++config.h" \ + saved/ + make clean + cp "../include/$effectiveTargetMachineTriple/bits/gthr-single.h" \ + "../include/$effectiveTargetMachineTriple/bits/gthr-default.h" + sed -i -e 's,#define _GLIBCXX_HAS_GTHREADS 1,/* #undef _GLIBCXX_HAS_GTHREADS */,' \ + "../config.h" + sed -i -e 's,#define _GLIBCXX_HAVE_TLS 1,/* #undef _GLIBCXX_HAVE_TLS */,' \ + "../include/$effectiveTargetMachineTriple/bits/c++config.h" + make $jobArgs CFLAGS="-ffreestanding -O2 $bootCcFlags" CXXFLAGS="-ffreestanding -O2 $bootCcFlags" + mv .libs/libsupc++.a .libs/libsupc++-boot.a + mv saved/libsupc++* .libs/ + mv saved/gthr-default.h "../include/$effectiveTargetMachineTriple/bits/" + mv saved/config.h .. + mv saved/c++config.h "../include/$effectiveTargetMachineTriple/bits/" + rmdir saved +} + +INSTALL() +{ + cd $objectsDir + + make install + make install-html + + ### HTML documentation #################################### + + echo "Organizing HTML documentation..." + cd $docDir + for dir in libquadmath; do + mv ${dir}.html $dir + ln -s $dir/index.html ${dir}.html + done + + ### Libraries ############################################# + + echo "Moving libraries around" + + # Move/copy libraries such that copies of the runtime (shared) libs exist + # in $libDir and copies of static libraries exist in $developLibDir. These + # are put into separate packages gcc_syslibs and gcc_syslibs_devel, which + # are both used by Haiku's build system. + mkdir -p $libDir + mkdir -p $developLibDir + cd $installDir + + # libatomic + cp -d $gccLibDir/libatomic.so \ + $gccLibDir/libatomic.so.$libatomicSoVersion \ + $gccLibDir/libatomic.so.$libatomicLibVersion \ + $libDir/ + rm $gccLibDir/libatomic*.a + + # libgfortran + cp -d $gccLibDir/libgfortran.so \ + $gccLibDir/libgfortran.so.$libgfortranSoVersion \ + $gccLibDir/libgfortran.so.$libgfortranLibVersion \ + $libDir/ + cp $gccLibDir/libgfortran*.a $developLibDir/ + + # libgomp + cp -d $gccLibDir/libgomp.so \ + $gccLibDir/libgomp.so.$libgompSoVersion \ + $gccLibDir/libgomp.so.$libgompLibVersion \ + $libDir/ + rm $gccLibDir/libgomp*.a + + # libquadmath + cp -d $gccLibDir/libquadmath.so \ + $gccLibDir/libquadmath.so.$libquadmathSoVersion \ + $gccLibDir/libquadmath.so.$libquadmathLibVersion \ + $libDir/ + rm $gccLibDir/libquadmath*.a + + # libssp + cp -d $gccLibDir/libssp.so \ + $gccLibDir/libssp.so.$libsspSoVersion \ + $gccLibDir/libssp.so.$libsspLibVersion \ + $libDir/ + rm $gccLibDir/libssp.a + cp $gccLibDir/libssp_nonshared.a $developLibDir + + # libstdc++ + cp -d $gccLibDir/libstdc++.so \ + $gccLibDir/libstdc++.so.$libstdcxxSoVersion \ + $gccLibDir/libstdc++.so.$libstdcxxLibVersion \ + $libDir/ + rm $gccLibDir/libstdc++.a + cp $gccLibDir/libstdc++exp.a $developLibDir + + # libsupc++ + libstdcxxDir=$objectsDir/$effectiveTargetMachineTriple/libstdc++-v3 + cp $libstdcxxDir/libsupc++/.libs/libsupc++-kernel.a \ + $gccLibDir/ + cp $libstdcxxDir/libsupc++/.libs/libsupc++-boot.a \ + $gccLibDir/ + ln -s libstdc++.so $libDir/libsupc++.so + cp $gccLibDir/libsupc++*.a $developLibDir/ + + # libgcc + cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-kernel.a \ + $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-kernel.a \ + $gccLibDir/ + cp $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc-boot.a \ + $objectsDir/$effectiveTargetMachineTriple/libgcc/libgcc_eh-boot.a \ + $gccLibDir/ + cp -d $gccLibDir/libgcc_s.so \ + $gccLibDir/libgcc_s.so.$libgccSoVersion \ + $libDir/ + cp $gccLibDir/libgcc*.a $developLibDir/ + + # merge libssp_nonshared.a in libgcc.a on x86 + if [ "$targetArchitecture" = "x86_gcc2" ]; then + (mkdir temp_libgcc; cd temp_libgcc; ar x ../$gccLibDir/libssp_nonshared.a; + ar x ../$gccLibDir/libgcc.a; cd ..) + ar -qc $developLibDir/libgcc.a temp_libgcc/*.o + cp $developLibDir/libgcc.a $gccLibDir/libgcc.a + rm -rf temp_libgcc + fi + + # gcc and c++ headers + mkdir -p $includeDir/gcc + cp -r $gccLibDir/include $includeDir/gcc/ + cp -r $gccLibDir/include-fixed $includeDir/gcc/ + mv $includeDir/gcc/include/c++ $includeDir/ + + ### Strip ################################################# + + echo "Strip" + + strip --strip-debug \ + $gccLibDir/*.a \ + $developLibDir/*.a + + ### Disable ASLR ########################################## + + echo "Add SYS:ENV attribute to disable ASLR" + + cd $installDir + for f in bin/*; do + if [ -r "$f" ]; then + addattr SYS:ENV DISABLE_ASLR=1 $f + fi + done + for f in cc1 cc1obj cc1plus collect2 f951 g++-mapper-server lto1 lto-wrapper ; do + addattr SYS:ENV DISABLE_ASLR=1 \ + $gccLibDir/$f + done + + ### Symlinks ############################################## + + echo "Creating required symlinks" + + # create missing cc symlink + ln -sf gcc $installDir/bin/cc + + # make all tools available via default paths + mkdir -p $binDir + for f in c++ cc cpp g++ gcc gcc-ar gcc-nm gcc-ranlib gcov gcov-dump \ + gcov-tool gfortran lto-dump ; do + symlinkRelative -sfn $installDir/bin/$f $binDir + done + + # symlink all libraries from libDir -> developLibDir + mkdir -p $developLibDir + for l in libatomic libgomp libquadmath libssp libgcc_s libstdc++ \ + libsupc++; do + for f in $libDir/$l*; do + symlinkRelative -sfn $f $developLibDir/ + done + done + + ### Cleanup ############################################### + + echo "Cleanup" + rm -rf $installDir/info + rm -rf $installDir/share + rm -rf $gccLibDir/*.la + rm -rf $gccLibdir/libobjc.* + rm -rf $gccLibdir/include/objc + rm -rf $includeDir/gcc/include/objc + + ### Sub Packages ########################################## + + packageEntries "fortran" \ + $relativeBinDir/gfortran \ + $developDir/tools$secondaryArchSubDir/bin/*gfortran \ + $installDir/$gccLibDir/f951 \ + $installDir/$gccLibDir/finclude \ + $installDir/$gccLibDir/libcaf_single.a \ + $installDir/$gccLibDir/libgfortran.a \ + $installDir/$gccLibDir/libgfortran.spec + + rm -rf $installDir/$gccLibDir/{f951, finclude, libcaf_single*, libgfortran*} + + packageEntries "syslibs" \ + $relativeLibDir/libatomic.so \ + $relativeLibDir/libatomic.so.$libatomicSoVersion \ + $relativeLibDir/libatomic.so.$libatomicLibVersion \ + $relativeLibDir/libgcc_s.so \ + $relativeLibDir/libgcc_s.so.$libgccSoVersion \ + $relativeLibDir/libgfortran.so \ + $relativeLibDir/libgfortran.so.$libgfortranSoVersion \ + $relativeLibDir/libgfortran.so.$libgfortranLibVersion \ + $relativeLibDir/libgomp.so \ + $relativeLibDir/libgomp.so.$libgompSoVersion \ + $relativeLibDir/libgomp.so.$libgompLibVersion \ + $relativeLibDir/libquadmath.so \ + $relativeLibDir/libquadmath.so.$libquadmathSoVersion \ + $relativeLibDir/libquadmath.so.$libquadmathLibVersion \ + $relativeLibDir/libssp.so \ + $relativeLibDir/libssp.so.$libsspSoVersion \ + $relativeLibDir/libssp.so.$libsspLibVersion \ + $relativeLibDir/libstdc++.so \ + $relativeLibDir/libstdc++.so.$libstdcxxSoVersion \ + $relativeLibDir/libstdc++.so.$libstdcxxLibVersion \ + $relativeLibDir/libsupc++.so + + packageEntries "syslibs_devel" \ + $developLibDir/*.so* \ + $developLibDir/libgcc.a \ + $developLibDir/libgcc-boot.a \ + $developLibDir/libgcc-kernel.a \ + $developLibDir/libgcc_eh.a \ + $developLibDir/libgcc_eh-boot.a \ + $developLibDir/libgcc_eh-kernel.a \ + $developLibDir/libssp_nonshared.a \ + $developLibDir/libstdc++exp.a \ + $developLibDir/libsupc++.a \ + $developLibDir/libsupc++-boot.a \ + $developLibDir/libsupc++-kernel.a \ + $relativeIncludeDir + + rm -rf $includeDir + rm -rf $developLibDir +} diff --git a/sys-devel/gcc/patches/gcc-13.1.0_2023_06_20.patchset b/sys-devel/gcc/patches/gcc-13.1.0_2023_06_20.patchset new file mode 100644 index 000000000..dca50262f --- /dev/null +++ b/sys-devel/gcc/patches/gcc-13.1.0_2023_06_20.patchset @@ -0,0 +1,8276 @@ +From 046145fe2778c5b29a7dcf1fe49184b56ec561b5 Mon Sep 17 00:00:00 2001 +From: Niels Sascha Reedijk +Date: Tue, 20 Jun 2023 16:14:19 +0100 +Subject: [PATCH] Modifications for GCC 13.1.0 for Haiku (from buildtools + repository) + +--- + c++tools/config.h.in | 10 +- + c++tools/configure | 2662 ++++++++--------- + config.rpath | 2 + + config/ax_lib_socket_nsl.m4 | 2 +- + configure | 28 +- + configure.ac | 14 +- + gcc/Makefile.in | 14 +- + gcc/config.gcc | 71 +- + gcc/config.host | 12 +- + gcc/config/aarch64/aarch64-haiku.h | 71 + + gcc/config/aarch64/t-aarch64-haiku | 21 + + gcc/config/arm/haiku.h | 71 + + gcc/config/arm/t-haiku | 21 + + gcc/config/haiku-protos.h | 21 + + gcc/config/haiku-stdint.h | 55 + + gcc/config/haiku.c | 39 + + gcc/config/haiku.h | 230 ++ + gcc/config/haiku.opt | 32 + + gcc/config/i386/haiku.h | 82 + + gcc/config/i386/haiku64.h | 135 + + gcc/config/i386/t-haiku64 | 16 + + gcc/config/m68k/haiku.h | 266 ++ + gcc/config/mips/haiku.h | 42 + + gcc/config/riscv/haiku.h | 59 + + gcc/config/riscv/t-haiku | 4 + + gcc/config/rs6000/haiku.h | 54 + + gcc/config/sparc/haiku.h | 93 + + gcc/config/sparc/t-haiku | 5 + + gcc/config/t-haiku | 9 + + gcc/configure | 40 +- + gcc/configure.ac | 86 +- + gcc/ginclude/stdarg.h | 2 +- + gcc/ginclude/stddef.h | 10 +- + include/filenames.h | 4 + + libatomic/configure | 33 +- + libatomic/configure.ac | 24 +- + libatomic/configure.tgt | 2 +- + libcody/configure | 2 +- + libgcc/config.host | 35 +- + libgcc/config/aarch64/haiku-unwind.h | 51 + + libgcc/config/t-haiku | 3 + + libgcc/crtstuff.c | 2 + + libgomp/configure | 40 +- + libgomp/configure.ac | 16 +- + libstdc++-v3/config/os/haiku/ctype_base.h | 61 + + .../config/os/haiku/ctype_configure_char.cc | 99 + + libstdc++-v3/config/os/haiku/ctype_inline.h | 173 ++ + .../config/os/haiku/error_constants.h | 178 ++ + libstdc++-v3/config/os/haiku/os_defines.h | 48 + + libstdc++-v3/configure | 99 +- + libstdc++-v3/configure.host | 5 +- + libstdc++-v3/crossconfig.m4 | 44 +- + libstdc++-v3/libsupc++/tinfo.cc | 9 + + libtool.m4 | 11 +- + 54 files changed, 3754 insertions(+), 1464 deletions(-) + create mode 100644 gcc/config/aarch64/aarch64-haiku.h + create mode 100644 gcc/config/aarch64/t-aarch64-haiku + create mode 100644 gcc/config/arm/haiku.h + create mode 100644 gcc/config/arm/t-haiku + create mode 100644 gcc/config/haiku-protos.h + create mode 100644 gcc/config/haiku-stdint.h + create mode 100644 gcc/config/haiku.c + create mode 100644 gcc/config/haiku.h + create mode 100644 gcc/config/haiku.opt + create mode 100644 gcc/config/i386/haiku.h + create mode 100644 gcc/config/i386/haiku64.h + create mode 100644 gcc/config/i386/t-haiku64 + create mode 100644 gcc/config/m68k/haiku.h + create mode 100644 gcc/config/mips/haiku.h + create mode 100644 gcc/config/riscv/haiku.h + create mode 100644 gcc/config/riscv/t-haiku + create mode 100644 gcc/config/rs6000/haiku.h + create mode 100644 gcc/config/sparc/haiku.h + create mode 100644 gcc/config/sparc/t-haiku + create mode 100644 gcc/config/t-haiku + create mode 100644 libgcc/config/aarch64/haiku-unwind.h + create mode 100644 libgcc/config/t-haiku + create mode 100644 libstdc++-v3/config/os/haiku/ctype_base.h + create mode 100644 libstdc++-v3/config/os/haiku/ctype_configure_char.cc + create mode 100644 libstdc++-v3/config/os/haiku/ctype_inline.h + create mode 100644 libstdc++-v3/config/os/haiku/error_constants.h + create mode 100644 libstdc++-v3/config/os/haiku/os_defines.h + +diff --git a/c++tools/config.h.in b/c++tools/config.h.in +index 410b2f7da..8d75ca1b3 100644 +--- a/c++tools/config.h.in ++++ b/c++tools/config.h.in +@@ -21,9 +21,6 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_INTTYPES_H + +-/* Define to 1 if you have the header file. */ +-#undef HAVE_MEMORY_H +- + /* Define if pselect provided. */ + #undef HAVE_PSELECT + +@@ -33,6 +30,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_STDINT_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDIO_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_STDLIB_H + +@@ -75,5 +75,7 @@ + /* Define to the version of this package. */ + #undef PACKAGE_VERSION + +-/* Define to 1 if you have the ANSI C header files. */ ++/* Define to 1 if all of the C90 standard headers exist (not just the ones ++ required in a freestanding environment). This macro is provided for ++ backward compatibility; new code need not use it. */ + #undef STDC_HEADERS +diff --git a/c++tools/configure b/c++tools/configure +index 742816e42..68b41fac9 100755 +--- a/c++tools/configure ++++ b/c++tools/configure +@@ -1,9 +1,10 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.69. ++# Generated by GNU Autoconf 2.71. + # + # +-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. ++# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, ++# Inc. + # + # + # This configure script is free software; the Free Software Foundation +@@ -14,14 +15,16 @@ + + # Be more Bourne compatible + DUALCASE=1; export DUALCASE # for MKS sh +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++as_nop=: ++if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 ++then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +-else ++else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( +@@ -31,46 +34,46 @@ esac + fi + + ++ ++# Reset variables that may have inherited troublesome values from ++# the environment. ++ ++# IFS needs to be set, to space, tab, and newline, in precisely that order. ++# (If _AS_PATH_WALK were called with IFS unset, it would have the ++# side effect of setting IFS to empty, thus disabling word splitting.) ++# Quoting is to prevent editors from complaining about space-tab. + as_nl=' + ' + export as_nl +-# Printing a long string crashes Solaris 7 /usr/bin/printf. +-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +-# Prefer a ksh shell builtin over an external printf program on Solaris, +-# but without wasting forks for bash or zsh. +-if test -z "$BASH_VERSION$ZSH_VERSION" \ +- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='print -r --' +- as_echo_n='print -rn --' +-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='printf %s\n' +- as_echo_n='printf %s' +-else +- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then +- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' +- as_echo_n='/usr/ucb/echo -n' +- else +- as_echo_body='eval expr "X$1" : "X\\(.*\\)"' +- as_echo_n_body='eval +- arg=$1; +- case $arg in #( +- *"$as_nl"*) +- expr "X$arg" : "X\\(.*\\)$as_nl"; +- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; +- esac; +- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" +- ' +- export as_echo_n_body +- as_echo_n='sh -c $as_echo_n_body as_echo' +- fi +- export as_echo_body +- as_echo='sh -c $as_echo_body as_echo' +-fi ++IFS=" "" $as_nl" ++ ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# Ensure predictable behavior from utilities with locale-dependent output. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# We cannot yet rely on "unset" to work, but we need these variables ++# to be unset--not just set to an empty or harmless value--now, to ++# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct ++# also avoids known problems related to "unset" and subshell syntax ++# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). ++for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH ++do eval test \${$as_var+y} \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++ ++# Ensure that fds 0, 1, and 2 are open. ++if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi ++if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + # The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then ++if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || +@@ -79,13 +82,6 @@ if test "${PATH_SEPARATOR+set}" != set; then + fi + + +-# IFS +-# We need space, tab and new line, in precisely that order. Quoting is +-# there to prevent editors from complaining about space-tab. +-# (If _AS_PATH_WALK were called with IFS unset, it would disable word +-# splitting by setting IFS to empty value.) +-IFS=" "" $as_nl" +- + # Find who we are. Look in the path if we contain no directory separator. + as_myself= + case $0 in #(( +@@ -94,8 +90,12 @@ case $0 in #(( + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done + IFS=$as_save_IFS + +@@ -107,30 +107,10 @@ if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then +- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 + fi + +-# Unset variables that we do not need and which cause bugs (e.g. in +-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +-# suppresses any "Segmentation fault" message there. '((' could +-# trigger a bug in pdksh 5.2.14. +-for as_var in BASH_ENV ENV MAIL MAILPATH +-do eval test x\${$as_var+set} = xset \ +- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +-done +-PS1='$ ' +-PS2='> ' +-PS4='+ ' +- +-# NLS nuisances. +-LC_ALL=C +-export LC_ALL +-LANGUAGE=C +-export LANGUAGE +- +-# CDPATH. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + # Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. +@@ -152,20 +132,22 @@ esac + exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} + # Admittedly, this is quite paranoid, since all the known shells bail + # out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +-as_fn_exit 255 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 ++exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} + if test "x$CONFIG_SHELL" = x; then +- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : ++ as_bourne_compatible="as_nop=: ++if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 ++then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +-else ++else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( +@@ -185,42 +167,52 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } + as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } + as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } + as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : ++if ( set x; as_fn_ret_success y && test x = \"\$1\" ) ++then : + +-else ++else \$as_nop + exitcode=1; echo positional parameters were not saved. + fi + test x\$exitcode = x0 || exit 1 ++blah=\$(echo \$(echo blah)) ++test x\"\$blah\" = xblah || exit 1 + test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && +- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +-test \$(( 1 + 1 )) = 2 || exit 1" +- if (eval "$as_required") 2>/dev/null; then : ++ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" ++ if (eval "$as_required") 2>/dev/null ++then : + as_have_required=yes +-else ++else $as_nop + as_have_required=no + fi +- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : ++ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null ++then : + +-else ++else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_found=false + for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. +- as_shell=$as_dir/$as_base ++ as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && +- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null ++then : + CONFIG_SHELL=$as_shell as_have_required=yes +- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null ++then : + break 2 + fi + fi +@@ -228,14 +220,21 @@ fi + esac + as_found=false + done +-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : +- CONFIG_SHELL=$SHELL as_have_required=yes +-fi; } + IFS=$as_save_IFS ++if $as_found ++then : ++ ++else $as_nop ++ if { test -f "$SHELL" || test -f "$SHELL.exe"; } && ++ as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null ++then : ++ CONFIG_SHELL=$SHELL as_have_required=yes ++fi ++fi + + +- if test "x$CONFIG_SHELL" != x; then : ++ if test "x$CONFIG_SHELL" != x ++then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also +@@ -253,18 +252,19 @@ esac + exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} + # Admittedly, this is quite paranoid, since all the known shells bail + # out after a failed `exec'. +-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 ++printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 + exit 255 + fi + +- if test x$as_have_required = xno; then : +- $as_echo "$0: This script requires a shell more modern than all" +- $as_echo "$0: the shells that I found on your system." +- if test x${ZSH_VERSION+set} = xset ; then +- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" +- $as_echo "$0: be upgraded to zsh 4.3.4 or later." ++ if test x$as_have_required = xno ++then : ++ printf "%s\n" "$0: This script requires a shell more modern than all" ++ printf "%s\n" "$0: the shells that I found on your system." ++ if test ${ZSH_VERSION+y} ; then ++ printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" ++ printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else +- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, ++ printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system, + $0: including any error possibly output before this + $0: message. Then install a modern shell, or manually run + $0: the script under such a shell if you do have one." +@@ -291,6 +291,7 @@ as_fn_unset () + } + as_unset=as_fn_unset + ++ + # as_fn_set_status STATUS + # ----------------------- + # Set $? to STATUS, without forking. +@@ -308,6 +309,14 @@ as_fn_exit () + as_fn_set_status $1 + exit $1 + } # as_fn_exit ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + + # as_fn_mkdir_p + # ------------- +@@ -322,7 +331,7 @@ as_fn_mkdir_p () + as_dirs= + while :; do + case $as_dir in #( +- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" +@@ -331,7 +340,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$as_dir" | ++printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -370,12 +379,13 @@ as_fn_executable_p () + # advantage of any shell optimizations that allow amortized linear growth over + # repeated appends, instead of the typical quadratic growth present in naive + # implementations. +-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null ++then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +-else ++else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 +@@ -387,18 +397,27 @@ fi # as_fn_append + # Perform arithmetic evaluation on the ARGs, and store the result in the + # global $as_val. Take advantage of shells that can avoid forks. The arguments + # must be portable across $(()) and expr. +-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null ++then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +-else ++else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } + fi # as_fn_arith + ++# as_fn_nop ++# --------- ++# Do nothing but, unlike ":", preserve the value of $?. ++as_fn_nop () ++{ ++ return $? ++} ++as_nop=as_fn_nop + + # as_fn_error STATUS ERROR [LINENO LOG_FD] + # ---------------------------------------- +@@ -410,9 +429,9 @@ as_fn_error () + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi +- $as_echo "$as_me: error: $2" >&2 ++ printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status + } # as_fn_error + +@@ -439,7 +458,7 @@ as_me=`$as_basename -- "$0" || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X/"$0" | ++printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q +@@ -483,7 +502,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || +- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } ++ { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall +@@ -497,6 +516,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits + exit + } + ++ ++# Determine whether it's possible to make 'echo' print without a newline. ++# These variables are no longer used directly by Autoconf, but are AC_SUBSTed ++# for compatibility with existing Makefiles. + ECHO_C= ECHO_N= ECHO_T= + case `echo -n x` in #((((( + -n*) +@@ -510,6 +533,13 @@ case `echo -n x` in #((((( + ECHO_N='-n';; + esac + ++# For backward compatibility with old third-party macros, we provide ++# the shell variables $as_echo and $as_echo_n. New code should use ++# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. ++as_echo='printf %s\n' ++as_echo_n='printf %s' ++ ++ + rm -f conf$$ conf$$.exe conf$$.file + if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +@@ -575,58 +605,51 @@ MFLAGS= + MAKEFLAGS= + + # Identity of this package. +-PACKAGE_NAME= +-PACKAGE_TARNAME= +-PACKAGE_VERSION= +-PACKAGE_STRING= +-PACKAGE_BUGREPORT= +-PACKAGE_URL= ++PACKAGE_NAME='' ++PACKAGE_TARNAME='' ++PACKAGE_VERSION='' ++PACKAGE_STRING='' ++PACKAGE_BUGREPORT='' ++PACKAGE_URL='' + + ac_unique_file="c++tools" + ac_unique_file="server.cc" + # Factoring default headers for most tests. + ac_includes_default="\ +-#include +-#ifdef HAVE_SYS_TYPES_H +-# include +-#endif +-#ifdef HAVE_SYS_STAT_H +-# include ++#include ++#ifdef HAVE_STDIO_H ++# include + #endif +-#ifdef STDC_HEADERS ++#ifdef HAVE_STDLIB_H + # include +-# include +-#else +-# ifdef HAVE_STDLIB_H +-# include +-# endif + #endif + #ifdef HAVE_STRING_H +-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +-# include +-# endif + # include + #endif +-#ifdef HAVE_STRINGS_H +-# include +-#endif + #ifdef HAVE_INTTYPES_H + # include + #endif + #ifdef HAVE_STDINT_H + # include + #endif ++#ifdef HAVE_STRINGS_H ++# include ++#endif ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_STAT_H ++# include ++#endif + #ifdef HAVE_UNISTD_H + # include + #endif" + ++ac_header_cxx_list= + ac_subst_vars='LTLIBOBJS + LIBOBJS + NETLIBS + get_gcc_base_ver +-EGREP +-GREP +-CXXCPP + PIEFLAG + MAINTAINER + CXX_AUX_TOOLS +@@ -674,6 +697,7 @@ infodir + docdir + oldincludedir + includedir ++runstatedir + localstatedir + sharedstatedir + sysconfdir +@@ -710,8 +734,7 @@ CXXFLAGS + LDFLAGS + LIBS + CPPFLAGS +-CCC +-CXXCPP' ++CCC' + + + # Initialize some variables set by options. +@@ -750,6 +773,7 @@ datadir='${datarootdir}' + sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' ++runstatedir='${localstatedir}/run' + includedir='${prefix}/include' + oldincludedir='/usr/include' + docdir='${datarootdir}/doc/${PACKAGE}' +@@ -779,8 +803,6 @@ do + *) ac_optarg=yes ;; + esac + +- # Accept the important Cygnus configure options, so we can diagnose typos. +- + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; +@@ -821,9 +843,9 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "enable_$ac_useropt" +@@ -847,9 +869,9 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid feature name: $ac_useropt" ++ as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "enable_$ac_useropt" +@@ -1002,6 +1024,15 @@ do + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + ++ -runstatedir | --runstatedir | --runstatedi | --runstated \ ++ | --runstate | --runstat | --runsta | --runst | --runs \ ++ | --run | --ru | --r) ++ ac_prev=runstatedir ;; ++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ ++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ ++ | --run=* | --ru=* | --r=*) ++ runstatedir=$ac_optarg ;; ++ + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ +@@ -1051,9 +1082,9 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "with_$ac_useropt" +@@ -1067,9 +1098,9 @@ do + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && +- as_fn_error $? "invalid package name: $ac_useropt" ++ as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt +- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" + "with_$ac_useropt" +@@ -1113,9 +1144,9 @@ Try \`$0 --help' for more information" + + *) + # FIXME: should be removed in autoconf 3.0. +- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 ++ printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && +- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 ++ printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + +@@ -1131,7 +1162,7 @@ if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; +- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; ++ *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac + fi + +@@ -1139,7 +1170,7 @@ fi + for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ +- libdir localedir mandir ++ libdir localedir mandir runstatedir + do + eval ac_val=\$$ac_var + # Remove trailing slashes. +@@ -1195,7 +1226,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$as_myself" | ++printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -1292,6 +1323,7 @@ Fine tuning of the installation directories: + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] ++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] +@@ -1348,7 +1380,6 @@ Some influential environment variables: + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory +- CXXCPP C++ preprocessor + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. +@@ -1369,9 +1400,9 @@ if test "$ac_init_help" = "recursive"; then + case "$ac_dir" in + .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) +- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. +- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` ++ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; +@@ -1399,7 +1430,8 @@ esac + ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } +- # Check for guested configure. ++ # Check for configure.gnu first; this name is used for a wrapper for ++ # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive +@@ -1407,7 +1439,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else +- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +@@ -1417,9 +1449,9 @@ test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF + configure +-generated by GNU Autoconf 2.69 ++generated by GNU Autoconf 2.71 + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2021 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it. + _ACEOF +@@ -1436,14 +1468,14 @@ fi + ac_fn_cxx_try_compile () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- rm -f conftest.$ac_objext ++ rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -1451,14 +1483,15 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err +- } && test -s conftest.$ac_objext; then : ++ } && test -s conftest.$ac_objext ++then : + ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +@@ -1468,172 +1501,6 @@ fi + + } # ac_fn_cxx_try_compile + +-# ac_fn_cxx_try_cpp LINENO +-# ------------------------ +-# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +-ac_fn_cxx_try_cpp () +-{ +- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- if { { ac_try="$ac_cpp conftest.$ac_ext" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 +- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err +- ac_status=$? +- if test -s conftest.err; then +- grep -v '^ *+' conftest.err >conftest.er1 +- cat conftest.er1 >&5 +- mv -f conftest.er1 conftest.err +- fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } > conftest.i && { +- test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || +- test ! -s conftest.err +- }; then : +- ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_retval=1 +-fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +- as_fn_set_status $ac_retval +- +-} # ac_fn_cxx_try_cpp +- +-# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +-# --------------------------------------------------------- +-# Tests whether HEADER exists, giving a warning if it cannot be compiled using +-# the include files in INCLUDES and setting the cache variable VAR +-# accordingly. +-ac_fn_cxx_check_header_mongrel () +-{ +- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- if eval \${$3+:} false; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +-$as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : +- $as_echo_n "(cached) " >&6 +-fi +-eval ac_res=\$$3 +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-else +- # Is the header compilable? +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +-$as_echo_n "checking $2 usability... " >&6; } +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-$4 +-#include <$2> +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- ac_header_compiler=yes +-else +- ac_header_compiler=no +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +-$as_echo "$ac_header_compiler" >&6; } +- +-# Is the header present? +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +-$as_echo_n "checking $2 presence... " >&6; } +-cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include <$2> +-_ACEOF +-if ac_fn_cxx_try_cpp "$LINENO"; then : +- ac_header_preproc=yes +-else +- ac_header_preproc=no +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +-$as_echo "$ac_header_preproc" >&6; } +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( +- yes:no: ) +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +- ;; +- no:yes:* ) +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +- ;; +-esac +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +-$as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- eval "$3=\$ac_header_compiler" +-fi +-eval ac_res=\$$3 +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } +-fi +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +- +-} # ac_fn_cxx_check_header_mongrel +- +-# ac_fn_cxx_try_run LINENO +-# ------------------------ +-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +-# that executables *can* be run. +-ac_fn_cxx_try_run () +-{ +- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- if { { ac_try="$ac_link" +-case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 +- (eval "$ac_link") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' +- { { case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 +- (eval "$ac_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; }; then : +- ac_retval=0 +-else +- $as_echo "$as_me: program exited with status $ac_status" >&5 +- $as_echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_retval=$ac_status +-fi +- rm -rf conftest.dSYM conftest_ipa8_conftest.oo +- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno +- as_fn_set_status $ac_retval +- +-} # ac_fn_cxx_try_run +- + # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES + # --------------------------------------------------------- + # Tests whether HEADER exists and can be compiled using the include files in +@@ -1641,26 +1508,28 @@ fi + ac_fn_cxx_check_header_compile () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +-$as_echo_n "checking for $2... " >&6; } +-if eval \${$3+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++printf %s "checking for $2... " >&6; } ++if eval test \${$3+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + $4 + #include <$2> + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + eval "$3=yes" +-else ++else $as_nop + eval "$3=no" + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + eval ac_res=\$$3 +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +-$as_echo "$ac_res" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + + } # ac_fn_cxx_check_header_compile +@@ -1671,14 +1540,14 @@ $as_echo "$ac_res" >&6; } + ac_fn_cxx_try_link () + { + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- rm -f conftest.$ac_objext conftest$ac_exeext ++ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -1686,17 +1555,18 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext +- }; then : ++ } ++then : + ac_retval=0 +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +@@ -1710,14 +1580,34 @@ fi + as_fn_set_status $ac_retval + + } # ac_fn_cxx_try_link ++ac_configure_args_raw= ++for ac_arg ++do ++ case $ac_arg in ++ *\'*) ++ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ as_fn_append ac_configure_args_raw " '$ac_arg'" ++done ++ ++case $ac_configure_args_raw in ++ *$as_nl*) ++ ac_safe_unquote= ;; ++ *) ++ ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ++ ac_unsafe_a="$ac_unsafe_z#~" ++ ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ++ ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; ++esac ++ + cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + + It was created by $as_me, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.71. Invocation command line was + +- $ $0 $@ ++ $ $0$ac_configure_args_raw + + _ACEOF + exec 5>>config.log +@@ -1750,8 +1640,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- $as_echo "PATH: $as_dir" ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ printf "%s\n" "PATH: $as_dir" + done + IFS=$as_save_IFS + +@@ -1786,7 +1680,7 @@ do + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) +- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; +@@ -1821,11 +1715,13 @@ done + # WARNING: Use '\'' to represent an apostrophe within the trap. + # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. + trap 'exit_status=$? ++ # Sanitize IFS. ++ IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + +- $as_echo "## ---------------- ## ++ printf "%s\n" "## ---------------- ## + ## Cache variables. ## + ## ---------------- ##" + echo +@@ -1836,8 +1732,8 @@ trap 'exit_status=$? + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( +- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ++ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( +@@ -1861,7 +1757,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + ) + echo + +- $as_echo "## ----------------- ## ++ printf "%s\n" "## ----------------- ## + ## Output variables. ## + ## ----------------- ##" + echo +@@ -1869,14 +1765,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + do + eval ac_val=\$$ac_var + case $ac_val in +- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac +- $as_echo "$ac_var='\''$ac_val'\''" ++ printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then +- $as_echo "## ------------------- ## ++ printf "%s\n" "## ------------------- ## + ## File substitutions. ## + ## ------------------- ##" + echo +@@ -1884,15 +1780,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + do + eval ac_val=\$$ac_var + case $ac_val in +- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac +- $as_echo "$ac_var='\''$ac_val'\''" ++ printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then +- $as_echo "## ----------- ## ++ printf "%s\n" "## ----------- ## + ## confdefs.h. ## + ## ----------- ##" + echo +@@ -1900,8 +1796,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + echo + fi + test "$ac_signal" != 0 && +- $as_echo "$as_me: caught signal $ac_signal" +- $as_echo "$as_me: exit $exit_status" ++ printf "%s\n" "$as_me: caught signal $ac_signal" ++ printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && +@@ -1915,63 +1811,48 @@ ac_signal=0 + # confdefs.h avoids OS command line length limits that DEFS can exceed. + rm -f -r conftest* confdefs.h + +-$as_echo "/* confdefs.h */" > confdefs.h ++printf "%s\n" "/* confdefs.h */" > confdefs.h + + # Predefined preprocessor variables. + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_NAME "$PACKAGE_NAME" +-_ACEOF ++printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +-_ACEOF ++printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_VERSION "$PACKAGE_VERSION" +-_ACEOF ++printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_STRING "$PACKAGE_STRING" +-_ACEOF ++printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +-_ACEOF ++printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_URL "$PACKAGE_URL" +-_ACEOF ++printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + + # Let the site file select an alternate cache file if it wants to. + # Prefer an explicitly selected file to automatically selected ones. +-ac_site_file1=NONE +-ac_site_file2=NONE + if test -n "$CONFIG_SITE"; then +- # We do not want a PATH search for config.site. +- case $CONFIG_SITE in #(( +- -*) ac_site_file1=./$CONFIG_SITE;; +- */*) ac_site_file1=$CONFIG_SITE;; +- *) ac_site_file1=./$CONFIG_SITE;; +- esac ++ ac_site_files="$CONFIG_SITE" + elif test "x$prefix" != xNONE; then +- ac_site_file1=$prefix/share/config.site +- ac_site_file2=$prefix/etc/config.site ++ ac_site_files="$prefix/share/config.site $prefix/etc/config.site" + else +- ac_site_file1=$ac_default_prefix/share/config.site +- ac_site_file2=$ac_default_prefix/etc/config.site ++ ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +-for ac_site_file in "$ac_site_file1" "$ac_site_file2" ++ ++for ac_site_file in $ac_site_files + do +- test "x$ac_site_file" = xNONE && continue +- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +-$as_echo "$as_me: loading site script $ac_site_file" >&6;} ++ case $ac_site_file in #( ++ */*) : ++ ;; #( ++ *) : ++ ac_site_file=./$ac_site_file ;; ++esac ++ if test -f "$ac_site_file" && test -r "$ac_site_file"; then ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 ++printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ +- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "failed to load site script $ac_site_file + See \`config.log' for more details" "$LINENO" 5; } + fi +@@ -1981,19 +1862,342 @@ if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +-$as_echo "$as_me: loading cache $cache_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 ++printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +-$as_echo "$as_me: creating cache $cache_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 ++printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file + fi + ++# Test code for whether the C++ compiler supports C++98 (global declarations) ++ac_cxx_conftest_cxx98_globals=' ++// Does the compiler advertise C++98 conformance? ++#if !defined __cplusplus || __cplusplus < 199711L ++# error "Compiler does not advertise C++98 conformance" ++#endif ++ ++// These inclusions are to reject old compilers that ++// lack the unsuffixed header files. ++#include ++#include ++ ++// and are *not* freestanding headers in C++98. ++extern void assert (int); ++namespace std { ++ extern int strcmp (const char *, const char *); ++} ++ ++// Namespaces, exceptions, and templates were all added after "C++ 2.0". ++using std::exception; ++using std::strcmp; ++ ++namespace { ++ ++void test_exception_syntax() ++{ ++ try { ++ throw "test"; ++ } catch (const char *s) { ++ // Extra parentheses suppress a warning when building autoconf itself, ++ // due to lint rules shared with more typical C programs. ++ assert (!(strcmp) (s, "test")); ++ } ++} ++ ++template struct test_template ++{ ++ T const val; ++ explicit test_template(T t) : val(t) {} ++ template T add(U u) { return static_cast(u) + val; } ++}; ++ ++} // anonymous namespace ++' ++ ++# Test code for whether the C++ compiler supports C++98 (body of main) ++ac_cxx_conftest_cxx98_main=' ++ assert (argc); ++ assert (! argv[0]); ++{ ++ test_exception_syntax (); ++ test_template tt (2.0); ++ assert (tt.add (4) == 6.0); ++ assert (true && !false); ++} ++' ++ ++# Test code for whether the C++ compiler supports C++11 (global declarations) ++ac_cxx_conftest_cxx11_globals=' ++// Does the compiler advertise C++ 2011 conformance? ++#if !defined __cplusplus || __cplusplus < 201103L ++# error "Compiler does not advertise C++11 conformance" ++#endif ++ ++namespace cxx11test ++{ ++ constexpr int get_val() { return 20; } ++ ++ struct testinit ++ { ++ int i; ++ double d; ++ }; ++ ++ class delegate ++ { ++ public: ++ delegate(int n) : n(n) {} ++ delegate(): delegate(2354) {} ++ ++ virtual int getval() { return this->n; }; ++ protected: ++ int n; ++ }; ++ ++ class overridden : public delegate ++ { ++ public: ++ overridden(int n): delegate(n) {} ++ virtual int getval() override final { return this->n * 2; } ++ }; ++ ++ class nocopy ++ { ++ public: ++ nocopy(int i): i(i) {} ++ nocopy() = default; ++ nocopy(const nocopy&) = delete; ++ nocopy & operator=(const nocopy&) = delete; ++ private: ++ int i; ++ }; ++ ++ // for testing lambda expressions ++ template Ret eval(Fn f, Ret v) ++ { ++ return f(v); ++ } ++ ++ // for testing variadic templates and trailing return types ++ template auto sum(V first) -> V ++ { ++ return first; ++ } ++ template auto sum(V first, Args... rest) -> V ++ { ++ return first + sum(rest...); ++ } ++} ++' ++ ++# Test code for whether the C++ compiler supports C++11 (body of main) ++ac_cxx_conftest_cxx11_main=' ++{ ++ // Test auto and decltype ++ auto a1 = 6538; ++ auto a2 = 48573953.4; ++ auto a3 = "String literal"; ++ ++ int total = 0; ++ for (auto i = a3; *i; ++i) { total += *i; } ++ ++ decltype(a2) a4 = 34895.034; ++} ++{ ++ // Test constexpr ++ short sa[cxx11test::get_val()] = { 0 }; ++} ++{ ++ // Test initializer lists ++ cxx11test::testinit il = { 4323, 435234.23544 }; ++} ++{ ++ // Test range-based for ++ int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, ++ 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; ++ for (auto &x : array) { x += 23; } ++} ++{ ++ // Test lambda expressions ++ using cxx11test::eval; ++ assert (eval ([](int x) { return x*2; }, 21) == 42); ++ double d = 2.0; ++ assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); ++ assert (d == 5.0); ++ assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); ++ assert (d == 5.0); ++} ++{ ++ // Test use of variadic templates ++ using cxx11test::sum; ++ auto a = sum(1); ++ auto b = sum(1, 2); ++ auto c = sum(1.0, 2.0, 3.0); ++} ++{ ++ // Test constructor delegation ++ cxx11test::delegate d1; ++ cxx11test::delegate d2(); ++ cxx11test::delegate d3(45); ++} ++{ ++ // Test override and final ++ cxx11test::overridden o1(55464); ++} ++{ ++ // Test nullptr ++ char *c = nullptr; ++} ++{ ++ // Test template brackets ++ test_template<::test_template> v(test_template(12)); ++} ++{ ++ // Unicode literals ++ char const *utf8 = u8"UTF-8 string \u2500"; ++ char16_t const *utf16 = u"UTF-8 string \u2500"; ++ char32_t const *utf32 = U"UTF-32 string \u2500"; ++} ++' ++ ++# Test code for whether the C compiler supports C++11 (complete). ++ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ++${ac_cxx_conftest_cxx11_globals} ++ ++int ++main (int argc, char **argv) ++{ ++ int ok = 0; ++ ${ac_cxx_conftest_cxx98_main} ++ ${ac_cxx_conftest_cxx11_main} ++ return ok; ++} ++" ++ ++# Test code for whether the C compiler supports C++98 (complete). ++ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} ++int ++main (int argc, char **argv) ++{ ++ int ok = 0; ++ ${ac_cxx_conftest_cxx98_main} ++ return ok; ++} ++" ++ ++as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H" ++as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H" ++as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H" ++as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H" ++as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H" ++as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H" ++as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" ++as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" ++as_fn_append ac_header_cxx_list " unistd.h unistd_h HAVE_UNISTD_H" ++ ++# Auxiliary files required by this configure script. ++ac_aux_files="install-sh config.guess config.sub" ++ ++# Locations in which to look for auxiliary files. ++ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." ++ ++# Search for a directory containing all of the required auxiliary files, ++# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. ++# If we don't find one directory that contains all the files we need, ++# we report the set of missing files from the *first* directory in ++# $ac_aux_dir_candidates and give up. ++ac_missing_aux_files="" ++ac_first_candidate=: ++printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++as_found=false ++for as_dir in $ac_aux_dir_candidates ++do ++ IFS=$as_save_IFS ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ as_found=: ++ ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ++ ac_aux_dir_found=yes ++ ac_install_sh= ++ for ac_aux in $ac_aux_files ++ do ++ # As a special case, if "install-sh" is required, that requirement ++ # can be satisfied by any of "install-sh", "install.sh", or "shtool", ++ # and $ac_install_sh is set appropriately for whichever one is found. ++ if test x"$ac_aux" = x"install-sh" ++ then ++ if test -f "${as_dir}install-sh"; then ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ++ ac_install_sh="${as_dir}install-sh -c" ++ elif test -f "${as_dir}install.sh"; then ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ++ ac_install_sh="${as_dir}install.sh -c" ++ elif test -f "${as_dir}shtool"; then ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ++ ac_install_sh="${as_dir}shtool install -c" ++ else ++ ac_aux_dir_found=no ++ if $ac_first_candidate; then ++ ac_missing_aux_files="${ac_missing_aux_files} install-sh" ++ else ++ break ++ fi ++ fi ++ else ++ if test -f "${as_dir}${ac_aux}"; then ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 ++ else ++ ac_aux_dir_found=no ++ if $ac_first_candidate; then ++ ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" ++ else ++ break ++ fi ++ fi ++ fi ++ done ++ if test "$ac_aux_dir_found" = yes; then ++ ac_aux_dir="$as_dir" ++ break ++ fi ++ ac_first_candidate=false ++ ++ as_found=false ++done ++IFS=$as_save_IFS ++if $as_found ++then : ++ ++else $as_nop ++ as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ++fi ++ ++ ++# These three variables are undocumented and unsupported, ++# and are intended to be withdrawn in a future Autoconf release. ++# They can cause serious problems if a builder's source tree is in a directory ++# whose full name contains unusual characters. ++if test -f "${ac_aux_dir}config.guess"; then ++ ac_config_guess="$SHELL ${ac_aux_dir}config.guess" ++fi ++if test -f "${ac_aux_dir}config.sub"; then ++ ac_config_sub="$SHELL ${ac_aux_dir}config.sub" ++fi ++if test -f "$ac_aux_dir/configure"; then ++ ac_configure="$SHELL ${ac_aux_dir}configure" ++fi ++ + # Check that the precious variables saved in the cache have kept the same + # value. + ac_cache_corrupted=false +@@ -2004,12 +2208,12 @@ for ac_var in $ac_precious_vars; do + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) +- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 ++printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) +- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 ++printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) +@@ -2018,24 +2222,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 ++printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 ++printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi +- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 ++printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 ++printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in +- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; ++ *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in +@@ -2045,11 +2249,12 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi + done + if $ac_cache_corrupted; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} +- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 ++printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} ++ as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' ++ and start over" "$LINENO" 5 + fi + ## -------------------- ## + ## Main body of script. ## +@@ -2066,55 +2271,30 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + # Determine the noncanonical names used for directories. +-ac_aux_dir= +-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +- if test -f "$ac_dir/install-sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install-sh -c" +- break +- elif test -f "$ac_dir/install.sh"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/install.sh -c" +- break +- elif test -f "$ac_dir/shtool"; then +- ac_aux_dir=$ac_dir +- ac_install_sh="$ac_aux_dir/shtool install -c" +- break +- fi +-done +-if test -z "$ac_aux_dir"; then +- as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +-fi + +-# These three variables are undocumented and unsupported, +-# and are intended to be withdrawn in a future Autoconf release. +-# They can cause serious problems if a builder's source tree is in a directory +-# whose full name contains unusual characters. +-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +-# Make sure we can run config.sub. +-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || +- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 ++ # Make sure we can run config.sub. ++$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || ++ as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +-$as_echo_n "checking build system type... " >&6; } +-if ${ac_cv_build+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 ++printf %s "checking build system type... " >&6; } ++if test ${ac_cv_build+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_build_alias=$build_alias + test "x$ac_build_alias" = x && +- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` ++ ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` + test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || +- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 ++ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || ++ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +-$as_echo "$ac_cv_build" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 ++printf "%s\n" "$ac_cv_build" >&6; } + case $ac_cv_build in + *-*-*) ;; + *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +@@ -2151,21 +2331,22 @@ esac + + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +-$as_echo_n "checking host system type... " >&6; } +-if ${ac_cv_host+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 ++printf %s "checking host system type... " >&6; } ++if test ${ac_cv_host+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build + else +- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || +- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 ++ ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || ++ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 + fi + + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +-$as_echo "$ac_cv_host" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 ++printf "%s\n" "$ac_cv_host" >&6; } + case $ac_cv_host in + *-*-*) ;; + *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +@@ -2184,21 +2365,22 @@ IFS=$ac_save_IFS + case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +-$as_echo_n "checking target system type... " >&6; } +-if ${ac_cv_target+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 ++printf %s "checking target system type... " >&6; } ++if test ${ac_cv_target+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host + else +- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || +- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 ++ ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || ++ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 + fi + + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +-$as_echo "$ac_cv_target" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 ++printf "%s\n" "$ac_cv_target" >&6; } + case $ac_cv_target in + *-*-*) ;; + *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +@@ -2224,7 +2406,8 @@ test -n "$target_alias" && + NONENONEs,x,x, && + program_prefix=${target_alias}- + +-# Find a good install program. We prefer a C program (faster), ++ ++ # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or + # incompatible versions: + # SysV /etc/install, /usr/sbin/install +@@ -2238,20 +2421,25 @@ test -n "$target_alias" && + # OS/2's system install, which has a completely different semantic + # ./install, which can be erroneously created by make from ./install.sh. + # Reject install programs that cannot install multiple files. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +-$as_echo_n "checking for a BSD-compatible install... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 ++printf %s "checking for a BSD-compatible install... " >&6; } + if test -z "$INSTALL"; then +-if ${ac_cv_path_install+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++if test ${ac_cv_path_install+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- # Account for people who put trailing slashes in PATH elements. +-case $as_dir/ in #(( +- ./ | .// | /[cC]/* | \ ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ # Account for fact that we put trailing slashes in our PATH walk. ++case $as_dir in #(( ++ ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; +@@ -2261,13 +2449,13 @@ case $as_dir/ in #(( + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then ++ if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && +- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && +- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else +@@ -2275,12 +2463,12 @@ case $as_dir/ in #(( + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir +- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && ++ if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then +- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi +@@ -2296,7 +2484,7 @@ IFS=$as_save_IFS + rm -rf conftest.one conftest.two conftest.dir + + fi +- if test "${ac_cv_path_install+set}" = set; then ++ if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a +@@ -2306,8 +2494,8 @@ fi + INSTALL=$ac_install_sh + fi + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +-$as_echo "$INSTALL" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 ++printf "%s\n" "$INSTALL" >&6; } + + # Use test -z because SunOS4 sh mishandles braces in ${var-val}. + # It thinks the first close brace ends the variable substitution. +@@ -2320,6 +2508,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + + ++ ++ ++ ++ ++ ++ + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -2330,15 +2524,16 @@ if test -z "$CXX"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then +- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC ++ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. + set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_CXX+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_CXX+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. + else +@@ -2346,11 +2541,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2361,11 +2560,11 @@ fi + fi + CXX=$ac_cv_prog_CXX + if test -n "$CXX"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +-$as_echo "$CXX" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 ++printf "%s\n" "$CXX" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2374,15 +2573,16 @@ fi + fi + if test -z "$CXX"; then + ac_ct_CXX=$CXX +- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC ++ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_ac_ct_CXX+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_ac_ct_CXX+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + else +@@ -2390,11 +2590,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2405,11 +2609,11 @@ fi + fi + ac_ct_CXX=$ac_cv_prog_ac_ct_CXX + if test -n "$ac_ct_CXX"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +-$as_echo "$ac_ct_CXX" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 ++printf "%s\n" "$ac_ct_CXX" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2421,8 +2625,8 @@ done + else + case $cross_compiling:$ac_tool_warned in + yes:) +-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} + ac_tool_warned=yes ;; + esac + CXX=$ac_ct_CXX +@@ -2432,7 +2636,7 @@ fi + fi + fi + # Provide some information about the compiler. +-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 ++printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 + set X $ac_compile + ac_compiler=$2 + for ac_option in --version -v -V -qversion; do +@@ -2442,7 +2646,7 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then +@@ -2452,7 +2656,7 @@ $as_echo "$ac_try_echo"; } >&5 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + done + +@@ -2460,7 +2664,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; +@@ -2472,9 +2676,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" + # Try to create an executable without -o first, disregard a.out. + # It will help us diagnose broken compilers, and finding out an intuition + # of exeext. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 +-$as_echo_n "checking whether the C++ compiler works... " >&6; } +-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 ++printf %s "checking whether the C++ compiler works... " >&6; } ++ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + + # The possible output files: + ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +@@ -2495,11 +2699,12 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then : ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. + # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # in a Makefile. We should not override ac_cv_exeext if it was cached, +@@ -2516,7 +2721,7 @@ do + # certainly right. + break;; + *.* ) +- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; ++ if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi +@@ -2532,44 +2737,46 @@ do + done + test "$ac_cv_exeext" = no && ac_cv_exeext= + +-else ++else $as_nop + ac_file='' + fi +-if test -z "$ac_file"; then : +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +-$as_echo "$as_me: failed program was:" >&5 ++if test -z "$ac_file" ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } ++printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error 77 "C++ compiler cannot create executables + See \`config.log' for more details" "$LINENO" 5; } +-else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 +-$as_echo_n "checking for C++ compiler default output file name... " >&6; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +-$as_echo "$ac_file" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++printf "%s\n" "yes" >&6; } ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 ++printf %s "checking for C++ compiler default output file name... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 ++printf "%s\n" "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext + + rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out + ac_clean_files=$ac_clean_files_save +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +-$as_echo_n "checking for suffix of executables... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 ++printf %s "checking for suffix of executables... " >&6; } + if { { ac_try="$ac_link" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then : ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) + # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will + # work properly (i.e., refer to `conftest.exe'), while it won't with +@@ -2583,15 +2790,15 @@ for ac_file in conftest.exe conftest conftest.*; do + * ) break;; + esac + done +-else +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++else $as_nop ++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot compute suffix of executables: cannot compile and link + See \`config.log' for more details" "$LINENO" 5; } + fi + rm -f conftest conftest$ac_cv_exeext +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +-$as_echo "$ac_cv_exeext" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 ++printf "%s\n" "$ac_cv_exeext" >&6; } + + rm -f conftest.$ac_ext + EXEEXT=$ac_cv_exeext +@@ -2600,7 +2807,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include + int +-main () ++main (void) + { + FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; +@@ -2612,8 +2819,8 @@ _ACEOF + ac_clean_files="$ac_clean_files conftest.out" + # Check that the compiler produces executables we can run. If not, either + # the compiler is broken, or we cross compile. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +-$as_echo_n "checking whether we are cross compiling... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 ++printf %s "checking whether we are cross compiling... " >&6; } + if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" + case "(($ac_try" in +@@ -2621,10 +2828,10 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in +@@ -2632,39 +2839,40 @@ $as_echo "$ac_try_echo"; } >&5 + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run C++ compiled programs. ++ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error 77 "cannot run C++ compiled programs. + If you meant to cross compile, use \`--host'. + See \`config.log' for more details" "$LINENO" 5; } + fi + fi + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +-$as_echo "$cross_compiling" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 ++printf "%s\n" "$cross_compiling" >&6; } + + rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out + ac_clean_files=$ac_clean_files_save +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +-$as_echo_n "checking for suffix of object files... " >&6; } +-if ${ac_cv_objext+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 ++printf %s "checking for suffix of object files... " >&6; } ++if test ${ac_cv_objext+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; +@@ -2678,11 +2886,12 @@ case "(($ac_try" in + *) ac_try_echo=$ac_try;; + esac + eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 ++printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then : ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in +@@ -2691,31 +2900,32 @@ $as_echo "$ac_try_echo"; } >&5 + break;; + esac + done +-else +- $as_echo "$as_me: failed program was:" >&5 ++else $as_nop ++ printf "%s\n" "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + +-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot compute suffix of object files: cannot compile + See \`config.log' for more details" "$LINENO" 5; } + fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +-$as_echo "$ac_cv_objext" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 ++printf "%s\n" "$ac_cv_objext" >&6; } + OBJEXT=$ac_cv_objext + ac_objext=$OBJEXT +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +-if ${ac_cv_cxx_compiler_gnu+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 ++printf %s "checking whether the compiler supports GNU C++... " >&6; } ++if test ${ac_cv_cxx_compiler_gnu+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + #ifndef __GNUC__ + choke me +@@ -2725,29 +2935,33 @@ main () + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_compiler_gnu=yes +-else ++else $as_nop + ac_compiler_gnu=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 ++printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ + if test $ac_compiler_gnu = yes; then + GXX=yes + else + GXX= + fi +-ac_test_CXXFLAGS=${CXXFLAGS+set} ++ac_test_CXXFLAGS=${CXXFLAGS+y} + ac_save_CXXFLAGS=$CXXFLAGS +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +-$as_echo_n "checking whether $CXX accepts -g... " >&6; } +-if ${ac_cv_prog_cxx_g+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 ++printf %s "checking whether $CXX accepts -g... " >&6; } ++if test ${ac_cv_prog_cxx_g+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no +@@ -2756,71 +2970,168 @@ else + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_prog_cxx_g=yes +-else ++else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + +-else ++else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +-main () ++main (void) + { + + ; + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_prog_cxx_g=yes + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ++ ac_cxx_werror_flag=$ac_save_cxx_werror_flag ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 ++printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } ++if test $ac_test_CXXFLAGS; then ++ CXXFLAGS=$ac_save_CXXFLAGS ++elif test $ac_cv_prog_cxx_g = yes; then ++ if test "$GXX" = yes; then ++ CXXFLAGS="-g -O2" ++ else ++ CXXFLAGS="-g" ++ fi ++else ++ if test "$GXX" = yes; then ++ CXXFLAGS="-O2" ++ else ++ CXXFLAGS= ++ fi ++fi ++ac_prog_cxx_stdcxx=no ++if test x$ac_prog_cxx_stdcxx = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 ++printf %s "checking for $CXX option to enable C++11 features... " >&6; } ++if test ${ac_cv_prog_cxx_11+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ac_cv_prog_cxx_11=no ++ac_save_CXX=$CXX ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_cxx_conftest_cxx11_program ++_ACEOF ++for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA ++do ++ CXX="$ac_save_CXX $ac_arg" ++ if ac_fn_cxx_try_compile "$LINENO" ++then : ++ ac_cv_prog_cxx_cxx11=$ac_arg ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam ++ test "x$ac_cv_prog_cxx_cxx11" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CXX=$ac_save_CXX ++fi ++ ++if test "x$ac_cv_prog_cxx_cxx11" = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++printf "%s\n" "unsupported" >&6; } ++else $as_nop ++ if test "x$ac_cv_prog_cxx_cxx11" = x ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++printf "%s\n" "none needed" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 ++printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } ++ CXX="$CXX $ac_cv_prog_cxx_cxx11" ++fi ++ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ++ ac_prog_cxx_stdcxx=cxx11 ++fi ++fi ++if test x$ac_prog_cxx_stdcxx = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 ++printf %s "checking for $CXX option to enable C++98 features... " >&6; } ++if test ${ac_cv_prog_cxx_98+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ac_cv_prog_cxx_98=no ++ac_save_CXX=$CXX ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_cxx_conftest_cxx98_program ++_ACEOF ++for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA ++do ++ CXX="$ac_save_CXX $ac_arg" ++ if ac_fn_cxx_try_compile "$LINENO" ++then : ++ ac_cv_prog_cxx_cxx98=$ac_arg ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam ++ test "x$ac_cv_prog_cxx_cxx98" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CXX=$ac_save_CXX + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++if test "x$ac_cv_prog_cxx_cxx98" = xno ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++printf "%s\n" "unsupported" >&6; } ++else $as_nop ++ if test "x$ac_cv_prog_cxx_cxx98" = x ++then : ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++printf "%s\n" "none needed" >&6; } ++else $as_nop ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 ++printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } ++ CXX="$CXX $ac_cv_prog_cxx_cxx98" + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- ac_cxx_werror_flag=$ac_save_cxx_werror_flag ++ ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ++ ac_prog_cxx_stdcxx=cxx98 + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +-$as_echo "$ac_cv_prog_cxx_g" >&6; } +-if test "$ac_test_CXXFLAGS" = set; then +- CXXFLAGS=$ac_save_CXXFLAGS +-elif test $ac_cv_prog_cxx_g = yes; then +- if test "$GXX" = yes; then +- CXXFLAGS="-g -O2" +- else +- CXXFLAGS="-g" +- fi +-else +- if test "$GXX" = yes; then +- CXXFLAGS="-O2" +- else +- CXXFLAGS= +- fi + fi ++ + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -2832,11 +3143,12 @@ for ac_prog in autoconf + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_AUTOCONF+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_AUTOCONF+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$AUTOCONF"; then + ac_cv_prog_AUTOCONF="$AUTOCONF" # Let the user override the test. + else +@@ -2844,11 +3156,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AUTOCONF="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2859,11 +3175,11 @@ fi + fi + AUTOCONF=$ac_cv_prog_AUTOCONF + if test -n "$AUTOCONF"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOCONF" >&5 +-$as_echo "$AUTOCONF" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AUTOCONF" >&5 ++printf "%s\n" "$AUTOCONF" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2875,11 +3191,12 @@ for ac_prog in autoheader + do + # Extract the first word of "$ac_prog", so it can be a program name with args. + set dummy $ac_prog; ac_word=$2 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +-$as_echo_n "checking for $ac_word... " >&6; } +-if ${ac_cv_prog_AUTOHEADER+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++printf %s "checking for $ac_word... " >&6; } ++if test ${ac_cv_prog_AUTOHEADER+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + if test -n "$AUTOHEADER"; then + ac_cv_prog_AUTOHEADER="$AUTOHEADER" # Let the user override the test. + else +@@ -2887,11 +3204,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac + for ac_exec_ext in '' $ac_executable_extensions; do +- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AUTOHEADER="$ac_prog" +- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi + done +@@ -2902,11 +3223,11 @@ fi + fi + AUTOHEADER=$ac_cv_prog_AUTOHEADER + if test -n "$AUTOHEADER"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AUTOHEADER" >&5 +-$as_echo "$AUTOHEADER" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AUTOHEADER" >&5 ++printf "%s\n" "$AUTOHEADER" >&6; } + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++printf "%s\n" "no" >&6; } + fi + + +@@ -2922,25 +3243,27 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build C++ tools" >&5 +-$as_echo_n "checking whether to build C++ tools... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build C++ tools" >&5 ++printf %s "checking whether to build C++ tools... " >&6; } + # Check whether --enable-c++-tools was given. +-if test "${enable_c___tools+set}" = set; then : ++if test ${enable_c___tools+y} ++then : + enableval=$enable_c___tools; cxx_aux_tools=$enableval +-else ++else $as_nop + cxx_aux_tools=yes + fi + + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cxx_aux_tools" >&5 +-$as_echo "$cxx_aux_tools" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cxx_aux_tools" >&5 ++printf "%s\n" "$cxx_aux_tools" >&6; } + CXX_AUX_TOOLS="$cxx_aux_tools" + + + # Check whether --enable-maintainer-mode was given. +-if test "${enable_maintainer_mode+set}" = set; then : ++if test ${enable_maintainer_mode+y} ++then : + enableval=$enable_maintainer_mode; +-else ++else $as_nop + enable_maintainer_mode=no + fi + +@@ -2949,10 +3272,10 @@ case "$enable_maintainer_mode" in + no) maintainer_mode=no ;; + *) as_fn_error $? "unknown maintainer mode $enable_maintainer_mode" "$LINENO" 5 ;; + esac +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking maintainer-mode" >&5 +-$as_echo_n "checking maintainer-mode... " >&6; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $maintainer_mode" >&5 +-$as_echo "$maintainer_mode" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking maintainer-mode" >&5 ++printf %s "checking maintainer-mode... " >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $maintainer_mode" >&5 ++printf "%s\n" "$maintainer_mode" >&6; } + test "$maintainer_mode" = yes && MAINTAINER=yes + + +@@ -2960,9 +3283,10 @@ test "$maintainer_mode" = yes && MAINTAINER=yes + # default to release checking and stricter checks do not change this. + + # Check whether --enable-checking was given. +-if test "${enable_checking+set}" = set; then : ++if test ${enable_checking+y} ++then : + enableval=$enable_checking; ac_checking_flags="${enableval}" +-else ++else $as_nop + + # Default to checking. + ac_checking_flags=yes +@@ -2983,15 +3307,16 @@ IFS="$ac_save_IFS" + + if test x$ac_assert_checking != x ; then + +-$as_echo "#define ENABLE_ASSERT_CHECKING 1" >>confdefs.h ++printf "%s\n" "#define ENABLE_ASSERT_CHECKING 1" >>confdefs.h + + fi + + # Check whether --enable-default-pie was given. + # Check whether --enable-default-pie was given. +-if test "${enable_default_pie+set}" = set; then : ++if test ${enable_default_pie+y} ++then : + enableval=$enable_default_pie; PIEFLAG=-fPIE +-else ++else $as_nop + PIEFLAG= + fi + +@@ -2999,18 +3324,19 @@ fi + + # Check if O_CLOEXEC is defined by fcntl + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 +-$as_echo_n "checking for O_CLOEXEC... " >&6; } +-if ${ac_cv_o_cloexec+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 ++printf %s "checking for O_CLOEXEC... " >&6; } ++if test ${ac_cv_o_cloexec+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include + int +-main () ++main (void) + { + + return open ("/dev/null", O_RDONLY | O_CLOEXEC); +@@ -3018,426 +3344,58 @@ return open ("/dev/null", O_RDONLY | O_CLOEXEC); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_o_cloexec=yes +-else ++else $as_nop + ac_cv_o_cloexec=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_o_cloexec" >&5 +-$as_echo "$ac_cv_o_cloexec" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_o_cloexec" >&5 ++printf "%s\n" "$ac_cv_o_cloexec" >&6; } + if test $ac_cv_o_cloexec = yes; then + +-$as_echo "#define HOST_HAS_O_CLOEXEC 1" >>confdefs.h +- +-fi +- +-ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' +-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +-$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +-if test -z "$CXXCPP"; then +- if ${ac_cv_prog_CXXCPP+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- # Double quotes because CXXCPP needs to be expanded +- for CXXCPP in "$CXX -E" "/lib/cpp" +- do +- ac_preproc_ok=false +-for ac_cxx_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer to if __STDC__ is defined, since +- # exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include +-#else +-# include +-#endif +- Syntax error +-_ACEOF +-if ac_fn_cxx_try_cpp "$LINENO"; then : +- +-else +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether nonexistent headers +- # can be detected and how. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-_ACEOF +-if ac_fn_cxx_try_cpp "$LINENO"; then : +- # Broken: success on invalid input. +-continue +-else +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : +- break +-fi +- +- done +- ac_cv_prog_CXXCPP=$CXXCPP +- +-fi +- CXXCPP=$ac_cv_prog_CXXCPP +-else +- ac_cv_prog_CXXCPP=$CXXCPP +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +-$as_echo "$CXXCPP" >&6; } +-ac_preproc_ok=false +-for ac_cxx_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer to if __STDC__ is defined, since +- # exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include +-#else +-# include +-#endif +- Syntax error +-_ACEOF +-if ac_fn_cxx_try_cpp "$LINENO"; then : +- +-else +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether nonexistent headers +- # can be detected and how. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-_ACEOF +-if ac_fn_cxx_try_cpp "$LINENO"; then : +- # Broken: success on invalid input. +-continue +-else +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.i conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.i conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then : +- +-else +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +-See \`config.log' for more details" "$LINENO" 5; } +-fi +- +-ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' +-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +- +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +-$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +-if ${ac_cv_path_GREP+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- if test -z "$GREP"; then +- ac_path_GREP_found=false +- # Loop through the user's path and test for each of PROGNAME-LIST +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_prog in grep ggrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" +- as_fn_executable_p "$ac_path_GREP" || continue +-# Check for GNU ac_path_GREP and select it if it is found. +- # Check for GNU $ac_path_GREP +-case `"$ac_path_GREP" --version 2>&1` in +-*GNU*) +- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +-*) +- ac_count=0 +- $as_echo_n 0123456789 >"conftest.in" +- while : +- do +- cat "conftest.in" "conftest.in" >"conftest.tmp" +- mv "conftest.tmp" "conftest.in" +- cp "conftest.in" "conftest.nl" +- $as_echo 'GREP' >> "conftest.nl" +- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break +- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- as_fn_arith $ac_count + 1 && ac_count=$as_val +- if test $ac_count -gt ${ac_path_GREP_max-0}; then +- # Best one so far, save it but keep looking for a better one +- ac_cv_path_GREP="$ac_path_GREP" +- ac_path_GREP_max=$ac_count +- fi +- # 10*(2^10) chars as input seems more than enough +- test $ac_count -gt 10 && break +- done +- rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +-esac +- +- $ac_path_GREP_found && break 3 +- done +- done +- done +-IFS=$as_save_IFS +- if test -z "$ac_cv_path_GREP"; then +- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 +- fi +-else +- ac_cv_path_GREP=$GREP +-fi ++printf "%s\n" "#define HOST_HAS_O_CLOEXEC 1" >>confdefs.h + + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +-$as_echo "$ac_cv_path_GREP" >&6; } +- GREP="$ac_cv_path_GREP" + +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +-$as_echo_n "checking for egrep... " >&6; } +-if ${ac_cv_path_EGREP+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +- then ac_cv_path_EGREP="$GREP -E" +- else +- if test -z "$EGREP"; then +- ac_path_EGREP_found=false +- # Loop through the user's path and test for each of PROGNAME-LIST +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++ac_header= ac_cache= ++for ac_item in $ac_header_cxx_list + do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_prog in egrep; do +- for ac_exec_ext in '' $ac_executable_extensions; do +- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" +- as_fn_executable_p "$ac_path_EGREP" || continue +-# Check for GNU ac_path_EGREP and select it if it is found. +- # Check for GNU $ac_path_EGREP +-case `"$ac_path_EGREP" --version 2>&1` in +-*GNU*) +- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +-*) +- ac_count=0 +- $as_echo_n 0123456789 >"conftest.in" +- while : +- do +- cat "conftest.in" "conftest.in" >"conftest.tmp" +- mv "conftest.tmp" "conftest.in" +- cp "conftest.in" "conftest.nl" +- $as_echo 'EGREP' >> "conftest.nl" +- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break +- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break +- as_fn_arith $ac_count + 1 && ac_count=$as_val +- if test $ac_count -gt ${ac_path_EGREP_max-0}; then +- # Best one so far, save it but keep looking for a better one +- ac_cv_path_EGREP="$ac_path_EGREP" +- ac_path_EGREP_max=$ac_count ++ if test $ac_cache; then ++ ac_fn_cxx_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" ++ if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then ++ printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi +- # 10*(2^10) chars as input seems more than enough +- test $ac_count -gt 10 && break +- done +- rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +-esac +- +- $ac_path_EGREP_found && break 3 +- done +- done +- done +-IFS=$as_save_IFS +- if test -z "$ac_cv_path_EGREP"; then +- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ ac_header= ac_cache= ++ elif test $ac_header; then ++ ac_cache=$ac_item ++ else ++ ac_header=$ac_item + fi +-else +- ac_cv_path_EGREP=$EGREP +-fi +- +- fi +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +-$as_echo "$ac_cv_path_EGREP" >&6; } +- EGREP="$ac_cv_path_EGREP" +- +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +-$as_echo_n "checking for ANSI C header files... " >&6; } +-if ${ac_cv_header_stdc+:} false; then : +- $as_echo_n "(cached) " >&6 +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-#include +-#include +-#include +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- ac_cv_header_stdc=yes +-else +- ac_cv_header_stdc=no +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- +-if test $ac_cv_header_stdc = yes; then +- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "memchr" >/dev/null 2>&1; then : +- +-else +- ac_cv_header_stdc=no +-fi +-rm -f conftest* +- +-fi +- +-if test $ac_cv_header_stdc = yes; then +- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +- +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "free" >/dev/null 2>&1; then : ++done + +-else +- ac_cv_header_stdc=no +-fi +-rm -f conftest* + +-fi + +-if test $ac_cv_header_stdc = yes; then +- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +- if test "$cross_compiling" = yes; then : +- : +-else +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +-#include +-#include +-#if ((' ' & 0x0FF) == 0x020) +-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +-#else +-# define ISLOWER(c) \ +- (('a' <= (c) && (c) <= 'i') \ +- || ('j' <= (c) && (c) <= 'r') \ +- || ('s' <= (c) && (c) <= 'z')) +-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +-#endif + +-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +-int +-main () +-{ +- int i; +- for (i = 0; i < 256; i++) +- if (XOR (islower (i), ISLOWER (i)) +- || toupper (i) != TOUPPER (i)) +- return 2; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_run "$LINENO"; then : + +-else +- ac_cv_header_stdc=no +-fi +-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ +- conftest.$ac_objext conftest.beam conftest.$ac_ext +-fi + +-fi +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +-$as_echo "$ac_cv_header_stdc" >&6; } +-if test $ac_cv_header_stdc = yes; then + +-$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +-fi ++if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes ++then : + +-# On IRIX 5.3, sys/types and inttypes.h are conflicting. +-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ +- inttypes.h stdint.h unistd.h +-do : +- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +-ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +-" +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +- cat >>confdefs.h <<_ACEOF +-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF ++printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + + fi +- +-done +- +- +-for ac_header in sys/mman.h +-do : +- ac_fn_cxx_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +-if test "x$ac_cv_header_sys_mman_h" = xyes; then : +- cat >>confdefs.h <<_ACEOF +-#define HAVE_SYS_MMAN_H 1 +-_ACEOF ++ac_fn_cxx_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" ++if test "x$ac_cv_header_sys_mman_h" = xyes ++then : ++ printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + + fi + +-done +- + + # C++ Modules would like some networking features to provide the mapping + # server. You can still use modules without them though. +@@ -3446,11 +3404,12 @@ done + + # Local socket connectivity wants AF_UNIX networking + # Check for AF_UNIX networking +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_UNIX" >&5 +-$as_echo_n "checking for AF_UNIX... " >&6; } +-if ${ac_cv_af_unix+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AF_UNIX" >&5 ++printf %s "checking for AF_UNIX... " >&6; } ++if test ${ac_cv_af_unix+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +@@ -3460,7 +3419,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + #include + #include + int +-main () ++main (void) + { + + sockaddr_un un; +@@ -3471,28 +3430,30 @@ connect (fd, (sockaddr *)&un, sizeof (un)); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_af_unix=yes +-else ++else $as_nop + ac_cv_af_unix=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_unix" >&5 +-$as_echo "$ac_cv_af_unix" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_unix" >&5 ++printf "%s\n" "$ac_cv_af_unix" >&6; } + if test $ac_cv_af_unix = yes; then + +-$as_echo "#define HAVE_AF_UNIX 1" >>confdefs.h ++printf "%s\n" "#define HAVE_AF_UNIX 1" >>confdefs.h + + fi + + # Remote socket connectivity wants AF_INET6 networking + # Check for AF_INET6 networking +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_INET6" >&5 +-$as_echo_n "checking for AF_INET6... " >&6; } +-if ${ac_cv_af_inet6+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AF_INET6" >&5 ++printf %s "checking for AF_INET6... " >&6; } ++if test ${ac_cv_af_inet6+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +@@ -3502,7 +3463,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + #include + #include + int +-main () ++main (void) + { + + sockaddr_in6 in6; +@@ -3525,35 +3486,37 @@ connect (fd, (sockaddr *)&in6, sizeof (in6)); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_af_inet6=yes +-else ++else $as_nop + ac_cv_af_inet6=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_inet6" >&5 +-$as_echo "$ac_cv_af_inet6" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_inet6" >&5 ++printf "%s\n" "$ac_cv_af_inet6" >&6; } + if test $ac_cv_af_inet6 = yes; then + +-$as_echo "#define HAVE_AF_INET6 1" >>confdefs.h ++printf "%s\n" "#define HAVE_AF_INET6 1" >>confdefs.h + + fi + + # Efficient server response wants epoll + # Check for epoll_create, epoll_ctl, epoll_pwait +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 +-$as_echo_n "checking for epoll... " >&6; } +-if ${ac_cv_epoll+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 ++printf %s "checking for epoll... " >&6; } ++if test ${ac_cv_epoll+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include + int +-main () ++main (void) + { + + int fd = epoll_create (1); +@@ -3566,35 +3529,37 @@ epoll_pwait (fd, 0, 0, -1, 0); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_epoll=yes +-else ++else $as_nop + ac_cv_epoll=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_epoll" >&5 +-$as_echo "$ac_cv_epoll" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_epoll" >&5 ++printf "%s\n" "$ac_cv_epoll" >&6; } + if test $ac_cv_epoll = yes; then + +-$as_echo "#define HAVE_EPOLL 1" >>confdefs.h ++printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h + + fi + + # If we can't use epoll, try pselect. + # Check for pselect +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 +-$as_echo_n "checking for pselect... " >&6; } +-if ${ac_cv_pselect+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pselect" >&5 ++printf %s "checking for pselect... " >&6; } ++if test ${ac_cv_pselect+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include + int +-main () ++main (void) + { + + pselect (0, 0, 0, 0, 0, 0); +@@ -3602,36 +3567,38 @@ pselect (0, 0, 0, 0, 0, 0); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_pselect=yes +-else ++else $as_nop + ac_cv_pselect=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pselect" >&5 +-$as_echo "$ac_cv_pselect" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pselect" >&5 ++printf "%s\n" "$ac_cv_pselect" >&6; } + if test $ac_cv_pselect = yes; then + +-$as_echo "#define HAVE_PSELECT 1" >>confdefs.h ++printf "%s\n" "#define HAVE_PSELECT 1" >>confdefs.h + + fi + + # And failing that, use good old select. + # If we can't even use this, the server is serialized. + # Check for select +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for select" >&5 +-$as_echo_n "checking for select... " >&6; } +-if ${ac_cv_select+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for select" >&5 ++printf %s "checking for select... " >&6; } ++if test ${ac_cv_select+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include + int +-main () ++main (void) + { + + select (0, 0, 0, 0, 0); +@@ -3639,35 +3606,37 @@ select (0, 0, 0, 0, 0); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_select=yes +-else ++else $as_nop + ac_cv_select=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_select" >&5 +-$as_echo "$ac_cv_select" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_select" >&5 ++printf "%s\n" "$ac_cv_select" >&6; } + if test $ac_cv_select = yes; then + +-$as_echo "#define HAVE_SELECT 1" >>confdefs.h ++printf "%s\n" "#define HAVE_SELECT 1" >>confdefs.h + + fi + + # Avoid some fnctl calls by using accept4, when available. + # Check for accept4 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept4" >&5 +-$as_echo_n "checking for accept4... " >&6; } +-if ${ac_cv_accept4+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for accept4" >&5 ++printf %s "checking for accept4... " >&6; } ++if test ${ac_cv_accept4+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + #include + int +-main () ++main (void) + { + + int err = accept4 (1, 0, 0, SOCK_NONBLOCK); +@@ -3675,28 +3644,30 @@ int err = accept4 (1, 0, 0, SOCK_NONBLOCK); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_accept4=yes +-else ++else $as_nop + ac_cv_accept4=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_accept4" >&5 +-$as_echo "$ac_cv_accept4" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_accept4" >&5 ++printf "%s\n" "$ac_cv_accept4" >&6; } + if test $ac_cv_accept4 = yes; then + +-$as_echo "#define HAVE_ACCEPT4 1" >>confdefs.h ++printf "%s\n" "#define HAVE_ACCEPT4 1" >>confdefs.h + + fi + + # For better server messages, look for a way to stringize network addresses + # Check for inet_ntop +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5 +-$as_echo_n "checking for inet_ntop... " >&6; } +-if ${ac_cv_inet_ntop+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_ntop" >&5 ++printf %s "checking for inet_ntop... " >&6; } ++if test ${ac_cv_inet_ntop+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +@@ -3704,7 +3675,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + #include + #include + int +-main () ++main (void) + { + + sockaddr_in6 in6; +@@ -3714,18 +3685,19 @@ const char *str = inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); + return 0; + } + _ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : ++if ac_fn_cxx_try_compile "$LINENO" ++then : + ac_cv_inet_ntop=yes +-else ++else $as_nop + ac_cv_inet_ntop=no + fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_inet_ntop" >&5 +-$as_echo "$ac_cv_inet_ntop" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_inet_ntop" >&5 ++printf "%s\n" "$ac_cv_inet_ntop" >&6; } + if test $ac_cv_inet_ntop = yes; then + +-$as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h ++printf "%s\n" "#define HAVE_INET_NTOP 1" >>confdefs.h + + fi + +@@ -3734,7 +3706,8 @@ fi + get_gcc_base_ver="cat" + + # Check whether --with-gcc-major-version-only was given. +-if test "${with_gcc_major_version_only+set}" = set; then : ++if test ${with_gcc_major_version_only+y} ++then : + withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then + get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'" + fi +@@ -3749,155 +3722,158 @@ fi + save_LIBS="$LIBS" + LIBS= + +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +-$as_echo_n "checking for library containing gethostbyname... " >&6; } +-if ${ac_cv_search_gethostbyname+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 ++printf %s "checking for library containing gethostbyname... " >&6; } ++if test ${ac_cv_search_gethostbyname+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_func_search_save_LIBS=$LIBS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char gethostbyname (); ++namespace conftest { ++ extern "C" int gethostbyname (); ++} + int +-main () ++main (void) + { +-return gethostbyname (); ++return conftest::gethostbyname (); + ; + return 0; + } + _ACEOF +-for ac_lib in '' nsl; do ++for ac_lib in '' nsl, network ++do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi +- if ac_fn_cxx_try_link "$LINENO"; then : ++ if ac_fn_cxx_try_link "$LINENO" ++then : + ac_cv_search_gethostbyname=$ac_res + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext +- if ${ac_cv_search_gethostbyname+:} false; then : ++ if test ${ac_cv_search_gethostbyname+y} ++then : + break + fi + done +-if ${ac_cv_search_gethostbyname+:} false; then : ++if test ${ac_cv_search_gethostbyname+y} ++then : + +-else ++else $as_nop + ac_cv_search_gethostbyname=no + fi + rm conftest.$ac_ext + LIBS=$ac_func_search_save_LIBS + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +-$as_echo "$ac_cv_search_gethostbyname" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 ++printf "%s\n" "$ac_cv_search_gethostbyname" >&6; } + ac_res=$ac_cv_search_gethostbyname +-if test "$ac_res" != no; then : ++if test "$ac_res" != no ++then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + + fi + +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +-$as_echo_n "checking for library containing socket... " >&6; } +-if ${ac_cv_search_socket+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 ++printf %s "checking for library containing socket... " >&6; } ++if test ${ac_cv_search_socket+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_func_search_save_LIBS=$LIBS + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char socket (); ++namespace conftest { ++ extern "C" int socket (); ++} + int +-main () ++main (void) + { +-return socket (); ++return conftest::socket (); + ; + return 0; + } + _ACEOF +-for ac_lib in '' socket; do ++for ac_lib in '' socket ++do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi +- if ac_fn_cxx_try_link "$LINENO"; then : ++ if ac_fn_cxx_try_link "$LINENO" ++then : + ac_cv_search_socket=$ac_res + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext +- if ${ac_cv_search_socket+:} false; then : ++ if test ${ac_cv_search_socket+y} ++then : + break + fi + done +-if ${ac_cv_search_socket+:} false; then : ++if test ${ac_cv_search_socket+y} ++then : + +-else ++else $as_nop + ac_cv_search_socket=no + fi + rm conftest.$ac_ext + LIBS=$ac_func_search_save_LIBS + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +-$as_echo "$ac_cv_search_socket" >&6; } ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 ++printf "%s\n" "$ac_cv_search_socket" >&6; } + ac_res=$ac_cv_search_socket +-if test "$ac_res" != no; then : ++if test "$ac_res" != no ++then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +-else ++else $as_nop + +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +-$as_echo_n "checking for socket in -lsocket... " >&6; } +-if ${ac_cv_lib_socket_socket+:} false; then : +- $as_echo_n "(cached) " >&6 +-else ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 ++printf %s "checking for socket in -lsocket... " >&6; } ++if test ${ac_cv_lib_socket_socket+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop + ac_check_lib_save_LIBS=$LIBS + LIBS="-lsocket -lnsl $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-/* Override any GCC internal prototype to avoid an error. +- Use char because int might match the return type of a GCC +- builtin and then its argument prototype would still apply. */ +-#ifdef __cplusplus +-extern "C" +-#endif +-char socket (); ++namespace conftest { ++ extern "C" int socket (); ++} + int +-main () ++main (void) + { +-return socket (); ++return conftest::socket (); + ; + return 0; + } + _ACEOF +-if ac_fn_cxx_try_link "$LINENO"; then : ++if ac_fn_cxx_try_link "$LINENO" ++then : + ac_cv_lib_socket_socket=yes +-else ++else $as_nop + ac_cv_lib_socket_socket=no + fi +-rm -f core conftest.err conftest.$ac_objext \ ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_lib_save_LIBS + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +-$as_echo "$ac_cv_lib_socket_socket" >&6; } +-if test "x$ac_cv_lib_socket_socket" = xyes; then : ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 ++printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } ++if test "x$ac_cv_lib_socket_socket" = xyes ++then : + LIBS="-lsocket -lnsl $LIBS" + fi + +@@ -3940,8 +3916,8 @@ _ACEOF + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( +- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ++ *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( +@@ -3971,15 +3947,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + /^ac_cv_env_/b end + t clear + :clear +- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ ++ s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache + if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +-$as_echo "$as_me: updating cache $cache_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 ++printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else +@@ -3993,8 +3969,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} + fi + fi + else +- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 ++printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi + fi + rm -f confcache +@@ -4011,7 +3987,7 @@ U= + for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' +- ac_i=`$as_echo "$ac_i" | sed "$ac_script"` ++ ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" +@@ -4027,8 +4003,8 @@ LTLIBOBJS=$ac_ltlibobjs + ac_write_fail=0 + ac_clean_files_save=$ac_clean_files + ac_clean_files="$ac_clean_files $CONFIG_STATUS" +-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 ++printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} + as_write_fail=0 + cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 + #! $SHELL +@@ -4051,14 +4027,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 + + # Be more Bourne compatible + DUALCASE=1; export DUALCASE # for MKS sh +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++as_nop=: ++if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 ++then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +-else ++else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( +@@ -4068,46 +4046,46 @@ esac + fi + + ++ ++# Reset variables that may have inherited troublesome values from ++# the environment. ++ ++# IFS needs to be set, to space, tab, and newline, in precisely that order. ++# (If _AS_PATH_WALK were called with IFS unset, it would have the ++# side effect of setting IFS to empty, thus disabling word splitting.) ++# Quoting is to prevent editors from complaining about space-tab. + as_nl=' + ' + export as_nl +-# Printing a long string crashes Solaris 7 /usr/bin/printf. +-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +-# Prefer a ksh shell builtin over an external printf program on Solaris, +-# but without wasting forks for bash or zsh. +-if test -z "$BASH_VERSION$ZSH_VERSION" \ +- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='print -r --' +- as_echo_n='print -rn --' +-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +- as_echo='printf %s\n' +- as_echo_n='printf %s' +-else +- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then +- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' +- as_echo_n='/usr/ucb/echo -n' +- else +- as_echo_body='eval expr "X$1" : "X\\(.*\\)"' +- as_echo_n_body='eval +- arg=$1; +- case $arg in #( +- *"$as_nl"*) +- expr "X$arg" : "X\\(.*\\)$as_nl"; +- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; +- esac; +- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" +- ' +- export as_echo_n_body +- as_echo_n='sh -c $as_echo_n_body as_echo' +- fi +- export as_echo_body +- as_echo='sh -c $as_echo_body as_echo' +-fi ++IFS=" "" $as_nl" ++ ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# Ensure predictable behavior from utilities with locale-dependent output. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# We cannot yet rely on "unset" to work, but we need these variables ++# to be unset--not just set to an empty or harmless value--now, to ++# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct ++# also avoids known problems related to "unset" and subshell syntax ++# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). ++for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH ++do eval test \${$as_var+y} \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++ ++# Ensure that fds 0, 1, and 2 are open. ++if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi ++if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + + # The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then ++if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || +@@ -4116,13 +4094,6 @@ if test "${PATH_SEPARATOR+set}" != set; then + fi + + +-# IFS +-# We need space, tab and new line, in precisely that order. Quoting is +-# there to prevent editors from complaining about space-tab. +-# (If _AS_PATH_WALK were called with IFS unset, it would disable word +-# splitting by setting IFS to empty value.) +-IFS=" "" $as_nl" +- + # Find who we are. Look in the path if we contain no directory separator. + as_myself= + case $0 in #(( +@@ -4131,8 +4102,12 @@ case $0 in #(( + for as_dir in $PATH + do + IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ case $as_dir in #((( ++ '') as_dir=./ ;; ++ */) ;; ++ *) as_dir=$as_dir/ ;; ++ esac ++ test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done + IFS=$as_save_IFS + +@@ -4144,30 +4119,10 @@ if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then +- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 + fi + +-# Unset variables that we do not need and which cause bugs (e.g. in +-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +-# suppresses any "Segmentation fault" message there. '((' could +-# trigger a bug in pdksh 5.2.14. +-for as_var in BASH_ENV ENV MAIL MAILPATH +-do eval test x\${$as_var+set} = xset \ +- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +-done +-PS1='$ ' +-PS2='> ' +-PS4='+ ' +- +-# NLS nuisances. +-LC_ALL=C +-export LC_ALL +-LANGUAGE=C +-export LANGUAGE +- +-# CDPATH. +-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + + # as_fn_error STATUS ERROR [LINENO LOG_FD] +@@ -4180,13 +4135,14 @@ as_fn_error () + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack +- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi +- $as_echo "$as_me: error: $2" >&2 ++ printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status + } # as_fn_error + + ++ + # as_fn_set_status STATUS + # ----------------------- + # Set $? to STATUS, without forking. +@@ -4213,18 +4169,20 @@ as_fn_unset () + { eval $1=; unset $1;} + } + as_unset=as_fn_unset ++ + # as_fn_append VAR VALUE + # ---------------------- + # Append the text in VALUE to the end of the definition contained in VAR. Take + # advantage of any shell optimizations that allow amortized linear growth over + # repeated appends, instead of the typical quadratic growth present in naive + # implementations. +-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null ++then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +-else ++else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 +@@ -4236,12 +4194,13 @@ fi # as_fn_append + # Perform arithmetic evaluation on the ARGs, and store the result in the + # global $as_val. Take advantage of shells that can avoid forks. The arguments + # must be portable across $(()) and expr. +-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null ++then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +-else ++else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` +@@ -4272,7 +4231,7 @@ as_me=`$as_basename -- "$0" || + $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X/"$0" | ++printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q +@@ -4294,6 +4253,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS + as_cr_digits='0123456789' + as_cr_alnum=$as_cr_Letters$as_cr_digits + ++ ++# Determine whether it's possible to make 'echo' print without a newline. ++# These variables are no longer used directly by Autoconf, but are AC_SUBSTed ++# for compatibility with existing Makefiles. + ECHO_C= ECHO_N= ECHO_T= + case `echo -n x` in #((((( + -n*) +@@ -4307,6 +4270,12 @@ case `echo -n x` in #((((( + ECHO_N='-n';; + esac + ++# For backward compatibility with old third-party macros, we provide ++# the shell variables $as_echo and $as_echo_n. New code should use ++# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. ++as_echo='printf %s\n' ++as_echo_n='printf %s' ++ + rm -f conf$$ conf$$.exe conf$$.file + if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +@@ -4348,7 +4317,7 @@ as_fn_mkdir_p () + as_dirs= + while :; do + case $as_dir in #( +- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" +@@ -4357,7 +4326,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$as_dir" | ++printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -4420,7 +4389,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + # values after options handling. + ac_log=" + This file was extended by $as_me, which was +-generated by GNU Autoconf 2.69. Invocation command line was ++generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -4478,14 +4447,16 @@ $config_headers + Report bugs to the package provider." + + _ACEOF ++ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ++ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ++ac_cs_config='$ac_cs_config_escaped' + ac_cs_version="\\ + config.status +-configured by $0, generated by GNU Autoconf 2.69, ++configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +-Copyright (C) 2012 Free Software Foundation, Inc. ++Copyright (C) 2021 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation + gives unlimited permission to copy, distribute and modify it." + +@@ -4523,15 +4494,15 @@ do + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) +- $as_echo "$ac_cs_version"; exit ;; ++ printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) +- $as_echo "$ac_cs_config"; exit ;; ++ printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in +- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" +@@ -4539,7 +4510,7 @@ do + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in +- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; +@@ -4548,7 +4519,7 @@ do + as_fn_error $? "ambiguous option: \`$1' + Try \`$0 --help' for more information.";; + --help | --hel | -h ) +- $as_echo "$ac_cs_usage"; exit ;; ++ printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; +@@ -4576,7 +4547,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift +- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 ++ \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +@@ -4590,7 +4561,7 @@ exec 5>>config.log + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX + ## Running $as_me. ## + _ASBOX +- $as_echo "$ac_log" ++ printf "%s\n" "$ac_log" + } >&5 + + _ACEOF +@@ -4616,8 +4587,8 @@ done + # We use the long form for the default assignment because of an extremely + # bizarre bug on SunOS 4.1.3. + if $ac_need_defaults; then +- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers ++ test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files ++ test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + fi + + # Have a temporary directory for convenience. Make it in the build tree +@@ -4953,7 +4924,7 @@ do + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac +- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ++ case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + +@@ -4961,17 +4932,17 @@ do + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` +- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' ++ printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" +- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +-$as_echo "$as_me: creating $ac_file" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 ++printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) +- ac_sed_conf_input=`$as_echo "$configure_input" | ++ ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac +@@ -4988,7 +4959,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +-$as_echo X"$ac_file" | ++printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q +@@ -5012,9 +4983,9 @@ $as_echo X"$ac_file" | + case "$ac_dir" in + .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) +- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. +- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` ++ ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; +@@ -5071,8 +5042,8 @@ ac_sed_dataroot=' + case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in + *datarootdir*) ac_datarootdir_seen=yes;; + *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 ++printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' +@@ -5115,9 +5086,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + which seems to be undefined. Please make sure it is defined" >&5 +-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' + which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" +@@ -5133,20 +5104,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} + # + if test x"$ac_file" != x-; then + { +- $as_echo "/* $configure_input */" \ ++ printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +-$as_echo "$as_me: $ac_file is unchanged" >&6;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 ++printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else +- $as_echo "/* $configure_input */" \ ++ printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +@@ -5187,7 +5158,8 @@ if test "$no_create" != yes; then + $ac_cs_success || as_fn_exit 1 + fi + if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} ++ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 ++printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + fi + ++ +diff --git a/config.rpath b/config.rpath +index 4dea75957..5bcc5be17 100755 +--- a/config.rpath ++++ b/config.rpath +@@ -161,6 +161,8 @@ if test "$with_gnu_ld" = yes; then + ;; + netbsd*) + ;; ++ haiku*) ++ ;; + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no +diff --git a/config/ax_lib_socket_nsl.m4 b/config/ax_lib_socket_nsl.m4 +index 54cad68b4..7996135b9 100644 +--- a/config/ax_lib_socket_nsl.m4 ++++ b/config/ax_lib_socket_nsl.m4 +@@ -33,7 +33,7 @@ + AU_ALIAS([LIB_SOCKET_NSL], [AX_LIB_SOCKET_NSL]) + AC_DEFUN([AX_LIB_SOCKET_NSL], + [ +- AC_SEARCH_LIBS([gethostbyname], [nsl]) ++ AC_SEARCH_LIBS([gethostbyname], [nsl, network]) + AC_SEARCH_LIBS([socket], [socket], [], [ + AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"], + [], [-lnsl])]) +diff --git a/configure b/configure +index 117a7ef23..a4b2dac27 100755 +--- a/configure ++++ b/configure +@@ -767,6 +767,7 @@ infodir + docdir + oldincludedir + includedir ++runstatedir + localstatedir + sharedstatedir + sysconfdir +@@ -936,6 +937,7 @@ datadir='${datarootdir}' + sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' ++runstatedir='${localstatedir}/run' + includedir='${prefix}/include' + oldincludedir='/usr/include' + docdir='${datarootdir}/doc/${PACKAGE}' +@@ -1188,6 +1190,15 @@ do + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + ++ -runstatedir | --runstatedir | --runstatedi | --runstated \ ++ | --runstate | --runstat | --runsta | --runst | --runs \ ++ | --run | --ru | --r) ++ ac_prev=runstatedir ;; ++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ ++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ ++ | --run=* | --ru=* | --r=*) ++ runstatedir=$ac_optarg ;; ++ + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ +@@ -1325,7 +1336,7 @@ fi + for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ +- libdir localedir mandir ++ libdir localedir mandir runstatedir + do + eval ac_val=\$$ac_var + # Remove trailing slashes. +@@ -1485,6 +1496,7 @@ Fine tuning of the installation directories: + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] ++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] +@@ -3144,6 +3156,9 @@ case "${host}" in + i[3456789]86-*-msdosdjgpp*) + noconfigdirs="$noconfigdirs tcl tk itcl" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs tk itcl libgui gdb" ++ ;; + esac + + +@@ -3222,7 +3237,7 @@ if test x$enable_libgomp = x ; then + ;; + *-*-solaris2* | *-*-hpux11*) + ;; +- *-*-darwin* | *-*-aix*) ++ *-*-darwin* | *-*-aix* | *-*-haiku*) + ;; + nvptx*-*-* | amdgcn*-*-*) + ;; +@@ -3460,6 +3475,9 @@ case "${target}" in + *-*-darwin*) + noconfigdirs="$noconfigdirs target-libffi" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs ${libgcj}" ++ ;; + *-*-netware*) + noconfigdirs="$noconfigdirs target-libffi" + ;; +@@ -3667,6 +3685,9 @@ case "${target}" in + *-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs target-newlib target-libgloss" ++ ;; + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; +@@ -3731,6 +3752,9 @@ case "${target}" in + with_gmp=/usr/local + fi + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs gdb target-libiberty" ++ ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + noconfigdirs="$noconfigdirs target-libgloss" +diff --git a/configure.ac b/configure.ac +index b3e9bbd2a..362fd8159 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -433,6 +433,9 @@ case "${host}" in + i[[3456789]]86-*-msdosdjgpp*) + noconfigdirs="$noconfigdirs tcl tk itcl" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs tk itcl libgui gdb" ++ ;; + esac + + +@@ -496,7 +499,7 @@ if test x$enable_libgomp = x ; then + ;; + *-*-solaris2* | *-*-hpux11*) + ;; +- *-*-darwin* | *-*-aix*) ++ *-*-darwin* | *-*-aix* | *-*-haiku*) + ;; + nvptx*-*-* | amdgcn*-*-*) + ;; +@@ -719,6 +722,9 @@ case "${target}" in + *-*-darwin*) + noconfigdirs="$noconfigdirs target-libffi" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs ${libgcj}" ++ ;; + *-*-netware*) + noconfigdirs="$noconfigdirs target-libffi" + ;; +@@ -923,6 +929,9 @@ case "${target}" in + *-*-freebsd*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs target-newlib target-libgloss" ++ ;; + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu | *-*-kopensolaris*-gnu) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; +@@ -987,6 +996,9 @@ case "${target}" in + with_gmp=/usr/local + fi + ;; ++ *-*-haiku*) ++ noconfigdirs="$noconfigdirs gdb target-libiberty" ++ ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + noconfigdirs="$noconfigdirs target-libgloss" +diff --git a/gcc/Makefile.in b/gcc/Makefile.in +index ad9a5d94c..bcbafbb2a 100644 +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -106,6 +106,8 @@ build_objdir := $(toplevel_builddir)/$(build_subdir) + build_libobjdir := $(toplevel_builddir)/$(build_libsubdir) + target_objdir := $(toplevel_builddir)/$(target_subdir) + ++HYBRID_SECONDARY = @HYBRID_SECONDARY@ ++ + # -------- + # Defined vpaths + # -------- +@@ -275,7 +277,7 @@ NO_PIE_FLAG = @NO_PIE_FLAG@ + DO_LINK_MUTEX = @DO_LINK_MUTEX@ + + # We don't want to compile the compilers with -fPIE, it make PCH fail. +-COMPILER += $(NO_PIE_CFLAGS) ++#COMPILER += $(NO_PIE_CFLAGS) + + # Link with -no-pie since we compile the compiler with -fno-PIE. + LINKER += $(NO_PIE_FLAG) +@@ -2341,6 +2343,10 @@ DRIVER_DEFINES = \ + -DCONFIGURE_SPECS="\"@CONFIGURE_SPECS@\"" \ + -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \ + -DNATIVE_SYSTEM_HEADER_DIR=\"$(NATIVE_SYSTEM_HEADER_DIR)\" ++ ++ifneq ($(HYBRID_SECONDARY),) ++DRIVER_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" ++endif + + CFLAGS-gcc.o += $(DRIVER_DEFINES) -DBASEVER=$(BASEVER_s) + gcc.o: $(BASEVER) +@@ -2978,7 +2984,7 @@ $(genprogerr:%=build/gen%$(build_exeext)): $(BUILD_ERRORS) + genprog = $(genprogerr) check checksum match + + # These programs need libs over and above what they get from the above list. +-build/genautomata$(build_exeext) : BUILD_LIBS += -lm ++build/genautomata$(build_exeext) : BUILD_LIBS += @build_math_library@ + + build/genrecog$(build_exeext) : build/hash-table.o build/inchash.o + build/gencfn-macros$(build_exeext) : build/hash-table.o build/vec.o \ +@@ -3074,6 +3080,10 @@ PREPROCESSOR_DEFINES = \ + -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \ + @TARGET_SYSTEM_ROOT_DEFINE@ + ++ifneq ($(HYBRID_SECONDARY),) ++PREPROCESSOR_DEFINES += -DHYBRID_SECONDARY="\"$(HYBRID_SECONDARY)\"" ++endif ++ + CFLAGS-cppbuiltin.o += $(PREPROCESSOR_DEFINES) -DBASEVER=$(BASEVER_s) + cppbuiltin.o: $(BASEVER) + +diff --git a/gcc/config.gcc b/gcc/config.gcc +index 6fd159448..ca188fa72 100644 +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -181,7 +181,7 @@ + # the --with-sysroot configure option or the + # --sysroot command line option is used this + # will be relative to the sysroot. +-# target_type_format_char ++# target_type_format_char + # The default character to be used for formatting + # the attribute in a + # .type symbol_name, ${t_t_f_c} +@@ -843,6 +843,22 @@ case ${target} in + *-*-fuchsia*) + native_system_header_dir=/include + ;; ++*-*-haiku*) ++ # This is the generic ELF configuration of Haiku. Later ++ # machine-specific sections may refine and add to this ++ # configuration. ++ # ++ gas=yes ++ gnu_ld=yes ++ tmake_file="t-slibgcc" ++ case ${enable_threads} in ++ "" | yes | posix) thread_file='posix' ;; ++ esac ++ default_use_cxa_atexit=yes ++ tm_p_file="${tm_p_file} haiku-protos.h" ++ extra_objs="${extra_objs} haiku.o" ++ extra_options="${extra_options} haiku.opt" ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) + extra_options="$extra_options gnu-user.opt" + gas=yes +@@ -1175,6 +1191,12 @@ aarch64*-*-netbsd*) + tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" + ;; ++aarch64*-*-haiku*) ++ gcc_cv_initfini_array=yes ++ tm_file="${tm_file} dbxelf.h elfos.h haiku.h haiku-stdint.h" ++ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-haiku.h" ++ tmake_file="${tmake_file} t-haiku aarch64/t-aarch64 aarch64/t-aarch64-haiku" ++ ;; + aarch64*-*-linux*) + tm_file="${tm_file} elfos.h gnu-user.h linux.h glibc-stdint.h" + tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h" +@@ -1345,6 +1367,16 @@ arm*-*-netbsdelf*) + armv7*) target_cpu_cname="generic-armv7-a";; + esac + ;; ++arm*-*-haiku*) ++ tmake_file="${tmake_file} t-haiku arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-haiku" ++ tm_file="dbxelf.h elfos.h haiku.h arm/elf.h arm/bpabi.h arm/haiku.h haiku-stdint.h" ++ # The BPABI long long divmod functions return a 128-bit value in ++ # registers r0-r3. Correctly modeling that requires the use of ++ # TImode. ++ need_64bit_hwint=yes ++ default_use_cxa_atexit=yes ++ tm_file="${tm_file} arm/aout.h arm/arm.h" ++ ;; + arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) + tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" + extra_options="${extra_options} linux-android.opt" +@@ -1891,6 +1923,14 @@ i[34567]86-*-freebsd*) + x86_64-*-freebsd*) + tm_file="${tm_file} i386/unix.h i386/att.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" + ;; ++i[34567]86-*-haiku*) ++ tmake_file="${tmake_file} t-haiku i386/t-crtpic" ++ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h haiku.h i386/haiku.h haiku-stdint.h" ++ ;; ++x86_64-*-haiku*) ++ tmake_file="${tmake_file} t-haiku i386/t-haiku64" ++ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h haiku.h i386/haiku64.h haiku-stdint.h" ++ ;; + i[34567]86-*-netbsdelf*) + tm_file="${tm_file} i386/unix.h i386/att.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h" + extra_options="${extra_options} netbsd.opt netbsd-elf.opt" +@@ -2362,6 +2402,13 @@ m68k-*-rtems*) + tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h" + tm_defines="${tm_defines} MOTOROLA=1" + ;; ++m68k-*-haiku*) ++ default_m68k_cpu=68020 ++ default_cf_cpu=5206 ++ tmake_file="${tmake_file} m68k/t-m68kbare m68k/t-crtstuff t-haiku" #?? ++ tm_file="${tm_file} dbxelf.h elfos.h haiku.h m68k/haiku.h haiku-stdint.h" ++ tm_defines="${tm_defines} MOTOROLA=1" ++ ;; + mcore-*-elf) + tm_file="elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h" + tmake_file=mcore/t-mcore +@@ -2413,6 +2460,13 @@ microblaze*-*-elf) + cxx_target_objs="${cxx_target_objs} microblaze-c.o" + tmake_file="${tmake_file} microblaze/t-microblaze" + ;; ++riscv*-*-haiku*) ++ gcc_cv_initfini_array=yes ++ tm_file="elfos.h haiku.h ${tm_file} riscv/haiku.h haiku-stdint.h" ++ tmake_file="${tmake_file} t-haiku riscv/t-riscv riscv/t-haiku" ++ gnu_ld=yes ++ gas=yes ++ ;; + riscv*-*-linux*) + tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h" + case "x${enable_multilib}" in +@@ -2514,6 +2568,11 @@ mips*-mti-linux*) + gnu_ld=yes + gas=yes + ;; ++mipsel-*-haiku*) ++ target_cpu_default="MASK_ABICALLS" ++ tm_file="elfos.h ${tm_file} haiku.h mips/haiku.h haiku-stdint.h" ++ tmake_file="${tmake_file} mips/t-elf t-haiku" ++ ;; + mips*-*-linux*) # Linux MIPS, either endian. + tm_file="elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h" + extra_options="${extra_options} linux-android.opt" +@@ -2949,6 +3008,11 @@ powerpc-*-eabi*) + tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + use_gcc_stdint=wrap + ;; ++powerpc-*-haiku*) ++ tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" ++ tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku.h haiku-stdint.h" ++ extra_options="${extra_options} rs6000/sysv4.opt" ++ ;; + powerpc-*-rtems*) + tm_file="rs6000/biarch64.h ${tm_file} elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h" + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" +@@ -3405,6 +3469,11 @@ sparc64-*-rtems*) + extra_options="${extra_options}" + tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64" + ;; ++sparc64-*-haiku*) ++ tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h haiku.h sparc/haiku.h haiku-stdint.h" ++ extra_options="${extra_options}" ++ tmake_file="${tmake_file} t-haiku sparc/t-sparc sparc/t-haiku" ++ ;; + sparc64-*-linux*) + tm_file="sparc/biarch64.h ${tm_file} elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h" + extra_options="${extra_options} sparc/long-double-switch.opt" +diff --git a/gcc/config.host b/gcc/config.host +index 5df85752e..caa9f8468 100644 +--- a/gcc/config.host ++++ b/gcc/config.host +@@ -61,7 +61,7 @@ + # different from the default "liblto_plugin.so". + + # When setting any of these variables, check to see if a corresponding +-# variable is present in config.build; if so, you will likely want to ++# variable is present in config.build; if so, you will likely want to + # set it in both places. + + # Default settings. +@@ -100,7 +100,7 @@ esac + + case ${host} in + aarch64*-*-freebsd* | aarch64*-*-linux* | aarch64*-*-fuchsia* |\ +- aarch64*-*-darwin*) ++ aarch64*-*-darwin* | aarch64*-*-haiku*) + case ${target} in + aarch64*-*-*) + host_extra_gcc_objs="driver-aarch64.o" +@@ -108,7 +108,7 @@ case ${host} in + ;; + esac + ;; +- arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia*) ++ arm*-*-freebsd* | arm*-*-netbsd* | arm*-*-linux* | arm*-*-fuchsia* | arm*-*-haiku*) + case ${target} in + arm*-*-*) + host_extra_gcc_objs="driver-arm.o" +@@ -134,9 +134,11 @@ case ${host} in + ;; + esac + ;; +- mips*-*-linux*) ++ mips*-*-linux* \ ++ | mips*-*-haiku*) + case ${target} in +- mips*-*-linux*) ++ mips*-*-linux* \ ++ | mips*-*-haiku*) + host_extra_gcc_objs="driver-native.o" + host_xmake_file="${host_xmake_file} mips/x-native" + ;; +diff --git a/gcc/config/aarch64/aarch64-haiku.h b/gcc/config/aarch64/aarch64-haiku.h +new file mode 100644 +index 000000000..6ab98a4a0 +--- /dev/null ++++ b/gcc/config/aarch64/aarch64-haiku.h +@@ -0,0 +1,71 @@ ++/* Machine description for AArch64 architecture. ++ Copyright (C) 2009-2018 Free Software Foundation, Inc. ++ Contributed by ARM Ltd. ++ Updated for Haiku by Jaroslaw Pelczar ++ ++ This file is part of GCC. ++ ++ GCC is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3, or (at your option) ++ any later version. ++ ++ GCC is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING3. If not see ++ . */ ++ ++#ifndef GCC_AARCH64_HAIKU_H ++#define GCC_AARCH64_HAIKU_H ++ ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ } \ ++ while (0) ++ ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_LINKER_EMULATION "aarch64haikub" ++#else ++#define TARGET_LINKER_EMULATION "aarch64haiku" ++#endif ++ ++#if TARGET_FIX_ERR_A53_835769_DEFAULT ++#define CA53_ERR_835769_SPEC \ ++ " %{!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769}" ++#else ++#define CA53_ERR_835769_SPEC \ ++ " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}" ++#endif ++ ++#if TARGET_FIX_ERR_A53_843419_DEFAULT ++#define CA53_ERR_843419_SPEC \ ++ " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}" ++#else ++#define CA53_ERR_843419_SPEC \ ++ " %{mfix-cortex-a53-843419:--fix-cortex-a53-843419}" ++#endif ++ ++ ++/* Uninitialized common symbols in non-PIE executables, even with ++ strong definitions in dependent shared libraries, will resolve ++ to COPY relocated symbol in the executable. See PR65780. */ ++#undef TARGET_BINDS_LOCAL_P ++#define TARGET_BINDS_LOCAL_P default_binds_local_p_2 ++ ++/* Define this to be nonzero if static stack checking is supported. */ ++#define STACK_CHECK_STATIC_BUILTIN 1 ++ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m " TARGET_LINKER_EMULATION " %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL} " CA53_ERR_835769_SPEC " " CA53_ERR_843419_SPEC " -X" ++ ++#endif /* GCC_AARCH64_HAIKU_H */ +diff --git a/gcc/config/aarch64/t-aarch64-haiku b/gcc/config/aarch64/t-aarch64-haiku +new file mode 100644 +index 000000000..99d3dea36 +--- /dev/null ++++ b/gcc/config/aarch64/t-aarch64-haiku +@@ -0,0 +1,21 @@ ++# Machine description for AArch64 architecture. ++# Copyright (C) 2016-2018 Free Software Foundation, Inc. ++# ++# This file is part of GCC. ++# ++# GCC is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3, or (at your option) ++# any later version. ++# ++# GCC is distributed in the hope that it will be useful, but ++# WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++# General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with GCC; see the file COPYING3. If not see ++# . ++ ++LIB1ASMSRC = aarch64/lib1funcs.asm ++LIB1ASMFUNCS = _aarch64_sync_cache_range +diff --git a/gcc/config/arm/haiku.h b/gcc/config/arm/haiku.h +new file mode 100644 +index 000000000..543ba9dd4 +--- /dev/null ++++ b/gcc/config/arm/haiku.h +@@ -0,0 +1,71 @@ ++/* Definitions for ARM running Haiku systems using ELF ++ Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ++ 2005 Free Software Foundation, Inc. ++ ++ This file is part of GCC. ++ ++ GCC is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ GCC is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GCC; see the file COPYING. If not, write to ++ the Free Software Foundation, 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* Unsigned chars produces much better code than signed. */ ++#define DEFAULT_SIGNED_CHAR 0 ++ ++#undef TARGET_DEFAULT_FLOAT_ABI ++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT ++ ++/* We default to the "aapcs-linux" ABI so that enums are int-sized by ++ default. */ ++#undef ARM_DEFAULT_ABI ++#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX ++ ++/* bpabi.h sets FPUTYPE_DEFAULT to VFP */ ++ ++#undef MULTILIB_DEFAULTS ++#define MULTILIB_DEFAULTS \ ++ { "marm", "mlittle-endian", "msoft-float", "mno-thumb-interwork" } ++ ++/* Default is set by bpabi.h */ ++/* ++#undef TARGET_DEFAULT ++*/ ++ ++#undef SUBTARGET_CPU_DEFAULT ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 ++ ++/* Now we define the strings used to build the spec file. */ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__ARM__"); \ ++ builtin_define ("__arm__"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ TARGET_BPABI_CPP_BUILTINS(); \ ++ } \ ++ while (0) ++ ++/* Use the default LIBGCC_SPEC, not the empty version in haiku.h, as we ++ do not use multilib (needed ??). */ ++#undef LIBGCC_SPEC ++ ++/* If ELF is the default format, we should not use /lib/elf. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m armelf_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL} -X" ++ +diff --git a/gcc/config/arm/t-haiku b/gcc/config/arm/t-haiku +new file mode 100644 +index 000000000..3f7f488fe +--- /dev/null ++++ b/gcc/config/arm/t-haiku +@@ -0,0 +1,21 @@ ++# build multilib for soft float and VFP ++# (unsure about how it should be done...) ++# mix from t-symbian & t-wince-pe ++ ++#LIB1ASMSRC = arm/lib1funcs.asm ++#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _call_via_rX _interwork_call_via_rX ++ ++ ++#MULTILIB_OPTIONS += mhard-float ++#MULTILIB_DIRNAMES += fpu ++ ++MULTILIB_OPTIONS += msoft-float ++MULTILIB_DIRNAMES += fpu soft ++MULTILIB_EXCEPTIONS += *mthumb/*mhard-float* ++ ++MULTILIB_OPTIONS += mfloat-abi=softfp ++MULTILIB_DIRNAMES += softfp ++ ++#LIBGCC = stmp-multilib ++#INSTALL_LIBGCC = install-multilib ++#TARGET_LIBGCC2_CFLAGS = +diff --git a/gcc/config/haiku-protos.h b/gcc/config/haiku-protos.h +new file mode 100644 +index 000000000..22d8e5922 +--- /dev/null ++++ b/gcc/config/haiku-protos.h +@@ -0,0 +1,21 @@ ++/* Operating system specific prototypes to be used when targeting GCC for Haiku. ++ Copyright (C) 2021 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++/* In haiku.c. */ ++extern void haiku_override_options (void); +diff --git a/gcc/config/haiku-stdint.h b/gcc/config/haiku-stdint.h +new file mode 100644 +index 000000000..19f141296 +--- /dev/null ++++ b/gcc/config/haiku-stdint.h +@@ -0,0 +1,55 @@ ++/* Definitions for types on Haiku. ++ Copyright (C) 2014 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++. */ ++ ++#define SIG_ATOMIC_TYPE "int" ++ ++#define INT8_TYPE "signed char" ++#define INT16_TYPE "short int" ++#define INT32_TYPE "int" ++#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT8_TYPE "unsigned char" ++#define UINT16_TYPE "short unsigned int" ++#define UINT32_TYPE "unsigned int" ++#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INT_LEAST8_TYPE "signed char" ++#define INT_LEAST16_TYPE "short int" ++#define INT_LEAST32_TYPE "int" ++#define INT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT_LEAST8_TYPE "unsigned char" ++#define UINT_LEAST16_TYPE "short unsigned int" ++#define UINT_LEAST32_TYPE "unsigned int" ++#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INT_FAST8_TYPE "int" ++#define INT_FAST16_TYPE "int" ++#define INT_FAST32_TYPE "int" ++#define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") ++#define UINT_FAST8_TYPE "unsigned int" ++#define UINT_FAST16_TYPE "unsigned int" ++#define UINT_FAST32_TYPE "unsigned int" ++#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") ++ ++#define INTPTR_TYPE "long int" ++#define UINTPTR_TYPE "long unsigned int" +diff --git a/gcc/config/haiku.c b/gcc/config/haiku.c +new file mode 100644 +index 000000000..af14c02f4 +--- /dev/null ++++ b/gcc/config/haiku.c +@@ -0,0 +1,39 @@ ++/* General Haiku system support. ++ Copyright (C) 2021 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#include "config.h" ++#include "system.h" ++#include "coretypes.h" ++#include "target.h" ++ ++void ++haiku_override_options (void) ++{ ++ if (!global_options_set.x_dwarf_strict) ++ dwarf_strict = 1; ++ if (!global_options_set.x_dwarf_version) ++ dwarf_version = 4; ++ ++ /* PIE does not work on Haiku, but PIC does the right thing for position ++ * independant executables. So if asked for PIE, do PIC instead. ++ */ ++ if (flag_pie && !flag_pic) ++ flag_pic = flag_pie; ++ flag_pie = 0; ++} +diff --git a/gcc/config/haiku.h b/gcc/config/haiku.h +new file mode 100644 +index 000000000..88adc2577 +--- /dev/null ++++ b/gcc/config/haiku.h +@@ -0,0 +1,230 @@ ++/* Definitions of target machine for GCC. ++ Common Haiku definitions for all architectures. ++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++ ++/* Change debugging to Dwarf2. */ ++#undef PREFERRED_DEBUGGING_TYPE ++#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG ++ ++#undef MCOUNT_NAME ++#define MCOUNT_NAME "_mcount" ++ ++#define TARGET_DECLSPEC 1 ++ ++#undef SIZE_TYPE ++#define SIZE_TYPE "long unsigned int" ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE "long int" ++ ++#undef WCHAR_TYPE ++#define WCHAR_TYPE "int" ++ ++#undef WCHAR_TYPE_SIZE ++#define WCHAR_TYPE_SIZE 32 ++ ++/* Haiku uses lots of multichars, so don't warn about them unless the ++ user explicitly asks for the warnings with -Wmultichar. Note that ++ CC1_SPEC is used for both cc1 and cc1plus. ++ ++ HAIKU_CC1_SPEC is common options for all architectures. The frame pointer is also enabled ++ for all architectures, except for 32-bit i386, because that one has a very limited number of ++ registers, and the performance impact is too high. */ ++#define HAIKU_CC1_SPEC \ ++ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ ++ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ HAIKU_CC1_SPEC " %{!fomit-frame-pointer: -fno-omit-frame-pointer}" ++ ++#undef CC1PLUS_SPEC ++#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" ++ ++#define SUBTARGET_OVERRIDE_OPTIONS \ ++ do { \ ++ haiku_override_options (); \ ++ } while (0) ++ ++/* LIB_SPEC for Haiku */ ++#undef LIB_SPEC ++#define LIB_SPEC "-lroot" ++ ++/* Use --as-needed -lgcc_s for eh support. */ ++#ifdef HAVE_LD_AS_NEEDED ++#define USE_LD_AS_NEEDED 1 ++#endif ++ ++/* Pass --eh-frame-hdr to provide a PT_EH_FRAME section, allowing unwind ++ libraries to get frame information. */ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#define LINK_EH_SPEC "%{!static|static-pie:--eh-frame-hdr} " ++#endif ++ ++#undef STARTFILE_SPEC ++#define STARTFILE_SPEC "crti.o%s crtbeginS.o%s %{!shared:%{!nostart:start_dyn.o%s}} init_term_dyn.o%s" ++ ++#undef ENDFILE_SPEC ++#define ENDFILE_SPEC "crtendS.o%s crtn.o%s" ++ ++/* Every program on Haiku links against libroot which contains the pthread ++ routines, so there's no need to explicitly call out when doing threaded ++ work. */ ++#undef GOMP_SELF_SPECS ++#define GOMP_SELF_SPECS "" ++#undef GTM_SELF_SPECS ++#define GTM_SELF_SPECS "" ++ ++#ifdef HYBRID_SECONDARY ++/* For a secondary compiler on a hybrid system, use alternative search paths.*/ ++#define INCLUDE_DEFAULTS \ ++{ \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ ++ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ ++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ ++ { "/boot/system/non-packaged/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ ++ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ ++ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/" HYBRID_SECONDARY, 0, 0, 0, 1, 0 }, \ ++ /* Hybrid secondary folders for os kits not in base haiku package */\ ++ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/" HYBRID_SECONDARY "/os/opengl", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++} ++#else /* HYBRID_SECONDARY */ ++/* For both native and cross compiler, use standard Haiku include file ++ search paths. ++ For a cross compiler, it is expected that an appropriate sysroot has ++ been configured (e.g. /boot/system/develop/cross/x86) which will ++ be appended to each search folder given below. */ ++#define INCLUDE_DEFAULTS \ ++{ \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0, 0 }, \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ ++ { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0, 0 }, \ ++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 }, \ ++ { "/boot/system/non-packaged/develop/headers", 0, 0, 0, 1, 0 }, \ ++ { "/boot/system/develop/headers/os", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/app", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/device", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/drivers", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/game", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/interface", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/kernel", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/locale", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/mail", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/media", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/midi", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/midi2", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/net", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/opengl", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/storage", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/support", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/translation", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/graphics", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/input_server", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/mail_daemon", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/registrar", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/screen_saver", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/add-ons/tracker", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/Deskbar", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/NetPositive", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/os/be_apps/Tracker", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/3rdparty", 0, 0, 0, 1, 0 }, \ ++ /* TODO: To be removed when libtiff has been outsourced. */\ ++ { "/boot/system/develop/headers/bsd", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/glibc", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/gnu", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers/posix", 0, 0, 1, 1, 0 }, \ ++ { "/boot/system/develop/headers", 0, 0, 0, 1, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++} ++#endif /* HYBRID_SECONDARY */ ++ ++/* Whee. LIBRARY_PATH is Be's LD_LIBRARY_PATH, which of course will ++ cause nasty problems if we override it. */ ++#define LIBRARY_PATH_ENV "BELIBRARIES" ++ ++/* Set STANDARD_STARTFILE_PREFIX_1 set to "/boot/system/develop/lib/", or the ++ respective secondary architecture path. The user specific paths are set via ++ LIBRARY_PATH_ENV. */ ++#undef STANDARD_STARTFILE_PREFIX_1 ++#undef STANDARD_STARTFILE_PREFIX_2 ++#undef MD_STARTFILE_PREFIX ++#undef STARTFILE_PREFIX_SPEC ++#ifdef HYBRID_SECONDARY ++/* For a secondary compiler on a hybrid system, use alternative search paths.*/ ++#define STANDARD_STARTFILE_PREFIX_1 \ ++ "/boot/system/non-packaged/develop/lib/" HYBRID_SECONDARY "/" ++#define STANDARD_STARTFILE_PREFIX_2 \ ++ "/boot/system/develop/lib/" HYBRID_SECONDARY "/" ++#else /* HYBRID_SECONDARY */ ++#define STANDARD_STARTFILE_PREFIX_1 "/boot/system/non-packaged/develop/lib/" ++#define STANDARD_STARTFILE_PREFIX_2 "/boot/system/develop/lib/" ++#endif /* HYBRID_SECONDARY */ ++ ++/* Haiku doesn't have a separate math library. */ ++#define MATH_LIBRARY "" ++ ++/* Haiku headers are C++-aware (and often use C++). */ ++/* #define NO_IMPLICIT_EXTERN_C */ ++ ++#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ ++ "|fstack-protector-strong|fstack-protector-explicit" \ ++ ":-lssp_nonshared}" ++ ++/* Do not use TM clone registry in Haiku for now */ ++#define USE_TM_CLONE_REGISTRY 0 +diff --git a/gcc/config/haiku.opt b/gcc/config/haiku.opt +new file mode 100644 +index 000000000..5b22f3b44 +--- /dev/null ++++ b/gcc/config/haiku.opt +@@ -0,0 +1,32 @@ ++; Haiku options. ++ ++; Copyright (C) 2010-2022 Free Software Foundation, Inc. ++; ++; This file is part of GCC. ++; ++; GCC is free software; you can redistribute it and/or modify it under ++; the terms of the GNU General Public License as published by the Free ++; Software Foundation; either version 3, or (at your option) any later ++; version. ++; ++; GCC is distributed in the hope that it will be useful, but WITHOUT ANY ++; WARRANTY; without even the implied warranty of MERCHANTABILITY or ++; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++; for more details. ++; ++; You should have received a copy of the GNU General Public License ++; along with GCC; see the file COPYING3. If not see ++; . ++ ++; See the GCC internals manual (options.texi) for a description of ++; this file's format. ++ ++; Please try to keep this file in ASCII collating order. ++ ++pthread ++Driver ++ ++rdynamic ++Driver ++ ++; This comment is to ensure we retain the blank line above. +diff --git a/gcc/config/i386/haiku.h b/gcc/config/i386/haiku.h +new file mode 100644 +index 000000000..4d43c6bbf +--- /dev/null ++++ b/gcc/config/i386/haiku.h +@@ -0,0 +1,82 @@ ++/* Definitions for Intel x86 running Haiku ++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++ ++#undef ASM_COMMENT_START ++#define ASM_COMMENT_START " #" ++ ++/* The SVR4 ABI for the i386 says that records and unions are returned ++ in memory. */ ++#undef DEFAULT_PCC_STRUCT_RETURN ++#define DEFAULT_PCC_STRUCT_RETURN 1 ++ ++#undef DBX_REGISTER_NUMBER ++#define DBX_REGISTER_NUMBER(n) \ ++ (TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n]) ++ ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__INTEL__"); \ ++ builtin_define ("_X86_"); \ ++ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ ++ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ } \ ++ while (0) ++ ++/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support ++ for the special GCC options -static and -shared, which allow us to ++ link things in one of these three modes by applying the appropriate ++ combinations of options at link-time. */ ++ ++/* If ELF is the default format, we should not use /lib/elf. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf_i386_haiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" ++ ++/* A C statement (sans semicolon) to output to the stdio stream ++ FILE the assembler definition of uninitialized global DECL named ++ NAME whose size is SIZE bytes and alignment is ALIGN bytes. ++ Try to use asm_output_aligned_bss to implement this macro. */ ++ ++#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ ++ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) ++ ++/* A C statement to output to the stdio stream FILE an assembler ++ command to advance the location counter to a multiple of 1< 8 byte \ ++ alignment is preferred. */ \ ++ if ((LOG) > 3 \ ++ && (1 << (LOG)) > ((MAX_SKIP) + 1) \ ++ && (MAX_SKIP) >= 7) \ ++ fputs ("\t.p2align 3\n", (FILE)); \ ++ } \ ++ } \ ++ } while (0) ++#undef ASM_OUTPUT_MAX_SKIP_PAD ++#define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ ++ if ((LOG) != 0) \ ++ { \ ++ if ((MAX_SKIP) == 0) \ ++ fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ ++ else \ ++ fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ ++ } ++#endif ++ ++ ++/* Output assembler code to FILE to call the profiler. */ ++#define NO_PROFILE_COUNTERS 1 ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \ ++ %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}" ++ ++#undef ASM_OUTPUT_ALIGNED_DECL_COMMON ++#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \ ++ x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN); ++ ++ ++/* i386 System V Release 4 uses DWARF debugging info. ++ x86-64 ABI specifies DWARF2. */ ++ ++#define DWARF2_DEBUGGING_INFO 1 ++#define DWARF2_UNWIND_INFO 1 ++ ++#undef PREFERRED_DEBUGGING_TYPE ++#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG ++ ++#undef TARGET_ASM_SELECT_SECTION ++#define TARGET_ASM_SELECT_SECTION x86_64_elf_select_section ++ ++#undef TARGET_ASM_UNIQUE_SECTION ++#define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section ++ ++#define USE_X86_64_FRAME_POINTER 1 +diff --git a/gcc/config/i386/t-haiku64 b/gcc/config/i386/t-haiku64 +new file mode 100644 +index 000000000..9c8f8e62e +--- /dev/null ++++ b/gcc/config/i386/t-haiku64 +@@ -0,0 +1,16 @@ ++MULTILIB_OPTIONS = m32 ++MULTILIB_DIRNAMES = 32 ++ ++LIBGCC = stmp-multilib ++INSTALL_LIBGCC = install-multilib ++ ++EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o ++ ++# The pushl in CTOR initialization interferes with frame pointer elimination. ++# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables, ++# because then __FRAME_END__ might not be the last thing in .eh_frame ++# section. ++CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables ++ ++# Compile libgcc2.a with pic. ++TARGET_LIBGCC2_CFLAGS = -fPIC +diff --git a/gcc/config/m68k/haiku.h b/gcc/config/m68k/haiku.h +new file mode 100644 +index 000000000..2b117fcb1 +--- /dev/null ++++ b/gcc/config/m68k/haiku.h +@@ -0,0 +1,266 @@ ++/* Definitions for Motorola 68k running Haiku ++ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2007 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 51 Franklin Street, Fifth Floor, ++Boston, MA 02110-1301, USA. */ ++ ++/* Default target comes from config.gcc. */ ++ ++#undef TARGET_DEFAULT ++#ifdef TARGET_CPU_DEFAULT ++#define TARGET_DEFAULT TARGET_CPU_DEFAULT ++#else ++#define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020) ++#endif ++ ++/* for 68k machines this only needs to be TRUE for the 68000 */ ++ ++#undef STRICT_ALIGNMENT ++#define STRICT_ALIGNMENT 0 ++ ++/* Here are four prefixes that are used by asm_fprintf to ++ facilitate customization for alternate assembler syntaxes. ++ Machines with no likelihood of an alternate syntax need not ++ define these and need not use asm_fprintf. */ ++ ++/* The prefix for register names. Note that REGISTER_NAMES ++ is supposed to include this prefix. Also note that this is NOT an ++ fprintf format string, it is a literal string */ ++ ++#undef REGISTER_PREFIX ++#define REGISTER_PREFIX "%" ++ ++/* The prefix for local (compiler generated) labels. ++ These labels will not appear in the symbol table. */ ++ ++#undef LOCAL_LABEL_PREFIX ++#define LOCAL_LABEL_PREFIX "." ++ ++/* The prefix to add to user-visible assembler symbols. */ ++ ++#undef USER_LABEL_PREFIX ++#define USER_LABEL_PREFIX "" ++ ++#undef ASM_COMMENT_START ++#define ASM_COMMENT_START "|" ++ ++/* Target OS builtins. */ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__M68K__"); \ ++ builtin_define_std ("mc68000"); \ ++ builtin_define_std ("mc68020"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ } \ ++ while (0) ++ ++#define TARGET_OBJFMT_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__ELF__"); \ ++ } \ ++ while (0) ++ ++#undef CPP_SPEC ++#if TARGET_DEFAULT & MASK_68881 ++#define CPP_SPEC \ ++ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{!msoft-float:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" ++#else ++#define CPP_SPEC \ ++ "%{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} %{m68881:-D__HAVE_68881__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" ++#endif ++ ++/* We override the ASM_SPEC from svr4.h because we must pass -m68040 down ++ to the assembler. */ ++#undef ASM_SPEC ++#define ASM_SPEC \ ++ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \ ++%{m68040} %{m68060:-m68040}" ++ ++/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support ++ for the special GCC options -static and -shared, which allow us to ++ link things in one of these three modes by applying the appropriate ++ combinations of options at link-time. */ ++ ++/* If ELF is the default format, we should not use /lib/elf. */ ++ ++#undef LINK_SPEC ++/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/ ++#define LINK_SPEC "-m m68kelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" ++ ++/* XXX: not sure for the rest there... */ ++ ++/* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to ++ keep switch tables in the text section. */ ++ ++#define JUMP_TABLES_IN_TEXT_SECTION 1 ++ ++/* This is how to output an assembler line that says to advance the ++ location counter to a multiple of 2**LOG bytes. */ ++ ++/* Use the default action for outputting the case label. */ ++#undef ASM_OUTPUT_CASE_LABEL ++#define ASM_RETURN_CASE_JUMP \ ++ do { \ ++ if (TARGET_COLDFIRE) \ ++ { \ ++ if (ADDRESS_REG_P (operands[0])) \ ++ return "jmp %%pc@(2,%0:l)"; \ ++ else \ ++ return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ ++ } \ ++ else \ ++ return "jmp %%pc@(2,%0:w)"; \ ++ } while (0) ++ ++#undef ASM_OUTPUT_ALIGN ++#define ASM_OUTPUT_ALIGN(FILE,LOG) \ ++ if ((LOG) > 0) \ ++ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); ++ ++/* If defined, a C expression whose value is a string containing the ++ assembler operation to identify the following data as uninitialized global ++ data. */ ++ ++#define BSS_SECTION_ASM_OP "\t.section\t.bss" ++ ++/* A C statement (sans semicolon) to output to the stdio stream ++ FILE the assembler definition of uninitialized global DECL named ++ NAME whose size is SIZE bytes and alignment is ALIGN bytes. ++ Try to use asm_output_aligned_bss to implement this macro. */ ++ ++#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ ++ asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN) ++ ++/* Output assembler code to FILE to increment profiler label # LABELNO ++ for profiling a function entry. */ ++ ++#undef FUNCTION_PROFILER ++#define FUNCTION_PROFILER(FILE, LABELNO) \ ++{ \ ++ asm_fprintf (FILE, "\tlea (%LLP%d,%Rpc),%Ra1\n", (LABELNO)); \ ++ if (flag_pic) \ ++ fprintf (FILE, "\tbsr.l _mcount@PLTPC\n"); \ ++ else \ ++ fprintf (FILE, "\tjbsr _mcount\n"); \ ++} ++ ++/* How to renumber registers for dbx and gdb. ++ On the Sun-3, the floating point registers have numbers ++ 18 to 25, not 16 to 23 as they do in the compiler. */ ++ ++#define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) ++ ++/* Do not break .stabs pseudos into continuations. */ ++ ++#define DBX_CONTIN_LENGTH 0 ++ ++/* 1 if N is a possible register number for a function value. For ++ m68k/SVR4 allow d0, a0, or fp0 as return registers, for integral, ++ pointer, or floating types, respectively. Reject fp0 if not using ++ a 68881 coprocessor. */ ++ ++#undef FUNCTION_VALUE_REGNO_P ++#define FUNCTION_VALUE_REGNO_P(N) \ ++ ((N) == 0 || (N) == 8 || (TARGET_68881 && (N) == 16)) ++ ++/* Define this to be true when FUNCTION_VALUE_REGNO_P is true for ++ more than one register. */ ++ ++#undef NEEDS_UNTYPED_CALL ++#define NEEDS_UNTYPED_CALL 1 ++ ++/* Define how to generate (in the callee) the output value of a ++ function and how to find (in the caller) the value returned by a ++ function. VALTYPE is the data type of the value (as a tree). If ++ the precise function being called is known, FUNC is its ++ FUNCTION_DECL; otherwise, FUNC is 0. For m68k/SVR4 generate the ++ result in d0, a0, or fp0 as appropriate. */ ++ ++#undef FUNCTION_VALUE ++#define FUNCTION_VALUE(VALTYPE, FUNC) \ ++ (TREE_CODE (VALTYPE) == REAL_TYPE && TARGET_68881 \ ++ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 16) \ ++ : (POINTER_TYPE_P (VALTYPE) \ ++ ? gen_rtx_REG (TYPE_MODE (VALTYPE), 8) \ ++ : gen_rtx_REG (TYPE_MODE (VALTYPE), 0))) ++ ++/* For compatibility with the large body of existing code which does ++ not always properly declare external functions returning pointer ++ types, the m68k/SVR4 convention is to copy the value returned for ++ pointer functions from a0 to d0 in the function epilogue, so that ++ callers that have neglected to properly declare the callee can ++ still find the correct return value. */ ++ ++#define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) \ ++do { \ ++ if (current_function_returns_pointer \ ++ && ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ ++ asm_fprintf (FILE, "\tmove.l %Ra0,%Rd0\n"); \ ++} while (0); ++ ++/* Define how to find the value returned by a library function ++ assuming the value has mode MODE. ++ For m68k/SVR4 look for integer values in d0, pointer values in d0 ++ (returned in both d0 and a0), and floating values in fp0. */ ++ ++#undef LIBCALL_VALUE ++#define LIBCALL_VALUE(MODE) \ ++ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode) \ ++ && TARGET_68881) \ ++ ? gen_rtx_REG ((MODE), 16) \ ++ : gen_rtx_REG ((MODE), 0)) ++ ++/* For m68k SVR4, structures are returned using the reentrant ++ technique. */ ++#undef PCC_STATIC_STRUCT_RETURN ++#define DEFAULT_PCC_STRUCT_RETURN 0 ++ ++/* Finalize the trampoline by flushing the insn cache. */ ++ ++#undef FINALIZE_TRAMPOLINE ++#define FINALIZE_TRAMPOLINE(TRAMP) \ ++ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ ++ LCT_NORMAL, VOIDmode, TRAMP, Pmode, \ ++ plus_constant (Pmode, TRAMP, TRAMPOLINE_SIZE), \ ++ Pmode); ++ ++/* Clear the instruction cache from `beg' to `end'. This makes an ++ inline system call to SYS_cacheflush. The arguments are as ++ follows: ++ ++ cacheflush (addr, scope, cache, len) ++ ++ addr - the start address for the flush ++ scope - the scope of the flush (see the cpush insn) ++ cache - which cache to flush (see the cpush insn) ++ len - a factor relating to the number of flushes to perform: ++ len/16 lines, or len/4096 pages. */ ++ ++#define CLEAR_INSN_CACHE(BEG, END) \ ++{ \ ++extern void clear_caches(void *address, int length, unsigned long flags); \ ++ void *ptr = BEG; \ ++ int len = (END - BEG + 32); \ ++ clear_caches(ptr, len, 0x0005); \ ++} +diff --git a/gcc/config/mips/haiku.h b/gcc/config/mips/haiku.h +new file mode 100644 +index 000000000..aa3dcded9 +--- /dev/null ++++ b/gcc/config/mips/haiku.h +@@ -0,0 +1,42 @@ ++/* Definitions for MIPS running Haiku ++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++ ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__MIPS__"); \ ++ builtin_define ("__MIPSEL__"); \ ++ builtin_define ("_MIPSEL_"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ if (flag_pic) \ ++ { \ ++ builtin_define ("__PIC__"); \ ++ builtin_define ("__pic__"); \ ++ } \ ++ } \ ++ while (0) ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}" ++ +diff --git a/gcc/config/riscv/haiku.h b/gcc/config/riscv/haiku.h +new file mode 100644 +index 000000000..0dfb3c544 +--- /dev/null ++++ b/gcc/config/riscv/haiku.h +@@ -0,0 +1,59 @@ ++/* Definitions for RISC-V Haiku systems with ELF format. ++ Copyright (C) 1998-2017 Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ ++ builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ } \ ++ while (0) ++ ++#define MUSL_ABI_SUFFIX \ ++ "%{mabi=ilp32:-sf}" \ ++ "%{mabi=ilp32f:-sp}" \ ++ "%{mabi=ilp32d:}" \ ++ "%{mabi=lp64:-sf}" \ ++ "%{mabi=lp64f:-sp}" \ ++ "%{mabi=lp64d:}" ++ ++#define LD_EMUL_SUFFIX \ ++ "%{mabi=lp64d:}" \ ++ "%{mabi=lp64f:_lp64f}" \ ++ "%{mabi=lp64:_lp64}" \ ++ "%{mabi=ilp32d:}" \ ++ "%{mabi=ilp32f:_ilp32f}" \ ++ "%{mabi=ilp32:_ilp32}" ++ ++#undef LIB_SPEC ++// Linux adds -latomic because RISC-V only has word-sized atomics ++// Not sure if we really need it though. ++#define LIB_SPEC " -lroot " ++ ++// riscv.h defines /lib and friends which breaks the sysroot ++#undef STARTFILE_PREFIX_SPEC ++ ++#define ICACHE_FLUSH_FUNC "__riscv_flush_icache" ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-melf" XLEN_SPEC DEFAULT_ENDIAN_SPEC "riscv" LD_EMUL_SUFFIX " %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}} -X" +diff --git a/gcc/config/riscv/t-haiku b/gcc/config/riscv/t-haiku +new file mode 100644 +index 000000000..6cccc72ae +--- /dev/null ++++ b/gcc/config/riscv/t-haiku +@@ -0,0 +1,4 @@ ++# Disable for now, only RV64 on Haiku for the moment ++# Only XLEN and ABI affect multilib dir names, e.g. /lib32/ilp32d/ ++#MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst rv64%,lib64,$(MULTILIB_DIRNAMES))) ++#MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES)) +diff --git a/gcc/config/rs6000/haiku.h b/gcc/config/rs6000/haiku.h +new file mode 100644 +index 000000000..8c2e8054b +--- /dev/null ++++ b/gcc/config/rs6000/haiku.h +@@ -0,0 +1,54 @@ ++/* Definitions for PowerPC running Haiku ++ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 2, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to ++the Free Software Foundation, 59 Temple Place - Suite 330, ++Boston, MA 02111-1307, USA. */ ++ ++ ++/* long double is 128 bits wide; the documentation claims ++ LIBGCC2_LONG_DOUBLE_TYPE_SIZE to default to LONG_DOUBLE_TYPE_SIZE, but ++ it apparently does not */ ++/*#undef LONG_DOUBLE_TYPE_SIZE ++#define LONG_DOUBLE_TYPE_SIZE 128 ++#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE ++#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128*/ ++ ++#undef TARGET_OS_CPP_BUILTINS ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ builtin_define ("__POWERPC__"); \ ++ builtin_define ("__powerpc__"); \ ++ builtin_define ("__STDC_ISO_10646__=201103L"); \ ++ builtin_assert ("system=haiku"); \ ++ builtin_assert ("cpu=powerpc"); \ ++ builtin_assert ("machine=powerpc"); \ ++ TARGET_OS_SYSV_CPP_BUILTINS (); \ ++ } \ ++ while (0) ++ ++/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support ++ for the special GCC options -static and -shared, which allow us to ++ link things in one of these three modes by applying the appropriate ++ combinations of options at link-time. */ ++ ++/* If ELF is the default format, we should not use /lib/elf. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" +diff --git a/gcc/config/sparc/haiku.h b/gcc/config/sparc/haiku.h +new file mode 100644 +index 000000000..8c81d7eb2 +--- /dev/null ++++ b/gcc/config/sparc/haiku.h +@@ -0,0 +1,93 @@ ++/* Definitions of target machine for GCC, for ELF on Haiku/sparc64. ++ Copyright (C) 2002-2017 Free Software Foundation, Inc. ++ Contributed by Matthew Green (mrg@eterna.com.au). ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING3. If not see ++. */ ++ ++#define TARGET_OS_CPP_BUILTINS() \ ++ do \ ++ { \ ++ builtin_define ("__HAIKU__"); \ ++ if (TARGET_ARCH64) \ ++ { \ ++ builtin_define ("__sparc64__"); \ ++ builtin_define ("__sparc_v9__"); \ ++ builtin_define ("__sparcv9"); \ ++ } \ ++ else \ ++ builtin_define ("__sparc"); \ ++ builtin_define ("__sparc__"); \ ++ } \ ++ while (0) ++ ++/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support ++ for the special GCC options -static and -shared, which allow us to ++ link things in one of these three modes by applying the appropriate ++ combinations of options at link-time. */ ++ ++#undef LINK_SPEC ++#define LINK_SPEC "-m elf64_sparc %{!r:-shared} %{nostart:-e 0} \ ++ %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" ++/* SIZE_TYPE and PTRDIFF_TYPE are wrong from sparc/sparc.h. */ ++#undef SIZE_TYPE ++#define SIZE_TYPE "long unsigned int" ++ ++#undef PTRDIFF_TYPE ++#define PTRDIFF_TYPE "long int" ++ ++/* This is the char to use for continuation (in case we need to turn ++ continuation back on). */ ++#undef DBX_CONTIN_CHAR ++#define DBX_CONTIN_CHAR '?' ++ ++#undef LOCAL_LABEL_PREFIX ++#define LOCAL_LABEL_PREFIX "." ++ ++/* This is how to store into the string LABEL ++ the symbol_ref name of an internal numbered label where ++ PREFIX is the class of label and NUM is the number within the class. ++ This is suitable for output with `assemble_name'. */ ++ ++#undef ASM_GENERATE_INTERNAL_LABEL ++#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ ++ sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM)) ++ ++#undef USER_LABEL_PREFIX ++#define USER_LABEL_PREFIX "" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{" FPIE_OR_FPIC_SPEC ":-K PIC} \ ++%(asm_cpu) %(asm_arch) %(asm_relax)" ++ ++#define HAVE_ENABLE_EXECUTE_STACK ++ ++#undef TARGET_DEFAULT ++#define TARGET_DEFAULT \ ++ (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \ ++ + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) ++ ++#undef SPARC_DEFAULT_CMODEL ++#define SPARC_DEFAULT_CMODEL CM_MEDANY ++ ++/* Build a compiler that supports -m32 and -m64? */ ++ ++#undef LONG_DOUBLE_TYPE_SIZE ++#define LONG_DOUBLE_TYPE_SIZE 128 ++ ++/* We use GNU ld so undefine this so that attribute((init_priority)) works. */ ++#undef CTORS_SECTION_ASM_OP ++#undef DTORS_SECTION_ASM_OP +diff --git a/gcc/config/sparc/t-haiku b/gcc/config/sparc/t-haiku +new file mode 100644 +index 000000000..a8d212dcb +--- /dev/null ++++ b/gcc/config/sparc/t-haiku +@@ -0,0 +1,5 @@ ++# Disable multilib for now, as we don't intend to support SPARC32. ++#MULTILIB_OPTIONS = m32/m64 ++#MULTILIB_DIRNAMES = 32 64 ++#MULTILIB_MATCHES = ++ +diff --git a/gcc/config/t-haiku b/gcc/config/t-haiku +new file mode 100644 +index 000000000..ba1f7f517 +--- /dev/null ++++ b/gcc/config/t-haiku +@@ -0,0 +1,9 @@ ++# There are system headers elsewhere, but these are the ones that ++# we are most likely to want to apply any fixes to. ++NATIVE_SYSTEM_HEADER_DIR = /boot/system/develop/headers ++LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/posix/limits.h ] ++ ++# Haiku-specific attributes ++haiku.o: $(srcdir)/config/haiku.c ++ $(COMPILE) $< ++ $(POSTCOMPILE) +diff --git a/gcc/configure b/gcc/configure +index c7b26d192..ec1ffad43 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -799,6 +799,7 @@ NETLIBS + EXTRA_GCC_LIBS + GNAT_LIBEXC + COLLECT2_LIBS ++build_math_library + CXXDEPMODE + DEPDIR + am__leading_dot +@@ -842,6 +843,7 @@ with_float + with_cpu + enable_multiarch + enable_multilib ++HYBRID_SECONDARY + coverage_flags + valgrind_command + valgrind_path_defines +@@ -1823,6 +1825,8 @@ Optional Packages: + pathname) + --with-gnu-as arrange to work with GNU as + --with-as arrange to use the specified as (full pathname) ++ --with-hybrid_secondary specify the packaging architecture for building a ++ secondary compiler for a Haiku hybrid system + --with-stack-clash-protection-guard-size=size + Set the default stack clash protection guard size + for specific targets as a power of two in bytes. +@@ -7815,6 +7819,17 @@ fi + # Miscenalleous configure options + # ------------------------------- + ++# handle --with-hybrid-secondary ++ ++# Check whether --with-hybrid_secondary was given. ++if test "${with_hybrid_secondary+set}" = set; then : ++ withval=$with_hybrid_secondary; HYBRID_SECONDARY=$withval ++else ++ HYBRID_SECONDARY= ++ ++fi ++ ++ + # Determine whether or not multilibs are enabled. + # Check whether --enable-multilib was given. + if test "${enable_multilib+set}" = set; then : +@@ -10059,6 +10074,15 @@ fi + # -------- + + ++# Configure -lm usage for host tools that need it ++build_math_library="-lm" ++case $build in ++ *-*-haiku*) ++ # no separate math library needed ++ build_math_library= ++ ;; ++esac ++ + # These libraries may be used by collect2. + # We may need a special search path to get them linked. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for collect2 libraries" >&5 +@@ -13011,7 +13035,7 @@ case ${enable_threads} in + # default + target_thread_file='single' + ;; +- aix | dce | lynx | mipssde | posix | rtems | \ ++ aix | dce | haiku | lynx | mipssde | posix | rtems | \ + single | tpf | vxworks | win32 | mcf) + target_thread_file=${enable_threads} + ;; +@@ -19005,8 +19029,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -22680,8 +22705,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -24949,12 +24975,12 @@ __FRAME_BEGIN__: + cat > conftest.lit < conftest.big </dev/null 2>&1; then + + # For platforms other than powerpc64*, enable as appropriate. +@@ -2762,7 +2780,7 @@ AC_SUBST(ORIGINAL_LD_FOR_TARGET) + case "$ORIGINAL_LD_FOR_TARGET" in + ./collect-ld | ./collect-ld$build_exeext) ;; + *) AC_CONFIG_FILES(collect-ld:exec-tool.in, [chmod +x collect-ld]) ;; +-esac ++esac + + AC_MSG_CHECKING(what linker to use) + if test "$gcc_cv_ld" = ../ld/ld-new$build_exeext \ +@@ -2929,7 +2947,7 @@ AC_SUBST(ORIGINAL_DSYMUTIL_FOR_TARGET) + case "$ORIGINAL_DSYMUTIL_FOR_TARGET" in + ./dsymutil | ./dsymutil$build_exeext) ;; + *) AC_CONFIG_FILES(dsymutil:exec-tool.in, [chmod +x dsymutil]) ;; +-esac ++esac + + # Figure out what assembler alignment features are present. + gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,, +@@ -3456,7 +3474,7 @@ if test $gcc_cv_as_section_exclude_e = no; then + ;; + i?86-*-solaris2* | x86_64-*-solaris2*) + conftest_s='.section foo1, #exclude' +- ;; ++ ;; + esac + ;; + esac +@@ -3757,17 +3775,17 @@ foo: .long 25 + addil LT%foo-$tls_gdidx$,gp + ldo RT%foo-$tls_gdidx$(%r1),%arg0 + b __tls_get_addr +- nop ++ nop + addil LT%foo-$tls_ldidx$,gp + b __tls_get_addr + ldo RT%foo-$tls_ldidx$(%r1),%arg0 + addil LR%foo-$tls_dtpoff$,%ret0 + ldo RR%foo-$tls_dtpoff$(%r1),%t1 +- mfctl %cr27,%t1 ++ mfctl %cr27,%t1 + addil LT%foo-$tls_ieoff$,gp + ldw RT%foo-$tls_ieoff$(%r1),%t2 +- add %t1,%t2,%t3 +- mfctl %cr27,%t1 ++ add %t1,%t2,%t3 ++ mfctl %cr27,%t1 + addil LR%foo-$tls_leoff$,%t1 + ldo RR%foo-$tls_leoff$(%r1),%t2' + tls_as_opt=--fatal-warnings +@@ -3833,7 +3851,7 @@ foo: .long 25 + case $gas_flag in + yes) tls_as_opt="$tls_as_opt --64" ;; + no) tls_as_opt="$tls_as_opt -xarch=amd64" ;; +- esac ++ esac + fi + conftest_s="$conftest_s + foo: .long 25 +@@ -4890,7 +4908,7 @@ tls_ld: + .section .text,"ax",@progbits + .globl _start + .type _start, @function +-_start: ++_start: + leal value@tlsldm(%ebx), %eax + call ___tls_get_addr@plt + +@@ -6677,7 +6695,7 @@ AC_CACHE_CHECK(linker --sysroot support, + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then + gcc_cv_ld_sysroot=yes + fi +- elif test x$gcc_cv_ld != x; then ++ elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then + gcc_cv_ld_sysroot=yes + fi +@@ -6685,7 +6703,7 @@ AC_CACHE_CHECK(linker --sysroot support, + if test x"$gcc_cv_ld_sysroot" = xyes; then + AC_DEFINE(HAVE_LD_SYSROOT, 1, + [Define if your linker supports --sysroot.]) +-fi ++fi + + case $target in + *-*-solaris2*) +@@ -7096,7 +7114,7 @@ changequote(,)dnl + # sources implementing front-end to GCC tree converters), and for + # build infrastructure purposes (Make-lang.in, etc.) + # +- # This will be (relative to $srcdir) if a line like ++ # This will be (relative to $srcdir) if a line like + # gcc_subdir="" or gcc_subdir= + # is found in /config-lang.in, and will remain + # otherwise. +@@ -7385,7 +7403,7 @@ AC_ARG_VAR(GMPINC,[How to find GMP include files]) + + AC_ARG_VAR(ISLLIBS,[How to link isl]) + AC_ARG_VAR(ISLINC,[How to find isl include files]) +-if test "x${ISLLIBS}" != "x" ; then ++if test "x${ISLLIBS}" != "x" ; then + AC_DEFINE(HAVE_isl, 1, [Define if isl is in use.]) + fi + +@@ -7684,6 +7702,6 @@ for d in $subdirs doc build common c-family + do + test -d $d || mkdir $d + done +-], ++], + [subdirs='$subdirs']) + AC_OUTPUT +diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h +index e386dbf76..3cabf4952 100644 +--- a/gcc/ginclude/stdarg.h ++++ b/gcc/ginclude/stdarg.h +@@ -98,7 +98,7 @@ typedef __gnuc_va_list va_list; + #ifndef _VA_LIST + /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ + #ifndef _VA_LIST_T_H +-/* The macro __va_list__ is used by BeOS. */ ++/* The macro __va_list__ is used by BeOS and Haiku. */ + #ifndef __va_list__ + typedef __gnuc_va_list va_list; + #endif /* not __va_list__ */ +diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h +index 12ceef391..f8a0fcf7e 100644 +--- a/gcc/ginclude/stddef.h ++++ b/gcc/ginclude/stddef.h +@@ -164,7 +164,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + /* Define this type if we are doing the whole job, + or if we want this type in particular. */ + #if defined (_STDDEF_H) || defined (__need_size_t) +-#ifndef __size_t__ /* BeOS */ ++#ifndef __size_t__ /* BeOS, Haiku */ + #ifndef __SIZE_T__ /* Cray Unicos/Mk */ + #ifndef _SIZE_T /* in case has defined it. */ + #ifndef _SYS_SIZE_T_H +@@ -182,7 +182,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #ifndef _GCC_SIZE_T + #ifndef _SIZET_ + #ifndef __size_t +-#define __size_t__ /* BeOS */ ++#define __size_t__ /* BeOS, Haiku */ + #define __SIZE_T__ /* Cray Unicos/Mk */ + #define _SIZE_T + #define _SYS_SIZE_T_H +@@ -212,7 +212,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #endif + #if !(defined (__GNUG__) && defined (size_t)) + typedef __SIZE_TYPE__ size_t; +-#ifdef __BEOS__ ++#if defined(__BEOS__) + typedef long ssize_t; + #endif /* __BEOS__ */ + #endif /* !(defined (__GNUG__) && defined (size_t)) */ +@@ -246,7 +246,7 @@ typedef long ssize_t; + /* Define this type if we are doing the whole job, + or if we want this type in particular. */ + #if defined (_STDDEF_H) || defined (__need_wchar_t) +-#ifndef __wchar_t__ /* BeOS */ ++#ifndef __wchar_t__ /* BeOS, Haiku */ + #ifndef __WCHAR_T__ /* Cray Unicos/Mk */ + #ifndef _WCHAR_T + #ifndef _T_WCHAR_ +@@ -264,7 +264,7 @@ typedef long ssize_t; + #ifndef ___int_wchar_t_h + #ifndef __INT_WCHAR_T_H + #ifndef _GCC_WCHAR_T +-#define __wchar_t__ /* BeOS */ ++#define __wchar_t__ /* BeOS, Haiku */ + #define __WCHAR_T__ /* Cray Unicos/Mk */ + #define _WCHAR_T + #define _T_WCHAR_ +diff --git a/include/filenames.h b/include/filenames.h +index 444c5cc41..7991d6abe 100644 +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -37,17 +37,21 @@ extern "C" { + # ifndef HAVE_DOS_BASED_FILE_SYSTEM + # define HAVE_DOS_BASED_FILE_SYSTEM 1 + # endif ++/* + # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM + # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 + # endif ++*/ + # define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f) + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ + # if defined(__APPLE__) ++/* + # ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM + # define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 + # endif ++*/ + # endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) +diff --git a/libatomic/configure b/libatomic/configure +index e47d2d7fb..a312f13e8 100755 +--- a/libatomic/configure ++++ b/libatomic/configure +@@ -8483,8 +8483,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- lt_prog_compiler_static= + ;; + + hpux*) +@@ -10586,8 +10584,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -11128,7 +11127,7 @@ else + lt_cv_dlopen_libs= + + case $host_os in +- beos*) ++ beos* | haiku* ) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes +@@ -14890,7 +14889,6 @@ _ACEOF + case " $config_path " in + *" posix "*) + XPCFLAGS="" +- CFLAGS="$CFLAGS -pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +@@ -14903,14 +14901,30 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); + return 0; + } + _ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ++else ++ CFLAGS="$CFLAGS -pthread" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ void *g(void *d) { return NULL; } ++int ++main () ++{ ++pthread_t t; pthread_create(&t,NULL,g,NULL); ++ ; ++ return 0; ++} ++_ACEOF + if ac_fn_c_try_link "$LINENO"; then : + XPCFLAGS=" -pthread" + else + CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +- void *g(void *d) { return NULL; } ++ void *g(void *d) { return NULL; } + int + main () + { +@@ -14927,6 +14941,9 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$save_CFLAGS $XPCFLAGS" +diff --git a/libatomic/configure.ac b/libatomic/configure.ac +index 31304685d..998ba1bf4 100644 +--- a/libatomic/configure.ac ++++ b/libatomic/configure.ac +@@ -217,21 +217,27 @@ LIBAT_WORDSIZE + case " $config_path " in + *" posix "*) + XPCFLAGS="" +- CFLAGS="$CFLAGS -pthread" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], +- [XPCFLAGS=" -pthread"], +- [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" ++ [], ++ [CFLAGS="$CFLAGS -pthread" + AC_LINK_IFELSE( +- [AC_LANG_PROGRAM( +- [#include +- void *g(void *d) { return NULL; }], +- [pthread_t t; pthread_create(&t,NULL,g,NULL);])], +- [], +- [AC_MSG_ERROR([Pthreads are required to build libatomic])])]) ++ [AC_LANG_PROGRAM( ++ [#include ++ void *g(void *d) { return NULL; }], ++ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], ++ [XPCFLAGS=" -pthread"], ++ [CFLAGS="$save_CFLAGS $XCFLAGS" LIBS="-lpthread $LIBS" ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include ++ void *g(void *d) { return NULL; }], ++ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], ++ [], ++ [AC_MSG_ERROR([Pthreads are required to build libatomic])])])]) + CFLAGS="$save_CFLAGS $XPCFLAGS" + ;; + esac +diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt +index a92ae9e83..fc746b4aa 100644 +--- a/libatomic/configure.tgt ++++ b/libatomic/configure.tgt +@@ -152,7 +152,7 @@ case "${target}" in + *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \ + | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \ + | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ +- | *-*-darwin* | *-*-aix* | *-*-cygwin*) ++ | *-*-darwin* | *-*-aix* | *-*-cygwin* | *-*-haiku*) + # POSIX system. The OS is supported. + config_path="${config_path} posix" + ;; +diff --git a/libcody/configure b/libcody/configure +index da52a5cfc..d92e55a09 100755 +--- a/libcody/configure ++++ b/libcody/configure +@@ -2496,7 +2496,7 @@ $as_echo_n "checking whether $CXX is for C++11... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-#if __cplusplus != 201103 ++#if __cplusplus < 201103 + #error "C++11 is required" + #endif + +diff --git a/libgcc/config.host b/libgcc/config.host +index b9975de90..ac7894e90 100644 +--- a/libgcc/config.host ++++ b/libgcc/config.host +@@ -103,7 +103,7 @@ arm*-*-*) + ;; + avr-*-*) + cpu_type=avr +- ;; ++ ;; + bfin*-*) + cpu_type=bfin + ;; +@@ -263,6 +263,14 @@ case ${host} in + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia" + extra_parts="crtbegin.o crtend.o" + ;; ++*-*-haiku*) ++ # This is the generic ELF configuration of Haiku. Later ++ # machine-specific sections may refine and add to this ++ # configuration. ++ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-haiku t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver" ++ tmake_file="$tmake_file t-slibgcc-libgcc t-slibgcc-nolc-override" ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ ;; + *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi) + tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" +@@ -398,6 +406,11 @@ aarch64*-*-fuchsia*) + tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp" + tmake_file="${tmake_file} t-dfprules" + ;; ++aarch64*-*-haiku*) ++ tmake_file="${tmake_file} ${cpu_type}/t-aarch64" ++ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp" ++ md_unwind_header=aarch64/haiku-unwind.h ++ ;; + aarch64*-*-linux*) + extra_parts="$extra_parts crtfastmath.o" + md_unwind_header=aarch64/linux-unwind.h +@@ -486,6 +499,12 @@ arm*-*-netbsdelf*) + ;; + esac + ;; ++arm-*-haiku*) ++ tmake_file="${tmake_file} arm/t-arm arm/t-elf arm/t-bpabi" ++ tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp" ++ tm_file="${tm_file} arm/bpabi-lib.h" ++ unwind_header=config/arm/unwind-arm.h ++ ;; + arm*-*-linux* | arm*-*-uclinuxfdpiceabi) + tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix t-crtfm" + tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc" +@@ -713,6 +732,12 @@ x86_64-*-freebsd*) + tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff" + md_unwind_header=i386/freebsd-unwind.h + ;; ++i[34567]86-*-haiku*) ++ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" ++ ;; ++x86_64-*-haiku*) ++ tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2" ++ ;; + i[34567]86-*-netbsdelf*) + tmake_file="${tmake_file} i386/t-crtstuff" + ;; +@@ -943,6 +968,8 @@ m32r-*-elf*) + m32rle-*-elf*) + tmake_file=t-fdpbit + ;; ++m68k-*-haiku*) ++ ;; + m68k-*-elf* | fido-*-elf) + tmake_file="$tmake_file m68k/t-floatlib" + ;; +@@ -1013,6 +1040,8 @@ mips*-sde-elf*) + esac + extra_parts="$extra_parts crti.o crtn.o" + ;; ++mipsel-*-haiku*) ++ ;; + mipsisa32-*-elf* | mipsisa32el-*-elf* | \ + mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ + mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \ +@@ -1171,6 +1200,8 @@ powerpc*-*-freebsd*) + ;; + esac + ;; ++powerpc-*-haiku*) ++ ;; + powerpc-*-netbsd*) + tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" + ;; +@@ -1449,6 +1480,8 @@ sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux + fi + md_unwind_header=sparc/linux-unwind.h + ;; ++sparc64-*-haiku*) ++ ;; + sparc64-*-netbsd*) + ;; + tic6x-*-uclinux) +diff --git a/libgcc/config/aarch64/haiku-unwind.h b/libgcc/config/aarch64/haiku-unwind.h +new file mode 100644 +index 000000000..3c8d33d6a +--- /dev/null ++++ b/libgcc/config/aarch64/haiku-unwind.h +@@ -0,0 +1,51 @@ ++/* DWARF2 EH unwinding support for FreeBSD/ARM64 (aarch64). ++ Copyright (C) 2017-2018 Free Software Foundation, Inc. ++ Contributed by John Marino ++ ++This file is part of GCC. ++ ++GCC is free software; you can redistribute it and/or modify ++it under the terms of the GNU General Public License as published by ++the Free Software Foundation; either version 3, or (at your option) ++any later version. ++ ++GCC is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++. */ ++ ++/* Identify a signal frame, and set the frame state data appropriately. ++ See unwind-dw2.c for the structs. */ ++ ++/* Always include AArch64 unwinder header file. */ ++#include "config/aarch64/aarch64-unwind.h" ++ ++#include ++#include ++#include ++#include ++ ++#define REG_NAME(reg) mc_gpregs.gp_## reg ++#define XREG(num) mc_gpregs.gp_x[num] ++#define DARC __LIBGCC_DWARF_ALT_FRAME_RETURN_COLUMN__ ++ ++#define MD_FALLBACK_FRAME_STATE_FOR aarch64_haiku_fallback_frame_state ++ ++static _Unwind_Reason_Code ++aarch64_haiku_fallback_frame_state ++(struct _Unwind_Context *context, _Unwind_FrameState *fs) ++{ ++ // For now just signal end of stack. Once the Haiku implementation ++ // for AArch64 is more mature we can consider writing something similar ++ // to Linux or FreeBSD support. ++ return _URC_END_OF_STACK; ++} +diff --git a/libgcc/config/t-haiku b/libgcc/config/t-haiku +new file mode 100644 +index 000000000..b4fff2d8f +--- /dev/null ++++ b/libgcc/config/t-haiku +@@ -0,0 +1,3 @@ ++# Use unwind-dw2-fde ++LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \ ++ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c +diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c +index 93ff5b81d..959f45e7f 100644 +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -108,7 +108,9 @@ call_ ## FUNC (void) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ + && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ + && defined(__GLIBC__) && __GLIBC__ >= 2 ++#ifndef __HAIKU__ + #include ++#endif + /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. + But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ + # if !defined(__UCLIBC__) \ +diff --git a/libgomp/configure b/libgomp/configure +index fd0e337b5..898722b00 100755 +--- a/libgomp/configure ++++ b/libgomp/configure +@@ -8495,8 +8495,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- lt_prog_compiler_static= + ;; + + hpux*) +@@ -10598,8 +10596,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -11140,7 +11139,7 @@ else + lt_cv_dlopen_libs= + + case $host_os in +- beos*) ++ beos* | haiku* ) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes +@@ -12389,8 +12388,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- lt_prog_compiler_static_FC= + ;; + + hpux*) +@@ -14257,8 +14254,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -14958,7 +14956,6 @@ case "$host" in + *) + # Check to see if -pthread or -lpthread is needed. Prefer the former. + # In case the pthread.h system header is not found, this test will fail. +- CFLAGS="$CFLAGS -pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +@@ -14972,9 +14969,9 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); + } + _ACEOF + if ac_fn_c_try_link "$LINENO"; then : +- XPCFLAGS=" -Wc,-pthread" ++ + else +- CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" ++ CFLAGS="$CFLAGS -pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + #include +@@ -14987,6 +14984,22 @@ pthread_t t; pthread_create(&t,NULL,g,NULL); + return 0; + } + _ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ XPCFLAGS=" -Wc,-pthread" ++else ++ CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ void *g(void *d) { return NULL; } ++int ++main () ++{ ++pthread_t t; pthread_create(&t,NULL,g,NULL); ++ ; ++ return 0; ++} ++_ACEOF + if ac_fn_c_try_link "$LINENO"; then : + + else +@@ -14995,6 +15008,9 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + esac +diff --git a/libgomp/configure.ac b/libgomp/configure.ac +index a9b1f3973..5fbf57125 100644 +--- a/libgomp/configure.ac ++++ b/libgomp/configure.ac +@@ -197,21 +197,27 @@ case "$host" in + *) + # Check to see if -pthread or -lpthread is needed. Prefer the former. + # In case the pthread.h system header is not found, this test will fail. +- CFLAGS="$CFLAGS -pthread" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], +- [XPCFLAGS=" -Wc,-pthread"], +- [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" ++ [], ++ [CFLAGS="$CFLAGS -pthread" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], +- [], +- [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) ++ [XPCFLAGS=" -Wc,-pthread"], ++ [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" ++ AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM( ++ [#include ++ void *g(void *d) { return NULL; }], ++ [pthread_t t; pthread_create(&t,NULL,g,NULL);])], ++ [], ++ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) + esac + + if test x$libgomp_use_pthreads != xno; then +diff --git a/libstdc++-v3/config/os/haiku/ctype_base.h b/libstdc++-v3/config/os/haiku/ctype_base.h +new file mode 100644 +index 000000000..86e15cb47 +--- /dev/null ++++ b/libstdc++-v3/config/os/haiku/ctype_base.h +@@ -0,0 +1,61 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 1997-2013 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++// Default information, may not be appropriate for specific host. ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ /// @brief Base class for ctype. ++ struct ctype_base ++ { ++ // Non-standard typedefs. ++ typedef const int* __to_type; ++ ++ // NB: Offsets into ctype::_M_table force a particular size ++ // on the mask type. Because of this, we don't use an enum. ++ typedef unsigned int mask; ++ static const mask upper = 1 << 0; ++ static const mask lower = 1 << 1; ++ static const mask alpha = 1 << 2; ++ static const mask digit = 1 << 3; ++ static const mask xdigit = 1 << 4; ++ static const mask space = 1 << 5; ++ static const mask print = 1 << 6; ++ static const mask graph = (1 << 2) | (1 << 3) | (1 << 9); // alnum|punct ++ static const mask cntrl = 1 << 8; ++ static const mask punct = 1 << 9; ++ static const mask alnum = (1 << 2) | (1 << 3); // alpha|digit ++#if __cplusplus >= 201103L ++ static const mask blank = 1 << 10; ++#endif ++ }; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff --git a/libstdc++-v3/config/os/haiku/ctype_configure_char.cc b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc +new file mode 100644 +index 000000000..35e6b80f0 +--- /dev/null ++++ b/libstdc++-v3/config/os/haiku/ctype_configure_char.cc +@@ -0,0 +1,99 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2011-2013 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++/** @file ctype_configure_char.cc */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++#include ++#include ++#include ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++// Information as gleaned from /usr/include/ctype.h ++ ++ const ctype_base::mask* ++ ctype::classic_table() throw() ++ { return 0; } ++ ++ ctype::ctype(__c_locale, const mask* __table, bool __del, ++ size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ ctype::ctype(const mask* __table, bool __del, size_t __refs) ++ : facet(__refs), _M_del(__table != 0 && __del), ++ _M_toupper(NULL), _M_tolower(NULL), ++ _M_table(__table ? __table : classic_table()) ++ { ++ memset(_M_widen, 0, sizeof(_M_widen)); ++ _M_widen_ok = 0; ++ memset(_M_narrow, 0, sizeof(_M_narrow)); ++ _M_narrow_ok = 0; ++ } ++ ++ char ++ ctype::do_toupper(char __c) const ++ { return ::toupper((int) __c); } ++ ++ const char* ++ ctype::do_toupper(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::toupper((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++ char ++ ctype::do_tolower(char __c) const ++ { return ::tolower((int) __c); } ++ ++ const char* ++ ctype::do_tolower(char* __low, const char* __high) const ++ { ++ while (__low < __high) ++ { ++ *__low = ::tolower((int) *__low); ++ ++__low; ++ } ++ return __high; ++ } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff --git a/libstdc++-v3/config/os/haiku/ctype_inline.h b/libstdc++-v3/config/os/haiku/ctype_inline.h +new file mode 100644 +index 000000000..5b5cc5693 +--- /dev/null ++++ b/libstdc++-v3/config/os/haiku/ctype_inline.h +@@ -0,0 +1,173 @@ ++// Locale support -*- C++ -*- ++ ++// Copyright (C) 2000-2015 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++/** @file bits/ctype_inline.h ++ * This is an internal header file, included by other library headers. ++ * Do not attempt to use it directly. @headername{locale} ++ */ ++ ++// ++// ISO C++ 14882: 22.1 Locales ++// ++ ++// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) ++// functions go in ctype.cc ++ ++// The following definitions are portable, but insanely slow. If one ++// cares at all about performance, then specialized ctype ++// functionality should be added for the native os in question: see ++// the config/os/bits/ctype_*.h files. ++ ++// Constructing a synthetic "C" table should be seriously considered... ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ bool ++ ctype:: ++ is(mask __m, char __c) const ++ { ++ if (_M_table) ++ return _M_table[static_cast(__c)] & __m; ++ else ++ { ++ bool __ret = false; ++ const size_t __bitmasksize = 15; ++ size_t __bitcur = 0; // Lowest bitmask in ctype_base == 0 ++ for (; __bitcur <= __bitmasksize; ++__bitcur) ++ { ++ const mask __bit = static_cast(1 << __bitcur); ++ if (__m & __bit) ++ { ++ bool __testis; ++ switch (__bit) ++ { ++ case space: ++ __testis = isspace(__c); ++ break; ++ case print: ++ __testis = isprint(__c); ++ break; ++ case cntrl: ++ __testis = iscntrl(__c); ++ break; ++ case upper: ++ __testis = isupper(__c); ++ break; ++ case lower: ++ __testis = islower(__c); ++ break; ++ case alpha: ++ __testis = isalpha(__c); ++ break; ++ case digit: ++ __testis = isdigit(__c); ++ break; ++ case punct: ++ __testis = ispunct(__c); ++ break; ++ case xdigit: ++ __testis = isxdigit(__c); ++ break; ++ case alnum: ++ __testis = isalnum(__c); ++ break; ++ case graph: ++ __testis = isgraph(__c); ++ break; ++#if __cplusplus >= 201103L ++ case blank: ++ __testis = isblank(__c); ++ break; ++#endif ++ default: ++ __testis = false; ++ break; ++ } ++ __ret |= __testis; ++ } ++ } ++ return __ret; ++ } ++ } ++ ++ const char* ++ ctype:: ++ is(const char* __low, const char* __high, mask* __vec) const ++ { ++ if (_M_table) ++ while (__low < __high) ++ *__vec++ = _M_table[static_cast(*__low++)]; ++ else ++ { ++ // Highest bitmask in ctype_base == 11. ++ const size_t __bitmasksize = 15; ++ for (;__low < __high; ++__vec, ++__low) ++ { ++ mask __m = 0; ++ // Lowest bitmask in ctype_base == 0 ++ size_t __i = 0; ++ for (;__i <= __bitmasksize; ++__i) ++ { ++ const mask __bit = static_cast(1 << __i); ++ if (this->is(__bit, *__low)) ++ __m |= __bit; ++ } ++ *__vec = __m; ++ } ++ } ++ return __high; ++ } ++ ++ const char* ++ ctype:: ++ scan_is(mask __m, const char* __low, const char* __high) const ++ { ++ if (_M_table) ++ while (__low < __high ++ && !(_M_table[static_cast(*__low)] & __m)) ++ ++__low; ++ else ++ while (__low < __high && !this->is(__m, *__low)) ++ ++__low; ++ return __low; ++ } ++ ++ const char* ++ ctype:: ++ scan_not(mask __m, const char* __low, const char* __high) const ++ { ++ if (_M_table) ++ while (__low < __high ++ && (_M_table[static_cast(*__low)] & __m) != 0) ++ ++__low; ++ else ++ while (__low < __high && this->is(__m, *__low) != 0) ++ ++__low; ++ return __low; ++ } ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace +diff --git a/libstdc++-v3/config/os/haiku/error_constants.h b/libstdc++-v3/config/os/haiku/error_constants.h +new file mode 100644 +index 000000000..fa6d88919 +--- /dev/null ++++ b/libstdc++-v3/config/os/haiku/error_constants.h +@@ -0,0 +1,178 @@ ++// Specific definitions for generic platforms -*- C++ -*- ++ ++// Copyright (C) 2007-2013 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++/** @file bits/error_constants.h ++ * This is an internal header file, included by other library headers. ++ * Do not attempt to use it directly. @headername{system_error} ++ */ ++ ++#ifndef _GLIBCXX_ERROR_CONSTANTS ++#define _GLIBCXX_ERROR_CONSTANTS 1 ++ ++#include ++#include ++ ++namespace std _GLIBCXX_VISIBILITY(default) ++{ ++_GLIBCXX_BEGIN_NAMESPACE_VERSION ++ ++ enum class errc ++ { ++ address_family_not_supported = EAFNOSUPPORT, ++ address_in_use = EADDRINUSE, ++ address_not_available = EADDRNOTAVAIL, ++ already_connected = EISCONN, ++ argument_list_too_long = E2BIG, ++ argument_out_of_domain = EDOM, ++ bad_address = EFAULT, ++ bad_file_descriptor = EBADF, ++ ++#ifdef _GLIBCXX_HAVE_EBADMSG ++ bad_message = EBADMSG, ++#endif ++ ++ broken_pipe = EPIPE, ++ connection_aborted = ECONNABORTED, ++ connection_already_in_progress = EALREADY, ++ connection_refused = ECONNREFUSED, ++ connection_reset = ECONNRESET, ++ cross_device_link = EXDEV, ++ destination_address_required = EDESTADDRREQ, ++ device_or_resource_busy = EBUSY, ++ directory_not_empty = ENOTEMPTY, ++ executable_format_error = ENOEXEC, ++ file_exists = EEXIST, ++ file_too_large = EFBIG, ++ filename_too_long = ENAMETOOLONG, ++ function_not_supported = ENOSYS, ++ host_unreachable = EHOSTUNREACH, ++ ++#ifdef _GLIBCXX_HAVE_EIDRM ++ identifier_removed = EIDRM, ++#endif ++ ++ illegal_byte_sequence = EILSEQ, ++ inappropriate_io_control_operation = ENOTTY, ++ interrupted = EINTR, ++ invalid_argument = EINVAL, ++ invalid_seek = ESPIPE, ++ io_error = EIO, ++ is_a_directory = EISDIR, ++ message_size = EMSGSIZE, ++ network_down = ENETDOWN, ++ network_reset = ENETRESET, ++ network_unreachable = ENETUNREACH, ++ no_buffer_space = ENOBUFS, ++ no_child_process = ECHILD, ++ ++#ifdef _GLIBCXX_HAVE_ENOLINK ++ no_link = ENOLINK, ++#endif ++ ++ no_lock_available = ENOLCK, ++ ++#ifdef _GLIBCXX_HAVE_ENODATA ++ no_message_available = ENODATA, ++#endif ++ ++ no_message = ENOMSG, ++ no_protocol_option = ENOPROTOOPT, ++ no_space_on_device = ENOSPC, ++ ++#ifdef _GLIBCXX_HAVE_ENOSR ++ no_stream_resources = ENOSR, ++#endif ++ ++ no_such_device_or_address = ENXIO, ++ no_such_device = ENODEV, ++ no_such_file_or_directory = ENOENT, ++ no_such_process = ESRCH, ++ not_a_directory = ENOTDIR, ++ not_a_socket = ENOTSOCK, ++ ++#ifdef _GLIBCXX_HAVE_ENOSTR ++ not_a_stream = ENOSTR, ++#endif ++ ++ not_connected = ENOTCONN, ++ not_enough_memory = ENOMEM, ++ ++#ifdef _GLIBCXX_HAVE_ENOTSUP ++ not_supported = ENOTSUP, ++#endif ++ ++#ifdef _GLIBCXX_HAVE_ECANCELED ++ operation_canceled = ECANCELED, ++#endif ++ ++ operation_in_progress = EINPROGRESS, ++ operation_not_permitted = EPERM, ++ operation_not_supported = EOPNOTSUPP, ++ operation_would_block = EWOULDBLOCK, ++ ++#ifdef _GLIBCXX_HAVE_EOWNERDEAD ++ owner_dead = EOWNERDEAD, ++#endif ++ ++ permission_denied = EACCES, ++ ++#ifdef _GLIBCXX_HAVE_EPROTO ++ protocol_error = EPROTO, ++#endif ++ ++ protocol_not_supported = EPROTONOSUPPORT, ++ read_only_file_system = EROFS, ++ resource_deadlock_would_occur = EDEADLK, ++ resource_unavailable_try_again = EAGAIN, ++ result_out_of_range = ERANGE, ++ ++#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE ++ state_not_recoverable = ENOTRECOVERABLE, ++#endif ++ ++#ifdef _GLIBCXX_HAVE_ETIME ++ stream_timeout = ETIME, ++#endif ++ ++#ifdef _GLIBCXX_HAVE_ETXTBSY ++ text_file_busy = ETXTBSY, ++#endif ++ ++ timed_out = ETIMEDOUT, ++ too_many_files_open_in_system = ENFILE, ++ too_many_files_open = EMFILE, ++ too_many_links = EMLINK, ++ too_many_symbolic_link_levels = ELOOP, ++ ++#ifdef _GLIBCXX_HAVE_EOVERFLOW ++ value_too_large = EOVERFLOW, ++#endif ++ ++ wrong_protocol_type = EPROTOTYPE ++ }; ++ ++_GLIBCXX_END_NAMESPACE_VERSION ++} // namespace ++ ++#endif +diff --git a/libstdc++-v3/config/os/haiku/os_defines.h b/libstdc++-v3/config/os/haiku/os_defines.h +new file mode 100644 +index 000000000..02c869321 +--- /dev/null ++++ b/libstdc++-v3/config/os/haiku/os_defines.h +@@ -0,0 +1,48 @@ ++// Specific definitions for generic platforms -*- C++ -*- ++ ++// Copyright (C) 2000-2013 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// Under Section 7 of GPL version 3, you are granted additional ++// permissions described in the GCC Runtime Library Exception, version ++// 3.1, as published by the Free Software Foundation. ++ ++// You should have received a copy of the GNU General Public License and ++// a copy of the GCC Runtime Library Exception along with this program; ++// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++// . ++ ++/** @file bits/os_defines.h ++ * This is an internal header file, included by other library headers. ++ * Do not attempt to use it directly. @headername{iosfwd} ++ */ ++ ++#ifndef _GLIBCXX_OS_DEFINES ++#define _GLIBCXX_OS_DEFINES 1 ++ ++// System-specific #define, typedefs, corrections, etc, go here. This ++// file will come before all others. ++ ++// On Haiku, nanosleep and sched_yield are always available except for the ++// kernel and the bootloader, so use them. ++#if !defined(_KERNEL_MODE) && !defined(_LOADER_MODE) ++ #define _GLIBCXX_USE_NANOSLEEP 1 ++ #define _GLIBCXX_USE_SCHED_YIELD 1 ++ #define _GLIBCXX_USE_CLOCK_MONOTONIC 1 ++ #define _GLIBCXX_USE_CLOCK_REALTIME 1 ++#endif ++ ++// See libstdc++/69506 ++#define _GLIBCXX_USE_WEAK_REF 0 ++ ++#endif +diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure +index 68ee94c9e..56fb82c40 100755 +--- a/libstdc++-v3/configure ++++ b/libstdc++-v3/configure +@@ -9237,8 +9237,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- lt_prog_compiler_static= + ;; + + hpux*) +@@ -11349,8 +11347,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -11894,7 +11893,7 @@ else + lt_cv_dlopen_libs= + + case $host_os in +- beos*) ++ beos* | haiku*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes +@@ -14136,8 +14135,6 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; } + ;; + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. +@@ -15048,8 +15045,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -47552,6 +47550,89 @@ done + + ;; + ++ *-haiku*) ++ for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \ ++ machine/endian.h machine/param.h sys/machine.h sys/types.h \ ++ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ SECTION_FLAGS='-ffunction-sections -fdata-sections' ++ ++ ++ $as_echo "#define HAVE_INT64_T 1" >>confdefs.h ++ ++ ++ $as_echo "#define HAVE_ACOSF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ASINF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ATANF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_CEILF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_COSF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_COSHF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_EXPF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FABSF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FINITE 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FINITEF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FLOORF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FMODF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_FREXPF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_HYPOT 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISINF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISINFF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISNAN 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_ISNANF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_LOGF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_LOG10F 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_MODFF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_SINF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_SINHF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_SQRTF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_TANF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_TANHF 1" >>confdefs.h ++ ++ $as_echo "#define HAVE_TLS 1" >>confdefs.h ++ ++ ;; ++ + *-fuchsia*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' + +diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host +index ec32980aa..8dbe77c66 100644 +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -267,6 +267,9 @@ case "${host_os}" in + os_include_dir="os/gnu-linux" + fi + ;; ++ haiku*) ++ os_include_dir="os/haiku" ++ ;; + hpux*) + os_include_dir="os/hpux" + ;; +@@ -354,7 +357,7 @@ case "${host}" in + ;; + esac + ;; +- arm*-*-freebsd*) ++ arm*-*-freebsd* | arm*-*-haiku*) + port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver" + ;; + powerpc*-*-darwin*) +diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 +index b3269cb88..853c51893 100644 +--- a/libstdc++-v3/crossconfig.m4 ++++ b/libstdc++-v3/crossconfig.m4 +@@ -90,7 +90,7 @@ case "${host}" in + + *-freebsd*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' +- AC_SUBST(SECTION_FLAGS) ++ AC_SUBST(SECTION_FLAGS) + GLIBCXX_CHECK_LINKER_FEATURES + AC_DEFINE(HAVE_SETENV) + AC_DEFINE(HAVE_FINITEF) +@@ -136,6 +136,46 @@ case "${host}" in + AC_CHECK_FUNCS(uselocale) + ;; + ++ *-haiku*) ++ AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ ++ machine/endian.h machine/param.h sys/machine.h sys/types.h \ ++ fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) ++ SECTION_FLAGS='-ffunction-sections -fdata-sections' ++ AC_SUBST(SECTION_FLAGS) ++ ++ AC_DEFINE(HAVE_INT64_T) ++ ++ AC_DEFINE(HAVE_ACOSF) ++ AC_DEFINE(HAVE_ASINF) ++ AC_DEFINE(HAVE_ATANF) ++ AC_DEFINE(HAVE_ATAN2F) ++ AC_DEFINE(HAVE_CEILF) ++ AC_DEFINE(HAVE_COSF) ++ AC_DEFINE(HAVE_COSHF) ++ AC_DEFINE(HAVE_EXPF) ++ AC_DEFINE(HAVE_FABSF) ++ AC_DEFINE(HAVE_FINITE) ++ AC_DEFINE(HAVE_FINITEF) ++ AC_DEFINE(HAVE_FLOORF) ++ AC_DEFINE(HAVE_FMODF) ++ AC_DEFINE(HAVE_FREXPF) ++ AC_DEFINE(HAVE_HYPOT) ++ AC_DEFINE(HAVE_HYPOTF) ++ AC_DEFINE(HAVE_ISINF) ++ AC_DEFINE(HAVE_ISINFF) ++ AC_DEFINE(HAVE_ISNAN) ++ AC_DEFINE(HAVE_ISNANF) ++ AC_DEFINE(HAVE_LOGF) ++ AC_DEFINE(HAVE_LOG10F) ++ AC_DEFINE(HAVE_MODFF) ++ AC_DEFINE(HAVE_SINF) ++ AC_DEFINE(HAVE_SINHF) ++ AC_DEFINE(HAVE_SQRTF) ++ AC_DEFINE(HAVE_TANF) ++ AC_DEFINE(HAVE_TANHF) ++ AC_DEFINE(HAVE_TLS) ++ ;; ++ + *-fuchsia*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' + AC_SUBST(SECTION_FLAGS) +@@ -221,7 +261,7 @@ case "${host}" in + ;; + *-qnx6.1* | *-qnx6.2*) + SECTION_FLAGS='-ffunction-sections -fdata-sections' +- AC_SUBST(SECTION_FLAGS) ++ AC_SUBST(SECTION_FLAGS) + GLIBCXX_CHECK_LINKER_FEATURES + AC_DEFINE(HAVE_COSF) + AC_DEFINE(HAVE_COSL) +diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc +index cac383bea..22c6c5949 100644 +--- a/libstdc++-v3/libsupc++/tinfo.cc ++++ b/libstdc++-v3/libsupc++/tinfo.cc +@@ -30,6 +30,15 @@ std::type_info:: + ~type_info () + { } + ++#ifdef __HAIKU__ ++#ifndef __GXX_MERGED_TYPEINFO_NAMES ++#define __GXX_MERGED_TYPEINFO_NAMES 0 ++#endif ++#ifndef __GXX_TYPEINFO_EQUALITY_INLINE ++#define __GXX_TYPEINFO_EQUALITY_INLINE 0 ++#endif ++#endif ++ + #if !__GXX_TYPEINFO_EQUALITY_INLINE + + #if __cplusplus > 202002L +diff --git a/libtool.m4 b/libtool.m4 +index b92e284d9..6a180a5bc 100644 +--- a/libtool.m4 ++++ b/libtool.m4 +@@ -1724,7 +1724,7 @@ else + lt_cv_dlopen_libs= + + case $host_os in +- beos*) ++ beos* | haiku*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes +@@ -2334,8 +2334,9 @@ haiku*) + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes +- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' +- hardcode_into_libs=yes ++ sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' ++ sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' ++ hardcode_into_libs=no + ;; + + hpux9* | hpux10* | hpux11*) +@@ -3647,8 +3648,6 @@ m4_if([$1], [CXX], [ + ;; + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. +@@ -3958,8 +3957,6 @@ m4_if([$1], [CXX], [ + + haiku*) + # PIC is the default for Haiku. +- # The "-static" flag exists, but is broken. +- _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) +-- +2.34.1 +