ffi 1.9.24 → 1.16.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +348 -0
- data/Gemfile +4 -5
- data/README.md +44 -17
- data/Rakefile +74 -148
- data/ext/ffi_c/AbstractMemory.c +89 -70
- data/ext/ffi_c/AbstractMemory.h +3 -2
- data/ext/ffi_c/ArrayType.c +49 -13
- data/ext/ffi_c/ArrayType.h +1 -0
- data/ext/ffi_c/Buffer.c +90 -38
- data/ext/ffi_c/Call.c +55 -56
- data/ext/ffi_c/Call.h +12 -6
- data/ext/ffi_c/ClosurePool.c +333 -0
- data/ext/ffi_c/{Closure.h → ClosurePool.h} +25 -13
- data/ext/ffi_c/DynamicLibrary.c +91 -33
- data/ext/ffi_c/Function.c +306 -235
- data/ext/ffi_c/Function.h +3 -5
- data/ext/ffi_c/FunctionInfo.c +87 -32
- data/ext/ffi_c/LastError.c +74 -15
- data/ext/ffi_c/LongDouble.c +12 -10
- data/ext/ffi_c/LongDouble.h +0 -4
- data/ext/ffi_c/MappedType.c +66 -23
- data/ext/ffi_c/MappedType.h +0 -2
- data/ext/ffi_c/MemoryPointer.c +37 -15
- data/ext/ffi_c/MemoryPointer.h +0 -4
- data/ext/ffi_c/MethodHandle.c +265 -38
- data/ext/ffi_c/MethodHandle.h +3 -2
- data/ext/ffi_c/Platform.c +5 -56
- data/ext/ffi_c/Pointer.c +93 -55
- data/ext/ffi_c/Pointer.h +1 -4
- data/ext/ffi_c/Struct.c +202 -134
- data/ext/ffi_c/Struct.h +18 -9
- data/ext/ffi_c/StructByValue.c +50 -23
- data/ext/ffi_c/StructLayout.c +135 -64
- data/ext/ffi_c/Thread.c +4 -228
- data/ext/ffi_c/Thread.h +1 -20
- data/ext/ffi_c/Type.c +105 -55
- data/ext/ffi_c/Type.h +3 -2
- data/ext/ffi_c/Types.c +8 -9
- data/ext/ffi_c/Types.h +3 -4
- data/ext/ffi_c/Variadic.c +88 -47
- data/ext/ffi_c/compat.h +26 -22
- data/ext/ffi_c/extconf.rb +75 -32
- data/ext/ffi_c/ffi.c +9 -10
- data/ext/ffi_c/libffi/.appveyor/site.exp +16 -0
- data/ext/ffi_c/libffi/.appveyor/unix-noexec.exp +7 -0
- data/ext/ffi_c/libffi/.appveyor.yml +53 -19
- data/ext/ffi_c/libffi/.ci/bfin-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/build-cross-in-container.sh +18 -0
- data/ext/ffi_c/libffi/.ci/build-in-container.sh +10 -0
- data/ext/ffi_c/libffi/.ci/build.sh +124 -0
- data/ext/ffi_c/libffi/.ci/install.sh +78 -0
- data/ext/ffi_c/libffi/.ci/m32r-sim.exp +58 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/moxie-sim.exp +1 -1
- data/ext/ffi_c/libffi/.ci/msvs-detect +1103 -0
- data/ext/ffi_c/libffi/.ci/or1k-sim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/powerpc-eabisim.exp +58 -0
- data/ext/ffi_c/libffi/.ci/site.exp +29 -0
- data/ext/ffi_c/libffi/.ci/wine-sim.exp +55 -0
- data/ext/ffi_c/libffi/.circleci/config.yml +156 -0
- data/ext/ffi_c/libffi/.gitattributes +4 -0
- data/ext/ffi_c/libffi/.github/workflows/build.yml +460 -0
- data/ext/ffi_c/libffi/.github/workflows/emscripten.yml +171 -0
- data/ext/ffi_c/libffi/.gitignore +10 -2
- data/ext/ffi_c/libffi/{ChangeLog.libffi-3.1 → ChangeLog.old} +1407 -0
- data/ext/ffi_c/libffi/LICENSE +1 -1
- data/ext/ffi_c/libffi/LICENSE-BUILDTOOLS +5 -4
- data/ext/ffi_c/libffi/Makefile.am +64 -73
- data/ext/ffi_c/libffi/Makefile.in +553 -235
- data/ext/ffi_c/libffi/README.md +165 -100
- data/ext/ffi_c/libffi/acinclude.m4 +10 -112
- data/ext/ffi_c/libffi/compile +348 -0
- data/ext/ffi_c/libffi/config.guess +950 -662
- data/ext/ffi_c/libffi/config.sub +1362 -1306
- data/ext/ffi_c/libffi/configure +4909 -4096
- data/ext/ffi_c/libffi/configure.ac +93 -32
- data/ext/ffi_c/libffi/configure.host +76 -28
- data/ext/ffi_c/libffi/doc/Makefile.in +15 -8
- data/ext/ffi_c/libffi/doc/libffi.texi +107 -46
- data/ext/ffi_c/libffi/doc/version.texi +4 -4
- data/ext/ffi_c/libffi/fficonfig.h.in +22 -44
- data/ext/ffi_c/libffi/generate-darwin-source-and-headers.py +165 -56
- data/ext/ffi_c/libffi/include/Makefile.am +1 -1
- data/ext/ffi_c/libffi/include/Makefile.in +17 -12
- data/ext/ffi_c/libffi/include/ffi.h.in +64 -48
- data/ext/ffi_c/libffi/include/ffi_cfi.h +21 -0
- data/ext/ffi_c/libffi/include/ffi_common.h +34 -1
- data/ext/ffi_c/libffi/include/tramp.h +45 -0
- data/ext/ffi_c/libffi/install-sh +107 -74
- data/ext/ffi_c/libffi/libffi.map.in +8 -12
- data/ext/ffi_c/libffi/libffi.xcodeproj/project.pbxproj +2 -48
- data/ext/ffi_c/libffi/libtool-version +2 -2
- data/ext/ffi_c/libffi/ltmain.sh +576 -284
- data/ext/ffi_c/libffi/m4/asmcfi.m4 +1 -1
- data/ext/ffi_c/libffi/m4/ax_append_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_cc_maxopt.m4 +18 -14
- data/ext/ffi_c/libffi/m4/ax_cflags_warn_all.m4 +108 -72
- data/ext/ffi_c/libffi/m4/ax_check_compile_flag.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_compiler_vendor.m4 +76 -44
- data/ext/ffi_c/libffi/m4/ax_configure_args.m4 +5 -26
- data/ext/ffi_c/libffi/m4/ax_gcc_archflag.m4 +7 -3
- data/ext/ffi_c/libffi/m4/ax_prepend_flag.m4 +51 -0
- data/ext/ffi_c/libffi/make_sunver.pl +333 -0
- data/ext/ffi_c/libffi/man/Makefile.in +15 -8
- data/ext/ffi_c/libffi/missing +8 -8
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.sln +33 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj +130 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.filters +57 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/Ffi_staticLib.vcxproj.user +4 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/ffi.h +511 -0
- data/ext/ffi_c/libffi/msvc_build/aarch64/aarch64_include/fficonfig.h +219 -0
- data/ext/ffi_c/libffi/msvcc.sh +39 -14
- data/ext/ffi_c/libffi/src/aarch64/ffi.c +286 -98
- data/ext/ffi_c/libffi/src/aarch64/ffitarget.h +19 -3
- data/ext/ffi_c/libffi/src/aarch64/internal.h +33 -0
- data/ext/ffi_c/libffi/src/aarch64/sysv.S +142 -37
- data/ext/ffi_c/libffi/src/aarch64/win64_armasm.S +506 -0
- data/ext/ffi_c/libffi/src/arc/arcompact.S +169 -94
- data/ext/ffi_c/libffi/src/arc/ffi.c +325 -148
- data/ext/ffi_c/libffi/src/arc/ffitarget.h +14 -0
- data/ext/ffi_c/libffi/src/arm/ffi.c +112 -10
- data/ext/ffi_c/libffi/src/arm/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/arm/internal.h +10 -0
- data/ext/ffi_c/libffi/src/arm/sysv.S +117 -44
- data/ext/ffi_c/libffi/src/arm/sysv_msvc_arm32.S +311 -0
- data/ext/ffi_c/libffi/src/closures.c +189 -48
- data/ext/ffi_c/libffi/src/csky/ffi.c +395 -0
- data/ext/ffi_c/libffi/src/csky/ffitarget.h +63 -0
- data/ext/ffi_c/libffi/src/csky/sysv.S +371 -0
- data/ext/ffi_c/libffi/src/dlmalloc.c +6 -1
- data/ext/ffi_c/libffi/src/frv/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/ia64/ffi.c +12 -0
- data/ext/ffi_c/libffi/src/ia64/unix.S +20 -2
- data/ext/ffi_c/libffi/src/kvx/asm.h +5 -0
- data/ext/ffi_c/libffi/src/kvx/ffi.c +273 -0
- data/ext/ffi_c/libffi/src/kvx/ffitarget.h +75 -0
- data/ext/ffi_c/libffi/src/kvx/sysv.S +127 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffi.c +621 -0
- data/ext/ffi_c/libffi/src/loongarch64/ffitarget.h +82 -0
- data/ext/ffi_c/libffi/src/loongarch64/sysv.S +327 -0
- data/ext/ffi_c/libffi/src/m32r/ffi.c +31 -14
- data/ext/ffi_c/libffi/src/metag/ffi.c +1 -1
- data/ext/ffi_c/libffi/src/mips/ffi.c +245 -66
- data/ext/ffi_c/libffi/src/mips/ffitarget.h +8 -1
- data/ext/ffi_c/libffi/src/mips/n32.S +137 -28
- data/ext/ffi_c/libffi/src/mips/o32.S +63 -4
- data/ext/ffi_c/libffi/src/moxie/ffi.c +48 -23
- data/ext/ffi_c/libffi/src/or1k/ffi.c +25 -12
- data/ext/ffi_c/libffi/src/pa/ffi.c +62 -108
- data/ext/ffi_c/libffi/src/pa/ffi64.c +614 -0
- data/ext/ffi_c/libffi/src/pa/ffitarget.h +20 -11
- data/ext/ffi_c/libffi/src/pa/hpux32.S +87 -38
- data/ext/ffi_c/libffi/src/pa/hpux64.S +681 -0
- data/ext/ffi_c/libffi/src/pa/linux.S +109 -39
- data/ext/ffi_c/libffi/src/powerpc/ffi.c +6 -4
- data/ext/ffi_c/libffi/src/powerpc/ffi_darwin.c +13 -1
- data/ext/ffi_c/libffi/src/powerpc/ffi_linux64.c +211 -32
- data/ext/ffi_c/libffi/src/powerpc/ffi_powerpc.h +18 -7
- data/ext/ffi_c/libffi/src/powerpc/ffitarget.h +10 -4
- data/ext/ffi_c/libffi/src/powerpc/linux64.S +93 -28
- data/ext/ffi_c/libffi/src/powerpc/linux64_closure.S +83 -5
- data/ext/ffi_c/libffi/src/powerpc/sysv.S +5 -7
- data/ext/ffi_c/libffi/src/powerpc/t-aix +5 -0
- data/ext/ffi_c/libffi/src/prep_cif.c +26 -4
- data/ext/ffi_c/libffi/src/riscv/ffi.c +79 -10
- data/ext/ffi_c/libffi/src/riscv/ffitarget.h +1 -0
- data/ext/ffi_c/libffi/src/riscv/sysv.S +86 -7
- data/ext/ffi_c/libffi/src/sparc/ffi64.c +16 -0
- data/ext/ffi_c/libffi/src/tramp.c +716 -0
- data/ext/ffi_c/libffi/src/wasm32/ffi.c +934 -0
- data/ext/ffi_c/libffi/src/wasm32/ffitarget.h +62 -0
- data/ext/ffi_c/libffi/src/x86/ffi.c +128 -49
- data/ext/ffi_c/libffi/src/x86/ffi64.c +89 -23
- data/ext/ffi_c/libffi/src/x86/ffitarget.h +21 -4
- data/ext/ffi_c/libffi/src/x86/ffiw64.c +63 -10
- data/ext/ffi_c/libffi/src/x86/internal.h +14 -0
- data/ext/ffi_c/libffi/src/x86/internal64.h +14 -0
- data/ext/ffi_c/libffi/src/x86/sysv.S +274 -45
- data/ext/ffi_c/libffi/src/x86/sysv_intel.S +998 -0
- data/ext/ffi_c/libffi/src/x86/unix64.S +190 -4
- data/ext/ffi_c/libffi/src/x86/win64.S +32 -10
- data/ext/ffi_c/libffi/src/x86/win64_intel.S +3 -2
- data/ext/ffi_c/libffi/src/xtensa/ffi.c +16 -8
- data/ext/ffi_c/libffi/src/xtensa/ffitarget.h +4 -0
- data/ext/ffi_c/libffi/src/xtensa/sysv.S +26 -16
- data/ext/ffi_c/libffi/testsuite/Makefile.am +127 -109
- data/ext/ffi_c/libffi/testsuite/Makefile.in +144 -88
- data/ext/ffi_c/libffi/testsuite/emscripten/build-tests.sh +54 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/build.sh +63 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/conftest.py +80 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/node-tests.sh +48 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test.html +7 -0
- data/ext/ffi_c/libffi/testsuite/emscripten/test_libffi.py +51 -0
- data/ext/ffi_c/libffi/testsuite/lib/libffi.exp +71 -25
- data/ext/ffi_c/libffi/testsuite/lib/target-libpath.exp +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/bhaible.exp +7 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-call.c +5 -4
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/test-callback.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.bhaible/testcases.c +5 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/bpo_38748.c +41 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/call.exp +12 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/ffitest.h +28 -3
- data/ext/ffi_c/libffi/testsuite/libffi.call/float2.c +9 -8
- data/ext/ffi_c/libffi/testsuite/libffi.call/float_va.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ll1.c +5 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_sl.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/return_ul.c +4 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/s55.c +60 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen.c +8 -9
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen2.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen3.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/strlen4.c +2 -2
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct10.c +1 -1
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_2.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_3f.c +65 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_4f.c +67 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_big.c +93 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_by_value_small.c +61 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_2H.c +63 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/struct_return_8H.c +90 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_1.c +1 -119
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_2.c +220 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_3.c +154 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct2.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/va_struct3.c +15 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/closure.exp +67 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn0.c +3 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn1.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn2.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn3.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn4.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn5.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_fn6.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_loc_fn0.c +7 -6
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/closure_simple.c +6 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_12byte.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_16byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_18byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_19byte.c +29 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_1_1byte.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_20byte1.c +21 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_24byte.c +35 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_2byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3_1byte.c +19 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte1.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3byte2.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_3float.c +18 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4_1byte.c +22 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_4byte.c +13 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5_1_byte.c +29 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_5byte.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_64byte.c +24 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6_1_byte.c +28 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_6byte.c +24 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7_1_byte.c +39 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_7byte.c +25 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_8byte.c +14 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte1.c +14 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_9byte2.c +14 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_double.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_float.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble.c +20 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split.c +40 -25
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_longdouble_split2.c +40 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_pointer.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint32.c +18 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_sint64.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint16.c +18 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint32.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_align_uint64.c +19 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_dbls_struct.c +3 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double_va.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_float.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble.c +11 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_longdouble_va.c +22 -3
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_schar.c +5 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshort.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_sshortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_uchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushort.c +6 -2
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_multi_ushortchar.c +9 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer.c +5 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_pointer_stack.c +10 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_schar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sint.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_sshort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_struct_va1.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uchar.c +3 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_uint_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulong_va.c +4 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ulonglong.c +2 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_ushort.c +3 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/ffitest.h +1 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/huge_struct.c +24 -22
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct.c +32 -9
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct1.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct10.c +12 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct11.c +21 -5
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct12.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/nested_struct13.c +115 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct2.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct3.c +10 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct4.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct5.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct6.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct7.c +9 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct8.c +11 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/nested_struct9.c +11 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs1.c +86 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs2.c +102 -0
- data/ext/ffi_c/libffi/testsuite/libffi.closures/single_entry_structs3.c +101 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_medium2.c +1 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/testclosure.c +6 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest.cc +2 -1
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/unwindtest_ffi_call.cc +1 -0
- data/ext/ffi_c/libffi.bsd.mk +2 -2
- data/ext/ffi_c/libffi.darwin.mk +1 -1
- data/ext/ffi_c/libffi.gnu.mk +2 -2
- data/ext/ffi_c/rbffi.h +1 -3
- data/ffi.gemspec +15 -9
- data/lib/ffi/abstract_memory.rb +44 -0
- data/lib/ffi/autopointer.rb +8 -23
- data/lib/ffi/compat.rb +43 -0
- data/lib/ffi/data_converter.rb +67 -0
- data/lib/ffi/dynamic_library.rb +89 -0
- data/lib/ffi/enum.rb +18 -11
- data/lib/ffi/ffi.rb +6 -0
- data/lib/ffi/function.rb +71 -0
- data/lib/ffi/io.rb +3 -3
- data/lib/ffi/library.rb +65 -77
- data/lib/ffi/library_path.rb +109 -0
- data/lib/ffi/managedstruct.rb +3 -3
- data/lib/ffi/platform/aarch64-darwin/types.conf +130 -0
- data/lib/ffi/platform/aarch64-freebsd/types.conf +128 -0
- data/lib/ffi/platform/aarch64-freebsd12/types.conf +181 -0
- data/lib/ffi/platform/aarch64-linux/types.conf +81 -81
- data/lib/ffi/platform/aarch64-openbsd/types.conf +134 -0
- data/lib/ffi/platform/aarch64-windows/types.conf +52 -0
- data/lib/ffi/platform/arm-freebsd/types.conf +152 -0
- data/lib/ffi/platform/arm-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/arm-linux/types.conf +110 -82
- data/lib/ffi/platform/hppa1.1-linux/types.conf +178 -0
- data/lib/ffi/platform/hppa2.0-linux/types.conf +178 -0
- data/lib/ffi/platform/i386-cygwin/types.conf +1 -1
- data/lib/ffi/platform/i386-darwin/types.conf +63 -63
- data/lib/ffi/platform/i386-freebsd/types.conf +89 -89
- data/lib/ffi/platform/i386-freebsd12/types.conf +152 -0
- data/lib/ffi/platform/i386-gnu/types.conf +84 -84
- data/lib/ffi/platform/i386-linux/types.conf +77 -77
- data/lib/ffi/platform/i386-netbsd/types.conf +87 -87
- data/lib/ffi/platform/i386-openbsd/types.conf +89 -89
- data/lib/ffi/platform/i386-solaris/types.conf +96 -96
- data/lib/ffi/platform/i386-windows/types.conf +43 -96
- data/lib/ffi/platform/ia64-linux/types.conf +79 -79
- data/lib/ffi/platform/loongarch64-linux/types.conf +141 -0
- data/lib/ffi/platform/mips-linux/types.conf +79 -79
- data/lib/ffi/platform/mips64-linux/types.conf +81 -81
- data/lib/ffi/platform/mips64el-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsel-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa32r6el-linux/types.conf +79 -79
- data/lib/ffi/platform/mipsisa64r6-linux/types.conf +81 -81
- data/lib/ffi/platform/mipsisa64r6el-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc-aix/types.conf +155 -155
- data/lib/ffi/platform/powerpc-darwin/types.conf +63 -63
- data/lib/ffi/platform/powerpc-linux/types.conf +108 -78
- data/lib/ffi/platform/powerpc-openbsd/types.conf +156 -0
- data/lib/ffi/platform/powerpc64-linux/types.conf +81 -81
- data/lib/ffi/platform/powerpc64le-linux/types.conf +100 -0
- data/lib/ffi/platform/riscv64-linux/types.conf +104 -0
- data/lib/ffi/platform/s390-linux/types.conf +79 -79
- data/lib/ffi/platform/s390x-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-linux/types.conf +79 -79
- data/lib/ffi/platform/sparc-solaris/types.conf +103 -103
- data/lib/ffi/platform/sparcv9-openbsd/types.conf +156 -0
- data/lib/ffi/platform/sparcv9-solaris/types.conf +103 -103
- data/lib/ffi/platform/sw_64-linux/types.conf +141 -0
- data/lib/ffi/platform/x86_64-cygwin/types.conf +1 -1
- data/lib/ffi/platform/x86_64-darwin/types.conf +88 -84
- data/lib/ffi/platform/x86_64-dragonflybsd/types.conf +130 -0
- data/lib/ffi/platform/x86_64-freebsd/types.conf +90 -90
- data/lib/ffi/platform/x86_64-freebsd12/types.conf +158 -0
- data/lib/ffi/platform/x86_64-haiku/types.conf +117 -0
- data/lib/ffi/platform/x86_64-linux/types.conf +107 -77
- data/lib/ffi/platform/x86_64-msys/types.conf +119 -0
- data/lib/ffi/platform/x86_64-netbsd/types.conf +89 -89
- data/lib/ffi/platform/x86_64-openbsd/types.conf +86 -86
- data/lib/ffi/platform/x86_64-solaris/types.conf +96 -96
- data/lib/ffi/platform/x86_64-windows/types.conf +42 -110
- data/lib/ffi/platform.rb +43 -20
- data/lib/ffi/pointer.rb +26 -20
- data/lib/ffi/struct.rb +14 -68
- data/lib/ffi/struct_by_reference.rb +72 -0
- data/lib/ffi/struct_layout.rb +96 -0
- data/lib/ffi/struct_layout_builder.rb +1 -1
- data/lib/ffi/tools/const_generator.rb +11 -8
- data/lib/ffi/tools/generator.rb +47 -2
- data/lib/ffi/tools/generator_task.rb +13 -17
- data/lib/ffi/tools/struct_generator.rb +6 -5
- data/lib/ffi/tools/types_generator.rb +7 -4
- data/lib/ffi/types.rb +33 -7
- data/lib/ffi/variadic.rb +20 -18
- data/lib/ffi/version.rb +1 -1
- data/lib/ffi.rb +10 -3
- data/rakelib/ffi_gem_helper.rb +65 -0
- data/samples/getlogin.rb +1 -1
- data/samples/getpid.rb +1 -1
- data/samples/gettimeofday.rb +8 -8
- data/samples/hello.rb +2 -1
- data/samples/hello_ractor.rb +11 -0
- data/samples/inotify.rb +1 -1
- data/samples/pty.rb +1 -2
- data/samples/qsort.rb +0 -1
- data/samples/qsort_ractor.rb +28 -0
- data.tar.gz.sig +0 -0
- metadata +252 -153
- metadata.gz.sig +0 -0
- data/.gitignore +0 -22
- data/.gitmodules +0 -3
- data/.travis.yml +0 -52
- data/.yardopts +0 -5
- data/appveyor.yml +0 -22
- data/ext/ffi_c/Closure.c +0 -54
- data/ext/ffi_c/DataConverter.c +0 -91
- data/ext/ffi_c/StructByReference.c +0 -190
- data/ext/ffi_c/StructByReference.h +0 -50
- data/ext/ffi_c/libffi/.travis/build.sh +0 -34
- data/ext/ffi_c/libffi/.travis/install.sh +0 -22
- data/ext/ffi_c/libffi/.travis/site.exp +0 -18
- data/ext/ffi_c/libffi/.travis.yml +0 -34
- data/ext/ffi_c/libffi/ChangeLog.libffi +0 -584
- data/ext/ffi_c/libffi/ChangeLog.libgcj +0 -40
- data/ext/ffi_c/libffi/ChangeLog.v1 +0 -764
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_uchar_va.c +0 -44
- data/ext/ffi_c/libffi/testsuite/libffi.call/cls_ushort_va.c +0 -44
- data/ext/ffi_c/win32/stdbool.h +0 -8
- data/ext/ffi_c/win32/stdint.h +0 -201
- data/samples/sample_helper.rb +0 -6
- data/ext/ffi_c/libffi/{.travis → .ci}/ar-lib +0 -0
- data/ext/ffi_c/libffi/{.travis → .ci}/compile +0 -0
- data/ext/ffi_c/libffi/testsuite/libffi.call/{pyobjc-tc.c → pyobjc_tc.c} +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_args.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/cls_many_mixed_float_double.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/err_bad_abi.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/problem1.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large.c +0 -0
- data/ext/ffi_c/libffi/testsuite/{libffi.call → libffi.closures}/stret_large2.c +0 -0
- data/lib/ffi/platform/{sparc64-linux → sparcv9-linux}/types.conf +79 -79
data/ext/ffi_c/libffi/ltmain.sh
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
#! /bin/sh
|
1
|
+
#! /usr/bin/env sh
|
2
2
|
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
|
3
|
-
## by inline-source
|
3
|
+
## by inline-source v2019-02-19.15
|
4
4
|
|
5
|
-
# libtool (GNU libtool) 2.4.
|
5
|
+
# libtool (GNU libtool) 2.4.7
|
6
6
|
# Provide generalized library-building support services.
|
7
7
|
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
8
8
|
|
9
|
-
# Copyright (C) 1996-
|
9
|
+
# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
|
10
10
|
# This is free software; see the source for copying conditions. There is NO
|
11
11
|
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
12
12
|
|
@@ -31,8 +31,8 @@
|
|
31
31
|
|
32
32
|
PROGRAM=libtool
|
33
33
|
PACKAGE=libtool
|
34
|
-
VERSION="2.4.
|
35
|
-
package_revision=2.4.
|
34
|
+
VERSION="2.4.7 Debian-2.4.7-5"
|
35
|
+
package_revision=2.4.7
|
36
36
|
|
37
37
|
|
38
38
|
## ------ ##
|
@@ -64,34 +64,25 @@ package_revision=2.4.6
|
|
64
64
|
# libraries, which are installed to $pkgauxdir.
|
65
65
|
|
66
66
|
# Set a version string for this script.
|
67
|
-
scriptversion=
|
67
|
+
scriptversion=2019-02-19.15; # UTC
|
68
68
|
|
69
69
|
# General shell script boiler plate, and helper functions.
|
70
70
|
# Written by Gary V. Vaughan, 2004
|
71
71
|
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
|
81
|
-
#
|
82
|
-
#
|
83
|
-
# you may include this file under the same distribution terms that you use
|
84
|
-
# for the rest of that program.
|
85
|
-
|
86
|
-
# This program is distributed in the hope that it will be useful,
|
87
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
88
|
-
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
|
89
|
-
# General Public License for more details.
|
90
|
-
|
91
|
-
# You should have received a copy of the GNU General Public License
|
92
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
72
|
+
# This is free software. There is NO warranty; not even for
|
73
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
74
|
+
#
|
75
|
+
# Copyright (C) 2004-2019, 2021 Bootstrap Authors
|
76
|
+
#
|
77
|
+
# This file is dual licensed under the terms of the MIT license
|
78
|
+
# <https://opensource.org/license/MIT>, and GPL version 2 or later
|
79
|
+
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
80
|
+
# these licenses when using or redistributing this software or any of
|
81
|
+
# the files within it. See the URLs above, or the file `LICENSE`
|
82
|
+
# included in the Bootstrap distribution for the full license texts.
|
93
83
|
|
94
|
-
# Please report bugs or propose patches to
|
84
|
+
# Please report bugs or propose patches to:
|
85
|
+
# <https://github.com/gnulib-modules/bootstrap/issues>
|
95
86
|
|
96
87
|
|
97
88
|
## ------ ##
|
@@ -139,9 +130,12 @@ do
|
|
139
130
|
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
|
140
131
|
fi"
|
141
132
|
done
|
142
|
-
|
143
|
-
#
|
144
|
-
|
133
|
+
# These NLS vars are set unconditionally (bootstrap issue #24). Unset those
|
134
|
+
# in case the environment reset is needed later and the $save_* variant is not
|
135
|
+
# defined (see the code above).
|
136
|
+
LC_ALL=C
|
137
|
+
LANGUAGE=C
|
138
|
+
export LANGUAGE LC_ALL
|
145
139
|
|
146
140
|
# Make sure IFS has a sensible default
|
147
141
|
sp=' '
|
@@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then
|
|
159
153
|
fi
|
160
154
|
|
161
155
|
|
156
|
+
# func_unset VAR
|
157
|
+
# --------------
|
158
|
+
# Portably unset VAR.
|
159
|
+
# In some shells, an 'unset VAR' statement leaves a non-zero return
|
160
|
+
# status if VAR is already unset, which might be problematic if the
|
161
|
+
# statement is used at the end of a function (thus poisoning its return
|
162
|
+
# value) or when 'set -e' is active (causing even a spurious abort of
|
163
|
+
# the script in this case).
|
164
|
+
func_unset ()
|
165
|
+
{
|
166
|
+
{ eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
|
171
|
+
func_unset CDPATH
|
172
|
+
|
173
|
+
# Make sure ${,E,F}GREP behave sanely.
|
174
|
+
func_unset GREP_OPTIONS
|
175
|
+
|
162
176
|
|
163
177
|
## ------------------------- ##
|
164
178
|
## Locate command utilities. ##
|
@@ -259,7 +273,7 @@ test -z "$SED" && {
|
|
259
273
|
rm -f conftest.in conftest.tmp conftest.nl conftest.out
|
260
274
|
}
|
261
275
|
|
262
|
-
func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
|
276
|
+
func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
|
263
277
|
rm -f conftest.sed
|
264
278
|
SED=$func_path_progs_result
|
265
279
|
}
|
@@ -295,7 +309,7 @@ test -z "$GREP" && {
|
|
295
309
|
rm -f conftest.in conftest.tmp conftest.nl conftest.out
|
296
310
|
}
|
297
311
|
|
298
|
-
func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
|
312
|
+
func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
|
299
313
|
GREP=$func_path_progs_result
|
300
314
|
}
|
301
315
|
|
@@ -360,6 +374,35 @@ sed_double_backslash="\
|
|
360
374
|
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
|
361
375
|
s/\n//g"
|
362
376
|
|
377
|
+
# require_check_ifs_backslash
|
378
|
+
# ---------------------------
|
379
|
+
# Check if we can use backslash as IFS='\' separator, and set
|
380
|
+
# $check_ifs_backshlash_broken to ':' or 'false'.
|
381
|
+
require_check_ifs_backslash=func_require_check_ifs_backslash
|
382
|
+
func_require_check_ifs_backslash ()
|
383
|
+
{
|
384
|
+
_G_save_IFS=$IFS
|
385
|
+
IFS='\'
|
386
|
+
_G_check_ifs_backshlash='a\\b'
|
387
|
+
for _G_i in $_G_check_ifs_backshlash
|
388
|
+
do
|
389
|
+
case $_G_i in
|
390
|
+
a)
|
391
|
+
check_ifs_backshlash_broken=false
|
392
|
+
;;
|
393
|
+
'')
|
394
|
+
break
|
395
|
+
;;
|
396
|
+
*)
|
397
|
+
check_ifs_backshlash_broken=:
|
398
|
+
break
|
399
|
+
;;
|
400
|
+
esac
|
401
|
+
done
|
402
|
+
IFS=$_G_save_IFS
|
403
|
+
require_check_ifs_backslash=:
|
404
|
+
}
|
405
|
+
|
363
406
|
|
364
407
|
## ----------------- ##
|
365
408
|
## Global variables. ##
|
@@ -387,7 +430,7 @@ EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
|
|
387
430
|
# putting '$debug_cmd' at the start of all your functions, you can get
|
388
431
|
# bash to show function call trace with:
|
389
432
|
#
|
390
|
-
# debug_cmd='
|
433
|
+
# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
|
391
434
|
debug_cmd=${debug_cmd-":"}
|
392
435
|
exit_cmd=:
|
393
436
|
|
@@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
|
|
580
623
|
{
|
581
624
|
$debug_cmd
|
582
625
|
|
583
|
-
|
584
|
-
eval "$1+=\\ \$
|
626
|
+
func_quote_arg pretty "$2"
|
627
|
+
eval "$1+=\\ \$func_quote_arg_result"
|
585
628
|
}'
|
586
629
|
else
|
587
630
|
func_append_quoted ()
|
588
631
|
{
|
589
632
|
$debug_cmd
|
590
633
|
|
591
|
-
|
592
|
-
eval "$1=\$$1\\ \$
|
634
|
+
func_quote_arg pretty "$2"
|
635
|
+
eval "$1=\$$1\\ \$func_quote_arg_result"
|
593
636
|
}
|
594
637
|
fi
|
595
638
|
|
@@ -1091,85 +1134,203 @@ func_relative_path ()
|
|
1091
1134
|
}
|
1092
1135
|
|
1093
1136
|
|
1094
|
-
#
|
1095
|
-
#
|
1096
|
-
#
|
1097
|
-
#
|
1098
|
-
#
|
1099
|
-
|
1100
|
-
# ii) func_quote_for_eval_unquoted_result
|
1101
|
-
# has all characters that are still active within double
|
1102
|
-
# quotes backslashified.
|
1103
|
-
func_quote_for_eval ()
|
1137
|
+
# func_quote_portable EVAL ARG
|
1138
|
+
# ----------------------------
|
1139
|
+
# Internal function to portably implement func_quote_arg. Note that we still
|
1140
|
+
# keep attention to performance here so we as much as possible try to avoid
|
1141
|
+
# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
|
1142
|
+
func_quote_portable ()
|
1104
1143
|
{
|
1105
1144
|
$debug_cmd
|
1106
1145
|
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
else
|
1119
|
-
func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
|
1146
|
+
$require_check_ifs_backslash
|
1147
|
+
|
1148
|
+
func_quote_portable_result=$2
|
1149
|
+
|
1150
|
+
# one-time-loop (easy break)
|
1151
|
+
while true
|
1152
|
+
do
|
1153
|
+
if $1; then
|
1154
|
+
func_quote_portable_result=`$ECHO "$2" | $SED \
|
1155
|
+
-e "$sed_double_quote_subst" -e "$sed_double_backslash"`
|
1156
|
+
break
|
1120
1157
|
fi
|
1121
1158
|
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1159
|
+
# Quote for eval.
|
1160
|
+
case $func_quote_portable_result in
|
1161
|
+
*[\\\`\"\$]*)
|
1162
|
+
# Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
|
1163
|
+
# contains the shell wildcard characters.
|
1164
|
+
case $check_ifs_backshlash_broken$func_quote_portable_result in
|
1165
|
+
:*|*[\[\*\?]*)
|
1166
|
+
func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
|
1167
|
+
| $SED "$sed_quote_subst"`
|
1168
|
+
break
|
1169
|
+
;;
|
1170
|
+
esac
|
1171
|
+
|
1172
|
+
func_quote_portable_old_IFS=$IFS
|
1173
|
+
for _G_char in '\' '`' '"' '$'
|
1174
|
+
do
|
1175
|
+
# STATE($1) PREV($2) SEPARATOR($3)
|
1176
|
+
set start "" ""
|
1177
|
+
func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
|
1178
|
+
IFS=$_G_char
|
1179
|
+
for _G_part in $func_quote_portable_result
|
1180
|
+
do
|
1181
|
+
case $1 in
|
1182
|
+
quote)
|
1183
|
+
func_append func_quote_portable_result "$3$2"
|
1184
|
+
set quote "$_G_part" "\\$_G_char"
|
1185
|
+
;;
|
1186
|
+
start)
|
1187
|
+
set first "" ""
|
1188
|
+
func_quote_portable_result=
|
1189
|
+
;;
|
1190
|
+
first)
|
1191
|
+
set quote "$_G_part" ""
|
1192
|
+
;;
|
1193
|
+
esac
|
1194
|
+
done
|
1195
|
+
done
|
1196
|
+
IFS=$func_quote_portable_old_IFS
|
1130
1197
|
;;
|
1131
|
-
*)
|
1132
|
-
_G_quoted_arg=$_G_unquoted_arg
|
1133
|
-
;;
|
1198
|
+
*) ;;
|
1134
1199
|
esac
|
1135
|
-
|
1136
|
-
if test -n "$func_quote_for_eval_result"; then
|
1137
|
-
func_append func_quote_for_eval_result " $_G_quoted_arg"
|
1138
|
-
else
|
1139
|
-
func_append func_quote_for_eval_result "$_G_quoted_arg"
|
1140
|
-
fi
|
1141
|
-
shift
|
1200
|
+
break
|
1142
1201
|
done
|
1202
|
+
|
1203
|
+
func_quote_portable_unquoted_result=$func_quote_portable_result
|
1204
|
+
case $func_quote_portable_result in
|
1205
|
+
# double-quote args containing shell metacharacters to delay
|
1206
|
+
# word splitting, command substitution and variable expansion
|
1207
|
+
# for a subsequent eval.
|
1208
|
+
# many bourne shells cannot handle close brackets correctly
|
1209
|
+
# in scan sets, so we specify it separately.
|
1210
|
+
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
|
1211
|
+
func_quote_portable_result=\"$func_quote_portable_result\"
|
1212
|
+
;;
|
1213
|
+
esac
|
1143
1214
|
}
|
1144
1215
|
|
1145
1216
|
|
1146
|
-
#
|
1147
|
-
#
|
1148
|
-
#
|
1149
|
-
# but
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1217
|
+
# func_quotefast_eval ARG
|
1218
|
+
# -----------------------
|
1219
|
+
# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
|
1220
|
+
# but optimized for speed. Result is stored in $func_quotefast_eval.
|
1221
|
+
if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
|
1222
|
+
printf -v _GL_test_printf_tilde %q '~'
|
1223
|
+
if test '\~' = "$_GL_test_printf_tilde"; then
|
1224
|
+
func_quotefast_eval ()
|
1225
|
+
{
|
1226
|
+
printf -v func_quotefast_eval_result %q "$1"
|
1227
|
+
}
|
1228
|
+
else
|
1229
|
+
# Broken older Bash implementations. Make those faster too if possible.
|
1230
|
+
func_quotefast_eval ()
|
1231
|
+
{
|
1232
|
+
case $1 in
|
1233
|
+
'~'*)
|
1234
|
+
func_quote_portable false "$1"
|
1235
|
+
func_quotefast_eval_result=$func_quote_portable_result
|
1236
|
+
;;
|
1237
|
+
*)
|
1238
|
+
printf -v func_quotefast_eval_result %q "$1"
|
1239
|
+
;;
|
1240
|
+
esac
|
1241
|
+
}
|
1242
|
+
fi
|
1243
|
+
else
|
1244
|
+
func_quotefast_eval ()
|
1245
|
+
{
|
1246
|
+
func_quote_portable false "$1"
|
1247
|
+
func_quotefast_eval_result=$func_quote_portable_result
|
1248
|
+
}
|
1249
|
+
fi
|
1153
1250
|
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1251
|
+
|
1252
|
+
# func_quote_arg MODEs ARG
|
1253
|
+
# ------------------------
|
1254
|
+
# Quote one ARG to be evaled later. MODEs argument may contain zero or more
|
1255
|
+
# specifiers listed below separated by ',' character. This function returns two
|
1256
|
+
# values:
|
1257
|
+
# i) func_quote_arg_result
|
1258
|
+
# double-quoted (when needed), suitable for a subsequent eval
|
1259
|
+
# ii) func_quote_arg_unquoted_result
|
1260
|
+
# has all characters that are still active within double
|
1261
|
+
# quotes backslashified. Available only if 'unquoted' is specified.
|
1262
|
+
#
|
1263
|
+
# Available modes:
|
1264
|
+
# ----------------
|
1265
|
+
# 'eval' (default)
|
1266
|
+
# - escape shell special characters
|
1267
|
+
# 'expand'
|
1268
|
+
# - the same as 'eval'; but do not quote variable references
|
1269
|
+
# 'pretty'
|
1270
|
+
# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
|
1271
|
+
# be used later in func_quote to get output like: 'echo "a b"' instead
|
1272
|
+
# of 'echo a\ b'. This is slower than default on some shells.
|
1273
|
+
# 'unquoted'
|
1274
|
+
# - produce also $func_quote_arg_unquoted_result which does not contain
|
1275
|
+
# wrapping double-quotes.
|
1276
|
+
#
|
1277
|
+
# Examples for 'func_quote_arg pretty,unquoted string':
|
1278
|
+
#
|
1279
|
+
# string | *_result | *_unquoted_result
|
1280
|
+
# ------------+-----------------------+-------------------
|
1281
|
+
# " | \" | \"
|
1282
|
+
# a b | "a b" | a b
|
1283
|
+
# "a b" | "\"a b\"" | \"a b\"
|
1284
|
+
# * | "*" | *
|
1285
|
+
# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
|
1286
|
+
#
|
1287
|
+
# Examples for 'func_quote_arg pretty,unquoted,expand string':
|
1288
|
+
#
|
1289
|
+
# string | *_result | *_unquoted_result
|
1290
|
+
# --------------+---------------------+--------------------
|
1291
|
+
# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
|
1292
|
+
func_quote_arg ()
|
1293
|
+
{
|
1294
|
+
_G_quote_expand=false
|
1295
|
+
case ,$1, in
|
1296
|
+
*,expand,*)
|
1297
|
+
_G_quote_expand=:
|
1298
|
+
;;
|
1160
1299
|
esac
|
1161
1300
|
|
1162
|
-
case
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1301
|
+
case ,$1, in
|
1302
|
+
*,pretty,*|*,expand,*|*,unquoted,*)
|
1303
|
+
func_quote_portable $_G_quote_expand "$2"
|
1304
|
+
func_quote_arg_result=$func_quote_portable_result
|
1305
|
+
func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
|
1306
|
+
;;
|
1307
|
+
*)
|
1308
|
+
# Faster quote-for-eval for some shells.
|
1309
|
+
func_quotefast_eval "$2"
|
1310
|
+
func_quote_arg_result=$func_quotefast_eval_result
|
1169
1311
|
;;
|
1170
1312
|
esac
|
1313
|
+
}
|
1314
|
+
|
1171
1315
|
|
1172
|
-
|
1316
|
+
# func_quote MODEs ARGs...
|
1317
|
+
# ------------------------
|
1318
|
+
# Quote all ARGs to be evaled later and join them into single command. See
|
1319
|
+
# func_quote_arg's description for more info.
|
1320
|
+
func_quote ()
|
1321
|
+
{
|
1322
|
+
$debug_cmd
|
1323
|
+
_G_func_quote_mode=$1 ; shift
|
1324
|
+
func_quote_result=
|
1325
|
+
while test 0 -lt $#; do
|
1326
|
+
func_quote_arg "$_G_func_quote_mode" "$1"
|
1327
|
+
if test -n "$func_quote_result"; then
|
1328
|
+
func_append func_quote_result " $func_quote_arg_result"
|
1329
|
+
else
|
1330
|
+
func_append func_quote_result "$func_quote_arg_result"
|
1331
|
+
fi
|
1332
|
+
shift
|
1333
|
+
done
|
1173
1334
|
}
|
1174
1335
|
|
1175
1336
|
|
@@ -1215,8 +1376,8 @@ func_show_eval ()
|
|
1215
1376
|
_G_cmd=$1
|
1216
1377
|
_G_fail_exp=${2-':'}
|
1217
1378
|
|
1218
|
-
|
1219
|
-
eval "func_notquiet $
|
1379
|
+
func_quote_arg pretty,expand "$_G_cmd"
|
1380
|
+
eval "func_notquiet $func_quote_arg_result"
|
1220
1381
|
|
1221
1382
|
$opt_dry_run || {
|
1222
1383
|
eval "$_G_cmd"
|
@@ -1241,8 +1402,8 @@ func_show_eval_locale ()
|
|
1241
1402
|
_G_fail_exp=${2-':'}
|
1242
1403
|
|
1243
1404
|
$opt_quiet || {
|
1244
|
-
|
1245
|
-
eval "func_echo $
|
1405
|
+
func_quote_arg expand,pretty "$_G_cmd"
|
1406
|
+
eval "func_echo $func_quote_arg_result"
|
1246
1407
|
}
|
1247
1408
|
|
1248
1409
|
$opt_dry_run || {
|
@@ -1369,30 +1530,26 @@ func_lt_ver ()
|
|
1369
1530
|
# End:
|
1370
1531
|
#! /bin/sh
|
1371
1532
|
|
1372
|
-
# Set a version string for this script.
|
1373
|
-
scriptversion=2014-01-07.03; # UTC
|
1374
|
-
|
1375
1533
|
# A portable, pluggable option parser for Bourne shell.
|
1376
1534
|
# Written by Gary V. Vaughan, 2010
|
1377
1535
|
|
1378
|
-
#
|
1379
|
-
#
|
1380
|
-
#
|
1381
|
-
|
1382
|
-
#
|
1383
|
-
#
|
1384
|
-
#
|
1385
|
-
#
|
1386
|
-
|
1387
|
-
#
|
1388
|
-
#
|
1389
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
1390
|
-
# GNU General Public License for more details.
|
1536
|
+
# This is free software. There is NO warranty; not even for
|
1537
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
1538
|
+
#
|
1539
|
+
# Copyright (C) 2010-2019, 2021 Bootstrap Authors
|
1540
|
+
#
|
1541
|
+
# This file is dual licensed under the terms of the MIT license
|
1542
|
+
# <https://opensource.org/license/MIT>, and GPL version 2 or later
|
1543
|
+
# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
|
1544
|
+
# these licenses when using or redistributing this software or any of
|
1545
|
+
# the files within it. See the URLs above, or the file `LICENSE`
|
1546
|
+
# included in the Bootstrap distribution for the full license texts.
|
1391
1547
|
|
1392
|
-
#
|
1393
|
-
#
|
1548
|
+
# Please report bugs or propose patches to:
|
1549
|
+
# <https://github.com/gnulib-modules/bootstrap/issues>
|
1394
1550
|
|
1395
|
-
#
|
1551
|
+
# Set a version string for this script.
|
1552
|
+
scriptversion=2019-02-19.15; # UTC
|
1396
1553
|
|
1397
1554
|
|
1398
1555
|
## ------ ##
|
@@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC
|
|
1415
1572
|
#
|
1416
1573
|
# In order for the '--version' option to work, you will need to have a
|
1417
1574
|
# suitably formatted comment like the one at the top of this file
|
1418
|
-
# starting with '# Written by ' and ending with '#
|
1575
|
+
# starting with '# Written by ' and ending with '# Copyright'.
|
1419
1576
|
#
|
1420
1577
|
# For '-h' and '--help' to work, you will also need a one line
|
1421
1578
|
# description of your script's purpose in a comment directly above the
|
@@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC
|
|
1427
1584
|
# to display verbose messages only when your user has specified
|
1428
1585
|
# '--verbose'.
|
1429
1586
|
#
|
1430
|
-
# After sourcing this file, you can plug processing for additional
|
1587
|
+
# After sourcing this file, you can plug in processing for additional
|
1431
1588
|
# options by amending the variables from the 'Configuration' section
|
1432
1589
|
# below, and following the instructions in the 'Option parsing'
|
1433
1590
|
# section further down.
|
@@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information."
|
|
1476
1633
|
## ------------------------- ##
|
1477
1634
|
|
1478
1635
|
# This section contains functions for adding, removing, and running hooks
|
1479
|
-
#
|
1480
|
-
#
|
1636
|
+
# in the main code. A hook is just a list of function names that can be
|
1637
|
+
# run in order later on.
|
1481
1638
|
|
1482
1639
|
# func_hookable FUNC_NAME
|
1483
1640
|
# -----------------------
|
@@ -1510,7 +1667,8 @@ func_add_hook ()
|
|
1510
1667
|
|
1511
1668
|
# func_remove_hook FUNC_NAME HOOK_FUNC
|
1512
1669
|
# ------------------------------------
|
1513
|
-
# Remove HOOK_FUNC from the list of functions called by
|
1670
|
+
# Remove HOOK_FUNC from the list of hook functions to be called by
|
1671
|
+
# FUNC_NAME.
|
1514
1672
|
func_remove_hook ()
|
1515
1673
|
{
|
1516
1674
|
$debug_cmd
|
@@ -1519,10 +1677,28 @@ func_remove_hook ()
|
|
1519
1677
|
}
|
1520
1678
|
|
1521
1679
|
|
1680
|
+
# func_propagate_result FUNC_NAME_A FUNC_NAME_B
|
1681
|
+
# ---------------------------------------------
|
1682
|
+
# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
|
1683
|
+
# *_result variable of FUNC_NAME_B.
|
1684
|
+
func_propagate_result ()
|
1685
|
+
{
|
1686
|
+
$debug_cmd
|
1687
|
+
|
1688
|
+
func_propagate_result_result=:
|
1689
|
+
if eval "test \"\${${1}_result+set}\" = set"
|
1690
|
+
then
|
1691
|
+
eval "${2}_result=\$${1}_result"
|
1692
|
+
else
|
1693
|
+
func_propagate_result_result=false
|
1694
|
+
fi
|
1695
|
+
}
|
1696
|
+
|
1697
|
+
|
1522
1698
|
# func_run_hooks FUNC_NAME [ARG]...
|
1523
1699
|
# ---------------------------------
|
1524
1700
|
# Run all hook functions registered to FUNC_NAME.
|
1525
|
-
# It
|
1701
|
+
# It's assumed that the list of hook functions contains nothing more
|
1526
1702
|
# than a whitespace-delimited list of legal shell function names, and
|
1527
1703
|
# no effort is wasted trying to catch shell meta-characters or preserve
|
1528
1704
|
# whitespace.
|
@@ -1530,24 +1706,23 @@ func_run_hooks ()
|
|
1530
1706
|
{
|
1531
1707
|
$debug_cmd
|
1532
1708
|
|
1709
|
+
_G_rc_run_hooks=false
|
1710
|
+
|
1533
1711
|
case " $hookable_fns " in
|
1534
1712
|
*" $1 "*) ;;
|
1535
|
-
*) func_fatal_error "'$1' does not support hook
|
1713
|
+
*) func_fatal_error "'$1' does not support hook functions." ;;
|
1536
1714
|
esac
|
1537
1715
|
|
1538
1716
|
eval _G_hook_fns=\$$1_hooks; shift
|
1539
1717
|
|
1540
1718
|
for _G_hook in $_G_hook_fns; do
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1719
|
+
func_unset "${_G_hook}_result"
|
1720
|
+
eval $_G_hook '${1+"$@"}'
|
1721
|
+
func_propagate_result $_G_hook func_run_hooks
|
1722
|
+
if $func_propagate_result_result; then
|
1723
|
+
eval set dummy "$func_run_hooks_result"; shift
|
1724
|
+
fi
|
1547
1725
|
done
|
1548
|
-
|
1549
|
-
func_quote_for_eval ${1+"$@"}
|
1550
|
-
func_run_hooks_result=$func_quote_for_eval_result
|
1551
1726
|
}
|
1552
1727
|
|
1553
1728
|
|
@@ -1557,10 +1732,18 @@ func_run_hooks ()
|
|
1557
1732
|
## --------------- ##
|
1558
1733
|
|
1559
1734
|
# In order to add your own option parsing hooks, you must accept the
|
1560
|
-
# full positional parameter list
|
1561
|
-
# options that you action, and then pass back the remaining
|
1562
|
-
# options in '<hooked_function_name>_result', escaped
|
1563
|
-
# 'eval'.
|
1735
|
+
# full positional parameter list from your hook function. You may remove
|
1736
|
+
# or edit any options that you action, and then pass back the remaining
|
1737
|
+
# unprocessed options in '<hooked_function_name>_result', escaped
|
1738
|
+
# suitably for 'eval'.
|
1739
|
+
#
|
1740
|
+
# The '<hooked_function_name>_result' variable is automatically unset
|
1741
|
+
# before your hook gets called; for best performance, only set the
|
1742
|
+
# *_result variable when necessary (i.e. don't call the 'func_quote'
|
1743
|
+
# function unnecessarily because it can be an expensive operation on some
|
1744
|
+
# machines).
|
1745
|
+
#
|
1746
|
+
# Like this:
|
1564
1747
|
#
|
1565
1748
|
# my_options_prep ()
|
1566
1749
|
# {
|
@@ -1570,9 +1753,8 @@ func_run_hooks ()
|
|
1570
1753
|
# usage_message=$usage_message'
|
1571
1754
|
# -s, --silent don'\''t print informational messages
|
1572
1755
|
# '
|
1573
|
-
#
|
1574
|
-
#
|
1575
|
-
# my_options_prep_result=$func_quote_for_eval_result
|
1756
|
+
# # No change in '$@' (ignored completely by this hook). Leave
|
1757
|
+
# # my_options_prep_result variable intact.
|
1576
1758
|
# }
|
1577
1759
|
# func_add_hook func_options_prep my_options_prep
|
1578
1760
|
#
|
@@ -1581,25 +1763,36 @@ func_run_hooks ()
|
|
1581
1763
|
# {
|
1582
1764
|
# $debug_cmd
|
1583
1765
|
#
|
1584
|
-
#
|
1766
|
+
# args_changed=false
|
1767
|
+
#
|
1768
|
+
# # Note that, for efficiency, we parse as many options as we can
|
1585
1769
|
# # recognise in a loop before passing the remainder back to the
|
1586
1770
|
# # caller on the first unrecognised argument we encounter.
|
1587
1771
|
# while test $# -gt 0; do
|
1588
1772
|
# opt=$1; shift
|
1589
1773
|
# case $opt in
|
1590
|
-
# --silent|-s) opt_silent=:
|
1774
|
+
# --silent|-s) opt_silent=:
|
1775
|
+
# args_changed=:
|
1776
|
+
# ;;
|
1591
1777
|
# # Separate non-argument short options:
|
1592
1778
|
# -s*) func_split_short_opt "$_G_opt"
|
1593
1779
|
# set dummy "$func_split_short_opt_name" \
|
1594
1780
|
# "-$func_split_short_opt_arg" ${1+"$@"}
|
1595
1781
|
# shift
|
1782
|
+
# args_changed=:
|
1596
1783
|
# ;;
|
1597
|
-
# *)
|
1784
|
+
# *) # Make sure the first unrecognised option "$_G_opt"
|
1785
|
+
# # is added back to "$@" in case we need it later,
|
1786
|
+
# # if $args_changed was set to 'true'.
|
1787
|
+
# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
|
1598
1788
|
# esac
|
1599
1789
|
# done
|
1600
1790
|
#
|
1601
|
-
#
|
1602
|
-
#
|
1791
|
+
# # Only call 'func_quote' here if we processed at least one argument.
|
1792
|
+
# if $args_changed; then
|
1793
|
+
# func_quote eval ${1+"$@"}
|
1794
|
+
# my_silent_option_result=$func_quote_result
|
1795
|
+
# fi
|
1603
1796
|
# }
|
1604
1797
|
# func_add_hook func_parse_options my_silent_option
|
1605
1798
|
#
|
@@ -1610,17 +1803,26 @@ func_run_hooks ()
|
|
1610
1803
|
#
|
1611
1804
|
# $opt_silent && $opt_verbose && func_fatal_help "\
|
1612
1805
|
# '--silent' and '--verbose' options are mutually exclusive."
|
1613
|
-
#
|
1614
|
-
# func_quote_for_eval ${1+"$@"}
|
1615
|
-
# my_option_validation_result=$func_quote_for_eval_result
|
1616
1806
|
# }
|
1617
1807
|
# func_add_hook func_validate_options my_option_validation
|
1618
1808
|
#
|
1619
|
-
# You'll
|
1809
|
+
# You'll also need to manually amend $usage_message to reflect the extra
|
1620
1810
|
# options you parse. It's preferable to append if you can, so that
|
1621
1811
|
# multiple option parsing hooks can be added safely.
|
1622
1812
|
|
1623
1813
|
|
1814
|
+
# func_options_finish [ARG]...
|
1815
|
+
# ----------------------------
|
1816
|
+
# Finishing the option parse loop (call 'func_options' hooks ATM).
|
1817
|
+
func_options_finish ()
|
1818
|
+
{
|
1819
|
+
$debug_cmd
|
1820
|
+
|
1821
|
+
func_run_hooks func_options ${1+"$@"}
|
1822
|
+
func_propagate_result func_run_hooks func_options_finish
|
1823
|
+
}
|
1824
|
+
|
1825
|
+
|
1624
1826
|
# func_options [ARG]...
|
1625
1827
|
# ---------------------
|
1626
1828
|
# All the functions called inside func_options are hookable. See the
|
@@ -1630,17 +1832,27 @@ func_options ()
|
|
1630
1832
|
{
|
1631
1833
|
$debug_cmd
|
1632
1834
|
|
1633
|
-
|
1634
|
-
eval func_parse_options \
|
1635
|
-
${func_options_prep_result+"$func_options_prep_result"}
|
1636
|
-
eval func_validate_options \
|
1637
|
-
${func_parse_options_result+"$func_parse_options_result"}
|
1835
|
+
_G_options_quoted=false
|
1638
1836
|
|
1639
|
-
|
1640
|
-
|
1837
|
+
for my_func in options_prep parse_options validate_options options_finish
|
1838
|
+
do
|
1839
|
+
func_unset func_${my_func}_result
|
1840
|
+
func_unset func_run_hooks_result
|
1841
|
+
eval func_$my_func '${1+"$@"}'
|
1842
|
+
func_propagate_result func_$my_func func_options
|
1843
|
+
if $func_propagate_result_result; then
|
1844
|
+
eval set dummy "$func_options_result"; shift
|
1845
|
+
_G_options_quoted=:
|
1846
|
+
fi
|
1847
|
+
done
|
1641
1848
|
|
1642
|
-
|
1643
|
-
|
1849
|
+
$_G_options_quoted || {
|
1850
|
+
# As we (func_options) are top-level options-parser function and
|
1851
|
+
# nobody quoted "$@" for us yet, we need to do it explicitly for
|
1852
|
+
# caller.
|
1853
|
+
func_quote eval ${1+"$@"}
|
1854
|
+
func_options_result=$func_quote_result
|
1855
|
+
}
|
1644
1856
|
}
|
1645
1857
|
|
1646
1858
|
|
@@ -1649,9 +1861,8 @@ func_options ()
|
|
1649
1861
|
# All initialisations required before starting the option parse loop.
|
1650
1862
|
# Note that when calling hook functions, we pass through the list of
|
1651
1863
|
# positional parameters. If a hook function modifies that list, and
|
1652
|
-
# needs to
|
1653
|
-
# modified list must be put in 'func_run_hooks_result' before
|
1654
|
-
# returning.
|
1864
|
+
# needs to propagate that back to rest of this script, then the complete
|
1865
|
+
# modified list must be put in 'func_run_hooks_result' before returning.
|
1655
1866
|
func_hookable func_options_prep
|
1656
1867
|
func_options_prep ()
|
1657
1868
|
{
|
@@ -1662,9 +1873,7 @@ func_options_prep ()
|
|
1662
1873
|
opt_warning_types=
|
1663
1874
|
|
1664
1875
|
func_run_hooks func_options_prep ${1+"$@"}
|
1665
|
-
|
1666
|
-
# save modified positional parameters for caller
|
1667
|
-
func_options_prep_result=$func_run_hooks_result
|
1876
|
+
func_propagate_result func_run_hooks func_options_prep
|
1668
1877
|
}
|
1669
1878
|
|
1670
1879
|
|
@@ -1676,25 +1885,32 @@ func_parse_options ()
|
|
1676
1885
|
{
|
1677
1886
|
$debug_cmd
|
1678
1887
|
|
1679
|
-
|
1680
|
-
|
1888
|
+
_G_parse_options_requote=false
|
1681
1889
|
# this just eases exit handling
|
1682
1890
|
while test $# -gt 0; do
|
1683
1891
|
# Defer to hook functions for initial option parsing, so they
|
1684
1892
|
# get priority in the event of reusing an option name.
|
1685
1893
|
func_run_hooks func_parse_options ${1+"$@"}
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1894
|
+
func_propagate_result func_run_hooks func_parse_options
|
1895
|
+
if $func_propagate_result_result; then
|
1896
|
+
eval set dummy "$func_parse_options_result"; shift
|
1897
|
+
# Even though we may have changed "$@", we passed the "$@" array
|
1898
|
+
# down into the hook and it quoted it for us (because we are in
|
1899
|
+
# this if-branch). No need to quote it again.
|
1900
|
+
_G_parse_options_requote=false
|
1901
|
+
fi
|
1689
1902
|
|
1690
1903
|
# Break out of the loop if we already parsed every option.
|
1691
1904
|
test $# -gt 0 || break
|
1692
1905
|
|
1906
|
+
# We expect that one of the options parsed in this function matches
|
1907
|
+
# and thus we remove _G_opt from "$@" and need to re-quote.
|
1908
|
+
_G_match_parse_options=:
|
1693
1909
|
_G_opt=$1
|
1694
1910
|
shift
|
1695
1911
|
case $_G_opt in
|
1696
1912
|
--debug|-x) debug_cmd='set -x'
|
1697
|
-
func_echo "enabling shell trace mode"
|
1913
|
+
func_echo "enabling shell trace mode" >&2
|
1698
1914
|
$debug_cmd
|
1699
1915
|
;;
|
1700
1916
|
|
@@ -1704,7 +1920,10 @@ func_parse_options ()
|
|
1704
1920
|
;;
|
1705
1921
|
|
1706
1922
|
--warnings|--warning|-W)
|
1707
|
-
test $# = 0 && func_missing_arg $_G_opt
|
1923
|
+
if test $# = 0 && func_missing_arg $_G_opt; then
|
1924
|
+
_G_parse_options_requote=:
|
1925
|
+
break
|
1926
|
+
fi
|
1708
1927
|
case " $warning_categories $1" in
|
1709
1928
|
*" $1 "*)
|
1710
1929
|
# trailing space prevents matching last $1 above
|
@@ -1757,15 +1976,24 @@ func_parse_options ()
|
|
1757
1976
|
shift
|
1758
1977
|
;;
|
1759
1978
|
|
1760
|
-
--) break ;;
|
1979
|
+
--) _G_parse_options_requote=: ; break ;;
|
1761
1980
|
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
|
1762
|
-
*) set dummy "$_G_opt" ${1+"$@"}; shift
|
1981
|
+
*) set dummy "$_G_opt" ${1+"$@"}; shift
|
1982
|
+
_G_match_parse_options=false
|
1983
|
+
break
|
1984
|
+
;;
|
1763
1985
|
esac
|
1986
|
+
|
1987
|
+
if $_G_match_parse_options; then
|
1988
|
+
_G_parse_options_requote=:
|
1989
|
+
fi
|
1764
1990
|
done
|
1765
1991
|
|
1766
|
-
|
1767
|
-
|
1768
|
-
|
1992
|
+
if $_G_parse_options_requote; then
|
1993
|
+
# save modified positional parameters for caller
|
1994
|
+
func_quote eval ${1+"$@"}
|
1995
|
+
func_parse_options_result=$func_quote_result
|
1996
|
+
fi
|
1769
1997
|
}
|
1770
1998
|
|
1771
1999
|
|
@@ -1782,12 +2010,10 @@ func_validate_options ()
|
|
1782
2010
|
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
|
1783
2011
|
|
1784
2012
|
func_run_hooks func_validate_options ${1+"$@"}
|
2013
|
+
func_propagate_result func_run_hooks func_validate_options
|
1785
2014
|
|
1786
2015
|
# Bail if the options were screwed!
|
1787
2016
|
$exit_cmd $EXIT_FAILURE
|
1788
|
-
|
1789
|
-
# save modified positional parameters for caller
|
1790
|
-
func_validate_options_result=$func_run_hooks_result
|
1791
2017
|
}
|
1792
2018
|
|
1793
2019
|
|
@@ -1843,8 +2069,8 @@ func_missing_arg ()
|
|
1843
2069
|
|
1844
2070
|
# func_split_equals STRING
|
1845
2071
|
# ------------------------
|
1846
|
-
# Set func_split_equals_lhs and func_split_equals_rhs shell variables
|
1847
|
-
# splitting STRING at the '=' sign.
|
2072
|
+
# Set func_split_equals_lhs and func_split_equals_rhs shell variables
|
2073
|
+
# after splitting STRING at the '=' sign.
|
1848
2074
|
test -z "$_G_HAVE_XSI_OPS" \
|
1849
2075
|
&& (eval 'x=a/b/c;
|
1850
2076
|
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
|
@@ -1859,8 +2085,9 @@ then
|
|
1859
2085
|
|
1860
2086
|
func_split_equals_lhs=${1%%=*}
|
1861
2087
|
func_split_equals_rhs=${1#*=}
|
1862
|
-
test "x$func_split_equals_lhs" = "x$1"
|
1863
|
-
|
2088
|
+
if test "x$func_split_equals_lhs" = "x$1"; then
|
2089
|
+
func_split_equals_rhs=
|
2090
|
+
fi
|
1864
2091
|
}'
|
1865
2092
|
else
|
1866
2093
|
# ...otherwise fall back to using expr, which is often a shell builtin.
|
@@ -1870,7 +2097,7 @@ else
|
|
1870
2097
|
|
1871
2098
|
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
|
1872
2099
|
func_split_equals_rhs=
|
1873
|
-
test "x$func_split_equals_lhs" = "x$1" \
|
2100
|
+
test "x$func_split_equals_lhs=" = "x$1" \
|
1874
2101
|
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
|
1875
2102
|
}
|
1876
2103
|
fi #func_split_equals
|
@@ -1896,7 +2123,7 @@ else
|
|
1896
2123
|
{
|
1897
2124
|
$debug_cmd
|
1898
2125
|
|
1899
|
-
func_split_short_opt_name=`expr "x$1" : 'x
|
2126
|
+
func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
|
1900
2127
|
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
|
1901
2128
|
}
|
1902
2129
|
fi #func_split_short_opt
|
@@ -1938,31 +2165,44 @@ func_usage_message ()
|
|
1938
2165
|
# func_version
|
1939
2166
|
# ------------
|
1940
2167
|
# Echo version message to standard output and exit.
|
2168
|
+
# The version message is extracted from the calling file's header
|
2169
|
+
# comments, with leading '# ' stripped:
|
2170
|
+
# 1. First display the progname and version
|
2171
|
+
# 2. Followed by the header comment line matching /^# Written by /
|
2172
|
+
# 3. Then a blank line followed by the first following line matching
|
2173
|
+
# /^# Copyright /
|
2174
|
+
# 4. Immediately followed by any lines between the previous matches,
|
2175
|
+
# except lines preceding the intervening completely blank line.
|
2176
|
+
# For example, see the header comments of this file.
|
1941
2177
|
func_version ()
|
1942
2178
|
{
|
1943
2179
|
$debug_cmd
|
1944
2180
|
|
1945
2181
|
printf '%s\n' "$progname $scriptversion"
|
1946
2182
|
$SED -n '
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
:go
|
1955
|
-
/^# Written by /,/# warranty; / {
|
1956
|
-
s|^# ||
|
1957
|
-
s|^# *$||
|
1958
|
-
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
|
1959
|
-
p
|
2183
|
+
/^# Written by /!b
|
2184
|
+
s|^# ||; p; n
|
2185
|
+
|
2186
|
+
:fwd2blnk
|
2187
|
+
/./ {
|
2188
|
+
n
|
2189
|
+
b fwd2blnk
|
1960
2190
|
}
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
2191
|
+
p; n
|
2192
|
+
|
2193
|
+
:holdwrnt
|
2194
|
+
s|^# ||
|
2195
|
+
s|^# *$||
|
2196
|
+
/^Copyright /!{
|
2197
|
+
/./H
|
2198
|
+
n
|
2199
|
+
b holdwrnt
|
1964
2200
|
}
|
1965
|
-
|
2201
|
+
|
2202
|
+
s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
|
2203
|
+
G
|
2204
|
+
s|\(\n\)\n*|\1|g
|
2205
|
+
p; q' < "$progpath"
|
1966
2206
|
|
1967
2207
|
exit $?
|
1968
2208
|
}
|
@@ -1972,12 +2212,12 @@ func_version ()
|
|
1972
2212
|
# mode: shell-script
|
1973
2213
|
# sh-indentation: 2
|
1974
2214
|
# eval: (add-hook 'before-save-hook 'time-stamp)
|
1975
|
-
# time-stamp-pattern: "
|
2215
|
+
# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
|
1976
2216
|
# time-stamp-time-zone: "UTC"
|
1977
2217
|
# End:
|
1978
2218
|
|
1979
2219
|
# Set a version string.
|
1980
|
-
scriptversion='(GNU libtool) 2.4.
|
2220
|
+
scriptversion='(GNU libtool) 2.4.7'
|
1981
2221
|
|
1982
2222
|
|
1983
2223
|
# func_echo ARG...
|
@@ -2068,7 +2308,7 @@ include the following information:
|
|
2068
2308
|
compiler: $LTCC
|
2069
2309
|
compiler flags: $LTCFLAGS
|
2070
2310
|
linker: $LD (gnu? $with_gnu_ld)
|
2071
|
-
version: $progname $scriptversion Debian-2.4.
|
2311
|
+
version: $progname $scriptversion Debian-2.4.7-5
|
2072
2312
|
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
|
2073
2313
|
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
|
2074
2314
|
|
@@ -2124,7 +2364,7 @@ fi
|
|
2124
2364
|
# a configuration failure hint, and exit.
|
2125
2365
|
func_fatal_configuration ()
|
2126
2366
|
{
|
2127
|
-
|
2367
|
+
func_fatal_error ${1+"$@"} \
|
2128
2368
|
"See the $PACKAGE documentation for more information." \
|
2129
2369
|
"Fatal configuration error."
|
2130
2370
|
}
|
@@ -2270,6 +2510,10 @@ libtool_options_prep ()
|
|
2270
2510
|
nonopt=
|
2271
2511
|
preserve_args=
|
2272
2512
|
|
2513
|
+
_G_rc_lt_options_prep=:
|
2514
|
+
|
2515
|
+
_G_rc_lt_options_prep=:
|
2516
|
+
|
2273
2517
|
# Shorthand for --mode=foo, only valid as the first argument
|
2274
2518
|
case $1 in
|
2275
2519
|
clean|clea|cle|cl)
|
@@ -2293,11 +2537,16 @@ libtool_options_prep ()
|
|
2293
2537
|
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
|
2294
2538
|
shift; set dummy --mode uninstall ${1+"$@"}; shift
|
2295
2539
|
;;
|
2540
|
+
*)
|
2541
|
+
_G_rc_lt_options_prep=false
|
2542
|
+
;;
|
2296
2543
|
esac
|
2297
2544
|
|
2298
|
-
|
2299
|
-
|
2300
|
-
|
2545
|
+
if $_G_rc_lt_options_prep; then
|
2546
|
+
# Pass back the list of options.
|
2547
|
+
func_quote eval ${1+"$@"}
|
2548
|
+
libtool_options_prep_result=$func_quote_result
|
2549
|
+
fi
|
2301
2550
|
}
|
2302
2551
|
func_add_hook func_options_prep libtool_options_prep
|
2303
2552
|
|
@@ -2309,9 +2558,12 @@ libtool_parse_options ()
|
|
2309
2558
|
{
|
2310
2559
|
$debug_cmd
|
2311
2560
|
|
2561
|
+
_G_rc_lt_parse_options=false
|
2562
|
+
|
2312
2563
|
# Perform our own loop to consume as many options as possible in
|
2313
2564
|
# each iteration.
|
2314
2565
|
while test $# -gt 0; do
|
2566
|
+
_G_match_lt_parse_options=:
|
2315
2567
|
_G_opt=$1
|
2316
2568
|
shift
|
2317
2569
|
case $_G_opt in
|
@@ -2386,15 +2638,20 @@ libtool_parse_options ()
|
|
2386
2638
|
func_append preserve_args " $_G_opt"
|
2387
2639
|
;;
|
2388
2640
|
|
2389
|
-
|
2390
|
-
*)
|
2641
|
+
# An option not handled by this hook function:
|
2642
|
+
*) set dummy "$_G_opt" ${1+"$@"} ; shift
|
2643
|
+
_G_match_lt_parse_options=false
|
2644
|
+
break
|
2645
|
+
;;
|
2391
2646
|
esac
|
2647
|
+
$_G_match_lt_parse_options && _G_rc_lt_parse_options=:
|
2392
2648
|
done
|
2393
2649
|
|
2394
|
-
|
2395
|
-
|
2396
|
-
|
2397
|
-
|
2650
|
+
if $_G_rc_lt_parse_options; then
|
2651
|
+
# save modified positional parameters for caller
|
2652
|
+
func_quote eval ${1+"$@"}
|
2653
|
+
libtool_parse_options_result=$func_quote_result
|
2654
|
+
fi
|
2398
2655
|
}
|
2399
2656
|
func_add_hook func_parse_options libtool_parse_options
|
2400
2657
|
|
@@ -2451,8 +2708,8 @@ libtool_validate_options ()
|
|
2451
2708
|
}
|
2452
2709
|
|
2453
2710
|
# Pass back the unparsed argument list
|
2454
|
-
|
2455
|
-
libtool_validate_options_result=$
|
2711
|
+
func_quote eval ${1+"$@"}
|
2712
|
+
libtool_validate_options_result=$func_quote_result
|
2456
2713
|
}
|
2457
2714
|
func_add_hook func_validate_options libtool_validate_options
|
2458
2715
|
|
@@ -3418,8 +3675,8 @@ func_mode_compile ()
|
|
3418
3675
|
esac
|
3419
3676
|
done
|
3420
3677
|
|
3421
|
-
|
3422
|
-
test "X$libobj" != "X$
|
3678
|
+
func_quote_arg pretty "$libobj"
|
3679
|
+
test "X$libobj" != "X$func_quote_arg_result" \
|
3423
3680
|
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
|
3424
3681
|
&& func_warning "libobj name '$libobj' may not contain shell special characters."
|
3425
3682
|
func_dirname_and_basename "$obj" "/" ""
|
@@ -3492,8 +3749,8 @@ compiler."
|
|
3492
3749
|
|
3493
3750
|
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
|
3494
3751
|
srcfile=$func_to_tool_file_result
|
3495
|
-
|
3496
|
-
qsrcfile=$
|
3752
|
+
func_quote_arg pretty "$srcfile"
|
3753
|
+
qsrcfile=$func_quote_arg_result
|
3497
3754
|
|
3498
3755
|
# Only build a PIC object if we are building libtool libraries.
|
3499
3756
|
if test yes = "$build_libtool_libs"; then
|
@@ -3648,7 +3905,8 @@ This mode accepts the following additional options:
|
|
3648
3905
|
-prefer-non-pic try to build non-PIC objects only
|
3649
3906
|
-shared do not build a '.o' file suitable for static linking
|
3650
3907
|
-static only build a '.o' file suitable for static linking
|
3651
|
-
-Wc,FLAG
|
3908
|
+
-Wc,FLAG
|
3909
|
+
-Xcompiler FLAG pass FLAG directly to the compiler
|
3652
3910
|
|
3653
3911
|
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
|
3654
3912
|
from the given SOURCEFILE.
|
@@ -3754,6 +4012,8 @@ The following components of LINK-COMMAND are treated specially:
|
|
3754
4012
|
-weak LIBNAME declare that the target provides the LIBNAME interface
|
3755
4013
|
-Wc,FLAG
|
3756
4014
|
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler
|
4015
|
+
-Wa,FLAG
|
4016
|
+
-Xassembler FLAG pass linker-specific FLAG directly to the assembler
|
3757
4017
|
-Wl,FLAG
|
3758
4018
|
-Xlinker FLAG pass linker-specific FLAG directly to the linker
|
3759
4019
|
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
|
@@ -4096,8 +4356,8 @@ func_mode_install ()
|
|
4096
4356
|
case $nonopt in *shtool*) :;; *) false;; esac
|
4097
4357
|
then
|
4098
4358
|
# Aesthetically quote it.
|
4099
|
-
|
4100
|
-
install_prog="$
|
4359
|
+
func_quote_arg pretty "$nonopt"
|
4360
|
+
install_prog="$func_quote_arg_result "
|
4101
4361
|
arg=$1
|
4102
4362
|
shift
|
4103
4363
|
else
|
@@ -4107,8 +4367,8 @@ func_mode_install ()
|
|
4107
4367
|
|
4108
4368
|
# The real first argument should be the name of the installation program.
|
4109
4369
|
# Aesthetically quote it.
|
4110
|
-
|
4111
|
-
func_append install_prog "$
|
4370
|
+
func_quote_arg pretty "$arg"
|
4371
|
+
func_append install_prog "$func_quote_arg_result"
|
4112
4372
|
install_shared_prog=$install_prog
|
4113
4373
|
case " $install_prog " in
|
4114
4374
|
*[\\\ /]cp\ *) install_cp=: ;;
|
@@ -4165,12 +4425,12 @@ func_mode_install ()
|
|
4165
4425
|
esac
|
4166
4426
|
|
4167
4427
|
# Aesthetically quote the argument.
|
4168
|
-
|
4169
|
-
func_append install_prog " $
|
4428
|
+
func_quote_arg pretty "$arg"
|
4429
|
+
func_append install_prog " $func_quote_arg_result"
|
4170
4430
|
if test -n "$arg2"; then
|
4171
|
-
|
4431
|
+
func_quote_arg pretty "$arg2"
|
4172
4432
|
fi
|
4173
|
-
func_append install_shared_prog " $
|
4433
|
+
func_append install_shared_prog " $func_quote_arg_result"
|
4174
4434
|
done
|
4175
4435
|
|
4176
4436
|
test -z "$install_prog" && \
|
@@ -4181,8 +4441,8 @@ func_mode_install ()
|
|
4181
4441
|
|
4182
4442
|
if test -n "$install_override_mode" && $no_mode; then
|
4183
4443
|
if $install_cp; then :; else
|
4184
|
-
|
4185
|
-
func_append install_shared_prog " -m $
|
4444
|
+
func_quote_arg pretty "$install_override_mode"
|
4445
|
+
func_append install_shared_prog " -m $func_quote_arg_result"
|
4186
4446
|
fi
|
4187
4447
|
fi
|
4188
4448
|
|
@@ -4478,8 +4738,8 @@ func_mode_install ()
|
|
4478
4738
|
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
|
4479
4739
|
|
4480
4740
|
$opt_quiet || {
|
4481
|
-
|
4482
|
-
eval "func_echo $
|
4741
|
+
func_quote_arg expand,pretty "$relink_command"
|
4742
|
+
eval "func_echo $func_quote_arg_result"
|
4483
4743
|
}
|
4484
4744
|
if eval "$relink_command"; then :
|
4485
4745
|
else
|
@@ -5258,7 +5518,8 @@ else
|
|
5258
5518
|
if test \"\$libtool_execute_magic\" != \"$magic\"; then
|
5259
5519
|
file=\"\$0\""
|
5260
5520
|
|
5261
|
-
|
5521
|
+
func_quote_arg pretty "$ECHO"
|
5522
|
+
qECHO=$func_quote_arg_result
|
5262
5523
|
$ECHO "\
|
5263
5524
|
|
5264
5525
|
# A function that is used when there is no print builtin or printf.
|
@@ -5268,7 +5529,7 @@ func_fallback_echo ()
|
|
5268
5529
|
\$1
|
5269
5530
|
_LTECHO_EOF'
|
5270
5531
|
}
|
5271
|
-
ECHO
|
5532
|
+
ECHO=$qECHO
|
5272
5533
|
fi
|
5273
5534
|
|
5274
5535
|
# Very basic option parsing. These options are (a) specific to
|
@@ -6611,9 +6872,9 @@ func_mode_link ()
|
|
6611
6872
|
while test "$#" -gt 0; do
|
6612
6873
|
arg=$1
|
6613
6874
|
shift
|
6614
|
-
|
6615
|
-
qarg=$
|
6616
|
-
func_append libtool_args " $
|
6875
|
+
func_quote_arg pretty,unquoted "$arg"
|
6876
|
+
qarg=$func_quote_arg_unquoted_result
|
6877
|
+
func_append libtool_args " $func_quote_arg_result"
|
6617
6878
|
|
6618
6879
|
# If the previous option needs an argument, assign it.
|
6619
6880
|
if test -n "$prev"; then
|
@@ -6849,6 +7110,13 @@ func_mode_link ()
|
|
6849
7110
|
prev=
|
6850
7111
|
continue
|
6851
7112
|
;;
|
7113
|
+
xassembler)
|
7114
|
+
func_append compiler_flags " -Xassembler $qarg"
|
7115
|
+
prev=
|
7116
|
+
func_append compile_command " -Xassembler $qarg"
|
7117
|
+
func_append finalize_command " -Xassembler $qarg"
|
7118
|
+
continue
|
7119
|
+
;;
|
6852
7120
|
xcclinker)
|
6853
7121
|
func_append linker_flags " $qarg"
|
6854
7122
|
func_append compiler_flags " $qarg"
|
@@ -7019,7 +7287,7 @@ func_mode_link ()
|
|
7019
7287
|
# These systems don't actually have a C library (as such)
|
7020
7288
|
test X-lc = "X$arg" && continue
|
7021
7289
|
;;
|
7022
|
-
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
|
7290
|
+
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
|
7023
7291
|
# Do not include libc due to us having libc/libc_r.
|
7024
7292
|
test X-lc = "X$arg" && continue
|
7025
7293
|
;;
|
@@ -7039,7 +7307,7 @@ func_mode_link ()
|
|
7039
7307
|
esac
|
7040
7308
|
elif test X-lc_r = "X$arg"; then
|
7041
7309
|
case $host in
|
7042
|
-
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
|
7310
|
+
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
|
7043
7311
|
# Do not include libc_r directly, use -pthread flag.
|
7044
7312
|
continue
|
7045
7313
|
;;
|
@@ -7069,8 +7337,20 @@ func_mode_link ()
|
|
7069
7337
|
prev=xcompiler
|
7070
7338
|
continue
|
7071
7339
|
;;
|
7072
|
-
|
7073
|
-
|
7340
|
+
# Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
|
7341
|
+
-pthread)
|
7342
|
+
case $host in
|
7343
|
+
*solaris2*) ;;
|
7344
|
+
*)
|
7345
|
+
case "$new_inherited_linker_flags " in
|
7346
|
+
*" $arg "*) ;;
|
7347
|
+
* ) func_append new_inherited_linker_flags " $arg" ;;
|
7348
|
+
esac
|
7349
|
+
;;
|
7350
|
+
esac
|
7351
|
+
continue
|
7352
|
+
;;
|
7353
|
+
-mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|
7074
7354
|
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
|
7075
7355
|
func_append compiler_flags " $arg"
|
7076
7356
|
func_append compile_command " $arg"
|
@@ -7211,9 +7491,9 @@ func_mode_link ()
|
|
7211
7491
|
save_ifs=$IFS; IFS=,
|
7212
7492
|
for flag in $args; do
|
7213
7493
|
IFS=$save_ifs
|
7214
|
-
|
7215
|
-
func_append arg " $
|
7216
|
-
func_append compiler_flags " $
|
7494
|
+
func_quote_arg pretty "$flag"
|
7495
|
+
func_append arg " $func_quote_arg_result"
|
7496
|
+
func_append compiler_flags " $func_quote_arg_result"
|
7217
7497
|
done
|
7218
7498
|
IFS=$save_ifs
|
7219
7499
|
func_stripname ' ' '' "$arg"
|
@@ -7227,16 +7507,21 @@ func_mode_link ()
|
|
7227
7507
|
save_ifs=$IFS; IFS=,
|
7228
7508
|
for flag in $args; do
|
7229
7509
|
IFS=$save_ifs
|
7230
|
-
|
7231
|
-
func_append arg " $wl$
|
7232
|
-
func_append compiler_flags " $wl$
|
7233
|
-
func_append linker_flags " $
|
7510
|
+
func_quote_arg pretty "$flag"
|
7511
|
+
func_append arg " $wl$func_quote_arg_result"
|
7512
|
+
func_append compiler_flags " $wl$func_quote_arg_result"
|
7513
|
+
func_append linker_flags " $func_quote_arg_result"
|
7234
7514
|
done
|
7235
7515
|
IFS=$save_ifs
|
7236
7516
|
func_stripname ' ' '' "$arg"
|
7237
7517
|
arg=$func_stripname_result
|
7238
7518
|
;;
|
7239
7519
|
|
7520
|
+
-Xassembler)
|
7521
|
+
prev=xassembler
|
7522
|
+
continue
|
7523
|
+
;;
|
7524
|
+
|
7240
7525
|
-Xcompiler)
|
7241
7526
|
prev=xcompiler
|
7242
7527
|
continue
|
@@ -7254,8 +7539,8 @@ func_mode_link ()
|
|
7254
7539
|
|
7255
7540
|
# -msg_* for osf cc
|
7256
7541
|
-msg_*)
|
7257
|
-
|
7258
|
-
arg=$
|
7542
|
+
func_quote_arg pretty "$arg"
|
7543
|
+
arg=$func_quote_arg_result
|
7259
7544
|
;;
|
7260
7545
|
|
7261
7546
|
# Flags to be passed through unchanged, with rationale:
|
@@ -7275,12 +7560,16 @@ func_mode_link ()
|
|
7275
7560
|
# -specs=* GCC specs files
|
7276
7561
|
# -stdlib=* select c++ std lib with clang
|
7277
7562
|
# -fsanitize=* Clang/GCC memory and address sanitizer
|
7563
|
+
# -fuse-ld=* Linker select flags for GCC
|
7564
|
+
# -static-* direct GCC to link specific libraries statically
|
7565
|
+
# -fcilkplus Cilk Plus language extension features for C/C++
|
7566
|
+
# -Wa,* Pass flags directly to the assembler
|
7278
7567
|
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
|
7279
7568
|
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
|
7280
7569
|
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
|
7281
|
-
-specs=*|-fsanitize
|
7282
|
-
|
7283
|
-
arg=$
|
7570
|
+
-specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*)
|
7571
|
+
func_quote_arg pretty "$arg"
|
7572
|
+
arg=$func_quote_arg_result
|
7284
7573
|
func_append compile_command " $arg"
|
7285
7574
|
func_append finalize_command " $arg"
|
7286
7575
|
func_append compiler_flags " $arg"
|
@@ -7301,15 +7590,15 @@ func_mode_link ()
|
|
7301
7590
|
continue
|
7302
7591
|
else
|
7303
7592
|
# Otherwise treat like 'Some other compiler flag' below
|
7304
|
-
|
7305
|
-
arg=$
|
7593
|
+
func_quote_arg pretty "$arg"
|
7594
|
+
arg=$func_quote_arg_result
|
7306
7595
|
fi
|
7307
7596
|
;;
|
7308
7597
|
|
7309
7598
|
# Some other compiler flag.
|
7310
7599
|
-* | +*)
|
7311
|
-
|
7312
|
-
arg=$
|
7600
|
+
func_quote_arg pretty "$arg"
|
7601
|
+
arg=$func_quote_arg_result
|
7313
7602
|
;;
|
7314
7603
|
|
7315
7604
|
*.$objext)
|
@@ -7429,8 +7718,8 @@ func_mode_link ()
|
|
7429
7718
|
*)
|
7430
7719
|
# Unknown arguments in both finalize_command and compile_command need
|
7431
7720
|
# to be aesthetically quoted because they are evaled later.
|
7432
|
-
|
7433
|
-
arg=$
|
7721
|
+
func_quote_arg pretty "$arg"
|
7722
|
+
arg=$func_quote_arg_result
|
7434
7723
|
;;
|
7435
7724
|
esac # arg
|
7436
7725
|
|
@@ -8638,7 +8927,7 @@ func_mode_link ()
|
|
8638
8927
|
test CXX = "$tagname" && {
|
8639
8928
|
case $host_os in
|
8640
8929
|
linux*)
|
8641
|
-
case `$CC -V 2>&1 |
|
8930
|
+
case `$CC -V 2>&1 | $SED 5q` in
|
8642
8931
|
*Sun\ C*) # Sun C++ 5.9
|
8643
8932
|
func_suncc_cstd_abi
|
8644
8933
|
|
@@ -8811,7 +9100,7 @@ func_mode_link ()
|
|
8811
9100
|
#
|
8812
9101
|
case $version_type in
|
8813
9102
|
# correct linux to gnu/linux during the next big refactor
|
8814
|
-
darwin|freebsd-elf|linux|osf|windows|none)
|
9103
|
+
darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
|
8815
9104
|
func_arith $number_major + $number_minor
|
8816
9105
|
current=$func_arith_result
|
8817
9106
|
age=$number_minor
|
@@ -8905,7 +9194,7 @@ func_mode_link ()
|
|
8905
9194
|
versuffix=.$current.$revision
|
8906
9195
|
;;
|
8907
9196
|
|
8908
|
-
freebsd-elf)
|
9197
|
+
freebsd-elf | midnightbsd-elf)
|
8909
9198
|
func_arith $current - $age
|
8910
9199
|
major=.$func_arith_result
|
8911
9200
|
versuffix=$major.$age.$revision
|
@@ -9131,7 +9420,7 @@ func_mode_link ()
|
|
9131
9420
|
*-*-netbsd*)
|
9132
9421
|
# Don't link with libc until the a.out ld.so is fixed.
|
9133
9422
|
;;
|
9134
|
-
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
|
9423
|
+
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
|
9135
9424
|
# Do not include libc due to us having libc/libc_r.
|
9136
9425
|
;;
|
9137
9426
|
*-*-sco3.2v5* | *-*-sco5v6*)
|
@@ -9942,8 +10231,8 @@ EOF
|
|
9942
10231
|
for cmd in $concat_cmds; do
|
9943
10232
|
IFS=$save_ifs
|
9944
10233
|
$opt_quiet || {
|
9945
|
-
|
9946
|
-
eval "func_echo $
|
10234
|
+
func_quote_arg expand,pretty "$cmd"
|
10235
|
+
eval "func_echo $func_quote_arg_result"
|
9947
10236
|
}
|
9948
10237
|
$opt_dry_run || eval "$cmd" || {
|
9949
10238
|
lt_exit=$?
|
@@ -10036,8 +10325,8 @@ EOF
|
|
10036
10325
|
eval cmd=\"$cmd\"
|
10037
10326
|
IFS=$save_ifs
|
10038
10327
|
$opt_quiet || {
|
10039
|
-
|
10040
|
-
eval "func_echo $
|
10328
|
+
func_quote_arg expand,pretty "$cmd"
|
10329
|
+
eval "func_echo $func_quote_arg_result"
|
10041
10330
|
}
|
10042
10331
|
$opt_dry_run || eval "$cmd" || {
|
10043
10332
|
lt_exit=$?
|
@@ -10511,12 +10800,13 @@ EOF
|
|
10511
10800
|
elif eval var_value=\$$var; test -z "$var_value"; then
|
10512
10801
|
relink_command="$var=; export $var; $relink_command"
|
10513
10802
|
else
|
10514
|
-
|
10515
|
-
relink_command="$var=$
|
10803
|
+
func_quote_arg pretty "$var_value"
|
10804
|
+
relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
|
10516
10805
|
fi
|
10517
10806
|
done
|
10518
|
-
|
10519
|
-
|
10807
|
+
func_quote eval cd "`pwd`"
|
10808
|
+
func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
|
10809
|
+
relink_command=$func_quote_arg_unquoted_result
|
10520
10810
|
fi
|
10521
10811
|
|
10522
10812
|
# Only actually do things if not in dry run mode.
|
@@ -10756,13 +11046,15 @@ EOF
|
|
10756
11046
|
elif eval var_value=\$$var; test -z "$var_value"; then
|
10757
11047
|
relink_command="$var=; export $var; $relink_command"
|
10758
11048
|
else
|
10759
|
-
|
10760
|
-
relink_command="$var=$
|
11049
|
+
func_quote_arg pretty,unquoted "$var_value"
|
11050
|
+
relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
|
10761
11051
|
fi
|
10762
11052
|
done
|
10763
11053
|
# Quote the link command for shipping.
|
10764
|
-
|
10765
|
-
relink_command
|
11054
|
+
func_quote eval cd "`pwd`"
|
11055
|
+
relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
|
11056
|
+
func_quote_arg pretty,unquoted "$relink_command"
|
11057
|
+
relink_command=$func_quote_arg_unquoted_result
|
10766
11058
|
if test yes = "$hardcode_automatic"; then
|
10767
11059
|
relink_command=
|
10768
11060
|
fi
|