curses 1.2.7 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +19 -0
  3. data/.github/workflows/ubuntu.yml +26 -0
  4. data/.github/workflows/windows.yml +25 -0
  5. data/.gitmodules +1 -1
  6. data/History.md +41 -0
  7. data/README.md +14 -46
  8. data/Rakefile +0 -83
  9. data/curses.gemspec +2 -3
  10. data/ext/curses/curses.c +1314 -176
  11. data/ext/curses/extconf.rb +140 -17
  12. data/lib/curses.rb +5 -12
  13. data/sample/form.rb +52 -0
  14. data/sample/menu.rb +1 -1
  15. data/vendor/PDCurses/.gitignore +47 -0
  16. data/vendor/PDCurses/.travis.yml +49 -0
  17. data/vendor/PDCurses/CMakeLists.txt +68 -0
  18. data/vendor/PDCurses/HISTORY.md +2036 -0
  19. data/vendor/PDCurses/IMPLEMNT.md +327 -0
  20. data/vendor/PDCurses/README.md +77 -0
  21. data/vendor/PDCurses/acs_defs.h +265 -0
  22. data/vendor/PDCurses/appveyor.yml +218 -0
  23. data/vendor/PDCurses/cmake/README.md +71 -0
  24. data/vendor/PDCurses/cmake/build_dependencies.cmake +178 -0
  25. data/vendor/PDCurses/cmake/build_options.cmake +25 -0
  26. data/vendor/PDCurses/cmake/dll_version.cmake +26 -0
  27. data/vendor/PDCurses/cmake/gen_config_header.cmake +43 -0
  28. data/vendor/PDCurses/cmake/get_version.cmake +17 -0
  29. data/vendor/PDCurses/cmake/make_uninstall.cmake +19 -0
  30. data/vendor/PDCurses/cmake/project_common.cmake +121 -0
  31. data/vendor/PDCurses/cmake/resource.in.cmake +52 -0
  32. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +83 -0
  33. data/vendor/PDCurses/cmake/target_arch.cmake +36 -0
  34. data/vendor/PDCurses/cmake/version.in.cmake +73 -0
  35. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +96 -0
  36. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +106 -0
  37. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +105 -0
  38. data/vendor/PDCurses/curses.h +1846 -0
  39. data/vendor/PDCurses/curspriv.h +134 -0
  40. data/vendor/PDCurses/demos/README.md +25 -0
  41. data/vendor/PDCurses/demos/firework.c +144 -0
  42. data/vendor/PDCurses/demos/newtest.c +581 -0
  43. data/vendor/PDCurses/demos/ozdemo.c +447 -0
  44. data/vendor/PDCurses/demos/ptest.c +283 -0
  45. data/vendor/PDCurses/demos/rain.c +157 -0
  46. data/vendor/PDCurses/demos/testcurs.c +1607 -0
  47. data/vendor/PDCurses/demos/tui.c +1048 -0
  48. data/vendor/PDCurses/demos/tui.h +65 -0
  49. data/vendor/PDCurses/demos/tuidemo.c +233 -0
  50. data/vendor/PDCurses/demos/version.c +61 -0
  51. data/vendor/PDCurses/demos/worm.c +432 -0
  52. data/vendor/PDCurses/demos/xmas.c +955 -0
  53. data/vendor/PDCurses/dos/CMakeLists.txt +47 -0
  54. data/vendor/PDCurses/dos/Makefile.bcc +83 -0
  55. data/vendor/PDCurses/dos/Makefile.dmc +257 -0
  56. data/vendor/PDCurses/dos/Makefile.msc +113 -0
  57. data/vendor/PDCurses/dos/Makefile.wcc +107 -0
  58. data/vendor/PDCurses/dos/README.md +51 -0
  59. data/vendor/PDCurses/dos/bccdos.lrf +9 -0
  60. data/vendor/PDCurses/dos/mscdos.lrf +50 -0
  61. data/vendor/PDCurses/dos/pdcclip.c +132 -0
  62. data/vendor/PDCurses/dos/pdcdisp.c +135 -0
  63. data/vendor/PDCurses/dos/pdcdos.h +194 -0
  64. data/vendor/PDCurses/dos/pdcgetsc.c +98 -0
  65. data/vendor/PDCurses/dos/pdckbd.c +513 -0
  66. data/vendor/PDCurses/dos/pdcscrn.c +785 -0
  67. data/vendor/PDCurses/dos/pdcsetsc.c +101 -0
  68. data/vendor/PDCurses/dos/pdcutil.c +212 -0
  69. data/vendor/PDCurses/libobjs.mif +26 -0
  70. data/vendor/PDCurses/makedist.mif +20 -0
  71. data/vendor/PDCurses/man/README.md +21 -0
  72. data/vendor/PDCurses/man/intro.md +361 -0
  73. data/vendor/PDCurses/man/manext.c +119 -0
  74. data/vendor/PDCurses/man/sdl.md +152 -0
  75. data/vendor/PDCurses/man/sdl2.md +58 -0
  76. data/vendor/PDCurses/man/x11.md +407 -0
  77. data/vendor/PDCurses/ncurses/CMakeLists.txt +66 -0
  78. data/vendor/PDCurses/ncurses/README.md +26 -0
  79. data/vendor/PDCurses/ncurses/makefile +29 -0
  80. data/vendor/PDCurses/os2/CMakeLists.txt +41 -0
  81. data/vendor/PDCurses/os2/Makefile.bcc +90 -0
  82. data/vendor/PDCurses/os2/Makefile.wcc +43 -0
  83. data/vendor/PDCurses/os2/README.md +43 -0
  84. data/vendor/PDCurses/os2/iccos2.lrf +50 -0
  85. data/vendor/PDCurses/os2/iccos2.mak +256 -0
  86. data/vendor/PDCurses/os2/pdcclip.c +188 -0
  87. data/vendor/PDCurses/os2/pdcdisp.c +93 -0
  88. data/vendor/PDCurses/os2/pdcgetsc.c +89 -0
  89. data/vendor/PDCurses/os2/pdckbd.c +521 -0
  90. data/vendor/PDCurses/os2/pdcos2.h +55 -0
  91. data/vendor/PDCurses/os2/pdcscrn.c +449 -0
  92. data/vendor/PDCurses/os2/pdcsetsc.c +112 -0
  93. data/vendor/PDCurses/os2/pdcutil.c +52 -0
  94. data/vendor/PDCurses/panel.h +56 -0
  95. data/vendor/PDCurses/pdcurses/README.md +25 -0
  96. data/vendor/PDCurses/pdcurses/addch.c +693 -0
  97. data/vendor/PDCurses/pdcurses/addchstr.c +245 -0
  98. data/vendor/PDCurses/pdcurses/addstr.c +240 -0
  99. data/vendor/PDCurses/pdcurses/attr.c +359 -0
  100. data/vendor/PDCurses/pdcurses/beep.c +68 -0
  101. data/vendor/PDCurses/pdcurses/bkgd.c +223 -0
  102. data/vendor/PDCurses/pdcurses/border.c +411 -0
  103. data/vendor/PDCurses/pdcurses/clear.c +159 -0
  104. data/vendor/PDCurses/pdcurses/color.c +298 -0
  105. data/vendor/PDCurses/pdcurses/debug.c +109 -0
  106. data/vendor/PDCurses/pdcurses/delch.c +96 -0
  107. data/vendor/PDCurses/pdcurses/deleteln.c +211 -0
  108. data/vendor/PDCurses/pdcurses/deprec.c +27 -0
  109. data/vendor/PDCurses/pdcurses/getch.c +417 -0
  110. data/vendor/PDCurses/pdcurses/getstr.c +474 -0
  111. data/vendor/PDCurses/pdcurses/getyx.c +139 -0
  112. data/vendor/PDCurses/pdcurses/inch.c +127 -0
  113. data/vendor/PDCurses/pdcurses/inchstr.c +214 -0
  114. data/vendor/PDCurses/pdcurses/initscr.c +367 -0
  115. data/vendor/PDCurses/pdcurses/inopts.c +324 -0
  116. data/vendor/PDCurses/pdcurses/insch.c +271 -0
  117. data/vendor/PDCurses/pdcurses/insstr.c +264 -0
  118. data/vendor/PDCurses/pdcurses/instr.c +246 -0
  119. data/vendor/PDCurses/pdcurses/kernel.c +259 -0
  120. data/vendor/PDCurses/pdcurses/keyname.c +157 -0
  121. data/vendor/PDCurses/pdcurses/mouse.c +438 -0
  122. data/vendor/PDCurses/pdcurses/move.c +57 -0
  123. data/vendor/PDCurses/pdcurses/outopts.c +159 -0
  124. data/vendor/PDCurses/pdcurses/overlay.c +214 -0
  125. data/vendor/PDCurses/pdcurses/pad.c +260 -0
  126. data/vendor/PDCurses/pdcurses/panel.c +633 -0
  127. data/vendor/PDCurses/pdcurses/printw.c +126 -0
  128. data/vendor/PDCurses/pdcurses/refresh.c +279 -0
  129. data/vendor/PDCurses/pdcurses/scanw.c +578 -0
  130. data/vendor/PDCurses/pdcurses/scr_dump.c +213 -0
  131. data/vendor/PDCurses/pdcurses/scroll.c +101 -0
  132. data/vendor/PDCurses/pdcurses/slk.c +591 -0
  133. data/vendor/PDCurses/pdcurses/termattr.c +182 -0
  134. data/vendor/PDCurses/pdcurses/terminfo.c +217 -0
  135. data/vendor/PDCurses/pdcurses/touch.c +163 -0
  136. data/vendor/PDCurses/pdcurses/util.c +312 -0
  137. data/vendor/PDCurses/pdcurses/window.c +569 -0
  138. data/vendor/PDCurses/sdl1/Makefile.mng +110 -0
  139. data/vendor/PDCurses/sdl1/README.md +31 -0
  140. data/vendor/PDCurses/sdl1/deffont.h +385 -0
  141. data/vendor/PDCurses/sdl1/deficon.h +23 -0
  142. data/vendor/PDCurses/sdl1/pdcclip.c +131 -0
  143. data/vendor/PDCurses/sdl1/pdcdisp.c +373 -0
  144. data/vendor/PDCurses/sdl1/pdcgetsc.c +30 -0
  145. data/vendor/PDCurses/sdl1/pdckbd.c +405 -0
  146. data/vendor/PDCurses/sdl1/pdcscrn.c +414 -0
  147. data/vendor/PDCurses/sdl1/pdcsdl.h +31 -0
  148. data/vendor/PDCurses/sdl1/pdcsetsc.c +64 -0
  149. data/vendor/PDCurses/sdl1/pdcutil.c +40 -0
  150. data/vendor/PDCurses/sdl1/sdltest.c +79 -0
  151. data/vendor/PDCurses/sdl2/CMakeLists.txt +76 -0
  152. data/vendor/PDCurses/sdl2/Makefile.vc +164 -0
  153. data/vendor/PDCurses/sdl2/README.md +34 -0
  154. data/vendor/PDCurses/sdl2/deffont.h +385 -0
  155. data/vendor/PDCurses/sdl2/deficon.h +23 -0
  156. data/vendor/PDCurses/sdl2/pdcclip.c +93 -0
  157. data/vendor/PDCurses/sdl2/pdcdisp.c +534 -0
  158. data/vendor/PDCurses/sdl2/pdcgetsc.c +30 -0
  159. data/vendor/PDCurses/sdl2/pdckbd.c +480 -0
  160. data/vendor/PDCurses/sdl2/pdcscrn.c +443 -0
  161. data/vendor/PDCurses/sdl2/pdcsdl.h +33 -0
  162. data/vendor/PDCurses/sdl2/pdcsetsc.c +67 -0
  163. data/vendor/PDCurses/sdl2/pdcutil.c +39 -0
  164. data/vendor/PDCurses/sdl2/sdltest.c +81 -0
  165. data/vendor/PDCurses/term.h +48 -0
  166. data/vendor/PDCurses/version.mif +7 -0
  167. data/vendor/PDCurses/vt/CMakeLists.txt +28 -0
  168. data/vendor/PDCurses/vt/Makefile.bcc +111 -0
  169. data/vendor/PDCurses/vt/Makefile.dmc +258 -0
  170. data/vendor/PDCurses/vt/Makefile.vc +144 -0
  171. data/vendor/PDCurses/vt/Makefile.wcc +107 -0
  172. data/vendor/PDCurses/vt/README.md +64 -0
  173. data/vendor/PDCurses/vt/pdcclip.c +20 -0
  174. data/vendor/PDCurses/vt/pdcdisp.c +284 -0
  175. data/vendor/PDCurses/vt/pdcgetsc.c +27 -0
  176. data/vendor/PDCurses/vt/pdckbd.c +394 -0
  177. data/vendor/PDCurses/vt/pdcscrn.c +434 -0
  178. data/vendor/PDCurses/vt/pdcsetsc.c +45 -0
  179. data/vendor/PDCurses/vt/pdcutil.c +43 -0
  180. data/vendor/PDCurses/vt/pdcvt.h +16 -0
  181. data/vendor/PDCurses/watcom.mif +68 -0
  182. data/vendor/PDCurses/wincon/CMakeLists.txt +27 -0
  183. data/vendor/PDCurses/wincon/Makefile.bcc +88 -0
  184. data/vendor/PDCurses/wincon/Makefile.dmc +256 -0
  185. data/vendor/PDCurses/wincon/Makefile.lcc +273 -0
  186. data/vendor/PDCurses/wincon/Makefile.mng +176 -0
  187. data/vendor/PDCurses/wincon/Makefile.vc +144 -0
  188. data/vendor/PDCurses/wincon/Makefile.wcc +51 -0
  189. data/vendor/PDCurses/wincon/README.md +85 -0
  190. data/vendor/PDCurses/wincon/pdcclip.c +174 -0
  191. data/vendor/PDCurses/wincon/pdcdisp.c +143 -0
  192. data/vendor/PDCurses/wincon/pdcgetsc.c +55 -0
  193. data/vendor/PDCurses/wincon/pdckbd.c +786 -0
  194. data/vendor/PDCurses/wincon/pdcscrn.c +717 -0
  195. data/vendor/PDCurses/wincon/pdcsetsc.c +91 -0
  196. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  197. data/vendor/PDCurses/wincon/pdcurses.rc +28 -0
  198. data/vendor/PDCurses/wincon/pdcutil.c +41 -0
  199. data/vendor/PDCurses/wincon/pdcwin.h +31 -0
  200. data/vendor/PDCurses/wingui/CMakeLists.txt +27 -0
  201. data/vendor/PDCurses/wingui/Makefile.bcc +85 -0
  202. data/vendor/PDCurses/wingui/Makefile.dmc +259 -0
  203. data/vendor/PDCurses/wingui/Makefile.lcc +273 -0
  204. data/vendor/PDCurses/wingui/Makefile.mng +171 -0
  205. data/vendor/PDCurses/wingui/Makefile.vc +144 -0
  206. data/vendor/PDCurses/wingui/Makefile.wcc +51 -0
  207. data/vendor/PDCurses/wingui/README.md +93 -0
  208. data/vendor/PDCurses/wingui/pdcclip.c +174 -0
  209. data/vendor/PDCurses/wingui/pdcdisp.c +718 -0
  210. data/vendor/PDCurses/wingui/pdcgetsc.c +30 -0
  211. data/vendor/PDCurses/wingui/pdckbd.c +143 -0
  212. data/vendor/PDCurses/wingui/pdcscrn.c +2797 -0
  213. data/vendor/PDCurses/wingui/pdcsetsc.c +89 -0
  214. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  215. data/vendor/PDCurses/wingui/pdcurses.rc +28 -0
  216. data/vendor/PDCurses/wingui/pdcutil.c +61 -0
  217. data/vendor/PDCurses/wingui/pdcwin.h +122 -0
  218. data/vendor/PDCurses/x11/Makefile.in +754 -0
  219. data/vendor/PDCurses/x11/PDCurses.spec +82 -0
  220. data/vendor/PDCurses/x11/README.md +62 -0
  221. data/vendor/PDCurses/x11/ScrollBox.c +319 -0
  222. data/vendor/PDCurses/x11/ScrollBox.h +51 -0
  223. data/vendor/PDCurses/x11/ScrollBoxP.h +70 -0
  224. data/vendor/PDCurses/x11/aclocal.m4 +994 -0
  225. data/vendor/PDCurses/x11/big_icon.xbm +46 -0
  226. data/vendor/PDCurses/x11/compose.h +201 -0
  227. data/vendor/PDCurses/x11/config.guess +1500 -0
  228. data/vendor/PDCurses/x11/config.h.in +100 -0
  229. data/vendor/PDCurses/x11/config.sub +1616 -0
  230. data/vendor/PDCurses/x11/configure +6700 -0
  231. data/vendor/PDCurses/x11/configure.ac +295 -0
  232. data/vendor/PDCurses/x11/debian/changelog +6 -0
  233. data/vendor/PDCurses/x11/debian/compat +1 -0
  234. data/vendor/PDCurses/x11/debian/control +11 -0
  235. data/vendor/PDCurses/x11/debian/copyright +27 -0
  236. data/vendor/PDCurses/x11/debian/rules +98 -0
  237. data/vendor/PDCurses/x11/install-sh +253 -0
  238. data/vendor/PDCurses/x11/little_icon.xbm +14 -0
  239. data/vendor/PDCurses/x11/ncurses_cfg.h +45 -0
  240. data/vendor/PDCurses/x11/pdcclip.c +173 -0
  241. data/vendor/PDCurses/x11/pdcdisp.c +85 -0
  242. data/vendor/PDCurses/x11/pdcgetsc.c +28 -0
  243. data/vendor/PDCurses/x11/pdckbd.c +104 -0
  244. data/vendor/PDCurses/x11/pdcscrn.c +258 -0
  245. data/vendor/PDCurses/x11/pdcsetsc.c +95 -0
  246. data/vendor/PDCurses/x11/pdcutil.c +52 -0
  247. data/vendor/PDCurses/x11/pdcx11.c +316 -0
  248. data/vendor/PDCurses/x11/pdcx11.h +191 -0
  249. data/vendor/PDCurses/x11/sb.c +155 -0
  250. data/vendor/PDCurses/x11/x11.c +3686 -0
  251. data/vendor/PDCurses/x11/xcurses-config.in +81 -0
  252. metadata +255 -24
  253. data/.travis.yml +0 -13
  254. data/appveyor.yml +0 -16
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Copyright 1989 O'Reilly and Associates, Inc.
3
+
4
+ The X Consortium, and any party obtaining a copy of these files from
5
+ the X Consortium, directly or indirectly, is granted, free of charge, a
6
+ full and unrestricted irrevocable, world-wide, paid up, royalty-free,
7
+ nonexclusive right and license to deal in this software and
8
+ documentation files (the "Software"), including without limitation the
9
+ rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ and/or sell copies of the Software, and to permit persons who receive
11
+ copies from any such party to do so. This license includes without
12
+ limitation a license to do the foregoing actions under any patents of
13
+ the party supplying this software to the X Consortium.
14
+ */
15
+
16
+ #ifndef _XORAscrollBox_h
17
+ #define _XORAscrollBox_h
18
+
19
+ /************************************************************************
20
+ * *
21
+ * scrollBox Widget (subclass of CompositeClass) *
22
+ * *
23
+ ************************************************************************/
24
+
25
+ /* Parameters:
26
+
27
+ Name Class RepType Default Value
28
+ ---- ----- ------- -------------
29
+ background Background Pixel XtDefaultBackground
30
+ border BorderColor Pixel XtDefaultForeground
31
+ borderWidth BorderWidth Dimension 1
32
+ destroyCallback Callback Pointer NULL
33
+ hSpace HSpace Dimension 4
34
+ height Height Dimension 0
35
+ mappedWhenManaged MappedWhenManaged Boolean True
36
+ vSpace VSpace Dimension 4
37
+ width Width Dimension 0
38
+ x Position Position 0
39
+ y Position Position 0
40
+
41
+ */
42
+
43
+
44
+ /* Class record constants */
45
+
46
+ extern WidgetClass scrollBoxWidgetClass;
47
+
48
+ typedef struct _ScrollBoxClassRec *ScrollBoxWidgetClass;
49
+ typedef struct _ScrollBoxRec *ScrollBoxWidget;
50
+
51
+ #endif /* _XORAscrollBox_h */
@@ -0,0 +1,70 @@
1
+ /*
2
+ * Copyright 1989 O'Reilly and Associates, Inc.
3
+
4
+ The X Consortium, and any party obtaining a copy of these files from
5
+ the X Consortium, directly or indirectly, is granted, free of charge, a
6
+ full and unrestricted irrevocable, world-wide, paid up, royalty-free,
7
+ nonexclusive right and license to deal in this software and
8
+ documentation files (the "Software"), including without limitation the
9
+ rights to use, copy, modify, merge, publish, distribute, sublicense,
10
+ and/or sell copies of the Software, and to permit persons who receive
11
+ copies from any such party to do so. This license includes without
12
+ limitation a license to do the foregoing actions under any patents of
13
+ the party supplying this software to the X Consortium.
14
+ */
15
+
16
+ /*
17
+ * scrollBoxP.h - Private definitions for scrollBox widget
18
+ *
19
+ */
20
+
21
+ #ifndef _XORAscrollBoxP_h
22
+ #define _XORAscrollBoxP_h
23
+
24
+ /************************************************************************
25
+ * *
26
+ * scrollBox Widget Private Data *
27
+ * *
28
+ ************************************************************************/
29
+
30
+ #include "x11/ScrollBox.h"
31
+
32
+ #include <X11/CompositeP.h>
33
+
34
+ /* New fields for the scrollBox widget class record */
35
+ typedef struct _ScrollBoxClass {
36
+ int empty;
37
+ } ScrollBoxClassPart;
38
+
39
+ /* Full class record declaration */
40
+ typedef struct _ScrollBoxClassRec {
41
+ CoreClassPart core_class;
42
+ CompositeClassPart composite_class;
43
+ ScrollBoxClassPart scrollBox_class;
44
+ } ScrollBoxClassRec;
45
+
46
+ extern ScrollBoxClassRec scrollBoxClassRec;
47
+
48
+ /* New fields for the scrollBox widget record */
49
+ typedef struct {
50
+ Dimension h_space, v_space;
51
+ Dimension preferred_width, preferred_height;
52
+ Dimension last_query_width, last_query_height;
53
+ Dimension increment_width, increment_height;
54
+ XtGeometryMask last_query_mode;
55
+ } ScrollBoxPart;
56
+
57
+
58
+ /************************************************************************
59
+ * *
60
+ * Full instance record declaration *
61
+ * *
62
+ ************************************************************************/
63
+
64
+ typedef struct _ScrollBoxRec {
65
+ CorePart core;
66
+ CompositePart composite;
67
+ ScrollBoxPart scrollBox;
68
+ } ScrollBoxRec;
69
+
70
+ #endif /* _XORAscrollBoxP_h */
@@ -0,0 +1,994 @@
1
+ dnl ---------------------------------------------------------------------------
2
+ dnl This file offers the following macros...
3
+ dnl ---------------------------------------------------------------------------
4
+ dnl MH_IPC
5
+ dnl MH_CHECK_X_INC
6
+ dnl MH_CHECK_X_LIB
7
+ dnl MH_CHECK_X_HEADERS
8
+ dnl MH_CHECK_X_KEYDEFS
9
+ dnl MH_CHECK_X_TYPEDEF
10
+ dnl MH_CHECK_LIB
11
+ dnl MH_SHARED_LIBRARY
12
+ dnl MH_HOWTO_DYN_LINK
13
+ dnl MH_CHECK_CC_O
14
+ dnl MH_SHLPST
15
+ dnl MH_CHECK_MAX_SIGNALS
16
+ dnl MH_CHECK_OSX_ARCH
17
+ dnl MH_GET_DISTRO_NAME
18
+ dnl MH_CHECK_RPM
19
+ dnl MH_CHECK_ARCH
20
+ dnl AC_DEFINE_DIR
21
+
22
+ dnl ---------------------------------------------------------------------------
23
+ dnl Determine if the system has System V IPC. ie sys/ipc.h and sys/shm.h
24
+ dnl headers.
25
+ dnl ---------------------------------------------------------------------------
26
+ AC_DEFUN([MH_IPC],
27
+ [
28
+ AC_CHECK_HEADER(sys/ipc.h)
29
+ if test $ac_cv_header_sys_ipc_h = no; then
30
+ AC_MSG_ERROR(Cannot find required header file sys/ipc.h; PDCurses cannot be configured)
31
+ fi
32
+ ])dnl
33
+
34
+ dnl ---------------------------------------------------------------------------
35
+ dnl Set up the correct X header file location
36
+ dnl ---------------------------------------------------------------------------
37
+ AC_DEFUN([MH_CHECK_X_INC],
38
+ [
39
+ mh_x11_dir=""
40
+ mh_x11_xaw_dir=""
41
+
42
+ mh_inc_dirs="$ac_x_header_dirs"
43
+
44
+ dnl Provide for user supplying directory
45
+
46
+ if test "x$x_includes" != xNONE ; then
47
+ mh_inc_dirs="$x_includes $mh_inc_dirs"
48
+ fi
49
+
50
+ dnl Try to determine the directory containing X headers
51
+ dnl We will append X11 to all the paths above as an extra check
52
+
53
+ for ac_dir in $mh_inc_dirs ; do
54
+ if test -r $ac_dir/Intrinsic.h; then
55
+ mh_x11_dir=$ac_dir
56
+ break
57
+ fi
58
+ if test -r $ac_dir/X11/Intrinsic.h; then
59
+ mh_x11_dir="$ac_dir/X11"
60
+ break
61
+ fi
62
+ done
63
+
64
+ dnl Try to determine the directory containing Xaw headers
65
+ dnl We will append X11 to all the paths above as an extra check
66
+
67
+ if test "$with_xaw3d" = yes; then
68
+ mh_xaw_dir="Xaw3d"
69
+ else
70
+ if test "$with_nextaw" = yes; then
71
+ mh_xaw_dir="neXtaw"
72
+ else
73
+ mh_xaw_dir="Xaw"
74
+ fi
75
+ fi
76
+ for ac_dir in $mh_inc_dirs ; do
77
+ if test -r $ac_dir/$mh_xaw_dir/Box.h; then
78
+ mh_x11_xaw_dir=$ac_dir
79
+ break
80
+ fi
81
+ if test -r $ac_dir/X11/$mh_xaw_dir/Box.h; then
82
+ mh_x11_xaw_dir="$ac_dir/X11"
83
+ break
84
+ fi
85
+ done
86
+
87
+ if test "x$mh_x11_dir" != "x" ; then
88
+ mh_x11_dir_no_x11=`echo $mh_x11_dir | sed 's/\/X11$//'`
89
+
90
+ if test "$mh_x11_dir_no_x11" != "$mh_x11_dir" ; then
91
+ MH_XINC_DIR="-I$mh_x11_dir -I$mh_x11_dir_no_x11"
92
+ else
93
+ MH_XINC_DIR="-I$mh_x11_dir"
94
+ fi
95
+ else
96
+ AC_MSG_ERROR(Cannot find required header file Intrinsic.h; PDCurses cannot be configured)
97
+ fi
98
+
99
+ if test "x$mh_x11_xaw_dir" != "x"; then
100
+ if test "$mh_x11_xaw_dir" != "$mh_x11_dir" ; then
101
+ MH_XINC_DIR="-I$mh_x11_xaw_dir $MH_XINC_DIR"
102
+ fi
103
+ else
104
+ AC_MSG_ERROR(Cannot find required Xaw header file Box.h; PDCurses cannot be configured)
105
+ fi
106
+
107
+ AC_SUBST(MH_XINC_DIR)
108
+
109
+ ])dnl
110
+
111
+ dnl ---------------------------------------------------------------------------
112
+ dnl Set up the correct X library file location
113
+ dnl ---------------------------------------------------------------------------
114
+ AC_DEFUN([MH_CHECK_X_LIB],
115
+ [
116
+ dnl Some systems require extra libraries...
117
+
118
+ mh_solaris_flag=no
119
+ mh_hpux9_flag=no
120
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])
121
+ case "$target" in
122
+ *solaris*)
123
+ mh_solaris_flag=yes
124
+ ;;
125
+ *pc-sco*)
126
+ extra_x_libs="Xext"
127
+ ;;
128
+ sparc*sunos*)
129
+ extra_x_libs="Xext"
130
+ if test "$ac_cv_prog_CC" = "gcc" ; then
131
+ extra_ld_flags="-Wl,-Bstatic"
132
+ extra_ld_flags2="-Wl,-Bdynamic"
133
+ else
134
+ extra_ld_flags="-Bstatic"
135
+ extra_ld_flags2="-Bdynamic"
136
+ fi
137
+ ;;
138
+ *hpux9*)
139
+ mh_hpux9_flag=yes
140
+ ;;
141
+ esac
142
+
143
+ if test "$with_xaw3d" = yes; then
144
+ MH_X11_LIBS="Xaw3d Xmu Xt X11"
145
+ else
146
+ if test "$with_nextaw" = yes; then
147
+ MH_X11_LIBS="neXtaw Xmu Xt X11"
148
+ else
149
+ MH_X11_LIBS="Xaw Xmu Xt X11"
150
+ fi
151
+ fi
152
+ MH_X11R6_LIBS="SM ICE Xext"
153
+ mh_x11r6=no
154
+
155
+ which dpkg-architecture > /dev/null
156
+ if test $? -eq 0; then
157
+ multiarch_libdir="/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`"
158
+ else
159
+ multiarch_libdir=""
160
+ fi
161
+
162
+ mh_lib_dirs="$multiarch_libdir /usr/lib64 /usr/lib/x86_64-linux-gnu /usr/lib/i386-linux-gnu $x_libraries `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`"
163
+
164
+ dnl try to find libSM.[a,sl,so,dylib]. If we find it we are using X11R6
165
+ for ac_dir in $mh_lib_dirs ; do
166
+ for mh_xsm in libSM.a libSM.so libSM.sl libSM.dylib; do
167
+ if test -r $ac_dir/$mh_xsm; then
168
+ mh_x11r6=yes
169
+ break 2
170
+ fi
171
+ done
172
+ done
173
+
174
+ if test "$mh_x11r6" = yes ; then
175
+ mh_libs="$MH_X11_LIBS $MH_X11R6_LIBS"
176
+ else
177
+ mh_libs="$MH_X11_LIBS $extra_x_libs"
178
+ fi
179
+
180
+
181
+ dnl Ensure that all required X libraries are found
182
+
183
+ mh_prev_dir=""
184
+ mh_where_found=""
185
+ mh_where_found_dirs=""
186
+ mh_solaris_path=""
187
+ for mh_lib in $mh_libs; do
188
+ mh_lib_found=no
189
+ for ac_dir in $mh_lib_dirs ; do
190
+ for mh_ext in a so sl dll.a dylib; do
191
+ if test -r $ac_dir/lib$mh_lib.$mh_ext; then
192
+ if test "x$mh_prev_dir" != "x$ac_dir" ; then
193
+ if test "x$mh_prev_dir" = "x" ; then
194
+ mh_where_found="$mh_where_found found in $ac_dir"
195
+ else
196
+ mh_where_found="$mh_where_found and in $ac_dir"
197
+ fi
198
+ mh_prev_dir=$ac_dir
199
+ mh_where_found_dirs="$mh_where_found_dirs $ac_dir"
200
+ MH_XLIBS="$MH_XLIBS -L$ac_dir"
201
+ mh_solaris_path="${mh_solaris_path}:$ac_dir"
202
+ fi
203
+ MH_XLIBS="$MH_XLIBS -l$mh_lib"
204
+ mh_lib_found=yes
205
+ break 2
206
+ fi
207
+ done
208
+ done
209
+ if test "$mh_lib_found" = no; then
210
+ AC_MSG_ERROR(Cannot find required X library; lib$mh_lib. PDCurses cannot be configured)
211
+ fi
212
+ done
213
+
214
+ mh_solaris_path=`echo $mh_solaris_path | sed 's/^://'`
215
+ if test "$mh_solaris_flag" = yes ; then
216
+ MH_XLIBS="-R$mh_solaris_path $extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
217
+ else
218
+ MH_XLIBS="$extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
219
+ fi
220
+ if test "$mh_hpux9_flag" = yes ; then
221
+ grep -q XtSetLanguageProc $mh_x11_dir/Intrinsic.h
222
+ if test $? -eq 0 ; then
223
+ mh_found_xtshellstrings=no
224
+ for mh_acdir in $mh_where_found_dirs ; do
225
+ for mh_xaw in `ls $mh_acdir/libXaw.*` ; do
226
+ nm $mh_xaw | grep XtShellStrings | grep -qv extern
227
+ if test $? -eq 0 ; then
228
+ mh_found_xtshellstrings=yes
229
+ fi
230
+ done
231
+ done
232
+ if test "$mh_found_xtshellstrings" = no ; then
233
+ AC_MSG_WARN(The X11 development environment has not been installed correctly.)
234
+ AC_MSG_WARN(The header file; Intrinsic.h, is for X11R5 while the Athena Widget)
235
+ AC_MSG_WARN(Set library; libXaw is for X11R4. This is a common problem with)
236
+ AC_MSG_WARN(HP-UX 9.x.)
237
+ AC_MSG_ERROR(X11 installation incomplete; cannot continue)
238
+ fi
239
+ fi
240
+ fi
241
+
242
+ AC_SUBST(MH_XLIBS)
243
+
244
+ ])dnl
245
+
246
+ dnl ---------------------------------------------------------------------------
247
+ dnl Determine if the supplied X headers exist.
248
+ dnl ---------------------------------------------------------------------------
249
+ AC_DEFUN([MH_CHECK_X_HEADERS],
250
+ [
251
+ save_CPPFLAGS="$CPPFLAGS"
252
+ CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
253
+ for mh_header in $1; do
254
+ AC_CHECK_HEADERS($mh_header)
255
+ done
256
+ CPPFLAGS="$save_CPPFLAGS"
257
+ ])dnl
258
+
259
+ dnl ---------------------------------------------------------------------------
260
+ dnl Determine if various key definitions exist in keysym.h
261
+ dnl ---------------------------------------------------------------------------
262
+ AC_DEFUN([MH_CHECK_X_KEYDEFS],
263
+ [
264
+ save_CPPFLAGS="$CPPFLAGS"
265
+ CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
266
+ for mh_keydef in $1; do
267
+ AC_MSG_CHECKING(for $mh_keydef in keysym.h)
268
+ mh_upper_name="HAVE_`echo $mh_keydef | tr '[a-z]' '[A-Z]'`"
269
+ AC_TRY_COMPILE([#include <keysym.h>],
270
+ [int i = $mh_keydef;],
271
+ mh_have_key=yes; AC_DEFINE_UNQUOTED($mh_upper_name,1), mh_have_key=no )
272
+ AC_MSG_RESULT($mh_have_key)
273
+ done
274
+ CPPFLAGS="$save_CPPFLAGS"
275
+ ])dnl
276
+
277
+ dnl ---------------------------------------------------------------------------
278
+ dnl Determine if supplied types have been typedefed
279
+ dnl ---------------------------------------------------------------------------
280
+ AC_DEFUN([MH_CHECK_X_TYPEDEF],
281
+ [
282
+ save_CPPFLAGS="$CPPFLAGS"
283
+ CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR"
284
+ for td in $1 ; do
285
+ AC_MSG_CHECKING(if $td is typedefed:)
286
+ AC_TRY_COMPILE(
287
+ [#include "X11/Xlib.h"],
288
+ [$td fred],
289
+ [mh_td=yes],
290
+ [mh_td=no]
291
+ )
292
+ if test "$mh_td" = yes ; then
293
+ TD_upper=`echo $td | tr a-z A-Z`
294
+ AC_DEFINE_UNQUOTED(${TD_upper}_TYPEDEFED, 1)
295
+ fi
296
+ AC_MSG_RESULT($mh_td)
297
+ done
298
+ CPPFLAGS="$save_CPPFLAGS"
299
+ ])dnl
300
+
301
+ dnl ---------------------------------------------------------------------------
302
+ dnl Check for presence of various libraries
303
+ dnl ---------------------------------------------------------------------------
304
+ AC_DEFUN([MH_CHECK_LIB],
305
+ [
306
+ MH_EXTRA_LIBS=''
307
+ for mh_lib in $1; do
308
+ if test "$on_qnx" = yes; then
309
+ AC_MSG_CHECKING(for library -l${mh_lib})
310
+ if test -r /usr/lib/${mh_lib}3r.lib; then
311
+ AC_MSG_RESULT(found)
312
+ MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
313
+ else
314
+ AC_MSG_RESULT(not found)
315
+ fi
316
+ else
317
+ AC_CHECK_LIB($mh_lib,main,mh_lib_found=yes,mh_lib_found=no)
318
+ if test "$mh_lib_found" = yes; then
319
+ MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
320
+ fi
321
+ fi
322
+ done
323
+ ])dnl
324
+
325
+ dnl ---------------------------------------------------------------------------
326
+ dnl Work out how to create a dynamically loaded module
327
+ dnl ---------------------------------------------------------------------------
328
+ AC_DEFUN([MH_HOWTO_DYN_LINK],
329
+ [
330
+ mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&AC_FD_CC'
331
+ cat > conftest.$ac_ext <<EOF
332
+ dnl [#]line __oline__ "[$]0"
333
+ [#]line __oline__ "configure"
334
+ int foo()
335
+ {
336
+ return(0);
337
+ }
338
+ EOF
339
+ if AC_TRY_EVAL(mh_compile) && test -s conftest.o; then
340
+ mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC'
341
+ # mh_dyn_link='${CC} -Wl,-shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC'
342
+ if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then
343
+ LD_RXLIB1="ld -shared"
344
+ # LD_RXLIB1="${CC} -Wl,-shared"
345
+ SHLPRE="lib"
346
+ SHLPST=".so"
347
+ else
348
+ mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&AC_FD_CC'
349
+ # mh_dyn_link='${CC} -Wl,-G -o conftest.rxlib conftest.o 1>&AC_FD_CC'
350
+ if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then
351
+ LD_RXLIB1="ld -G"
352
+ # LD_RXLIB1="${CC} -Wl,-G"
353
+ SHLPRE="lib"
354
+ SHLPST=".so"
355
+ else
356
+ LD_RXLIB1=""
357
+ SHLPRE=""
358
+ SHLPST=""
359
+ fi
360
+ fi
361
+ fi
362
+ rm -f conftest*
363
+ ])dnl
364
+
365
+ dnl ---------------------------------------------------------------------------
366
+ dnl Determine how to build shared libraries etc..
367
+ dnl ---------------------------------------------------------------------------
368
+ AC_DEFUN([MH_SHARED_LIBRARY],
369
+ [
370
+ AC_REQUIRE([MH_SHLPST])
371
+ dnl
372
+ dnl If compiler is gcc, then flags should be the same for all platforms
373
+ dnl (just guessing on this)
374
+ dnl
375
+ AIX_DYN="no"
376
+ BEOS_DYN="no"
377
+ SHLFILE="$1"
378
+ SHLFILES="$*"
379
+ RXPACKEXPORTS=""
380
+ SHLPRE="lib"
381
+ LD_RXLIB1=""
382
+ BASE_INSTALL="installbase"
383
+ BASE_BINARY="binarybase"
384
+ # OTHER_INSTALLS is set to install a non-version numbered shared library
385
+ # by default; ie. no .\$(ABI) suffix. Set OTHER_INSTALLS="installabilib" if you
386
+ # are building a version numbered shared library.
387
+ OTHER_INSTALLS="installlib"
388
+
389
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])
390
+ case "$target" in
391
+ *hp-hpux*)
392
+ SYS_DEFS="-D_HPUX_SOURCE"
393
+ LD_RXLIB1="ld -b -q -n"
394
+ ;;
395
+ *ibm-aix*)
396
+ SYS_DEFS="-D_ALL_SOURCE -DAIX"
397
+ AIX_DYN="yes"
398
+ DYN_COMP="-DDYNAMIC"
399
+ LD_RXLIB1="ld -bnoentry -bM:SRE"
400
+ RXPACKEXPORTS="-bE:$SHLFILE.exp"
401
+ RXPACKEXP="$SHLFILE.exp"
402
+ ;;
403
+ *dec-osf*)
404
+ if test "$ac_cv_prog_CC" = "gcc"; then
405
+ SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE"
406
+ else
407
+ SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE -Olimit 800"
408
+ fi
409
+ LD_RXLIB1="ld -shared"
410
+ ;;
411
+ *sequent-dynix*|*esix*|*dgux*)
412
+ LD_RXLIB1="ld -G"
413
+ ;;
414
+ *solaris*)
415
+ if test "$ac_cv_prog_CC" = "gcc"; then
416
+ LD_RXLIB1="gcc -shared"
417
+ else
418
+ LD_RXLIB1="ld -G"
419
+ fi
420
+ ;;
421
+ sparc*sunos*)
422
+ SYS_DEFS="-DSUNOS -DSUNOS_STRTOD_BUG"
423
+ LD_RXLIB1="ld"
424
+ ;;
425
+ *atheos*|*nto-qnx*)
426
+ LD_RXLIB1="${CC} -shared"
427
+ ;;
428
+ *linux*|*kfreebsd*-gnu*)
429
+ LD_RXLIB1="${CC} -shared -Wl,-soname,\$(@)"
430
+ CAN_USE_ABI="yes"
431
+ if test "$USE_ABI" = "yes"; then
432
+ OTHER_INSTALLS="installabilib"
433
+ fi
434
+ ;;
435
+ *freebsd*)
436
+ LD_RXLIB1="ld -Bdynamic -Bshareable"
437
+ ;;
438
+ *pc-sco*)
439
+ LD_RXLIB1="ld -dy -G"
440
+ ;;
441
+ *beos*)
442
+ LD_RXLIB1="${CC} -Wl,-shared -nostart -Xlinker -soname=\$(@)"
443
+ BEOS_DYN="yes"
444
+ ;;
445
+ *qnx*)
446
+ SHLPRE=""
447
+ DYN_COMP="-Q" # force no check for dynamic loading
448
+ SHLFILE=""
449
+ ;;
450
+ *cygwin)
451
+ SHLPRE=""
452
+ DYN_COMP="-DDYNAMIC"
453
+ LD_RXLIB1="dllwrap --def \$(srcdir)/../win32/pdcurses.def --target i386-cygwin32 --dllname \$(@)"
454
+ # cygwininstall target MUST install the shared library itself because
455
+ # it puts it into $(bindir) not $(libdir) as all other platforms
456
+ ;;
457
+ *darwin*)
458
+ DYN_COMP="-fno-common"
459
+ LD_RXLIB1="${CC} -flat_namespace -undefined suppress -dynamiclib -install_name=\$(@)"
460
+ ;;
461
+ *)
462
+ ;;
463
+ esac
464
+
465
+ dnl determine what switches our compiler uses for building objects
466
+ dnl suitable for inclusion in shared libraries
467
+ dnl Only call this if DYN_COMP is not set. If we have set DYN_COMP
468
+ dnl above, then we know how to compile AND link for dynamic libraries
469
+
470
+ if test "$DYN_COMP" = ""; then
471
+ AC_MSG_CHECKING(compiler flags for a dynamic object)
472
+
473
+ cat > conftest.$ac_ext <<EOF
474
+ dnl [#]line __oline__ "[$]0"
475
+ [#]line __oline__ "configure"
476
+ int a=0
477
+ EOF
478
+
479
+ DYN_COMP=""
480
+ mh_cv_stop=no
481
+ save_cflags="$CFLAGS"
482
+ mh_cv_flags="-fPIC -KPIC +Z"
483
+ for a in $mh_cv_flags; do
484
+ CFLAGS="-c $a"
485
+
486
+ mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1'
487
+ if AC_TRY_EVAL(mh_compile); then
488
+ DYN_COMP=""
489
+ else
490
+ slash="\\"
491
+ mh_dyncomp="`egrep -c $slash$a conftest.tmp`"
492
+ if test "$mh_dyncomp" = "0"; then
493
+ DYN_COMP="$a -DDYNAMIC"
494
+ AC_MSG_RESULT($a)
495
+ break
496
+ else
497
+ DYN_COMP=""
498
+ fi
499
+ fi
500
+ done
501
+ if test "$DYN_COMP" = ""; then
502
+ AC_MSG_RESULT(none of $mh_cv_flags supported)
503
+ fi
504
+ if test "$LD_RXLIB1" = ""; then
505
+ MH_HOWTO_DYN_LINK()
506
+ fi
507
+ CFLAGS=$save_cflags
508
+ rm -f conftest.*
509
+ fi
510
+
511
+
512
+ SHL_TARGETS=""
513
+
514
+ if test "$AIX_DYN" = "yes"; then
515
+ aix_exports="config.exports.aix"
516
+ echo "" > $aix_exports
517
+ fi
518
+
519
+ if test "$ac_cv_header_dl_h" = "yes" -o "$ac_cv_header_dlfcn_h" = "yes" -o "$AIX_DYN" = "yes" -o "$BEOS_DYN" = "yes" -o "$DLFCNINCDIR" != "" -o "$DLFCNLIBDIR" != ""; then
520
+ EXPS="1,2,3,4,5,6,7,8,9"
521
+ for a in $SHLFILES
522
+ do
523
+ if test "$USE_ABI" = "yes" -a "$CAN_USE_ABI" = "yes"; then
524
+ SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}.\$(ABI)"
525
+ else
526
+ SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}"
527
+ fi
528
+ this=`echo $EXPS | cut -d, -f1`
529
+ EXPS=`echo $EXPS | cut -d, -f2-`
530
+ if test "$AIX_DYN" = "yes"; then
531
+ echo "RXPACKEXP$this=$a.exp" >> $aix_exports
532
+ echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports
533
+ fi
534
+ done
535
+ fi
536
+
537
+ AC_SUBST(DYN_COMP)
538
+ AC_SUBST(LIBS)
539
+ AC_SUBST(LD_RXLIB1)
540
+ AC_SUBST(SHLPRE)
541
+ AC_SUBST(SHLPST)
542
+ AC_SUBST(SHL_TARGETS)
543
+ AC_SUBST(O2SAVE)
544
+ AC_SUBST(CC2O)
545
+ AC_SUBST(SAVE2O)
546
+ AC_SUBST(RXPACKEXPORTS)
547
+ AC_SUBST(BASE_INSTALL)
548
+ AC_SUBST(OTHER_INSTALLS)
549
+ AC_SUBST(BASE_BINARY)
550
+ AC_SUBST(CAN_USE_ABI)
551
+ ])dnl
552
+
553
+ dnl ---------------------------------------------------------------------------
554
+ dnl Check if C compiler supports -c -o file.ooo
555
+ dnl ---------------------------------------------------------------------------
556
+ AC_DEFUN([MH_CHECK_CC_O],
557
+ [
558
+ AC_MSG_CHECKING(whether $CC understand -c and -o together)
559
+ set dummy $CC; ac_cc="`echo [$]2 |
560
+ changequote(, )dnl
561
+ sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
562
+ changequote([, ])dnl
563
+ AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
564
+ [echo 'foo(){}' > conftest.c
565
+ # We do the test twice because some compilers refuse to overwrite an
566
+ # existing .o file with -o, though they will create one.
567
+ eval ac_cv_prog_cc_${ac_cc}_c_o=no
568
+ ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC'
569
+ if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try);
570
+ then
571
+ ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC'
572
+ if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try);
573
+ then
574
+ eval ac_cv_prog_cc_${ac_cc}_c_o=yes
575
+ fi
576
+ fi
577
+ rm -f conftest*
578
+ ])dnl
579
+ if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
580
+ O2SAVE=""
581
+ SAVE2O=""
582
+ CC2O="-o $"'@'
583
+ AC_MSG_RESULT(yes)
584
+ else
585
+ O2SAVE="-mv \`basename "$'@'" .sho\`.o \`basename "$'@'" .sho\`.o.save;"
586
+ SAVE2O="-mv \`basename "$'@'" .sho\`.o "$'@'"; mv \`basename "$'@'" .sho\`.o.save \`basename "$'@'" .sho\`.o"
587
+ CC2O=""
588
+ AC_MSG_RESULT(no)
589
+ fi
590
+ ])
591
+
592
+ dnl ---------------------------------------------------------------------------
593
+ dnl Determines the file extension for shared libraries
594
+ dnl ---------------------------------------------------------------------------
595
+ AC_DEFUN([MH_SHLPST],
596
+ [
597
+ AC_MSG_CHECKING(shared library extension)
598
+ SHLPST=".so"
599
+ AC_REQUIRE([AC_CANONICAL_SYSTEM])
600
+ case "$target" in
601
+ *hp-hpux*)
602
+ SHLPST=".sl"
603
+ ;;
604
+ *ibm-aix*)
605
+ SHLPST=".a"
606
+ ;;
607
+ *qnx*)
608
+ SHLPST=""
609
+ ;;
610
+ *cygwin*)
611
+ SHLPST=".dll"
612
+ ;;
613
+ *darwin*)
614
+ SHLPST=".dylib"
615
+ ;;
616
+ esac
617
+ AC_SUBST(SHLPST)
618
+ AC_MSG_RESULT($SHLPST)
619
+ ])
620
+
621
+ dnl ---------------------------------------------------------------------------
622
+ dnl Determine the system limit for number of signals
623
+ dnl ---------------------------------------------------------------------------
624
+ AC_DEFUN([MH_CHECK_MAX_SIGNALS],
625
+ [
626
+ save_CPPFLAGS="$CPPFLAGS"
627
+ CPPFLAGS="$CPPFLAGS $SYS_DEFS"
628
+ AC_MSG_CHECKING(for maximum signal specifier:)
629
+ AC_CACHE_VAL(mh_cv_max_signals,
630
+ mh_found="no"
631
+ for mh_sigs in $1; do
632
+ AC_TRY_COMPILE([#include <signal.h>],
633
+ [return $mh_sigs;],
634
+ mh_found="yes"; mh_cv_max_signals="$mh_sigs" )
635
+ if test "$mh_found" = "yes"; then
636
+ break;
637
+ fi
638
+ done)
639
+ CPPFLAGS="$save_CPPFLAGS"
640
+ if test "$mh_found" = "no"; then
641
+ AC_MSG_ERROR(Cannot find a system limit for number of signals. PDCurses cannot be configured on this machine.)
642
+ else
643
+ AC_DEFINE_UNQUOTED(PDC_MAX_SIGNALS,$mh_cv_max_signals)
644
+ AC_MSG_RESULT($mh_cv_max_signals)
645
+ fi
646
+ ])dnl
647
+
648
+ dnl ---------------------------------------------------------------------------
649
+ dnl Determines which -arch flags valid on Mac OSX with gcc
650
+ dnl ---------------------------------------------------------------------------
651
+ AC_DEFUN([MH_CHECK_OSX_ARCH],
652
+ [
653
+ valid_arch_flags=""
654
+ found_arch_flags=""
655
+ AC_ARG_WITH(arch,
656
+ [ --with-arch=option build universal binaries on OS X, option: one of "all 32bit 64bit intel ppc ppc64 x86_64 i386"],
657
+ [with_arch=$withval],
658
+ [with_arch=none],
659
+ )
660
+ case "$with_arch" in
661
+ none)
662
+ arch_flags=""
663
+ ;;
664
+ all)
665
+ arch_flags="-arch ppc -arch ppc64 -arch x86_64 -arch i386"
666
+ ;;
667
+ 32bit)
668
+ arch_flags="-arch ppc -arch i386"
669
+ ;;
670
+ 64bit)
671
+ arch_flags="-arch ppc64 -arch x86_64"
672
+ ;;
673
+ intel)
674
+ arch_flags="-arch i386 -arch x86_64"
675
+ ;;
676
+ *)
677
+ arch_flags="-arch $with_arch"
678
+ ;;
679
+ esac
680
+
681
+ valid_arch_flags=""
682
+ found_arch_flags=""
683
+ if test $on_osx = "yes"; then
684
+ AC_MSG_CHECKING(for which Mac OSX -arch flags are supported for universal binaries)
685
+ for a in $arch_flags; do
686
+ save_ldflags="$LDFLAGS"
687
+ LDFLAGS="$LDFLAGS -arch $a"
688
+ AC_LINK_IFELSE(
689
+ [AC_LANG_PROGRAM([#include <stdio.h>],
690
+ [exit(0)])],
691
+ [valid_arch_flags="$valid_arch_flags -arch $a";found_arch_flags="$found_arch_flags $a"],
692
+ [a="$a"]
693
+ )
694
+ LDFLAGS="$save_ldflags"
695
+ done
696
+ AC_MSG_RESULT($found_arch_flags)
697
+ AC_SUBST(valid_arch_flags)
698
+ fi
699
+ ])
700
+
701
+ dnl ---------------------------------------------------------------------------
702
+ dnl Determines the Linux distribution name
703
+ dnl ---------------------------------------------------------------------------
704
+ AC_DEFUN([MH_GET_DISTRO_NAME],
705
+ [
706
+ AC_CHECK_PROG(lsb_release, [lsb_release], yes, no)
707
+ if test "$ac_cv_prog_lsb_release" = yes; then
708
+ AC_MSG_CHECKING(OS distribution name)
709
+ MYDISTRO="`lsb_release -i | cut -f 2`-`lsb_release -r | cut -f 2`"
710
+ MYDISTRO="`echo $MYDISTRO | sed \"s/ /_/g\"`"
711
+ AC_MSG_RESULT($MYDISTRO)
712
+ else
713
+ case "$target" in
714
+ *freebsd* | *openbsd*)
715
+ MYDISTRO="`echo $target | cut -f3 -d-`"
716
+ ;;
717
+ *darwin*)
718
+ MYDISTRO="`echo $target | cut -f2-3 -d-`"
719
+ ;;
720
+ *pc-solaris2*)
721
+ MYDISTRO="`echo $target | cut -f2- -d-`"
722
+ ;;
723
+ *cygwin*)
724
+ MYDISTRO="`echo $target | cut -f2- -d-`"
725
+ ;;
726
+ *)
727
+ MYDISTRO="$target"
728
+ ;;
729
+ esac
730
+ fi
731
+ AC_SUBST(MYDISTRO)
732
+ ])
733
+
734
+ dnl ---------------------------------------------------------------------------
735
+ dnl Determines where rpm build files are located
736
+ dnl ---------------------------------------------------------------------------
737
+ AC_DEFUN([MH_CHECK_RPM],
738
+ [
739
+ AC_CHECK_PROG(mh_rpm_exists, rpm, yes, no )
740
+ if test "$mh_rpm_exists" = yes; then
741
+ AC_MSG_CHECKING(where rpms are built)
742
+ RPMTOPDIR=`rpm --eval "%{_topdir}"`
743
+ AC_MSG_RESULT($RPMTOPDIR)
744
+ AC_SUBST(RPMTOPDIR)
745
+ fi
746
+ ])
747
+
748
+ dnl
749
+ dnl Determine if the platform can handle 64 bit binaries
750
+ dnl
751
+ dnl Assumes AC_CANONICAL_SYSTEM has already been called
752
+ dnl assumes we are on a 32bit system
753
+
754
+ AC_DEFUN([MH_CHECK_ARCH],
755
+ [
756
+ dnl ---------------------- check 32/64 bit -----------------------
757
+ dnl allow --with-32bit to ensure that 32bit libraries are used
758
+ AC_ARG_ENABLE(32bit,
759
+ [ --enable-32bit specify if 32bit libraries are to be used],
760
+ [bitflag32=yes],
761
+ [bitflag32=no],
762
+ )
763
+ dnl allow --with-64bit to ensure that 64bit libraries are used
764
+ AC_ARG_ENABLE(64bit,
765
+ [ --enable-64bit specify if 64bit libraries are to be used],
766
+ [bitflag64=yes],
767
+ [bitflag64=no],
768
+ )
769
+
770
+ #
771
+ # Now do platform specific tests
772
+ #
773
+ gcc_64bit="-m64"
774
+ gcc_32bit="-m32"
775
+ on_osx="no"
776
+ osis64bit=no
777
+ bitflag=""
778
+ case "$target" in
779
+ *hp-hpux*)
780
+ ;;
781
+ *ibm-aix*)
782
+ rc=`lsconf -k | grep -c 64-bit`
783
+ if test $rc -eq 1; then
784
+ bitflag="64"
785
+ osis64bit=yes
786
+ fi
787
+ #
788
+ # AIX gcc has its own special bit switches :-(
789
+ #
790
+ gcc_64bit="-maix64"
791
+ gcc_32bit="-maix32"
792
+ ;;
793
+ *dec-osf4*)
794
+ ;;
795
+ *dec-osf*)
796
+ ;;
797
+ *sequent-dynix*)
798
+ ;;
799
+ i*86*solaris*)
800
+ ;;
801
+ *solaris*)
802
+ rc=`isainfo -v | grep -c 64-bit`
803
+ if test $rc -eq 1; then
804
+ bitflag="64"
805
+ osis64bit=yes
806
+ fi
807
+ ;;
808
+ sparc*sunos*)
809
+ ;;
810
+ *linux*|*kfreebsd*-gnu*)
811
+ mach="`uname -m`"
812
+ if test "$mach" = "x86_64" -o "$mach" = "ia86" -o "$mach" = "alpha" -o "$mach" = "ppc64" -o "$mach" = "s390x"; then
813
+ bitflag="64"
814
+ osis64bit=yes
815
+ fi
816
+ ;;
817
+ *-freebsd*)
818
+ mach="`uname -m`"
819
+ if test "$mach" = "amd64"; then
820
+ bitflag="64"
821
+ osis64bit=yes
822
+ fi
823
+ ;;
824
+ *nto-qnx*)
825
+ ;;
826
+ *qnx*)
827
+ ;;
828
+ *beos*)
829
+ ;;
830
+ *cygwin*)
831
+ ;;
832
+ *apple-darwin*)
833
+ on_osx="yes"
834
+ osx_64bit=`sysctl hw.cpu64bit_capable | cut -f2 -d' '`
835
+ if test $osx_64bit -eq 1; then
836
+ bitflag="64"
837
+ osis64bit=yes
838
+ fi
839
+ ;;
840
+ esac
841
+
842
+ if test "x$bitflag32" = "xyes" -a "x$bitflag64" = "xyes"; then
843
+ AC_MSG_ERROR(--enable-32bit and --enable-64bit flags cannot both be specified.)
844
+ fi
845
+
846
+ if test "x$bitflag64" = "xyes" -a "$osis64bit" = "no"; then
847
+ AC_MSG_ERROR(--enable-64bit cannot be specified on non-64bit OS.)
848
+ fi
849
+
850
+ binarybitprefix=""
851
+ if test "x$bitflag32" = "xyes"; then
852
+ bitflag="32"
853
+ if test "$osis64bit" = "yes"; then
854
+ binarybitprefix="32"
855
+ fi
856
+ elif test "x$bitflag64" = "xyes"; then
857
+ bitflag="64"
858
+ fi
859
+ MACH_ARCH=`$ac_config_guess | cut -f1 -d-`
860
+ AC_SUBST(MACH_ARCH)
861
+ dnl
862
+ dnl following variable used to name 32bit binaries on a 64bit system
863
+ dnl allows 32bit and 64bit binaries t co-exist on a 64bit system
864
+ AC_SUBST(binarybitprefix)
865
+
866
+ dnl --------------- allow --with-arch to specify which architectures to build universal binaries
867
+ dnl
868
+ if test "$on_osx" = "yes"; then
869
+ MH_CHECK_OSX_ARCH()
870
+ else
871
+ dnl
872
+ dnl Now set the correct compiler flags
873
+ dnl
874
+ if test "$ac_cv_prog_CC" = "gcc" -o "$ac_cv_prog_CC" = "g++"; then
875
+ if test "$bitflag" = "32"; then
876
+ CFLAGS="${CFLAGS} $gcc_32bit"
877
+ LDFLAGS="${LDFLAGS} $gcc_32bit"
878
+ elif test "$bitflag" = "64"; then
879
+ CFLAGS="${CFLAGS} $gcc_64bit"
880
+ LDFLAGS="${LDFLAGS} $gcc_64bit"
881
+ else
882
+ bitflag="32"
883
+ fi
884
+ elif test "$ac_cv_prog_CC" = "xlc" -o "$ac_cv_prog_CC" = "xlC"; then
885
+ if test "$bitflag" = "32"; then
886
+ CFLAGS="${CFLAGS} -q32"
887
+ LDFLAGS="${LDFLAGS} -q32"
888
+ elif test "$bitflag" = "64"; then
889
+ CFLAGS="${CFLAGS} -q64"
890
+ LDFLAGS="${LDFLAGS} -q64"
891
+ else
892
+ bitflag="32"
893
+ fi
894
+ fi
895
+ fi
896
+
897
+ dnl allow --disable-libdir-change to ensure that building a .deb works
898
+ #libdir_change=yes
899
+ AC_ARG_ENABLE(libdir-change,
900
+ [ --enable-libdir-change specify --disable-libdir-change if building a .deb],
901
+ [libdir_change=$enableval],
902
+ [libdir_change=yes],
903
+ )
904
+ echo "libdir: $libdir_change"
905
+ if test "$libdir_change" = yes; then
906
+ dnl
907
+ dnl If the user hasn't specified libdir, check for specific lib dirs
908
+ dnl
909
+ if test "${libdir}" = '${exec_prefix}/lib'; then
910
+ dnl
911
+ dnl expand the active $prefix
912
+ dnl
913
+ myprefix=$prefix
914
+ AC_DEFINE_DIR(MY_PREFIX,"$myprefix")
915
+ if test "${myprefix}" = "NONE"; then
916
+ myprefix="$ac_default_prefix"
917
+ fi
918
+ dnl
919
+ dnl check for 64bit libdir
920
+ dnl
921
+ if test -d "${myprefix}/lib/x86_64-linux-gnu"; then
922
+ libdir64="${myprefix}/lib/x86_64-linux-gnu"
923
+ elif test -d "${myprefix}/lib64"; then
924
+ libdir64="${myprefix}/lib64"
925
+ else
926
+ libdir64="${myprefix}/lib"
927
+ fi
928
+ dnl
929
+ dnl check for 32bit libdir
930
+ dnl
931
+ if test -d "${myprefix}/lib/i386-linux-gnu"; then
932
+ libdir32="${myprefix}/lib/i386-linux-gnu"
933
+ elif test -d "${myprefix}/lib32"; then
934
+ libdir32="${myprefix}/lib32"
935
+ else
936
+ libdir32="${myprefix}/lib"
937
+ fi
938
+ dnl
939
+ dnl Depending on the build type, set the default libdir
940
+ dnl
941
+ if test "$bitflag" = "64"; then
942
+ libdir="$libdir64"
943
+ else
944
+ libdir="$libdir32"
945
+ fi
946
+ else
947
+ libdir64="$libdir"
948
+ libdir32="$libdir"
949
+ fi
950
+ else
951
+ libdir64="$libdir"
952
+ libdir32="$libdir"
953
+ fi
954
+ AC_SUBST(libdir64)
955
+ AC_SUBST(libdir32)
956
+ AC_SUBST(bitflag)
957
+ ])
958
+ dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
959
+ dnl
960
+ dnl This macro sets VARNAME to the expansion of the DIR variable,
961
+ dnl taking care of fixing up ${prefix} and such.
962
+ dnl
963
+ dnl VARNAME is then offered as both an output variable and a C
964
+ dnl preprocessor symbol.
965
+ dnl
966
+ dnl Modified by Mark Hessling to fix eval bug
967
+ dnl
968
+ dnl Example:
969
+ dnl
970
+ dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
971
+ dnl
972
+ dnl @category Misc
973
+ dnl @author Stepan Kasal <kasal@ucw.cz>
974
+ dnl @author Andreas Schwab <schwab@suse.de>
975
+ dnl @author Guido U. Draheim <guidod@gmx.de>
976
+ dnl @author Alexandre Oliva
977
+ dnl @version 2006-10-13
978
+ dnl @license AllPermissive
979
+
980
+ AC_DEFUN([AC_DEFINE_DIR], [
981
+ prefix_NONE=
982
+ exec_prefix_NONE=
983
+ test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
984
+ test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
985
+ dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
986
+ dnl refers to ${prefix}. Thus we have to use `eval' twice.
987
+ eval ac_define_dir="\"$2\""
988
+ eval ac_define_dir="\"$ac_define_dir\""
989
+ AC_SUBST($1, "$ac_define_dir")
990
+ AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3])
991
+ test "$prefix_NONE" && prefix=NONE
992
+ test "$exec_prefix_NONE" && exec_prefix=NONE
993
+ ])
994
+