nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nitc & niti: move the duplicated pkg-config checks to the pkgconfig module
[nit.git]
/
src
/
compiler
/
abstract_compiler.nit
diff --git
a/src/compiler/abstract_compiler.nit
b/src/compiler/abstract_compiler.nit
index
a3a0bc8
..
1a1bb07
100644
(file)
--- a/
src/compiler/abstract_compiler.nit
+++ b/
src/compiler/abstract_compiler.nit
@@
-24,6
+24,7
@@
import c_tools
private import annotation
import mixin
import counter
private import annotation
import mixin
import counter
+import pkgconfig
# Add compiling options
redef class ToolContext
# Add compiling options
redef class ToolContext
@@
-188,6
+189,8
@@
class MakefileToolchain
var time1 = get_time
self.toolcontext.info("*** END WRITING C: {time1-time0} ***", 2)
var time1 = get_time
self.toolcontext.info("*** END WRITING C: {time1-time0} ***", 2)
+ if not toolcontext.check_errors then return
+
# Execute the Makefile
if self.toolcontext.opt_no_cc.value then return
# Execute the Makefile
if self.toolcontext.opt_no_cc.value then return
@@
-466,14
+469,19
@@
endif
f.close
end
f.close
end
- var java_files = new Array[ExternFile]
-
+ # pkg-config annotation support
var pkgconfigs = new Array[String]
for f in compiler.extern_bodies do
pkgconfigs.add_all f.pkgconfigs
end
var pkgconfigs = new Array[String]
for f in compiler.extern_bodies do
pkgconfigs.add_all f.pkgconfigs
end
- # Protect pkg-config
+
+ # Only test if pkg-config is used
if not pkgconfigs.is_empty then
if not pkgconfigs.is_empty then
+
+ # Check availability of pkg-config, silence the proc output
+ toolcontext.check_pkgconfig_packages pkgconfigs
+
+ # Double the check in the Makefile in case it's distributed
makefile.write """
# does pkg-config exists?
ifneq ($(shell which pkg-config >/dev/null; echo $$?), 0)
makefile.write """
# does pkg-config exists?
ifneq ($(shell which pkg-config >/dev/null; echo $$?), 0)
@@
-491,6
+499,7
@@
endif
end
# Compile each required extern body into a specific .o
end
# Compile each required extern body into a specific .o
+ var java_files = new Array[ExternFile]
for f in compiler.extern_bodies do
var o = f.makefile_rule_name
var ff = f.filename.basename
for f in compiler.extern_bodies do
var o = f.makefile_rule_name
var ff = f.filename.basename