"Fossies" - the Fresh Open Source Software Archive

Member "filezilla-3.48.1/configure.ac" (18 May 2020, 25134 Bytes) of package /linux/misc/FileZilla_3.48.1_src.tar.bz2:


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": 3.48.0_vs_3.48.1.

    1 AC_INIT([FileZilla],[3.48.1],[tim.kosse@filezilla-project.org],[],[https://filezilla-project.org/])
    2 AC_CONFIG_HEADERS([src/include/config.h])
    3 AC_CONFIG_MACRO_DIR([m4])
    4 AC_CONFIG_AUX_DIR(config)
    5 AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
    6 
    7 AC_CANONICAL_HOST
    8 
    9 AC_PROG_CXX
   10 AC_PROG_OBJCXX
   11 AM_PROG_CC_C_O
   12 AC_PROG_INSTALL
   13 
   14 LT_INIT
   15 LT_LANG([C++])
   16 
   17 AC_CACHE_SAVE
   18 
   19 AC_ARG_ENABLE(locales, AS_HELP_STRING([--enable-locales],[Build message catalogs]), \
   20         [locales="$enableval"], [locales="yes"])
   21 
   22 # Todo: Investigate using sub-configure scripts
   23 AC_ARG_ENABLE(localesonly, AS_HELP_STRING([--enable-localesonly],[Just build locales]), \
   24         [localesonly="$enableval"], [localesonly="no"])
   25 
   26 if test "$locales" != "yes" -a "$localesonly" = "yes"; then
   27   AC_MSG_ERROR([invalid flags: --disable-locales cannot be used together with --enable-localesonly])
   28 fi
   29 
   30 if test "$localesonly" = "yes"; then
   31   buildmain="no"
   32 else
   33   buildmain="yes"
   34 fi
   35 
   36 if ! test "$localesonly" = "yes"; then
   37 
   38   if test "X$GCC" = Xyes; then
   39     AX_APPEND_FLAG(-Wall, CFLAGS)
   40     AX_APPEND_FLAG(-g, CFLAGS)
   41     AX_APPEND_FLAG(-Wall, CXXFLAGS)
   42     AX_APPEND_FLAG(-g, CXXFLAGS)
   43   fi
   44 
   45   # Do this early: Compiler and linker flags to work around a nasty bug in Xcode.
   46   AX_CHECK_COMPILE_FLAG([-Werror=partial-availability], [
   47     # This warning should be on by default yet it's not even enabled by -Wall. Apple screwed up big time.
   48     AX_APPEND_FLAG(-Werror=partial-availability, CFLAGS)
   49     AX_APPEND_FLAG(-Werror=partial-availability, CXXFLAGS)
   50   ])
   51 
   52   AX_CHECK_LINK_FLAG([-Wl,-no_weak_imports], [
   53     # If the programmer wants weak symbols he would just used dlopen/dlsym
   54     # But not so on Apple systems where even basic functions like clock_gettime can
   55     # be randomly missing at runtime.
   56     AX_APPEND_FLAG([-Wl,-no_weak_imports], LFDLAGS)
   57   ])
   58 
   59   # Check for C++17 support
   60   AX_CXX_COMPILE_STDCXX_17([noext],[mandatory])
   61   CHECK_LIBCXX
   62 
   63   # libstdc++ as shipped with GCC 4.7 lacks std::map::emplace
   64   FZ_CHECK_MAP_EMPLACE
   65 
   66   # libstdc++ as shipped with GCC 4.7 has a steady clock that isn't steady (who implements such crap?)
   67   CHECK_STEADY_CLOCK
   68 
   69   # No thread_local in GCC 4.7 and it for some reason isn't supported on OS X either
   70   CHECK_THREAD_LOCAL
   71 
   72   # std::atomic on PPC seems to require -latomic
   73   CHECK_ATOMIC
   74 
   75   # Add build information to config.h
   76   # ---------------------------------
   77 
   78   # Add host to config.h
   79   AC_DEFINE_UNQUOTED(USED_HOST, ["$host"], [Host system under which the program will run.])
   80   AC_DEFINE_UNQUOTED(USED_BUILD, ["$build"], [Build system under which the program was compiled on.])
   81 
   82   # Add used CXXFLAGS to config.h
   83   AC_DEFINE_UNQUOTED(USED_CXXFLAGS, ["$CXXFLAGS"], [Define to the used CXXFLAGS to compile this package.])
   84 
   85   # Get compiler (version)
   86   AH_TEMPLATE(USED_COMPILER, [Define to name and version of used compiler])
   87   if COMPILER=`$CC --version | head -n 1`; then
   88     AC_DEFINE_UNQUOTED(USED_COMPILER, ["$COMPILER"])
   89   fi
   90 
   91   # Get buildtype.
   92   AC_ARG_ENABLE(buildtype, AS_HELP_STRING([--enable-buildtype=TYPE],[DO NOT USE. Reserved for use by official maintainer. TYPE can either be 'official' or 'nightly'.]),
   93     [buildtype="$enableval"], [buildtype=])
   94   buildtype_valid=false
   95   if test -z "$buildtype"; then
   96     buildtype_valid=true
   97   elif test "$buildtype" = "official"; then
   98     buildtype_valid=true
   99   elif test "$buildtype" = "nightly"; then
  100     buildtype_valid=true
  101   fi
  102 
  103   if test "$buildtype_valid" != "true"; then
  104     AC_MSG_ERROR([invalid buildtype passed])
  105   fi
  106 
  107   if ! test -z "$buildtype"; then
  108     AC_DEFINE_UNQUOTED(BUILDTYPE, ["$buildtype"], [Buildtype, indicates official builds and nightly builds])
  109   fi
  110 fi
  111 
  112 # Shell extension
  113 # ---------------
  114 
  115 AC_MSG_NOTICE([Running sub-configure for shell extension])
  116 if false; then
  117   # For autoreconf machinery
  118   AC_CONFIG_SUBDIRS([src/fzshellext])
  119 fi
  120 
  121 OLD_DIR="`pwd`"
  122 mkdir -p "$OLD_DIR/src/fzshellext/32"
  123 mkdir -p "$OLD_DIR/src/fzshellext/64"
  124 
  125 AC_ARG_ENABLE(shellext, [], \
  126         [shellext="$enableval"], [shellext="yes"])
  127 
  128 if test "$localesonly" != "yes" && echo $host_os | grep "cygwin\|mingw" > /dev/null 2>&1 && test "$shellext" = "yes"; then
  129   cd "$OLD_DIR/src/fzshellext/32" || exit 1
  130   "$ac_abs_confdir/src/fzshellext/configure" --prefix="$prefix" --exec-prefix="$exec_prefix" --host=i686-w64-mingw32 || exit 1
  131   cd "$OLD_DIR/src/fzshellext/64" || exit 1
  132   "$ac_abs_confdir/src/fzshellext/configure" --prefix="$prefix" --exec-prefix="$exec_prefix" --host=x86_64-w64-mingw32 || exit 1
  133 else
  134   cd "$OLD_DIR/src/fzshellext/64" || exit 1
  135   "$ac_abs_confdir/src/fzshellext/configure" --disable-shellext || exit 1
  136 fi
  137 cd "$OLD_DIR"
  138 
  139 
  140 
  141 if test "$buildmain" = "yes"; then
  142 
  143   # Require pkg-config
  144   # ------------------
  145   PKG_PROG_PKG_CONFIG
  146   if test -z "$PKG_CONFIG"; then
  147     AC_MSG_ERROR([pkg-config not found. pkg-config is required to check for some dependencies.])
  148   fi
  149 
  150   # Find libfilezilla
  151   # -----------------
  152   PKG_CHECK_MODULES(LIBFILEZILLA, [libfilezilla >= 0.22.0],, [
  153 	AC_MSG_ERROR([libfilezilla not found: $LIBFILEZILLA_PKG_ERRORS. You can download it from https://lib.filezilla-project.org/])
  154   ])
  155   AC_SUBST(LIBFILEZILLA_CFLAGS)
  156   AC_SUBST(LIBFILEZILLA_LIBS)
  157 
  158   # Detect wxWidgets
  159   # ----------------
  160 
  161   AM_OPTIONS_WXCONFIG
  162 
  163   MIN_WX_VERSION="3.0.4" # Do not downgrade this. wx 3.0.3 and older have too many known and fixed bugs affecting FileZilla.
  164   AM_PATH_WXCONFIG([$MIN_WX_VERSION], [wxWin=1], , [aui,xrc,adv,core,xml,base], [--unicode=yes --universal=no])
  165   if test "$wxWin" != 1; then
  166     AC_MSG_ERROR([
  167         wxWidgets must be installed on your system
  168         but either the wx-config script couldn't be found or
  169         no compatible wxWidgets configuration has been installed.
  170 
  171         Compatible wxWidgets configurations are the unicode builds
  172         of wxGTK, wxMac and wxMSW.
  173 
  174         Please check that wx-config is in path, the directory
  175         where wxWidgets libraries are installed (returned by
  176         'wx-config --libs' command) is in LD_LIBRARY_PATH or
  177         equivalent variable and wxWidgets version is $MIN_WX_VERSION or above.
  178     ])
  179   fi
  180   if test "${WX_VERSION_MAJOR}.${WX_VERSION_MINOR}" = "3.1"; then
  181     AC_MSG_ERROR([You must use wxWidgets 3.0.x, development versions of wxWidgets are not supported.])
  182   elif test "${WX_VERSION_MAJOR}.${WX_VERSION_MINOR}" != "3.0"; then
  183     AC_MSG_ERROR([You must use wxWidgets 3.0.x, wxWidgets 3.2 or higher is not yet supported.])
  184   fi
  185 
  186   # --universal=no doesn't work correctly, it still accepts universal builds. Reject it manually here.
  187   if echo "$WX_CPPFLAGS" | grep __WXUNIVERSAL__ > /dev/null; then
  188     AC_MSG_ERROR([wxUniversal is not acceptable as flavour of wxWidgets. Please recompile wxWidgets with --disable-universal])
  189   fi
  190   if echo "$WX_CPPFLAGS" | grep __WXMOTIF__ > /dev/null; then
  191     AC_MSG_ERROR([wxMotif is not acceptable as flavour of wxWidgets. Please recompile wxWidgets with the GTK flavour])
  192   fi
  193 
  194   AC_LANG_PUSH(C++)
  195   CPPFLAGS_OLD="$CPPFLAGS"
  196   CXXFLAGS_OLD="$CXXFLAGS"
  197   CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
  198   CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
  199 
  200   AC_MSG_CHECKING([positional printf argument support in wxWidgets])
  201   AC_COMPILE_IFELSE(
  202     [AC_LANG_PROGRAM([[
  203           #include <wx/wx.h>
  204           #if !wxUSE_PRINTF_POS_PARAMS
  205             #error wx compiled without wxUSE_PRINTF_POS_PARAMS
  206           #endif
  207         ]])],
  208       AC_MSG_RESULT([yes]),
  209       [
  210         AC_MSG_RESULT([no])
  211         AC_MSG_FAILURE([Positional printf argument support in wxWidgets is required by FileZilla. Please rebuild wxWidgets and pass --enable-printfposparam to its configure script.])
  212       ]
  213     )
  214 
  215   AC_MSG_CHECKING([GUI support in wxWidgets])
  216   AC_COMPILE_IFELSE(
  217     [AC_LANG_PROGRAM([[
  218           #include <wx/wx.h>
  219           #if !wxUSE_GUI
  220             #error wx compiled without wxUSE_GUI
  221           #endif
  222         ]])],
  223       AC_MSG_RESULT([yes]),
  224       [
  225         AC_MSG_RESULT([no])
  226         AC_MSG_FAILURE([GUI support in wxWidgets is required by FileZilla. Please rebuild wxWidgets and pass --enable-gui to its configure script.])
  227       ]
  228     )
  229 
  230   CPPFLAGS="$CPPFLAGS_OLD"
  231   CXXFLAGS="$CXXFLAGS_OLD"
  232   AC_LANG_POP
  233 
  234   AC_SUBST(WX_CONFIG_WITH_ARGS)
  235 
  236   AC_CACHE_SAVE
  237 
  238   # Get OS type for PUTTY frontend
  239   # ------------------------------
  240 
  241   AC_MSG_CHECKING([system type for sftp stub])
  242   sftpbuild="unix"
  243   if echo $host_os | grep "mingw" > /dev/null 2>&1; then sftpbuild="mingw"; fi
  244   AC_MSG_RESULT([$sftpbuild])
  245 
  246   # Checks for PuTTY
  247   # ----------------
  248 
  249   AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
  250   #include <sys/types.h>
  251   #include <utmp.h>])
  252 
  253   AC_SEARCH_LIBS([socket], [xnet])
  254   AC_SEARCH_LIBS([getaddrinfo], [xnet])
  255   AC_SEARCH_LIBS([in6addr_loopback], [socket])
  256 
  257   AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
  258   AC_CHECK_FUNCS([gettimeofday ftime])
  259   AC_CHECK_FUNCS([in6addr_loopback in6addr_any])
  260   AC_CHECK_DECLS([CLOCK_MONOTONIC], [], [], [[#include <time.h>]])
  261 
  262   AC_CACHE_CHECK([for SO_PEERCRED and dependencies], [x_cv_linux_so_peercred], [
  263       AC_COMPILE_IFELSE([
  264           AC_LANG_PROGRAM([[
  265               #define _GNU_SOURCE
  266               #include <features.h>
  267               #include <sys/socket.h>
  268             ]],[[
  269               struct ucred cr;
  270               socklen_t crlen = sizeof(cr);
  271               return getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cr, &crlen) +
  272               cr.pid + cr.uid + cr.gid;
  273             ]]
  274           )],
  275           AS_VAR_SET(x_cv_linux_so_peercred, yes),
  276           AS_VAR_SET(x_cv_linux_so_peercred, no)
  277       )
  278   ])
  279   AS_IF([test AS_VAR_GET(x_cv_linux_so_peercred) = yes],
  280       [AC_DEFINE([HAVE_SO_PEERCRED], [1],
  281        [Define if SO_PEERCRED works in the Linux fashion.])]
  282   )
  283 fi
  284 
  285 if test "$buildmain" = "yes"; then
  286 
  287   # Check for windres on MinGW builds
  288   # ---------------------------------
  289 
  290   # Small function to filter the flags for windres,
  291   # so that only includes and defines are passed to windres.
  292   parseflags() {
  293     WINDRESFLAGS=""
  294     for opt in "$@"
  295     do
  296         case "$opt" in
  297         -I*)
  298             WINDRESFLAGS="$WINDRESFLAGS --include-dir=${opt#-I}"
  299             ;;
  300         -D*)
  301             WINDRESFLAGS="$WINDRESFLAGS $opt"
  302             ;;
  303         esac
  304     done
  305   }
  306 
  307   WINDRESFLAGS=
  308   use_resourcefile=
  309   AC_MSG_CHECKING([whether to use windres])
  310   if echo $host_os | grep "cygwin\|mingw" > /dev/null 2>&1; then
  311     if echo $WX_CPPFLAGS | grep __WXMSW__ > /dev/null 2>&1; then
  312       AC_MSG_RESULT([yes])
  313       AC_CHECK_TOOL([WINDRES], [windres])
  314       if test "x$WINDRES" = "x"; then
  315         AC_MSG_ERROR([windres could not be found, please make sure this program is within your path.])
  316       fi
  317       use_resourcefile=true
  318       parseflags $WX_CPPFLAGS
  319 
  320       FZ_CHECK_ICOPYHOOKW
  321     else
  322       AC_MSG_RESULT([no])
  323     fi
  324   else
  325     AC_MSG_RESULT([no])
  326   fi
  327   AC_SUBST(WINDRES)
  328   AC_SUBST(WINDRESFLAGS)
  329 
  330   # Set version macros
  331   # ------------------
  332 
  333   # version.rc.in needs a major, minor and micro version number
  334   vnumber=${PACKAGE_VERSION%-*}
  335   PACKAGE_VERSION_MAJOR=${vnumber%%.*}
  336   vnumber=${vnumber#$PACKAGE_VERSION_MAJOR}
  337   vnumber=${vnumber#.}
  338   PACKAGE_VERSION_MINOR=${vnumber%%.*}
  339   vnumber=${vnumber#$PACKAGE_VERSION_MINOR}
  340   vnumber=${vnumber#.}
  341   PACKAGE_VERSION_MICRO=${vnumber%%.*}
  342   vnumber=${vnumber#$PACKAGE_VERSION_MICRO}
  343   vnumber=${vnumber#.}
  344   PACKAGE_VERSION_NANO=${vnumber%%.*}
  345 
  346   if test -z "$PACKAGE_VERSION_MAJOR"; then
  347     PACKAGE_VERSION_MAJOR=0
  348   fi
  349   if test -z "$PACKAGE_VERSION_MINOR"; then
  350     PACKAGE_VERSION_MINOR=0
  351   fi
  352   if test -z "$PACKAGE_VERSION_MICRO"; then
  353     PACKAGE_VERSION_MICRO=0
  354   fi
  355   if test -z "$PACKAGE_VERSION_NANO"; then
  356     PACKAGE_VERSION_NANO=0
  357   fi
  358 
  359   AC_SUBST(PACKAGE_VERSION_MAJOR)
  360   AC_SUBST(PACKAGE_VERSION_MINOR)
  361   AC_SUBST(PACKAGE_VERSION_MICRO)
  362   AC_SUBST(PACKAGE_VERSION_NANO)
  363 
  364   # Enable DEP and ASLR linker flags
  365   # --------------------------------
  366 
  367   AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [AX_APPEND_FLAG([-Wl,--dynamicbase], LDFLAGS)])
  368   AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [AX_APPEND_FLAG([-Wl,--nxcompat], LDFLAGS)])
  369 
  370   # Set Windows-specific linker flags
  371   # ---------------------------------
  372   if echo $host_os | grep "cygwin\|mingw" > /dev/null 2>&1; then
  373     # We currently require 7 minimum.
  374     AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6], [AX_APPEND_FLAG([-Wl,--major-subsystem-version -Wl,6], LDFLAGS)])
  375     AX_CHECK_LINK_FLAG([-Wl,--minor-subsystem-version -Wl,1], [AX_APPEND_FLAG([-Wl,--minor-subsystem-version -Wl,1], LDFLAGS)])
  376     AX_CHECK_LINK_FLAG([-Wl,--major-os-version -Wl,6], [AX_APPEND_FLAG([-Wl,--major-os-version -Wl,6], LDFLAGS)])
  377     AX_CHECK_LINK_FLAG([-Wl,--minor-os-version -Wl,1], [AX_APPEND_FLAG([-Wl,--minor-os-version -Wl,1], LDFLAGS)])
  378 
  379     # Set the Large Address Aware flag on 32bit Windows
  380     if ! echo $host_cpu | grep "x86_64" > /dev/null 2>&1; then
  381       AX_CHECK_LINK_FLAG([-Wl,--large-address-aware], [AX_APPEND_FLAG([-Wl,--large-address-aware], LDFLAGS)])
  382     fi
  383   fi
  384 
  385   # Mac OS X specific checks
  386   # ------------------------
  387 
  388   # Create application bundle on OS X
  389   if echo $WX_CPPFLAGS | grep __WXMAC__; then
  390     macappbundle="yes"
  391   else
  392     macappbundle="no"
  393   fi
  394 
  395   AC_ARG_ENABLE(mac-sandbox, AS_HELP_STRING([--enable-mac-sandbox],[Enables use of OS X's App Sandbox.]),
  396     [use_mac_sandbox="$enableval"], [use_mac_sandbox="no"])
  397   if test "$use_mac_sandbox" == "yes"; then
  398     AC_DEFINE([USE_MAC_SANDBOX], [1],
  399        [Define to 1 if the App Sandbox on OS X should be used.])
  400     CFBUNDLEIDSUFFIX=".sandbox"
  401   else
  402     CFBUNDLEIDSUFFIX=""
  403   fi
  404   AC_SUBST(CFBUNDLEIDSUFFIX)
  405 
  406   # Installer creation under Windows
  407   # --------------------------------
  408 
  409   # Create installer under Windows
  410   if echo $host_os | grep "mingw" > /dev/null 2>&1; then
  411     makensisscript="yes"
  412     if echo $host_cpu | grep "x86_64" > /dev/null 2>&1; then
  413       NSIS_64BIT=1
  414     else
  415       NSIS_64BIT=0
  416     fi
  417     AC_SUBST(NSIS_64BIT)
  418   else
  419     makensisscript="no"
  420   fi
  421 
  422   if echo $host_os | grep "mingw" > /dev/null 2>&1; then
  423     AC_CONFIG_FILES(data/install.nsi)
  424     AC_CONFIG_FILES(data/makezip.sh)
  425   fi
  426 
  427   # Libidn checks
  428   # -------------
  429 
  430   IDN_LIB=
  431   if ! echo $WX_CPPFLAGS | grep __WXMSW__ > /dev/null 2>&1; then
  432     AC_LANG_PUSH(C++)
  433     AX_CHECK_DEFINE([netdb.h], [AI_IDN],
  434       [],
  435       [
  436         AC_CHECK_HEADER(idna.h,,
  437         [
  438           AC_MSG_ERROR([idna.h not found which is part of GNU libidn.])
  439         ])
  440 
  441         AC_ARG_WITH(idn-lib,
  442             AS_HELP_STRING([--with-idn-lib=FILE],[Use the given path to the idn library.]),
  443         [
  444           if test "$withval" != "yes" -a "$withval" != ""; then
  445               IDN_LIB=$withval
  446           fi
  447         ])
  448 
  449         if test "x$IDN_LIB" = "x"; then
  450           AC_CHECK_LIB(idn, stringprep_check_version, IDN_LIB="-lidn",
  451                        AC_MSG_ERROR([GNU libidn not found. Try using --with-idn-lib=FILE to specify the library path.])
  452                        )
  453         fi
  454       ])
  455     AC_LANG_POP(C++)
  456   fi
  457   AC_SUBST(IDN_LIB)
  458 
  459   # Precompiled headers support
  460   # ---------------------------
  461 
  462   AC_MSG_CHECKING([whether to use precompiled headers])
  463   use_precomp=""
  464   AC_ARG_ENABLE(precomp, AS_HELP_STRING([--enable-precomp],[Use precompiled headers]), \
  465                 use_precomp="$enableval")
  466   if test "x$enable_dependency_tracking" = "xno"; then
  467     use_precomp="no"
  468   fi
  469   if test -z "$use_precomp"; then
  470     if test "X$GCC" = Xyes; then
  471       if gcc_version=`$CC -dumpversion` > /dev/null 2>&1; then
  472         major=`echo $gcc_version | cut -d. -f1`
  473         minor=`echo $gcc_version | sed "s/@<:@-,a-z,A-Z@:>@.*//" | cut -d. -f2`
  474         if test -z "$major" || test -z "$minor"; then
  475           use_precomp=no
  476         elif test "$major" -ge 4; then
  477           use_precomp=yes
  478         else
  479           use_precomp=no
  480         fi
  481       else
  482         use_precomp=no
  483       fi
  484     else
  485       use_precomp=no
  486     fi
  487   fi
  488   if test "x$use_precomp" = "xyes"; then
  489     CPPFLAGS="$CPPFLAGS -fpch-preprocess"
  490     AC_MSG_RESULT([yes])
  491   else
  492     AC_MSG_RESULT([no])
  493   fi
  494 
  495   # CppUnit tests
  496   # -------------
  497 
  498   PKG_CHECK_MODULES(CPPUNIT, [cppunit >= 1.13.0], [has_cppunit="yes"], [:])
  499 
  500   # Updatecheck related flags
  501   # -------------------------
  502 
  503   AC_ARG_ENABLE(manualupdatecheck, AS_HELP_STRING([--disable-manualupdatecheck],[Disallow the user to manually check for new versions. Implies --disable-autoupdatecheck]),
  504     [manualupdatecheck="$enableval"], [manualupdatecheck="yes"])
  505 
  506   if test "$manualupdatecheck" = "no"; then
  507     manualupdatecheck="0"
  508   else
  509     manualupdatecheck="1"
  510   fi
  511   AC_DEFINE_UNQUOTED(FZ_MANUALUPDATECHECK, $manualupdatecheck, [Set to 1 to enable user initiated update checks])
  512 
  513   AC_ARG_ENABLE(autoupdatecheck, AS_HELP_STRING([--disable-autoupdatecheck],[Disables the ability of FileZilla to check for new versions automatically.]),
  514     [autoupdatecheck="$enableval"], [autoupdatecheck="yes"])
  515 
  516   if test "$manualupdatecheck" = "1" -a "$autoupdatecheck" != "no"; then
  517     autoupdatecheck="1"
  518   else
  519     autoupdatecheck="0"
  520   fi
  521   AC_DEFINE_UNQUOTED(FZ_AUTOUPDATECHECK, $autoupdatecheck, [Set to 1 to add support for automated update checks])
  522 
  523   # Nettle
  524   # ------
  525 
  526   PKG_CHECK_MODULES([NETTLE], [nettle >= 3.1],, [
  527     AC_MSG_ERROR([nettle 3.1 greater was not found. You can get it from https://www.lysator.liu.se/~nisse/nettle/])
  528   ])
  529 
  530   AC_SUBST(NETTLE_LIBS)
  531   AC_SUBST(NETTLE_CFLAGS)
  532 
  533   PKG_CHECK_MODULES([HOGWEED], [hogweed >= 3.1],, [
  534     AC_MSG_ERROR([hogweed 3.1 greater was not found. You can get it from https://www.lysator.liu.se/~nisse/nettle/])
  535   ])
  536 
  537   AC_SUBST(HOGWEED_LIBS)
  538   AC_SUBST(HOGWEED_CFLAGS)
  539 
  540   # pugixml
  541   # ------
  542 
  543   FZ_CHECK_PUGIXML()
  544 
  545   # Libdbus
  546   # -------
  547 
  548   AC_ARG_WITH(dbus, AS_HELP_STRING([--with-dbus],[Enable D-Bus support through libdbus. Used for GNOME Session manager D-Bus API. Default: auto]),
  549     [
  550     ],
  551     [
  552       with_dbus="auto"
  553     ])
  554 
  555   if test "$with_dbus" = "auto"; then
  556     if echo $WX_CPPFLAGS | grep __WXMAC__ > /dev/null 2>&1; then
  557       with_dbus="no"
  558     elif echo $WX_CPPFLAGS | grep __WXMSW__ > /dev/null 2>&1; then
  559       with_dbus="no"
  560     else
  561       with_dbus="yes"
  562     fi
  563   elif test "$with_dbus" = "yes"; then
  564     if echo "$WX_CPPFLAGS" | grep __WXMAC__; then
  565       AC_MSG_ERROR([D-Bus support is not needed or available on your platform])
  566     elif echo "$WX_CPPFLAGS" | grep __WXMSW__; then
  567       AC_MSG_ERROR([D-Bus support is not needed or available on your platform])
  568     fi
  569   else
  570     with_dbus="no"
  571   fi
  572 
  573   if test "$with_dbus" != "no"; then
  574     PKG_CHECK_MODULES(LIBDBUS, dbus-1 >= 1.2, [with_dbus_v="2"],
  575       [
  576         PKG_CHECK_MODULES(LIBDBUS, dbus-1, [with_dbus_v="1"],
  577           [
  578             AC_MSG_ERROR([libdbus not found. Install libdbus or configure with --without-dbus])
  579           ])
  580       ])
  581     AC_DEFINE_UNQUOTED(WITH_LIBDBUS, [$with_dbus_v], [Set to 2 to if libdbus >= 1.2 is available, set to 1 if an older version is available.])
  582   fi
  583 
  584   AC_MSG_CHECKING([D-Bus support])
  585   AC_MSG_RESULT([$with_dbus])
  586 
  587   # We want xdg-open on *nix
  588   if echo "`$WX_CONFIG_WITH_ARGS --basename`" | grep -i gtk > /dev/null 2>&1; then
  589     AC_PATH_PROG(xdgopen, xdg-open)
  590     if test -z "$xdgopen"; then
  591       AC_MSG_ERROR([xdg-open not found. This program is the preferred way to launch the default browser. Please install the xdg-utils.])
  592     fi
  593 
  594     if echo "`$WX_CONFIG_WITH_ARGS --basename`" | grep -i gtk2 > /dev/null 2>&1; then
  595       PKG_CHECK_MODULES(LIBGTK, gtk+-2.0,, [
  596         AC_MSG_ERROR([gtk+-2.0 was not found, even though the used version of wxWidgets depends on it. Are you missing the gtk+2.0 development files?])
  597       ])
  598     fi
  599     if echo "`$WX_CONFIG_WITH_ARGS --basename`" | grep -i gtk3 > /dev/null 2>&1; then
  600       PKG_CHECK_MODULES(LIBGTK, gtk+-3.0,, [
  601         AC_MSG_ERROR([gtk+-3.0 was not found, even though the used version of wxWidgets depends on it. Are you missing the gtk+3.0 development files?])
  602       ])
  603     fi
  604 
  605     AC_SUBST(LIBGTK_LIBS)
  606     AC_SUBST(LIBGTK_CFLAGS)
  607   fi
  608 
  609   # Some more obscure platforms (e.g. HP-UX) don't have setenv which is required by POSIX
  610   AC_CHECK_FUNC(setenv, [AC_DEFINE([HAVE_SETENV], [1], [Define to 1 if setenv function is available.])], [])
  611   AC_CHECK_FUNC(putenv, [AC_DEFINE([HAVE_PUTENV], [1], [Define to 1 if putenv function is available.])], [])
  612 
  613   # Some platforms, e.g. OS X, lack posix_fadvise
  614   AC_CHECK_FUNCS(posix_fadvise)
  615 
  616   CHECK_THREADSAFE_LOCALTIME
  617   CHECK_THREADSAFE_GMTIME
  618   CHECK_INVERSE_GMTIME
  619 
  620   # Must be done after setting linker flags
  621   CHECK_CLOCK_GETTIME
  622 
  623   # SQLite3
  624   # -------
  625 
  626   PKG_CHECK_MODULES(LIBSQLITE3, sqlite3 >= 3.7,, [
  627 
  628     AC_CHECK_HEADER(sqlite3.h,,
  629     [
  630       AC_MSG_ERROR([sqlite3.h not found which is part of SQLite3.])
  631     ])
  632 
  633     AC_CHECK_LIB(sqlite3, sqlite3_version, LIBSQLITE3_LIBS="-lsqlite3",
  634     [
  635       AC_MSG_ERROR([SQLite3 not found.])
  636     ])
  637   ])
  638 
  639   AC_SUBST(LIBSQLITE3_LIBS)
  640   AC_SUBST(LIBSQLITE3_CFLAGS)
  641 
  642   # Find libstorj
  643   # -----------------
  644 
  645   AC_ARG_ENABLE(storj, AS_HELP_STRING([--enable-storj@<:@=ARG@:>@],[Enable support for the Storj decentralized cloud storage provider. Default: no]),
  646     [
  647     ],
  648     [
  649       enable_storj="no"
  650     ])
  651 
  652   if test "$enable_storj" != "no"; then
  653     PKG_CHECK_MODULES(LIBSTORJ, [libstorj >= 1.0],[
  654       AC_DEFINE([ENABLE_STORJ], [1], [Define if building with Storj support.])
  655       enable_storj="yes"
  656     ], [
  657       if test "$enable_storj" = "yes"; then
  658   	AC_MSG_ERROR([libstorj not found: $LIBSTORJ_PKG_ERRORS. You can download it from https://github.com/Storj/libstorj])
  659       else
  660         enable_storj="no"
  661       fi
  662     ])
  663     AC_SUBST(LIBSTORJ_CFLAGS)
  664     AC_SUBST(LIBSTORJ_LIBS)
  665   fi
  666 fi
  667 
  668 # Everything translation related
  669 # ------------------------------
  670 
  671 FILEZILLA_LINGUAS=
  672 FILEZILLA_LINGUAS_PO=
  673 FILEZILLA_LINGUAS_MO=
  674 FILEZILLA_LINGUAS_PO_NEW=
  675 
  676 if test "$locales" = "yes"; then
  677   AC_PATH_PROG(xgettext, xgettext)
  678   if test -z "$xgettext"; then
  679     AC_MSG_ERROR([xgettext not found, please install the GNU gettext package and make sure xgettext is in the path.])
  680   fi
  681 
  682   AC_PATH_PROG(msgfmt, msgfmt)
  683   if test -z "$msgfmt"; then
  684     AC_MSG_ERROR([ msgfmt not found, please install the GNU gettext package and make sure  msgfmt is in the path.])
  685   fi
  686 
  687   FZ_PATH_PROG_VER(msgmerge, msgmerge, 0.11.0)
  688   if test -z "$msgmerge"; then
  689     AC_MSG_ERROR([msgmerge not found or too old, please install a current version of the GNU gettext package and make sure msgmerge is in the path.])
  690   fi
  691 
  692   AC_MSG_CHECKING([available FZ3 message catalogs])
  693 
  694   FILEZILLA_LINGUAS_PO=
  695   FILEZILLA_LINGUAS=
  696 
  697   if /bin/ls > /dev/null; then
  698     LSPROG='/bin/ls'
  699   else
  700     LSPROG='ls'
  701   fi
  702 
  703   if test x$srcdir = x; then
  704     path="locales"
  705   else
  706     path="$srcdir/locales"
  707   fi
  708   for i in `$LSPROG $path/*.po`; do
  709     i=${i%.*}
  710     i=${i##*/}
  711     FILEZILLA_LINGUAS_PO=$FILEZILLA_LINGUAS_PO${FILEZILLA_LINGUAS_PO:+ }\$\(srcdir\)/$i.po
  712     FILEZILLA_LINGUAS_PO_NEW=$FILEZILLA_LINGUAS_PO_NEW${FILEZILLA_LINGUAS_PO_NEW:+ }$i.po.new
  713     FILEZILLA_LINGUAS=$FILEZILLA_LINGUAS${FILEZILLA_LINGUAS:+ }$i
  714     FILEZILLA_LINGUAS_MO=$FILEZILLA_LINGUAS_MO${FILEZILLA_LINGUAS_MO:+ }$i.mo
  715   done
  716 
  717   AC_MSG_RESULT([$FILEZILLA_LINGUAS])
  718 
  719   AC_PATH_PROG([WXRC], [wxrc --version])
  720   if test "x$WXRC" = "x"; then
  721     AC_MSG_ERROR([
  722       wxrc could not be found. This program gets build together with wxWidgets.
  723       Please make sure wxrc is within your path.
  724     ])
  725   fi
  726 fi
  727 
  728 AC_SUBST(FILEZILLA_LINGUAS)
  729 AC_SUBST(FILEZILLA_LINGUAS_PO)
  730 AC_SUBST(FILEZILLA_LINGUAS_PO_NEW)
  731 AC_SUBST(FILEZILLA_LINGUAS_MO)
  732 
  733 
  734 # Output automake conditionals
  735 # ----------------------------
  736 
  737 AM_CONDITIONAL([MINGW], [echo $host_os | grep "mingw" > /dev/null])
  738 AM_CONDITIONAL([LOCALES_ONLY], [test "$localesonly" = "yes"])
  739 AM_CONDITIONAL([LOCALES], [test "$locales" = "yes"])
  740 AM_CONDITIONAL(SFTP_MINGW, [test "$sftpbuild" = "mingw"])
  741 AM_CONDITIONAL(SFTP_UNIX, [test "$sftpbuild" = "unix"])
  742 AM_CONDITIONAL(USE_RESOURCEFILE, test "$use_resourcefile" = "true")
  743 AM_CONDITIONAL(MACAPPBUNDLE, [test "$macappbundle" = "yes"])
  744 AM_CONDITIONAL(USE_MAC_SANDBOX, [test "$use_mac_sandbox" = "yes"])
  745 AM_CONDITIONAL(MAKENSISSCRIPT, [test "$makensisscript" = "yes"])
  746 AM_CONDITIONAL(ENABLE_PRECOMP, test "x$use_precomp" = "xyes")
  747 AM_CONDITIONAL(HAS_CPPUNIT, [test "$has_cppunit" = "yes"])
  748 AM_CONDITIONAL(HAVE_LIBPUGIXML, [test "x$with_pugixml" = "xsystem"])
  749 AM_CONDITIONAL(HAVE_DBUS, [test "x$with_dbus" = "xyes"])
  750 AM_CONDITIONAL(ENABLE_STORJ, [test "x$enable_storj" = "xyes"])
  751 
  752 AC_CONFIG_FILES(Makefile src/Makefile src/engine/Makefile src/pugixml/Makefile
  753 src/dbus/Makefile
  754 src/interface/Makefile src/interface/resources/Makefile src/include/Makefile
  755 locales/Makefile
  756 data/Makefile
  757 src/interface/resources/classic/Makefile
  758 src/interface/resources/cyril/Makefile
  759 src/interface/resources/cyril/16x16/Makefile
  760 src/interface/resources/blukis/Makefile
  761 src/interface/resources/default/Makefile
  762 src/interface/resources/flatzilla/Makefile
  763 src/interface/resources/lone/Makefile
  764 src/interface/resources/minimal/Makefile
  765 src/interface/resources/opencrystal/Makefile
  766 src/interface/resources/sun/Makefile
  767 src/interface/resources/tango/Makefile
  768 src/putty/Makefile
  769 src/storj/Makefile
  770 tests/Makefile
  771 src/interface/resources/version.rc
  772 src/interface/resources/MacInfo.plist
  773 src/fzshellext/version.rc)
  774 AC_OUTPUT