ffi 1.0.9-x86-mingw32 → 1.0.12.pre-x86-mingw32

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 (218) hide show
  1. data/Rakefile +16 -16
  2. data/ext/ffi_c/AbstractMemory.c +376 -14
  3. data/ext/ffi_c/AbstractMemory.h +8 -0
  4. data/ext/ffi_c/ArrayType.c +28 -0
  5. data/ext/ffi_c/Buffer.c +109 -25
  6. data/ext/ffi_c/Call.c +16 -5
  7. data/ext/ffi_c/ClosurePool.c +21 -8
  8. data/ext/ffi_c/DataConverter.c +29 -0
  9. data/ext/ffi_c/DynamicLibrary.c +71 -2
  10. data/ext/ffi_c/Function.c +122 -11
  11. data/ext/ffi_c/Function.h +6 -0
  12. data/ext/ffi_c/FunctionInfo.c +21 -1
  13. data/ext/ffi_c/LastError.c +24 -0
  14. data/ext/ffi_c/MappedType.c +22 -0
  15. data/ext/ffi_c/MemoryPointer.c +19 -1
  16. data/ext/ffi_c/MemoryPointer.h +6 -0
  17. data/ext/ffi_c/MethodHandle.c +26 -11
  18. data/ext/ffi_c/Platform.c +17 -3
  19. data/ext/ffi_c/Pointer.c +106 -0
  20. data/ext/ffi_c/Pointer.h +6 -0
  21. data/ext/ffi_c/Struct.c +10 -4
  22. data/ext/ffi_c/Struct.h +2 -1
  23. data/ext/ffi_c/StructByReference.c +8 -0
  24. data/ext/ffi_c/StructByValue.c +8 -0
  25. data/ext/ffi_c/StructLayout.c +8 -2
  26. data/ext/ffi_c/Thread.c +131 -1
  27. data/ext/ffi_c/Thread.h +6 -0
  28. data/ext/ffi_c/Type.c +111 -17
  29. data/ext/ffi_c/Types.c +9 -2
  30. data/ext/ffi_c/Types.h +4 -0
  31. data/ext/ffi_c/Variadic.c +13 -4
  32. data/ext/ffi_c/compat.h +8 -0
  33. data/ext/ffi_c/endian.h +10 -1
  34. data/ext/ffi_c/extconf.rb +51 -35
  35. data/ext/ffi_c/ffi.c +5 -0
  36. data/ext/ffi_c/libffi.darwin.mk +15 -15
  37. data/ext/ffi_c/libffi.gnu.mk +3 -3
  38. data/ext/ffi_c/libffi.mk +4 -4
  39. data/ext/ffi_c/libffi.vc.mk +26 -0
  40. data/ext/ffi_c/libffi.vc64.mk +26 -0
  41. data/ext/ffi_c/libffi/ChangeLog +541 -0
  42. data/ext/ffi_c/libffi/ChangeLog.libffi +13 -87
  43. data/ext/ffi_c/libffi/LICENSE +3 -3
  44. data/ext/ffi_c/libffi/Makefile.am +41 -32
  45. data/ext/ffi_c/libffi/Makefile.in +95 -66
  46. data/ext/ffi_c/libffi/Makefile.vc +141 -0
  47. data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
  48. data/ext/ffi_c/libffi/README +40 -4
  49. data/ext/ffi_c/libffi/aclocal.m4 +729 -7854
  50. data/ext/ffi_c/libffi/build-ios.sh +67 -0
  51. data/ext/ffi_c/libffi/compile +11 -10
  52. data/ext/ffi_c/libffi/config.guess +4 -1
  53. data/ext/ffi_c/libffi/config.sub +6 -3
  54. data/ext/ffi_c/libffi/configure +6264 -6354
  55. data/ext/ffi_c/libffi/configure.ac +155 -63
  56. data/ext/ffi_c/libffi/depcomp +81 -35
  57. data/ext/ffi_c/libffi/doc/libffi.info +78 -18
  58. data/ext/ffi_c/libffi/doc/libffi.texi +64 -5
  59. data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
  60. data/ext/ffi_c/libffi/doc/version.texi +4 -4
  61. data/ext/ffi_c/libffi/fficonfig.h.in +18 -0
  62. data/ext/ffi_c/libffi/fficonfig.hw +57 -0
  63. data/ext/ffi_c/libffi/include/Makefile.in +21 -3
  64. data/ext/ffi_c/libffi/include/ffi.h.in +42 -14
  65. data/ext/ffi_c/libffi/include/ffi.h.vc +427 -0
  66. data/ext/ffi_c/libffi/include/ffi.h.vc64 +427 -0
  67. data/ext/ffi_c/libffi/include/ffi_common.h +9 -5
  68. data/ext/ffi_c/libffi/install-sh +364 -167
  69. data/ext/ffi_c/libffi/ltmain.sh +2599 -1369
  70. data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +176 -0
  71. data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +195 -0
  72. data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +76 -0
  73. data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +63 -0
  74. data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
  75. data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +300 -0
  76. data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +215 -0
  77. data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +79 -0
  78. data/ext/ffi_c/libffi/m4/libtool.m4 +1239 -768
  79. data/ext/ffi_c/libffi/m4/ltoptions.m4 +7 -6
  80. data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
  81. data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +9 -3
  82. data/ext/ffi_c/libffi/man/Makefile.in +21 -3
  83. data/ext/ffi_c/libffi/mdate-sh +0 -0
  84. data/ext/ffi_c/libffi/missing +60 -44
  85. data/ext/ffi_c/libffi/msvcc.sh +197 -0
  86. data/ext/ffi_c/libffi/src/alpha/osf.S +39 -18
  87. data/ext/ffi_c/libffi/src/arm/ffi.c +443 -24
  88. data/ext/ffi_c/libffi/src/arm/ffitarget.h +17 -1
  89. data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
  90. data/ext/ffi_c/libffi/src/arm/sysv.S +206 -15
  91. data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
  92. data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
  93. data/ext/ffi_c/libffi/src/avr32/ffitarget.h +2 -2
  94. data/ext/ffi_c/libffi/src/closures.c +17 -35
  95. data/ext/ffi_c/libffi/src/cris/ffi.c +1 -1
  96. data/ext/ffi_c/libffi/src/cris/ffitarget.h +2 -2
  97. data/ext/ffi_c/libffi/src/dlmalloc.c +66 -4
  98. data/ext/ffi_c/libffi/src/frv/ffitarget.h +2 -6
  99. data/ext/ffi_c/libffi/src/ia64/ffi.c +7 -5
  100. data/ext/ffi_c/libffi/src/ia64/ffitarget.h +2 -2
  101. data/ext/ffi_c/libffi/src/java_raw_api.c +1 -1
  102. data/ext/ffi_c/libffi/src/m32r/ffitarget.h +2 -2
  103. data/ext/ffi_c/libffi/src/m68k/ffi.c +10 -0
  104. data/ext/ffi_c/libffi/src/m68k/ffitarget.h +2 -2
  105. data/ext/ffi_c/libffi/src/m68k/sysv.S +36 -0
  106. data/ext/ffi_c/libffi/src/mips/ffi.c +12 -5
  107. data/ext/ffi_c/libffi/src/mips/ffitarget.h +18 -11
  108. data/ext/ffi_c/libffi/src/mips/n32.S +4 -4
  109. data/ext/ffi_c/libffi/src/moxie/eabi.S +128 -0
  110. data/ext/ffi_c/libffi/src/moxie/ffi.c +276 -0
  111. data/ext/ffi_c/libffi/src/pa/ffi.c +7 -4
  112. data/ext/ffi_c/libffi/src/pa/ffitarget.h +6 -5
  113. data/ext/ffi_c/libffi/src/powerpc/aix.S +5 -1
  114. data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +2 -0
  115. data/ext/ffi_c/libffi/src/powerpc/asm.h +1 -1
  116. data/ext/ffi_c/libffi/src/powerpc/darwin.S +215 -77
  117. data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +358 -100
  118. data/ext/ffi_c/libffi/src/powerpc/ffi.c +11 -5
  119. data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +603 -172
  120. data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +17 -4
  121. data/ext/ffi_c/libffi/src/prep_cif.c +16 -13
  122. data/ext/ffi_c/libffi/src/s390/ffitarget.h +4 -2
  123. data/ext/ffi_c/libffi/src/sh/ffitarget.h +2 -2
  124. data/ext/ffi_c/libffi/src/sh64/ffitarget.h +2 -2
  125. data/ext/ffi_c/libffi/src/sparc/ffi.c +55 -11
  126. data/ext/ffi_c/libffi/src/sparc/ffitarget.h +5 -3
  127. data/ext/ffi_c/libffi/src/x86/ffi.c +54 -92
  128. data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
  129. data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -14
  130. data/ext/ffi_c/libffi/src/x86/sysv.S +40 -26
  131. data/ext/ffi_c/libffi/src/x86/unix64.S +4 -0
  132. data/ext/ffi_c/libffi/src/x86/win32.S +379 -191
  133. data/ext/ffi_c/libffi/src/x86/win64.S +15 -7
  134. data/ext/ffi_c/libffi/testsuite/Makefile.am +1 -1
  135. data/ext/ffi_c/libffi/testsuite/Makefile.in +22 -4
  136. data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
  137. data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +1 -5
  138. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +1 -1
  139. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +1 -1
  140. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +1 -0
  141. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +1 -0
  142. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +3 -0
  143. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +2 -2
  144. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +3 -0
  145. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
  146. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +1 -1
  147. data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +1 -0
  148. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +2 -3
  149. data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -1
  150. data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +36 -0
  151. data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +17 -17
  152. data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -0
  153. data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +1 -0
  154. data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +1 -1
  155. data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +1 -3
  156. data/ext/ffi_c/win32/stdint.h +199 -0
  157. data/gen/Rakefile +18 -2
  158. data/lib/1.8/ffi_c.so +0 -0
  159. data/lib/ffi.rb +13 -9
  160. data/lib/ffi/autopointer.rb +88 -26
  161. data/lib/ffi/enum.rb +42 -0
  162. data/lib/ffi/errno.rb +6 -1
  163. data/lib/ffi/ffi.rb +1 -0
  164. data/lib/ffi/io.rb +13 -2
  165. data/lib/ffi/library.rb +219 -24
  166. data/lib/ffi/memorypointer.rb +1 -33
  167. data/lib/ffi/platform.rb +21 -7
  168. data/lib/ffi/platform/arm-linux/types.conf +102 -0
  169. data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
  170. data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
  171. data/lib/ffi/platform/i486-gnu/types.conf +107 -0
  172. data/lib/ffi/platform/ia64-linux/types.conf +102 -0
  173. data/lib/ffi/platform/mips-linux/types.conf +102 -0
  174. data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
  175. data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
  176. data/lib/ffi/platform/s390-linux/types.conf +102 -0
  177. data/lib/ffi/platform/s390x-linux/types.conf +102 -0
  178. data/lib/ffi/platform/sparc-linux/types.conf +102 -0
  179. data/lib/ffi/platform/x86_64-freebsd/types.conf +126 -0
  180. data/lib/ffi/platform/x86_64-netbsd/types.conf +126 -0
  181. data/lib/ffi/pointer.rb +44 -0
  182. data/lib/ffi/struct.rb +2 -6
  183. data/lib/ffi/struct_layout_builder.rb +2 -1
  184. data/lib/ffi/tools/const_generator.rb +78 -26
  185. data/lib/ffi/tools/types_generator.rb +8 -1
  186. data/lib/ffi/types.rb +21 -1
  187. data/spec/ffi/async_callback_spec.rb +2 -2
  188. data/spec/ffi/bool_spec.rb +6 -6
  189. data/spec/ffi/buffer_spec.rb +23 -23
  190. data/spec/ffi/callback_spec.rb +101 -102
  191. data/spec/ffi/custom_type_spec.rb +20 -24
  192. data/spec/ffi/dup_spec.rb +7 -7
  193. data/spec/ffi/enum_spec.rb +127 -127
  194. data/spec/ffi/errno_spec.rb +2 -2
  195. data/spec/ffi/ffi_spec.rb +3 -3
  196. data/spec/ffi/function_spec.rb +10 -10
  197. data/spec/ffi/library_spec.rb +30 -12
  198. data/spec/ffi/managed_struct_spec.rb +4 -4
  199. data/spec/ffi/number_spec.rb +40 -40
  200. data/spec/ffi/pointer_spec.rb +21 -24
  201. data/spec/ffi/rbx/memory_pointer_spec.rb +17 -15
  202. data/spec/ffi/rbx/struct_spec.rb +2 -2
  203. data/spec/ffi/spec_helper.rb +1 -1
  204. data/spec/ffi/string_spec.rb +9 -9
  205. data/spec/ffi/strptr_spec.rb +3 -3
  206. data/spec/ffi/struct_callback_spec.rb +7 -7
  207. data/spec/ffi/struct_initialize_spec.rb +2 -2
  208. data/spec/ffi/struct_packed_spec.rb +6 -6
  209. data/spec/ffi/struct_spec.rb +94 -84
  210. data/spec/ffi/typedef_spec.rb +15 -4
  211. data/spec/ffi/union_spec.rb +3 -3
  212. data/spec/ffi/variadic_spec.rb +17 -14
  213. data/tasks/extension.rake +0 -1
  214. data/tasks/gem.rake +0 -1
  215. data/tasks/rdoc.rake +1 -1
  216. data/tasks/yard.rake +11 -0
  217. metadata +50 -11
  218. data/lib/1.9/ffi_c.so +0 -0
