From d392231f9baa3880ae636e64a1a7e58eed89419c Mon Sep 17 00:00:00 2001 From: hmsk Date: Thu, 16 Jan 2025 23:02:24 -0800 Subject: [PATCH] update extconf to sync with Makefile of quickjs --- ext/quickjsrb/extconf.rb | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/ext/quickjsrb/extconf.rb b/ext/quickjsrb/extconf.rb index 2f3efea..8a3b724 100644 --- a/ext/quickjsrb/extconf.rb +++ b/ext/quickjsrb/extconf.rb @@ -16,25 +16,33 @@ append_cflags('-I$(srcdir)/quickjs') -append_cflags('-fwrapv') + append_cflags('-g') append_cflags('-O2') append_cflags('-Wall') append_cflags('-MMD') append_cflags('-MF') -append_cflags('-Wextra') -append_cflags('-Wno-sign-compare') -append_cflags('-Wno-missing-field-initializers') -append_cflags('-Wundef -Wuninitialized') -append_cflags('-Wunused -Wno-unused-parameter') -append_cflags('-Wwrite-strings') -append_cflags('-Wchar-subscripts -funsigned-char') -append_cflags('-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM') + +case CONFIG['arch'] +when /darwin/ + append_cflags('-Wextra') + append_cflags('-Wno-sign-compare') + append_cflags('-Wno-missing-field-initializers') + append_cflags('-Wundef -Wuninitialized') + append_cflags('-Wunused -Wno-unused-parameter') + append_cflags('-Wwrite-strings') + append_cflags('-Wchar-subscripts -funsigned-char') +else + append_cflags('-Wno-array-bounds -Wno-format-truncation') +end + +append_cflags('-fwrapv') +$defs.push('-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\"') +$defs.push('-DCONFIG_BIGNUM') abort('could not find quickjs.h') unless find_header('quickjs.h') abort('could not find cutils.h') unless find_header('cutils.h') abort('could not find quickjs-libc.h') unless find_header('quickjs-libc.h') -#abort('could not find libbf.h') unless find_header('libbf.h') # Makes all symbols private by default to avoid unintended conflict # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED