mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-16 14:12:56 +01:00
31 lines
1.0 KiB
Diff
31 lines
1.0 KiB
Diff
Link against system-provided libpg_query and xxhash, and respect our CFLAGS.
|
|
|
|
--- a/ext/pg_query/extconf.rb
|
|
+++ b/ext/pg_query/extconf.rb
|
|
@@ -5,11 +5,11 @@
|
|
require 'open-uri'
|
|
require 'pathname'
|
|
|
|
-$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
|
|
+$CFLAGS << " #{ENV["CFLAGS"]}"
|
|
+$CFLAGS << " -O3" unless $CFLAGS[/-O\d/]
|
|
+$CFLAGS << " -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable"
|
|
|
|
-$CFLAGS << " -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -g"
|
|
-
|
|
-$INCFLAGS = "-I#{File.join(__dir__, 'include')} " + $INCFLAGS
|
|
+$LDFLAGS << " -lpg_query -lxxhash"
|
|
|
|
SYMFILE = File.join(__dir__, 'pg_query_ruby.sym')
|
|
if RUBY_PLATFORM =~ /darwin/
|
|
--- a/ext/pg_query/pg_query_ruby.c
|
|
+++ b/ext/pg_query/pg_query_ruby.c
|
|
@@ -1,5 +1,5 @@
|
|
-#include "pg_query.h"
|
|
-#include "xxhash/xxhash.h"
|
|
+#include <pg_query.h>
|
|
+#include <xxhash.h>
|
|
#include <ruby.h>
|
|
|
|
void raise_ruby_parse_error(PgQueryProtobufParseResult result);
|