ffi 0.4.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (316) hide show
  1. data/LICENSE +51 -0
  2. data/README.rdoc +69 -0
  3. data/Rakefile +142 -0
  4. data/ext/ffi_c/AbstractMemory.c +412 -0
  5. data/ext/ffi_c/AbstractMemory.h +68 -0
  6. data/ext/ffi_c/AutoPointer.c +60 -0
  7. data/ext/ffi_c/AutoPointer.h +18 -0
  8. data/ext/ffi_c/Buffer.c +171 -0
  9. data/ext/ffi_c/Callback.c +374 -0
  10. data/ext/ffi_c/Callback.h +47 -0
  11. data/ext/ffi_c/DynamicLibrary.c +213 -0
  12. data/ext/ffi_c/DynamicLibrary.h +22 -0
  13. data/ext/ffi_c/Invoker.c +962 -0
  14. data/ext/ffi_c/LastError.c +135 -0
  15. data/ext/ffi_c/LastError.h +18 -0
  16. data/ext/ffi_c/MemoryPointer.c +156 -0
  17. data/ext/ffi_c/MemoryPointer.h +20 -0
  18. data/ext/ffi_c/NullPointer.c +143 -0
  19. data/ext/ffi_c/Platform.c +59 -0
  20. data/ext/ffi_c/Platform.h +16 -0
  21. data/ext/ffi_c/Pointer.c +164 -0
  22. data/ext/ffi_c/Pointer.h +25 -0
  23. data/ext/ffi_c/Struct.c +477 -0
  24. data/ext/ffi_c/Struct.h +26 -0
  25. data/ext/ffi_c/Type.c +230 -0
  26. data/ext/ffi_c/Type.h +28 -0
  27. data/ext/ffi_c/Types.c +118 -0
  28. data/ext/ffi_c/Types.h +54 -0
  29. data/ext/ffi_c/compat.h +22 -0
  30. data/ext/ffi_c/endian.h +40 -0
  31. data/ext/ffi_c/extconf.rb +31 -0
  32. data/ext/ffi_c/ffi.c +76 -0
  33. data/ext/ffi_c/libffi.bsd.mk +34 -0
  34. data/ext/ffi_c/libffi.darwin.mk +75 -0
  35. data/ext/ffi_c/libffi.gnu.mk +29 -0
  36. data/ext/ffi_c/libffi.mk +13 -0
  37. data/ext/ffi_c/libffi/ChangeLog +3243 -0
  38. data/ext/ffi_c/libffi/ChangeLog.libffi +347 -0
  39. data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
  40. data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
  41. data/ext/ffi_c/libffi/LICENSE +21 -0
  42. data/ext/ffi_c/libffi/Makefile.am +177 -0
  43. data/ext/ffi_c/libffi/Makefile.in +1640 -0
  44. data/ext/ffi_c/libffi/README +328 -0
  45. data/ext/ffi_c/libffi/TODO +1 -0
  46. data/ext/ffi_c/libffi/acinclude.m4 +92 -0
  47. data/ext/ffi_c/libffi/aclocal.m4 +7516 -0
  48. data/ext/ffi_c/libffi/compile +142 -0
  49. data/ext/ffi_c/libffi/config.guess +1516 -0
  50. data/ext/ffi_c/libffi/config.sub +1626 -0
  51. data/ext/ffi_c/libffi/configure +24414 -0
  52. data/ext/ffi_c/libffi/configure.ac +365 -0
  53. data/ext/ffi_c/libffi/configure.host +11 -0
  54. data/ext/ffi_c/libffi/depcomp +584 -0
  55. data/ext/ffi_c/libffi/doc/libffi.info +533 -0
  56. data/ext/ffi_c/libffi/doc/libffi.texi +541 -0
  57. data/ext/ffi_c/libffi/doc/stamp-vti +4 -0
  58. data/ext/ffi_c/libffi/doc/version.texi +4 -0
  59. data/ext/ffi_c/libffi/fficonfig.h.in +160 -0
  60. data/ext/ffi_c/libffi/include/Makefile.am +9 -0
  61. data/ext/ffi_c/libffi/include/Makefile.in +422 -0
  62. data/ext/ffi_c/libffi/include/ffi.h.in +393 -0
  63. data/ext/ffi_c/libffi/include/ffi_common.h +98 -0
  64. data/ext/ffi_c/libffi/install-sh +323 -0
  65. data/ext/ffi_c/libffi/libffi.pc.in +10 -0
  66. data/ext/ffi_c/libffi/libtool-version +29 -0
  67. data/ext/ffi_c/libffi/ltcf-c.sh +861 -0
  68. data/ext/ffi_c/libffi/ltcf-cxx.sh +1069 -0
  69. data/ext/ffi_c/libffi/ltcf-gcj.sh +700 -0
  70. data/ext/ffi_c/libffi/ltconfig +2862 -0
  71. data/ext/ffi_c/libffi/ltmain.sh +6930 -0
  72. data/ext/ffi_c/libffi/man/Makefile.am +8 -0
  73. data/ext/ffi_c/libffi/man/Makefile.in +395 -0
  74. data/ext/ffi_c/libffi/man/ffi.3 +31 -0
  75. data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
  76. data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +66 -0
  77. data/ext/ffi_c/libffi/mdate-sh +201 -0
  78. data/ext/ffi_c/libffi/missing +353 -0
  79. data/ext/ffi_c/libffi/mkinstalldirs +158 -0
  80. data/ext/ffi_c/libffi/src/alpha/ffi.c +284 -0
  81. data/ext/ffi_c/libffi/src/alpha/ffitarget.h +48 -0
  82. data/ext/ffi_c/libffi/src/alpha/osf.S +366 -0
  83. data/ext/ffi_c/libffi/src/arm/ffi.c +309 -0
  84. data/ext/ffi_c/libffi/src/arm/ffitarget.h +49 -0
  85. data/ext/ffi_c/libffi/src/arm/sysv.S +299 -0
  86. data/ext/ffi_c/libffi/src/closures.c +596 -0
  87. data/ext/ffi_c/libffi/src/cris/ffi.c +383 -0
  88. data/ext/ffi_c/libffi/src/cris/ffitarget.h +51 -0
  89. data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
  90. data/ext/ffi_c/libffi/src/debug.c +59 -0
  91. data/ext/ffi_c/libffi/src/dlmalloc.c +5099 -0
  92. data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
  93. data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
  94. data/ext/ffi_c/libffi/src/frv/ffitarget.h +61 -0
  95. data/ext/ffi_c/libffi/src/ia64/ffi.c +580 -0
  96. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +50 -0
  97. data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
  98. data/ext/ffi_c/libffi/src/ia64/unix.S +560 -0
  99. data/ext/ffi_c/libffi/src/java_raw_api.c +359 -0
  100. data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
  101. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +48 -0
  102. data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
  103. data/ext/ffi_c/libffi/src/m68k/ffi.c +278 -0
  104. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +49 -0
  105. data/ext/ffi_c/libffi/src/m68k/sysv.S +234 -0
  106. data/ext/ffi_c/libffi/src/mips/ffi.c +926 -0
  107. data/ext/ffi_c/libffi/src/mips/ffitarget.h +202 -0
  108. data/ext/ffi_c/libffi/src/mips/n32.S +534 -0
  109. data/ext/ffi_c/libffi/src/mips/o32.S +381 -0
  110. data/ext/ffi_c/libffi/src/pa/ffi.c +709 -0
  111. data/ext/ffi_c/libffi/src/pa/ffitarget.h +77 -0
  112. data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
  113. data/ext/ffi_c/libffi/src/pa/linux.S +357 -0
  114. data/ext/ffi_c/libffi/src/powerpc/aix.S +225 -0
  115. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +247 -0
  116. data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
  117. data/ext/ffi_c/libffi/src/powerpc/darwin.S +245 -0
  118. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +317 -0
  119. data/ext/ffi_c/libffi/src/powerpc/ffi.c +1429 -0
  120. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +800 -0
  121. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +118 -0
  122. data/ext/ffi_c/libffi/src/powerpc/linux64.S +187 -0
  123. data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +236 -0
  124. data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +327 -0
  125. data/ext/ffi_c/libffi/src/powerpc/sysv.S +230 -0
  126. data/ext/ffi_c/libffi/src/prep_cif.c +174 -0
  127. data/ext/ffi_c/libffi/src/raw_api.c +254 -0
  128. data/ext/ffi_c/libffi/src/s390/ffi.c +780 -0
  129. data/ext/ffi_c/libffi/src/s390/ffitarget.h +60 -0
  130. data/ext/ffi_c/libffi/src/s390/sysv.S +434 -0
  131. data/ext/ffi_c/libffi/src/sh/ffi.c +716 -0
  132. data/ext/ffi_c/libffi/src/sh/ffitarget.h +49 -0
  133. data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
  134. data/ext/ffi_c/libffi/src/sh64/ffi.c +453 -0
  135. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +53 -0
  136. data/ext/ffi_c/libffi/src/sh64/sysv.S +530 -0
  137. data/ext/ffi_c/libffi/src/sparc/ffi.c +610 -0
  138. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +66 -0
  139. data/ext/ffi_c/libffi/src/sparc/v8.S +272 -0
  140. data/ext/ffi_c/libffi/src/sparc/v9.S +307 -0
  141. data/ext/ffi_c/libffi/src/types.c +77 -0
  142. data/ext/ffi_c/libffi/src/x86/darwin.S +443 -0
  143. data/ext/ffi_c/libffi/src/x86/darwin64.S +416 -0
  144. data/ext/ffi_c/libffi/src/x86/ffi.c +475 -0
  145. data/ext/ffi_c/libffi/src/x86/ffi64.c +572 -0
  146. data/ext/ffi_c/libffi/src/x86/ffitarget.h +90 -0
  147. data/ext/ffi_c/libffi/src/x86/freebsd.S +458 -0
  148. data/ext/ffi_c/libffi/src/x86/sysv.S +437 -0
  149. data/ext/ffi_c/libffi/src/x86/unix64.S +418 -0
  150. data/ext/ffi_c/libffi/src/x86/win32.S +391 -0
  151. data/ext/ffi_c/libffi/testsuite/Makefile.am +71 -0
  152. data/ext/ffi_c/libffi/testsuite/Makefile.in +447 -0
  153. data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
  154. data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +289 -0
  155. data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +263 -0
  156. data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
  157. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +36 -0
  158. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +97 -0
  159. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +89 -0
  160. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +89 -0
  161. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +90 -0
  162. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +97 -0
  163. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +99 -0
  164. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +98 -0
  165. data/ext/ffi_c/libffi/testsuite/libffi.call/closure_stdcall.c +72 -0
  166. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +102 -0
  167. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +103 -0
  168. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +104 -0
  169. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +110 -0
  170. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +97 -0
  171. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +99 -0
  172. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +101 -0
  173. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +121 -0
  174. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +98 -0
  175. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +103 -0
  176. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +98 -0
  177. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +98 -0
  178. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +106 -0
  179. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +98 -0
  180. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +117 -0
  181. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +106 -0
  182. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +132 -0
  183. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +121 -0
  184. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +107 -0
  185. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +125 -0
  186. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +105 -0
  187. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +96 -0
  188. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +98 -0
  189. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +99 -0
  190. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +101 -0
  191. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +99 -0
  192. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +100 -0
  193. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +101 -0
  194. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +99 -0
  195. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +99 -0
  196. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +99 -0
  197. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +99 -0
  198. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +99 -0
  199. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +100 -0
  200. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +51 -0
  201. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +51 -0
  202. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +82 -0
  203. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +82 -0
  204. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +94 -0
  205. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +99 -0
  206. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +82 -0
  207. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +94 -0
  208. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +52 -0
  209. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +50 -0
  210. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +50 -0
  211. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +50 -0
  212. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +51 -0
  213. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +54 -0
  214. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +51 -0
  215. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +86 -0
  216. data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
  217. data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +58 -0
  218. data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +57 -0
  219. data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +72 -0
  220. data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
  221. data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +69 -0
  222. data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +63 -0
  223. data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +53 -0
  224. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +160 -0
  225. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +169 -0
  226. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +141 -0
  227. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +118 -0
  228. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +119 -0
  229. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +119 -0
  230. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +120 -0
  231. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +139 -0
  232. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +119 -0
  233. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +139 -0
  234. data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +139 -0
  235. data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +98 -0
  236. data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
  237. data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
  238. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +35 -0
  239. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
  240. data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
  241. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
  242. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
  243. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
  244. data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
  245. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
  246. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
  247. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +42 -0
  248. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
  249. data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
  250. data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
  251. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
  252. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
  253. data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +44 -0
  254. data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +65 -0
  255. data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
  256. data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +59 -0
  257. data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +63 -0
  258. data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +65 -0
  259. data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
  260. data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
  261. data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +80 -0
  262. data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +67 -0
  263. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +86 -0
  264. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +38 -0
  265. data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc +123 -0
  266. data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc +53 -0
  267. data/ext/ffi_c/libffi/texinfo.tex +7482 -0
  268. data/ext/ffi_c/rbffi.h +23 -0
  269. data/gen/Rakefile +12 -0
  270. data/lib/1.8/ffi_c.so +0 -0
  271. data/lib/1.9/ffi_c.so +0 -0
  272. data/lib/ffi.rb +11 -0
  273. data/lib/ffi/autopointer.rb +61 -0
  274. data/lib/ffi/buffer.rb +0 -0
  275. data/lib/ffi/callback.rb +10 -0
  276. data/lib/ffi/enum.rb +78 -0
  277. data/lib/ffi/errno.rb +8 -0
  278. data/lib/ffi/ffi.rb +96 -0
  279. data/lib/ffi/io.rb +21 -0
  280. data/lib/ffi/library.rb +243 -0
  281. data/lib/ffi/managedstruct.rb +55 -0
  282. data/lib/ffi/memorypointer.rb +73 -0
  283. data/lib/ffi/platform.rb +78 -0
  284. data/lib/ffi/pointer.rb +119 -0
  285. data/lib/ffi/struct.rb +354 -0
  286. data/lib/ffi/tools/const_generator.rb +177 -0
  287. data/lib/ffi/tools/generator.rb +58 -0
  288. data/lib/ffi/tools/generator_task.rb +35 -0
  289. data/lib/ffi/tools/struct_generator.rb +194 -0
  290. data/lib/ffi/tools/types_generator.rb +123 -0
  291. data/lib/ffi/types.rb +153 -0
  292. data/lib/ffi/union.rb +17 -0
  293. data/lib/ffi/variadic.rb +30 -0
  294. data/spec/ffi/bool_spec.rb +24 -0
  295. data/spec/ffi/buffer_spec.rb +196 -0
  296. data/spec/ffi/callback_spec.rb +560 -0
  297. data/spec/ffi/enum_spec.rb +164 -0
  298. data/spec/ffi/errno_spec.rb +13 -0
  299. data/spec/ffi/library_spec.rb +144 -0
  300. data/spec/ffi/managed_struct_spec.rb +56 -0
  301. data/spec/ffi/number_spec.rb +231 -0
  302. data/spec/ffi/pointer_spec.rb +195 -0
  303. data/spec/ffi/rbx/attach_function_spec.rb +27 -0
  304. data/spec/ffi/rbx/memory_pointer_spec.rb +102 -0
  305. data/spec/ffi/rbx/spec_helper.rb +1 -0
  306. data/spec/ffi/rbx/struct_spec.rb +13 -0
  307. data/spec/ffi/spec_helper.rb +17 -0
  308. data/spec/ffi/string_spec.rb +103 -0
  309. data/spec/ffi/struct_callback_spec.rb +41 -0
  310. data/spec/ffi/struct_initialize_spec.rb +30 -0
  311. data/spec/ffi/struct_spec.rb +476 -0
  312. data/spec/ffi/typedef_spec.rb +48 -0
  313. data/spec/ffi/union_spec.rb +60 -0
  314. data/spec/ffi/variadic_spec.rb +84 -0
  315. data/spec/spec.opts +4 -0
  316. metadata +375 -0
@@ -0,0 +1,323 @@
1
+ #!/bin/sh
2
+ # install - install a program, script, or datafile
3
+
4
+ scriptversion=2004-12-17.09
5
+
6
+ # This originates from X11R5 (mit/util/scripts/install.sh), which was
7
+ # later released in X11R6 (xc/config/util/install.sh) with the
8
+ # following copyright and license.
9
+ #
10
+ # Copyright (C) 1994 X Consortium
11
+ #
12
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ # of this software and associated documentation files (the "Software"), to
14
+ # deal in the Software without restriction, including without limitation the
15
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16
+ # sell copies of the Software, and to permit persons to whom the Software is
17
+ # furnished to do so, subject to the following conditions:
18
+ #
19
+ # The above copyright notice and this permission notice shall be included in
20
+ # all copies or substantial portions of the Software.
21
+ #
22
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26
+ # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
27
+ # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
+ #
29
+ # Except as contained in this notice, the name of the X Consortium shall not
30
+ # be used in advertising or otherwise to promote the sale, use or other deal-
31
+ # ings in this Software without prior written authorization from the X Consor-
32
+ # tium.
33
+ #
34
+ #
35
+ # FSF changes to this file are in the public domain.
36
+ #
37
+ # Calling this script install-sh is preferred over install.sh, to prevent
38
+ # `make' implicit rules from creating a file called install from it
39
+ # when there is no Makefile.
40
+ #
41
+ # This script is compatible with the BSD install script, but was written
42
+ # from scratch. It can only install one file at a time, a restriction
43
+ # shared with many OS's install programs.
44
+
45
+ # set DOITPROG to echo to test this script
46
+
47
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
48
+ doit="${DOITPROG-}"
49
+
50
+ # put in absolute paths if you don't have them in your path; or use env. vars.
51
+
52
+ mvprog="${MVPROG-mv}"
53
+ cpprog="${CPPROG-cp}"
54
+ chmodprog="${CHMODPROG-chmod}"
55
+ chownprog="${CHOWNPROG-chown}"
56
+ chgrpprog="${CHGRPPROG-chgrp}"
57
+ stripprog="${STRIPPROG-strip}"
58
+ rmprog="${RMPROG-rm}"
59
+ mkdirprog="${MKDIRPROG-mkdir}"
60
+
61
+ chmodcmd="$chmodprog 0755"
62
+ chowncmd=
63
+ chgrpcmd=
64
+ stripcmd=
65
+ rmcmd="$rmprog -f"
66
+ mvcmd="$mvprog"
67
+ src=
68
+ dst=
69
+ dir_arg=
70
+ dstarg=
71
+ no_target_directory=
72
+
73
+ usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
74
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
75
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
76
+ or: $0 [OPTION]... -d DIRECTORIES...
77
+
78
+ In the 1st form, copy SRCFILE to DSTFILE.
79
+ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
80
+ In the 4th, create DIRECTORIES.
81
+
82
+ Options:
83
+ -c (ignored)
84
+ -d create directories instead of installing files.
85
+ -g GROUP $chgrpprog installed files to GROUP.
86
+ -m MODE $chmodprog installed files to MODE.
87
+ -o USER $chownprog installed files to USER.
88
+ -s $stripprog installed files.
89
+ -t DIRECTORY install into DIRECTORY.
90
+ -T report an error if DSTFILE is a directory.
91
+ --help display this help and exit.
92
+ --version display version info and exit.
93
+
94
+ Environment variables override the default commands:
95
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
96
+ "
97
+
98
+ while test -n "$1"; do
99
+ case $1 in
100
+ -c) shift
101
+ continue;;
102
+
103
+ -d) dir_arg=true
104
+ shift
105
+ continue;;
106
+
107
+ -g) chgrpcmd="$chgrpprog $2"
108
+ shift
109
+ shift
110
+ continue;;
111
+
112
+ --help) echo "$usage"; exit 0;;
113
+
114
+ -m) chmodcmd="$chmodprog $2"
115
+ shift
116
+ shift
117
+ continue;;
118
+
119
+ -o) chowncmd="$chownprog $2"
120
+ shift
121
+ shift
122
+ continue;;
123
+
124
+ -s) stripcmd=$stripprog
125
+ shift
126
+ continue;;
127
+
128
+ -t) dstarg=$2
129
+ shift
130
+ shift
131
+ continue;;
132
+
133
+ -T) no_target_directory=true
134
+ shift
135
+ continue;;
136
+
137
+ --version) echo "$0 $scriptversion"; exit 0;;
138
+
139
+ *) # When -d is used, all remaining arguments are directories to create.
140
+ # When -t is used, the destination is already specified.
141
+ test -n "$dir_arg$dstarg" && break
142
+ # Otherwise, the last argument is the destination. Remove it from $@.
143
+ for arg
144
+ do
145
+ if test -n "$dstarg"; then
146
+ # $@ is not empty: it contains at least $arg.
147
+ set fnord "$@" "$dstarg"
148
+ shift # fnord
149
+ fi
150
+ shift # arg
151
+ dstarg=$arg
152
+ done
153
+ break;;
154
+ esac
155
+ done
156
+
157
+ if test -z "$1"; then
158
+ if test -z "$dir_arg"; then
159
+ echo "$0: no input file specified." >&2
160
+ exit 1
161
+ fi
162
+ # It's OK to call `install-sh -d' without argument.
163
+ # This can happen when creating conditional directories.
164
+ exit 0
165
+ fi
166
+
167
+ for src
168
+ do
169
+ # Protect names starting with `-'.
170
+ case $src in
171
+ -*) src=./$src ;;
172
+ esac
173
+
174
+ if test -n "$dir_arg"; then
175
+ dst=$src
176
+ src=
177
+
178
+ if test -d "$dst"; then
179
+ mkdircmd=:
180
+ chmodcmd=
181
+ else
182
+ mkdircmd=$mkdirprog
183
+ fi
184
+ else
185
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
186
+ # might cause directories to be created, which would be especially bad
187
+ # if $src (and thus $dsttmp) contains '*'.
188
+ if test ! -f "$src" && test ! -d "$src"; then
189
+ echo "$0: $src does not exist." >&2
190
+ exit 1
191
+ fi
192
+
193
+ if test -z "$dstarg"; then
194
+ echo "$0: no destination specified." >&2
195
+ exit 1
196
+ fi
197
+
198
+ dst=$dstarg
199
+ # Protect names starting with `-'.
200
+ case $dst in
201
+ -*) dst=./$dst ;;
202
+ esac
203
+
204
+ # If destination is a directory, append the input filename; won't work
205
+ # if double slashes aren't ignored.
206
+ if test -d "$dst"; then
207
+ if test -n "$no_target_directory"; then
208
+ echo "$0: $dstarg: Is a directory" >&2
209
+ exit 1
210
+ fi
211
+ dst=$dst/`basename "$src"`
212
+ fi
213
+ fi
214
+
215
+ # This sed command emulates the dirname command.
216
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
217
+
218
+ # Make sure that the destination directory exists.
219
+
220
+ # Skip lots of stat calls in the usual case.
221
+ if test ! -d "$dstdir"; then
222
+ defaultIFS='
223
+ '
224
+ IFS="${IFS-$defaultIFS}"
225
+
226
+ oIFS=$IFS
227
+ # Some sh's can't handle IFS=/ for some reason.
228
+ IFS='%'
229
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
230
+ shift
231
+ IFS=$oIFS
232
+
233
+ pathcomp=
234
+
235
+ while test $# -ne 0 ; do
236
+ pathcomp=$pathcomp$1
237
+ shift
238
+ if test ! -d "$pathcomp"; then
239
+ $mkdirprog "$pathcomp"
240
+ # mkdir can fail with a `File exist' error in case several
241
+ # install-sh are creating the directory concurrently. This
242
+ # is OK.
243
+ test -d "$pathcomp" || exit
244
+ fi
245
+ pathcomp=$pathcomp/
246
+ done
247
+ fi
248
+
249
+ if test -n "$dir_arg"; then
250
+ $doit $mkdircmd "$dst" \
251
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
252
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
253
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
254
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
255
+
256
+ else
257
+ dstfile=`basename "$dst"`
258
+
259
+ # Make a couple of temp file names in the proper directory.
260
+ dsttmp=$dstdir/_inst.$$_
261
+ rmtmp=$dstdir/_rm.$$_
262
+
263
+ # Trap to clean up those temp files at exit.
264
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
265
+ trap '(exit $?); exit' 1 2 13 15
266
+
267
+ # Copy the file name to the temp name.
268
+ $doit $cpprog "$src" "$dsttmp" &&
269
+
270
+ # and set any options; do chmod last to preserve setuid bits.
271
+ #
272
+ # If any of these fail, we abort the whole thing. If we want to
273
+ # ignore errors from any of these, just make sure not to ignore
274
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
275
+ #
276
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
277
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
278
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
279
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
280
+
281
+ # Now rename the file to the real destination.
282
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
283
+ || {
284
+ # The rename failed, perhaps because mv can't rename something else
285
+ # to itself, or perhaps because mv is so ancient that it does not
286
+ # support -f.
287
+
288
+ # Now remove or move aside any old file at destination location.
289
+ # We try this two ways since rm can't unlink itself on some
290
+ # systems and the destination file might be busy for other
291
+ # reasons. In this case, the final cleanup might fail but the new
292
+ # file should still install successfully.
293
+ {
294
+ if test -f "$dstdir/$dstfile"; then
295
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
296
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
297
+ || {
298
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
299
+ (exit 1); exit 1
300
+ }
301
+ else
302
+ :
303
+ fi
304
+ } &&
305
+
306
+ # Now rename the file to the real destination.
307
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
308
+ }
309
+ }
310
+ fi || { (exit 1); exit 1; }
311
+ done
312
+
313
+ # The final little trick to "correctly" pass the exit status to the exit trap.
314
+ {
315
+ (exit 0); exit 0
316
+ }
317
+
318
+ # Local variables:
319
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
320
+ # time-stamp-start: "scriptversion="
321
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
322
+ # time-stamp-end: "$"
323
+ # End:
@@ -0,0 +1,10 @@
1
+ prefix=@prefix@
2
+ exec_prefix=@exec_prefix@
3
+ libdir=@libdir@
4
+ includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include
5
+
6
+ Name: @PACKAGE_NAME@
7
+ Description: Library supporting Foreign Function Interfaces
8
+ Version: @PACKAGE_VERSION@
9
+ Libs: -L${libdir} -lffi
10
+ Cflags: -I${includedir}
@@ -0,0 +1,29 @@
1
+ # This file is used to maintain libtool version info for libffi. See
2
+ # the libtool manual to understand the meaning of the fields. This is
3
+ # a separate file so that version updates don't involve re-running
4
+ # automake.
5
+ #
6
+ # Here are a set of rules to help you update your library version
7
+ # information:
8
+ #
9
+ # 1. Start with version information of `0:0:0' for each libtool library.
10
+ #
11
+ # 2. Update the version information only immediately before a public
12
+ # release of your software. More frequent updates are unnecessary,
13
+ # and only guarantee that the current interface number gets larger
14
+ # faster.
15
+ #
16
+ # 3. If the library source code has changed at all since the last
17
+ # update, then increment revision (`c:r:a' becomes `c:r+1:a').
18
+ #
19
+ # 4. If any interfaces have been added, removed, or changed since the
20
+ # last update, increment current, and set revision to 0.
21
+ #
22
+ # 5. If any interfaces have been added since the last public release,
23
+ # then increment age.
24
+ #
25
+ # 6. If any interfaces have been removed since the last public
26
+ # release, then set age to 0.
27
+ #
28
+ # CURRENT:REVISION:AGE
29
+ 5:7:0
@@ -0,0 +1,861 @@
1
+ #### This script is meant to be sourced by ltconfig.
2
+
3
+ # ltcf-c.sh - Create a C compiler specific configuration
4
+ #
5
+ # Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
6
+ # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
+ #
8
+ # This file is free software; you can redistribute it and/or modify it
9
+ # under the terms of the GNU General Public License as published by
10
+ # the Free Software Foundation; either version 2 of the License, or
11
+ # (at your option) any later version.
12
+ #
13
+ # This program is distributed in the hope that it will be useful, but
14
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ # General Public License for more details.
17
+ #
18
+ # You should have received a copy of the GNU General Public License
19
+ # along with this program; if not, write to the Free Software
20
+ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
+ #
22
+ # As a special exception to the GNU General Public License, if you
23
+ # distribute this file as part of a program that contains a
24
+ # configuration script generated by Autoconf, you may include it under
25
+ # the same distribution terms that you use for the rest of that program.
26
+
27
+
28
+ # Source file extension for C test sources.
29
+ ac_ext=c
30
+
31
+ # Object file extension for compiled C test sources.
32
+ objext=o
33
+
34
+ # Code to be used in simple compile tests
35
+ lt_simple_compile_test_code="int some_variable = 0;"
36
+
37
+ # Code to be used in simple link tests
38
+ lt_simple_link_test_code='main(){return(0);}'
39
+
40
+ ## Linker Characteristics
41
+ case $host_os in
42
+ cygwin* | mingw*)
43
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
44
+ # When not using gcc, we currently assume that we are using
45
+ # Microsoft Visual C++.
46
+ if test "$with_gcc" != yes; then
47
+ with_gnu_ld=no
48
+ fi
49
+ ;;
50
+
51
+ esac
52
+
53
+ ld_shlibs=yes
54
+ if test "$with_gnu_ld" = yes; then
55
+ # If archive_cmds runs LD, not CC, wlarc should be empty
56
+ wlarc='${wl}'
57
+
58
+ # See if GNU ld supports shared libraries.
59
+ case $host_os in
60
+ aix3* | aix4* | aix5*)
61
+ # On AIX/PPC, the GNU linker is very broken
62
+ if test "$host_cpu" != ia64; then
63
+ ld_shlibs=no
64
+ cat <<EOF 1>&2
65
+
66
+ *** Warning: the GNU linker, at least up to release 2.9.1, is reported
67
+ *** to be unable to reliably create shared libraries on AIX.
68
+ *** Therefore, libtool is disabling shared libraries support. If you
69
+ *** really care for shared libraries, you may want to modify your PATH
70
+ *** so that a non-GNU linker is found, and then restart.
71
+
72
+ EOF
73
+ fi
74
+ ;;
75
+
76
+ amigaos*)
77
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
78
+ hardcode_libdir_flag_spec='-L$libdir'
79
+ hardcode_minus_L=yes
80
+
81
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
82
+ # that the semantics of dynamic libraries on AmigaOS, at least up
83
+ # to version 4, is to share data among multiple programs linked
84
+ # with the same dynamic library. Since this doesn't match the
85
+ # behavior of shared libraries on other platforms, we can use
86
+ # them.
87
+ ld_shlibs=no
88
+ ;;
89
+
90
+ beos*)
91
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
92
+ allow_undefined_flag=unsupported
93
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
94
+ # support --undefined. This deserves some investigation. FIXME
95
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
96
+ else
97
+ ld_shlibs=no
98
+ fi
99
+ ;;
100
+
101
+ cygwin* | mingw*)
102
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
103
+ # no search path for DLLs.
104
+ hardcode_libdir_flag_spec='-L$libdir'
105
+ allow_undefined_flag=unsupported
106
+ always_export_symbols=yes
107
+
108
+ extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
109
+ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~
110
+ test -f $output_objdir/impgen.exe || (cd $output_objdir && \
111
+ if test "x$BUILD_CC" != "x" ; then $BUILD_CC -o impgen impgen.c ; \
112
+ else $CC -o impgen impgen.c ; fi)~
113
+ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
114
+
115
+ old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
116
+
117
+ # cygwin and mingw dlls have different entry points and sets of symbols
118
+ # to exclude.
119
+ # FIXME: what about values for MSVC?
120
+ dll_entry=__cygwin_dll_entry@12
121
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
122
+ case $host_os in
123
+ mingw*)
124
+ # mingw values
125
+ dll_entry=_DllMainCRTStartup@12
126
+ dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
127
+ ;;
128
+ esac
129
+
130
+ # mingw and cygwin differ, and it's simplest to just exclude the union
131
+ # of the two symbol sets.
132
+ dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
133
+
134
+ # recent cygwin and mingw systems supply a stub DllMain which the user
135
+ # can override, but on older systems we have to supply one (in ltdll.c)
136
+ if test "x$lt_cv_need_dllmain" = "xyes"; then
137
+ ltdll_obj='$output_objdir/$soname-ltdll.'"$objext "
138
+ ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~
139
+ test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
140
+ else
141
+ ltdll_obj=
142
+ ltdll_cmds=
143
+ fi
144
+
145
+ # Extract the symbol export list from an `--export-all' def file,
146
+ # then regenerate the def file from the symbol export list, so that
147
+ # the compiled dll only exports the symbol export list.
148
+ # Be careful not to strip the DATA tag left be newer dlltools.
149
+ export_symbols_cmds="$ltdll_cmds"'
150
+ $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
151
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
152
+
153
+ # If the export-symbols file already is a .def file (1st line
154
+ # is EXPORTS), use it as is.
155
+ # If DATA tags from a recent dlltool are present, honour them!
156
+ archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
157
+ cp $export_symbols $output_objdir/$soname-def;
158
+ else
159
+ echo EXPORTS > $output_objdir/$soname-def;
160
+ _lt_hint=1;
161
+ cat $export_symbols | while read symbol; do
162
+ set dummy \$symbol;
163
+ case \[$]# in
164
+ 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
165
+ *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
166
+ esac;
167
+ _lt_hint=`expr 1 + \$_lt_hint`;
168
+ done;
169
+ fi~
170
+ '"$ltdll_cmds"'
171
+ $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
172
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
173
+ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
174
+ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
175
+ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
176
+ ;;
177
+
178
+ netbsd* | knetbsd*-gnu)
179
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
180
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
181
+ wlarc=
182
+ else
183
+ archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
184
+ archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
185
+ fi
186
+ ;;
187
+
188
+ solaris* | sysv5*)
189
+ if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
190
+ ld_shlibs=no
191
+ cat <<EOF 1>&2
192
+
193
+ *** Warning: The releases 2.8.* of the GNU linker cannot reliably
194
+ *** create shared libraries on Solaris systems. Therefore, libtool
195
+ *** is disabling shared libraries support. We urge you to upgrade GNU
196
+ *** binutils to release 2.9.1 or newer. Another option is to modify
197
+ *** your PATH or compiler configuration so that the native linker is
198
+ *** used, and then restart.
199
+
200
+ EOF
201
+ elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
202
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
203
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
204
+ else
205
+ ld_shlibs=no
206
+ fi
207
+ ;;
208
+
209
+ sunos4*)
210
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
211
+ wlarc=
212
+ hardcode_direct=yes
213
+ hardcode_shlibpath_var=no
214
+ ;;
215
+
216
+ tpf*)
217
+ ld_shlibs=yes
218
+ ;;
219
+
220
+ *)
221
+ if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
222
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
223
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
224
+ else
225
+ ld_shlibs=no
226
+ fi
227
+ ;;
228
+ esac
229
+
230
+ if test "$ld_shlibs" = yes; then
231
+ runpath_var=LD_RUN_PATH
232
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
233
+ export_dynamic_flag_spec='${wl}--export-dynamic'
234
+ case $host_os in
235
+ cygwin* | mingw*)
236
+ # dlltool doesn't understand --whole-archive et. al.
237
+ whole_archive_flag_spec=
238
+ ;;
239
+ *)
240
+ # ancient GNU ld didn't support --whole-archive et. al.
241
+ if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
242
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
243
+ else
244
+ whole_archive_flag_spec=
245
+ fi
246
+ ;;
247
+ esac
248
+ fi
249
+ else
250
+ # PORTME fill in a description of your system's linker (not GNU ld)
251
+ case $host_os in
252
+ aix3*)
253
+ allow_undefined_flag=unsupported
254
+ always_export_symbols=yes
255
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
256
+ # Note: this linker hardcodes the directories in LIBPATH if there
257
+ # are no directories specified by -L.
258
+ hardcode_minus_L=yes
259
+ if test "$with_gcc" = yes && test -z "$link_static_flag"; then
260
+ # Neither direct hardcoding nor static linking is supported with a
261
+ # broken collect2.
262
+ hardcode_direct=unsupported
263
+ fi
264
+ ;;
265
+
266
+ aix4* | aix5*)
267
+ hardcode_direct=yes
268
+ hardcode_libdir_separator=':'
269
+ link_all_deplibs=yes
270
+ # When large executables or shared objects are built, AIX ld can
271
+ # have problems creating the table of contents. If linking a library
272
+ # or program results in "error TOC overflow" add -mminimal-toc to
273
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
274
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
275
+ if test "$with_gcc" = yes; then
276
+ case $host_os in aix4.[012]|aix4.[012].*)
277
+ # We only want to do this on AIX 4.2 and lower, the check
278
+ # below for broken collect2 doesn't work under 4.3+
279
+ collect2name=`${CC} -print-prog-name=collect2`
280
+ if test -f "$collect2name" && \
281
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
282
+ then
283
+ # We have reworked collect2
284
+ hardcode_direct=yes
285
+ else
286
+ # We have old collect2
287
+ hardcode_direct=unsupported
288
+ # It fails to find uninstalled libraries when the uninstalled
289
+ # path is not listed in the libpath. Setting hardcode_minus_L
290
+ # to unsupported forces relinking
291
+ hardcode_minus_L=yes
292
+ hardcode_libdir_flag_spec='-L$libdir'
293
+ hardcode_libdir_separator=
294
+ fi
295
+ esac
296
+ shared_flag='-shared'
297
+ else
298
+ # not using gcc
299
+ if test "$host_cpu" = ia64; then
300
+ shared_flag='${wl}-G'
301
+ else
302
+ shared_flag='${wl}-bM:SRE'
303
+ fi
304
+ fi
305
+
306
+ if test "$host_cpu" = ia64; then
307
+ # On IA64, the linker does run time linking by default, so we don't
308
+ # have to do anything special.
309
+ aix_use_runtimelinking=no
310
+ if test $with_gnu_ld = no; then
311
+ exp_sym_flag='-Bexport'
312
+ no_entry_flag=""
313
+ fi
314
+ else
315
+ # Test if we are trying to use run time linking, or normal AIX style linking.
316
+ # If -brtl is somewhere in LDFLAGS, we need to do run time linking.
317
+ aix_use_runtimelinking=no
318
+ for ld_flag in $LDFLAGS; do
319
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then
320
+ aix_use_runtimelinking=yes
321
+ break
322
+ fi
323
+ done
324
+ exp_sym_flag='-bexport'
325
+ no_entry_flag='-bnoentry'
326
+ fi
327
+ # -bexpall does not export symbols beginning with underscore (_)
328
+ always_export_symbols=yes
329
+ if test "$aix_use_runtimelinking" = yes; then
330
+ # Warning - without using the other run time loading flags (-brtl), -berok will
331
+ # link without error, but may produce a broken library.
332
+ allow_undefined_flag=' ${wl}-berok'
333
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
334
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
335
+ else
336
+ if test "$host_cpu" = ia64; then
337
+ if test $with_gnu_ld = no; then
338
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
339
+ allow_undefined_flag="-z nodefs"
340
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
341
+ fi
342
+ else
343
+ allow_undefined_flag=' ${wl}-berok'
344
+ # -bexpall does not export symbols beginning with underscore (_)
345
+ always_export_symbols=yes
346
+ # Exported symbols can be pulled into shared objects from archives
347
+ whole_archive_flag_spec=' '
348
+ build_libtool_need_lc=yes
349
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
350
+ # This is similar to how AIX traditionally builds it's shared libraries.
351
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
352
+ fi
353
+ fi
354
+ ;;
355
+
356
+ amigaos*)
357
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
358
+ hardcode_libdir_flag_spec='-L$libdir'
359
+ hardcode_minus_L=yes
360
+ # see comment about different semantics on the GNU ld section
361
+ ld_shlibs=no
362
+ ;;
363
+
364
+ cygwin* | mingw*)
365
+ # When not using gcc, we currently assume that we are using
366
+ # Microsoft Visual C++.
367
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
368
+ # no search path for DLLs.
369
+ hardcode_libdir_flag_spec=' '
370
+ allow_undefined_flag=unsupported
371
+ # Tell ltmain to make .lib files, not .a files.
372
+ libext=lib
373
+ # FIXME: Setting linknames here is a bad hack.
374
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
375
+ # The linker will automatically build a .lib file if we build a DLL.
376
+ old_archive_from_new_cmds='true'
377
+ # FIXME: Should let the user specify the lib program.
378
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
379
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
380
+ ;;
381
+
382
+ darwin* | rhapsody*)
383
+ case "$host_os" in
384
+ rhapsody* | darwin1.[[012]])
385
+ allow_undefined_flag='-undefined suppress'
386
+ ;;
387
+ *) # Darwin 1.3 on
388
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
389
+ allow_undefined_flag='-flat_namespace -undefined suppress'
390
+ else
391
+ case ${MACOSX_DEPLOYMENT_TARGET} in
392
+ 10.[[012]])
393
+ allow_undefined_flag='-flat_namespace -undefined suppress'
394
+ ;;
395
+ 10.*)
396
+ allow_undefined_flag='-undefined dynamic_lookup'
397
+ ;;
398
+ esac
399
+ fi
400
+ ;;
401
+ esac
402
+ # Disable shared library build on OS-X older than 10.3.
403
+ case $host_os in
404
+ darwin[1-6]*)
405
+ can_build_shared=no
406
+ ;;
407
+ darwin7*)
408
+ can_build_shared=yes
409
+ ;;
410
+ esac
411
+ output_verbose_link_cmd='echo'
412
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
413
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
414
+ # Don't fix this by using the ld -exported_symbols_list flag,
415
+ # it doesn't exist in older darwin ld's
416
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
417
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
418
+ hardcode_direct=no
419
+ hardcode_automatic=yes
420
+ hardcode_shlibpath_var=unsupported
421
+ whole_archive_flag_spec='-all_load $convenience'
422
+ link_all_deplibs=yes
423
+ ;;
424
+
425
+ freebsd1*)
426
+ ld_shlibs=no
427
+ ;;
428
+
429
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
430
+ # support. Future versions do this automatically, but an explicit c++rt0.o
431
+ # does not break anything, and helps significantly (at the cost of a little
432
+ # extra space).
433
+ freebsd2.2*)
434
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
435
+ hardcode_libdir_flag_spec='-R$libdir'
436
+ hardcode_direct=yes
437
+ hardcode_shlibpath_var=no
438
+ ;;
439
+
440
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
441
+ freebsd2*)
442
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
443
+ hardcode_direct=yes
444
+ hardcode_minus_L=yes
445
+ hardcode_shlibpath_var=no
446
+ ;;
447
+
448
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
449
+ freebsd* | kfreebsd*-gnu)
450
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
451
+ hardcode_libdir_flag_spec='-R$libdir'
452
+ hardcode_direct=yes
453
+ hardcode_shlibpath_var=no
454
+ ;;
455
+
456
+ hpux9* | hpux10* | hpux11*)
457
+ case "$host_cpu" in
458
+ ia64*)
459
+ hardcode_direct=no
460
+ hardcode_shlibpath_var=no
461
+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
462
+ hardcode_libdir_flag_spec='-L$libdir' ;;
463
+ *)
464
+ if test $with_gcc = yes; then
465
+ case "$host_os" in
466
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
467
+ *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;;
468
+ esac
469
+ else
470
+ case $host_os in
471
+ hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;;
472
+ *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;;
473
+ esac
474
+ fi
475
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
476
+ hardcode_libdir_separator=:
477
+ hardcode_minus_L=yes # Not in the search PATH, but as the default
478
+ # location of the library.
479
+ ;;
480
+ esac
481
+ export_dynamic_flag_spec='${wl}-E'
482
+ hardcode_direct=yes
483
+ ;;
484
+
485
+ irix5* | irix6*)
486
+ if test "$with_gcc" = yes; then
487
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
488
+ else
489
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
490
+ fi
491
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
492
+ hardcode_libdir_separator=:
493
+ link_all_deplibs=yes
494
+ ;;
495
+
496
+ netbsd* | knetbsd*-gnu)
497
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
498
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
499
+ else
500
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
501
+ fi
502
+ hardcode_libdir_flag_spec='-R$libdir'
503
+ hardcode_direct=yes
504
+ hardcode_shlibpath_var=no
505
+ ;;
506
+
507
+ newsos6)
508
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
509
+ hardcode_direct=yes
510
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
511
+ hardcode_libdir_separator=:
512
+ hardcode_shlibpath_var=no
513
+ ;;
514
+
515
+ openbsd*)
516
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
517
+ hardcode_libdir_flag_spec='-R$libdir'
518
+ hardcode_direct=yes
519
+ hardcode_shlibpath_var=no
520
+ ;;
521
+
522
+ os2*)
523
+ hardcode_libdir_flag_spec='-L$libdir'
524
+ hardcode_minus_L=yes
525
+ allow_undefined_flag=unsupported
526
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
527
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
528
+ ;;
529
+
530
+ osf3*)
531
+ if test "$with_gcc" = yes; then
532
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
533
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
534
+ else
535
+ allow_undefined_flag=' -expect_unresolved \*'
536
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
537
+ fi
538
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
539
+ hardcode_libdir_separator=:
540
+ ;;
541
+
542
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
543
+ if test "$with_gcc" = yes; then
544
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
545
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
546
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
547
+ else
548
+ allow_undefined_flag=' -expect_unresolved \*'
549
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
550
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
551
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
552
+
553
+ # cc supports -rpath directly
554
+ hardcode_libdir_flag_spec='-rpath $libdir'
555
+ fi
556
+ hardcode_libdir_separator=:
557
+ ;;
558
+
559
+ sco3.2v5*)
560
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
561
+ hardcode_shlibpath_var=no
562
+ runpath_var=LD_RUN_PATH
563
+ hardcode_runpath_var=yes
564
+ ;;
565
+
566
+ solaris*)
567
+ no_undefined_flag=' -z defs'
568
+ if test "$with_gcc" = yes; then
569
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
570
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
571
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
572
+ else
573
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
574
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
575
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
576
+ fi
577
+ hardcode_libdir_flag_spec='-R$libdir'
578
+ hardcode_shlibpath_var=no
579
+ case $host_os in
580
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
581
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
582
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
583
+ esac
584
+ link_all_deplibs=yes
585
+ ;;
586
+
587
+ sunos4*)
588
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
589
+ hardcode_libdir_flag_spec='-L$libdir'
590
+ hardcode_direct=yes
591
+ hardcode_minus_L=yes
592
+ hardcode_shlibpath_var=no
593
+ ;;
594
+
595
+ sysv4)
596
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
597
+ runpath_var='LD_RUN_PATH'
598
+ hardcode_shlibpath_var=no
599
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
600
+ ;;
601
+
602
+ sysv4.3*)
603
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
604
+ hardcode_shlibpath_var=no
605
+ export_dynamic_flag_spec='-Bexport'
606
+ ;;
607
+
608
+ sysv5*)
609
+ no_undefined_flag=' -z text'
610
+ # $CC -shared without GNU ld will not create a library from C++
611
+ # object files and a static libstdc++, better avoid it by now
612
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
613
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
614
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
615
+ hardcode_libdir_flag_spec=
616
+ hardcode_shlibpath_var=no
617
+ runpath_var='LD_RUN_PATH'
618
+ ;;
619
+
620
+ uts4*)
621
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
622
+ hardcode_libdir_flag_spec='-L$libdir'
623
+ hardcode_shlibpath_var=no
624
+ ;;
625
+
626
+ dgux*)
627
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
628
+ hardcode_libdir_flag_spec='-L$libdir'
629
+ hardcode_shlibpath_var=no
630
+ ;;
631
+
632
+ sysv4*MP*)
633
+ if test -d /usr/nec; then
634
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
635
+ hardcode_shlibpath_var=no
636
+ runpath_var=LD_RUN_PATH
637
+ hardcode_runpath_var=yes
638
+ ld_shlibs=yes
639
+ fi
640
+ ;;
641
+
642
+ sysv4.2uw2*)
643
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
644
+ hardcode_direct=yes
645
+ hardcode_minus_L=no
646
+ hardcode_shlibpath_var=no
647
+ hardcode_runpath_var=yes
648
+ runpath_var=LD_RUN_PATH
649
+ ;;
650
+
651
+ sysv5uw7* | unixware7*)
652
+ no_undefined_flag='${wl}-z ${wl}text'
653
+ if test "$GCC" = yes; then
654
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
655
+ else
656
+ archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
657
+ fi
658
+ runpath_var='LD_RUN_PATH'
659
+ hardcode_shlibpath_var=no
660
+ ;;
661
+
662
+ *)
663
+ ld_shlibs=no
664
+ ;;
665
+ esac
666
+ fi
667
+
668
+ ## Compiler Characteristics: PIC flags, static flags, etc
669
+ if test "X${ac_cv_prog_cc_pic+set}" = Xset; then
670
+ :
671
+ else
672
+ ac_cv_prog_cc_pic=
673
+ ac_cv_prog_cc_shlib=
674
+ ac_cv_prog_cc_wl=
675
+ ac_cv_prog_cc_static=
676
+ ac_cv_prog_cc_no_builtin=
677
+ ac_cv_prog_cc_can_build_shared=$can_build_shared
678
+
679
+ if test "$with_gcc" = yes; then
680
+ ac_cv_prog_cc_wl='-Wl,'
681
+ ac_cv_prog_cc_static='-static'
682
+
683
+ case $host_os in
684
+ aix*)
685
+ # All AIX code is PIC.
686
+ if test "$host_cpu" = ia64; then
687
+ # AIX 5 now supports IA64 processor
688
+ lt_cv_prog_cc_static='-Bstatic'
689
+ else
690
+ lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp'
691
+ fi
692
+ ;;
693
+ amigaos*)
694
+ # FIXME: we need at least 68020 code to build shared libraries, but
695
+ # adding the `-m68020' flag to GCC prevents building anything better,
696
+ # like `-m68040'.
697
+ ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
698
+ ;;
699
+ beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
700
+ # PIC is the default for these OSes.
701
+ ;;
702
+ cygwin* | mingw* | os2*)
703
+ # This hack is so that the source file can tell whether it is being
704
+ # built for inclusion in a dll (and should export symbols for example).
705
+ ac_cv_prog_cc_pic='-DDLL_EXPORT'
706
+ ;;
707
+ darwin* | rhapsody*)
708
+ # PIC is the default on this platform
709
+ # Common symbols not allowed in MH_DYLIB files
710
+ ac_cv_prog_cc_pic='-fno-common'
711
+ ;;
712
+ *djgpp*)
713
+ # DJGPP does not support shared libraries at all
714
+ ac_cv_prog_cc_pic=
715
+ ;;
716
+ sysv4*MP*)
717
+ if test -d /usr/nec; then
718
+ ac_cv_prog_cc_pic=-Kconform_pic
719
+ fi
720
+ ;;
721
+ *)
722
+ ac_cv_prog_cc_pic='-fPIC'
723
+ ;;
724
+ esac
725
+ else
726
+ # PORTME Check for PIC flags for the system compiler.
727
+ case $host_os in
728
+ aix*)
729
+ # All AIX code is PIC.
730
+ ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC"
731
+ ;;
732
+
733
+ hpux9* | hpux10* | hpux11*)
734
+ # Is there a better ac_cv_prog_cc_static that works with the bundled CC?
735
+ ac_cv_prog_cc_wl='-Wl,'
736
+ ac_cv_prog_cc_static="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
737
+ ac_cv_prog_cc_pic='+Z'
738
+ ;;
739
+
740
+ irix5* | irix6*)
741
+ ac_cv_prog_cc_wl='-Wl,'
742
+ ac_cv_prog_cc_static='-non_shared'
743
+ # PIC (with -KPIC) is the default.
744
+ ;;
745
+
746
+ cygwin* | mingw* | os2*)
747
+ # This hack is so that the source file can tell whether it is being
748
+ # built for inclusion in a dll (and should export symbols for example).
749
+ ac_cv_prog_cc_pic='-DDLL_EXPORT'
750
+ ;;
751
+
752
+ newsos6)
753
+ ac_cv_prog_cc_pic='-KPIC'
754
+ ac_cv_prog_cc_static='-Bstatic'
755
+ ;;
756
+
757
+ osf3* | osf4* | osf5*)
758
+ # All OSF/1 code is PIC.
759
+ ac_cv_prog_cc_wl='-Wl,'
760
+ ac_cv_prog_cc_static='-non_shared'
761
+ ;;
762
+
763
+ sco3.2v5*)
764
+ ac_cv_prog_cc_pic='-Kpic'
765
+ ac_cv_prog_cc_static='-dn'
766
+ ac_cv_prog_cc_shlib='-belf'
767
+ ;;
768
+
769
+ solaris*)
770
+ ac_cv_prog_cc_pic='-KPIC'
771
+ ac_cv_prog_cc_static='-Bstatic'
772
+ ac_cv_prog_cc_wl='-Wl,'
773
+ ;;
774
+
775
+ sunos4*)
776
+ ac_cv_prog_cc_pic='-PIC'
777
+ ac_cv_prog_cc_static='-Bstatic'
778
+ ac_cv_prog_cc_wl='-Qoption ld '
779
+ ;;
780
+
781
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
782
+ ac_cv_prog_cc_pic='-KPIC'
783
+ ac_cv_prog_cc_static='-Bstatic'
784
+ ac_cv_prog_cc_wl='-Wl,'
785
+ ;;
786
+
787
+ uts4*)
788
+ ac_cv_prog_cc_pic='-pic'
789
+ ac_cv_prog_cc_static='-Bstatic'
790
+ ;;
791
+
792
+ sysv4*MP*)
793
+ if test -d /usr/nec ;then
794
+ ac_cv_prog_cc_pic='-Kconform_pic'
795
+ ac_cv_prog_cc_static='-Bstatic'
796
+ fi
797
+ ;;
798
+
799
+ *)
800
+ ac_cv_prog_cc_can_build_shared=no
801
+ ;;
802
+ esac
803
+ fi
804
+ case "$host_os" in
805
+ # Platforms which do not suport PIC and -DPIC is meaningless
806
+ # on them:
807
+ *djgpp*)
808
+ ac_cv_prog_cc_pic=
809
+ ;;
810
+ *)
811
+ ac_cv_prog_cc_pic="$ac_cv_prog_cc_pic -DPIC"
812
+ ;;
813
+ esac
814
+ fi
815
+
816
+ need_lc=yes
817
+ if test "$enable_shared" = yes && test "$with_gcc" = yes; then
818
+ case $archive_cmds in
819
+ *'~'*)
820
+ # FIXME: we may have to deal with multi-command sequences.
821
+ ;;
822
+ '$CC '*)
823
+ # Test whether the compiler implicitly links with -lc since on some
824
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
825
+ # to ld, don't add -lc before -lgcc.
826
+ echo $ac_n "checking whether -lc should be explicitly linked in... $ac_c" 1>&6
827
+ if eval "test \"`echo '$''{'ac_cv_archive_cmds_needs_lc'+set}'`\" = set"; then
828
+ echo $ac_n "(cached) $ac_c" 1>&6
829
+ need_lc=$ac_cv_archive_cmds_needs_lc
830
+ else
831
+ $rm conftest*
832
+ echo "static int dummy;" > conftest.$ac_ext
833
+ if { (eval echo ltcf-c.sh:need_lc: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
834
+ # Append any warnings to the config.log.
835
+ cat conftest.err 1>&5
836
+ soname=conftest
837
+ lib=conftest
838
+ libobjs=conftest.$objext
839
+ deplibs=
840
+ wl=$ac_cv_prog_cc_wl
841
+ compiler_flags=-v
842
+ linker_flags=-v
843
+ verstring=
844
+ output_objdir=.
845
+ libname=conftest
846
+ save_allow_undefined_flag=$allow_undefined_flag
847
+ allow_undefined_flag=
848
+ if { (eval echo ltcf-c.sh:need_lc: \"$archive_cmds\") 1>&5; (eval $archive_cmds) 2>&1 | grep " -lc " 1>&5 ; }; then
849
+ need_lc=no
850
+ fi
851
+ allow_undefined_flag=$save_allow_undefined_flag
852
+ else
853
+ cat conftest.err 1>&5
854
+ fi
855
+ fi
856
+ $rm conftest*
857
+ echo "$ac_t$need_lc" 1>&6
858
+ ;;
859
+ esac
860
+ fi
861
+ ac_cv_archive_cmds_needs_lc=$need_lc