Pratt 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. data/.exrc +61 -0
  2. data/.gitignore +4 -0
  3. data/History.txt +6 -0
  4. data/Manifest.txt +46 -0
  5. data/Pratt.gemspec +351 -0
  6. data/README.txt +66 -0
  7. data/Rakefile +85 -0
  8. data/TODO +54 -0
  9. data/VERSION +1 -0
  10. data/bin/pratt.rb +13 -0
  11. data/config.rb +34 -0
  12. data/lib/pratt.rb +527 -0
  13. data/lib/pratt/array.rb +11 -0
  14. data/lib/pratt/string.rb +18 -0
  15. data/models/app.rb +40 -0
  16. data/models/customer.rb +24 -0
  17. data/models/payment.rb +22 -0
  18. data/models/pratt.rb +19 -0
  19. data/models/project.rb +82 -0
  20. data/models/whence.rb +70 -0
  21. data/pkgs/tile-0.8.2.tar.gz +0 -0
  22. data/pkgs/tile-0.8.2/ANNOUNCE.txt +95 -0
  23. data/pkgs/tile-0.8.2/ChangeLog +4651 -0
  24. data/pkgs/tile-0.8.2/Makefile +250 -0
  25. data/pkgs/tile-0.8.2/Makefile.in +250 -0
  26. data/pkgs/tile-0.8.2/README.txt +86 -0
  27. data/pkgs/tile-0.8.2/aclocal.m4 +2 -0
  28. data/pkgs/tile-0.8.2/altTheme.o +0 -0
  29. data/pkgs/tile-0.8.2/blink.o +0 -0
  30. data/pkgs/tile-0.8.2/button.o +0 -0
  31. data/pkgs/tile-0.8.2/cache.o +0 -0
  32. data/pkgs/tile-0.8.2/clamTheme.o +0 -0
  33. data/pkgs/tile-0.8.2/classicTheme.o +0 -0
  34. data/pkgs/tile-0.8.2/config.log +1330 -0
  35. data/pkgs/tile-0.8.2/config.status +795 -0
  36. data/pkgs/tile-0.8.2/configure +15248 -0
  37. data/pkgs/tile-0.8.2/configure.in +89 -0
  38. data/pkgs/tile-0.8.2/demos/autocomplete.tcl +59 -0
  39. data/pkgs/tile-0.8.2/demos/demo.tcl +870 -0
  40. data/pkgs/tile-0.8.2/demos/dirbrowser.tcl +167 -0
  41. data/pkgs/tile-0.8.2/demos/dlgtest.tcl +97 -0
  42. data/pkgs/tile-0.8.2/demos/iconlib.tcl +110 -0
  43. data/pkgs/tile-0.8.2/demos/repeater.tcl +117 -0
  44. data/pkgs/tile-0.8.2/demos/toolbutton.tcl +101 -0
  45. data/pkgs/tile-0.8.2/doc/Geometry.3 +230 -0
  46. data/pkgs/tile-0.8.2/doc/INDEX.MAP +153 -0
  47. data/pkgs/tile-0.8.2/doc/Makefile +36 -0
  48. data/pkgs/tile-0.8.2/doc/TILE.XML +45 -0
  49. data/pkgs/tile-0.8.2/doc/Theme.3 +34 -0
  50. data/pkgs/tile-0.8.2/doc/button.n +75 -0
  51. data/pkgs/tile-0.8.2/doc/checkbutton.n +61 -0
  52. data/pkgs/tile-0.8.2/doc/combobox.n +98 -0
  53. data/pkgs/tile-0.8.2/doc/converting.txt +97 -0
  54. data/pkgs/tile-0.8.2/doc/dialog.n +122 -0
  55. data/pkgs/tile-0.8.2/doc/entry.n +438 -0
  56. data/pkgs/tile-0.8.2/doc/frame.n +43 -0
  57. data/pkgs/tile-0.8.2/doc/html/Geometry.html +304 -0
  58. data/pkgs/tile-0.8.2/doc/html/Theme.html +48 -0
  59. data/pkgs/tile-0.8.2/doc/html/button.html +120 -0
  60. data/pkgs/tile-0.8.2/doc/html/category-index.html +18 -0
  61. data/pkgs/tile-0.8.2/doc/html/checkbutton.html +94 -0
  62. data/pkgs/tile-0.8.2/doc/html/combobox.html +164 -0
  63. data/pkgs/tile-0.8.2/doc/html/converting.txt +97 -0
  64. data/pkgs/tile-0.8.2/doc/html/dialog.html +159 -0
  65. data/pkgs/tile-0.8.2/doc/html/entry.html +613 -0
  66. data/pkgs/tile-0.8.2/doc/html/frame.html +76 -0
  67. data/pkgs/tile-0.8.2/doc/html/image.html +100 -0
  68. data/pkgs/tile-0.8.2/doc/html/index.html +25 -0
  69. data/pkgs/tile-0.8.2/doc/html/keyword-index.html +228 -0
  70. data/pkgs/tile-0.8.2/doc/html/label.html +133 -0
  71. data/pkgs/tile-0.8.2/doc/html/labelframe.html +91 -0
  72. data/pkgs/tile-0.8.2/doc/html/manpage.css +212 -0
  73. data/pkgs/tile-0.8.2/doc/html/menubutton.html +63 -0
  74. data/pkgs/tile-0.8.2/doc/html/notebook.html +280 -0
  75. data/pkgs/tile-0.8.2/doc/html/paned.html +149 -0
  76. data/pkgs/tile-0.8.2/doc/html/progressbar.html +138 -0
  77. data/pkgs/tile-0.8.2/doc/html/radiobutton.html +89 -0
  78. data/pkgs/tile-0.8.2/doc/html/scrollbar.html +221 -0
  79. data/pkgs/tile-0.8.2/doc/html/separator.html +48 -0
  80. data/pkgs/tile-0.8.2/doc/html/sizegrip.html +62 -0
  81. data/pkgs/tile-0.8.2/doc/html/style.html +172 -0
  82. data/pkgs/tile-0.8.2/doc/html/tile-intro.html +164 -0
  83. data/pkgs/tile-0.8.2/doc/html/treeview.html +634 -0
  84. data/pkgs/tile-0.8.2/doc/html/widget.html +342 -0
  85. data/pkgs/tile-0.8.2/doc/image.n +81 -0
  86. data/pkgs/tile-0.8.2/doc/internals.txt +409 -0
  87. data/pkgs/tile-0.8.2/doc/label.n +75 -0
  88. data/pkgs/tile-0.8.2/doc/labelframe.n +64 -0
  89. data/pkgs/tile-0.8.2/doc/man.macros +239 -0
  90. data/pkgs/tile-0.8.2/doc/menubutton.n +41 -0
  91. data/pkgs/tile-0.8.2/doc/notebook.n +188 -0
  92. data/pkgs/tile-0.8.2/doc/paned.n +95 -0
  93. data/pkgs/tile-0.8.2/doc/progressbar.n +79 -0
  94. data/pkgs/tile-0.8.2/doc/radiobutton.n +57 -0
  95. data/pkgs/tile-0.8.2/doc/scrollbar.n +160 -0
  96. data/pkgs/tile-0.8.2/doc/separator.n +30 -0
  97. data/pkgs/tile-0.8.2/doc/sizegrip.n +53 -0
  98. data/pkgs/tile-0.8.2/doc/style.n +119 -0
  99. data/pkgs/tile-0.8.2/doc/tile-intro.n +165 -0
  100. data/pkgs/tile-0.8.2/doc/tmml.options +4 -0
  101. data/pkgs/tile-0.8.2/doc/treeview.n +415 -0
  102. data/pkgs/tile-0.8.2/doc/widget.n +227 -0
  103. data/pkgs/tile-0.8.2/doc/xml/Geometry.tmml +379 -0
  104. data/pkgs/tile-0.8.2/doc/xml/INDEX.MAP +153 -0
  105. data/pkgs/tile-0.8.2/doc/xml/Theme.tmml +63 -0
  106. data/pkgs/tile-0.8.2/doc/xml/button.tmml +134 -0
  107. data/pkgs/tile-0.8.2/doc/xml/checkbutton.tmml +119 -0
  108. data/pkgs/tile-0.8.2/doc/xml/combobox.tmml +184 -0
  109. data/pkgs/tile-0.8.2/doc/xml/dialog.tmml +195 -0
  110. data/pkgs/tile-0.8.2/doc/xml/entry.tmml +630 -0
  111. data/pkgs/tile-0.8.2/doc/xml/frame.tmml +98 -0
  112. data/pkgs/tile-0.8.2/doc/xml/image.tmml +101 -0
  113. data/pkgs/tile-0.8.2/doc/xml/label.tmml +154 -0
  114. data/pkgs/tile-0.8.2/doc/xml/labelframe.tmml +116 -0
  115. data/pkgs/tile-0.8.2/doc/xml/menubutton.tmml +80 -0
  116. data/pkgs/tile-0.8.2/doc/xml/notebook.tmml +306 -0
  117. data/pkgs/tile-0.8.2/doc/xml/paned.tmml +154 -0
  118. data/pkgs/tile-0.8.2/doc/xml/progressbar.tmml +151 -0
  119. data/pkgs/tile-0.8.2/doc/xml/radiobutton.tmml +109 -0
  120. data/pkgs/tile-0.8.2/doc/xml/scrollbar.tmml +233 -0
  121. data/pkgs/tile-0.8.2/doc/xml/separator.tmml +59 -0
  122. data/pkgs/tile-0.8.2/doc/xml/sizegrip.tmml +82 -0
  123. data/pkgs/tile-0.8.2/doc/xml/style.tmml +171 -0
  124. data/pkgs/tile-0.8.2/doc/xml/tile-intro.tmml +192 -0
  125. data/pkgs/tile-0.8.2/doc/xml/treeview.tmml +604 -0
  126. data/pkgs/tile-0.8.2/doc/xml/widget.tmml +372 -0
  127. data/pkgs/tile-0.8.2/entry.o +0 -0
  128. data/pkgs/tile-0.8.2/frame.o +0 -0
  129. data/pkgs/tile-0.8.2/generic/Makefile.in +221 -0
  130. data/pkgs/tile-0.8.2/generic/TODO +493 -0
  131. data/pkgs/tile-0.8.2/generic/altTheme.c +1172 -0
  132. data/pkgs/tile-0.8.2/generic/blink.c +168 -0
  133. data/pkgs/tile-0.8.2/generic/button.c +858 -0
  134. data/pkgs/tile-0.8.2/generic/cache.c +354 -0
  135. data/pkgs/tile-0.8.2/generic/clamTheme.c +974 -0
  136. data/pkgs/tile-0.8.2/generic/classicTheme.c +518 -0
  137. data/pkgs/tile-0.8.2/generic/configure +10334 -0
  138. data/pkgs/tile-0.8.2/generic/configure.in +100 -0
  139. data/pkgs/tile-0.8.2/generic/entry.c +1922 -0
  140. data/pkgs/tile-0.8.2/generic/frame.c +648 -0
  141. data/pkgs/tile-0.8.2/generic/gunk.h +44 -0
  142. data/pkgs/tile-0.8.2/generic/image.c +416 -0
  143. data/pkgs/tile-0.8.2/generic/label.c +663 -0
  144. data/pkgs/tile-0.8.2/generic/layout.c +1215 -0
  145. data/pkgs/tile-0.8.2/generic/manager.c +554 -0
  146. data/pkgs/tile-0.8.2/generic/manager.h +91 -0
  147. data/pkgs/tile-0.8.2/generic/notebook.c +1380 -0
  148. data/pkgs/tile-0.8.2/generic/paned.c +958 -0
  149. data/pkgs/tile-0.8.2/generic/pkgIndex.tcl.in +7 -0
  150. data/pkgs/tile-0.8.2/generic/progress.c +549 -0
  151. data/pkgs/tile-0.8.2/generic/scale.c +526 -0
  152. data/pkgs/tile-0.8.2/generic/scroll.c +253 -0
  153. data/pkgs/tile-0.8.2/generic/scrollbar.c +346 -0
  154. data/pkgs/tile-0.8.2/generic/separator.c +132 -0
  155. data/pkgs/tile-0.8.2/generic/square.c +306 -0
  156. data/pkgs/tile-0.8.2/generic/tagset.c +147 -0
  157. data/pkgs/tile-0.8.2/generic/tile.c +296 -0
  158. data/pkgs/tile-0.8.2/generic/tkElements.c +1280 -0
  159. data/pkgs/tile-0.8.2/generic/tkTheme.c +1708 -0
  160. data/pkgs/tile-0.8.2/generic/tkTheme.h +419 -0
  161. data/pkgs/tile-0.8.2/generic/tkThemeInt.h +45 -0
  162. data/pkgs/tile-0.8.2/generic/tkstate.c +268 -0
  163. data/pkgs/tile-0.8.2/generic/trace.c +145 -0
  164. data/pkgs/tile-0.8.2/generic/track.c +174 -0
  165. data/pkgs/tile-0.8.2/generic/treeview.c +3211 -0
  166. data/pkgs/tile-0.8.2/generic/ttk.decls +154 -0
  167. data/pkgs/tile-0.8.2/generic/ttkDecls.h +340 -0
  168. data/pkgs/tile-0.8.2/generic/ttkStubInit.c +61 -0
  169. data/pkgs/tile-0.8.2/generic/ttkStubLib.c +70 -0
  170. data/pkgs/tile-0.8.2/generic/widget.c +785 -0
  171. data/pkgs/tile-0.8.2/generic/widget.h +263 -0
  172. data/pkgs/tile-0.8.2/image.o +0 -0
  173. data/pkgs/tile-0.8.2/label.o +0 -0
  174. data/pkgs/tile-0.8.2/layout.o +0 -0
  175. data/pkgs/tile-0.8.2/library/altTheme.tcl +101 -0
  176. data/pkgs/tile-0.8.2/library/aquaTheme.tcl +62 -0
  177. data/pkgs/tile-0.8.2/library/button.tcl +85 -0
  178. data/pkgs/tile-0.8.2/library/clamTheme.tcl +139 -0
  179. data/pkgs/tile-0.8.2/library/classicTheme.tcl +108 -0
  180. data/pkgs/tile-0.8.2/library/combobox.tcl +439 -0
  181. data/pkgs/tile-0.8.2/library/cursors.tcl +36 -0
  182. data/pkgs/tile-0.8.2/library/defaults.tcl +118 -0
  183. data/pkgs/tile-0.8.2/library/dialog.tcl +274 -0
  184. data/pkgs/tile-0.8.2/library/entry.tcl +580 -0
  185. data/pkgs/tile-0.8.2/library/fonts.tcl +153 -0
  186. data/pkgs/tile-0.8.2/library/icons.tcl +105 -0
  187. data/pkgs/tile-0.8.2/library/keynav.tcl +192 -0
  188. data/pkgs/tile-0.8.2/library/menubutton.tcl +171 -0
  189. data/pkgs/tile-0.8.2/library/notebook.tcl +193 -0
  190. data/pkgs/tile-0.8.2/library/paned.tcl +87 -0
  191. data/pkgs/tile-0.8.2/library/progress.tcl +51 -0
  192. data/pkgs/tile-0.8.2/library/scale.tcl +54 -0
  193. data/pkgs/tile-0.8.2/library/scrollbar.tcl +125 -0
  194. data/pkgs/tile-0.8.2/library/sizegrip.tcl +77 -0
  195. data/pkgs/tile-0.8.2/library/tile.tcl +211 -0
  196. data/pkgs/tile-0.8.2/library/treeview.tcl +382 -0
  197. data/pkgs/tile-0.8.2/library/utils.tcl +254 -0
  198. data/pkgs/tile-0.8.2/library/winTheme.tcl +77 -0
  199. data/pkgs/tile-0.8.2/library/xpTheme.tcl +63 -0
  200. data/pkgs/tile-0.8.2/libtile0.8.2.so +0 -0
  201. data/pkgs/tile-0.8.2/libttkstub.a +0 -0
  202. data/pkgs/tile-0.8.2/license.terms +24 -0
  203. data/pkgs/tile-0.8.2/macosx/aquaTheme.c +1076 -0
  204. data/pkgs/tile-0.8.2/manager.o +0 -0
  205. data/pkgs/tile-0.8.2/notebook.o +0 -0
  206. data/pkgs/tile-0.8.2/paned.o +0 -0
  207. data/pkgs/tile-0.8.2/pkgIndex.tcl +3 -0
  208. data/pkgs/tile-0.8.2/progress.o +0 -0
  209. data/pkgs/tile-0.8.2/scale.o +0 -0
  210. data/pkgs/tile-0.8.2/scroll.o +0 -0
  211. data/pkgs/tile-0.8.2/scrollbar.o +0 -0
  212. data/pkgs/tile-0.8.2/separator.o +0 -0
  213. data/pkgs/tile-0.8.2/tagset.o +0 -0
  214. data/pkgs/tile-0.8.2/tclconfig/install-sh +119 -0
  215. data/pkgs/tile-0.8.2/tclconfig/tcl.m4 +4069 -0
  216. data/pkgs/tile-0.8.2/tclconfig/teax.m4 +109 -0
  217. data/pkgs/tile-0.8.2/tests/all.tcl +18 -0
  218. data/pkgs/tile-0.8.2/tests/bwidget.test +103 -0
  219. data/pkgs/tile-0.8.2/tests/cbtest.tcl +125 -0
  220. data/pkgs/tile-0.8.2/tests/combobox.test +51 -0
  221. data/pkgs/tile-0.8.2/tests/compound.tcl +92 -0
  222. data/pkgs/tile-0.8.2/tests/entry.test +285 -0
  223. data/pkgs/tile-0.8.2/tests/entrytest.tcl +78 -0
  224. data/pkgs/tile-0.8.2/tests/image.test +94 -0
  225. data/pkgs/tile-0.8.2/tests/labelframe.tcl +41 -0
  226. data/pkgs/tile-0.8.2/tests/labelframe.test +137 -0
  227. data/pkgs/tile-0.8.2/tests/layout.test +33 -0
  228. data/pkgs/tile-0.8.2/tests/misc.test +35 -0
  229. data/pkgs/tile-0.8.2/tests/nbtest.tcl +66 -0
  230. data/pkgs/tile-0.8.2/tests/notebook.test +500 -0
  231. data/pkgs/tile-0.8.2/tests/paned.test +298 -0
  232. data/pkgs/tile-0.8.2/tests/progress.test +92 -0
  233. data/pkgs/tile-0.8.2/tests/pwtest.tcl +90 -0
  234. data/pkgs/tile-0.8.2/tests/sbtest.tcl +79 -0
  235. data/pkgs/tile-0.8.2/tests/scrollbar.test +77 -0
  236. data/pkgs/tile-0.8.2/tests/sgtest.tcl +52 -0
  237. data/pkgs/tile-0.8.2/tests/testutils.tcl +20 -0
  238. data/pkgs/tile-0.8.2/tests/tile.test +674 -0
  239. data/pkgs/tile-0.8.2/tests/treetags.test +78 -0
  240. data/pkgs/tile-0.8.2/tests/treeview.test +563 -0
  241. data/pkgs/tile-0.8.2/tests/tvtest.tcl +332 -0
  242. data/pkgs/tile-0.8.2/tests/validate.test +278 -0
  243. data/pkgs/tile-0.8.2/tile.o +0 -0
  244. data/pkgs/tile-0.8.2/tkElements.o +0 -0
  245. data/pkgs/tile-0.8.2/tkTheme.o +0 -0
  246. data/pkgs/tile-0.8.2/tkstate.o +0 -0
  247. data/pkgs/tile-0.8.2/tools/genStubs.tcl +861 -0
  248. data/pkgs/tile-0.8.2/trace.o +0 -0
  249. data/pkgs/tile-0.8.2/track.o +0 -0
  250. data/pkgs/tile-0.8.2/treeview.o +0 -0
  251. data/pkgs/tile-0.8.2/ttkStubInit.o +0 -0
  252. data/pkgs/tile-0.8.2/ttkStubLib.o +0 -0
  253. data/pkgs/tile-0.8.2/widget.o +0 -0
  254. data/pkgs/tile-0.8.2/win/Tile.dsp +261 -0
  255. data/pkgs/tile-0.8.2/win/makefile.vc +527 -0
  256. data/pkgs/tile-0.8.2/win/monitor.c +164 -0
  257. data/pkgs/tile-0.8.2/win/nmakehlp.c +483 -0
  258. data/pkgs/tile-0.8.2/win/rules.vc +512 -0
  259. data/pkgs/tile-0.8.2/win/tile.rc +40 -0
  260. data/pkgs/tile-0.8.2/win/winTheme.c +734 -0
  261. data/pkgs/tile-0.8.2/win/xpTheme.c +1029 -0
  262. data/spec/app_spec.rb +48 -0
  263. data/spec/customer_spec.rb +31 -0
  264. data/spec/fixtures/graph.expectation +18 -0
  265. data/spec/payment_spec.rb +19 -0
  266. data/spec/pratt_spec.rb +148 -0
  267. data/spec/project_spec.rb +163 -0
  268. data/spec/rcov.opts +0 -0
  269. data/spec/spec.opts +1 -0
  270. data/spec/spec_helper.rb +21 -0
  271. data/spec/whence_spec.rb +54 -0
  272. data/tasks/pratt.rb +84 -0
  273. data/templates/model.eruby +12 -0
  274. data/templates/spec.eruby +8 -0
  275. data/views/env.rb +22 -0
  276. data/views/graph.eruby +20 -0
  277. data/views/invoice.eruby +148 -0
  278. data/views/main.rb +92 -0
  279. data/views/pid.eruby +3 -0
  280. data/views/pop.rb +94 -0
  281. data/views/pop2.rb +75 -0
  282. data/views/raw.eruby +11 -0
  283. metadata +390 -0
