Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created February 26, 2014 22:49
Show Gist options
  • Save FooBarWidget/9240430 to your computer and use it in GitHub Desktop.
Save FooBarWidget/9240430 to your computer and use it in GitHub Desktop.
def boolean_option(name, default_value = false)
value = ENV[name]
if value.nil? || value.empty?
return default_value
else
return value == "yes" || value == "on" || value == "true" || value == "1"
end
end
#ENV['USE_ASAN'] = '1'
ENV['CC'] ||= 'ccache clang -fcolor-diagnostics -Qunused-arguments'
ENV['CXX'] ||= 'ccache clang++ -fcolor-diagnostics -Qunused-arguments'
LDFLAGS = ""
LDFLAGS << " -faddress-sanitizer" if boolean_option('USE_ASAN', false)
LDFLAGS.strip!
task :configure do
sh "./configure --prefix=`pwd`/inst" +
" --with-cc-opt='-I/usr/local/openssl101/include -pipe'" +
" --with-ld-opt='-L/usr/local/openssl101/lib #{LDFLAGS}'" +
" --add-module=$HOME/Projects/passenger/ext/nginx" +
" --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_spdy_module" +
" --with-debug"
if RUBY_PLATFORM =~ /darwin/
sh "sed", "-E", "-i", "", "s/ -O[0-9]? / -ggdb /g", "objs/Makefile"
else
sh "sed", "-E", "-i", 's/ -O[0-9]? / -ggdb /g', "objs/Makefile"
end
end
task :configure_commercial do
sh "./configure --prefix=`pwd`/inst " +
" --with-cc-opt='-I/usr/local/openssl101/include -pipe'" +
" --with-ld-opt='-L/usr/local/openssl101/lib #{LDFLAGS}'" +
" --add-module=$HOME/Projects/commercial_passenger/ext/nginx" +
" --with-http_ssl_module --with-http_gzip_static_module" +
" --with-debug"
if RUBY_PLATFORM =~ /darwin/
sh "sed", "-E", "-i", "", "s/ -O[0-9]? / -ggdb /g", "objs/Makefile"
else
sh "sed -i 's/ -O\\d? / -ggdb /g' objs/Makefile"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment