Skip to content

Commit

Permalink
configure: Default to --full
Browse files Browse the repository at this point in the history
Now use --minimal and/or --without-ext to disable things.

Signed-off-by: Steve Bennett <[email protected]>
  • Loading branch information
msteveb committed Feb 13, 2023
1 parent aa18a0d commit ccd47be
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: sudo apt install libsqlite3-dev libhiredis-dev

- name: configure
run: ./configure --maintainer --full --allextmod --disable-docs
run: ./configure --maintainer --allextmod --disable-docs

- name: Build
run: make
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ addons:
- libsqlite3-dev
- libhiredis-dev
before_script:
- ./configure --maintainer --full --allextmod --disable-docs
- ./configure --maintainer --allextmod --disable-docs
script:
- make all test
- ./test-bootstrap-jim
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ install:
- cmd: C:\msys64\usr\bin\bash -lc "pacman --sync --noconfirm make mingw-w64-i686-gcc mingw-w64-i686-sqlite3"
- cmd: cd C:\projects & mklink /D %APPVEYOR_PROJECT_NAME% %APPVEYOR_PROJECT_SLUG% & exit 0
build_script:
- cmd: C:\msys64\usr\bin\bash -lc "cd /c/projects/jimtcl; ./configure --full --ssl --with-ext='sqlite3 win32 zlib' --disable-docs CFLAGS=-D__MINGW_USE_VC2005_COMPAT"
- cmd: C:\msys64\usr\bin\bash -lc "cd /c/projects/jimtcl; ./configure --ssl --with-ext='sqlite3 win32 zlib' --disable-docs CFLAGS=-D__MINGW_USE_VC2005_COMPAT"
- cmd: C:\msys64\usr\bin\bash -lc "cd /c/projects/jimtcl; make"
test_script:
- cmd: C:\msys64\usr\bin\bash -lc "cd /c/projects/jimtcl; make test"
Expand Down
64 changes: 38 additions & 26 deletions auto.def
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ define CFLAGS [get-env CFLAGS ""]
define CXXFLAGS [get-env CFLAGS ""]

options {
utf8 => "Include support for utf8-encoded strings"
utf8=1 => "Disable support for utf8-encoded strings"
lineedit=1 => "Disable line editing"
references=1 => "Disable support for references"
math => "Include support for math functions"
ssl => "Include ssl/tls support in the aio extension"
ipv6 => "Include ipv6 support in the aio extension"
math=1 => "Disable math functions"
ssl=1 => "Disable ssl/tls support in the aio extension"
ipv6=1 => "Disable ipv6 support in the aio extension"
maintainer => {Enable the [debug] command and JimPanic}
full => "Enable some optional features: ipv6, ssl, math, utf8, and some extensions (see --extinfo)"
minimal => "Disable some optional features: ipv6, ssl, math, utf8 and some extensions. Also see --without-ext=default"
# Note that full is now the default
full
allextmod => "Enable all non-default extensions as modules if prerequisites are found"
compat => "Enable some backward compatibility behaviour"
extinfo => "Show information about available extensions"
Expand Down Expand Up @@ -55,6 +57,7 @@ options {
# off=Off unless explicitly enabled or required by an enabled extension
# optional=Off by default, but selected by --full
# cpp=Is a C++ extension
# always=Always include, even if minimal
global extdb

foreach {mod attrs help} {
Expand All @@ -76,7 +79,7 @@ foreach {mod attrs help} {
nshelper { tcl off } {}
oo { tcl } {Object Oriented class support}
pack {} {Low level binary pack and unpack}
package { static } {Package management with the package command}
package { static always } {Package management with the package command}
posix {} {Posix APIs including os.fork, os.uptime}
readdir {} {Read the contents of a directory (used by glob)}
readline { off } {Interface to libreadline}
Expand All @@ -86,7 +89,7 @@ foreach {mod attrs help} {
sdl { off } {SDL graphics interface}
signal { static } {Signal handling}
sqlite3 { off } {Interface to sqlite3 database}
stdlib { tcl static } {Built-in commands including lambda, stacktrace and some dict subcommands}
stdlib { tcl static always } {Built-in commands including lambda, stacktrace and some dict subcommands}
syslog {} {System logging with syslog}
tclcompat { tcl static } {Tcl compatible read, gets, puts, parray, case, ...}
tclprefix { optional } {Support for the tcl::prefix command}
Expand All @@ -98,6 +101,10 @@ foreach {mod attrs help} {
dict set extdb help $mod $help
}

if {[opt-bool full]} {
user-notice "Note that --full is now the default, and need not be specified (see --minimal)"
}

if {[opt-bool extinfo]} {
use text-formatting
use help
Expand Down Expand Up @@ -138,7 +145,7 @@ if {[opt-bool extinfo]} {
}
showmods "These extensions are enabled by default:" $info default
nl
showmods "These are disabled by default, but enabled by --full:" $info optional
showmods "These are enabled by default, but disabled by --minimal:" $info optional
nl
showmods {
These are disabled unless explicitly enabled or --allextmod is selected and
Expand Down Expand Up @@ -375,20 +382,23 @@ cc-with {-includes sys/stat.h} {
set extra_objs {}
set jimregexp 0

# Returns 1 if either the given option is enabled, or
# --full is enabled and the option isn't explicitly disabled
#
proc opt-bool-or-full {opt} {
if {[opt-bool $opt]} {
return 1
}
if {[opt-bool full] && [opt-bool -nodefault $opt] != 0} {
return 1
}
return 0
# Like opt-bool except defaults to on normally and off if --minimal
# In either case if explicitly enable or disabled, that takes precedence
proc opt-bool-unless-minimal {opt} {
if {[opt-bool minimal]} {
set default 0
} else {
set default 1
}
# If not explicitly enabled/disabled, use the default based on --minimal
set val [opt-bool -nodefault $opt]
if {$val < 0} {
set val $default
}
return $val
}

if {[opt-bool-or-full utf8]} {
if {[opt-bool-unless-minimal utf8]} {
msg-result "Enabling UTF-8"
define JIM_UTF8
define-append AS_CFLAGS -DUSE_UTF8
Expand All @@ -401,19 +411,18 @@ if {[opt-bool maintainer]} {
msg-result "Enabling maintainer settings"
define JIM_MAINTAINER
}
# If --math or --full and not --disable-math
if {[opt-bool-or-full math]} {
if {[opt-bool-unless-minimal math]} {
msg-result "Enabling math functions"
define JIM_MATH_FUNCTIONS
cc-check-function-in-lib sin m
define-append LDLIBS [get-define lib_sin]
}
if {[opt-bool-or-full ipv6]} {
if {[opt-bool-unless-minimal ipv6]} {
msg-result "Enabling IPv6"
define JIM_IPV6
}
define-append PKG_CONFIG_REQUIRES ""
if {[opt-bool-or-full ssl]} {
if {[opt-bool-unless-minimal ssl]} {
if {[pkg-config-init 0]} {
foreach pkg {openssl libssl} {
if {[pkg-config $pkg]} {
Expand Down Expand Up @@ -441,7 +450,7 @@ if {[opt-bool-or-full ssl]} {
define-append AS_CFLAGS -DUSE_TLSv1_2_method
}
}
if {[opt-bool-or-full lineedit]} {
if {[opt-bool-unless-minimal lineedit]} {
if {([cc-check-includes termios.h] && [have-feature isatty]) || [have-feature winconsole]} {
msg-result "Enabling line editing"
define USE_LINENOISE
Expand Down Expand Up @@ -511,7 +520,10 @@ set withinfo(without) [join-ext-names [opt-val {without-ext with-out-jim-ext}]]
set withinfo(ext) [join-ext-names [opt-val {with-ext with-jim-ext}]]
set withinfo(mod) [join-ext-names [opt-val {with-mod with-jim-extmod}]]
set withinfo(nodefault) 0
set withinfo(optional) [opt-bool full]
set withinfo(optional) 1
if {[opt-bool minimal]} {
set withinfo(optional) 0
}
if {$withinfo(without) eq "default"} {
set withinfo(without) {}
set withinfo(nodefault) 1
Expand Down
43 changes: 22 additions & 21 deletions autosetup/local.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,28 @@ proc check-extensions {allextmod} {
set withinfo(maybemod) {}

# Now work out the default status. We have.
# 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 off]} {
if {$allextmod} {
lappend withinfo(maybemod) $i
}
continue
}
if {[ext-has $i optional] && !$withinfo(optional)} {
if {$allextmod} {
lappend withinfo(maybemod) $i
}
continue
}
lappend withinfo(maybe) $i
}
# normal case: include !off, !optional if possible
# --without=default: only include always
foreach i $extlist {
if {$withinfo(nodefault)} {
if {[ext-has $i always]} {
lappend withinfo(maybe) $i
}
continue
}
if {[ext-has $i off]} {
if {$allextmod} {
lappend withinfo(maybemod) $i
}
continue
}
if {[ext-has $i optional] && !$withinfo(optional)} {
if {$allextmod} {
lappend withinfo(maybemod) $i
}
continue
}
lappend withinfo(maybe) $i
}

foreach i $extlist {
Expand Down

0 comments on commit ccd47be

Please sign in to comment.