summaryrefslogtreecommitdiff
path: root/autosetup/local.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'autosetup/local.tcl')
-rw-r--r--autosetup/local.tcl31
1 files changed, 22 insertions, 9 deletions
diff --git a/autosetup/local.tcl b/autosetup/local.tcl
index bf86c5c..ba2bb3d 100644
--- a/autosetup/local.tcl
+++ b/autosetup/local.tcl
@@ -32,7 +32,7 @@ proc ext-get-status {ext} {
return ?
}
-proc check-extension-status {ext required} {
+proc check-extension-status {ext required {asmodule 0}} {
global withinfo
set status [ext-get-status $ext]
@@ -79,7 +79,13 @@ proc check-extension-status {ext required} {
}
}
- if {$ext in $withinfo(mod)} {
+ # asmodule=1 means that the parent is a module so
+ # any automatically selected dependencies should also be modules
+ if {$asmodule == 0 && $ext in $withinfo(mod)} {
+ set asmodule 1
+ }
+
+ if {$asmodule} {
# This is a module, so ignore LIBS
# LDLIBS_$ext will contain the appropriate libs for this module
define LIBS $LIBS
@@ -88,7 +94,7 @@ proc check-extension-status {ext required} {
if {$depinfo(n) == 0} {
# Now extension dependencies
foreach i [ext-get $ext dep] {
- set status [check-extension-status $i $required]
+ set status [check-extension-status $i $required $asmodule]
#puts "$ext: dep $i $required => $status"
incr depinfo($status)
if {$depinfo(n)} {
@@ -108,8 +114,8 @@ proc check-extension-status {ext required} {
return [ext-set-status $ext n]
}
- # Selected as a module?
- if {$ext in $withinfo(mod)} {
+ # Selected as a module directly or because of a parent dependency?
+ if {$asmodule} {
if {[ext-has $ext tcl]} {
# Easy, a Tcl module
msg-result "Extension $ext...tcl"
@@ -121,6 +127,7 @@ proc check-extension-status {ext required} {
define-append LDLIBS_$ext [pkg-config-get $pkg LIBS]
define-append LDFLAGS [pkg-config-get $pkg LDFLAGS]
define-append CCOPTS [pkg-config-get $pkg CFLAGS]
+ define-append PKG_CONFIG_REQUIRES $pkg
} else {
foreach i [ext-get $ext libdep] {
define-append LDLIBS_$ext [get-define $i ""]
@@ -145,6 +152,7 @@ proc check-extension-status {ext required} {
define-append LDLIBS [pkg-config-get $pkg LIBS]
define-append LDFLAGS [pkg-config-get $pkg LDFLAGS]
define-append CCOPTS [pkg-config-get $pkg CFLAGS]
+ define-append PKG_CONFIG_REQUIRES $pkg
} else {
foreach i [ext-get $ext libdep] {
define-append LDLIBS [get-define $i ""]
@@ -178,15 +186,20 @@ proc check-extensions {} {
set withinfo(maybe) {}
# Now work out the default status. We have.
- # normal case, include !optional if possible
- # --without=default, don't include optional
+ # normal case, include !off, !optional if possible
+ # --full, include !off if possible
+ # --without=default, don't include optional or off
if {$withinfo(nodefault)} {
lappend withinfo(maybe) stdlib
} else {
foreach i $extlist {
- if {![ext-has $i optional]} {
- lappend withinfo(maybe) $i
+ if {[ext-has $i off]} {
+ continue
+ }
+ if {[ext-has $i optional] && !$withinfo(optional)} {
+ continue
}
+ lappend withinfo(maybe) $i
}
}