ffi 1.0.11 → 1.0.12.pre
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.
- data/Rakefile +1 -1
- data/ext/ffi_c/AbstractMemory.c +9 -0
- data/ext/ffi_c/AbstractMemory.h +4 -0
- data/ext/ffi_c/Buffer.c +8 -0
- data/ext/ffi_c/Call.c +8 -0
- data/ext/ffi_c/ClosurePool.c +12 -0
- data/ext/ffi_c/DynamicLibrary.c +7 -1
- data/ext/ffi_c/Function.c +11 -1
- data/ext/ffi_c/Function.h +6 -0
- data/ext/ffi_c/FunctionInfo.c +8 -0
- data/ext/ffi_c/LastError.c +8 -0
- data/ext/ffi_c/MemoryPointer.c +8 -0
- data/ext/ffi_c/MemoryPointer.h +6 -0
- data/ext/ffi_c/MethodHandle.c +8 -0
- data/ext/ffi_c/Platform.c +8 -0
- data/ext/ffi_c/Pointer.c +8 -0
- data/ext/ffi_c/Pointer.h +6 -0
- data/ext/ffi_c/Struct.c +6 -0
- data/ext/ffi_c/StructByReference.c +8 -0
- data/ext/ffi_c/StructByValue.c +8 -0
- data/ext/ffi_c/StructLayout.c +6 -0
- data/ext/ffi_c/Thread.c +7 -0
- data/ext/ffi_c/Thread.h +6 -0
- data/ext/ffi_c/Type.c +3 -0
- data/ext/ffi_c/Types.h +4 -0
- data/ext/ffi_c/Variadic.c +8 -0
- data/ext/ffi_c/endian.h +3 -0
- data/ext/ffi_c/extconf.rb +6 -1
- data/ext/ffi_c/libffi.vc.mk +26 -0
- data/ext/ffi_c/libffi.vc64.mk +26 -0
- data/ext/ffi_c/libffi/ChangeLog +541 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi +13 -87
- data/ext/ffi_c/libffi/LICENSE +3 -3
- data/ext/ffi_c/libffi/Makefile.am +41 -32
- data/ext/ffi_c/libffi/Makefile.in +95 -66
- data/ext/ffi_c/libffi/Makefile.vc +141 -0
- data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
- data/ext/ffi_c/libffi/README +40 -4
- data/ext/ffi_c/libffi/aclocal.m4 +729 -7854
- data/ext/ffi_c/libffi/build-ios.sh +67 -0
- data/ext/ffi_c/libffi/compile +11 -10
- data/ext/ffi_c/libffi/config.guess +4 -1
- data/ext/ffi_c/libffi/config.sub +6 -3
- data/ext/ffi_c/libffi/configure +6264 -6354
- data/ext/ffi_c/libffi/configure.ac +155 -63
- data/ext/ffi_c/libffi/depcomp +81 -35
- data/ext/ffi_c/libffi/doc/libffi.info +78 -18
- data/ext/ffi_c/libffi/doc/libffi.texi +64 -5
- data/ext/ffi_c/libffi/doc/stamp-vti +4 -4
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +18 -0
- data/ext/ffi_c/libffi/fficonfig.hw +57 -0
- data/ext/ffi_c/libffi/include/Makefile.in +21 -3
- data/ext/ffi_c/libffi/include/ffi.h.in +42 -14
- data/ext/ffi_c/libffi/include/ffi.h.vc +427 -0
- data/ext/ffi_c/libffi/include/ffi.h.vc64 +427 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +9 -5
- data/ext/ffi_c/libffi/install-sh +364 -167
- data/ext/ffi_c/libffi/ltmain.sh +2599 -1369
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +176 -0
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +195 -0
- data/ext/ffi_c/libffi/m4/ax_check_compiler_flags.m4 +76 -0
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +63 -0
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +70 -0
- data/ext/ffi_c/libffi/m4/ax_enable_builddir.m4 +300 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +215 -0
- data/ext/ffi_c/libffi/m4/ax_gcc_x86_cpuid.m4 +79 -0
- data/ext/ffi_c/libffi/m4/libtool.m4 +1239 -768
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +7 -6
- data/ext/ffi_c/libffi/m4/ltversion.m4 +6 -6
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +9 -3
- data/ext/ffi_c/libffi/man/Makefile.in +21 -3
- data/ext/ffi_c/libffi/mdate-sh +0 -0
- data/ext/ffi_c/libffi/missing +60 -44
- data/ext/ffi_c/libffi/msvcc.sh +197 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +39 -18
- data/ext/ffi_c/libffi/src/arm/ffi.c +443 -24
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +17 -1
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +206 -15
- data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
- data/ext/ffi_c/libffi/src/avr32/ffi.c +4 -2
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/closures.c +17 -35
- data/ext/ffi_c/libffi/src/cris/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/dlmalloc.c +66 -4
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +2 -6
- data/ext/ffi_c/libffi/src/ia64/ffi.c +7 -5
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/java_raw_api.c +1 -1
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/m68k/ffi.c +10 -0
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/m68k/sysv.S +36 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +12 -5
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +18 -11
- data/ext/ffi_c/libffi/src/mips/n32.S +4 -4
- data/ext/ffi_c/libffi/src/moxie/eabi.S +128 -0
- data/ext/ffi_c/libffi/src/moxie/ffi.c +276 -0
- data/ext/ffi_c/libffi/src/pa/ffi.c +7 -4
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +6 -5
- data/ext/ffi_c/libffi/src/powerpc/aix.S +5 -1
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +2 -0
- data/ext/ffi_c/libffi/src/powerpc/asm.h +1 -1
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +215 -77
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +358 -100
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +11 -5
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +603 -172
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +17 -4
- data/ext/ffi_c/libffi/src/prep_cif.c +16 -13
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +4 -2
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +2 -2
- data/ext/ffi_c/libffi/src/sparc/ffi.c +55 -11
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +5 -3
- data/ext/ffi_c/libffi/src/x86/ffi.c +54 -92
- data/ext/ffi_c/libffi/src/x86/ffi64.c +17 -8
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +15 -14
- data/ext/ffi_c/libffi/src/x86/sysv.S +40 -26
- data/ext/ffi_c/libffi/src/x86/unix64.S +4 -0
- data/ext/ffi_c/libffi/src/x86/win32.S +379 -191
- data/ext/ffi_c/libffi/src/x86/win64.S +15 -7
- data/ext/ffi_c/libffi/testsuite/Makefile.am +1 -1
- data/ext/ffi_c/libffi/testsuite/Makefile.in +22 -4
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +1 -5
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +2 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +2 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +17 -17
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +1 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +1 -3
- data/ext/ffi_c/win32/stdint.h +199 -0
- data/gen/Rakefile +18 -2
- data/lib/ffi/platform/arm-linux/types.conf +102 -0
- data/lib/ffi/platform/i486-gnu/types.conf +107 -0
- data/lib/ffi/platform/ia64-linux/types.conf +102 -0
- data/lib/ffi/platform/mips-linux/types.conf +102 -0
- data/lib/ffi/platform/mipsel-linux/types.conf +102 -0
- data/lib/ffi/platform/powerpc-linux/types.conf +100 -0
- data/lib/ffi/platform/s390-linux/types.conf +102 -0
- data/lib/ffi/platform/s390x-linux/types.conf +102 -0
- data/lib/ffi/platform/sparc-linux/types.conf +102 -0
- data/lib/ffi/tools/types_generator.rb +8 -1
- data/lib/ffi_c.bundle +0 -0
- metadata +72 -42
@@ -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
|
+
])
|