"Fossies" - the Fresh Open Source Software Archive

Member "libreoffice-6.2.3.2/configure.ac" (10 Apr 2019, 465063 Bytes) of package /linux/misc/libreoffice/src/libreoffice-6.2.3.2.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 6.2.3.1_vs_6.2.3.2.

    1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
    2 dnl configure.ac serves as input for the GNU autoconf package
    3 dnl in order to create a configure script.
    4 
    5 # The version number in the second argument to AC_INIT should be four numbers separated by
    6 # periods. Some parts of the code requires the first one to be less than 128 and the others to be less
    7 # than 256. The four numbers can optionally be followed by a period and a free-form string containing
    8 # no spaces or periods, like "frobozz-mumble-42" or "alpha0". If the free-form string ends with one or
    9 # several non-alphanumeric characters, those are split off and used only for the
   10 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
   11 
   12 AC_INIT([LibreOffice],[6.2.3.2],[],[],[http://documentfoundation.org/])
   13 
   14 AC_PREREQ([2.59])
   15 
   16 if test -n "$BUILD_TYPE"; then
   17     AC_MSG_ERROR([You have sourced config_host.mk in this shell.  This may lead to trouble, please run in a fresh (login) shell.])
   18 fi
   19 
   20 save_CC=$CC
   21 save_CXX=$CXX
   22 
   23 BUILD_TYPE="LibO"
   24 SCPDEFS=""
   25 GIT_NEEDED_SUBMODULES=""
   26 LO_PATH= # used by path_munge to construct a PATH variable
   27 
   28 FilterLibs()
   29 {
   30     filteredlibs=
   31     for f in $1; do
   32         case "$f" in
   33             # let's start with Fedora's paths for now
   34             -L/lib|-L/lib/|-L/lib64|-L/lib64/|-L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/)
   35                 # ignore it: on UNIXoids it is searched by default anyway
   36                 # but if it's given explicitly then it may override other paths
   37                 # (on Mac OS X it would be an error to use it instead of SDK)
   38                 ;;
   39             *)
   40                 filteredlibs="$filteredlibs $f"
   41                 ;;
   42         esac
   43     done
   44 }
   45 
   46 PathFormat()
   47 {
   48     formatted_path="$1"
   49     if test "$build_os" = "cygwin"; then
   50         pf_conv_to_dos=
   51         # spaces,parentheses,brackets,braces are problematic in pathname
   52         # so are backslashes
   53         case "$formatted_path" in
   54             *\ * | *\)* | *\(* | *\{* | *\}* | *\[* | *\]* | *\\* )
   55                 pf_conv_to_dos="yes"
   56             ;;
   57         esac
   58         if test "$pf_conv_to_dos" = "yes"; then
   59             if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
   60                 formatted_path=`cygpath -sm "$formatted_path"`
   61             else
   62                 formatted_path=`cygpath -d "$formatted_path"`
   63             fi
   64             if test $? -ne 0;  then
   65                 AC_MSG_ERROR([path conversion failed for "$1".])
   66             fi
   67         fi
   68         fp_count_colon=`echo "$formatted_path" | $GREP -c "[:]"`
   69         fp_count_slash=`echo "$formatted_path" | $GREP -c "[/]"`
   70         if test "$fp_count_slash$fp_count_colon" != "00"; then
   71             if test "$fp_count_colon" = "0"; then
   72                 new_formatted_path=`realpath "$formatted_path"`
   73                 if test $? -ne 0;  then
   74                     AC_MSG_WARN([realpath failed for "$1", not necessarily a problem.])
   75                 else
   76                     formatted_path="$new_formatted_path"
   77                 fi
   78             fi
   79             formatted_path=`cygpath -m "$formatted_path"`
   80             if test $? -ne 0;  then
   81                 AC_MSG_ERROR([path conversion failed for "$1".])
   82             fi
   83         fi
   84         fp_count_space=`echo "$formatted_path" | $GREP -c "[ ]"`
   85         if test "$fp_count_space" != "0"; then
   86             AC_MSG_ERROR([converted path "$formatted_path" still contains spaces. Short filenames (8.3 filenames) support was disabled on this system?])
   87         fi
   88     fi
   89 }
   90 
   91 AbsolutePath()
   92 {
   93     # There appears to be no simple and portable method to get an absolute and
   94     # canonical path, so we try creating the directory if does not exist and
   95     # utilizing the shell and pwd.
   96     rel="$1"
   97     absolute_path=""
   98     test ! -e "$rel" && mkdir -p "$rel"
   99     if test -d "$rel" ; then
  100         cd "$rel" || AC_MSG_ERROR([absolute path resolution failed for "$rel".])
  101         absolute_path="$(pwd)"
  102         cd - > /dev/null
  103     else
  104         AC_MSG_ERROR([Failed to resolve absolute path.  "$rel" does not exist or is not a directory.])
  105     fi
  106 }
  107 
  108 rm -f warn
  109 have_WARNINGS="no"
  110 add_warning()
  111 {
  112     if test "$have_WARNINGS" = "no"; then
  113         echo "*************************************" > warn
  114         have_WARNINGS="yes"
  115         if which tput >/dev/null && test "`tput colors 2>/dev/null || echo 0`" -ge 8; then
  116             dnl <esc> as actual byte (U+1b), [ escaped using quadrigraph @<:@
  117             COLORWARN='*@<:@1;33;40m WARNING @<:@0m:'
  118         else
  119             COLORWARN="* WARNING :"
  120         fi
  121     fi
  122     echo "$COLORWARN $@" >> warn
  123 }
  124 
  125 dnl Some Mac User have the bad habbit of letting a lot fo crap
  126 dnl accumulate in their PATH and even adding stuff in /usr/local/bin
  127 dnl that confuse the build.
  128 dnl For the ones that use LODE, let's be nice and protect them
  129 dnl from themselves
  130 
  131 mac_sanitize_path()
  132 {
  133     mac_path="$LODE_HOME/opt/bin:/usr/bin:/bin:/usr/sbin:/sbin"
  134 dnl a common but nevertheless necessary thing that may be in a fancy
  135 dnl path location is git, so make sure we have it
  136     mac_git_path=`which git 2>/dev/null`
  137     if test -n "$mac_git_path" -a -x "$mac_git_path" -a "$mac_git_path" != "/usr/bin/git" ; then
  138         mac_path="$mac_path:`dirname $mac_git_path`"
  139     fi
  140 dnl a not so common but nevertheless quite helpful thing that may be in a fancy
  141 dnl path location is gpg, so make sure we find it
  142     mac_gpg_path=`which gpg 2>/dev/null`
  143     if test -n "$mac_gpg_path" -a -x "$mac_gpg_path" -a "$mac_gpg_path" != "/usr/bin/gpg" ; then
  144         mac_path="$mac_path:`dirname $mac_gpg_path`"
  145     fi
  146     PATH="$mac_path"
  147     unset mac_path
  148     unset mac_git_path
  149     unset mac_gpg_path
  150 }
  151 
  152 echo "********************************************************************"
  153 echo "*"
  154 echo "*   Running ${PACKAGE_NAME} build configuration."
  155 echo "*"
  156 echo "********************************************************************"
  157 echo ""
  158 
  159 dnl ===================================================================
  160 dnl checks build and host OSes
  161 dnl do this before argument processing to allow for platform dependent defaults
  162 dnl ===================================================================
  163 AC_CANONICAL_HOST
  164 
  165 AC_MSG_CHECKING([for product name])
  166 PRODUCTNAME="AC_PACKAGE_NAME"
  167 if test -n "$with_product_name" -a "$with_product_name" != no; then
  168     PRODUCTNAME="$with_product_name"
  169 fi
  170 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
  171     PRODUCTNAME="${PRODUCTNAME}Dev"
  172 fi
  173 AC_MSG_RESULT([$PRODUCTNAME])
  174 AC_SUBST(PRODUCTNAME)
  175 PRODUCTNAME_WITHOUT_SPACES=$(printf %s "$PRODUCTNAME" | sed 's/ //g')
  176 AC_SUBST(PRODUCTNAME_WITHOUT_SPACES)
  177 
  178 dnl ===================================================================
  179 dnl Our version is defined by the AC_INIT() at the top of this script.
  180 dnl ===================================================================
  181 
  182 AC_MSG_CHECKING([for package version])
  183 if test -n "$with_package_version" -a "$with_package_version" != no; then
  184     PACKAGE_VERSION="$with_package_version"
  185 fi
  186 AC_MSG_RESULT([$PACKAGE_VERSION])
  187 
  188 set `echo "$PACKAGE_VERSION" | sed "s/\./ /g"`
  189 
  190 LIBO_VERSION_MAJOR=$1
  191 LIBO_VERSION_MINOR=$2
  192 LIBO_VERSION_MICRO=$3
  193 LIBO_VERSION_PATCH=$4
  194 
  195 # The CFBundleShortVersionString in Info.plist consists of three integers, so encode the third
  196 # as the micro version times 1000 plus the patch number. Unfortunately the LIBO_VERSION_SUFFIX can be anything so
  197 # no way to encode that into an integer in general.
  198 MACOSX_BUNDLE_SHORTVERSION=$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR.`expr $LIBO_VERSION_MICRO '*' 1000 + $LIBO_VERSION_PATCH`
  199 
  200 LIBO_VERSION_SUFFIX=$5
  201 # Split out LIBO_VERSION_SUFFIX_SUFFIX... horrible crack. But apparently wanted separately in
  202 # openoffice.lst as ABOUTBOXPRODUCTVERSIONSUFFIX. Note that the double brackets are for m4's sake,
  203 # they get undoubled before actually passed to sed.
  204 LIBO_VERSION_SUFFIX_SUFFIX=`echo "$LIBO_VERSION_SUFFIX" | sed -e 's/.*[[a-zA-Z0-9]]\([[^a-zA-Z0-9]]*\)$/\1/'`
  205 test -n "$LIBO_VERSION_SUFFIX_SUFFIX" && LIBO_VERSION_SUFFIX="${LIBO_VERSION_SUFFIX%${LIBO_VERSION_SUFFIX_SUFFIX}}"
  206 # LIBO_VERSION_SUFFIX, if non-empty, should include the period separator
  207 test -n "$LIBO_VERSION_SUFFIX" && LIBO_VERSION_SUFFIX=".$LIBO_VERSION_SUFFIX"
  208 
  209 AC_SUBST(LIBO_VERSION_MAJOR)
  210 AC_SUBST(LIBO_VERSION_MINOR)
  211 AC_SUBST(LIBO_VERSION_MICRO)
  212 AC_SUBST(LIBO_VERSION_PATCH)
  213 AC_SUBST(MACOSX_BUNDLE_SHORTVERSION)
  214 AC_SUBST(LIBO_VERSION_SUFFIX)
  215 AC_SUBST(LIBO_VERSION_SUFFIX_SUFFIX)
  216 
  217 AC_DEFINE_UNQUOTED(LIBO_VERSION_MAJOR,$LIBO_VERSION_MAJOR)
  218 AC_DEFINE_UNQUOTED(LIBO_VERSION_MINOR,$LIBO_VERSION_MINOR)
  219 AC_DEFINE_UNQUOTED(LIBO_VERSION_MICRO,$LIBO_VERSION_MICRO)
  220 AC_DEFINE_UNQUOTED(LIBO_VERSION_PATCH,$LIBO_VERSION_PATCH)
  221 
  222 LIBO_THIS_YEAR=`date +%Y`
  223 AC_DEFINE_UNQUOTED(LIBO_THIS_YEAR,$LIBO_THIS_YEAR)
  224 
  225 dnl ===================================================================
  226 dnl Product version
  227 dnl ===================================================================
  228 AC_MSG_CHECKING([for product version])
  229 PRODUCTVERSION="$LIBO_VERSION_MAJOR.$LIBO_VERSION_MINOR"
  230 AC_MSG_RESULT([$PRODUCTVERSION])
  231 AC_SUBST(PRODUCTVERSION)
  232 
  233 AC_PROG_EGREP
  234 # AC_PROG_EGREP doesn't set GREP on all systems as well
  235 AC_PATH_PROG(GREP, grep)
  236 
  237 BUILDDIR=`pwd`
  238 cd $srcdir
  239 SRC_ROOT=`pwd`
  240 cd $BUILDDIR
  241 x_Cygwin=[\#]
  242 
  243 dnl ======================================
  244 dnl Required GObject introspection version
  245 dnl ======================================
  246 INTROSPECTION_REQUIRED_VERSION=1.32.0
  247 
  248 dnl ===================================================================
  249 dnl Search all the common names for GNU Make
  250 dnl ===================================================================
  251 AC_MSG_CHECKING([for GNU Make])
  252 
  253 # try to use our own make if it is available and GNUMAKE was not already defined
  254 if test -z "$GNUMAKE"; then
  255     if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/make" ; then
  256         GNUMAKE="$LODE_HOME/opt/bin/make"
  257     elif test -x "/opt/lo/bin/make"; then
  258         GNUMAKE="/opt/lo/bin/make"
  259     fi
  260 fi
  261 
  262 GNUMAKE_WIN_NATIVE=
  263 for a in "$MAKE" "$GNUMAKE" make gmake gnumake; do
  264     if test -n "$a"; then
  265         $a --version 2> /dev/null | grep GNU  2>&1 > /dev/null
  266         if test $? -eq 0;  then
  267             if test "$build_os" = "cygwin"; then
  268                 if test -n "$($a -v | grep 'Built for Windows')" ; then
  269                     GNUMAKE="$(cygpath -m "$(which "$(cygpath -u $a)")")"
  270                     GNUMAKE_WIN_NATIVE="TRUE"
  271                 else
  272                     GNUMAKE=`which $a`
  273                 fi
  274             else
  275                 GNUMAKE=`which $a`
  276             fi
  277             break
  278         fi
  279     fi
  280 done
  281 AC_MSG_RESULT($GNUMAKE)
  282 if test -z "$GNUMAKE"; then
  283     AC_MSG_ERROR([not found. install GNU Make.])
  284 else
  285     if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
  286         AC_MSG_NOTICE([Using a native Win32 GNU Make version.])
  287     fi
  288 fi
  289 
  290 win_short_path_for_make()
  291 {
  292     local_short_path="$1"
  293     if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
  294         cygpath -sm "$local_short_path"
  295     else
  296         cygpath -u "$(cygpath -d "$local_short_path")"
  297     fi
  298 }
  299 
  300 
  301 if test "$build_os" = "cygwin"; then
  302     PathFormat "$SRC_ROOT"
  303     SRC_ROOT="$formatted_path"
  304     PathFormat "$BUILDDIR"
  305     BUILDDIR="$formatted_path"
  306     x_Cygwin=
  307     AC_MSG_CHECKING(for explicit COMSPEC)
  308     if test -z "$COMSPEC"; then
  309         AC_MSG_ERROR([COMSPEC not set in environment, please set it and rerun])
  310     else
  311         AC_MSG_RESULT([found: $COMSPEC])
  312     fi
  313 fi
  314 
  315 AC_SUBST(SRC_ROOT)
  316 AC_SUBST(BUILDDIR)
  317 AC_SUBST(x_Cygwin)
  318 AC_DEFINE_UNQUOTED(SRCDIR,"$SRC_ROOT")
  319 AC_DEFINE_UNQUOTED(BUILDDIR,"$BUILDDIR")
  320 
  321 if test "z$EUID" = "z0" -a "`uname -o 2>/dev/null`" = "Cygwin"; then
  322     AC_MSG_ERROR([You must build LibreOffice as a normal user - not using an administrative account])
  323 fi
  324 
  325 # need sed in os checks...
  326 AC_PATH_PROGS(SED, sed)
  327 if test -z "$SED"; then
  328     AC_MSG_ERROR([install sed to run this script])
  329 fi
  330 
  331 # Set the ENABLE_LTO variable
  332 # ===================================================================
  333 AC_MSG_CHECKING([whether to use link-time optimization])
  334 if test -n "$enable_lto" -a "$enable_lto" != "no"; then
  335     ENABLE_LTO="TRUE"
  336     AC_MSG_RESULT([yes])
  337     AC_DEFINE(STATIC_LINKING)
  338 else
  339     ENABLE_LTO=""
  340     AC_MSG_RESULT([no])
  341 fi
  342 AC_SUBST(ENABLE_LTO)
  343 
  344 AC_ARG_ENABLE(fuzz-options,
  345     AS_HELP_STRING([--enable-fuzz-options],
  346         [Randomly enable or disable each of those configurable options
  347          that are supposed to be freely selectable without interdependencies,
  348          or where bad interaction from interdependencies is automatically avoided.])
  349 )
  350 
  351 dnl ===================================================================
  352 dnl When building for Android, --with-android-ndk,
  353 dnl --with-android-ndk-toolchain-version and --with-android-sdk are
  354 dnl mandatory
  355 dnl ===================================================================
  356 
  357 AC_ARG_WITH(android-ndk,
  358     AS_HELP_STRING([--with-android-ndk],
  359         [Specify location of the Android Native Development Kit. Mandatory when building for Android.]),
  360 ,)
  361 
  362 AC_ARG_WITH(android-ndk-toolchain-version,
  363     AS_HELP_STRING([--with-android-ndk-toolchain-version],
  364         [Specify which toolchain version to use, of those present in the
  365         Android NDK you are using. The default (and only supported version currently) is "clang5.0"]),,
  366         with_android_ndk_toolchain_version=clang5.0)
  367 
  368 AC_ARG_WITH(android-sdk,
  369     AS_HELP_STRING([--with-android-sdk],
  370         [Specify location of the Android SDK. Mandatory when building for Android.]),
  371 ,)
  372 
  373 ANDROID_NDK_HOME=
  374 if test -z "$with_android_ndk" -a -e "$SRC_ROOT/external/android-ndk" -a "$build" != "$host"; then
  375     with_android_ndk="$SRC_ROOT/external/android-ndk"
  376 fi
  377 if test -n "$with_android_ndk"; then
  378     ANDROID_NDK_HOME=$with_android_ndk
  379 
  380     # Set up a lot of pre-canned defaults
  381 
  382     if test ! -f $ANDROID_NDK_HOME/RELEASE.TXT; then
  383         if test ! -f $ANDROID_NDK_HOME/source.properties; then
  384             AC_MSG_ERROR([Unrecognized Android NDK. Missing RELEASE.TXT or source.properties file in $ANDROID_NDK_HOME.])
  385         fi
  386         ANDROID_NDK_VERSION=`sed -n -e 's/Pkg.Revision = //p' $ANDROID_NDK_HOME/source.properties`
  387     else
  388         ANDROID_NDK_VERSION=`cut -f1 -d' ' <$ANDROID_NDK_HOME/RELEASE.TXT`
  389     fi
  390     if test -z "$ANDROID_NDK_VERSION";  then
  391         AC_MSG_ERROR([Failed to determine Android NDK version. Please check your installation.])
  392     fi
  393     case $ANDROID_NDK_VERSION in
  394     r9*|r10*)
  395         AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x*])
  396         ;;
  397     11.1.*|12.1.*|13.1.*|14.1.*)
  398         AC_MSG_ERROR([Building for Android is only supported with NDK versions above 16.x.*])
  399         ;;
  400     16.*)
  401         ;;
  402     *)
  403         AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk.])
  404         add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only version 16.* have been used successfully. Proceed at your own risk."
  405         ;;
  406     esac
  407 
  408     ANDROID_API_LEVEL=14
  409     android_cpu=$host_cpu
  410     ANDROID_ARCH=$android_cpu
  411     if test $host_cpu = arm; then
  412         android_platform_prefix=$android_cpu-linux-androideabi
  413         android_gnu_prefix=$android_platform_prefix
  414         LLVM_TRIPLE=armv7-none-linux-androideabi
  415         ANDROID_APP_ABI=armeabi-v7a
  416         ANDROIDCFLAGS="-mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -Wl,--fix-cortex-a8"
  417     elif test $host_cpu = aarch64; then
  418         android_platform_prefix=$android_cpu-linux-android
  419         android_gnu_prefix=$android_platform_prefix
  420         LLVM_TRIPLE=aarch64-none-linux-android
  421         # minimum android version that supports aarch64
  422         ANDROID_API_LEVEL=21
  423         ANDROID_APP_ABI=arm64-v8a
  424         ANDROID_ARCH=arm64
  425     elif test $host_cpu = mips; then
  426         android_platform_prefix=mipsel-linux-android
  427         android_gnu_prefix=$android_platform_prefix
  428         LLVM_TRIPLE=mipsel-none-linux-android
  429         ANDROID_APP_ABI=mips
  430     else
  431         # host_cpu is something like "i386" or "i686" I guess, NDK uses
  432         # "x86" in some contexts
  433         android_cpu=x86
  434         android_platform_prefix=$android_cpu
  435         android_gnu_prefix=i686-linux-android
  436         LLVM_TRIPLE=i686-none-linux-android
  437         ANDROID_APP_ABI=x86
  438         ANDROID_ARCH=$android_cpu
  439         ANDROIDCFLAGS="-march=atom"
  440     fi
  441 
  442     case "$with_android_ndk_toolchain_version" in
  443     clang5.0)
  444         ANDROID_GCC_TOOLCHAIN_VERSION=4.9
  445         ANDROID_BINUTILS_DIR=$ANDROID_NDK_HOME/toolchains/$android_platform_prefix-$ANDROID_GCC_TOOLCHAIN_VERSION
  446         ANDROID_COMPILER_DIR=$ANDROID_NDK_HOME/toolchains/llvm
  447         ;;
  448     *)
  449         AC_MSG_ERROR([Unrecognized value for the --with-android-ndk-toolchain-version option. Building for Android is only supported with Clang 5.*])
  450     esac
  451 
  452     if test ! -d $ANDROID_BINUTILS_DIR; then
  453         AC_MSG_ERROR([No directory $ANDROID_BINUTILS_DIR])
  454     elif test ! -d $ANDROID_COMPILER_DIR; then
  455         AC_MSG_ERROR([No directory $ANDROID_COMPILER_DIR])
  456     fi
  457 
  458     # NDK 15 or later toolchain is 64bit-only, except for Windows that we don't support. Using a 64-bit
  459     # linker is required if you compile large parts of the code with -g. A 32-bit linker just won't
  460     # manage to link the (app-specific) single huge .so that is built for the app in
  461     # android/source/ if there is debug information in a significant part of the object files.
  462     # (A 64-bit ld.gold grows to much over 10 gigabytes of virtual space when linking such a .so if
  463     # all objects have been built with debug information.)
  464     case $build_os in
  465     linux-gnu*)
  466         ndk_build_os=linux
  467         ;;
  468     darwin*)
  469         ndk_build_os=darwin
  470         ;;
  471     *)
  472         AC_MSG_ERROR([We only support building for Android from Linux or OS X])
  473         ;;
  474     esac
  475     ANDROID_COMPILER_BIN=$ANDROID_COMPILER_DIR/prebuilt/$ndk_build_os-x86_64/bin
  476     ANDROID_BINUTILS_PREBUILT_ROOT=$ANDROID_BINUTILS_DIR/prebuilt/$ndk_build_os-x86_64
  477     AC_SUBST(ANDROID_BINUTILS_PREBUILT_ROOT)
  478 
  479     test -z "$SYSBASE" && SYSBASE=$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}
  480     test -z "$AR" && AR=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ar
  481     test -z "$NM" && NM=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-nm
  482     test -z "$OBJDUMP" && OBJDUMP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-objdump
  483     test -z "$RANLIB" && RANLIB=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-ranlib
  484     test -z "$STRIP" && STRIP=$ANDROID_BINUTILS_PREBUILT_ROOT/bin/$android_gnu_prefix-strip
  485 
  486     ANDROIDCFLAGS="$ANDROIDCFLAGS -gcc-toolchain $ANDROID_BINUTILS_PREBUILT_ROOT -target $LLVM_TRIPLE$ANDROID_API_LEVEL -no-canonical-prefixes"
  487     # android is using different sysroots for compilation and linking, but as
  488     # there is no full separation in configure and elsewhere, use isystem for
  489     # compilation stuff and sysroot for linking
  490     ANDROIDCFLAGS="$ANDROIDCFLAGS -D__ANDROID_API__=$ANDROID_API_LEVEL -isystem $ANDROID_NDK_HOME/sysroot/usr/include"
  491     ANDROIDCFLAGS="$ANDROIDCFLAGS -isystem $ANDROID_NDK_HOME/sysroot/usr/include/$android_gnu_prefix"
  492     ANDROIDCFLAGS="$ANDROIDCFLAGS --sysroot=$SYSBASE -ffunction-sections -fdata-sections -Qunused-arguments"
  493     if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
  494     ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI -D_GTHREAD_USE_MUTEX_INIT_FUNC=1"
  495     else
  496     ANDROIDCFLAGS="$ANDROIDCFLAGS -L$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/$ANDROID_APP_ABI"
  497     fi
  498     if test "$ENABLE_LTO" = TRUE; then
  499         # -flto comes from com_GCC_defs.mk, too, but we need to make sure it gets passed as part of
  500         # $CC and $CXX when building external libraries
  501         ANDROIDCFLAGS="$ANDROIDCFLAGS -flto -fuse-linker-plugin -O2"
  502     fi
  503 
  504     if test "$ANDROID_APP_ABI" = "armeabi-v7a"; then
  505     ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/include -I$ANDROID_NDK_HOME/sources/cxx-stl/gnu-libstdc++/4.9/libs/$ANDROID_APP_ABI/include -std=c++11"
  506     else
  507     ANDROIDCXXFLAGS="$ANDROIDCFLAGS -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/include -I$ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++abi/include -I$ANDROID_NDK_HOME/sources/android/support/include -std=c++11"
  508     fi
  509 
  510     if test -z "$CC"; then
  511         CC="$ANDROID_COMPILER_BIN/clang $ANDROIDCFLAGS"
  512     fi
  513     if test -z "$CXX"; then
  514         CXX="$ANDROID_COMPILER_BIN/clang++ $ANDROIDCXXFLAGS"
  515     fi
  516 
  517     # remember to download the ownCloud Android library later
  518     BUILD_TYPE="$BUILD_TYPE OWNCLOUD_ANDROID_LIB"
  519 fi
  520 AC_SUBST(ANDROID_NDK_HOME)
  521 AC_SUBST(ANDROID_APP_ABI)
  522 AC_SUBST(ANDROID_GCC_TOOLCHAIN_VERSION)
  523 
  524 dnl ===================================================================
  525 dnl --with-android-sdk
  526 dnl ===================================================================
  527 ANDROID_SDK_HOME=
  528 if test -z "$with_android_sdk" -a -e "$SRC_ROOT/external/android-sdk-linux" -a "$build" != "$host"; then
  529     with_android_sdk="$SRC_ROOT/external/android-sdk-linux"
  530 fi
  531 if test -n "$with_android_sdk"; then
  532     ANDROID_SDK_HOME=$with_android_sdk
  533     PATH="$ANDROID_SDK_HOME/platform-tools:$ANDROID_SDK_HOME/tools:$PATH"
  534 fi
  535 AC_SUBST(ANDROID_SDK_HOME)
  536 
  537 dnl ===================================================================
  538 dnl The following is a list of supported systems.
  539 dnl Sequential to keep the logic very simple
  540 dnl These values may be checked and reset later.
  541 dnl ===================================================================
  542 #defaults unless the os test overrides this:
  543 test_randr=yes
  544 test_xrender=yes
  545 test_cups=yes
  546 test_dbus=yes
  547 test_fontconfig=yes
  548 test_cairo=no
  549 
  550 # Default values, as such probably valid just for Linux, set
  551 # differently below just for Mac OSX,but at least better than
  552 # hardcoding these as we used to do. Much of this is duplicated also
  553 # in solenv for old build system and for gbuild, ideally we should
  554 # perhaps define stuff like this only here in configure.ac?
  555 
  556 LINKFLAGSSHL="-shared"
  557 PICSWITCH="-fpic"
  558 DLLPOST=".so"
  559 
  560 LINKFLAGSNOUNDEFS="-Wl,-z,defs"
  561 
  562 INSTROOTBASESUFFIX=
  563 INSTROOTCONTENTSUFFIX=
  564 SDKDIRNAME=sdk
  565 
  566 case "$host_os" in
  567 
  568 solaris*)
  569     test_gtk=yes
  570     build_gstreamer_1_0=yes
  571     build_gstreamer_0_10=yes
  572     test_freetype=yes
  573     _os=SunOS
  574 
  575     dnl ===========================================================
  576     dnl Check whether we're using Solaris 10 - SPARC or Intel.
  577     dnl ===========================================================
  578     AC_MSG_CHECKING([the Solaris operating system release])
  579     _os_release=`echo $host_os | $SED -e s/solaris2\.//`
  580     if test "$_os_release" -lt "10"; then
  581         AC_MSG_ERROR([use Solaris >= 10 to build LibreOffice])
  582     else
  583         AC_MSG_RESULT([ok ($_os_release)])
  584     fi
  585 
  586     dnl Check whether we're using a SPARC or i386 processor
  587     AC_MSG_CHECKING([the processor type])
  588     if test "$host_cpu" = "sparc" -o "$host_cpu" = "i386"; then
  589         AC_MSG_RESULT([ok ($host_cpu)])
  590     else
  591         AC_MSG_ERROR([only SPARC and i386 processors are supported])
  592     fi
  593     ;;
  594 
  595 linux-gnu*|k*bsd*-gnu*)
  596     test_gtk=yes
  597     build_gstreamer_1_0=yes
  598     build_gstreamer_0_10=yes
  599     test_kde4=yes
  600     test_kde5=yes
  601     test_gtk3_kde5=yes
  602     if test "$enable_fuzzers" != yes; then
  603         test_freetype=yes
  604         test_fontconfig=yes
  605     else
  606         test_freetype=no
  607         test_fontconfig=no
  608         BUILD_TYPE="$BUILD_TYPE FONTCONFIG FREETYPE"
  609     fi
  610     _os=Linux
  611     ;;
  612 
  613 gnu)
  614     test_randr=no
  615     test_xrender=no
  616     _os=GNU
  617      ;;
  618 
  619 cygwin*|interix*)
  620 
  621     # When building on Windows normally with MSVC under Cygwin,
  622     # configure thinks that the host platform (the platform the
  623     # built code will run on) is Cygwin, even if it obviously is
  624     # Windows, which in Autoconf terminology is called
  625     # "mingw32". (Which is misleading as MinGW is the name of the
  626     # tool-chain, not an operating system.)
  627 
  628     # Somewhat confusing, yes. But this configure script doesn't
  629     # look at $host etc that much, it mostly uses its own $_os
  630     # variable, set here in this case statement.
  631 
  632     test_cups=no
  633     test_dbus=no
  634     test_randr=no
  635     test_xrender=no
  636     test_freetype=no
  637     test_fontconfig=no
  638     _os=WINNT
  639 
  640     DLLPOST=".dll"
  641     LINKFLAGSNOUNDEFS=
  642     ;;
  643 
  644 darwin*) # Mac OS X or iOS
  645     test_gtk=yes
  646     test_randr=no
  647     test_xrender=no
  648     test_freetype=no
  649     test_fontconfig=no
  650     test_dbus=no
  651     if test -n "$LODE_HOME" ; then
  652         mac_sanitize_path
  653         AC_MSG_NOTICE([sanitized the PATH to $PATH])
  654     fi
  655     if test "$host_cpu" = "arm64" -o "$enable_ios_simulator" = "yes"; then
  656         build_for_ios=YES
  657         _os=iOS
  658         test_gtk=no
  659         test_cups=no
  660         enable_mpl_subset=yes
  661         enable_lotuswordpro=no
  662         enable_coinmp=no
  663         enable_lpsolve=no
  664         enable_postgresql_sdbc=no
  665         enable_extension_integration=no
  666         enable_report_builder=no
  667         with_ppds=no
  668         if test "$enable_ios_simulator" = "yes"; then
  669             host=x86_64-apple-darwin
  670         fi
  671     else
  672         _os=Darwin
  673         INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
  674         INSTROOTCONTENTSUFFIX=/Contents
  675         SDKDIRNAME=AC_PACKAGE_NAME${PRODUCTVERSION}_SDK
  676     fi
  677     # See comment above the case "$host_os"
  678     LINKFLAGSSHL="-dynamiclib -single_module"
  679 
  680     # -fPIC is default
  681     PICSWITCH=""
  682 
  683     DLLPOST=".dylib"
  684 
  685     # -undefined error is the default
  686     LINKFLAGSNOUNDEFS=""
  687 ;;
  688 
  689 freebsd*)
  690     test_gtk=yes
  691     build_gstreamer_1_0=yes
  692     build_gstreamer_0_10=yes
  693     test_kde4=yes
  694     test_kde5=yes
  695     test_gtk3_kde5=yes
  696     test_freetype=yes
  697     AC_MSG_CHECKING([the FreeBSD operating system release])
  698     if test -n "$with_os_version"; then
  699         OSVERSION="$with_os_version"
  700     else
  701         OSVERSION=`/sbin/sysctl -n kern.osreldate`
  702     fi
  703     AC_MSG_RESULT([found OSVERSION=$OSVERSION])
  704     AC_MSG_CHECKING([which thread library to use])
  705     if test "$OSVERSION" -lt "500016"; then
  706         PTHREAD_CFLAGS="-D_THREAD_SAFE"
  707         PTHREAD_LIBS="-pthread"
  708     elif test "$OSVERSION" -lt "502102"; then
  709         PTHREAD_CFLAGS="-D_THREAD_SAFE"
  710         PTHREAD_LIBS="-lc_r"
  711     else
  712         PTHREAD_CFLAGS=""
  713         PTHREAD_LIBS="-pthread"
  714     fi
  715     AC_MSG_RESULT([$PTHREAD_LIBS])
  716     _os=FreeBSD
  717     ;;
  718 
  719 *netbsd*)
  720     test_gtk=yes
  721     build_gstreamer_1_0=yes
  722     build_gstreamer_0_10=yes
  723     test_kde4=yes
  724     test_kde5=yes
  725     test_gtk3_kde5=yes
  726     test_freetype=yes
  727     PTHREAD_LIBS="-pthread -lpthread"
  728     _os=NetBSD
  729     ;;
  730 
  731 aix*)
  732     test_randr=no
  733     test_freetype=yes
  734     PTHREAD_LIBS=-pthread
  735     _os=AIX
  736     ;;
  737 
  738 openbsd*)
  739     test_gtk=yes
  740     test_freetype=yes
  741     PTHREAD_CFLAGS="-D_THREAD_SAFE"
  742     PTHREAD_LIBS="-pthread"
  743     _os=OpenBSD
  744     ;;
  745 
  746 dragonfly*)
  747     test_gtk=yes
  748     build_gstreamer_1_0=yes
  749     build_gstreamer_0_10=yes
  750     test_kde4=yes
  751     test_kde5=yes
  752     test_gtk3_kde5=yes
  753     test_freetype=yes
  754     PTHREAD_LIBS="-pthread"
  755     _os=DragonFly
  756     ;;
  757 
  758 linux-android*)
  759     build_gstreamer_1_0=no
  760     build_gstreamer_0_10=no
  761     enable_lotuswordpro=no
  762     enable_mpl_subset=yes
  763     enable_coinmp=yes
  764     enable_lpsolve=no
  765     enable_report_builder=no
  766     enable_odk=no
  767     enable_postgresql_sdbc=no
  768     enable_python=no
  769     with_theme="tango"
  770     test_cups=no
  771     test_dbus=no
  772     test_fontconfig=no
  773     test_freetype=no
  774     test_gtk=no
  775     test_kde4=no
  776     test_kde5=no
  777     test_gtk3_kde5=no
  778     test_randr=no
  779     test_xrender=no
  780     _os=Android
  781 
  782     AC_DEFINE(HAVE_FT_FACE_GETCHARVARIANTINDEX)
  783     BUILD_TYPE="$BUILD_TYPE CAIRO FONTCONFIG FREETYPE"
  784     ;;
  785 
  786 haiku*)
  787     test_cups=no
  788     test_dbus=no
  789     test_randr=no
  790     test_xrender=no
  791     test_freetype=yes
  792     enable_odk=no
  793     enable_gstreamer_0_10=no
  794     enable_gstreamer_1_0=no
  795     enable_vlc=no
  796     enable_coinmp=no
  797     enable_pdfium=no
  798     enable_sdremote=no
  799     enable_postgresql_sdbc=no
  800     enable_firebird_sdbc=no
  801     _os=Haiku
  802     ;;
  803 
  804 *)
  805     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
  806     ;;
  807 esac
  808 
  809 if test "$_os" = "Android" ; then
  810     # Verify that the NDK and SDK options are proper
  811     if test -z "$with_android_ndk"; then
  812         AC_MSG_ERROR([the --with-android-ndk option is mandatory, unless it is available at external/android-ndk/.])
  813     elif test ! -f "$ANDROID_NDK_HOME/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_ARCH}/usr/lib/libc.a"; then
  814         AC_MSG_ERROR([the --with-android-ndk option does not point to an Android NDK])
  815     fi
  816 
  817     if test -z "$ANDROID_SDK_HOME"; then
  818         AC_MSG_ERROR([the --with-android-sdk option is mandatory, unless it is available at external/android-sdk-linux/.])
  819     elif test ! -d "$ANDROID_SDK_HOME/platforms"; then
  820         AC_MSG_ERROR([the --with-android-sdk option does not point to an Android SDK])
  821     fi
  822 
  823     BUILD_TOOLS_VERSION=`$SED -n -e 's/.*buildToolsVersion "\(.*\)"/\1/p' $SRC_ROOT/android/source/build.gradle`
  824     if test ! -d "$ANDROID_SDK_HOME/build-tools/$BUILD_TOOLS_VERSION"; then
  825         AC_MSG_WARN([android build-tools $BUILD_TOOLS_VERSION not found - install with
  826                          $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION
  827                     or adjust change $SRC_ROOT/android/source/build.gradle accordingly])
  828         add_warning "android build-tools $BUILD_TOOLS_VERSION not found - install with"
  829         add_warning "    $ANDROID_SDK_HOME/tools/android update sdk -u --all --filter build-tools-$BUILD_TOOLS_VERSION"
  830         add_warning "or adjust $SRC_ROOT/android/source/build.gradle accordingly"
  831     fi
  832     if test ! -f "$ANDROID_SDK_HOME/extras/android/m2repository/source.properties"; then
  833         AC_MSG_WARN([android support repository not found - install with
  834                          $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository
  835                      to allow the build to download the specified version of the android support libraries])
  836         add_warning "android support repository not found - install with"
  837         add_warning "    $ANDROID_SDK_HOME/tools/android update sdk -u --filter extra-android-m2repository"
  838         add_warning "to allow the build to download the specified version of the android support libraries"
  839     fi
  840 fi
  841 
  842 if test "$_os" = "AIX"; then
  843     AC_PATH_PROG(GAWK, gawk)
  844     if test -z "$GAWK"; then
  845         AC_MSG_ERROR([gawk not found in \$PATH])
  846     fi
  847 fi
  848 
  849 AC_SUBST(SDKDIRNAME)
  850 
  851 AC_SUBST(PTHREAD_CFLAGS)
  852 AC_SUBST(PTHREAD_LIBS)
  853 
  854 # Check for explicit A/C/CXX/OBJC/OBJCXX/LDFLAGS.
  855 # By default use the ones specified by our build system,
  856 # but explicit override is possible.
  857 AC_MSG_CHECKING(for explicit AFLAGS)
  858 if test -n "$AFLAGS"; then
  859     AC_MSG_RESULT([$AFLAGS])
  860     x_AFLAGS=
  861 else
  862     AC_MSG_RESULT(no)
  863     x_AFLAGS=[\#]
  864 fi
  865 AC_MSG_CHECKING(for explicit CFLAGS)
  866 if test -n "$CFLAGS"; then
  867     AC_MSG_RESULT([$CFLAGS])
  868     x_CFLAGS=
  869 else
  870     AC_MSG_RESULT(no)
  871     x_CFLAGS=[\#]
  872 fi
  873 AC_MSG_CHECKING(for explicit CXXFLAGS)
  874 if test -n "$CXXFLAGS"; then
  875     AC_MSG_RESULT([$CXXFLAGS])
  876     x_CXXFLAGS=
  877 else
  878     AC_MSG_RESULT(no)
  879     x_CXXFLAGS=[\#]
  880 fi
  881 AC_MSG_CHECKING(for explicit OBJCFLAGS)
  882 if test -n "$OBJCFLAGS"; then
  883     AC_MSG_RESULT([$OBJCFLAGS])
  884     x_OBJCFLAGS=
  885 else
  886     AC_MSG_RESULT(no)
  887     x_OBJCFLAGS=[\#]
  888 fi
  889 AC_MSG_CHECKING(for explicit OBJCXXFLAGS)
  890 if test -n "$OBJCXXFLAGS"; then
  891     AC_MSG_RESULT([$OBJCXXFLAGS])
  892     x_OBJCXXFLAGS=
  893 else
  894     AC_MSG_RESULT(no)
  895     x_OBJCXXFLAGS=[\#]
  896 fi
  897 AC_MSG_CHECKING(for explicit LDFLAGS)
  898 if test -n "$LDFLAGS"; then
  899     AC_MSG_RESULT([$LDFLAGS])
  900     x_LDFLAGS=
  901 else
  902     AC_MSG_RESULT(no)
  903     x_LDFLAGS=[\#]
  904 fi
  905 AC_SUBST(AFLAGS)
  906 AC_SUBST(CFLAGS)
  907 AC_SUBST(CXXFLAGS)
  908 AC_SUBST(OBJCFLAGS)
  909 AC_SUBST(OBJCXXFLAGS)
  910 AC_SUBST(LDFLAGS)
  911 AC_SUBST(x_AFLAGS)
  912 AC_SUBST(x_CFLAGS)
  913 AC_SUBST(x_CXXFLAGS)
  914 AC_SUBST(x_OBJCFLAGS)
  915 AC_SUBST(x_OBJCXXFLAGS)
  916 AC_SUBST(x_LDFLAGS)
  917 
  918 dnl These are potentially set for MSVC, in the code checking for UCRT below:
  919 my_original_CFLAGS=$CFLAGS
  920 my_original_CXXFLAGS=$CXXFLAGS
  921 my_original_CPPFLAGS=$CPPFLAGS
  922 
  923 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
  924 dnl Needs to precede the AC_C_BIGENDIAN and AC_SEARCH_LIBS calls below, which apparently call
  925 dnl AC_PROG_CC internally.
  926 if test "$_os" != "WINNT"; then
  927     # AC_PROG_CC sets CFLAGS to -g -O2 if not set, avoid that
  928     save_CFLAGS=$CFLAGS
  929     AC_PROG_CC
  930     CFLAGS=$save_CFLAGS
  931 fi
  932 
  933 if test "$_os" != "WINNT"; then
  934 AC_C_BIGENDIAN([ENDIANNESS=big], [ENDIANNESS=little])
  935 else
  936 ENDIANNESS=little
  937 fi
  938 AC_SUBST(ENDIANNESS)
  939 
  940 if test $_os != "WINNT"; then
  941     save_LIBS="$LIBS"
  942     AC_SEARCH_LIBS([dlsym], [dl],
  943         [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac],
  944         [AC_MSG_ERROR([dlsym not found in either libc nor libdl])])
  945     LIBS="$save_LIBS"
  946 fi
  947 AC_SUBST(DLOPEN_LIBS)
  948 
  949 AC_ARG_ENABLE(ios-simulator,
  950     AS_HELP_STRING([--enable-ios-simulator],
  951         [build i386 or x86_64 for ios simulator])
  952 )
  953 
  954 AC_ARG_ENABLE(ios-libreofficelight-app,
  955     AS_HELP_STRING([--enable-ios-libreofficelight-app],
  956         [When building for iOS, build stuff relevant only for the 'LibreOfficeLight' app
  957          (in ios/LibreOfficeLight). Note that this app is not known to work in any useful manner,
  958          and also that its actual build (in Xcode) requires some obvious modifications to the project.])
  959 )
  960 
  961 ENABLE_IOS_LIBREOFFICELIGHT_APP=
  962 if test "$enable_ios_libreofficelight_app" = yes; then
  963     ENABLE_IOS_LIBREOFFICELIGHT_APP=TRUE
  964 fi
  965 AC_SUBST(ENABLE_IOS_LIBREOFFICELIGHT_APP)
  966 
  967 ###############################################################################
  968 # Extensions switches --enable/--disable
  969 ###############################################################################
  970 # By default these should be enabled unless having extra dependencies.
  971 # If there is extra dependency over configure options then the enable should
  972 # be automagic based on whether the requiring feature is enabled or not.
  973 # All this options change anything only with --enable-extension-integration.
  974 
  975 # The name of this option and its help string makes it sound as if
  976 # extensions are built anyway, just not integrated in the installer,
  977 # if you use --disable-extension-integration. Is that really the
  978 # case?
  979 
  980 libo_FUZZ_ARG_ENABLE(extension-integration,
  981     AS_HELP_STRING([--disable-extension-integration],
  982         [Disable integration of the built extensions in the installer of the
  983          product. Use this switch to disable the integration.])
  984 )
  985 
  986 AC_ARG_ENABLE(avmedia,
  987     AS_HELP_STRING([--disable-avmedia],
  988         [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
  989 )
  990 
  991 AC_ARG_ENABLE(database-connectivity,
  992     AS_HELP_STRING([--disable-database-connectivity],
  993         [Disable various database connectivity. Work in progress, use only if you are hacking on it.])
  994 )
  995 
  996 # This doesn't mean not building (or "integrating") extensions
  997 # (although it probably should; i.e. it should imply
  998 # --disable-extension-integration I guess), it means not supporting
  999 # any extension mechanism at all
 1000 libo_FUZZ_ARG_ENABLE(extensions,
 1001     AS_HELP_STRING([--disable-extensions],
 1002         [Disable all add-on extension functionality. Work in progress, use only if you are hacking on it.])
 1003 )
 1004 
 1005 AC_ARG_ENABLE(scripting,
 1006     AS_HELP_STRING([--disable-scripting],
 1007         [Disable BASIC, Java and Python. Work in progress, use only if you are hacking on it.])
 1008 )
 1009 
 1010 # This is mainly for Android and iOS, but could potentially be used in some
 1011 # special case otherwise, too, so factored out as a separate setting
 1012 
 1013 AC_ARG_ENABLE(dynamic-loading,
 1014     AS_HELP_STRING([--disable-dynamic-loading],
 1015         [Disable any use of dynamic loading of code. Work in progress, use only if you are hacking on it.])
 1016 )
 1017 
 1018 libo_FUZZ_ARG_ENABLE(report-builder,
 1019     AS_HELP_STRING([--disable-report-builder],
 1020         [Disable the Report Builder.])
 1021 )
 1022 
 1023 libo_FUZZ_ARG_ENABLE(ext-wiki-publisher,
 1024     AS_HELP_STRING([--enable-ext-wiki-publisher],
 1025         [Enable the Wiki Publisher extension.])
 1026 )
 1027 
 1028 libo_FUZZ_ARG_ENABLE(lpsolve,
 1029     AS_HELP_STRING([--disable-lpsolve],
 1030         [Disable compilation of the lp solve solver ])
 1031 )
 1032 libo_FUZZ_ARG_ENABLE(coinmp,
 1033     AS_HELP_STRING([--disable-coinmp],
 1034         [Disable compilation of the CoinMP solver ])
 1035 )
 1036 
 1037 libo_FUZZ_ARG_ENABLE(pdfimport,
 1038     AS_HELP_STRING([--disable-pdfimport],
 1039         [Disable building the PDF import feature.])
 1040 )
 1041 
 1042 libo_FUZZ_ARG_ENABLE(pdfium,
 1043     AS_HELP_STRING([--disable-pdfium],
 1044         [Disable building PDFium.])
 1045 )
 1046 
 1047 ###############################################################################
 1048 
 1049 dnl ---------- *** ----------
 1050 
 1051 libo_FUZZ_ARG_ENABLE(mergelibs,
 1052     AS_HELP_STRING([--enable-mergelibs],
 1053         [Merge several of the smaller libraries into one big, "merged", one.])
 1054 )
 1055 
 1056 libo_FUZZ_ARG_ENABLE(breakpad,
 1057     AS_HELP_STRING([--enable-breakpad],
 1058         [Enables breakpad for crash reporting.])
 1059 )
 1060 
 1061 AC_ARG_ENABLE(fetch-external,
 1062     AS_HELP_STRING([--disable-fetch-external],
 1063         [Disables fetching external tarballs from web sources.])
 1064 )
 1065 
 1066 AC_ARG_ENABLE(fuzzers,
 1067     AS_HELP_STRING([--enable-fuzzers],
 1068         [Enables building libfuzzer targets for fuzz testing.])
 1069 )
 1070 
 1071 libo_FUZZ_ARG_ENABLE(pch,
 1072     AS_HELP_STRING([--enable-pch],
 1073         [Enables precompiled header support for C++. Forced default on Windows/VC build])
 1074 )
 1075 
 1076 libo_FUZZ_ARG_ENABLE(epm,
 1077     AS_HELP_STRING([--enable-epm],
 1078         [LibreOffice includes self-packaging code, that requires epm, however epm is
 1079          useless for large scale package building.])
 1080 )
 1081 
 1082 libo_FUZZ_ARG_ENABLE(odk,
 1083     AS_HELP_STRING([--disable-odk],
 1084         [LibreOffice includes an ODK, office development kit which some packagers may
 1085          wish to build without.])
 1086 )
 1087 
 1088 AC_ARG_ENABLE(mpl-subset,
 1089     AS_HELP_STRING([--enable-mpl-subset],
 1090         [Don't compile any pieces which are not MPL or more liberally licensed])
 1091 )
 1092 
 1093 libo_FUZZ_ARG_ENABLE(evolution2,
 1094     AS_HELP_STRING([--enable-evolution2],
 1095         [Allows the built-in evolution 2 addressbook connectivity build to be
 1096          enabled.])
 1097 )
 1098 
 1099 AC_ARG_ENABLE(avahi,
 1100     AS_HELP_STRING([--enable-avahi],
 1101         [Determines whether to use Avahi to advertise Impress to remote controls.])
 1102 )
 1103 
 1104 libo_FUZZ_ARG_ENABLE(werror,
 1105     AS_HELP_STRING([--enable-werror],
 1106         [Turn warnings to errors. (Has no effect in modules where the treating
 1107          of warnings as errors is disabled explicitly.)]),
 1108 ,)
 1109 
 1110 libo_FUZZ_ARG_ENABLE(assert-always-abort,
 1111     AS_HELP_STRING([--enable-assert-always-abort],
 1112         [make assert() failures abort even when building without --enable-debug or --enable-dbgutil.]),
 1113 ,)
 1114 
 1115 libo_FUZZ_ARG_ENABLE(dbgutil,
 1116     AS_HELP_STRING([--enable-dbgutil],
 1117         [Provide debugging support from --enable-debug and include additional debugging
 1118          utilities such as object counting or more expensive checks.
 1119          This is the recommended option for developers.
 1120          Note that this makes the build ABI incompatible, it is not possible to mix object
 1121          files or libraries from a --enable-dbgutil and a --disable-dbgutil build.]))
 1122 
 1123 libo_FUZZ_ARG_ENABLE(debug,
 1124     AS_HELP_STRING([--enable-debug],
 1125         [Include debugging information, disable compiler optimization and inlining plus
 1126          extra debugging code like assertions. Extra large build! (enables -g compiler flag).]))
 1127 
 1128 libo_FUZZ_ARG_ENABLE(split-debug,
 1129     AS_HELP_STRING([--enable-split-debug],
 1130         [Uses split debug information (-gsplit-dwarf compile flag). Saves disk space and build time,
 1131          but requires tools that support it (both build tools and debuggers).]))
 1132 
 1133 libo_FUZZ_ARG_ENABLE(gdb-index,
 1134     AS_HELP_STRING([--enable-gdb-index],
 1135         [Creates debug information in the gdb index format, which makes gdb start faster.
 1136          Requires the gold or lld linker.]))
 1137 
 1138 libo_FUZZ_ARG_ENABLE(sal-log,
 1139     AS_HELP_STRING([--enable-sal-log],
 1140         [Make SAL_INFO and SAL_WARN calls do something even in a non-debug build.]))
 1141 
 1142 AC_ARG_ENABLE(selective-debuginfo,
 1143     AS_HELP_STRING([--enable-selective-debuginfo],
 1144         [If --enable-debug or --enable-dbgutil is used, build debugging information
 1145          (-g compiler flag) only for the specified gbuild build targets
 1146          (where all means everything, - prepended means not to enable, / appended means
 1147          everything in the directory; there is no ordering, more specific overrides
 1148          more general, and disabling takes precedence).
 1149          Example: --enable-selective-debuginfo="all -sw/ -Library_sc".]))
 1150 
 1151 libo_FUZZ_ARG_ENABLE(symbols,
 1152     AS_HELP_STRING([--enable-symbols],
 1153         [Generate debug information.
 1154          By default, enabled for --enable-debug and --enable-dbgutil, disabled
 1155          otherwise.]))
 1156 
 1157 libo_FUZZ_ARG_ENABLE(optimized,
 1158     AS_HELP_STRING([--disable-optimized],
 1159         [Whether to compile with optimization flags.
 1160          By default, disabled for --enable-debug and --enable-dbgutil, enabled
 1161          otherwise.]))
 1162 
 1163 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
 1164     AS_HELP_STRING([--disable-runtime-optimizations],
 1165         [Statically disable certain runtime optimizations (like rtl/alloc.h or
 1166          JVM JIT) that are known to interact badly with certain dynamic analysis
 1167          tools (like -fsanitize=address or Valgrind).  By default, disabled iff
 1168          CC contains "-fsanitize=*".  (For Valgrind, those runtime optimizations
 1169          are typically disabled dynamically via RUNNING_ON_VALGRIND.)]))
 1170 
 1171 AC_ARG_WITH(valgrind,
 1172     AS_HELP_STRING([--with-valgrind],
 1173         [Make availability of Valgrind headers a hard requirement.]))
 1174 
 1175 libo_FUZZ_ARG_ENABLE(compiler-plugins,
 1176     AS_HELP_STRING([--enable-compiler-plugins],
 1177         [Enable compiler plugins that will perform additional checks during
 1178          building. Enabled automatically by --enable-dbgutil.
 1179          Use --enable-compiler-plugins=debug to also enable debug code in the plugins.]))
 1180 COMPILER_PLUGINS_DEBUG=
 1181 if test "$enable_compiler_plugins" = debug; then
 1182     enable_compiler_plugins=yes
 1183     COMPILER_PLUGINS_DEBUG=TRUE
 1184 fi
 1185 
 1186 libo_FUZZ_ARG_ENABLE(ooenv,
 1187     AS_HELP_STRING([--disable-ooenv],
 1188         [Disable ooenv for the instdir installation.]))
 1189 
 1190 libo_FUZZ_ARG_ENABLE(libnumbertext,
 1191     AS_HELP_STRING([--disable-libnumbertext],
 1192         [Disable use of numbertext external library.]))
 1193 
 1194 AC_ARG_ENABLE(lto,
 1195     AS_HELP_STRING([--enable-lto],
 1196         [Enable link-time optimization. Suitable for (optimised) product builds. Building might take
 1197          longer but libraries and executables are optimized for speed. For GCC, best to use the 'gold'
 1198          linker. For MSVC, this option is broken at the moment. This is experimental work
 1199          in progress that shouldn't be used unless you are working on it.)]))
 1200 
 1201 AC_ARG_ENABLE(python,
 1202     AS_HELP_STRING([--enable-python=<no/auto/system/internal/fully-internal>],
 1203         [Enables or disables Python support at run-time.
 1204          Also specifies what Python to use. 'auto' is the default.
 1205          'fully-internal' even forces the internal version for uses of Python
 1206          during the build.]))
 1207 
 1208 libo_FUZZ_ARG_ENABLE(gtk,
 1209     AS_HELP_STRING([--disable-gtk],
 1210         [Determines whether to use Gtk+ vclplug on platforms where Gtk+ is available.]),
 1211 ,test "${enable_gtk+set}" = set || enable_gtk=yes)
 1212 
 1213 libo_FUZZ_ARG_ENABLE(gtk3,
 1214     AS_HELP_STRING([--disable-gtk3],
 1215         [Determines whether to use Gtk+ 3.0 vclplug on platforms where Gtk+ 3.0 is available.]),
 1216 ,test "${enable_gtk3+set}" = set || enable_gtk3=yes)
 1217 
 1218 AC_ARG_ENABLE(split-app-modules,
 1219     AS_HELP_STRING([--enable-split-app-modules],
 1220         [Split file lists for app modules, e.g. base, calc.
 1221          Has effect only with make distro-pack-install]),
 1222 ,)
 1223 
 1224 AC_ARG_ENABLE(split-opt-features,
 1225     AS_HELP_STRING([--enable-split-opt-features],
 1226         [Split file lists for some optional features, e.g. pyuno, testtool.
 1227          Has effect only with make distro-pack-install]),
 1228 ,)
 1229 
 1230 libo_FUZZ_ARG_ENABLE(cairo-canvas,
 1231     AS_HELP_STRING([--disable-cairo-canvas],
 1232         [Determines whether to build the Cairo canvas on platforms where Cairo is available.]),
 1233 ,)
 1234 
 1235 libo_FUZZ_ARG_ENABLE(dbus,
 1236     AS_HELP_STRING([--disable-dbus],
 1237         [Determines whether to enable features that depend on dbus.
 1238          e.g. Presentation mode screensaver control, bluetooth presentation control, automatic font install]),
 1239 ,test "${enable_dbus+set}" = set || enable_dbus=yes)
 1240 
 1241 libo_FUZZ_ARG_ENABLE(sdremote,
 1242     AS_HELP_STRING([--disable-sdremote],
 1243         [Determines whether to enable Impress remote control (i.e. the server component).]),
 1244 ,test "${enable_sdremote+set}" = set || enable_sdremote=yes)
 1245 
 1246 libo_FUZZ_ARG_ENABLE(sdremote-bluetooth,
 1247     AS_HELP_STRING([--disable-sdremote-bluetooth],
 1248         [Determines whether to build sdremote with bluetooth support.
 1249          Requires dbus on Linux.]))
 1250 
 1251 libo_FUZZ_ARG_ENABLE(gio,
 1252     AS_HELP_STRING([--disable-gio],
 1253         [Determines whether to use the GIO support.]),
 1254 ,test "${enable_gio+set}" = set || enable_gio=yes)
 1255 
 1256 AC_ARG_ENABLE(kde4,
 1257     AS_HELP_STRING([--enable-kde4],
 1258         [Determines whether to use Qt4/KDE4 vclplug on platforms where Qt4 and
 1259          KDE4 are available.]),
 1260 ,)
 1261 
 1262 AC_ARG_ENABLE(qt5,
 1263     AS_HELP_STRING([--enable-qt5],
 1264         [Determines whether to use Qt5 vclplug on platforms where Qt5 is
 1265          available.]),
 1266 ,)
 1267 
 1268 AC_ARG_ENABLE(kde5,
 1269     AS_HELP_STRING([--enable-kde5],
 1270         [Determines whether to use Qt5/KF5 vclplug on platforms where Qt5 and
 1271          KF5 are available.]),
 1272 ,)
 1273 
 1274 AC_ARG_ENABLE(gtk3_kde5,
 1275     AS_HELP_STRING([--enable-gtk3-kde5],
 1276         [Determines whether to use Gtk3 vclplug with KDE file dialogs on
 1277          platforms where Gtk3, Qt5 and Plasma is available.]),
 1278 ,)
 1279 
 1280 libo_FUZZ_ARG_ENABLE(gui,
 1281     AS_HELP_STRING([--disable-gui],
 1282         [Disable use of X11 or Wayland to reduce dependencies. Not related to the --headless
 1283          command-line option. Not related to LibreOffice Online functionality. Don't use
 1284          unless you are certain you need to. Nobody will help you if you insist on trying
 1285          this and run into problems.]),
 1286 ,test "${enable_gui+set}" = set || enable_gui=yes)
 1287 
 1288 libo_FUZZ_ARG_ENABLE(randr,
 1289     AS_HELP_STRING([--disable-randr],
 1290         [Disable RandR support in the vcl project.]),
 1291 ,test "${enable_randr+set}" = set || enable_randr=yes)
 1292 
 1293 libo_FUZZ_ARG_ENABLE(gstreamer-1-0,
 1294     AS_HELP_STRING([--disable-gstreamer-1-0],
 1295         [Disable building with the new gstreamer 1.0 avmedia backend.]),
 1296 ,test "${enable_gstreamer_1_0+set}" = set || enable_gstreamer_1_0=yes)
 1297 
 1298 AC_ARG_ENABLE(gstreamer-0-10,
 1299     AS_HELP_STRING([--enable-gstreamer-0-10],
 1300         [Enable building with the gstreamer 0.10 avmedia backend.]),
 1301 ,enable_gstreamer_0_10=no)
 1302 
 1303 libo_FUZZ_ARG_ENABLE(vlc,
 1304     AS_HELP_STRING([--enable-vlc],
 1305         [Enable building with the (experimental) VLC avmedia backend.]),
 1306 ,test "${enable_vlc+set}" = set || enable_vlc=no)
 1307 
 1308 libo_FUZZ_ARG_ENABLE(neon,
 1309     AS_HELP_STRING([--disable-neon],
 1310         [Disable neon and the compilation of webdav binding.]),
 1311 ,)
 1312 
 1313 libo_FUZZ_ARG_ENABLE([eot],
 1314     [AS_HELP_STRING([--enable-eot],
 1315         [Enable support for Embedded OpenType fonts.])],
 1316 ,test "${enable_eot+set}" = set || enable_eot=no)
 1317 
 1318 libo_FUZZ_ARG_ENABLE(cve-tests,
 1319     AS_HELP_STRING([--disable-cve-tests],
 1320         [Prevent CVE tests to be executed]),
 1321 ,)
 1322 
 1323 libo_FUZZ_ARG_ENABLE(chart-tests,
 1324     AS_HELP_STRING([--enable-chart-tests],
 1325         [Executes chart XShape tests. In a perfect world these tests would be
 1326          stable and everyone could run them, in reality it is best to run them
 1327          only on a few machines that are known to work and maintained by people
 1328          who can judge if a test failure is a regression or not.]),
 1329 ,)
 1330 
 1331 AC_ARG_ENABLE(build-unowinreg,
 1332     AS_HELP_STRING([--enable-build-unowinreg],
 1333         [Do not use the prebuilt unowinreg.dll. Build it instead. The MinGW C++
 1334          compiler is needed on Linux.]),
 1335 ,)
 1336 
 1337 AC_ARG_ENABLE(build-opensymbol,
 1338     AS_HELP_STRING([--enable-build-opensymbol],
 1339         [Do not use the prebuilt opens___.ttf. Build it instead. This needs
 1340          fontforge installed.]),
 1341 ,)
 1342 
 1343 AC_ARG_ENABLE(dependency-tracking,
 1344     AS_HELP_STRING([--enable-dependency-tracking],
 1345         [Do not reject slow dependency extractors.])[
 1346   --disable-dependency-tracking
 1347                           Disables generation of dependency information.
 1348                           Speed up one-time builds.],
 1349 ,)
 1350 
 1351 AC_ARG_ENABLE(icecream,
 1352     AS_HELP_STRING([--enable-icecream],
 1353         [Use the 'icecream' distributed compiling tool to speedup the compilation.
 1354          It defaults to /opt/icecream for the location of the icecream gcc/g++
 1355          wrappers, you can override that using --with-gcc-home=/the/path switch.]),
 1356 ,)
 1357 
 1358 AC_ARG_ENABLE(ld,
 1359     AS_HELP_STRING([--enable-ld=<linker>],
 1360         [Use the specified linker. Both 'gold' and 'lld' linkers generally use less memory and link faster.]),
 1361 ,)
 1362 
 1363 libo_FUZZ_ARG_ENABLE(cups,
 1364     AS_HELP_STRING([--disable-cups],
 1365         [Do not build cups support.])
 1366 )
 1367 
 1368 AC_ARG_ENABLE(ccache,
 1369     AS_HELP_STRING([--disable-ccache],
 1370         [Do not try to use ccache automatically.
 1371          By default, unless on Windows, we will try to detect if ccache is available; in that case if
 1372          CC/CXX are not yet set, and --enable-icecream is not given, we
 1373          attempt to use ccache. --disable-ccache disables ccache completely.
 1374 ]),
 1375 ,)
 1376 
 1377 AC_ARG_ENABLE(64-bit,
 1378     AS_HELP_STRING([--enable-64-bit],
 1379         [Build a 64-bit LibreOffice on platforms where the normal build is 32-bit.
 1380          At the moment meaningful only for Windows.]), ,)
 1381 
 1382 libo_FUZZ_ARG_ENABLE(online-update,
 1383     AS_HELP_STRING([--enable-online-update],
 1384         [Enable the online update service that will check for new versions of
 1385          LibreOffice. By default, it is enabled on Windows and Mac, disabled on Linux.
 1386          If the value is "mar", the experimental Mozilla-like update will be
 1387          enabled instead of the traditional update mechanism.]),
 1388 ,)
 1389 
 1390 AC_ARG_WITH(update-config,
 1391     AS_HELP_STRING([--with-update-config=/tmp/update.ini],
 1392                    [Path to the update config ini file]))
 1393 
 1394 libo_FUZZ_ARG_ENABLE(extension-update,
 1395     AS_HELP_STRING([--disable-extension-update],
 1396         [Disable possibility to update installed extensions.]),
 1397 ,)
 1398 
 1399 libo_FUZZ_ARG_ENABLE(release-build,
 1400     AS_HELP_STRING([--enable-release-build],
 1401         [Enable release build. Note that the "release build" choice is orthogonal to
 1402          whether symbols are present, debug info is generated, or optimization
 1403          is done.
 1404          See http://wiki.documentfoundation.org/Development/DevBuild]),
 1405 ,)
 1406 
 1407 AC_ARG_ENABLE(windows-build-signing,
 1408     AS_HELP_STRING([--enable-windows-build-signing],
 1409         [Enable signing of windows binaries (*.exe, *.dll)]),
 1410 ,)
 1411 
 1412 AC_ARG_ENABLE(silent-msi,
 1413     AS_HELP_STRING([--enable-silent-msi],
 1414         [Enable MSI with LIMITUI=1 (silent install).]),
 1415 ,)
 1416 
 1417 AC_ARG_ENABLE(macosx-code-signing,
 1418     AS_HELP_STRING([--enable-macosx-code-signing=<identity>],
 1419         [Sign executables, dylibs, frameworks and the app bundle. If you
 1420          don't provide an identity the first suitable certificate
 1421          in your keychain is used.]),
 1422 ,)
 1423 
 1424 AC_ARG_ENABLE(macosx-package-signing,
 1425     AS_HELP_STRING([--enable-macosx-package-signing=<identity>],
 1426         [Create a .pkg suitable for uploading to the Mac App Store and sign
 1427          it. If you don't provide an identity the first suitable certificate
 1428          in your keychain is used.]),
 1429 ,)
 1430 
 1431 AC_ARG_ENABLE(macosx-sandbox,
 1432     AS_HELP_STRING([--enable-macosx-sandbox],
 1433         [Make the app bundle run in a sandbox. Requires code signing.
 1434          Is required by apps distributed in the Mac App Store, and implies
 1435          adherence to App Store rules.]),
 1436 ,)
 1437 
 1438 AC_ARG_WITH(macosx-bundle-identifier,
 1439     AS_HELP_STRING([--with-macosx-bundle-identifier=tld.mumble.orifice.TheOffice],
 1440         [Define the OS X bundle identifier. Default is the somewhat weird
 1441          org.libreoffice.script ("script", huh?).]),
 1442 ,with_macosx_bundle_identifier=org.libreoffice.script)
 1443 
 1444 AC_ARG_WITH(product-name,
 1445     AS_HELP_STRING([--with-product-name='My Own Office Suite'],
 1446         [Define the product name. Default is AC_PACKAGE_NAME.]),
 1447 ,with_product_name=$PRODUCTNAME)
 1448 
 1449 AC_ARG_WITH(package-version,
 1450     AS_HELP_STRING([--with-package-version='3.1.4.5'],
 1451         [Define the package version. Default is AC_PACKAGE_VERSION. Use only if you distribute an own build for macOS.]),
 1452 ,)
 1453 
 1454 libo_FUZZ_ARG_ENABLE(readonly-installset,
 1455     AS_HELP_STRING([--enable-readonly-installset],
 1456         [Prevents any attempts by LibreOffice to write into its installation. That means
 1457          at least that no "system-wide" extensions can be added. Partly experimental work in
 1458          progress, probably not fully implemented (but is useful for sandboxed macOS builds).]),
 1459 ,)
 1460 
 1461 libo_FUZZ_ARG_ENABLE(postgresql-sdbc,
 1462     AS_HELP_STRING([--disable-postgresql-sdbc],
 1463         [Disable the build of the PostgreSQL-SDBC driver.])
 1464 )
 1465 
 1466 libo_FUZZ_ARG_ENABLE(lotuswordpro,
 1467     AS_HELP_STRING([--disable-lotuswordpro],
 1468         [Disable the build of the Lotus Word Pro filter.]),
 1469 ,test "${enable_lotuswordpro+set}" = set || enable_lotuswordpro=yes)
 1470 
 1471 libo_FUZZ_ARG_ENABLE(firebird-sdbc,
 1472     AS_HELP_STRING([--disable-firebird-sdbc],
 1473         [Disable the build of the Firebird-SDBC driver if it doesn't compile for you.]),
 1474 ,test "${enable_firebird_sdbc+set}" = set || enable_firebird_sdbc=yes)
 1475 
 1476 AC_ARG_ENABLE(bogus-pkg-config,
 1477     AS_HELP_STRING([--enable-bogus-pkg-config],
 1478         [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]),
 1479 )
 1480 
 1481 AC_ARG_ENABLE(openssl,
 1482     AS_HELP_STRING([--disable-openssl],
 1483         [Disable using libssl/libcrypto from OpenSSL. If disabled,
 1484          components will either use GNUTLS or NSS. Work in progress,
 1485          use only if you are hacking on it.]),
 1486 ,enable_openssl=yes)
 1487 
 1488 libo_FUZZ_ARG_ENABLE(cipher-openssl-backend,
 1489     AS_HELP_STRING([--enable-cipher-openssl-backend],
 1490         [Enable using OpenSSL as the actual implementation of the rtl/cipher.h functionality.
 1491          Requires --enable-openssl.]))
 1492 
 1493 AC_ARG_ENABLE(library-bin-tar,
 1494     AS_HELP_STRING([--enable-library-bin-tar],
 1495         [Enable the building and reused of tarball of binary build for some 'external' libraries.
 1496         Some libraries can save their build result in a tarball
 1497         stored in TARFILE_LOCATION. That binary tarball is
 1498         uniquely identified by the source tarball,
 1499         the content of the config_host.mk file and the content
 1500         of the top-level directory in core for that library
 1501         If this option is enabled, then if such a tarfile exist, it will be untarred
 1502         instead of the source tarfile, and the build step will be skipped for that
 1503         library.
 1504         If a proper tarfile does not exist, then the normal source-based
 1505         build is done for that library and a proper binary tarfile is created
 1506         for the next time.]),
 1507 )
 1508 
 1509 AC_ARG_ENABLE(dconf,
 1510     AS_HELP_STRING([--disable-dconf],
 1511         [Disable the dconf configuration backend (enabled by default where
 1512          available).]))
 1513 
 1514 libo_FUZZ_ARG_ENABLE(formula-logger,
 1515     AS_HELP_STRING(
 1516         [--enable-formula-logger],
 1517         [Enable formula logger for logging formula calculation flow in Calc.]
 1518     )
 1519 )
 1520 
 1521 dnl ===================================================================
 1522 dnl Optional Packages (--with/without-)
 1523 dnl ===================================================================
 1524 
 1525 AC_ARG_WITH(gcc-home,
 1526     AS_HELP_STRING([--with-gcc-home],
 1527         [Specify the location of gcc/g++ manually. This can be used in conjunction
 1528          with --enable-icecream when icecream gcc/g++ wrappers are installed in a
 1529          non-default path.]),
 1530 ,)
 1531 
 1532 AC_ARG_WITH(gnu-patch,
 1533     AS_HELP_STRING([--with-gnu-patch],
 1534         [Specify location of GNU patch on Solaris or FreeBSD.]),
 1535 ,)
 1536 
 1537 AC_ARG_WITH(build-platform-configure-options,
 1538     AS_HELP_STRING([--with-build-platform-configure-options],
 1539         [Specify options for the configure script run for the *build* platform in a cross-compilation]),
 1540 ,)
 1541 
 1542 AC_ARG_WITH(gnu-cp,
 1543     AS_HELP_STRING([--with-gnu-cp],
 1544         [Specify location of GNU cp on Solaris or FreeBSD.]),
 1545 ,)
 1546 
 1547 AC_ARG_WITH(external-tar,
 1548     AS_HELP_STRING([--with-external-tar=<TARFILE_PATH>],
 1549         [Specify an absolute path of where to find (and store) tarfiles.]),
 1550     TARFILE_LOCATION=$withval ,
 1551 )
 1552 
 1553 AC_ARG_WITH(referenced-git,
 1554     AS_HELP_STRING([--with-referenced-git=<OTHER_CHECKOUT_DIR>],
 1555         [Specify another checkout directory to reference. This makes use of
 1556                  git submodule update --reference, and saves a lot of diskspace
 1557                  when having multiple trees side-by-side.]),
 1558     GIT_REFERENCE_SRC=$withval ,
 1559 )
 1560 
 1561 AC_ARG_WITH(linked-git,
 1562     AS_HELP_STRING([--with-linked-git=<submodules repo basedir>],
 1563         [Specify a directory where the repositories of submodules are located.
 1564          This uses a method similar to git-new-workdir to get submodules.]),
 1565     GIT_LINK_SRC=$withval ,
 1566 )
 1567 
 1568 AC_ARG_WITH(galleries,
 1569     AS_HELP_STRING([--with-galleries],
 1570         [Specify how galleries should be built. It is possible either to
 1571          build these internally from source ("build"),
 1572          or to disable them ("no")]),
 1573 )
 1574 
 1575 AC_ARG_WITH(theme,
 1576     AS_HELP_STRING([--with-theme="theme1 theme2..."],
 1577         [Choose which themes to include. By default those themes with an '*' are included.
 1578          Possible choices: *breeze, *breeze_dark, *breeze_svg, *colibre, *colibre_svg, *elementary,
 1579          *elementary_svg, *karasa_jaga, *sifr, *sifr_dark, *tango.]),
 1580 ,)
 1581 
 1582 libo_FUZZ_ARG_WITH(helppack-integration,
 1583     AS_HELP_STRING([--without-helppack-integration],
 1584         [It will not integrate the helppacks to the installer
 1585          of the product. Please use this switch to use the online help
 1586          or separate help packages.]),
 1587 ,)
 1588 
 1589 libo_FUZZ_ARG_WITH(fonts,
 1590     AS_HELP_STRING([--without-fonts],
 1591         [LibreOffice includes some third-party fonts to provide a reliable basis for
 1592          help content, templates, samples, etc. When these fonts are already
 1593          known to be available on the system then you should use this option.]),
 1594 ,)
 1595 
 1596 AC_ARG_WITH(epm,
 1597     AS_HELP_STRING([--with-epm],
 1598         [Decides which epm to use. Default is to use the one from the system if
 1599          one is built. When either this is not there or you say =internal epm
 1600          will be built.]),
 1601 ,)
 1602 
 1603 AC_ARG_WITH(package-format,
 1604     AS_HELP_STRING([--with-package-format],
 1605         [Specify package format(s) for LibreOffice installation sets. The
 1606          implicit --without-package-format leads to no installation sets being
 1607          generated. Possible values: aix, archive, bsd, deb, dmg,
 1608          installed, msi, pkg, and rpm.
 1609          Example: --with-package-format='deb rpm']),
 1610 ,)
 1611 
 1612 AC_ARG_WITH(tls,
 1613     AS_HELP_STRING([--with-tls],
 1614         [Decides which TLS/SSL and cryptographic implementations to use for
 1615          LibreOffice's code. Notice that this doesn't apply for depending
 1616          libraries like "neon", for example. Default is to use OpenSSL
 1617          although NSS is also possible. Notice that selecting NSS restricts
 1618          the usage of OpenSSL in LO's code but selecting OpenSSL doesn't
 1619          restrict by now the usage of NSS in LO's code. Possible values:
 1620          openssl, nss. Example: --with-tls="nss"]),
 1621 ,)
 1622 
 1623 AC_ARG_WITH(system-libs,
 1624     AS_HELP_STRING([--with-system-libs],
 1625         [Use libraries already on system -- enables all --with-system-* flags.]),
 1626 ,)
 1627 
 1628 AC_ARG_WITH(system-bzip2,
 1629     AS_HELP_STRING([--with-system-bzip2],
 1630         [Use bzip2 already on system. Used only when --enable-online-update=mar]),,
 1631     [with_system_bzip2="$with_system_libs"])
 1632 
 1633 AC_ARG_WITH(system-headers,
 1634     AS_HELP_STRING([--with-system-headers],
 1635         [Use headers already on system -- enables all --with-system-* flags for
 1636          external packages whose headers are the only entities used i.e.
 1637          boost/odbc/sane-header(s).]),,
 1638     [with_system_headers="$with_system_libs"])
 1639 
 1640 AC_ARG_WITH(system-jars,
 1641     AS_HELP_STRING([--without-system-jars],
 1642         [When building with --with-system-libs, also the needed jars are expected
 1643          on the system. Use this to disable that]),,
 1644     [with_system_jars="$with_system_libs"])
 1645 
 1646 AC_ARG_WITH(system-cairo,
 1647     AS_HELP_STRING([--with-system-cairo],
 1648         [Use cairo libraries already on system.  Happens automatically for
 1649          (implicit) --enable-gtk and for --enable-gtk3.]))
 1650 
 1651 AC_ARG_WITH(system-epoxy,
 1652     AS_HELP_STRING([--with-system-epoxy],
 1653         [Use epoxy libraries already on system.  Happens automatically for
 1654          --enable-gtk3.]),,
 1655        [with_system_epoxy="$with_system_libs"])
 1656 
 1657 AC_ARG_WITH(myspell-dicts,
 1658     AS_HELP_STRING([--with-myspell-dicts],
 1659         [Adds myspell dictionaries to the LibreOffice installation set]),
 1660 ,)
 1661 
 1662 AC_ARG_WITH(system-dicts,
 1663     AS_HELP_STRING([--without-system-dicts],
 1664         [Do not use dictionaries from system paths.]),
 1665 ,)
 1666 
 1667 AC_ARG_WITH(external-dict-dir,
 1668     AS_HELP_STRING([--with-external-dict-dir],
 1669         [Specify external dictionary dir.]),
 1670 ,)
 1671 
 1672 AC_ARG_WITH(external-hyph-dir,
 1673     AS_HELP_STRING([--with-external-hyph-dir],
 1674         [Specify external hyphenation pattern dir.]),
 1675 ,)
 1676 
 1677 AC_ARG_WITH(external-thes-dir,
 1678     AS_HELP_STRING([--with-external-thes-dir],
 1679         [Specify external thesaurus dir.]),
 1680 ,)
 1681 
 1682 AC_ARG_WITH(system-zlib,
 1683     AS_HELP_STRING([--with-system-zlib],
 1684         [Use zlib already on system.]),,
 1685     [with_system_zlib=auto])
 1686 
 1687 AC_ARG_WITH(system-jpeg,
 1688     AS_HELP_STRING([--with-system-jpeg],
 1689         [Use jpeg already on system.]),,
 1690     [with_system_jpeg="$with_system_libs"])
 1691 
 1692 AC_ARG_WITH(system-clucene,
 1693     AS_HELP_STRING([--with-system-clucene],
 1694         [Use clucene already on system.]),,
 1695     [with_system_clucene="$with_system_libs"])
 1696 
 1697 AC_ARG_WITH(system-expat,
 1698     AS_HELP_STRING([--with-system-expat],
 1699         [Use expat already on system.]),,
 1700     [with_system_expat="$with_system_libs"])
 1701 
 1702 AC_ARG_WITH(system-libxml,
 1703     AS_HELP_STRING([--with-system-libxml],
 1704         [Use libxml/libxslt already on system.]),,
 1705     [with_system_libxml=auto])
 1706 
 1707 AC_ARG_WITH(system-icu,
 1708     AS_HELP_STRING([--with-system-icu],
 1709         [Use icu already on system.]),,
 1710     [with_system_icu="$with_system_libs"])
 1711 
 1712 AC_ARG_WITH(system-ucpp,
 1713     AS_HELP_STRING([--with-system-ucpp],
 1714         [Use ucpp already on system.]),,
 1715     [])
 1716 
 1717 AC_ARG_WITH(system-openldap,
 1718     AS_HELP_STRING([--with-system-openldap],
 1719         [Use the OpenLDAP LDAP SDK already on system.]),,
 1720     [with_system_openldap="$with_system_libs"])
 1721 
 1722 AC_ARG_WITH(system-poppler,
 1723     AS_HELP_STRING([--with-system-poppler],
 1724         [Use system poppler (only needed for PDF import).]),,
 1725     [with_system_poppler="$with_system_libs"])
 1726 
 1727 AC_ARG_WITH(system-gpgmepp,
 1728     AS_HELP_STRING([--with-system-gpgmepp],
 1729         [Use gpgmepp already on system]),,
 1730     [with_system_gpgmepp="$with_system_libs"])
 1731 
 1732 AC_ARG_WITH(system-apache-commons,
 1733     AS_HELP_STRING([--with-system-apache-commons],
 1734         [Use Apache commons libraries already on system.]),,
 1735     [with_system_apache_commons="$with_system_jars"])
 1736 
 1737 AC_ARG_WITH(system-mariadb,
 1738     AS_HELP_STRING([--with-system-mariadb],
 1739         [Use MariaDB/MySQL libraries already on system.]),,
 1740     [with_system_mariadb="$with_system_libs"])
 1741 
 1742 AC_ARG_ENABLE(bundle-mariadb,
 1743     AS_HELP_STRING([--enable-bundle-mariadb],
 1744         [When using MariaDB/MySQL libraries already on system, bundle them with the MariaDB Connector/LibreOffice.])
 1745 )
 1746 
 1747 AC_ARG_WITH(system-postgresql,
 1748     AS_HELP_STRING([--with-system-postgresql],
 1749         [Use PostgreSQL libraries already on system, for building the PostgreSQL-SDBC
 1750          driver. If pg_config is not in PATH, use PGCONFIG to point to it.]),,
 1751     [with_system_postgresql="$with_system_libs"])
 1752 
 1753 AC_ARG_WITH(libpq-path,
 1754     AS_HELP_STRING([--with-libpq-path=<absolute path to your libpq installation>],
 1755         [Use this PostgreSQL C interface (libpq) installation for building
 1756          the PostgreSQL-SDBC extension.]),
 1757 ,)
 1758 
 1759 AC_ARG_WITH(system-firebird,
 1760     AS_HELP_STRING([--with-system-firebird],
 1761         [Use Firebird libraries already on system, for building the Firebird-SDBC
 1762          driver. If fb_config is not in PATH, use FBCONFIG to point to it.]),,
 1763     [with_system_firebird="$with_system_libs"])
 1764 
 1765 AC_ARG_WITH(system-libtommath,
 1766             AS_HELP_STRING([--with-system-libtommath],
 1767                            [Use libtommath already on system]),,
 1768             [with_system_libtommath="$with_system_libs"])
 1769 
 1770 AC_ARG_WITH(system-hsqldb,
 1771     AS_HELP_STRING([--with-system-hsqldb],
 1772         [Use hsqldb already on system.]))
 1773 
 1774 AC_ARG_WITH(hsqldb-jar,
 1775     AS_HELP_STRING([--with-hsqldb-jar=JARFILE],
 1776         [Specify path to jarfile manually.]),
 1777     HSQLDB_JAR=$withval)
 1778 
 1779 libo_FUZZ_ARG_ENABLE(scripting-beanshell,
 1780     AS_HELP_STRING([--disable-scripting-beanshell],
 1781         [Disable support for scripts in BeanShell.]),
 1782 ,
 1783 )
 1784 
 1785 AC_ARG_WITH(system-beanshell,
 1786     AS_HELP_STRING([--with-system-beanshell],
 1787         [Use beanshell already on system.]),,
 1788     [with_system_beanshell="$with_system_jars"])
 1789 
 1790 AC_ARG_WITH(beanshell-jar,
 1791     AS_HELP_STRING([--with-beanshell-jar=JARFILE],
 1792         [Specify path to jarfile manually.]),
 1793     BSH_JAR=$withval)
 1794 
 1795 libo_FUZZ_ARG_ENABLE(scripting-javascript,
 1796     AS_HELP_STRING([--disable-scripting-javascript],
 1797         [Disable support for scripts in JavaScript.]),
 1798 ,
 1799 )
 1800 
 1801 AC_ARG_WITH(system-rhino,
 1802     AS_HELP_STRING([--with-system-rhino],
 1803         [Use rhino already on system.]),,)
 1804 #    [with_system_rhino="$with_system_jars"])
 1805 # Above is not used as we have different debug interface
 1806 # patched into internal rhino. This code needs to be fixed
 1807 # before we can enable it by default.
 1808 
 1809 AC_ARG_WITH(rhino-jar,
 1810     AS_HELP_STRING([--with-rhino-jar=JARFILE],
 1811         [Specify path to jarfile manually.]),
 1812     RHINO_JAR=$withval)
 1813 
 1814 AC_ARG_WITH(commons-logging-jar,
 1815     AS_HELP_STRING([--with-commons-logging-jar=JARFILE],
 1816         [Specify path to jarfile manually.]),
 1817     COMMONS_LOGGING_JAR=$withval)
 1818 
 1819 AC_ARG_WITH(system-jfreereport,
 1820     AS_HELP_STRING([--with-system-jfreereport],
 1821         [Use JFreeReport already on system.]),,
 1822     [with_system_jfreereport="$with_system_jars"])
 1823 
 1824 AC_ARG_WITH(sac-jar,
 1825     AS_HELP_STRING([--with-sac-jar=JARFILE],
 1826         [Specify path to jarfile manually.]),
 1827     SAC_JAR=$withval)
 1828 
 1829 AC_ARG_WITH(libxml-jar,
 1830     AS_HELP_STRING([--with-libxml-jar=JARFILE],
 1831         [Specify path to jarfile manually.]),
 1832     LIBXML_JAR=$withval)
 1833 
 1834 AC_ARG_WITH(flute-jar,
 1835     AS_HELP_STRING([--with-flute-jar=JARFILE],
 1836         [Specify path to jarfile manually.]),
 1837     FLUTE_JAR=$withval)
 1838 
 1839 AC_ARG_WITH(jfreereport-jar,
 1840     AS_HELP_STRING([--with-jfreereport-jar=JARFILE],
 1841         [Specify path to jarfile manually.]),
 1842     JFREEREPORT_JAR=$withval)
 1843 
 1844 AC_ARG_WITH(liblayout-jar,
 1845     AS_HELP_STRING([--with-liblayout-jar=JARFILE],
 1846         [Specify path to jarfile manually.]),
 1847     LIBLAYOUT_JAR=$withval)
 1848 
 1849 AC_ARG_WITH(libloader-jar,
 1850     AS_HELP_STRING([--with-libloader-jar=JARFILE],
 1851         [Specify path to jarfile manually.]),
 1852     LIBLOADER_JAR=$withval)
 1853 
 1854 AC_ARG_WITH(libformula-jar,
 1855     AS_HELP_STRING([--with-libformula-jar=JARFILE],
 1856         [Specify path to jarfile manually.]),
 1857     LIBFORMULA_JAR=$withval)
 1858 
 1859 AC_ARG_WITH(librepository-jar,
 1860     AS_HELP_STRING([--with-librepository-jar=JARFILE],
 1861         [Specify path to jarfile manually.]),
 1862     LIBREPOSITORY_JAR=$withval)
 1863 
 1864 AC_ARG_WITH(libfonts-jar,
 1865     AS_HELP_STRING([--with-libfonts-jar=JARFILE],
 1866         [Specify path to jarfile manually.]),
 1867     LIBFONTS_JAR=$withval)
 1868 
 1869 AC_ARG_WITH(libserializer-jar,
 1870     AS_HELP_STRING([--with-libserializer-jar=JARFILE],
 1871         [Specify path to jarfile manually.]),
 1872     LIBSERIALIZER_JAR=$withval)
 1873 
 1874 AC_ARG_WITH(libbase-jar,
 1875     AS_HELP_STRING([--with-libbase-jar=JARFILE],
 1876         [Specify path to jarfile manually.]),
 1877     LIBBASE_JAR=$withval)
 1878 
 1879 AC_ARG_WITH(system-odbc,
 1880     AS_HELP_STRING([--with-system-odbc],
 1881         [Use the odbc headers already on system.]),,
 1882     [with_system_odbc="auto"])
 1883 
 1884 AC_ARG_WITH(system-sane,
 1885     AS_HELP_STRING([--with-system-sane],
 1886         [Use sane.h already on system.]),,
 1887     [with_system_sane="$with_system_headers"])
 1888 
 1889 AC_ARG_WITH(system-bluez,
 1890     AS_HELP_STRING([--with-system-bluez],
 1891         [Use bluetooth.h already on system.]),,
 1892     [with_system_bluez="$with_system_headers"])
 1893 
 1894 AC_ARG_WITH(system-curl,
 1895     AS_HELP_STRING([--with-system-curl],
 1896         [Use curl already on system.]),,
 1897     [with_system_curl=auto])
 1898 
 1899 AC_ARG_WITH(system-boost,
 1900     AS_HELP_STRING([--with-system-boost],
 1901         [Use boost already on system.]),,
 1902     [with_system_boost="$with_system_headers"])
 1903 
 1904 AC_ARG_WITH(system-glm,
 1905     AS_HELP_STRING([--with-system-glm],
 1906         [Use glm already on system.]),,
 1907     [with_system_glm="$with_system_headers"])
 1908 
 1909 AC_ARG_WITH(system-hunspell,
 1910     AS_HELP_STRING([--with-system-hunspell],
 1911         [Use libhunspell already on system.]),,
 1912     [with_system_hunspell="$with_system_libs"])
 1913 
 1914 AC_ARG_WITH(system-mythes,
 1915     AS_HELP_STRING([--with-system-mythes],
 1916         [Use mythes already on system.]),,
 1917     [with_system_mythes="$with_system_libs"])
 1918 
 1919 AC_ARG_WITH(system-altlinuxhyph,
 1920     AS_HELP_STRING([--with-system-altlinuxhyph],
 1921         [Use ALTLinuxhyph already on system.]),,
 1922     [with_system_altlinuxhyph="$with_system_libs"])
 1923 
 1924 AC_ARG_WITH(system-lpsolve,
 1925     AS_HELP_STRING([--with-system-lpsolve],
 1926         [Use lpsolve already on system.]),,
 1927     [with_system_lpsolve="$with_system_libs"])
 1928 
 1929 AC_ARG_WITH(system-coinmp,
 1930     AS_HELP_STRING([--with-system-coinmp],
 1931         [Use CoinMP already on system.]),,
 1932     [with_system_coinmp="$with_system_libs"])
 1933 
 1934 AC_ARG_WITH(system-liblangtag,
 1935     AS_HELP_STRING([--with-system-liblangtag],
 1936         [Use liblangtag library already on system.]),,
 1937     [with_system_liblangtag="$with_system_libs"])
 1938 
 1939 AC_ARG_WITH(webdav,
 1940     AS_HELP_STRING([--with-webdav],
 1941         [Specify which library to use for webdav implementation.
 1942          Possible values: "neon", "serf", "no". The default value is "neon".
 1943          Example: --with-webdav="serf"]),
 1944     WITH_WEBDAV=$withval,
 1945     WITH_WEBDAV="neon")
 1946 
 1947 AC_ARG_WITH(linker-hash-style,
 1948     AS_HELP_STRING([--with-linker-hash-style],
 1949         [Use linker with --hash-style=<style> when linking shared objects.
 1950          Possible values: "sysv", "gnu", "both". The default value is "gnu"
 1951          if supported on the build system, and "sysv" otherwise.]))
 1952 
 1953 AC_ARG_WITH(jdk-home,
 1954     AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>],
 1955         [If you have installed JDK 1.6 or later on your system please supply the
 1956          path here. Note that this is not the location of the java command but the
 1957          location of the entire distribution.]),
 1958 ,)
 1959 
 1960 AC_ARG_WITH(help,
 1961     AS_HELP_STRING([--with-help],
 1962         [Enable the build of help. There is a special parameter "common" that
 1963          can be used to bundle only the common part, .e.g help-specific icons.
 1964          This is useful when you build the helpcontent separately.])
 1965     [
 1966                           Usage:     --with-help    build the old local help
 1967                                  --without-help     no local help (default)
 1968                                  --with-help=html   build the new HTML local help
 1969                                  --with-help=online build the new HTML online help
 1970     ],
 1971 ,)
 1972 
 1973 libo_FUZZ_ARG_WITH(java,
 1974     AS_HELP_STRING([--with-java=<java command>],
 1975         [Specify the name of the Java interpreter command. Typically "java"
 1976          which is the default.
 1977 
 1978          To build without support for Java components, applets, accessibility
 1979          or the XML filters written in Java, use --without-java or --with-java=no.]),
 1980     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ],
 1981     [ test -z "$with_java" -o "$with_java" = "yes" && with_java=java ]
 1982 )
 1983 
 1984 AC_ARG_WITH(jvm-path,
 1985     AS_HELP_STRING([--with-jvm-path=<absolute path to parent of jvm home>],
 1986         [Use a specific JVM search path at runtime.
 1987          e.g. use --with-jvm-path=/usr/lib/ to find JRE/JDK in /usr/lib/jvm/]),
 1988 ,)
 1989 
 1990 AC_ARG_WITH(ant-home,
 1991     AS_HELP_STRING([--with-ant-home=<absolute path to Ant home>],
 1992         [If you have installed Jakarta Ant on your system, please supply the path here.
 1993          Note that this is not the location of the Ant binary but the location
 1994          of the entire distribution.]),
 1995 ,)
 1996 
 1997 AC_ARG_WITH(symbol-config,
 1998     AS_HELP_STRING([--with-symbol-config],
 1999         [Configuration for the crashreport symbol upload]),
 2000         [],
 2001         [with_symbol_config=no])
 2002 
 2003 AC_ARG_WITH(export-validation,
 2004     AS_HELP_STRING([--without-export-validation],
 2005         [Disable validating OOXML and ODF files as exported from in-tree tests.
 2006          Use this option e.g. if your system only provides Java 5.]),
 2007 ,with_export_validation=auto)
 2008 
 2009 AC_ARG_WITH(bffvalidator,
 2010     AS_HELP_STRING([--with-bffvalidator=<absolute path to BFFValidator>],
 2011         [Enables export validation for Microsoft Binary formats (doc, xls, ppt).
 2012          Requires installed Microsoft Office Binary File Format Validator.
 2013          Note: export-validation (--with-export-validation) is required to be turned on.
 2014          See https://www.microsoft.com/en-us/download/details.aspx?id=26794]),
 2015 ,with_bffvalidator=no)
 2016 
 2017 libo_FUZZ_ARG_WITH(junit,
 2018     AS_HELP_STRING([--with-junit=<absolute path to JUnit 4 jar>],
 2019         [Specifies the JUnit 4 jar file to use for JUnit-based tests.
 2020          --without-junit disables those tests. Not relevant in the --without-java case.]),
 2021 ,with_junit=yes)
 2022 
 2023 AC_ARG_WITH(hamcrest,
 2024     AS_HELP_STRING([--with-hamcrest=<absolute path to hamcrest jar>],
 2025         [Specifies the hamcrest jar file to use for JUnit-based tests.
 2026          --without-junit disables those tests. Not relevant in the --without-java case.]),
 2027 ,with_hamcrest=yes)
 2028 
 2029 AC_ARG_WITH(perl-home,
 2030     AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
 2031         [If you have installed Perl 5 Distribution, on your system, please
 2032          supply the path here. Note that this is not the location of the Perl
 2033          binary but the location of the entire distribution.]),
 2034 ,)
 2035 
 2036 libo_FUZZ_ARG_WITH(doxygen,
 2037     AS_HELP_STRING(
 2038         [--with-doxygen=<absolute path to doxygen executable>],
 2039         [Specifies the doxygen executable to use when generating ODK C/C++
 2040          documentation. --without-doxygen disables generation of ODK C/C++
 2041          documentation. Not relevant in the --disable-odk case.]),
 2042 ,with_doxygen=yes)
 2043 
 2044 AC_ARG_WITH(visual-studio,
 2045     AS_HELP_STRING([--with-visual-studio=<2017>],
 2046         [Specify which Visual Studio version to use in case several are
 2047          installed. Currently only 2017 is supported.]),
 2048 ,)
 2049 
 2050 AC_ARG_WITH(windows-sdk,
 2051     AS_HELP_STRING([--with-windows-sdk=<7.1(A)/8.0(A)/8.1(A)/10>],
 2052         [Specify which Windows SDK, or "Windows Kit", version to use
 2053          in case the one that came with the selected Visual Studio
 2054          is not what you want for some reason. Note that not all compiler/SDK
 2055          combinations are supported. The intent is that this option should not
 2056          be needed.]),
 2057 ,)
 2058 
 2059 AC_ARG_WITH(lang,
 2060     AS_HELP_STRING([--with-lang="es sw tu cs sk"],
 2061         [Use this option to build LibreOffice with additional UI language support.
 2062          English (US) is always included by default.
 2063          Separate multiple languages with space.
 2064          For all languages, use --with-lang=ALL.]),
 2065 ,)
 2066 
 2067 AC_ARG_WITH(locales,
 2068     AS_HELP_STRING([--with-locales="en es pt fr zh kr ja"],
 2069         [Use this option to limit the locale information built in.
 2070          Separate multiple locales with space.
 2071          Very experimental and might well break stuff.
 2072          Just a desperate measure to shrink code and data size.
 2073          By default all the locales available is included.
 2074          This option is completely unrelated to --with-lang.])
 2075     [
 2076                           Affects also our character encoding conversion
 2077                           tables for encodings mainly targeted for a
 2078                           particular locale, like EUC-CN and EUC-TW for
 2079                           zh, ISO-2022-JP for ja.
 2080 
 2081                           Affects also our add-on break iterator data for
 2082                           some languages.
 2083 
 2084                           For the default, all locales, don't use this switch at all.
 2085                           Specifying just the language part of a locale means all matching
 2086                           locales will be included.
 2087     ],
 2088 ,)
 2089 
 2090 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
 2091 libo_FUZZ_ARG_WITH(krb5,
 2092     AS_HELP_STRING([--with-krb5],
 2093         [Enable MIT Kerberos 5 support in modules that support it.
 2094          By default automatically enabled on platforms
 2095          where a good system Kerberos 5 is available.]),
 2096 ,)
 2097 
 2098 libo_FUZZ_ARG_WITH(gssapi,
 2099     AS_HELP_STRING([--with-gssapi],
 2100         [Enable GSSAPI support in modules that support it.
 2101          By default automatically enabled on platforms
 2102          where a good system GSSAPI is available.]),
 2103 ,)
 2104 
 2105 AC_ARG_WITH(iwyu,
 2106     AS_HELP_STRING([--with-iwyu],
 2107         [Use given IWYU binary path to check unneeded includes instead of building.
 2108          Use only if you are hacking on it.]),
 2109 ,)
 2110 
 2111 libo_FUZZ_ARG_WITH(lxml,
 2112     AS_HELP_STRING([--without-lxml],
 2113         [gla11y will use python lxml when available, potentially building a local copy if necessary.
 2114          --without-lxml tells it to not use python lxml at all, which means that gla11y will only
 2115          report widget classes and ids.]),
 2116 ,)
 2117 
 2118 dnl ===================================================================
 2119 dnl Branding
 2120 dnl ===================================================================
 2121 
 2122 AC_ARG_WITH(branding,
 2123     AS_HELP_STRING([--with-branding=/path/to/images],
 2124         [Use given path to retrieve branding images set.])
 2125     [
 2126                           Search for intro.png about.svg and flat_logo.svg.
 2127                           If any is missing, default ones will be used instead.
 2128 
 2129                           Search also progress.conf for progress
 2130                           settings on intro screen :
 2131 
 2132                           PROGRESSBARCOLOR="255,255,255" Set color of
 2133                           progress bar. Comma separated RGB decimal values.
 2134                           PROGRESSSIZE="407,6" Set size of progress bar.
 2135                           Comma separated decimal values (width, height).
 2136                           PROGRESSPOSITION="61,317" Set position of progress
 2137                           bar from left,top. Comma separated decimal values.
 2138                           PROGRESSFRAMECOLOR="20,136,3" Set color of progress
 2139                           bar frame. Comma separated RGB decimal values.
 2140                           PROGRESSTEXTCOLOR="0,0,0" Set color of progress
 2141                           bar text. Comma separated RGB decimal values.
 2142                           PROGRESSTEXTBASELINE="287" Set vertical position of
 2143                           progress bar text from top. Decimal value.
 2144 
 2145                           Default values will be used if not found.
 2146     ],
 2147 ,)
 2148 
 2149 
 2150 AC_ARG_WITH(extra-buildid,
 2151     AS_HELP_STRING([--with-extra-buildid="Tinderbox: Win-x86@6, Branch:master, Date:2012-11-26_00.29.34"],
 2152         [Show addition build identification in about dialog.]),
 2153 ,)
 2154 
 2155 
 2156 AC_ARG_WITH(vendor,
 2157     AS_HELP_STRING([--with-vendor="John the Builder"],
 2158         [Set vendor of the build.]),
 2159 ,)
 2160 
 2161 AC_ARG_WITH(android-package-name,
 2162     AS_HELP_STRING([--with-android-package-name="org.libreoffice"],
 2163         [Set Android package name of the build.]),
 2164 ,)
 2165 
 2166 AC_ARG_WITH(compat-oowrappers,
 2167     AS_HELP_STRING([--with-compat-oowrappers],
 2168         [Install oo* wrappers in parallel with
 2169          lo* ones to keep backward compatibility.
 2170          Has effect only with make distro-pack-install]),
 2171 ,)
 2172 
 2173 AC_ARG_WITH(os-version,
 2174     AS_HELP_STRING([--with-os-version=<OSVERSION>],
 2175         [For FreeBSD users, use this option to override the detected OSVERSION.]),
 2176 ,)
 2177 
 2178 AC_ARG_WITH(mingw-cross-compiler,
 2179     AS_HELP_STRING([--with-mingw-cross-compiler=<mingw32-g++ command>],
 2180         [Specify the MinGW cross-compiler to use.
 2181          When building on the ODK on Unix and building unowinreg.dll,
 2182          specify the MinGW C++ cross-compiler.]),
 2183 ,)
 2184 
 2185 AC_ARG_WITH(idlc-cpp,
 2186     AS_HELP_STRING([--with-idlc-cpp=<cpp/ucpp>],
 2187         [Specify the C Preprocessor to use for idlc. Default is ucpp.]),
 2188 ,)
 2189 
 2190 AC_ARG_WITH(build-version,
 2191     AS_HELP_STRING([--with-build-version="Built by Jim"],
 2192         [Allows the builder to add a custom version tag that will appear in the
 2193          Help/About box for QA purposes.]),
 2194 with_build_version=$withval,
 2195 )
 2196 
 2197 AC_ARG_WITH(parallelism,
 2198     AS_HELP_STRING([--with-parallelism],
 2199         [Number of jobs to run simultaneously during build. Parallel builds can
 2200         save a lot of time on multi-cpu machines. Defaults to the number of
 2201         CPUs on the machine, unless you configure --enable-icecream - then to
 2202         10.]),
 2203 ,)
 2204 
 2205 AC_ARG_WITH(all-tarballs,
 2206     AS_HELP_STRING([--with-all-tarballs],
 2207         [Download all external tarballs unconditionally]))
 2208 
 2209 AC_ARG_WITH(gdrive-client-id,
 2210     AS_HELP_STRING([--with-gdrive-client-id],
 2211         [Provides the client id of the application for OAuth2 authentication
 2212         on Google Drive. If either this or --with-gdrive-client-secret is
 2213         empty, the feature will be disabled]),
 2214 )
 2215 
 2216 AC_ARG_WITH(gdrive-client-secret,
 2217     AS_HELP_STRING([--with-gdrive-client-secret],
 2218         [Provides the client secret of the application for OAuth2
 2219         authentication on Google Drive. If either this or
 2220         --with-gdrive-client-id is empty, the feature will be disabled]),
 2221 )
 2222 
 2223 AC_ARG_WITH(alfresco-cloud-client-id,
 2224     AS_HELP_STRING([--with-alfresco-cloud-client-id],
 2225         [Provides the client id of the application for OAuth2 authentication
 2226         on Alfresco Cloud. If either this or --with-alfresco-cloud-client-secret is
 2227         empty, the feature will be disabled]),
 2228 )
 2229 
 2230 AC_ARG_WITH(alfresco-cloud-client-secret,
 2231     AS_HELP_STRING([--with-alfresco-cloud-client-secret],
 2232         [Provides the client secret of the application for OAuth2
 2233         authentication on Alfresco Cloud. If either this or
 2234         --with-alfresco-cloud-client-id is empty, the feature will be disabled]),
 2235 )
 2236 
 2237 AC_ARG_WITH(onedrive-client-id,
 2238     AS_HELP_STRING([--with-onedrive-client-id],
 2239         [Provides the client id of the application for OAuth2 authentication
 2240         on OneDrive. If either this or --with-onedrive-client-secret is
 2241         empty, the feature will be disabled]),
 2242 )
 2243 
 2244 AC_ARG_WITH(onedrive-client-secret,
 2245     AS_HELP_STRING([--with-onedrive-client-secret],
 2246         [Provides the client secret of the application for OAuth2
 2247         authentication on OneDrive. If either this or
 2248         --with-onedrive-client-id is empty, the feature will be disabled]),
 2249 )
 2250 dnl ===================================================================
 2251 dnl Do we want to use pre-build binary tarball for recompile
 2252 dnl ===================================================================
 2253 
 2254 if test "$enable_library_bin_tar" = "yes" ; then
 2255     USE_LIBRARY_BIN_TAR=TRUE
 2256 else
 2257     USE_LIBRARY_BIN_TAR=
 2258 fi
 2259 AC_SUBST(USE_LIBRARY_BIN_TAR)
 2260 
 2261 dnl ===================================================================
 2262 dnl Test whether build target is Release Build
 2263 dnl ===================================================================
 2264 AC_MSG_CHECKING([whether build target is Release Build])
 2265 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
 2266     AC_MSG_RESULT([no])
 2267     ENABLE_RELEASE_BUILD=
 2268 else
 2269     AC_MSG_RESULT([yes])
 2270     ENABLE_RELEASE_BUILD=TRUE
 2271 fi
 2272 AC_SUBST(ENABLE_RELEASE_BUILD)
 2273 
 2274 dnl ===================================================================
 2275 dnl Test whether to sign Windows Build
 2276 dnl ===================================================================
 2277 AC_MSG_CHECKING([whether to sign windows build])
 2278 if test "$enable_windows_build_signing" = "yes" -a "$_os" = "WINNT"; then
 2279     AC_MSG_RESULT([yes])
 2280     WINDOWS_BUILD_SIGNING="TRUE"
 2281 else
 2282     AC_MSG_RESULT([no])
 2283     WINDOWS_BUILD_SIGNING="FALSE"
 2284 fi
 2285 AC_SUBST(WINDOWS_BUILD_SIGNING)
 2286 
 2287 dnl ===================================================================
 2288 dnl MacOSX build and runtime environment options
 2289 dnl ===================================================================
 2290 
 2291 AC_ARG_WITH(macosx-sdk,
 2292     AS_HELP_STRING([--with-macosx-sdk=<version>],
 2293         [Prefer a specific SDK for building.])
 2294     [
 2295                           If the requested SDK is not available, a search for the oldest one will be done.
 2296                           With current Xcode versions, only the latest SDK is included, so this option is
 2297                           not terribly useful. It works fine to build with a new SDK and run the result
 2298                           on an older OS.
 2299 
 2300                           e. g.: --with-macosx-sdk=10.9
 2301 
 2302                           there are 3 options to control the MacOSX build:
 2303                           --with-macosx-sdk (referred as 'sdk' below)
 2304                           --with-macosx-version-min-required (referred as 'min' below)
 2305                           --with-macosx-version-max-allowed (referred as 'max' below)
 2306 
 2307                           the connection between these value and the default they take is as follow:
 2308                           ( ? means not specified on the command line, s means the SDK version found,
 2309                           constraint: 8 <= x <= y <= z)
 2310 
 2311                           ==========================================
 2312                            command line      || config result
 2313                           ==========================================
 2314                           min  | max  | sdk  || min  | max  | sdk  |
 2315                           ?    | ?    | ?    || 10.9 | 10.s | 10.s |
 2316                           ?    | ?    | 10.x || 10.9 | 10.x | 10.x |
 2317                           ?    | 10.x | ?    || 10.9 | 10.s | 10.s |
 2318                           ?    | 10.x | 10.y || 10.9 | 10.x | 10.y |
 2319                           10.x | ?    | ?    || 10.x | 10.s | 10.s |
 2320                           10.x | ?    | 10.y || 10.x | 10.y | 10.y |
 2321                           10.x | 10.y | ?    || 10.x | 10.y | 10.y |
 2322                           10.x | 10.y | 10.z || 10.x | 10.y | 10.z |
 2323 
 2324 
 2325                           see: http://developer.apple.com/library/mac/#technotes/tn2064/_index.html
 2326                           for a detailed technical explanation of these variables
 2327 
 2328                           Note: MACOSX_DEPLOYMENT_TARGET will be set to the value of 'min'.
 2329     ],
 2330 ,)
 2331 
 2332 AC_ARG_WITH(macosx-version-min-required,
 2333     AS_HELP_STRING([--with-macosx-version-min-required=<version>],
 2334         [set the minimum OS version needed to run the built LibreOffice])
 2335     [
 2336                           e. g.: --with-macos-version-min-required=10.9
 2337                           see --with-macosx-sdk for more info
 2338     ],
 2339 ,)
 2340 
 2341 AC_ARG_WITH(macosx-version-max-allowed,
 2342     AS_HELP_STRING([--with-macosx-version-max-allowed=<version>],
 2343         [set the maximum allowed OS version the LibreOffice compilation can use APIs from])
 2344     [
 2345                           e. g.: --with-macos-version-max-allowed=10.9
 2346                           see --with-macosx-sdk for more info
 2347     ],
 2348 ,)
 2349 
 2350 
 2351 dnl ===================================================================
 2352 dnl options for stuff used during cross-compilation build
 2353 dnl Not quite superseded by --with-build-platform-configure-options.
 2354 dnl TODO: check, if the "force" option is still needed anywhere.
 2355 dnl ===================================================================
 2356 
 2357 AC_ARG_WITH(system-icu-for-build,
 2358     AS_HELP_STRING([--with-system-icu-for-build=yes/no/force],
 2359         [Use icu already on system for build tools (cross-compilation only).]))
 2360 
 2361 
 2362 dnl ===================================================================
 2363 dnl Check for incompatible options set by fuzzing, and reset those
 2364 dnl automatically to working combinations
 2365 dnl ===================================================================
 2366 
 2367 if test "$libo_fuzzed_enable_dbus" = yes -a "$libo_fuzzed_enable_avahi" -a \
 2368         "$enable_dbus" != "$enable_avahi"; then
 2369     AC_MSG_NOTICE([Resetting --enable-avahi=$enable_dbus])
 2370     enable_avahi=$enable_dbus
 2371 fi
 2372 
 2373 dnl ===================================================================
 2374 dnl check for required programs (grep, awk, sed, bash)
 2375 dnl ===================================================================
 2376 
 2377 pathmunge ()
 2378 {
 2379     if test -n "$1"; then
 2380         if test "$build_os" = "cygwin"; then
 2381             if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 2382                 PathFormat "$1"
 2383                 new_path=`cygpath -sm "$formatted_path"`
 2384             else
 2385                 PathFormat "$1"
 2386                 new_path=`cygpath -u "$formatted_path"`
 2387             fi
 2388         else
 2389             new_path="$1"
 2390         fi
 2391         if ! echo "$LO_PATH" | $EGREP -q "(^|:)$1($|:)"; then
 2392             if test "$2" = "after"; then
 2393                 LO_PATH="$LO_PATH${P_SEP}$new_path"
 2394             else
 2395                 LO_PATH="$new_path${P_SEP}$LO_PATH"
 2396             fi
 2397         fi
 2398         unset new_path
 2399     fi
 2400 }
 2401 
 2402 AC_PROG_AWK
 2403 AC_PATH_PROG( AWK, $AWK)
 2404 if test -z "$AWK"; then
 2405     AC_MSG_ERROR([install awk to run this script])
 2406 fi
 2407 
 2408 AC_PATH_PROG(BASH, bash)
 2409 if test -z "$BASH"; then
 2410     AC_MSG_ERROR([bash not found in \$PATH])
 2411 fi
 2412 AC_SUBST(BASH)
 2413 
 2414 AC_MSG_CHECKING([for GNU or BSD tar])
 2415 for a in $GNUTAR gtar gnutar bsdtar tar /usr/sfw/bin/gtar; do
 2416     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
 2417     if test $? -eq 0;  then
 2418         GNUTAR=$a
 2419         break
 2420     fi
 2421 done
 2422 AC_MSG_RESULT($GNUTAR)
 2423 if test -z "$GNUTAR"; then
 2424     AC_MSG_ERROR([not found. install GNU or BSD tar.])
 2425 fi
 2426 AC_SUBST(GNUTAR)
 2427 
 2428 AC_MSG_CHECKING([for tar's option to strip components])
 2429 $GNUTAR --help 2> /dev/null | egrep "bsdtar|strip-components" 2>&1 >/dev/null
 2430 if test $? -eq 0; then
 2431     STRIP_COMPONENTS="--strip-components"
 2432 else
 2433     $GNUTAR --help 2> /dev/null | egrep "strip-path" 2>&1 >/dev/null
 2434     if test $? -eq 0; then
 2435         STRIP_COMPONENTS="--strip-path"
 2436     else
 2437         STRIP_COMPONENTS="unsupported"
 2438     fi
 2439 fi
 2440 AC_MSG_RESULT($STRIP_COMPONENTS)
 2441 if test x$STRIP_COMPONENTS = xunsupported; then
 2442     AC_MSG_ERROR([you need a tar that is able to strip components.])
 2443 fi
 2444 AC_SUBST(STRIP_COMPONENTS)
 2445 
 2446 dnl It is useful to have a BUILD_TYPE keyword to distinguish "normal"
 2447 dnl desktop OSes from "mobile" ones.
 2448 
 2449 dnl We assume that a non-DESKTOP build type is also a non-NATIVE one.
 2450 dnl In other words, that when building for an OS that is not a
 2451 dnl "desktop" one but a "mobile" one, we are always cross-compiling.
 2452 
 2453 dnl Note the direction of the implication; there is no assumption that
 2454 dnl cross-compiling would imply a non-desktop OS.
 2455 
 2456 if test $_os != iOS -a $_os != Android -a "$enable_fuzzers" != "yes"; then
 2457     BUILD_TYPE="$BUILD_TYPE DESKTOP"
 2458     AC_DEFINE(HAVE_FEATURE_DESKTOP)
 2459     AC_DEFINE(HAVE_FEATURE_MULTIUSER_ENVIRONMENT)
 2460 fi
 2461 
 2462 # Whether to build "avmedia" functionality or not.
 2463 
 2464 if test -z "$enable_avmedia"; then
 2465     enable_avmedia=yes
 2466 fi
 2467 
 2468 BUILD_TYPE="$BUILD_TYPE AVMEDIA"
 2469 if test "$enable_avmedia" = yes; then
 2470     AC_DEFINE(HAVE_FEATURE_AVMEDIA)
 2471 else
 2472     USE_AVMEDIA_DUMMY='TRUE'
 2473 fi
 2474 AC_SUBST(USE_AVMEDIA_DUMMY)
 2475 
 2476 # Decide whether to build database connectivity stuff (including
 2477 # Base) or not. We probably don't want to on non-desktop OSes.
 2478 if test -z "$enable_database_connectivity"; then
 2479     # --disable-database-connectivity is unfinished work in progress
 2480     # and the iOS test app doesn't link if we actually try to use it.
 2481     # if test $_os != iOS -a $_os != Android; then
 2482     if test $_os != iOS; then
 2483         enable_database_connectivity=yes
 2484     fi
 2485 fi
 2486 
 2487 if test "$enable_database_connectivity" = yes; then
 2488     BUILD_TYPE="$BUILD_TYPE DBCONNECTIVITY"
 2489     AC_DEFINE(HAVE_FEATURE_DBCONNECTIVITY)
 2490 fi
 2491 
 2492 if test -z "$enable_extensions"; then
 2493     # For iOS and Android disable extensions unless specifically overridden with --enable-extensions.
 2494     if test $_os != iOS -a $_os != Android; then
 2495         enable_extensions=yes
 2496     fi
 2497 fi
 2498 
 2499 if test "$enable_extensions" = yes; then
 2500     BUILD_TYPE="$BUILD_TYPE EXTENSIONS"
 2501     AC_DEFINE(HAVE_FEATURE_EXTENSIONS)
 2502 fi
 2503 
 2504 if test -z "$enable_scripting"; then
 2505     # Disable scripting for iOS unless specifically overridden
 2506     # with --enable-scripting.
 2507     if test $_os != iOS; then
 2508         enable_scripting=yes
 2509     fi
 2510 fi
 2511 
 2512 DISABLE_SCRIPTING=''
 2513 if test "$enable_scripting" = yes; then
 2514     BUILD_TYPE="$BUILD_TYPE SCRIPTING"
 2515     AC_DEFINE(HAVE_FEATURE_SCRIPTING)
 2516 else
 2517     DISABLE_SCRIPTING='TRUE'
 2518     SCPDEFS="$SCPDEFS -DDISABLE_SCRIPTING"
 2519 fi
 2520 
 2521 if test $_os = iOS -o $_os = Android; then
 2522     # Disable dynamic_loading always for iOS and Android
 2523     enable_dynamic_loading=no
 2524 elif test -z "$enable_dynamic_loading"; then
 2525     # Otherwise enable it unless speficically disabled
 2526     enable_dynamic_loading=yes
 2527 fi
 2528 
 2529 DISABLE_DYNLOADING=''
 2530 if test "$enable_dynamic_loading" = yes; then
 2531     BUILD_TYPE="$BUILD_TYPE DYNLOADING"
 2532 else
 2533     DISABLE_DYNLOADING='TRUE'
 2534 fi
 2535 AC_SUBST(DISABLE_DYNLOADING)
 2536 
 2537 # remenber SYSBASE value
 2538 AC_SUBST(SYSBASE)
 2539 
 2540 dnl ===================================================================
 2541 dnl  Sort out various gallery compilation options
 2542 dnl ===================================================================
 2543 AC_MSG_CHECKING([how to build and package galleries])
 2544 if test -n "${with_galleries}"; then
 2545     if test "$with_galleries" = "build"; then
 2546         WITH_GALLERY_BUILD=TRUE
 2547         AC_MSG_RESULT([build from source images internally])
 2548     elif test "$with_galleries" = "no"; then
 2549         WITH_GALLERY_BUILD=
 2550         AC_MSG_RESULT([disable non-internal gallery build])
 2551     else
 2552         AC_MSG_ERROR([unknown value --with-galleries=$with_galleries])
 2553     fi
 2554 else
 2555     if test $_os != iOS -a $_os != Android; then
 2556         WITH_GALLERY_BUILD=TRUE
 2557         AC_MSG_RESULT([internal src images for desktop])
 2558     else
 2559         WITH_GALLERY_BUILD=
 2560         AC_MSG_RESULT([disable src image build])
 2561     fi
 2562 fi
 2563 AC_SUBST(WITH_GALLERY_BUILD)
 2564 
 2565 dnl ===================================================================
 2566 dnl  Checks if ccache is available
 2567 dnl ===================================================================
 2568 if test "$_os" = "WINNT"; then
 2569     # on windows/VC build do not use ccache
 2570     CCACHE=""
 2571 elif test "$enable_ccache" = "yes" -o \( "$enable_ccache" = "" -a "$enable_icecream" != "yes" \); then
 2572     case "%$CC%$CXX%" in
 2573     # If $CC and/or $CXX already contain "ccache" (possibly suffixed with some version number etc),
 2574     # assume that's good then
 2575     *%ccache[[-_' ']]*|*/ccache[[-_' ']]*)
 2576         AC_MSG_NOTICE([ccache seems to be included in a pre-defined CC and/or CXX])
 2577         ;;
 2578     *)
 2579         AC_PATH_PROG([CCACHE],[ccache],[not found])
 2580         if test "$CCACHE" = "not found"; then
 2581             CCACHE=""
 2582         else
 2583             # Need to check for ccache version: otherwise prevents
 2584             # caching of the results (like "-x objective-c++" for Mac)
 2585             if test $_os = Darwin -o $_os = iOS; then
 2586                 # Check ccache version
 2587                 AC_MSG_CHECKING([whether version of ccache is suitable])
 2588                 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'`
 2589                 CCACHE_NUMVER=`echo $CCACHE_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
 2590                 if test "$CCACHE_VERSION" = "2.4_OOo" -o "$CCACHE_NUMVER" -ge "030100"; then
 2591                     AC_MSG_RESULT([yes, $CCACHE_VERSION])
 2592                 else
 2593                     AC_MSG_RESULT([no, $CCACHE_VERSION])
 2594                     CCACHE=""
 2595                 fi
 2596             fi
 2597         fi
 2598         ;;
 2599     esac
 2600 else
 2601     CCACHE=""
 2602 fi
 2603 
 2604 if test "$CCACHE" != ""; then
 2605     ccache_size_msg=$([ccache -s | tail -n 1 | sed 's/^[^0-9]*//' | sed -e 's/\.[0-9]*//'])
 2606     ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//')
 2607     if test "$ccache_size" = ""; then
 2608         ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
 2609         if test "$ccache_size" = ""; then
 2610             ccache_size=0
 2611         fi
 2612         # we could not determine the size or it was less than 1GB -> disable auto-ccache
 2613         if test $ccache_size -lt 1024; then
 2614             CCACHE=""
 2615             AC_MSG_WARN([ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection])
 2616             add_warning "ccache's cache size is less than 1GB using it is counter-productive: auto-ccache detection disabled"
 2617         else
 2618             # warn that ccache may be too small for debug build
 2619             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
 2620             add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
 2621         fi
 2622     else
 2623         if test $ccache_size -lt 5; then
 2624             #warn that ccache may be too small for debug build
 2625             AC_MSG_WARN([ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build])
 2626             add_warning "ccache's cache size is less than 5GB using it may be counter-productive for debug or symbol-enabled build"
 2627         fi
 2628     fi
 2629 fi
 2630 
 2631 dnl ===================================================================
 2632 dnl  Checks for C compiler,
 2633 dnl  The check for the C++ compiler is later on.
 2634 dnl ===================================================================
 2635 if test "$_os" != "WINNT"; then
 2636     GCC_HOME_SET="true"
 2637     AC_MSG_CHECKING([gcc home])
 2638     if test -z "$with_gcc_home"; then
 2639         if test "$enable_icecream" = "yes"; then
 2640             if test -d "/usr/lib/icecc/bin"; then
 2641                 GCC_HOME="/usr/lib/icecc/"
 2642             elif test -d "/usr/libexec/icecc/bin"; then
 2643                 GCC_HOME="/usr/libexec/icecc/"
 2644             elif test -d "/opt/icecream/bin"; then
 2645                 GCC_HOME="/opt/icecream/"
 2646             else
 2647                 AC_MSG_ERROR([Could not figure out the location of icecream GCC wrappers, manually use --with-gcc-home])
 2648 
 2649             fi
 2650         else
 2651             GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
 2652             GCC_HOME_SET="false"
 2653         fi
 2654     else
 2655         GCC_HOME="$with_gcc_home"
 2656     fi
 2657     AC_MSG_RESULT($GCC_HOME)
 2658     AC_SUBST(GCC_HOME)
 2659 
 2660     if test "$GCC_HOME_SET" = "true"; then
 2661         if test -z "$CC"; then
 2662             CC="$GCC_HOME/bin/gcc"
 2663         fi
 2664         if test -z "$CXX"; then
 2665             CXX="$GCC_HOME/bin/g++"
 2666         fi
 2667     fi
 2668 fi
 2669 
 2670 COMPATH=`dirname "$CC"`
 2671 if test "$COMPATH" = "."; then
 2672     AC_PATH_PROGS(COMPATH, $CC)
 2673     dnl double square bracket to get single because of M4 quote...
 2674     COMPATH=`echo $COMPATH | $SED "s@/[[^/:]]*\\\$@@"`
 2675 fi
 2676 COMPATH=`echo $COMPATH | $SED "s@/[[Bb]][[Ii]][[Nn]]\\\$@@"`
 2677 
 2678 dnl ===================================================================
 2679 dnl Java support
 2680 dnl ===================================================================
 2681 AC_MSG_CHECKING([whether to build with Java support])
 2682 if test "$with_java" != "no"; then
 2683     if test "$DISABLE_SCRIPTING" = TRUE; then
 2684         AC_MSG_RESULT([no, overridden by --disable-scripting])
 2685         ENABLE_JAVA=""
 2686         with_java=no
 2687     else
 2688         AC_MSG_RESULT([yes])
 2689         ENABLE_JAVA="TRUE"
 2690         AC_DEFINE(HAVE_FEATURE_JAVA)
 2691     fi
 2692 else
 2693     AC_MSG_RESULT([no])
 2694     ENABLE_JAVA=""
 2695 fi
 2696 
 2697 AC_SUBST(ENABLE_JAVA)
 2698 
 2699 dnl ENABLE_JAVA="TRUE" if we want there to be *run-time* (and build-time) support for Java
 2700 
 2701 dnl ENABLE_JAVA="" indicate no Java support at all
 2702 
 2703 dnl ===================================================================
 2704 dnl Check OS X SDK and compiler
 2705 dnl ===================================================================
 2706 
 2707 if test $_os = Darwin -o $_os = iOS; then
 2708 
 2709     # If no --with-macosx-sdk option is given, look for one
 2710 
 2711     # The intent is that for "most" Mac-based developers, a suitable
 2712     # SDK will be found automatically without any configure options.
 2713 
 2714     # For developers with a current Xcode, the lowest-numbered SDK
 2715     # higher than or equal to the minimum required should be found.
 2716 
 2717     AC_MSG_CHECKING([what Mac OS X SDK to use])
 2718     for _macosx_sdk in ${with_macosx_sdk-10.14 10.13 10.12}; do
 2719         MACOSX_SDK_PATH=`xcrun --sdk macosx${_macosx_sdk} --show-sdk-path 2> /dev/null`
 2720         if test -d "$MACOSX_SDK_PATH"; then
 2721             with_macosx_sdk="${_macosx_sdk}"
 2722             break
 2723         else
 2724             MACOSX_SDK_PATH="`xcode-select -print-path`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_macosx_sdk}.sdk"
 2725             if test -d "$MACOSX_SDK_PATH"; then
 2726                 with_macosx_sdk="${_macosx_sdk}"
 2727                 break
 2728             fi
 2729         fi
 2730     done
 2731     if test ! -d "$MACOSX_SDK_PATH"; then
 2732         AC_MSG_ERROR([Could not find an appropriate Mac OS X SDK])
 2733     fi
 2734 
 2735     if test $_os = iOS; then
 2736         if test "$enable_ios_simulator" = "yes"; then
 2737             useos=iphonesimulator
 2738         else
 2739             useos=iphoneos
 2740         fi
 2741         MACOSX_SDK_PATH=`xcrun --sdk ${useos} --show-sdk-path 2> /dev/null`
 2742     fi
 2743     AC_MSG_RESULT([SDK $with_macosx_sdk at $MACOSX_SDK_PATH])
 2744 
 2745 
 2746     case $with_macosx_sdk in
 2747     10.12)
 2748         MACOSX_SDK_VERSION=101200
 2749         ;;
 2750     10.13)
 2751         MACOSX_SDK_VERSION=101300
 2752         ;;
 2753     10.14)
 2754         MACOSX_SDK_VERSION=101400
 2755         ;;
 2756     *)
 2757         AC_MSG_ERROR([with-macosx-sdk $with_macosx_sdk is not a supported value, supported values are 10.12--14])
 2758         ;;
 2759     esac
 2760 
 2761     if test "$with_macosx_version_min_required" = "" ; then
 2762         with_macosx_version_min_required="10.9";
 2763     fi
 2764 
 2765     if test "$with_macosx_version_max_allowed" = "" ; then
 2766         with_macosx_version_max_allowed="$with_macosx_sdk"
 2767     fi
 2768 
 2769     # export this so that "xcrun" invocations later return matching values
 2770     DEVELOPER_DIR="${MACOSX_SDK_PATH%/SDKs*}"
 2771     DEVELOPER_DIR="${DEVELOPER_DIR%/Platforms*}"
 2772     export DEVELOPER_DIR
 2773     FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
 2774     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
 2775 
 2776     case "$with_macosx_version_min_required" in
 2777     10.9)
 2778         MAC_OS_X_VERSION_MIN_REQUIRED="1090"
 2779         ;;
 2780     10.10)
 2781         MAC_OS_X_VERSION_MIN_REQUIRED="101000"
 2782         ;;
 2783     10.11)
 2784         MAC_OS_X_VERSION_MIN_REQUIRED="101100"
 2785         ;;
 2786     10.12)
 2787         MAC_OS_X_VERSION_MIN_REQUIRED="101200"
 2788         ;;
 2789     10.13)
 2790         MAC_OS_X_VERSION_MIN_REQUIRED="101300"
 2791         ;;
 2792     10.14)
 2793         MAC_OS_X_VERSION_MIN_REQUIRED="101400"
 2794         ;;
 2795     *)
 2796         AC_MSG_ERROR([with-macosx-version-min-required $with_macosx_version_min_required is not a supported value, supported values are 10.9--14])
 2797         ;;
 2798     esac
 2799     MAC_OS_X_VERSION_MIN_REQUIRED_DOTS=$with_macosx_version_min_required
 2800 
 2801     LIBTOOL=/usr/bin/libtool
 2802     INSTALL_NAME_TOOL=install_name_tool
 2803     if test -z "$save_CC"; then
 2804         AC_MSG_CHECKING([what compiler to use])
 2805         stdlib=-stdlib=libc++
 2806         if test "$ENABLE_LTO" = TRUE; then
 2807             lto=-flto
 2808         fi
 2809         CC="`xcrun -find clang` -m64 $lto -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
 2810         CXX="`xcrun -find clang++` -m64 $lto $stdlib -mmacosx-version-min=$with_macosx_version_min_required -isysroot $MACOSX_SDK_PATH"
 2811         INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
 2812         AR=`xcrun -find ar`
 2813         NM=`xcrun -find nm`
 2814         STRIP=`xcrun -find strip`
 2815         LIBTOOL=`xcrun -find libtool`
 2816         RANLIB=`xcrun -find ranlib`
 2817         AC_MSG_RESULT([$CC and $CXX])
 2818     fi
 2819 
 2820     case "$with_macosx_version_max_allowed" in
 2821     10.9)
 2822         MAC_OS_X_VERSION_MAX_ALLOWED="1090"
 2823         ;;
 2824     10.10)
 2825         MAC_OS_X_VERSION_MAX_ALLOWED="101000"
 2826         ;;
 2827     10.11)
 2828         MAC_OS_X_VERSION_MAX_ALLOWED="101100"
 2829         ;;
 2830     10.12)
 2831         MAC_OS_X_VERSION_MAX_ALLOWED="101200"
 2832         ;;
 2833     10.13)
 2834         MAC_OS_X_VERSION_MAX_ALLOWED="101300"
 2835         ;;
 2836     10.14)
 2837         MAC_OS_X_VERSION_MAX_ALLOWED="101400"
 2838         ;;
 2839     *)
 2840         AC_MSG_ERROR([with-macosx-version-max-allowed $with_macosx_version_max_allowed is not a supported value, supported values are 10.9--14])
 2841         ;;
 2842     esac
 2843 
 2844     AC_MSG_CHECKING([that macosx-version-min-required is coherent with macosx-version-max-allowed])
 2845     if test $MAC_OS_X_VERSION_MIN_REQUIRED -gt $MAC_OS_X_VERSION_MAX_ALLOWED; then
 2846         AC_MSG_ERROR([the version minimumn required, $MAC_OS_X_VERSION_MIN_REQUIRED, must be <= the version maximum allowed, $MAC_OS_X_VERSION_MAX_ALLOWED])
 2847     else
 2848         AC_MSG_RESULT([ok])
 2849     fi
 2850 
 2851     AC_MSG_CHECKING([that macosx-version-max-allowed is coherent with macos-with-sdk])
 2852     if test $MAC_OS_X_VERSION_MAX_ALLOWED -gt $MACOSX_SDK_VERSION; then
 2853         AC_MSG_ERROR([the version maximum allowed cannot be greater than the sdk level])
 2854     else
 2855         AC_MSG_RESULT([ok])
 2856     fi
 2857     AC_MSG_NOTICE([MAC_OS_X_VERSION_MIN_REQUIRED=$MAC_OS_X_VERSION_MIN_REQUIRED])
 2858     AC_MSG_NOTICE([MAC_OS_X_VERSION_MAX_ALLOWED=$MAC_OS_X_VERSION_MAX_ALLOWED])
 2859 
 2860     AC_MSG_CHECKING([whether to do code signing])
 2861 
 2862     if test "$enable_macosx_code_signing" = yes; then
 2863         # By default use the first suitable certificate (?).
 2864 
 2865         # http://stackoverflow.com/questions/13196291/difference-between-mac-developer-and-3rd-party-mac-developer-application
 2866         # says that the "Mac Developer" certificate is useful just for self-testing. For distribution
 2867         # outside the Mac App Store, use the "Developer ID Application" one, and for distribution in
 2868         # the App Store, the "3rd Party Mac Developer" one. I think it works best to the
 2869         # "Developer ID Application" one.
 2870 
 2871         identity=`security find-identity -p codesigning -v 2>/dev/null | grep 'Developer ID Application:' | $AWK '{print $2}' |head -1`
 2872         if test -n "$identity"; then
 2873             MACOSX_CODESIGNING_IDENTITY=$identity
 2874             pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
 2875             AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
 2876         else
 2877             AC_MSG_ERROR([cannot determine identity to use])
 2878         fi
 2879     elif test -n "$enable_macosx_code_signing" -a "$enable_macosx_code_signing" != no ; then
 2880         MACOSX_CODESIGNING_IDENTITY=$enable_macosx_code_signing
 2881         pretty_name=`security find-identity -p codesigning -v | grep "$MACOSX_CODESIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
 2882         AC_MSG_RESULT([yes, using the identity $MACOSX_CODESIGNING_IDENTITY for $pretty_name])
 2883     else
 2884         AC_MSG_RESULT([no])
 2885     fi
 2886 
 2887     AC_MSG_CHECKING([whether to create a Mac App Store package])
 2888 
 2889     if test -n "$enable_macosx_package_signing" -a -z "$MACOSX_CODESIGNING_IDENTITY"; then
 2890         AC_MSG_ERROR([You forgot --enable-macosx-code-signing])
 2891     elif test "$enable_macosx_package_signing" = yes; then
 2892         # By default use the first suitable certificate.
 2893         # It should be a "3rd Party Mac Developer Installer" one
 2894 
 2895         identity=`security find-identity -v 2>/dev/null | grep '3rd Party Mac Developer Installer:' | awk '{print $2}' |head -1`
 2896         if test -n "$identity"; then
 2897             MACOSX_PACKAGE_SIGNING_IDENTITY=$identity
 2898             pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
 2899             AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
 2900         else
 2901             AC_MSG_ERROR([Could not find any suitable '3rd Party Mac Developer Installer' certificate])
 2902         fi
 2903     elif test -n "$enable_macosx_package_signing"; then
 2904         MACOSX_PACKAGE_SIGNING_IDENTITY=$enable_macosx_package_signing
 2905         pretty_name=`security find-identity -v | grep "$MACOSX_PACKAGE_SIGNING_IDENTITY" | sed -e 's/^[[^"]]*"//' -e 's/"//'`
 2906         AC_MSG_RESULT([yes, using the identity $MACOSX_PACKAGE_SIGNING_IDENTITY for $pretty_name])
 2907     else
 2908         AC_MSG_RESULT([no])
 2909     fi
 2910 
 2911     if test -n "$MACOSX_CODESIGNING_IDENTITY" -a -n "$MACOSX_PACKAGE_SIGNING_IDENTITY" -a "$MACOSX_CODESIGNING_IDENTITY" = "$MACOSX_PACKAGE_SIGNING_IDENTITY"; then
 2912         AC_MSG_ERROR([You should not use the same identity for code and package signing])
 2913     fi
 2914 
 2915     AC_MSG_CHECKING([whether to sandbox the application])
 2916 
 2917     if test -z "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
 2918         AC_MSG_ERROR([OS X sandboxing requires code signing])
 2919     elif test -n "$ENABLE_JAVA" -a "$enable_macosx_sandbox" = yes; then
 2920         AC_MSG_ERROR([OS X sandboxing (actually App Store rules) disallows use of Java])
 2921     elif test -n "$MACOSX_CODESIGNING_IDENTITY" -a "$enable_macosx_sandbox" = yes; then
 2922         ENABLE_MACOSX_SANDBOX=TRUE
 2923         AC_DEFINE(HAVE_FEATURE_MACOSX_SANDBOX)
 2924         AC_MSG_RESULT([yes])
 2925     else
 2926         AC_MSG_RESULT([no])
 2927     fi
 2928 
 2929     AC_MSG_CHECKING([what OS X app bundle identifier to use])
 2930     MACOSX_BUNDLE_IDENTIFIER=$with_macosx_bundle_identifier
 2931     AC_MSG_RESULT([$MACOSX_BUNDLE_IDENTIFIER])
 2932 fi
 2933 AC_SUBST(MACOSX_SDK_PATH)
 2934 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
 2935 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED)
 2936 AC_SUBST(MAC_OS_X_VERSION_MIN_REQUIRED_DOTS)
 2937 AC_SUBST(MAC_OS_X_VERSION_MAX_ALLOWED)
 2938 AC_SUBST(INSTALL_NAME_TOOL)
 2939 AC_SUBST(LIBTOOL) # Note that the OS X libtool command is unrelated to GNU libtool
 2940 AC_SUBST(MACOSX_CODESIGNING_IDENTITY)
 2941 AC_SUBST(MACOSX_PACKAGE_SIGNING_IDENTITY)
 2942 AC_SUBST(ENABLE_MACOSX_SANDBOX)
 2943 AC_SUBST(MACOSX_BUNDLE_IDENTIFIER)
 2944 
 2945 dnl ===================================================================
 2946 dnl Check iOS SDK and compiler
 2947 dnl ===================================================================
 2948 
 2949 if test $_os = iOS; then
 2950     AC_MSG_CHECKING([what iOS SDK to use])
 2951     current_sdk_ver=12.1
 2952     older_sdk_vers="12.0 11.4"
 2953     if test "$enable_ios_simulator" = "yes"; then
 2954         platform=iPhoneSimulator
 2955         versionmin=-mios-simulator-version-min=11.0
 2956     else
 2957         platform=iPhoneOS
 2958         versionmin=-miphoneos-version-min=11.0
 2959     fi
 2960     xcode_developer=`xcode-select -print-path`
 2961 
 2962     for sdkver in $current_sdk_ver $older_sdk_vers; do
 2963         t=$xcode_developer/Platforms/$platform.platform/Developer/SDKs/$platform$sdkver.sdk
 2964         if test -d $t; then
 2965             sysroot=$t
 2966             break
 2967         fi
 2968     done
 2969 
 2970     if test -z "$sysroot"; then
 2971         AC_MSG_ERROR([Could not find iOS SDK, expected something like $xcode_developer/Platforms/$platform.platform/Developer/SDKs/${platform}${current_sdk_ver}.sdk])
 2972     fi
 2973 
 2974     AC_MSG_RESULT($sysroot)
 2975 
 2976     # LTO is not really recommended for iOS builds,
 2977     # the link time will be astronomical
 2978     if test "$ENABLE_LTO" = TRUE; then
 2979         lto=-flto
 2980     fi
 2981 
 2982     stdlib="-stdlib=libc++"
 2983 
 2984     CC="`xcrun -find clang` -arch $host_cpu -isysroot $sysroot $lto $versionmin"
 2985     CXX="`xcrun -find clang++` -arch $host_cpu $stdlib -isysroot $sysroot $lto $versionmin"
 2986 
 2987     INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
 2988     AR=`xcrun -find ar`
 2989     NM=`xcrun -find nm`
 2990     STRIP=`xcrun -find strip`
 2991     LIBTOOL=`xcrun -find libtool`
 2992     RANLIB=`xcrun -find ranlib`
 2993 fi
 2994 
 2995 AC_MSG_CHECKING([whether to treat the installation as read-only])
 2996 
 2997 if test \( -z "$enable_readonly_installset" -a "$ENABLE_MACOSX_SANDBOX" = TRUE \) -o \
 2998         "$enable_extensions" != yes; then
 2999     enable_readonly_installset=yes
 3000 fi
 3001 if test "$enable_readonly_installset" = yes; then
 3002     AC_MSG_RESULT([yes])
 3003     AC_DEFINE(HAVE_FEATURE_READONLY_INSTALLSET)
 3004 else
 3005     AC_MSG_RESULT([no])
 3006 fi
 3007 
 3008 dnl ===================================================================
 3009 dnl Structure of install set
 3010 dnl ===================================================================
 3011 
 3012 if test $_os = Darwin; then
 3013     LIBO_BIN_FOLDER=MacOS
 3014     LIBO_ETC_FOLDER=Resources
 3015     LIBO_LIBEXEC_FOLDER=MacOS
 3016     LIBO_LIB_FOLDER=Frameworks
 3017     LIBO_LIB_PYUNO_FOLDER=Resources
 3018     LIBO_SHARE_FOLDER=Resources
 3019     LIBO_SHARE_HELP_FOLDER=Resources/help
 3020     LIBO_SHARE_JAVA_FOLDER=Resources/java
 3021     LIBO_SHARE_PRESETS_FOLDER=Resources/presets
 3022     LIBO_SHARE_READMES_FOLDER=Resources/readmes
 3023     LIBO_SHARE_RESOURCE_FOLDER=Resources/resource
 3024     LIBO_SHARE_SHELL_FOLDER=Resources/shell
 3025     LIBO_URE_BIN_FOLDER=MacOS
 3026     LIBO_URE_ETC_FOLDER=Resources/ure/etc
 3027     LIBO_URE_LIB_FOLDER=Frameworks
 3028     LIBO_URE_MISC_FOLDER=Resources/ure/share/misc
 3029     LIBO_URE_SHARE_JAVA_FOLDER=Resources/java
 3030 elif test $_os = WINNT; then
 3031     LIBO_BIN_FOLDER=program
 3032     LIBO_ETC_FOLDER=program
 3033     LIBO_LIBEXEC_FOLDER=program
 3034     LIBO_LIB_FOLDER=program
 3035     LIBO_LIB_PYUNO_FOLDER=program
 3036     LIBO_SHARE_FOLDER=share
 3037     LIBO_SHARE_HELP_FOLDER=help
 3038     LIBO_SHARE_JAVA_FOLDER=program/classes
 3039     LIBO_SHARE_PRESETS_FOLDER=presets
 3040     LIBO_SHARE_READMES_FOLDER=readmes
 3041     LIBO_SHARE_RESOURCE_FOLDER=program/resource
 3042     LIBO_SHARE_SHELL_FOLDER=program/shell
 3043     LIBO_URE_BIN_FOLDER=program
 3044     LIBO_URE_ETC_FOLDER=program
 3045     LIBO_URE_LIB_FOLDER=program
 3046     LIBO_URE_MISC_FOLDER=program
 3047     LIBO_URE_SHARE_JAVA_FOLDER=program/classes
 3048 else
 3049     LIBO_BIN_FOLDER=program
 3050     LIBO_ETC_FOLDER=program
 3051     LIBO_LIBEXEC_FOLDER=program
 3052     LIBO_LIB_FOLDER=program
 3053     LIBO_LIB_PYUNO_FOLDER=program
 3054     LIBO_SHARE_FOLDER=share
 3055     LIBO_SHARE_HELP_FOLDER=help
 3056     LIBO_SHARE_JAVA_FOLDER=program/classes
 3057     LIBO_SHARE_PRESETS_FOLDER=presets
 3058     LIBO_SHARE_READMES_FOLDER=readmes
 3059     if test "$enable_fuzzers" != yes; then
 3060         LIBO_SHARE_RESOURCE_FOLDER=program/resource
 3061     else
 3062         LIBO_SHARE_RESOURCE_FOLDER=resource
 3063     fi
 3064     LIBO_SHARE_SHELL_FOLDER=program/shell
 3065     LIBO_URE_BIN_FOLDER=program
 3066     LIBO_URE_ETC_FOLDER=program
 3067     LIBO_URE_LIB_FOLDER=program
 3068     LIBO_URE_MISC_FOLDER=program
 3069     LIBO_URE_SHARE_JAVA_FOLDER=program/classes
 3070 fi
 3071 AC_DEFINE_UNQUOTED(LIBO_BIN_FOLDER,"$LIBO_BIN_FOLDER")
 3072 AC_DEFINE_UNQUOTED(LIBO_ETC_FOLDER,"$LIBO_ETC_FOLDER")
 3073 AC_DEFINE_UNQUOTED(LIBO_LIBEXEC_FOLDER,"$LIBO_LIBEXEC_FOLDER")
 3074 AC_DEFINE_UNQUOTED(LIBO_LIB_FOLDER,"$LIBO_LIB_FOLDER")
 3075 AC_DEFINE_UNQUOTED(LIBO_LIB_PYUNO_FOLDER,"$LIBO_LIB_PYUNO_FOLDER")
 3076 AC_DEFINE_UNQUOTED(LIBO_SHARE_FOLDER,"$LIBO_SHARE_FOLDER")
 3077 AC_DEFINE_UNQUOTED(LIBO_SHARE_HELP_FOLDER,"$LIBO_SHARE_HELP_FOLDER")
 3078 AC_DEFINE_UNQUOTED(LIBO_SHARE_JAVA_FOLDER,"$LIBO_SHARE_JAVA_FOLDER")
 3079 AC_DEFINE_UNQUOTED(LIBO_SHARE_PRESETS_FOLDER,"$LIBO_SHARE_PRESETS_FOLDER")
 3080 AC_DEFINE_UNQUOTED(LIBO_SHARE_RESOURCE_FOLDER,"$LIBO_SHARE_RESOURCE_FOLDER")
 3081 AC_DEFINE_UNQUOTED(LIBO_SHARE_SHELL_FOLDER,"$LIBO_SHARE_SHELL_FOLDER")
 3082 AC_DEFINE_UNQUOTED(LIBO_URE_BIN_FOLDER,"$LIBO_URE_BIN_FOLDER")
 3083 AC_DEFINE_UNQUOTED(LIBO_URE_ETC_FOLDER,"$LIBO_URE_ETC_FOLDER")
 3084 AC_DEFINE_UNQUOTED(LIBO_URE_LIB_FOLDER,"$LIBO_URE_LIB_FOLDER")
 3085 AC_DEFINE_UNQUOTED(LIBO_URE_MISC_FOLDER,"$LIBO_URE_MISC_FOLDER")
 3086 AC_DEFINE_UNQUOTED(LIBO_URE_SHARE_JAVA_FOLDER,"$LIBO_URE_SHARE_JAVA_FOLDER")
 3087 
 3088 # Not all of them needed in config_host.mk, add more if need arises
 3089 AC_SUBST(LIBO_BIN_FOLDER)
 3090 AC_SUBST(LIBO_ETC_FOLDER)
 3091 AC_SUBST(LIBO_LIB_FOLDER)
 3092 AC_SUBST(LIBO_LIB_PYUNO_FOLDER)
 3093 AC_SUBST(LIBO_SHARE_FOLDER)
 3094 AC_SUBST(LIBO_SHARE_HELP_FOLDER)
 3095 AC_SUBST(LIBO_SHARE_JAVA_FOLDER)
 3096 AC_SUBST(LIBO_SHARE_PRESETS_FOLDER)
 3097 AC_SUBST(LIBO_SHARE_READMES_FOLDER)
 3098 AC_SUBST(LIBO_SHARE_RESOURCE_FOLDER)
 3099 AC_SUBST(LIBO_URE_BIN_FOLDER)
 3100 AC_SUBST(LIBO_URE_ETC_FOLDER)
 3101 AC_SUBST(LIBO_URE_LIB_FOLDER)
 3102 AC_SUBST(LIBO_URE_MISC_FOLDER)
 3103 AC_SUBST(LIBO_URE_SHARE_JAVA_FOLDER)
 3104 
 3105 dnl ===================================================================
 3106 dnl Windows specific tests and stuff
 3107 dnl ===================================================================
 3108 
 3109 reg_get_value()
 3110 {
 3111     # Return value: $regvalue
 3112     unset regvalue
 3113 
 3114     local _regentry="/proc/registry${1}/${2}"
 3115     if test -f "$_regentry"; then
 3116         # Stop bash complaining about \0 bytes in input, as it can't handle them.
 3117         # Registry keys read via /proc/registry* are always \0 terminated!
 3118         local _regvalue=$(tr -d '\0' < "$_regentry")
 3119         if test $? -eq 0; then
 3120             regvalue=$_regvalue
 3121         fi
 3122     fi
 3123 }
 3124 
 3125 # Get a value from the 32-bit side of the Registry
 3126 reg_get_value_32()
 3127 {
 3128     reg_get_value "32" "$1"
 3129 }
 3130 
 3131 # Get a value from the 64-bit side of the Registry
 3132 reg_get_value_64()
 3133 {
 3134     reg_get_value "64" "$1"
 3135 }
 3136 
 3137 if test "$_os" = "WINNT"; then
 3138     AC_MSG_CHECKING([whether to build a 64-bit LibreOffice])
 3139     if test "$enable_64_bit" = "" -o "$enable_64_bit" = "no"; then
 3140         AC_MSG_RESULT([no])
 3141         WINDOWS_SDK_ARCH="x86"
 3142     else
 3143         AC_MSG_RESULT([yes])
 3144         WINDOWS_SDK_ARCH="x64"
 3145         BITNESS_OVERRIDE=64
 3146     fi
 3147 fi
 3148 if test "$_os" = "iOS"; then
 3149     cross_compiling="yes"
 3150 fi
 3151 
 3152 if test "$cross_compiling" = "yes"; then
 3153     export CROSS_COMPILING=TRUE
 3154 else
 3155     CROSS_COMPILING=
 3156     BUILD_TYPE="$BUILD_TYPE NATIVE"
 3157 fi
 3158 AC_SUBST(CROSS_COMPILING)
 3159 
 3160 USE_LD=
 3161 if test -n "$enable_ld" -a "$enable_ld" != "no"; then
 3162     AC_MSG_CHECKING([for -fuse-ld=$enable_ld linker support])
 3163     if test "$GCC" = "yes"; then
 3164         ldflags_save=$LDFLAGS
 3165         LDFLAGS="$LDFLAGS -fuse-ld=$enable_ld"
 3166         AC_LINK_IFELSE([AC_LANG_PROGRAM([
 3167 #include <stdio.h>
 3168             ],[
 3169 printf ("hello world\n");
 3170             ])], USE_LD=$enable_ld, [])
 3171         if test -n "$USE_LD"; then
 3172             AC_MSG_RESULT( yes )
 3173             LDFLAGS="$ldflags_save -fuse-ld=$enable_ld"
 3174         else
 3175             AC_MSG_ERROR( no )
 3176         fi
 3177     else
 3178         AC_MSG_ERROR( not supported )
 3179     fi
 3180 fi
 3181 AC_SUBST(USE_LD)
 3182 
 3183 ENABLE_GDB_INDEX=
 3184 if test "$enable_gdb_index" = "yes"; then
 3185     AC_MSG_CHECKING([whether $CC supports -ggnu-pubnames])
 3186     save_CFLAGS=$CFLAGS
 3187     CFLAGS="$CFLAGS -Werror -ggnu-pubnames"
 3188     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ AC_MSG_RESULT( yes )],[ AC_MSG_ERROR( no )])
 3189 
 3190     AC_MSG_CHECKING([whether $CC supports -Wl,--gdb-index])
 3191     ldflags_save=$LDFLAGS
 3192     LDFLAGS="$LDFLAGS -Wl,--gdb-index"
 3193     AC_LINK_IFELSE([AC_LANG_PROGRAM([
 3194 #include <stdio.h>
 3195         ],[
 3196 printf ("hello world\n");
 3197         ])], ENABLE_GDB_INDEX=TRUE, [])
 3198     if test "$ENABLE_GDB_INDEX" = "TRUE"; then
 3199         AC_MSG_RESULT( yes )
 3200     else
 3201         AC_MSG_ERROR( no )
 3202     fi
 3203     CFLAGS=$save_CFLAGS
 3204     LDFLAGS=$ldflags_save
 3205 fi
 3206 AC_SUBST(ENABLE_GDB_INDEX)
 3207 
 3208 HAVE_LD_BSYMBOLIC_FUNCTIONS=
 3209 if test "$GCC" = "yes"; then
 3210     AC_MSG_CHECKING([for -Bsymbolic-functions linker support])
 3211     bsymbolic_functions_ldflags_save=$LDFLAGS
 3212     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
 3213     AC_LINK_IFELSE([AC_LANG_PROGRAM([
 3214 #include <stdio.h>
 3215         ],[
 3216 printf ("hello world\n");
 3217         ])], HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE, [])
 3218     if test "$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "TRUE"; then
 3219         AC_MSG_RESULT( found )
 3220     else
 3221         AC_MSG_RESULT( not found )
 3222     fi
 3223     LDFLAGS=$bsymbolic_functions_ldflags_save
 3224 fi
 3225 AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS)
 3226 
 3227 # Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers.
 3228 # NOTE: must _not_ be used for bundled external libraries!
 3229 ISYSTEM=
 3230 if test "$GCC" = "yes"; then
 3231     AC_MSG_CHECKING( for -isystem )
 3232     save_CFLAGS=$CFLAGS
 3233     CFLAGS="$CFLAGS -Werror"
 3234     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[])
 3235     CFLAGS=$save_CFLAGS
 3236     if test -n "$ISYSTEM"; then
 3237         AC_MSG_RESULT(yes)
 3238     else
 3239         AC_MSG_RESULT(no)
 3240     fi
 3241 fi
 3242 if test -z "$ISYSTEM"; then
 3243     # fall back to using -I
 3244     ISYSTEM=-I
 3245 fi
 3246 AC_SUBST(ISYSTEM)
 3247 
 3248 dnl ===================================================================
 3249 dnl  Check which Visual Studio compiler is used
 3250 dnl ===================================================================
 3251 
 3252 map_vs_year_to_version()
 3253 {
 3254     # Return value: $vsversion
 3255 
 3256     unset vsversion
 3257 
 3258     case $1 in
 3259     2017)
 3260         vsversion=15.0;;
 3261     *)
 3262         AC_MSG_ERROR([Assertion failure - invalid argument "$1" to map_vs_year_to_version()]);;
 3263     esac
 3264 }
 3265 
 3266 vs_versions_to_check()
 3267 {
 3268     # Args: $1 (optional) : versions to check, in the order of preference
 3269     # Return value: $vsversions
 3270 
 3271     unset vsversions
 3272 
 3273     if test -n "$1"; then
 3274         map_vs_year_to_version "$1"
 3275         vsversions=$vsversion
 3276     else
 3277         # We accept only 2017
 3278         vsversions="15.0"
 3279     fi
 3280 }
 3281 
 3282 win_get_env_from_vsvars32bat()
 3283 {
 3284     WRAPPERBATCHFILEPATH="`mktemp -t wrpXXXXXX.bat`"
 3285     # Also seems to be located in another directory under the same name: vsvars32.bat
 3286     # https://github.com/bazelbuild/bazel/blob/master/src/main/native/build_windows_jni.sh#L56-L57
 3287     printf '@call "%s/../Common7/Tools/VsDevCmd.bat" /no_logo\r\n' "$(cygpath -w $VC_PRODUCT_DIR)" > $WRAPPERBATCHFILEPATH
 3288     printf '@setlocal\r\n@echo %%%s%%\r\n@endlocal\r\n' "$1" >> $WRAPPERBATCHFILEPATH
 3289     chmod +x $WRAPPERBATCHFILEPATH
 3290     _win_get_env_from_vsvars32bat=$("$WRAPPERBATCHFILEPATH" | tr -d '\r')
 3291     rm -f $WRAPPERBATCHFILEPATH
 3292     printf '%s' "$_win_get_env_from_vsvars32bat"
 3293 }
 3294 
 3295 find_ucrt()
 3296 {
 3297     reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/InstallationFolder"
 3298     if test -n "$regvalue"; then
 3299         PathFormat "$regvalue"
 3300         UCRTSDKDIR=$formatted_path
 3301         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v10.0/ProductVersion"
 3302         UCRTVERSION=$regvalue
 3303         # Rest if not exist
 3304         if ! test -d "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"; then
 3305           UCRTSDKDIR=
 3306         fi
 3307     fi
 3308     if test -z "$UCRTSDKDIR"; then
 3309         ide_env_dir="$VC_PRODUCT_DIR/../Common7/Tools/"
 3310         ide_env_file="${ide_env_dir}VsDevCmd.bat"
 3311         if test -f "$ide_env_file"; then
 3312             PathFormat "$(win_get_env_from_vsvars32bat UniversalCRTSdkDir)"
 3313             UCRTSDKDIR=$formatted_path
 3314             UCRTVERSION=$(win_get_env_from_vsvars32bat UCRTVersion)
 3315             dnl Hack needed at least by tml:
 3316             if test "$UCRTVERSION" = 10.0.15063.0 \
 3317                 -a ! -f "${UCRTSDKDIR}Include/10.0.15063.0/um/sqlext.h" \
 3318                 -a -f "${UCRTSDKDIR}Include/10.0.14393.0/um/sqlext.h"
 3319             then
 3320                 UCRTVERSION=10.0.14393.0
 3321             fi
 3322         else
 3323           AC_MSG_ERROR([No UCRT found])
 3324         fi
 3325     fi
 3326 }
 3327 
 3328 find_msvc()
 3329 {
 3330     # Find Visual C++ 2017
 3331     # Args: $1 (optional) : The VS version year
 3332     # Return values: $vctest, $vcyear, $vcnum, $vcnumwithdot, $vcbuildnumber
 3333 
 3334     unset vctest vcnum vcnumwithdot vcbuildnumber
 3335 
 3336     vs_versions_to_check "$1"
 3337 
 3338     for ver in $vsversions; do
 3339         reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VC/ProductDir
 3340         if test -n "$regvalue"; then
 3341             vctest=$regvalue
 3342             break
 3343         fi
 3344         reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/SxS/VS7/$ver
 3345         if test -n "$regvalue"; then
 3346             AC_MSG_RESULT([found: $regvalue])
 3347             PathFormat "$regvalue"
 3348             vctest=$formatted_path
 3349             break
 3350         fi
 3351     done
 3352     if test -n "$vctest"; then
 3353         vcnumwithdot=$ver
 3354         case "$vcnumwithdot" in
 3355         15.0)
 3356             vcyear=2017
 3357             vcnum=150
 3358             vcbuildnumber=`ls $vctest/VC/Tools/MSVC -A1r | head -1`
 3359             ;;
 3360         esac
 3361     fi
 3362 }
 3363 
 3364 SOLARINC=
 3365 MSBUILD_PATH=
 3366 DEVENV=
 3367 if test "$_os" = "WINNT"; then
 3368     AC_MSG_CHECKING([Visual C++])
 3369 
 3370     find_msvc "$with_visual_studio"
 3371     if test -z "$vctest"; then
 3372         if test -n "$with_visual_studio"; then
 3373             AC_MSG_ERROR([No Visual Studio $with_visual_studio installation found])
 3374         else
 3375             AC_MSG_ERROR([No Visual Studio 2017 installation found])
 3376         fi
 3377     fi
 3378 
 3379     if test "$BITNESS_OVERRIDE" = ""; then
 3380         if test -f "$vctest/bin/cl.exe"; then
 3381             VC_PRODUCT_DIR=$vctest
 3382         elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86/cl.exe"; then
 3383             VC_PRODUCT_DIR=$vctest/VC
 3384         else
 3385             AC_MSG_ERROR([No compiler (cl.exe) in $vctest/bin/cl.exe])
 3386         fi
 3387     else
 3388         if test -f "$vctest/bin/amd64/cl.exe"; then
 3389             VC_PRODUCT_DIR=$vctest
 3390         elif test -f "$vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"; then
 3391             VC_PRODUCT_DIR=$vctest/VC
 3392         else
 3393             AC_MSG_ERROR([No compiler (cl.exe) in $vctest/VC/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe or $vctest/bin/amd64/cl.exe or $vctest/bin/x86_amd64/cl.exe])
 3394         fi
 3395     fi
 3396 
 3397     AC_MSG_CHECKING([for short pathname of VC product directory])
 3398     VC_PRODUCT_DIR=`win_short_path_for_make "$VC_PRODUCT_DIR"`
 3399     AC_MSG_RESULT([$VC_PRODUCT_DIR])
 3400 
 3401     UCRTSDKDIR=
 3402     UCRTVERSION=
 3403 
 3404     AC_MSG_CHECKING([for UCRT location])
 3405     find_ucrt
 3406     # find_ucrt errors out if it doesn't find it
 3407     AC_MSG_RESULT([found])
 3408     PathFormat "${UCRTSDKDIR}Include/$UCRTVERSION/ucrt"
 3409     ucrtincpath_formatted=$formatted_path
 3410     # SOLARINC is used for external modules and must be set too.
 3411     # And no, it's not sufficient to set SOLARINC only, as configure
 3412     # itself doesn't honour it.
 3413     SOLARINC="$SOLARINC -I$ucrtincpath_formatted"
 3414     CFLAGS="$CFLAGS -I$ucrtincpath_formatted"
 3415     CXXFLAGS="$CXXFLAGS -I$ucrtincpath_formatted"
 3416     CPPFLAGS="$CPPFLAGS -I$ucrtincpath_formatted"
 3417 
 3418     AC_SUBST(UCRTSDKDIR)
 3419     AC_SUBST(UCRTVERSION)
 3420 
 3421     AC_MSG_CHECKING([for MSBuild.exe location for: $vcnumwithdot])
 3422     # Find the proper version of MSBuild.exe to use based on the VS version
 3423     reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MSBuild/$vcnumwithdot/MSBuildOverrideTasksPath
 3424     if test -n "$regvalue" ; then
 3425         AC_MSG_RESULT([found: $regvalue])
 3426         MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
 3427     else
 3428         if test "$BITNESS_OVERRIDE" = ""; then
 3429             regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin"
 3430         else
 3431             regvalue="$VC_PRODUCT_DIR/../MSBuild/$vcnumwithdot/Bin/amd64"
 3432         fi
 3433         MSBUILD_PATH=`win_short_path_for_make "$regvalue"`
 3434 	AC_MSG_RESULT([$regvalue])
 3435     fi
 3436 
 3437     # Find the version of devenv.exe
 3438     # MSVC 2017 devenv does not start properly from a DOS 8.3 path
 3439     DEVENV=$(cygpath -lm "$VC_PRODUCT_DIR/../Common7/IDE/devenv.exe")
 3440     if test ! -e "$DEVENV"; then
 3441         AC_MSG_ERROR([No devenv.exe found, Visual Studio installation broken?])
 3442     fi
 3443 
 3444     dnl ===========================================================
 3445     dnl  Check for the corresponding mspdb*.dll
 3446     dnl ===========================================================
 3447 
 3448     MSPDB_PATH=
 3449     CL_DIR=
 3450     CL_LIB=
 3451 
 3452     if test "$BITNESS_OVERRIDE" = ""; then
 3453         MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX86/x86"
 3454         CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX86/x86
 3455     else
 3456         MSPDB_PATH="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64"
 3457         CL_DIR=Tools/MSVC/$vcbuildnumber/bin/HostX64/x64
 3458     fi
 3459 
 3460     # MSVC 15.0 has libraries from 14.0?
 3461     mspdbnum="140"
 3462 
 3463     if test ! -e "$MSPDB_PATH/mspdb${mspdbnum}.dll"; then
 3464         AC_MSG_ERROR([No mspdb${mspdbnum}.dll in $MSPDB_PATH, Visual Studio installation broken?])
 3465     fi
 3466 
 3467     MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
 3468     MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
 3469 
 3470     dnl The path needs to be added before cl is called
 3471     PATH="$MSPDB_PATH:$PATH"
 3472 
 3473     AC_MSG_CHECKING([cl.exe])
 3474 
 3475     # Is there really ever a need to pass CC explicitly? Surely we can hope to get all the
 3476     # automagical niceness to work OK? If somebody has some unsupported compiler in some weird
 3477     # location, isn't it likely that lots of other things needs changes, too, and just setting CC
 3478     # is not enough?
 3479 
 3480     dnl Save the true MSVC cl.exe for use when CC/CXX is actually clang-cl,
 3481     dnl needed when building CLR code:
 3482     if test -z "$MSVC_CXX"; then
 3483         if test "$BITNESS_OVERRIDE" = ""; then
 3484             if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
 3485                 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
 3486             fi
 3487         else
 3488             if test -f "$VC_PRODUCT_DIR/$CL_DIR/cl.exe"; then
 3489                 MSVC_CXX="$VC_PRODUCT_DIR/$CL_DIR/cl.exe"
 3490             fi
 3491         fi
 3492 
 3493         # This gives us a posix path with 8.3 filename restrictions
 3494         MSVC_CXX=`win_short_path_for_make "$MSVC_CXX"`
 3495     fi
 3496 
 3497     if test -z "$CC"; then
 3498         CC=$MSVC_CXX
 3499     fi
 3500     if test "$BITNESS_OVERRIDE" = ""; then
 3501         dnl since MSVC 2012, default for x86 is -arch:SSE2:
 3502         MSVC_CXX="$MSVC_CXX -arch:SSE"
 3503     fi
 3504 
 3505     if test -n "$CC"; then
 3506         # Remove /cl.exe from CC case insensitive
 3507         AC_MSG_RESULT([found Visual C++ $vcyear ($CC)])
 3508         if test "$BITNESS_OVERRIDE" = ""; then
 3509            COMPATH="$VC_PRODUCT_DIR"
 3510         else
 3511             if test -n "$VC_PRODUCT_DIR"; then
 3512                 COMPATH=$VC_PRODUCT_DIR
 3513             fi
 3514         fi
 3515         if test "$BITNESS_OVERRIDE" = ""; then
 3516             dnl since MSVC 2012, default for x86 is -arch:SSE2:
 3517             CC="$CC -arch:SSE"
 3518         fi
 3519 
 3520         COMPATH="$COMPATH/Tools/MSVC/$vcbuildnumber"
 3521 
 3522         export INCLUDE=`cygpath -d "$COMPATH\Include"`
 3523 
 3524         PathFormat "$COMPATH"
 3525         COMPATH="$formatted_path"
 3526 
 3527         VCVER=$vcnum
 3528         MSVSVER=$vcyear
 3529 
 3530         # The WINDOWS_SDK_ACCEPTABLE_VERSIONS is mostly an educated guess...  Assuming newer ones
 3531         # are always "better", we list them in reverse chronological order.
 3532 
 3533         case $vcnum in
 3534         150)
 3535             COMEX=19
 3536             WINDOWS_SDK_ACCEPTABLE_VERSIONS="10.0 8.1A 8.1 8.0 7.1A"
 3537             ;;
 3538         esac
 3539 
 3540         # The expectation is that --with-windows-sdk should not need to be used
 3541         if test -n "$with_windows_sdk"; then
 3542             case " $WINDOWS_SDK_ACCEPTABLE_VERSIONS " in
 3543             *" "$with_windows_sdk" "*)
 3544                 WINDOWS_SDK_ACCEPTABLE_VERSIONS=$with_windows_sdk
 3545                 ;;
 3546             *)
 3547                 AC_MSG_ERROR([Windows SDK $with_windows_sdk is not known to work with VS $MSVSVER])
 3548                 ;;
 3549             esac
 3550         fi
 3551 
 3552         # Make AC_COMPILE_IFELSE etc. work (set by AC_PROG_C, which we don't use for MSVC)
 3553         ac_objext=obj
 3554         ac_exeext=exe
 3555 
 3556     else
 3557         AC_MSG_ERROR([Visual C++ not found after all, huh])
 3558     fi
 3559 
 3560     # Check for 64-bit (cross-)compiler to use to build the 64-bit
 3561     # version of the Explorer extension (and maybe other small
 3562     # bits, too) needed when installing a 32-bit LibreOffice on a
 3563     # 64-bit OS. The 64-bit Explorer extension is a feature that
 3564     # has been present since long in OOo. Don't confuse it with
 3565     # building LibreOffice itself as 64-bit code.
 3566 
 3567     BUILD_X64=
 3568     CXX_X64_BINARY=
 3569     LINK_X64_BINARY=
 3570 
 3571     if test "$BITNESS_OVERRIDE" = ""; then
 3572         AC_MSG_CHECKING([for a x64 compiler and libraries for 64-bit Explorer extensions])
 3573         if test -f "$VC_PRODUCT_DIR/atlmfc/lib/amd64/atls.lib"; then
 3574             # Prefer native x64 compiler to cross-compiler, in case we are running
 3575             # the build on a 64-bit OS.
 3576             if "$VC_PRODUCT_DIR/bin/amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
 3577                 BUILD_X64=TRUE
 3578                 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/cl.exe"
 3579                 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/amd64/link.exe"
 3580             elif "$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe" -? </dev/null >/dev/null 2>&1; then
 3581                 BUILD_X64=TRUE
 3582                 CXX_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/cl.exe"
 3583                 LINK_X64_BINARY="$VC_PRODUCT_DIR/bin/x86_amd64/link.exe"
 3584             fi
 3585         elif test -f "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/atlmfc/lib/x64/atls.lib"; then
 3586             # nobody uses 32-bit OS to build, just pick the 64-bit compiler
 3587             if "$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe" -? </dev/null >/dev/null 2>&1; then
 3588                 BUILD_X64=TRUE
 3589                 CXX_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/cl.exe"
 3590                 LINK_X64_BINARY="$VC_PRODUCT_DIR/Tools/MSVC/$vcbuildnumber/bin/HostX64/x64/link.exe"
 3591             fi
 3592         fi
 3593         if test "$BUILD_X64" = TRUE; then
 3594             AC_MSG_RESULT([found])
 3595         else
 3596             AC_MSG_RESULT([not found])
 3597             AC_MSG_WARN([Installation set will not contain 64-bit Explorer extensions])
 3598         fi
 3599     fi
 3600     AC_SUBST(BUILD_X64)
 3601 
 3602     # These are passed to the environment and then used in gbuild/platform/com_MSC_class.mk
 3603     AC_SUBST(CXX_X64_BINARY)
 3604     AC_SUBST(LINK_X64_BINARY)
 3605 fi
 3606 AC_SUBST(VCVER)
 3607 AC_SUBST(DEVENV)
 3608 PathFormat "$MSPDB_PATH"
 3609 MSPDB_PATH="$formatted_path"
 3610 AC_SUBST(MSVC_CXX)
 3611 
 3612 #
 3613 # unowinreg.dll
 3614 #
 3615 UNOWINREG_DLL="185d60944ea767075d27247c3162b3bc-unowinreg.dll"
 3616 AC_SUBST(UNOWINREG_DLL)
 3617 
 3618 COM_IS_CLANG=
 3619 AC_MSG_CHECKING([whether the compiler is actually Clang])
 3620 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 3621     #ifndef __clang__
 3622     you lose
 3623     #endif
 3624     int foo=42;
 3625     ]])],
 3626     [AC_MSG_RESULT([yes])
 3627      COM_IS_CLANG=TRUE],
 3628     [AC_MSG_RESULT([no])])
 3629 
 3630 CC_PLAIN=$CC
 3631 if test "$COM_IS_CLANG" = TRUE; then
 3632     AC_MSG_CHECKING([the Clang version])
 3633     if test "$_os" = WINNT; then
 3634         dnl In which case, assume clang-cl:
 3635         my_args="/EP /TC"
 3636         dnl Filter out -FIIntrin.h, which needs to be explicitly stated for
 3637         dnl clang-cl:
 3638         CC_PLAIN=
 3639         for i in $CC; do
 3640             case $i in
 3641             -FIIntrin.h)
 3642                 ;;
 3643             *)
 3644                 CC_PLAIN="$CC_PLAIN $i"
 3645                 ;;
 3646             esac
 3647         done
 3648     else
 3649         my_args="-E -P"
 3650     fi
 3651     clang_version=`echo __clang_major__.__clang_minor__.__clang_patchlevel__ | $CC_PLAIN $my_args -`
 3652     CLANG_FULL_VERSION=`echo __clang_version__ | $CC_PLAIN $my_args -`
 3653     CLANGVER=`echo $clang_version \
 3654         | $AWK -F. '{ print \$1*10000+(\$2<100?\$2:99)*100+(\$3<100?\$3:99) }'`
 3655     AC_MSG_RESULT([Clang $CLANG_FULL_VERSION, $CLANGVER])
 3656     AC_DEFINE_UNQUOTED(CLANG_VERSION,$CLANGVER)
 3657     AC_DEFINE_UNQUOTED(CLANG_FULL_VERSION,$CLANG_FULL_VERSION)
 3658 fi
 3659 AC_SUBST(COM_IS_CLANG)
 3660 AC_SUBST(CLANGVER)
 3661 
 3662 SHOWINCLUDES_PREFIX=
 3663 if test "$_os" = WINNT; then
 3664     dnl We need to guess the prefix of the -showIncludes output, it can be
 3665     dnl localized
 3666     AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
 3667     echo "#include <stdlib.h>" > conftest.c
 3668     SHOWINCLUDES_PREFIX=`$CC_PLAIN $CFLAGS -c -showIncludes conftest.c 2>/dev/null | \
 3669         grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
 3670     rm -f conftest.c conftest.obj
 3671     if test -z "$SHOWINCLUDES_PREFIX"; then
 3672         AC_MSG_ERROR([cannot determine the -showIncludes prefix])
 3673     else
 3674         AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
 3675     fi
 3676 fi
 3677 AC_SUBST(SHOWINCLUDES_PREFIX)
 3678 
 3679 #
 3680 # prefix C with ccache if needed
 3681 #
 3682 if test "$CCACHE" != ""; then
 3683     AC_MSG_CHECKING([whether $CC is already ccached])
 3684 
 3685     AC_LANG_PUSH([C])
 3686     save_CFLAGS=$CFLAGS
 3687     CFLAGS="$CFLAGS --ccache-skip -O2"
 3688     dnl an empty program will do, we're checking the compiler flags
 3689     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
 3690                       [use_ccache=yes], [use_ccache=no])
 3691     if test $use_ccache = yes; then
 3692         AC_MSG_RESULT([yes])
 3693     else
 3694         CC="$CCACHE $CC"
 3695         AC_MSG_RESULT([no])
 3696     fi
 3697     CFLAGS=$save_CFLAGS
 3698     AC_LANG_POP([C])
 3699 fi
 3700 
 3701 # ===================================================================
 3702 # check various GCC options that Clang does not support now but maybe
 3703 # will somewhen in the future, check them even for GCC, so that the
 3704 # flags are set
 3705 # ===================================================================
 3706 
 3707 HAVE_GCC_GGDB2=
 3708 HAVE_GCC_FINLINE_LIMIT=
 3709 HAVE_GCC_FNO_INLINE=
 3710 if test "$GCC" = "yes"; then
 3711     AC_MSG_CHECKING([whether $CC supports -ggdb2])
 3712     save_CFLAGS=$CFLAGS
 3713     CFLAGS="$CFLAGS -Werror -ggdb2"
 3714     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_GGDB2=TRUE ],[])
 3715     CFLAGS=$save_CFLAGS
 3716     if test "$HAVE_GCC_GGDB2" = "TRUE"; then
 3717         AC_MSG_RESULT([yes])
 3718     else
 3719         AC_MSG_RESULT([no])
 3720     fi
 3721 
 3722     AC_MSG_CHECKING([whether $CC supports -finline-limit=0])
 3723     save_CFLAGS=$CFLAGS
 3724     CFLAGS="$CFLAGS -Werror -finline-limit=0"
 3725     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FINLINE_LIMIT=TRUE ],[])
 3726     CFLAGS=$save_CFLAGS
 3727     if test "$HAVE_GCC_FINLINE_LIMIT" = "TRUE"; then
 3728         AC_MSG_RESULT([yes])
 3729     else
 3730         AC_MSG_RESULT([no])
 3731     fi
 3732 
 3733     AC_MSG_CHECKING([whether $CC supports -fno-inline])
 3734     save_CFLAGS=$CFLAGS
 3735     CFLAGS="$CFLAGS -Werror -fno-inline"
 3736     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_INLINE=TRUE ],[])
 3737     CFLAGS=$save_CFLAGS
 3738     if test "$HAVE_GCC_FNO_INLINE" = "TRUE"; then
 3739         AC_MSG_RESULT([yes])
 3740     else
 3741         AC_MSG_RESULT([no])
 3742     fi
 3743 
 3744     if test "$host_cpu" = "m68k"; then
 3745         AC_MSG_CHECKING([whether $CC supports -mlong-jump-table-offsets])
 3746         save_CFLAGS=$CFLAGS
 3747         CFLAGS="$CFLAGS -Werror -mlong-jump-table-offsets"
 3748         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_LONG_JUMP_TABLE_OFFSETS=TRUE ],[])
 3749         CFLAGS=$save_CFLAGS
 3750         if test "$HAVE_GCC_LONG_JUMP_TABLE_OFFSETS" = "TRUE"; then
 3751             AC_MSG_RESULT([yes])
 3752         else
 3753             AC_MSG_ERROR([no])
 3754         fi
 3755     fi
 3756 fi
 3757 AC_SUBST(HAVE_GCC_GGDB2)
 3758 AC_SUBST(HAVE_GCC_FINLINE_LIMIT)
 3759 AC_SUBST(HAVE_GCC_FNO_INLINE)
 3760 
 3761 dnl ===================================================================
 3762 dnl  Test the gcc version
 3763 dnl ===================================================================
 3764 if test "$GCC" = "yes" -a -z "$COM_IS_CLANG"; then
 3765     AC_MSG_CHECKING([the GCC version])
 3766     _gcc_version=`$CC -dumpversion`
 3767     gcc_full_version=$(printf '%s' "$_gcc_version" | \
 3768         $AWK -F. '{ print $1*10000+$2*100+(NF<3?1:$3) }')
 3769     GCC_VERSION=`echo $_gcc_version | $AWK -F. '{ print \$1*100+\$2 }'`
 3770 
 3771     AC_MSG_RESULT([gcc $_gcc_version ($gcc_full_version)])
 3772 
 3773     if test "$gcc_full_version" -lt 40801; then
 3774         AC_MSG_ERROR([GCC $_gcc_version is too old, must be at least GCC 4.8.1])
 3775     fi
 3776 else
 3777     # Explicitly force GCC_VERSION to be empty, even for Clang, to check incorrect uses.
 3778     # GCC version should generally be checked only when handling GCC-specific bugs, for testing
 3779     # things like features configure checks should be used, otherwise they may e.g. fail with Clang
 3780     # (which reports itself as GCC 4.2.1).
 3781     GCC_VERSION=
 3782 fi
 3783 AC_SUBST(GCC_VERSION)
 3784 
 3785 dnl Set the ENABLE_DBGUTIL variable
 3786 dnl ===================================================================
 3787 AC_MSG_CHECKING([whether to build with additional debug utilities])
 3788 if test -n "$enable_dbgutil" -a "$enable_dbgutil" != "no"; then
 3789     ENABLE_DBGUTIL="TRUE"
 3790     # this is an extra var so it can have different default on different MSVC
 3791     # versions (in case there are version specific problems with it)
 3792     MSVC_USE_DEBUG_RUNTIME="TRUE"
 3793 
 3794     AC_MSG_RESULT([yes])
 3795     # cppunit and graphite expose STL in public headers
 3796     if test "$with_system_cppunit" = "yes"; then
 3797         AC_MSG_ERROR([--with-system-cppunit conflicts with --enable-dbgutil])
 3798     else
 3799         with_system_cppunit=no
 3800     fi
 3801     if test "$with_system_graphite" = "yes"; then
 3802         AC_MSG_ERROR([--with-system-graphite conflicts with --enable-dbgutil])
 3803     else
 3804         with_system_graphite=no
 3805     fi
 3806     if test "$with_system_orcus" = "yes"; then
 3807         AC_MSG_ERROR([--with-system-orcus conflicts with --enable-dbgutil])
 3808     else
 3809         with_system_orcus=no
 3810     fi
 3811     if test "$with_system_libcmis" = "yes"; then
 3812         AC_MSG_ERROR([--with-system-libcmis conflicts with --enable-dbgutil])
 3813     else
 3814         with_system_libcmis=no
 3815     fi
 3816     if test "$with_system_hunspell" = "yes"; then
 3817         AC_MSG_ERROR([--with-system-hunspell conflicts with --enable-dbgutil])
 3818     else
 3819         with_system_hunspell=no
 3820     fi
 3821     if test "$with_system_gpgmepp" = "yes"; then
 3822         AC_MSG_ERROR([--with-system-gpgmepp conflicts with --enable-dbgutil])
 3823     else
 3824         with_system_gpgmepp=no
 3825     fi
 3826     # As mixing system libwps and non-system libnumbertext or vice versa likely causes trouble (see
 3827     # 603074c5f2b84de8a24593faf807da784b040625 "Pass _GLIBCXX_DEBUG into external/libwps" and the
 3828     # mail thread starting at <https://gcc.gnu.org/ml/gcc/2018-05/msg00057.html> "libstdc++: ODR
 3829     # violation when using std::regex with and without -D_GLIBCXX_DEBUG"), simply make sure neither
 3830     # of those two is using the system variant:
 3831     if test "$with_system_libnumbertext" = "yes"; then
 3832         AC_MSG_ERROR([--with-system-libnumbertext conflicts with --enable-dbgutil])
 3833     else
 3834         with_system_libnumbertext=no
 3835     fi
 3836     if test "$with_system_libwps" = "yes"; then
 3837         AC_MSG_ERROR([--with-system-libwps conflicts with --enable-dbgutil])
 3838     else
 3839         with_system_libwps=no
 3840     fi
 3841 else
 3842     ENABLE_DBGUTIL=""
 3843     MSVC_USE_DEBUG_RUNTIME=""
 3844     AC_MSG_RESULT([no])
 3845 fi
 3846 AC_SUBST(ENABLE_DBGUTIL)
 3847 AC_SUBST(MSVC_USE_DEBUG_RUNTIME)
 3848 
 3849 dnl Set the ENABLE_DEBUG variable.
 3850 dnl ===================================================================
 3851 if test -n "$enable_debug" && test "$enable_debug" != "yes" && test "$enable_debug" != "no"; then
 3852     AC_MSG_ERROR([--enable-debug now accepts only yes or no, use --enable-selective-debuginfo])
 3853 fi
 3854 if test -n "$ENABLE_DBGUTIL" -a "$enable_debug" = "no"; then
 3855     if test -z "$libo_fuzzed_enable_debug"; then
 3856         AC_MSG_ERROR([--disable-debug cannot be used with --enable-dbgutil])
 3857     else
 3858         AC_MSG_NOTICE([Resetting --enable-debug=yes])
 3859         enable_debug=yes
 3860     fi
 3861 fi
 3862 
 3863 AC_MSG_CHECKING([whether to do a debug build])
 3864 if test -n "$ENABLE_DBGUTIL" -o \( -n "$enable_debug" -a "$enable_debug" != "no" \) ; then
 3865     ENABLE_DEBUG="TRUE"
 3866     if test -n "$ENABLE_DBGUTIL" ; then
 3867         AC_MSG_RESULT([yes (dbgutil)])
 3868     else
 3869         AC_MSG_RESULT([yes])
 3870     fi
 3871 else
 3872     ENABLE_DEBUG=""
 3873     AC_MSG_RESULT([no])
 3874 fi
 3875 AC_SUBST(ENABLE_DEBUG)
 3876 
 3877 if test "$enable_split_debug" = yes; then
 3878     HAVE_GSPLIT_DWARF=
 3879     if test "$GCC" = "yes"; then
 3880         AC_MSG_CHECKING([whether $CC supports -gsplit-dwarf])
 3881         save_CFLAGS=$CFLAGS
 3882         CFLAGS="$CFLAGS -Werror -gsplit-dwarf"
 3883         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_SPLIT_DWARF=TRUE ],[])
 3884         CFLAGS=$save_CFLAGS
 3885         if test "$HAVE_GCC_SPLIT_DWARF" = "TRUE"; then
 3886             AC_MSG_RESULT([yes])
 3887         else
 3888             AC_MSG_RESULT([no])
 3889         fi
 3890     fi
 3891     AC_SUBST(HAVE_GCC_SPLIT_DWARF)
 3892 fi
 3893 
 3894 if test "$enable_sal_log" = yes; then
 3895     ENABLE_SAL_LOG=TRUE
 3896 fi
 3897 AC_SUBST(ENABLE_SAL_LOG)
 3898 
 3899 dnl Selective debuginfo
 3900 ENABLE_DEBUGINFO_FOR=
 3901 if test -n "$ENABLE_DEBUG"; then
 3902     AC_MSG_CHECKING([whether to use selective debuginfo])
 3903     if test -n "$enable_selective_debuginfo" -a "$enable_selective_debuginfo" != "no"; then
 3904         if test "$enable_selective_debuginfo" = "yes"; then
 3905             AC_MSG_ERROR([--enable-selective-debuginfo requires a parameter])
 3906         fi
 3907         ENABLE_DEBUGINFO_FOR="$enable_selective_debuginfo"
 3908         AC_MSG_RESULT([for "$enable_selective_debuginfo"])
 3909     else
 3910         ENABLE_DEBUGINFO_FOR=all
 3911         AC_MSG_RESULT([no, for all])
 3912     fi
 3913 else
 3914     if test -n "$enable_selective_debuginfo"; then
 3915         AC_MSG_ERROR([--enable-selective-debuginfo must be used together with either --enable-debug or --enable-dbgutil])
 3916     fi
 3917 fi
 3918 AC_SUBST(ENABLE_DEBUGINFO_FOR)
 3919 
 3920 dnl Check for enable symbols option
 3921 dnl ===================================================================
 3922 AC_MSG_CHECKING([whether to generate debug information])
 3923 if test -z "$enable_symbols"; then
 3924     if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
 3925         enable_symbols=yes
 3926     else
 3927         enable_symbols=no
 3928     fi
 3929 fi
 3930 if test "$enable_symbols" != no; then
 3931     ENABLE_SYMBOLS=TRUE
 3932     AC_MSG_RESULT([yes])
 3933 else
 3934     ENABLE_SYMBOLS=
 3935     AC_MSG_RESULT([no])
 3936 fi
 3937 AC_SUBST(ENABLE_SYMBOLS)
 3938 
 3939 if test -n "$with_android_ndk" -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE_DEBUG" -o -n "$ENABLE_DBGUTIL" \) -a "$ENABLE_DEBUGINFO_FOR" = "all"; then
 3940     # Building on Android with full symbols: without enough memory the linker never finishes currently.
 3941     AC_MSG_CHECKING([whether enough memory is available for linking])
 3942     mem_size=$(grep -o 'MemTotal: *.\+ kB' /proc/meminfo | sed 's/MemTotal: *\(.\+\) kB/\1/')
 3943     # Check for 15GB, as Linux reports a bit less than the physical memory size.
 3944     if test -n "$mem_size" -a $mem_size -lt 15728640; then
 3945         AC_MSG_ERROR([building with full symbols and less than 16GB of memory is not supported])
 3946     else
 3947         AC_MSG_RESULT([yes])
 3948     fi
 3949 fi
 3950 
 3951 AC_MSG_CHECKING([whether to compile with optimization flags])
 3952 if test -z "$enable_optimized"; then
 3953     if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
 3954         enable_optimized=no
 3955     else
 3956         enable_optimized=yes
 3957     fi
 3958 fi
 3959 if test "$enable_optimized" != no; then
 3960     ENABLE_OPTIMIZED=TRUE
 3961     AC_MSG_RESULT([yes])
 3962 else
 3963     ENABLE_OPTIMIZED=
 3964     AC_MSG_RESULT([no])
 3965 fi
 3966 AC_SUBST(ENABLE_OPTIMIZED)
 3967 
 3968 #
 3969 # determine CPUNAME, OS, ...
 3970 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
 3971 #
 3972 case "$host_os" in
 3973 
 3974 aix*)
 3975     COM=GCC
 3976     CPUNAME=POWERPC
 3977     USING_X11=TRUE
 3978     OS=AIX
 3979     RTL_OS=AIX
 3980     RTL_ARCH=PowerPC
 3981     PLATFORMID=aix_powerpc
 3982     P_SEP=:
 3983     ;;
 3984 
 3985 cygwin*)
 3986     COM=MSC
 3987     USING_X11=
 3988     OS=WNT
 3989     RTL_OS=Windows
 3990     if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 3991         P_SEP=";"
 3992     else
 3993         P_SEP=:
 3994     fi
 3995     case "$host_cpu" in
 3996     i*86|x86_64)
 3997         if test "$BITNESS_OVERRIDE" = 64; then
 3998             CPUNAME=X86_64
 3999             RTL_ARCH=X86_64
 4000             PLATFORMID=windows_x86_64
 4001             WINDOWS_X64=1
 4002             SCPDEFS="$SCPDEFS -DWINDOWS_X64"
 4003         else
 4004             CPUNAME=INTEL
 4005             RTL_ARCH=x86
 4006             PLATFORMID=windows_x86
 4007         fi
 4008         ;;
 4009     *)
 4010         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4011         ;;
 4012     esac
 4013     SCPDEFS="$SCPDEFS -D_MSC_VER"
 4014     ;;
 4015 
 4016 darwin*)
 4017     COM=GCC
 4018     USING_X11=
 4019     OS=MACOSX
 4020     RTL_OS=MacOSX
 4021     P_SEP=:
 4022 
 4023     case "$host_cpu" in
 4024     arm)
 4025         AC_MSG_ERROR([Can't build 32-bit code for iOS])
 4026         ;;
 4027     arm64)
 4028         OS=iOS
 4029         if test "$enable_ios_simulator" = "yes"; then
 4030             AC_MSG_ERROR([iOS simulator is only available in OSX not iOS])
 4031         else
 4032             CPUNAME=ARM64
 4033             RTL_ARCH=ARM_EABI
 4034             PLATFORMID=ios_arm64
 4035         fi
 4036         ;;
 4037     i*86)
 4038         AC_MSG_ERROR([Can't build 64-bit code in 32-bit OS])
 4039         ;;
 4040     x86_64)
 4041         if test "$enable_ios_simulator" = "yes"; then
 4042             OS=iOS
 4043         fi
 4044         CPUNAME=X86_64
 4045         RTL_ARCH=X86_64
 4046         PLATFORMID=macosx_x86_64
 4047         ;;
 4048     *)
 4049         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4050         ;;
 4051     esac
 4052     ;;
 4053 
 4054 dragonfly*)
 4055     COM=GCC
 4056     USING_X11=TRUE
 4057     OS=DRAGONFLY
 4058     RTL_OS=DragonFly
 4059     P_SEP=:
 4060 
 4061     case "$host_cpu" in
 4062     i*86)
 4063         CPUNAME=INTEL
 4064         RTL_ARCH=x86
 4065         PLATFORMID=dragonfly_x86
 4066         ;;
 4067     x86_64)
 4068         CPUNAME=X86_64
 4069         RTL_ARCH=X86_64
 4070         PLATFORMID=dragonfly_x86_64
 4071         ;;
 4072     *)
 4073         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4074         ;;
 4075     esac
 4076     ;;
 4077 
 4078 freebsd*)
 4079     COM=GCC
 4080     USING_X11=TRUE
 4081     RTL_OS=FreeBSD
 4082     OS=FREEBSD
 4083     P_SEP=:
 4084 
 4085     case "$host_cpu" in
 4086     i*86)
 4087         CPUNAME=INTEL
 4088         RTL_ARCH=x86
 4089         PLATFORMID=freebsd_x86
 4090         ;;
 4091     x86_64|amd64)
 4092         CPUNAME=X86_64
 4093         RTL_ARCH=X86_64
 4094         PLATFORMID=freebsd_x86_64
 4095         ;;
 4096     *)
 4097         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4098         ;;
 4099     esac
 4100     ;;
 4101 
 4102 haiku*)
 4103     COM=GCC
 4104     USING_X11=
 4105     GUIBASE=haiku
 4106     RTL_OS=Haiku
 4107     OS=HAIKU
 4108     P_SEP=:
 4109 
 4110     case "$host_cpu" in
 4111     i*86)
 4112         CPUNAME=INTEL
 4113         RTL_ARCH=x86
 4114         PLATFORMID=haiku_x86
 4115         ;;
 4116     x86_64|amd64)
 4117         CPUNAME=X86_64
 4118         RTL_ARCH=X86_64
 4119         PLATFORMID=haiku_x86_64
 4120         ;;
 4121     *)
 4122         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4123         ;;
 4124     esac
 4125     ;;
 4126 
 4127 kfreebsd*)
 4128     COM=GCC
 4129     USING_X11=TRUE
 4130     OS=LINUX
 4131     RTL_OS=kFreeBSD
 4132     P_SEP=:
 4133 
 4134     case "$host_cpu" in
 4135 
 4136     i*86)
 4137         CPUNAME=INTEL
 4138         RTL_ARCH=x86
 4139         PLATFORMID=kfreebsd_x86
 4140         ;;
 4141     x86_64)
 4142         CPUNAME=X86_64
 4143         RTL_ARCH=X86_64
 4144         PLATFORMID=kfreebsd_x86_64
 4145         ;;
 4146     *)
 4147         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4148         ;;
 4149     esac
 4150     ;;
 4151 
 4152 linux-gnu*)
 4153     COM=GCC
 4154     USING_X11=TRUE
 4155     OS=LINUX
 4156     RTL_OS=Linux
 4157     P_SEP=:
 4158 
 4159     case "$host_cpu" in
 4160 
 4161     aarch64)
 4162         CPUNAME=AARCH64
 4163         PLATFORMID=linux_aarch64
 4164         RTL_ARCH=AARCH64
 4165         ;;
 4166     alpha)
 4167         CPUNAME=AXP
 4168         RTL_ARCH=ALPHA
 4169         PLATFORMID=linux_alpha
 4170         ;;
 4171     arm*)
 4172         CPUNAME=ARM
 4173         EPM_FLAGS="-a arm"
 4174         RTL_ARCH=ARM_EABI
 4175         PLATFORMID=linux_arm_eabi
 4176         case "$host_cpu" in
 4177         arm*-linux)
 4178             RTL_ARCH=ARM_OABI
 4179             PLATFORMID=linux_arm_oabi
 4180             ;;
 4181         esac
 4182         ;;
 4183     hppa)
 4184         CPUNAME=HPPA
 4185         RTL_ARCH=HPPA
 4186         EPM_FLAGS="-a hppa"
 4187         PLATFORMID=linux_hppa
 4188         ;;
 4189     i*86)
 4190         CPUNAME=INTEL
 4191         RTL_ARCH=x86
 4192         PLATFORMID=linux_x86
 4193         ;;
 4194     ia64)
 4195         CPUNAME=IA64
 4196         RTL_ARCH=IA64
 4197         PLATFORMID=linux_ia64
 4198         ;;
 4199     mips)
 4200         CPUNAME=GODSON
 4201         RTL_ARCH=MIPS_EB
 4202         EPM_FLAGS="-a mips"
 4203         PLATFORMID=linux_mips_eb
 4204         ;;
 4205     mips64)
 4206         CPUNAME=GODSON64
 4207         RTL_ARCH=MIPS64_EB
 4208         EPM_FLAGS="-a mips64"
 4209         PLATFORMID=linux_mips64_eb
 4210         ;;
 4211     mips64el)
 4212         CPUNAME=GODSON64
 4213         RTL_ARCH=MIPS64_EL
 4214         EPM_FLAGS="-a mips64el"
 4215         PLATFORMID=linux_mips64_el
 4216         ;;
 4217     mipsel)
 4218         CPUNAME=GODSON
 4219         RTL_ARCH=MIPS_EL
 4220         EPM_FLAGS="-a mipsel"
 4221         PLATFORMID=linux_mips_el
 4222         ;;
 4223     m68k)
 4224         CPUNAME=M68K
 4225         RTL_ARCH=M68K
 4226         PLATFORMID=linux_m68k
 4227         ;;
 4228     powerpc)
 4229         CPUNAME=POWERPC
 4230         RTL_ARCH=PowerPC
 4231         PLATFORMID=linux_powerpc
 4232         ;;
 4233     powerpc64)
 4234         CPUNAME=POWERPC64
 4235         RTL_ARCH=PowerPC_64
 4236         PLATFORMID=linux_powerpc64
 4237         ;;
 4238     powerpc64le)
 4239         CPUNAME=POWERPC64
 4240         RTL_ARCH=PowerPC_64_LE
 4241         PLATFORMID=linux_powerpc64_le
 4242         ;;
 4243     sparc)
 4244         CPUNAME=SPARC
 4245         RTL_ARCH=SPARC
 4246         PLATFORMID=linux_sparc
 4247         ;;
 4248     sparc64)
 4249         CPUNAME=SPARC64
 4250         RTL_ARCH=SPARC64
 4251         PLATFORMID=linux_sparc64
 4252         ;;
 4253     s390)
 4254         CPUNAME=S390
 4255         RTL_ARCH=S390
 4256         PLATFORMID=linux_s390
 4257         ;;
 4258     s390x)
 4259         CPUNAME=S390X
 4260         RTL_ARCH=S390x
 4261         PLATFORMID=linux_s390x
 4262         ;;
 4263     x86_64)
 4264         CPUNAME=X86_64
 4265         RTL_ARCH=X86_64
 4266         PLATFORMID=linux_x86_64
 4267         ;;
 4268     *)
 4269         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4270         ;;
 4271     esac
 4272     ;;
 4273 
 4274 linux-android*)
 4275     COM=GCC
 4276     USING_X11=
 4277     OS=ANDROID
 4278     RTL_OS=Android
 4279     P_SEP=:
 4280 
 4281     case "$host_cpu" in
 4282 
 4283     arm|armel)
 4284         CPUNAME=ARM
 4285         RTL_ARCH=ARM_EABI
 4286         PLATFORMID=android_arm_eabi
 4287         ;;
 4288     aarch64)
 4289         CPUNAME=AARCH64
 4290         RTL_ARCH=AARCH64
 4291         PLATFORMID=android_aarch64
 4292         ;;
 4293     mips|mipsel)
 4294         CPUNAME=GODSON # Weird, but maybe that's the LO convention?
 4295         RTL_ARCH=MIPS_EL
 4296         PLATFORMID=android_mips_el
 4297         ;;
 4298     i*86)
 4299         CPUNAME=INTEL
 4300         RTL_ARCH=x86
 4301         PLATFORMID=android_x86
 4302         ;;
 4303     *)
 4304         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4305         ;;
 4306     esac
 4307     ;;
 4308 
 4309 *netbsd*)
 4310     COM=GCC
 4311     USING_X11=TRUE
 4312     OS=NETBSD
 4313     RTL_OS=NetBSD
 4314     P_SEP=:
 4315 
 4316     case "$host_cpu" in
 4317     i*86)
 4318         CPUNAME=INTEL
 4319         RTL_ARCH=x86
 4320         PLATFORMID=netbsd_x86
 4321         ;;
 4322     powerpc)
 4323         CPUNAME=POWERPC
 4324         RTL_ARCH=PowerPC
 4325         PLATFORMID=netbsd_powerpc
 4326         ;;
 4327     sparc)
 4328         CPUNAME=SPARC
 4329         RTL_ARCH=SPARC
 4330         PLATFORMID=netbsd_sparc
 4331         ;;
 4332     x86_64)
 4333         CPUNAME=X86_64
 4334         RTL_ARCH=X86_64
 4335         PLATFORMID=netbsd_x86_64
 4336         ;;
 4337     *)
 4338         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4339         ;;
 4340     esac
 4341     ;;
 4342 
 4343 openbsd*)
 4344     COM=GCC
 4345     USING_X11=TRUE
 4346     OS=OPENBSD
 4347     RTL_OS=OpenBSD
 4348     P_SEP=:
 4349 
 4350     case "$host_cpu" in
 4351     i*86)
 4352         CPUNAME=INTEL
 4353         RTL_ARCH=x86
 4354         PLATFORMID=openbsd_x86
 4355         ;;
 4356     x86_64)
 4357         CPUNAME=X86_64
 4358         RTL_ARCH=X86_64
 4359         PLATFORMID=openbsd_x86_64
 4360         ;;
 4361     *)
 4362         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4363         ;;
 4364     esac
 4365     SOLARINC="$SOLARINC -I/usr/local/include"
 4366     ;;
 4367 
 4368 solaris*)
 4369     COM=GCC
 4370     USING_X11=TRUE
 4371     OS=SOLARIS
 4372     RTL_OS=Solaris
 4373     P_SEP=:
 4374 
 4375     case "$host_cpu" in
 4376     i*86)
 4377         CPUNAME=INTEL
 4378         RTL_ARCH=x86
 4379         PLATFORMID=solaris_x86
 4380         ;;
 4381     sparc)
 4382         CPUNAME=SPARC
 4383         RTL_ARCH=SPARC
 4384         PLATFORMID=solaris_sparc
 4385         ;;
 4386     sparc64)
 4387         CPUNAME=SPARC64
 4388         RTL_ARCH=SPARC64
 4389         PLATFORMID=solaris_sparc64
 4390         ;;
 4391     *)
 4392         AC_MSG_ERROR([Unsupported host_cpu $host_cpu for host_os $host_os])
 4393         ;;
 4394     esac
 4395     SOLARINC="$SOLARINC -I/usr/local/include"
 4396     ;;
 4397 
 4398 *)
 4399     AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice for!])
 4400     ;;
 4401 esac
 4402 
 4403 if test "$with_x" = "no"; then
 4404     AC_MSG_ERROR([Use --disable-gui instead. How can we get rid of this option? No idea where it comes from.])
 4405 fi
 4406 
 4407 DISABLE_GUI=""
 4408 if test "$enable_gui" = "no"; then
 4409     if test "$USING_X11" != TRUE; then
 4410         AC_MSG_ERROR([$host_os operating system is not suitable to build LibreOffice with --disable-gui.])
 4411     fi
 4412     USING_X11=
 4413     DISABLE_GUI=TRUE
 4414     AC_DEFINE(HAVE_FEATURE_UI,0)
 4415     test_cairo=yes
 4416 fi
 4417 AC_SUBST(DISABLE_GUI)
 4418 
 4419 WORKDIR="${BUILDDIR}/workdir"
 4420 INSTDIR="${BUILDDIR}/instdir"
 4421 INSTROOTBASE=${INSTDIR}${INSTROOTBASESUFFIX}
 4422 INSTROOT=${INSTROOTBASE}${INSTROOTCONTENTSUFFIX}
 4423 SOLARINC="-I$SRC_ROOT/include $SOLARINC"
 4424 AC_SUBST(COM)
 4425 AC_SUBST(CPUNAME)
 4426 AC_SUBST(RTL_OS)
 4427 AC_SUBST(RTL_ARCH)
 4428 AC_SUBST(EPM_FLAGS)
 4429 AC_SUBST(USING_X11)
 4430 AC_SUBST([INSTDIR])
 4431 AC_SUBST([INSTROOT])
 4432 AC_SUBST([INSTROOTBASE])
 4433 AC_SUBST(OS)
 4434 AC_SUBST(P_SEP)
 4435 AC_SUBST(WORKDIR)
 4436 AC_SUBST(PLATFORMID)
 4437 AC_SUBST(WINDOWS_X64)
 4438 AC_DEFINE_UNQUOTED(WORKDIR,"$WORKDIR")
 4439 
 4440 dnl ===================================================================
 4441 dnl Test which package format to use
 4442 dnl ===================================================================
 4443 AC_MSG_CHECKING([which package format to use])
 4444 if test -n "$with_package_format" -a "$with_package_format" != no; then
 4445     for i in $with_package_format; do
 4446         case "$i" in
 4447         aix | bsd | deb | pkg | rpm | archive | dmg | installed | msi)
 4448             ;;
 4449         *)
 4450             AC_MSG_ERROR([unsupported format $i. Supported by EPM are:
 4451 aix - AIX software distribution
 4452 bsd - FreeBSD, NetBSD, or OpenBSD software distribution
 4453 deb - Debian software distribution
 4454 pkg - Solaris software distribution
 4455 rpm - RedHat software distribution
 4456 
 4457 LibreOffice additionally supports:
 4458 archive - .tar.gz or .zip
 4459 dmg - Mac OS X .dmg
 4460 installed - installation tree
 4461 msi - Windows .msi
 4462         ])
 4463             ;;
 4464         esac
 4465     done
 4466     # fakeroot is needed to ensure correct file ownerships/permissions
 4467     # inside deb packages and tar archives created on Linux and Solaris.
 4468     if test "$OS" = "LINUX" || test "$OS" = "SOLARIS"; then
 4469         AC_PATH_PROG(FAKEROOT, fakeroot, no)
 4470         if test "$FAKEROOT" = "no"; then
 4471             AC_MSG_ERROR(
 4472                 [--with-package-format='$with_package_format' requires fakeroot. Install fakeroot.])
 4473         fi
 4474     fi
 4475     PKGFORMAT="$with_package_format"
 4476     AC_MSG_RESULT([$PKGFORMAT])
 4477 else
 4478     PKGFORMAT=
 4479     AC_MSG_RESULT([none])
 4480 fi
 4481 AC_SUBST(PKGFORMAT)
 4482 
 4483 dnl ===================================================================
 4484 dnl Set up a different compiler to produce tools to run on the build
 4485 dnl machine when doing cross-compilation
 4486 dnl ===================================================================
 4487 
 4488 m4_pattern_allow([PKG_CONFIG_FOR_BUILD])
 4489 m4_pattern_allow([PKG_CONFIG_LIBDIR])
 4490 if test "$cross_compiling" = "yes"; then
 4491     AC_MSG_CHECKING([for BUILD platform configuration])
 4492     echo
 4493     rm -rf CONF-FOR-BUILD config_build.mk
 4494     mkdir CONF-FOR-BUILD
 4495     # Here must be listed all files needed when running the configure script. In particular, also
 4496     # those expanded by the AC_CONFIG_FILES() call near the end of this configure.ac. For clarity,
 4497     # keep them in the same order as there.
 4498     (cd $SRC_ROOT && tar cf - \
 4499         config.guess \
 4500         bin/get_config_variables \
 4501         solenv/bin/getcompver.awk \
 4502         solenv/inc/langlist.mk \
 4503         download.lst \
 4504         config_host.mk.in \
 4505         config_host_lang.mk.in \
 4506         Makefile.in \
 4507         lo.xcent.in \
 4508         bin/bffvalidator.sh.in \
 4509         bin/odfvalidator.sh.in \
 4510         bin/officeotron.sh.in \
 4511         instsetoo_native/util/openoffice.lst.in \
 4512         config_host/*.in \
 4513         sysui/desktop/macosx/Info.plist.in) \
 4514     | (cd CONF-FOR-BUILD && tar xf -)
 4515     cp configure CONF-FOR-BUILD
 4516     test -d config_build && cp -p config_build/*.h CONF-FOR-BUILD/config_host 2>/dev/null
 4517     (
 4518     unset COM USING_X11 OS CPUNAME
 4519     unset CC CXX SYSBASE CFLAGS
 4520     unset AR NM OBJDUMP PKG_CONFIG RANLIB READELF STRIP
 4521     unset CPPUNIT_CFLAGS CPPUNIT_LIBS
 4522     unset LIBXML_CFLAGS LIBXML_LIBS LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC PKG_CONFIG_LIBDIR
 4523     test -n "$CC_FOR_BUILD" && export CC="$CC_FOR_BUILD"
 4524     test -n "$CXX_FOR_BUILD" && export CXX="$CXX_FOR_BUILD"
 4525     test -n "$PKG_CONFIG_FOR_BUILD" && export PKG_CONFIG="$PKG_CONFIG_FOR_BUILD"
 4526     cd CONF-FOR-BUILD
 4527     sub_conf_opts=""
 4528     test -n "$enable_ccache" && sub_conf_opts="$sub_conf_opts --enable-ccache=$enable_ccache"
 4529     test -n "$with_ant_home" && sub_conf_opts="$sub_conf_opts --with-ant-home=$with_ant_home"
 4530     test $with_junit = no && sub_conf_opts="$sub_conf_opts --without-junit"
 4531     test -n "$TARFILE_LOCATION" && sub_conf_opts="$sub_conf_opts --with-external-tar=$TARFILE_LOCATION"
 4532     test "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" && sub_conf_opts="$sub_conf_opts --with-system-icu"
 4533     test "$build_for_ios" = "YES" && sub_conf_opts="$sub_conf_opts build_for_ios=YES"
 4534     sub_conf_opts="$sub_conf_opts $with_build_platform_configure_options"
 4535     # Don't bother having configure look for stuff not needed for the build platform anyway
 4536     ./configure \
 4537         --disable-cups \
 4538         --disable-gtk3 \
 4539         --disable-pdfimport \
 4540         --disable-postgresql-sdbc \
 4541         --with-parallelism="$with_parallelism" \
 4542         --without-doxygen \
 4543         --without-java \
 4544         $sub_conf_opts \
 4545         --srcdir=$srcdir \
 4546         2>&1 | sed -e 's/^/    /'
 4547     test -f ./config_host.mk 2>/dev/null || exit
 4548     cp config_host.mk ../config_build.mk
 4549     cp config_host_lang.mk ../config_build_lang.mk
 4550     mv config.log ../config.Build.log
 4551     mkdir -p ../config_build
 4552     mv config_host/*.h ../config_build
 4553     . ./bin/get_config_variables CC CXX INSTDIR INSTROOT LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS PATH SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT WORKDIR
 4554 
 4555     for V in CC CXX LIBO_BIN_FOLDER LIBO_LIB_FOLDER LIBO_URE_LIB_FOLDER LIBO_URE_MISC_FOLDER OS SDKDIRNAME SYSTEM_LIBXML SYSTEM_LIBXSLT; do
 4556         VV='$'$V
 4557         VV=`eval "echo $VV"`
 4558         if test -n "$VV"; then
 4559             line=${V}_FOR_BUILD='${'${V}_FOR_BUILD:-$VV'}'
 4560             echo "$line" >>build-config
 4561         fi
 4562     done
 4563 
 4564     for V in INSTDIR INSTROOT WORKDIR; do
 4565         VV='$'$V
 4566         VV=`eval "echo $VV"`
 4567         VV=`echo $VV | sed -e "s,/CONF-FOR-BUILD/\([[a-z]]*\),/\1_for_build,g"`
 4568         if test -n "$VV"; then
 4569             line="${V}_FOR_BUILD='$VV'"
 4570             echo "$line" >>build-config
 4571         fi
 4572     done
 4573 
 4574     line=`echo "LO_PATH_FOR_BUILD=$PATH" | sed -e 's,/CONF-FOR-BUILD,,g'`
 4575     echo "$line" >>build-config
 4576 
 4577     )
 4578     test -f CONF-FOR-BUILD/build-config || AC_MSG_ERROR([Running configure script for BUILD system failed, see CONF-FOR-BUILD/config.log])
 4579     test -f config_build.mk || AC_MSG_ERROR([A file called config_build.mk was supposed to have been copied here, but it isn't found])
 4580     perl -pi -e 's,/(workdir|instdir)(/|$),/\1_for_build\2,g;' \
 4581              -e 's,/CONF-FOR-BUILD,,g;' config_build.mk
 4582 
 4583     eval `cat CONF-FOR-BUILD/build-config`
 4584 
 4585     AC_MSG_RESULT([checking for BUILD platform configuration... done])
 4586 
 4587     rm -rf CONF-FOR-BUILD
 4588 else
 4589     OS_FOR_BUILD="$OS"
 4590     CC_FOR_BUILD="$CC"
 4591     CXX_FOR_BUILD="$CXX"
 4592     INSTDIR_FOR_BUILD="$INSTDIR"
 4593     INSTROOT_FOR_BUILD="$INSTROOT"
 4594     LIBO_BIN_FOLDER_FOR_BUILD="$LIBO_BIN_FOLDER"
 4595     LIBO_LIB_FOLDER_FOR_BUILD="$LIBO_LIB_FOLDER"
 4596     LIBO_URE_LIB_FOLDER_FOR_BUILD="$LIBO_URE_LIB_FOLDER"
 4597     LIBO_URE_MISC_FOLDER_FOR_BUILD="$LIBO_URE_MISC_FOLDER"
 4598     SDKDIRNAME_FOR_BUILD="$SDKDIRNAME"
 4599     WORKDIR_FOR_BUILD="$WORKDIR"
 4600 fi
 4601 AC_SUBST(OS_FOR_BUILD)
 4602 AC_SUBST(INSTDIR_FOR_BUILD)
 4603 AC_SUBST(INSTROOT_FOR_BUILD)
 4604 AC_SUBST(LIBO_BIN_FOLDER_FOR_BUILD)
 4605 AC_SUBST(LIBO_LIB_FOLDER_FOR_BUILD)
 4606 AC_SUBST(LIBO_URE_LIB_FOLDER_FOR_BUILD)
 4607 AC_SUBST(LIBO_URE_MISC_FOLDER_FOR_BUILD)
 4608 AC_SUBST(SDKDIRNAME_FOR_BUILD)
 4609 AC_SUBST(WORKDIR_FOR_BUILD)
 4610 
 4611 dnl ===================================================================
 4612 dnl Check for syslog header
 4613 dnl ===================================================================
 4614 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
 4615 
 4616 dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
 4617 dnl ===================================================================
 4618 AC_MSG_CHECKING([whether to turn warnings to errors])
 4619 if test -n "$enable_werror" -a "$enable_werror" != "no"; then
 4620     ENABLE_WERROR="TRUE"
 4621     AC_MSG_RESULT([yes])
 4622 else
 4623     if test -n "$LODE_HOME" -a -z "$enable_werror"; then
 4624         ENABLE_WERROR="TRUE"
 4625         AC_MSG_RESULT([yes])
 4626     else
 4627         AC_MSG_RESULT([no])
 4628     fi
 4629 fi
 4630 AC_SUBST(ENABLE_WERROR)
 4631 
 4632 dnl Check for --enable-assert-always-abort, set ASSERT_ALWAYS_ABORT
 4633 dnl ===================================================================
 4634 AC_MSG_CHECKING([whether to have assert() failures abort even without --enable-debug])
 4635 if test -z "$enable_assert_always_abort"; then
 4636    if test "$ENABLE_DEBUG" = TRUE; then
 4637        enable_assert_always_abort=yes
 4638    else
 4639        enable_assert_always_abort=no
 4640    fi
 4641 fi
 4642 if test "$enable_assert_always_abort" = "yes"; then
 4643     ASSERT_ALWAYS_ABORT="TRUE"
 4644     AC_MSG_RESULT([yes])
 4645 else
 4646     ASSERT_ALWAYS_ABORT="FALSE"
 4647     AC_MSG_RESULT([no])
 4648 fi
 4649 AC_SUBST(ASSERT_ALWAYS_ABORT)
 4650 
 4651 # Determine whether to use ooenv for the instdir installation
 4652 # ===================================================================
 4653 if test $_os != "WINNT" -a $_os != "Darwin"; then
 4654     AC_MSG_CHECKING([whether to use ooenv for the instdir installation])
 4655     if test "$enable_ooenv" = "no"; then
 4656         AC_MSG_RESULT([no])
 4657     else
 4658         ENABLE_OOENV="TRUE"
 4659         AC_MSG_RESULT([yes])
 4660     fi
 4661 fi
 4662 AC_SUBST(ENABLE_OOENV)
 4663 
 4664 if test "$USING_X11" != TRUE; then
 4665     # be sure to do not mess with unneeded stuff
 4666     test_randr=no
 4667     test_xrender=no
 4668     test_cups=no
 4669     test_dbus=no
 4670     test_gtk=no
 4671     build_gstreamer_1_0=no
 4672     build_gstreamer_0_10=no
 4673     test_kde4=no
 4674     test_kde5=no
 4675     test_qt5=no
 4676     test_gtk3_kde5=no
 4677     enable_cairo_canvas=no
 4678 fi
 4679 
 4680 if test "$OS" = "HAIKU"; then
 4681     enable_cairo_canvas=yes
 4682     test_kde5=yes
 4683 fi
 4684 
 4685 if test "$test_kde5" = "yes"; then
 4686     test_qt5=yes
 4687 fi
 4688 
 4689 if test "$test_kde5" = "yes" -a  "$enable_kde5" = "yes"; then
 4690     if test "$enable_qt5" = "no"; then
 4691         AC_MSG_ERROR([KDE5 support depends on QT5, so it conflicts with --disable-qt5])
 4692     else
 4693         enable_qt5=yes
 4694     fi
 4695 fi
 4696 
 4697 dnl ===================================================================
 4698 dnl check for cups support
 4699 dnl ===================================================================
 4700 ENABLE_CUPS=""
 4701 
 4702 if test "$enable_cups" = "no"; then
 4703     test_cups=no
 4704 fi
 4705 
 4706 AC_MSG_CHECKING([whether to enable CUPS support])
 4707 if test "$test_cups" = "yes"; then
 4708     ENABLE_CUPS="TRUE"
 4709     AC_MSG_RESULT([yes])
 4710 
 4711     AC_MSG_CHECKING([whether cups support is present])
 4712     AC_CHECK_LIB([cups], [cupsPrintFiles], [:])
 4713     AC_CHECK_HEADER(cups/cups.h, AC_DEFINE(HAVE_CUPS_H))
 4714     if test "$ac_cv_lib_cups_cupsPrintFiles" != "yes" -o "$ac_cv_header_cups_cups_h" != "yes"; then
 4715         AC_MSG_ERROR([Could not find CUPS. Install libcups2-dev or cups-devel.])
 4716     fi
 4717 
 4718 else
 4719     AC_MSG_RESULT([no])
 4720 fi
 4721 
 4722 AC_SUBST(ENABLE_CUPS)
 4723 
 4724 # fontconfig checks
 4725 if test "$test_fontconfig" = "yes"; then
 4726     PKG_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.4.1])
 4727     SYSTEM_FONTCONFIG=TRUE
 4728     FilterLibs "${FONTCONFIG_LIBS}"
 4729     FONTCONFIG_LIBS="${filteredlibs}"
 4730 fi
 4731 AC_SUBST(FONTCONFIG_CFLAGS)
 4732 AC_SUBST(FONTCONFIG_LIBS)
 4733 AC_SUBST([SYSTEM_FONTCONFIG])
 4734 
 4735 dnl whether to find & fetch external tarballs?
 4736 dnl ===================================================================
 4737 if test -z "$TARFILE_LOCATION" -a -n "$LODE_HOME" ; then
 4738    if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 4739        TARFILE_LOCATION="`cygpath -m $LODE_HOME/ext_tar`"
 4740    else
 4741        TARFILE_LOCATION="$LODE_HOME/ext_tar"
 4742    fi
 4743 fi
 4744 if test -z "$TARFILE_LOCATION"; then
 4745     if test -d "$SRC_ROOT/src" ; then
 4746         mv "$SRC_ROOT/src" "$SRC_ROOT/external/tarballs"
 4747         ln -s "$SRC_ROOT/external/tarballs" "$SRC_ROOT/src"
 4748     fi
 4749     TARFILE_LOCATION="$SRC_ROOT/external/tarballs"
 4750 else
 4751     AbsolutePath "$TARFILE_LOCATION"
 4752     PathFormat "${absolute_path}"
 4753     TARFILE_LOCATION="${formatted_path}"
 4754 fi
 4755 AC_SUBST(TARFILE_LOCATION)
 4756 
 4757 AC_MSG_CHECKING([whether we want to fetch tarballs])
 4758 if test "$enable_fetch_external" != "no"; then
 4759     if test "$with_all_tarballs" = "yes"; then
 4760         AC_MSG_RESULT([yes, all of them])
 4761         DO_FETCH_TARBALLS="ALL"
 4762     else
 4763         AC_MSG_RESULT([yes, if we use them])
 4764         DO_FETCH_TARBALLS="TRUE"
 4765     fi
 4766 else
 4767     AC_MSG_RESULT([no])
 4768     DO_FETCH_TARBALLS=
 4769 fi
 4770 AC_SUBST(DO_FETCH_TARBALLS)
 4771 
 4772 AC_MSG_CHECKING([whether to build help])
 4773 if test -n "$with_help" -a "$with_help" != "no" -a $_os != iOS -a $_os != Android; then
 4774     BUILD_TYPE="$BUILD_TYPE HELP"
 4775     GIT_NEEDED_SUBMODULES="helpcontent2 $GIT_NEEDED_SUBMODULES"
 4776     case "$with_help" in
 4777     "html")
 4778         ENABLE_HTMLHELP=TRUE
 4779         SCPDEFS="$SCPDEFS -DWITH_HELP"
 4780         AC_MSG_RESULT([HTML])
 4781         ;;
 4782     "online")
 4783         ENABLE_HTMLHELP=TRUE
 4784         HELP_ONLINE=TRUE
 4785         AC_MSG_RESULT([HTML])
 4786         ;;
 4787     yes)
 4788         SCPDEFS="$SCPDEFS -DWITH_HELP"
 4789         AC_MSG_RESULT([yes])
 4790         ;;
 4791     *)
 4792         AC_MSG_ERROR([Unknown --with-help=$with_help])
 4793         ;;
 4794     esac
 4795 else
 4796     AC_MSG_RESULT([no])
 4797 fi
 4798 AC_SUBST([ENABLE_HTMLHELP])
 4799 AC_SUBST([HELP_ONLINE])
 4800 
 4801 dnl Test whether to include MySpell dictionaries
 4802 dnl ===================================================================
 4803 AC_MSG_CHECKING([whether to include MySpell dictionaries])
 4804 if test "$with_myspell_dicts" = "yes"; then
 4805     AC_MSG_RESULT([yes])
 4806     WITH_MYSPELL_DICTS=TRUE
 4807     BUILD_TYPE="$BUILD_TYPE DICTIONARIES"
 4808     GIT_NEEDED_SUBMODULES="dictionaries $GIT_NEEDED_SUBMODULES"
 4809 else
 4810     AC_MSG_RESULT([no])
 4811     WITH_MYSPELL_DICTS=
 4812 fi
 4813 AC_SUBST(WITH_MYSPELL_DICTS)
 4814 
 4815 # There are no "system" myspell, hyphen or mythes dictionaries on OS X, Windows, Android or iOS.
 4816 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS -o $_os = Android; then
 4817     if test "$with_system_dicts" = yes; then
 4818         AC_MSG_ERROR([There are no system dicts on this OS in the formats the 3rd-party libs we use expect]);
 4819     fi
 4820     with_system_dicts=no
 4821 fi
 4822 
 4823 AC_MSG_CHECKING([whether to use dicts from external paths])
 4824 if test -z "$with_system_dicts" -o "$with_system_dicts" != "no"; then
 4825     AC_MSG_RESULT([yes])
 4826     SYSTEM_DICTS=TRUE
 4827     AC_MSG_CHECKING([for spelling dictionary directory])
 4828     if test -n "$with_external_dict_dir"; then
 4829         DICT_SYSTEM_DIR=file://$with_external_dict_dir
 4830     else
 4831         DICT_SYSTEM_DIR=file:///usr/share/hunspell
 4832         if test ! -d /usr/share/hunspell -a -d /usr/share/myspell; then
 4833             DICT_SYSTEM_DIR=file:///usr/share/myspell
 4834         fi
 4835     fi
 4836     AC_MSG_RESULT([$DICT_SYSTEM_DIR])
 4837     AC_MSG_CHECKING([for hyphenation patterns directory])
 4838     if test -n "$with_external_hyph_dir"; then
 4839         HYPH_SYSTEM_DIR=file://$with_external_hyph_dir
 4840     else
 4841         HYPH_SYSTEM_DIR=file:///usr/share/hyphen
 4842     fi
 4843     AC_MSG_RESULT([$HYPH_SYSTEM_DIR])
 4844     AC_MSG_CHECKING([for thesaurus directory])
 4845     if test -n "$with_external_thes_dir"; then
 4846         THES_SYSTEM_DIR=file://$with_external_thes_dir
 4847     else
 4848         THES_SYSTEM_DIR=file:///usr/share/mythes
 4849     fi
 4850     AC_MSG_RESULT([$THES_SYSTEM_DIR])
 4851 else
 4852     AC_MSG_RESULT([no])
 4853     SYSTEM_DICTS=
 4854 fi
 4855 AC_SUBST(SYSTEM_DICTS)
 4856 AC_SUBST(DICT_SYSTEM_DIR)
 4857 AC_SUBST(HYPH_SYSTEM_DIR)
 4858 AC_SUBST(THES_SYSTEM_DIR)
 4859 
 4860 dnl ===================================================================
 4861 dnl enable pch by default on windows
 4862 dnl enable it explicitly otherwise
 4863 ENABLE_PCH=""
 4864 if test "$enable_pch" = yes -a "$enable_compiler_plugins" = yes; then
 4865     if test -z "$libo_fuzzed_enable_pch"; then
 4866         AC_MSG_ERROR([--enable-pch cannot be used with --enable-compiler-plugins])
 4867     else
 4868         AC_MSG_NOTICE([Resetting --enable-pch=no])
 4869         enable_pch=no
 4870     fi
 4871 fi
 4872 
 4873 AC_MSG_CHECKING([whether to enable pch feature])
 4874 if test "$enable_pch" != "no"; then
 4875     if test "$_os" = "WINNT"; then
 4876         ENABLE_PCH="TRUE"
 4877         AC_MSG_RESULT([yes])
 4878     elif test -n "$enable_pch" && test "$GCC" = "yes"; then
 4879         ENABLE_PCH="TRUE"
 4880         AC_MSG_RESULT([yes])
 4881     elif test -n "$enable_pch"; then
 4882         AC_MSG_ERROR([Precompiled header not yet supported for your platform/compiler])
 4883     else
 4884         AC_MSG_RESULT([no])
 4885     fi
 4886 else
 4887     AC_MSG_RESULT([no])
 4888 fi
 4889 AC_SUBST(ENABLE_PCH)
 4890 
 4891 TAB=`printf '\t'`
 4892 
 4893 AC_MSG_CHECKING([the GNU Make version])
 4894 _make_version=`$GNUMAKE --version | grep GNU | $GREP -v GPL | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
 4895 _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
 4896 if test "$_make_longver" -ge "038200"; then
 4897     AC_MSG_RESULT([$GNUMAKE $_make_version])
 4898 
 4899 elif test "$_make_longver" -ge "038100"; then
 4900     if test "$build_os" = "cygwin"; then
 4901         AC_MSG_ERROR([failed ($GNUMAKE version >= 3.82 needed])
 4902     fi
 4903     AC_MSG_RESULT([$GNUMAKE $_make_version])
 4904 
 4905     dnl ===================================================================
 4906     dnl Search all the common names for sha1sum
 4907     dnl ===================================================================
 4908     AC_CHECK_PROGS(SHA1SUM, sha1sum sha1 shasum openssl)
 4909     if test -z "$SHA1SUM"; then
 4910         AC_MSG_ERROR([install the appropriate SHA-1 checksumming program for this OS])
 4911     elif test "$SHA1SUM" = "openssl"; then
 4912         SHA1SUM="openssl sha1"
 4913     fi
 4914     AC_MSG_CHECKING([for GNU Make bug 20033])
 4915     TESTGMAKEBUG20033=`mktemp -d tmp.XXXXXX`
 4916     $SED -e "s/<TAB>/$TAB/g" > $TESTGMAKEBUG20033/Makefile << EOF
 4917 A := \$(wildcard *.a)
 4918 
 4919 .PHONY: all
 4920 all: \$(A:.a=.b)
 4921 <TAB>@echo survived bug20033.
 4922 
 4923 .PHONY: setup
 4924 setup:
 4925 <TAB>@touch 1.a 2.a 3.a 4.a 5.a 6.a
 4926 
 4927 define d1
 4928 @echo lala \$(1)
 4929 @sleep 1
 4930 endef
 4931 
 4932 define d2
 4933 @echo tyty \$(1)
 4934 @sleep 1
 4935 endef
 4936 
 4937 %.b : %.a
 4938 <TAB>\$(eval CHECKSUM := \$(word 1,\$(shell cat \$^ | $SHA1SUM))) \$(if \$(wildcard \$(CACHEDIR)/\$(CHECKSUM)),\
 4939 <TAB>\$(call d1,\$(CHECKSUM)),\
 4940 <TAB>\$(call d2,\$(CHECKSUM)))
 4941 EOF
 4942     if test -z "`(cd $TESTGMAKEBUG20033 && $GNUMAKE setup && $GNUMAKE -j)|grep survived`"; then
 4943         no_parallelism_make="YES"
 4944         AC_MSG_RESULT([yes, disable parallelism])
 4945     else
 4946         AC_MSG_RESULT([no, keep parallelism enabled])
 4947     fi
 4948     rm -rf $TESTGMAKEBUG20033
 4949 else
 4950     AC_MSG_ERROR([failed ($GNUMAKE version >= 3.81 needed])
 4951 fi
 4952 
 4953 # find if gnumake support file function
 4954 AC_MSG_CHECKING([whether GNU Make supports the 'file' function])
 4955 TESTGMAKEFILEFUNC="`mktemp -d -t tst.XXXXXX`"
 4956 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 4957     TESTGMAKEFILEFUNC=`cygpath -m $TESTGMAKEFILEFUNC`
 4958 fi
 4959 $SED -e "s/<TAB>/$TAB/" > $TESTGMAKEFILEFUNC/Makefile << EOF
 4960 \$(file >test.txt,Success )
 4961 
 4962 .PHONY: all
 4963 all:
 4964 <TAB>@cat test.txt
 4965 
 4966 EOF
 4967 $GNUMAKE -C $TESTGMAKEFILEFUNC 2>/dev/null 1>&2
 4968 if test -f $TESTGMAKEFILEFUNC/test.txt; then
 4969     HAVE_GNUMAKE_FILE_FUNC=TRUE
 4970     AC_MSG_RESULT([yes])
 4971 else
 4972     AC_MSG_RESULT([no])
 4973 fi
 4974 rm -rf $TESTGMAKEFILEFUNC
 4975 AC_SUBST(HAVE_GNUMAKE_FILE_FUNC)
 4976 AC_SUBST(GNUMAKE_WIN_NATIVE)
 4977 
 4978 _make_ver_check=`$GNUMAKE --version | grep "Built for Windows"`
 4979 STALE_MAKE=
 4980 if test "$_make_ver_check" = ""; then
 4981    STALE_MAKE=TRUE
 4982 fi
 4983 
 4984 HAVE_LD_HASH_STYLE=FALSE
 4985 WITH_LINKER_HASH_STYLE=
 4986 AC_MSG_CHECKING([for --hash-style gcc linker support])
 4987 if test "$GCC" = "yes"; then
 4988     if test -z "$with_linker_hash_style" -o "$with_linker_hash_style" = "yes"; then
 4989         hash_styles="gnu sysv"
 4990     elif test "$with_linker_hash_style" = "no"; then
 4991         hash_styles=
 4992     else
 4993         hash_styles="$with_linker_hash_style"
 4994     fi
 4995 
 4996     for hash_style in $hash_styles; do
 4997         test "$HAVE_LD_HASH_STYLE" = "TRUE" && continue
 4998         hash_style_ldflags_save=$LDFLAGS
 4999         LDFLAGS="$LDFLAGS -Wl,--hash-style=$hash_style"
 5000 
 5001         AC_RUN_IFELSE([AC_LANG_PROGRAM(
 5002             [
 5003 #include <stdio.h>
 5004             ],[
 5005 printf ("");
 5006             ])],
 5007             [
 5008                   HAVE_LD_HASH_STYLE=TRUE
 5009                   WITH_LINKER_HASH_STYLE=$hash_style
 5010             ],
 5011             [HAVE_LD_HASH_STYLE=FALSE],
 5012             [HAVE_LD_HASH_STYLE=FALSE])
 5013         LDFLAGS=$hash_style_ldflags_save
 5014     done
 5015 
 5016     if test "$HAVE_LD_HASH_STYLE" = "TRUE"; then
 5017         AC_MSG_RESULT( $WITH_LINKER_HASH_STYLE )
 5018     else
 5019         AC_MSG_RESULT( no )
 5020     fi
 5021     LDFLAGS=$hash_style_ldflags_save
 5022 else
 5023     AC_MSG_RESULT( no )
 5024 fi
 5025 AC_SUBST(HAVE_LD_HASH_STYLE)
 5026 AC_SUBST(WITH_LINKER_HASH_STYLE)
 5027 
 5028 dnl ===================================================================
 5029 dnl Check whether there's a Perl version available.
 5030 dnl ===================================================================
 5031 if test -z "$with_perl_home"; then
 5032     AC_PATH_PROG(PERL, perl)
 5033 else
 5034     test "$build_os" = "cygwin" && with_perl_home=`cygpath -u "$with_perl_home"`
 5035     _perl_path="$with_perl_home/bin/perl"
 5036     if test -x "$_perl_path"; then
 5037         PERL=$_perl_path
 5038     else
 5039         AC_MSG_ERROR([$_perl_path not found])
 5040     fi
 5041 fi
 5042 
 5043 dnl ===================================================================
 5044 dnl Testing for Perl version 5 or greater.
 5045 dnl $] is the Perl version variable, it is returned as an integer
 5046 dnl ===================================================================
 5047 if test "$PERL"; then
 5048     AC_MSG_CHECKING([the Perl version])
 5049     ${PERL} -e "exit($]);"
 5050     _perl_version=$?
 5051     if test "$_perl_version" -lt 5; then
 5052         AC_MSG_ERROR([found Perl $_perl_version, use Perl 5])
 5053     fi
 5054     AC_MSG_RESULT([Perl $_perl_version])
 5055 else
 5056     AC_MSG_ERROR([Perl not found, install Perl 5])
 5057 fi
 5058 
 5059 dnl ===================================================================
 5060 dnl Testing for required Perl modules
 5061 dnl ===================================================================
 5062 
 5063 AC_MSG_CHECKING([for required Perl modules])
 5064 perl_use_string="use Cwd ; use Digest::MD5"
 5065 if test "$_os" = "WINNT"; then
 5066     if test -n "$PKGFORMAT"; then
 5067         for i in $PKGFORMAT; do
 5068             case "$i" in
 5069             msi)
 5070                 # for getting fonts versions to use in MSI
 5071                 perl_use_string="$perl_use_string ; use Font::TTF::Font"
 5072                 ;;
 5073             esac
 5074         done
 5075     fi
 5076 fi
 5077 if test "$with_system_hsqldb" = "yes"; then
 5078 	perl_use_string="$perl_use_string ; use Archive::Zip"
 5079 fi
 5080 if $PERL -e "$perl_use_string">/dev/null 2>&1; then
 5081     AC_MSG_RESULT([all modules found])
 5082 else
 5083     AC_MSG_RESULT([failed to find some modules])
 5084     # Find out which modules are missing.
 5085     for i in $perl_use_string; do
 5086         if test "$i" != "use" -a "$i" != ";"; then
 5087             if ! $PERL -e "use $i;">/dev/null 2>&1; then
 5088                 missing_perl_modules="$missing_perl_modules $i"
 5089             fi
 5090         fi
 5091     done
 5092     AC_MSG_ERROR([
 5093     The missing Perl modules are: $missing_perl_modules
 5094     Install them as superuser/administrator with "cpan -i $missing_perl_modules"])
 5095 fi
 5096 
 5097 dnl ===================================================================
 5098 dnl Check for pkg-config
 5099 dnl ===================================================================
 5100 if test "$_os" != "WINNT"; then
 5101     PKG_PROG_PKG_CONFIG
 5102 fi
 5103 
 5104 if test "$_os" != "WINNT"; then
 5105 
 5106     # If you use CC=/path/to/compiler/foo-gcc or even CC="ccache
 5107     # /path/to/compiler/foo-gcc" you need to set the AR etc env vars
 5108     # explicitly. Or put /path/to/compiler in PATH yourself.
 5109 
 5110     # Use wrappers for LTO
 5111     if test "$ENABLE_LTO" = "TRUE" -a "$COM_IS_CLANG" != "TRUE"; then
 5112         AC_CHECK_TOOL(AR,gcc-ar)
 5113         AC_CHECK_TOOL(NM,gcc-nm)
 5114         AC_CHECK_TOOL(RANLIB,gcc-ranlib)
 5115     else
 5116         AC_CHECK_TOOL(AR,ar)
 5117         AC_CHECK_TOOL(NM,nm)
 5118         AC_CHECK_TOOL(RANLIB,ranlib)
 5119     fi
 5120     AC_CHECK_TOOL(OBJDUMP,objdump)
 5121     AC_CHECK_TOOL(READELF,readelf)
 5122     AC_CHECK_TOOL(STRIP,strip)
 5123     if test "$_os" = "WINNT"; then
 5124         AC_CHECK_TOOL(DLLTOOL,dlltool)
 5125         AC_CHECK_TOOL(WINDRES,windres)
 5126     fi
 5127 fi
 5128 AC_SUBST(AR)
 5129 AC_SUBST(DLLTOOL)
 5130 AC_SUBST(NM)
 5131 AC_SUBST(OBJDUMP)
 5132 AC_SUBST(PKG_CONFIG)
 5133 AC_SUBST(RANLIB)
 5134 AC_SUBST(READELF)
 5135 AC_SUBST(STRIP)
 5136 AC_SUBST(WINDRES)
 5137 
 5138 dnl ===================================================================
 5139 dnl pkg-config checks on Mac OS X
 5140 dnl ===================================================================
 5141 
 5142 if test $_os = Darwin; then
 5143     AC_MSG_CHECKING([for bogus pkg-config])
 5144     if test -n "$PKG_CONFIG"; then
 5145         if test "$PKG_CONFIG" = /usr/bin/pkg-config && ls -l /usr/bin/pkg-config | $GREP -q Mono.framework; then
 5146             AC_MSG_ERROR([yes, from Mono. This *will* break the build. Please remove or hide $PKG_CONFIG])
 5147         else
 5148             if test "$enable_bogus_pkg_config" = "yes"; then
 5149                 AC_MSG_RESULT([yes, user-approved from unknown origin.])
 5150             else
 5151                 AC_MSG_ERROR([yes, from unknown origin. This *will* break the build. Please modify your PATH variable so that $PKG_CONFIG is no longer found by configure scripts.])
 5152             fi
 5153         fi
 5154     else
 5155         AC_MSG_RESULT([no, good])
 5156     fi
 5157 fi
 5158 
 5159 find_csc()
 5160 {
 5161     # Return value: $csctest
 5162 
 5163     unset csctest
 5164 
 5165     reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/NET Framework Setup/NDP/v4/Client/InstallPath"
 5166     if test -n "$regvalue"; then
 5167         csctest=$regvalue
 5168         return
 5169     fi
 5170 }
 5171 
 5172 find_al()
 5173 {
 5174     # Return value: $altest
 5175 
 5176     unset altest
 5177 
 5178     for x in `ls /proc/registry32/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft\ SDKs/Windows`; do
 5179         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/$x/WinSDK-NetFx40Tools/InstallationFolder"
 5180         if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
 5181             altest=$regvalue
 5182             return
 5183         fi
 5184     done
 5185 
 5186     # We need this additional check to detect 4.6.1 or above.
 5187     for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1; do
 5188         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools/InstallationFolder"
 5189         if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
 5190             altest=$regvalue
 5191             return
 5192         fi
 5193 
 5194         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/WOW6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/WinSDK-NetFx40Tools"
 5195         if test -n "$regvalue" -a \( -f "$regvalue/al.exe" -o -f "$regvalue/bin/al.exe" \); then
 5196             altest=$regvalue
 5197             return
 5198         fi
 5199     done
 5200 }
 5201 
 5202 find_dotnetsdk46()
 5203 {
 5204     unset frametest
 5205 
 5206     for ver in 4.7.2 4.7.1 4.7 4.6.2 4.6.1 4.6; do
 5207         reg_get_value_64 "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
 5208         if test -n "$regvalue"; then
 5209             frametest=$regvalue
 5210             return
 5211         fi
 5212         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/NETFXSDK/$ver/KitsInstallationFolder"
 5213         if test -n "$regvalue"; then
 5214             frametest=$regvalue
 5215             return
 5216         fi
 5217     done
 5218 }
 5219 
 5220 find_winsdk_version()
 5221 {
 5222     # Args: $1 : SDK version as in "6.0A", "7.0" etc
 5223     # Return values: $winsdktest, $winsdkbinsubdir, $winsdklibsubdir
 5224 
 5225     unset winsdktest winsdkbinsubdir winsdklibsubdir
 5226 
 5227     case "$1" in
 5228     7.*)
 5229         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
 5230         if test -n "$regvalue"; then
 5231             winsdktest=$regvalue
 5232             winsdklibsubdir=.
 5233             return
 5234         fi
 5235         ;;
 5236     8.0|8.0A)
 5237         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot"
 5238         if test -n "$regvalue"; then
 5239             winsdktest=$regvalue
 5240             winsdklibsubdir=win8
 5241             return
 5242         fi
 5243         ;;
 5244     8.1|8.1A)
 5245         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows Kits/Installed Roots/KitsRoot81"
 5246         if test -n "$regvalue"; then
 5247             winsdktest=$regvalue
 5248             winsdklibsubdir=winv6.3
 5249             return
 5250         fi
 5251         ;;
 5252     10.0)
 5253         reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/InstallationFolder"
 5254         if test -n "$regvalue"; then
 5255             winsdktest=$regvalue
 5256             reg_get_value_32 "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SDKs/Windows/v${1}/ProductVersion"
 5257             if test -n "$regvalue"; then
 5258                 winsdkbinsubdir="$regvalue".0
 5259                 winsdklibsubdir=$winsdkbinsubdir
 5260                 tmppath="$winsdktest\\Include\\$winsdklibsubdir"
 5261                 # test exist the SDK path
 5262                 if test -d "$tmppath"; then
 5263                    # when path is convertible to a short path then path is okay
 5264                    if ! cygpath -d "$tmppath"; then
 5265                       AC_MSG_ERROR([Windows SDK doesn't have a 8.3 name, see NtfsDisable8dot3NameCreation])
 5266                    fi
 5267                 else
 5268                    AC_MSG_ERROR([The Windows SDK not found, check the installation])
 5269                 fi
 5270             fi
 5271             return
 5272         fi
 5273         ;;
 5274     esac
 5275 }
 5276 
 5277 find_winsdk()
 5278 {
 5279     # Return value: From find_winsdk_version
 5280 
 5281     unset winsdktest
 5282 
 5283     for ver in $WINDOWS_SDK_ACCEPTABLE_VERSIONS; do
 5284         find_winsdk_version $ver
 5285         if test -n "$winsdktest"; then
 5286             return
 5287         fi
 5288     done
 5289 }
 5290 
 5291 find_msms()
 5292 {
 5293     my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
 5294     if test $VCVER = 150; then
 5295         my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
 5296     fi
 5297     AC_MSG_CHECKING([for ${my_msm_files}])
 5298     msmdir=
 5299     for ver in 14.0 15.0; do
 5300         reg_get_value_32 HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
 5301         if test -n "$regvalue"; then
 5302             for f in ${my_msm_files}; do
 5303                 if test -e "$regvalue/${f}"; then
 5304                     msmdir=$regvalue
 5305                     break
 5306                 fi
 5307             done
 5308         fi
 5309     done
 5310     dnl Is the following fallback really necessary, or was it added in response
 5311     dnl to never having started Visual Studio on a given machine, so the
 5312     dnl registry keys checked above had presumably not yet been created?
 5313     dnl Anyway, if it really is necessary, it might be worthwhile to extend it
 5314     dnl to also check %CommonProgramFiles(X86)% (typically expanding to
 5315     dnl "C:\Program Files (X86)\Common Files" compared to %CommonProgramFiles%
 5316     dnl expanding to "C:\Program Files\Common Files"), which would need
 5317     dnl something like $(perl -e 'print $ENV{"CommonProgramFiles(x86)"}') to
 5318     dnl obtain its value from cygwin:
 5319     if test -z "$msmdir"; then
 5320         my_msm_dir="${COMMONPROGRAMFILES}/Merge Modules/"
 5321         for f in ${my_msm_files}; do
 5322             if test -e "$my_msm_dir/${f}"; then
 5323                 msmdir=$my_msm_dir
 5324             fi
 5325         done
 5326     fi
 5327 
 5328     dnl Starting from MSVC 15.0, merge modules are located in different directory
 5329     if test $VCVER = 150; then
 5330         for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
 5331             AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules])
 5332             my_msm_dir="$VC_PRODUCT_DIR/redist/MSVC/$l/MergeModules/"
 5333             for f in ${my_msm_files}; do
 5334                 if test -e "$my_msm_dir/${f}"; then
 5335                     msmdir=$my_msm_dir
 5336                     break
 5337                 fi
 5338             done
 5339         done
 5340     fi
 5341 
 5342     if test -n "$msmdir"; then
 5343         msmdir=`cygpath -m "$msmdir"`
 5344         AC_MSG_RESULT([$msmdir])
 5345     else
 5346         if test "$ENABLE_RELEASE_BUILD" = "TRUE" ; then
 5347             AC_MSG_ERROR([not found])
 5348         else
 5349             AC_MSG_WARN([not found])
 5350             add_warning "MSM none of ${my_msm_files} found"
 5351         fi
 5352     fi
 5353 }
 5354 
 5355 find_msvc_x64_dlls()
 5356 {
 5357     msvcdllpath="$VC_PRODUCT_DIR/redist/x64/Microsoft.VC${VCVER}.CRT"
 5358     if test "$VCVER" = 150; then
 5359         for l in `ls -1 $VC_PRODUCT_DIR/redist/MSVC/`; do
 5360             AC_MSG_CHECKING([for $VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT])
 5361             if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"; then
 5362                 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/x64/Microsoft.VC141.CRT"
 5363                 break
 5364             fi
 5365             if test -d "$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"; then
 5366                 msvcdllpath="$VC_PRODUCT_DIR/redist/MSVC/$l/onecore/x64/Microsoft.VC150.CRT"
 5367                 break
 5368             fi
 5369         done
 5370     fi
 5371     msvcdlls="msvcp140.dll vcruntime140.dll"
 5372     for dll in $msvcdlls; do
 5373         if ! test -f "$msvcdllpath/$dll"; then
 5374             AC_MSG_ERROR([can not find $dll in $msvcdllpath])
 5375         fi
 5376     done
 5377 }
 5378 
 5379 dnl =========================================
 5380 dnl Check for the Windows  SDK.
 5381 dnl =========================================
 5382 if test "$_os" = "WINNT"; then
 5383     AC_MSG_CHECKING([for Windows SDK])
 5384     if test "$build_os" = "cygwin"; then
 5385         find_winsdk
 5386         WINDOWS_SDK_HOME=$winsdktest
 5387 
 5388         # normalize if found
 5389         if test -n "$WINDOWS_SDK_HOME"; then
 5390             WINDOWS_SDK_HOME=`cygpath -d "$WINDOWS_SDK_HOME"`
 5391             WINDOWS_SDK_HOME=`cygpath -u "$WINDOWS_SDK_HOME"`
 5392         fi
 5393 
 5394         WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
 5395     fi
 5396 
 5397     if test -n "$WINDOWS_SDK_HOME"; then
 5398         # Remove a possible trailing backslash
 5399         WINDOWS_SDK_HOME=`echo $WINDOWS_SDK_HOME | $SED 's/\/$//'`
 5400 
 5401         if test -f "$WINDOWS_SDK_HOME/Include/adoint.h" \
 5402              -a -f "$WINDOWS_SDK_HOME/Include/SqlUcode.h" \
 5403              -a -f "$WINDOWS_SDK_HOME/Include/usp10.h"; then
 5404             have_windows_sdk_headers=yes
 5405         elif test -f "$WINDOWS_SDK_HOME/Include/um/adoint.h" \
 5406              -a -f "$WINDOWS_SDK_HOME/Include/um/SqlUcode.h" \
 5407              -a -f "$WINDOWS_SDK_HOME/Include/um/usp10.h"; then
 5408             have_windows_sdk_headers=yes
 5409         elif test -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/adoint.h" \
 5410              -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/SqlUcode.h" \
 5411              -a -f "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um/usp10.h"; then
 5412             have_windows_sdk_headers=yes
 5413         else
 5414             have_windows_sdk_headers=no
 5415         fi
 5416 
 5417         if test -f "$WINDOWS_SDK_HOME/lib/user32.lib"; then
 5418             have_windows_sdk_libs=yes
 5419         elif test -f "$WINDOWS_SDK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/user32.lib"; then
 5420             have_windows_sdk_libs=yes
 5421         else
 5422             have_windows_sdk_libs=no
 5423         fi
 5424 
 5425         if test $have_windows_sdk_headers = no -o $have_windows_sdk_libs = no; then
 5426             AC_MSG_ERROR([Some (all?) Windows SDK files not found, please check if all needed parts of
 5427 the  Windows SDK are installed.])
 5428         fi
 5429     fi
 5430 
 5431     if test -z "$WINDOWS_SDK_HOME"; then
 5432         AC_MSG_RESULT([no, hoping the necessary headers and libraries will be found anyway!?])
 5433     elif echo $WINDOWS_SDK_HOME | grep "v7.1" >/dev/null 2>/dev/null; then
 5434         WINDOWS_SDK_VERSION=70
 5435         AC_MSG_RESULT([found Windows SDK 7 ($WINDOWS_SDK_HOME)])
 5436     elif echo $WINDOWS_SDK_HOME | grep "8.0" >/dev/null 2>/dev/null; then
 5437         WINDOWS_SDK_VERSION=80
 5438         AC_MSG_RESULT([found Windows SDK 8.0 ($WINDOWS_SDK_HOME)])
 5439     elif echo $WINDOWS_SDK_HOME | grep "8.1" >/dev/null 2>/dev/null; then
 5440         WINDOWS_SDK_VERSION=81
 5441         AC_MSG_RESULT([found Windows SDK 8.1 ($WINDOWS_SDK_HOME)])
 5442     elif echo $WINDOWS_SDK_HOME | grep "/10" >/dev/null 2>/dev/null; then
 5443         WINDOWS_SDK_VERSION=10
 5444         AC_MSG_RESULT([found Windows SDK 10.0 ($WINDOWS_SDK_HOME)])
 5445     else
 5446         AC_MSG_ERROR([Found legacy Windows Platform SDK ($WINDOWS_SDK_HOME)])
 5447     fi
 5448     PathFormat "$WINDOWS_SDK_HOME"
 5449     WINDOWS_SDK_HOME="$formatted_path"
 5450     if test "$build_os" = "cygwin"; then
 5451         SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include -I$COMPATH/Include"
 5452         if test -d "$WINDOWS_SDK_HOME/include/um"; then
 5453             SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/include/um -I$WINDOWS_SDK_HOME/include/shared"
 5454         elif test -d "$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um"; then
 5455             SOLARINC="$SOLARINC -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/um -I$WINDOWS_SDK_HOME/Include/$winsdklibsubdir/shared"
 5456         fi
 5457     fi
 5458 
 5459     dnl TODO: solenv/bin/modules/installer/windows/msiglobal.pm wants to use a
 5460     dnl WiLangId.vbs that is included only in some SDKs (e.g., included in v7.1
 5461     dnl but not in v8.0), so allow this to be overridden with a
 5462     dnl WINDOWS_SDK_WILANGID for now; a full-blown --with-windows-sdk-wilangid
 5463     dnl and configuration error if no WiLangId.vbs is found would arguably be
 5464     dnl better, but I do not know under which conditions exactly it is needed by
 5465     dnl msiglobal.pm:
 5466     if test -z "$WINDOWS_SDK_WILANGID" -a -n "$WINDOWS_SDK_HOME"; then
 5467         WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/Samples/sysmgmt/msi/scripts/WiLangId.vbs
 5468         if ! test -e "$WINDOWS_SDK_WILANGID" ; then
 5469             WINDOWS_SDK_WILANGID="${WINDOWS_SDK_HOME}/bin/${WINDOWS_SDK_LIB_SUBDIR}/${WINDOWS_SDK_ARCH}/WiLangId.vbs"
 5470         fi
 5471         if ! test -e "$WINDOWS_SDK_WILANGID" ; then
 5472             WINDOWS_SDK_WILANGID=$WINDOWS_SDK_HOME/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs
 5473         fi
 5474         if ! test -e "$WINDOWS_SDK_WILANGID" ; then
 5475             WINDOWS_SDK_WILANGID=$(cygpath -sm "C:/Program Files (x86)/Windows Kits/8.1/bin/$WINDOWS_SDK_ARCH/WiLangId.vbs")
 5476         fi
 5477     fi
 5478     if test -n "$with_lang" -a "$with_lang" != "en-US"; then
 5479         if test -n "$with_package_format" -a "$with_package_format" != no; then
 5480             for i in "$with_package_format"; do
 5481                 if test "$i" = "msi"; then
 5482                     if ! test -e "$WINDOWS_SDK_WILANGID" ; then
 5483                         AC_MSG_ERROR([WiLangId.vbs not found - building translated packages will fail])
 5484                     fi
 5485                 fi
 5486             done
 5487         fi
 5488     fi
 5489 fi
 5490 AC_SUBST(WINDOWS_SDK_HOME)
 5491 AC_SUBST(WINDOWS_SDK_LIB_SUBDIR)
 5492 AC_SUBST(WINDOWS_SDK_VERSION)
 5493 AC_SUBST(WINDOWS_SDK_WILANGID)
 5494 
 5495 if test "$build_os" = "cygwin"; then
 5496     dnl Check midl.exe; this being the first check for a tool in the SDK bin
 5497     dnl dir, it also determines that dir's path w/o an arch segment if any,
 5498     dnl WINDOWS_SDK_BINDIR_NO_ARCH:
 5499     AC_MSG_CHECKING([for midl.exe])
 5500 
 5501     find_winsdk
 5502     if test -n "$winsdkbinsubdir" \
 5503         -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/midl.exe"
 5504     then
 5505         MIDL_PATH=$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH
 5506         WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin/$winsdkbinsubdir
 5507     elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/midl.exe"; then
 5508         MIDL_PATH=$winsdktest/Bin/$WINDOWS_SDK_ARCH
 5509         WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
 5510     elif test -f "$winsdktest/Bin/midl.exe"; then
 5511         MIDL_PATH=$winsdktest/Bin
 5512         WINDOWS_SDK_BINDIR_NO_ARCH=$WINDOWS_SDK_HOME/Bin
 5513     fi
 5514     if test ! -f "$MIDL_PATH/midl.exe"; then
 5515         AC_MSG_ERROR([midl.exe not found in $winsdktest/Bin/$WINDOWS_SDK_ARCH, Windows SDK installation broken?])
 5516     else
 5517         AC_MSG_RESULT([$MIDL_PATH/midl.exe])
 5518     fi
 5519 
 5520     # Convert to posix path with 8.3 filename restrictions ( No spaces )
 5521     MIDL_PATH=`win_short_path_for_make "$MIDL_PATH"`
 5522 
 5523     if test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msiinfo.exe" \
 5524          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msidb.exe" \
 5525          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/uuidgen.exe" \
 5526          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/msitran.exe"; then :
 5527     elif test -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msiinfo.exe" \
 5528          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msidb.exe" \
 5529          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
 5530          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/msitran.exe"; then :
 5531     elif test -f "$WINDOWS_SDK_HOME/bin/x86/msiinfo.exe" \
 5532          -a -f "$WINDOWS_SDK_HOME/bin/x86/msidb.exe" \
 5533          -a -f "$WINDOWS_SDK_BINDIR_NO_ARCH/x86/uuidgen.exe" \
 5534          -a -f "$WINDOWS_SDK_HOME/bin/x86/msitran.exe"; then :
 5535     else
 5536         AC_MSG_ERROR([Some (all?) Windows Installer tools in the Windows SDK are missing, please install.])
 5537     fi
 5538 
 5539     dnl Check csc.exe
 5540     AC_MSG_CHECKING([for csc.exe])
 5541     find_csc
 5542     if test -f "$csctest/csc.exe"; then
 5543         CSC_PATH="$csctest"
 5544     fi
 5545     if test ! -f "$CSC_PATH/csc.exe"; then
 5546         AC_MSG_ERROR([csc.exe not found as $CSC_PATH/csc.exe])
 5547     else
 5548         AC_MSG_RESULT([$CSC_PATH/csc.exe])
 5549     fi
 5550 
 5551     CSC_PATH=`win_short_path_for_make "$CSC_PATH"`
 5552 
 5553     dnl Check al.exe
 5554     AC_MSG_CHECKING([for al.exe])
 5555     find_winsdk
 5556     if test -n "$winsdkbinsubdir" \
 5557         -a -f "$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH/al.exe"
 5558     then
 5559         AL_PATH="$winsdktest/Bin/$winsdkbinsubdir/$WINDOWS_SDK_ARCH"
 5560     elif test -f "$winsdktest/Bin/$WINDOWS_SDK_ARCH/al.exe"; then
 5561         AL_PATH="$winsdktest/Bin/$WINDOWS_SDK_ARCH"
 5562     elif test -f "$winsdktest/Bin/al.exe"; then
 5563         AL_PATH="$winsdktest/Bin"
 5564     fi
 5565 
 5566     if test -z "$AL_PATH"; then
 5567         find_al
 5568         if test -f "$altest/bin/al.exe"; then
 5569             AL_PATH="$altest/bin"
 5570         elif test -f "$altest/al.exe"; then
 5571             AL_PATH="$altest"
 5572         fi
 5573     fi
 5574     if test ! -f "$AL_PATH/al.exe"; then
 5575         AC_MSG_ERROR([al.exe not found as $AL_PATH/al.exe])
 5576     else
 5577         AC_MSG_RESULT([$AL_PATH/al.exe])
 5578     fi
 5579 
 5580     AL_PATH=`win_short_path_for_make "$AL_PATH"`
 5581 
 5582     dnl Check mscoree.lib / .NET Framework dir
 5583     AC_MSG_CHECKING(.NET Framework)
 5584     find_dotnetsdk46
 5585     PathFormat "$frametest"
 5586     frametest="$formatted_path"
 5587     if test -f "$frametest/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
 5588         DOTNET_FRAMEWORK_HOME="$frametest"
 5589     else
 5590         find_winsdk
 5591         if test -f "$winsdktest/lib/mscoree.lib" -o -f "$winsdktest/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
 5592             DOTNET_FRAMEWORK_HOME="$winsdktest"
 5593         fi
 5594     fi
 5595     if test ! -f "$DOTNET_FRAMEWORK_HOME/lib/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/lib/$winsdklibsubdir/um/$WINDOWS_SDK_ARCH/mscoree.lib" -a ! -f "$DOTNET_FRAMEWORK_HOME/Lib/um/$WINDOWS_SDK_ARCH/mscoree.lib"; then
 5596         AC_MSG_ERROR([mscoree.lib not found])
 5597     fi
 5598     AC_MSG_RESULT([found: $DOTNET_FRAMEWORK_HOME])
 5599 
 5600     PathFormat "$MIDL_PATH"
 5601     MIDL_PATH="$formatted_path"
 5602 
 5603     PathFormat "$AL_PATH"
 5604     AL_PATH="$formatted_path"
 5605 
 5606     PathFormat "$DOTNET_FRAMEWORK_HOME"
 5607     DOTNET_FRAMEWORK_HOME="$formatted_path"
 5608 
 5609     PathFormat "$CSC_PATH"
 5610     CSC_PATH="$formatted_path"
 5611 fi
 5612 
 5613 dnl ===================================================================
 5614 dnl Check if stdc headers are available excluding MSVC.
 5615 dnl ===================================================================
 5616 if test "$_os" != "WINNT"; then
 5617     AC_HEADER_STDC
 5618 fi
 5619 
 5620 dnl ===================================================================
 5621 dnl Testing for C++ compiler and version...
 5622 dnl ===================================================================
 5623 
 5624 if test "$_os" != "WINNT"; then
 5625     # AC_PROG_CXX sets CXXFLAGS to -g -O2 if not set, avoid that
 5626     save_CXXFLAGS=$CXXFLAGS
 5627     AC_PROG_CXX
 5628     CXXFLAGS=$save_CXXFLAGS
 5629 else
 5630     if test -n "$CC" -a -z "$CXX"; then
 5631         CXX="$CC"
 5632     fi
 5633 fi
 5634 
 5635 dnl check for GNU C++ compiler version
 5636 if test "$GXX" = "yes"; then
 5637     AC_MSG_CHECKING([the GNU C++ compiler version])
 5638 
 5639     _gpp_version=`$CXX -dumpversion`
 5640     _gpp_majmin=`echo $_gpp_version | $AWK -F. '{ print \$1*100+\$2 }'`
 5641 
 5642     if test "$_gpp_majmin" -lt "401"; then
 5643         AC_MSG_ERROR([You need to use GNU C++ compiler version >= 4.1 to build LibreOffice, you have $_gpp_version.])
 5644     else
 5645         AC_MSG_RESULT([checked (g++ $_gpp_version)])
 5646     fi
 5647 
 5648     dnl see https://code.google.com/p/android/issues/detail?id=41770
 5649     if test "$_gpp_majmin" -ge "401"; then
 5650         glibcxx_threads=no
 5651         AC_LANG_PUSH([C++])
 5652         AC_REQUIRE_CPP
 5653         AC_MSG_CHECKING([whether $CXX is broken with boost.thread])
 5654         AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
 5655             #include <bits/c++config.h>]],[[
 5656             #if !defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
 5657             && !defined(_GLIBCXX__PTHREADS) \
 5658             && !defined(_GLIBCXX_HAS_GTHREADS)
 5659             choke me
 5660             #endif
 5661         ]])],[AC_MSG_RESULT([yes])
 5662         glibcxx_threads=yes],[AC_MSG_RESULT([no])])
 5663         AC_LANG_POP([C++])
 5664         if test $glibcxx_threads = yes; then
 5665             BOOST_CXXFLAGS="-D_GLIBCXX_HAS_GTHREADS"
 5666         fi
 5667      fi
 5668 fi
 5669 AC_SUBST(BOOST_CXXFLAGS)
 5670 
 5671 #
 5672 # prefx CXX with ccache if needed
 5673 #
 5674 if test "$CCACHE" != ""; then
 5675     AC_MSG_CHECKING([whether $CXX is already ccached])
 5676     AC_LANG_PUSH([C++])
 5677     save_CXXFLAGS=$CXXFLAGS
 5678     CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
 5679     dnl an empty program will do, we're checking the compiler flags
 5680     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
 5681                       [use_ccache=yes], [use_ccache=no])
 5682     if test $use_ccache = yes; then
 5683         AC_MSG_RESULT([yes])
 5684     else
 5685         CXX="$CCACHE $CXX"
 5686         AC_MSG_RESULT([no])
 5687     fi
 5688     CXXFLAGS=$save_CXXFLAGS
 5689     AC_LANG_POP([C++])
 5690 fi
 5691 
 5692 dnl ===================================================================
 5693 dnl Find pre-processors.(should do that _after_ messing with CC/CXX)
 5694 dnl ===================================================================
 5695 
 5696 if test "$_os" != "WINNT"; then
 5697     AC_PROG_CXXCPP
 5698 
 5699     dnl Check whether there's a C pre-processor.
 5700     AC_PROG_CPP
 5701 fi
 5702 
 5703 
 5704 dnl ===================================================================
 5705 dnl Find integral type sizes and alignments
 5706 dnl ===================================================================
 5707 
 5708 if test "$_os" != "WINNT"; then
 5709 
 5710 if test "$_os" == "iOS"; then
 5711     AC_MSG_CHECKING([iOS setting sizes long, short, int, long long, double, voidp])
 5712     ac_cv_sizeof_long=8
 5713     ac_cv_sizeof_short=2
 5714     ac_cv_sizeof_int=4
 5715     ac_cv_sizeof_long_long=8
 5716     ac_cv_sizeof_double=8
 5717     ac_cv_sizeof_voidp=8
 5718 else
 5719     AC_CHECK_SIZEOF(long)
 5720     AC_CHECK_SIZEOF(short)
 5721     AC_CHECK_SIZEOF(int)
 5722     AC_CHECK_SIZEOF(long long)
 5723     AC_CHECK_SIZEOF(double)
 5724     AC_CHECK_SIZEOF(void*)
 5725 fi
 5726 
 5727     SAL_TYPES_SIZEOFSHORT=$ac_cv_sizeof_short
 5728     SAL_TYPES_SIZEOFINT=$ac_cv_sizeof_int
 5729     SAL_TYPES_SIZEOFLONG=$ac_cv_sizeof_long
 5730     SAL_TYPES_SIZEOFLONGLONG=$ac_cv_sizeof_long_long
 5731     SAL_TYPES_SIZEOFPOINTER=$ac_cv_sizeof_voidp
 5732 
 5733     dnl Allow build without AC_CHECK_ALIGNOF, grrr
 5734     m4_pattern_allow([AC_CHECK_ALIGNOF])
 5735     m4_ifdef([AC_CHECK_ALIGNOF],
 5736         [
 5737             AC_CHECK_ALIGNOF(short,[#include <stddef.h>])
 5738             AC_CHECK_ALIGNOF(int,[#include <stddef.h>])
 5739             AC_CHECK_ALIGNOF(long,[#include <stddef.h>])
 5740             AC_CHECK_ALIGNOF(double,[#include <stddef.h>])
 5741         ],
 5742         [
 5743             case "$_os-$host_cpu" in
 5744             Linux-i686)
 5745                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
 5746                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
 5747                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=4
 5748                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=4
 5749                 ;;
 5750             Linux-x86_64)
 5751                 test -z "$ac_cv_alignof_short" && ac_cv_alignof_short=2
 5752                 test -z "$ac_cv_alignof_int" && ac_cv_alignof_int=4
 5753                 test -z "$ac_cv_alignof_long" && ac_cv_alignof_long=8
 5754                 test -z "$ac_cv_alignof_double" && ac_cv_alignof_double=8
 5755                 ;;
 5756             *)
 5757                 if test -z "$ac_cv_alignof_short" -o \
 5758                         -z "$ac_cv_alignof_int" -o \
 5759                         -z "$ac_cv_alignof_long" -o \
 5760                         -z "$ac_cv_alignof_double"; then
 5761                    AC_MSG_ERROR([Your Autoconf doesn't have [AC_][CHECK_ALIGNOF]. You need to set the environment variables ac_cv_alignof_short, ac_cv_alignof_int, ac_cv_alignof_long and ac_cv_alignof_double.])
 5762                 fi
 5763                 ;;
 5764             esac
 5765         ])
 5766 
 5767     SAL_TYPES_ALIGNMENT2=$ac_cv_alignof_short
 5768     SAL_TYPES_ALIGNMENT4=$ac_cv_alignof_int
 5769     if test $ac_cv_sizeof_long -eq 8; then
 5770         SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_long
 5771     elif test $ac_cv_sizeof_double -eq 8; then
 5772         SAL_TYPES_ALIGNMENT8=$ac_cv_alignof_double
 5773     else
 5774         AC_MSG_ERROR([Cannot find alignment of 8 byte types.])
 5775     fi
 5776 
 5777     dnl Check for large file support
 5778     AC_SYS_LARGEFILE
 5779     if test -n "$ac_cv_sys_file_offset_bits" -a "$ac_cv_sys_file_offset_bits" != "no"; then
 5780         LFS_CFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
 5781     fi
 5782     if test -n "$ac_cv_sys_large_files" -a "$ac_cv_sys_large_files" != "no"; then
 5783         LFS_CFLAGS="$LFS_CFLAGS -D_LARGE_FILES"
 5784     fi
 5785 else
 5786     # Hardcode for MSVC
 5787     SAL_TYPES_SIZEOFSHORT=2
 5788     SAL_TYPES_SIZEOFINT=4
 5789     SAL_TYPES_SIZEOFLONG=4
 5790     SAL_TYPES_SIZEOFLONGLONG=8
 5791     if test "$BITNESS_OVERRIDE" = ""; then
 5792         SAL_TYPES_SIZEOFPOINTER=4
 5793     else
 5794         SAL_TYPES_SIZEOFPOINTER=8
 5795     fi
 5796     SAL_TYPES_ALIGNMENT2=2
 5797     SAL_TYPES_ALIGNMENT4=4
 5798     SAL_TYPES_ALIGNMENT8=8
 5799     LFS_CFLAGS=''
 5800 fi
 5801 AC_SUBST(LFS_CFLAGS)
 5802 
 5803 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFSHORT,$SAL_TYPES_SIZEOFSHORT)
 5804 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFINT,$SAL_TYPES_SIZEOFINT)
 5805 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONG,$SAL_TYPES_SIZEOFLONG)
 5806 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFLONGLONG,$SAL_TYPES_SIZEOFLONGLONG)
 5807 AC_DEFINE_UNQUOTED(SAL_TYPES_SIZEOFPOINTER,$SAL_TYPES_SIZEOFPOINTER)
 5808 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT2,$SAL_TYPES_ALIGNMENT2)
 5809 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT4,$SAL_TYPES_ALIGNMENT4)
 5810 AC_DEFINE_UNQUOTED(SAL_TYPES_ALIGNMENT8,$SAL_TYPES_ALIGNMENT8)
 5811 
 5812 dnl ===================================================================
 5813 dnl Check whether to enable runtime optimizations
 5814 dnl ===================================================================
 5815 ENABLE_RUNTIME_OPTIMIZATIONS=
 5816 AC_MSG_CHECKING([whether to enable runtime optimizations])
 5817 if test -z "$enable_runtime_optimizations"; then
 5818     for i in $CC; do
 5819         case $i in
 5820         -fsanitize=*)
 5821             enable_runtime_optimizations=no
 5822             break
 5823             ;;
 5824         esac
 5825     done
 5826 fi
 5827 if test "$enable_runtime_optimizations" != no; then
 5828     ENABLE_RUNTIME_OPTIMIZATIONS=TRUE
 5829     AC_DEFINE(ENABLE_RUNTIME_OPTIMIZATIONS)
 5830     AC_MSG_RESULT([yes])
 5831 else
 5832     AC_MSG_RESULT([no])
 5833 fi
 5834 AC_SUBST([ENABLE_RUNTIME_OPTIMIZATIONS])
 5835 
 5836 dnl ===================================================================
 5837 dnl Check if valgrind headers are available
 5838 dnl ===================================================================
 5839 ENABLE_VALGRIND=
 5840 if test "$cross_compiling" != yes -a "$with_valgrind" != no; then
 5841     prev_cppflags=$CPPFLAGS
 5842     # Is VALGRIND_CFLAGS something one is supposed to have in the environment,
 5843     # or where does it come from?
 5844     CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
 5845     AC_CHECK_HEADER([valgrind/valgrind.h],
 5846         [ENABLE_VALGRIND=TRUE])
 5847     CPPFLAGS=$prev_cppflags
 5848 fi
 5849 AC_SUBST([ENABLE_VALGRIND])
 5850 if test -z "$ENABLE_VALGRIND"; then
 5851     if test "$with_valgrind" = yes; then
 5852         AC_MSG_ERROR([--with-valgrind specified but no Valgrind headers found])
 5853     fi
 5854     VALGRIND_CFLAGS=
 5855 fi
 5856 AC_SUBST([VALGRIND_CFLAGS])
 5857 
 5858 
 5859 dnl ===================================================================
 5860 dnl Check if SDT probes (for systemtap, gdb, dtrace) are available
 5861 dnl ===================================================================
 5862 
 5863 # We need at least the sys/sdt.h include header.
 5864 AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='TRUE'], [SDT_H_FOUND='FALSE'])
 5865 if test "$SDT_H_FOUND" = "TRUE"; then
 5866     # Found sys/sdt.h header, now make sure the c++ compiler works.
 5867     # Old g++ versions had problems with probes in constructors/destructors.
 5868     AC_MSG_CHECKING([working sys/sdt.h and c++ support])
 5869     AC_LANG_PUSH([C++])
 5870     AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 5871     #include <sys/sdt.h>
 5872     class ProbeClass
 5873     {
 5874     private:
 5875       int& ref;
 5876       const char *name;
 5877 
 5878     public:
 5879       ProbeClass(int& v, const char *n) : ref(v), name(n)
 5880       {
 5881         DTRACE_PROBE2(_test_, cons, name, ref);
 5882       }
 5883 
 5884       void method(int min)
 5885       {
 5886         DTRACE_PROBE3(_test_, meth, name, ref, min);
 5887         ref -= min;
 5888       }
 5889 
 5890       ~ProbeClass()
 5891       {
 5892         DTRACE_PROBE2(_test_, dest, name, ref);
 5893       }
 5894     };
 5895     ]],[[
 5896     int i = 64;
 5897     DTRACE_PROBE1(_test_, call, i);
 5898     ProbeClass inst = ProbeClass(i, "call");
 5899     inst.method(24);
 5900     ]])], [AC_MSG_RESULT([yes]); AC_DEFINE([USE_SDT_PROBES])],
 5901           [AC_MSG_RESULT([no, sdt.h or c++ compiler too old])])
 5902     AC_LANG_POP([C++])
 5903 fi
 5904 AC_CONFIG_HEADERS([config_host/config_probes.h])
 5905 
 5906 dnl ===================================================================
 5907 dnl GCC features
 5908 dnl ===================================================================
 5909 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
 5910     AC_MSG_CHECKING([whether $CC supports -mno-avx])
 5911     save_CFLAGS=$CFLAGS
 5912     CFLAGS="$CFLAGS -Werror -mno-avx"
 5913     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_AVX=TRUE ],[])
 5914     CFLAGS=$save_CFLAGS
 5915     if test "$HAVE_GCC_AVX" = "TRUE"; then
 5916         AC_MSG_RESULT([yes])
 5917     else
 5918         AC_MSG_RESULT([no])
 5919     fi
 5920 
 5921     AC_MSG_CHECKING([whether $CC supports -fstack-protector-strong])
 5922     save_CFLAGS=$CFLAGS
 5923     CFLAGS="$CFLAGS -O0 -Werror -fstack-protector-strong"
 5924     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char a[8]; a[7] = 0; ]])],[ HAVE_GCC_STACK_PROTECTOR_STRONG=TRUE ],[])
 5925     CFLAGS=$save_CFLAGS
 5926     if test "$HAVE_GCC_STACK_PROTECTOR_STRONG" = "TRUE"; then
 5927         AC_MSG_RESULT([yes])
 5928     else
 5929         AC_MSG_RESULT([no])
 5930     fi
 5931 
 5932     AC_MSG_CHECKING([whether $CC supports atomic functions])
 5933     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
 5934     int v = 0;
 5935     if (__sync_add_and_fetch(&v, 1) != 1 ||
 5936         __sync_sub_and_fetch(&v, 1) != 0)
 5937         return 1;
 5938     __sync_synchronize();
 5939     if (__sync_val_compare_and_swap(&v, 0, 1) != 0 ||
 5940         v != 1)
 5941         return 1;
 5942     return 0;
 5943 ]])],[HAVE_GCC_BUILTIN_ATOMIC=TRUE],[])
 5944     if test "$HAVE_GCC_BUILTIN_ATOMIC" = "TRUE"; then
 5945         AC_MSG_RESULT([yes])
 5946         AC_DEFINE(HAVE_GCC_BUILTIN_ATOMIC)
 5947     else
 5948         AC_MSG_RESULT([no])
 5949     fi
 5950 
 5951     AC_MSG_CHECKING([whether $CC supports __builtin_ffs])
 5952     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return __builtin_ffs(1); ]])],[HAVE_GCC_BUILTIN_FFS=TRUE],[])
 5953     if test "$HAVE_GCC_BUILTIN_FFS" = "TRUE"; then
 5954         AC_MSG_RESULT([yes])
 5955         AC_DEFINE(HAVE_GCC_BUILTIN_FFS)
 5956     else
 5957         AC_MSG_RESULT([no])
 5958     fi
 5959 
 5960     AC_MSG_CHECKING([whether $CC supports __attribute__((deprecated(message)))])
 5961     save_CFLAGS=$CFLAGS
 5962     CFLAGS="$CFLAGS -Werror"
 5963     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 5964             __attribute__((deprecated("test"))) void f();
 5965         ])], [
 5966             AC_DEFINE([HAVE_GCC_DEPRECATED_MESSAGE],[1])
 5967             AC_MSG_RESULT([yes])
 5968         ], [AC_MSG_RESULT([no])])
 5969     CFLAGS=$save_CFLAGS
 5970 
 5971     AC_MSG_CHECKING([whether $CXX defines __base_class_type_info in cxxabi.h])
 5972     AC_LANG_PUSH([C++])
 5973     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 5974             #include <cstddef>
 5975             #include <cxxabi.h>
 5976             std::size_t f() { return sizeof(__cxxabiv1::__base_class_type_info); }
 5977         ])], [
 5978             AC_DEFINE([HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO],[1])
 5979             AC_MSG_RESULT([yes])
 5980         ], [AC_MSG_RESULT([no])])
 5981     AC_LANG_POP([C++])
 5982 
 5983     AC_MSG_CHECKING([whether $CXX defines __class_type_info in cxxabi.h])
 5984     AC_LANG_PUSH([C++])
 5985     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 5986             #include <cstddef>
 5987             #include <cxxabi.h>
 5988             std::size_t f() { return sizeof(__cxxabiv1::__class_type_info); }
 5989         ])], [
 5990             AC_DEFINE([HAVE_CXXABI_H_CLASS_TYPE_INFO],[1])
 5991             AC_MSG_RESULT([yes])
 5992         ], [AC_MSG_RESULT([no])])
 5993     AC_LANG_POP([C++])
 5994 
 5995     AC_MSG_CHECKING([whether $CXX declares __cxa_allocate_exception in cxxabi.h])
 5996     AC_LANG_PUSH([C++])
 5997     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 5998             #include <cxxabi.h>
 5999             void * f() { return __cxxabiv1::__cxa_allocate_exception(0); }
 6000         ])], [
 6001             AC_DEFINE([HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION],[1])
 6002             AC_MSG_RESULT([yes])
 6003         ], [AC_MSG_RESULT([no])])
 6004     AC_LANG_POP([C++])
 6005 
 6006     AC_MSG_CHECKING([whether $CXX defines __cxa_eh_globals in cxxabi.h])
 6007     AC_LANG_PUSH([C++])
 6008     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6009             #include <cstddef>
 6010             #include <cxxabi.h>
 6011             std::size_t f() { return sizeof(__cxxabiv1::__cxa_eh_globals); }
 6012         ])], [
 6013             AC_DEFINE([HAVE_CXXABI_H_CXA_EH_GLOBALS],[1])
 6014             AC_MSG_RESULT([yes])
 6015         ], [AC_MSG_RESULT([no])])
 6016     AC_LANG_POP([C++])
 6017 
 6018     AC_MSG_CHECKING([whether $CXX defines __cxa_exceptions in cxxabi.h])
 6019     AC_LANG_PUSH([C++])
 6020     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6021             #include <cstddef>
 6022             #include <cxxabi.h>
 6023             std::size_t f() { return sizeof(__cxxabiv1::__cxa_exceptions); }
 6024         ])], [
 6025             AC_DEFINE([HAVE_CXXABI_H_CXA_EXCEPTIONS],[1])
 6026             AC_MSG_RESULT([yes])
 6027         ], [AC_MSG_RESULT([no])])
 6028     AC_LANG_POP([C++])
 6029 
 6030     AC_MSG_CHECKING([whether $CXX declares __cxa_get_globals in cxxabi.h])
 6031     AC_LANG_PUSH([C++])
 6032     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6033             #include <cxxabi.h>
 6034             void * f() { return __cxxabiv1::__cxa_get_globals(); }
 6035         ])], [
 6036             AC_DEFINE([HAVE_CXXABI_H_CXA_GET_GLOBALS],[1])
 6037             AC_MSG_RESULT([yes])
 6038         ], [AC_MSG_RESULT([no])])
 6039     AC_LANG_POP([C++])
 6040 
 6041     AC_MSG_CHECKING([whether $CXX declares __cxa_current_exception_type in cxxabi.h])
 6042     AC_LANG_PUSH([C++])
 6043     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6044             #include <cxxabi.h>
 6045             void * f() { return __cxxabiv1::__cxa_current_exception_type(); }
 6046         ])], [
 6047             AC_DEFINE([HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE],[1])
 6048             AC_MSG_RESULT([yes])
 6049         ], [AC_MSG_RESULT([no])])
 6050     AC_LANG_POP([C++])
 6051 
 6052     AC_MSG_CHECKING([whether $CXX declares __cxa_throw in cxxabi.h])
 6053     AC_LANG_PUSH([C++])
 6054     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6055             #include <cxxabi.h>
 6056             void f() { __cxxabiv1::__cxa_throw(0, 0, 0); }
 6057         ])], [
 6058             AC_DEFINE([HAVE_CXXABI_H_CXA_THROW],[1])
 6059             AC_MSG_RESULT([yes])
 6060         ], [AC_MSG_RESULT([no])])
 6061     AC_LANG_POP([C++])
 6062 
 6063     AC_MSG_CHECKING([whether $CXX defines __si_class_type_info in cxxabi.h])
 6064     AC_LANG_PUSH([C++])
 6065     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6066             #include <cstddef>
 6067             #include <cxxabi.h>
 6068             std::size_t f() { return sizeof(__cxxabiv1::__si_class_type_info); }
 6069         ])], [
 6070             AC_DEFINE([HAVE_CXXABI_H_SI_CLASS_TYPE_INFO],[1])
 6071             AC_MSG_RESULT([yes])
 6072         ], [AC_MSG_RESULT([no])])
 6073     AC_LANG_POP([C++])
 6074 
 6075     AC_MSG_CHECKING([whether $CXX defines __vmi_class_type_info in cxxabi.h])
 6076     AC_LANG_PUSH([C++])
 6077     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6078             #include <cstddef>
 6079             #include <cxxabi.h>
 6080             std::size_t f() { return sizeof(__cxxabiv1::__vmi_class_type_info); }
 6081         ])], [
 6082             AC_DEFINE([HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO],[1])
 6083             AC_MSG_RESULT([yes])
 6084         ], [AC_MSG_RESULT([no])])
 6085     AC_LANG_POP([C++])
 6086 
 6087     dnl Available in GCC 4.9 and at least since Clang 3.4:
 6088     AC_MSG_CHECKING([whether $CXX supports __attribute__((warn_unused))])
 6089     AC_LANG_PUSH([C++])
 6090     save_CXXFLAGS=$CXXFLAGS
 6091     CXXFLAGS="$CXXFLAGS -Werror"
 6092     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6093             struct __attribute__((warn_unused)) dummy {};
 6094         ])], [
 6095             AC_DEFINE([HAVE_GCC_ATTRIBUTE_WARN_UNUSED],[1])
 6096             AC_MSG_RESULT([yes])
 6097         ], [AC_MSG_RESULT([no])])
 6098     CXXFLAGS=$save_CXXFLAGS
 6099 AC_LANG_POP([C++])
 6100 fi
 6101 
 6102 AC_SUBST(HAVE_GCC_AVX)
 6103 AC_SUBST(HAVE_GCC_STACK_PROTECTOR_STRONG)
 6104 AC_SUBST(HAVE_GCC_BUILTIN_ATOMIC)
 6105 AC_SUBST(HAVE_GCC_BUILTIN_FFS)
 6106 
 6107 dnl ===================================================================
 6108 dnl Identify the C++ library
 6109 dnl ===================================================================
 6110 
 6111 AC_MSG_CHECKING([what the C++ library is])
 6112 AC_LANG_PUSH([C++])
 6113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6114 #include <utility>
 6115 #ifndef __GLIBCXX__
 6116 foo bar
 6117 #endif
 6118 ]])],
 6119     [CPP_LIBRARY=GLIBCXX
 6120      cpp_library_name="GNU libstdc++"
 6121     ],
 6122     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6123 #include <utility>
 6124 #ifndef _LIBCPP_VERSION
 6125 foo bar
 6126 #endif
 6127 ]])],
 6128     [CPP_LIBRARY=LIBCPP
 6129      cpp_library_name="LLVM libc++"
 6130      AC_DEFINE([HAVE_LIBCXX])
 6131     ],
 6132     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6133 #include <utility>
 6134 #ifndef _MSC_VER
 6135 foo bar
 6136 #endif
 6137 ]])],
 6138     [CPP_LIBRARY=MSVCRT
 6139      cpp_library_name="Microsoft"
 6140     ],
 6141     AC_MSG_ERROR([Could not figure out what C++ library this is]))))
 6142 AC_MSG_RESULT([$cpp_library_name])
 6143 AC_LANG_POP([C++])
 6144 
 6145 dnl ===================================================================
 6146 dnl Check for gperf
 6147 dnl ===================================================================
 6148 AC_PATH_PROG(GPERF, gperf)
 6149 if test -z "$GPERF"; then
 6150     AC_MSG_ERROR([gperf not found but needed. Install it.])
 6151 fi
 6152 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 6153     GPERF=`cygpath -m $GPERF`
 6154 fi
 6155 AC_MSG_CHECKING([gperf version])
 6156 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then
 6157     AC_MSG_RESULT([OK])
 6158 else
 6159     AC_MSG_ERROR([too old, you need at least 3.0.0])
 6160 fi
 6161 AC_SUBST(GPERF)
 6162 
 6163 dnl ===================================================================
 6164 dnl Check for system libcmis
 6165 dnl ===================================================================
 6166 # libcmis requires curl and we can't build curl for iOS
 6167 if test $_os != iOS; then
 6168     libo_CHECK_SYSTEM_MODULE([libcmis],[LIBCMIS],[libcmis-0.5 >= 0.5.0])
 6169     ENABLE_LIBCMIS=TRUE
 6170 else
 6171     ENABLE_LIBCMIS=
 6172 fi
 6173 AC_SUBST(ENABLE_LIBCMIS)
 6174 
 6175 dnl ===================================================================
 6176 dnl C++11
 6177 dnl ===================================================================
 6178 
 6179 my_cxx17switches=
 6180 libo_FUZZ_ARG_ENABLE(c++17,
 6181     AS_HELP_STRING([--disable-c++17],
 6182         [Do not attempt to run GCC/Clang in C++17 mode (needed for Coverity).])
 6183 )
 6184 
 6185 AC_MSG_CHECKING([whether $CXX supports C++17, C++14, or C++11])
 6186 CXXFLAGS_CXX11=
 6187 if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
 6188     CXXFLAGS_CXX11=-std:c++17
 6189 elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
 6190     dnl But only use C++17 if the gperf that is being used knows not to emit
 6191     dnl "register" in C++ output:
 6192     printf 'foo\n' | $GPERF -L C++ > conftest.inc
 6193     my_flags='-std=gnu++14 -std=gnu++1y -std=c++14 -std=c++1y -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x'
 6194     if test "$enable_c__17" != no; then
 6195         my_flags="-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z $my_flags"
 6196     fi
 6197     for flag in $my_flags; do
 6198         if test "$COM" = MSC; then
 6199             flag="-Xclang $flag"
 6200         fi
 6201         save_CXXFLAGS=$CXXFLAGS
 6202         CXXFLAGS="$CXXFLAGS $flag -Werror"
 6203         if test "$SYSTEM_LIBCMIS" = TRUE; then
 6204             CXXFLAGS="$CXXFLAGS -DSYSTEM_LIBCMIS $LIBCMIS_CFLAGS"
 6205         fi
 6206         AC_LANG_PUSH([C++])
 6207         dnl Clang 3.9 supports __float128 since
 6208         dnl <http://llvm.org/viewvc/llvm-project?view=revision&revision=268898> "Enable support for
 6209         dnl __float128 in Clang and enable it on pertinent platforms", but Clang 3.8 may need a
 6210         dnl hacky workaround to be able to include <vector> (as is done in the main check whether
 6211         dnl $flag is supported below, so check this first):
 6212         my_float128hack=
 6213         my_float128hack_impl=-D__float128=void
 6214         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6215             #include <vector>
 6216             // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
 6217             // (__float128)
 6218             ]])
 6219         ],,[
 6220             dnl The only reason why libstdc++ headers fail with Clang in C++11 mode is because they
 6221             dnl use the __float128 type that Clang doesn't know (libstdc++ checks whether __float128
 6222             dnl is available during its build, but it's usually built using GCC, and so c++config.h
 6223             dnl hardcodes __float128 being supported). At least for some older libstdc++, the only
 6224             dnl place where __float128 is used is in a template specialization, -D__float128=void
 6225             dnl will avoid the problem there while still causing a problem if somebody actually uses
 6226             dnl the type. (But some later libstdc++ are known to use __float128 also in algorithm ->
 6227             dnl bits/stl_alog.h -> cstdlib -> bits/std_abs.h, in a way that unfortunately cannot be
 6228             dnl "fixed" with this hack):
 6229             CXXFLAGS="$CXXFLAGS $my_float128hack_impl"
 6230             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6231                 #include <vector>
 6232                 // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x
 6233                 // (__float128)
 6234                 ]])
 6235             ],[my_float128hack=$my_float128hack_impl])
 6236         ])
 6237         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6238             #include <algorithm>
 6239             #include <functional>
 6240             #include <vector>
 6241 
 6242             #include <string.h>
 6243             #pragma GCC diagnostic push
 6244             #pragma GCC diagnostic ignored "-Wpragmas"
 6245                 // make GCC not warn about next pragma
 6246             #pragma GCC diagnostic ignored "-Wdeprecated-register"
 6247                 // make Clang with -std < C++17 not even warn about register
 6248             #include "conftest.inc"
 6249             #pragma GCC diagnostic pop
 6250 
 6251             #if defined SYSTEM_LIBCMIS
 6252             // See ucb/source/ucp/cmis/auth_provider.hxx:
 6253             #if __GNUC__ >= 7
 6254             #pragma GCC diagnostic push
 6255             #pragma GCC diagnostic ignored "-Wdeprecated"
 6256             #pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
 6257             #endif
 6258             #include <libcmis/libcmis.hxx>
 6259             #if __GNUC__ >= 7
 6260             #pragma GCC diagnostic pop
 6261             #endif
 6262             #endif
 6263 
 6264             void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
 6265                 std::sort(v.begin(), v.end(), fn);
 6266             }
 6267             ]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
 6268         AC_LANG_POP([C++])
 6269         CXXFLAGS=$save_CXXFLAGS
 6270         if test -n "$CXXFLAGS_CXX11"; then
 6271             break
 6272         fi
 6273     done
 6274     rm conftest.inc
 6275 fi
 6276 if test -n "$CXXFLAGS_CXX11"; then
 6277     AC_MSG_RESULT([yes ($CXXFLAGS_CXX11)])
 6278 else
 6279     AC_MSG_ERROR(no)
 6280 fi
 6281 AC_SUBST(CXXFLAGS_CXX11)
 6282 
 6283 dnl Test for temporarily incompatible libstdc++ 4.7.{0,1}, where
 6284 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=179528> introduced
 6285 dnl an additional member _M_size into C++11 std::list towards 4.7.0 and
 6286 dnl <https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=189186> removed it
 6287 dnl again towards 4.7.2:
 6288 if test $CPP_LIBRARY = GLIBCXX; then
 6289     AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage])
 6290     AC_LANG_PUSH([C++])
 6291     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6292 #include <list>
 6293 #if !defined __GLIBCXX__ || (__GLIBCXX__ != 20120322 && __GLIBCXX__ != 20120614)
 6294     // according to <https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html>:
 6295     //   GCC 4.7.0: 20120322
 6296     //   GCC 4.7.1: 20120614
 6297     // and using a range check is not possible as the mapping between
 6298     // __GLIBCXX__ values and GCC versions is not monotonic
 6299 /* ok */
 6300 #else
 6301 abi broken
 6302 #endif
 6303         ]])], [AC_MSG_RESULT(no, ok)],
 6304         [AC_MSG_ERROR(yes)])
 6305     AC_LANG_POP([C++])
 6306 fi
 6307 
 6308 AC_MSG_CHECKING([whether $CXX supports C++11 without Language Defect 757])
 6309 save_CXXFLAGS=$CXXFLAGS
 6310 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6311 AC_LANG_PUSH([C++])
 6312 
 6313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6314 #include <stddef.h>
 6315 
 6316 template <typename T, size_t S> char (&sal_n_array_size( T(&)[S] ))[S];
 6317 
 6318 namespace
 6319 {
 6320         struct b
 6321         {
 6322                 int i;
 6323                 int j;
 6324         };
 6325 }
 6326 ]], [[
 6327 struct a
 6328 {
 6329         int i;
 6330         int j;
 6331 };
 6332 a thinga[]={{0,0}, {1,1}};
 6333 b thingb[]={{0,0}, {1,1}};
 6334 size_t i = sizeof(sal_n_array_size(thinga));
 6335 size_t j = sizeof(sal_n_array_size(thingb));
 6336 return !(i != 0 && j != 0);
 6337 ]])
 6338     ], [ AC_MSG_RESULT(yes) ],
 6339     [ AC_MSG_ERROR(no)])
 6340 AC_LANG_POP([C++])
 6341 CXXFLAGS=$save_CXXFLAGS
 6342 
 6343 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
 6344 save_CXXFLAGS=$CXXFLAGS
 6345 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6346 AC_LANG_PUSH([C++])
 6347 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 6348     // A somewhat over-complicated way of checking for
 6349     // <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66460> "ICE using __func__
 6350     // in constexpr function":
 6351     #include <cassert>
 6352     template<typename T> inline constexpr T f(T x) { return x; }
 6353     template<typename T> inline constexpr T g(T x) {
 6354         assert(f(static_cast<int>(x)));
 6355         return x;
 6356     }
 6357     enum E { e };
 6358     auto v = g(E::e);
 6359 
 6360     struct S {
 6361         int n_;
 6362         constexpr bool f() {
 6363             int n = n_;
 6364             int i = 0;
 6365             while (n > 0) { --n; ++i; }
 6366             assert(i >= 0);
 6367             return i == 0;
 6368         }
 6369     };
 6370     constexpr auto v2 = S{10}.f();
 6371     ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
 6372 AC_LANG_POP([C++])
 6373 CXXFLAGS=$save_CXXFLAGS
 6374 AC_MSG_RESULT([$cxx14_constexpr])
 6375 if test "$cxx14_constexpr" = yes; then
 6376     AC_DEFINE([HAVE_CXX14_CONSTEXPR])
 6377 fi
 6378 
 6379 dnl _Pragma support (may require C++11)
 6380 if test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
 6381     AC_MSG_CHECKING([whether $CXX supports _Pragma operator])
 6382     AC_LANG_PUSH([C++])
 6383     save_CXXFLAGS=$CXXFLAGS
 6384     CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11 -Werror"
 6385     AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6386             _Pragma("GCC diagnostic ignored \"-Wformat\"")
 6387         ])], [
 6388             AC_DEFINE([HAVE_GCC_PRAGMA_OPERATOR],[1])
 6389             AC_MSG_RESULT([yes])
 6390         ], [AC_MSG_RESULT([no])])
 6391     AC_LANG_POP([C++])
 6392     CXXFLAGS=$save_CXXFLAGS
 6393 fi
 6394 
 6395 HAVE_GCC_FNO_SIZED_DEALLOCATION=
 6396 if test "$GCC" = yes; then
 6397     AC_MSG_CHECKING([whether $CXX supports -fno-sized-deallocation])
 6398     AC_LANG_PUSH([C++])
 6399     save_CXXFLAGS=$CXXFLAGS
 6400     CXXFLAGS="$CXXFLAGS -fno-sized-deallocation"
 6401     AC_LINK_IFELSE([AC_LANG_PROGRAM()],[HAVE_GCC_FNO_SIZED_DEALLOCATION=TRUE])
 6402     CXXFLAGS=$save_CXXFLAGS
 6403     AC_LANG_POP([C++])
 6404     if test "$HAVE_GCC_FNO_SIZED_DEALLOCATION" = TRUE; then
 6405         AC_MSG_RESULT([yes])
 6406     else
 6407         AC_MSG_RESULT([no])
 6408     fi
 6409 fi
 6410 AC_SUBST([HAVE_GCC_FNO_SIZED_DEALLOCATION])
 6411 
 6412 AC_MSG_CHECKING([[whether $CXX supports [[fallthrough]]]])
 6413 AC_LANG_PUSH([C++])
 6414 save_CXXFLAGS=$CXXFLAGS
 6415 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6416 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
 6417 if test "$COM" = MSC; then
 6418     CXXFLAGS="$CXXFLAGS /we5030"
 6419 else
 6420     CXXFLAGS="$CXXFLAGS -Werror"
 6421 fi
 6422 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 6423         // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
 6424         // by checking for __cplusplus:
 6425         #if __cplusplus > 201703L
 6426         #if !__has_cpp_attribute(fallthrough)
 6427         #error
 6428         #endif
 6429         #else
 6430         void f(int & x) {
 6431             switch (x) {
 6432             case 0:
 6433                 ++x;
 6434                 [[fallthrough]];
 6435             default:
 6436                 ++x;
 6437             }
 6438         }
 6439         #endif
 6440     ]])], [
 6441         AC_DEFINE([HAVE_CPP_ATTRIBUTE_FALLTHROUGH],[1])
 6442         AC_MSG_RESULT([yes])
 6443     ], [AC_MSG_RESULT([no])])
 6444 CXXFLAGS=$save_CXXFLAGS
 6445 AC_LANG_POP([C++])
 6446 
 6447 AC_MSG_CHECKING([[whether $CXX supports [[nodiscard]]]])
 6448 AC_LANG_PUSH([C++])
 6449 save_CXXFLAGS=$CXXFLAGS
 6450 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6451 dnl Unknown attributes must be ignored by compilers, but they do emit warnings about them:
 6452 if test "$COM" = MSC; then
 6453     CXXFLAGS="$CXXFLAGS /we5030"
 6454 else
 6455     CXXFLAGS="$CXXFLAGS -Werror"
 6456 fi
 6457 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 6458         // There appears to be no feature-test macro for __has_cpp_attribute in C++2a, approximate
 6459         // by checking for __cplusplus:
 6460         #if __cplusplus > 201703L
 6461         #if !__has_cpp_attribute(nodiscard)
 6462         #error
 6463         #endif
 6464         #else
 6465         [[nodiscard]] int f();
 6466         #endif
 6467     ]])], [
 6468         AC_DEFINE([HAVE_CPP_ATTRIBUTE_NODISCARD],[1])
 6469         AC_MSG_RESULT([yes])
 6470     ], [AC_MSG_RESULT([no])])
 6471 CXXFLAGS=$save_CXXFLAGS
 6472 AC_LANG_POP([C++])
 6473 
 6474 AC_MSG_CHECKING([whether $CXX supports guaranteed copy elision])
 6475 AC_LANG_PUSH([C++])
 6476 save_CXXFLAGS=$CXXFLAGS
 6477 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6478 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6479         // At least VS 2017 15.8.1 defines __cpp_guaranteed_copy_elision as 201606L without actually
 6480         // supporting it:
 6481         #if !defined __cpp_guaranteed_copy_elision || (defined _MSC_VER && !defined __clang__)
 6482         struct S {
 6483         private:
 6484             S(S const &);
 6485         public:
 6486             S();
 6487             ~S();
 6488         };
 6489         S copy();
 6490         void f() { S c(copy()); }
 6491         #endif
 6492     ])], [
 6493         AC_DEFINE([HAVE_CPP_GUARANTEED_COPY_ELISION],[1])
 6494         AC_MSG_RESULT([yes])
 6495     ], [AC_MSG_RESULT([no])])
 6496 CXXFLAGS=$save_CXXFLAGS
 6497 AC_LANG_POP([C++])
 6498 
 6499 AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
 6500 AC_LANG_PUSH([C++])
 6501 save_CXXFLAGS=$CXXFLAGS
 6502 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6503 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6504         #include <memory>
 6505         struct S1 {};
 6506         struct S2: S1 {};
 6507         std::unique_ptr<S1> f() {
 6508             std::unique_ptr<S2> s2(new S2);
 6509             return s2;
 6510         }
 6511     ])], [
 6512         AC_DEFINE([HAVE_CXX_CWG1579_FIX],[1])
 6513         AC_MSG_RESULT([yes])
 6514     ], [AC_MSG_RESULT([no])])
 6515 CXXFLAGS=$save_CXXFLAGS
 6516 AC_LANG_POP([C++])
 6517 
 6518 AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
 6519 AC_LANG_PUSH([C++])
 6520 save_CXXFLAGS=$CXXFLAGS
 6521 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
 6522 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 6523         struct S1 { S1(S1 &&); };
 6524         struct S2: S1 {};
 6525         S1 f(S2 s) { return s; }
 6526     ])], [
 6527         AC_DEFINE([HAVE_GCC_BUG_87150],[1])
 6528         AC_MSG_RESULT([yes])
 6529     ], [AC_MSG_RESULT([no])])
 6530 CXXFLAGS=$save_CXXFLAGS
 6531 AC_LANG_POP([C++])
 6532 
 6533 dnl ===================================================================
 6534 dnl system stl sanity tests
 6535 dnl ===================================================================
 6536 if test "$_os" != "WINNT"; then
 6537 
 6538     AC_LANG_PUSH([C++])
 6539 
 6540     save_CPPFLAGS="$CPPFLAGS"
 6541     if test -n "$MACOSX_SDK_PATH"; then
 6542         CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
 6543     fi
 6544 
 6545     # Assume visibility is not broken with libc++. The below test is very much designed for libstdc++
 6546     # only.
 6547     if test "$CPP_LIBRARY" = GLIBCXX; then
 6548         dnl gcc#19664, gcc#22482, rhbz#162935
 6549         AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
 6550         AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
 6551         AC_MSG_RESULT([$stlvisok])
 6552         if test "$stlvisok" = "no"; then
 6553             AC_MSG_ERROR([Your libstdc++ headers are not visibility safe. This is no longer supported.])
 6554         fi
 6555     fi
 6556 
 6557     # As the below test checks things when linking self-compiled dynamic libraries, it presumably is irrelevant
 6558     # when we don't make any dynamic libraries?
 6559     if test "$DISABLE_DYNLOADING" = ""; then
 6560         AC_MSG_CHECKING([if gcc is -fvisibility-inlines-hidden safe (Clang bug 11250)])
 6561         cat > conftestlib1.cc <<_ACEOF
 6562 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
 6563 struct S2: S1<int> { virtual ~S2(); };
 6564 S2::~S2() {}
 6565 _ACEOF
 6566         cat > conftestlib2.cc <<_ACEOF
 6567 template<typename T> struct S1 { virtual ~S1() {} virtual void f() {} };
 6568 struct S2: S1<int> { virtual ~S2(); };
 6569 struct S3: S2 { virtual ~S3(); }; S3::~S3() {}
 6570 _ACEOF
 6571         gccvisinlineshiddenok=yes
 6572         if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib1.cc -o libconftest1$DLLPOST >/dev/null 2>&5; then
 6573             gccvisinlineshiddenok=no
 6574         else
 6575             dnl At least Clang -fsanitize=address and -fsanitize=undefined are
 6576             dnl known to not work with -z defs (unsetting which makes the test
 6577             dnl moot, though):
 6578             my_linkflagsnoundefs=$LINKFLAGSNOUNDEFS
 6579             if test "$COM_IS_CLANG" = TRUE; then
 6580                 for i in $CXX $CXXFLAGS; do
 6581                     case $i in
 6582                     -fsanitize=*)
 6583                         my_linkflagsnoundefs=
 6584                         break
 6585                         ;;
 6586                     esac
 6587                 done
 6588             fi
 6589             if ! $CXX $CXXFLAGS $CPPFLAGS $LINKFLAGSSHL -fPIC -fvisibility-inlines-hidden conftestlib2.cc -L. -lconftest1 $my_linkflagsnoundefs -o libconftest2$DLLPOST >/dev/null 2>&5; then
 6590                 gccvisinlineshiddenok=no
 6591             fi
 6592         fi
 6593 
 6594         rm -fr libconftest*
 6595         AC_MSG_RESULT([$gccvisinlineshiddenok])
 6596         if test "$gccvisinlineshiddenok" = "no"; then
 6597             AC_MSG_ERROR([Your gcc/clang is not -fvisibility-inlines-hidden safe. This is no longer supported.])
 6598         fi
 6599     fi
 6600 
 6601    AC_MSG_CHECKING([if gcc has a visibility bug with class-level attributes (GCC bug 26905)])
 6602     cat >visibility.cxx <<_ACEOF
 6603 #pragma GCC visibility push(hidden)
 6604 struct __attribute__ ((visibility ("default"))) TestStruct {
 6605   static void Init();
 6606 };
 6607 __attribute__ ((visibility ("default"))) void TestFunc() {
 6608   TestStruct::Init();
 6609 }
 6610 _ACEOF
 6611     if ! $CXX $CXXFLAGS $CPPFLAGS -fpic -S visibility.cxx; then
 6612         gccvisbroken=yes
 6613     else
 6614         case "$host_cpu" in
 6615         i?86|x86_64)
 6616             if test "$_os" = "Darwin" -o "$_os" = "iOS"; then
 6617                 gccvisbroken=no
 6618             else
 6619                 if $EGREP -q '@PLT|@GOT' visibility.s || test "$ENABLE_LTO" = "TRUE"; then
 6620                     gccvisbroken=no
 6621                 else
 6622                     gccvisbroken=yes
 6623                 fi
 6624             fi
 6625             ;;
 6626         *)
 6627             gccvisbroken=no
 6628             ;;
 6629         esac
 6630     fi
 6631     rm -f visibility.s visibility.cxx
 6632 
 6633     AC_MSG_RESULT([$gccvisbroken])
 6634     if test "$gccvisbroken" = "yes"; then
 6635         AC_MSG_ERROR([Your gcc is not -fvisibility=hidden safe. This is no longer supported.])
 6636     fi
 6637 
 6638     CPPFLAGS="$save_CPPFLAGS"
 6639 
 6640     AC_LANG_POP([C++])
 6641 fi
 6642 
 6643 dnl ===================================================================
 6644 dnl  Clang++ tests
 6645 dnl ===================================================================
 6646 
 6647 HAVE_GCC_FNO_DEFAULT_INLINE=
 6648 HAVE_GCC_FNO_ENFORCE_EH_SPECS=
 6649 if test "$GCC" = "yes"; then
 6650     AC_MSG_CHECKING([whether $CXX supports -fno-default-inline])
 6651     AC_LANG_PUSH([C++])
 6652     save_CXXFLAGS=$CXXFLAGS
 6653     CXXFLAGS="$CFLAGS -Werror -fno-default-inline"
 6654     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_DEFAULT_INLINE=TRUE ],[])
 6655     CXXFLAGS=$save_CXXFLAGS
 6656     AC_LANG_POP([C++])
 6657     if test "$HAVE_GCC_FNO_DEFAULT_INLINE" = "TRUE"; then
 6658         AC_MSG_RESULT([yes])
 6659     else
 6660         AC_MSG_RESULT([no])
 6661     fi
 6662 
 6663     AC_MSG_CHECKING([whether $CXX supports -fno-enforce-eh-specs])
 6664     AC_LANG_PUSH([C++])
 6665     save_CXXFLAGS=$CXXFLAGS
 6666     CXXFLAGS="$CFLAGS -Werror -fno-enforce-eh-specs"
 6667     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ HAVE_GCC_FNO_ENFORCE_EH_SPECS=TRUE ],[])
 6668     CXXFLAGS=$save_CXXFLAGS
 6669     AC_LANG_POP([C++])
 6670     if test "$HAVE_GCC_FNO_ENFORCE_EH_SPECS" = "TRUE"; then
 6671         AC_MSG_RESULT([yes])
 6672     else
 6673         AC_MSG_RESULT([no])
 6674     fi
 6675 fi
 6676 AC_SUBST(HAVE_GCC_FNO_DEFAULT_INLINE)
 6677 AC_SUBST(HAVE_GCC_FNO_ENFORCE_EH_SPECS)
 6678 
 6679 dnl ===================================================================
 6680 dnl Compiler plugins
 6681 dnl ===================================================================
 6682 
 6683 COMPILER_PLUGINS=
 6684 # currently only Clang
 6685 
 6686 if test "$COM_IS_CLANG" != "TRUE"; then
 6687     if test "$libo_fuzzed_enable_compiler_plugins" = yes -a "$enable_compiler_plugins" = yes; then
 6688         AC_MSG_NOTICE([Resetting --enable-compiler-plugins=no])
 6689         enable_compiler_plugins=no
 6690     fi
 6691 fi
 6692 
 6693 if test "$COM_IS_CLANG" = "TRUE"; then
 6694     if test -n "$enable_compiler_plugins"; then
 6695         compiler_plugins="$enable_compiler_plugins"
 6696     elif test -n "$ENABLE_DBGUTIL"; then
 6697         compiler_plugins=test
 6698     else
 6699         compiler_plugins=no
 6700     fi
 6701     if test "$compiler_plugins" != no -a "$CLANGVER" -lt 30800; then
 6702         if test "$compiler_plugins" = yes; then
 6703             AC_MSG_ERROR([Clang $CLANGVER is too old to build compiler plugins; need >= 3.8.0.])
 6704         else
 6705             compiler_plugins=no
 6706         fi
 6707     fi
 6708     if test "$compiler_plugins" != "no"; then
 6709         dnl The prefix where Clang resides, override to where Clang resides if
 6710         dnl using a source build:
 6711         if test -z "$CLANGDIR"; then
 6712             CLANGDIR=/usr
 6713         fi
 6714         AC_LANG_PUSH([C++])
 6715         save_CPPFLAGS=$CPPFLAGS
 6716         save_CXX=$CXX
 6717         # compiler plugins must be built with "native" compiler that was used to build Clang itself:
 6718         : "${COMPILER_PLUGINS_CXX=g++ -std=c++11}"
 6719         CXX=$COMPILER_PLUGINS_CXX
 6720         CPPFLAGS="$CPPFLAGS -I$CLANGDIR/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
 6721         AC_CHECK_HEADER(clang/AST/RecursiveASTVisitor.h,
 6722             [COMPILER_PLUGINS=TRUE],
 6723             [
 6724             if test "$compiler_plugins" = "yes"; then
 6725                 AC_MSG_ERROR([Cannot find Clang headers to build compiler plugins.])
 6726             else
 6727                 AC_MSG_WARN([Cannot find Clang headers to build compiler plugins, plugins disabled])
 6728                 add_warning "Cannot find Clang headers to build compiler plugins, plugins disabled."
 6729             fi
 6730             ])
 6731         CXX=$save_CXX
 6732         CPPFLAGS=$save_CPPFLAGS
 6733         AC_LANG_POP([C++])
 6734     fi
 6735 else
 6736     if test "$enable_compiler_plugins" = "yes"; then
 6737         AC_MSG_ERROR([Compiler plugins are currently supported only with the Clang compiler.])
 6738     fi
 6739 fi
 6740 AC_SUBST(COMPILER_PLUGINS)
 6741 AC_SUBST(COMPILER_PLUGINS_CXX)
 6742 AC_SUBST(COMPILER_PLUGINS_CXX_LINKFLAGS)
 6743 AC_SUBST(COMPILER_PLUGINS_DEBUG)
 6744 AC_SUBST(CLANGDIR)
 6745 AC_SUBST(CLANGLIBDIR)
 6746 
 6747 # Plugin to help linker.
 6748 # Add something like LD_PLUGIN=/usr/lib64/LLVMgold.so to your autogen.input.
 6749 # This makes --enable-lto build with clang work.
 6750 AC_SUBST(LD_PLUGIN)
 6751 
 6752 AC_CHECK_FUNCS(posix_fallocate, HAVE_POSIX_FALLOCATE=YES, [HAVE_POSIX_FALLOCATE=NO])
 6753 AC_SUBST(HAVE_POSIX_FALLOCATE)
 6754 
 6755 dnl ===================================================================
 6756 dnl Custom build version
 6757 dnl ===================================================================
 6758 
 6759 AC_MSG_CHECKING([whether to add custom build version])
 6760 if test "$with_build_version" != ""; then
 6761     BUILD_VER_STRING=$with_build_version
 6762     AC_MSG_RESULT([yes, $BUILD_VER_STRING])
 6763 else
 6764     BUILD_VER_STRING=
 6765     AC_MSG_RESULT([no])
 6766 fi
 6767 AC_SUBST(BUILD_VER_STRING)
 6768 
 6769 JITC_PROCESSOR_TYPE=""
 6770 if test "$_os" = "Linux" -a "$host_cpu" = "powerpc"; then
 6771     # IBMs JDK needs this...
 6772     JITC_PROCESSOR_TYPE=6
 6773     export JITC_PROCESSOR_TYPE
 6774 fi
 6775 AC_SUBST([JITC_PROCESSOR_TYPE])
 6776 
 6777 # Misc Windows Stuff
 6778 AC_ARG_WITH(ucrt-dir,
 6779     AS_HELP_STRING([--with-ucrt-dir],
 6780         [path to the directory with the arch-specific MSU packages of the Windows Universal CRT redistributables
 6781         (MS KB 2999226) for packaging into the installsets (without those the target system needs to install
 6782         the UCRT or Visual C++ Runtimes manually). The directory must contain the following 6 files:
 6783             Windows6.1-KB2999226-x64.msu
 6784             Windows6.1-KB2999226-x86.msu
 6785             Windows8.1-KB2999226-x64.msu
 6786             Windows8.1-KB2999226-x86.msu
 6787             Windows8-RT-KB2999226-x64.msu
 6788             Windows8-RT-KB2999226-x86.msu
 6789         A zip archive including those files is available from Microsoft site:
 6790         https://www.microsoft.com/en-us/download/details.aspx?id=48234]),
 6791 ,)
 6792 UCRT_REDISTDIR="$with_ucrt_dir"
 6793 if test $_os = "WINNT"; then
 6794     find_msvc_x64_dlls
 6795     find_msms
 6796     MSVC_DLL_PATH="$msvcdllpath"
 6797     MSVC_DLLS="$msvcdlls"
 6798     MSM_PATH="$msmdir"
 6799     # MSVC 15.3 changed it to VC141
 6800     if echo "$MSVC_DLL_PATH" | grep -q "VC141.CRT$"; then
 6801         SCPDEFS="$SCPDEFS -DWITH_VC141_REDIST"
 6802     else
 6803         SCPDEFS="$SCPDEFS -DWITH_VC${VCVER}_REDIST"
 6804     fi
 6805     if test "$UCRT_REDISTDIR" = "no"; then
 6806         dnl explicitly disabled
 6807         UCRT_REDISTDIR=""
 6808     else
 6809         if ! test -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x64.msu" -a \
 6810                   -f "$UCRT_REDISTDIR/Windows6.1-KB2999226-x86.msu" -a \
 6811                   -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x64.msu" -a \
 6812                   -f "$UCRT_REDISTDIR/Windows8.1-KB2999226-x86.msu" -a \
 6813                   -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x64.msu" -a \
 6814                   -f "$UCRT_REDISTDIR/Windows8-RT-KB2999226-x86.msu"; then
 6815             UCRT_REDISTDIR=""
 6816             if test -n "$PKGFORMAT"; then
 6817                for i in $PKGFORMAT; do
 6818                    case "$i" in
 6819                    msi)
 6820                        AC_MSG_WARN([--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency])
 6821                        add_warning "--without-ucrt-dir not specified or MSUs not found - installer will have runtime dependency"
 6822                        ;;
 6823                    esac
 6824                done
 6825             fi
 6826         fi
 6827     fi
 6828 fi
 6829 
 6830 AC_SUBST(UCRT_REDISTDIR)
 6831 AC_SUBST(MSVC_DLL_PATH)
 6832 AC_SUBST(MSVC_DLLS)
 6833 AC_SUBST(MSM_PATH)
 6834 
 6835 dnl ===================================================================
 6836 dnl Checks for Java
 6837 dnl ===================================================================
 6838 if test "$ENABLE_JAVA" != ""; then
 6839 
 6840     # Windows-specific tests
 6841     if test "$build_os" = "cygwin"; then
 6842         if test "$BITNESS_OVERRIDE" = 64; then
 6843             bitness=64
 6844         else
 6845             bitness=32
 6846         fi
 6847 
 6848         if test -z "$with_jdk_home"; then
 6849             dnl See <https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-EEED398E-AE37-4D12-
 6850             dnl AB10-49F82F720027> section "Windows Registry Key Changes":
 6851             reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion"
 6852             if test -n "$regvalue"; then
 6853                 ver=$regvalue
 6854                 reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/$ver/JavaHome"
 6855                 _jdk_home=$regvalue
 6856             fi
 6857             if test -z "$with_jdk_home"; then
 6858                 for ver in 1.8 1.7 1.6; do
 6859                     reg_get_value "$bitness" "HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Development Kit/$ver/JavaHome"
 6860                     if test -n "$regvalue"; then
 6861                         _jdk_home=$regvalue
 6862                         break
 6863                     fi
 6864                 done
 6865             fi
 6866             if test -f "$_jdk_home/lib/jvm.lib" -a -f "$_jdk_home/bin/java.exe"; then
 6867                 with_jdk_home="$_jdk_home"
 6868                 howfound="found automatically"
 6869             else
 6870                 AC_MSG_ERROR([No JDK found, pass the --with-jdk-home option pointing to a $bitness-bit JDK])
 6871             fi
 6872         else
 6873             test "$build_os" = "cygwin" && with_jdk_home=`win_short_path_for_make "$with_jdk_home"`
 6874             howfound="you passed"
 6875         fi
 6876     fi
 6877 
 6878     # MacOS X: /usr/libexec/java_home helps to set the current JDK_HOME. Actually JDK_HOME should NOT be set where java (/usr/bin/java) is located.
 6879     # /usr/bin/java -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, but /usr does not contain the JDK libraries
 6880     if test -z "$with_jdk_home" -a "$_os" = "Darwin" -a -x /usr/libexec/java_home; then
 6881         with_jdk_home=`/usr/libexec/java_home`
 6882     fi
 6883 
 6884     JAVA_HOME=; export JAVA_HOME
 6885     if test -z "$with_jdk_home"; then
 6886         AC_PATH_PROG(JAVAINTERPRETER, $with_java)
 6887     else
 6888         _java_path="$with_jdk_home/bin/$with_java"
 6889         dnl Check if there is a Java interpreter at all.
 6890         if test -x "$_java_path"; then
 6891             JAVAINTERPRETER=$_java_path
 6892         else
 6893             AC_MSG_ERROR([$_java_path not found, pass --with-jdk-home])
 6894         fi
 6895     fi
 6896 
 6897     dnl Check that the JDK found is correct architecture (at least 2 reasons to
 6898     dnl check: officebean needs to link -ljawt, and libjpipe.so needs to be
 6899     dnl loaded by java to run JunitTests:
 6900     if test "$build_os" = "cygwin"; then
 6901         shortjdkhome=`cygpath -d "$with_jdk_home"`
 6902         if test "$BITNESS_OVERRIDE" = 64 -a -f "$with_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
 6903             AC_MSG_WARN([You are building 64-bit binaries but the JDK $howfound is 32-bit])
 6904             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
 6905         elif test "$BITNESS_OVERRIDE" = "" -a -f "$_jdk_home/bin/java.exe" -a "`$shortjdkhome/bin/java.exe -version 2>&1 | $GREP -i 64-bit`" != ""  >/dev/null; then
 6906             AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
 6907             AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
 6908         fi
 6909 
 6910         if test x`echo "$JAVAINTERPRETER" | $GREP -i '\.exe$'` = x; then
 6911             JAVAINTERPRETER="${JAVAINTERPRETER}.exe"
 6912         fi
 6913         JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"`
 6914     elif test "$cross_compiling" != "yes"; then
 6915         case $CPUNAME in
 6916             AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64)
 6917                 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then
 6918                     AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit])
 6919                     AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK])
 6920                 fi
 6921                 ;;
 6922             *) # assumption: everything else 32-bit
 6923                 if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" != ""  >/dev/null; then
 6924                     AC_MSG_WARN([You are building 32-bit binaries but the JDK $howfound is 64-bit])
 6925                     AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a (32-bit) JDK])
 6926                 fi
 6927                 ;;
 6928         esac
 6929     fi
 6930 fi
 6931 
 6932 HAVE_JAVA9=
 6933 dnl ===================================================================
 6934 dnl Checks for JDK.
 6935 dnl ===================================================================
 6936 
 6937 # Note that JAVA_HOME as for now always means the *build* platform's
 6938 # JAVA_HOME. Whether all the complexity here actually is needed any
 6939 # more or not, no idea.
 6940 
 6941 if test "$ENABLE_JAVA" != ""; then
 6942     _gij_longver=0
 6943     AC_MSG_CHECKING([the installed JDK])
 6944     if test -n "$JAVAINTERPRETER"; then
 6945         dnl java -version sends output to stderr!
 6946         if test `$JAVAINTERPRETER -version 2>&1 | $GREP -c "Kaffe"` -gt 0; then
 6947             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
 6948         elif test `$JAVAINTERPRETER --version 2>&1 | $GREP -c "GNU libgcj"` -gt 0; then
 6949             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
 6950         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then
 6951             AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac])
 6952         elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then
 6953             JDK=ibm
 6954 
 6955             dnl IBM JDK specific tests
 6956             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//`
 6957             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
 6958 
 6959             if test "$_jdk_ver" -lt 10600; then
 6960                 AC_MSG_ERROR([IBM JDK is too old, you need at least 1.6])
 6961             fi
 6962 
 6963             AC_MSG_RESULT([checked (IBM JDK $_jdk)])
 6964 
 6965             if test "$with_jdk_home" = ""; then
 6966                 AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK,
 6967 you must use the "--with-jdk-home" configure option explicitly])
 6968             fi
 6969 
 6970             JAVA_HOME=$with_jdk_home
 6971         else
 6972             JDK=sun
 6973 
 6974             dnl Sun JDK specific tests
 6975             _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//`
 6976             _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'`
 6977 
 6978             if test "$_jdk_ver" -lt 10600; then
 6979                 AC_MSG_ERROR([JDK is too old, you need at least 1.6])
 6980             fi
 6981             if test "$_jdk_ver" -gt 10600; then
 6982                 JAVA_CLASSPATH_NOT_SET=TRUE
 6983             fi
 6984             if test "$_jdk_ver" -ge 10900; then
 6985                 HAVE_JAVA9=TRUE
 6986             fi
 6987 
 6988             AC_MSG_RESULT([checked (JDK $_jdk)])
 6989             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"`
 6990             if test "$_os" = "WINNT"; then
 6991                 JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[[eE]][[xX]][[eE]]$,,"`
 6992             fi
 6993 
 6994             # set to limit VM usage for JunitTests
 6995             JAVAIFLAGS=-Xmx64M
 6996             # set to limit VM usage for javac
 6997             JAVAFLAGS=-J-Xmx128M
 6998         fi
 6999     else
 7000         AC_MSG_ERROR([Java not found. You need at least jdk-1.6])
 7001     fi
 7002 else
 7003     dnl Java disabled
 7004     JAVA_HOME=
 7005     export JAVA_HOME
 7006 fi
 7007 
 7008 dnl ===================================================================
 7009 dnl Set target Java bytecode version
 7010 dnl ===================================================================
 7011 if test "$ENABLE_JAVA" != ""; then
 7012     if test "$HAVE_JAVA9" = "TRUE"; then
 7013         _java_target_ver="1.6"
 7014     else
 7015         _java_target_ver="1.5"
 7016     fi
 7017     JAVA_SOURCE_VER="$_java_target_ver"
 7018     JAVA_TARGET_VER="$_java_target_ver"
 7019 fi
 7020 
 7021 dnl ===================================================================
 7022 dnl Checks for javac
 7023 dnl ===================================================================
 7024 if test "$ENABLE_JAVA" != ""; then
 7025     javacompiler="javac"
 7026     if test -z "$with_jdk_home"; then
 7027         AC_PATH_PROG(JAVACOMPILER, $javacompiler)
 7028     else
 7029         _javac_path="$with_jdk_home/bin/$javacompiler"
 7030         dnl Check if there is a Java compiler at all.
 7031         if test -x "$_javac_path"; then
 7032             JAVACOMPILER=$_javac_path
 7033         fi
 7034     fi
 7035     if test -z "$JAVACOMPILER"; then
 7036         AC_MSG_ERROR([$javacompiler not found set with_jdk_home])
 7037     fi
 7038     if test "$build_os" = "cygwin"; then
 7039         if test x`echo "$JAVACOMPILER" | $GREP -i '\.exe$'` = x; then
 7040             JAVACOMPILER="${JAVACOMPILER}.exe"
 7041         fi
 7042         JAVACOMPILER=`win_short_path_for_make "$JAVACOMPILER"`
 7043     fi
 7044 fi
 7045 
 7046 dnl ===================================================================
 7047 dnl Checks for javadoc
 7048 dnl ===================================================================
 7049 if test "$ENABLE_JAVA" != ""; then
 7050     if test -z "$with_jdk_home"; then
 7051         AC_PATH_PROG(JAVADOC, javadoc)
 7052     else
 7053         _javadoc_path="$with_jdk_home/bin/javadoc"
 7054         dnl Check if there is a javadoc at all.
 7055         if test -x "$_javadoc_path"; then
 7056             JAVADOC=$_javadoc_path
 7057         else
 7058             AC_PATH_PROG(JAVADOC, javadoc)
 7059         fi
 7060     fi
 7061     if test -z "$JAVADOC"; then
 7062         AC_MSG_ERROR([$_javadoc_path not found set with_jdk_home])
 7063     fi
 7064     if test "$build_os" = "cygwin"; then
 7065         if test x`echo "$JAVADOC" | $GREP -i '\.exe$'` = x; then
 7066             JAVADOC="${JAVADOC}.exe"
 7067         fi
 7068         JAVADOC=`win_short_path_for_make "$JAVADOC"`
 7069     fi
 7070 
 7071     if test `$JAVADOC --version 2>&1 | $GREP -c "gjdoc"` -gt 0; then
 7072     JAVADOCISGJDOC="yes"
 7073     fi
 7074 fi
 7075 AC_SUBST(JAVADOCISGJDOC)
 7076 
 7077 if test "$ENABLE_JAVA" != ""; then
 7078     # check if JAVA_HOME was (maybe incorrectly?) set automatically to /usr
 7079     if test "$JAVA_HOME" = "/usr" -a "x$with_jdk_home" = "x"; then
 7080         if basename $(readlink $(readlink $JAVACOMPILER)) >/dev/null 2>/dev/null; then
 7081            # try to recover first by looking whether we have a alternatives
 7082            # system as in Debian or newer SuSEs where following /usr/bin/javac
 7083            # over /etc/alternatives/javac leads to the right bindir where we
 7084            # just need to strip a bit away to get a valid JAVA_HOME
 7085            JAVA_HOME=$(readlink $(readlink $JAVACOMPILER))
 7086         elif readlink $JAVACOMPILER >/dev/null 2>/dev/null; then
 7087             # maybe only one level of symlink (e.g. on Mac)
 7088             JAVA_HOME=$(readlink $JAVACOMPILER)
 7089             if test "$(dirname $JAVA_HOME)" = "."; then
 7090                 # we've got no path to trim back
 7091                 JAVA_HOME=""
 7092             fi
 7093         else
 7094             # else warn
 7095             AC_MSG_WARN([JAVA_HOME is set to /usr - this is very likely to be incorrect])
 7096             AC_MSG_WARN([if this is the case, please inform the correct JAVA_HOME with --with-jdk-home])
 7097             add_warning "JAVA_HOME is set to /usr - this is very likely to be incorrect"
 7098             add_warning "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home"
 7099         fi
 7100         dnl now that we probably have the path to the real javac, make a JAVA_HOME out of it..
 7101         if test "$JAVA_HOME" != "/usr"; then
 7102             if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
 7103                 dnl Leopard returns a non-suitable path with readlink - points to "Current" only
 7104                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/Current/Commands/javac$,/CurrentJDK/Home,)
 7105                 dnl Tiger already returns a JDK path..
 7106                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/CurrentJDK/Commands/javac$,/CurrentJDK/Home,)
 7107             else
 7108                 JAVA_HOME=$(echo $JAVA_HOME | $SED -e s,/bin/javac$,,)
 7109                 dnl check that we have a directory as certain distros eg gentoo substitute javac for a script
 7110                 dnl that checks which version to run
 7111                 if test -f "$JAVA_HOME"; then
 7112                     JAVA_HOME=""; # set JAVA_HOME to null if it's a file
 7113                 fi
 7114             fi
 7115         fi
 7116     fi
 7117     # as we drop out of this, JAVA_HOME may have been set to the empty string by readlink
 7118 
 7119     dnl now if JAVA_HOME has been set to empty, then call findhome to find it
 7120     if test -z "$JAVA_HOME"; then
 7121         if test "x$with_jdk_home" = "x"; then
 7122             cat > findhome.java <<_ACEOF
 7123 [import java.io.File;
 7124 
 7125 class findhome
 7126 {
 7127     public static void main(String args[])
 7128     {
 7129         String jrelocation = System.getProperty("java.home");
 7130         File jre = new File(jrelocation);
 7131         System.out.println(jre.getParent());
 7132     }
 7133 }]
 7134 _ACEOF
 7135             AC_MSG_CHECKING([if javac works])
 7136             javac_cmd="$JAVACOMPILER findhome.java 1>&2"
 7137             AC_TRY_EVAL(javac_cmd)
 7138             if test $? = 0 -a -f ./findhome.class; then
 7139                 AC_MSG_RESULT([javac works])
 7140             else
 7141                 echo "configure: javac test failed" >&5
 7142                 cat findhome.java >&5
 7143                 AC_MSG_ERROR([javac does not work - java projects will not build!])
 7144             fi
 7145             AC_MSG_CHECKING([if gij knows its java.home])
 7146             JAVA_HOME=`$JAVAINTERPRETER findhome`
 7147             if test $? = 0 -a "$JAVA_HOME" != ""; then
 7148                 AC_MSG_RESULT([$JAVA_HOME])
 7149             else
 7150                 echo "configure: java test failed" >&5
 7151                 cat findhome.java >&5
 7152                 AC_MSG_ERROR([gij does not know its java.home - use --with-jdk-home])
 7153             fi
 7154             # clean-up after ourselves
 7155             rm -f ./findhome.java ./findhome.class
 7156         else
 7157             JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$with_java,,p"`
 7158         fi
 7159     fi
 7160 
 7161     # now check if $JAVA_HOME is really valid
 7162     if test "$_os" = "Darwin" -o "$OS_FOR_BUILD" = MACOSX; then
 7163         case "${JAVA_HOME}" in
 7164             /Library/Java/JavaVirtualMachines/*)
 7165                 ;;
 7166             *)
 7167                 AC_MSG_ERROR([JDK in $JAVA_HOME cannot be used in CppUnit tests - install Oracle JDK])
 7168                 ;;
 7169         esac
 7170         if test ! -f "$JAVA_HOME/lib/jvm.cfg" -a "x$with_jdk_home" = "x"; then
 7171             JAVA_HOME_OK="NO"
 7172         fi
 7173     elif test ! -d "$JAVA_HOME/jre" -a "x$with_jdk_home" = "x"; then
 7174         JAVA_HOME_OK="NO"
 7175     fi
 7176     if test "$JAVA_HOME_OK" = "NO"; then
 7177         AC_MSG_WARN([JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script])
 7178         AC_MSG_WARN([attempted to find JAVA_HOME automatically, but apparently it failed])
 7179         AC_MSG_WARN([in case JAVA_HOME is incorrectly set, some projects will not be built correctly])
 7180         add_warning "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script"
 7181         add_warning "attempted to find JAVA_HOME automatically, but apparently it failed"
 7182         add_warning "in case JAVA_HOME is incorrectly set, some projects will not be built correctly"
 7183     fi
 7184     PathFormat "$JAVA_HOME"
 7185     JAVA_HOME="$formatted_path"
 7186 fi
 7187 
 7188 if test -z "$JAWTLIB" -a -n "$ENABLE_JAVA" -a "$_os" != Android -a \
 7189     "$_os" != Darwin
 7190 then
 7191     AC_MSG_CHECKING([for JAWT lib])
 7192     if test "$_os" = WINNT; then
 7193         # The path to $JAVA_HOME/lib/$JAWTLIB is part of $ILIB:
 7194         JAWTLIB=jawt.lib
 7195     else
 7196         case "$host_cpu" in
 7197         arm*)
 7198             AS_IF([test -e "$JAVA_HOME/jre/lib/aarch32/libjawt.so"], [my_java_arch=aarch32], [my_java_arch=arm])
 7199             JAVA_ARCH=$my_java_arch
 7200             ;;
 7201         i*86)
 7202             my_java_arch=i386
 7203             ;;
 7204         m68k)
 7205             my_java_arch=m68k
 7206             ;;
 7207         powerpc)
 7208             my_java_arch=ppc
 7209             ;;
 7210         powerpc64)
 7211             my_java_arch=ppc64
 7212             ;;
 7213         powerpc64le)
 7214             AS_IF([test -e "$JAVA_HOME/jre/lib/ppc64le/libjawt.so"], [my_java_arch=ppc64le], [my_java_arch=ppc64])
 7215             JAVA_ARCH=$my_java_arch
 7216             ;;
 7217         sparc64)
 7218             my_java_arch=sparcv9
 7219             ;;
 7220         x86_64)
 7221             my_java_arch=amd64
 7222             ;;
 7223         *)
 7224             my_java_arch=$host_cpu
 7225             ;;
 7226         esac
 7227         # This is where JDK9 puts the library
 7228         if test -e "$JAVA_HOME/lib/libjawt.so"; then
 7229             JAWTLIB="-L$JAVA_HOME/lib/ -ljawt"
 7230         else
 7231             JAWTLIB="-L$JAVA_HOME/jre/lib/$my_java_arch -ljawt"
 7232         fi
 7233         AS_IF([test "$JAVA_ARCH" != ""], [AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$JAVA_ARCH"])])
 7234     fi
 7235     AC_MSG_RESULT([$JAWTLIB])
 7236 fi
 7237 AC_SUBST(JAWTLIB)
 7238 
 7239 if test -n "$ENABLE_JAVA" -a -z "$JAVAINC"; then
 7240     case "$host_os" in
 7241 
 7242     aix*)
 7243         JAVAINC="-I$JAVA_HOME/include"
 7244         JAVAINC="$JAVAINC -I$JAVA_HOME/include/aix"
 7245         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7246         ;;
 7247 
 7248     cygwin*)
 7249         JAVAINC="-I$JAVA_HOME/include/win32"
 7250         JAVAINC="$JAVAINC -I$JAVA_HOME/include"
 7251         ;;
 7252 
 7253     darwin*)
 7254         if test -d "$JAVA_HOME/include/darwin"; then
 7255             JAVAINC="-I$JAVA_HOME/include  -I$JAVA_HOME/include/darwin"
 7256         else
 7257             JAVAINC=${ISYSTEM}$FRAMEWORKSHOME/JavaVM.framework/Versions/Current/Headers
 7258         fi
 7259         ;;
 7260 
 7261     dragonfly*)
 7262         JAVAINC="-I$JAVA_HOME/include"
 7263         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7264         ;;
 7265 
 7266     freebsd*)
 7267         JAVAINC="-I$JAVA_HOME/include"
 7268         JAVAINC="$JAVAINC -I$JAVA_HOME/include/freebsd"
 7269         JAVAINC="$JAVAINC -I$JAVA_HOME/include/bsd"
 7270         JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
 7271         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7272         ;;
 7273 
 7274     k*bsd*-gnu*)
 7275         JAVAINC="-I$JAVA_HOME/include"
 7276         JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
 7277         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7278         ;;
 7279 
 7280     linux-gnu*)
 7281         JAVAINC="-I$JAVA_HOME/include"
 7282         JAVAINC="$JAVAINC -I$JAVA_HOME/include/linux"
 7283         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7284         ;;
 7285 
 7286     *netbsd*)
 7287         JAVAINC="-I$JAVA_HOME/include"
 7288         JAVAINC="$JAVAINC -I$JAVA_HOME/include/netbsd"
 7289         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7290        ;;
 7291 
 7292     openbsd*)
 7293         JAVAINC="-I$JAVA_HOME/include"
 7294         JAVAINC="$JAVAINC -I$JAVA_HOME/include/openbsd"
 7295         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7296         ;;
 7297 
 7298     solaris*)
 7299         JAVAINC="-I$JAVA_HOME/include"
 7300         JAVAINC="$JAVAINC -I$JAVA_HOME/include/solaris"
 7301         test -d "$JAVA_HOME/include/native_thread" && JAVAINC="$JAVAINC -I$JAVA_HOME/include/native_thread"
 7302         ;;
 7303     esac
 7304 fi
 7305 SOLARINC="$SOLARINC $JAVAINC"
 7306 
 7307 if test "$ENABLE_JAVA" != "" -a "x" != "x$JAVACOMPILER"; then
 7308     url_check_unknown=0
 7309     java_base="testurlcheck"
 7310     java_src="${java_base}.java"
 7311     java_cls="${java_base}.class"
 7312     cat > "${java_src}" <<_ACEOF
 7313 [import jdk.internal.loader.URLClassPath;
 7314 import java.lang.reflect.Field;
 7315 import java.net.URL;
 7316 
 7317 class ${java_base}
 7318 {
 7319     public static void main(String args[])
 7320     {
 7321         try {
 7322             URLClassPath cp = new URLClassPath(new URL[0], null);
 7323             Field field = cp.getClass().getDeclaredField("DISABLE_CP_URL_CHECK");
 7324             field.setAccessible(true);
 7325             System.out.println(field.get(cp).toString());
 7326         } catch(Exception e) {
 7327             System.out.println("unknown");
 7328         }
 7329     }
 7330 }]
 7331 _ACEOF
 7332     AC_MSG_CHECKING([if jdk.net.URLClassPath.ClassPathURLCheck is disabled])
 7333     java_cmd="$JAVACOMPILER --add-exports java.base/jdk.internal.loader=ALL-UNNAMED ${java_src} 1>&2"
 7334     AC_TRY_EVAL(java_cmd)
 7335     if test $? = 0 -a -f "./${java_cls}"; then
 7336         java_res=`$JAVAINTERPRETER --add-opens java.base/jdk.internal.loader=ALL-UNNAMED ${java_base} 2>/dev/null`
 7337         if test $? = 0; then
 7338             case "${java_res}" in
 7339             true) AC_MSG_RESULT([yes]) ;;
 7340             false)
 7341                 rm -f "./${java_src}" "./${java_cls}"
 7342                 AC_MSG_ERROR([no - Java unit tests will break!])
 7343                 ;;
 7344             *) url_check_unknown=1 ;;
 7345             esac
 7346         else
 7347             url_check_unknown=1
 7348         fi
 7349     else
 7350         url_check_unknown=1
 7351     fi
 7352     if test $url_check_unknown -eq 1; then
 7353         AC_MSG_RESULT([unknown - assuming yes])
 7354         add_warning "Unable to find the default value for jdk.net.URLClassPath.ClassPathURLCheck - java tests might fail!"
 7355     fi
 7356     rm -f "./${java_src}" "./${java_cls}"
 7357 fi
 7358 
 7359 AC_SUBST(JAVACOMPILER)
 7360 AC_SUBST(JAVADOC)
 7361 AC_SUBST(JAVAINTERPRETER)
 7362 AC_SUBST(JAVAIFLAGS)
 7363 AC_SUBST(JAVAFLAGS)
 7364 AC_SUBST(JAVA_CLASSPATH_NOT_SET)
 7365 AC_SUBST(JAVA_HOME)
 7366 AC_SUBST(JAVA_SOURCE_VER)
 7367 AC_SUBST(JAVA_TARGET_VER)
 7368 AC_SUBST(JDK)
 7369 
 7370 
 7371 dnl ===================================================================
 7372 dnl Export file validation
 7373 dnl ===================================================================
 7374 AC_MSG_CHECKING([whether to enable export file validation])
 7375 if test "$with_export_validation" != "no"; then
 7376     if test -z "$ENABLE_JAVA"; then
 7377         if test "$with_export_validation" = "yes"; then
 7378             AC_MSG_ERROR([requested, but Java is disabled])
 7379         else
 7380             AC_MSG_RESULT([no, as Java is disabled])
 7381         fi
 7382     elif test "$_jdk_ver" -lt 10800; then
 7383         if test "$with_export_validation" = "yes"; then
 7384             AC_MSG_ERROR([requested, but Java is too old, need Java 8])
 7385         else
 7386             AC_MSG_RESULT([no, as Java is too old, need Java 8])
 7387         fi
 7388     else
 7389         AC_MSG_RESULT([yes])
 7390         AC_DEFINE(HAVE_EXPORT_VALIDATION)
 7391 
 7392         AC_PATH_PROGS(ODFVALIDATOR, odfvalidator)
 7393         if test -z "$ODFVALIDATOR"; then
 7394             # remember to download the ODF toolkit with validator later
 7395             AC_MSG_NOTICE([no odfvalidator found, will download it])
 7396             BUILD_TYPE="$BUILD_TYPE ODFVALIDATOR"
 7397             ODFVALIDATOR="$BUILDDIR/bin/odfvalidator.sh"
 7398 
 7399             # and fetch name of odfvalidator jar name from download.lst
 7400             ODFVALIDATOR_JAR=`$SED -n -e "s/export *ODFVALIDATOR_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
 7401             AC_SUBST(ODFVALIDATOR_JAR)
 7402 
 7403             if test -z "$ODFVALIDATOR_JAR"; then
 7404                 AC_MSG_ERROR([cannot determine odfvalidator jar location (--with-export-validation)])
 7405             fi
 7406         fi
 7407         if test "$build_os" = "cygwin"; then
 7408             # In case of Cygwin it will be executed from Windows,
 7409             # so we need to run bash and absolute path to validator
 7410             # so instead of "odfvalidator" it will be
 7411             # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
 7412             ODFVALIDATOR="bash.exe `cygpath -m "$ODFVALIDATOR"`"
 7413         else
 7414             ODFVALIDATOR="sh $ODFVALIDATOR"
 7415         fi
 7416         AC_SUBST(ODFVALIDATOR)
 7417 
 7418 
 7419         AC_PATH_PROGS(OFFICEOTRON, officeotron)
 7420         if test -z "$OFFICEOTRON"; then
 7421             # remember to download the officeotron with validator later
 7422             AC_MSG_NOTICE([no officeotron found, will download it])
 7423             BUILD_TYPE="$BUILD_TYPE OFFICEOTRON"
 7424             OFFICEOTRON="$BUILDDIR/bin/officeotron.sh"
 7425 
 7426             # and fetch name of officeotron jar name from download.lst
 7427             OFFICEOTRON_JAR=`$SED -n -e "s/export *OFFICEOTRON_JAR *:= *\(.*\) */\1/p" $SRC_ROOT/download.lst`
 7428             AC_SUBST(OFFICEOTRON_JAR)
 7429 
 7430             if test -z "$OFFICEOTRON_JAR"; then
 7431                 AC_MSG_ERROR([cannot determine officeotron jar location (--with-export-validation)])
 7432             fi
 7433         else
 7434             # check version of existing officeotron
 7435             OFFICEOTRON_VER=`$OFFICEOTRON --version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
 7436             if test 0"$OFFICEOTRON_VER" -lt 704; then
 7437                 AC_MSG_ERROR([officeotron too old])
 7438             fi
 7439         fi
 7440         if test "$build_os" = "cygwin"; then
 7441             # In case of Cygwin it will be executed from Windows,
 7442             # so we need to run bash and absolute path to validator
 7443             # so instead of "odfvalidator" it will be
 7444             # something like "bash.exe C:\cygwin\opt\lo\bin\odfvalidator"
 7445             OFFICEOTRON="bash.exe `cygpath -m "$OFFICEOTRON"`"
 7446         else
 7447             OFFICEOTRON="sh $OFFICEOTRON"
 7448         fi
 7449     fi
 7450     AC_SUBST(OFFICEOTRON)
 7451 else
 7452     AC_MSG_RESULT([no])
 7453 fi
 7454 
 7455 AC_MSG_CHECKING([for Microsoft Binary File Format Validator])
 7456 if test "$with_bffvalidator" != "no"; then
 7457     AC_DEFINE(HAVE_BFFVALIDATOR)
 7458 
 7459     if test "$with_export_validation" = "no"; then
 7460         AC_MSG_ERROR([Please enable export validation (-with-export-validation)!])
 7461     fi
 7462 
 7463     if test "$with_bffvalidator" = "yes"; then
 7464         BFFVALIDATOR=`win_short_path_for_make "$PROGRAMFILES/Microsoft Office/BFFValidator/BFFValidator.exe"`
 7465     else
 7466         BFFVALIDATOR="$with_bffvalidator"
 7467     fi
 7468 
 7469     if test "$build_os" = "cygwin"; then
 7470         if test -n "$BFFVALIDATOR" -a -e "`cygpath $BFFVALIDATOR`"; then
 7471             AC_MSG_RESULT($BFFVALIDATOR)
 7472         else
 7473             AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
 7474         fi
 7475     elif test -n "$BFFVALIDATOR"; then
 7476         # We are not in Cygwin but need to run Windows binary with wine
 7477         AC_PATH_PROGS(WINE, wine)
 7478 
 7479         # so swap in a shell wrapper that converts paths transparently
 7480         BFFVALIDATOR_EXE="$BFFVALIDATOR"
 7481         BFFVALIDATOR="sh $BUILDDIR/bin/bffvalidator.sh"
 7482         AC_SUBST(BFFVALIDATOR_EXE)
 7483         AC_MSG_RESULT($BFFVALIDATOR)
 7484     else
 7485         AC_MSG_ERROR([bffvalidator not found, but required by --with-bffvalidator])
 7486     fi
 7487     AC_SUBST(BFFVALIDATOR)
 7488 else
 7489     AC_MSG_RESULT([no])
 7490 fi
 7491 
 7492 dnl ===================================================================
 7493 dnl Check for C preprocessor to use
 7494 dnl ===================================================================
 7495 AC_MSG_CHECKING([which C preprocessor to use in idlc])
 7496 if test -n "$with_idlc_cpp"; then
 7497     AC_MSG_RESULT([$with_idlc_cpp])
 7498     AC_PATH_PROG(SYSTEM_UCPP, $with_idlc_cpp)
 7499 else
 7500     AC_MSG_RESULT([ucpp])
 7501     AC_MSG_CHECKING([which ucpp tp use])
 7502     if test -n "$with_system_ucpp" -a "$with_system_ucpp" != "no"; then
 7503         AC_MSG_RESULT([external])
 7504         AC_PATH_PROG(SYSTEM_UCPP, ucpp)
 7505     else
 7506         AC_MSG_RESULT([internal])
 7507         BUILD_TYPE="$BUILD_TYPE UCPP"
 7508     fi
 7509 fi
 7510 AC_SUBST(SYSTEM_UCPP)
 7511 
 7512 dnl ===================================================================
 7513 dnl Check for epm (not needed for Windows)
 7514 dnl ===================================================================
 7515 AC_MSG_CHECKING([whether to enable EPM for packing])
 7516 if test "$enable_epm" = "yes"; then
 7517     AC_MSG_RESULT([yes])
 7518     if test "$_os" != "WINNT"; then
 7519         if test $_os = Darwin; then
 7520             EPM=internal
 7521         elif test -n "$with_epm"; then
 7522             EPM=$with_epm
 7523         else
 7524             AC_PATH_PROG(EPM, epm, no)
 7525         fi
 7526         if test "$EPM" = "no" -o "$EPM" = "internal"; then
 7527             AC_MSG_NOTICE([EPM will be built.])
 7528             BUILD_TYPE="$BUILD_TYPE EPM"
 7529             EPM=${WORKDIR}/UnpackedTarball/epm/epm
 7530         else
 7531             # Gentoo has some epm which is something different...
 7532             AC_MSG_CHECKING([whether the found epm is the right epm])
 7533             if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then
 7534                 AC_MSG_RESULT([yes])
 7535             else
 7536                 AC_MSG_ERROR([no. Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
 7537             fi
 7538             AC_MSG_CHECKING([epm version])
 7539             EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//`
 7540             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \
 7541                test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then
 7542                 AC_MSG_RESULT([OK, >= 3.7])
 7543             else
 7544                 AC_MSG_RESULT([too old. epm >= 3.7 is required.])
 7545                 AC_MSG_ERROR([Install ESP Package Manager (http://www.msweet.org/projects.php?Z2) and/or specify the path to the right epm])
 7546             fi
 7547         fi
 7548     fi
 7549 
 7550     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then
 7551         AC_MSG_CHECKING([for rpm])
 7552         for a in "$RPM" rpmbuild rpm; do
 7553             $a --usage >/dev/null 2> /dev/null
 7554             if test $? -eq 0; then
 7555                 RPM=$a
 7556                 break
 7557             else
 7558                 $a --version >/dev/null 2> /dev/null
 7559                 if test $? -eq 0; then
 7560                     RPM=$a
 7561                     break
 7562                 fi
 7563             fi
 7564         done
 7565         if test -z "$RPM"; then
 7566             AC_MSG_ERROR([not found])
 7567         elif "$RPM" --help 2>&1 | $EGREP buildroot >/dev/null; then
 7568             RPM_PATH=`which $RPM`
 7569             AC_MSG_RESULT([$RPM_PATH])
 7570             SCPDEFS="$SCPDEFS -DWITH_RPM"
 7571         else
 7572             AC_MSG_ERROR([cannot build packages. Try installing rpmbuild.])
 7573         fi
 7574     fi
 7575     if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then
 7576         AC_PATH_PROG(DPKG, dpkg, no)
 7577         if test "$DPKG" = "no"; then
 7578             AC_MSG_ERROR([dpkg needed for deb creation. Install dpkg.])
 7579         fi
 7580     fi
 7581     if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \
 7582        echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
 7583         if test "$with_epm" = "no" -a "$_os" != "Darwin"; then
 7584             if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then
 7585                 AC_MSG_CHECKING([whether epm is patched for LibreOffice's needs])
 7586                 if grep "Patched for LibreOffice" $EPM >/dev/null 2>/dev/null; then
 7587                     AC_MSG_RESULT([yes])
 7588                 else
 7589                     AC_MSG_RESULT([no])
 7590                     if echo "$PKGFORMAT" | $GREP -q rpm; then
 7591                         _pt="rpm"
 7592                         AC_MSG_WARN([the rpms will need to be installed with --nodeps])
 7593                         add_warning "the rpms will need to be installed with --nodeps"
 7594                     else
 7595                         _pt="pkg"
 7596                     fi
 7597                     AC_MSG_WARN([the ${_pt}s will not be relocatable])
 7598                     add_warning "the ${_pt}s will not be relocatable"
 7599                     AC_MSG_WARN([if you want to make sure installation without --nodeps and
 7600                                  relocation will work, you need to patch your epm with the
 7601                                  patch in epm/epm-3.7.patch or build with
 7602                                  --with-epm=internal which will build a suitable epm])
 7603                 fi
 7604             fi
 7605         fi
 7606     fi
 7607     if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then
 7608         AC_PATH_PROG(PKGMK, pkgmk, no)
 7609         if test "$PKGMK" = "no"; then
 7610             AC_MSG_ERROR([pkgmk needed for Solaris pkg creation. Install it.])
 7611         fi
 7612     fi
 7613     AC_SUBST(RPM)
 7614     AC_SUBST(DPKG)
 7615     AC_SUBST(PKGMK)
 7616 else
 7617     for i in $PKGFORMAT; do
 7618         case "$i" in
 7619         aix | bsd | deb | pkg | rpm | native | portable)
 7620             AC_MSG_ERROR(
 7621                 [--with-package-format='$PKGFORMAT' requires --enable-epm])
 7622             ;;
 7623         esac
 7624     done
 7625     AC_MSG_RESULT([no])
 7626     EPM=NO
 7627 fi
 7628 AC_SUBST(EPM)
 7629 
 7630 ENABLE_LWP=
 7631 if test "$enable_lotuswordpro" = "yes"; then
 7632     ENABLE_LWP="TRUE"
 7633 fi
 7634 AC_SUBST(ENABLE_LWP)
 7635 
 7636 dnl ===================================================================
 7637 dnl Check for building ODK
 7638 dnl ===================================================================
 7639 if test "$enable_odk" = no; then
 7640     unset DOXYGEN
 7641 else
 7642     if test "$with_doxygen" = no; then
 7643         AC_MSG_CHECKING([for doxygen])
 7644         unset DOXYGEN
 7645         AC_MSG_RESULT([no])
 7646     else
 7647         if test "$with_doxygen" = yes; then
 7648             AC_PATH_PROG([DOXYGEN], [doxygen])
 7649             if test -z "$DOXYGEN"; then
 7650                 AC_MSG_ERROR([doxygen not found in \$PATH; specify its pathname via --with-doxygen=..., or disable its use via --without-doxygen])
 7651             fi
 7652             if $DOXYGEN -g - | grep -q "HAVE_DOT *= *YES"; then
 7653                 if ! dot -V 2>/dev/null; then
 7654                     AC_MSG_ERROR([dot not found in \$PATH but doxygen defaults to HAVE_DOT=YES; install graphviz or disable its use via --without-doxygen])
 7655                 fi
 7656             fi
 7657         else
 7658             AC_MSG_CHECKING([for doxygen])
 7659             DOXYGEN=$with_doxygen
 7660             AC_MSG_RESULT([$DOXYGEN])
 7661         fi
 7662         if test -n "$DOXYGEN"; then
 7663             DOXYGEN_VERSION=`$DOXYGEN --version 2>/dev/null`
 7664             DOXYGEN_NUMVERSION=`echo $DOXYGEN_VERSION | $AWK -F. '{ print \$1*10000 + \$2*100 + \$3 }'`
 7665             if ! test "$DOXYGEN_NUMVERSION" -ge "10804" ; then
 7666                 AC_MSG_ERROR([found doxygen is too old; need at least version 1.8.4 or specify --without-doxygen])
 7667             fi
 7668         fi
 7669     fi
 7670 fi
 7671 AC_SUBST([DOXYGEN])
 7672 
 7673 AC_MSG_CHECKING([whether to build the ODK])
 7674 if test "$enable_odk" = "" -o "$enable_odk" != "no"; then
 7675     AC_MSG_RESULT([yes])
 7676 
 7677     if test "$with_java" != "no"; then
 7678         AC_MSG_CHECKING([whether to build unowinreg.dll])
 7679         if test "$_os" = "WINNT" -a "$enable_build_unowinreg" = ""; then
 7680             # build on Win by default
 7681             enable_build_unowinreg=yes
 7682         fi
 7683         if test "$enable_build_unowinreg" = "" -o "$enable_build_unowinreg" = "no"; then
 7684             AC_MSG_RESULT([no])
 7685             BUILD_UNOWINREG=
 7686         else
 7687             AC_MSG_RESULT([yes])
 7688             BUILD_UNOWINREG=TRUE
 7689         fi
 7690         if test "$_os" != "WINNT" -a "$BUILD_UNOWINREG" = "TRUE"; then
 7691             if test -z "$with_mingw_cross_compiler"; then
 7692                 dnl Guess...
 7693                 AC_CHECK_PROGS(MINGWCXX,i386-mingw32msvc-g++ i586-pc-mingw32-g++ i686-pc-mingw32-g++ i686-w64-mingw32-g++,false)
 7694             elif test -x "$with_mingw_cross_compiler"; then
 7695                  MINGWCXX="$with_mingw_cross_compiler"
 7696             else
 7697                 AC_CHECK_TOOL(MINGWCXX, "$with_mingw_cross_compiler", false)
 7698             fi
 7699 
 7700             if test "$MINGWCXX" = "false"; then
 7701                 AC_MSG_ERROR([MinGW32 C++ cross-compiler not found.])
 7702             fi
 7703 
 7704             mingwstrip_test="`echo $MINGWCXX | $SED -e s/g++/strip/`"
 7705             if test -x "$mingwstrip_test"; then
 7706                 MINGWSTRIP="$mingwstrip_test"
 7707             else
 7708                 AC_CHECK_TOOL(MINGWSTRIP, "$mingwstrip_test", false)
 7709             fi
 7710 
 7711             if test "$MINGWSTRIP" = "false"; then
 7712                 AC_MSG_ERROR(MinGW32 binutils not found.)
 7713             fi
 7714         fi
 7715     fi
 7716     BUILD_TYPE="$BUILD_TYPE ODK"
 7717 else
 7718     AC_MSG_RESULT([no])
 7719     BUILD_UNOWINREG=
 7720 fi
 7721 AC_SUBST(BUILD_UNOWINREG)
 7722 AC_SUBST(MINGWCXX)
 7723 AC_SUBST(MINGWSTRIP)
 7724 
 7725 dnl ===================================================================
 7726 dnl Check for system zlib
 7727 dnl ===================================================================
 7728 if test "$with_system_zlib" = "auto"; then
 7729     case "$_os" in
 7730     WINNT)
 7731         with_system_zlib="$with_system_libs"
 7732         ;;
 7733     *)
 7734         if test "$enable_fuzzers" != "yes"; then
 7735             with_system_zlib=yes
 7736         else
 7737             with_system_zlib=no
 7738         fi
 7739         ;;
 7740     esac
 7741 fi
 7742 
 7743 dnl we want to use libo_CHECK_SYSTEM_MODULE here too, but OS X is too stupid
 7744 dnl and has no pkg-config for it at least on some tinderboxes,
 7745 dnl so leaving that out for now
 7746 dnl libo_CHECK_SYSTEM_MODULE([zlib],[ZLIB],[zlib])
 7747 AC_MSG_CHECKING([which zlib to use])
 7748 if test "$with_system_zlib" = "yes"; then
 7749     AC_MSG_RESULT([external])
 7750     SYSTEM_ZLIB=TRUE
 7751     AC_CHECK_HEADER(zlib.h, [],
 7752         [AC_MSG_ERROR(zlib.h not found. install zlib)], [])
 7753     AC_CHECK_LIB(z, deflate, [ ZLIB_LIBS=-lz ],
 7754         [AC_MSG_ERROR(zlib not found or functional)], [])
 7755 else
 7756     AC_MSG_RESULT([internal])
 7757     SYSTEM_ZLIB=
 7758     BUILD_TYPE="$BUILD_TYPE ZLIB"
 7759     ZLIB_CFLAGS="-I${WORKDIR}/UnpackedTarball/zlib"
 7760     ZLIB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lzlib"
 7761 fi
 7762 AC_SUBST(ZLIB_CFLAGS)
 7763 AC_SUBST(ZLIB_LIBS)
 7764 AC_SUBST(SYSTEM_ZLIB)
 7765 
 7766 dnl ===================================================================
 7767 dnl Check for system jpeg
 7768 dnl ===================================================================
 7769 AC_MSG_CHECKING([which libjpeg to use])
 7770 if test "$with_system_jpeg" = "yes"; then
 7771     AC_MSG_RESULT([external])
 7772     SYSTEM_LIBJPEG=TRUE
 7773     AC_CHECK_HEADER(jpeglib.h, [ LIBJPEG_CFLAGS= ],
 7774         [AC_MSG_ERROR(jpeg.h not found. install libjpeg)], [])
 7775     AC_CHECK_LIB(jpeg, jpeg_resync_to_restart, [ LIBJPEG_LIBS="-ljpeg" ],
 7776         [AC_MSG_ERROR(jpeg library not found or fuctional)], [])
 7777 else
 7778     SYSTEM_LIBJPEG=
 7779     AC_MSG_RESULT([internal, libjpeg-turbo])
 7780     BUILD_TYPE="$BUILD_TYPE LIBJPEG_TURBO"
 7781     LIBJPEG_CFLAGS="-I${WORKDIR}/UnpackedTarball/libjpeg-turbo"
 7782     if test "$COM" = "MSC"; then
 7783         LIBJPEG_LIBS="${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs/libjpeg.lib"
 7784     else
 7785         LIBJPEG_LIBS="-L${WORKDIR}/UnpackedTarball/libjpeg-turbo/.libs -ljpeg"
 7786     fi
 7787 
 7788     case "$host_cpu" in
 7789     x86_64 | amd64 | i*86 | x86 | ia32)
 7790         AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
 7791         if test -z "$NASM" -a "$build_os" = "cygwin"; then
 7792             if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/nasm"; then
 7793                 NASM="$LODE_HOME/opt/bin/nasm"
 7794             elif test -x "/opt/lo/bin/nasm"; then
 7795                 NASM="/opt/lo/bin/nasm"
 7796             fi
 7797         fi
 7798 
 7799         if test -n "$NASM"; then
 7800             AC_MSG_CHECKING([for object file format of host system])
 7801             case "$host_os" in
 7802               cygwin* | mingw* | pw32* | interix*)
 7803                 case "$host_cpu" in
 7804                   x86_64)
 7805                     objfmt='Win64-COFF'
 7806                     ;;
 7807                   *)
 7808                     objfmt='Win32-COFF'
 7809                     ;;
 7810                 esac
 7811               ;;
 7812               msdosdjgpp* | go32*)
 7813                 objfmt='COFF'
 7814               ;;
 7815               os2-emx*)			# not tested
 7816                 objfmt='MSOMF'		# obj
 7817               ;;
 7818               linux*coff* | linux*oldld*)
 7819                 objfmt='COFF'		# ???
 7820               ;;
 7821               linux*aout*)
 7822                 objfmt='a.out'
 7823               ;;
 7824               linux*)
 7825                 case "$host_cpu" in
 7826                   x86_64)
 7827                     objfmt='ELF64'
 7828                     ;;
 7829                   *)
 7830                     objfmt='ELF'
 7831                     ;;
 7832                 esac
 7833               ;;
 7834               kfreebsd* | freebsd* | netbsd* | openbsd*)
 7835                 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
 7836                   objfmt='BSD-a.out'
 7837                 else
 7838                   case "$host_cpu" in
 7839                     x86_64 | amd64)
 7840                       objfmt='ELF64'
 7841                       ;;
 7842                     *)
 7843                       objfmt='ELF'
 7844                       ;;
 7845                   esac
 7846                 fi
 7847               ;;
 7848               solaris* | sunos* | sysv* | sco*)
 7849                 case "$host_cpu" in
 7850                   x86_64)
 7851                     objfmt='ELF64'
 7852                     ;;
 7853                   *)
 7854                     objfmt='ELF'
 7855                     ;;
 7856                 esac
 7857               ;;
 7858               darwin* | rhapsody* | nextstep* | openstep* | macos*)
 7859                 case "$host_cpu" in
 7860                   x86_64)
 7861                     objfmt='Mach-O64'
 7862                     ;;
 7863                   *)
 7864                     objfmt='Mach-O'
 7865                     ;;
 7866                 esac
 7867               ;;
 7868               *)
 7869                 objfmt='ELF ?'
 7870               ;;
 7871             esac
 7872 
 7873             AC_MSG_RESULT([$objfmt])
 7874             if test "$objfmt" = 'ELF ?'; then
 7875               objfmt='ELF'
 7876               AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
 7877             fi
 7878 
 7879             AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
 7880             case "$objfmt" in
 7881               MSOMF)      NAFLAGS='-fobj -DOBJ32';;
 7882               Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
 7883               Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
 7884               COFF)       NAFLAGS='-fcoff -DCOFF';;
 7885               a.out)      NAFLAGS='-faout -DAOUT';;
 7886               BSD-a.out)  NAFLAGS='-faoutb -DAOUT';;
 7887               ELF)        NAFLAGS='-felf -DELF';;
 7888               ELF64)      NAFLAGS='-felf64 -DELF -D__x86_64__';;
 7889               RDF)        NAFLAGS='-frdf -DRDF';;
 7890               Mach-O)     NAFLAGS='-fmacho -DMACHO';;
 7891               Mach-O64)   NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
 7892             esac
 7893             AC_MSG_RESULT([$NAFLAGS])
 7894 
 7895             AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
 7896             cat > conftest.asm << EOF
 7897             [%line __oline__ "configure"
 7898                     section .text
 7899                     global  _main,main
 7900             _main:
 7901             main:   xor     eax,eax
 7902                     ret
 7903             ]
 7904 EOF
 7905             try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
 7906             if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
 7907               AC_MSG_RESULT(yes)
 7908             else
 7909               echo "configure: failed program was:" >&AC_FD_CC
 7910               cat conftest.asm >&AC_FD_CC
 7911               rm -rf conftest*
 7912               AC_MSG_RESULT(no)
 7913               AC_MSG_WARN([installation or configuration problem: assembler cannot create object files.])
 7914               NASM=""
 7915             fi
 7916 
 7917         fi
 7918 
 7919         if test -z "$NASM"; then
 7920 cat << _EOS
 7921 ****************************************************************************
 7922 You need yasm or nasm (Netwide Assembler) to build the internal jpeg library optimally.
 7923 To get one please:
 7924 
 7925 _EOS
 7926             if test "$build_os" = "cygwin"; then
 7927 cat << _EOS
 7928 install a pre-compiled binary for Win32
 7929 
 7930 mkdir -p /opt/lo/bin
 7931 cd /opt/lo/bin
 7932 wget https://dev-www.libreoffice.org/bin/cygwin/nasm.exe
 7933 chmod +x nasm
 7934 
 7935 or get and install one from http://www.nasm.us/
 7936 
 7937 Then re-run autogen.sh
 7938 
 7939 Note: autogen.sh will try to use /opt/lo/bin/nasm if the environment variable NASM is not already defined.
 7940 Alternatively, you can install the 'new' nasm where ever you want and make sure that \`which nasm\` finds it.
 7941 
 7942 _EOS
 7943             else
 7944 cat << _EOS
 7945 consult https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
 7946 
 7947 _EOS
 7948             fi
 7949             AC_MSG_WARN([no suitable nasm (Netwide Assembler) found])
 7950             add_warning "no suitable nasm (Netwide Assembler) found for internal libjpeg-turbo"
 7951         fi
 7952       ;;
 7953     esac
 7954 fi
 7955 
 7956 AC_SUBST(NASM)
 7957 AC_SUBST(LIBJPEG_CFLAGS)
 7958 AC_SUBST(LIBJPEG_LIBS)
 7959 AC_SUBST(SYSTEM_LIBJPEG)
 7960 
 7961 dnl ===================================================================
 7962 dnl Check for system clucene
 7963 dnl ===================================================================
 7964 dnl we should rather be using
 7965 dnl libo_CHECK_SYSTEM_MODULE([clucence],[CLUCENE],[liblucence-core]) here
 7966 dnl but the contribs-lib check seems tricky
 7967 AC_MSG_CHECKING([which clucene to use])
 7968 if test "$with_system_clucene" = "yes"; then
 7969     AC_MSG_RESULT([external])
 7970     SYSTEM_CLUCENE=TRUE
 7971     PKG_CHECK_MODULES(CLUCENE, libclucene-core)
 7972     CLUCENE_CFLAGS=[$(printf '%s' "$CLUCENE_CFLAGS" | sed -e 's@-I[^ ]*/CLucene/ext@@' -e "s/-I/${ISYSTEM?}/g")]
 7973     FilterLibs "${CLUCENE_LIBS}"
 7974     CLUCENE_LIBS="${filteredlibs}"
 7975     AC_LANG_PUSH([C++])
 7976     save_CXXFLAGS=$CXXFLAGS
 7977     save_CPPFLAGS=$CPPFLAGS
 7978     CXXFLAGS="$CXXFLAGS $CLUCENE_CFLAGS"
 7979     CPPFLAGS="$CPPFLAGS $CLUCENE_CFLAGS"
 7980     dnl http://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
 7981     dnl https://bugzilla.redhat.com/show_bug.cgi?id=794795
 7982     AC_CHECK_HEADER([CLucene/analysis/cjk/CJKAnalyzer.h], [],
 7983                  [AC_MSG_ERROR([Your version of libclucene has contribs-lib missing.])], [#include <CLucene.h>])
 7984     CXXFLAGS=$save_CXXFLAGS
 7985     CPPFLAGS=$save_CPPFLAGS
 7986     AC_LANG_POP([C++])
 7987 
 7988     CLUCENE_LIBS="$CLUCENE_LIBS -lclucene-contribs-lib"
 7989 else
 7990     AC_MSG_RESULT([internal])
 7991     SYSTEM_CLUCENE=
 7992     BUILD_TYPE="$BUILD_TYPE CLUCENE"
 7993 fi
 7994 AC_SUBST(SYSTEM_CLUCENE)
 7995 AC_SUBST(CLUCENE_CFLAGS)
 7996 AC_SUBST(CLUCENE_LIBS)
 7997 
 7998 dnl ===================================================================
 7999 dnl Check for system expat
 8000 dnl ===================================================================
 8001 libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
 8002 
 8003 dnl ===================================================================
 8004 dnl Check for system xmlsec
 8005 dnl ===================================================================
 8006 libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
 8007 
 8008 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
 8009 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
 8010     ENABLE_EOT="TRUE"
 8011     AC_DEFINE([ENABLE_EOT])
 8012     AC_MSG_RESULT([yes])
 8013 
 8014     libo_CHECK_SYSTEM_MODULE([libeot],[LIBEOT],[libeot >= 0.01])
 8015 else
 8016     ENABLE_EOT=
 8017     AC_MSG_RESULT([no])
 8018 fi
 8019 AC_SUBST([ENABLE_EOT])
 8020 
 8021 dnl ===================================================================
 8022 dnl Check for DLP libs
 8023 dnl ===================================================================
 8024 AS_IF([test "$COM" = "MSC"],
 8025       [librevenge_libdir="${WORKDIR}/LinkTarget/Library"],
 8026       [librevenge_libdir="${WORKDIR}/UnpackedTarball/librevenge/src/lib/.libs"]
 8027 )
 8028 libo_CHECK_SYSTEM_MODULE([librevenge],[REVENGE],[librevenge-0.0 >= 0.0.1],["-I${WORKDIR}/UnpackedTarball/librevenge/inc"],["-L${librevenge_libdir} -lrevenge-0.0"])
 8029 
 8030 libo_CHECK_SYSTEM_MODULE([libodfgen],[ODFGEN],[libodfgen-0.1])
 8031 
 8032 libo_CHECK_SYSTEM_MODULE([libepubgen],[EPUBGEN],[libepubgen-0.1])
 8033 
 8034 AS_IF([test "$COM" = "MSC"],
 8035       [libwpd_libdir="${WORKDIR}/LinkTarget/Library"],
 8036       [libwpd_libdir="${WORKDIR}/UnpackedTarball/libwpd/src/lib/.libs"]
 8037 )
 8038 libo_CHECK_SYSTEM_MODULE([libwpd],[WPD],[libwpd-0.10],["-I${WORKDIR}/UnpackedTarball/libwpd/inc"],["-L${libwpd_libdir} -lwpd-0.10"])
 8039 
 8040 libo_CHECK_SYSTEM_MODULE([libwpg],[WPG],[libwpg-0.3])
 8041 
 8042 libo_CHECK_SYSTEM_MODULE([libwps],[WPS],[libwps-0.4])
 8043 libo_PKG_VERSION([WPS], [libwps-0.4], [0.4.10])
 8044 
 8045 libo_CHECK_SYSTEM_MODULE([libvisio],[VISIO],[libvisio-0.1])
 8046 
 8047 libo_CHECK_SYSTEM_MODULE([libcdr],[CDR],[libcdr-0.1])
 8048 
 8049 libo_CHECK_SYSTEM_MODULE([libmspub],[MSPUB],[libmspub-0.1])
 8050 
 8051 libo_CHECK_SYSTEM_MODULE([libmwaw],[MWAW],[libmwaw-0.3 >= 0.3.1])
 8052 libo_PKG_VERSION([MWAW], [libmwaw-0.3], [0.3.14])
 8053 
 8054 libo_CHECK_SYSTEM_MODULE([libetonyek],[ETONYEK],[libetonyek-0.1])
 8055 libo_PKG_VERSION([ETONYEK], [libetonyek-0.1], [0.1.8])
 8056 
 8057 libo_CHECK_SYSTEM_MODULE([libfreehand],[FREEHAND],[libfreehand-0.1])
 8058 
 8059 libo_CHECK_SYSTEM_MODULE([libebook],[EBOOK],[libe-book-0.1])
 8060 libo_PKG_VERSION([EBOOK], [libe-book-0.1], [0.1.2])
 8061 
 8062 libo_CHECK_SYSTEM_MODULE([libabw],[ABW],[libabw-0.1])
 8063 
 8064 libo_CHECK_SYSTEM_MODULE([libpagemaker],[PAGEMAKER],[libpagemaker-0.0])
 8065 
 8066 libo_CHECK_SYSTEM_MODULE([libqxp],[QXP],[libqxp-0.0])
 8067 
 8068 libo_CHECK_SYSTEM_MODULE([libzmf],[ZMF],[libzmf-0.0])
 8069 
 8070 libo_CHECK_SYSTEM_MODULE([libstaroffice],[STAROFFICE],[libstaroffice-0.0])
 8071 libo_PKG_VERSION([STAROFFICE], [libstaroffice-0.0], [0.0.6])
 8072 
 8073 dnl ===================================================================
 8074 dnl Check for system lcms2
 8075 dnl ===================================================================
 8076 if test "$with_system_lcms2" != "yes"; then
 8077     SYSTEM_LCMS2=
 8078 fi
 8079 libo_CHECK_SYSTEM_MODULE([lcms2],[LCMS2],[lcms2],["-I${WORKDIR}/UnpackedTarball/lcms2/include"],["-L${WORKDIR}/UnpackedTarball/lcms2/src/.libs -llcms2"])
 8080 if test "$GCC" = "yes"; then
 8081     LCMS2_CFLAGS="${LCMS2_CFLAGS} -Wno-long-long"
 8082 fi
 8083 if test "$COM" = "MSC"; then # override the above
 8084     LCMS2_LIBS=${WORKDIR}/UnpackedTarball/lcms2/bin/lcms2.lib
 8085 fi
 8086 
 8087 dnl ===================================================================
 8088 dnl Check for system cppunit
 8089 dnl ===================================================================
 8090 if test "$_os" != "Android" ; then
 8091     libo_CHECK_SYSTEM_MODULE([cppunit],[CPPUNIT],[cppunit >= 1.14.0])
 8092 fi
 8093 
 8094 dnl ===================================================================
 8095 dnl Check whether freetype is available
 8096 dnl ===================================================================
 8097 if test  "$test_freetype" = "yes"; then
 8098     AC_MSG_CHECKING([whether freetype is available])
 8099     # FreeType has 3 different kinds of versions
 8100     # * release, like 2.4.10
 8101     # * libtool, like 13.0.7 (this what pkg-config returns)
 8102     # * soname
 8103     # FreeType's docs/VERSION.DLL provides a table mapping between the three
 8104     #
 8105     # 9.9.3 is 2.2.0
 8106     PKG_CHECK_MODULES(FREETYPE, freetype2 >= 9.9.3)
 8107     FREETYPE_CFLAGS=$(printf '%s' "$FREETYPE_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 8108     FilterLibs "${FREETYPE_LIBS}"
 8109     FREETYPE_LIBS="${filteredlibs}"
 8110     SYSTEM_FREETYPE=TRUE
 8111 else
 8112     FREETYPE_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/freetype/include"
 8113     FREETYPE_LIBS="-L${WORKDIR}/UnpackedTarball/freetype/instdir/lib -lfreetype"
 8114 fi
 8115 AC_SUBST(FREETYPE_CFLAGS)
 8116 AC_SUBST(FREETYPE_LIBS)
 8117 AC_SUBST([SYSTEM_FREETYPE])
 8118 
 8119 # ===================================================================
 8120 # Check for system libxslt
 8121 # to prevent incompatibilities between internal libxml2 and external libxslt,
 8122 # or vice versa, use with_system_libxml here
 8123 # ===================================================================
 8124 if test "$with_system_libxml" = "auto"; then
 8125     case "$_os" in
 8126     WINNT|iOS|Android)
 8127         with_system_libxml="$with_system_libs"
 8128         ;;
 8129     *)
 8130         if test "$enable_fuzzers" != "yes"; then
 8131             with_system_libxml=yes
 8132         else
 8133             with_system_libxml=no
 8134         fi
 8135         ;;
 8136     esac
 8137 fi
 8138 
 8139 AC_MSG_CHECKING([which libxslt to use])
 8140 if test "$with_system_libxml" = "yes"; then
 8141     AC_MSG_RESULT([external])
 8142     SYSTEM_LIBXSLT=TRUE
 8143     if test "$_os" = "Darwin"; then
 8144         dnl make sure to use SDK path
 8145         LIBXSLT_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
 8146         LIBEXSLT_CFLAGS="$LIBXSLT_CFLAGS"
 8147         dnl omit -L/usr/lib
 8148         LIBXSLT_LIBS="-lxslt -lxml2 -lz -lpthread -liconv -lm"
 8149         LIBEXSLT_LIBS="-lexslt $LIBXSLT_LIBS"
 8150     else
 8151         PKG_CHECK_MODULES(LIBXSLT, libxslt)
 8152         LIBXSLT_CFLAGS=$(printf '%s' "$LIBXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 8153         FilterLibs "${LIBXSLT_LIBS}"
 8154         LIBXSLT_LIBS="${filteredlibs}"
 8155         PKG_CHECK_MODULES(LIBEXSLT, libexslt)
 8156         LIBEXSLT_CFLAGS=$(printf '%s' "$LIBEXSLT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 8157         FilterLibs "${LIBEXSLT_LIBS}"
 8158         LIBEXSLT_LIBS=$(printf '%s' "${filteredlibs}" | sed -e "s/-lgpg-error//"  -e "s/-lgcrypt//")
 8159     fi
 8160 
 8161     dnl Check for xsltproc
 8162     AC_PATH_PROG(XSLTPROC, xsltproc, no)
 8163     if test "$XSLTPROC" = "no"; then
 8164         AC_MSG_ERROR([xsltproc is required])
 8165     fi
 8166 else
 8167     AC_MSG_RESULT([internal])
 8168     SYSTEM_LIBXSLT=
 8169     BUILD_TYPE="$BUILD_TYPE LIBXSLT"
 8170 
 8171     if test "$cross_compiling" = "yes"; then
 8172         AC_PATH_PROG(XSLTPROC, xsltproc, no)
 8173         if test "$XSLTPROC" = "no"; then
 8174             AC_MSG_ERROR([xsltproc is required])
 8175         fi
 8176     fi
 8177 fi
 8178 AC_SUBST(SYSTEM_LIBXSLT)
 8179 if test -z "$SYSTEM_LIBXSLT_FOR_BUILD"; then
 8180     SYSTEM_LIBXSLT_FOR_BUILD="$SYSTEM_LIBXSLT"
 8181 fi
 8182 AC_SUBST(SYSTEM_LIBXSLT_FOR_BUILD)
 8183 
 8184 AC_SUBST(LIBEXSLT_CFLAGS)
 8185 AC_SUBST(LIBEXSLT_LIBS)
 8186 AC_SUBST(LIBXSLT_CFLAGS)
 8187 AC_SUBST(LIBXSLT_LIBS)
 8188 AC_SUBST(XSLTPROC)
 8189 
 8190 # ===================================================================
 8191 # Check for system libxml
 8192 # ===================================================================
 8193 AC_MSG_CHECKING([which libxml to use])
 8194 if test "$with_system_libxml" = "yes"; then
 8195     AC_MSG_RESULT([external])
 8196     SYSTEM_LIBXML=TRUE
 8197     if test "$_os" = "Darwin"; then
 8198         dnl make sure to use SDK path
 8199         LIBXML_CFLAGS="-I$MACOSX_SDK_PATH/usr/include/libxml2"
 8200         dnl omit -L/usr/lib
 8201         LIBXML_LIBS="-lxml2 -lz -lpthread -liconv -lm"
 8202     elif test $_os = iOS; then
 8203         dnl make sure to use SDK path
 8204         usr=`echo '#include <stdlib.h>' | $CC -E -MD - | grep usr/include/stdlib.h | head -1 | sed -e 's,# 1 ",,' -e 's,/usr/include/.*,/usr,'`
 8205         LIBXML_CFLAGS="-I$usr/include/libxml2"
 8206         LIBXML_LIBS="-L$usr/lib -lxml2 -liconv"
 8207     else
 8208         PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.0)
 8209         LIBXML_CFLAGS=$(printf '%s' "$LIBXML_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 8210         FilterLibs "${LIBXML_LIBS}"
 8211         LIBXML_LIBS="${filteredlibs}"
 8212     fi
 8213 
 8214     dnl Check for xmllint
 8215     AC_PATH_PROG(XMLLINT, xmllint, no)
 8216     if test "$XMLLINT" = "no"; then
 8217         AC_MSG_ERROR([xmllint is required])
 8218     fi
 8219 else
 8220     AC_MSG_RESULT([internal])
 8221     SYSTEM_LIBXML=
 8222     LIBXML_CFLAGS="-I${WORKDIR}/UnpackedTarball/libxml2/include"
 8223     if test "$COM" = "MSC"; then
 8224         LIBXML_CFLAGS="${LIBXML_CFLAGS} -I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
 8225     fi
 8226     if test "$COM" = "MSC"; then
 8227         LIBXML_LIBS="${WORKDIR}/UnpackedTarball/libxml2/win32/bin.msvc/libxml2.lib"
 8228     else
 8229         LIBXML_LIBS="-L${WORKDIR}/UnpackedTarball/libxml2/.libs -lxml2"
 8230     fi
 8231     BUILD_TYPE="$BUILD_TYPE LIBXML2"
 8232 fi
 8233 AC_SUBST(SYSTEM_LIBXML)
 8234 if test -z "$SYSTEM_LIBXML_FOR_BUILD"; then
 8235     SYSTEM_LIBXML_FOR_BUILD="$SYSTEM_LIBXML"
 8236 fi
 8237 AC_SUBST(SYSTEM_LIBXML_FOR_BUILD)
 8238 AC_SUBST(LIBXML_CFLAGS)
 8239 AC_SUBST(LIBXML_LIBS)
 8240 AC_SUBST(XMLLINT)
 8241 
 8242 # =====================================================================
 8243 # Checking for a Python interpreter with version >= 2.7.
 8244 # Build and runtime requires Python 3 compatible version (>= 2.7).
 8245 # Optionally user can pass an option to configure, i. e.
 8246 # ./configure PYTHON=/usr/bin/python
 8247 # =====================================================================
 8248 if test "$build_os" != "cygwin" -a "$enable_python" != fully-internal; then
 8249     # This allows a lack of system python with no error, we use internal one in that case.
 8250     AM_PATH_PYTHON([2.7],, [:])
 8251     # Clean PYTHON_VERSION checked below if cross-compiling
 8252     PYTHON_VERSION=""
 8253     if test "$PYTHON" != ":"; then
 8254         PYTHON_FOR_BUILD=$PYTHON
 8255     fi
 8256 fi
 8257 AC_SUBST(PYTHON_FOR_BUILD)
 8258 
 8259 # Checks for Python to use for Pyuno
 8260 AC_MSG_CHECKING([which Python to use for Pyuno])
 8261 case "$enable_python" in
 8262 no|disable)
 8263     if test -z $PYTHON_FOR_BUILD; then
 8264         # Python is required to build LibreOffice. In theory we could separate the build-time Python
 8265         # requirement from the choice whether to include Python stuff in the installer, but why
 8266         # bother?
 8267         AC_MSG_ERROR([Python is required at build time.])
 8268     fi
 8269     enable_python=no
 8270     AC_MSG_RESULT([none])
 8271     ;;
 8272 ""|yes|auto)
 8273     if test "$DISABLE_SCRIPTING" = TRUE -a -n "$PYTHON_FOR_BUILD"; then
 8274         AC_MSG_RESULT([no, overridden by --disable-scripting])
 8275         enable_python=no
 8276     elif test $build_os = cygwin; then
 8277         dnl When building on Windows we don't attempt to use any installed
 8278         dnl "system"  Python.
 8279         AC_MSG_RESULT([fully internal])
 8280         enable_python=internal
 8281     elif test "$cross_compiling" = yes; then
 8282         AC_MSG_RESULT([system])
 8283         enable_python=system
 8284     else
 8285         # Unset variables set by the above AM_PATH_PYTHON so that
 8286         # we actually do check anew.
 8287         unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_version am_cv_python_platform am_cv_python_pythondir am_cv_python_pyexecdir
 8288         AM_PATH_PYTHON([3.3],, [:])
 8289         if test "$PYTHON" = ":"; then
 8290             if test -z "$PYTHON_FOR_BUILD"; then
 8291                 AC_MSG_RESULT([fully internal])
 8292             else
 8293                 AC_MSG_RESULT([internal])
 8294             fi
 8295             enable_python=internal
 8296         else
 8297             AC_MSG_RESULT([system])
 8298             enable_python=system
 8299         fi
 8300     fi
 8301     ;;
 8302 internal)
 8303     AC_MSG_RESULT([internal])
 8304     ;;
 8305 fully-internal)
 8306     AC_MSG_RESULT([fully internal])
 8307     enable_python=internal
 8308     ;;
 8309 system)
 8310     AC_MSG_RESULT([system])
 8311     ;;
 8312 *)
 8313     AC_MSG_ERROR([Incorrect --enable-python option])
 8314     ;;
 8315 esac
 8316 
 8317 if test $enable_python != no; then
 8318     BUILD_TYPE="$BUILD_TYPE PYUNO"
 8319 fi
 8320 
 8321 if test $enable_python = system; then
 8322     if test -z "$PYTHON_CFLAGS" -a $_os = Darwin; then
 8323         python_version=2.7
 8324         PYTHON=python$python_version
 8325         if test -d "$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"; then
 8326             PYTHON_CFLAGS="-I$FRAMEWORKSHOME/Python.framework/Versions/${python_version}/include/python${python_version}"
 8327             PYTHON_LIBS="-framework Python"
 8328         else
 8329             PYTHON_CFLAGS="`$PYTHON-config --includes`"
 8330             PYTHON_LIBS="`$PYTHON-config --libs`"
 8331         fi
 8332     fi
 8333     if test -n "$PYTHON_CFLAGS" -a -n "$PYTHON_LIBS"; then
 8334         # Fallback: Accept these in the environment, or as set above
 8335         # for MacOSX.
 8336         :
 8337     elif test "$cross_compiling" != yes; then
 8338         # Unset variables set by the above AM_PATH_PYTHON so that
 8339         # we actually do check anew.
 8340         unset PYTHON am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_version am_cv_python_platform am_cv_python_pythondir am_cv_python_pyexecdir
 8341         # This causes an error if no python command is found
 8342         AM_PATH_PYTHON([3.3])
 8343         python_include=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('INCLUDEPY'));"`
 8344         python_version=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'));"`
 8345         python_libs=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBS'));"`
 8346         python_libdir=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBDIR'));"`
 8347         if test -z "$PKG_CONFIG"; then
 8348             PYTHON_CFLAGS="-I$python_include"
 8349             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
 8350         elif $PKG_CONFIG --exists python-$python_version; then
 8351             PYTHON_CFLAGS="`$PKG_CONFIG --cflags python-$python_version`"
 8352             PYTHON_LIBS="`$PKG_CONFIG --libs python-$python_version` $python_libs"
 8353         else
 8354             PYTHON_CFLAGS="-I$python_include"
 8355             PYTHON_LIBS="-L$python_libdir -lpython$python_version $python_libs"
 8356         fi
 8357         FilterLibs "${PYTHON_LIBS}"
 8358         PYTHON_LIBS="${filteredlibs}"
 8359     else
 8360         dnl How to find out the cross-compilation Python installation path?
 8361         AC_MSG_CHECKING([for python version])
 8362         AS_IF([test -n "$PYTHON_VERSION"],
 8363               [AC_MSG_RESULT([$PYTHON_VERSION])],
 8364               [AC_MSG_RESULT([not found])
 8365                AC_MSG_ERROR([no usable python found])])
 8366         test -n "$PYTHON_CFLAGS" && break
 8367     fi
 8368 
 8369     dnl Check if the headers really work
 8370     save_CPPFLAGS="$CPPFLAGS"
 8371     CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
 8372     AC_CHECK_HEADER(Python.h)
 8373     CPPFLAGS="$save_CPPFLAGS"
 8374 
 8375     # let the PYTHON_FOR_BUILD match the same python installation that
 8376     # provides PYTHON_CFLAGS/PYTHON_LDFLAGS for pyuno, which should be
 8377     # better for PythonTests.
 8378     PYTHON_FOR_BUILD=$PYTHON
 8379 fi
 8380 
 8381 if test "$with_lxml" != no; then
 8382     if test -z "$PYTHON_FOR_BUILD"; then
 8383         case $build_os in
 8384             cygwin)
 8385                 AC_MSG_WARN([No system-provided python lxml, gla11y will only report widget classes and ids])
 8386                 ;;
 8387             *)
 8388                 if test "$cross_compiling" != yes ; then
 8389                     BUILD_TYPE="$BUILD_TYPE LXML"
 8390                 fi
 8391                 ;;
 8392         esac
 8393     else
 8394         AC_MSG_CHECKING([for python lxml])
 8395         if $PYTHON_FOR_BUILD -c "import lxml.etree as ET" 2> /dev/null ; then
 8396             AC_MSG_RESULT([yes])
 8397         else
 8398             case $build_os in
 8399                 cygwin)
 8400                     AC_MSG_RESULT([no, gla11y will only report widget classes and ids])
 8401                     ;;
 8402                 *)
 8403                     if test "$cross_compiling" != yes -a "x$ac_cv_header_Python_h" = "xyes"; then
 8404                         BUILD_TYPE="$BUILD_TYPE LXML"
 8405                         AC_MSG_RESULT([no, using internal lxml])
 8406                     else
 8407                         AC_MSG_RESULT([no, and system does not provide python development headers, gla11y will only report widget classes and ids])
 8408                     fi
 8409                     ;;
 8410             esac
 8411         fi
 8412     fi
 8413 fi
 8414 
 8415 dnl By now enable_python should be "system", "internal" or "no"
 8416 case $enable_python in
 8417 system)
 8418     SYSTEM_PYTHON=TRUE
 8419 
 8420     if test "x$ac_cv_header_Python_h" != "xyes"; then
 8421        AC_MSG_ERROR([Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.])
 8422     fi
 8423 
 8424     AC_LANG_PUSH(C)
 8425     CFLAGS="$CFLAGS $PYTHON_CFLAGS"
 8426     AC_MSG_CHECKING([for correct python library version])
 8427        AC_RUN_IFELSE([AC_LANG_SOURCE([[
 8428 #include <Python.h>
 8429 
 8430 int main(int argc, char **argv) {
 8431    if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) ||
 8432        (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3)) return 0;
 8433    else return 1;
 8434 }
 8435        ]])],[AC_MSG_RESULT([ok])],[AC_MSG_ERROR([Python >= 3.3 is needed when building with Python 3, or Python >= 2.7 when building with Python 2])],[AC_MSG_RESULT([skipped; cross-compiling])])
 8436     CFLAGS=$save_CFLAGS
 8437     AC_LANG_POP(C)
 8438 
 8439     dnl FIXME Check if the Python library can be linked with, too?
 8440     ;;
 8441 
 8442 internal)
 8443     SYSTEM_PYTHON=
 8444     PYTHON_VERSION_MAJOR=3
 8445     PYTHON_VERSION_MINOR=5
 8446     PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.7
 8447     if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then
 8448         AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst])
 8449     fi
 8450     AC_DEFINE_UNQUOTED([PYTHON_VERSION_STRING], [L"${PYTHON_VERSION}"])
 8451     BUILD_TYPE="$BUILD_TYPE PYTHON"
 8452     # Embedded Python dies without Home set
 8453     if test "$HOME" = ""; then
 8454         export HOME=""
 8455     fi
 8456     ;;
 8457 no)
 8458     DISABLE_PYTHON=TRUE
 8459     SYSTEM_PYTHON=
 8460     ;;
 8461 *)
 8462     AC_MSG_ERROR([Internal configure script error, invalid enable_python value "$enable_python"])
 8463     ;;
 8464 esac
 8465 
 8466 AC_SUBST(DISABLE_PYTHON)
 8467 AC_SUBST(SYSTEM_PYTHON)
 8468 AC_SUBST(PYTHON_CFLAGS)
 8469 AC_SUBST(PYTHON_LIBS)
 8470 AC_SUBST(PYTHON_VERSION)
 8471 AC_SUBST(PYTHON_VERSION_MAJOR)
 8472 AC_SUBST(PYTHON_VERSION_MINOR)
 8473 
 8474 ENABLE_MARIADBC=TRUE
 8475 if test "$_os" = "Android" -o "$_os" = "iOS" -o "$enable_mpl_subset" = "yes"; then
 8476     ENABLE_MARIADBC=
 8477 fi
 8478 MARIADBC_MAJOR=1
 8479 MARIADBC_MINOR=0
 8480 MARIADBC_MICRO=2
 8481 if test "$ENABLE_MARIADBC" = "TRUE"; then
 8482     BUILD_TYPE="$BUILD_TYPE MARIADBC"
 8483 fi
 8484 
 8485 AC_SUBST(ENABLE_MARIADBC)
 8486 AC_SUBST(MARIADBC_MAJOR)
 8487 AC_SUBST(MARIADBC_MINOR)
 8488 AC_SUBST(MARIADBC_MICRO)
 8489 
 8490 if test "$ENABLE_MARIADBC" = "TRUE"; then
 8491     dnl ===================================================================
 8492     dnl Check for system MariaDB
 8493     dnl ===================================================================
 8494     AC_MSG_CHECKING([which MariaDB to use])
 8495     if test "$with_system_mariadb" = "yes"; then
 8496         AC_MSG_RESULT([external])
 8497         SYSTEM_MARIADB_CONNECTOR_C=TRUE
 8498         #AC_PATH_PROG(MARIADBCONFIG, [mariadb_config])
 8499         if test -z "$MARIADBCONFIG"; then
 8500             AC_PATH_PROG(MARIADBCONFIG, [mysql_config])
 8501             if test -z "$MARIADBCONFIG"; then
 8502                 AC_MSG_ERROR([mysql_config is missing. Install MySQL client library development package.])
 8503                 #AC_MSG_ERROR([mariadb_config and mysql_config are missing. Install MariaDB or MySQL client library development package.])
 8504             fi
 8505         fi
 8506         AC_MSG_CHECKING([MariaDB version])
 8507         MARIADB_VERSION=`$MARIADBCONFIG --version`
 8508         MARIADB_MAJOR=`$MARIADBCONFIG --version | cut -d"." -f1`
 8509         if test "$MARIADB_MAJOR" -ge "5"; then
 8510             AC_MSG_RESULT([OK])
 8511         else
 8512             AC_MSG_ERROR([too old, use 5.0.x or later])
 8513         fi
 8514         AC_MSG_CHECKING([for MariaDB Client library])
 8515         MARIADB_CFLAGS=`$MARIADBCONFIG --cflags`
 8516         if test "$COM_IS_CLANG" = TRUE; then
 8517             MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-fstack-protector-strong//)
 8518         fi
 8519         MARIADB_LIBS=`$MARIADBCONFIG --libs_r`
 8520         dnl At least mariadb-5.5.34-3.fc20.x86_64 plus
 8521         dnl mariadb-5.5.34-3.fc20.i686 reports 64-bit specific output even under
 8522         dnl linux32:
 8523         if test "$OS" = LINUX -a "$CPUNAME" = INTEL; then
 8524             MARIADB_CFLAGS=$(printf '%s' "$MARIADB_CFLAGS" | sed -e s/-m64//)
 8525             MARIADB_LIBS=$(printf '%s' "$MARIADB_LIBS" \
 8526                 | sed -e 's|/lib64/|/lib/|')
 8527         fi
 8528         FilterLibs "${MARIADB_LIBS}"
 8529         MARIADB_LIBS="${filteredlibs}"
 8530         AC_MSG_RESULT([includes '$MARIADB_CFLAGS', libraries '$MARIADB_LIBS'])
 8531         AC_MSG_CHECKING([whether to bundle the MySQL/MariaDB client library])
 8532         if test "$enable_bundle_mariadb" = "yes"; then
 8533             AC_MSG_RESULT([yes])
 8534             BUNDLE_MARIADB_CONNECTOR_C=TRUE
 8535             LIBMARIADB=lib$(echo "${MARIADB_LIBS}" | sed -e 's/[[[:space:]]]\{1,\}-l\([[^[:space:]]]\{1,\}\)/\
 8536 \1\
 8537 /g' -e 's/^-l\([[^[:space:]]]\{1,\}\)[[[:space:]]]*/\
 8538 \1\
 8539 /g' | grep -E '(mysqlclient|mariadb)')
 8540             if test "$_os" = "Darwin"; then
 8541                 LIBMARIADB=${LIBMARIADB}.dylib
 8542             elif test "$_os" = "WINNT"; then
 8543                 LIBMARIADB=${LIBMARIADB}.dll
 8544             else
 8545                 LIBMARIADB=${LIBMARIADB}.so
 8546             fi
 8547             LIBMARIADB_PATH=$($MARIADBCONFIG --variable=pkglibdir)
 8548             AC_MSG_CHECKING([for $LIBMARIADB in $LIBMARIADB_PATH])
 8549             if test -e "$LIBMARIADB_PATH/$LIBMARIADB"; then
 8550                 AC_MSG_RESULT([found.])
 8551                 PathFormat "$LIBMARIADB_PATH"
 8552                 LIBMARIADB_PATH="$formatted_path"
 8553             else
 8554                 AC_MSG_ERROR([not found.])
 8555             fi
 8556         else
 8557             AC_MSG_RESULT([no])
 8558             BUNDLE_MARIADB_CONNECTOR_C=
 8559         fi
 8560     else
 8561         AC_MSG_RESULT([internal])
 8562         SYSTEM_MARIADB_CONNECTOR_C=
 8563         MARIADB_CFLAGS="-I${WORKDIR}/UnpackedTarball/mariadb-connector-c/include"
 8564         MARIADB_LIBS="-L${WORKDIR}/LinkTarget/StaticLibrary -lmariadb-connector-c"
 8565         BUILD_TYPE="$BUILD_TYPE MARIADB_CONNECTOR_C"
 8566     fi
 8567 
 8568     AC_SUBST(SYSTEM_MARIADB_CONNECTOR_C)
 8569     AC_SUBST(MARIADB_CFLAGS)
 8570     AC_SUBST(MARIADB_LIBS)
 8571     AC_SUBST(LIBMARIADB)
 8572     AC_SUBST(LIBMARIADB_PATH)
 8573     AC_SUBST(BUNDLE_MARIADB_CONNECTOR_C)
 8574 fi
 8575 
 8576 dnl ===================================================================
 8577 dnl Check for system hsqldb
 8578 dnl ===================================================================
 8579 if test "$with_java" != "no"; then
 8580     HSQLDB_USE_JDBC_4_1=
 8581     AC_MSG_CHECKING([which hsqldb to use])
 8582     if test "$with_system_hsqldb" = "yes"; then
 8583         AC_MSG_RESULT([external])
 8584         SYSTEM_HSQLDB=TRUE
 8585         if test -z $HSQLDB_JAR; then
 8586             HSQLDB_JAR=/usr/share/java/hsqldb.jar
 8587         fi
 8588         if ! test -f $HSQLDB_JAR; then
 8589                AC_MSG_ERROR(hsqldb.jar not found.)
 8590         fi
 8591         AC_MSG_CHECKING([whether hsqldb is 1.8.0.x])
 8592         export HSQLDB_JAR
 8593         if $PERL -e \
 8594            'use Archive::Zip;
 8595             my $file = "$ENV{'HSQLDB_JAR'}";
 8596             my $zip = Archive::Zip->new( $file );
 8597             my $mf = $zip->contents ( "META-INF/MANIFEST.MF" );
 8598             if ( $mf =~ m/Specification-Version: 1.8.*/ )
 8599             {
 8600                 push @l, split(/\n/, $mf);
 8601                 foreach my $line (@l)
 8602                 {
 8603                     if ($line =~ m/Specification-Version:/)
 8604                     {
 8605                         ($t, $version) = split (/:/,$line);
 8606                         $version =~ s/^\s//;
 8607                         ($a, $b, $c, $d) = split (/\./,$version);
 8608                         if ($c == "0" && $d > "8")
 8609                         {
 8610                             exit 0;
 8611                         }
 8612                         else
 8613                         {
 8614                             exit 1;
 8615                         }
 8616                     }
 8617                 }
 8618             }
 8619             else
 8620             {
 8621                 exit 1;
 8622             }'; then
 8623             AC_MSG_RESULT([yes])
 8624         else
 8625             AC_MSG_ERROR([no, you need hsqldb >= 1.8.0.9 but < 1.8.1])
 8626         fi
 8627     else
 8628         AC_MSG_RESULT([internal])
 8629         SYSTEM_HSQLDB=
 8630         BUILD_TYPE="$BUILD_TYPE HSQLDB"
 8631         NEED_ANT=TRUE
 8632         AC_MSG_CHECKING([whether hsqldb should be built with JDBC 4.1])
 8633         javanumver=`$JAVAINTERPRETER -version 2>&1 | $AWK -v num=true -f $SRC_ROOT/solenv/bin/getcompver.awk`
 8634         if expr "$javanumver" '>=' 000100060000 > /dev/null; then
 8635             AC_MSG_RESULT([yes])
 8636             HSQLDB_USE_JDBC_4_1=TRUE
 8637         else
 8638             AC_MSG_RESULT([no])
 8639         fi
 8640     fi
 8641     AC_SUBST(SYSTEM_HSQLDB)
 8642     AC_SUBST(HSQLDB_JAR)
 8643     AC_SUBST([HSQLDB_USE_JDBC_4_1])
 8644 fi
 8645 
 8646 dnl ===================================================================
 8647 dnl Check for PostgreSQL stuff
 8648 dnl ===================================================================
 8649 AC_MSG_CHECKING([whether to build the PostgreSQL SDBC driver])
 8650 if test "x$enable_postgresql_sdbc" != "xno"; then
 8651     AC_MSG_RESULT([yes])
 8652     SCPDEFS="$SCPDEFS -DWITH_POSTGRESQL_SDBC"
 8653 
 8654     if test "$with_krb5" = "yes" -a "$enable_openssl" = "no"; then
 8655         AC_MSG_ERROR([krb5 needs OpenSSL, but --disable-openssl was given.])
 8656     fi
 8657     if test "$with_gssapi" = "yes" -a "$enable_openssl" = "no"; then
 8658         AC_MSG_ERROR([GSSAPI needs OpenSSL, but --disable-openssl was given.])
 8659     fi
 8660 
 8661     postgres_interface=""
 8662     if test "$with_system_postgresql" = "yes"; then
 8663         postgres_interface="external PostgreSQL"
 8664         SYSTEM_POSTGRESQL=TRUE
 8665         if test "$_os" = Darwin; then
 8666             supp_path=''
 8667             for d in /Library/PostgreSQL/9.*/bin /sw/opt/postgresql/9.*/bin /opt/local/lib/postgresql9*/bin; do
 8668                 pg_supp_path="$P_SEP$d$pg_supp_path"
 8669             done
 8670         fi
 8671         AC_PATH_PROG(PGCONFIG, pg_config, ,$PATH$pg_supp_path)
 8672         if test -n "$PGCONFIG"; then
 8673             POSTGRESQL_INC=-I$(${PGCONFIG} --includedir)
 8674             POSTGRESQL_LIB="-L$(${PGCONFIG} --libdir)"
 8675         else
 8676             PKG_CHECK_MODULES(POSTGRESQL, libpq, [
 8677               POSTGRESQL_INC=$POSTGRESQL_CFLAGS
 8678               POSTGRESQL_LIB=$POSTGRESQL_LIBS
 8679             ],[
 8680               AC_MSG_ERROR([pg_config or 'pkg-config libpq' needed; set PGCONFIG if not in PATH])
 8681             ])
 8682         fi
 8683         FilterLibs "${POSTGRESQL_LIB}"
 8684         POSTGRESQL_LIB="${filteredlibs}"
 8685     else
 8686         # if/when anything else than PostgreSQL uses Kerberos,
 8687         # move this out of `test "x$enable_postgresql_sdbc" != "xno"'
 8688         WITH_KRB5=
 8689         WITH_GSSAPI=
 8690         case "$_os" in
 8691         Darwin)
 8692             # MacOS X has system MIT Kerberos 5 since 10.4
 8693             if test "$with_krb5" != "no"; then
 8694                 WITH_KRB5=TRUE
 8695                 save_LIBS=$LIBS
 8696                 # Not sure whether it makes any sense here to search multiple potential libraries; it is not likely
 8697                 # that the libraries where these functions are located on macOS will change, is it?
 8698                 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8699                     [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
 8700                 KRB5_LIBS=$LIBS
 8701                 LIBS=$save_LIBS
 8702                 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8703                     [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
 8704                 KRB5_LIBS="$KRB5_LIBS $LIBS"
 8705                 LIBS=$save_LIBS
 8706             fi
 8707             if test "$with_gssapi" != "no"; then
 8708                 WITH_GSSAPI=TRUE
 8709                 save_LIBS=$LIBS
 8710                 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
 8711                     [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
 8712                 GSSAPI_LIBS=$LIBS
 8713                 LIBS=$save_LIBS
 8714             fi
 8715             ;;
 8716         WINNT)
 8717             if test "$with_krb5" = "yes" -o "$with_gssapi" = "yes"; then
 8718                 AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Windows.])
 8719             fi
 8720             ;;
 8721         Linux|GNU|*BSD|DragonFly)
 8722             if test "$with_krb5" != "no"; then
 8723                 WITH_KRB5=TRUE
 8724                 save_LIBS=$LIBS
 8725                 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8726                     [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
 8727                 KRB5_LIBS=$LIBS
 8728                 LIBS=$save_LIBS
 8729                 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8730                     [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
 8731                 KRB5_LIBS="$KRB5_LIBS $LIBS"
 8732                 LIBS=$save_LIBS
 8733             fi
 8734             if test "$with_gssapi" != "no"; then
 8735                 WITH_GSSAPI=TRUE
 8736                 save_LIBS=$LIBS
 8737                 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
 8738                     [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
 8739                 GSSAPI_LIBS=$LIBS
 8740                 LIBS=$save_LIBS
 8741             fi
 8742             ;;
 8743         *)
 8744             if test "$with_krb5" = "yes"; then
 8745                 WITH_KRB5=TRUE
 8746                 save_LIBS=$LIBS
 8747                 AC_SEARCH_LIBS(com_err, [com_err 'com_err -lssl -lcrypto' krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8748                     [AC_MSG_ERROR([could not find function 'com_err' required for Kerberos 5])])
 8749                 KRB5_LIBS=$LIBS
 8750                 LIBS=$save_LIBS
 8751                 AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken'], [],
 8752                     [AC_MSG_ERROR([could not find function 'krb5_sendauth' required for Kerberos 5])])
 8753                 KRB5_LIBS="$KRB5_LIBS $LIBS"
 8754                 LIBS=$save_LIBS
 8755             fi
 8756             if test "$with_gssapi" = "yes"; then
 8757                 WITH_GSSAPI=TRUE
 8758                 save_LIBS=$LIBS
 8759                 AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
 8760                     [AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
 8761                 LIBS=$save_LIBS
 8762                 GSSAPI_LIBS=$LIBS
 8763             fi
 8764         esac
 8765 
 8766         if test -n "$with_libpq_path"; then
 8767             SYSTEM_POSTGRESQL=TRUE
 8768             postgres_interface="external libpq"
 8769             POSTGRESQL_LIB="-L${with_libpq_path}/lib/"
 8770             POSTGRESQL_INC=-I"${with_libpq_path}/include/"
 8771         else
 8772             SYSTEM_POSTGRESQL=
 8773             postgres_interface="internal"
 8774             POSTGRESQL_LIB=""
 8775             POSTGRESQL_INC="%OVERRIDE_ME%"
 8776             BUILD_TYPE="$BUILD_TYPE POSTGRESQL"
 8777         fi
 8778     fi
 8779 
 8780     AC_MSG_CHECKING([PostgreSQL C interface])
 8781     AC_MSG_RESULT([$postgres_interface])
 8782 
 8783     if test "${SYSTEM_POSTGRESQL}" = "TRUE"; then
 8784         AC_MSG_NOTICE([checking system PostgreSQL prerequisites])
 8785         save_CFLAGS=$CFLAGS
 8786         save_CPPFLAGS=$CPPFLAGS
 8787         save_LIBS=$LIBS
 8788         CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_INC}"
 8789         LIBS="${LIBS} ${POSTGRESQL_LIB}"
 8790         AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], [])
 8791         AC_CHECK_LIB([pq], [PQconnectdbParams], [:],
 8792             [AC_MSG_ERROR(libpq not found or too old. Need >= 9.0)], [])
 8793         CFLAGS=$save_CFLAGS
 8794         CPPFLAGS=$save_CPPFLAGS
 8795         LIBS=$save_LIBS
 8796     fi
 8797     BUILD_POSTGRESQL_SDBC=TRUE
 8798 else
 8799     AC_MSG_RESULT([no])
 8800 fi
 8801 AC_SUBST(WITH_KRB5)
 8802 AC_SUBST(WITH_GSSAPI)
 8803 AC_SUBST(GSSAPI_LIBS)
 8804 AC_SUBST(KRB5_LIBS)
 8805 AC_SUBST(BUILD_POSTGRESQL_SDBC)
 8806 AC_SUBST(SYSTEM_POSTGRESQL)
 8807 AC_SUBST(POSTGRESQL_INC)
 8808 AC_SUBST(POSTGRESQL_LIB)
 8809 
 8810 dnl ===================================================================
 8811 dnl Check for Firebird stuff
 8812 dnl ===================================================================
 8813 ENABLE_FIREBIRD_SDBC=
 8814 if test "$enable_firebird_sdbc" = "yes" ; then
 8815     SCPDEFS="$SCPDEFS -DWITH_FIREBIRD_SDBC"
 8816 
 8817     dnl ===================================================================
 8818     dnl Check for system Firebird
 8819     dnl ===================================================================
 8820     AC_MSG_CHECKING([which Firebird to use])
 8821     if test "$with_system_firebird" = "yes"; then
 8822         AC_MSG_RESULT([external])
 8823         SYSTEM_FIREBIRD=TRUE
 8824         AC_PATH_PROG(FIREBIRDCONFIG, [fb_config])
 8825         if test -z "$FIREBIRDCONFIG"; then
 8826             AC_MSG_NOTICE([No fb_config -- using pkg-config])
 8827             PKG_CHECK_MODULES([FIREBIRD], [fbclient >= 3], [FIREBIRD_PKGNAME=fbclient], [
 8828                 PKG_CHECK_MODULES([FIREBIRD], [fbembed], [FIREBIRD_PKGNAME=fbembed])
 8829             ])
 8830             FIREBIRD_VERSION=`pkg-config --modversion "$FIREBIRD_PKGNAME"`
 8831         else
 8832             AC_MSG_NOTICE([fb_config found])
 8833             FIREBIRD_VERSION=`$FIREBIRDCONFIG --version`
 8834             AC_MSG_CHECKING([for Firebird Client library])
 8835             FIREBIRD_CFLAGS=`$FIREBIRDCONFIG --cflags`
 8836             FIREBIRD_LIBS=`$FIREBIRDCONFIG --embedlibs`
 8837             FilterLibs "${FIREBIRD_LIBS}"
 8838             FIREBIRD_LIBS="${filteredlibs}"
 8839         fi
 8840         AC_MSG_RESULT([includes `$FIREBIRD_CFLAGS', libraries `$FIREBIRD_LIBS'])
 8841         AC_MSG_CHECKING([Firebird version])
 8842         if test -n "${FIREBIRD_VERSION}"; then
 8843             FIREBIRD_MAJOR=`echo $FIREBIRD_VERSION | cut -d"." -f1`
 8844             FIREBIRD_MINOR=`echo $FIREBIRD_VERSION | cut -d"." -f2`
 8845             if test "$FIREBIRD_MAJOR" -eq "3" -a "$FIREBIRD_MINOR" -eq "0"; then
 8846                 AC_MSG_RESULT([OK])
 8847             else
 8848                 AC_MSG_ERROR([Ensure firebird 3.0.x is installed])
 8849             fi
 8850         else
 8851             __save_CFLAGS="${CFLAGS}"
 8852             CFLAGS="${CFLAGS} ${FIREBIRD_CFLAGS}"
 8853             AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ibase.h>
 8854 #if defined(FB_API_VER) && FB_API_VER == 30
 8855 int fb_api_is_30(void) { return 0; }
 8856 #else
 8857 #error "Wrong Firebird API version"
 8858 #endif]])],AC_MSG_RESULT([OK]),AC_MSG_ERROR([Ensure firebird 3.0.x is installed]))
 8859             CFLAGS="${__save_CFLAGS}"
 8860         fi
 8861         ENABLE_FIREBIRD_SDBC=TRUE
 8862         AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
 8863     elif test "$enable_database_connectivity" != yes; then
 8864         AC_MSG_RESULT([none])
 8865     elif test "$cross_compiling" = "yes"; then
 8866         AC_MSG_RESULT([none])
 8867     else
 8868         dnl Embedded Firebird has version 3.0
 8869         AC_DEFINE(HAVE_FIREBIRD_30, 1)
 8870         dnl We need libatomic-ops for any non X86/X64 system
 8871         if test "${CPUNAME}" != INTEL -a "${CPUNAME}" != X86_64; then
 8872             dnl ===================================================================
 8873             dnl Check for system libatomic-ops
 8874             dnl ===================================================================
 8875             libo_CHECK_SYSTEM_MODULE([libatomic_ops],[ATOMIC_OPS],[atomic_ops >= 0.7.2])
 8876             if test "$with_system_libatomic_ops" = "yes"; then
 8877                 SYSTEM_LIBATOMIC_OPS=TRUE
 8878                 AC_CHECK_HEADERS(atomic_ops.h, [],
 8879                 [AC_MSG_ERROR(atomic_ops.h not found. install libatomic-ops)], [])
 8880             else
 8881                 SYSTEM_LIBATOMIC_OPS=
 8882                 LIBATOMIC_OPS_CFLAGS="-I${WORKDIR}/UnpackedTarball/libatomic_ops/include"
 8883                 LIBATOMIC_OPS_LIBS="-latomic_ops"
 8884                 BUILD_TYPE="$BUILD_TYPE LIBATOMIC_OPS"
 8885             fi
 8886         fi
 8887 
 8888         AC_MSG_RESULT([internal])
 8889         SYSTEM_FIREBIRD=
 8890         FIREBIRD_CFLAGS="-I${WORKDIR}/UnpackedTarball/firebird/gen/Release/firebird/include"
 8891         FIREBIRD_LIBS="-lfbclient"
 8892 
 8893         if test "$with_system_libtommath" = "yes"; then
 8894             SYSTEM_LIBTOMMATH=TRUE
 8895             dnl check for tommath presence
 8896             save_LIBS=$LIBS
 8897             AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package))
 8898             AC_CHECK_LIB(tommath, mp_init, TOMMATH_LIBS=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package))
 8899             LIBS=$save_LIBS
 8900         else
 8901             SYSTEM_LIBTOMMATH=
 8902             LIBTOMMATH_CFLAGS="-I${WORKDIR}/UnpackedTarball/libtommath"
 8903             LIBTOMMATH_LIBS="-ltommath"
 8904             BUILD_TYPE="$BUILD_TYPE LIBTOMMATH"
 8905         fi
 8906 
 8907         BUILD_TYPE="$BUILD_TYPE FIREBIRD"
 8908         ENABLE_FIREBIRD_SDBC=TRUE
 8909         AC_DEFINE([ENABLE_FIREBIRD_SDBC],1)
 8910     fi
 8911 fi
 8912 AC_SUBST(ENABLE_FIREBIRD_SDBC)
 8913 AC_SUBST(SYSTEM_LIBATOMIC_OPS)
 8914 AC_SUBST(LIBATOMIC_OPS_CFLAGS)
 8915 AC_SUBST(LIBATOMIC_OPS_LIBS)
 8916 AC_SUBST(SYSTEM_FIREBIRD)
 8917 AC_SUBST(FIREBIRD_CFLAGS)
 8918 AC_SUBST(FIREBIRD_LIBS)
 8919 AC_SUBST([TOMMATH_CFLAGS])
 8920 AC_SUBST([TOMMATH_LIBS])
 8921 
 8922 dnl ===================================================================
 8923 dnl Check for system curl
 8924 dnl ===================================================================
 8925 AC_MSG_CHECKING([which libcurl to use])
 8926 if test "$with_system_curl" = "auto"; then
 8927     with_system_curl="$with_system_libs"
 8928 fi
 8929 
 8930 if test "$with_system_curl" = "yes"; then
 8931     AC_MSG_RESULT([external])
 8932     SYSTEM_CURL=TRUE
 8933 
 8934     # First try PKGCONFIG and then fall back
 8935     PKG_CHECK_MODULES(CURL, libcurl >= 7.19.4,, [:])
 8936 
 8937     if test -n "$CURL_PKG_ERRORS"; then
 8938         AC_PATH_PROG(CURLCONFIG, curl-config)
 8939         if test -z "$CURLCONFIG"; then
 8940             AC_MSG_ERROR([curl development files not found])
 8941         fi
 8942         CURL_LIBS=`$CURLCONFIG --libs`
 8943         FilterLibs "${CURL_LIBS}"
 8944         CURL_LIBS="${filteredlibs}"
 8945         CURL_CFLAGS=$("$CURLCONFIG" --cflags | sed -e "s/-I/${ISYSTEM?}/g")
 8946         curl_version=`$CURLCONFIG --version | $SED -e 's/^libcurl //'`
 8947 
 8948         AC_MSG_CHECKING([whether libcurl is >= 7.19.4])
 8949         case $curl_version in
 8950         dnl brackets doubled below because Autoconf uses them as m4 quote characters,
 8951         dnl so they need to be doubled to end up in the configure script
 8952         7.19.4|7.19.[[5-9]]|7.[[2-9]]?.*|7.???.*|[[8-9]].*|[[1-9]][[0-9]].*)
 8953             AC_MSG_RESULT([yes])
 8954             ;;
 8955         *)
 8956             AC_MSG_ERROR([no, you have $curl_version])
 8957             ;;
 8958         esac
 8959     fi
 8960 
 8961     ENABLE_CURL=TRUE
 8962 elif test $_os = iOS; then
 8963     # Let's see if we need curl, I think not?
 8964     AC_MSG_RESULT([none])
 8965     ENABLE_CURL=
 8966 else
 8967     AC_MSG_RESULT([internal])
 8968     SYSTEM_CURL=
 8969     BUILD_TYPE="$BUILD_TYPE CURL"
 8970     ENABLE_CURL=TRUE
 8971 fi
 8972 AC_SUBST(SYSTEM_CURL)
 8973 AC_SUBST(CURL_CFLAGS)
 8974 AC_SUBST(CURL_LIBS)
 8975 AC_SUBST(ENABLE_CURL)
 8976 
 8977 dnl ===================================================================
 8978 dnl Check for system boost
 8979 dnl ===================================================================
 8980 AC_MSG_CHECKING([which boost to use])
 8981 if test "$with_system_boost" = "yes"; then
 8982     AC_MSG_RESULT([external])
 8983     SYSTEM_BOOST=TRUE
 8984     AX_BOOST_BASE(1.47)
 8985     AX_BOOST_DATE_TIME
 8986     AX_BOOST_FILESYSTEM
 8987     AX_BOOST_IOSTREAMS
 8988     AX_BOOST_LOCALE
 8989     AC_LANG_PUSH([C++])
 8990     save_CXXFLAGS=$CXXFLAGS
 8991     CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS $CXXFLAGS_CXX11"
 8992     AC_CHECK_HEADER(boost/shared_ptr.hpp, [],
 8993        [AC_MSG_ERROR(boost/shared_ptr.hpp not found. install boost)], [])
 8994     AC_CHECK_HEADER(boost/spirit/include/classic_core.hpp, [],
 8995        [AC_MSG_ERROR(boost/spirit/include/classic_core.hpp not found. install boost >= 1.36)], [])
 8996     CXXFLAGS=$save_CXXFLAGS
 8997     AC_LANG_POP([C++])
 8998     # this is in m4/ax_boost_base.m4
 8999     FilterLibs "${BOOST_LDFLAGS}"
 9000     BOOST_LDFLAGS="${filteredlibs}"
 9001 else
 9002     AC_MSG_RESULT([internal])
 9003     BUILD_TYPE="$BUILD_TYPE BOOST"
 9004     SYSTEM_BOOST=
 9005     if test "${COM}" = "GCC" -o "${COM_IS_CLANG}" = "TRUE"; then
 9006         # use warning-suppressing wrapper headers
 9007         BOOST_CPPFLAGS="-I${SRC_ROOT}/external/boost/include -I${WORKDIR}/UnpackedTarball/boost"
 9008     else
 9009         BOOST_CPPFLAGS="-I${WORKDIR}/UnpackedTarball/boost"
 9010     fi
 9011 fi
 9012 AC_SUBST(SYSTEM_BOOST)
 9013 
 9014 dnl ===================================================================
 9015 dnl Check for system mdds
 9016 dnl ===================================================================
 9017 libo_CHECK_SYSTEM_MODULE([mdds], [MDDS], [mdds-1.4 >= 1.4.1], ["-I${WORKDIR}/UnpackedTarball/mdds/include"])
 9018 
 9019 dnl ===================================================================
 9020 dnl Check for system glm
 9021 dnl ===================================================================
 9022 AC_MSG_CHECKING([which glm to use])
 9023 if test "$with_system_glm" = "yes"; then
 9024     AC_MSG_RESULT([external])
 9025     SYSTEM_GLM=TRUE
 9026     AC_LANG_PUSH([C++])
 9027     AC_CHECK_HEADER([glm/glm.hpp], [],
 9028        [AC_MSG_ERROR([glm/glm.hpp not found. install glm])], [])
 9029     AC_LANG_POP([C++])
 9030 else
 9031     AC_MSG_RESULT([internal])
 9032     BUILD_TYPE="$BUILD_TYPE GLM"
 9033     SYSTEM_GLM=
 9034     GLM_CFLAGS="${ISYSTEM}${WORKDIR}/UnpackedTarball/glm"
 9035 fi
 9036 AC_SUBST([GLM_CFLAGS])
 9037 AC_SUBST([SYSTEM_GLM])
 9038 
 9039 dnl ===================================================================
 9040 dnl Check for system odbc
 9041 dnl ===================================================================
 9042 AC_MSG_CHECKING([which odbc headers to use])
 9043 if test "$with_system_odbc" = "yes" -o '(' "$with_system_headers" = "yes" -a "$with_system_odbc" = "auto" ')' -o '(' "$_os" = "WINNT" -a  "$with_system_odbc" != "no" ')'; then
 9044     AC_MSG_RESULT([external])
 9045     SYSTEM_ODBC_HEADERS=TRUE
 9046 
 9047     if test "$build_os" = "cygwin"; then
 9048         save_CPPFLAGS=$CPPFLAGS
 9049         find_winsdk
 9050         PathFormat "$winsdktest"
 9051         CPPFLAGS="$CPPFLAGS -I$formatted_path/include/um -I$formatted_path/Include/$winsdklibsubdir/um -I$formatted_path/include -I$formatted_path/include/shared -I$formatted_path/include/$winsdklibsubdir/shared"
 9052         AC_CHECK_HEADER(sqlext.h, [],
 9053             [AC_MSG_ERROR(odbc not found. install odbc)],
 9054             [#include <windows.h>])
 9055         CPPFLAGS=$save_CPPFLAGS
 9056     else
 9057         AC_CHECK_HEADER(sqlext.h, [],
 9058             [AC_MSG_ERROR(odbc not found. install odbc)],[])
 9059     fi
 9060 elif test "$enable_database_connectivity" != yes; then
 9061     AC_MSG_RESULT([none])
 9062 else
 9063     AC_MSG_RESULT([internal])
 9064     SYSTEM_ODBC_HEADERS=
 9065 fi
 9066 AC_SUBST(SYSTEM_ODBC_HEADERS)
 9067 
 9068 
 9069 dnl ===================================================================
 9070 dnl Check for system openldap
 9071 dnl ===================================================================
 9072 
 9073 if test "$_os" != "WINNT" -a "$_os" != "iOS" -a "$_os" != "Android"; then
 9074 AC_MSG_CHECKING([which openldap library to use])
 9075 if test "$with_system_openldap" = "yes"; then
 9076     AC_MSG_RESULT([external])
 9077     SYSTEM_OPENLDAP=TRUE
 9078     AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
 9079     AC_CHECK_LIB([ldap], [ldap_simple_bind_s], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
 9080     AC_CHECK_LIB([ldap], [ldap_set_option], [:], [AC_MSG_ERROR(openldap lib not found or functional)], [])
 9081 else
 9082     AC_MSG_RESULT([internal])
 9083     SYSTEM_OPENLDAP=
 9084     BUILD_TYPE="$BUILD_TYPE OPENLDAP"
 9085 fi
 9086 fi
 9087 AC_SUBST(SYSTEM_OPENLDAP)
 9088 
 9089 dnl ===================================================================
 9090 dnl Check for system NSS
 9091 dnl ===================================================================
 9092 if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
 9093     libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
 9094     AC_DEFINE(HAVE_FEATURE_NSS)
 9095     ENABLE_NSS="TRUE"
 9096     AC_DEFINE(ENABLE_NSS)
 9097 elif test $_os != iOS ; then
 9098     with_tls=openssl
 9099 fi
 9100 AC_SUBST(ENABLE_NSS)
 9101 
 9102 dnl ===================================================================
 9103 dnl Check for TLS/SSL and cryptographic implementation to use
 9104 dnl ===================================================================
 9105 AC_MSG_CHECKING([which TLS/SSL and cryptographic implementation to use])
 9106 if test -n "$with_tls"; then
 9107     case $with_tls in
 9108     openssl)
 9109         AC_DEFINE(USE_TLS_OPENSSL)
 9110         TLS=OPENSSL
 9111 
 9112         if test "$enable_openssl" != "yes"; then
 9113             AC_MSG_ERROR(["Disabling OpenSSL was requested, but the requested TLS to use is actually OpenSSL."])
 9114         fi
 9115 
 9116         # warn that OpenSSL has been selected but not all TLS code has this option
 9117         AC_MSG_WARN([TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS])
 9118         add_warning "TLS/SSL implementation to use is OpenSSL but some code may still depend on NSS or GNUTLS"
 9119         ;;
 9120     nss)
 9121         AC_DEFINE(USE_TLS_NSS)
 9122         TLS=NSS
 9123         ;;
 9124     no)
 9125         AC_MSG_WARN([Skipping TLS/SSL])
 9126         ;;
 9127     *)
 9128         AC_MSG_ERROR([unsupported implementation $with_tls. Supported are:
 9129 openssl - OpenSSL
 9130 nss - Mozilla's Network Security Services (NSS)
 9131     ])
 9132         ;;
 9133     esac
 9134 else
 9135     # default to using NSS, it results in smaller oox lib
 9136     AC_DEFINE(USE_TLS_NSS)
 9137     TLS=NSS
 9138 fi
 9139 AC_MSG_RESULT([$TLS])
 9140 AC_SUBST(TLS)
 9141 
 9142 dnl ===================================================================
 9143 dnl Check for system sane
 9144 dnl ===================================================================
 9145 AC_MSG_CHECKING([which sane header to use])
 9146 if test "$with_system_sane" = "yes"; then
 9147     AC_MSG_RESULT([external])
 9148     AC_CHECK_HEADER(sane/sane.h, [],
 9149       [AC_MSG_ERROR(sane not found. install sane)], [])
 9150 else
 9151     AC_MSG_RESULT([internal])
 9152     BUILD_TYPE="$BUILD_TYPE SANE"
 9153 fi
 9154 
 9155 dnl ===================================================================
 9156 dnl Check for system icu
 9157 dnl ===================================================================
 9158 SYSTEM_GENBRK=
 9159 SYSTEM_GENCCODE=
 9160 SYSTEM_GENCMN=
 9161 
 9162 ICU_MAJOR=63
 9163 ICU_MINOR=1
 9164 ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
 9165 ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
 9166 ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
 9167 AC_MSG_CHECKING([which icu to use])
 9168 if test "$with_system_icu" = "yes"; then
 9169     AC_MSG_RESULT([external])
 9170     SYSTEM_ICU=TRUE
 9171     AC_LANG_PUSH([C++])
 9172     AC_MSG_CHECKING([for unicode/rbbi.h])
 9173     AC_PREPROC_IFELSE([AC_LANG_SOURCE([[unicode/rbbi.h]])],[AC_MSG_RESULT(checked.)],[AC_MSG_ERROR(icu headers not found.)])
 9174     AC_LANG_POP([C++])
 9175 
 9176     if test "$cross_compiling" != "yes"; then
 9177         PKG_CHECK_MODULES(ICU, icu-i18n >= 4.6)
 9178         ICU_VERSION=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
 9179         ICU_MAJOR=`echo $ICU_VERSION | cut -d"." -f1`
 9180         ICU_MINOR=`echo $ICU_VERSION | cut -d"." -f2`
 9181     fi
 9182 
 9183     if test "$cross_compiling" = "yes" -a \( "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force" \); then
 9184         ICU_VERSION_FOR_BUILD=`$PKG_CONFIG --modversion icu-i18n 2>/dev/null`
 9185         ICU_MAJOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f1`
 9186         ICU_MINOR_FOR_BUILD=`echo $ICU_VERSION_FOR_BUILD | cut -d"." -f2`
 9187         AC_MSG_CHECKING([if MinGW and system versions of ICU are compatible])
 9188         if test "$ICU_MAJOR" -eq "$ICU_MAJOR_FOR_BUILD" -a "$ICU_MINOR" -eq "$ICU_MINOR_FOR_BUILD"; then
 9189             AC_MSG_RESULT([yes])
 9190         else
 9191             AC_MSG_RESULT([no])
 9192             if test "$with_system_icu_for_build" != "force"; then
 9193                 AC_MSG_ERROR([System ICU is not version-compatible with MinGW ICU.
 9194 You can use --with-system-icu-for-build=force to use it anyway.])
 9195             fi
 9196         fi
 9197     fi
 9198 
 9199     if test "$cross_compiling" != "yes" -o "$with_system_icu_for_build" = "yes" -o "$with_system_icu_for_build" = "force"; then
 9200         # using the system icu tools can lead to version confusion, use the
 9201         # ones from the build environment when cross-compiling
 9202         AC_PATH_PROG(SYSTEM_GENBRK, genbrk, [], [$PATH:/usr/sbin:/sbin])
 9203         if test -z "$SYSTEM_GENBRK"; then
 9204             AC_MSG_ERROR([\'genbrk\' not found in \$PATH, install the icu development tool \'genbrk\'])
 9205         fi
 9206         AC_PATH_PROG(SYSTEM_GENCCODE, genccode, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
 9207         if test -z "$SYSTEM_GENCCODE"; then
 9208             AC_MSG_ERROR([\'genccode\' not found in \$PATH, install the icu development tool \'genccode\'])
 9209         fi
 9210         AC_PATH_PROG(SYSTEM_GENCMN, gencmn, [], [$PATH:/usr/sbin:/sbin:/usr/local/sbin])
 9211         if test -z "$SYSTEM_GENCMN"; then
 9212             AC_MSG_ERROR([\'gencmn\' not found in \$PATH, install the icu development tool \'gencmn\'])
 9213         fi
 9214         if test "$ICU_MAJOR" -ge "49"; then
 9215             ICU_RECLASSIFIED_PREPEND_SET_EMPTY="TRUE"
 9216             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER="TRUE"
 9217             ICU_RECLASSIFIED_HEBREW_LETTER="TRUE"
 9218         else
 9219             ICU_RECLASSIFIED_PREPEND_SET_EMPTY=
 9220             ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER=
 9221             ICU_RECLASSIFIED_HEBREW_LETTER=
 9222         fi
 9223     fi
 9224 
 9225     if test "$cross_compiling" = "yes"; then
 9226         if test "$ICU_MAJOR" -ge "50"; then
 9227             AC_MSG_RESULT([Ignore ICU_MINOR as obviously the libraries don't include the minor version in their names any more])
 9228             ICU_MINOR=""
 9229         fi
 9230     fi
 9231 else
 9232     AC_MSG_RESULT([internal])
 9233     SYSTEM_ICU=
 9234     BUILD_TYPE="$BUILD_TYPE ICU"
 9235     # surprisingly set these only for "internal" (to be used by various other
 9236     # external libs): the system icu-config is quite unhelpful and spits out
 9237     # dozens of weird flags and also default path -I/usr/include
 9238     ICU_CFLAGS="-I${WORKDIR}/UnpackedTarball/icu/source/i18n -I${WORKDIR}/UnpackedTarball/icu/source/common"
 9239     ICU_LIBS="-L${WORKDIR}/UnpackedTarball/icu/source/lib"
 9240 fi
 9241 if test "$ICU_MAJOR" -ge "59"; then
 9242     # As of ICU 59 it defaults to typedef char16_t UChar; which is available
 9243     # with -std=c++11 but not all external libraries can be built with that,
 9244     # for those use a bit-compatible typedef uint16_t UChar; see
 9245     # icu/source/common/unicode/umachine.h
 9246     ICU_UCHAR_TYPE="-DUCHAR_TYPE=uint16_t"
 9247 else
 9248     ICU_UCHAR_TYPE=""
 9249 fi
 9250 AC_SUBST(SYSTEM_ICU)
 9251 AC_SUBST(SYSTEM_GENBRK)
 9252 AC_SUBST(SYSTEM_GENCCODE)
 9253 AC_SUBST(SYSTEM_GENCMN)
 9254 AC_SUBST(ICU_MAJOR)
 9255 AC_SUBST(ICU_MINOR)
 9256 AC_SUBST(ICU_RECLASSIFIED_PREPEND_SET_EMPTY)
 9257 AC_SUBST(ICU_RECLASSIFIED_CONDITIONAL_JAPANESE_STARTER)
 9258 AC_SUBST(ICU_RECLASSIFIED_HEBREW_LETTER)
 9259 AC_SUBST(ICU_CFLAGS)
 9260 AC_SUBST(ICU_LIBS)
 9261 AC_SUBST(ICU_UCHAR_TYPE)
 9262 
 9263 dnl ==================================================================
 9264 dnl Breakpad
 9265 dnl ==================================================================
 9266 AC_MSG_CHECKING([whether to enable breakpad])
 9267 if test "$enable_breakpad" != yes; then
 9268     AC_MSG_RESULT([no])
 9269 else
 9270     AC_MSG_RESULT([yes])
 9271     ENABLE_BREAKPAD="TRUE"
 9272     AC_DEFINE(ENABLE_BREAKPAD)
 9273     AC_DEFINE(HAVE_FEATURE_BREAKPAD, 1)
 9274     BUILD_TYPE="$BUILD_TYPE BREAKPAD"
 9275 
 9276     AC_MSG_CHECKING([for crashreport config])
 9277     if test "$with_symbol_config" = "no"; then
 9278         BREAKPAD_SYMBOL_CONFIG="invalid"
 9279         AC_MSG_RESULT([no])
 9280     else
 9281         BREAKPAD_SYMBOL_CONFIG="$with_symbol_config"
 9282         AC_DEFINE(BREAKPAD_SYMBOL_CONFIG)
 9283         AC_MSG_RESULT([yes])
 9284     fi
 9285     AC_SUBST(BREAKPAD_SYMBOL_CONFIG)
 9286 fi
 9287 AC_SUBST(ENABLE_BREAKPAD)
 9288 
 9289 dnl ==================================================================
 9290 dnl libfuzzer
 9291 dnl ==================================================================
 9292 AC_MSG_CHECKING([whether to enable fuzzers])
 9293 if test "$enable_fuzzers" != yes; then
 9294     AC_MSG_RESULT([no])
 9295 else
 9296     AC_MSG_RESULT([yes])
 9297     ENABLE_FUZZERS="TRUE"
 9298     AC_DEFINE([ENABLE_FUZZERS],1)
 9299     BUILD_TYPE="$BUILD_TYPE FUZZERS"
 9300 fi
 9301 AC_SUBST(ENABLE_FUZZERS)
 9302 
 9303 dnl ===================================================================
 9304 dnl Orcus
 9305 dnl ===================================================================
 9306 libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.14 >= 0.14.0])
 9307 if test "$with_system_orcus" != "yes"; then
 9308     if test "$SYSTEM_BOOST" = "TRUE"; then
 9309         # ===========================================================
 9310         # Determine if we are going to need to link with Boost.System
 9311         # ===========================================================
 9312         dnl This seems to be necessary since boost 1.50 (1.48 does not need it,
 9313         dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned
 9314         dnl in documentation has no effect.
 9315         AC_MSG_CHECKING([if we need to link with Boost.System])
 9316         AC_LANG_PUSH([C++])
 9317         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 9318                 @%:@include <boost/version.hpp>
 9319             ]],[[
 9320                 #if BOOST_VERSION >= 105000
 9321                 #   error yes, we need to link with Boost.System
 9322                 #endif
 9323             ]])],[
 9324                 AC_MSG_RESULT([no])
 9325             ],[
 9326                 AC_MSG_RESULT([yes])
 9327                 AX_BOOST_SYSTEM
 9328         ])
 9329         AC_LANG_POP([C++])
 9330     fi
 9331 fi
 9332 dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world
 9333 SYSTEM_LIBORCUS=$SYSTEM_ORCUS
 9334 AC_SUBST([BOOST_SYSTEM_LIB])
 9335 AC_SUBST(SYSTEM_LIBORCUS)
 9336 
 9337 dnl ===================================================================
 9338 dnl HarfBuzz
 9339 dnl ===================================================================
 9340 libo_CHECK_SYSTEM_MODULE([graphite],[GRAPHITE],[graphite2 >= 0.9.3],
 9341                          ["-I${WORKDIR}/UnpackedTarball/graphite/include -DGRAPHITE2_STATIC"],
 9342                          ["-L${WORKDIR}/LinkTarget/StaticLibrary -lgraphite"])
 9343 
 9344 libo_CHECK_SYSTEM_MODULE([harfbuzz],[HARFBUZZ],[harfbuzz-icu >= 0.9.42],
 9345                          ["-I${WORKDIR}/UnpackedTarball/harfbuzz/src"],
 9346                          ["-L${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs -lharfbuzz"])
 9347 
 9348 if test "$COM" = "MSC"; then # override the above
 9349     GRAPHITE_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/graphite.lib"
 9350     HARFBUZZ_LIBS="${WORKDIR}/UnpackedTarball/harfbuzz/src/.libs/libharfbuzz.lib"
 9351 fi
 9352 
 9353 if test "$with_system_harfbuzz" = "yes"; then
 9354     if test "$with_system_graphite" = "no"; then
 9355         AC_MSG_ERROR([--with-system-graphite must be used when --with-system-harfbuzz is used])
 9356     fi
 9357     AC_MSG_CHECKING([whether system Harfbuzz is built with Graphite support])
 9358     _save_libs="$LIBS"
 9359     _save_cflags="$CFLAGS"
 9360     LIBS="$LIBS $HARFBUZZ_LIBS"
 9361     CFLAGS="$CFLAGS $HARFBUZZ_CFLAGS"
 9362     AC_CHECK_FUNC(hb_graphite2_face_get_gr_face,,[AC_MSG_ERROR([Harfbuzz needs to be built with Graphite support.])])
 9363     LIBS="$_save_libs"
 9364     CFLAGS="$_save_cflags"
 9365 else
 9366     if test "$with_system_graphite" = "yes"; then
 9367         AC_MSG_ERROR([--without-system-graphite must be used when --without-system-harfbuzz is used])
 9368     fi
 9369 fi
 9370 
 9371 AC_MSG_CHECKING([whether to use X11])
 9372 dnl ***************************************
 9373 dnl testing for X libraries and includes...
 9374 dnl ***************************************
 9375 if test "$USING_X11" = TRUE; then
 9376     AC_DEFINE(HAVE_FEATURE_X11)
 9377 fi
 9378 AC_MSG_RESULT([$USING_X11])
 9379 
 9380 if test "$USING_X11" = TRUE; then
 9381     AC_PATH_X
 9382     AC_PATH_XTRA
 9383     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
 9384 
 9385     if test -z "$x_includes"; then
 9386         x_includes="default_x_includes"
 9387     fi
 9388     if test -z "$x_libraries"; then
 9389         x_libraries="default_x_libraries"
 9390     fi
 9391     CFLAGS="$CFLAGS $X_CFLAGS"
 9392     LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS"
 9393     AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS", [AC_MSG_ERROR([X Development libraries not found])])
 9394 else
 9395     x_includes="no_x_includes"
 9396     x_libraries="no_x_libraries"
 9397 fi
 9398 
 9399 if test "$USING_X11" = TRUE; then
 9400     dnl ===================================================================
 9401     dnl Check for extension headers
 9402     dnl ===================================================================
 9403     AC_CHECK_HEADERS(X11/extensions/shape.h,[],[AC_MSG_ERROR([libXext headers not found])],
 9404      [#include <X11/extensions/shape.h>])
 9405 
 9406     # vcl needs ICE and SM
 9407     AC_CHECK_HEADERS(X11/ICE/ICElib.h,[],[AC_MSG_ERROR([libICE headers not found])])
 9408     AC_CHECK_LIB([ICE], [IceConnectionNumber], [:],
 9409         [AC_MSG_ERROR(ICE library not found)])
 9410     AC_CHECK_HEADERS(X11/SM/SMlib.h,[],[AC_MSG_ERROR([libSM headers not found])])
 9411     AC_CHECK_LIB([SM], [SmcOpenConnection], [:],
 9412         [AC_MSG_ERROR(SM library not found)])
 9413 fi
 9414 
 9415 dnl ===================================================================
 9416 dnl Check for system Xrender
 9417 dnl ===================================================================
 9418 AC_MSG_CHECKING([whether to use Xrender])
 9419 if test "$USING_X11" = TRUE -a  "$test_xrender" = "yes"; then
 9420     AC_MSG_RESULT([yes])
 9421     PKG_CHECK_MODULES(XRENDER, xrender)
 9422     XRENDER_CFLAGS=$(printf '%s' "$XRENDER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 9423     FilterLibs "${XRENDER_LIBS}"
 9424     XRENDER_LIBS="${filteredlibs}"
 9425     AC_CHECK_LIB([Xrender], [XRenderQueryVersion], [:],
 9426       [AC_MSG_ERROR(libXrender not found or functional)], [])
 9427     AC_CHECK_HEADER(X11/extensions/Xrender.h, [],
 9428       [AC_MSG_ERROR(Xrender not found. install X)], [])
 9429 else
 9430     AC_MSG_RESULT([no])
 9431 fi
 9432 AC_SUBST(XRENDER_CFLAGS)
 9433 AC_SUBST(XRENDER_LIBS)
 9434 
 9435 dnl ===================================================================
 9436 dnl Check for XRandr
 9437 dnl ===================================================================
 9438 AC_MSG_CHECKING([whether to enable RandR support])
 9439 if test "$USING_X11" = TRUE -a "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \); then
 9440     AC_MSG_RESULT([yes])
 9441     PKG_CHECK_MODULES(XRANDR, xrandr >= 1.2, ENABLE_RANDR="TRUE", ENABLE_RANDR="")
 9442     if test "$ENABLE_RANDR" != "TRUE"; then
 9443         AC_CHECK_HEADER(X11/extensions/Xrandr.h, [],
 9444                     [AC_MSG_ERROR([X11/extensions/Xrandr.h could not be found. X11 dev missing?])], [])
 9445         XRANDR_CFLAGS=" "
 9446         AC_CHECK_LIB([Xrandr], [XRRQueryExtension], [:],
 9447           [ AC_MSG_ERROR(libXrandr not found or functional) ], [])
 9448         XRANDR_LIBS="-lXrandr "
 9449         ENABLE_RANDR="TRUE"
 9450     fi
 9451     XRANDR_CFLAGS=$(printf '%s' "$XRANDR_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 9452     FilterLibs "${XRANDR_LIBS}"
 9453     XRANDR_LIBS="${filteredlibs}"
 9454 else
 9455     ENABLE_RANDR=""
 9456     AC_MSG_RESULT([no])
 9457 fi
 9458 AC_SUBST(XRANDR_CFLAGS)
 9459 AC_SUBST(XRANDR_LIBS)
 9460 AC_SUBST(ENABLE_RANDR)
 9461 
 9462 if test "$enable_neon" = "no" -o "$enable_mpl_subset" = "yes"; then
 9463     WITH_WEBDAV="serf"
 9464 fi
 9465 if test $_os = iOS -o $_os = Android; then
 9466     WITH_WEBDAV="no"
 9467 fi
 9468 AC_MSG_CHECKING([for webdav library])
 9469 case "$WITH_WEBDAV" in
 9470 serf)
 9471     AC_MSG_RESULT([serf])
 9472     # Check for system apr-util
 9473     libo_CHECK_SYSTEM_MODULE([apr],[APR],[apr-util-1],
 9474                              ["-I${WORKDIR}/UnpackedTarball/apr/include -I${WORKDIR}/UnpackedTarball/apr_util/include"],
 9475                              ["-L${WORKDIR}/UnpackedTarball/apr/.libs -lapr-1 -L${WORKDIR}/UnpackedTarball/apr_util/.libs -laprutil-1"])
 9476     if test "$COM" = "MSC"; then
 9477         APR_LIB_DIR="LibR"
 9478         test -n "${MSVC_USE_DEBUG_RUNTIME}" && APR_LIB_DIR="LibD"
 9479         APR_LIBS="${WORKDIR}/UnpackedTarball/apr/${APR_LIB_DIR}/apr-1.lib ${WORKDIR}/UnpackedTarball/apr_util/${APR_LIB_DIR}/aprutil-1.lib"
 9480     fi
 9481 
 9482     # Check for system serf
 9483     libo_CHECK_SYSTEM_MODULE([serf],[SERF],[serf-1 >= 1.1.0],["-I${WORKDIR}/UnpackedTarball/serf"],
 9484                              ["-L${WORKDIR}/UnpackedTarball/serf/.libs -lserf-1"])
 9485     if test "$COM" = "MSC"; then
 9486         SERF_LIB_DIR="Release"
 9487         test -n "${MSVC_USE_DEBUG_RUNTIME}" && SERF_LIB_DIR="Debug"
 9488         SERF_LIBS="${WORKDIR}/UnpackedTarball/serf/${SERF_LIB_DIR}/serf-1.lib"
 9489     fi
 9490     ;;
 9491 neon)
 9492     AC_MSG_RESULT([neon])
 9493     # Check for system neon
 9494     libo_CHECK_SYSTEM_MODULE([neon],[NEON],[neon >= 0.26.0])
 9495     if test "$with_system_neon" = "yes"; then
 9496         NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`"
 9497     else
 9498         NEON_VERSION=0295
 9499     fi
 9500     AC_SUBST(NEON_VERSION)
 9501     ;;
 9502 *)
 9503     AC_MSG_RESULT([none, disabled])
 9504     WITH_WEBDAV=""
 9505     ;;
 9506 esac
 9507 AC_SUBST(WITH_WEBDAV)
 9508 
 9509 dnl ===================================================================
 9510 dnl Check for disabling cve_tests
 9511 dnl ===================================================================
 9512 AC_MSG_CHECKING([whether to execute CVE tests])
 9513 # If not explicitly enabled or disabled, default
 9514 if test -z "$enable_cve_tests"; then
 9515     case "$OS" in
 9516     WNT)
 9517         # Default cves off for windows with its wild and wonderful
 9518         # varienty of AV software kicking in and panicking
 9519         enable_cve_tests=no
 9520         ;;
 9521     *)
 9522         # otherwise yes
 9523         enable_cve_tests=yes
 9524         ;;
 9525     esac
 9526 fi
 9527 if test "$enable_cve_tests" = "no"; then
 9528     AC_MSG_RESULT([no])
 9529     DISABLE_CVE_TESTS=TRUE
 9530     AC_SUBST(DISABLE_CVE_TESTS)
 9531 else
 9532     AC_MSG_RESULT([yes])
 9533 fi
 9534 
 9535 dnl ===================================================================
 9536 dnl Check for enabling chart XShape tests
 9537 dnl ===================================================================
 9538 AC_MSG_CHECKING([whether to execute chart XShape tests])
 9539 if test "$enable_chart_tests" = "yes" -o '(' "$_os" = "WINNT" -a "$enable_chart_tests" != "no" ')'; then
 9540     AC_MSG_RESULT([yes])
 9541     ENABLE_CHART_TESTS=TRUE
 9542     AC_SUBST(ENABLE_CHART_TESTS)
 9543 else
 9544     AC_MSG_RESULT([no])
 9545 fi
 9546 
 9547 dnl ===================================================================
 9548 dnl Check for system openssl
 9549 dnl ===================================================================
 9550 DISABLE_OPENSSL=
 9551 AC_MSG_CHECKING([whether to disable OpenSSL usage])
 9552 if test "$enable_openssl" = "yes"; then
 9553     AC_MSG_RESULT([no])
 9554     if test "$_os" = Darwin ; then
 9555         # OpenSSL is deprecated when building for 10.7 or later.
 9556         #
 9557         # http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion
 9558         # http://stackoverflow.com/questions/7475914/libcrypto-deprecated-on-mac-os-x-10-7-lion
 9559 
 9560         with_system_openssl=no
 9561         libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
 9562     elif test "$_os" = "NetBSD" -o "$_os" = "OpenBSD" -o "$_os" = "DragonFly" \
 9563             && test "$with_system_openssl" != "no"; then
 9564         with_system_openssl=yes
 9565         SYSTEM_OPENSSL=TRUE
 9566         OPENSSL_CFLAGS=
 9567         OPENSSL_LIBS="-lssl -lcrypto"
 9568     else
 9569         libo_CHECK_SYSTEM_MODULE([openssl],[OPENSSL],[openssl])
 9570     fi
 9571     if test "$with_system_openssl" = "yes"; then
 9572         AC_MSG_CHECKING([whether openssl supports SHA512])
 9573         AC_LANG_PUSH([C])
 9574         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/sha.h>]],[[
 9575             SHA512_CTX context;
 9576 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, openssl too old. Need >= 0.9.8.])])
 9577         AC_LANG_POP(C)
 9578     fi
 9579 else
 9580     AC_MSG_RESULT([yes])
 9581     DISABLE_OPENSSL=TRUE
 9582 
 9583     # warn that although OpenSSL is disabled, system libraries may depend on it
 9584     AC_MSG_WARN([OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies])
 9585     add_warning "OpenSSL has been disabled. No code compiled by LibO will make use of it but system librares may create indirect dependencies"
 9586 fi
 9587 
 9588 AC_SUBST([DISABLE_OPENSSL])
 9589 
 9590 if test "$enable_cipher_openssl_backend" = yes && test "$DISABLE_OPENSSL" = TRUE; then
 9591     if test "$libo_fuzzed_enable_cipher_openssl_backend" = yes; then
 9592         AC_MSG_NOTICE([Resetting --enable-cipher-openssl-backend=no])
 9593         enable_cipher_openssl_backend=no
 9594     else
 9595         AC_MSG_ERROR([--enable-cipher-openssl-backend needs OpenSSL, but --disable-openssl was given.])
 9596     fi
 9597 fi
 9598 AC_MSG_CHECKING([whether to enable the OpenSSL backend for rtl/cipher.h])
 9599 ENABLE_CIPHER_OPENSSL_BACKEND=
 9600 if test "$enable_cipher_openssl_backend" = yes; then
 9601     AC_MSG_RESULT([yes])
 9602     ENABLE_CIPHER_OPENSSL_BACKEND=TRUE
 9603 else
 9604     AC_MSG_RESULT([no])
 9605 fi
 9606 AC_SUBST([ENABLE_CIPHER_OPENSSL_BACKEND])
 9607 
 9608 dnl ===================================================================
 9609 dnl Check for building gnutls
 9610 dnl ===================================================================
 9611 AC_MSG_CHECKING([whether to use gnutls])
 9612 if test "$WITH_WEBDAV" = "neon" -a "$with_system_neon" = no -a "$enable_openssl" = "no"; then
 9613     AC_MSG_RESULT([yes])
 9614     AM_PATH_LIBGCRYPT()
 9615     PKG_CHECK_MODULES(GNUTLS, [gnutls],,
 9616         AC_MSG_ERROR([[Disabling OpenSSL was requested, but GNUTLS is not
 9617                       available in the system to use as replacement.]]))
 9618     FilterLibs "${LIBGCRYPT_LIBS}"
 9619     LIBGCRYPT_LIBS="${filteredlibs}"
 9620 else
 9621     AC_MSG_RESULT([no])
 9622 fi
 9623 
 9624 AC_SUBST([LIBGCRYPT_CFLAGS])
 9625 AC_SUBST([LIBGCRYPT_LIBS])
 9626 
 9627 dnl ===================================================================
 9628 dnl Check for system redland
 9629 dnl ===================================================================
 9630 dnl redland: versions before 1.0.8 write RDF/XML that is useless for ODF (@xml:base)
 9631 dnl raptor2: need at least 2.0.7 for CVE-2012-0037
 9632 libo_CHECK_SYSTEM_MODULE([redland],[REDLAND],[redland >= 1.0.8 raptor2 >= 2.0.7])
 9633 if test "$with_system_redland" = "yes"; then
 9634     AC_CHECK_LIB([rdf], [librdf_world_set_raptor_init_handler], [:],
 9635             [AC_MSG_ERROR(librdf too old. Need >= 1.0.16)], [])
 9636 else
 9637     RAPTOR_MAJOR="0"
 9638     RASQAL_MAJOR="3"
 9639     REDLAND_MAJOR="0"
 9640 fi
 9641 AC_SUBST(RAPTOR_MAJOR)
 9642 AC_SUBST(RASQAL_MAJOR)
 9643 AC_SUBST(REDLAND_MAJOR)
 9644 
 9645 dnl ===================================================================
 9646 dnl Check for system hunspell
 9647 dnl ===================================================================
 9648 AC_MSG_CHECKING([which libhunspell to use])
 9649 if test "$with_system_hunspell" = "yes"; then
 9650     AC_MSG_RESULT([external])
 9651     SYSTEM_HUNSPELL=TRUE
 9652     AC_LANG_PUSH([C++])
 9653     PKG_CHECK_MODULES(HUNSPELL, hunspell, HUNSPELL_PC="TRUE", HUNSPELL_PC="" )
 9654     if test "$HUNSPELL_PC" != "TRUE"; then
 9655         AC_CHECK_HEADER(hunspell.hxx, [],
 9656             [
 9657             AC_CHECK_HEADER(hunspell/hunspell.hxx, [ HUNSPELL_CFLAGS=-I/usr/include/hunspell ],
 9658             [AC_MSG_ERROR(hunspell headers not found.)], [])
 9659             ], [])
 9660         AC_CHECK_LIB([hunspell], [main], [:],
 9661            [ AC_MSG_ERROR(hunspell library not found.) ], [])
 9662         HUNSPELL_LIBS=-lhunspell
 9663     fi
 9664     AC_LANG_POP([C++])
 9665     HUNSPELL_CFLAGS=$(printf '%s' "$HUNSPELL_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 9666     FilterLibs "${HUNSPELL_LIBS}"
 9667     HUNSPELL_LIBS="${filteredlibs}"
 9668 else
 9669     AC_MSG_RESULT([internal])
 9670     SYSTEM_HUNSPELL=
 9671     HUNSPELL_CFLAGS="-I${WORKDIR}/UnpackedTarball/hunspell/src/hunspell"
 9672     if test "$COM" = "MSC"; then
 9673         HUNSPELL_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/hunspell.lib"
 9674     else
 9675         HUNSPELL_LIBS="-L${WORKDIR}/UnpackedTarball/hunspell/src/hunspell/.libs -lhunspell-1.7"
 9676     fi
 9677     BUILD_TYPE="$BUILD_TYPE HUNSPELL"
 9678 fi
 9679 AC_SUBST(SYSTEM_HUNSPELL)
 9680 AC_SUBST(HUNSPELL_CFLAGS)
 9681 AC_SUBST(HUNSPELL_LIBS)
 9682 
 9683 dnl ===================================================================
 9684 dnl Checking for altlinuxhyph
 9685 dnl ===================================================================
 9686 AC_MSG_CHECKING([which altlinuxhyph to use])
 9687 if test "$with_system_altlinuxhyph" = "yes"; then
 9688     AC_MSG_RESULT([external])
 9689     SYSTEM_HYPH=TRUE
 9690     AC_CHECK_HEADER(hyphen.h, [],
 9691        [ AC_MSG_ERROR(altlinuxhyph headers not found.)], [])
 9692     AC_CHECK_MEMBER(struct _HyphenDict.cset, [],
 9693        [ AC_MSG_ERROR(no. You are sure you have altlinuyhyph headers?)],
 9694        [#include <hyphen.h>])
 9695     AC_CHECK_LIB(hyphen, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyphen],
 9696         [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
 9697     if test -z "$HYPHEN_LIB"; then
 9698         AC_CHECK_LIB(hyph, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhyph],
 9699            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
 9700     fi
 9701     if test -z "$HYPHEN_LIB"; then
 9702         AC_CHECK_LIB(hnj, hnj_hyphen_hyphenate2, [HYPHEN_LIB=-lhnj],
 9703            [ AC_MSG_ERROR(altlinuxhyph library not found or too old.)], [])
 9704     fi
 9705 else
 9706     AC_MSG_RESULT([internal])
 9707     SYSTEM_HYPH=
 9708     BUILD_TYPE="$BUILD_TYPE HYPHEN"
 9709     if test "$COM" = "MSC"; then
 9710         HYPHEN_LIB="${WORKDIR}/LinkTarget/StaticLibrary/hyphen.lib"
 9711     else
 9712         HYPHEN_LIB="-L${WORKDIR}/UnpackedTarball/hyphen/.libs -lhyphen"
 9713     fi
 9714 fi
 9715 AC_SUBST(SYSTEM_HYPH)
 9716 AC_SUBST(HYPHEN_LIB)
 9717 
 9718 dnl ===================================================================
 9719 dnl Checking for mythes
 9720 dnl ===================================================================
 9721 AC_MSG_CHECKING([which mythes to use])
 9722 if test "$with_system_mythes" = "yes"; then
 9723     AC_MSG_RESULT([external])
 9724     SYSTEM_MYTHES=TRUE
 9725     AC_LANG_PUSH([C++])
 9726     PKG_CHECK_MODULES(MYTHES, mythes, MYTHES_PKGCONFIG=yes, MYTHES_PKGCONFIG=no)
 9727     if test "$MYTHES_PKGCONFIG" = "no"; then
 9728         AC_CHECK_HEADER(mythes.hxx, [],
 9729             [ AC_MSG_ERROR(mythes.hxx headers not found.)], [])
 9730         AC_CHECK_LIB([mythes-1.2], [main], [:],
 9731             [ MYTHES_FOUND=no], [])
 9732     if test "$MYTHES_FOUND" = "no"; then
 9733         AC_CHECK_LIB(mythes, main, [MYTHES_FOUND=yes],
 9734                 [ MYTHES_FOUND=no], [])
 9735     fi
 9736     if test "$MYTHES_FOUND" = "no"; then
 9737         AC_MSG_ERROR([mythes library not found!.])
 9738     fi
 9739     fi
 9740     AC_LANG_POP([C++])
 9741     MYTHES_CFLAGS=$(printf '%s' "$MYTHES_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 9742     FilterLibs "${MYTHES_LIBS}"
 9743     MYTHES_LIBS="${filteredlibs}"
 9744 else
 9745     AC_MSG_RESULT([internal])
 9746     SYSTEM_MYTHES=
 9747     BUILD_TYPE="$BUILD_TYPE MYTHES"
 9748     if test "$COM" = "MSC"; then
 9749         MYTHES_LIBS="${WORKDIR}/LinkTarget/StaticLibrary/mythes.lib"
 9750     else
 9751         MYTHES_LIBS="-L${WORKDIR}/UnpackedTarball/mythes/.libs -lmythes-1.2"
 9752     fi
 9753 fi
 9754 AC_SUBST(SYSTEM_MYTHES)
 9755 AC_SUBST(MYTHES_CFLAGS)
 9756 AC_SUBST(MYTHES_LIBS)
 9757 
 9758 dnl ===================================================================
 9759 dnl How should we build the linear programming solver ?
 9760 dnl ===================================================================
 9761 
 9762 ENABLE_COINMP=
 9763 AC_MSG_CHECKING([whether to build with CoinMP])
 9764 if test "$enable_coinmp" != "no"; then
 9765     ENABLE_COINMP=TRUE
 9766     AC_MSG_RESULT([yes])
 9767     if test "$with_system_coinmp" = "yes"; then
 9768         SYSTEM_COINMP=TRUE
 9769         PKG_CHECK_MODULES(COINMP, coinmp coinutils)
 9770         FilterLibs "${COINMP_LIBS}"
 9771         COINMP_LIBS="${filteredlibs}"
 9772     else
 9773         BUILD_TYPE="$BUILD_TYPE COINMP"
 9774     fi
 9775 else
 9776     AC_MSG_RESULT([no])
 9777 fi
 9778 AC_SUBST(ENABLE_COINMP)
 9779 AC_SUBST(SYSTEM_COINMP)
 9780 AC_SUBST(COINMP_CFLAGS)
 9781 AC_SUBST(COINMP_LIBS)
 9782 
 9783 ENABLE_LPSOLVE=
 9784 AC_MSG_CHECKING([whether to build with lpsolve])
 9785 if test "$enable_lpsolve" != "no"; then
 9786     ENABLE_LPSOLVE=TRUE
 9787     AC_MSG_RESULT([yes])
 9788 else
 9789     AC_MSG_RESULT([no])
 9790 fi
 9791 AC_SUBST(ENABLE_LPSOLVE)
 9792 
 9793 if test "$ENABLE_LPSOLVE" = TRUE; then
 9794     AC_MSG_CHECKING([which lpsolve to use])
 9795     if test "$with_system_lpsolve" = "yes"; then
 9796         AC_MSG_RESULT([external])
 9797         SYSTEM_LPSOLVE=TRUE
 9798         AC_CHECK_HEADER(lpsolve/lp_lib.h, [],
 9799            [ AC_MSG_ERROR(lpsolve headers not found.)], [])
 9800         save_LIBS=$LIBS
 9801         # some systems need this. Like Ubuntu....
 9802         AC_CHECK_LIB(m, floor)
 9803         AC_CHECK_LIB(dl, dlopen)
 9804         AC_CHECK_LIB([lpsolve55], [make_lp], [:],
 9805             [ AC_MSG_ERROR(lpsolve library not found or too old.)], [])
 9806         LIBS=$save_LIBS
 9807     else
 9808         AC_MSG_RESULT([internal])
 9809         SYSTEM_LPSOLVE=
 9810         BUILD_TYPE="$BUILD_TYPE LPSOLVE"
 9811     fi
 9812 fi
 9813 AC_SUBST(SYSTEM_LPSOLVE)
 9814 
 9815 dnl ===================================================================
 9816 dnl Checking for libexttextcat
 9817 dnl ===================================================================
 9818 libo_CHECK_SYSTEM_MODULE([libexttextcat],[LIBEXTTEXTCAT],[libexttextcat >= 3.4.1])
 9819 if test "$with_system_libexttextcat" = "yes"; then
 9820     SYSTEM_LIBEXTTEXTCAT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libexttextcat`
 9821 fi
 9822 AC_SUBST(SYSTEM_LIBEXTTEXTCAT_DATA)
 9823 
 9824 dnl ===================================================================
 9825 dnl Checking for libnumbertext
 9826 dnl ===================================================================
 9827 AC_MSG_CHECKING([whether to use libnumbertext])
 9828 if test "$enable_libnumbertext" = "no"; then
 9829     AC_MSG_RESULT([no])
 9830     ENABLE_LIBNUMBERTEXT=
 9831     SYSTEM_LIBNUMBERTEXT=
 9832 else
 9833     AC_MSG_RESULT([yes])
 9834     ENABLE_LIBNUMBERTEXT=TRUE
 9835     libo_CHECK_SYSTEM_MODULE([libnumbertext],[LIBNUMBERTEXT],[libnumbertext >= 1.0.0])
 9836     if test "$with_system_libnumbertext" = "yes"; then
 9837         SYSTEM_LIBNUMBERTEXT_DATA=file://`$PKG_CONFIG --variable=pkgdatadir libnumbertext`
 9838         SYSTEM_LIBNUMBERTEXT=YES
 9839     else
 9840         SYSTEM_LIBNUMBERTEXT=
 9841         AC_LANG_PUSH([C++])
 9842         save_CPPFLAGS=$CPPFLAGS
 9843         CPPFLAGS="$CPPFLAGS $CXXFLAGS_CXX11"
 9844         AC_CHECK_HEADERS([codecvt regex])
 9845         AS_IF([test "x$ac_cv_header_codecvt" != xyes -o "x$ac_cv_header_regex" != xyes],
 9846                 [ ENABLE_LIBNUMBERTEXT=''
 9847                   LIBNUMBERTEXT_CFLAGS=''
 9848                   AC_MSG_WARN([No system-provided libnumbertext or codecvt/regex C++11 headers (min. libstdc++ 4.9).
 9849                                Enable libnumbertext fallback (missing number to number name conversion).])
 9850                 ])
 9851         CPPFLAGS=$save_CPPFLAGS
 9852         AC_LANG_POP([C++])
 9853     fi
 9854     if test "$ENABLE_LIBNUMBERTEXT" = TRUE; then
 9855         AC_DEFINE(ENABLE_LIBNUMBERTEXT)
 9856     fi
 9857 fi
 9858 AC_SUBST(SYSTEM_LIBNUMBERTEXT)
 9859 AC_SUBST(SYSTEM_LIBNUMBERTEXT_DATA)
 9860 AC_SUBST(ENABLE_LIBNUMBERTEXT)
 9861 AC_SUBST(LIBNUMBERTEXT_CFLAGS)
 9862 
 9863 dnl ***************************************
 9864 dnl testing libc version for Linux...
 9865 dnl ***************************************
 9866 if test "$_os" = "Linux"; then
 9867     AC_MSG_CHECKING([whether libc is >= 2.1.1])
 9868     exec 6>/dev/null # no output
 9869     AC_CHECK_LIB(c, gnu_get_libc_version, HAVE_LIBC=yes; export HAVE_LIBC)
 9870     exec 6>&1 # output on again
 9871     if test "$HAVE_LIBC"; then
 9872         AC_MSG_RESULT([yes])
 9873     else
 9874         AC_MSG_ERROR([no, upgrade libc])
 9875     fi
 9876 fi
 9877 
 9878 dnl =========================================
 9879 dnl Check for uuidgen
 9880 dnl =========================================
 9881 if test "$_os" = "WINNT" -a "$cross_compiling" != "yes"; then
 9882     # presence is already tested above in the WINDOWS_SDK_HOME check
 9883     UUIDGEN=uuidgen.exe
 9884     AC_SUBST(UUIDGEN)
 9885 else
 9886     AC_PATH_PROG([UUIDGEN], [uuidgen])
 9887     if test -z "$UUIDGEN"; then
 9888         AC_MSG_WARN([uuid is needed for building installation sets])
 9889     fi
 9890 fi
 9891 
 9892 dnl ***************************************
 9893 dnl Checking for bison and flex
 9894 dnl ***************************************
 9895 AC_PATH_PROG(BISON, bison)
 9896 if test -z "$BISON"; then
 9897     AC_MSG_ERROR([no bison found in \$PATH, install it])
 9898 else
 9899     AC_MSG_CHECKING([the bison version])
 9900     _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[[^0-9]]*@@' -e 's@ .*@@' -e 's@,.*@@'`
 9901     _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'`
 9902     # Accept newer than 2.0
 9903     if test "$_bison_longver" -lt 2000; then
 9904         AC_MSG_ERROR([failed ($BISON $_bison_version need 2.0+)])
 9905     fi
 9906 fi
 9907 
 9908 AC_PATH_PROG(FLEX, flex)
 9909 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 9910     FLEX=`cygpath -m $FLEX`
 9911 fi
 9912 if test -z "$FLEX"; then
 9913     AC_MSG_ERROR([no flex found in \$PATH, install it])
 9914 else
 9915     AC_MSG_CHECKING([the flex version])
 9916     _flex_version=$($FLEX --version | $SED -e 's/^.*\([[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\.[[[:digit:]]]\{1,\}\).*$/\1/')
 9917     if test $(echo $_flex_version | $AWK -F. '{printf("%d%03d%03d", $1, $2, $3)}') -lt 2005035; then
 9918         AC_MSG_ERROR([failed ($FLEX $_flex_version found, but need at least 2.5.35)])
 9919     fi
 9920 fi
 9921 AC_SUBST([FLEX])
 9922 dnl ***************************************
 9923 dnl Checking for patch
 9924 dnl ***************************************
 9925 AC_PATH_PROG(PATCH, patch)
 9926 if test -z "$PATCH"; then
 9927     AC_MSG_ERROR(["patch" not found in \$PATH, install it])
 9928 fi
 9929 
 9930 dnl On Solaris, FreeBSD or MacOS X, check if --with-gnu-patch was used
 9931 if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then
 9932     if test -z "$with_gnu_patch"; then
 9933         GNUPATCH=$PATCH
 9934     else
 9935         if test -x "$with_gnu_patch"; then
 9936             GNUPATCH=$with_gnu_patch
 9937         else
 9938             AC_MSG_ERROR([--with-gnu-patch did not point to an executable])
 9939         fi
 9940     fi
 9941 
 9942     AC_MSG_CHECKING([whether $GNUPATCH is GNU patch])
 9943     if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then
 9944         AC_MSG_RESULT([yes])
 9945     else
 9946         AC_MSG_ERROR([no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it])
 9947     fi
 9948 else
 9949     GNUPATCH=$PATCH
 9950 fi
 9951 
 9952 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 9953     GNUPATCH=`cygpath -m $GNUPATCH`
 9954 fi
 9955 
 9956 dnl We also need to check for --with-gnu-cp
 9957 
 9958 if test -z "$with_gnu_cp"; then
 9959     # check the place where the good stuff is hidden on Solaris...
 9960     if test -x /usr/gnu/bin/cp; then
 9961         GNUCP=/usr/gnu/bin/cp
 9962     else
 9963         AC_PATH_PROGS(GNUCP, gnucp cp)
 9964     fi
 9965     if test -z $GNUCP; then
 9966         AC_MSG_ERROR([Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it])
 9967     fi
 9968 else
 9969     if test -x "$with_gnu_cp"; then
 9970         GNUCP=$with_gnu_cp
 9971     else
 9972         AC_MSG_ERROR([--with-gnu-cp did not point to an executable])
 9973     fi
 9974 fi
 9975 
 9976 if test "$GNUMAKE_WIN_NATIVE" = "TRUE" ; then
 9977     GNUCP=`cygpath -m $GNUCP`
 9978 fi
 9979 
 9980 AC_MSG_CHECKING([whether $GNUCP is GNU cp from coreutils with preserve= support])
 9981 if $GNUCP --version 2>/dev/null | grep "coreutils" >/dev/null 2>/dev/null; then
 9982     AC_MSG_RESULT([yes])
 9983 elif $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then
 9984     AC_MSG_RESULT([yes])
 9985 else
 9986     case "$build_os" in
 9987     darwin*|netbsd*|openbsd*|freebsd*|dragonfly*|aix*)
 9988         x_GNUCP=[\#]
 9989         GNUCP=''
 9990         AC_MSG_RESULT([no gnucp found - using the system's cp command])
 9991         ;;
 9992     *)
 9993         AC_MSG_ERROR([no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it])
 9994         ;;
 9995     esac
 9996 fi
 9997 
 9998 AC_SUBST(GNUPATCH)
 9999 AC_SUBST(GNUCP)
10000 AC_SUBST(x_GNUCP)
10001 
10002 dnl ***************************************
10003 dnl testing assembler path
10004 dnl ***************************************
10005 ML_EXE=""
10006 if test "$_os" = "WINNT"; then
10007     if test "$BITNESS_OVERRIDE" = ""; then
10008         assembler=ml.exe
10009         assembler_bin=$CL_DIR
10010     else
10011         assembler=ml64.exe
10012         assembler_bin=$CL_DIR
10013     fi
10014 
10015     AC_MSG_CHECKING([$VC_PRODUCT_DIR/$assembler_bin/$assembler])
10016     if test -f "$VC_PRODUCT_DIR/$assembler_bin/$assembler"; then
10017         ASM_HOME=$VC_PRODUCT_DIR/$assembler_bin
10018         AC_MSG_RESULT([found])
10019         ML_EXE="$VC_PRODUCT_DIR/$assembler_bin/$assembler"
10020     else
10021         AC_MSG_ERROR([Configure did not find $assembler assembler.])
10022     fi
10023 
10024     PathFormat "$ASM_HOME"
10025     ASM_HOME="$formatted_path"
10026 else
10027     ASM_HOME=""
10028 fi
10029 
10030 AC_SUBST(ML_EXE)
10031 
10032 dnl ===================================================================
10033 dnl We need zip and unzip
10034 dnl ===================================================================
10035 AC_PATH_PROG(ZIP, zip)
10036 test -z "$ZIP" && AC_MSG_ERROR([zip is required])
10037 if ! "$ZIP" --filesync < /dev/null 2>/dev/null > /dev/null; then
10038     AC_MSG_ERROR([Zip version 3.0 or newer is required to build, please install it and make sure it is the one found first in PATH],,)
10039 fi
10040 
10041 AC_PATH_PROG(UNZIP, unzip)
10042 test -z "$UNZIP" && AC_MSG_ERROR([unzip is required])
10043 
10044 dnl ===================================================================
10045 dnl Zip must be a specific type for different build types.
10046 dnl ===================================================================
10047 if test $build_os = cygwin; then
10048     if test -n "`$ZIP -h | $GREP -i WinNT`"; then
10049         AC_MSG_ERROR([$ZIP is not the required Cygwin version of Info-ZIP's zip.exe.])
10050     fi
10051 fi
10052 
10053 dnl ===================================================================
10054 dnl We need touch with -h option support.
10055 dnl ===================================================================
10056 AC_PATH_PROG(TOUCH, touch)
10057 test -z "$TOUCH" && AC_MSG_ERROR([touch is required])
10058 touch warn
10059 if ! "$TOUCH" -h warn 2>/dev/null > /dev/null; then
10060     AC_MSG_ERROR([touch version with -h option support is required to build, please install it and make sure it is the one found first in PATH],,)
10061 fi
10062 
10063 dnl ===================================================================
10064 dnl Check for system epoxy
10065 dnl ===================================================================
10066 libo_CHECK_SYSTEM_MODULE([epoxy], [EPOXY], [epoxy >= 1.2], ["-I${WORKDIR}/UnpackedTarball/epoxy/include"])
10067 
10068 dnl ===================================================================
10069 dnl Set vcl option: coordinate device in double or sal_Int32
10070 dnl ===================================================================
10071 
10072 dnl disabled for now, we don't want subtle differences between OSs
10073 dnl AC_MSG_CHECKING([Type to use for Device Pixel coordinates])
10074 dnl if test "$_os" = "Darwin" -o  $_os = iOS ; then
10075 dnl     AC_DEFINE(VCL_FLOAT_DEVICE_PIXEL)
10076 dnl     AC_MSG_RESULT([double])
10077 dnl else
10078 dnl     AC_MSG_RESULT([sal_Int32])
10079 dnl fi
10080 
10081 dnl ===================================================================
10082 dnl Test which vclplugs have to be built.
10083 dnl ===================================================================
10084 R=""
10085 if test "$USING_X11" != TRUE; then
10086     enable_gtk=no
10087     enable_gtk3=no
10088 fi
10089 GTK3_CFLAGS=""
10090 GTK3_LIBS=""
10091 ENABLE_GTK3=""
10092 if test "x$enable_gtk3" = "xyes"; then
10093     if test "$with_system_cairo" = no; then
10094         AC_MSG_ERROR([System cairo required for gtk3 support, do not combine --enable-gtk3 with --without-system-cairo])
10095     fi
10096     : ${with_system_cairo:=yes}
10097     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
10098     if test "x$ENABLE_GTK3" = "xTRUE"; then
10099         R="gtk3"
10100         dnl Avoid installed by unpackaged files for now.
10101         if test -z "$PKGFORMAT"; then
10102             GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
10103         fi
10104     else
10105         AC_MSG_ERROR([gtk3 or dependent libraries of the correct versions, not found])
10106     fi
10107     GTK3_CFLAGS=$(printf '%s' "$GTK3_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10108     FilterLibs "${GTK3_LIBS}"
10109     GTK3_LIBS="${filteredlibs}"
10110 
10111     dnl We require egl only for the gtk3 plugin. Otherwise we use glx.
10112     if test "$with_system_epoxy" != "yes"; then
10113         AC_CHECK_LIB(EGL, eglMakeCurrent, [:], AC_MSG_ERROR([libEGL required.]))
10114         AC_CHECK_HEADER(EGL/eglplatform.h, [],
10115                         [AC_MSG_ERROR(EGL headers not found. install mesa-libEGL-devel)], [])
10116     fi
10117 fi
10118 AC_SUBST(GTK3_LIBS)
10119 AC_SUBST(GTK3_CFLAGS)
10120 AC_SUBST(ENABLE_GTK3)
10121 
10122 ENABLE_GTK=""
10123 if test "x$enable_gtk" = "xyes"; then
10124     if test "$with_system_cairo" = no; then
10125         AC_MSG_ERROR([System cairo required for gtk support, do not use --without-system-cairo or use --disable-gtk])
10126     fi
10127     : ${with_system_cairo:=yes}
10128     ENABLE_GTK="TRUE"
10129     AC_DEFINE(ENABLE_GTK)
10130     R="gtk $R"
10131 fi
10132 AC_SUBST(ENABLE_GTK)
10133 
10134 ENABLE_KDE4=""
10135 if test "x$enable_kde4" = "xyes"; then
10136     ENABLE_KDE4="TRUE"
10137     AC_DEFINE(ENABLE_KDE4)
10138     R="$R kde4"
10139 fi
10140 AC_SUBST(ENABLE_KDE4)
10141 
10142 ENABLE_QT5=""
10143 if test "x$enable_qt5" = "xyes"; then
10144     ENABLE_QT5="TRUE"
10145     AC_DEFINE(ENABLE_QT5)
10146     R="$R qt5"
10147 fi
10148 AC_SUBST(ENABLE_QT5)
10149 
10150 ENABLE_KDE5=""
10151 if test "x$enable_kde5" = "xyes"; then
10152     ENABLE_KDE5="TRUE"
10153     AC_DEFINE(ENABLE_KDE5)
10154     R="$R kde5"
10155 fi
10156 AC_SUBST(ENABLE_KDE5)
10157 
10158 ENABLE_GTK3_KDE5=""
10159 if test "x$enable_gtk3_kde5" = "xyes"; then
10160     ENABLE_GTK3_KDE5="TRUE"
10161     AC_DEFINE(ENABLE_GTK3_KDE5)
10162     R="$R gtk3_kde5"
10163 fi
10164 AC_SUBST(ENABLE_GTK3_KDE5)
10165 
10166 build_vcl_plugins="$R"
10167 if test -z "$build_vcl_plugins"; then
10168     build_vcl_plugins="none"
10169 fi
10170 AC_MSG_NOTICE([VCLplugs to be built: $build_vcl_plugins])
10171 
10172 dnl ===================================================================
10173 dnl check for dbus support
10174 dnl ===================================================================
10175 ENABLE_DBUS=""
10176 DBUS_CFLAGS=""
10177 DBUS_LIBS=""
10178 DBUS_GLIB_CFLAGS=""
10179 DBUS_GLIB_LIBS=""
10180 DBUS_HAVE_GLIB=""
10181 
10182 if test "$enable_dbus" = "no"; then
10183     test_dbus=no
10184 fi
10185 
10186 AC_MSG_CHECKING([whether to enable DBUS support])
10187 if test "$test_dbus" = "yes"; then
10188     ENABLE_DBUS="TRUE"
10189     AC_MSG_RESULT([yes])
10190     PKG_CHECK_MODULES(DBUS, dbus-1 >= 0.60)
10191     AC_DEFINE(ENABLE_DBUS)
10192     DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10193     FilterLibs "${DBUS_LIBS}"
10194     DBUS_LIBS="${filteredlibs}"
10195 
10196     # Glib is needed for BluetoothServer
10197     # Sets also DBUS_GLIB_CFLAGS/DBUS_GLIB_LIBS if successful.
10198     PKG_CHECK_MODULES(DBUS_GLIB,[glib-2.0 >= 2.4],
10199         [
10200             DBUS_HAVE_GLIB="TRUE"
10201             AC_DEFINE(DBUS_HAVE_GLIB,1)
10202         ],
10203         AC_MSG_WARN([[No Glib found, Bluetooth support will be disabled]])
10204     )
10205 else
10206     AC_MSG_RESULT([no])
10207 fi
10208 
10209 AC_SUBST(ENABLE_DBUS)
10210 AC_SUBST(DBUS_CFLAGS)
10211 AC_SUBST(DBUS_LIBS)
10212 AC_SUBST(DBUS_GLIB_CFLAGS)
10213 AC_SUBST(DBUS_GLIB_LIBS)
10214 AC_SUBST(DBUS_HAVE_GLIB)
10215 
10216 AC_MSG_CHECKING([whether to enable Impress remote control])
10217 if test -n "$enable_sdremote" -a "$enable_sdremote" != "no"; then
10218     AC_MSG_RESULT([yes])
10219     ENABLE_SDREMOTE=TRUE
10220     AC_MSG_CHECKING([whether to enable Bluetooth support in Impress remote control])
10221 
10222     # If not explicitly enabled or disabled, default
10223     if test -z "$enable_sdremote_bluetooth"; then
10224         case "$OS" in
10225         LINUX|MACOSX|WNT)
10226             # Default to yes for these
10227             enable_sdremote_bluetooth=yes
10228             ;;
10229         *)
10230             # otherwise no
10231             enable_sdremote_bluetooth=no
10232             ;;
10233         esac
10234     fi
10235     # $enable_sdremote_bluetooth is guaranteed non-empty now
10236 
10237     if test "$enable_sdremote_bluetooth" != "no"; then
10238         if test "$OS" = "LINUX"; then
10239             if test "$ENABLE_DBUS" = "TRUE" -a "$DBUS_HAVE_GLIB" = "TRUE"; then
10240                 AC_MSG_RESULT([yes])
10241                 ENABLE_SDREMOTE_BLUETOOTH=TRUE
10242                 dnl ===================================================================
10243                 dnl Check for system bluez
10244                 dnl ===================================================================
10245                 AC_MSG_CHECKING([which Bluetooth header to use])
10246                 if test "$with_system_bluez" = "yes"; then
10247                     AC_MSG_RESULT([external])
10248                     AC_CHECK_HEADER(bluetooth/bluetooth.h, [],
10249                         [AC_MSG_ERROR(bluetooth.h not found. install bluez)], [])
10250                     SYSTEM_BLUEZ=TRUE
10251                 else
10252                     AC_MSG_RESULT([internal])
10253                     SYSTEM_BLUEZ=
10254                 fi
10255             else
10256                 AC_MSG_RESULT([no, dbus disabled])
10257                 ENABLE_SDREMOTE_BLUETOOTH=
10258                 SYSTEM_BLUEZ=
10259             fi
10260         else
10261             AC_MSG_RESULT([yes])
10262             ENABLE_SDREMOTE_BLUETOOTH=TRUE
10263             SYSTEM_BLUEZ=
10264         fi
10265     else
10266         AC_MSG_RESULT([no])
10267         ENABLE_SDREMOTE_BLUETOOTH=
10268         SYSTEM_BLUEZ=
10269     fi
10270 else
10271     ENABLE_SDREMOTE=
10272     SYSTEM_BLUEZ=
10273     AC_MSG_RESULT([no])
10274 fi
10275 AC_SUBST(ENABLE_SDREMOTE)
10276 AC_SUBST(ENABLE_SDREMOTE_BLUETOOTH)
10277 AC_SUBST(SYSTEM_BLUEZ)
10278 
10279 dnl ===================================================================
10280 dnl Check whether the gtk 2.0 libraries are available.
10281 dnl ===================================================================
10282 
10283 GTK_CFLAGS=""
10284 GTK_LIBS=""
10285 if test  "$test_gtk" = "yes"; then
10286 
10287     if test "$ENABLE_GTK" = "TRUE"; then
10288         PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.18.0 gdk-pixbuf-2.0 >= 2.2 ,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10289         GTK_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10290         FilterLibs "${GTK_LIBS}"
10291         GTK_LIBS="${filteredlibs}"
10292         PKG_CHECK_MODULES(GTHREAD, gthread-2.0,,AC_MSG_ERROR([requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages]))
10293         BUILD_TYPE="$BUILD_TYPE GTK"
10294         GTHREAD_CFLAGS=$(printf '%s' "$GTK_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10295         FilterLibs "${GTHREAD_LIBS}"
10296         GTHREAD_LIBS="${filteredlibs}"
10297 
10298         AC_MSG_CHECKING([whether to enable Gtk print dialog support])
10299         PKG_CHECK_MODULES([GTK_PRINT], [gtk+-unix-print-2.0 >= 2.10.0],
10300                           [ENABLE_GTK_PRINT="TRUE"],
10301                           [ENABLE_GTK_PRINT=""])
10302         GTK_PRINT_CFLAGS=$(printf '%s' "$GTK_PRINT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10303         FilterLibs "${GTK_PRINT_LIBS}"
10304         GTK_PRINT_LIBS="${filteredlibs}"
10305     fi
10306 
10307     if test "$ENABLE_GTK" = "TRUE" || test "$ENABLE_GTK3" = "TRUE"; then
10308         AC_MSG_CHECKING([whether to enable GIO support])
10309         if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then
10310             dnl Need at least 2.26 for the dbus support.
10311             PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.26],
10312                               [ENABLE_GIO="TRUE"], [ENABLE_GIO=""])
10313             if test "$ENABLE_GIO" = "TRUE"; then
10314                 AC_DEFINE(ENABLE_GIO)
10315                 GIO_CFLAGS=$(printf '%s' "$GIO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10316                 FilterLibs "${GIO_LIBS}"
10317                 GIO_LIBS="${filteredlibs}"
10318             fi
10319         else
10320             AC_MSG_RESULT([no])
10321         fi
10322     fi
10323 fi
10324 AC_SUBST(ENABLE_GIO)
10325 AC_SUBST(GIO_CFLAGS)
10326 AC_SUBST(GIO_LIBS)
10327 AC_SUBST(GTK_CFLAGS)
10328 AC_SUBST(GTK_LIBS)
10329 AC_SUBST(GTHREAD_CFLAGS)
10330 AC_SUBST(GTHREAD_LIBS)
10331 AC_SUBST([ENABLE_GTK_PRINT])
10332 AC_SUBST([GTK_PRINT_CFLAGS])
10333 AC_SUBST([GTK_PRINT_LIBS])
10334 
10335 
10336 dnl ===================================================================
10337 
10338 SPLIT_APP_MODULES=""
10339 if test "$enable_split_app_modules" = "yes"; then
10340     SPLIT_APP_MODULES="TRUE"
10341 fi
10342 AC_SUBST(SPLIT_APP_MODULES)
10343 
10344 SPLIT_OPT_FEATURES=""
10345 if test "$enable_split_opt_features" = "yes"; then
10346     SPLIT_OPT_FEATURES="TRUE"
10347 fi
10348 AC_SUBST(SPLIT_OPT_FEATURES)
10349 
10350 if test $_os = Darwin -o $_os = WINNT -o $_os = iOS; then
10351     if test "$enable_cairo_canvas" = yes; then
10352         AC_MSG_ERROR([The cairo canvas should not be used for this platform])
10353     fi
10354     enable_cairo_canvas=no
10355 elif test -z "$enable_cairo_canvas"; then
10356     enable_cairo_canvas=yes
10357 fi
10358 
10359 ENABLE_CAIRO_CANVAS=""
10360 if test "$enable_cairo_canvas" = "yes"; then
10361     test_cairo=yes
10362     ENABLE_CAIRO_CANVAS="TRUE"
10363     AC_DEFINE(ENABLE_CAIRO_CANVAS)
10364 fi
10365 AC_SUBST(ENABLE_CAIRO_CANVAS)
10366 
10367 dnl ===================================================================
10368 dnl Check whether the GStreamer libraries are available.
10369 dnl It's possible to build avmedia with both GStreamer backends!
10370 dnl ===================================================================
10371 
10372 ENABLE_GSTREAMER_1_0=""
10373 
10374 if test "$build_gstreamer_1_0" = "yes"; then
10375 
10376     AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
10377     if test "$enable_avmedia" = yes -a "$enable_gstreamer_1_0" != no; then
10378         ENABLE_GSTREAMER_1_0="TRUE"
10379         AC_MSG_RESULT([yes])
10380         PKG_CHECK_MODULES( [GSTREAMER_1_0], [gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0 gstreamer-video-1.0] )
10381         GSTREAMER_1_0_CFLAGS=$(printf '%s' "$GSTREAMER_1_0_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10382         FilterLibs "${GSTREAMER_1_0_LIBS}"
10383         GSTREAMER_1_0_LIBS="${filteredlibs}"
10384     else
10385         AC_MSG_RESULT([no])
10386     fi
10387 fi
10388 AC_SUBST(GSTREAMER_1_0_CFLAGS)
10389 AC_SUBST(GSTREAMER_1_0_LIBS)
10390 AC_SUBST(ENABLE_GSTREAMER_1_0)
10391 
10392 
10393 ENABLE_GSTREAMER_0_10=""
10394 if test "$build_gstreamer_0_10" = "yes"; then
10395 
10396     AC_MSG_CHECKING([whether to enable the GStreamer 0.10 avmedia backend])
10397     if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
10398         ENABLE_GSTREAMER_0_10="TRUE"
10399         AC_MSG_RESULT([yes])
10400         PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10],, [
10401             PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10] )
10402         ])
10403         GSTREAMER_0_10_CFLAGS=$(printf '%s' "$GSTREAMER_0_10_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10404         FilterLibs "${GSTREAMER_0_10_LIBS}"
10405         GSTREAMER_0_10_LIBS="${filteredlibs}"
10406     else
10407         AC_MSG_RESULT([no])
10408     fi
10409 fi
10410 
10411 AC_SUBST(GSTREAMER_0_10_CFLAGS)
10412 AC_SUBST(GSTREAMER_0_10_LIBS)
10413 AC_SUBST(ENABLE_GSTREAMER_0_10)
10414 
10415 dnl ===================================================================
10416 dnl Check whether to build the VLC avmedia backend
10417 dnl ===================================================================
10418 
10419 ENABLE_VLC=""
10420 
10421 AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
10422 if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
10423     ENABLE_VLC="TRUE"
10424     AC_MSG_RESULT([yes])
10425 else
10426     AC_MSG_RESULT([no])
10427 fi
10428 AC_SUBST(ENABLE_VLC)
10429 
10430 ENABLE_OPENGL_TRANSITIONS=
10431 ENABLE_OPENGL_CANVAS=
10432 if test $_os = iOS -o $_os = Android -o "$ENABLE_FUZZERS" = "TRUE"; then
10433    : # disable
10434 elif test "$_os" = "Darwin"; then
10435     # We use frameworks on Mac OS X, no need for detail checks
10436     ENABLE_OPENGL_TRANSITIONS=TRUE
10437     AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10438     ENABLE_OPENGL_CANVAS=TRUE
10439 elif test $_os = WINNT; then
10440     ENABLE_OPENGL_TRANSITIONS=TRUE
10441     AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10442     ENABLE_OPENGL_CANVAS=TRUE
10443 else
10444     if test "$USING_X11" = TRUE; then
10445         AC_CHECK_LIB(GL, glBegin, [:], AC_MSG_ERROR([libGL required.]))
10446         ENABLE_OPENGL_TRANSITIONS=TRUE
10447         AC_DEFINE(HAVE_FEATURE_OPENGL,1)
10448         ENABLE_OPENGL_CANVAS=TRUE
10449     fi
10450 fi
10451 
10452 AC_SUBST(ENABLE_OPENGL_TRANSITIONS)
10453 AC_SUBST(ENABLE_OPENGL_CANVAS)
10454 
10455 dnl =================================================
10456 dnl Check whether to build with OpenCL support.
10457 dnl =================================================
10458 
10459 if test $_os != iOS -a $_os != Android -a "$ENABLE_FUZZERS" != "TRUE"; then
10460     # OPENCL in BUILD_TYPE and HAVE_FEATURE_OPENCL tell that OpenCL is potentially available on the
10461     # platform (optional at run-time, used through clew).
10462     BUILD_TYPE="$BUILD_TYPE OPENCL"
10463     AC_DEFINE(HAVE_FEATURE_OPENCL)
10464 fi
10465 
10466 dnl =================================================
10467 dnl Check whether to build with dconf support.
10468 dnl =================================================
10469 
10470 if test "$enable_dconf" != no; then
10471     PKG_CHECK_MODULES([DCONF], [dconf >= 0.15.2], [], [
10472         if test "$enable_dconf" = yes; then
10473             AC_MSG_ERROR([dconf not found])
10474         else
10475             enable_dconf=no
10476         fi])
10477 fi
10478 AC_MSG_CHECKING([whether to enable dconf])
10479 if test "$enable_dconf" = no; then
10480     DCONF_CFLAGS=
10481     DCONF_LIBS=
10482     ENABLE_DCONF=
10483     AC_MSG_RESULT([no])
10484 else
10485     ENABLE_DCONF=TRUE
10486     AC_DEFINE(ENABLE_DCONF)
10487     AC_MSG_RESULT([yes])
10488 fi
10489 AC_SUBST([DCONF_CFLAGS])
10490 AC_SUBST([DCONF_LIBS])
10491 AC_SUBST([ENABLE_DCONF])
10492 
10493 # pdf import?
10494 AC_MSG_CHECKING([whether to build the PDF import feature])
10495 ENABLE_PDFIMPORT=
10496 if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_pdfimport" = yes \); then
10497     AC_MSG_RESULT([yes])
10498     ENABLE_PDFIMPORT=TRUE
10499     AC_DEFINE(HAVE_FEATURE_PDFIMPORT)
10500 
10501     dnl ===================================================================
10502     dnl Check for system poppler
10503     dnl ===================================================================
10504     AC_MSG_CHECKING([which PDF import backend to use])
10505     if test "$with_system_poppler" = "yes"; then
10506         AC_MSG_RESULT([external])
10507         SYSTEM_POPPLER=TRUE
10508         PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
10509         AC_LANG_PUSH([C++])
10510         save_CXXFLAGS=$CXXFLAGS
10511         save_CPPFLAGS=$CPPFLAGS
10512         CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
10513         CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
10514         AC_CHECK_HEADER([cpp/poppler-version.h],
10515             [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
10516             [])
10517         CXXFLAGS=$save_CXXFLAGS
10518         CPPFLAGS=$save_CPPFLAGS
10519         AC_LANG_POP([C++])
10520         POPPLER_CFLAGS=$(printf '%s' "$POPPLER_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
10521 
10522         FilterLibs "${POPPLER_LIBS}"
10523         POPPLER_LIBS="${filteredlibs}"
10524     else
10525         AC_MSG_RESULT([internal])
10526         SYSTEM_POPPLER=
10527         BUILD_TYPE="$BUILD_TYPE POPPLER"
10528         AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
10529     fi
10530     AC_DEFINE([ENABLE_PDFIMPORT],1)
10531 else
10532     AC_MSG_RESULT([no])
10533 fi
10534 AC_SUBST(ENABLE_PDFIMPORT)
10535 AC_SUBST(SYSTEM_POPPLER)
10536 AC_SUBST(POPPLER_CFLAGS)
10537 AC_SUBST(POPPLER_LIBS)
10538 
10539 # pdf import?
10540 AC_MSG_CHECKING([whether to build PDFium])
10541 ENABLE_PDFIUM=
10542 if test -z "$enable_pdfium" -o "$enable_pdfium" = yes; then
10543     AC_MSG_RESULT([yes])
10544     ENABLE_PDFIUM=TRUE
10545     AC_DEFINE(HAVE_FEATURE_PDFIUM)
10546     BUILD_TYPE="$BUILD_TYPE PDFIUM"
10547 else
10548     AC_MSG_RESULT([no])
10549 fi
10550 AC_SUBST(ENABLE_PDFIUM)
10551 
10552 SYSTEM_GPGMEPP=
10553 
10554 if test "$build_for_ios" = "YES"; then
10555     AC_MSG_CHECKING([whether gpgmepp should be disabled due to iOS])
10556     AC_MSG_RESULT([yes])
10557 elif test "$enable_mpl_subset" = "yes"; then
10558     AC_MSG_CHECKING([whether gpgmepp should be disabled due to building just MPL])
10559     AC_MSG_RESULT([yes])
10560 elif test "$enable_fuzzers" = "yes"; then
10561     AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
10562     AC_MSG_RESULT([yes])
10563 elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
10564     dnl ===================================================================
10565     dnl Check for system gpgme
10566     dnl ===================================================================
10567     AC_MSG_CHECKING([which gpgmepp to use])
10568     if test "$with_system_gpgmepp" = "yes"; then
10569         AC_MSG_RESULT([external])
10570         SYSTEM_GPGMEPP=TRUE
10571 
10572         # C++ library doesn't come with fancy gpgmepp-config, check for headers the old-fashioned way
10573         AC_CHECK_HEADER(gpgme++/gpgmepp_version.h, [ GPGMEPP_CFLAGS=-I/usr/include/gpgme++ ],
10574             [AC_MSG_ERROR([gpgmepp headers not found, install gpgmepp development package])], [])
10575         # progress_callback is the only func with plain C linkage
10576         # checking for it also filters out older, KDE-dependent libgpgmepp versions
10577         AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
10578             [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
10579         AC_CHECK_HEADER(gpgme.h, [],
10580             [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
10581     else
10582         AC_MSG_RESULT([internal])
10583         BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
10584         AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
10585 
10586         GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
10587         LIBASSUAN_CFLAGS="-I${WORKDIR}/UnpackedTarball/libassuan/src"
10588         if test "$_os" != "WINNT"; then
10589             GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"
10590             LIBASSUAN_LIBS="-L${WORKDIR}/UnpackedTarball/libassuan/src/.libs -lassuan"
10591         elif test "$host_cpu" = "i686" -a "$WINDOWS_SDK_ARCH" = "x64"; then
10592             AC_MSG_ERROR(gpgme cannot be built on cygwin32 for Win64.)
10593         fi
10594     fi
10595     ENABLE_GPGMEPP=TRUE
10596     AC_DEFINE([HAVE_FEATURE_GPGME])
10597     AC_PATH_PROG(GPG, gpg)
10598     # TODO: Windows's cygwin gpg does not seem to work with our gpgme,
10599     # so let's exclude that manually for the moment
10600     if test -n "$GPG" -a "$_os" != "WINNT"; then
10601         # make sure we not only have a working gpgme, but a full working
10602         # gpg installation to run OpenPGP signature verification
10603         AC_DEFINE([HAVE_FEATURE_GPGVERIFY])
10604     fi
10605     if test "$_os" = "Linux"; then
10606       uid=`id -u`
10607       AC_MSG_CHECKING([for /run/user/$uid])
10608       if test -d /run/user/$uid; then
10609         AC_MSG_RESULT([yes])
10610         AC_PATH_PROG(GPGCONF, gpgconf)
10611 
10612         # Older versions of gpgconf are not working as expected, since
10613         # `gpgconf --remove-socketdir` fails to exit any gpg-agent daemon operating
10614         # on that socket dir that has (indirectly) been started by the tests in xmlsecurity/qa/unit/signing/signing.cxx
10615         # (see commit message of f0305ec0a7d199e605511844d9d6af98b66d4bfd%5E )
10616         AC_MSG_CHECKING([whether version of gpgconf is suitable ... ])
10617         GPGCONF_VERSION=`"$GPGCONF" --version | "$AWK" '/^gpgconf \(GnuPG\)/{print $3}'`
10618         GPGCONF_NUMVER=`echo $GPGCONF_VERSION | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'`
10619         if test "$GPGCONF_VERSION" = "2.2_OOo" -o "$GPGCONF_NUMVER" -ge "020200"; then
10620           AC_MSG_RESULT([yes, $GPGCONF_VERSION])
10621           AC_MSG_CHECKING([for gpgconf --create-socketdir... ])
10622           if $GPGCONF --dump-options > /dev/null ; then
10623             if $GPGCONF --dump-options | grep -q create-socketdir ; then
10624               AC_MSG_RESULT([yes])
10625               AC_DEFINE([HAVE_GPGCONF_SOCKETDIR])
10626               AC_DEFINE_UNQUOTED([GPGME_GPGCONF], ["$GPGCONF"])
10627             else
10628               AC_MSG_RESULT([no])
10629             fi
10630           else
10631             AC_MSG_RESULT([no. missing or broken gpgconf?])
10632           fi
10633         else
10634           AC_MSG_RESULT([no, $GPGCONF_VERSION])
10635         fi
10636       else
10637         AC_MSG_RESULT([no])
10638      fi
10639    fi
10640 fi
10641 AC_SUBST(ENABLE_GPGMEPP)
10642 AC_SUBST(SYSTEM_GPGMEPP)
10643 AC_SUBST(GPG_ERROR_CFLAGS)
10644 AC_SUBST(GPG_ERROR_LIBS)
10645 AC_SUBST(LIBASSUAN_CFLAGS)
10646 AC_SUBST(LIBASSUAN_LIBS)
10647 AC_SUBST(GPGMEPP_CFLAGS)
10648 AC_SUBST(GPGMEPP_LIBS)
10649 
10650 AC_MSG_CHECKING([whether to build the Wiki Publisher extension])
10651 if test "x$enable_ext_wiki_publisher" = "xyes" -a "x$enable_extension_integration" != "xno" -a "$with_java" != "no"; then
10652     AC_MSG_RESULT([yes])
10653     ENABLE_MEDIAWIKI=TRUE
10654     BUILD_TYPE="$BUILD_TYPE XSLTML"
10655     if test  "x$with_java" = "xno"; then
10656         AC_MSG_ERROR([Wiki Publisher requires Java! Enable Java if you want to build it.])
10657     fi
10658 else
10659     AC_MSG_RESULT([no])
10660     ENABLE_MEDIAWIKI=
10661     SCPDEFS="$SCPDEFS -DWITHOUT_EXTENSION_MEDIAWIKI"
10662 fi
10663 AC_SUBST(ENABLE_MEDIAWIKI)
10664 
10665 AC_MSG_CHECKING([whether to build the Report Builder])
10666 if test "$enable_report_builder" != "no" -a "$with_java" != "no"; then
10667     AC_MSG_RESULT([yes])
10668     ENABLE_REPORTBUILDER=TRUE
10669     AC_MSG_CHECKING([which jfreereport libs to use])
10670     if test "$with_system_jfreereport" = "yes"; then
10671         SYSTEM_JFREEREPORT=TRUE
10672         AC_MSG_RESULT([external])
10673         if test -z $SAC_JAR; then
10674             SAC_JAR=/usr/share/java/sac.jar
10675         fi
10676         if ! test -f $SAC_JAR; then
10677              AC_MSG_ERROR(sac.jar not found.)
10678         fi
10679 
10680         if test -z $LIBXML_JAR; then
10681             if test -f /usr/share/java/libxml-1.0.0.jar; then
10682                 LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar
10683             elif test -f /usr/share/java/libxml.jar; then
10684                 LIBXML_JAR=/usr/share/java/libxml.jar
10685             else
10686                 AC_MSG_ERROR(libxml.jar replacement not found.)
10687             fi
10688         elif ! test -f $LIBXML_JAR; then
10689             AC_MSG_ERROR(libxml.jar not found.)
10690         fi
10691 
10692         if test -z $FLUTE_JAR; then
10693             if test -f/usr/share/java/flute-1.3.0.jar; then
10694                 FLUTE_JAR=/usr/share/java/flute-1.3.0.jar
10695             elif test -f /usr/share/java/flute.jar; then
10696                 FLUTE_JAR=/usr/share/java/flute.jar
10697             else
10698                 AC_MSG_ERROR(flute-1.3.0.jar replacement not found.)
10699             fi
10700         elif ! test -f $FLUTE_JAR; then
10701             AC_MSG_ERROR(flute-1.3.0.jar not found.)
10702         fi
10703 
10704         if test -z $JFREEREPORT_JAR; then
10705             if test -f /usr/share/java/flow-engine-0.9.2.jar; then
10706                 JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar
10707             elif test -f /usr/share/java/flow-engine.jar; then
10708                 JFREEREPORT_JAR=/usr/share/java/flow-engine.jar
10709             else
10710                 AC_MSG_ERROR(jfreereport.jar replacement not found.)
10711             fi
10712         elif ! test -f  $JFREEREPORT_JAR; then
10713                 AC_MSG_ERROR(jfreereport.jar not found.)
10714         fi
10715 
10716         if test -z $LIBLAYOUT_JAR; then
10717             if test -f /usr/share/java/liblayout-0.2.9.jar; then
10718                 LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar
10719             elif test -f /usr/share/java/liblayout.jar; then
10720                 LIBLAYOUT_JAR=/usr/share/java/liblayout.jar
10721             else
10722                 AC_MSG_ERROR(liblayout.jar replacement not found.)
10723             fi
10724         elif ! test -f $LIBLAYOUT_JAR; then
10725                 AC_MSG_ERROR(liblayout.jar not found.)
10726         fi
10727 
10728         if test -z $LIBLOADER_JAR; then
10729             if test -f /usr/share/java/libloader-1.0.0.jar; then
10730                 LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar
10731             elif test -f /usr/share/java/libloader.jar; then
10732                 LIBLOADER_JAR=/usr/share/java/libloader.jar
10733             else
10734                 AC_MSG_ERROR(libloader.jar replacement not found.)
10735             fi
10736         elif ! test -f  $LIBLOADER_JAR; then
10737             AC_MSG_ERROR(libloader.jar not found.)
10738         fi
10739 
10740         if test -z $LIBFORMULA_JAR; then
10741             if test -f /usr/share/java/libformula-0.2.0.jar; then
10742                 LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar
10743             elif test -f /usr/share/java/libformula.jar; then
10744                 LIBFORMULA_JAR=/usr/share/java/libformula.jar
10745             else
10746                 AC_MSG_ERROR(libformula.jar replacement not found.)
10747             fi
10748         elif ! test -f $LIBFORMULA_JAR; then
10749                 AC_MSG_ERROR(libformula.jar not found.)
10750         fi
10751 
10752         if test -z $LIBREPOSITORY_JAR; then
10753             if test -f /usr/share/java/librepository-1.0.0.jar; then
10754                 LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar
10755             elif test -f /usr/share/java/librepository.jar; then
10756                 LIBREPOSITORY_JAR=/usr/share/java/librepository.jar
10757             else
10758                 AC_MSG_ERROR(librepository.jar replacement not found.)
10759             fi
10760         elif ! test -f $LIBREPOSITORY_JAR; then
10761             AC_MSG_ERROR(librepository.jar not found.)
10762         fi
10763 
10764         if test -z $LIBFONTS_JAR; then
10765             if test -f /usr/share/java/libfonts-1.0.0.jar; then
10766                 LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar
10767             elif test -f /usr/share/java/libfonts.jar; then
10768                 LIBFONTS_JAR=/usr/share/java/libfonts.jar
10769             else
10770                 AC_MSG_ERROR(libfonts.jar replacement not found.)
10771             fi
10772         elif ! test -f $LIBFONTS_JAR; then
10773                 AC_MSG_ERROR(libfonts.jar not found.)
10774         fi
10775 
10776         if test -z $LIBSERIALIZER_JAR; then
10777             if test -f /usr/share/java/libserializer-1.0.0.jar; then
10778                 LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar
10779             elif test -f /usr/share/java/libserializer.jar; then
10780                 LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar
10781             else
10782                 AC_MSG_ERROR(libserializer.jar replacement not found.)
10783             fi
10784         elif ! test -f $LIBSERIALIZER_JAR; then
10785                 AC_MSG_ERROR(libserializer.jar not found.)
10786         fi
10787 
10788         if test -z $LIBBASE_JAR; then
10789             if test -f /usr/share/java/libbase-1.0.0.jar; then
10790                 LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar
10791             elif test -f /usr/share/java/libbase.jar; then
10792                 LIBBASE_JAR=/usr/share/java/libbase.jar
10793             else
10794                 AC_MSG_ERROR(libbase.jar replacement not found.)
10795             fi
10796         elif ! test -f $LIBBASE_JAR; then
10797             AC_MSG_ERROR(libbase.jar not found.)
10798         fi
10799 
10800     else
10801         AC_MSG_RESULT([internal])
10802         SYSTEM_JFREEREPORT=
10803         BUILD_TYPE="$BUILD_TYPE JFREEREPORT"
10804         NEED_ANT=TRUE
10805     fi
10806 else
10807     AC_MSG_RESULT([no])
10808     ENABLE_REPORTBUILDER=
10809     SYSTEM_JFREEREPORT=
10810 fi
10811 AC_SUBST(ENABLE_REPORTBUILDER)
10812 AC_SUBST(SYSTEM_JFREEREPORT)
10813 AC_SUBST(SAC_JAR)
10814 AC_SUBST(LIBXML_JAR)
10815 AC_SUBST(FLUTE_JAR)
10816 AC_SUBST(JFREEREPORT_JAR)
10817 AC_SUBST(LIBBASE_JAR)
10818 AC_SUBST(LIBLAYOUT_JAR)
10819 AC_SUBST(LIBLOADER_JAR)
10820 AC_SUBST(LIBFORMULA_JAR)
10821 AC_SUBST(LIBREPOSITORY_JAR)
10822 AC_SUBST(LIBFONTS_JAR)
10823 AC_SUBST(LIBSERIALIZER_JAR)
10824 
10825 # this has to be here because both the Wiki Publisher and the SRB use
10826 # commons-logging
10827 COMMONS_LOGGING_VERSION=1.2
10828 if test "$ENABLE_REPORTBUILDER" = "TRUE"; then
10829     AC_MSG_CHECKING([which Apache commons-* libs to use])
10830     if test "$with_system_apache_commons" = "yes"; then
10831         SYSTEM_APACHE_COMMONS=TRUE
10832         AC_MSG_RESULT([external])
10833         if test -z $COMMONS_LOGGING_JAR; then
10834             if test -f /usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar; then
10835                COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-${COMMONS_LOGGING_VERSION}.jar
10836            elif test -f /usr/share/java/commons-logging.jar; then
10837                 COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar
10838             else
10839                 AC_MSG_ERROR(commons-logging.jar replacement not found.)
10840             fi
10841         elif ! test -f $COMMONS_LOGGING_JAR; then
10842             AC_MSG_ERROR(commons-logging.jar not found.)
10843         fi
10844     else
10845         AC_MSG_RESULT([internal])
10846         SYSTEM_APACHE_COMMONS=
10847         BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS"
10848         NEED_ANT=TRUE
10849     fi
10850 fi
10851 AC_SUBST(SYSTEM_APACHE_COMMONS)
10852 AC_SUBST(COMMONS_LOGGING_JAR)
10853 AC_SUBST(COMMONS_LOGGING_VERSION)
10854 
10855 # scripting provider for BeanShell?
10856 AC_MSG_CHECKING([whether to build support for scripts in BeanShell])
10857 if test "${enable_scripting_beanshell}" != "no" -a "x$with_java" != "xno"; then
10858     AC_MSG_RESULT([yes])
10859     ENABLE_SCRIPTING_BEANSHELL=TRUE
10860 
10861     dnl ===================================================================
10862     dnl Check for system beanshell
10863     dnl ===================================================================
10864     AC_MSG_CHECKING([which beanshell to use])
10865     if test "$with_system_beanshell" = "yes"; then
10866         AC_MSG_RESULT([external])
10867         SYSTEM_BSH=TRUE
10868         if test -z $BSH_JAR; then
10869             BSH_JAR=/usr/share/java/bsh.jar
10870         fi
10871         if ! test -f $BSH_JAR; then
10872             AC_MSG_ERROR(bsh.jar not found.)
10873         fi
10874     else
10875         AC_MSG_RESULT([internal])
10876         SYSTEM_BSH=
10877         BUILD_TYPE="$BUILD_TYPE BSH"
10878     fi
10879 else
10880     AC_MSG_RESULT([no])
10881     ENABLE_SCRIPTING_BEANSHELL=
10882     SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_BEANSHELL"
10883 fi
10884 AC_SUBST(ENABLE_SCRIPTING_BEANSHELL)
10885 AC_SUBST(SYSTEM_BSH)
10886 AC_SUBST(BSH_JAR)
10887 
10888 # scripting provider for JavaScript?
10889 AC_MSG_CHECKING([whether to build support for scripts in JavaScript])
10890 if test "${enable_scripting_javascript}" != "no" -a "x$with_java" != "xno"; then
10891     AC_MSG_RESULT([yes])
10892     ENABLE_SCRIPTING_JAVASCRIPT=TRUE
10893 
10894     dnl ===================================================================
10895     dnl Check for system rhino
10896     dnl ===================================================================
10897     AC_MSG_CHECKING([which rhino to use])
10898     if test "$with_system_rhino" = "yes"; then
10899         AC_MSG_RESULT([external])
10900         SYSTEM_RHINO=TRUE
10901         if test -z $RHINO_JAR; then
10902             RHINO_JAR=/usr/share/java/js.jar
10903         fi
10904         if ! test -f $RHINO_JAR; then
10905             AC_MSG_ERROR(js.jar not found.)
10906         fi
10907     else
10908         AC_MSG_RESULT([internal])
10909         SYSTEM_RHINO=
10910         BUILD_TYPE="$BUILD_TYPE RHINO"
10911         NEED_ANT=TRUE
10912     fi
10913 else
10914     AC_MSG_RESULT([no])
10915     ENABLE_SCRIPTING_JAVASCRIPT=
10916     SCPDEFS="$SCPDEFS -DWITHOUT_SCRIPTING_JAVASCRIPT"
10917 fi
10918 AC_SUBST(ENABLE_SCRIPTING_JAVASCRIPT)
10919 AC_SUBST(SYSTEM_RHINO)
10920 AC_SUBST(RHINO_JAR)
10921 
10922 # This is only used in KDE3/KDE4 checks to determine if /usr/lib64
10923 # paths should be added to library search path. So lets put all 64-bit
10924 # platforms there.
10925 supports_multilib=
10926 case "$host_cpu" in
10927 x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el)
10928     if test "$SAL_TYPES_SIZEOFLONG" = "8"; then
10929         supports_multilib="yes"
10930     fi
10931     ;;
10932 *)
10933     ;;
10934 esac
10935 
10936 dnl ===================================================================
10937 dnl KDE4 Integration
10938 dnl ===================================================================
10939 
10940 KDE4_CFLAGS=""
10941 KDE4_LIBS=""
10942 QMAKE4="qmake"
10943 MOC4="moc"
10944 KDE4_GLIB_CFLAGS=""
10945 KDE4_GLIB_LIBS=""
10946 KDE4_HAVE_GLIB=""
10947 if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
10948     qt4_incdirs="$QT4INC /usr/include/qt4 /usr/include $x_includes"
10949     qt4_libdirs="$QT4LIB /usr/lib/qt4 /usr/lib $x_libraries"
10950 
10951     kde4_incdirs="/usr/include /usr/include/kde4 $x_includes"
10952     kde4_libdirs="/usr/lib /usr/lib/kde4 /usr/lib/kde4/devel $x_libraries"
10953 
10954     if test -n "$supports_multilib"; then
10955         qt4_libdirs="$qt4_libdirs /usr/lib64/qt4 /usr/lib64/qt /usr/lib64"
10956         kde4_libdirs="$kde4_libdirs /usr/lib64 /usr/lib64/kde4 /usr/lib64/kde4/devel"
10957     fi
10958 
10959     if test -n "$QTDIR"; then
10960         qt4_incdirs="$QTDIR/include $qt4_incdirs"
10961         if test -z "$supports_multilib"; then
10962             qt4_libdirs="$QTDIR/lib $qt4_libdirs"
10963         else
10964             qt4_libdirs="$QTDIR/lib64 $QTDIR/lib $qt4_libdirs"
10965         fi
10966     fi
10967     if test -n "$QT4DIR"; then
10968         qt4_incdirs="$QT4DIR/include $qt4_incdirs"
10969         if test -z "$supports_multilib"; then
10970             qt4_libdirs="$QT4DIR/lib $qt4_libdirs"
10971         else
10972             qt4_libdirs="$QT4DIR/lib64 $QT4DIR/lib $qt4_libdirs"
10973         fi
10974     fi
10975 
10976     if test -n "$KDEDIR"; then
10977         kde4_incdirs="$KDEDIR/include $kde4_incdirs"
10978         if test -z "$supports_multilib"; then
10979             kde4_libdirs="$KDEDIR/lib $kde4_libdirs"
10980         else
10981             kde4_libdirs="$KDEDIR/lib64 $KDEDIR/lib $kde4_libdirs"
10982         fi
10983     fi
10984     if test -n "$KDE4DIR"; then
10985         kde4_incdirs="$KDE4DIR/include $KDE4DIR/include/kde4 $kde4_incdirs"
10986         if test -z "$supports_multilib"; then
10987             kde4_libdirs="$KDE4DIR/lib $kde4_libdirs"
10988         else
10989             kde4_libdirs="$KDE4DIR/lib64 $KDE4DIR/lib $kde4_libdirs"
10990         fi
10991     fi
10992 
10993     qt4_test_include="Qt/qobject.h"
10994     qt4_test_library="libQtNetwork.so"
10995     kde4_test_include="kwindowsystem.h"
10996     kde4_test_library="libsolid.so"
10997 
10998     AC_MSG_CHECKING([for Qt4 headers])
10999     qt4_header_dir="no"
11000     for inc_dir in $qt4_incdirs; do
11001         if test -r "$inc_dir/$qt4_test_include"; then
11002             qt4_header_dir="$inc_dir"
11003             break
11004         fi
11005     done
11006 
11007     AC_MSG_RESULT([$qt4_header_dir])
11008     if test "x$qt4_header_dir" = "xno"; then
11009         AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11010     fi
11011 
11012     dnl Check for qmake
11013     AC_PATH_PROGS( QMAKE4, [qmake-qt4 qmake], no, [`dirname $qt4_header_dir`/bin:$QT4DIR/bin:$PATH] )
11014     if test "$QMAKE4" = "no"; then
11015         AC_MSG_ERROR([Qmake not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11016     else
11017         qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`"
11018         if test -z "$qmake4_test_ver"; then
11019             AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".])
11020         fi
11021     fi
11022 
11023     qt4_libdirs="`$QMAKE4 -query QT_INSTALL_LIBS` $qt4_libdirs"
11024     AC_MSG_CHECKING([for Qt4 libraries])
11025     qt4_lib_dir="no"
11026     for lib_dir in $qt4_libdirs; do
11027         if test -r "$lib_dir/$qt4_test_library"; then
11028             qt4_lib_dir="$lib_dir"
11029             PKG_CONFIG_PATH="$qt4_lib_dir"/pkgconfig:$PKG_CONFIG_PATH
11030             break
11031         fi
11032     done
11033 
11034     AC_MSG_RESULT([$qt4_lib_dir])
11035 
11036     if test "x$qt4_lib_dir" = "xno"; then
11037         AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QT4DIR before running "configure".])
11038     fi
11039 
11040     dnl Check for Meta Object Compiler
11041 
11042     AC_PATH_PROG( MOCQT4, moc-qt4, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11043     MOC4="$MOCQT4"
11044     if test "$MOC4" = "no"; then
11045         AC_PATH_PROG( MOC4, moc, no, [`dirname $qt4_lib_dir`/bin:$QT4DIR/bin:$PATH] )
11046         if test "$MOC4" = "no"; then
11047             AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
11048 the root of your Qt installation by exporting QT4DIR before running "configure".])
11049         fi
11050     fi
11051 
11052     dnl Check for KDE4 headers
11053     AC_MSG_CHECKING([for KDE4 headers])
11054     kde4_incdir="no"
11055     for kde4_check in $kde4_incdirs; do
11056         if test -r "$kde4_check/$kde4_test_include"; then
11057             kde4_incdir="$kde4_check"
11058             break
11059         fi
11060     done
11061     AC_MSG_RESULT([$kde4_incdir])
11062     if test "x$kde4_incdir" = "xno"; then
11063         AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11064     fi
11065     if test "$kde4_incdir" = "/usr/include"; then kde4_incdir=; fi
11066 
11067     dnl Check for KDE4 libraries
11068     AC_MSG_CHECKING([for KDE4 libraries])
11069     kde4_libdir="no"
11070     for kde4_check in $kde4_libdirs; do
11071         if test -r "$kde4_check/$kde4_test_library"; then
11072             kde4_libdir="$kde4_check"
11073             break
11074         fi
11075     done
11076 
11077     AC_MSG_RESULT([$kde4_libdir])
11078     if test "x$kde4_libdir" = "xno"; then
11079         AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDE4DIR before running "configure".])
11080     fi
11081 
11082     PKG_CHECK_MODULES([QT4],[QtNetwork QtGui])
11083     if ! test -z "$kde4_incdir"; then
11084     	KDE4_CFLAGS="-I$kde4_incdir $QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11085     else
11086     	KDE4_CFLAGS="$QT4_CFLAGS -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11087     fi
11088 
11089     KDE4_LIBS="-L$kde4_libdir -lkio -lkfile -lkdeui -lkdecore -L$qt4_lib_dir $QT4_LIBS"
11090     KDE4_CFLAGS=$(printf '%s' "$KDE4_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11091     FilterLibs "$KDE4_LIBS"
11092     KDE4_LIBS="$filteredlibs"
11093 
11094     AC_LANG_PUSH([C++])
11095     save_CXXFLAGS=$CXXFLAGS
11096     CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11097     AC_MSG_CHECKING([whether KDE is >= 4.2])
11098        AC_RUN_IFELSE([AC_LANG_SOURCE([[
11099 #include <kdeversion.h>
11100 
11101 int main(int argc, char **argv) {
11102        if (KDE_VERSION_MAJOR == 4 && KDE_VERSION_MINOR >= 2) return 0;
11103        else return 1;
11104 }
11105 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[AC_MSG_ERROR([KDE support not tested with cross-compilation])])
11106     CXXFLAGS=$save_CXXFLAGS
11107     AC_LANG_POP([C++])
11108 
11109     # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11110     # Sets also KDE4_GLIB_CFLAGS/KDE4_GLIB_LIBS if successful.
11111     PKG_CHECK_MODULES(KDE4_GLIB,[glib-2.0 >= 2.4],
11112         [
11113             KDE4_HAVE_GLIB=TRUE
11114             AC_DEFINE(KDE4_HAVE_GLIB,1)
11115             KDE4_GLIB_CFLAGS=$(printf '%s' "$KDE4_GLIB_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11116             FilterLibs "${KDE4_GLIB_LIBS}"
11117             KDE4_GLIB_LIBS="${filteredlibs}"
11118 
11119             qt4_fix_warning=
11120 
11121             AC_LANG_PUSH([C++])
11122             # tst_exclude_socket_notifiers.moc:70:28: runtime error: member access within address 0x60d00000bb20 which does not point to an object of type 'QObjectData'
11123             # 0x60d00000bb20: note: object is of type 'QObjectPrivate'
11124             #  02 00 80 3a  90 8a 4e d2 3a 00 00 00  f0 b4 b9 a7 ff 7f 00 00  00 00 00 00 00 00 00 00  20 d8 4e d2
11125             #               ^~~~~~~~~~~~~~~~~~~~~~~
11126             #               vptr for 'QObjectPrivate'
11127             # so temporarily ignore here whichever way would be used to make such errors fatal
11128             # (-fno-sanitize-recover=... or UBSAN_OPTIONS halt_on_error=1):
11129             save_CXX=$CXX
11130             CXX=$(printf %s "$CXX" \
11131                 | sed -e 's/-fno-sanitize-recover\(=[[0-9A-Za-z,_-]]*\)*//')
11132             save_UBSAN_OPTIONS=$UBSAN_OPTIONS
11133             UBSAN_OPTIONS=$UBSAN_OPTIONS:halt_on_error=0
11134             save_CXXFLAGS=$CXXFLAGS
11135             CXXFLAGS="$CXXFLAGS $KDE4_CFLAGS"
11136             save_LIBS=$LIBS
11137             LIBS="$LIBS $KDE4_LIBS"
11138             AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
11139 
11140             # Prepare meta object data
11141             TSTBASE="tst_exclude_socket_notifiers"
11142             TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11143             ln -fs "${TSTMOC}.hxx"
11144             $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11145 
11146             AC_RUN_IFELSE([AC_LANG_SOURCE([[
11147 #include <cstdlib>
11148 #include "tst_exclude_socket_notifiers.moc"
11149 
11150 int main(int argc, char *argv[])
11151 {
11152     QCoreApplication app(argc, argv);
11153     exit(tst_processEventsExcludeSocket());
11154     return 0;
11155 }
11156             ]])],[
11157                 AC_MSG_RESULT([yes])
11158             ],[
11159                 AC_MSG_RESULT([no])
11160                 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11161                 if test -z "$qt4_fix_warning"; then
11162                     add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11163                 fi
11164                 qt4_fix_warning=1
11165                 add_warning "  https://bugreports.qt.io/browse/QTBUG-37380 (needed)"
11166                 ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11167 
11168             # Remove meta object data
11169             rm -f "${TSTBASE}."*
11170 
11171             AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
11172 
11173             # Prepare meta object data
11174             TSTBASE="tst_exclude_posted_events"
11175             TSTMOC="${SRC_ROOT}/vcl/unx/kde4/${TSTBASE}"
11176             ln -fs "${TSTMOC}.hxx"
11177             $MOC4 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
11178 
11179             AC_RUN_IFELSE([AC_LANG_SOURCE([[
11180 #include <cstdlib>
11181 #include "tst_exclude_posted_events.moc"
11182 
11183 int main(int argc, char *argv[])
11184 {
11185     QCoreApplication app(argc, argv);
11186     exit(tst_excludePostedEvents());
11187     return 0;
11188 }
11189             ]])],[
11190                 AC_MSG_RESULT([yes])
11191             ],[
11192                 AC_MSG_RESULT([no])
11193                 AC_MSG_WARN([native KDE4 file pickers will be disabled at runtime])
11194                 if test -z "$qt4_fix_warning"; then
11195                     add_warning "native KDE4 file pickers will be disabled at runtime, Qt4 fixes needed"
11196                 fi
11197                 qt4_fix_warning=1
11198                 add_warning "  https://bugreports.qt.io/browse/QTBUG-34614 (needed)"
11199             ],[AC_MSG_ERROR([KDE4 file pickers not tested with cross-compilation])])
11200 
11201             # Remove meta object data
11202             rm -f "${TSTBASE}."*
11203 
11204             if test -n "$qt4_fix_warning"; then
11205                 add_warning "  https://bugreports.qt.io/browse/QTBUG-38585 (recommended)"
11206             fi
11207 
11208             LIBS=$save_LIBS
11209             CXXFLAGS=$save_CXXFLAGS
11210             UBSAN_OPTIONS=$save_UBSAN_OPTIONS
11211             CXX=$save_CXX
11212             AC_LANG_POP([C++])
11213         ],
11214         AC_MSG_WARN([[No Glib found, KDE4 support will not use native file pickers!]]))
11215 fi
11216 AC_SUBST(KDE4_CFLAGS)
11217 AC_SUBST(KDE4_LIBS)
11218 AC_SUBST(MOC4)
11219 AC_SUBST(KDE4_GLIB_CFLAGS)
11220 AC_SUBST(KDE4_GLIB_LIBS)
11221 AC_SUBST(KDE4_HAVE_GLIB)
11222 
11223 dnl ===================================================================
11224 dnl QT5 Integration
11225 dnl ===================================================================
11226 
11227 QT5_CFLAGS=""
11228 QT5_LIBS=""
11229 QMAKE5="qmake"
11230 MOC5="moc"
11231 QT5_GLIB_CFLAGS=""
11232 QT5_GLIB_LIBS=""
11233 QT5_HAVE_GLIB=""
11234 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11235         \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
11236         \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11237 then
11238     qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
11239     qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
11240 
11241     if test -n "$supports_multilib"; then
11242         qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
11243     fi
11244 
11245     qt5_test_include="QtWidgets/qapplication.h"
11246     qt5_test_library="libQt5Widgets.so"
11247 
11248     dnl Check for qmake5
11249     AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
11250     if test "$QMAKE5" = "no"; then
11251         AC_MSG_ERROR([Qmake not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11252     else
11253         qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
11254         if test -z "$qmake5_test_ver"; then
11255             AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11256         fi
11257         qmake5_minor_version="`echo $qmake5_test_ver | cut -d. -f2`"
11258         qt5_minimal_minor="6"
11259         if test "$qmake5_minor_version" -lt "$qt5_minimal_minor"; then
11260             AC_MSG_ERROR([The minimal supported Qt5 version is 5.${qt5_minimal_minor}, but your 'qmake -v' reports Qt5 version $qmake5_test_ver.])
11261         else
11262             AC_MSG_NOTICE([Detected Qt5 version: $qmake5_test_ver])
11263         fi
11264     fi
11265 
11266     qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
11267     qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
11268 
11269     AC_MSG_CHECKING([for Qt5 headers])
11270     qt5_incdir="no"
11271     for inc_dir in $qt5_incdirs; do
11272         if test -r "$inc_dir/$qt5_test_include"; then
11273             qt5_incdir="$inc_dir"
11274             break
11275         fi
11276     done
11277     AC_MSG_RESULT([$qt5_incdir])
11278     if test "x$qt5_incdir" = "xno"; then
11279         AC_MSG_ERROR([Qt5 headers not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11280     fi
11281 
11282     AC_MSG_CHECKING([for Qt5 libraries])
11283     qt5_libdir="no"
11284     for lib_dir in $qt5_libdirs; do
11285         if test -r "$lib_dir/$qt5_test_library"; then
11286             qt5_libdir="$lib_dir"
11287             break
11288         fi
11289     done
11290     AC_MSG_RESULT([$qt5_libdir])
11291     if test "x$qt5_libdir" = "xno"; then
11292         AC_MSG_ERROR([Qt5 libraries not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
11293     fi
11294 
11295     QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
11296     QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11297     QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
11298 
11299     dnl Check for Meta Object Compiler
11300 
11301     AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
11302     if test "$MOC5" = "no"; then
11303         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
11304 the root of your Qt installation by exporting QT5DIR before running "configure".])
11305     fi
11306 
11307     # Glib is needed for properly handling Qt event loop with Qt's Glib integration enabled.
11308     # Sets also QT5_GLIB_CFLAGS/QT5_GLIB_LIBS if successful.
11309     PKG_CHECK_MODULES(QT5_GLIB,[glib-2.0 >= 2.4],
11310         [
11311             QT5_HAVE_GLIB=1
11312             AC_DEFINE(QT5_HAVE_GLIB,1)
11313         ],
11314         AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])
11315     )
11316 fi
11317 AC_SUBST(QT5_CFLAGS)
11318 AC_SUBST(QT5_LIBS)
11319 AC_SUBST(MOC5)
11320 AC_SUBST(QT5_GLIB_CFLAGS)
11321 AC_SUBST(QT5_GLIB_LIBS)
11322 AC_SUBST(QT5_HAVE_GLIB)
11323 
11324 dnl ===================================================================
11325 dnl KDE5 Integration
11326 dnl ===================================================================
11327 
11328 KF5_CFLAGS=""
11329 KF5_LIBS=""
11330 KF5_CONFIG="kf5-config"
11331 if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
11332         \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \
11333         \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
11334 then
11335     if test "$OS" = "HAIKU"; then
11336         haiku_arch="`echo $RTL_ARCH | tr X x`"
11337         kf5_haiku_incdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_HEADERS_DIRECTORY`"
11338         kf5_haiku_libdirs="`findpaths -c ' ' -a $haiku_arch B_FIND_PATH_DEVELOP_LIB_DIRECTORY`"
11339     fi
11340 
11341     kf5_incdirs="$KF5INC /usr/include/ $kf5_haiku_incdirs $x_includes"
11342     kf5_libdirs="$KF5LIB /usr/lib /usr/lib/kf5 /usr/lib/kf5/devel $kf5_haiku_libdirs $x_libraries"
11343     if test -n "$supports_multilib"; then
11344         kf5_libdirs="$kf5_libdirs /usr/lib64 /usr/lib64/kf5 /usr/lib64/kf5/devel"
11345     fi
11346 
11347     kf5_test_include="KF5/kcoreaddons_version.h"
11348     kf5_test_library="libKF5CoreAddons.so"
11349     kf5_libdirs="$qt5_libdir $kf5_libdirs"
11350 
11351     dnl kf5 KDE4 support compatibility installed
11352     AC_PATH_PROG( KF5_CONFIG, $KF5_CONFIG, no, )
11353     if test "$KF5_CONFIG" != "no"; then
11354         kf5_incdirs="`$KF5_CONFIG --path include` $kf5_incdirs"
11355         kf5_libdirs="`$KF5_CONFIG --path lib` $kf5_libdirs"
11356     fi
11357 
11358     dnl Check for KF5 headers
11359     AC_MSG_CHECKING([for KF5 headers])
11360     kf5_incdir="no"
11361     for kf5_check in $kf5_incdirs; do
11362         if test -r "$kf5_check/$kf5_test_include"; then
11363             kf5_incdir="$kf5_check/KF5"
11364             break
11365         fi
11366     done
11367     AC_MSG_RESULT([$kf5_incdir])
11368     if test "x$kf5_incdir" = "xno"; then
11369         AC_MSG_ERROR([KF5 headers not found.  Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11370     fi
11371 
11372     dnl Check for KF5 libraries
11373     AC_MSG_CHECKING([for KF5 libraries])
11374     kf5_libdir="no"
11375     for kf5_check in $kf5_libdirs; do
11376         if test -r "$kf5_check/$kf5_test_library"; then
11377             kf5_libdir="$kf5_check"
11378             break
11379         fi
11380     done
11381 
11382     AC_MSG_RESULT([$kf5_libdir])
11383     if test "x$kf5_libdir" = "xno"; then
11384         AC_MSG_ERROR([KF5 libraries not found.  Please specify the root of your KF5 installation by exporting KF5DIR before running "configure".])
11385     fi
11386 
11387     if test "$USING_X11" = TRUE; then
11388         PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
11389     fi
11390 
11391     KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT $KF5_XCB_CFLAGS"
11392     KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
11393     KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11394 
11395     if test "$USING_X11" = TRUE; then
11396         KF5_LIBS="$KF5_LIBS -lQt5X11Extras"
11397     fi
11398 
11399     AC_LANG_PUSH([C++])
11400     save_CXXFLAGS=$CXXFLAGS
11401     CXXFLAGS="$CXXFLAGS $KF5_CFLAGS"
11402     AC_MSG_CHECKING([whether KDE is >= 5.0])
11403        AC_RUN_IFELSE([AC_LANG_SOURCE([[
11404 #include <kcoreaddons_version.h>
11405 
11406 int main(int argc, char **argv) {
11407        if (KCOREADDONS_VERSION_MAJOR == 5 && KCOREADDONS_VERSION_MINOR >= 0) return 0;
11408        else return 1;
11409 }
11410        ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([KDE version too old])],[])
11411     CXXFLAGS=$save_CXXFLAGS
11412     AC_LANG_POP([C++])
11413 fi
11414 AC_SUBST(KF5_CFLAGS)
11415 AC_SUBST(KF5_LIBS)
11416 
11417 dnl ===================================================================
11418 dnl Test whether to include Evolution 2 support
11419 dnl ===================================================================
11420 AC_MSG_CHECKING([whether to enable evolution 2 support])
11421 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then
11422     AC_MSG_RESULT([yes])
11423     PKG_CHECK_MODULES(GOBJECT, gobject-2.0)
11424     GOBJECT_CFLAGS=$(printf '%s' "$GOBJECT_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11425     FilterLibs "${GOBJECT_LIBS}"
11426     GOBJECT_LIBS="${filteredlibs}"
11427     ENABLE_EVOAB2="TRUE"
11428 else
11429     ENABLE_EVOAB2=""
11430     AC_MSG_RESULT([no])
11431 fi
11432 AC_SUBST(ENABLE_EVOAB2)
11433 AC_SUBST(GOBJECT_CFLAGS)
11434 AC_SUBST(GOBJECT_LIBS)
11435 
11436 dnl ===================================================================
11437 dnl Test which themes to include
11438 dnl ===================================================================
11439 AC_MSG_CHECKING([which themes to include])
11440 # if none given use default subset of available themes
11441 if test "x$with_theme" = "x" -o "x$with_theme" = "xyes"; then
11442     with_theme="breeze breeze_dark breeze_svg colibre colibre_svg elementary elementary_svg karasa_jaga sifr sifr_dark tango"
11443 fi
11444 
11445 WITH_THEMES=""
11446 if test "x$with_theme" != "xno"; then
11447     for theme in $with_theme; do
11448         case $theme in
11449         breeze|breeze_dark|breeze_svg|colibre|colibre_svg|elementary|elementary_svg|karasa_jaga|sifr|sifr_dark|tango) real_theme="$theme" ;;
11450         default) real_theme=colibre ;;
11451         *) AC_MSG_ERROR([Unknown value for --with-theme: $theme]) ;;
11452         esac
11453         WITH_THEMES=`echo "$WITH_THEMES $real_theme"|tr '\ ' '\n'|sort|uniq|tr '\n' '\ '`
11454     done
11455 fi
11456 AC_MSG_RESULT([$WITH_THEMES])
11457 AC_SUBST([WITH_THEMES])
11458 # FIXME: remove this, and the convenience default->colibre remapping after a crace period
11459 for theme in $with_theme; do
11460     case $theme in
11461     default) AC_MSG_WARN([--with-theme=default is deprecated and will be removed, use --with-theme=colibre]) ;;
11462     *) ;;
11463     esac
11464 done
11465 
11466 dnl ===================================================================
11467 dnl Test whether to integrate helppacks into the product's installer
11468 dnl ===================================================================
11469 AC_MSG_CHECKING([for helppack integration])
11470 if test "$with_helppack_integration" = "no"; then
11471     AC_MSG_RESULT([no integration])
11472 else
11473     SCPDEFS="$SCPDEFS -DWITH_HELPPACK_INTEGRATION"
11474     AC_MSG_RESULT([integration])
11475 fi
11476 
11477 ###############################################################################
11478 # Extensions checking
11479 ###############################################################################
11480 AC_MSG_CHECKING([for extensions integration])
11481 if test "x$enable_extension_integration" != "xno"; then
11482     WITH_EXTENSION_INTEGRATION=TRUE
11483     SCPDEFS="$SCPDEFS -DWITH_EXTENSION_INTEGRATION"
11484     AC_MSG_RESULT([yes, use integration])
11485 else
11486     WITH_EXTENSION_INTEGRATION=
11487     AC_MSG_RESULT([no, do not integrate])
11488 fi
11489 AC_SUBST(WITH_EXTENSION_INTEGRATION)
11490 
11491 dnl Should any extra extensions be included?
11492 dnl There are standalone tests for each of these below.
11493 WITH_EXTRA_EXTENSIONS=
11494 AC_SUBST([WITH_EXTRA_EXTENSIONS])
11495 
11496 libo_CHECK_EXTENSION([ConvertTextToNumber],[CT2N],[ct2n],[ct2n],[])
11497 libo_CHECK_EXTENSION([Numbertext],[NUMBERTEXT],[numbertext],[numbertext],[b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt])
11498 if test "x$with_java" != "xno"; then
11499     libo_CHECK_EXTENSION([NLPSolver],[NLPSOLVER],[nlpsolver],[nlpsolver],[])
11500     libo_CHECK_EXTENSION([LanguageTool],[LANGUAGETOOL],[languagetool],[languagetool],[])
11501 fi
11502 
11503 AC_MSG_CHECKING([whether to build opens___.ttf])
11504 if test "$enable_build_opensymbol" = "yes"; then
11505     AC_MSG_RESULT([yes])
11506     AC_PATH_PROG(FONTFORGE, fontforge)
11507     if test -z "$FONTFORGE"; then
11508 	AC_MSG_ERROR([fontforge not installed])
11509     fi
11510 else
11511     AC_MSG_RESULT([no])
11512     OPENSYMBOL_TTF=49a64f3bcf20a7909ba2751349231d6652ded9cd2840e961b5164d09de3ffa63-opens___.ttf
11513     BUILD_TYPE="$BUILD_TYPE OPENSYMBOL"
11514 fi
11515 AC_SUBST(OPENSYMBOL_TTF)
11516 AC_SUBST(FONTFORGE)
11517 
11518 dnl ===================================================================
11519 dnl Test whether to include fonts
11520 dnl ===================================================================
11521 AC_MSG_CHECKING([whether to include third-party fonts])
11522 if test "$with_fonts" != "no"; then
11523     AC_MSG_RESULT([yes])
11524     WITH_FONTS=TRUE
11525     BUILD_TYPE="$BUILD_TYPE MORE_FONTS"
11526     AC_DEFINE(HAVE_MORE_FONTS)
11527 else
11528     AC_MSG_RESULT([no])
11529     WITH_FONTS=
11530     SCPDEFS="$SCPDEFS -DWITHOUT_FONTS"
11531 fi
11532 AC_SUBST(WITH_FONTS)
11533 
11534 
11535 dnl ===================================================================
11536 dnl Test whether to enable online update service
11537 dnl ===================================================================
11538 AC_MSG_CHECKING([whether to enable online update])
11539 ENABLE_ONLINE_UPDATE=
11540 ENABLE_ONLINE_UPDATE_MAR=
11541 UPDATE_CONFIG=
11542 if test "$enable_online_update" = ""; then
11543     if test "$_os" = "WINNT" -o "$_os" = "Darwin"; then
11544         AC_MSG_RESULT([yes])
11545         ENABLE_ONLINE_UPDATE="TRUE"
11546     else
11547         AC_MSG_RESULT([no])
11548     fi
11549 else
11550     if test "$enable_online_update" = "mar"; then
11551         AC_MSG_RESULT([yes - MAR-based online update])
11552         ENABLE_ONLINE_UPDATE_MAR="TRUE"
11553         if test "$with_update_config" = ""; then
11554             AC_MSG_ERROR([mar based online updater needs an update config specified with "with-update-config])
11555         fi
11556         UPDATE_CONFIG="$with_update_config"
11557         AC_DEFINE(HAVE_FEATURE_UPDATE_MAR)
11558     elif test "$enable_online_update" = "yes"; then
11559         AC_MSG_RESULT([yes])
11560         ENABLE_ONLINE_UPDATE="TRUE"
11561     else
11562         AC_MSG_RESULT([no])
11563     fi
11564 fi
11565 AC_SUBST(ENABLE_ONLINE_UPDATE)
11566 AC_SUBST(ENABLE_ONLINE_UPDATE_MAR)
11567 AC_SUBST(UPDATE_CONFIG)
11568 
11569 dnl ===================================================================
11570 dnl Test whether we need bzip2
11571 dnl ===================================================================
11572 SYSTEM_BZIP2=
11573 if test "$ENABLE_ONLINE_UPDATE_MAR" = "TRUE"; then
11574     AC_MSG_CHECKING([whether to use system bzip2])
11575     if test "$with_system_bzip2" = yes; then
11576         SYSTEM_BZIP2=TRUE
11577         AC_MSG_RESULT([yes])
11578         PKG_CHECK_MODULES(BZIP2, bzip2)
11579         FilterLibs "${BZIP2_LIBS}"
11580         BZIP2_LIBS="${filteredlibs}"
11581     else
11582         AC_MSG_RESULT([no])
11583         BUILD_TYPE="$BUILD_TYPE BZIP2"
11584     fi
11585 fi
11586 AC_SUBST(SYSTEM_BZIP2)
11587 AC_SUBST(BZIP2_CFLAGS)
11588 AC_SUBST(BZIP2_LIBS)
11589 
11590 dnl ===================================================================
11591 dnl Test whether to enable extension update
11592 dnl ===================================================================
11593 AC_MSG_CHECKING([whether to enable extension update])
11594 ENABLE_EXTENSION_UPDATE=
11595 if test "x$enable_extension_update" = "xno"; then
11596     AC_MSG_RESULT([no])
11597 else
11598     AC_MSG_RESULT([yes])
11599     ENABLE_EXTENSION_UPDATE="TRUE"
11600     AC_DEFINE(ENABLE_EXTENSION_UPDATE)
11601     SCPDEFS="$SCPDEFS -DENABLE_EXTENSION_UPDATE"
11602 fi
11603 AC_SUBST(ENABLE_EXTENSION_UPDATE)
11604 
11605 
11606 dnl ===================================================================
11607 dnl Test whether to create MSI with LIMITUI=1 (silent install)
11608 dnl ===================================================================
11609 AC_MSG_CHECKING([whether to create MSI with LIMITUI=1 (silent install)])
11610 if test "$enable_silent_msi" = "" -o "$enable_silent_msi" = "no"; then
11611     AC_MSG_RESULT([no])
11612     ENABLE_SILENT_MSI=
11613 else
11614     AC_MSG_RESULT([yes])
11615     ENABLE_SILENT_MSI=TRUE
11616     SCPDEFS="$SCPDEFS -DENABLE_SILENT_MSI"
11617 fi
11618 AC_SUBST(ENABLE_SILENT_MSI)
11619 
11620 AC_MSG_CHECKING([whether and how to use Xinerama])
11621 if test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then
11622     if test "$x_libraries" = "default_x_libraries"; then
11623         XINERAMALIB=`$PKG_CONFIG --variable=libdir xinerama`
11624         if test "x$XINERAMALIB" = x; then
11625            XINERAMALIB="/usr/lib"
11626         fi
11627     else
11628         XINERAMALIB="$x_libraries"
11629     fi
11630     if test -e "$XINERAMALIB/libXinerama.so" -a -e "$XINERAMALIB/libXinerama.a"; then
11631         # we have both versions, let the user decide but use the dynamic one
11632         # per default
11633         USE_XINERAMA=TRUE
11634         if test -z "$with_static_xinerama" -o -n "$with_system_libs"; then
11635             XINERAMA_LINK=dynamic
11636         else
11637             XINERAMA_LINK=static
11638         fi
11639     elif test -e "$XINERAMALIB/libXinerama.so" -a ! -e "$XINERAMALIB/libXinerama.a"; then
11640         # we have only the dynamic version
11641         USE_XINERAMA=TRUE
11642         XINERAMA_LINK=dynamic
11643     elif test -e "$XINERAMALIB/libXinerama.a"; then
11644         # static version
11645         if echo $host_cpu | $GREP -E 'i[[3456]]86' 2>/dev/null >/dev/null; then
11646             USE_XINERAMA=TRUE
11647             XINERAMA_LINK=static
11648         else
11649             USE_XINERAMA=
11650             XINERAMA_LINK=none
11651         fi
11652     else
11653         # no Xinerama
11654         USE_XINERAMA=
11655         XINERAMA_LINK=none
11656     fi
11657     if test "$USE_XINERAMA" = "TRUE"; then
11658         AC_MSG_RESULT([yes, with $XINERAMA_LINK linking])
11659         AC_CHECK_HEADER(X11/extensions/Xinerama.h, [],
11660             [AC_MSG_ERROR(Xinerama header not found.)], [])
11661         XEXTLIBS=`$PKG_CONFIG --variable=libs xext`
11662         if test "x$XEXTLIB" = x; then
11663            XEXTLIBS="-L$XLIB -L$XINERAMALIB -lXext"
11664         fi
11665         XINERAMA_EXTRA_LIBS="$XEXTLIBS"
11666         if test "$_os" = "FreeBSD"; then
11667             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -lXt"
11668         fi
11669         if test "$_os" = "Linux"; then
11670             XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl"
11671         fi
11672         AC_CHECK_LIB([Xinerama], [XineramaIsActive], [:],
11673             [AC_MSG_ERROR(Xinerama not functional?)], [$XINERAMA_EXTRA_LIBS])
11674     else
11675         AC_MSG_RESULT([no, libXinerama not found or wrong architecture.])
11676     fi
11677 else
11678     USE_XINERAMA=
11679     XINERAMA_LINK=none
11680     AC_MSG_RESULT([no])
11681 fi
11682 AC_SUBST(USE_XINERAMA)
11683 AC_SUBST(XINERAMA_LINK)
11684 
11685 dnl ===================================================================
11686 dnl Test whether to build cairo or rely on the system version
11687 dnl ===================================================================
11688 
11689 if test "$USING_X11" = TRUE; then
11690     # Used in vcl/Library_vclplug_gen.mk
11691     test_cairo=yes
11692 fi
11693 
11694 if test "$test_cairo" = "yes"; then
11695     AC_MSG_CHECKING([whether to use the system cairo])
11696 
11697     : ${with_system_cairo:=$with_system_libs}
11698     if test "$with_system_cairo" = "yes"; then
11699         SYSTEM_CAIRO=TRUE
11700         AC_MSG_RESULT([yes])
11701 
11702         PKG_CHECK_MODULES( CAIRO, cairo >= 1.2.0 )
11703         CAIRO_CFLAGS=$(printf '%s' "$CAIRO_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11704         FilterLibs "${CAIRO_LIBS}"
11705         CAIRO_LIBS="${filteredlibs}"
11706 
11707         if test "$test_xrender" = "yes"; then
11708             AC_MSG_CHECKING([whether Xrender.h defines PictStandardA8])
11709             AC_LANG_PUSH([C])
11710             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/Xrender.h>]],[[
11711 #ifdef PictStandardA8
11712 #else
11713       return fail;
11714 #endif
11715 ]])],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, X headers too old.])])
11716 
11717             AC_LANG_POP([C])
11718         fi
11719     else
11720         SYSTEM_CAIRO=
11721         AC_MSG_RESULT([no])
11722 
11723         BUILD_TYPE="$BUILD_TYPE CAIRO"
11724     fi
11725 fi
11726 
11727 AC_SUBST(SYSTEM_CAIRO)
11728 AC_SUBST(CAIRO_CFLAGS)
11729 AC_SUBST(CAIRO_LIBS)
11730 
11731 dnl ===================================================================
11732 dnl Test whether to use avahi
11733 dnl ===================================================================
11734 if test "$_os" = "WINNT"; then
11735     # Windows uses bundled mDNSResponder
11736     BUILD_TYPE="$BUILD_TYPE MDNSRESPONDER"
11737 elif test "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
11738     PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
11739                       [ENABLE_AVAHI="TRUE"])
11740     AC_DEFINE(HAVE_FEATURE_AVAHI)
11741     AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11742     FilterLibs "${AVAHI_LIBS}"
11743     AVAHI_LIBS="${filteredlibs}"
11744 fi
11745 
11746 AC_SUBST(ENABLE_AVAHI)
11747 AC_SUBST(AVAHI_CFLAGS)
11748 AC_SUBST(AVAHI_LIBS)
11749 
11750 dnl ===================================================================
11751 dnl Test whether to use liblangtag
11752 dnl ===================================================================
11753 SYSTEM_LIBLANGTAG=
11754 AC_MSG_CHECKING([whether to use system liblangtag])
11755 if test "$with_system_liblangtag" = yes; then
11756     SYSTEM_LIBLANGTAG=TRUE
11757     AC_MSG_RESULT([yes])
11758     PKG_CHECK_MODULES( LIBLANGTAG, liblangtag >= 0.4.0)
11759     dnl cf. <https://bitbucket.org/tagoh/liblangtag/commits/9324836a0d1c> "Fix a build issue with inline keyword"
11760     PKG_CHECK_EXISTS([liblangtag >= 0.5.5], [], [AC_DEFINE([LIBLANGTAG_INLINE_FIX])])
11761     LIBLANGTAG_CFLAGS=$(printf '%s' "$LIBLANGTAG_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
11762     FilterLibs "${LIBLANGTAG_LIBS}"
11763     LIBLANGTAG_LIBS="${filteredlibs}"
11764 else
11765     SYSTEM_LIBLANGTAG=
11766     AC_MSG_RESULT([no])
11767     BUILD_TYPE="$BUILD_TYPE LIBLANGTAG"
11768     LIBLANGTAG_CFLAGS="-I${WORKDIR}/UnpackedTarball/liblangtag"
11769     if test "$COM" = "MSC"; then
11770         LIBLANGTAG_LIBS="${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs/liblangtag.lib"
11771     else
11772         LIBLANGTAG_LIBS="-L${WORKDIR}/UnpackedTarball/liblangtag/liblangtag/.libs -llangtag"
11773     fi
11774 fi
11775 AC_SUBST(SYSTEM_LIBLANGTAG)
11776 AC_SUBST(LIBLANGTAG_CFLAGS)
11777 AC_SUBST(LIBLANGTAG_LIBS)
11778 
11779 dnl ===================================================================
11780 dnl Test whether to build libpng or rely on the system version
11781 dnl ===================================================================
11782 
11783 libo_CHECK_SYSTEM_MODULE([libpng],[LIBPNG],[libpng],["-I${WORKDIR}/UnpackedTarball/libpng"],["-L${WORKDIR}/LinkTarget/StaticLibrary -llibpng"])
11784 
11785 dnl ===================================================================
11786 dnl Check for runtime JVM search path
11787 dnl ===================================================================
11788 if test "$ENABLE_JAVA" != ""; then
11789     AC_MSG_CHECKING([whether to use specific JVM search path at runtime])
11790     if test -n "$with_jvm_path" -a "$with_jvm_path" != "no"; then
11791         AC_MSG_RESULT([yes])
11792         if ! test -d "$with_jvm_path"; then
11793             AC_MSG_ERROR(["$with_jvm_path" not a directory])
11794         fi
11795         if ! test -d "$with_jvm_path"jvm; then
11796             AC_MSG_ERROR(["$with_jvm_path"jvm not found, point with_jvm_path to \[/path/to/\]jvm])
11797         fi
11798         JVM_ONE_PATH_CHECK="$with_jvm_path"
11799         AC_SUBST(JVM_ONE_PATH_CHECK)
11800     else
11801         AC_MSG_RESULT([no])
11802     fi
11803 fi
11804 
11805 dnl ===================================================================
11806 dnl Test for the presence of Ant and that it works
11807 dnl ===================================================================
11808 
11809 if test "$ENABLE_JAVA" != "" -a "$NEED_ANT" = "TRUE"; then
11810     ANT_HOME=; export ANT_HOME
11811     WITH_ANT_HOME=; export WITH_ANT_HOME
11812     if test -z "$with_ant_home" -a -n "$LODE_HOME" ; then
11813         if test -x "$LODE_HOME/opt/ant/bin/ant" ; then
11814             if test "$_os" = "WINNT"; then
11815                 with_ant_home="`cygpath -m $LODE_HOME/opt/ant`"
11816             else
11817                 with_ant_home="$LODE_HOME/opt/ant"
11818             fi
11819         elif test -x  "$LODE_HOME/opt/bin/ant" ; then
11820             with_ant_home="$LODE_HOME/opt/ant"
11821         fi
11822     fi
11823     if test -z "$with_ant_home"; then
11824         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd])
11825     else
11826         if test "$_os" = "WINNT"; then
11827             # AC_PATH_PROGS needs unix path
11828             with_ant_home=`cygpath -u "$with_ant_home"`
11829         fi
11830         AbsolutePath "$with_ant_home"
11831         with_ant_home=$absolute_path
11832         AC_PATH_PROGS(ANT, [jakarta-ant ant ant.sh ant.bat ant.cmd],,$with_ant_home/bin:$PATH)
11833         WITH_ANT_HOME=$with_ant_home
11834         ANT_HOME=$with_ant_home
11835     fi
11836 
11837     if test -z "$ANT"; then
11838         AC_MSG_ERROR([Ant not found - Make sure it's in the path or use --with-ant-home])
11839     else
11840         # resolve relative or absolute symlink
11841         while test -h "$ANT"; do
11842             a_cwd=`pwd`
11843             a_basename=`basename "$ANT"`
11844             a_script=`ls -l "$ANT" | $SED "s/.*${a_basename} -> //g"`
11845             cd "`dirname "$ANT"`"
11846             cd "`dirname "$a_script"`"
11847             ANT="`pwd`"/"`basename "$a_script"`"
11848             cd "$a_cwd"
11849         done
11850 
11851         AC_MSG_CHECKING([if $ANT works])
11852         mkdir -p conftest.dir
11853         a_cwd=$(pwd)
11854         cd conftest.dir
11855         cat > conftest.java << EOF
11856         public class conftest {
11857             int testmethod(int a, int b) {
11858                     return a + b;
11859             }
11860         }
11861 EOF
11862 
11863         cat > conftest.xml << EOF
11864         <project name="conftest" default="conftest">
11865         <target name="conftest">
11866             <javac srcdir="." includes="conftest.java">
11867             </javac>
11868         </target>
11869         </project>
11870 EOF
11871 
11872         AC_TRY_COMMAND("$ANT" -buildfile conftest.xml 1>&2)
11873         if test $? = 0 -a -f ./conftest.class; then
11874             AC_MSG_RESULT([Ant works])
11875             if test -z "$WITH_ANT_HOME"; then
11876                 ANT_HOME=`"$ANT" -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"`
11877                 if test -z "$ANT_HOME"; then
11878                     ANT_HOME=`echo "$ANT" | $SED -n "s/\/bin\/ant.*\$//p"`
11879                 fi
11880             else
11881                 ANT_HOME="$WITH_ANT_HOME"
11882             fi
11883         else
11884             echo "configure: Ant test failed" >&5
11885             cat conftest.java >&5
11886             cat conftest.xml >&5
11887             AC_MSG_ERROR([Ant does not work - Some Java projects will not build!])
11888         fi
11889         cd "$a_cwd"
11890         rm -fr conftest.dir
11891     fi
11892     if test -z "$ANT_HOME"; then
11893         ANT_HOME="NO_ANT_HOME"
11894     else
11895         PathFormat "$ANT_HOME"
11896         ANT_HOME="$formatted_path"
11897         PathFormat "$ANT"
11898         ANT="$formatted_path"
11899     fi
11900     AC_SUBST(ANT_HOME)
11901     AC_SUBST(ANT)
11902 
11903     dnl Checking for ant.jar
11904     if test "$ANT_HOME" != "NO_ANT_HOME"; then
11905         AC_MSG_CHECKING([Ant lib directory])
11906         if test -f $ANT_HOME/lib/ant.jar; then
11907             ANT_LIB="$ANT_HOME/lib"
11908         else
11909             if test -f $ANT_HOME/ant.jar; then
11910                 ANT_LIB="$ANT_HOME"
11911             else
11912                 if test -f /usr/share/java/ant.jar; then
11913                     ANT_LIB=/usr/share/java
11914                 else
11915                     if test -f /usr/share/ant-core/lib/ant.jar; then
11916                         ANT_LIB=/usr/share/ant-core/lib
11917                     else
11918                         if test -f $ANT_HOME/lib/ant/ant.jar; then
11919                             ANT_LIB="$ANT_HOME/lib/ant"
11920                         else
11921                             if test -f /usr/share/lib/ant/ant.jar; then
11922                                 ANT_LIB=/usr/share/lib/ant
11923                             else
11924                                 AC_MSG_ERROR([Ant libraries not found!])
11925                             fi
11926                         fi
11927                     fi
11928                 fi
11929             fi
11930         fi
11931         PathFormat "$ANT_LIB"
11932         ANT_LIB="$formatted_path"
11933         AC_MSG_RESULT([Ant lib directory found.])
11934     fi
11935     AC_SUBST(ANT_LIB)
11936 
11937     ant_minver=1.6.0
11938     ant_minminor1=`echo $ant_minver | cut -d"." -f2`
11939 
11940     AC_MSG_CHECKING([whether Ant is >= $ant_minver])
11941     ant_version=`"$ANT" -version | $AWK '{ print $4; }'`
11942     ant_version_major=`echo $ant_version | cut -d. -f1`
11943     ant_version_minor=`echo $ant_version | cut -d. -f2`
11944     echo "configure: ant_version $ant_version " >&5
11945     echo "configure: ant_version_major $ant_version_major " >&5
11946     echo "configure: ant_version_minor $ant_version_minor " >&5
11947     if test "$ant_version_major" -ge "2"; then
11948         AC_MSG_RESULT([yes, $ant_version])
11949     elif test "$ant_version_major" = "1" -a "$ant_version_minor" -ge "$ant_minminor1"; then
11950         AC_MSG_RESULT([yes, $ant_version])
11951     else
11952         AC_MSG_ERROR([no, you need at least Ant >= $ant_minver])
11953     fi
11954 
11955     rm -f conftest* core core.* *.core
11956 fi
11957 
11958 OOO_JUNIT_JAR=
11959 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11960     AC_MSG_CHECKING([for JUnit 4])
11961     if test "$with_junit" = "yes"; then
11962         if test -n "$LODE_HOME" -a -e "$LODE_HOME/opt/share/java/junit.jar" ; then
11963             OOO_JUNIT_JAR="$LODE_HOME/opt/share/java/junit.jar"
11964         elif test -e /usr/share/java/junit4.jar; then
11965             OOO_JUNIT_JAR=/usr/share/java/junit4.jar
11966         else
11967            if test -e /usr/share/lib/java/junit.jar; then
11968               OOO_JUNIT_JAR=/usr/share/lib/java/junit.jar
11969            else
11970               OOO_JUNIT_JAR=/usr/share/java/junit.jar
11971            fi
11972         fi
11973     else
11974         OOO_JUNIT_JAR=$with_junit
11975     fi
11976     if test "$_os" = "WINNT"; then
11977         OOO_JUNIT_JAR=`cygpath -m "$OOO_JUNIT_JAR"`
11978     fi
11979     printf 'import org.junit.Before;' > conftest.java
11980     if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11981         AC_MSG_RESULT([$OOO_JUNIT_JAR])
11982     else
11983         AC_MSG_ERROR(
11984 [cannot find JUnit 4 jar; please install one in the default location (/usr/share/java),
11985  specify its pathname via --with-junit=..., or disable it via --without-junit])
11986     fi
11987     rm -f conftest.class conftest.java
11988     if test $OOO_JUNIT_JAR != ""; then
11989     BUILD_TYPE="$BUILD_TYPE QADEVOOO"
11990     fi
11991 fi
11992 AC_SUBST(OOO_JUNIT_JAR)
11993 
11994 HAMCREST_JAR=
11995 if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no"; then
11996     AC_MSG_CHECKING([for included Hamcrest])
11997     printf 'import org.hamcrest.BaseDescription;' > conftest.java
11998     if "$JAVACOMPILER" -classpath "$OOO_JUNIT_JAR" conftest.java >&5 2>&5; then
11999         AC_MSG_RESULT([Included in $OOO_JUNIT_JAR])
12000     else
12001         AC_MSG_RESULT([Not included])
12002         AC_MSG_CHECKING([for standalone hamcrest jar.])
12003         if test "$with_hamcrest" = "yes"; then
12004             if test -e /usr/share/lib/java/hamcrest.jar; then
12005                 HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
12006             elif test -e /usr/share/java/hamcrest/core.jar; then
12007                 HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
12008             else
12009                 HAMCREST_JAR=/usr/share/java/hamcrest.jar
12010             fi
12011         else
12012             HAMCREST_JAR=$with_hamcrest
12013         fi
12014         if test "$_os" = "WINNT"; then
12015             HAMCREST_JAR=`cygpath -m "$HAMCREST_JAR"`
12016         fi
12017         if "$JAVACOMPILER" -classpath "$HAMCREST_JAR" conftest.java >&5 2>&5; then
12018             AC_MSG_RESULT([$HAMCREST_JAR])
12019         else
12020             AC_MSG_ERROR([junit does not contain hamcrest; please use a junit jar that includes hamcrest, install a hamcrest jar in the default location (/usr/share/java),
12021                           specify its path with --with-hamcrest=..., or disable junit with --without-junit])
12022         fi
12023     fi
12024     rm -f conftest.class conftest.java
12025 fi
12026 AC_SUBST(HAMCREST_JAR)
12027 
12028 
12029 AC_SUBST(SCPDEFS)
12030 
12031 #
12032 # check for wget and curl
12033 #
12034 WGET=
12035 CURL=
12036 
12037 if test "$enable_fetch_external" != "no"; then
12038 
12039 CURL=`which curl 2>/dev/null`
12040 
12041 for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/wget /opt/local/bin/wget; do
12042     # wget new enough?
12043     $i --help 2> /dev/null | $GREP no-use-server-timestamps 2>&1 > /dev/null
12044     if test $? -eq 0; then
12045         WGET=$i
12046         break
12047     fi
12048 done
12049 
12050 if test -z "$WGET" -a -z "$CURL"; then
12051     AC_MSG_ERROR([neither wget nor curl found!])
12052 fi
12053 
12054 fi
12055 
12056 AC_SUBST(WGET)
12057 AC_SUBST(CURL)
12058 
12059 #
12060 # check for sha256sum
12061 #
12062 SHA256SUM=
12063 
12064 for i in shasum /usr/local/bin/shasum /usr/sfw/bin/shasum /opt/sfw/bin/shasum /opt/local/bin/shasum; do
12065     eval "$i -a 256 --version" > /dev/null 2>&1
12066     ret=$?
12067     if test $ret -eq 0; then
12068         SHA256SUM="$i -a 256"
12069         break
12070     fi
12071 done
12072 
12073 if test -z "$SHA256SUM"; then
12074     for i in sha256sum /usr/local/bin/sha256sum /usr/sfw/bin/sha256sum /opt/sfw/bin/sha256sum /opt/local/bin/sha256sum; do
12075         eval "$i --version" > /dev/null 2>&1
12076         ret=$?
12077         if test $ret -eq 0; then
12078             SHA256SUM=$i
12079             break
12080         fi
12081     done
12082 fi
12083 
12084 if test -z "$SHA256SUM"; then
12085     AC_MSG_ERROR([no sha256sum found!])
12086 fi
12087 
12088 AC_SUBST(SHA256SUM)
12089 
12090 dnl ===================================================================
12091 dnl Dealing with l10n options
12092 dnl ===================================================================
12093 AC_MSG_CHECKING([which languages to be built])
12094 # get list of all languages
12095 # generate shell variable from completelangiso= from solenv/inc/langlist.mk
12096 # the sed command does the following:
12097 #   + if a line ends with a backslash, append the next line to it
12098 #   + adds " on the beginning of the value (after =)
12099 #   + adds " at the end of the value
12100 #   + removes en-US; we want to put it on the beginning
12101 #   + prints just the section starting with 'completelangiso=' and ending with the " at the end of line
12102 [eval $(sed -e :a -e '/\\$/N; s/\\\n//; ta' -n -e 's/=/="/;s/\([^\\]\)$/\1"/;s/en-US//;/^completelangiso/p' $SRC_ROOT/solenv/inc/langlist.mk)]
12103 ALL_LANGS="en-US $completelangiso"
12104 # check the configured localizations
12105 WITH_LANG="$with_lang"
12106 
12107 # Check for --without-lang which turns up as $with_lang being "no". Luckily there is no language with code "no".
12108 # (Norwegian is "nb" and "nn".)
12109 if test "$WITH_LANG" = "no"; then
12110     WITH_LANG=
12111 fi
12112 
12113 if test -z "$WITH_LANG" -o "$WITH_LANG" = "en-US"; then
12114     AC_MSG_RESULT([en-US])
12115 else
12116     AC_MSG_RESULT([$WITH_LANG])
12117     GIT_NEEDED_SUBMODULES="translations $GIT_NEEDED_SUBMODULES"
12118     if test -z "$MSGFMT"; then
12119         if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msgfmt" ; then
12120             MSGFMT="$LODE_HOME/opt/bin/msgfmt"
12121         elif test -x "/opt/lo/bin/msgfmt"; then
12122             MSGFMT="/opt/lo/bin/msgfmt"
12123         else
12124             AC_CHECK_PROGS(MSGFMT, [msgfmt])
12125             if test -z "$MSGFMT"; then
12126                 AC_MSG_ERROR([msgfmt not found. Install GNU gettext, or re-run without languages.])
12127             fi
12128         fi
12129     fi
12130     if test -z "$MSGUNIQ"; then
12131         if test -n "$LODE_HOME" -a -x "$LODE_HOME/opt/bin/msguniq" ; then
12132             MSGUNIQ="$LODE_HOME/opt/bin/msguniq"
12133         elif test -x "/opt/lo/bin/msguniq"; then
12134             MSGUNIQ="/opt/lo/bin/msguniq"
12135         else
12136             AC_CHECK_PROGS(MSGUNIQ, [msguniq])
12137             if test -z "$MSGUNIQ"; then
12138                 AC_MSG_ERROR([msguniq not found. Install GNU gettext, or re-run without languages.])
12139             fi
12140         fi
12141     fi
12142 fi
12143 AC_SUBST(MSGFMT)
12144 AC_SUBST(MSGUNIQ)
12145 # check that the list is valid
12146 for lang in $WITH_LANG; do
12147     test "$lang" = "ALL" && continue
12148     # need to check for the exact string, so add space before and after the list of all languages
12149     for vl in $ALL_LANGS; do
12150         if test "$vl" = "$lang"; then
12151            break
12152         fi
12153     done
12154     if test "$vl" != "$lang"; then
12155         # if you're reading this - you prolly quoted your languages remove the quotes ...
12156         AC_MSG_ERROR([invalid language: '$lang' (vs '$v1'); supported languages are: $ALL_LANGS])
12157     fi
12158 done
12159 if test -n "$WITH_LANG" -a "$WITH_LANG" != "ALL"; then
12160     echo $WITH_LANG | grep -q en-US
12161     test $? -ne 1 || WITH_LANG=`echo $WITH_LANG en-US`
12162 fi
12163 # list with substituted ALL
12164 WITH_LANG_LIST=`echo $WITH_LANG | sed "s/ALL/$ALL_LANGS/"`
12165 test -z "$WITH_LANG_LIST" && WITH_LANG_LIST="en-US"
12166 test "$WITH_LANG" = "en-US" && WITH_LANG=
12167 if test "$enable_release_build" = "" -o "$enable_release_build" = "no"; then
12168     test "$WITH_LANG_LIST" = "en-US" || WITH_LANG_LIST=`echo $WITH_LANG_LIST qtz`
12169     ALL_LANGS=`echo $ALL_LANGS qtz`
12170 fi
12171 AC_SUBST(ALL_LANGS)
12172 AC_DEFINE_UNQUOTED(WITH_LANG,"$WITH_LANG")
12173 AC_SUBST(WITH_LANG)
12174 AC_SUBST(WITH_LANG_LIST)
12175 AC_SUBST(GIT_NEEDED_SUBMODULES)
12176 
12177 WITH_POOR_HELP_LOCALIZATIONS=
12178 if test -d "$SRC_ROOT/translations/source"; then
12179     for l in `ls -1 $SRC_ROOT/translations/source`; do
12180         if test ! -d "$SRC_ROOT/translations/source/$l/helpcontent2"; then
12181             WITH_POOR_HELP_LOCALIZATIONS="$WITH_POOR_HELP_LOCALIZATIONS $l"
12182         fi
12183     done
12184 fi
12185 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
12186 
12187 if test -n "$with_locales"; then
12188     WITH_LOCALES="$with_locales"
12189 
12190     just_langs="`echo $WITH_LOCALES | sed -e 's/_[A-Z]*//g'`"
12191     # Only languages and scripts for which we actually have ifdefs need to be handled. Also see
12192     # config_host/config_locales.h.in
12193     for locale in $WITH_LOCALES; do
12194         lang=${locale%_*}
12195 
12196         AC_DEFINE_UNQUOTED(WITH_LOCALE_$lang, 1)
12197 
12198         case $lang in
12199         hi|mr*ne)
12200             AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Deva)
12201             ;;
12202         bg|ru)
12203             AC_DEFINE(WITH_LOCALE_FOR_SCRIPT_Cyrl)
12204             ;;
12205         esac
12206     done
12207 else
12208     AC_DEFINE(WITH_LOCALE_ALL)
12209 fi
12210 AC_SUBST(WITH_LOCALES)
12211 
12212 dnl git submodule update --reference
12213 dnl ===================================================================
12214 if test -n "${GIT_REFERENCE_SRC}"; then
12215     for repo in ${GIT_NEEDED_SUBMODULES}; do
12216         if ! test -d "${GIT_REFERENCE_SRC}"/${repo}; then
12217             AC_MSG_ERROR([referenced git: required repository does not exist: ${GIT_REFERENCE_SRC}/${repo}])
12218         fi
12219     done
12220 fi
12221 AC_SUBST(GIT_REFERENCE_SRC)
12222 
12223 dnl git submodules linked dirs
12224 dnl ===================================================================
12225 if test -n "${GIT_LINK_SRC}"; then
12226     for repo in ${GIT_NEEDED_SUBMODULES}; do
12227         if ! test -d "${GIT_LINK_SRC}"/${repo}; then
12228             AC_MSG_ERROR([linked git: required repository does not exist: ${GIT_LINK_SRC}/${repo}])
12229         fi
12230     done
12231 fi
12232 AC_SUBST(GIT_LINK_SRC)
12233 
12234 dnl branding
12235 dnl ===================================================================
12236 AC_MSG_CHECKING([for alternative branding images directory])
12237 # initialize mapped arrays
12238 BRAND_INTRO_IMAGES="flat_logo.svg intro.png intro-highres.png"
12239 brand_files="$BRAND_INTRO_IMAGES about.svg"
12240 
12241 if test -z "$with_branding" -o "$with_branding" = "no"; then
12242     AC_MSG_RESULT([none])
12243     DEFAULT_BRAND_IMAGES="$brand_files"
12244 else
12245     if ! test -d $with_branding ; then
12246         AC_MSG_ERROR([No directory $with_branding, falling back to default branding])
12247     else
12248         AC_MSG_RESULT([$with_branding])
12249         CUSTOM_BRAND_DIR="$with_branding"
12250         for lfile in $brand_files
12251         do
12252             if ! test -f $with_branding/$lfile ; then
12253                 AC_MSG_WARN([Branded file $lfile does not exist, using the default one])
12254                 DEFAULT_BRAND_IMAGES="$DEFAULT_BRAND_IMAGES $lfile"
12255             else
12256                 CUSTOM_BRAND_IMAGES="$CUSTOM_BRAND_IMAGES $lfile"
12257             fi
12258         done
12259         check_for_progress="yes"
12260     fi
12261 fi
12262 AC_SUBST([BRAND_INTRO_IMAGES])
12263 AC_SUBST([CUSTOM_BRAND_DIR])
12264 AC_SUBST([CUSTOM_BRAND_IMAGES])
12265 AC_SUBST([DEFAULT_BRAND_IMAGES])
12266 
12267 
12268 AC_MSG_CHECKING([for 'intro' progress settings])
12269 PROGRESSBARCOLOR=
12270 PROGRESSSIZE=
12271 PROGRESSPOSITION=
12272 PROGRESSFRAMECOLOR=
12273 PROGRESSTEXTCOLOR=
12274 PROGRESSTEXTBASELINE=
12275 
12276 if test "$check_for_progress" = "yes" -a -f "$with_branding/progress.conf" ; then
<