[PATCH] ruby: fix order of CFLAGS
Shuffle the order of the various CFLAGS used when building the Ruby extension: first the flags from manywarnings (gnulib), then libguestfs own CFLAGS, and then -DGUESTFS_PRIVATE=1 (so it is not overridden). This matches also what happens in automake parts, and makes it possible to override any flags from manywarnings also in the Ruby extension. --- ruby/ext/guestfs/extconf.rb.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ruby/ext/guestfs/extconf.rb.in b/ruby/ext/guestfs/extconf.rb.in index c4551fa6c..6b806101e 100644 --- a/ruby/ext/guestfs/extconf.rb.in +++ b/ruby/ext/guestfs/extconf.rb.in @@ -33,8 +33,9 @@ have_func("rb_define_alloc_func") have_type("rb_alloc_func_t") $CFLAGS = - "#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE=1 " << - "@WARN_CFLAGS@ @WERROR_CFLAGS@" + "#{$CFLAGS} " << + "@WARN_CFLAGS@ @WERROR_CFLAGS@ " << + "@CFLAGS@ -DGUESTFS_PRIVATE=1" create_header create_makefile(extension_name, "@abs_srcdir@") -- 2.13.4
On Thu, Aug 10, 2017 at 03:08:33PM +0200, Pino Toscano wrote:
Shuffle the order of the various CFLAGS used when building the Ruby extension: first the flags from manywarnings (gnulib), then libguestfs own CFLAGS, and then -DGUESTFS_PRIVATE=1 (so it is not overridden).
This matches also what happens in automake parts, and makes it possible to override any flags from manywarnings also in the Ruby extension. --- ruby/ext/guestfs/extconf.rb.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ruby/ext/guestfs/extconf.rb.in b/ruby/ext/guestfs/extconf.rb.in index c4551fa6c..6b806101e 100644 --- a/ruby/ext/guestfs/extconf.rb.in +++ b/ruby/ext/guestfs/extconf.rb.in @@ -33,8 +33,9 @@ have_func("rb_define_alloc_func") have_type("rb_alloc_func_t")
$CFLAGS = - "#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE=1 " << - "@WARN_CFLAGS@ @WERROR_CFLAGS@" + "#{$CFLAGS} " << + "@WARN_CFLAGS@ @WERROR_CFLAGS@ " << + "@CFLAGS@ -DGUESTFS_PRIVATE=1"
create_header create_makefile(extension_name, "@abs_srcdir@")
ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Checking out sources from https://github.com/libguestfs/libguestfs ... /var/tmp/tmpVA_rVY/libguestfs /var/tmp/tmpVA_rVY Reset branch 'master' Branch master set up to track remote branch master from origin. Your branch is up-to-date with 'origin/master'. >From github.com:libguestfs/libguestfs 91b293b3f..3050a5862 master -> origin/master * [new branch] rhel-7.5 -> origin/rhel-7.5 Updating 91b293b3f..3050a5862 Fast-forward ruby/ext/guestfs/extconf.rb.in | 5 +++-- valgrind-suppressions | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) /var/tmp/tmpVA_rVY Applying patches ... /var/tmp/tmpVA_rVY/libguestfs /var/tmp/tmpVA_rVY error: patch failed: ruby/ext/guestfs/extconf.rb.in:33 error: ruby/ext/guestfs/extconf.rb.in: patch does not apply Applying: ruby: fix order of CFLAGS Patch failed at 0001 ruby: fix order of CFLAGS The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Checking out sources from https://github.com/libguestfs/libguestfs ... /var/tmp/tmppp6jwQ/libguestfs /var/tmp/tmppp6jwQ Reset branch 'master' Branch master set up to track remote branch master from origin. Your branch is up-to-date with 'origin/master'. >From github.com:libguestfs/libguestfs 91b293b3f..3050a5862 master -> origin/master * [new branch] rhel-7.5 -> origin/rhel-7.5 Updating 91b293b3f..3050a5862 Fast-forward ruby/ext/guestfs/extconf.rb.in | 5 +++-- valgrind-suppressions | 9 --------- 2 files changed, 3 insertions(+), 11 deletions(-) /var/tmp/tmppp6jwQ Applying patches ... /var/tmp/tmppp6jwQ/libguestfs /var/tmp/tmppp6jwQ error: patch failed: ruby/ext/guestfs/extconf.rb.in:33 error: ruby/ext/guestfs/extconf.rb.in: patch does not apply Applying: ruby: fix order of CFLAGS Patch failed at 0001 ruby: fix order of CFLAGS The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
participants (3)
-
Pino Toscano -
Richard Jones -
Richard W.M. Jones