Fossil SCM

Build system changes to support the Tcl stubs mechanism.

mistachkin 2012-09-29 06:56 UTC tclStubsV2
Commit 9d0a4a89d776527104a6b196326847ba8276ae5a
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
4141
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
4242
TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
4343
INSTALLDIR = $(DESTDIR)@prefix@/bin
4444
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
4545
FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46
+FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
4647
4748
include $(SRCDIR)/main.mk
4849
4950
distclean: clean
5051
rm -f autoconfig.h config.log Makefile
5152
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
 
46
47 include $(SRCDIR)/main.mk
48
49 distclean: clean
50 rm -f autoconfig.h config.log Makefile
51
--- Makefile.in
+++ Makefile.in
@@ -41,10 +41,11 @@
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
48 include $(SRCDIR)/main.mk
49
50 distclean: clean
51 rm -f autoconfig.h config.log Makefile
52
+26 -21
--- auto.def
+++ auto.def
@@ -92,35 +92,40 @@
9292
user-error "zlib not found please install it or specify the location with --with-zlib"
9393
}
9494
9595
set tclpath [opt-val with-tcl]
9696
if {$tclpath ne ""} {
97
- # Note parse-tclconfig-sh is in autosetup/local.tcl
97
+ # Note parse-tclconfig-sh is in autosetup/local.tcl
9898
if {$tclpath eq "1"} {
9999
# Use the system Tcl. Look in some likely places.
100100
array set tclconfig [parse-tclconfig-sh /usr /usr/local /usr/share /opt/local]
101
- set msg "on your system"
102
- } else {
101
+ set msg "on your system"
102
+ } else {
103103
array set tclconfig [parse-tclconfig-sh $tclpath]
104
- set msg "at $tclpath"
105
- }
106
- if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107
- user-error "Cannot find Tcl $msg"
108
- }
109
- set cflags $tclconfig(TCL_INCLUDE_SPEC)
110
- set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
111
- cc-with [list -cflags $cflags -libs $libs] {
112
- if {![cc-check-functions Tcl_CreateInterp]} {
113
- user-error "Cannot find a usable Tcl $msg"
114
- }
115
- }
116
- set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
117
- msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
118
- define-append LIBS $libs
119
- define-append EXTRA_CFLAGS $cflags
120
- define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
121
-
104
+ set msg "at $tclpath"
105
+ }
106
+ if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107
+ user-error "Cannot find Tcl $msg"
108
+ }
109
+ set tclstubs [opt-val with-tcl-stubs]
110
+ if {$tclstubs eq "1" && $tclconfig(TCL_SUPPORTS_STUBS)} {
111
+ set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
112
+ define FOSSIL_ENABLE_TCL_STUBS
113
+ } else {
114
+ set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
115
+ }
116
+ set cflags $tclconfig(TCL_INCLUDE_SPEC)
117
+ cc-with [list -cflags $cflags -libs $libs] {
118
+ if {![cc-check-functions Tcl_CreateInterp]} {
119
+ user-error "Cannot find a usable Tcl $msg"
120
+ }
121
+ }
122
+ set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
123
+ msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
124
+ define-append LIBS $libs
125
+ define-append EXTRA_CFLAGS $cflags
126
+ define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
122127
define FOSSIL_ENABLE_TCL
123128
}
124129
125130
# Helper for openssl checking
126131
proc check-for-openssl {msg {cflags {}}} {
127132
--- auto.def
+++ auto.def
@@ -92,35 +92,40 @@
92 user-error "zlib not found please install it or specify the location with --with-zlib"
93 }
94
95 set tclpath [opt-val with-tcl]
96 if {$tclpath ne ""} {
97 # Note parse-tclconfig-sh is in autosetup/local.tcl
98 if {$tclpath eq "1"} {
99 # Use the system Tcl. Look in some likely places.
100 array set tclconfig [parse-tclconfig-sh /usr /usr/local /usr/share /opt/local]
101 set msg "on your system"
102 } else {
103 array set tclconfig [parse-tclconfig-sh $tclpath]
104 set msg "at $tclpath"
105 }
106 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107 user-error "Cannot find Tcl $msg"
108 }
109 set cflags $tclconfig(TCL_INCLUDE_SPEC)
110 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
111 cc-with [list -cflags $cflags -libs $libs] {
112 if {![cc-check-functions Tcl_CreateInterp]} {
113 user-error "Cannot find a usable Tcl $msg"
114 }
115 }
116 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
117 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
118 define-append LIBS $libs
119 define-append EXTRA_CFLAGS $cflags
120 define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
121
 
 
 
 
 
