ffi 1.9.3-x64-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.
- data/COPYING +49 -0
- data/LICENSE +24 -0
- data/README.md +109 -0
- data/Rakefile +220 -0
- data/ext/ffi_c/AbstractMemory.c +1032 -0
- data/ext/ffi_c/AbstractMemory.h +175 -0
- data/ext/ffi_c/ArrayType.c +162 -0
- data/ext/ffi_c/ArrayType.h +59 -0
- data/ext/ffi_c/Buffer.c +365 -0
- data/ext/ffi_c/Call.c +465 -0
- data/ext/ffi_c/Call.h +93 -0
- data/ext/ffi_c/ClosurePool.c +283 -0
- data/ext/ffi_c/ClosurePool.h +57 -0
- data/ext/ffi_c/DataConverter.c +91 -0
- data/ext/ffi_c/DynamicLibrary.c +333 -0
- data/ext/ffi_c/DynamicLibrary.h +49 -0
- data/ext/ffi_c/Function.c +999 -0
- data/ext/ffi_c/Function.h +87 -0
- data/ext/ffi_c/FunctionInfo.c +271 -0
- data/ext/ffi_c/LastError.c +184 -0
- data/ext/ffi_c/LastError.h +47 -0
- data/ext/ffi_c/LongDouble.c +63 -0
- data/ext/ffi_c/LongDouble.h +51 -0
- data/ext/ffi_c/MappedType.c +168 -0
- data/ext/ffi_c/MappedType.h +59 -0
- data/ext/ffi_c/MemoryPointer.c +197 -0
- data/ext/ffi_c/MemoryPointer.h +53 -0
- data/ext/ffi_c/MethodHandle.c +360 -0
- data/ext/ffi_c/MethodHandle.h +55 -0
- data/ext/ffi_c/Platform.c +121 -0
- data/ext/ffi_c/Platform.h +45 -0
- data/ext/ffi_c/Pointer.c +508 -0
- data/ext/ffi_c/Pointer.h +63 -0
- data/ext/ffi_c/Struct.c +828 -0
- data/ext/ffi_c/Struct.h +106 -0
- data/ext/ffi_c/StructByReference.c +190 -0
- data/ext/ffi_c/StructByReference.h +50 -0
- data/ext/ffi_c/StructByValue.c +150 -0
- data/ext/ffi_c/StructByValue.h +55 -0
- data/ext/ffi_c/StructLayout.c +698 -0
- data/ext/ffi_c/Thread.c +352 -0
- data/ext/ffi_c/Thread.h +95 -0
- data/ext/ffi_c/Type.c +397 -0
- data/ext/ffi_c/Type.h +62 -0
- data/ext/ffi_c/Types.c +139 -0
- data/ext/ffi_c/Types.h +89 -0
- data/ext/ffi_c/Variadic.c +276 -0
- data/ext/ffi_c/compat.h +83 -0
- data/ext/ffi_c/extconf.rb +64 -0
- data/ext/ffi_c/ffi.c +98 -0
- data/ext/ffi_c/libffi.bsd.mk +34 -0
- data/ext/ffi_c/libffi.darwin.mk +95 -0
- data/ext/ffi_c/libffi.gnu.mk +31 -0
- data/ext/ffi_c/libffi.mk +13 -0
- data/ext/ffi_c/libffi.vc.mk +26 -0
- data/ext/ffi_c/libffi.vc64.mk +26 -0
- data/ext/ffi_c/libffi/ChangeLog +4600 -0
- data/ext/ffi_c/libffi/ChangeLog.libffi +584 -0
- data/ext/ffi_c/libffi/ChangeLog.libgcj +40 -0
- data/ext/ffi_c/libffi/ChangeLog.v1 +764 -0
- data/ext/ffi_c/libffi/LICENSE +21 -0
- data/ext/ffi_c/libffi/Makefile.am +196 -0
- data/ext/ffi_c/libffi/Makefile.in +1820 -0
- data/ext/ffi_c/libffi/Makefile.vc +141 -0
- data/ext/ffi_c/libffi/Makefile.vc64 +141 -0
- data/ext/ffi_c/libffi/README +342 -0
- data/ext/ffi_c/libffi/acinclude.m4 +92 -0
- data/ext/ffi_c/libffi/aclocal.m4 +1873 -0
- data/ext/ffi_c/libffi/build-ios.sh +67 -0
- data/ext/ffi_c/libffi/compile +143 -0
- data/ext/ffi_c/libffi/config.guess +1501 -0
- data/ext/ffi_c/libffi/config.sub +1705 -0
- data/ext/ffi_c/libffi/configure +17191 -0
- data/ext/ffi_c/libffi/configure.ac +496 -0
- data/ext/ffi_c/libffi/configure.host +11 -0
- data/ext/ffi_c/libffi/depcomp +630 -0
- data/ext/ffi_c/libffi/doc/libffi.info +593 -0
- data/ext/ffi_c/libffi/doc/libffi.texi +600 -0
- data/ext/ffi_c/libffi/doc/stamp-vti +4 -0
- data/ext/ffi_c/libffi/doc/version.texi +4 -0
- data/ext/ffi_c/libffi/fficonfig.h.in +199 -0
- data/ext/ffi_c/libffi/fficonfig.hw +57 -0
- data/ext/ffi_c/libffi/include/Makefile.am +9 -0
- data/ext/ffi_c/libffi/include/Makefile.in +487 -0
- data/ext/ffi_c/libffi/include/ffi.h.in +427 -0
- 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 +126 -0
- data/ext/ffi_c/libffi/install-sh +520 -0
- data/ext/ffi_c/libffi/libffi.pc.in +10 -0
- data/ext/ffi_c/libffi/libtool-version +29 -0
- data/ext/ffi_c/libffi/ltmain.sh +9636 -0
- 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 +7831 -0
- data/ext/ffi_c/libffi/m4/ltoptions.m4 +369 -0
- data/ext/ffi_c/libffi/m4/ltsugar.m4 +123 -0
- data/ext/ffi_c/libffi/m4/ltversion.m4 +23 -0
- data/ext/ffi_c/libffi/m4/lt~obsolete.m4 +98 -0
- data/ext/ffi_c/libffi/man/Makefile.am +8 -0
- data/ext/ffi_c/libffi/man/Makefile.in +466 -0
- data/ext/ffi_c/libffi/man/ffi.3 +31 -0
- data/ext/ffi_c/libffi/man/ffi_call.3 +103 -0
- data/ext/ffi_c/libffi/man/ffi_prep_cif.3 +66 -0
- data/ext/ffi_c/libffi/mdate-sh +201 -0
- data/ext/ffi_c/libffi/missing +376 -0
- data/ext/ffi_c/libffi/msvcc.sh +197 -0
- data/ext/ffi_c/libffi/src/alpha/ffi.c +284 -0
- data/ext/ffi_c/libffi/src/alpha/ffitarget.h +48 -0
- data/ext/ffi_c/libffi/src/alpha/osf.S +387 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +728 -0
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +65 -0
- data/ext/ffi_c/libffi/src/arm/gentramp.sh +118 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +497 -0
- data/ext/ffi_c/libffi/src/arm/trampoline.S +4450 -0
- data/ext/ffi_c/libffi/src/avr32/ffi.c +423 -0
- data/ext/ffi_c/libffi/src/avr32/ffitarget.h +50 -0
- data/ext/ffi_c/libffi/src/avr32/sysv.S +208 -0
- data/ext/ffi_c/libffi/src/closures.c +615 -0
- data/ext/ffi_c/libffi/src/cris/ffi.c +383 -0
- data/ext/ffi_c/libffi/src/cris/ffitarget.h +51 -0
- data/ext/ffi_c/libffi/src/cris/sysv.S +215 -0
- data/ext/ffi_c/libffi/src/debug.c +59 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +5161 -0
- data/ext/ffi_c/libffi/src/frv/eabi.S +128 -0
- data/ext/ffi_c/libffi/src/frv/ffi.c +292 -0
- data/ext/ffi_c/libffi/src/frv/ffitarget.h +57 -0
- data/ext/ffi_c/libffi/src/ia64/ffi.c +582 -0
- data/ext/ffi_c/libffi/src/ia64/ffitarget.h +50 -0
- data/ext/ffi_c/libffi/src/ia64/ia64_flags.h +40 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +560 -0
- data/ext/ffi_c/libffi/src/java_raw_api.c +356 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +232 -0
- data/ext/ffi_c/libffi/src/m32r/ffitarget.h +48 -0
- data/ext/ffi_c/libffi/src/m32r/sysv.S +121 -0
- data/ext/ffi_c/libffi/src/m68k/ffi.c +288 -0
- data/ext/ffi_c/libffi/src/m68k/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/m68k/sysv.S +270 -0
- data/ext/ffi_c/libffi/src/mips/ffi.c +1036 -0
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +242 -0
- data/ext/ffi_c/libffi/src/mips/n32.S +591 -0
- data/ext/ffi_c/libffi/src/mips/o32.S +381 -0
- 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 +719 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +78 -0
- data/ext/ffi_c/libffi/src/pa/hpux32.S +368 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +357 -0
- data/ext/ffi_c/libffi/src/powerpc/aix.S +328 -0
- data/ext/ffi_c/libffi/src/powerpc/aix_closure.S +445 -0
- data/ext/ffi_c/libffi/src/powerpc/asm.h +125 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin.S +383 -0
- data/ext/ffi_c/libffi/src/powerpc/darwin_closure.S +575 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +1448 -0
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +1359 -0
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +139 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +187 -0
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +236 -0
- data/ext/ffi_c/libffi/src/powerpc/ppc_closure.S +327 -0
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +219 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +177 -0
- data/ext/ffi_c/libffi/src/raw_api.c +254 -0
- data/ext/ffi_c/libffi/src/s390/ffi.c +780 -0
- data/ext/ffi_c/libffi/src/s390/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/s390/sysv.S +434 -0
- data/ext/ffi_c/libffi/src/sh/ffi.c +716 -0
- data/ext/ffi_c/libffi/src/sh/ffitarget.h +49 -0
- data/ext/ffi_c/libffi/src/sh/sysv.S +850 -0
- data/ext/ffi_c/libffi/src/sh64/ffi.c +468 -0
- data/ext/ffi_c/libffi/src/sh64/ffitarget.h +53 -0
- data/ext/ffi_c/libffi/src/sh64/sysv.S +539 -0
- data/ext/ffi_c/libffi/src/sparc/ffi.c +669 -0
- data/ext/ffi_c/libffi/src/sparc/ffitarget.h +68 -0
- data/ext/ffi_c/libffi/src/sparc/v8.S +313 -0
- data/ext/ffi_c/libffi/src/sparc/v9.S +307 -0
- data/ext/ffi_c/libffi/src/types.c +77 -0
- data/ext/ffi_c/libffi/src/x86/darwin.S +444 -0
- data/ext/ffi_c/libffi/src/x86/darwin64.S +416 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +644 -0
- data/ext/ffi_c/libffi/src/x86/ffi64.c +635 -0
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +121 -0
- data/ext/ffi_c/libffi/src/x86/freebsd.S +458 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +468 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +426 -0
- data/ext/ffi_c/libffi/src/x86/win32.S +1065 -0
- data/ext/ffi_c/libffi/src/x86/win64.S +468 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.am +80 -0
- data/ext/ffi_c/libffi/testsuite/Makefile.in +500 -0
- data/ext/ffi_c/libffi/testsuite/config/default.exp +1 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi-dg.exp +300 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +350 -0
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +263 -0
- data/ext/ffi_c/libffi/testsuite/lib/wrapper.exp +45 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +32 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn0.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn1.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn2.c +81 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn3.c +82 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn4.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn5.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_fn6.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_loc_fn0.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/closure_stdcall.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_12byte.c +94 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_16byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_18byte.c +96 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_19byte.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_1_1byte.c +89 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_20byte1.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_24byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_2byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3_1byte.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_3byte2.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4_1byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_4byte.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5_1_byte.c +109 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_5byte.c +98 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_64byte.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6_1_byte.c +113 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_6byte.c +99 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7_1_byte.c +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_7byte.c +97 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_8byte.c +88 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_9byte2.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_double.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_float.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split.c +134 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c +117 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_pointer.c +95 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_sint64.c +92 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint16.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint32.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_align_uint64.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_dbls_struct.c +66 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_double_va.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_float.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble.c +105 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_longdouble_va.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_schar.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_sshortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_uchar.c +91 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushort.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_multi_ushortchar.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_pointer_stack.c +140 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_schar.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sint.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_sshort.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uint.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ulonglong.c +47 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_abi.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/err_bad_typedef.c +26 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +153 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float1.c +58 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +58 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float3.c +72 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/float4.c +62 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/huge_struct.c +342 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many.c +69 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/many_win32.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/negint.c +53 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct.c +152 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct1.c +161 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct10.c +133 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct2.c +110 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct3.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct4.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct5.c +112 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct6.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct7.c +111 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct8.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/nested_struct9.c +131 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/problem1.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/promotion.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/pyobjc-tc.c +114 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_dbl2.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl.c +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl1.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl2.c +49 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_fl3.c +42 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ldl.c +34 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +43 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sc.c +36 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_uc.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +38 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large.c +145 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_large2.c +148 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium.c +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/stret_medium2.c +125 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen_win32.c +44 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct1.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct2.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c +59 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct4.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct5.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct6.c +64 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +74 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct8.c +80 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct9.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/testclosure.c +70 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/ffitestcxx.h +96 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/special.exp +35 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest.cc +124 -0
- data/ext/ffi_c/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc +53 -0
- data/ext/ffi_c/libffi/texinfo.tex +7210 -0
- data/ext/ffi_c/rbffi.h +57 -0
- data/ext/ffi_c/rbffi_endian.h +59 -0
- data/ext/ffi_c/win32/stdbool.h +8 -0
- data/ext/ffi_c/win32/stdint.h +201 -0
- data/ffi.gemspec +22 -0
- data/gen/Rakefile +30 -0
- data/lib/ffi.rb +28 -0
- data/lib/ffi/autopointer.rb +194 -0
- data/lib/ffi/buffer.rb +4 -0
- data/lib/ffi/callback.rb +4 -0
- data/lib/ffi/enum.rb +173 -0
- data/lib/ffi/errno.rb +43 -0
- data/lib/ffi/ffi.rb +44 -0
- data/lib/ffi/io.rb +62 -0
- data/lib/ffi/library.rb +499 -0
- data/lib/ffi/managedstruct.rb +84 -0
- data/lib/ffi/memorypointer.rb +1 -0
- data/lib/ffi/platform.rb +148 -0
- data/lib/ffi/platform/arm-linux/types.conf +104 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +3 -0
- data/lib/ffi/platform/i386-darwin/types.conf +100 -0
- data/lib/ffi/platform/i386-freebsd/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +107 -0
- data/lib/ffi/platform/i386-linux/types.conf +103 -0
- data/lib/ffi/platform/i386-netbsd/types.conf +126 -0
- data/lib/ffi/platform/i386-openbsd/types.conf +128 -0
- data/lib/ffi/platform/i386-solaris/types.conf +122 -0
- data/lib/ffi/platform/i386-windows/types.conf +105 -0
- data/lib/ffi/platform/ia64-linux/types.conf +104 -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-aix/types.conf +180 -0
- data/lib/ffi/platform/powerpc-darwin/types.conf +100 -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/platform/sparc-solaris/types.conf +128 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +3 -0
- data/lib/ffi/platform/x86_64-darwin/types.conf +100 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +102 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +126 -0
- data/lib/ffi/platform/x86_64-openbsd/types.conf +128 -0
- data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
- data/lib/ffi/platform/x86_64-windows/types.conf +27 -0
- data/lib/ffi/pointer.rb +134 -0
- data/lib/ffi/struct.rb +367 -0
- data/lib/ffi/struct_layout_builder.rb +222 -0
- data/lib/ffi/tools/const_generator.rb +229 -0
- data/lib/ffi/tools/generator.rb +60 -0
- data/lib/ffi/tools/generator_task.rb +36 -0
- data/lib/ffi/tools/struct_generator.rb +194 -0
- data/lib/ffi/tools/types_generator.rb +135 -0
- data/lib/ffi/types.rb +190 -0
- data/lib/ffi/union.rb +43 -0
- data/lib/ffi/variadic.rb +78 -0
- data/lib/ffi/version.rb +4 -0
- data/lib/ffi_c.so +0 -0
- data/libtest/Benchmark.c +52 -0
- data/libtest/BoolTest.c +34 -0
- data/libtest/BufferTest.c +31 -0
- data/libtest/ClosureTest.c +190 -0
- data/libtest/EnumTest.c +34 -0
- data/libtest/FunctionTest.c +58 -0
- data/libtest/GNUmakefile +149 -0
- data/libtest/GlobalVariable.c +62 -0
- data/libtest/LastErrorTest.c +21 -0
- data/libtest/NumberTest.c +132 -0
- data/libtest/PointerTest.c +63 -0
- data/libtest/ReferenceTest.c +23 -0
- data/libtest/StringTest.c +34 -0
- data/libtest/StructTest.c +243 -0
- data/libtest/UnionTest.c +43 -0
- data/libtest/VariadicTest.c +62 -0
- data/spec/ffi/async_callback_spec.rb +35 -0
- data/spec/ffi/bool_spec.rb +29 -0
- data/spec/ffi/buffer_spec.rb +251 -0
- data/spec/ffi/callback_spec.rb +667 -0
- data/spec/ffi/custom_param_type.rb +36 -0
- data/spec/ffi/custom_type_spec.rb +74 -0
- data/spec/ffi/dup_spec.rb +54 -0
- data/spec/ffi/enum_spec.rb +220 -0
- data/spec/ffi/errno_spec.rb +18 -0
- data/spec/ffi/ffi_spec.rb +29 -0
- data/spec/ffi/function_spec.rb +76 -0
- data/spec/ffi/library_spec.rb +216 -0
- data/spec/ffi/long_double.rb +30 -0
- data/spec/ffi/managed_struct_spec.rb +57 -0
- data/spec/ffi/number_spec.rb +236 -0
- data/spec/ffi/pointer_spec.rb +265 -0
- data/spec/ffi/rbx/attach_function_spec.rb +28 -0
- data/spec/ffi/rbx/memory_pointer_spec.rb +123 -0
- data/spec/ffi/rbx/spec_helper.rb +1 -0
- data/spec/ffi/rbx/struct_spec.rb +13 -0
- data/spec/ffi/spec_helper.rb +33 -0
- data/spec/ffi/string_spec.rb +108 -0
- data/spec/ffi/strptr_spec.rb +50 -0
- data/spec/ffi/struct_by_ref_spec.rb +43 -0
- data/spec/ffi/struct_callback_spec.rb +69 -0
- data/spec/ffi/struct_initialize_spec.rb +35 -0
- data/spec/ffi/struct_packed_spec.rb +51 -0
- data/spec/ffi/struct_spec.rb +748 -0
- data/spec/ffi/typedef_spec.rb +78 -0
- data/spec/ffi/union_spec.rb +65 -0
- data/spec/ffi/variadic_spec.rb +92 -0
- data/spec/spec.opts +4 -0
- metadata +562 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# http://www.gnu.org/software/autoconf-archive/ax_configure_args.html
|
3
|
+
# ===========================================================================
|
4
|
+
#
|
5
|
+
# SYNOPSIS
|
6
|
+
#
|
7
|
+
# AX_CONFIGURE_ARGS
|
8
|
+
#
|
9
|
+
# DESCRIPTION
|
10
|
+
#
|
11
|
+
# Helper macro for AX_ENABLE_BUILDDIR.
|
12
|
+
#
|
13
|
+
# The traditional way of starting a subdir-configure is running the script
|
14
|
+
# with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have
|
15
|
+
# to rely on eval'ing $ac_configure_args however some old autoconf
|
16
|
+
# versions do not provide that. To ensure maximum portability of autoconf
|
17
|
+
# extension macros this helper can be AC_REQUIRE'd so that
|
18
|
+
# $ac_configure_args will alsways be present.
|
19
|
+
#
|
20
|
+
# Sadly, the traditional "exec $SHELL" of the enable_builddir macros is
|
21
|
+
# spoiled now and must be replaced by "eval + exit $?".
|
22
|
+
#
|
23
|
+
# Example:
|
24
|
+
#
|
25
|
+
# AC_DEFUN([AX_ENABLE_SUBDIR],[dnl
|
26
|
+
# AC_REQUIRE([AX_CONFIGURE_ARGS])dnl
|
27
|
+
# eval $SHELL $ac_configure_args || exit $?
|
28
|
+
# ...])
|
29
|
+
#
|
30
|
+
# LICENSE
|
31
|
+
#
|
32
|
+
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
33
|
+
#
|
34
|
+
# This program is free software; you can redistribute it and/or modify it
|
35
|
+
# under the terms of the GNU General Public License as published by the
|
36
|
+
# Free Software Foundation; either version 3 of the License, or (at your
|
37
|
+
# option) any later version.
|
38
|
+
#
|
39
|
+
# This program is distributed in the hope that it will be useful, but
|
40
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
41
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
42
|
+
# Public License for more details.
|
43
|
+
#
|
44
|
+
# You should have received a copy of the GNU General Public License along
|
45
|
+
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
46
|
+
#
|
47
|
+
# As a special exception, the respective Autoconf Macro's copyright owner
|
48
|
+
# gives unlimited permission to copy, distribute and modify the configure
|
49
|
+
# scripts that are the output of Autoconf when processing the Macro. You
|
50
|
+
# need not follow the terms of the GNU General Public License when using
|
51
|
+
# or distributing such scripts, even though portions of the text of the
|
52
|
+
# Macro appear in them. The GNU General Public License (GPL) does govern
|
53
|
+
# all other use of the material that constitutes the Autoconf Macro.
|
54
|
+
#
|
55
|
+
# This special exception to the GPL applies to versions of the Autoconf
|
56
|
+
# Macro released by the Autoconf Archive. When you make and distribute a
|
57
|
+
# modified version of the Autoconf Macro, you may extend this special
|
58
|
+
# exception to the GPL to apply to your modified version as well.
|
59
|
+
|
60
|
+
#serial 9
|
61
|
+
|
62
|
+
AC_DEFUN([AX_CONFIGURE_ARGS],[
|
63
|
+
# [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
|
64
|
+
if test "${ac_configure_args+set}" != "set" ; then
|
65
|
+
ac_configure_args=
|
66
|
+
for ac_arg in ${1+"[$]@"}; do
|
67
|
+
ac_configure_args="$ac_configure_args '$ac_arg'"
|
68
|
+
done
|
69
|
+
fi
|
70
|
+
])
|
@@ -0,0 +1,300 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# http://www.gnu.org/software/autoconf-archive/ax_enable_builddir.html
|
3
|
+
# ===========================================================================
|
4
|
+
#
|
5
|
+
# SYNOPSIS
|
6
|
+
#
|
7
|
+
# AX_ENABLE_BUILDDIR [(dirstring-or-command [,Makefile.mk [,-all]])]
|
8
|
+
#
|
9
|
+
# DESCRIPTION
|
10
|
+
#
|
11
|
+
# If the current configure was run within the srcdir then we move all
|
12
|
+
# configure-files into a subdir and let the configure steps continue
|
13
|
+
# there. We provide an option --disable-builddir to suppress the move into
|
14
|
+
# a separate builddir.
|
15
|
+
#
|
16
|
+
# Defaults:
|
17
|
+
#
|
18
|
+
# $1 = $host (overridden with $HOST)
|
19
|
+
# $2 = Makefile.mk
|
20
|
+
# $3 = -all
|
21
|
+
#
|
22
|
+
# This macro must be called before AM_INIT_AUTOMAKE. It creates a default
|
23
|
+
# toplevel srcdir Makefile from the information found in the created
|
24
|
+
# toplevel builddir Makefile. It just copies the variables and
|
25
|
+
# rule-targets, each extended with a default rule-execution that recurses
|
26
|
+
# into the build directory of the current "HOST". You can override the
|
27
|
+
# auto-dection through `config.guess` and build-time of course, as in
|
28
|
+
#
|
29
|
+
# make HOST=i386-mingw-cross
|
30
|
+
#
|
31
|
+
# which can of course set at configure time as well using
|
32
|
+
#
|
33
|
+
# configure --host=i386-mingw-cross
|
34
|
+
#
|
35
|
+
# After the default has been created, additional rules can be appended
|
36
|
+
# that will not just recurse into the subdirectories and only ever exist
|
37
|
+
# in the srcdir toplevel makefile - these parts are read from the $2 =
|
38
|
+
# Makefile.mk file
|
39
|
+
#
|
40
|
+
# The automatic rules are usually scanning the toplevel Makefile for lines
|
41
|
+
# like '#### $host |$builddir' to recognize the place where to recurse
|
42
|
+
# into. Usually, the last one is the only one used. However, almost all
|
43
|
+
# targets have an additional "*-all" rule which makes the script to
|
44
|
+
# recurse into _all_ variants of the current HOST (!!) setting. The "-all"
|
45
|
+
# suffix can be overriden for the macro as well.
|
46
|
+
#
|
47
|
+
# a special rule is only given for things like "dist" that will copy the
|
48
|
+
# tarball from the builddir to the sourcedir (or $(PUB)) for reason of
|
49
|
+
# convenience.
|
50
|
+
#
|
51
|
+
# LICENSE
|
52
|
+
#
|
53
|
+
# Copyright (c) 2009 Guido U. Draheim <guidod@gmx.de>
|
54
|
+
# Copyright (c) 2009 Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
55
|
+
#
|
56
|
+
# This program is free software; you can redistribute it and/or modify it
|
57
|
+
# under the terms of the GNU General Public License as published by the
|
58
|
+
# Free Software Foundation; either version 3 of the License, or (at your
|
59
|
+
# option) any later version.
|
60
|
+
#
|
61
|
+
# This program is distributed in the hope that it will be useful, but
|
62
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
63
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
64
|
+
# Public License for more details.
|
65
|
+
#
|
66
|
+
# You should have received a copy of the GNU General Public License along
|
67
|
+
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
68
|
+
#
|
69
|
+
# As a special exception, the respective Autoconf Macro's copyright owner
|
70
|
+
# gives unlimited permission to copy, distribute and modify the configure
|
71
|
+
# scripts that are the output of Autoconf when processing the Macro. You
|
72
|
+
# need not follow the terms of the GNU General Public License when using
|
73
|
+
# or distributing such scripts, even though portions of the text of the
|
74
|
+
# Macro appear in them. The GNU General Public License (GPL) does govern
|
75
|
+
# all other use of the material that constitutes the Autoconf Macro.
|
76
|
+
#
|
77
|
+
# This special exception to the GPL applies to versions of the Autoconf
|
78
|
+
# Macro released by the Autoconf Archive. When you make and distribute a
|
79
|
+
# modified version of the Autoconf Macro, you may extend this special
|
80
|
+
# exception to the GPL to apply to your modified version as well.
|
81
|
+
|
82
|
+
#serial 22
|
83
|
+
|
84
|
+
AC_DEFUN([AX_ENABLE_BUILDDIR],[
|
85
|
+
AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
|
86
|
+
AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
|
87
|
+
AC_REQUIRE([AM_AUX_DIR_EXPAND])[]dnl
|
88
|
+
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
|
89
|
+
AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
|
90
|
+
AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
|
91
|
+
AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
|
92
|
+
SUB="."
|
93
|
+
AC_ARG_ENABLE([builddir], AS_HELP_STRING(
|
94
|
+
[--disable-builddir],[disable automatic build in subdir of sources])
|
95
|
+
,[SUB="$enableval"], [SUB="auto"])
|
96
|
+
if test ".$ac_srcdir_defaulted" != ".no" ; then
|
97
|
+
if test ".$srcdir" = ".." ; then
|
98
|
+
if test -f config.status ; then
|
99
|
+
AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build)
|
100
|
+
else
|
101
|
+
test ".$SUB" = "." && SUB="."
|
102
|
+
test ".$SUB" = ".no" && SUB="."
|
103
|
+
test ".$TARGET" = "." && TARGET="$target"
|
104
|
+
test ".$SUB" = ".auto" && SUB="m4_ifval([$1], [$1],[$TARGET])"
|
105
|
+
if test ".$SUB" != ".." ; then # we know where to go and
|
106
|
+
AS_MKDIR_P([$SUB])
|
107
|
+
echo __.$SUB.__ > $SUB/conftest.tmp
|
108
|
+
cd $SUB
|
109
|
+
if grep __.$SUB.__ conftest.tmp >/dev/null 2>/dev/null ; then
|
110
|
+
rm conftest.tmp
|
111
|
+
AC_MSG_RESULT([continue configure in default builddir "./$SUB"])
|
112
|
+
else
|
113
|
+
AC_MSG_ERROR([could not change to default builddir "./$SUB"])
|
114
|
+
fi
|
115
|
+
srcdir=`echo "$SUB" |
|
116
|
+
sed -e 's,^\./,,;s,[[^/]]$,&/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
|
117
|
+
# going to restart from subdirectory location
|
118
|
+
test -f $srcdir/config.log && mv $srcdir/config.log .
|
119
|
+
test -f $srcdir/confdefs.h && mv $srcdir/confdefs.h .
|
120
|
+
test -f $srcdir/conftest.log && mv $srcdir/conftest.log .
|
121
|
+
test -f $srcdir/$cache_file && mv $srcdir/$cache_file .
|
122
|
+
AC_MSG_RESULT(....exec $SHELL $srcdir/[$]0 "--srcdir=$srcdir" "--enable-builddir=$SUB" ${1+"[$]@"})
|
123
|
+
case "[$]0" in # restart
|
124
|
+
[/\\]*) eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
|
125
|
+
*) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
|
126
|
+
esac ; exit $?
|
127
|
+
fi
|
128
|
+
fi
|
129
|
+
fi fi
|
130
|
+
test ".$SUB" = ".auto" && SUB="."
|
131
|
+
dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec"
|
132
|
+
AC_PATH_PROG(SED,gsed sed, sed)
|
133
|
+
AUX="$am_aux_dir"
|
134
|
+
AS_VAR_POPDEF([SED])dnl
|
135
|
+
AS_VAR_POPDEF([AUX])dnl
|
136
|
+
AS_VAR_POPDEF([SUB])dnl
|
137
|
+
AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
|
138
|
+
AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
|
139
|
+
AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
|
140
|
+
AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
|
141
|
+
AS_VAR_PUSHDEF([AUX],[ax_enable_builddir_auxdir])dnl
|
142
|
+
AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
|
143
|
+
pushdef([END],[Makefile.mk])dnl
|
144
|
+
pushdef([_ALL],[ifelse([$3],,[-all],[$3])])dnl
|
145
|
+
SRC="$ax_enable_builddir_srcdir"
|
146
|
+
if test ".$SUB" = ".." ; then
|
147
|
+
if test -f "$TOP/Makefile" ; then
|
148
|
+
AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
|
149
|
+
else
|
150
|
+
AC_MSG_NOTICE([skipping TOP/Makefile - not created])
|
151
|
+
fi
|
152
|
+
else
|
153
|
+
if test -f "$SRC/Makefile" ; then
|
154
|
+
a=`grep "^VERSION " "$SRC/Makefile"` ; b=`grep "^VERSION " Makefile`
|
155
|
+
test "$a" != "$b" && rm "$SRC/Makefile"
|
156
|
+
fi
|
157
|
+
if test -f "$SRC/Makefile" ; then
|
158
|
+
echo "$SRC/Makefile : $SRC/Makefile.in" > $tmp/conftemp.mk
|
159
|
+
echo " []@ echo 'REMOVED,,,' >\$[]@" >> $tmp/conftemp.mk
|
160
|
+
eval "${MAKE-make} -f $tmp/conftemp.mk 2>/dev/null >/dev/null"
|
161
|
+
if grep '^REMOVED,,,' "$SRC/Makefile" >/dev/null
|
162
|
+
then rm $SRC/Makefile ; fi
|
163
|
+
cp $tmp/conftemp.mk $SRC/makefiles.mk~ ## DEBUGGING
|
164
|
+
fi
|
165
|
+
if test ! -f "$SRC/Makefile" ; then
|
166
|
+
AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
|
167
|
+
x='`' ; cat >$tmp/conftemp.sed <<_EOF
|
168
|
+
/^\$/n
|
169
|
+
x
|
170
|
+
/^\$/bS
|
171
|
+
x
|
172
|
+
/\\\\\$/{H;d;}
|
173
|
+
{H;s/.*//;x;}
|
174
|
+
bM
|
175
|
+
:S
|
176
|
+
x
|
177
|
+
/\\\\\$/{h;d;}
|
178
|
+
{h;s/.*//;x;}
|
179
|
+
:M
|
180
|
+
s/\\(\\n\\) /\\1 /g
|
181
|
+
/^ /d
|
182
|
+
/^[[ ]]*[[\\#]]/d
|
183
|
+
/^VPATH *=/d
|
184
|
+
s/^srcdir *=.*/srcdir = ./
|
185
|
+
s/^top_srcdir *=.*/top_srcdir = ./
|
186
|
+
/[[:=]]/!d
|
187
|
+
/^\\./d
|
188
|
+
dnl Now handle rules (i.e. lines containing ":" but not " = ").
|
189
|
+
/ = /b
|
190
|
+
/ .= /b
|
191
|
+
/:/!b
|
192
|
+
s/:.*/:/
|
193
|
+
s/ / /g
|
194
|
+
s/ \\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/ \\1 \\1[]_ALL\\2/g
|
195
|
+
s/^\\([[a-z]][[a-z-]]*[[a-zA-Z0-9]]\\)\\([[ :]]\\)/\\1 \\1[]_ALL\\2/
|
196
|
+
s/ / /g
|
197
|
+
/^all all[]_ALL[[ :]]/i\\
|
198
|
+
all-configured : all[]_ALL
|
199
|
+
dnl dist-all exists... and would make for dist-all-all
|
200
|
+
s/ [[a-zA-Z0-9-]]*[]_ALL [[a-zA-Z0-9-]]*[]_ALL[]_ALL//g
|
201
|
+
/[]_ALL[]_ALL/d
|
202
|
+
a\\
|
203
|
+
@ HOST="\$(HOST)\" \\\\\\
|
204
|
+
; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
|
205
|
+
; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
|
206
|
+
; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
|
207
|
+
; echo "MAKE \$\$HOST : \$\$n * \$\@"; if test "\$\$n" = "0" ; then : \\\\\\
|
208
|
+
; BUILD=$x grep "^####.*|" Makefile |tail -1| sed -e 's/.*|//' $x ; fi \\\\\\
|
209
|
+
; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
|
210
|
+
; test "\$\$use" = "\$\@" && BUILD=$x echo "\$\$BUILD" | tail -1 $x \\\\\\
|
211
|
+
; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
|
212
|
+
; (cd "\$\$i" && test ! -f configure && \$(MAKE) \$\$use) || exit; done
|
213
|
+
dnl special rule add-on: "dist" copies the tarball to $(PUB). (source tree)
|
214
|
+
/dist[]_ALL *:/a\\
|
215
|
+
@ HOST="\$(HOST)\" \\\\\\
|
216
|
+
; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
|
217
|
+
; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
|
218
|
+
; found=$x echo \$\$BUILD | wc -w $x \\\\\\
|
219
|
+
; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).tar.*" \\\\\\
|
220
|
+
; if test "\$\$found" = "0" ; then : \\\\\\
|
221
|
+
; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
|
222
|
+
; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
|
223
|
+
; for f in \$\$i/\$(PACKAGE)-\$(VERSION).tar.* \\\\\\
|
224
|
+
; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
|
225
|
+
dnl special rule add-on: "dist-foo" copies all the archives to $(PUB). (source tree)
|
226
|
+
/dist-[[a-zA-Z0-9]]*[]_ALL *:/a\\
|
227
|
+
@ HOST="\$(HOST)\" \\\\\\
|
228
|
+
; test ".\$\$HOST" = "." && HOST=$x sh ./config.guess $x \\\\\\
|
229
|
+
; BUILD=$x grep "^#### \$\$HOST " Makefile | sed -e 's/.*|//' $x \\\\\\
|
230
|
+
; found=$x echo \$\$BUILD | wc -w $x \\\\\\
|
231
|
+
; echo "MAKE \$\$HOST : \$\$found \$(PACKAGE)-\$(VERSION).*" \\\\\\
|
232
|
+
; if test "\$\$found" = "0" ; then : \\\\\\
|
233
|
+
; BUILD=$x grep "^#### .*|" Makefile |tail -1| sed -e 's/.*|//' $x \\\\\\
|
234
|
+
; fi ; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
|
235
|
+
; for f in \$\$i/\$(PACKAGE)-\$(VERSION).* \\\\\\
|
236
|
+
; do test -f "\$\$f" && mv "\$\$f" \$(PUB). ; done ; break ; done
|
237
|
+
dnl special rule add-on: "distclean" removes all local builddirs completely
|
238
|
+
/distclean[]_ALL *:/a\\
|
239
|
+
@ HOST="\$(HOST)\" \\\\\\
|
240
|
+
; test ".\$\$HOST" = "." && HOST=$x sh $AUX/config.guess $x \\\\\\
|
241
|
+
; BUILD=$x grep "^#### .*|" Makefile | sed -e 's/.*|//' $x \\\\\\
|
242
|
+
; use=$x basename "\$\@" _ALL $x; n=$x echo \$\$BUILD | wc -w $x \\\\\\
|
243
|
+
; echo "MAKE \$\$HOST : \$\$n * \$\@ (all local builds)" \\\\\\
|
244
|
+
; test ".\$\$BUILD" = "." && BUILD="." \\\\\\
|
245
|
+
; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
|
246
|
+
; echo "# rm -r \$\$i"; done ; echo "# (sleep 3)" ; sleep 3 \\\\\\
|
247
|
+
; for i in \$\$BUILD ; do test ".\$\$i" = "." && continue \\\\\\
|
248
|
+
; echo "\$\$i" | grep "^/" > /dev/null && continue \\\\\\
|
249
|
+
; echo "\$\$i" | grep "^../" > /dev/null && continue \\\\\\
|
250
|
+
; echo "rm -r \$\$i"; (rm -r "\$\$i") ; done ; rm Makefile
|
251
|
+
_EOF
|
252
|
+
cp "$tmp/conftemp.sed" "$SRC/makefile.sed~" ## DEBUGGING
|
253
|
+
$SED -f $tmp/conftemp.sed Makefile >$SRC/Makefile
|
254
|
+
if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
|
255
|
+
AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
|
256
|
+
cat $SRC/END >>$SRC/Makefile
|
257
|
+
fi ; xxxx="####"
|
258
|
+
echo "$xxxx CONFIGURATIONS FOR TOPLEVEL MAKEFILE: " >>$SRC/Makefile
|
259
|
+
# sanity check
|
260
|
+
if grep '^; echo "MAKE ' $SRC/Makefile >/dev/null ; then
|
261
|
+
AC_MSG_NOTICE([buggy sed found - it deletes tab in "a" text parts])
|
262
|
+
$SED -e '/^@ HOST=/s/^/ /' -e '/^; /s/^/ /' $SRC/Makefile \
|
263
|
+
>$SRC/Makefile~
|
264
|
+
(test -s $SRC/Makefile~ && mv $SRC/Makefile~ $SRC/Makefile) 2>/dev/null
|
265
|
+
fi
|
266
|
+
else
|
267
|
+
xxxx="\\#\\#\\#\\#"
|
268
|
+
# echo "/^$xxxx *$ax_enable_builddir_host /d" >$tmp/conftemp.sed
|
269
|
+
echo "s!^$xxxx [[^|]]* | *$SUB *\$!$xxxx ...... $SUB!" >$tmp/conftemp.sed
|
270
|
+
$SED -f "$tmp/conftemp.sed" "$SRC/Makefile" >$tmp/mkfile.tmp
|
271
|
+
cp "$tmp/conftemp.sed" "$SRC/makefiles.sed~" ## DEBUGGING
|
272
|
+
cp "$tmp/mkfile.tmp" "$SRC/makefiles.out~" ## DEBUGGING
|
273
|
+
if cmp -s "$SRC/Makefile" "$tmp/mkfile.tmp" 2>/dev/null ; then
|
274
|
+
AC_MSG_NOTICE([keeping TOP/Makefile from earlier configure])
|
275
|
+
rm "$tmp/mkfile.tmp"
|
276
|
+
else
|
277
|
+
AC_MSG_NOTICE([reusing TOP/Makefile from earlier configure])
|
278
|
+
mv "$tmp/mkfile.tmp" "$SRC/Makefile"
|
279
|
+
fi
|
280
|
+
fi
|
281
|
+
AC_MSG_NOTICE([build in $SUB (HOST=$ax_enable_builddir_host)])
|
282
|
+
xxxx="####"
|
283
|
+
echo "$xxxx" "$ax_enable_builddir_host" "|$SUB" >>$SRC/Makefile
|
284
|
+
fi
|
285
|
+
popdef([END])dnl
|
286
|
+
AS_VAR_POPDEF([SED])dnl
|
287
|
+
AS_VAR_POPDEF([AUX])dnl
|
288
|
+
AS_VAR_POPDEF([SRC])dnl
|
289
|
+
AS_VAR_POPDEF([TOP])dnl
|
290
|
+
AS_VAR_POPDEF([SUB])dnl
|
291
|
+
],[dnl
|
292
|
+
ax_enable_builddir_srcdir="$srcdir" # $srcdir
|
293
|
+
ax_enable_builddir_host="$HOST" # $HOST / $host
|
294
|
+
ax_enable_builddir_version="$VERSION" # $VERSION
|
295
|
+
ax_enable_builddir_package="$PACKAGE" # $PACKAGE
|
296
|
+
ax_enable_builddir_auxdir="$ax_enable_builddir_auxdir" # $AUX
|
297
|
+
ax_enable_builddir_sed="$ax_enable_builddir_sed" # $SED
|
298
|
+
ax_enable_builddir="$ax_enable_builddir" # $SUB
|
299
|
+
])dnl
|
300
|
+
])
|
@@ -0,0 +1,215 @@
|
|
1
|
+
# ===========================================================================
|
2
|
+
# http://www.gnu.org/software/autoconf-archive/ax_gcc_archflag.html
|
3
|
+
# ===========================================================================
|
4
|
+
#
|
5
|
+
# SYNOPSIS
|
6
|
+
#
|
7
|
+
# AX_GCC_ARCHFLAG([PORTABLE?], [ACTION-SUCCESS], [ACTION-FAILURE])
|
8
|
+
#
|
9
|
+
# DESCRIPTION
|
10
|
+
#
|
11
|
+
# This macro tries to guess the "native" arch corresponding to the target
|
12
|
+
# architecture for use with gcc's -march=arch or -mtune=arch flags. If
|
13
|
+
# found, the cache variable $ax_cv_gcc_archflag is set to this flag and
|
14
|
+
# ACTION-SUCCESS is executed; otherwise $ax_cv_gcc_archflag is is set to
|
15
|
+
# "unknown" and ACTION-FAILURE is executed. The default ACTION-SUCCESS is
|
16
|
+
# to add $ax_cv_gcc_archflag to the end of $CFLAGS.
|
17
|
+
#
|
18
|
+
# PORTABLE? should be either [yes] (default) or [no]. In the former case,
|
19
|
+
# the flag is set to -mtune (or equivalent) so that the architecture is
|
20
|
+
# only used for tuning, but the instruction set used is still portable. In
|
21
|
+
# the latter case, the flag is set to -march (or equivalent) so that
|
22
|
+
# architecture-specific instructions are enabled.
|
23
|
+
#
|
24
|
+
# The user can specify --with-gcc-arch=<arch> in order to override the
|
25
|
+
# macro's choice of architecture, or --without-gcc-arch to disable this.
|
26
|
+
#
|
27
|
+
# When cross-compiling, or if $CC is not gcc, then ACTION-FAILURE is
|
28
|
+
# called unless the user specified --with-gcc-arch manually.
|
29
|
+
#
|
30
|
+
# Requires macros: AX_CHECK_COMPILER_FLAGS, AX_GCC_X86_CPUID
|
31
|
+
#
|
32
|
+
# (The main emphasis here is on recent CPUs, on the principle that doing
|
33
|
+
# high-performance computing on old hardware is uncommon.)
|
34
|
+
#
|
35
|
+
# LICENSE
|
36
|
+
#
|
37
|
+
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
38
|
+
# Copyright (c) 2008 Matteo Frigo
|
39
|
+
#
|
40
|
+
# This program is free software: you can redistribute it and/or modify it
|
41
|
+
# under the terms of the GNU General Public License as published by the
|
42
|
+
# Free Software Foundation, either version 3 of the License, or (at your
|
43
|
+
# option) any later version.
|
44
|
+
#
|
45
|
+
# This program is distributed in the hope that it will be useful, but
|
46
|
+
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
47
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
48
|
+
# Public License for more details.
|
49
|
+
#
|
50
|
+
# You should have received a copy of the GNU General Public License along
|
51
|
+
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
52
|
+
#
|
53
|
+
# As a special exception, the respective Autoconf Macro's copyright owner
|
54
|
+
# gives unlimited permission to copy, distribute and modify the configure
|
55
|
+
# scripts that are the output of Autoconf when processing the Macro. You
|
56
|
+
# need not follow the terms of the GNU General Public License when using
|
57
|
+
# or distributing such scripts, even though portions of the text of the
|
58
|
+
# Macro appear in them. The GNU General Public License (GPL) does govern
|
59
|
+
# all other use of the material that constitutes the Autoconf Macro.
|
60
|
+
#
|
61
|
+
# This special exception to the GPL applies to versions of the Autoconf
|
62
|
+
# Macro released by the Autoconf Archive. When you make and distribute a
|
63
|
+
# modified version of the Autoconf Macro, you may extend this special
|
64
|
+
# exception to the GPL to apply to your modified version as well.
|
65
|
+
|
66
|
+
#serial 8
|
67
|
+
|
68
|
+
AC_DEFUN([AX_GCC_ARCHFLAG],
|
69
|
+
[AC_REQUIRE([AC_PROG_CC])
|
70
|
+
AC_REQUIRE([AC_CANONICAL_HOST])
|
71
|
+
|
72
|
+
AC_ARG_WITH(gcc-arch, [AS_HELP_STRING([--with-gcc-arch=<arch>], [use architecture <arch> for gcc -march/-mtune, instead of guessing])],
|
73
|
+
ax_gcc_arch=$withval, ax_gcc_arch=yes)
|
74
|
+
|
75
|
+
AC_MSG_CHECKING([for gcc architecture flag])
|
76
|
+
AC_MSG_RESULT([])
|
77
|
+
AC_CACHE_VAL(ax_cv_gcc_archflag,
|
78
|
+
[
|
79
|
+
ax_cv_gcc_archflag="unknown"
|
80
|
+
|
81
|
+
if test "$GCC" = yes; then
|
82
|
+
|
83
|
+
if test "x$ax_gcc_arch" = xyes; then
|
84
|
+
ax_gcc_arch=""
|
85
|
+
if test "$cross_compiling" = no; then
|
86
|
+
case $host_cpu in
|
87
|
+
i[[3456]]86*|x86_64*) # use cpuid codes, in part from x86info-1.7 by D. Jones
|
88
|
+
AX_GCC_X86_CPUID(0)
|
89
|
+
AX_GCC_X86_CPUID(1)
|
90
|
+
case $ax_cv_gcc_x86_cpuid_0 in
|
91
|
+
*:756e6547:*:*) # Intel
|
92
|
+
case $ax_cv_gcc_x86_cpuid_1 in
|
93
|
+
*5[[48]]?:*:*:*) ax_gcc_arch="pentium-mmx pentium" ;;
|
94
|
+
*5??:*:*:*) ax_gcc_arch=pentium ;;
|
95
|
+
*6[[3456]]?:*:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
|
96
|
+
*6a?:*[[01]]:*:*) ax_gcc_arch="pentium2 pentiumpro" ;;
|
97
|
+
*6a?:*[[234]]:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
|
98
|
+
*6[[9d]]?:*:*:*) ax_gcc_arch="pentium-m pentium3 pentiumpro" ;;
|
99
|
+
*6[[78b]]?:*:*:*) ax_gcc_arch="pentium3 pentiumpro" ;;
|
100
|
+
*6??:*:*:*) ax_gcc_arch=pentiumpro ;;
|
101
|
+
*f3[[347]]:*:*:*|*f4[1347]:*:*:*)
|
102
|
+
case $host_cpu in
|
103
|
+
x86_64*) ax_gcc_arch="nocona pentium4 pentiumpro" ;;
|
104
|
+
*) ax_gcc_arch="prescott pentium4 pentiumpro" ;;
|
105
|
+
esac ;;
|
106
|
+
*f??:*:*:*) ax_gcc_arch="pentium4 pentiumpro";;
|
107
|
+
esac ;;
|
108
|
+
*:68747541:*:*) # AMD
|
109
|
+
case $ax_cv_gcc_x86_cpuid_1 in
|
110
|
+
*5[[67]]?:*:*:*) ax_gcc_arch=k6 ;;
|
111
|
+
*5[[8d]]?:*:*:*) ax_gcc_arch="k6-2 k6" ;;
|
112
|
+
*5[[9]]?:*:*:*) ax_gcc_arch="k6-3 k6" ;;
|
113
|
+
*60?:*:*:*) ax_gcc_arch=k7 ;;
|
114
|
+
*6[[12]]?:*:*:*) ax_gcc_arch="athlon k7" ;;
|
115
|
+
*6[[34]]?:*:*:*) ax_gcc_arch="athlon-tbird k7" ;;
|
116
|
+
*67?:*:*:*) ax_gcc_arch="athlon-4 athlon k7" ;;
|
117
|
+
*6[[68a]]?:*:*:*)
|
118
|
+
AX_GCC_X86_CPUID(0x80000006) # L2 cache size
|
119
|
+
case $ax_cv_gcc_x86_cpuid_0x80000006 in
|
120
|
+
*:*:*[[1-9a-f]]??????:*) # (L2 = ecx >> 16) >= 256
|
121
|
+
ax_gcc_arch="athlon-xp athlon-4 athlon k7" ;;
|
122
|
+
*) ax_gcc_arch="athlon-4 athlon k7" ;;
|
123
|
+
esac ;;
|
124
|
+
*f[[4cef8b]]?:*:*:*) ax_gcc_arch="athlon64 k8" ;;
|
125
|
+
*f5?:*:*:*) ax_gcc_arch="opteron k8" ;;
|
126
|
+
*f7?:*:*:*) ax_gcc_arch="athlon-fx opteron k8" ;;
|
127
|
+
*f??:*:*:*) ax_gcc_arch="k8" ;;
|
128
|
+
esac ;;
|
129
|
+
*:746e6543:*:*) # IDT
|
130
|
+
case $ax_cv_gcc_x86_cpuid_1 in
|
131
|
+
*54?:*:*:*) ax_gcc_arch=winchip-c6 ;;
|
132
|
+
*58?:*:*:*) ax_gcc_arch=winchip2 ;;
|
133
|
+
*6[[78]]?:*:*:*) ax_gcc_arch=c3 ;;
|
134
|
+
*69?:*:*:*) ax_gcc_arch="c3-2 c3" ;;
|
135
|
+
esac ;;
|
136
|
+
esac
|
137
|
+
if test x"$ax_gcc_arch" = x; then # fallback
|
138
|
+
case $host_cpu in
|
139
|
+
i586*) ax_gcc_arch=pentium ;;
|
140
|
+
i686*) ax_gcc_arch=pentiumpro ;;
|
141
|
+
esac
|
142
|
+
fi
|
143
|
+
;;
|
144
|
+
|
145
|
+
sparc*)
|
146
|
+
AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/])
|
147
|
+
cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null`
|
148
|
+
cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters`
|
149
|
+
case $cputype in
|
150
|
+
*ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;;
|
151
|
+
*ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;;
|
152
|
+
*ultrasparc*) ax_gcc_arch="ultrasparc v9" ;;
|
153
|
+
*supersparc*|*tms390z5[[05]]*) ax_gcc_arch="supersparc v8" ;;
|
154
|
+
*hypersparc*|*rt62[[056]]*) ax_gcc_arch="hypersparc v8" ;;
|
155
|
+
*cypress*) ax_gcc_arch=cypress ;;
|
156
|
+
esac ;;
|
157
|
+
|
158
|
+
alphaev5) ax_gcc_arch=ev5 ;;
|
159
|
+
alphaev56) ax_gcc_arch=ev56 ;;
|
160
|
+
alphapca56) ax_gcc_arch="pca56 ev56" ;;
|
161
|
+
alphapca57) ax_gcc_arch="pca57 pca56 ev56" ;;
|
162
|
+
alphaev6) ax_gcc_arch=ev6 ;;
|
163
|
+
alphaev67) ax_gcc_arch=ev67 ;;
|
164
|
+
alphaev68) ax_gcc_arch="ev68 ev67" ;;
|
165
|
+
alphaev69) ax_gcc_arch="ev69 ev68 ev67" ;;
|
166
|
+
alphaev7) ax_gcc_arch="ev7 ev69 ev68 ev67" ;;
|
167
|
+
alphaev79) ax_gcc_arch="ev79 ev7 ev69 ev68 ev67" ;;
|
168
|
+
|
169
|
+
powerpc*)
|
170
|
+
cputype=`((grep cpu /proc/cpuinfo | head -n 1 | cut -d: -f2 | cut -d, -f1 | sed 's/ //g') ; /usr/bin/machine ; /bin/machine; grep CPU /var/run/dmesg.boot | head -n 1 | cut -d" " -f2) 2> /dev/null`
|
171
|
+
cputype=`echo $cputype | sed -e 's/ppc//g;s/ *//g'`
|
172
|
+
case $cputype in
|
173
|
+
*750*) ax_gcc_arch="750 G3" ;;
|
174
|
+
*740[[0-9]]*) ax_gcc_arch="$cputype 7400 G4" ;;
|
175
|
+
*74[[4-5]][[0-9]]*) ax_gcc_arch="$cputype 7450 G4" ;;
|
176
|
+
*74[[0-9]][[0-9]]*) ax_gcc_arch="$cputype G4" ;;
|
177
|
+
*970*) ax_gcc_arch="970 G5 power4";;
|
178
|
+
*POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";;
|
179
|
+
*POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";;
|
180
|
+
603ev|8240) ax_gcc_arch="$cputype 603e 603";;
|
181
|
+
*) ax_gcc_arch=$cputype ;;
|
182
|
+
esac
|
183
|
+
ax_gcc_arch="$ax_gcc_arch powerpc"
|
184
|
+
;;
|
185
|
+
esac
|
186
|
+
fi # not cross-compiling
|
187
|
+
fi # guess arch
|
188
|
+
|
189
|
+
if test "x$ax_gcc_arch" != x -a "x$ax_gcc_arch" != xno; then
|
190
|
+
for arch in $ax_gcc_arch; do
|
191
|
+
if test "x[]m4_default([$1],yes)" = xyes; then # if we require portable code
|
192
|
+
flags="-mtune=$arch"
|
193
|
+
# -mcpu=$arch and m$arch generate nonportable code on every arch except
|
194
|
+
# x86. And some other arches (e.g. Alpha) don't accept -mtune. Grrr.
|
195
|
+
case $host_cpu in i*86|x86_64*) flags="$flags -mcpu=$arch -m$arch";; esac
|
196
|
+
else
|
197
|
+
flags="-march=$arch -mcpu=$arch -m$arch"
|
198
|
+
fi
|
199
|
+
for flag in $flags; do
|
200
|
+
AX_CHECK_COMPILER_FLAGS($flag, [ax_cv_gcc_archflag=$flag; break])
|
201
|
+
done
|
202
|
+
test "x$ax_cv_gcc_archflag" = xunknown || break
|
203
|
+
done
|
204
|
+
fi
|
205
|
+
|
206
|
+
fi # $GCC=yes
|
207
|
+
])
|
208
|
+
AC_MSG_CHECKING([for gcc architecture flag])
|
209
|
+
AC_MSG_RESULT($ax_cv_gcc_archflag)
|
210
|
+
if test "x$ax_cv_gcc_archflag" = xunknown; then
|
211
|
+
m4_default([$3],:)
|
212
|
+
else
|
213
|
+
m4_default([$2], [CFLAGS="$CFLAGS $ax_cv_gcc_archflag"])
|
214
|
+
fi
|
215
|
+
])
|