From 06bc980aebf49a717bf9e46fc816ca14ae4740cc Mon Sep 17 00:00:00 2001 From: Lionel Orry Date: Fri, 29 Apr 2011 15:53:21 +0800 Subject: Nicely continue when a header is not found. This is needed because depending on the efl configuration, some header files may not be installed. We show a message to indicate no bindings will be generated though. --- tools/extract-api.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/extract-api.sh b/tools/extract-api.sh index 29844aa..254a693 100755 --- a/tools/extract-api.sh +++ b/tools/extract-api.sh @@ -37,6 +37,11 @@ for header in \ "${INCLUDE}/elementary-0/Elementary.h" \ ; do # + if [ ! -e "$header" ]; then + echo "$header not found, we won't generate bindings for this header." + continue + fi + # DIR=$(dirname $header) FILE=$(basename $header) # -- cgit v1.1-2-g2b99 From cd09ccaf2c48dce97c8df94a922ead968549a494 Mon Sep 17 00:00:00 2001 From: Lionel Orry Date: Fri, 29 Apr 2011 15:54:57 +0800 Subject: make genruby.rb compliant with ruby 1.8. The 'typedef enum' regexp has been simplified a lot, it seems to me that it's sufficient like that. --- tools/genruby.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/genruby.rb b/tools/genruby.rb index fafa6a9..4177447 100755 --- a/tools/genruby.rb +++ b/tools/genruby.rb @@ -157,7 +157,7 @@ def gen_enums path, indent r = [] open(path+'-enums','r').readlines.each do |l| l.strip! - if not l=~/(typedef enum(?: \w+)?) {([A-Z0-9_ (\s*=\s*-?[\d+]),]+)} (\w+);/ + if not l=~/(typedef enum(?: \w+)?) \{([-A-Z0-9_=, ]+)\} (\w+);/ r << indent+"# #{l}\n#{indent}# FIXME" next end @@ -239,12 +239,12 @@ def gen_functions path, indent r end # -Dir.mkdir lib_path unless Dir.exists? lib_path +Dir.mkdir lib_path unless (File.exists? lib_path) # libraries.collect do |header,module_name,fct_prefix,lib, output| base = File.join path, 'api', header output = File.join lib_path, output - Dir.mkdir File.dirname output unless Dir.exists? File.dirname output + Dir.mkdir File.dirname(output) unless File.exists? File.dirname(output) printf "%-60s", "parse #{base}-*" r = [lib, output, module_name, fct_prefix ] print "enums, " -- cgit v1.1-2-g2b99 From 2dee77f043a66caefe9ee33b351a7dfe4a1cef13 Mon Sep 17 00:00:00 2001 From: Lionel Orry Date: Fri, 29 Apr 2011 16:02:05 +0800 Subject: use the shebang line from genruby.rb for its invocation It's too restrictive to call 'ruby' manually. --- tasks/ffi.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/ffi.rake b/tasks/ffi.rake index 7ab3ffb..0ade669 100644 --- a/tasks/ffi.rake +++ b/tasks/ffi.rake @@ -12,7 +12,7 @@ namespace :ffi do # desc "generate ffi bindings" task :ruby do - sh 'ruby ./tools/genruby.rb' + sh './tools/genruby.rb' end end # -- cgit v1.1-2-g2b99