mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 06:06:40 +00:00
Merge pull request #49 from jimeh/fix-portability
fix: improve portability of builds
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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(' ')
|
||||
|
||||
@@ -652,11 +652,35 @@ class LibEmbedder < AbstractEmbedder
|
||||
FileUtils.cd(File.dirname(app)) do
|
||||
copy_libs(binary)
|
||||
copy_extra_libs(extra_libs, binary) if extra_libs.any?
|
||||
if eln_files.any?
|
||||
info "Embedding libraries for #{eln_files.size} *.eln files " \
|
||||
'within Emacs.app'
|
||||
rel_path = Pathname.new(lib_dir).relative_path_from(
|
||||
Pathname.new(File.dirname(binary))
|
||||
).to_s
|
||||
eln_files.each { |f| copy_libs(f, rel_path) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def eln_files
|
||||
@eln_files ||= Dir[
|
||||
File.join(
|
||||
app, 'Contents', 'Resources', 'native-lisp', '**', '*.eln'
|
||||
),
|
||||
File.join(
|
||||
app, 'Contents', 'MacOS', 'lib', 'emacs', '**',
|
||||
'native-lisp', '**', '*.eln'
|
||||
),
|
||||
File.join(
|
||||
app, 'Contents', 'MacOS', 'libexec', 'emacs', '**',
|
||||
'eln-cache', '**', '*.eln'
|
||||
)
|
||||
]
|
||||
end
|
||||
|
||||
def copy_libs(exe, rel_path = nil)
|
||||
exe_file = File.basename(exe)
|
||||
rel_path ||= Pathname.new(lib_dir).relative_path_from(
|
||||
@@ -880,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,
|
||||
@@ -921,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|
|
||||
|
||||
Reference in New Issue
Block a user