You've already forked pgbackrest
							
							
				mirror of
				https://github.com/pgbackrest/pgbackrest.git
				synced 2025-10-30 23:37:45 +02:00 
			
		
		
		
	Use pkg-config instead of xml2-config for libxml2 build options.
pkg-config is a generic way to get build options rather than relying on a package-specific utility. XML2_CONFIG can be used to override this utility for systems that do not ship pkg-config.
This commit is contained in:
		| @@ -13,6 +13,18 @@ | ||||
|  | ||||
|     <release-list> | ||||
|         <release date="XXXX-XX-XX" version="2.23dev" title="UNDER DEVELOPMENT"> | ||||
|             <release-core-list> | ||||
|                 <release-improvement-list> | ||||
|                     <release-item> | ||||
|                         <release-item-contributor-list> | ||||
|                             <release-item-contributor id="david.steele"/> | ||||
|                             <release-item-contributor id="adrian.vondendriesch"/> | ||||
|                         </release-item-contributor-list> | ||||
|  | ||||
|                         <p>Use <file>pkg-config</file> instead of <file>xml2-config</file> for <proper>libxml2</proper> build options.</p> | ||||
|                     </release-item> | ||||
|                 </release-improvement-list> | ||||
|             </release-core-list> | ||||
|         </release> | ||||
|  | ||||
|         <release date="2020-01-21" version="2.22" title="Bug Fix"> | ||||
|   | ||||
| @@ -763,7 +763,7 @@ | ||||
|  | ||||
|             <execute if="{[os-type-is-debian]}" user="root" pre="y"> | ||||
|                 <exe-cmd> | ||||
|                     apt-get install make gcc libpq-dev libssl-dev libxml2-dev</exe-cmd> | ||||
|                     apt-get install make gcc libpq-dev libssl-dev libxml2-dev pkg-config</exe-cmd> | ||||
|                 <exe-cmd-extra>-y 2>&1</exe-cmd-extra> | ||||
|             </execute> | ||||
|  | ||||
|   | ||||
| @@ -131,7 +131,7 @@ WriteMakefile | ||||
|         -std=c99 | ||||
|         -D_POSIX_C_SOURCE=200112L | ||||
|         -D_FILE_OFFSET_BITS=64 | ||||
|         `xml2-config --cflags` | ||||
|         `pkg-config libxml-2.0 --cflags` | ||||
|         -I`pg_config --includedir` | ||||
|     )), | ||||
|  | ||||
|   | ||||
							
								
								
									
										75
									
								
								src/configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										75
									
								
								src/configure
									
									
									
									
										vendored
									
									
								
							| @@ -1324,7 +1324,7 @@ Some influential environment variables: | ||||
