diff --git a/README.md b/README.md index eadb3bd..2566cff 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ Options: --git-sha SHA Override detected git SHA of specified branch allowing builds of old commits --[no-]xwidgets Enable/disable XWidgets if supported (default: enabled) --[no-]native-comp Enable/disable native-comp (default: enabled if supported) + --[no-]native-march Enable/disable -march=native CFLAG(default: disabled) --[no-]native-full-aot Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation (default: disabled) --[no-]rsvg Enable/disable SVG image support via librsvg (default: enabled) --no-titlebar Apply no-titlebar patch (default: disabled) diff --git a/build-emacs-for-macos b/build-emacs-for-macos index cd3fc27..2b81054 100755 --- a/build-emacs-for-macos +++ b/build-emacs-for-macos @@ -267,7 +267,7 @@ class Build "-I#{File.join(gcc_info.root_dir, 'include')}", "-I#{File.join(gcc_info.libgccjit_root_dir, 'include')}", '-O2', - '-march=native', + (options[:native_march] ? '-march=native' : nil), ENV['CFLAGS'] ].compact.join(' ') @@ -904,6 +904,7 @@ if __FILE__ == $PROGRAM_NAME cli_options = { work_dir: File.expand_path(__dir__), native_full_aot: false, + native_march: false, parallel: Etc.nprocessors, rsvg: true, xwidgets: true, @@ -945,6 +946,12 @@ if __FILE__ == $PROGRAM_NAME cli_options[:native_comp] = v end + opts.on('--[no-]native-march', + 'Enable/disable -march=native CFLAG' \ + '(default: disabled)') do |v| + cli_options[:native_march] = v + end + opts.on('--[no-]native-full-aot', 'Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation ' \ '(default: disabled)') do |v|