@@ -0,0 +1,176 @@
1
+ # ===========================================================================
2
+ # http://www.gnu.org/software/autoconf-archive/ax_cc_maxopt.html
3
+ # ===========================================================================
4
+ #
5
+ # SYNOPSIS
6
+ #
7
+ # AX_CC_MAXOPT
8
+ #
9
+ # DESCRIPTION
10
+ #
11
+ # Try to turn on "good" C optimization flags for various compilers and
12
+ # architectures, for some definition of "good". (In our case, good for
13
+ # FFTW and hopefully for other scientific codes. Modify as needed.)
14
+ #
15
+ # The user can override the flags by setting the CFLAGS environment
16
+ # variable. The user can also specify --enable-portable-binary in order to
17
+ # disable any optimization flags that might result in a binary that only
18
+ # runs on the host architecture.
19
+ #
20
+ # Note also that the flags assume that ANSI C aliasing rules are followed
21
+ # by the code (e.g. for gcc's -fstrict-aliasing), and that floating-point
22
+ # computations can be re-ordered as needed.
23
+ #
24
+ # Requires macros: AX_CHECK_COMPILER_FLAGS, AX_COMPILER_VENDOR,
25
+ # AX_GCC_ARCHFLAG, AX_GCC_X86_CPUID.
26
+ #
27
+ # LICENSE
28
+ #
29
+ # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
30
+ # Copyright (c) 2008 Matteo Frigo
31
+ #
32
+ # This program is free software: you can redistribute it and/or modify it
33
+ # under the terms of the GNU General Public License as published by the
34
+ # Free Software Foundation, either version 3 of the License, or (at your
35
+ # option) any later version.
36
+ #
37
+ # This program is distributed in the hope that it will be useful, but
38
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
39
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40
+ # Public License for more details.
41
+ #
42
+ # You should have received a copy of the GNU General Public License along
43
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
44
+ #
45
+ # As a special exception, the respective Autoconf Macro's copyright owner
46
+ # gives unlimited permission to copy, distribute and modify the configure
47
+ # scripts that are the output of Autoconf when processing the Macro. You
48
+ # need not follow the terms of the GNU General Public License when using
49
+ # or distributing such scripts, even though portions of the text of the
50
+ # Macro appear in them. The GNU General Public License (GPL) does govern
51
+ # all other use of the material that constitutes the Autoconf Macro.
52
+ #
53
+ # This special exception to the GPL applies to versions of the Autoconf
54
+ # Macro released by the Autoconf Archive. When you make and distribute a
55
+ # modified version of the Autoconf Macro, you may extend this special
56
+ # exception to the GPL to apply to your modified version as well.
57
+
58
+ #serial 11
59
+
60
+ AC_DEFUN([AX_CC_MAXOPT],
61
+ [
62
+ AC_REQUIRE([AC_PROG_CC])
63
+ AC_REQUIRE([AX_COMPILER_VENDOR])
64
+ AC_REQUIRE([AC_CANONICAL_HOST])
65
+
66
+ AC_ARG_ENABLE(portable-binary, [AS_HELP_STRING([--enable-portable-binary], [disable compiler optimizations that would produce unportable binaries])],
67
+ acx_maxopt_portable=$withval, acx_maxopt_portable=no)
68
+
69
+ # Try to determine "good" native compiler flags if none specified via CFLAGS
70
+ if test "$ac_test_CFLAGS" != "set"; then
71
+ CFLAGS=""
72
+ case $ax_cv_c_compiler_vendor in
73
+ dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host"
74
+ if test "x$acx_maxopt_portable" = xno; then
75
+ CFLAGS="$CFLAGS -arch host"
76
+ fi;;
77
+
78
+ sun) CFLAGS="-native -fast -xO5 -dalign"
79
+ if test "x$acx_maxopt_portable" = xyes; then
80
+ CFLAGS="$CFLAGS -xarch=generic"
81
+ fi;;
82
+
83
+ hp) CFLAGS="+Oall +Optrs_ansi +DSnative"
84
+ if test "x$acx_maxopt_portable" = xyes; then
85
+ CFLAGS="$CFLAGS +DAportable"
86
+ fi;;
87
+
88
+ ibm) if test "x$acx_maxopt_portable" = xno; then
89
+ xlc_opt="-qarch=auto -qtune=auto"
90
+ else
91
+ xlc_opt="-qtune=auto"
92
+ fi
93
+ AX_CHECK_COMPILER_FLAGS($xlc_opt,
94
+ CFLAGS="-O3 -qansialias -w $xlc_opt",
95
+ [CFLAGS="-O3 -qansialias -w"
96
+ echo "******************************************************"
97
+ echo "* You seem to have the IBM C compiler. It is *"
98
+ echo "* recommended for best performance that you use: *"
99
+ echo "* *"
100
+ echo "* CFLAGS=-O3 -qarch=xxx -qtune=xxx -qansialias -w *"
101
+ echo "* ^^^ ^^^ *"
102
+ echo "* where xxx is pwr2, pwr3, 604, or whatever kind of *"
103
+ echo "* CPU you have. (Set the CFLAGS environment var. *"
104
+ echo "* and re-run configure.) For more info, man cc. *"
105
+ echo "******************************************************"])
106
+ ;;
107
+
108
+ intel) CFLAGS="-O3 -ansi_alias"
109
+ if test "x$acx_maxopt_portable" = xno; then
110
+ icc_archflag=unknown
111
+ icc_flags=""
112
+ case $host_cpu in
113
+ i686*|x86_64*)
114
+ # icc accepts gcc assembly syntax, so these should work:
115
+ AX_GCC_X86_CPUID(0)
116
+ AX_GCC_X86_CPUID(1)
117
+ case $ax_cv_gcc_x86_cpuid_0 in # see AX_GCC_ARCHFLAG
118
+ *:756e6547:*:*) # Intel
119
+ case $ax_cv_gcc_x86_cpuid_1 in
120
+ *6a?:*[[234]]:*:*|*6[[789b]]?:*:*:*) icc_flags="-xK";;
121
+ *f3[[347]]:*:*:*|*f4[1347]:*:*:*) icc_flags="-xP -xN -xW -xK";;
122
+ *f??:*:*:*) icc_flags="-xN -xW -xK";;
123
+ esac ;;
124
+ esac ;;
125
+ esac
126
+ if test "x$icc_flags" != x; then
127
+ for flag in $icc_flags; do
128
+ AX_CHECK_COMPILER_FLAGS($flag, [icc_archflag=$flag; break])
129
+ done
130
+ fi
131
+ AC_MSG_CHECKING([for icc architecture flag])
132
+ AC_MSG_RESULT($icc_archflag)
133
+ if test "x$icc_archflag" != xunknown; then
134
+ CFLAGS="$CFLAGS $icc_archflag"
135
+ fi
136
+ fi
137
+ ;;
138
+
139
+ gnu)
140
+ # default optimization flags for gcc on all systems
141
+ CFLAGS="-O3 -fomit-frame-pointer"
142
+
143
+ # -fstrict-aliasing for gcc-2.95+
144
+ AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing,
145
+ CFLAGS="$CFLAGS -fstrict-aliasing")
146
+
147
+ AX_CHECK_COMPILER_FLAGS(-ffast-math, CFLAGS="$CFLAGS -ffast-math")
148
+
149
+ AX_GCC_ARCHFLAG($acx_maxopt_portable)
150
+ ;;
151
+ esac
152
+
153
+ if test -z "$CFLAGS"; then
154
+ echo ""
155
+ echo "********************************************************"
156
+ echo "* WARNING: Don't know the best CFLAGS for this system *"
157
+ echo "* Use ./configure CFLAGS=... to specify your own flags *"
158
+ echo "* (otherwise, a default of CFLAGS=-O3 will be used) *"
159
+ echo "********************************************************"
160
+ echo ""
161
+ CFLAGS="-O3"
162
+ fi
163
+
164
+ AX_CHECK_COMPILER_FLAGS($CFLAGS, [], [
165
+ echo ""
166
+ echo "********************************************************"
167
+ echo "* WARNING: The guessed CFLAGS don't seem to work with *"
168
+ echo "* your compiler. *"
169
+ echo "* Use ./configure CFLAGS=... to specify your own flags *"
170
+ echo "********************************************************"
171
+ echo ""
172
+ CFLAGS=""
173
+ ])
174
+
175
+ fi
176
+ ])
@@ -0,0 +1,195 @@
1
+ # ===========================================================================
2
+ # http://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
3
+ # ===========================================================================
4
+ #
5
+ # SYNOPSIS
6
+ #
7
+ # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
8
+ # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
9
+ # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
10
+ #
11
+ # DESCRIPTION
12
+ #
13
+ # Try to find a compiler option that enables most reasonable warnings.
14
+ #
15
+ # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
16
+ # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
17
+ #
18
+ # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
19
+ # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
20
+ # Intel compilers. For a given compiler, the Fortran flags are much more
21
+ # experimental than their C equivalents.
22
+ #
23
+ # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
24
+ # - $2 add-value-if-not-found : nothing
25
+ # - $3 action-if-found : add value to shellvariable
26
+ # - $4 action-if-not-found : nothing
27
+ #
28
+ # LICENSE
29
+ #
30
+ # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
31
+ # Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
32
+ #
33
+ # This program is free software; you can redistribute it and/or modify it
34
+ # under the terms of the GNU General Public License as published by the
35
+ # Free Software Foundation; either version 3 of the License, or (at your
36
+ # option) any later version.
37
+ #
38
+ # This program is distributed in the hope that it will be useful, but
39
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
40
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
41
+ # Public License for more details.
42
+ #
43
+ # You should have received a copy of the GNU General Public License along
44
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
45
+ #
46
+ # As a special exception, the respective Autoconf Macro's copyright owner
47
+ # gives unlimited permission to copy, distribute and modify the configure
48
+ # scripts that are the output of Autoconf when processing the Macro. You
49
+ # need not follow the terms of the GNU General Public License when using
50
+ # or distributing such scripts, even though portions of the text of the
51
+ # Macro appear in them. The GNU General Public License (GPL) does govern
52
+ # all other use of the material that constitutes the Autoconf Macro.
53
+ #
54
+ # This special exception to the GPL applies to versions of the Autoconf
55
+ # Macro released by the Autoconf Archive. When you make and distribute a
56
+ # modified version of the Autoconf Macro, you may extend this special
57
+ # exception to the GPL to apply to your modified version as well.
58
+
59
+ #serial 10
60
+
61
+ AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
62
+ AS_VAR_PUSHDEF([FLAGS],[CFLAGS])dnl
63
+ AS_VAR_PUSHDEF([VAR],[ac_cv_cflags_warn_all])dnl
64
+ AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
65
+ VAR,[VAR="no, unknown"
66
+ AC_LANG_PUSH([C])
67
+ ac_save_[]FLAGS="$[]FLAGS"
68
+ for ac_arg dnl
69
+ in "-pedantic % -Wall" dnl GCC
70
+ "-xstrconst % -v" dnl Solaris C
71
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
72
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
73
+ "-ansi -ansiE % -fullwarn" dnl IRIX
74
+ "+ESlit % +w1" dnl HP-UX C
75
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
76
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
77
+ #
78
+ do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
79
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
80
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
81
+ done
82
+ FLAGS="$ac_save_[]FLAGS"
83
+ AC_LANG_POP([C])
84
+ ])
85
+ case ".$VAR" in
86
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
87
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
88
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
89
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
90
+ *) m4_ifvaln($3,$3,[
91
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
92
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
93
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
94
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
95
+ fi ]) ;;
96
+ esac
97
+ AS_VAR_POPDEF([VAR])dnl
98
+ AS_VAR_POPDEF([FLAGS])dnl
99
+ ])
100
+
101
+ dnl the only difference - the LANG selection... and the default FLAGS
102
+
103
+ AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
104
+ AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl
105
+ AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl
106
+ AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
107
+ VAR,[VAR="no, unknown"
108
+ AC_LANG_PUSH([C++])
109
+ ac_save_[]FLAGS="$[]FLAGS"
110
+ for ac_arg dnl
111
+ in "-pedantic % -Wall" dnl GCC
112
+ "-xstrconst % -v" dnl Solaris C
113
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
114
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
115
+ "-ansi -ansiE % -fullwarn" dnl IRIX
116
+ "+ESlit % +w1" dnl HP-UX C
117
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
118
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
119
+ #
120
+ do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
121
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
122
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
123
+ done
124
+ FLAGS="$ac_save_[]FLAGS"
125
+ AC_LANG_POP([C++])
126
+ ])
127
+ case ".$VAR" in
128
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
129
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
130
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
131
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
132
+ *) m4_ifvaln($3,$3,[
133
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
134
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
135
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
136
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
137
+ fi ]) ;;
138
+ esac
139
+ AS_VAR_POPDEF([VAR])dnl
140
+ AS_VAR_POPDEF([FLAGS])dnl
141
+ ])
142
+
143
+ dnl the only difference - the LANG selection... and the default FLAGS
144
+
145
+ AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
146
+ AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl
147
+ AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl
148
+ AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
149
+ VAR,[VAR="no, unknown"
150
+ AC_LANG_PUSH([Fortran])
151
+ ac_save_[]FLAGS="$[]FLAGS"
152
+ for ac_arg dnl
153
+ in "-warn all % -warn all" dnl Intel
154
+ "-pedantic % -Wall" dnl GCC
155
+ "-xstrconst % -v" dnl Solaris C
156
+ "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
157
+ "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
158
+ "-ansi -ansiE % -fullwarn" dnl IRIX
159
+ "+ESlit % +w1" dnl HP-UX C
160
+ "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
161
+ "-h conform % -h msglevel 2" dnl Cray C (Unicos)
162
+ #
163
+ do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
164
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
165
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
166
+ done
167
+ FLAGS="$ac_save_[]FLAGS"
168
+ AC_LANG_POP([Fortran])
169
+ ])
170
+ case ".$VAR" in
171
+ .ok|.ok,*) m4_ifvaln($3,$3) ;;
172
+ .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[
173
+ AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])
174
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;;
175
+ *) m4_ifvaln($3,$3,[
176
+ if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null
177
+ then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR])
178
+ else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"])
179
+ m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"
180
+ fi ]) ;;
181
+ esac
182
+ AS_VAR_POPDEF([VAR])dnl
183
+ AS_VAR_POPDEF([FLAGS])dnl
184
+ ])
185
+
186
+ dnl implementation tactics:
187
+ dnl the for-argument contains a list of options. The first part of
188
+ dnl these does only exist to detect the compiler - usually it is
189
+ dnl a global option to enable -ansi or -extrawarnings. All other
190
+ dnl compilers will fail about it. That was needed since a lot of
191
+ dnl compilers will give false positives for some option-syntax
192
+ dnl like -Woption or -Xoption as they think of it is a pass-through
193
+ dnl to later compile stages or something. The "%" is used as a
194
+ dnl delimiter. A non-option comment can be given after "%%" marks
195
+ dnl which will be shown but not added to the respective C/CXXFLAGS.
@@ -0,0 +1,76 @@
1
+ # ===========================================================================
2
+ # http://www.gnu.org/software/autoconf-archive/ax_check_compiler_flags.html
3
+ # ===========================================================================
4
+ #
5
+ # SYNOPSIS
6
+ #
7
+ # AX_CHECK_COMPILER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
8
+ #
9
+ # DESCRIPTION
10
+ #
11
+ # Check whether the given compiler FLAGS work with the current language's
12
+ # compiler, or whether they give an error. (Warnings, however, are
13
+ # ignored.)
14
+ #
15
+ # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
16
+ # success/failure.
17
+ #
18
+ # LICENSE
19
+ #
20
+ # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
21
+ # Copyright (c) 2009 Matteo Frigo
22
+ #
23
+ # This program is free software: you can redistribute it and/or modify it
24
+ # under the terms of the GNU General Public License as published by the
25
+ # Free Software Foundation, either version 3 of the License, or (at your
26
+ # option) any later version.
27
+ #
28
+ # This program is distributed in the hope that it will be useful, but
29
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
30
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
31
+ # Public License for more details.
32
+ #
33
+ # You should have received a copy of the GNU General Public License along
34
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
35
+ #
36
+ # As a special exception, the respective Autoconf Macro's copyright owner
37
+ # gives unlimited permission to copy, distribute and modify the configure
38
+ # scripts that are the output of Autoconf when processing the Macro. You
39
+ # need not follow the terms of the GNU General Public License when using
40
+ # or distributing such scripts, even though portions of the text of the
41
+ # Macro appear in them. The GNU General Public License (GPL) does govern
42
+ # all other use of the material that constitutes the Autoconf Macro.
43
+ #
44
+ # This special exception to the GPL applies to versions of the Autoconf
45
+ # Macro released by the Autoconf Archive. When you make and distribute a
46
+ # modified version of the Autoconf Macro, you may extend this special
47
+ # exception to the GPL to apply to your modified version as well.
48
+
49
+ #serial 9
50
+
51
+ AC_DEFUN([AX_CHECK_COMPILER_FLAGS],
52
+ [AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
53
+ AC_MSG_CHECKING([whether _AC_LANG compiler accepts $1])
54
+ dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
55
+ AS_LITERAL_IF([$1],
56
+ [AC_CACHE_VAL(AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1]), [
57
+ ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
58
+ _AC_LANG_PREFIX[]FLAGS="$1"
59
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
60
+ AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
61
+ AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
62
+ _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])],
63
+ [ax_save_FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
64
+ _AC_LANG_PREFIX[]FLAGS="$1"
65
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
66
+ eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=yes,
67
+ eval AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])=no)
68
+ _AC_LANG_PREFIX[]FLAGS=$ax_save_FLAGS])
69
+ eval ax_check_compiler_flags=$AS_TR_SH(ax_cv_[]_AC_LANG_ABBREV[]_flags_[$1])
70
+ AC_MSG_RESULT($ax_check_compiler_flags)
71
+ if test "x$ax_check_compiler_flags" = xyes; then
72
+ m4_default([$2], :)
73
+ else
74
+ m4_default([$3], :)
75
+ fi
76
+ ])dnl AX_CHECK_COMPILER_FLAGS
@@ -0,0 +1,63 @@
1
+ # ===========================================================================
2
+ # http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
3
+ # ===========================================================================
4
+ #
5
+ # SYNOPSIS
6
+ #
7
+ # AX_COMPILER_VENDOR
8
+ #
9
+ # DESCRIPTION
10
+ #
11
+ # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
12
+ # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
13
+ # watcom, etc. The vendor is returned in the cache variable
14
+ # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
15
+ #
16
+ # LICENSE
17
+ #
18
+ # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
19
+ # Copyright (c) 2008 Matteo Frigo
20
+ #
21
+ # This program is free software: you can redistribute it and/or modify it
22
+ # under the terms of the GNU General Public License as published by the
23
+ # Free Software Foundation, either version 3 of the License, or (at your
24
+ # option) any later version.
25
+ #
26
+ # This program is distributed in the hope that it will be useful, but
27
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
28
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
29
+ # Public License for more details.
30
+ #
31
+ # You should have received a copy of the GNU General Public License along
32
+ # with this program. If not, see <http://www.gnu.org/licenses/>.
33
+ #
34
+ # As a special exception, the respective Autoconf Macro's copyright owner
35
+ # gives unlimited permission to copy, distribute and modify the configure
36
+ # scripts that are the output of Autoconf when processing the Macro. You
37
+ # need not follow the terms of the GNU General Public License when using
38
+ # or distributing such scripts, even though portions of the text of the
39
+ # Macro appear in them. The GNU General Public License (GPL) does govern
40
+ # all other use of the material that constitutes the Autoconf Macro.
41
+ #
42
+ # This special exception to the GPL applies to versions of the Autoconf
43
+ # Macro released by the Autoconf Archive. When you make and distribute a
44
+ # modified version of the Autoconf Macro, you may extend this special
45
+ # exception to the GPL to apply to your modified version as well.
46
+
47
+ #serial 9
48
+
49
+ AC_DEFUN([AX_COMPILER_VENDOR],
50
+ [
51
+ AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
52
+ [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown
53
+ # note: don't check for gcc first since some other compilers define __GNUC__
54
+ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ clang:__clang__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do
55
+ vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")"
56
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
57
+ #if !($vencpp)
58
+ thisisanerror;
59
+ #endif
60
+ ])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break])
61
+ done
62
+ ])
63
+ ])