|   LIBS        libraries to pass to the linker, e.g. -l<library> | ||||
|   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if | ||||
|               you have headers in a nonstandard directory <include dir> | ||||
|   XML2_CONFIG path to xml2-config utility | ||||
|   XML2_CONFIG path to xml2 config utility | ||||
|   CPP         C preprocessor | ||||
|  | ||||
| Use these variables to override the choices made by `configure' or to help | ||||
| @@ -3009,10 +3009,6 @@ fi | ||||
|  | ||||
|  | ||||
|  | ||||
| # Wrap AC_PATH_PROGS to check if the value is already set before looking for programs. AC_PATH_PROGS preserves the value only if it | ||||
| # looks like an absolute path. | ||||
|  | ||||
|  | ||||
| # Enable internal test code and assertions by undefining NDEBUG | ||||
| warning='-Wall -Wextra -Wno-clobbered -Wno-missing-field-initializers' | ||||
|  | ||||
| @@ -3202,73 +3198,12 @@ fi | ||||
|  | ||||
|  | ||||
| # Check required xml library | ||||
|  | ||||
| if test -z "$XML2_CONFIG"; then | ||||
|     for ac_prog in xml2-config | ||||
| do | ||||
|   # Extract the first word of "$ac_prog", so it can be a program name with args. | ||||
| set dummy $ac_prog; ac_word=$2 | ||||
| { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||||
| $as_echo_n "checking for $ac_word... " >&6; } | ||||
| if ${ac_cv_path_XML2_CONFIG+:} false; then : | ||||
|   $as_echo_n "(cached) " >&6 | ||||
| else | ||||
|   case $XML2_CONFIG in | ||||
|   [\\/]* | ?:[\\/]*) | ||||
|   ac_cv_path_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test with a path. | ||||
|   ;; | ||||
|   *) | ||||
|   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||||
| for as_dir in $PATH | ||||
| do | ||||
|   IFS=$as_save_IFS | ||||
|   test -z "$as_dir" && as_dir=. | ||||
|     for ac_exec_ext in '' $ac_executable_extensions; do | ||||
|   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | ||||
|     ac_cv_path_XML2_CONFIG="$as_dir/$ac_word$ac_exec_ext" | ||||
|     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||||
|     break 2 | ||||
|   fi | ||||
| done | ||||
|   done | ||||
| IFS=$as_save_IFS | ||||
|  | ||||
|   ;; | ||||
| esac | ||||
| fi | ||||
| XML2_CONFIG=$ac_cv_path_XML2_CONFIG | ||||
| if test -n "$XML2_CONFIG"; then | ||||
|   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 | ||||
| $as_echo "$XML2_CONFIG" >&6; } | ||||
| else | ||||
|   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||||
| $as_echo "no" >&6; } | ||||
|     XML2_CONFIG="pkg-config libxml-2.0" | ||||
| fi | ||||
|  | ||||
|  | ||||
|   test -n "$XML2_CONFIG" && break | ||||
| done | ||||
|  | ||||
| else | ||||
|     # Report the value of XML2_CONFIG in configure's output | ||||
|     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2_CONFIG" >&5 | ||||
| $as_echo_n "checking for XML2_CONFIG... " >&6; } | ||||
|     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5 | ||||
| $as_echo "$XML2_CONFIG" >&6; } | ||||
| fi | ||||
|  | ||||
|  | ||||
| if test -n "$XML2_CONFIG"; then | ||||
|     for ac_option in `$XML2_CONFIG --cflags`; do | ||||
|         case $ac_option in | ||||
|             -I*|-D*) CPPFLAGS="$CPPFLAGS $ac_option";; | ||||
|         esac | ||||
|     done | ||||
|         for pgac_option in `$XML2_CONFIG --libs`; do | ||||
|         case $ac_option in | ||||
|             -L*) LDFLAGS="$LDFLAGS $ac_option";; | ||||
|         esac | ||||
|     done | ||||
| fi | ||||
| CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags`" | ||||
|  | ||||
| { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlSaveToBuffer in -lxml2" >&5 | ||||
| $as_echo_n "checking for xmlSaveToBuffer in -lxml2... " >&6; } | ||||
| @@ -3722,7 +3657,7 @@ else | ||||
| fi | ||||
|  | ||||
|  | ||||
| CLIBRARY="$CLIBRARY `$XML2_CONFIG --cflags`" | ||||
| CLIBRARY="$CLIBRARY `pkg-config libxml-2.0 --cflags`" | ||||
|  | ||||
|  | ||||
| # Check required gzip library | ||||
|   | ||||
| @@ -6,18 +6,6 @@ AC_CONFIG_SRCDIR([version.h]) | ||||
| # Check compiler | ||||
| AC_PROG_CC_C99 | ||||
|  | ||||
| # Wrap AC_PATH_PROGS to check if the value is already set before looking for programs. AC_PATH_PROGS preserves the value only if it | ||||
| # looks like an absolute path. | ||||
| AC_DEFUN([BRAC_PATH_PROGS], | ||||
| [if test -z "$$1"; then | ||||
|     AC_PATH_PROGS($@) | ||||
| else | ||||
|     # Report the value of $1 in configure's output | ||||
|     AC_MSG_CHECKING([for $1]) | ||||
|     AC_MSG_RESULT([$$1]) | ||||
| fi | ||||
| ]) | ||||
|  | ||||
| # Enable internal test code and assertions by undefining NDEBUG | ||||
| warning='-Wall -Wextra -Wno-clobbered -Wno-missing-field-initializers' | ||||
|  | ||||
| @@ -54,25 +42,17 @@ AC_CHECK_LIB([crypto], [EVP_get_digestbyname], [], [AC_MSG_ERROR([library 'crypt | ||||
| AC_CHECK_LIB([ssl], [SSL_new], [], [AC_MSG_ERROR([library 'ssl' is required])]) | ||||
|  | ||||
| # Check required xml library | ||||
| BRAC_PATH_PROGS(XML2_CONFIG, [xml2-config]) | ||||
| AC_ARG_VAR(XML2_CONFIG, [path to xml2-config utility])dnl | ||||
| AC_ARG_VAR(XML2_CONFIG, [path to xml2 config utility])dnl | ||||
|  | ||||
| if test -n "$XML2_CONFIG"; then | ||||
|     for ac_option in `$XML2_CONFIG --cflags`; do | ||||
|         case $ac_option in | ||||
|             -I*|-D*) CPPFLAGS="$CPPFLAGS $ac_option";; | ||||
|         esac | ||||
|     done | ||||
|         for pgac_option in `$XML2_CONFIG --libs`; do | ||||
|         case $ac_option in | ||||
|             -L*) LDFLAGS="$LDFLAGS $ac_option";; | ||||
|         esac | ||||
|     done | ||||
| if test -z "$XML2_CONFIG"; then | ||||
|     XML2_CONFIG="pkg-config libxml-2.0" | ||||
| fi | ||||
|  | ||||
| CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags`" | ||||
|  | ||||
| AC_CHECK_LIB([xml2], [xmlSaveToBuffer], [], [AC_MSG_ERROR([library 'xml2' is required])]) | ||||
| AC_CHECK_HEADER(libxml/parser.h, [], [AC_MSG_ERROR([header file <libxml/parser.h> is required])]) | ||||
| AC_SUBST(CLIBRARY, "$CLIBRARY `$XML2_CONFIG --cflags`") | ||||
| AC_SUBST(CLIBRARY, "$CLIBRARY `pkg-config libxml-2.0 --cflags`") | ||||
|  | ||||
| # Check required gzip library | ||||
| AC_CHECK_LIB([z], [deflate], [], [AC_MSG_ERROR([library 'z' is required])]) | ||||
|   | ||||
| @@ -12,10 +12,12 @@ | ||||
| # - docker login -u pgbackrest | ||||
| # - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?} | ||||
| # ********************************************************************************************************************************** | ||||
| 20200124A: | ||||
|   u12: 0f2fcf1bc79ee35e78121773c9a2155a77cb10d5 | ||||
|   u18: e0d670be1f7167152748e36832081b5b09aabc70 | ||||
|   u19: 9d057b1081efedfce0f7ba38092b867a125fde37 | ||||
|  | ||||
| 20191122A: | ||||
|   f30: 3a60318c275cdbfa6daa0f2b502a5551562e6db6 | ||||
|   co6: 63527115fd269dfee74bda70da8a5b0569f94886 | ||||
|   co7: 0b4c4b953709dc086f95fcc5c8ca45dee1a5eee9 | ||||
|   u12: 333122fe71a766b78398a1e86bafd1d8703fef1f | ||||
|   u18: c4dd9d5586eb67d77dfa6e0b89c5ebf9e27820a4 | ||||
|   u19: e68f7b969d12c2c43b47a83053a5241092c28524 | ||||
|   | ||||
| @@ -380,7 +380,7 @@ sub containerBuild | ||||
|                 "    apt-get -y install openssh-server wget sudo gcc make valgrind git \\\n" . | ||||
|                 "        libdbd-pg-perl libhtml-parser-perl libssl-dev libperl-dev \\\n" . | ||||
|                 "        libyaml-libyaml-perl tzdata devscripts lintian libxml-checker-perl txt2man debhelper \\\n" . | ||||
|                 "        libppi-html-perl libtemplate-perl libtest-differences-perl zlib1g-dev libxml2-dev"; | ||||
|                 "        libppi-html-perl libtemplate-perl libtest-differences-perl zlib1g-dev libxml2-dev pkg-config"; | ||||
|  | ||||
|             if ($strOS eq VM_U12) | ||||
|             { | ||||
|   | ||||
| @@ -454,7 +454,7 @@ sub run | ||||
|                 # Flags that are common to all builds | ||||
|                 my $strCommonFlags = | ||||
|                     '-I. -Itest -std=c99 -fPIC -g -Wno-clobbered -D_POSIX_C_SOURCE=200809L -D_FILE_OFFSET_BITS=64' . | ||||
|                         ' `xml2-config --cflags`' . ($self->{bProfile} ? " -pg" : '') . | ||||
|                         ' `pkg-config libxml-2.0 --cflags`' . ($self->{bProfile} ? " -pg" : '') . | ||||
|                         ' -I`pg_config --includedir`' . | ||||
|                     ($self->{oTest}->{&TEST_DEBUG_UNIT_SUPPRESS} ? '' : " -DDEBUG_UNIT") . | ||||
|                     (vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? ' -DWITH_BACKTRACE' : '') . | ||||
|   | ||||
| @@ -132,7 +132,8 @@ eval | ||||
|     processBegin('install common packages'); | ||||
|     processExec('sudo apt-get -qq update', {bSuppressStdErr => true, bSuppressError => true}); | ||||
|     processExec( | ||||
|         'sudo apt-get install -y rsync zlib1g-dev libssl-dev libxml2-dev libpq-dev libxml-checker-perl libyaml-libyaml-perl', | ||||
|         'sudo apt-get install -y rsync zlib1g-dev libssl-dev libxml2-dev libpq-dev libxml-checker-perl libyaml-libyaml-perl' . | ||||
|             ' pkg-config', | ||||
|         {bSuppressStdErr => true}); | ||||
|     processEnd(); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user