122 define FOSSIL_ENABLE_TCL
123 }
124
125 # Helper for openssl checking
126 proc check-for-openssl {msg {cflags {}}} {
127
--- auto.def
+++ auto.def
@@ -92,35 +92,40 @@
92 user-error "zlib not found please install it or specify the location with --with-zlib"
93 }
94
95 set tclpath [opt-val with-tcl]
96 if {$tclpath ne ""} {
97 # Note parse-tclconfig-sh is in autosetup/local.tcl
98 if {$tclpath eq "1"} {
99 # Use the system Tcl. Look in some likely places.
100 array set tclconfig [parse-tclconfig-sh /usr /usr/local /usr/share /opt/local]
101 set msg "on your system"
102 } else {
103 array set tclconfig [parse-tclconfig-sh $tclpath]
104 set msg "at $tclpath"
105 }
106 if {![info exists tclconfig(TCL_INCLUDE_SPEC)]} {
107 user-error "Cannot find Tcl $msg"
108 }
109 set tclstubs [opt-val with-tcl-stubs]
110 if {$tclstubs eq "1" && $tclconfig(TCL_SUPPORTS_STUBS)} {
111 set libs "$tclconfig(TCL_STUB_LIB_SPEC)"
112 define FOSSIL_ENABLE_TCL_STUBS
113 } else {
114 set libs "$tclconfig(TCL_LIB_SPEC) $tclconfig(TCL_LIBS)"
115 }
116 set cflags $tclconfig(TCL_INCLUDE_SPEC)
117 cc-with [list -cflags $cflags -libs $libs] {
118 if {![cc-check-functions Tcl_CreateInterp]} {
119 user-error "Cannot find a usable Tcl $msg"
120 }
121 }
122 set version $tclconfig(TCL_VERSION)$tclconfig(TCL_PATCH_LEVEL)
123 msg-result "Found Tcl $version at $tclconfig(TCL_PREFIX)"
124 define-append LIBS $libs
125 define-append EXTRA_CFLAGS $cflags
126 define-append EXTRA_LDFLAGS $tclconfig(TCL_LD_FLAGS)
127 define FOSSIL_ENABLE_TCL
128 }
129
130 # Helper for openssl checking
131 proc check-for-openssl {msg {cflags {}}} {
132
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -476,12 +476,12 @@
476476
ifdef FOSSIL_ENABLE_TCL
477477
TCC += -DFOSSIL_ENABLE_TCL=1
478478
RCC += -DFOSSIL_ENABLE_TCL=1
479479
# Either statically linked or via stubs
480480
ifdef FOSSIL_ENABLE_TCL_STUBS
481
-TCC += -DUSE_TCL_STUBS
482
-RCC += -DUSE_TCL_STUBS
481
+TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
482
+RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
483483
else
484484
TCC += -DSTATIC_BUILD
485485
RCC += -DSTATIC_BUILD
486486
endif
487487
endif
@@ -515,11 +515,15 @@
515515
516516
#### These libraries MUST appear in the same order as they do for Tcl
517517
# or linking with it will not work (exact reason unknown).
518518
#
519519
ifdef FOSSIL_ENABLE_TCL
520
+ifdef FOSSIL_ENABLE_TCL_STUBS
521
+LIB += -lkernel32 -lws2_32
522
+else
520523
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
524
+endif
521525
else
522526
LIB += -lkernel32 -lws2_32
523527
endif
524528
525529
#### Tcl shell for use in running the fossil test suite. This is only
526530
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -476,12 +476,12 @@
476 ifdef FOSSIL_ENABLE_TCL
477 TCC += -DFOSSIL_ENABLE_TCL=1
478 RCC += -DFOSSIL_ENABLE_TCL=1
479 # Either statically linked or via stubs
480 ifdef FOSSIL_ENABLE_TCL_STUBS
481 TCC += -DUSE_TCL_STUBS
482 RCC += -DUSE_TCL_STUBS
483 else
484 TCC += -DSTATIC_BUILD
485 RCC += -DSTATIC_BUILD
486 endif
487 endif
@@ -515,11 +515,15 @@
515
516 #### These libraries MUST appear in the same order as they do for Tcl
517 # or linking with it will not work (exact reason unknown).
518 #
519 ifdef FOSSIL_ENABLE_TCL
 
 
 
520 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
 
521 else
522 LIB += -lkernel32 -lws2_32
523 endif
524
525 #### Tcl shell for use in running the fossil test suite. This is only
526
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -476,12 +476,12 @@
476 ifdef FOSSIL_ENABLE_TCL
477 TCC += -DFOSSIL_ENABLE_TCL=1
478 RCC += -DFOSSIL_ENABLE_TCL=1
479 # Either statically linked or via stubs
480 ifdef FOSSIL_ENABLE_TCL_STUBS
481 TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
482 RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
483 else
484 TCC += -DSTATIC_BUILD
485 RCC += -DSTATIC_BUILD
486 endif
487 endif
@@ -515,11 +515,15 @@
515
516 #### These libraries MUST appear in the same order as they do for Tcl
517 # or linking with it will not work (exact reason unknown).
518 #
519 ifdef FOSSIL_ENABLE_TCL
520 ifdef FOSSIL_ENABLE_TCL_STUBS
521 LIB += -lkernel32 -lws2_32
522 else
523 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
524 endif
525 else
526 LIB += -lkernel32 -lws2_32
527 endif
528
529 #### Tcl shell for use in running the fossil test suite. This is only
530
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -148,12 +148,12 @@
148148
ifdef FOSSIL_ENABLE_TCL
149149
TCC += -DFOSSIL_ENABLE_TCL=1
150150
RCC += -DFOSSIL_ENABLE_TCL=1
151151
# Either statically linked or via stubs
152152
ifdef FOSSIL_ENABLE_TCL_STUBS
153
-TCC += -DUSE_TCL_STUBS
154
-RCC += -DUSE_TCL_STUBS
153
+TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
154
+RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
155155
else
156156
TCC += -DSTATIC_BUILD
157157
RCC += -DSTATIC_BUILD
158158
endif
159159
endif
@@ -187,11 +187,15 @@
187187
188188
#### These libraries MUST appear in the same order as they do for Tcl
189189
# or linking with it will not work (exact reason unknown).
190190
#
191191
ifdef FOSSIL_ENABLE_TCL
192
+ifdef FOSSIL_ENABLE_TCL_STUBS
193
+LIB += -lkernel32 -lws2_32
194
+else
192195
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
196
+endif
193197
else
194198
LIB += -lkernel32 -lws2_32
195199
endif
196200
197201
#### Tcl shell for use in running the fossil test suite. This is only
198202
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -148,12 +148,12 @@
148 ifdef FOSSIL_ENABLE_TCL
149 TCC += -DFOSSIL_ENABLE_TCL=1
150 RCC += -DFOSSIL_ENABLE_TCL=1
151 # Either statically linked or via stubs
152 ifdef FOSSIL_ENABLE_TCL_STUBS
153 TCC += -DUSE_TCL_STUBS
154 RCC += -DUSE_TCL_STUBS
155 else
156 TCC += -DSTATIC_BUILD
157 RCC += -DSTATIC_BUILD
158 endif
159 endif
@@ -187,11 +187,15 @@
187
188 #### These libraries MUST appear in the same order as they do for Tcl
189 # or linking with it will not work (exact reason unknown).
190 #
191 ifdef FOSSIL_ENABLE_TCL
 
 
 
192 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
 
193 else
194 LIB += -lkernel32 -lws2_32
195 endif
196
197 #### Tcl shell for use in running the fossil test suite. This is only
198
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -148,12 +148,12 @@
148 ifdef FOSSIL_ENABLE_TCL
149 TCC += -DFOSSIL_ENABLE_TCL=1
150 RCC += -DFOSSIL_ENABLE_TCL=1
151 # Either statically linked or via stubs
152 ifdef FOSSIL_ENABLE_TCL_STUBS
153 TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
154 RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
155 else
156 TCC += -DSTATIC_BUILD
157 RCC += -DSTATIC_BUILD
158 endif
159 endif
@@ -187,11 +187,15 @@
187
188 #### These libraries MUST appear in the same order as they do for Tcl
189 # or linking with it will not work (exact reason unknown).
190 #
191 ifdef FOSSIL_ENABLE_TCL
192 ifdef FOSSIL_ENABLE_TCL_STUBS
193 LIB += -lkernel32 -lws2_32
194 else
195 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
196 endif
197 else
198 LIB += -lkernel32 -lws2_32
199 endif
200
201 #### Tcl shell for use in running the fossil test suite. This is only
202
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -148,12 +148,12 @@
148148
ifdef FOSSIL_ENABLE_TCL
149149
TCC += -DFOSSIL_ENABLE_TCL=1
150150
RCC += -DFOSSIL_ENABLE_TCL=1
151151
# Either statically linked or via stubs
152152
ifdef FOSSIL_ENABLE_TCL_STUBS
153
-TCC += -DUSE_TCL_STUBS
154
-RCC += -DUSE_TCL_STUBS
153
+TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
154
+RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
155155
else
156156
TCC += -DSTATIC_BUILD
157157
RCC += -DSTATIC_BUILD
158158
endif
159159
endif
@@ -187,11 +187,15 @@
187187
188188
#### These libraries MUST appear in the same order as they do for Tcl
189189
# or linking with it will not work (exact reason unknown).
190190
#
191191
ifdef FOSSIL_ENABLE_TCL
192
+ifdef FOSSIL_ENABLE_TCL_STUBS
193
+LIB += -lkernel32 -lws2_32
194
+else
192195
LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
196
+endif
193197
else
194198
LIB += -lkernel32 -lws2_32
195199
endif
196200
197201
#### Tcl shell for use in running the fossil test suite. This is only
198202
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -148,12 +148,12 @@
148 ifdef FOSSIL_ENABLE_TCL
149 TCC += -DFOSSIL_ENABLE_TCL=1
150 RCC += -DFOSSIL_ENABLE_TCL=1
151 # Either statically linked or via stubs
152 ifdef FOSSIL_ENABLE_TCL_STUBS
153 TCC += -DUSE_TCL_STUBS
154 RCC += -DUSE_TCL_STUBS
155 else
156 TCC += -DSTATIC_BUILD
157 RCC += -DSTATIC_BUILD
158 endif
159 endif
@@ -187,11 +187,15 @@
187
188 #### These libraries MUST appear in the same order as they do for Tcl
189 # or linking with it will not work (exact reason unknown).
190 #
191 ifdef FOSSIL_ENABLE_TCL
 
 
 
192 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
 
193 else
194 LIB += -lkernel32 -lws2_32
195 endif
196
197 #### Tcl shell for use in running the fossil test suite. This is only
198
--- win/Makefile.mingw.mistachkin
+++ win/Makefile.mingw.mistachkin
@@ -148,12 +148,12 @@
148 ifdef FOSSIL_ENABLE_TCL
149 TCC += -DFOSSIL_ENABLE_TCL=1
150 RCC += -DFOSSIL_ENABLE_TCL=1
151 # Either statically linked or via stubs
152 ifdef FOSSIL_ENABLE_TCL_STUBS
153 TCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
154 RCC += -DFOSSIL_ENABLE_TCL_STUBS=1 -DUSE_TCL_STUBS
155 else
156 TCC += -DSTATIC_BUILD
157 RCC += -DSTATIC_BUILD
158 endif
159 endif
@@ -187,11 +187,15 @@
187
188 #### These libraries MUST appear in the same order as they do for Tcl
189 # or linking with it will not work (exact reason unknown).
190 #
191 ifdef FOSSIL_ENABLE_TCL
192 ifdef FOSSIL_ENABLE_TCL_STUBS
193 LIB += -lkernel32 -lws2_32
194 else
195 LIB += -lnetapi32 -lkernel32 -luser32 -ladvapi32 -lws2_32
196 endif
197 else
198 LIB += -lkernel32 -lws2_32
199 endif
200
201 #### Tcl shell for use in running the fossil test suite. This is only
202

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button