tasks/compile.rake in webroar-0.2.6 vs tasks/compile.rake in webroar-0.3.0
- old
+ new
@@ -99,10 +99,12 @@
$inc_flags = Config::expand($INCFLAGS,CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote))
else
$inc_flags = Config::expand($INCFLAGS,CONFIG.merge('hdrdir' => $hdrdir.quote, 'srcdir' => $srcdir.quote, 'arch_hdrdir' => "#$arch_hdrdir", 'top_srcdir' => $top_srcdir.quote))
end
+$inc_flags << " #{Config::CONFIG['cppflags']}" if Config::CONFIG['cppflags']
+
$c_flags = Config::expand($CFLAGS,CONFIG)
if RUBY_PLATFORM =~ /darwin/
$c_flags += " -g -O2 "
end
$debug_flags = " -DL_ERROR -DL_INFO "
@@ -136,10 +138,12 @@
include_dir.each do |dir|
$inc_flags << " -I#{dir} "
end
+$inc_flags << " #{ENV['include_flags']}" if ENV['include_flags']
+
CLEAN.include(File.join(OBJ_DIR,'*.o'),File.join(WORKER_OBJ_DIR,'*.o'), File.join(YAML_OBJ_DIR,'*.o'), File.join(TEST_OBJ_DIR,'*.o'))
CLOBBER.include(File.join(BIN_DIR,'webroar-head'),File.join(BIN_DIR,'webroar-worker'), File.join(UNIT_TEST_DIR,'*.so'))
webroar_bin = File.join(BIN_DIR,"webroar-head")
worker_bin = File.join(BIN_DIR,"webroar-worker")
@@ -239,35 +243,37 @@
file worker_bin do
unless $webroar_config_called
webroar_config
end
#libraries for making executable
- $libs += $LIBS + ' ' + Config::expand($LIBRUBYARG_SHARED,CONFIG)
+ lib_flags = $libs + $LIBS + ' -L' + Config::expand($libdir,CONFIG) + ' ' + Config::expand($LIBRUBYARG_SHARED,CONFIG)
#$libs += ' '+CONFIG["LIBRUBYARG"]
- $libs += ' -lpthread '
+ #$libs += ' -lpthread '
+ lib_flags += " #{ENV['library_flags']}" if ENV['library_flags']
out_file=File.join(BIN_DIR,'webroar-worker')
object_files=FileList[File.join(WORKER_OBJ_DIR,'*.o'), helper_obj.keys, File.join(YAML_OBJ_DIR,'*.o')]
# -rdynamic option to get function name in stacktrace
- cmd="#{COMPILER} #$libs -rdynamic #{object_files} -o #{out_file}"
+ cmd="#{COMPILER} #{lib_flags} -rdynamic #{object_files} -o #{out_file}"
sh cmd
end
file webroar_bin do
unless $webroar_config_called
webroar_config
end
#libraries for making executable
- $libs += $LIBS + ' ' + Config::expand($LIBRUBYARG_SHARED,CONFIG)
+ lib_flags = $libs + $LIBS # + ' -L' + Config::expand($libdir,CONFIG) + ' ' + Config::expand($LIBRUBYARG_SHARED,CONFIG)
#$libs += ' '+CONFIG["LIBRUBYARG"]
- $libs += ' -lpthread '
+ #$libs += ' -lpthread '
+ lib_flags += " #{ENV['library_flags']}" if ENV['library_flags']
if ENV['ssl'].eql?("yes")
puts "Compiling with gnutls library."
- $libs += ' -lgnutls '
+ lib_flags += ' -L' + Config::CONFIG['libdir'] + ' -lgnutls '
end
out_file=File.join(BIN_DIR,'webroar-head')
object_files=FileList[File.join(OBJ_DIR,'*.o'),File.join(YAML_OBJ_DIR,'*.o')]
# -rdynamic option to get function name in stacktrace
- cmd="#{COMPILER} #$libs -rdynamic #{object_files} -o #{out_file}"
+ cmd="#{COMPILER} #{lib_flags} -rdynamic #{object_files} -o #{out_file}"
sh cmd
end
file webroar_bin => worker_bin
task :compile => [:create_obj_dirs, webroar_bin]