poedit/poedit-2.1-update_configure_check_for_pugixml.patch
2018-07-24 12:01:13 +02:00

125 lines
3.3 KiB
Diff

--- a/configure 2018-07-23 12:48:05.000000000 +0200
+++ b/configure 2018-07-23 12:52:12.000000000 +0200
@@ -8782,6 +8782,18 @@
fi
+if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pugixml\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "pugixml") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pugixml_found=yes
+else
+ pugixml_found=no
+fi
+
+if test x"$pugixml_found" = xyes; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PUGIXML" >&5
@@ -8841,22 +8853,97 @@
# Put the nasty error message in config.log where it belongs
echo "$PUGIXML_PKG_ERRORS" >&5
-
-
+ pugixml_found=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
-
-
+ pugixml_found=no
else
PUGIXML_CFLAGS=$pkg_cv_PUGIXML_CFLAGS
PUGIXML_LIBS=$pkg_cv_PUGIXML_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ pugixml_found=yes
+fi
+fi
- CXXFLAGS="$CXXFLAGS $PUGIXML_CFLAGS -DHAVE_PUGIXML"
+if test x"$pugixml_found" = xno; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ for ac_header in pugixml.hpp
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "pugixml.hpp" "ac_cv_header_pugixml_hpp" "$ac_includes_default"
+if test "x$ac_cv_header_pugixml_hpp" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PUGIXML_HPP 1
+_ACEOF
+
+fi
+done
+
+ if test x"$ac_cv_header_pugixml_hpp" = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpugixml" >&5
+$as_echo_n "checking for main in -lpugixml... " >&6; }
+if ${ac_cv_lib_pugixml_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpugixml $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_pugixml_main=yes
+else
+ ac_cv_lib_pugixml_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pugixml_main" >&5
+$as_echo "$ac_cv_lib_pugixml_main" >&6; }
+if test "x$ac_cv_lib_pugixml_main" = xyes; then :
+
+ PUGIXML_LIBS=-lpugixml
+ pugixml_found=yes
+
+fi
+
+ fi
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+if test $pugixml_found = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using the system version of the pugixml library" >&5
+$as_echo "$as_me: Using the system version of the pugixml library" >&6;}
+ CXXFLAGS="$CXXFLAGS $PUGIXML_CFLAGS -DHAVE_PUGIXML"
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using bundled copy of pugixml library" >&5
+$as_echo "$as_me: Using bundled copy of pugixml library" >&6;}
fi