Binary file
Binary file
@@ -0,0 +1,3 @@
1
+ if {[catch {package require Tcl 8.4}]} return
2
+ package ifneeded tile 0.8.2 \
3
+ [list load [file join $dir libtile0.8.2.so] tile]
Binary file
Binary file
Binary file
@@ -0,0 +1,119 @@
1
+ #!/bin/sh
2
+
3
+ #
4
+ # install - install a program, script, or datafile
5
+ # This comes from X11R5; it is not part of GNU.
6
+ #
7
+ # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
8
+ #
9
+ # This script is compatible with the BSD install script, but was written
10
+ # from scratch.
11
+ #
12
+
13
+
14
+ # set DOITPROG to echo to test this script
15
+
16
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
17
+ doit="${DOITPROG-}"
18
+
19
+
20
+ # put in absolute paths if you don't have them in your path; or use env. vars.
21
+
22
+ mvprog="${MVPROG-mv}"
23
+ cpprog="${CPPROG-cp}"
24
+ chmodprog="${CHMODPROG-chmod}"
25
+ chownprog="${CHOWNPROG-chown}"
26
+ chgrpprog="${CHGRPPROG-chgrp}"
27
+ stripprog="${STRIPPROG-strip}"
28
+ rmprog="${RMPROG-rm}"
29
+
30
+ instcmd="$mvprog"
31
+ chmodcmd=""
32
+ chowncmd=""
33
+ chgrpcmd=""
34
+ stripcmd=""
35
+ rmcmd="$rmprog -f"
36
+ mvcmd="$mvprog"
37
+ src=""
38
+ dst=""
39
+
40
+ while [ x"$1" != x ]; do
41
+ case $1 in
42
+ -c) instcmd="$cpprog"
43
+ shift
44
+ continue;;
45
+
46
+ -m) chmodcmd="$chmodprog $2"
47
+ shift
48
+ shift
49
+ continue;;
50
+
51
+ -o) chowncmd="$chownprog $2"
52
+ shift
53
+ shift
54
+ continue;;
55
+
56
+ -g) chgrpcmd="$chgrpprog $2"
57
+ shift
58
+ shift
59
+ continue;;
60
+
61
+ -s) stripcmd="$stripprog"
62
+ shift
63
+ continue;;
64
+
65
+ *) if [ x"$src" = x ]
66
+ then
67
+ src=$1
68
+ else
69
+ dst=$1
70
+ fi
71
+ shift
72
+ continue;;
73
+ esac
74
+ done
75
+
76
+ if [ x"$src" = x ]
77
+ then
78
+ echo "install: no input file specified"
79
+ exit 1
80
+ fi
81
+
82
+ if [ x"$dst" = x ]
83
+ then
84
+ echo "install: no destination specified"
85
+ exit 1
86
+ fi
87
+
88
+
89
+ # If destination is a directory, append the input filename; if your system
90
+ # does not like double slashes in filenames, you may need to add some logic
91
+
92
+ if [ -d $dst ]
93
+ then
94
+ dst="$dst"/`basename $src`
95
+ fi
96
+
97
+ # Make a temp file name in the proper directory.
98
+
99
+ dstdir=`dirname $dst`
100
+ dsttmp=$dstdir/#inst.$$#
101
+
102
+ # Move or copy the file name to the temp name
103
+
104
+ $doit $instcmd $src $dsttmp
105
+
106
+ # and set any options; do chmod last to preserve setuid bits
107
+
108
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
109
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
110
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
111
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
112
+
113
+ # Now rename the file to the real destination.
114
+
115
+ $doit $rmcmd $dst
116
+ $doit $mvcmd $dsttmp $dst
117
+
118
+
119
+ exit 0
@@ -0,0 +1,4069 @@
1
+ # tcl.m4 --
2
+ #
3
+ # This file provides a set of autoconf macros to help TEA-enable
4
+ # a Tcl extension.
5
+ #
6
+ # Copyright (c) 1999-2000 Ajuba Solutions.
7
+ # Copyright (c) 2002-2005 ActiveState Corporation.
8
+ #
9
+ # See the file "license.terms" for information on usage and redistribution
10
+ # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11
+ #
12
+ # BASED ON: @(#) tclconfig/tcl.m4 r1.117 2007/11/18 07:14:28
13
+ #
14
+
15
+ AC_PREREQ(2.57)
16
+
17
+ dnl TEA extensions pass us the version of TEA they think they
18
+ dnl are compatible with (must be set in TEA_INIT below)
19
+ dnl TEA_VERSION="3.6"
20
+
21
+ # Possible values for key variables defined:
22
+ #
23
+ # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem')
24
+ # TEA_PLATFORM - windows unix
25
+ #
26
+
27
+ #------------------------------------------------------------------------
28
+ # TEA_PATH_TCLCONFIG --
29
+ #
30
+ # Locate the tclConfig.sh file and perform a sanity check on
31
+ # the Tcl compile flags
32
+ #
33
+ # Arguments:
34
+ # none
35
+ #
36
+ # Results:
37
+ #
38
+ # Adds the following arguments to configure:
39
+ # --with-tcl=...
40
+ #
41
+ # Defines the following vars:
42
+ # TCL_BIN_DIR Full path to the directory containing
43
+ # the tclConfig.sh file
44
+ #------------------------------------------------------------------------
45
+
46
+ AC_DEFUN([TEA_PATH_TCLCONFIG], [
47
+ dnl TEA specific: Make sure we are initialized
48
+ AC_REQUIRE([TEA_INIT])
49
+ #
50
+ # Ok, lets find the tcl configuration
51
+ # First, look for one uninstalled.
52
+ # the alternative search directory is invoked by --with-tcl
53
+ #
54
+
55
+ if test x"${no_tcl}" = x ; then
56
+ # we reset no_tcl in case something fails here
57
+ no_tcl=true
58
+ AC_ARG_WITH(tcl,
59
+ AC_HELP_STRING([--with-tcl],
60
+ [directory containing tcl configuration (tclConfig.sh)]),
61
+ with_tclconfig=${withval})
62
+ AC_MSG_CHECKING([for Tcl configuration])
63
+ AC_CACHE_VAL(ac_cv_c_tclconfig,[
64
+
65
+ # First check to see if --with-tcl was specified.
66
+ if test x"${with_tclconfig}" != x ; then
67
+ case ${with_tclconfig} in
68
+ */tclConfig.sh )
69
+ if test -f ${with_tclconfig}; then
70
+ AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself])
71
+ with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'`
72
+ fi ;;
73
+ esac
74
+ if test -f "${with_tclconfig}/tclConfig.sh" ; then
75
+ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)`
76
+ else
77
+ AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
78
+ fi
79
+ fi
80
+
81
+ # then check for a private Tcl installation
82
+ if test x"${ac_cv_c_tclconfig}" = x ; then
83
+ for i in \
84
+ ../tcl \
85
+ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
86
+ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \
87
+ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
88
+ ../../tcl \
89
+ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
90
+ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
91
+ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \
92
+ ../../../tcl \
93
+ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
94
+ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \
95
+ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
96
+ if test -f "$i/unix/tclConfig.sh" ; then
97
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
98
+ break
99
+ fi
100
+ done
101
+ fi
102
+
103
+ # on Darwin, check in Framework installation locations
104
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then
105
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
106
+ `ls -d /Library/Frameworks 2>/dev/null` \
107
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
108
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
109
+ ; do
110
+ if test -f "$i/Tcl.framework/tclConfig.sh" ; then
111
+ ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)`
112
+ break
113
+ fi
114
+ done
115
+ fi
116
+
117
+ # TEA specific: on Windows, check in common installation locations
118
+ if test "${TEA_PLATFORM}" = "windows" \
119
+ -a x"${ac_cv_c_tclconfig}" = x ; then
120
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
121
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
122
+ ; do
123
+ if test -f "$i/tclConfig.sh" ; then
124
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
125
+ break
126
+ fi
127
+ done
128
+ fi
129
+
130
+ # check in a few common install locations
131
+ if test x"${ac_cv_c_tclconfig}" = x ; then
132
+ for i in `ls -d ${libdir} 2>/dev/null` \
133
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
134
+ `ls -d ${prefix}/lib 2>/dev/null` \
135
+ `ls -d /usr/local/lib 2>/dev/null` \
136
+ `ls -d /usr/contrib/lib 2>/dev/null` \
137
+ `ls -d /usr/lib 2>/dev/null` \
138
+ ; do
139
+ if test -f "$i/tclConfig.sh" ; then
140
+ ac_cv_c_tclconfig=`(cd $i; pwd)`
141
+ break
142
+ fi
143
+ done
144
+ fi
145
+
146
+ # check in a few other private locations
147
+ if test x"${ac_cv_c_tclconfig}" = x ; then
148
+ for i in \
149
+ ${srcdir}/../tcl \
150
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
151
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \
152
+ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do
153
+ if test -f "$i/unix/tclConfig.sh" ; then
154
+ ac_cv_c_tclconfig=`(cd $i/unix; pwd)`
155
+ break
156
+ fi
157
+ done
158
+ fi
159
+ ])
160
+
161
+ if test x"${ac_cv_c_tclconfig}" = x ; then
162
+ TCL_BIN_DIR="# no Tcl configs found"
163
+ AC_MSG_WARN([Can't find Tcl configuration definitions])
164
+ exit 0
165
+ else
166
+ no_tcl=
167
+ TCL_BIN_DIR=${ac_cv_c_tclconfig}
168
+ AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh])
169
+ fi
170
+ fi
171
+ ])
172
+
173
+ #------------------------------------------------------------------------
174
+ # TEA_PATH_TKCONFIG --
175
+ #
176
+ # Locate the tkConfig.sh file
177
+ #
178
+ # Arguments:
179
+ # none
180
+ #
181
+ # Results:
182
+ #
183
+ # Adds the following arguments to configure:
184
+ # --with-tk=...
185
+ #
186
+ # Defines the following vars:
187
+ # TK_BIN_DIR Full path to the directory containing
188
+ # the tkConfig.sh file
189
+ #------------------------------------------------------------------------
190
+
191
+ AC_DEFUN([TEA_PATH_TKCONFIG], [
192
+ #
193
+ # Ok, lets find the tk configuration
194
+ # First, look for one uninstalled.
195
+ # the alternative search directory is invoked by --with-tk
196
+ #
197
+
198
+ if test x"${no_tk}" = x ; then
199
+ # we reset no_tk in case something fails here
200
+ no_tk=true
201
+ AC_ARG_WITH(tk,
202
+ AC_HELP_STRING([--with-tk],
203
+ [directory containing tk configuration (tkConfig.sh)]),
204
+ with_tkconfig=${withval})
205
+ AC_MSG_CHECKING([for Tk configuration])
206
+ AC_CACHE_VAL(ac_cv_c_tkconfig,[
207
+
208
+ # First check to see if --with-tkconfig was specified.
209
+ if test x"${with_tkconfig}" != x ; then
210
+ case ${with_tkconfig} in
211
+ */tkConfig.sh )
212
+ if test -f ${with_tkconfig}; then
213
+ AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself])
214
+ with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'`
215
+ fi ;;
216
+ esac
217
+ if test -f "${with_tkconfig}/tkConfig.sh" ; then
218
+ ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)`
219
+ else
220
+ AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
221
+ fi
222
+ fi
223
+
224
+ # then check for a private Tk library
225
+ if test x"${ac_cv_c_tkconfig}" = x ; then
226
+ for i in \
227
+ ../tk \
228
+ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
229
+ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \
230
+ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \
231
+ ../../tk \
232
+ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
233
+ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \
234
+ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \
235
+ ../../../tk \
236
+ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
237
+ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \
238
+ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
239
+ if test -f "$i/unix/tkConfig.sh" ; then
240
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
241
+ break
242
+ fi
243
+ done
244
+ fi
245
+
246
+ # on Darwin, check in Framework installation locations
247
+ if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then
248
+ for i in `ls -d ~/Library/Frameworks 2>/dev/null` \
249
+ `ls -d /Library/Frameworks 2>/dev/null` \
250
+ `ls -d /Network/Library/Frameworks 2>/dev/null` \
251
+ `ls -d /System/Library/Frameworks 2>/dev/null` \
252
+ ; do
253
+ if test -f "$i/Tk.framework/tkConfig.sh" ; then
254
+ ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)`
255
+ break
256
+ fi
257
+ done
258
+ fi
259
+
260
+ # check in a few common install locations
261
+ if test x"${ac_cv_c_tkconfig}" = x ; then
262
+ for i in `ls -d ${libdir} 2>/dev/null` \
263
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
264
+ `ls -d ${prefix}/lib 2>/dev/null` \
265
+ `ls -d /usr/local/lib 2>/dev/null` \
266
+ `ls -d /usr/contrib/lib 2>/dev/null` \
267
+ `ls -d /usr/lib 2>/dev/null` \
268
+ ; do
269
+ if test -f "$i/tkConfig.sh" ; then
270
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
271
+ break
272
+ fi
273
+ done
274
+ fi
275
+
276
+ # TEA specific: on Windows, check in common installation locations
277
+ if test "${TEA_PLATFORM}" = "windows" \
278
+ -a x"${ac_cv_c_tkconfig}" = x ; then
279
+ for i in `ls -d C:/Tcl/lib 2>/dev/null` \
280
+ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
281
+ ; do
282
+ if test -f "$i/tkConfig.sh" ; then
283
+ ac_cv_c_tkconfig=`(cd $i; pwd)`
284
+ break
285
+ fi
286
+ done
287
+ fi
288
+
289
+ # check in a few other private locations
290
+ if test x"${ac_cv_c_tkconfig}" = x ; then
291
+ for i in \
292
+ ${srcdir}/../tk \
293
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \
294
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \
295
+ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do
296
+ if test -f "$i/unix/tkConfig.sh" ; then
297
+ ac_cv_c_tkconfig=`(cd $i/unix; pwd)`
298
+ break
299
+ fi
300
+ done
301
+ fi
302
+ ])
303
+
304
+ if test x"${ac_cv_c_tkconfig}" = x ; then
305
+ TK_BIN_DIR="# no Tk configs found"
306
+ AC_MSG_WARN([Can't find Tk configuration definitions])
307
+ exit 0
308
+ else
309
+ no_tk=
310
+ TK_BIN_DIR=${ac_cv_c_tkconfig}
311
+ AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh])
312
+ fi
313
+ fi
314
+ ])
315
+
316
+ #------------------------------------------------------------------------
317
+ # TEA_LOAD_TCLCONFIG --
318
+ #
319
+ # Load the tclConfig.sh file
320
+ #
321
+ # Arguments:
322
+ #
323
+ # Requires the following vars to be set:
324
+ # TCL_BIN_DIR
325
+ #
326
+ # Results:
327
+ #
328
+ # Subst the following vars:
329
+ # TCL_BIN_DIR
330
+ # TCL_SRC_DIR
331
+ # TCL_LIB_FILE
332
+ #
333
+ #------------------------------------------------------------------------
334
+
335
+ AC_DEFUN([TEA_LOAD_TCLCONFIG], [
336
+ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
337
+
338
+ if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
339
+ AC_MSG_RESULT([loading])
340
+ . "${TCL_BIN_DIR}/tclConfig.sh"
341
+ else
342
+ AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
343
+ fi
344
+
345
+ # eval is required to do the TCL_DBGX substitution
346
+ eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
347
+ eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
348
+
349
+ # If the TCL_BIN_DIR is the build directory (not the install directory),
350
+ # then set the common variable name to the value of the build variables.
351
+ # For example, the variable TCL_LIB_SPEC will be set to the value
352
+ # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
353
+ # instead of TCL_BUILD_LIB_SPEC since it will work with both an
354
+ # installed and uninstalled version of Tcl.
355
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
356
+ TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
357
+ TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
358
+ TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
359
+ elif test "`uname -s`" = "Darwin"; then
360
+ # If Tcl was built as a framework, attempt to use the libraries
361
+ # from the framework at the given location so that linking works
362
+ # against Tcl.framework installed in an arbitary location.
363
+ case ${TCL_DEFS} in
364
+ *TCL_FRAMEWORK*)
365
+ if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
366
+ for i in "`cd ${TCL_BIN_DIR}; pwd`" \
367
+ "`cd ${TCL_BIN_DIR}/../..; pwd`"; do
368
+ if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then
369
+ TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}"
370
+ break
371
+ fi
372
+ done
373
+ fi
374
+ if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then
375
+ TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}"
376
+ TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"
377
+ fi
378
+ ;;
379
+ esac
380
+ fi
381
+
382
+ # eval is required to do the TCL_DBGX substitution
383
+ eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
384
+ eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
385
+ eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
386
+ eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
387
+
388
+ AC_SUBST(TCL_VERSION)
389
+ AC_SUBST(TCL_BIN_DIR)
390
+ AC_SUBST(TCL_SRC_DIR)
391
+
392
+ AC_SUBST(TCL_LIB_FILE)
393
+ AC_SUBST(TCL_LIB_FLAG)
394
+ AC_SUBST(TCL_LIB_SPEC)
395
+
396
+ AC_SUBST(TCL_STUB_LIB_FILE)
397
+ AC_SUBST(TCL_STUB_LIB_FLAG)
398
+ AC_SUBST(TCL_STUB_LIB_SPEC)
399
+
400
+ # TEA specific:
401
+ AC_SUBST(TCL_LIBS)
402
+ AC_SUBST(TCL_DEFS)
403
+ AC_SUBST(TCL_EXTRA_CFLAGS)
404
+ AC_SUBST(TCL_LD_FLAGS)
405
+ AC_SUBST(TCL_SHLIB_LD_LIBS)
406
+ ])
407
+
408
+ #------------------------------------------------------------------------
409
+ # TEA_LOAD_TKCONFIG --
410
+ #
411
+ # Load the tkConfig.sh file
412
+ #
413
+ # Arguments:
414
+ #
415
+ # Requires the following vars to be set:
416
+ # TK_BIN_DIR
417
+ #
418
+ # Results:
419
+ #
420
+ # Sets the following vars that should be in tkConfig.sh:
421
+ # TK_BIN_DIR
422
+ #------------------------------------------------------------------------
423
+
424
+ AC_DEFUN([TEA_LOAD_TKCONFIG], [
425
+ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
426
+
427
+ if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
428
+ AC_MSG_RESULT([loading])
429
+ . "${TK_BIN_DIR}/tkConfig.sh"
430
+ else
431
+ AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
432
+ fi
433
+
434
+ # eval is required to do the TK_DBGX substitution
435
+ eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
436
+ eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
437
+
438
+ # If the TK_BIN_DIR is the build directory (not the install directory),
439
+ # then set the common variable name to the value of the build variables.
440
+ # For example, the variable TK_LIB_SPEC will be set to the value
441
+ # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC
442
+ # instead of TK_BUILD_LIB_SPEC since it will work with both an
443
+ # installed and uninstalled version of Tcl.
444
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
445
+ TK_LIB_SPEC=${TK_BUILD_LIB_SPEC}
446
+ TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC}
447
+ TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH}
448
+ elif test "`uname -s`" = "Darwin"; then
449
+ # If Tk was built as a framework, attempt to use the libraries
450
+ # from the framework at the given location so that linking works
451
+ # against Tk.framework installed in an arbitary location.
452
+ case ${TK_DEFS} in
453
+ *TK_FRAMEWORK*)
454
+ if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
455
+ for i in "`cd ${TK_BIN_DIR}; pwd`" \
456
+ "`cd ${TK_BIN_DIR}/../..; pwd`"; do
457
+ if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then
458
+ TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}"
459
+ break
460
+ fi
461
+ done
462
+ fi
463
+ if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then
464
+ TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}"
465
+ TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"
466
+ fi
467
+ ;;
468
+ esac
469
+ fi
470
+
471
+ # eval is required to do the TK_DBGX substitution
472
+ eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
473
+ eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
474
+ eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
475
+ eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
476
+
477
+ # TEA specific: Ensure windowingsystem is defined
478
+ if test "${TEA_PLATFORM}" = "unix" ; then
479
+ case ${TK_DEFS} in
480
+ *MAC_OSX_TK*)
481
+ AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?])
482
+ TEA_WINDOWINGSYSTEM="aqua"
483
+ ;;
484
+ *)
485
+ TEA_WINDOWINGSYSTEM="x11"
486
+ ;;
487
+ esac
488
+ elif test "${TEA_PLATFORM}" = "windows" ; then
489
+ TEA_WINDOWINGSYSTEM="win32"
490
+ fi
491
+
492
+ AC_SUBST(TK_VERSION)
493
+ AC_SUBST(TK_BIN_DIR)
494
+ AC_SUBST(TK_SRC_DIR)
495
+
496
+ AC_SUBST(TK_LIB_FILE)
497
+ AC_SUBST(TK_LIB_FLAG)
498
+ AC_SUBST(TK_LIB_SPEC)
499
+
500
+ AC_SUBST(TK_STUB_LIB_FILE)
501
+ AC_SUBST(TK_STUB_LIB_FLAG)
502
+ AC_SUBST(TK_STUB_LIB_SPEC)
503
+
504
+ # TEA specific:
505
+ AC_SUBST(TK_LIBS)
506
+ AC_SUBST(TK_XINCLUDES)
507
+ ])
508
+
509
+ #------------------------------------------------------------------------
510
+ # TEA_PROG_TCLSH
511
+ # Determine the fully qualified path name of the tclsh executable
512
+ # in the Tcl build directory or the tclsh installed in a bin
513
+ # directory. This macro will correctly determine the name
514
+ # of the tclsh executable even if tclsh has not yet been
515
+ # built in the build directory. The tclsh found is always
516
+ # associated with a tclConfig.sh file. This tclsh should be used
517
+ # only for running extension test cases. It should never be
518
+ # or generation of files (like pkgIndex.tcl) at build time.
519
+ #
520
+ # Arguments
521
+ # none
522
+ #
523
+ # Results
524
+ # Subst's the following values:
525
+ # TCLSH_PROG
526
+ #------------------------------------------------------------------------
527
+
528
+ AC_DEFUN([TEA_PROG_TCLSH], [
529
+ AC_MSG_CHECKING([for tclsh])
530
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
531
+ # tclConfig.sh is in Tcl build directory
532
+ if test "${TEA_PLATFORM}" = "windows"; then
533
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
534
+ else
535
+ TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
536
+ fi
537
+ else
538
+ # tclConfig.sh is in install location
539
+ if test "${TEA_PLATFORM}" = "windows"; then
540
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}"
541
+ else
542
+ TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}"
543
+ fi
544
+ list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
545
+ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
546
+ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
547
+ for i in $list ; do
548
+ if test -f "$i/${TCLSH_PROG}" ; then
549
+ REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
550
+ break
551
+ fi
552
+ done
553
+ TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
554
+ fi
555
+ AC_MSG_RESULT([${TCLSH_PROG}])
556
+ AC_SUBST(TCLSH_PROG)
557
+ ])
558
+
559
+ #------------------------------------------------------------------------
560
+ # TEA_PROG_WISH
561
+ # Determine the fully qualified path name of the wish executable
562
+ # in the Tk build directory or the wish installed in a bin
563
+ # directory. This macro will correctly determine the name
564
+ # of the wish executable even if wish has not yet been
565
+ # built in the build directory. The wish found is always
566
+ # associated with a tkConfig.sh file. This wish should be used
567
+ # only for running extension test cases. It should never be
568
+ # or generation of files (like pkgIndex.tcl) at build time.
569
+ #
570
+ # Arguments
571
+ # none
572
+ #
573
+ # Results
574
+ # Subst's the following values:
575
+ # WISH_PROG
576
+ #------------------------------------------------------------------------
577
+
578
+ AC_DEFUN([TEA_PROG_WISH], [
579
+ AC_MSG_CHECKING([for wish])
580
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
581
+ # tkConfig.sh is in Tk build directory
582
+ if test "${TEA_PLATFORM}" = "windows"; then
583
+ WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
584
+ else
585
+ WISH_PROG="${TK_BIN_DIR}/wish"
586
+ fi
587
+ else
588
+ # tkConfig.sh is in install location
589
+ if test "${TEA_PLATFORM}" = "windows"; then
590
+ WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}"
591
+ else
592
+ WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}"
593
+ fi
594
+ list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
595
+ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
596
+ `ls -d ${TK_PREFIX}/bin 2>/dev/null`"
597
+ for i in $list ; do
598
+ if test -f "$i/${WISH_PROG}" ; then
599
+ REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
600
+ break
601
+ fi
602
+ done
603
+ WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
604
+ fi
605
+ AC_MSG_RESULT([${WISH_PROG}])
606
+ AC_SUBST(WISH_PROG)
607
+ ])
608
+
609
+ #------------------------------------------------------------------------
610
+ # TEA_ENABLE_SHARED --
611
+ #
612
+ # Allows the building of shared libraries
613
+ #
614
+ # Arguments:
615
+ # none
616
+ #
617
+ # Results:
618
+ #
619
+ # Adds the following arguments to configure:
620
+ # --enable-shared=yes|no
621
+ #
622
+ # Defines the following vars:
623
+ # STATIC_BUILD Used for building import/export libraries
624
+ # on Windows.
625
+ #
626
+ # Sets the following vars:
627
+ # SHARED_BUILD Value of 1 or 0
628
+ #------------------------------------------------------------------------
629
+
630
+ AC_DEFUN([TEA_ENABLE_SHARED], [
631
+ AC_MSG_CHECKING([how to build libraries])
632
+ AC_ARG_ENABLE(shared,
633
+ AC_HELP_STRING([--enable-shared],
634
+ [build and link with shared libraries (default: on)]),
635
+ [tcl_ok=$enableval], [tcl_ok=yes])
636
+
637
+ if test "${enable_shared+set}" = set; then
638
+ enableval="$enable_shared"
639
+ tcl_ok=$enableval
640
+ else
641
+ tcl_ok=yes
642
+ fi
643
+
644
+ if test "$tcl_ok" = "yes" ; then
645
+ AC_MSG_RESULT([shared])
646
+ SHARED_BUILD=1
647
+ else
648
+ AC_MSG_RESULT([static])
649
+ SHARED_BUILD=0
650
+ AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?])
651
+ fi
652
+ AC_SUBST(SHARED_BUILD)
653
+ ])
654
+
655
+ #------------------------------------------------------------------------
656
+ # TEA_ENABLE_THREADS --
657
+ #
658
+ # Specify if thread support should be enabled. If "yes" is specified
659
+ # as an arg (optional), threads are enabled by default, "no" means
660
+ # threads are disabled. "yes" is the default.
661
+ #
662
+ # TCL_THREADS is checked so that if you are compiling an extension
663
+ # against a threaded core, your extension must be compiled threaded
664
+ # as well.
665
+ #
666
+ # Note that it is legal to have a thread enabled extension run in a
667
+ # threaded or non-threaded Tcl core, but a non-threaded extension may
668
+ # only run in a non-threaded Tcl core.
669
+ #
670
+ # Arguments:
671
+ # none
672
+ #
673
+ # Results:
674
+ #
675
+ # Adds the following arguments to configure:
676
+ # --enable-threads
677
+ #
678
+ # Sets the following vars:
679
+ # THREADS_LIBS Thread library(s)
680
+ #
681
+ # Defines the following vars:
682
+ # TCL_THREADS
683
+ # _REENTRANT
684
+ # _THREAD_SAFE
685
+ #
686
+ #------------------------------------------------------------------------
687
+
688
+ AC_DEFUN([TEA_ENABLE_THREADS], [
689
+ AC_ARG_ENABLE(threads,
690
+ AC_HELP_STRING([--enable-threads],
691
+ [build with threads]),
692
+ [tcl_ok=$enableval], [tcl_ok=yes])
693
+
694
+ if test "${enable_threads+set}" = set; then
695
+ enableval="$enable_threads"
696
+ tcl_ok=$enableval
697
+ else
698
+ tcl_ok=yes
699
+ fi
700
+
701
+ if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then
702
+ TCL_THREADS=1
703
+
704
+ if test "${TEA_PLATFORM}" != "windows" ; then
705
+ # We are always OK on Windows, so check what this platform wants:
706
+
707
+ # USE_THREAD_ALLOC tells us to try the special thread-based
708
+ # allocator that significantly reduces lock contention
709
+ AC_DEFINE(USE_THREAD_ALLOC, 1,
710
+ [Do we want to use the threaded memory allocator?])
711
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
712
+ if test "`uname -s`" = "SunOS" ; then
713
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
714
+ [Do we really want to follow the standard? Yes we do!])
715
+ fi
716
+ AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?])
717
+ AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no)
718
+ if test "$tcl_ok" = "no"; then
719
+ # Check a little harder for __pthread_mutex_init in the same
720
+ # library, as some systems hide it there until pthread.h is
721
+ # defined. We could alternatively do an AC_TRY_COMPILE with
722
+ # pthread.h, but that will work with libpthread really doesn't
723
+ # exist, like AIX 4.2. [Bug: 4359]
724
+ AC_CHECK_LIB(pthread, __pthread_mutex_init,
725
+ tcl_ok=yes, tcl_ok=no)
726
+ fi
727
+
728
+ if test "$tcl_ok" = "yes"; then
729
+ # The space is needed
730
+ THREADS_LIBS=" -lpthread"
731
+ else
732
+ AC_CHECK_LIB(pthreads, pthread_mutex_init,
733
+ tcl_ok=yes, tcl_ok=no)
734
+ if test "$tcl_ok" = "yes"; then
735
+ # The space is needed
736
+ THREADS_LIBS=" -lpthreads"
737
+ else
738
+ AC_CHECK_LIB(c, pthread_mutex_init,
739
+ tcl_ok=yes, tcl_ok=no)
740
+ if test "$tcl_ok" = "no"; then
741
+ AC_CHECK_LIB(c_r, pthread_mutex_init,
742
+ tcl_ok=yes, tcl_ok=no)
743
+ if test "$tcl_ok" = "yes"; then
744
+ # The space is needed
745
+ THREADS_LIBS=" -pthread"
746
+ else
747
+ TCL_THREADS=0
748
+ AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled])
749
+ fi
750
+ fi
751
+ fi
752
+ fi
753
+ fi
754
+ else
755
+ TCL_THREADS=0
756
+ fi
757
+ # Do checking message here to not mess up interleaved configure output
758
+ AC_MSG_CHECKING([for building with threads])
759
+ if test "${TCL_THREADS}" = 1; then
760
+ AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?])
761
+ AC_MSG_RESULT([yes (default)])
762
+ else
763
+ AC_MSG_RESULT([no])
764
+ fi
765
+ # TCL_THREADS sanity checking. See if our request for building with
766
+ # threads is the same as the way Tcl was built. If not, warn the user.
767
+ case ${TCL_DEFS} in
768
+ *THREADS=1*)
769
+ if test "${TCL_THREADS}" = "0"; then
770
+ AC_MSG_WARN([
771
+ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl
772
+ that IS thread-enabled. It is recommended to use --enable-threads.])
773
+ fi
774
+ ;;
775
+ *)
776
+ if test "${TCL_THREADS}" = "1"; then
777
+ AC_MSG_WARN([
778
+ --enable-threads requested, but building against a Tcl that is NOT
779
+ thread-enabled. This is an OK configuration that will also run in
780
+ a thread-enabled core.])
781
+ fi
782
+ ;;
783
+ esac
784
+ AC_SUBST(TCL_THREADS)
785
+ ])
786
+
787
+ #------------------------------------------------------------------------
788
+ # TEA_ENABLE_SYMBOLS --
789
+ #
790
+ # Specify if debugging symbols should be used.
791
+ # Memory (TCL_MEM_DEBUG) debugging can also be enabled.
792
+ #
793
+ # Arguments:
794
+ # none
795
+ #
796
+ # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives
797
+ # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted.
798
+ # Requires the following vars to be set in the Makefile:
799
+ # CFLAGS_DEFAULT
800
+ # LDFLAGS_DEFAULT
801
+ #
802
+ # Results:
803
+ #
804
+ # Adds the following arguments to configure:
805
+ # --enable-symbols
806
+ #
807
+ # Defines the following vars:
808
+ # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
809
+ # Sets to $(CFLAGS_OPTIMIZE) if false
810
+ # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
811
+ # Sets to $(LDFLAGS_OPTIMIZE) if false
812
+ # DBGX Formerly used as debug library extension;
813
+ # always blank now.
814
+ #
815
+ #------------------------------------------------------------------------
816
+
817
+ AC_DEFUN([TEA_ENABLE_SYMBOLS], [
818
+ dnl TEA specific: Make sure we are initialized
819
+ AC_REQUIRE([TEA_CONFIG_CFLAGS])
820
+ AC_MSG_CHECKING([for build with symbols])
821
+ AC_ARG_ENABLE(symbols,
822
+ AC_HELP_STRING([--enable-symbols],
823
+ [build with debugging symbols (default: off)]),
824
+ [tcl_ok=$enableval], [tcl_ok=no])
825
+ DBGX=""
826
+ if test "$tcl_ok" = "no"; then
827
+ CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}"
828
+ LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}"
829
+ AC_MSG_RESULT([no])
830
+ else
831
+ CFLAGS_DEFAULT="${CFLAGS_DEBUG}"
832
+ LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}"
833
+ if test "$tcl_ok" = "yes"; then
834
+ AC_MSG_RESULT([yes (standard debugging)])
835
+ fi
836
+ fi
837
+ # TEA specific:
838
+ if test "${TEA_PLATFORM}" != "windows" ; then
839
+ LDFLAGS_DEFAULT="${LDFLAGS}"
840
+ fi
841
+ AC_SUBST(CFLAGS_DEFAULT)
842
+ AC_SUBST(LDFLAGS_DEFAULT)
843
+ AC_SUBST(TCL_DBGX)
844
+
845
+ if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
846
+ AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?])
847
+ fi
848
+
849
+ if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
850
+ if test "$tcl_ok" = "all"; then
851
+ AC_MSG_RESULT([enabled symbols mem debugging])
852
+ else
853
+ AC_MSG_RESULT([enabled $tcl_ok debugging])
854
+ fi
855
+ fi
856
+ ])
857
+
858
+ #------------------------------------------------------------------------
859
+ # TEA_ENABLE_LANGINFO --
860
+ #
861
+ # Allows use of modern nl_langinfo check for better l10n.
862
+ # This is only relevant for Unix.
863
+ #
864
+ # Arguments:
865
+ # none
866
+ #
867
+ # Results:
868
+ #
869
+ # Adds the following arguments to configure:
870
+ # --enable-langinfo=yes|no (default is yes)
871
+ #
872
+ # Defines the following vars:
873
+ # HAVE_LANGINFO Triggers use of nl_langinfo if defined.
874
+ #
875
+ #------------------------------------------------------------------------
876
+
877
+ AC_DEFUN([TEA_ENABLE_LANGINFO], [
878
+ AC_ARG_ENABLE(langinfo,
879
+ AC_HELP_STRING([--enable-langinfo],
880
+ [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
881
+ [langinfo_ok=$enableval], [langinfo_ok=yes])
882
+
883
+ HAVE_LANGINFO=0
884
+ if test "$langinfo_ok" = "yes"; then
885
+ AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no])
886
+ fi
887
+ AC_MSG_CHECKING([whether to use nl_langinfo])
888
+ if test "$langinfo_ok" = "yes"; then
889
+ AC_CACHE_VAL(tcl_cv_langinfo_h, [
890
+ AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);],
891
+ [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
892
+ AC_MSG_RESULT([$tcl_cv_langinfo_h])
893
+ if test $tcl_cv_langinfo_h = yes; then
894
+ AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?])
895
+ fi
896
+ else
897
+ AC_MSG_RESULT([$langinfo_ok])
898
+ fi
899
+ ])
900
+
901
+ #--------------------------------------------------------------------
902
+ # TEA_CONFIG_SYSTEM
903
+ #
904
+ # Determine what the system is (some things cannot be easily checked
905
+ # on a feature-driven basis, alas). This can usually be done via the
906
+ # "uname" command, but there are a few systems, like Next, where
907
+ # this doesn't work.
908
+ #
909
+ # Arguments:
910
+ # none
911
+ #
912
+ # Results:
913
+ # Defines the following var:
914
+ #
915
+ # system - System/platform/version identification code.
916
+ #
917
+ #--------------------------------------------------------------------
918
+
919
+ AC_DEFUN([TEA_CONFIG_SYSTEM], [
920
+ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
921
+ # TEA specific:
922
+ if test "${TEA_PLATFORM}" = "windows" ; then
923
+ tcl_cv_sys_version=windows
924
+ elif test -f /usr/lib/NextStep/software_version; then
925
+ tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
926
+ else
927
+ tcl_cv_sys_version=`uname -s`-`uname -r`
928
+ if test "$?" -ne 0 ; then
929
+ AC_MSG_WARN([can't find uname command])
930
+ tcl_cv_sys_version=unknown
931
+ else
932
+ # Special check for weird MP-RAS system (uname returns weird
933
+ # results, and the version is kept in special file).
934
+
935
+ if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
936
+ tcl_cv_sys_version=MP-RAS-`awk '{print $[3]}' /etc/.relid`
937
+ fi
938
+ if test "`uname -s`" = "AIX" ; then
939
+ tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
940
+ fi
941
+ fi
942
+ fi
943
+ ])
944
+ system=$tcl_cv_sys_version
945
+ ])
946
+
947
+ #--------------------------------------------------------------------
948
+ # TEA_CONFIG_CFLAGS
949
+ #
950
+ # Try to determine the proper flags to pass to the compiler
951
+ # for building shared libraries and other such nonsense.
952
+ #
953
+ # Arguments:
954
+ # none
955
+ #
956
+ # Results:
957
+ #
958
+ # Defines and substitutes the following vars:
959
+ #
960
+ # DL_OBJS - Name of the object file that implements dynamic
961
+ # loading for Tcl on this system.
962
+ # DL_LIBS - Library file(s) to include in tclsh and other base
963
+ # applications in order for the "load" command to work.
964
+ # LDFLAGS - Flags to pass to the compiler when linking object
965
+ # files into an executable application binary such
966
+ # as tclsh.
967
+ # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib",
968
+ # that tell the run-time dynamic linker where to look
969
+ # for shared libraries such as libtcl.so. Depends on
970
+ # the variable LIB_RUNTIME_DIR in the Makefile. Could
971
+ # be the same as CC_SEARCH_FLAGS if ${CC} is used to link.
972
+ # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib",
973
+ # that tell the run-time dynamic linker where to look
974
+ # for shared libraries such as libtcl.so. Depends on
975
+ # the variable LIB_RUNTIME_DIR in the Makefile.
976
+ # SHLIB_CFLAGS - Flags to pass to cc when compiling the components
977
+ # of a shared library (may request position-independent
978
+ # code, among other things).
979
+ # SHLIB_LD - Base command to use for combining object files
980
+ # into a shared library.
981
+ # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when
982
+ # creating shared libraries. This symbol typically
983
+ # goes at the end of the "ld" commands that build
984
+ # shared libraries. The value of the symbol is
985
+ # "${LIBS}" if all of the dependent libraries should
986
+ # be specified when creating a shared library. If
987
+ # dependent libraries should not be specified (as on
988
+ # SunOS 4.x, where they cause the link to fail, or in
989
+ # general if Tcl and Tk aren't themselves shared
990
+ # libraries), then this symbol has an empty string
991
+ # as its value.
992
+ # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable
993
+ # extensions. An empty string means we don't know how
994
+ # to use shared libraries on this platform.
995
+ # LIB_SUFFIX - Specifies everything that comes after the "libfoo"
996
+ # in a static or shared library name, using the $VERSION variable
997
+ # to put the version in the right place. This is used
998
+ # by platforms that need non-standard library names.
999
+ # Examples: ${VERSION}.so.1.1 on NetBSD, since it needs
1000
+ # to have a version after the .so, and ${VERSION}.a
1001
+ # on AIX, since a shared library needs to have
1002
+ # a .a extension whereas shared objects for loadable
1003
+ # extensions have a .so extension. Defaults to
1004
+ # ${VERSION}${SHLIB_SUFFIX}.
1005
+ # TCL_NEEDS_EXP_FILE -
1006
+ # 1 means that an export file is needed to link to a
1007
+ # shared library.
1008
+ # TCL_EXP_FILE - The name of the installed export / import file which
1009
+ # should be used to link to the Tcl shared library.
1010
+ # Empty if Tcl is unshared.
1011
+ # TCL_BUILD_EXP_FILE -
1012
+ # The name of the built export / import file which
1013
+ # should be used to link to the Tcl shared library.
1014
+ # Empty if Tcl is unshared.
1015
+ # CFLAGS_DEBUG -
1016
+ # Flags used when running the compiler in debug mode
1017
+ # CFLAGS_OPTIMIZE -
1018
+ # Flags used when running the compiler in optimize mode
1019
+ # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
1020
+ #
1021
+ #--------------------------------------------------------------------
1022
+
1023
+ AC_DEFUN([TEA_CONFIG_CFLAGS], [
1024
+ dnl TEA specific: Make sure we are initialized
1025
+ AC_REQUIRE([TEA_INIT])
1026
+
1027
+ # Step 0.a: Enable 64 bit support?
1028
+
1029
+ AC_MSG_CHECKING([if 64bit support is requested])
1030
+ AC_ARG_ENABLE(64bit,
1031
+ AC_HELP_STRING([--enable-64bit],
1032
+ [enable 64bit support (default: off)]),
1033
+ [do64bit=$enableval], [do64bit=no])
1034
+ AC_MSG_RESULT([$do64bit])
1035
+
1036
+ # Step 0.b: Enable Solaris 64 bit VIS support?
1037
+
1038
+ AC_MSG_CHECKING([if 64bit Sparc VIS support is requested])
1039
+ AC_ARG_ENABLE(64bit-vis,
1040
+ AC_HELP_STRING([--enable-64bit-vis],
1041
+ [enable 64bit Sparc VIS support (default: off)]),
1042
+ [do64bitVIS=$enableval], [do64bitVIS=no])
1043
+ AC_MSG_RESULT([$do64bitVIS])
1044
+ # Force 64bit on with VIS
1045
+ AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes])
1046
+
1047
+ # Step 0.c: Check if visibility support is available. Do this here so
1048
+ # that platform specific alternatives can be used below if this fails.
1049
+
1050
+ AC_CACHE_CHECK([if compiler supports visibility "hidden"],
1051
+ tcl_cv_cc_visibility_hidden, [
1052
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror"
1053
+ AC_TRY_LINK([
1054
+ extern __attribute__((__visibility__("hidden"))) void f(void);
1055
+ void f(void) {}], [f();], tcl_cv_cc_visibility_hidden=yes,
1056
+ tcl_cv_cc_visibility_hidden=no)
1057
+ CFLAGS=$hold_cflags])
1058
+ AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [
1059
+ AC_DEFINE(MODULE_SCOPE,
1060
+ [extern __attribute__((__visibility__("hidden")))],
1061
+ [Compiler support for module scope symbols])
1062
+ ])
1063
+
1064
+ # Step 0.d: Disable -rpath support?
1065
+
1066
+ AC_MSG_CHECKING([if rpath support is requested])
1067
+ AC_ARG_ENABLE(rpath,
1068
+ AC_HELP_STRING([--disable-rpath],
1069
+ [disable rpath support (default: on)]),
1070
+ [doRpath=$enableval], [doRpath=yes])
1071
+ AC_MSG_RESULT([$doRpath])
1072
+
1073
+ # TEA specific: Cross-compiling options for Windows/CE builds?
1074
+
1075
+ AS_IF([test "${TEA_PLATFORM}" = windows], [
1076
+ AC_MSG_CHECKING([if Windows/CE build is requested])
1077
+ AC_ARG_ENABLE(wince,
1078
+ AC_HELP_STRING([--enable-wince],
1079
+ [enable Win/CE support (where applicable)]),
1080
+ [doWince=$enableval], [doWince=no])
1081
+ AC_MSG_RESULT([$doWince])
1082
+ ])
1083
+
1084
+ # Step 1: set the variable "system" to hold the name and version number
1085
+ # for the system.
1086
+
1087
+ TEA_CONFIG_SYSTEM
1088
+
1089
+ # Step 2: check for existence of -ldl library. This is needed because
1090
+ # Linux can use either -ldl or -ldld for dynamic loading.
1091
+
1092
+ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no)
1093
+
1094
+ # Require ranlib early so we can override it in special cases below.
1095
+
1096
+ AC_REQUIRE([AC_PROG_RANLIB])
1097
+
1098
+ # Step 3: set configuration options based on system name and version.
1099
+ # This is similar to Tcl's unix/tcl.m4 except that we've added a
1100
+ # "windows" case.
1101
+
1102
+ do64bit_ok=no
1103
+ LDFLAGS_ORIG="$LDFLAGS"
1104
+ # When ld needs options to work in 64-bit mode, put them in
1105
+ # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load]
1106
+ # is disabled by the user. [Bug 1016796]
1107
+ LDFLAGS_ARCH=""
1108
+ TCL_EXPORT_FILE_SUFFIX=""
1109
+ UNSHARED_LIB_SUFFIX=""
1110
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
1111
+ TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`'
1112
+ ECHO_VERSION='`echo ${PACKAGE_VERSION}`'
1113
+ TCL_LIB_VERSIONS_OK=ok
1114
+ CFLAGS_DEBUG=-g
1115
+ CFLAGS_OPTIMIZE=-O
1116
+ AS_IF([test "$GCC" = yes], [
1117
+ # TEA specific:
1118
+ CFLAGS_OPTIMIZE=-O2
1119
+ CFLAGS_WARNING="-Wall"
1120
+ ], [CFLAGS_WARNING=""])
1121
+ TCL_NEEDS_EXP_FILE=0
1122
+ TCL_BUILD_EXP_FILE=""
1123
+ TCL_EXP_FILE=""
1124
+ dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed.
1125
+ dnl AC_CHECK_TOOL(AR, ar)
1126
+ AC_CHECK_PROG(AR, ar, ar)
1127
+ STLIB_LD='${AR} cr'
1128
+ LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH"
1129
+ case $system in
1130
+ # TEA specific:
1131
+ windows)
1132
+ # This is a 2-stage check to make sure we have the 64-bit SDK
1133
+ # We have to know where the SDK is installed.
1134
+ # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs
1135
+ # MACHINE is IX86 for LINK, but this is used by the manifest,
1136
+ # which requires x86|amd64|ia64.
1137
+ MACHINE="X86"
1138
+ if test "$do64bit" != "no" ; then
1139
+ if test "x${MSSDK}x" = "xx" ; then
1140
+ MSSDK="C:/Progra~1/Microsoft Platform SDK"
1141
+ fi
1142
+ MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'`
1143
+ PATH64=""
1144
+ case "$do64bit" in
1145
+ amd64|x64|yes)
1146
+ MACHINE="AMD64" ; # default to AMD64 64-bit build
1147
+ PATH64="${MSSDK}/Bin/Win64/x86/AMD64"
1148
+ ;;
1149
+ ia64)
1150
+ MACHINE="IA64"
1151
+ PATH64="${MSSDK}/Bin/Win64"
1152
+ ;;
1153
+ esac
1154
+ if test ! -d "${PATH64}" ; then
1155
+ AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode])
1156
+ AC_MSG_WARN([Ensure latest Platform SDK is installed])
1157
+ do64bit="no"
1158
+ else
1159
+ AC_MSG_RESULT([ Using 64-bit $MACHINE mode])
1160
+ do64bit_ok="yes"
1161
+ fi
1162
+ fi
1163
+
1164
+ if test "$doWince" != "no" ; then
1165
+ if test "$do64bit" != "no" ; then
1166
+ AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible])
1167
+ fi
1168
+ if test "$GCC" = "yes" ; then
1169
+ AC_MSG_ERROR([Windows/CE and GCC builds incompatible])
1170
+ fi
1171
+ TEA_PATH_CELIB
1172
+ # Set defaults for common evc4/PPC2003 setup
1173
+ # Currently Tcl requires 300+, possibly 420+ for sockets
1174
+ CEVERSION=420; # could be 211 300 301 400 420 ...
1175
+ TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ...
1176
+ ARCH=ARM; # could be ARM MIPS X86EM ...
1177
+ PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002"
1178
+ if test "$doWince" != "yes"; then
1179
+ # If !yes then the user specified something
1180
+ # Reset ARCH to allow user to skip specifying it
1181
+ ARCH=
1182
+ eval `echo $doWince | awk -F, '{ \
1183
+ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \
1184
+ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \
1185
+ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \
1186
+ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \
1187
+ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \
1188
+ }'`
1189
+ if test "x${ARCH}" = "x" ; then
1190
+ ARCH=$TARGETCPU;
1191
+ fi
1192
+ fi
1193
+ OSVERSION=WCE$CEVERSION;
1194
+ if test "x${WCEROOT}" = "x" ; then
1195
+ WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0"
1196
+ if test ! -d "${WCEROOT}" ; then
1197
+ WCEROOT="C:/Program Files/Microsoft eMbedded Tools"
1198
+ fi
1199
+ fi
1200
+ if test "x${SDKROOT}" = "x" ; then
1201
+ SDKROOT="C:/Program Files/Windows CE Tools"
1202
+ if test ! -d "${SDKROOT}" ; then
1203
+ SDKROOT="C:/Windows CE Tools"
1204
+ fi
1205
+ fi
1206
+ WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'`
1207
+ SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'`
1208
+ if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \
1209
+ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then
1210
+ AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]])
1211
+ doWince="no"
1212
+ else
1213
+ # We could PATH_NOSPACE these, but that's not important,
1214
+ # as long as we quote them when used.
1215
+ CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include"
1216
+ if test -d "${CEINCLUDE}/${TARGETCPU}" ; then
1217
+ CEINCLUDE="${CEINCLUDE}/${TARGETCPU}"
1218
+ fi
1219
+ CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}"
1220
+ fi
1221
+ fi
1222
+
1223
+ if test "$GCC" != "yes" ; then
1224
+ if test "${SHARED_BUILD}" = "0" ; then
1225
+ runtime=-MT
1226
+ else
1227
+ runtime=-MD
1228
+ fi
1229
+
1230
+ if test "$do64bit" != "no" ; then
1231
+ # All this magic is necessary for the Win64 SDK RC1 - hobbs
1232
+ CC="\"${PATH64}/cl.exe\""
1233
+ CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\""
1234
+ RC="\"${MSSDK}/bin/rc.exe\""
1235
+ lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\""
1236
+ LINKBIN="\"${PATH64}/link.exe\""
1237
+ CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d"
1238
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
1239
+ # Avoid 'unresolved external symbol __security_cookie'
1240
+ # errors, c.f. http://support.microsoft.com/?id=894573
1241
+ TEA_ADD_LIBS([bufferoverflowU.lib])
1242
+ elif test "$doWince" != "no" ; then
1243
+ CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin"
1244
+ if test "${TARGETCPU}" = "X86"; then
1245
+ CC="\"${CEBINROOT}/cl.exe\""
1246
+ else
1247
+ CC="\"${CEBINROOT}/cl${ARCH}.exe\""
1248
+ fi
1249
+ CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\""
1250
+ RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\""
1251
+ arch=`echo ${ARCH} | awk '{print tolower([$]0)}'`
1252
+ defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS"
1253
+ if test "${SHARED_BUILD}" = "1" ; then
1254
+ # Static CE builds require static celib as well
1255
+ defs="${defs} _DLL"
1256
+ fi
1257
+ for i in $defs ; do
1258
+ AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i)
1259
+ done
1260
+ AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version])
1261
+ AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version])
1262
+ CFLAGS_DEBUG="-nologo -Zi -Od"
1263
+ CFLAGS_OPTIMIZE="-nologo -Ox"
1264
+ lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'`
1265
+ lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo"
1266
+ LINKBIN="\"${CEBINROOT}/link.exe\""
1267
+ AC_SUBST(CELIB_DIR)
1268
+ else
1269
+ RC="rc"
1270
+ lflags="-nologo"
1271
+ LINKBIN="link"
1272
+ CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d"
1273
+ CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}"
1274
+ fi
1275
+ fi
1276
+
1277
+ if test "$GCC" = "yes"; then
1278
+ # mingw gcc mode
1279
+ RC="windres"
1280
+ CFLAGS_DEBUG="-g"
1281
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
1282
+ SHLIB_LD="$CC -shared"
1283
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1284
+ LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}"
1285
+ LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}"
1286
+ else
1287
+ SHLIB_LD="${LINKBIN} -dll ${lflags}"
1288
+ # link -lib only works when -lib is the first arg
1289
+ STLIB_LD="${LINKBIN} -lib ${lflags}"
1290
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib'
1291
+ PATHTYPE=-w
1292
+ # For information on what debugtype is most useful, see:
1293
+ # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp
1294
+ # This essentially turns it all on.
1295
+ LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2"
1296
+ LDFLAGS_OPTIMIZE="-release"
1297
+ if test "$doWince" != "no" ; then
1298
+ LDFLAGS_CONSOLE="-link ${lflags}"
1299
+ LDFLAGS_WINDOW=${LDFLAGS_CONSOLE}
1300
+ else
1301
+ LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
1302
+ LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
1303
+ fi
1304
+ fi
1305
+
1306
+ SHLIB_LD_LIBS='${LIBS}'
1307
+ SHLIB_SUFFIX=".dll"
1308
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll'
1309
+
1310
+ TCL_LIB_VERSIONS_OK=nodots
1311
+ # Bogus to avoid getting this turned off
1312
+ DL_OBJS="tclLoadNone.obj"
1313
+ ;;
1314
+ AIX-*)
1315
+ AS_IF([test "${TCL_THREADS}" = "1" -a "$GCC" != "yes"], [
1316
+ # AIX requires the _r compiler when gcc isn't being used
1317
+ case "${CC}" in
1318
+ *_r)
1319
+ # ok ...
1320
+ ;;
1321
+ *)
1322
+ CC=${CC}_r
1323
+ ;;
1324
+ esac
1325
+ AC_MSG_RESULT([Using $CC for compiling with threads])
1326
+ ])
1327
+ LIBS="$LIBS -lc"
1328
+ SHLIB_CFLAGS=""
1329
+ SHLIB_LD_LIBS='${LIBS}'
1330
+ SHLIB_SUFFIX=".so"
1331
+
1332
+ DL_OBJS="tclLoadDl.o"
1333
+ LD_LIBRARY_PATH_VAR="LIBPATH"
1334
+
1335
+ # Check to enable 64-bit flags for compiler/linker on AIX 4+
1336
+ AS_IF([test "$do64bit" = yes -a "`uname -v`" -gt 3], [
1337
+ AS_IF([test "$GCC" = yes], [
1338
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
1339
+ ], [
1340
+ do64bit_ok=yes
1341
+ CFLAGS="$CFLAGS -q64"
1342
+ LDFLAGS_ARCH="-q64"
1343
+ RANLIB="${RANLIB} -X64"
1344
+ AR="${AR} -X64"
1345
+ SHLIB_LD_FLAGS="-b64"
1346
+ ])
1347
+ ])
1348
+
1349
+ AS_IF([test "`uname -m`" = ia64], [
1350
+ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC
1351
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
1352
+ # AIX-5 has dl* in libc.so
1353
+ DL_LIBS=""
1354
+ AS_IF([test "$GCC" = yes], [
1355
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
1356
+ ], [
1357
+ CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}'
1358
+ ])
1359
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
1360
+ ], [
1361
+ AS_IF([test "$GCC" = yes], [SHLIB_LD='${CC} -shared'], [
1362
+ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry"
1363
+ ])
1364
+ SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}"
1365
+ DL_LIBS="-ldl"
1366
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1367
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1368
+ TCL_NEEDS_EXP_FILE=1
1369
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
1370
+ TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp'
1371
+ ])
1372
+
1373
+ # AIX v<=4.1 has some different flags than 4.2+
1374
+ AS_IF([test "$system" = "AIX-4.1" -o "`uname -v`" -lt 4], [
1375
+ AC_LIBOBJ([tclLoadAix])
1376
+ DL_LIBS="-lld"
1377
+ ])
1378
+
1379
+ # On AIX <=v4 systems, libbsd.a has to be linked in to support
1380
+ # non-blocking file IO. This library has to be linked in after
1381
+ # the MATH_LIBS or it breaks the pow() function. The way to
1382
+ # insure proper sequencing, is to add it to the tail of MATH_LIBS.
1383
+ # This library also supplies gettimeofday.
1384
+ #
1385
+ # AIX does not have a timezone field in struct tm. When the AIX
1386
+ # bsd library is used, the timezone global and the gettimeofday
1387
+ # methods are to be avoided for timezone deduction instead, we
1388
+ # deduce the timezone by comparing the localtime result on a
1389
+ # known GMT value.
1390
+
1391
+ AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no)
1392
+ AS_IF([test $libbsd = yes], [
1393
+ MATH_LIBS="$MATH_LIBS -lbsd"
1394
+ AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?])
1395
+ ])
1396
+ ;;
1397
+ BeOS*)
1398
+ SHLIB_CFLAGS="-fPIC"
1399
+ SHLIB_LD='${CC} -nostart'
1400
+ SHLIB_LD_LIBS='${LIBS}'
1401
+ SHLIB_SUFFIX=".so"
1402
+ DL_OBJS="tclLoadDl.o"
1403
+ DL_LIBS="-ldl"
1404
+
1405
+ #-----------------------------------------------------------
1406
+ # Check for inet_ntoa in -lbind, for BeOS (which also needs
1407
+ # -lsocket, even if the network functions are in -lnet which
1408
+ # is always linked to, for compatibility.
1409
+ #-----------------------------------------------------------
1410
+ AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"])
1411
+ ;;
1412
+ BSD/OS-2.1*|BSD/OS-3*)
1413
+ SHLIB_CFLAGS=""
1414
+ SHLIB_LD="shlicc -r"
1415
+ SHLIB_LD_LIBS='${LIBS}'
1416
+ SHLIB_SUFFIX=".so"
1417
+ DL_OBJS="tclLoadDl.o"
1418
+ DL_LIBS="-ldl"
1419
+ CC_SEARCH_FLAGS=""
1420
+ LD_SEARCH_FLAGS=""
1421
+ ;;
1422
+ BSD/OS-4.*)
1423
+ SHLIB_CFLAGS="-export-dynamic -fPIC"
1424
+ SHLIB_LD='${CC} -shared'
1425
+ SHLIB_LD_LIBS='${LIBS}'
1426
+ SHLIB_SUFFIX=".so"
1427
+ DL_OBJS="tclLoadDl.o"
1428
+ DL_LIBS="-ldl"
1429
+ LDFLAGS="$LDFLAGS -export-dynamic"
1430
+ CC_SEARCH_FLAGS=""
1431
+ LD_SEARCH_FLAGS=""
1432
+ ;;
1433
+ dgux*)
1434
+ SHLIB_CFLAGS="-K PIC"
1435
+ SHLIB_LD='${CC} -G'
1436
+ SHLIB_LD_LIBS=""
1437
+ SHLIB_SUFFIX=".so"
1438
+ DL_OBJS="tclLoadDl.o"
1439
+ DL_LIBS="-ldl"
1440
+ CC_SEARCH_FLAGS=""
1441
+ LD_SEARCH_FLAGS=""
1442
+ ;;
1443
+ HP-UX-*.11.*)
1444
+ # Use updated header definitions where possible
1445
+ AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?])
1446
+ # TEA specific: Needed by Tcl, but not most extensions
1447
+ #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?])
1448
+ #LIBS="$LIBS -lxnet" # Use the XOPEN network library
1449
+
1450
+ AS_IF([test "`uname -m`" = ia64], [
1451
+ SHLIB_SUFFIX=".so"
1452
+ # Use newer C++ library for C++ extensions
1453
+ #if test "$GCC" != "yes" ; then
1454
+ # CPPFLAGS="-AA"
1455
+ #fi
1456
+ ], [
1457
+ SHLIB_SUFFIX=".sl"
1458
+ ])
1459
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1460
+ AS_IF([test "$tcl_ok" = yes], [
1461
+ SHLIB_CFLAGS="+z"
1462
+ SHLIB_LD="ld -b"
1463
+ SHLIB_LD_LIBS='${LIBS}'
1464
+ DL_OBJS="tclLoadShl.o"
1465
+ DL_LIBS="-ldld"
1466
+ LDFLAGS="$LDFLAGS -Wl,-E"
1467
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1468
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
1469
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1470
+ ])
1471
+ AS_IF([test "$GCC" = yes], [
1472
+ SHLIB_LD='${CC} -shared'
1473
+ SHLIB_LD_LIBS='${LIBS}'
1474
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1475
+ ])
1476
+
1477
+ # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc
1478
+ #CFLAGS="$CFLAGS +DAportable"
1479
+
1480
+ # Check to enable 64-bit flags for compiler/linker
1481
+ AS_IF([test "$do64bit" = "yes"], [
1482
+ AS_IF([test "$GCC" = yes], [
1483
+ case `${CC} -dumpmachine` in
1484
+ hppa64*)
1485
+ # 64-bit gcc in use. Fix flags for GNU ld.
1486
+ do64bit_ok=yes
1487
+ SHLIB_LD='${CC} -shared'
1488
+ SHLIB_LD_LIBS='${LIBS}'
1489
+ AS_IF([test $doRpath = yes], [
1490
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1491
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1492
+ ;;
1493
+ *)
1494
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
1495
+ ;;
1496
+ esac
1497
+ ], [
1498
+ do64bit_ok=yes
1499
+ CFLAGS="$CFLAGS +DD64"
1500
+ LDFLAGS_ARCH="+DD64"
1501
+ ])
1502
+ ]) ;;
1503
+ HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*)
1504
+ SHLIB_SUFFIX=".sl"
1505
+ AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no)
1506
+ AS_IF([test "$tcl_ok" = yes], [
1507
+ SHLIB_CFLAGS="+z"
1508
+ SHLIB_LD="ld -b"
1509
+ SHLIB_LD_LIBS=""
1510
+ DL_OBJS="tclLoadShl.o"
1511
+ DL_LIBS="-ldld"
1512
+ LDFLAGS="$LDFLAGS -Wl,-E"
1513
+ CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.'
1514
+ LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.'
1515
+ LD_LIBRARY_PATH_VAR="SHLIB_PATH"
1516
+ ]) ;;
1517
+ IRIX-5.*)
1518
+ SHLIB_CFLAGS=""
1519
+ SHLIB_LD="ld -shared -rdata_shared"
1520
+ SHLIB_LD_LIBS='${LIBS}'
1521
+ SHLIB_SUFFIX=".so"
1522
+ DL_OBJS="tclLoadDl.o"
1523
+ DL_LIBS=""
1524
+ AS_IF([test $doRpath = yes], [
1525
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1526
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1527
+ ;;
1528
+ IRIX-6.*)
1529
+ SHLIB_CFLAGS=""
1530
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
1531
+ SHLIB_LD_LIBS='${LIBS}'
1532
+ SHLIB_SUFFIX=".so"
1533
+ DL_OBJS="tclLoadDl.o"
1534
+ DL_LIBS=""
1535
+ AS_IF([test $doRpath = yes], [
1536
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1537
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1538
+ AS_IF([test "$GCC" = yes], [
1539
+ CFLAGS="$CFLAGS -mabi=n32"
1540
+ LDFLAGS="$LDFLAGS -mabi=n32"
1541
+ ], [
1542
+ case $system in
1543
+ IRIX-6.3)
1544
+ # Use to build 6.2 compatible binaries on 6.3.
1545
+ CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS"
1546
+ ;;
1547
+ *)
1548
+ CFLAGS="$CFLAGS -n32"
1549
+ ;;
1550
+ esac
1551
+ LDFLAGS="$LDFLAGS -n32"
1552
+ ])
1553
+ ;;
1554
+ IRIX64-6.*)
1555
+ SHLIB_CFLAGS=""
1556
+ SHLIB_LD="ld -n32 -shared -rdata_shared"
1557
+ SHLIB_LD_LIBS='${LIBS}'
1558
+ SHLIB_SUFFIX=".so"
1559
+ DL_OBJS="tclLoadDl.o"
1560
+ DL_LIBS=""
1561
+ AS_IF([test $doRpath = yes], [
1562
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1563
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1564
+
1565
+ # Check to enable 64-bit flags for compiler/linker
1566
+
1567
+ AS_IF([test "$do64bit" = yes], [
1568
+ AS_IF([test "$GCC" = yes], [
1569
+ AC_MSG_WARN([64bit mode not supported by gcc])
1570
+ ], [
1571
+ do64bit_ok=yes
1572
+ SHLIB_LD="ld -64 -shared -rdata_shared"
1573
+ CFLAGS="$CFLAGS -64"
1574
+ LDFLAGS_ARCH="-64"
1575
+ ])
1576
+ ])
1577
+ ;;
1578
+ Linux*)
1579
+ SHLIB_CFLAGS="-fPIC"
1580
+ SHLIB_LD_LIBS='${LIBS}'
1581
+ SHLIB_SUFFIX=".so"
1582
+
1583
+ # TEA specific:
1584
+ CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer"
1585
+ # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
1586
+ # when you inline the string and math operations. Turn this off to
1587
+ # get rid of the warnings.
1588
+ #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
1589
+
1590
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
1591
+ SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
1592
+ DL_OBJS="tclLoadDl.o"
1593
+ DL_LIBS="-ldl"
1594
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1595
+ AS_IF([test $doRpath = yes], [
1596
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1597
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1598
+ AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1599
+ AS_IF([test $do64bit = yes], [
1600
+ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
1601
+ hold_cflags=$CFLAGS
1602
+ CFLAGS="$CFLAGS -m64"
1603
+ AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
1604
+ CFLAGS=$hold_cflags])
1605
+ AS_IF([test $tcl_cv_cc_m64 = yes], [
1606
+ CFLAGS="$CFLAGS -m64"
1607
+ do64bit_ok=yes
1608
+ ])
1609
+ ])
1610
+
1611
+ # The combo of gcc + glibc has a bug related to inlining of
1612
+ # functions like strtod(). The -fno-builtin flag should address
1613
+ # this problem but it does not work. The -fno-inline flag is kind
1614
+ # of overkill but it works. Disable inlining only when one of the
1615
+ # files in compat/*.c is being linked in.
1616
+
1617
+ AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"])
1618
+
1619
+ ;;
1620
+ GNU*)
1621
+ SHLIB_CFLAGS="-fPIC"
1622
+ SHLIB_LD_LIBS='${LIBS}'
1623
+ SHLIB_SUFFIX=".so"
1624
+
1625
+ SHLIB_LD='${CC} -shared'
1626
+ DL_OBJS=""
1627
+ DL_LIBS="-ldl"
1628
+ LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
1629
+ CC_SEARCH_FLAGS=""
1630
+ LD_SEARCH_FLAGS=""
1631
+ AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
1632
+ ;;
1633
+ Lynx*)
1634
+ SHLIB_CFLAGS="-fPIC"
1635
+ SHLIB_LD_LIBS='${LIBS}'
1636
+ SHLIB_SUFFIX=".so"
1637
+ CFLAGS_OPTIMIZE=-02
1638
+ SHLIB_LD='${CC} -shared'
1639
+ DL_OBJS="tclLoadDl.o"
1640
+ DL_LIBS="-mshared -ldl"
1641
+ LD_FLAGS="-Wl,--export-dynamic"
1642
+ AS_IF([test $doRpath = yes], [
1643
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1644
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1645
+ ;;
1646
+ MP-RAS-02*)
1647
+ SHLIB_CFLAGS="-K PIC"
1648
+ SHLIB_LD='${CC} -G'
1649
+ SHLIB_LD_LIBS=""
1650
+ SHLIB_SUFFIX=".so"
1651
+ DL_OBJS="tclLoadDl.o"
1652
+ DL_LIBS="-ldl"
1653
+ CC_SEARCH_FLAGS=""
1654
+ LD_SEARCH_FLAGS=""
1655
+ ;;
1656
+ MP-RAS-*)
1657
+ SHLIB_CFLAGS="-K PIC"
1658
+ SHLIB_LD='${CC} -G'
1659
+ SHLIB_LD_LIBS=""
1660
+ SHLIB_SUFFIX=".so"
1661
+ DL_OBJS="tclLoadDl.o"
1662
+ DL_LIBS="-ldl"
1663
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
1664
+ CC_SEARCH_FLAGS=""
1665
+ LD_SEARCH_FLAGS=""
1666
+ ;;
1667
+ NetBSD-1.*|FreeBSD-[[1-2]].*)
1668
+ SHLIB_CFLAGS="-fPIC"
1669
+ SHLIB_LD="ld -Bshareable -x"
1670
+ SHLIB_LD_LIBS='${LIBS}'
1671
+ SHLIB_SUFFIX=".so"
1672
+ DL_OBJS="tclLoadDl.o"
1673
+ DL_LIBS=""
1674
+ AS_IF([test $doRpath = yes], [
1675
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1676
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1677
+ AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1678
+ AC_EGREP_CPP(yes, [
1679
+ #ifdef __ELF__
1680
+ yes
1681
+ #endif
1682
+ ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1683
+ AS_IF([test $tcl_cv_ld_elf = yes], [
1684
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1685
+ ], [
1686
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
1687
+ ])
1688
+
1689
+ # Ancient FreeBSD doesn't handle version numbers with dots.
1690
+
1691
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1692
+ TCL_LIB_VERSIONS_OK=nodots
1693
+ ;;
1694
+ OpenBSD-*)
1695
+ SHLIB_CFLAGS="-fPIC"
1696
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
1697
+ SHLIB_LD_LIBS='${LIBS}'
1698
+ SHLIB_SUFFIX=".so"
1699
+ DL_OBJS="tclLoadDl.o"
1700
+ DL_LIBS=""
1701
+ AS_IF([test $doRpath = yes], [
1702
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1703
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1704
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
1705
+ AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [
1706
+ AC_EGREP_CPP(yes, [
1707
+ #ifdef __ELF__
1708
+ yes
1709
+ #endif
1710
+ ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)])
1711
+ AS_IF([test $tcl_cv_ld_elf = yes], [
1712
+ LDFLAGS=-Wl,-export-dynamic
1713
+ ], [LDFLAGS=""])
1714
+
1715
+ # OpenBSD doesn't do version numbers with dots.
1716
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1717
+ TCL_LIB_VERSIONS_OK=nodots
1718
+ ;;
1719
+ NetBSD-*|FreeBSD-*)
1720
+ # FreeBSD 3.* and greater have ELF.
1721
+ # NetBSD 2.* has ELF and can use 'cc -shared' to build shared libs
1722
+ SHLIB_CFLAGS="-fPIC"
1723
+ SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
1724
+ SHLIB_LD_LIBS='${LIBS}'
1725
+ SHLIB_SUFFIX=".so"
1726
+ DL_OBJS="tclLoadDl.o"
1727
+ DL_LIBS=""
1728
+ LDFLAGS="$LDFLAGS -export-dynamic"
1729
+ AS_IF([test $doRpath = yes], [
1730
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
1731
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1732
+ AS_IF([test "${TCL_THREADS}" = "1"], [
1733
+ # The -pthread needs to go in the CFLAGS, not LIBS
1734
+ LIBS=`echo $LIBS | sed s/-pthread//`
1735
+ CFLAGS="$CFLAGS -pthread"
1736
+ LDFLAGS="$LDFLAGS -pthread"
1737
+ ])
1738
+ case $system in
1739
+ FreeBSD-3.*)
1740
+ # FreeBSD-3 doesn't handle version numbers with dots.
1741
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1742
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so'
1743
+ TCL_LIB_VERSIONS_OK=nodots
1744
+ ;;
1745
+ esac
1746
+ ;;
1747
+ Darwin-*)
1748
+ CFLAGS_OPTIMIZE="-Os"
1749
+ SHLIB_CFLAGS="-fno-common"
1750
+ # To avoid discrepancies between what headers configure sees during
1751
+ # preprocessing tests and compiling tests, move any -isysroot and
1752
+ # -mmacosx-version-min flags from CFLAGS to CPPFLAGS:
1753
+ CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \
1754
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1755
+ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`"
1756
+ CFLAGS="`echo " ${CFLAGS}" | \
1757
+ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \
1758
+ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`"
1759
+ AS_IF([test $do64bit = yes], [
1760
+ case `arch` in
1761
+ ppc)
1762
+ AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
1763
+ tcl_cv_cc_arch_ppc64, [
1764
+ hold_cflags=$CFLAGS
1765
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1766
+ AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
1767
+ tcl_cv_cc_arch_ppc64=no)
1768
+ CFLAGS=$hold_cflags])
1769
+ AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [
1770
+ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
1771
+ do64bit_ok=yes
1772
+ ]);;
1773
+ i386)
1774
+ AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
1775
+ tcl_cv_cc_arch_x86_64, [
1776
+ hold_cflags=$CFLAGS
1777
+ CFLAGS="$CFLAGS -arch x86_64"
1778
+ AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
1779
+ tcl_cv_cc_arch_x86_64=no)
1780
+ CFLAGS=$hold_cflags])
1781
+ AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [
1782
+ CFLAGS="$CFLAGS -arch x86_64"
1783
+ do64bit_ok=yes
1784
+ ]);;
1785
+ *)
1786
+ AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
1787
+ esac
1788
+ ], [
1789
+ # Check for combined 32-bit and 64-bit fat build
1790
+ AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \
1791
+ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [
1792
+ fat_32_64=yes])
1793
+ ])
1794
+ # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS
1795
+ SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
1796
+ AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
1797
+ hold_ldflags=$LDFLAGS
1798
+ LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
1799
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
1800
+ LDFLAGS=$hold_ldflags])
1801
+ AS_IF([test $tcl_cv_ld_single_module = yes], [
1802
+ SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
1803
+ ])
1804
+ SHLIB_LD_LIBS='${LIBS}'
1805
+ SHLIB_SUFFIX=".dylib"
1806
+ DL_OBJS="tclLoadDyld.o"
1807
+ DL_LIBS=""
1808
+ # Don't use -prebind when building for Mac OS X 10.4 or later only:
1809
+ AS_IF([test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
1810
+ "`echo "${CPPFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4], [
1811
+ LDFLAGS="$LDFLAGS -prebind"])
1812
+ LDFLAGS="$LDFLAGS -headerpad_max_install_names"
1813
+ AC_CACHE_CHECK([if ld accepts -search_paths_first flag],
1814
+ tcl_cv_ld_search_paths_first, [
1815
+ hold_ldflags=$LDFLAGS
1816
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1817
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes,
1818
+ tcl_cv_ld_search_paths_first=no)
1819
+ LDFLAGS=$hold_ldflags])
1820
+ AS_IF([test $tcl_cv_ld_search_paths_first = yes], [
1821
+ LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
1822
+ ])
1823
+ AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
1824
+ AC_DEFINE(MODULE_SCOPE, [__private_extern__],
1825
+ [Compiler support for module scope symbols])
1826
+ ])
1827
+ CC_SEARCH_FLAGS=""
1828
+ LD_SEARCH_FLAGS=""
1829
+ LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
1830
+ # TEA specific: for combined 32 & 64 bit fat builds of Tk
1831
+ # extensions, verify that 64-bit build is possible.
1832
+ AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [
1833
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [
1834
+ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [
1835
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
1836
+ eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"'
1837
+ done
1838
+ CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include"
1839
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
1840
+ AC_TRY_LINK([#include <X11/Xlib.h>], [XrmInitialize();],
1841
+ tcl_cv_lib_x11_64=yes, tcl_cv_lib_x11_64=no)
1842
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
1843
+ eval $v'="$hold_'$v'"'
1844
+ done])
1845
+ ])
1846
+ # remove 64-bit arch flags from CFLAGS et al. if configuration
1847
+ # does not support 64-bit.
1848
+ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua -o "$tcl_cv_lib_x11_64" = no], [
1849
+ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags])
1850
+ for v in CFLAGS CPPFLAGS LDFLAGS; do
1851
+ eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"'
1852
+ done])
1853
+ ])
1854
+ ;;
1855
+ NEXTSTEP-*)
1856
+ SHLIB_CFLAGS=""
1857
+ SHLIB_LD='${CC} -nostdlib -r'
1858
+ SHLIB_LD_LIBS=""
1859
+ SHLIB_SUFFIX=".so"
1860
+ DL_OBJS="tclLoadNext.o"
1861
+ DL_LIBS=""
1862
+ CC_SEARCH_FLAGS=""
1863
+ LD_SEARCH_FLAGS=""
1864
+ ;;
1865
+ OS/390-*)
1866
+ CFLAGS_OPTIMIZE="" # Optimizer is buggy
1867
+ AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h
1868
+ [Should OS/390 do the right thing with sockets?])
1869
+ ;;
1870
+ OSF1-1.0|OSF1-1.1|OSF1-1.2)
1871
+ # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1
1872
+ SHLIB_CFLAGS=""
1873
+ # Hack: make package name same as library name
1874
+ SHLIB_LD='ld -R -export $@:'
1875
+ SHLIB_LD_LIBS=""
1876
+ SHLIB_SUFFIX=".so"
1877
+ DL_OBJS="tclLoadOSF.o"
1878
+ DL_LIBS=""
1879
+ CC_SEARCH_FLAGS=""
1880
+ LD_SEARCH_FLAGS=""
1881
+ ;;
1882
+ OSF1-1.*)
1883
+ # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
1884
+ SHLIB_CFLAGS="-fPIC"
1885
+ AS_IF([test "$SHARED_BUILD" = 1], [SHLIB_LD="ld -shared"], [
1886
+ SHLIB_LD="ld -non_shared"
1887
+ ])
1888
+ SHLIB_LD_LIBS=""
1889
+ SHLIB_SUFFIX=".so"
1890
+ DL_OBJS="tclLoadDl.o"
1891
+ DL_LIBS=""
1892
+ CC_SEARCH_FLAGS=""
1893
+ LD_SEARCH_FLAGS=""
1894
+ ;;
1895
+ OSF1-V*)
1896
+ # Digital OSF/1
1897
+ SHLIB_CFLAGS=""
1898
+ AS_IF([test "$SHARED_BUILD" = 1], [
1899
+ SHLIB_LD='ld -shared -expect_unresolved "*"'
1900
+ ], [
1901
+ SHLIB_LD='ld -non_shared -expect_unresolved "*"'
1902
+ ])
1903
+ SHLIB_LD_LIBS=""
1904
+ SHLIB_SUFFIX=".so"
1905
+ DL_OBJS="tclLoadDl.o"
1906
+ DL_LIBS=""
1907
+ AS_IF([test $doRpath = yes], [
1908
+ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
1909
+ LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
1910
+ AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
1911
+ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
1912
+ # see pthread_intro(3) for pthread support on osf1, k.furukawa
1913
+ AS_IF([test "${TCL_THREADS}" = 1], [
1914
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE"
1915
+ CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64"
1916
+ LIBS=`echo $LIBS | sed s/-lpthreads//`
1917
+ AS_IF([test "$GCC" = yes], [
1918
+ LIBS="$LIBS -lpthread -lmach -lexc"
1919
+ ], [
1920
+ CFLAGS="$CFLAGS -pthread"
1921
+ LDFLAGS="$LDFLAGS -pthread"
1922
+ ])
1923
+ ])
1924
+ ;;
1925
+ QNX-6*)
1926
+ # QNX RTP
1927
+ # This may work for all QNX, but it was only reported for v6.
1928
+ SHLIB_CFLAGS="-fPIC"
1929
+ SHLIB_LD="ld -Bshareable -x"
1930
+ SHLIB_LD_LIBS=""
1931
+ SHLIB_SUFFIX=".so"
1932
+ DL_OBJS="tclLoadDl.o"
1933
+ # dlopen is in -lc on QNX
1934
+ DL_LIBS=""
1935
+ CC_SEARCH_FLAGS=""
1936
+ LD_SEARCH_FLAGS=""
1937
+ ;;
1938
+ SCO_SV-3.2*)
1939
+ # Note, dlopen is available only on SCO 3.2.5 and greater. However,
1940
+ # this test works, since "uname -s" was non-standard in 3.2.4 and
1941
+ # below.
1942
+ AS_IF([test "$GCC" = yes], [
1943
+ SHLIB_CFLAGS="-fPIC -melf"
1944
+ LDFLAGS="$LDFLAGS -melf -Wl,-Bexport"
1945
+ ], [
1946
+ SHLIB_CFLAGS="-Kpic -belf"
1947
+ LDFLAGS="$LDFLAGS -belf -Wl,-Bexport"
1948
+ ])
1949
+ SHLIB_LD="ld -G"
1950
+ SHLIB_LD_LIBS=""
1951
+ SHLIB_SUFFIX=".so"
1952
+ DL_OBJS="tclLoadDl.o"
1953
+ DL_LIBS=""
1954
+ CC_SEARCH_FLAGS=""
1955
+ LD_SEARCH_FLAGS=""
1956
+ ;;
1957
+ SINIX*5.4*)
1958
+ SHLIB_CFLAGS="-K PIC"
1959
+ SHLIB_LD='${CC} -G'
1960
+ SHLIB_LD_LIBS=""
1961
+ SHLIB_SUFFIX=".so"
1962
+ DL_OBJS="tclLoadDl.o"
1963
+ DL_LIBS="-ldl"
1964
+ CC_SEARCH_FLAGS=""
1965
+ LD_SEARCH_FLAGS=""
1966
+ ;;
1967
+ SunOS-4*)
1968
+ SHLIB_CFLAGS="-PIC"
1969
+ SHLIB_LD="ld"
1970
+ SHLIB_LD_LIBS=""
1971
+ SHLIB_SUFFIX=".so"
1972
+ DL_OBJS="tclLoadDl.o"
1973
+ DL_LIBS="-ldl"
1974
+ CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}'
1975
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
1976
+
1977
+ # SunOS can't handle version numbers with dots in them in library
1978
+ # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it
1979
+ # requires an extra version number at the end of .so file names.
1980
+ # So, the library has to have a name like libtcl75.so.1.0
1981
+
1982
+ SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
1983
+ UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
1984
+ TCL_LIB_VERSIONS_OK=nodots
1985
+ ;;
1986
+ SunOS-5.[[0-6]])
1987
+ # Careful to not let 5.10+ fall into this case
1988
+
1989
+ # Note: If _REENTRANT isn't defined, then Solaris
1990
+ # won't define thread-safe library routines.
1991
+
1992
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
1993
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
1994
+ [Do we really want to follow the standard? Yes we do!])
1995
+
1996
+ SHLIB_CFLAGS="-KPIC"
1997
+
1998
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
1999
+ # symbols when dynamically loaded into tclsh.
2000
+
2001
+ SHLIB_LD_LIBS='${LIBS}'
2002
+ SHLIB_SUFFIX=".so"
2003
+ DL_OBJS="tclLoadDl.o"
2004
+ DL_LIBS="-ldl"
2005
+ AS_IF([test "$GCC" = yes], [
2006
+ SHLIB_LD='${CC} -shared'
2007
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2008
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2009
+ ], [
2010
+ SHLIB_LD="/usr/ccs/bin/ld -G -z text"
2011
+ CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
2012
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2013
+ ])
2014
+ ;;
2015
+ SunOS-5*)
2016
+ # Note: If _REENTRANT isn't defined, then Solaris
2017
+ # won't define thread-safe library routines.
2018
+
2019
+ AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?])
2020
+ AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1,
2021
+ [Do we really want to follow the standard? Yes we do!])
2022
+
2023
+ SHLIB_CFLAGS="-KPIC"
2024
+
2025
+ # Check to enable 64-bit flags for compiler/linker
2026
+ AS_IF([test "$do64bit" = yes], [
2027
+ arch=`isainfo`
2028
+ AS_IF([test "$arch" = "sparcv9 sparc"], [
2029
+ AS_IF([test "$GCC" = yes], [
2030
+ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [
2031
+ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system])
2032
+ ], [
2033
+ do64bit_ok=yes
2034
+ CFLAGS="$CFLAGS -m64 -mcpu=v9"
2035
+ LDFLAGS="$LDFLAGS -m64 -mcpu=v9"
2036
+ SHLIB_CFLAGS="-fPIC"
2037
+ ])
2038
+ ], [
2039
+ do64bit_ok=yes
2040
+ AS_IF([test "$do64bitVIS" = yes], [
2041
+ CFLAGS="$CFLAGS -xarch=v9a"
2042
+ LDFLAGS_ARCH="-xarch=v9a"
2043
+ ], [
2044
+ CFLAGS="$CFLAGS -xarch=v9"
2045
+ LDFLAGS_ARCH="-xarch=v9"
2046
+ ])
2047
+ # Solaris 64 uses this as well
2048
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
2049
+ ])
2050
+ ], [AS_IF([test "$arch" = "amd64 i386"], [
2051
+ AS_IF([test "$GCC" = yes], [
2052
+ AC_MSG_WARN([64bit mode not supported with GCC on $system])
2053
+ ], [
2054
+ do64bit_ok=yes
2055
+ CFLAGS="$CFLAGS -xarch=amd64"
2056
+ LDFLAGS="$LDFLAGS -xarch=amd64"
2057
+ ])
2058
+ ], [AC_MSG_WARN([64bit mode not supported for $arch])])])
2059
+ ])
2060
+
2061
+ # Note: need the LIBS below, otherwise Tk won't find Tcl's
2062
+ # symbols when dynamically loaded into tclsh.
2063
+
2064
+ SHLIB_LD_LIBS='${LIBS}'
2065
+ SHLIB_SUFFIX=".so"
2066
+ DL_OBJS="tclLoadDl.o"
2067
+ DL_LIBS="-ldl"
2068
+ AS_IF([test "$GCC" = yes], [
2069
+ SHLIB_LD='${CC} -shared'
2070
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2071
+ LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
2072
+ AS_IF([test "$do64bit_ok" = yes], [
2073
+ # We need to specify -static-libgcc or we need to
2074
+ # add the path to the sparv9 libgcc.
2075
+ # JH: static-libgcc is necessary for core Tcl, but may
2076
+ # not be necessary for extensions.
2077
+ SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc"
2078
+ # for finding sparcv9 libgcc, get the regular libgcc
2079
+ # path, remove so name and append 'sparcv9'
2080
+ #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..."
2081
+ #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir"
2082
+ ])
2083
+ ], [
2084
+ case $system in
2085
+ SunOS-5.[[1-9]][[0-9]]*)
2086
+ SHLIB_LD='${CC} -G -z text';;
2087
+ *)
2088
+ SHLIB_LD='/usr/ccs/bin/ld -G -z text';;
2089
+ esac
2090
+ CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
2091
+ LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
2092
+ ])
2093
+ ;;
2094
+ UNIX_SV* | UnixWare-5*)
2095
+ SHLIB_CFLAGS="-KPIC"
2096
+ SHLIB_LD='${CC} -G'
2097
+ SHLIB_LD_LIBS=""
2098
+ SHLIB_SUFFIX=".so"
2099
+ DL_OBJS="tclLoadDl.o"
2100
+ DL_LIBS="-ldl"
2101
+ # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers
2102
+ # that don't grok the -Bexport option. Test that it does.
2103
+ AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [
2104
+ hold_ldflags=$LDFLAGS
2105
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
2106
+ AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no)
2107
+ LDFLAGS=$hold_ldflags])
2108
+ AS_IF([test $tcl_cv_ld_Bexport = yes], [
2109
+ LDFLAGS="$LDFLAGS -Wl,-Bexport"
2110
+ ])
2111
+ CC_SEARCH_FLAGS=""
2112
+ LD_SEARCH_FLAGS=""
2113
+ ;;
2114
+ esac
2115
+
2116
+ AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [
2117
+ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform])
2118
+ ])
2119
+
2120
+ dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so
2121
+ dnl # until the end of configure, as configure's compile and link tests use
2122
+ dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's
2123
+ dnl # preprocessing tests use only CPPFLAGS.
2124
+ AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""])
2125
+
2126
+ # Step 4: disable dynamic loading if requested via a command-line switch.
2127
+
2128
+ AC_ARG_ENABLE(load,
2129
+ AC_HELP_STRING([--enable-load],
2130
+ [allow dynamic loading and "load" command (default: on)]),
2131
+ [tcl_ok=$enableval], [tcl_ok=yes])
2132
+ AS_IF([test "$tcl_ok" = no], [DL_OBJS=""])
2133
+
2134
+ AS_IF([test "x$DL_OBJS" != x], [BUILD_DLTEST="\$(DLTEST_TARGETS)"], [
2135
+ AC_MSG_WARN([Can't figure out how to do dynamic loading or shared libraries on this system.])
2136
+ SHLIB_CFLAGS=""
2137
+ SHLIB_LD=""
2138
+ SHLIB_SUFFIX=""
2139
+ DL_OBJS="tclLoadNone.o"
2140
+ DL_LIBS=""
2141
+ LDFLAGS="$LDFLAGS_ORIG"
2142
+ CC_SEARCH_FLAGS=""
2143
+ LD_SEARCH_FLAGS=""
2144
+ BUILD_DLTEST=""
2145
+ ])
2146
+ LDFLAGS="$LDFLAGS $LDFLAGS_ARCH"
2147
+
2148
+ # If we're running gcc, then change the C flags for compiling shared
2149
+ # libraries to the right flags for gcc, instead of those for the
2150
+ # standard manufacturer compiler.
2151
+
2152
+ AS_IF([test "$DL_OBJS" != "tclLoadNone.o" -a "$GCC" = yes], [
2153
+ case $system in
2154
+ AIX-*) ;;
2155
+ BSD/OS*) ;;
2156
+ IRIX*) ;;
2157
+ NetBSD-*|FreeBSD-*) ;;
2158
+ Darwin-*) ;;
2159
+ SCO_SV-3.2*) ;;
2160
+ *) SHLIB_CFLAGS="-fPIC" ;;
2161
+ esac])
2162
+
2163
+ AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [
2164
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
2165
+ SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}'])
2166
+ AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [
2167
+ # TEA specific: use PACKAGE_VERSION instead of VERSION
2168
+ UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a'])
2169
+
2170
+ AC_SUBST(DL_LIBS)
2171
+
2172
+ AC_SUBST(CFLAGS_DEBUG)
2173
+ AC_SUBST(CFLAGS_OPTIMIZE)
2174
+ AC_SUBST(CFLAGS_WARNING)
2175
+
2176
+ AC_SUBST(STLIB_LD)
2177
+ AC_SUBST(SHLIB_LD)
2178
+
2179
+ AC_SUBST(SHLIB_LD_LIBS)
2180
+ AC_SUBST(SHLIB_CFLAGS)
2181
+
2182
+ AC_SUBST(LD_LIBRARY_PATH_VAR)
2183
+
2184
+ # These must be called after we do the basic CFLAGS checks and
2185
+ # verify any possible 64-bit or similar switches are necessary
2186
+ TEA_TCL_EARLY_FLAGS
2187
+ TEA_TCL_64BIT_FLAGS
2188
+ ])
2189
+
2190
+ #--------------------------------------------------------------------
2191
+ # TEA_SERIAL_PORT
2192
+ #
2193
+ # Determine which interface to use to talk to the serial port.
2194
+ # Note that #include lines must begin in leftmost column for
2195
+ # some compilers to recognize them as preprocessor directives,
2196
+ # and some build environments have stdin not pointing at a
2197
+ # pseudo-terminal (usually /dev/null instead.)
2198
+ #
2199
+ # Arguments:
2200
+ # none
2201
+ #
2202
+ # Results:
2203
+ #
2204
+ # Defines only one of the following vars:
2205
+ # HAVE_SYS_MODEM_H
2206
+ # USE_TERMIOS
2207
+ # USE_TERMIO
2208
+ # USE_SGTTY
2209
+ #
2210
+ #--------------------------------------------------------------------
2211
+
2212
+ AC_DEFUN([TEA_SERIAL_PORT], [
2213
+ AC_CHECK_HEADERS(sys/modem.h)
2214
+ AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
2215
+ AC_TRY_RUN([
2216
+ #include <termios.h>
2217
+
2218
+ int main() {
2219
+ struct termios t;
2220
+ if (tcgetattr(0, &t) == 0) {
2221
+ cfsetospeed(&t, 0);
2222
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2223
+ return 0;
2224
+ }
2225
+ return 1;
2226
+ }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2227
+ if test $tcl_cv_api_serial = no ; then
2228
+ AC_TRY_RUN([
2229
+ #include <termio.h>
2230
+
2231
+ int main() {
2232
+ struct termio t;
2233
+ if (ioctl(0, TCGETA, &t) == 0) {
2234
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2235
+ return 0;
2236
+ }
2237
+ return 1;
2238
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2239
+ fi
2240
+ if test $tcl_cv_api_serial = no ; then
2241
+ AC_TRY_RUN([
2242
+ #include <sgtty.h>
2243
+
2244
+ int main() {
2245
+ struct sgttyb t;
2246
+ if (ioctl(0, TIOCGETP, &t) == 0) {
2247
+ t.sg_ospeed = 0;
2248
+ t.sg_flags |= ODDP | EVENP | RAW;
2249
+ return 0;
2250
+ }
2251
+ return 1;
2252
+ }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2253
+ fi
2254
+ if test $tcl_cv_api_serial = no ; then
2255
+ AC_TRY_RUN([
2256
+ #include <termios.h>
2257
+ #include <errno.h>
2258
+
2259
+ int main() {
2260
+ struct termios t;
2261
+ if (tcgetattr(0, &t) == 0
2262
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2263
+ cfsetospeed(&t, 0);
2264
+ t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB;
2265
+ return 0;
2266
+ }
2267
+ return 1;
2268
+ }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2269
+ fi
2270
+ if test $tcl_cv_api_serial = no; then
2271
+ AC_TRY_RUN([
2272
+ #include <termio.h>
2273
+ #include <errno.h>
2274
+
2275
+ int main() {
2276
+ struct termio t;
2277
+ if (ioctl(0, TCGETA, &t) == 0
2278
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2279
+ t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB;
2280
+ return 0;
2281
+ }
2282
+ return 1;
2283
+ }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no)
2284
+ fi
2285
+ if test $tcl_cv_api_serial = no; then
2286
+ AC_TRY_RUN([
2287
+ #include <sgtty.h>
2288
+ #include <errno.h>
2289
+
2290
+ int main() {
2291
+ struct sgttyb t;
2292
+ if (ioctl(0, TIOCGETP, &t) == 0
2293
+ || errno == ENOTTY || errno == ENXIO || errno == EINVAL) {
2294
+ t.sg_ospeed = 0;
2295
+ t.sg_flags |= ODDP | EVENP | RAW;
2296
+ return 0;
2297
+ }
2298
+ return 1;
2299
+ }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none)
2300
+ fi])
2301
+ case $tcl_cv_api_serial in
2302
+ termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);;
2303
+ termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
2304
+ sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
2305
+ esac
2306
+ ])
2307
+
2308
+ #--------------------------------------------------------------------
2309
+ # TEA_MISSING_POSIX_HEADERS
2310
+ #
2311
+ # Supply substitutes for missing POSIX header files. Special
2312
+ # notes:
2313
+ # - stdlib.h doesn't define strtol, strtoul, or
2314
+ # strtod insome versions of SunOS
2315
+ # - some versions of string.h don't declare procedures such
2316
+ # as strstr
2317
+ #
2318
+ # Arguments:
2319
+ # none
2320
+ #
2321
+ # Results:
2322
+ #
2323
+ # Defines some of the following vars:
2324
+ # NO_DIRENT_H
2325
+ # NO_ERRNO_H
2326
+ # NO_VALUES_H
2327
+ # HAVE_LIMITS_H or NO_LIMITS_H
2328
+ # NO_STDLIB_H
2329
+ # NO_STRING_H
2330
+ # NO_SYS_WAIT_H
2331
+ # NO_DLFCN_H
2332
+ # HAVE_SYS_PARAM_H
2333
+ #
2334
+ # HAVE_STRING_H ?
2335
+ #
2336
+ # tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and
2337
+ # CHECK on limits.h
2338
+ #--------------------------------------------------------------------
2339
+
2340
+ AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
2341
+ AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
2342
+ AC_TRY_LINK([#include <sys/types.h>
2343
+ #include <dirent.h>], [
2344
+ #ifndef _POSIX_SOURCE
2345
+ # ifdef __Lynx__
2346
+ /*
2347
+ * Generate compilation error to make the test fail: Lynx headers
2348
+ * are only valid if really in the POSIX environment.
2349
+ */
2350
+
2351
+ missing_procedure();
2352
+ # endif
2353
+ #endif
2354
+ DIR *d;
2355
+ struct dirent *entryPtr;
2356
+ char *p;
2357
+ d = opendir("foobar");
2358
+ entryPtr = readdir(d);
2359
+ p = entryPtr->d_name;
2360
+ closedir(d);
2361
+ ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
2362
+
2363
+ if test $tcl_cv_dirent_h = no; then
2364
+ AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
2365
+ fi
2366
+
2367
+ # TEA specific:
2368
+ AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have <errno.h>?])])
2369
+ AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
2370
+ AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
2371
+ AC_CHECK_HEADER(limits.h,
2372
+ [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have <limits.h>?])],
2373
+ [AC_DEFINE(NO_LIMITS_H, 1, [Do we have <limits.h>?])])
2374
+ AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
2375
+ AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
2376
+ AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
2377
+ AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
2378
+ if test $tcl_ok = 0; then
2379
+ AC_DEFINE(NO_STDLIB_H, 1, [Do we have <stdlib.h>?])
2380
+ fi
2381
+ AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
2382
+ AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
2383
+ AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
2384
+
2385
+ # See also memmove check below for a place where NO_STRING_H can be
2386
+ # set and why.
2387
+
2388
+ if test $tcl_ok = 0; then
2389
+ AC_DEFINE(NO_STRING_H, 1, [Do we have <string.h>?])
2390
+ fi
2391
+
2392
+ AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have <sys/wait.h>?])])
2393
+ AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have <dlfcn.h>?])])
2394
+
2395
+ # OS/390 lacks sys/param.h (and doesn't need it, by chance).
2396
+ AC_HAVE_HEADERS(sys/param.h)
2397
+ ])
2398
+
2399
+ #--------------------------------------------------------------------
2400
+ # TEA_PATH_X
2401
+ #
2402
+ # Locate the X11 header files and the X11 library archive. Try
2403
+ # the ac_path_x macro first, but if it doesn't find the X stuff
2404
+ # (e.g. because there's no xmkmf program) then check through
2405
+ # a list of possible directories. Under some conditions the
2406
+ # autoconf macro will return an include directory that contains
2407
+ # no include files, so double-check its result just to be safe.
2408
+ #
2409
+ # This should be called after TEA_CONFIG_CFLAGS as setting the
2410
+ # LIBS line can confuse some configure macro magic.
2411
+ #
2412
+ # Arguments:
2413
+ # none
2414
+ #
2415
+ # Results:
2416
+ #
2417
+ # Sets the following vars:
2418
+ # XINCLUDES
2419
+ # XLIBSW
2420
+ # PKG_LIBS (appends to)
2421
+ #
2422
+ #--------------------------------------------------------------------
2423
+
2424
+ AC_DEFUN([TEA_PATH_X], [
2425
+ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
2426
+ TEA_PATH_UNIX_X
2427
+ fi
2428
+ ])
2429
+
2430
+ AC_DEFUN([TEA_PATH_UNIX_X], [
2431
+ AC_PATH_X
2432
+ not_really_there=""
2433
+ if test "$no_x" = ""; then
2434
+ if test "$x_includes" = ""; then
2435
+ AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes")
2436
+ else
2437
+ if test ! -r $x_includes/X11/Intrinsic.h; then
2438
+ not_really_there="yes"
2439
+ fi
2440
+ fi
2441
+ fi
2442
+ if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
2443
+ AC_MSG_CHECKING([for X11 header files])
2444
+ found_xincludes="no"
2445
+ AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no")
2446
+ if test "$found_xincludes" = "no"; then
2447
+ dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
2448
+ for i in $dirs ; do
2449
+ if test -r $i/X11/Intrinsic.h; then
2450
+ AC_MSG_RESULT([$i])
2451
+ XINCLUDES=" -I$i"
2452
+ found_xincludes="yes"
2453
+ break
2454
+ fi
2455
+ done
2456
+ fi
2457
+ else
2458
+ if test "$x_includes" != ""; then
2459
+ XINCLUDES="-I$x_includes"
2460
+ found_xincludes="yes"
2461
+ fi
2462
+ fi
2463
+ if test found_xincludes = "no"; then
2464
+ AC_MSG_RESULT([couldn't find any!])
2465
+ fi
2466
+
2467
+ if test "$no_x" = yes; then
2468
+ AC_MSG_CHECKING([for X11 libraries])
2469
+ XLIBSW=nope
2470
+ dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
2471
+ for i in $dirs ; do
2472
+ if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then
2473
+ AC_MSG_RESULT([$i])
2474
+ XLIBSW="-L$i -lX11"
2475
+ x_libraries="$i"
2476
+ break
2477
+ fi
2478
+ done
2479
+ else
2480
+ if test "$x_libraries" = ""; then
2481
+ XLIBSW=-lX11
2482
+ else
2483
+ XLIBSW="-L$x_libraries -lX11"
2484
+ fi
2485
+ fi
2486
+ if test "$XLIBSW" = nope ; then
2487
+ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
2488
+ fi
2489
+ if test "$XLIBSW" = nope ; then
2490
+ AC_MSG_RESULT([could not find any! Using -lX11.])
2491
+ XLIBSW=-lX11
2492
+ fi
2493
+ # TEA specific:
2494
+ if test x"${XLIBSW}" != x ; then
2495
+ PKG_LIBS="${PKG_LIBS} ${XLIBSW}"
2496
+ fi
2497
+ ])
2498
+
2499
+ #--------------------------------------------------------------------
2500
+ # TEA_BLOCKING_STYLE
2501
+ #
2502
+ # The statements below check for systems where POSIX-style
2503
+ # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented.
2504
+ # On these systems (mostly older ones), use the old BSD-style
2505
+ # FIONBIO approach instead.
2506
+ #
2507
+ # Arguments:
2508
+ # none
2509
+ #
2510
+ # Results:
2511
+ #
2512
+ # Defines some of the following vars:
2513
+ # HAVE_SYS_IOCTL_H
2514
+ # HAVE_SYS_FILIO_H
2515
+ # USE_FIONBIO
2516
+ # O_NONBLOCK
2517
+ #
2518
+ #--------------------------------------------------------------------
2519
+
2520
+ AC_DEFUN([TEA_BLOCKING_STYLE], [
2521
+ AC_CHECK_HEADERS(sys/ioctl.h)
2522
+ AC_CHECK_HEADERS(sys/filio.h)
2523
+ TEA_CONFIG_SYSTEM
2524
+ AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
2525
+ case $system in
2526
+ # There used to be code here to use FIONBIO under AIX. However, it
2527
+ # was reported that FIONBIO doesn't work under AIX 3.2.5. Since
2528
+ # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO
2529
+ # code (JO, 5/31/97).
2530
+
2531
+ OSF*)
2532
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
2533
+ AC_MSG_RESULT([FIONBIO])
2534
+ ;;
2535
+ SunOS-4*)
2536
+ AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
2537
+ AC_MSG_RESULT([FIONBIO])
2538
+ ;;
2539
+ *)
2540
+ AC_MSG_RESULT([O_NONBLOCK])
2541
+ ;;
2542
+ esac
2543
+ ])
2544
+
2545
+ #--------------------------------------------------------------------
2546
+ # TEA_TIME_HANLDER
2547
+ #
2548
+ # Checks how the system deals with time.h, what time structures
2549
+ # are used on the system, and what fields the structures have.
2550
+ #
2551
+ # Arguments:
2552
+ # none
2553
+ #
2554
+ # Results:
2555
+ #
2556
+ # Defines some of the following vars:
2557
+ # USE_DELTA_FOR_TZ
2558
+ # HAVE_TM_GMTOFF
2559
+ # HAVE_TM_TZADJ
2560
+ # HAVE_TIMEZONE_VAR
2561
+ #
2562
+ #--------------------------------------------------------------------
2563
+
2564
+ AC_DEFUN([TEA_TIME_HANDLER], [
2565
+ AC_CHECK_HEADERS(sys/time.h)
2566
+ AC_HEADER_TIME
2567
+ AC_STRUCT_TIMEZONE
2568
+
2569
+ AC_CHECK_FUNCS(gmtime_r localtime_r)
2570
+
2571
+ AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [
2572
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;],
2573
+ tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
2574
+ if test $tcl_cv_member_tm_tzadj = yes ; then
2575
+ AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?])
2576
+ fi
2577
+
2578
+ AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
2579
+ AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
2580
+ tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
2581
+ if test $tcl_cv_member_tm_gmtoff = yes ; then
2582
+ AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
2583
+ fi
2584
+
2585
+ #
2586
+ # Its important to include time.h in this check, as some systems
2587
+ # (like convex) have timezone functions, etc.
2588
+ #
2589
+ AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [
2590
+ AC_TRY_COMPILE([#include <time.h>],
2591
+ [extern long timezone;
2592
+ timezone += 1;
2593
+ exit (0);],
2594
+ tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
2595
+ if test $tcl_cv_timezone_long = yes ; then
2596
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2597
+ else
2598
+ #
2599
+ # On some systems (eg IRIX 6.2), timezone is a time_t and not a long.
2600
+ #
2601
+ AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [
2602
+ AC_TRY_COMPILE([#include <time.h>],
2603
+ [extern time_t timezone;
2604
+ timezone += 1;
2605
+ exit (0);],
2606
+ tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
2607
+ if test $tcl_cv_timezone_time = yes ; then
2608
+ AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
2609
+ fi
2610
+ fi
2611
+ ])
2612
+
2613
+ #--------------------------------------------------------------------
2614
+ # TEA_BUGGY_STRTOD
2615
+ #
2616
+ # Under Solaris 2.4, strtod returns the wrong value for the
2617
+ # terminating character under some conditions. Check for this
2618
+ # and if the problem exists use a substitute procedure
2619
+ # "fixstrtod" (provided by Tcl) that corrects the error.
2620
+ # Also, on Compaq's Tru64 Unix 5.0,
2621
+ # strtod(" ") returns 0.0 instead of a failure to convert.
2622
+ #
2623
+ # Arguments:
2624
+ # none
2625
+ #
2626
+ # Results:
2627
+ #
2628
+ # Might defines some of the following vars:
2629
+ # strtod (=fixstrtod)
2630
+ #
2631
+ #--------------------------------------------------------------------
2632
+
2633
+ AC_DEFUN([TEA_BUGGY_STRTOD], [
2634
+ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
2635
+ if test "$tcl_strtod" = 1; then
2636
+ AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
2637
+ AC_TRY_RUN([
2638
+ extern double strtod();
2639
+ int main() {
2640
+ char *infString="Inf", *nanString="NaN", *spaceString=" ";
2641
+ char *term;
2642
+ double value;
2643
+ value = strtod(infString, &term);
2644
+ if ((term != infString) && (term[-1] == 0)) {
2645
+ exit(1);
2646
+ }
2647
+ value = strtod(nanString, &term);
2648
+ if ((term != nanString) && (term[-1] == 0)) {
2649
+ exit(1);
2650
+ }
2651
+ value = strtod(spaceString, &term);
2652
+ if (term == (spaceString+1)) {
2653
+ exit(1);
2654
+ }
2655
+ exit(0);
2656
+ }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
2657
+ tcl_cv_strtod_buggy=buggy)])
2658
+ if test "$tcl_cv_strtod_buggy" = buggy; then
2659
+ AC_LIBOBJ([fixstrtod])
2660
+ USE_COMPAT=1
2661
+ AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
2662
+ fi
2663
+ fi
2664
+ ])
2665
+
2666
+ #--------------------------------------------------------------------
2667
+ # TEA_TCL_LINK_LIBS
2668
+ #
2669
+ # Search for the libraries needed to link the Tcl shell.
2670
+ # Things like the math library (-lm) and socket stuff (-lsocket vs.
2671
+ # -lnsl) are dealt with here.
2672
+ #
2673
+ # Arguments:
2674
+ # Requires the following vars to be set in the Makefile:
2675
+ # DL_LIBS
2676
+ # LIBS
2677
+ # MATH_LIBS
2678
+ #
2679
+ # Results:
2680
+ #
2681
+ # Subst's the following var:
2682
+ # TCL_LIBS
2683
+ # MATH_LIBS
2684
+ #
2685
+ # Might append to the following vars:
2686
+ # LIBS
2687
+ #
2688
+ # Might define the following vars:
2689
+ # HAVE_NET_ERRNO_H
2690
+ #
2691
+ #--------------------------------------------------------------------
2692
+
2693
+ AC_DEFUN([TEA_TCL_LINK_LIBS], [
2694
+ #--------------------------------------------------------------------
2695
+ # On a few very rare systems, all of the libm.a stuff is
2696
+ # already in libc.a. Set compiler flags accordingly.
2697
+ # Also, Linux requires the "ieee" library for math to work
2698
+ # right (and it must appear before "-lm").
2699
+ #--------------------------------------------------------------------
2700
+
2701
+ AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
2702
+ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
2703
+
2704
+ #--------------------------------------------------------------------
2705
+ # Interactive UNIX requires -linet instead of -lsocket, plus it
2706
+ # needs net/errno.h to define the socket-related error codes.
2707
+ #--------------------------------------------------------------------
2708
+
2709
+ AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"])
2710
+ AC_CHECK_HEADER(net/errno.h, [
2711
+ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])])
2712
+
2713
+ #--------------------------------------------------------------------
2714
+ # Check for the existence of the -lsocket and -lnsl libraries.
2715
+ # The order here is important, so that they end up in the right
2716
+ # order in the command line generated by make. Here are some
2717
+ # special considerations:
2718
+ # 1. Use "connect" and "accept" to check for -lsocket, and
2719
+ # "gethostbyname" to check for -lnsl.
2720
+ # 2. Use each function name only once: can't redo a check because
2721
+ # autoconf caches the results of the last check and won't redo it.
2722
+ # 3. Use -lnsl and -lsocket only if they supply procedures that
2723
+ # aren't already present in the normal libraries. This is because
2724
+ # IRIX 5.2 has libraries, but they aren't needed and they're
2725
+ # bogus: they goof up name resolution if used.
2726
+ # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
2727
+ # To get around this problem, check for both libraries together
2728
+ # if -lsocket doesn't work by itself.
2729
+ #--------------------------------------------------------------------
2730
+
2731
+ tcl_checkBoth=0
2732
+ AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
2733
+ if test "$tcl_checkSocket" = 1; then
2734
+ AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt,
2735
+ LIBS="$LIBS -lsocket", tcl_checkBoth=1)])
2736
+ fi
2737
+ if test "$tcl_checkBoth" = 1; then
2738
+ tk_oldLibs=$LIBS
2739
+ LIBS="$LIBS -lsocket -lnsl"
2740
+ AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs])
2741
+ fi
2742
+ AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname,
2743
+ [LIBS="$LIBS -lnsl"])])
2744
+
2745
+ # TEA specific: Don't perform the eval of the libraries here because
2746
+ # DL_LIBS won't be set until we call TEA_CONFIG_CFLAGS
2747
+
2748
+ TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}'
2749
+ AC_SUBST(TCL_LIBS)
2750
+ AC_SUBST(MATH_LIBS)
2751
+ ])
2752
+
2753
+ #--------------------------------------------------------------------
2754
+ # TEA_TCL_EARLY_FLAGS
2755
+ #
2756
+ # Check for what flags are needed to be passed so the correct OS
2757
+ # features are available.
2758
+ #
2759
+ # Arguments:
2760
+ # None
2761
+ #
2762
+ # Results:
2763
+ #
2764
+ # Might define the following vars:
2765
+ # _ISOC99_SOURCE
2766
+ # _LARGEFILE64_SOURCE
2767
+ # _LARGEFILE_SOURCE64
2768
+ #
2769
+ #--------------------------------------------------------------------
2770
+
2771
+ AC_DEFUN([TEA_TCL_EARLY_FLAG],[
2772
+ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
2773
+ AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
2774
+ AC_TRY_COMPILE([[#define ]$1[ 1
2775
+ ]$2], $3,
2776
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
2777
+ [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)))
2778
+ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
2779
+ AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
2780
+ tcl_flags="$tcl_flags $1"
2781
+ fi
2782
+ ])
2783
+
2784
+ AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
2785
+ AC_MSG_CHECKING([for required early compiler flags])
2786
+ tcl_flags=""
2787
+ TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
2788
+ [char *p = (char *)strtoll; char *q = (char *)strtoull;])
2789
+ TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
2790
+ [struct stat64 buf; int i = stat64("/", &buf);])
2791
+ TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
2792
+ [char *p = (char *)open64;])
2793
+ if test "x${tcl_flags}" = "x" ; then
2794
+ AC_MSG_RESULT([none])
2795
+ else
2796
+ AC_MSG_RESULT([${tcl_flags}])
2797
+ fi
2798
+ ])
2799
+
2800
+ #--------------------------------------------------------------------
2801
+ # TEA_TCL_64BIT_FLAGS
2802
+ #
2803
+ # Check for what is defined in the way of 64-bit features.
2804
+ #
2805
+ # Arguments:
2806
+ # None
2807
+ #
2808
+ # Results:
2809
+ #
2810
+ # Might define the following vars:
2811
+ # TCL_WIDE_INT_IS_LONG
2812
+ # TCL_WIDE_INT_TYPE
2813
+ # HAVE_STRUCT_DIRENT64
2814
+ # HAVE_STRUCT_STAT64
2815
+ # HAVE_TYPE_OFF64_T
2816
+ #
2817
+ #--------------------------------------------------------------------
2818
+
2819
+ AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
2820
+ AC_MSG_CHECKING([for 64-bit integer type])
2821
+ AC_CACHE_VAL(tcl_cv_type_64bit,[
2822
+ tcl_cv_type_64bit=none
2823
+ # See if the compiler knows natively about __int64
2824
+ AC_TRY_COMPILE(,[__int64 value = (__int64) 0;],
2825
+ tcl_type_64bit=__int64, tcl_type_64bit="long long")
2826
+ # See if we should use long anyway Note that we substitute in the
2827
+ # type that is our current guess for a 64-bit type inside this check
2828
+ # program, so it should be modified only carefully...
2829
+ AC_TRY_COMPILE(,[switch (0) {
2830
+ case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ;
2831
+ }],tcl_cv_type_64bit=${tcl_type_64bit})])
2832
+ if test "${tcl_cv_type_64bit}" = none ; then
2833
+ AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?])
2834
+ AC_MSG_RESULT([using long])
2835
+ elif test "${tcl_cv_type_64bit}" = "__int64" \
2836
+ -a "${TEA_PLATFORM}" = "windows" ; then
2837
+ # TEA specific: We actually want to use the default tcl.h checks in
2838
+ # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER*
2839
+ AC_MSG_RESULT([using Tcl header defaults])
2840
+ else
2841
+ AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
2842
+ [What type should be used to define wide integers?])
2843
+ AC_MSG_RESULT([${tcl_cv_type_64bit}])
2844
+
2845
+ # Now check for auxiliary declarations
2846
+ AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
2847
+ AC_TRY_COMPILE([#include <sys/types.h>
2848
+ #include <sys/dirent.h>],[struct dirent64 p;],
2849
+ tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)])
2850
+ if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then
2851
+ AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
2852
+ fi
2853
+
2854
+ AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
2855
+ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
2856
+ ],
2857
+ tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)])
2858
+ if test "x${tcl_cv_struct_stat64}" = "xyes" ; then
2859
+ AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in <sys/stat.h>?])
2860
+ fi
2861
+
2862
+ AC_CHECK_FUNCS(open64 lseek64)
2863
+ AC_MSG_CHECKING([for off64_t])
2864
+ AC_CACHE_VAL(tcl_cv_type_off64_t,[
2865
+ AC_TRY_COMPILE([#include <sys/types.h>],[off64_t offset;
2866
+ ],
2867
+ tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)])
2868
+ dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
2869
+ dnl functions lseek64 and open64 are defined.
2870
+ if test "x${tcl_cv_type_off64_t}" = "xyes" && \
2871
+ test "x${ac_cv_func_lseek64}" = "xyes" && \
2872
+ test "x${ac_cv_func_open64}" = "xyes" ; then
2873
+ AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
2874
+ AC_MSG_RESULT([yes])
2875
+ else
2876
+ AC_MSG_RESULT([no])
2877
+ fi
2878
+ fi
2879
+ ])
2880
+
2881
+ ##
2882
+ ## Here ends the standard Tcl configuration bits and starts the
2883
+ ## TEA specific functions
2884
+ ##
2885
+
2886
+ #------------------------------------------------------------------------
2887
+ # TEA_INIT --
2888
+ #
2889
+ # Init various Tcl Extension Architecture (TEA) variables.
2890
+ # This should be the first called TEA_* macro.
2891
+ #
2892
+ # Arguments:
2893
+ # none
2894
+ #
2895
+ # Results:
2896
+ #
2897
+ # Defines and substs the following vars:
2898
+ # CYGPATH
2899
+ # EXEEXT
2900
+ # Defines only:
2901
+ # TEA_VERSION
2902
+ # TEA_INITED
2903
+ # TEA_PLATFORM (windows or unix)
2904
+ #
2905
+ # "cygpath" is used on windows to generate native path names for include
2906
+ # files. These variables should only be used with the compiler and linker
2907
+ # since they generate native path names.
2908
+ #
2909
+ # EXEEXT
2910
+ # Select the executable extension based on the host type. This
2911
+ # is a lightweight replacement for AC_EXEEXT that doesn't require
2912
+ # a compiler.
2913
+ #------------------------------------------------------------------------
2914
+
2915
+ AC_DEFUN([TEA_INIT], [
2916
+ # TEA extensions pass this us the version of TEA they think they
2917
+ # are compatible with.
2918
+ TEA_VERSION="3.6"
2919
+
2920
+ AC_MSG_CHECKING([for correct TEA configuration])
2921
+ if test x"${PACKAGE_NAME}" = x ; then
2922
+ AC_MSG_ERROR([
2923
+ The PACKAGE_NAME variable must be defined by your TEA configure.in])
2924
+ fi
2925
+ if test x"$1" = x ; then
2926
+ AC_MSG_ERROR([
2927
+ TEA version not specified.])
2928
+ elif test "$1" != "${TEA_VERSION}" ; then
2929
+ AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"])
2930
+ else
2931
+ AC_MSG_RESULT([ok (TEA ${TEA_VERSION})])
2932
+ fi
2933
+ case "`uname -s`" in
2934
+ *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*)
2935
+ AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
2936
+ EXEEXT=".exe"
2937
+ TEA_PLATFORM="windows"
2938
+ ;;
2939
+ *)
2940
+ CYGPATH=echo
2941
+ EXEEXT=""
2942
+ TEA_PLATFORM="unix"
2943
+ ;;
2944
+ esac
2945
+
2946
+ # Check if exec_prefix is set. If not use fall back to prefix.
2947
+ # Note when adjusted, so that TEA_PREFIX can correct for this.
2948
+ # This is needed for recursive configures, since autoconf propagates
2949
+ # $prefix, but not $exec_prefix (doh!).
2950
+ if test x$exec_prefix = xNONE ; then
2951
+ exec_prefix_default=yes
2952
+ exec_prefix=$prefix
2953
+ fi
2954
+
2955
+ AC_SUBST(EXEEXT)
2956
+ AC_SUBST(CYGPATH)
2957
+
2958
+ # This package name must be replaced statically for AC_SUBST to work
2959
+ AC_SUBST(PKG_LIB_FILE)
2960
+ # Substitute STUB_LIB_FILE in case package creates a stub library too.
2961
+ AC_SUBST(PKG_STUB_LIB_FILE)
2962
+
2963
+ # We AC_SUBST these here to ensure they are subst'ed,
2964
+ # in case the user doesn't call TEA_ADD_...
2965
+ AC_SUBST(PKG_STUB_SOURCES)
2966
+ AC_SUBST(PKG_STUB_OBJECTS)
2967
+ AC_SUBST(PKG_TCL_SOURCES)
2968
+ AC_SUBST(PKG_HEADERS)
2969
+ AC_SUBST(PKG_INCLUDES)
2970
+ AC_SUBST(PKG_LIBS)
2971
+ AC_SUBST(PKG_CFLAGS)
2972
+ ])
2973
+
2974
+ #------------------------------------------------------------------------
2975
+ # TEA_ADD_SOURCES --
2976
+ #
2977
+ # Specify one or more source files. Users should check for
2978
+ # the right platform before adding to their list.
2979
+ # It is not important to specify the directory, as long as it is
2980
+ # in the generic, win or unix subdirectory of $(srcdir).
2981
+ #
2982
+ # Arguments:
2983
+ # one or more file names
2984
+ #
2985
+ # Results:
2986
+ #
2987
+ # Defines and substs the following vars:
2988
+ # PKG_SOURCES
2989
+ # PKG_OBJECTS
2990
+ #------------------------------------------------------------------------
2991
+ AC_DEFUN([TEA_ADD_SOURCES], [
2992
+ vars="$@"
2993
+ for i in $vars; do
2994
+ case $i in
2995
+ [\$]*)
2996
+ # allow $-var names
2997
+ PKG_SOURCES="$PKG_SOURCES $i"
2998
+ PKG_OBJECTS="$PKG_OBJECTS $i"
2999
+ ;;
3000
+ *)
3001
+ # check for existence - allows for generic/win/unix VPATH
3002
+ # To add more dirs here (like 'src'), you have to update VPATH
3003
+ # in Makefile.in as well
3004
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
3005
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
3006
+ ; then
3007
+ AC_MSG_ERROR([could not find source file '$i'])
3008
+ fi
3009
+ PKG_SOURCES="$PKG_SOURCES $i"
3010
+ # this assumes it is in a VPATH dir
3011
+ i=`basename $i`
3012
+ # handle user calling this before or after TEA_SETUP_COMPILER
3013
+ if test x"${OBJEXT}" != x ; then
3014
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
3015
+ else
3016
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
3017
+ fi
3018
+ PKG_OBJECTS="$PKG_OBJECTS $j"
3019
+ ;;
3020
+ esac
3021
+ done
3022
+ AC_SUBST(PKG_SOURCES)
3023
+ AC_SUBST(PKG_OBJECTS)
3024
+ ])
3025
+
3026
+ #------------------------------------------------------------------------
3027
+ # TEA_ADD_STUB_SOURCES --
3028
+ #
3029
+ # Specify one or more source files. Users should check for
3030
+ # the right platform before adding to their list.
3031
+ # It is not important to specify the directory, as long as it is
3032
+ # in the generic, win or unix subdirectory of $(srcdir).
3033
+ #
3034
+ # Arguments:
3035
+ # one or more file names
3036
+ #
3037
+ # Results:
3038
+ #
3039
+ # Defines and substs the following vars:
3040
+ # PKG_STUB_SOURCES
3041
+ # PKG_STUB_OBJECTS
3042
+ #------------------------------------------------------------------------
3043
+ AC_DEFUN([TEA_ADD_STUB_SOURCES], [
3044
+ vars="$@"
3045
+ for i in $vars; do
3046
+ # check for existence - allows for generic/win/unix VPATH
3047
+ if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
3048
+ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
3049
+ ; then
3050
+ AC_MSG_ERROR([could not find stub source file '$i'])
3051
+ fi
3052
+ PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i"
3053
+ # this assumes it is in a VPATH dir
3054
+ i=`basename $i`
3055
+ # handle user calling this before or after TEA_SETUP_COMPILER
3056
+ if test x"${OBJEXT}" != x ; then
3057
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}"
3058
+ else
3059
+ j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}"
3060
+ fi
3061
+ PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j"
3062
+ done
3063
+ AC_SUBST(PKG_STUB_SOURCES)
3064
+ AC_SUBST(PKG_STUB_OBJECTS)
3065
+ ])
3066
+
3067
+ #------------------------------------------------------------------------
3068
+ # TEA_ADD_TCL_SOURCES --
3069
+ #
3070
+ # Specify one or more Tcl source files. These should be platform
3071
+ # independent runtime files.
3072
+ #
3073
+ # Arguments:
3074
+ # one or more file names
3075
+ #
3076
+ # Results:
3077
+ #
3078
+ # Defines and substs the following vars:
3079
+ # PKG_TCL_SOURCES
3080
+ #------------------------------------------------------------------------
3081
+ AC_DEFUN([TEA_ADD_TCL_SOURCES], [
3082
+ vars="$@"
3083
+ for i in $vars; do
3084
+ # check for existence, be strict because it is installed
3085
+ if test ! -f "${srcdir}/$i" ; then
3086
+ AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i'])
3087
+ fi
3088
+ PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i"
3089
+ done
3090
+ AC_SUBST(PKG_TCL_SOURCES)
3091
+ ])
3092
+
3093
+ #------------------------------------------------------------------------
3094
+ # TEA_ADD_HEADERS --
3095
+ #
3096
+ # Specify one or more source headers. Users should check for
3097
+ # the right platform before adding to their list.
3098
+ #
3099
+ # Arguments:
3100
+ # one or more file names
3101
+ #
3102
+ # Results:
3103
+ #
3104
+ # Defines and substs the following vars:
3105
+ # PKG_HEADERS
3106
+ #------------------------------------------------------------------------
3107
+ AC_DEFUN([TEA_ADD_HEADERS], [
3108
+ vars="$@"
3109
+ for i in $vars; do
3110
+ # check for existence, be strict because it is installed
3111
+ if test ! -f "${srcdir}/$i" ; then
3112
+ AC_MSG_ERROR([could not find header file '${srcdir}/$i'])
3113
+ fi
3114
+ PKG_HEADERS="$PKG_HEADERS $i"
3115
+ done
3116
+ AC_SUBST(PKG_HEADERS)
3117
+ ])
3118
+
3119
+ #------------------------------------------------------------------------
3120
+ # TEA_ADD_INCLUDES --
3121
+ #
3122
+ # Specify one or more include dirs. Users should check for
3123
+ # the right platform before adding to their list.
3124
+ #
3125
+ # Arguments:
3126
+ # one or more file names
3127
+ #
3128
+ # Results:
3129
+ #
3130
+ # Defines and substs the following vars:
3131
+ # PKG_INCLUDES
3132
+ #------------------------------------------------------------------------
3133
+ AC_DEFUN([TEA_ADD_INCLUDES], [
3134
+ vars="$@"
3135
+ for i in $vars; do
3136
+ PKG_INCLUDES="$PKG_INCLUDES $i"
3137
+ done
3138
+ AC_SUBST(PKG_INCLUDES)
3139
+ ])
3140
+
3141
+ #------------------------------------------------------------------------
3142
+ # TEA_ADD_LIBS --
3143
+ #
3144
+ # Specify one or more libraries. Users should check for
3145
+ # the right platform before adding to their list. For Windows,
3146
+ # libraries provided in "foo.lib" format will be converted to
3147
+ # "-lfoo" when using GCC (mingw).
3148
+ #
3149
+ # Arguments:
3150
+ # one or more file names
3151
+ #
3152
+ # Results:
3153
+ #
3154
+ # Defines and substs the following vars:
3155
+ # PKG_LIBS
3156
+ #------------------------------------------------------------------------
3157
+ AC_DEFUN([TEA_ADD_LIBS], [
3158
+ vars="$@"
3159
+ for i in $vars; do
3160
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
3161
+ # Convert foo.lib to -lfoo for GCC. No-op if not *.lib
3162
+ i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'`
3163
+ fi
3164
+ PKG_LIBS="$PKG_LIBS $i"
3165
+ done
3166
+ AC_SUBST(PKG_LIBS)
3167
+ ])
3168
+
3169
+ #------------------------------------------------------------------------
3170
+ # TEA_ADD_CFLAGS --
3171
+ #
3172
+ # Specify one or more CFLAGS. Users should check for
3173
+ # the right platform before adding to their list.
3174
+ #
3175
+ # Arguments:
3176
+ # one or more file names
3177
+ #
3178
+ # Results:
3179
+ #
3180
+ # Defines and substs the following vars:
3181
+ # PKG_CFLAGS
3182
+ #------------------------------------------------------------------------
3183
+ AC_DEFUN([TEA_ADD_CFLAGS], [
3184
+ PKG_CFLAGS="$PKG_CFLAGS $@"
3185
+ AC_SUBST(PKG_CFLAGS)
3186
+ ])
3187
+
3188
+ #------------------------------------------------------------------------
3189
+ # TEA_PREFIX --
3190
+ #
3191
+ # Handle the --prefix=... option by defaulting to what Tcl gave
3192
+ #
3193
+ # Arguments:
3194
+ # none
3195
+ #
3196
+ # Results:
3197
+ #
3198
+ # If --prefix or --exec-prefix was not specified, $prefix and
3199
+ # $exec_prefix will be set to the values given to Tcl when it was
3200
+ # configured.
3201
+ #------------------------------------------------------------------------
3202
+ AC_DEFUN([TEA_PREFIX], [
3203
+ if test "${prefix}" = "NONE"; then
3204
+ prefix_default=yes
3205
+ if test x"${TCL_PREFIX}" != x; then
3206
+ AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}])
3207
+ prefix=${TCL_PREFIX}
3208
+ else
3209
+ AC_MSG_NOTICE([--prefix defaulting to /usr/local])
3210
+ prefix=/usr/local
3211
+ fi
3212
+ fi
3213
+ if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \
3214
+ -o x"${exec_prefix_default}" = x"yes" ; then
3215
+ if test x"${TCL_EXEC_PREFIX}" != x; then
3216
+ AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}])
3217
+ exec_prefix=${TCL_EXEC_PREFIX}
3218
+ else
3219
+ AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}])
3220
+ exec_prefix=$prefix
3221
+ fi
3222
+ fi
3223
+ ])
3224
+
3225
+ #------------------------------------------------------------------------
3226
+ # TEA_SETUP_COMPILER_CC --
3227
+ #
3228
+ # Do compiler checks the way we want. This is just a replacement
3229
+ # for AC_PROG_CC in TEA configure.in files to make them cleaner.
3230
+ #
3231
+ # Arguments:
3232
+ # none
3233
+ #
3234
+ # Results:
3235
+ #
3236
+ # Sets up CC var and other standard bits we need to make executables.
3237
+ #------------------------------------------------------------------------
3238
+ AC_DEFUN([TEA_SETUP_COMPILER_CC], [
3239
+ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
3240
+ # in this macro, they need to go into TEA_SETUP_COMPILER instead.
3241
+
3242
+ # If the user did not set CFLAGS, set it now to keep
3243
+ # the AC_PROG_CC macro from adding "-g -O2".
3244
+ if test "${CFLAGS+set}" != "set" ; then
3245
+ CFLAGS=""
3246
+ fi
3247
+
3248
+ AC_PROG_CC
3249
+ AC_PROG_CPP
3250
+
3251
+ AC_PROG_INSTALL
3252
+
3253
+ #--------------------------------------------------------------------
3254
+ # Checks to see if the make program sets the $MAKE variable.
3255
+ #--------------------------------------------------------------------
3256
+
3257
+ AC_PROG_MAKE_SET
3258
+
3259
+ #--------------------------------------------------------------------
3260
+ # Find ranlib
3261
+ #--------------------------------------------------------------------
3262
+
3263
+ AC_PROG_RANLIB
3264
+
3265
+ #--------------------------------------------------------------------
3266
+ # Determines the correct binary file extension (.o, .obj, .exe etc.)
3267
+ #--------------------------------------------------------------------
3268
+
3269
+ AC_OBJEXT
3270
+ AC_EXEEXT
3271
+ ])
3272
+
3273
+ #------------------------------------------------------------------------
3274
+ # TEA_SETUP_COMPILER --
3275
+ #
3276
+ # Do compiler checks that use the compiler. This must go after
3277
+ # TEA_SETUP_COMPILER_CC, which does the actual compiler check.
3278
+ #
3279
+ # Arguments:
3280
+ # none
3281
+ #
3282
+ # Results:
3283
+ #
3284
+ # Sets up CC var and other standard bits we need to make executables.
3285
+ #------------------------------------------------------------------------
3286
+ AC_DEFUN([TEA_SETUP_COMPILER], [
3287
+ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
3288
+ AC_REQUIRE([TEA_SETUP_COMPILER_CC])
3289
+
3290
+ #------------------------------------------------------------------------
3291
+ # If we're using GCC, see if the compiler understands -pipe. If so, use it.
3292
+ # It makes compiling go faster. (This is only a performance feature.)
3293
+ #------------------------------------------------------------------------
3294
+
3295
+ if test -z "$no_pipe" -a -n "$GCC"; then
3296
+ AC_CACHE_CHECK([if the compiler understands -pipe],
3297
+ tcl_cv_cc_pipe, [
3298
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
3299
+ AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
3300
+ CFLAGS=$hold_cflags])
3301
+ if test $tcl_cv_cc_pipe = yes; then
3302
+ CFLAGS="$CFLAGS -pipe"
3303
+ fi
3304
+ fi
3305
+
3306
+ #--------------------------------------------------------------------
3307
+ # Common compiler flag setup
3308
+ #--------------------------------------------------------------------
3309
+
3310
+ AC_C_BIGENDIAN
3311
+ if test "${TEA_PLATFORM}" = "unix" ; then
3312
+ TEA_TCL_LINK_LIBS
3313
+ TEA_MISSING_POSIX_HEADERS
3314
+ # Let the user call this, because if it triggers, they will
3315
+ # need a compat/strtod.c that is correct. Users can also
3316
+ # use Tcl_GetDouble(FromObj) instead.
3317
+ #TEA_BUGGY_STRTOD
3318
+ fi
3319
+ ])
3320
+
3321
+ #------------------------------------------------------------------------
3322
+ # TEA_MAKE_LIB --
3323
+ #
3324
+ # Generate a line that can be used to build a shared/unshared library
3325
+ # in a platform independent manner.
3326
+ #
3327
+ # Arguments:
3328
+ # none
3329
+ #
3330
+ # Requires:
3331
+ #
3332
+ # Results:
3333
+ #
3334
+ # Defines the following vars:
3335
+ # CFLAGS - Done late here to note disturb other AC macros
3336
+ # MAKE_LIB - Command to execute to build the Tcl library;
3337
+ # differs depending on whether or not Tcl is being
3338
+ # compiled as a shared library.
3339
+ # MAKE_SHARED_LIB Makefile rule for building a shared library
3340
+ # MAKE_STATIC_LIB Makefile rule for building a static library
3341
+ # MAKE_STUB_LIB Makefile rule for building a stub library
3342
+ #------------------------------------------------------------------------
3343
+
3344
+ AC_DEFUN([TEA_MAKE_LIB], [
3345
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
3346
+ MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
3347
+ MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
3348
+ MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)"
3349
+ else
3350
+ MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)"
3351
+ MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}"
3352
+ MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)"
3353
+ fi
3354
+
3355
+ if test "${SHARED_BUILD}" = "1" ; then
3356
+ MAKE_LIB="${MAKE_SHARED_LIB} "
3357
+ else
3358
+ MAKE_LIB="${MAKE_STATIC_LIB} "
3359
+ fi
3360
+
3361
+ #--------------------------------------------------------------------
3362
+ # Shared libraries and static libraries have different names.
3363
+ # Use the double eval to make sure any variables in the suffix is
3364
+ # substituted. (@@@ Might not be necessary anymore)
3365
+ #--------------------------------------------------------------------
3366
+
3367
+ if test "${TEA_PLATFORM}" = "windows" ; then
3368
+ if test "${SHARED_BUILD}" = "1" ; then
3369
+ # We force the unresolved linking of symbols that are really in
3370
+ # the private libraries of Tcl and Tk.
3371
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\""
3372
+ if test x"${TK_BIN_DIR}" != x ; then
3373
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\""
3374
+ fi
3375
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3376
+ else
3377
+ eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3378
+ fi
3379
+ # Some packages build their own stubs libraries
3380
+ eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
3381
+ if test "$GCC" = "yes"; then
3382
+ PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
3383
+ fi
3384
+ # These aren't needed on Windows (either MSVC or gcc)
3385
+ RANLIB=:
3386
+ RANLIB_STUB=:
3387
+ else
3388
+ RANLIB_STUB="${RANLIB}"
3389
+ if test "${SHARED_BUILD}" = "1" ; then
3390
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}"
3391
+ if test x"${TK_BIN_DIR}" != x ; then
3392
+ SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}"
3393
+ fi
3394
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
3395
+ RANLIB=:
3396
+ else
3397
+ eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
3398
+ fi
3399
+ # Some packages build their own stubs libraries
3400
+ eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
3401
+ fi
3402
+
3403
+ # These are escaped so that only CFLAGS is picked up at configure time.
3404
+ # The other values will be substituted at make time.
3405
+ CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}"
3406
+ if test "${SHARED_BUILD}" = "1" ; then
3407
+ CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}"
3408
+ fi
3409
+
3410
+ AC_SUBST(MAKE_LIB)
3411
+ AC_SUBST(MAKE_SHARED_LIB)
3412
+ AC_SUBST(MAKE_STATIC_LIB)
3413
+ AC_SUBST(MAKE_STUB_LIB)
3414
+ AC_SUBST(RANLIB_STUB)
3415
+ ])
3416
+
3417
+ #------------------------------------------------------------------------
3418
+ # TEA_LIB_SPEC --
3419
+ #
3420
+ # Compute the name of an existing object library located in libdir
3421
+ # from the given base name and produce the appropriate linker flags.
3422
+ #
3423
+ # Arguments:
3424
+ # basename The base name of the library without version
3425
+ # numbers, extensions, or "lib" prefixes.
3426
+ # extra_dir Extra directory in which to search for the
3427
+ # library. This location is used first, then
3428
+ # $prefix/$exec-prefix, then some defaults.
3429
+ #
3430
+ # Requires:
3431
+ # TEA_INIT and TEA_PREFIX must be called first.
3432
+ #
3433
+ # Results:
3434
+ #
3435
+ # Defines the following vars:
3436
+ # ${basename}_LIB_NAME The computed library name.
3437
+ # ${basename}_LIB_SPEC The computed linker flags.
3438
+ #------------------------------------------------------------------------
3439
+
3440
+ AC_DEFUN([TEA_LIB_SPEC], [
3441
+ AC_MSG_CHECKING([for $1 library])
3442
+
3443
+ # Look in exec-prefix for the library (defined by TEA_PREFIX).
3444
+
3445
+ tea_lib_name_dir="${exec_prefix}/lib"
3446
+
3447
+ # Or in a user-specified location.
3448
+
3449
+ if test x"$2" != x ; then
3450
+ tea_extra_lib_dir=$2
3451
+ else
3452
+ tea_extra_lib_dir=NONE
3453
+ fi
3454
+
3455
+ for i in \
3456
+ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3457
+ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3458
+ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \
3459
+ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \
3460
+ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3461
+ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \
3462
+ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \
3463
+ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do
3464
+ if test -f "$i" ; then
3465
+ tea_lib_name_dir=`dirname $i`
3466
+ $1_LIB_NAME=`basename $i`
3467
+ $1_LIB_PATH_NAME=$i
3468
+ break
3469
+ fi
3470
+ done
3471
+
3472
+ if test "${TEA_PLATFORM}" = "windows"; then
3473
+ $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\"
3474
+ else
3475
+ # Strip off the leading "lib" and trailing ".a" or ".so"
3476
+
3477
+ tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'`
3478
+ $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}"
3479
+ fi
3480
+
3481
+ if test "x${$1_LIB_NAME}" = x ; then
3482
+ AC_MSG_ERROR([not found])
3483
+ else
3484
+ AC_MSG_RESULT([${$1_LIB_SPEC}])
3485
+ fi
3486
+ ])
3487
+
3488
+ #------------------------------------------------------------------------
3489
+ # TEA_PRIVATE_TCL_HEADERS --
3490
+ #
3491
+ # Locate the private Tcl include files
3492
+ #
3493
+ # Arguments:
3494
+ #
3495
+ # Requires:
3496
+ # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has
3497
+ # already been called.
3498
+ #
3499
+ # Results:
3500
+ #
3501
+ # Substs the following vars:
3502
+ # TCL_TOP_DIR_NATIVE
3503
+ # TCL_GENERIC_DIR_NATIVE
3504
+ # TCL_UNIX_DIR_NATIVE
3505
+ # TCL_WIN_DIR_NATIVE
3506
+ # TCL_BMAP_DIR_NATIVE
3507
+ # TCL_TOOL_DIR_NATIVE
3508
+ # TCL_PLATFORM_DIR_NATIVE
3509
+ # TCL_BIN_DIR_NATIVE
3510
+ # TCL_INCLUDES
3511
+ #------------------------------------------------------------------------
3512
+
3513
+ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
3514
+ AC_MSG_CHECKING([for Tcl private include files])
3515
+
3516
+ TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
3517
+ TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\"
3518
+ TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\"
3519
+ TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\"
3520
+ TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\"
3521
+ TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\"
3522
+ TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\"
3523
+ TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\"
3524
+
3525
+ if test "${TEA_PLATFORM}" = "windows"; then
3526
+ TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE}
3527
+ else
3528
+ TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE}
3529
+ fi
3530
+ # We want to ensure these are substituted so as not to require
3531
+ # any *_NATIVE vars be defined in the Makefile
3532
+ TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
3533
+ if test "`uname -s`" = "Darwin"; then
3534
+ # If Tcl was built as a framework, attempt to use
3535
+ # the framework's Headers and PrivateHeaders directories
3536
+ case ${TCL_DEFS} in
3537
+ *TCL_FRAMEWORK*)
3538
+ if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then
3539
+ TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else
3540
+ TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi
3541
+ ;;
3542
+ esac
3543
+ else
3544
+ if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then
3545
+ AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}])
3546
+ fi
3547
+ fi
3548
+
3549
+
3550
+ AC_SUBST(TCL_TOP_DIR_NATIVE)
3551
+ AC_SUBST(TCL_GENERIC_DIR_NATIVE)
3552
+ AC_SUBST(TCL_UNIX_DIR_NATIVE)
3553
+ AC_SUBST(TCL_WIN_DIR_NATIVE)
3554
+ AC_SUBST(TCL_BMAP_DIR_NATIVE)
3555
+ AC_SUBST(TCL_TOOL_DIR_NATIVE)
3556
+ AC_SUBST(TCL_PLATFORM_DIR_NATIVE)
3557
+
3558
+ AC_SUBST(TCL_INCLUDES)
3559
+ AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}])
3560
+ ])
3561
+
3562
+ #------------------------------------------------------------------------
3563
+ # TEA_PUBLIC_TCL_HEADERS --
3564
+ #
3565
+ # Locate the installed public Tcl header files
3566
+ #
3567
+ # Arguments:
3568
+ # None.
3569
+ #
3570
+ # Requires:
3571
+ # CYGPATH must be set
3572
+ #
3573
+ # Results:
3574
+ #
3575
+ # Adds a --with-tclinclude switch to configure.
3576
+ # Result is cached.
3577
+ #
3578
+ # Substs the following vars:
3579
+ # TCL_INCLUDES
3580
+ #------------------------------------------------------------------------
3581
+
3582
+ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
3583
+ AC_MSG_CHECKING([for Tcl public headers])
3584
+
3585
+ AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval})
3586
+
3587
+ AC_CACHE_VAL(ac_cv_c_tclh, [
3588
+ # Use the value from --with-tclinclude, if it was given
3589
+
3590
+ if test x"${with_tclinclude}" != x ; then
3591
+ if test -f "${with_tclinclude}/tcl.h" ; then
3592
+ ac_cv_c_tclh=${with_tclinclude}
3593
+ else
3594
+ AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h])
3595
+ fi
3596
+ else
3597
+ if test "`uname -s`" = "Darwin"; then
3598
+ # If Tcl was built as a framework, attempt to use
3599
+ # the framework's Headers directory
3600
+ case ${TCL_DEFS} in
3601
+ *TCL_FRAMEWORK*)
3602
+ list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`"
3603
+ ;;
3604
+ esac
3605
+ fi
3606
+
3607
+ # Look in the source dir only if Tcl is not installed,
3608
+ # and in that situation, look there before installed locations.
3609
+ if test -f "${TCL_BIN_DIR}/Makefile" ; then
3610
+ list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`"
3611
+ fi
3612
+
3613
+ # Check order: pkg --prefix location, Tcl's --prefix location,
3614
+ # relative to directory of tclConfig.sh.
3615
+
3616
+ eval "temp_includedir=${includedir}"
3617
+ list="$list \
3618
+ `ls -d ${temp_includedir} 2>/dev/null` \
3619
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3620
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
3621
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3622
+ list="$list /usr/local/include /usr/include"
3623
+ if test x"${TCL_INCLUDE_SPEC}" != x ; then
3624
+ d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'`
3625
+ list="$list `ls -d ${d} 2>/dev/null`"
3626
+ fi
3627
+ fi
3628
+ for i in $list ; do
3629
+ if test -f "$i/tcl.h" ; then
3630
+ ac_cv_c_tclh=$i
3631
+ break
3632
+ fi
3633
+ done
3634
+ fi
3635
+ ])
3636
+
3637
+ # Print a message based on how we determined the include path
3638
+
3639
+ if test x"${ac_cv_c_tclh}" = x ; then
3640
+ AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude])
3641
+ else
3642
+ AC_MSG_RESULT([${ac_cv_c_tclh}])
3643
+ fi
3644
+
3645
+ # Convert to a native path and substitute into the output files.
3646
+
3647
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}`
3648
+
3649
+ TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3650
+
3651
+ AC_SUBST(TCL_INCLUDES)
3652
+ ])
3653
+
3654
+ #------------------------------------------------------------------------
3655
+ # TEA_PRIVATE_TK_HEADERS --
3656
+ #
3657
+ # Locate the private Tk include files
3658
+ #
3659
+ # Arguments:
3660
+ #
3661
+ # Requires:
3662
+ # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has
3663
+ # already been called.
3664
+ #
3665
+ # Results:
3666
+ #
3667
+ # Substs the following vars:
3668
+ # TK_INCLUDES
3669
+ #------------------------------------------------------------------------
3670
+
3671
+ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
3672
+ AC_MSG_CHECKING([for Tk private include files])
3673
+
3674
+ TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
3675
+ TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\"
3676
+ TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\"
3677
+ TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\"
3678
+ TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\"
3679
+ TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\"
3680
+ if test "${TEA_PLATFORM}" = "windows"; then
3681
+ TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE}
3682
+ else
3683
+ TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE}
3684
+ fi
3685
+ # We want to ensure these are substituted so as not to require
3686
+ # any *_NATIVE vars be defined in the Makefile
3687
+ TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}"
3688
+ # Detect and add ttk subdir
3689
+ if test -d ${TK_SRC_DIR_NATIVE}/generic/ttk; then
3690
+ TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\""
3691
+ fi
3692
+ if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
3693
+ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
3694
+ TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}"
3695
+ fi
3696
+ if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
3697
+ TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx"
3698
+ fi
3699
+ if test "`uname -s`" = "Darwin"; then
3700
+ # If Tk was built as a framework, attempt to use
3701
+ # the framework's Headers and PrivateHeaders directories
3702
+ case ${TK_DEFS} in
3703
+ *TK_FRAMEWORK*)
3704
+ if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then
3705
+ TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi
3706
+ ;;
3707
+ esac
3708
+ else
3709
+ if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then
3710
+ AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}])
3711
+ fi
3712
+ fi
3713
+
3714
+ AC_SUBST(TK_TOP_DIR_NATIVE)
3715
+ AC_SUBST(TK_UNIX_DIR_NATIVE)
3716
+ AC_SUBST(TK_WIN_DIR_NATIVE)
3717
+ AC_SUBST(TK_GENERIC_DIR_NATIVE)
3718
+ AC_SUBST(TK_XLIB_DIR_NATIVE)
3719
+ AC_SUBST(TK_PLATFORM_DIR_NATIVE)
3720
+
3721
+ AC_SUBST(TK_INCLUDES)
3722
+ AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}])
3723
+ ])
3724
+
3725
+ #------------------------------------------------------------------------
3726
+ # TEA_PUBLIC_TK_HEADERS --
3727
+ #
3728
+ # Locate the installed public Tk header files
3729
+ #
3730
+ # Arguments:
3731
+ # None.
3732
+ #
3733
+ # Requires:
3734
+ # CYGPATH must be set
3735
+ #
3736
+ # Results:
3737
+ #
3738
+ # Adds a --with-tkinclude switch to configure.
3739
+ # Result is cached.
3740
+ #
3741
+ # Substs the following vars:
3742
+ # TK_INCLUDES
3743
+ #------------------------------------------------------------------------
3744
+
3745
+ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
3746
+ AC_MSG_CHECKING([for Tk public headers])
3747
+
3748
+ AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval})
3749
+
3750
+ AC_CACHE_VAL(ac_cv_c_tkh, [
3751
+ # Use the value from --with-tkinclude, if it was given
3752
+
3753
+ if test x"${with_tkinclude}" != x ; then
3754
+ if test -f "${with_tkinclude}/tk.h" ; then
3755
+ ac_cv_c_tkh=${with_tkinclude}
3756
+ else
3757
+ AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h])
3758
+ fi
3759
+ else
3760
+ if test "`uname -s`" = "Darwin"; then
3761
+ # If Tk was built as a framework, attempt to use
3762
+ # the framework's Headers directory.
3763
+ case ${TK_DEFS} in
3764
+ *TK_FRAMEWORK*)
3765
+ list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`"
3766
+ ;;
3767
+ esac
3768
+ fi
3769
+
3770
+ # Look in the source dir only if Tk is not installed,
3771
+ # and in that situation, look there before installed locations.
3772
+ if test -f "${TK_BIN_DIR}/Makefile" ; then
3773
+ list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`"
3774
+ fi
3775
+
3776
+ # Check order: pkg --prefix location, Tk's --prefix location,
3777
+ # relative to directory of tkConfig.sh, Tcl's --prefix location,
3778
+ # relative to directory of tclConfig.sh.
3779
+
3780
+ eval "temp_includedir=${includedir}"
3781
+ list="$list \
3782
+ `ls -d ${temp_includedir} 2>/dev/null` \
3783
+ `ls -d ${TK_PREFIX}/include 2>/dev/null` \
3784
+ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \
3785
+ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \
3786
+ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`"
3787
+ if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then
3788
+ list="$list /usr/local/include /usr/include"
3789
+ fi
3790
+ for i in $list ; do
3791
+ if test -f "$i/tk.h" ; then
3792
+ ac_cv_c_tkh=$i
3793
+ break
3794
+ fi
3795
+ done
3796
+ fi
3797
+ ])
3798
+
3799
+ # Print a message based on how we determined the include path
3800
+
3801
+ if test x"${ac_cv_c_tkh}" = x ; then
3802
+ AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude])
3803
+ else
3804
+ AC_MSG_RESULT([${ac_cv_c_tkh}])
3805
+ fi
3806
+
3807
+ # Convert to a native path and substitute into the output files.
3808
+
3809
+ INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}`
3810
+
3811
+ TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3812
+
3813
+ AC_SUBST(TK_INCLUDES)
3814
+
3815
+ if test "${TEA_WINDOWINGSYSTEM}" = "win32" \
3816
+ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then
3817
+ # On Windows and Aqua, we need the X compat headers
3818
+ AC_MSG_CHECKING([for X11 header files])
3819
+ if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then
3820
+ INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`"
3821
+ TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\"
3822
+ AC_SUBST(TK_XINCLUDES)
3823
+ fi
3824
+ AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}])
3825
+ fi
3826
+ ])
3827
+
3828
+ #------------------------------------------------------------------------
3829
+ # TEA_PATH_CONFIG --
3830
+ #
3831
+ # Locate the ${1}Config.sh file and perform a sanity check on
3832
+ # the ${1} compile flags. These are used by packages like
3833
+ # [incr Tk] that load *Config.sh files from more than Tcl and Tk.
3834
+ #
3835
+ # Arguments:
3836
+ # none
3837
+ #
3838
+ # Results:
3839
+ #
3840
+ # Adds the following arguments to configure:
3841
+ # --with-$1=...
3842
+ #
3843
+ # Defines the following vars:
3844
+ # $1_BIN_DIR Full path to the directory containing
3845
+ # the $1Config.sh file
3846
+ #------------------------------------------------------------------------
3847
+
3848
+ AC_DEFUN([TEA_PATH_CONFIG], [
3849
+ #
3850
+ # Ok, lets find the $1 configuration
3851
+ # First, look for one uninstalled.
3852
+ # the alternative search directory is invoked by --with-$1
3853
+ #
3854
+
3855
+ if test x"${no_$1}" = x ; then
3856
+ # we reset no_$1 in case something fails here
3857
+ no_$1=true
3858
+ AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval})
3859
+ AC_MSG_CHECKING([for $1 configuration])
3860
+ AC_CACHE_VAL(ac_cv_c_$1config,[
3861
+
3862
+ # First check to see if --with-$1 was specified.
3863
+ if test x"${with_$1config}" != x ; then
3864
+ case ${with_$1config} in
3865
+ */$1Config.sh )
3866
+ if test -f ${with_$1config}; then
3867
+ AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself])
3868
+ with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'`
3869
+ fi;;
3870
+ esac
3871
+ if test -f "${with_$1config}/$1Config.sh" ; then
3872
+ ac_cv_c_$1config=`(cd ${with_$1config}; pwd)`
3873
+ else
3874
+ AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh])
3875
+ fi
3876
+ fi
3877
+
3878
+ # then check for a private $1 installation
3879
+ if test x"${ac_cv_c_$1config}" = x ; then
3880
+ for i in \
3881
+ ../$1 \
3882
+ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3883
+ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3884
+ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3885
+ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3886
+ ../../$1 \
3887
+ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3888
+ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3889
+ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3890
+ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3891
+ ../../../$1 \
3892
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3893
+ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3894
+ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3895
+ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3896
+ ${srcdir}/../$1 \
3897
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \
3898
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \
3899
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \
3900
+ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \
3901
+ ; do
3902
+ if test -f "$i/$1Config.sh" ; then
3903
+ ac_cv_c_$1config=`(cd $i; pwd)`
3904
+ break
3905
+ fi
3906
+ if test -f "$i/unix/$1Config.sh" ; then
3907
+ ac_cv_c_$1config=`(cd $i/unix; pwd)`
3908
+ break
3909
+ fi
3910
+ done
3911
+ fi
3912
+
3913
+ # check in a few common install locations
3914
+ if test x"${ac_cv_c_$1config}" = x ; then
3915
+ for i in `ls -d ${libdir} 2>/dev/null` \
3916
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
3917
+ `ls -d ${prefix}/lib 2>/dev/null` \
3918
+ `ls -d /usr/local/lib 2>/dev/null` \
3919
+ `ls -d /usr/contrib/lib 2>/dev/null` \
3920
+ `ls -d /usr/lib 2>/dev/null` \
3921
+ ; do
3922
+ if test -f "$i/$1Config.sh" ; then
3923
+ ac_cv_c_$1config=`(cd $i; pwd)`
3924
+ break
3925
+ fi
3926
+ done
3927
+ fi
3928
+ ])
3929
+
3930
+ if test x"${ac_cv_c_$1config}" = x ; then
3931
+ $1_BIN_DIR="# no $1 configs found"
3932
+ AC_MSG_WARN([Cannot find $1 configuration definitions])
3933
+ exit 0
3934
+ else
3935
+ no_$1=
3936
+ $1_BIN_DIR=${ac_cv_c_$1config}
3937
+ AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh])
3938
+ fi
3939
+ fi
3940
+ ])
3941
+
3942
+ #------------------------------------------------------------------------
3943
+ # TEA_LOAD_CONFIG --
3944
+ #
3945
+ # Load the $1Config.sh file
3946
+ #
3947
+ # Arguments:
3948
+ #
3949
+ # Requires the following vars to be set:
3950
+ # $1_BIN_DIR
3951
+ #
3952
+ # Results:
3953
+ #
3954
+ # Subst the following vars:
3955
+ # $1_SRC_DIR
3956
+ # $1_LIB_FILE
3957
+ # $1_LIB_SPEC
3958
+ #
3959
+ #------------------------------------------------------------------------
3960
+
3961
+ AC_DEFUN([TEA_LOAD_CONFIG], [
3962
+ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
3963
+
3964
+ if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
3965
+ AC_MSG_RESULT([loading])
3966
+ . "${$1_BIN_DIR}/$1Config.sh"
3967
+ else
3968
+ AC_MSG_RESULT([file not found])
3969
+ fi
3970
+
3971
+ #
3972
+ # If the $1_BIN_DIR is the build directory (not the install directory),
3973
+ # then set the common variable name to the value of the build variables.
3974
+ # For example, the variable $1_LIB_SPEC will be set to the value
3975
+ # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC
3976
+ # instead of $1_BUILD_LIB_SPEC since it will work with both an
3977
+ # installed and uninstalled version of Tcl.
3978
+ #
3979
+
3980
+ if test -f "${$1_BIN_DIR}/Makefile" ; then
3981
+ AC_MSG_WARN([Found Makefile - using build library specs for $1])
3982
+ $1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
3983
+ $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
3984
+ $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
3985
+ fi
3986
+
3987
+ AC_SUBST($1_VERSION)
3988
+ AC_SUBST($1_BIN_DIR)
3989
+ AC_SUBST($1_SRC_DIR)
3990
+
3991
+ AC_SUBST($1_LIB_FILE)
3992
+ AC_SUBST($1_LIB_SPEC)
3993
+
3994
+ AC_SUBST($1_STUB_LIB_FILE)
3995
+ AC_SUBST($1_STUB_LIB_SPEC)
3996
+ AC_SUBST($1_STUB_LIB_PATH)
3997
+ ])
3998
+
3999
+ #------------------------------------------------------------------------
4000
+ # TEA_PATH_CELIB --
4001
+ #
4002
+ # Locate Keuchel's celib emulation layer for targeting Win/CE
4003
+ #
4004
+ # Arguments:
4005
+ # none
4006
+ #
4007
+ # Results:
4008
+ #
4009
+ # Adds the following arguments to configure:
4010
+ # --with-celib=...
4011
+ #
4012
+ # Defines the following vars:
4013
+ # CELIB_DIR Full path to the directory containing
4014
+ # the include and platform lib files
4015
+ #------------------------------------------------------------------------
4016
+
4017
+ AC_DEFUN([TEA_PATH_CELIB], [
4018
+ # First, look for one uninstalled.
4019
+ # the alternative search directory is invoked by --with-celib
4020
+
4021
+ if test x"${no_celib}" = x ; then
4022
+ # we reset no_celib in case something fails here
4023
+ no_celib=true
4024
+ AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval})
4025
+ AC_MSG_CHECKING([for Windows/CE celib directory])
4026
+ AC_CACHE_VAL(ac_cv_c_celibconfig,[
4027
+ # First check to see if --with-celibconfig was specified.
4028
+ if test x"${with_celibconfig}" != x ; then
4029
+ if test -d "${with_celibconfig}/inc" ; then
4030
+ ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)`
4031
+ else
4032
+ AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory])
4033
+ fi
4034
+ fi
4035
+
4036
+ # then check for a celib library
4037
+ if test x"${ac_cv_c_celibconfig}" = x ; then
4038
+ for i in \
4039
+ ../celib-palm-3.0 \
4040
+ ../celib \
4041
+ ../../celib-palm-3.0 \
4042
+ ../../celib \
4043
+ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \
4044
+ ${srcdir}/../celib-palm-3.0 \
4045
+ ${srcdir}/../celib \
4046
+ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \
4047
+ ; do
4048
+ if test -d "$i/inc" ; then
4049
+ ac_cv_c_celibconfig=`(cd $i; pwd)`
4050
+ break
4051
+ fi
4052
+ done
4053
+ fi
4054
+ ])
4055
+ if test x"${ac_cv_c_celibconfig}" = x ; then
4056
+ AC_MSG_ERROR([Cannot find celib support library directory])
4057
+ else
4058
+ no_celib=
4059
+ CELIB_DIR=${ac_cv_c_celibconfig}
4060
+ CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'`
4061
+ AC_MSG_RESULT([found $CELIB_DIR])
4062
+ fi
4063
+ fi
4064
+ ])
4065
+
4066
+
4067
+ # Local Variables:
4068
+ # mode: autoconf
4069
+ # End: