aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in23
-rw-r--r--auto.def29
-rwxr-xr-xconfigure1
3 files changed, 29 insertions, 24 deletions
diff --git a/Makefile.in b/Makefile.in
index 5c149c9..d9ef3c9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -40,8 +40,11 @@ SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS@
@else
SHOBJ_LDFLAGS ?= @SHOBJ_LDFLAGS_R@
@endif
-CFLAGS = @CFLAGS@ @CCOPTS@ @CPPFLAGS@
-CXXFLAGS = @CXXFLAGS@ @CXXOPTS@
+AS_CFLAGS = @AS_CFLAGS@
+AS_CXXFLAGS = @AS_CFLAGS@
+AS_CPPFLAGS = @AS_CPPFLAGS@
+CFLAGS ?= @CFLAGS@
+CXXFLAGS ?= @CXXFLAGS@
LDFLAGS = @LDFLAGS@
LDLIBS += @LDLIBS@
LIBS += @LIBS@
@@ -50,11 +53,9 @@ prefix ?= @prefix@
docdir = @docdir@
srcdir := @srcdir@
-CC += -Wall $(OPTIM) -I.
-CXX += -Wall $(OPTIM) -I.
+AS_CPPFLAGS += -Wall -I.
@if [get-define srcdir] ne "."
-CFLAGS += -I@srcdir@
-CXXFLAGS += -I@srcdir@
+AS_CPPFLAGS += -I@srcdir@
VPATH := @srcdir@
@endif
@@ -69,9 +70,9 @@ DEF_LD_PATH := @LD_LIBRARY_PATH@="@builddir@:$(@LD_LIBRARY_PATH@)"
@endif
@if HAVE_CXX_EXTENSIONS
-JIMSH_CC := $(CXX) $(CXXFLAGS)
+JIMSH_CC := $(CXX) $(AS_CXXFLAGS) $(CXXFLAGS)
@else
-JIMSH_CC := $(CC) $(CFLAGS)
+JIMSH_CC := $(CC) $(AS_FLAGS) $(CFLAGS)
@endif
OBJS := _load-static-exts.o jim-subcmd.o jim-interactive.o jim-format.o jim.o utf8.o jimregexp.o jimiocompat.o \
@@ -93,11 +94,11 @@ all: $(JIMSH) @C_EXT_SHOBJS@
$(ECHO) " TCLEXT _$*.c"
$(Q)@tclsh@ @srcdir@/make-c-ext.tcl $< >_$*.c
$(ECHO) " CC $@"
- $(Q)$(CC) $(CFLAGS) -c -o $@ _$*.c
+ $(Q)$(CC) $(AS_CFLAGS) $(AS_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) -c -o $@ _$*.c
.c.o:
$(ECHO) " CC $@"
- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
+ $(Q)$(CC) $(AS_CFLAGS) $(AS_CPPFLAGS) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
$(JIMSH): $(LIBJIM) jimsh.o initjimsh.o
$(ECHO) " LINK $@"
@@ -163,7 +164,7 @@ $(LIBJIM): $(OBJS)
$(Q)$(RANLIB) $@
@else
$(ECHO) " LDSO $@ libjim@SH_SOEXT@"
- $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(SH_LDFLAGS) -o $@ $(OBJS) $(LDLIBS) $(LIBS)
+ $(Q)$(CC) $(AS_CFLAGS) $(CFLAGS) $(LDFLAGS) $(SH_LDFLAGS) -o $@ $(OBJS) $(LDLIBS) $(LIBS)
@if SH_SOEXT ne LIBSOEXT
$(Q)ln -s -f $@ libjim@SH_SOEXT@
@endif
diff --git a/auto.def b/auto.def
index 7235bdd..7d565e5 100644
--- a/auto.def
+++ b/auto.def
@@ -11,6 +11,10 @@ options-defaults {
use cc cc-shared cc-db cc-lib pkg-config util
use local
+# CFLAGS, CXXFLAGS only come from the user
+define CFLAGS [get-env CFLAGS ""]
+define CXXFLAGS [get-env CFLAGS ""]
+
options {
utf8 => "Include support for utf8-encoded strings"
lineedit=1 => "Disable line editing"
@@ -190,19 +194,18 @@ if {"-Werror" in [get-define CFLAGS] && [cctest -cflags -Wno-error]} {
cc-check-types "long long"
cc-check-sizeof int
-define CCOPTS ""
-define CXXOPTS ""
-if {[cctest -cflags -fno-unwind-tables]} {
- define-append CCOPTS -fno-unwind-tables
-}
-if {[cctest -cflags -fno-asynchronous-unwind-tables]} {
- define-append CCOPTS -fno-asynchronous-unwind-tables
+# Default optimisation
+define-append AS_CPPFLAGS -O2
+
+# check, but don't add to -cflags
+cc-with {} {
+ cc-check-flags -fno-unwind-tables -fno-asynchronous-unwind-tables
}
if {[opt-bool coverage]} {
if {[cctest -link 1 -cflags --coverage]} {
# When using coverage, disable ccache and compiler optimisation
define CCACHE ""
- define-append CCOPTS --coverage -O0
+ define-append AS_CFLAGS --coverage -O0
define-append LDFLAGS --coverage
define COVERAGE 1
if {[cc-check-progs gcovr]} {
@@ -286,7 +289,7 @@ switch -glob -- $host_os {
define TCL_PLATFORM_PLATFORM windows
define TCL_PLATFORM_PATH_SEPARATOR {;}
# Target WinXP or later. Should this be configurable?
- define-append CCOPTS -D_WIN32_WINNT=0x501 -Wno-deprecated-declarations
+ define-append AS_CFLAGS -D_WIN32_WINNT=0x501 -Wno-deprecated-declarations
}
default {
# Note that cygwin is considered a unix platform
@@ -370,7 +373,7 @@ proc opt-bool-or-full {opt} {
if {[opt-bool-or-full utf8]} {
msg-result "Enabling UTF-8"
define JIM_UTF8
- define-append CCOPTS -DUSE_UTF8
+ define-append AS_CFLAGS -DUSE_UTF8
define PARSE_UNIDATA_FLAGS ""
incr jimregexp
} else {
@@ -399,7 +402,7 @@ if {[opt-bool-or-full ssl]} {
define JIM_SSL
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 AS_CFLAGS [pkg-config-get $pkg CFLAGS]
msg-result "Enabling SSL ($pkg)"
define-append PKG_CONFIG_REQUIRES $pkg
break
@@ -417,7 +420,7 @@ if {[opt-bool-or-full ssl]} {
}
# Later versions deprecate TLSv1_2_method, but older versions don't have TLS_method
if {![cc-check-function-in-lib TLS_method ssl]} {
- define-append CCOPTS -DUSE_TLSv1_2_method
+ define-append AS_CFLAGS -DUSE_TLSv1_2_method
}
}
if {[opt-bool-or-full lineedit]} {
@@ -427,7 +430,7 @@ if {[opt-bool-or-full lineedit]} {
define-append PARSE_UNIDATA_FLAGS -width
lappend extra_objs linenoise.o
if {[cc-check-inline] && [is-defined inline]} {
- define-append CCOPTS -Dinline=[get-define inline]
+ define-append AS_CFLAGS -Dinline=[get-define inline]
}
}
}
diff --git a/configure b/configure
index adac37c..64b60f8 100755
--- a/configure
+++ b/configure
@@ -1,3 +1,4 @@
#!/bin/sh
dir="`dirname "$0"`/autosetup"
+#@@INITCHECK@@#
WRAPPER="$0"; export WRAPPER; exec "`"$dir/autosetup-find-tclsh"`" "$dir/autosetup" "$@"