From 05f615f7b130c857ace4844c76099d4037c6553e Mon Sep 17 00:00:00 2001 From: yala Date: Mon, 30 Jan 2023 09:55:10 +0800 Subject: [PATCH] Add loongarch architecture support --- Makefile | 2 +- asmcomp/loongarch64/CSE.ml | 39 + asmcomp/loongarch64/NOTES.md | 13 + asmcomp/loongarch64/arch.ml | 94 + asmcomp/loongarch64/arch.mli | 75 + asmcomp/loongarch64/emit.mlp | 772 +++++++ asmcomp/loongarch64/proc.ml | 309 +++ asmcomp/loongarch64/reload.ml | 19 + asmcomp/loongarch64/scheduling.ml | 30 + asmcomp/loongarch64/selection.ml | 70 + asmcomp/loongarch64/stackframe.ml | 32 + configure | 3096 +++++++++++++++----------- configure.ac | 9 +- runtime/caml/config.h | 2 +- runtime/caml/stack.h | 10 + runtime/loongarch64.S | 835 +++++++ testsuite/tools/asmgen_loongarch64.S | 75 + 17 files changed, 4206 insertions(+), 1276 deletions(-) create mode 100644 asmcomp/loongarch64/CSE.ml create mode 100644 asmcomp/loongarch64/NOTES.md create mode 100644 asmcomp/loongarch64/arch.ml create mode 100644 asmcomp/loongarch64/arch.mli create mode 100644 asmcomp/loongarch64/emit.mlp create mode 100644 asmcomp/loongarch64/proc.ml create mode 100644 asmcomp/loongarch64/reload.ml create mode 100644 asmcomp/loongarch64/scheduling.ml create mode 100644 asmcomp/loongarch64/selection.ml create mode 100644 asmcomp/loongarch64/stackframe.ml create mode 100644 runtime/loongarch64.S create mode 100644 testsuite/tools/asmgen_loongarch64.S diff --git a/Makefile b/Makefile index 71d41cd2d6..47b50eb5c7 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ include stdlib/StdlibModules CAMLC = $(BOOT_OCAMLC) $(BOOT_STDLIBFLAGS) -use-prims runtime/primitives CAMLOPT=$(OCAMLRUN) ./ocamlopt$(EXE) $(STDLIBFLAGS) -I otherlibs/dynlink -ARCHES=amd64 arm64 power s390x riscv +ARCHES=amd64 arm64 loongarch64 power s390x riscv VPATH = utils parsing typing bytecomp file_formats lambda middle_end \ middle_end/closure middle_end/flambda middle_end/flambda/base_types \ asmcomp driver toplevel tools $(addprefix otherlibs/, $(ALL_OTHERLIBS)) diff --git a/asmcomp/loongarch64/CSE.ml b/asmcomp/loongarch64/CSE.ml new file mode 100644 index 0000000000..658bb66352 --- /dev/null +++ b/asmcomp/loongarch64/CSE.ml @@ -0,0 +1,39 @@ +# 2 "asmcomp/loongarch64/CSE.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* CSE for the LoongArch *) + +open Arch +open Mach +open CSEgen + +class cse = object (_self) + +inherit cse_generic as super + +method! class_of_operation op = + match op with + | Ispecific(Imultaddf _ | Imultsubf _) -> Op_pure + | _ -> super#class_of_operation op + +method! is_cheap_operation op = + match op with + | Iconst_int n -> n <= 0x7FFF_FFFFn && n >= -0x8000_0000n + | _ -> false + +end + +let fundecl f = + (new cse)#fundecl f diff --git a/asmcomp/loongarch64/NOTES.md b/asmcomp/loongarch64/NOTES.md new file mode 100644 index 0000000000..aacca61de0 --- /dev/null +++ b/asmcomp/loongarch64/NOTES.md @@ -0,0 +1,13 @@ +# Supported platforms + +LoongArch in 64-bit mode + +Debian architecture name: `loongarch64` + +# Reference documents + +* Instruction set specification: + - https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html + +* ELF ABI specification: + - https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html diff --git a/asmcomp/loongarch64/arch.ml b/asmcomp/loongarch64/arch.ml new file mode 100644 index 0000000000..4342d80426 --- /dev/null +++ b/asmcomp/loongarch64/arch.ml @@ -0,0 +1,94 @@ +# 2 "asmcomp/loongarch64/arch.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* Nicolas Ojeda Bar *) +(* *) +(* Copyright 2016 Institut National de Recherche en Informatique et *) +(* en Automatique. *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Specific operations for the Loongarch processor *) + +open Format + +(* Machine-specific command-line options *) + +let command_line_options = [] + +(* Specific operations *) + +type specific_operation = + | Imultaddf of bool (* multiply, optionally negate, and add *) + | Imultsubf of bool (* multiply, optionally negate, and subtract *) + | Isqrtf (* floating-point square root *) + +(* Addressing modes *) + +type addressing_mode = + | Iindexed of int (* reg + displ *) + +let is_immediate n = + (n <= 0x7FF) && (n >= -0x800) + +(* Sizes, endianness *) + +let big_endian = false + +let size_addr = 8 +let size_int = size_addr +let size_float = 8 + +let allow_unaligned_access = false + +(* Behavior of division *) + +let division_crashes_on_overflow = false + +(* Operations on addressing modes *) + +let identity_addressing = Iindexed 0 + +let offset_addressing addr delta = + match addr with + | Iindexed n -> Iindexed(n + delta) + +(* Printing operations and addressing modes *) + +let print_addressing printreg addr ppf arg = + match addr with + | Iindexed n -> + let idx = if n <> 0 then Printf.sprintf " + %i" n else "" in + fprintf ppf "%a%s" printreg arg.(0) idx + +let print_specific_operation printreg op ppf arg = + match op with + | Imultaddf false -> + fprintf ppf "%a *f %a +f %a" + printreg arg.(0) printreg arg.(1) printreg arg.(2) + | Imultaddf true -> + fprintf ppf "-f (%a *f %a +f %a)" + printreg arg.(0) printreg arg.(1) printreg arg.(2) + | Imultsubf false -> + fprintf ppf "%a *f %a -f %a" + printreg arg.(0) printreg arg.(1) printreg arg.(2) + | Imultsubf true -> + fprintf ppf "-f (%a *f %a -f %a)" + printreg arg.(0) printreg arg.(1) printreg arg.(2) + | Isqrtf -> + fprintf ppf "sqrtf %a" + printreg arg.(0) + +(* Specific operations that are pure *) + +let operation_is_pure _ = true + +(* Specific operations that can raise *) + +let operation_can_raise _ = false diff --git a/asmcomp/loongarch64/arch.mli b/asmcomp/loongarch64/arch.mli new file mode 100644 index 0000000000..68d3989ee0 --- /dev/null +++ b/asmcomp/loongarch64/arch.mli @@ -0,0 +1,75 @@ +# 2 "asmcomp/loongarch64/arch.mli" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* Nicolas Ojeda Bar *) +(* *) +(* Copyright 2016 Institut National de Recherche en Informatique et *) +(* en Automatique. *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Specific operations for the Loongarch processor *) + +(* Machine-specific command-line options *) + +val command_line_options : (string * Arg.spec * string) list + +(* Specific operations *) + +type specific_operation = + | Imultaddf of bool (* multiply, optionally negate, and add *) + | Imultsubf of bool (* multiply, optionally negate, and subtract *) + | Isqrtf (* floating-point square root *) + +(* Addressing modes *) + +type addressing_mode = + | Iindexed of int (* reg + displ *) + +val is_immediate : int -> bool + +(* Sizes, endianness *) + +val big_endian : bool + +val size_addr : int + +val size_int : int + +val size_float : int + +val allow_unaligned_access : bool + +(* Behavior of division *) + +val division_crashes_on_overflow : bool + +(* Operations on addressing modes *) + +val identity_addressing : addressing_mode + +val offset_addressing : addressing_mode -> int -> addressing_mode + +(* Printing operations and addressing modes *) + +val print_addressing : + (Format.formatter -> 'a -> unit) -> addressing_mode -> + Format.formatter -> 'a array -> unit + +val print_specific_operation : + (Format.formatter -> 'a -> unit) -> specific_operation -> + Format.formatter -> 'a array -> unit + +(* Specific operations that are pure *) + +val operation_is_pure : specific_operation -> bool + +(* Specific operations that can raise *) + +val operation_can_raise : specific_operation -> bool diff --git a/asmcomp/loongarch64/emit.mlp b/asmcomp/loongarch64/emit.mlp new file mode 100644 index 0000000000..184769c28b --- /dev/null +++ b/asmcomp/loongarch64/emit.mlp @@ -0,0 +1,772 @@ +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Emission of LoongArch assembly code *) + +open Cmm +open Arch +open Proc +open Reg +open Mach +open Linear +open Emitaux +open Emitenv + +(* Layout of the stack. The stack is kept 16-aligned. *) + +let frame_size env = + env.stack_offset + (* Trap frame, outgoing parameters *) + size_int * env.f.fun_num_stack_slots.(0) + (* Local int variables *) + size_float * env.f.fun_num_stack_slots.(1)+ (* Local float variables *) + (if env.f.fun_frame_required then size_addr else 0) (* Return address *) + +let slot_offset env loc cls = + match loc with + | Local n -> + ("$sp", + if cls = 0 + then env.stack_offset + env.f.fun_num_stack_slots.(1) * size_float + + n * size_int + else env.stack_offset + n * size_float) + | Incoming n -> + ("$sp", frame_size env + n) + | Outgoing n -> + ("$sp", n) + | Domainstate n -> + ("$s8", n + Domainstate.(idx_of_field Domain_extra_params) * 8) + +(* Output a symbol *) + +let emit_jump op s = + if !Clflags.dlcode || !Clflags.pic_code + then `{emit_string op} %plt({emit_symbol s})` + else `{emit_string op} {emit_symbol s}` + +let emit_call = emit_jump "bl" +let emit_tail = emit_jump "b" + +(* Output a label *) + +let emit_label lbl = + emit_string ".L"; emit_int lbl + +(* Section switching *) + +let data_space = + ".section .data" + +let code_space = + ".section .text" + +let rodata_space = + ".section .rodata" + +(* Names for special regs *) + +let reg_tmp = phys_reg 22 (* t1 *) +let reg_tmp2 = phys_reg 21 (* t0 *) +let reg_t2 = phys_reg 13 (* t2 *) +let reg_domain_state_ptr = phys_reg 25 (* s8 *) +let reg_trap_ptr = phys_reg 23 (* s1 *) +let reg_alloc_ptr = phys_reg 24 (* s7 *) +let reg_stack_arg_begin = phys_reg 9 (* s3 *) +let reg_stack_arg_end = phys_reg 10 (* s4 *) + +(* Output a pseudo-register *) + +let reg_name = function + | {loc = Reg r} -> register_name r + | _ -> Misc.fatal_error "Emit.reg_name" + +let emit_reg r = + emit_string (reg_name r) + +(* Adjust sp by the given byte amount, clobbers reg_tmp *) + +let emit_stack_adjustment n = + if n <> 0 then begin + if is_immediate n then + ` addi.d $sp, $sp, {emit_int n} \n` + else begin + ` li.d {emit_reg reg_tmp}, {emit_int n}\n`; + ` add.d $sp, $sp, {emit_reg reg_tmp}\n` + end; + cfi_adjust_cfa_offset (-n) + end + +(* Output add.d-immediate instruction, clobbers reg_tmp2 *) + +let emit_addimm rd rs n = + if is_immediate n then + ` addi.d {emit_reg rd}, {emit_reg rs}, {emit_int n}\n` + else begin + ` li.d {emit_reg reg_tmp2}, {emit_int n}\n`; + ` add.d {emit_reg rd}, {emit_reg rs}, {emit_reg reg_tmp2}\n` + end + +(* Output memory operation with a possibly non-immediate offset, + clobbers reg_tmp *) + +let emit_mem_op op reg ofs addr = + if is_immediate ofs then + ` {emit_string op} {emit_string reg}, {emit_string addr}, {emit_int ofs}\n` + else begin + ` li.d {emit_reg reg_tmp}, {emit_int ofs}\n`; + ` add.d {emit_reg reg_tmp}, {emit_string addr}, {emit_reg reg_tmp}\n`; + ` {emit_string op} {emit_string reg}, {emit_reg reg_tmp}, 0\n` + end + +let reload_ra n = + emit_mem_op "ld.d" "$ra" (n - 8) "$sp" + +let store_ra n = + emit_mem_op "st.d" "$ra" (n - 8) "$sp" + +let emit_store rs ofs rd = + emit_mem_op "st.d" (reg_name rs) ofs rd + +let emit_load rd ofs rs = + emit_mem_op "ld.d" (reg_name rd) ofs rs + +let emit_float_load rd ofs rs = + emit_mem_op "fld.d" (reg_name rd) ofs rs + +let emit_float_store rs ofs rd = + emit_mem_op "fst.d" (reg_name rs) ofs rd + +let emit_float_test cmp ~arg ~res = + let negated = + match cmp with + | CFneq | CFnlt | CFngt | CFnle | CFnge -> true + | CFeq | CFlt | CFgt | CFle | CFge -> false + in + begin match cmp with + | CFeq | CFneq -> ` fcmp.ceq.d $fcc0, {emit_reg arg.(0)}, {emit_reg arg.(1)}\n movcf2gr {emit_reg res}, $fcc0\n` + | CFlt | CFnlt -> ` fcmp.clt.d $fcc0, {emit_reg arg.(0)}, {emit_reg arg.(1)}\n movcf2gr {emit_reg res}, $fcc0\n` + | CFgt | CFngt -> ` fcmp.clt.d $fcc0, {emit_reg arg.(1)}, {emit_reg arg.(0)}\n movcf2gr {emit_reg res}, $fcc0\n` + | CFle | CFnle -> ` fcmp.cle.d $fcc0, {emit_reg arg.(0)}, {emit_reg arg.(1)}\n movcf2gr {emit_reg res}, $fcc0\n` + | CFge | CFnge -> ` fcmp.cle.d $fcc0, {emit_reg arg.(1)}, {emit_reg arg.(0)}\n movcf2gr {emit_reg res}, $fcc0\n` + end; + negated + +(* Record live pointers at call points *) + +let record_frame_label env live dbg = + let lbl = new_label () in + let live_offset = ref [] in + Reg.Set.iter + (function + {typ = Val; loc = Reg r} -> + live_offset := (r lsl 1) + 1 :: !live_offset + | {typ = Val; loc = Stack s} as reg -> + let (base, ofs) = slot_offset env s (register_class reg) in + assert (base = "$sp"); + live_offset := ofs :: !live_offset + | {typ = Addr} as r -> + Misc.fatal_error ("bad GC root " ^ Reg.name r) + | _ -> () + ) + live; + record_frame_descr ~label:lbl ~frame_size:(frame_size env) + ~live_offset:!live_offset dbg; + lbl + +let record_frame env live dbg = + let lbl = record_frame_label env live dbg in + `{emit_label lbl}:\n` + +let emit_call_gc gc = + `{emit_label gc.gc_lbl}:\n`; + ` {emit_call "caml_call_gc"}\n`; + `{emit_label gc.gc_frame_lbl}:\n`; + ` b {emit_label gc.gc_return_lbl}\n` + +let bound_error_label env dbg = + if !Clflags.debug || env.bound_error_sites = [] then begin + let lbl_bound_error = new_label() in + let lbl_frame = record_frame_label env Reg.Set.empty (Dbg_other dbg) in + env.bound_error_sites <- + { bd_lbl = lbl_bound_error; + bd_frame = lbl_frame; } :: env.bound_error_sites; + lbl_bound_error + end else + let bd = List.hd env.bound_error_sites in + bd.bd_lbl + +let emit_call_bound_error bd = + `{emit_label bd.bd_lbl}:\n`; + ` {emit_call "caml_ml_array_bound_error"}\n`; + `{emit_label bd.bd_frame}:\n` + +(* Names for various instructions *) + +let name_for_intop = function + | Iadd -> "add.d" + | Isub -> "sub.d" + | Imul -> "mul.d" + | Imulh -> "mulh.d" + | Idiv -> "div.d" + | Iand -> "and" + | Ior -> "or" + | Ixor -> "xor" + | Ilsl -> "sll.d" + | Ilsr -> "srl.d" + | Iasr -> "sra.d" + | Imod -> "mod.d" + | _ -> Misc.fatal_error "Emit.Intop" + +let name_for_intop_imm = function + | Iadd -> "addi.d" + | Iand -> "andi" + | Ior -> "ori" + | Ixor -> "xori" + | Ilsl -> "slli.d" + | Ilsr -> "srli.d" + | Iasr -> "srai.d" + | _ -> Misc.fatal_error "Emit.Intop_imm" + +let name_for_floatop1 = function + | Inegf -> "fneg.d" + | Iabsf -> "fabs.d" + | Ispecific Isqrtf -> "fsqrt.d" + | _ -> Misc.fatal_error "Emit.Iopf1" + +let name_for_floatop2 = function + | Iaddf -> "fadd.d" + | Isubf -> "fsub.d" + | Imulf -> "fmul.d" + | Idivf -> "fdiv.d" + | _ -> Misc.fatal_error "Emit.Iopf2" + +let name_for_specific = function + | Imultaddf false -> "fmadd.d" + | Imultaddf true -> "fnmadd.d" + | Imultsubf false -> "fmsub.d" + | Imultsubf true -> "fnmsub.d" + | _ -> Misc.fatal_error "Emit.Iopf3" + +(* Output the assembly code for an instruction *) + +let emit_instr env i = + emit_debug_info i.dbg; + match i.desc with + Lend -> () + | Lprologue -> + let n = frame_size env in + emit_stack_adjustment (-n); + if env.f.fun_frame_required then begin + store_ra n; + cfi_offset ~reg:1 (* ra *) ~offset:(-8) + end; + | Lop(Imove | Ispill | Ireload) -> + let src = i.arg.(0) and dst = i.res.(0) in + if src.loc <> dst.loc then begin + match (src, dst) with + | {loc = Reg _; typ = (Val | Int | Addr)}, {loc = Reg _} -> + ` move {emit_reg dst}, {emit_reg src}\n` + | {loc = Reg _; typ = Float}, {loc = Reg _; typ = Float} -> + ` fmov.d {emit_reg dst}, {emit_reg src}\n` + | {loc = Reg _; typ = Float}, {loc = Reg _; typ = (Val | Int | Addr)} -> + ` movfr2gr.d {emit_reg dst}, {emit_reg src}\n` + | {loc = Reg _; typ = (Val | Int | Addr)}, {loc = Stack s} -> + let (base, ofs) = slot_offset env s (register_class dst) in + emit_store src ofs base + | {loc = Reg _; typ = Float}, {loc = Stack s} -> + let (base, ofs) = slot_offset env s (register_class dst) in + emit_float_store src ofs base + | {loc = Stack s; typ = (Val | Int | Addr)}, {loc = Reg _} -> + let (base, ofs) = slot_offset env s (register_class src) in + emit_load dst ofs base + | {loc = Stack s; typ = Float}, {loc = Reg _} -> + let (base, ofs) = slot_offset env s (register_class src) in + emit_float_load dst ofs base + | {loc = Stack _}, {loc = Stack _} + | {loc = Unknown}, _ | _, {loc = Unknown} -> + Misc.fatal_error "Emit: Imove" + end + | Lop(Iconst_int n) -> + ` li.d {emit_reg i.res.(0)}, {emit_nativeint n}\n` + | Lop(Iconst_float f) -> + let lbl = new_label() in + env.float_literals <- {fl=f; lbl} :: env.float_literals; + `la.local {emit_reg reg_tmp}, {emit_label lbl} \n`; + ` fld.d {emit_reg i.res.(0)}, {emit_reg reg_tmp}, 0\n` + | Lop(Iconst_symbol s) -> (* FIXME la.global assert error in binutils*) + `pcaddi {emit_reg i.res.(0)}, 0 \n`; + `b 7112233f\n`; + `.dword {emit_symbol s}\n`; + `7112233: ld.d {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 8\n` + | Lop(Icall_ind) -> + ` jirl $ra, {emit_reg i.arg.(0)}, 0\n`; + record_frame env i.live (Dbg_other i.dbg) + | Lop(Icall_imm {func}) -> + ` {emit_call func}\n`; + record_frame env i.live (Dbg_other i.dbg) + | Lop(Itailcall_ind) -> + let n = frame_size env in + if env.f.fun_frame_required then reload_ra n; + emit_stack_adjustment n; + ` jr {emit_reg i.arg.(0)}\n` + | Lop(Itailcall_imm {func}) -> + if func = env.f.fun_name then begin + ` b {emit_label env.f.fun_tailrec_entry_point_label}\n` + end else begin + let n = frame_size env in + if env.f.fun_frame_required then reload_ra n; + emit_stack_adjustment n; + ` {emit_tail func}\n` + end + | Lop(Iextcall{func; alloc; stack_ofs}) -> + if stack_ofs > 0 then begin + ` move {emit_reg reg_stack_arg_begin}, $sp\n`; + ` addi.d {emit_reg reg_stack_arg_end}, $sp, {emit_int (Misc.align stack_ofs 16)}\n`; + ` la.global {emit_reg reg_t2}, {emit_symbol func}\n`; + ` {emit_call "caml_c_call_stack_args"}\n`; + record_frame env i.live (Dbg_other i.dbg) + end else if alloc then begin + ` la.global {emit_reg reg_t2}, {emit_symbol func}\n`; + ` {emit_call "caml_c_call"}\n`; + record_frame env i.live (Dbg_other i.dbg) + end else begin + (* store ocaml stack in s0, which is marked as being destroyed + at noalloc calls *) + ` move $s0, $sp\n`; + cfi_remember_state (); + cfi_def_cfa_register ~reg:21; + let ofs = Domainstate.(idx_of_field Domain_c_stack) * 8 in + ` ld.d $sp, {emit_reg reg_domain_state_ptr}, {emit_int ofs}\n`; + ` {emit_call func}\n`; + ` move $sp, $s0\n`; + cfi_restore_state () + end + | Lop(Istackoffset n) -> + assert (n mod 16 = 0); + emit_stack_adjustment (-n); + env.stack_offset <- env.stack_offset + n + | Lop(Iload { memory_chunk = Single; addressing_mode = Iindexed ofs; is_atomic } ) -> + assert (not is_atomic); + ` fld.s {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int ofs}\n`; + ` fcvt.d.s {emit_reg i.res.(0)}, {emit_reg i.res.(0)}\n` + | Lop(Iload { memory_chunk = Word_int | Word_val; addressing_mode = Iindexed ofs; is_atomic } ) -> + if is_atomic then ` dbar 0\n`; + ` ld.d {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int ofs}\n`; + if is_atomic then ` dbar 0\n` + | Lop(Iload { memory_chunk; addressing_mode = Iindexed ofs; is_atomic } ) -> + assert (not is_atomic); + let instr = + match memory_chunk with + | Byte_unsigned -> "ld.bu" + | Byte_signed -> "ld.b" + | Sixteen_unsigned -> "ld.hu" + | Sixteen_signed -> "ld.h" + | Thirtytwo_unsigned -> "ld.wu" + | Thirtytwo_signed -> "ld.w" + | Word_int | Word_val | Single -> assert false + | Double -> "fld.d" + in + ` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int ofs}\n` + | Lop(Istore(Single, Iindexed ofs, _)) -> + (* ft0 is marked as destroyed for this operation *) + ` fcvt.s.d $ft0, {emit_reg i.arg.(0)}\n`; + ` fst.s $ft0, {emit_reg i.arg.(1)}, {emit_int ofs}\n` + | Lop(Istore((Word_int | Word_val), Iindexed ofs, assignement)) -> + if assignement then begin + ` dbar 0\n`; + ` st.d {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_int ofs}\n` + end else + ` st.d {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_int ofs}\n`; + | Lop(Istore(chunk, Iindexed ofs, _)) -> + let instr = + match chunk with + | Byte_unsigned | Byte_signed -> "st.b" + | Sixteen_unsigned | Sixteen_signed -> "st.h" + | Thirtytwo_unsigned | Thirtytwo_signed -> "st.w" + | Word_int | Word_val | Single -> assert false + | Double -> "fst.d" + in + ` {emit_string instr} {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_int ofs}\n` + | Lop(Ialloc {bytes; dbginfo}) -> + let lbl_frame_lbl = record_frame_label env i.live (Dbg_alloc dbginfo) in + if env.f.fun_fast then begin + let lbl_after_alloc = new_label () in + let lbl_call_gc = new_label () in + let n = -bytes in + let offset = Domainstate.(idx_of_field Domain_young_limit) * 8 in + emit_addimm reg_alloc_ptr reg_alloc_ptr n; + ` ld.d {emit_reg reg_tmp}, {emit_reg reg_domain_state_ptr}, {emit_int offset}\n`; + ` sltu {emit_reg reg_tmp}, {emit_reg reg_alloc_ptr}, {emit_reg reg_tmp}\n`; + ` bnez {emit_reg reg_tmp}, {emit_label lbl_call_gc}\n`; + `{emit_label lbl_after_alloc}:\n`; + ` addi.d {emit_reg i.res.(0)}, {emit_reg reg_alloc_ptr}, 8\n`; + env.call_gc_sites <- + { gc_lbl = lbl_call_gc; + gc_return_lbl = lbl_after_alloc; + gc_frame_lbl = lbl_frame_lbl } :: env.call_gc_sites + end else begin + begin match bytes with + | 16 -> ` {emit_call "caml_alloc1"}\n` + | 24 -> ` {emit_call "caml_alloc2"}\n` + | 32 -> ` {emit_call "caml_alloc3"}\n` + | _ -> + ` li.d {emit_reg reg_t2}, {emit_int bytes}\n`; + ` {emit_call "caml_allocN"}\n` + end; + `{emit_label lbl_frame_lbl}:\n`; + ` addi.d {emit_reg i.res.(0)}, {emit_reg reg_alloc_ptr}, 8\n` + end + | Lop(Ipoll { return_label }) -> + let lbl_frame_lbl = record_frame_label env i.live (Dbg_alloc []) in + let lbl_after_poll = match return_label with + | None -> new_label() + | Some(lbl) -> lbl in + let lbl_call_gc = new_label () in + let offset = Domainstate.(idx_of_field Domain_young_limit) * 8 in + ` ld.d {emit_reg reg_tmp}, {emit_reg reg_domain_state_ptr}, {emit_int offset}\n`; + begin match return_label with + | None -> ` bltu {emit_reg reg_alloc_ptr}, {emit_reg reg_tmp}, {emit_label lbl_call_gc}\n`; + `{emit_label lbl_after_poll}:\n`; + | Some lbl -> ` bgeu {emit_reg reg_alloc_ptr}, {emit_reg reg_tmp}, {emit_label lbl}\n`; + ` b {emit_label lbl_call_gc}\n` + end; + env.call_gc_sites <- + { gc_lbl = lbl_call_gc; + gc_return_lbl = lbl_after_poll; + gc_frame_lbl = lbl_frame_lbl } :: env.call_gc_sites + | Lop(Iintop(Icomp cmp)) -> + begin match cmp with + | Isigned Clt -> + ` slt {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n` + | Isigned Cge -> + ` slt {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`; + ` xori {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n`; + | Isigned Cgt -> + ` slt {emit_reg i.res.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(0)}\n` + | Isigned Cle -> + ` slt {emit_reg i.res.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(0)}\n`; + ` xori {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n`; + | Isigned Ceq | Iunsigned Ceq -> + ` sub.d {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`; + ` sltui {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n` + | Isigned Cne | Iunsigned Cne -> + ` sub.d {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`; + ` sltu {emit_reg i.res.(0)}, $zero, {emit_reg i.res.(0)}\n` + | Iunsigned Clt -> + ` sltu {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n` + | Iunsigned Cge -> + ` sltu {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`; + ` xori {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n`; + | Iunsigned Cgt -> + ` sltu {emit_reg i.res.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(0)}\n` + | Iunsigned Cle -> + ` sltu {emit_reg i.res.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(0)}\n`; + ` xori {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n`; + end + | Lop(Icompf cmp) -> + let negated = emit_float_test cmp ~res:i.res.(0) ~arg:i.arg in + if negated then ` xori {emit_reg i.res.(0)}, {emit_reg i.res.(0)}, 1\n`; + | Lop(Iintop (Icheckbound)) -> + let lbl = bound_error_label env i.dbg in + ` bleu {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_label lbl}\n` + | Lop(Iintop op) -> + let instr = name_for_intop op in + ` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n` + | Lop(Iintop_imm(Isub, n)) -> + ` addi.d {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int(-n)}\n` + | Lop(Iintop_imm(Iadd, n)) -> + ` addi.d {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int(n)}\n` + | Lop(Iintop_imm(op, n)) -> + let instri = name_for_intop_imm op in + if n<0 then (* FIXME *) + let instr = name_for_intop op in + ` addi.d {emit_reg reg_tmp2}, $zero, {emit_int n}\n {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg reg_tmp2} \n` + else + ` {emit_string instri} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_int n}\n` + | Lop(Inegf | Iabsf | Ispecific Isqrtf as op) -> + let instr = name_for_floatop1 op in + ` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}\n` + | Lop(Iaddf | Isubf | Imulf | Idivf as op) -> + let instr = name_for_floatop2 op in + ` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n` + | Lop(Ifloatofint) -> + ` movgr2fr.d $ft0, {emit_reg i.arg.(0)} \n`; + ` ffint.d.l {emit_reg i.res.(0)}, $ft0\n` + | Lop(Iintoffloat) -> + ` ftintrz.l.d $ft0, {emit_reg i.arg.(0)}\n`; + ` movfr2gr.d {emit_reg i.res.(0)}, $ft0 \n` + | Lop(Iopaque) -> + assert (i.arg.(0).loc = i.res.(0).loc) + | Lop(Ispecific sop) -> + let instr = name_for_specific sop in + ` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_reg i.arg.(2)}\n` + | Lop (Idls_get) -> + let ofs = Domainstate.(idx_of_field Domain_dls_root) * 8 in + ` ld.d {emit_reg i.res.(0)}, {emit_reg reg_domain_state_ptr}, {emit_int ofs}\n` + | Lreloadretaddr -> + let n = frame_size env in + reload_ra n + | Lreturn -> + let n = frame_size env in + emit_stack_adjustment n; + ` jr $ra\n` + | Lop (Ireturn_addr) -> + let n = frame_size env in + if env.f.fun_frame_required then + ` ld.d {emit_reg i.res.(0)}, sp, {emit_int (n - 8)}\n` + else + ` move {emit_reg i.res.(0)}, ra\n`; + | Llabel lbl -> + `{emit_label lbl}:\n` + | Lbranch lbl -> + ` b {emit_label lbl}\n` + | Lcondbranch(tst, lbl) -> + begin match tst with + | Itruetest -> + ` bnez {emit_reg i.arg.(0)}, {emit_label lbl}\n` + | Ifalsetest -> + ` beqz {emit_reg i.arg.(0)}, {emit_label lbl}\n` + | Iinttest cmp -> + let name = match cmp with + | Iunsigned Ceq | Isigned Ceq -> "beq" + | Iunsigned Cne | Isigned Cne -> "bne" + | Iunsigned Cle -> "bleu" | Isigned Cle -> "ble" + | Iunsigned Cge -> "bgeu" | Isigned Cge -> "bge" + | Iunsigned Clt -> "bltu" | Isigned Clt -> "blt" + | Iunsigned Cgt -> "bgtu" | Isigned Cgt -> "bgt" + in + ` {emit_string name} {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}, {emit_label lbl}\n` + | Iinttest_imm _ -> + Misc.fatal_error "Emit.emit_instr (Iinttest_imm _)" + | Ifloattest cmp -> + let negated = emit_float_test cmp ~arg:i.arg ~res:reg_tmp in + let branch = + if negated + then "beqz" + else "bnez" + in + ` {emit_string branch} {emit_reg reg_tmp}, {emit_label lbl}\n` + | Ioddtest -> + ` andi {emit_reg reg_tmp}, {emit_reg i.arg.(0)}, 1\n`; + ` bnez {emit_reg reg_tmp}, {emit_label lbl}\n` + | Ieventest -> + ` andi {emit_reg reg_tmp}, {emit_reg i.arg.(0)}, 1\n`; + ` beqz {emit_reg reg_tmp}, {emit_label lbl}\n` + end + | Lcondbranch3(lbl0, lbl1, lbl2) -> + ` addi.d {emit_reg reg_tmp}, {emit_reg i.arg.(0)}, -1\n`; + begin match lbl0 with + | None -> () + | Some lbl -> ` bltz {emit_reg reg_tmp}, {emit_label lbl}\n` + end; + begin match lbl1 with + | None -> () + | Some lbl -> ` beqz {emit_reg reg_tmp}, {emit_label lbl}\n` + end; + begin match lbl2 with + | None -> () + | Some lbl -> ` bgtz {emit_reg reg_tmp}, {emit_label lbl}\n` + end + | Lswitch jumptbl -> + let lbl = new_label() in + ` la.local {emit_reg reg_tmp}, {emit_label lbl}\n`; + ` slli.d {emit_reg reg_tmp2}, {emit_reg i.arg.(0)}, 2\n`; + ` add.d {emit_reg reg_tmp}, {emit_reg reg_tmp}, {emit_reg reg_tmp2}\n`; + ` jr {emit_reg reg_tmp}\n`; + `{emit_label lbl}:\n`; + for i = 0 to Array.length jumptbl - 1 do + ` b {emit_label jumptbl.(i)}\n` + done + | Lentertrap -> + () + | Ladjust_trap_depth { delta_traps } -> + (* each trap occupes 16 bytes on the stack *) + let delta = 16 * delta_traps in + cfi_adjust_cfa_offset delta; + env.stack_offset <- env.stack_offset + delta + | Lpushtrap {lbl_handler} -> + ` la.local {emit_reg reg_tmp}, {emit_label lbl_handler}\n`; + ` addi.d $sp, $sp, -16\n`; + env.stack_offset <- env.stack_offset + 16; + ` st.d {emit_reg reg_trap_ptr}, $sp, 0\n`; + ` st.d {emit_reg reg_tmp}, $sp, 8\n`; + cfi_adjust_cfa_offset 16; + ` move {emit_reg reg_trap_ptr}, $sp\n` + | Lpoptrap -> + ` ld.d {emit_reg reg_trap_ptr}, $sp, 0\n`; + ` addi.d $sp, $sp, 16\n`; + cfi_adjust_cfa_offset (-16); + env.stack_offset <- env.stack_offset - 16 + | Lraise k -> + begin match k with + | Lambda.Raise_regular -> + ` {emit_call "caml_raise_exn"}\n`; + record_frame env Reg.Set.empty (Dbg_raise i.dbg) + | Lambda.Raise_reraise -> + ` {emit_call "caml_reraise_exn"}\n`; + record_frame env Reg.Set.empty (Dbg_raise i.dbg) + | Lambda.Raise_notrace -> + ` move $sp, {emit_reg reg_trap_ptr}\n`; + ` ld.d {emit_reg reg_tmp}, $sp, 8\n`; + ` ld.d {emit_reg reg_trap_ptr}, $sp, 0\n`; + ` addi.d $sp, $sp, 16\n`; + ` jr {emit_reg reg_tmp}\n` + end + +(* Emit a sequence of instructions *) + +let rec emit_all env = function + | {desc = Lend} -> () | i -> emit_instr env i; emit_all env i.next + +(* Emission of a function declaration *) + +let fundecl fundecl = + let env = mk_env fundecl in + ` .globl {emit_symbol fundecl.fun_name}\n`; + ` .type {emit_symbol fundecl.fun_name}, @function\n`; + ` {emit_string code_space}\n`; + ` .align 2\n`; + `{emit_symbol fundecl.fun_name}:\n`; + emit_debug_info fundecl.fun_dbg; + cfi_startproc(); + + (* Dynamic stack checking *) + let stack_threshold_size = Config.stack_threshold * 8 in (* bytes *) + let max_frame_size = frame_size env + fundecl.fun_extra_stack_used in + let handle_overflow = ref None in + if fundecl.fun_contains_nontail_calls || max_frame_size >= stack_threshold_size then begin + let overflow = new_label () and ret = new_label () in + let threshold_offset = Domainstate.stack_ctx_words * 8 + stack_threshold_size in + let f = max_frame_size + threshold_offset in + let offset = Domainstate.(idx_of_field Domain_current_stack) * 8 in + ` ld.d {emit_reg reg_tmp}, {emit_reg reg_domain_state_ptr}, {emit_int offset}\n`; + emit_addimm reg_tmp reg_tmp f; + ` bltu $sp, {emit_reg reg_tmp}, {emit_label overflow}\n`; + `{emit_label ret}:\n`; + handle_overflow := Some (overflow, ret) + end; + + emit_all env fundecl.fun_body; + List.iter emit_call_gc env.call_gc_sites; + List.iter emit_call_bound_error env.bound_error_sites; + + begin match !handle_overflow with + | None -> () + | Some (overflow, ret) -> + `{emit_label overflow}:\n`; + (* Pass the desired frame size on the stack, since all of the + argument-passing registers may be in use. *) + let s = Config.stack_threshold + max_frame_size / 8 in + ` li.d {emit_reg reg_tmp}, {emit_int s}\n`; + ` addi.d $sp, $sp, -16\n`; + ` st.d {emit_reg reg_tmp}, $sp, 0\n`; + ` st.d $ra, $sp, 8\n`; + ` {emit_call "caml_call_realloc_stack"}\n`; + ` ld.d $ra, $sp, 8\n`; + ` addi.d $sp, $sp, 16\n`; + ` b {emit_label ret}\n` + end; + + cfi_endproc(); + ` .size {emit_symbol fundecl.fun_name}, .-{emit_symbol fundecl.fun_name}\n`; + (* Emit the float literals *) + if env.float_literals <> [] then begin + ` {emit_string rodata_space}\n`; + ` .align 3\n`; + List.iter + (fun {fl; lbl} -> + `{emit_label lbl}:\n`; + emit_float64_directive ".quad" fl) + env.float_literals; + end + +(* Emission of data *) + +let declare_global_data s = + ` .globl {emit_symbol s}\n`; + ` .type {emit_symbol s}, @object\n` + +let emit_item = function + | Cglobal_symbol s -> + declare_global_data s + | Cdefine_symbol s -> + `{emit_symbol s}:\n`; + | Cint8 n -> + ` .byte {emit_int n}\n` + | Cint16 n -> + ` .short {emit_int n}\n` + | Cint32 n -> + ` .long {emit_nativeint n}\n` + | Cint n -> + ` .quad {emit_nativeint n}\n` + | Csingle f -> + emit_float32_directive ".long" (Int32.bits_of_float f) + | Cdouble f -> + emit_float64_directive ".quad" (Int64.bits_of_float f) + | Csymbol_address s -> + ` .quad {emit_symbol s}\n` + | Cstring s -> + emit_bytes_directive " .byte " s + | Cskip n -> + if n > 0 then ` .space {emit_int n}\n` + | Calign n -> + ` .align {emit_int (Misc.log2 n)}\n` + +let data l = + ` {emit_string data_space}\n`; + List.iter emit_item l + +(* Beginning / end of an assembly file *) + +let begin_assembly() = + ` .file \"\"\n`; (* PR#7073 *) + reset_debug_info (); + (* Emit the beginning of the segments *) + let lbl_begin = Compilenv.make_symbol (Some "data_begin") in + ` {emit_string data_space}\n`; + declare_global_data lbl_begin; + `{emit_symbol lbl_begin}:\n`; + let lbl_begin = Compilenv.make_symbol (Some "code_begin") in + ` {emit_string code_space}\n`; + declare_global_data lbl_begin; + `{emit_symbol lbl_begin}:\n` + +let end_assembly() = + ` {emit_string code_space}\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + declare_global_data lbl_end; + `{emit_symbol lbl_end}:\n`; + ` .long 0\n`; + ` {emit_string data_space}\n`; + let lbl_end = Compilenv.make_symbol (Some "data_end") in + declare_global_data lbl_end; + ` .quad 0\n`; (* PR#6329 *) + `{emit_symbol lbl_end}:\n`; + ` .quad 0\n`; + (* Emit the frame descriptors *) + ` {emit_string data_space}\n`; (* not rodata because relocations inside *) + let lbl = Compilenv.make_symbol (Some "frametable") in + declare_global_data lbl; + `{emit_symbol lbl}:\n`; + emit_frames + { efa_code_label = (fun l -> ` .quad {emit_label l}\n`); + efa_data_label = (fun l -> ` .quad {emit_label l}\n`); + efa_8 = (fun n -> ` .byte {emit_int n}\n`); + efa_16 = (fun n -> ` .short {emit_int n}\n`); + efa_32 = (fun n -> ` .long {emit_int32 n}\n`); + efa_word = (fun n -> ` .quad {emit_int n}\n`); + efa_align = (fun n -> ` .align {emit_int (Misc.log2 n)}\n`); + efa_label_rel = (fun lbl ofs -> + ` .long ({emit_label lbl} - .) + {emit_int32 ofs}\n`); + efa_def_label = (fun l -> `{emit_label l}:\n`); + efa_string = (fun s -> emit_bytes_directive " .byte " (s ^ "\000")) + } diff --git a/asmcomp/loongarch64/proc.ml b/asmcomp/loongarch64/proc.ml new file mode 100644 index 0000000000..d7635d9564 --- /dev/null +++ b/asmcomp/loongarch64/proc.ml @@ -0,0 +1,309 @@ +# 2 "asmcomp/loongarch64/proc.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Instruction selection *) + +let word_addressed = false + +(* Description of the LoongArch *) + +open Misc +open Cmm +open Reg +open Arch +open Mach + +(* Registers available for register allocation *) + +(* Integer register map + -------------------- + + zero always zero + ra return address + sp, gp, tp stack pointer, global pointer, thread pointer + a0-a7 0-7 arguments/results + s2-s6 8-12 arguments/results (preserved by C) + t2-t6 13-17 temporary + s0 18 general purpose (preserved by C) + t0, t1 19-20 temporaries (used by call veneers) + s1 21 trap pointer (preserved by C) + s7 22 allocation pointer (preserved by C) + s8 23 domain pointer (preserved by C) + + Floating-point register map + --------------------------- + + ft0-ft7 100-107 temporary + fs0-fs1 108-109 general purpose (preserved by C) + fa0-fa7 110-117 arguments/results + fs2-fs7 118-123 general purpose (preserved by C) + ft8-f15 124-131 temporary + + Additional notes + ---------------- + + - t1 is used by the code generator, so not available for register + allocation. + + - t0-t6 may be used by PLT stubs, so should not be used to pass + arguments and may be clobbered by [Ialloc] in the presence of dynamic + linking. +*) + +let int_reg_name = + [|"$a0"; "$a1"; "$a2"; "$a3"; "$a4"; "$a5"; "$a6"; "$a7"; (* 0- 7 *) + "$s2"; "$s3"; "$s4"; "$s5"; "$s6"; (* 8-12 *) + "$t2"; "$t3"; "$t4"; "$t5"; "$t6"; "$t7"; "$t8"; (* 13-19 *) + "$s0"; (* 20 *) + "$t0"; "$t1"; (* 21-22 *) + "$s1"; "$s7"; "$s8"; (* 23-25 *) + |] + +let float_reg_name = + [| "$ft0"; "$ft1"; "$ft2"; "$ft3"; "$ft4"; "$ft5"; "$ft6";"$ft7"; + "$fs0"; "$fs1"; + "$fa0"; "$fa1"; "$fa2"; "$fa3"; "$fa4"; "$fa5"; "$fa6"; "$fa7"; + "$fs2"; "$fs3"; "$fs4"; "$fs5"; "$fs6"; "$fs7"; + "$ft8"; "$ft9"; "$ft10"; "$ft11";"$ft12";"$ft13";"$ft14";"$ft15"; |] +let num_register_classes = 2 + +let register_class r = + match r.typ with + | Val | Int | Addr -> 0 + | Float -> 1 + +(* first 19 int regs allocatable; all float regs allocatable *) +let num_available_registers = [| 21; 32 |] + +let first_available_register = [| 0; 100 |] + +let register_name r = + if r < 100 then int_reg_name.(r) else float_reg_name.(r - 100) + +let rotate_registers = true + +(* Representation of hard registers by pseudo-registers *) + +let hard_int_reg = + let v = Array.make 26 Reg.dummy in + for i = 0 to 25 do + v.(i) <- Reg.at_location Int (Reg i) + done; + v + +let hard_float_reg = + let v = Array.make 32 Reg.dummy in + for i = 0 to 31 do + v.(i) <- Reg.at_location Float (Reg(100 + i)) + done; + v + +let all_phys_regs = + Array.append hard_int_reg hard_float_reg + +let phys_reg n = + if n < 100 then hard_int_reg.(n) else hard_float_reg.(n - 100) + +let stack_slot slot ty = + Reg.at_location ty (Stack slot) + +(* Calling conventions *) + +let size_domainstate_args = 64 * size_int + +let calling_conventions + first_int last_int first_float last_float make_stack first_stack arg = + let loc = Array.make (Array.length arg) Reg.dummy in + let int = ref first_int in + let float = ref first_float in + let ofs = ref first_stack in + for i = 0 to Array.length arg - 1 do + match arg.(i) with + | Val | Int | Addr as ty -> + if !int <= last_int then begin + loc.(i) <- phys_reg !int; + incr int + end else begin + loc.(i) <- stack_slot (make_stack !ofs) ty; + ofs := !ofs + size_int + end + | Float -> + if !float <= last_float then begin + loc.(i) <- phys_reg !float; + incr float + end else begin + loc.(i) <- stack_slot (make_stack !ofs) Float; + ofs := !ofs + size_float + end + done; + (loc, Misc.align (max 0 !ofs) 16) (* Keep stack 16-aligned. *) + +let incoming ofs = + if ofs >= 0 + then Incoming ofs + else Domainstate (ofs + size_domainstate_args) +let outgoing ofs = + if ofs >= 0 + then Outgoing ofs + else Domainstate (ofs + size_domainstate_args) +let not_supported _ = fatal_error "Proc.loc_results: cannot call" + +let max_arguments_for_tailcalls = 13 (* in regs *) + 64 (* in domain state *) + +(* OCaml calling convention: + first integer args in a0 .. a7, s2 .. s6 + first float args in fa0 .. fa7, fs2 .. fs9 + remaining args in domain state area, then on stack. + Return values in a0 .. a7, s2 .. s6 or fa0 .. fa7, fs2 .. fs9. *) + +let loc_arguments arg = + calling_conventions 0 12 110 121 outgoing (- size_domainstate_args) arg + +let loc_parameters arg = + let (loc, _ofs) = + calling_conventions 0 12 110 121 incoming (- size_domainstate_args) arg + in + loc + +let loc_results res = + let (loc, _ofs) = + calling_conventions 0 12 110 121 not_supported 0 res + in + loc + +(* C calling convention: + first integer args in a0 .. a7 + first float args in fa0 .. fa7 + remaining args on stack. + A FP argument can be passed in an integer register if all FP registers + are exhausted but integer registers remain. + Return values in a0 .. a1 or fa0 .. fa1. *) + +let external_calling_conventions + first_int last_int first_float last_float make_stack arg = + let loc = Array.make (Array.length arg) [| Reg.dummy |] in + let int = ref first_int in + let float = ref first_float in + let ofs = ref 0 in + for i = 0 to Array.length arg - 1 do + match arg.(i) with + | Val | Int | Addr as ty -> + if !int <= last_int then begin + loc.(i) <- [| phys_reg !int |]; + incr int + end else begin + loc.(i) <- [| stack_slot (make_stack !ofs) ty |]; + ofs := !ofs + size_int + end + | Float -> + if !float <= last_float then begin + loc.(i) <- [| phys_reg !float |]; + incr float + end else if !int <= last_int then begin + loc.(i) <- [| phys_reg !int |]; + incr int + end else begin + loc.(i) <- [| stack_slot (make_stack !ofs) Float |]; + ofs := !ofs + size_float + end + done; + (loc, Misc.align !ofs 16) (* Keep stack 16-aligned. *) + +let loc_external_arguments ty_args = + let arg = Cmm.machtype_of_exttype_list ty_args in + external_calling_conventions 0 7 110 117 outgoing arg + +let loc_external_results res = + let (loc, _ofs) = calling_conventions 0 1 110 111 not_supported 0 res + in loc + +(* Exceptions are in a0 *) + +let loc_exn_bucket = phys_reg 0 + +(* Registers destroyed by operations *) + +let destroyed_at_c_noalloc_call = + (* s0-s8 and fs0-fs7 are callee-save, but s0 is + used to preserve OCaml sp. *) + Array.of_list(List.map phys_reg + [0; 1; 2; 3; 4; 5; 6; 7; 13; 14; 15; 16; 17; 18; 19; 20;(*s0*) + 100; 101; 102; 103; 104; 105; 106; 107; 110; 111; 112; 113; 114; 115; 116; + 117; 124; 125; 126; 127; 128; 129; 130; 131]) + +let destroyed_at_alloc = + (* t0-t6 are used for PLT stubs *) + if !Clflags.dlcode then Array.map phys_reg [|13; 14; 15; 16; 17; 18; 19|] + else [| phys_reg 13 |] (* t2 is used to pass the argument to caml_allocN *) + +let destroyed_at_oper = function + | Iop(Icall_ind | Icall_imm _) -> all_phys_regs + | Iop(Iextcall{alloc; stack_ofs; _}) -> + assert (stack_ofs >= 0); + if alloc || stack_ofs > 0 then all_phys_regs + else destroyed_at_c_noalloc_call + | Iop(Ialloc _) | Iop(Ipoll _) -> destroyed_at_alloc + | Iop(Istore(Single, _, _)) -> [| phys_reg 100 |] + | Iop(Ifloatofint | Iintoffloat) -> [| phys_reg 100 |] + | _ -> [| |] + +let destroyed_at_raise = all_phys_regs + +let destroyed_at_reloadretaddr = [| |] + +(* Maximal register pressure *) + +let safe_register_pressure = function + | Iextcall _ -> 5 (*9-4=5 s0~s8 - s7 - s8 - s1 - s0*) + | _ -> 21 + +let max_register_pressure = function + | Iextcall _ -> [| 5; 8 |] (* 5 integer callee-saves, 8 FP callee-saves *) + | _ -> [| 21; 30 |] + + (* FIXME *) +let int_dwarf_reg_numbers = + [| 4; 5; 6; 7; 8; 9; 10; 11; + 23; 24; 25; 26; 27; 28; 29; 30; + 14; 15; 16; 17; 18; + 31; + 12; 13; + 19; 20; + |] + +let float_dwarf_reg_numbers = + [| 32; 33; 34; 35; 36; 37; 38; 39; + 40; 41; + 42; 43; 44; 45; 46; 47; 48; 49; + 50; 51; 52; 53; 54; 55; 56; 57; + 58; 59; + 60; 61; 62; 63; + |] + +let dwarf_register_numbers ~reg_class = + match reg_class with + | 0 -> int_dwarf_reg_numbers + | 1 -> float_dwarf_reg_numbers + | _ -> Misc.fatal_errorf "Bad register class %d" reg_class + +let stack_ptr_dwarf_register_number = 2 + +(* Calling the assembler *) + +let assemble_file infile outfile = + Ccomp.command + (Config.asm ^ " -o " ^ Filename.quote outfile ^ " " ^ Filename.quote infile) + +let init () = () diff --git a/asmcomp/loongarch64/reload.ml b/asmcomp/loongarch64/reload.ml new file mode 100644 index 0000000000..a997f129cc --- /dev/null +++ b/asmcomp/loongarch64/reload.ml @@ -0,0 +1,19 @@ +# 2 "asmcomp/loongarch64/reload.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Reloading for the LoongArch *) + +let fundecl f = + (new Reloadgen.reload_generic)#fundecl f diff --git a/asmcomp/loongarch64/scheduling.ml b/asmcomp/loongarch64/scheduling.ml new file mode 100644 index 0000000000..86febf1f81 --- /dev/null +++ b/asmcomp/loongarch64/scheduling.ml @@ -0,0 +1,30 @@ +# 2 "asmcomp/loongarch64/scheduling.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Instruction scheduling for the LoongArch *) + +(* The "open!" directive below is necessary because, although + this module does not actually depend on Schedgen in this backend, the + dependency exists in other backends and our build system requires + that all the backends have the same dependencies. + We thus have to use "open!" and disable the corresponding warning + only for this compilation unit. +*) + +open! Schedgen [@@warning "-66"] + +(* Scheduling is turned off. *) + +let fundecl f = f diff --git a/asmcomp/loongarch64/selection.ml b/asmcomp/loongarch64/selection.ml new file mode 100644 index 0000000000..be29364c16 --- /dev/null +++ b/asmcomp/loongarch64/selection.ml @@ -0,0 +1,70 @@ +# 2 "asmcomp/loongarch64/selection.ml" +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* yala *) +(* *) +(* Copyright © 2008-2023 LOONGSON *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Instruction selection for the LoongArch processor *) + +open Cmm +open Arch +open Mach + +(* Instruction selection *) + +class selector = object + +inherit Selectgen.selector_generic as super + +(* LoongArch does not support immediate operands for comparison operators *) +method is_immediate_test _cmp _n = false + +method! is_immediate op n = + match op with + | Iadd | Iand | Ior | Ixor -> is_immediate n + (* sub immediate is turned into add immediate opposite *) + | Isub -> is_immediate (-n) + | _ -> super#is_immediate op n + +method select_addressing _ = function + | Cop(Cadda, [arg; Cconst_int (n, _)], _) when is_immediate n -> + (Iindexed n, arg) + | Cop(Cadda, [arg1; Cop(Caddi, [arg2; Cconst_int (n, _)], _)], dbg) + when is_immediate n -> + (Iindexed n, Cop(Caddi, [arg1; arg2], dbg)) + | arg -> + (Iindexed 0, arg) + +method! select_operation op args dbg = + match (op, args) with + (* Recognize (neg-)mult-add and (neg-)mult-sub instructions *) + | (Caddf, [Cop(Cmulf, [arg1; arg2], _); arg3]) + | (Caddf, [arg3; Cop(Cmulf, [arg1; arg2], _)]) -> + (Ispecific (Imultaddf false), [arg1; arg2; arg3]) + | (Csubf, [Cop(Cmulf, [arg1; arg2], _); arg3]) -> + (Ispecific (Imultsubf false), [arg1; arg2; arg3]) + | (Cnegf, [Cop(Csubf, [Cop(Cmulf, [arg1; arg2], _); arg3], _)]) -> + (Ispecific (Imultsubf true), [arg1; arg2; arg3]) + | (Cnegf, [Cop(Caddf, [Cop(Cmulf, [arg1; arg2], _); arg3], _)]) -> + (Ispecific (Imultaddf true), [arg1; arg2; arg3]) + | (Cstore (Word_int | Word_val as memory_chunk, Assignment), [arg1; arg2]) -> + (* Use trivial addressing mode for non-initializing stores *) + (Istore (memory_chunk, Iindexed 0, true), [arg2; arg1]) + | (Cextcall("sqrt", _, _, _), []) -> + (Ispecific Isqrtf, args) + | _ -> + super#select_operation op args dbg + +end + +let fundecl ~future_funcnames f = + (new selector)#emit_fundecl ~future_funcnames f diff --git a/asmcomp/loongarch64/stackframe.ml b/asmcomp/loongarch64/stackframe.ml new file mode 100644 index 0000000000..d165a2078c --- /dev/null +++ b/asmcomp/loongarch64/stackframe.ml @@ -0,0 +1,32 @@ +(**************************************************************************) +(* *) +(* OCaml *) +(* *) +(* Xavier Leroy, projet Cambium, INRIA Paris *) +(* *) +(* Copyright 2023 Institut National de Recherche en Informatique et *) +(* en Automatique. *) +(* *) +(* All rights reserved. This file is distributed under the terms of *) +(* the GNU Lesser General Public License version 2.1, with the *) +(* special exception on linking described in the file LICENSE. *) +(* *) +(**************************************************************************) + +(* Compute the parameters needed for allocating and managing stack frames + in the Emit phase. *) + +open! Mach [@@warning "-66"] + +let trap_handler_size = 16 + +class stackframe = object + +inherit Stackframegen.stackframe_generic + +method trap_handler_size = trap_handler_size + +end + +let analyze f = + (new stackframe)#analyze f diff --git a/configure b/configure index 6dc7cc7517..8204bd45b2 100755 --- a/configure +++ b/configure @@ -1,67 +1,11 @@ #! /bin/sh - -if test -e '.git' ; then : - if test -z "$ac_read_git_config" ; then : - extra_args=$(git config ocaml.configure 2>/dev/null) - extended_cache=$(git config ocaml.configure-cache 2>/dev/null) - cache_file= - - # If ocaml.configure-cache is set, parse the command-line for the --host - # option, in order to determine the name of the cache file. - if test -n "$extended_cache" ; then : - echo "Detected Git configuration option ocaml.configure-cache set to \ -\"$extended_cache\"" - dashdash= - prev= - host=default - # The logic here is pretty borrowed from autoconf's - for option in $extra_args "$@" - do - if test -n "$prev" ; then : - host=$option - continue - fi - - case $dashdash$option in - --) - dashdash=yes ;; - -host | --host | --hos | --ho) - prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - case $option in - *=?*) host=$(expr "X$option" : '[^=]*=\(.*\)') ;; - *=) host= ;; - esac ;; - esac - done - cache_file="`dirname "$0"`/$extended_cache/ocaml-$host.cache" - fi - - # If either option has a value, re-invoke configure - if test -n "$extra_args$cache_file" ; then : - echo "Detected Git configuration option ocaml.configure set to \ -\"$extra_args\"" - # Too much effort to get the echo to show appropriate quoting - the - # invocation itself intentionally quotes $0 and passes $@ exactly as given - # but allows a single expansion of ocaml.configure - if test -n "$cache_file" ; then : - echo "Re-running $0 $extra_args --cache-file \"$cache_file\" $@" - ac_read_git_config=true exec "$0" $extra_args \ - --cache-file "$cache_file" "$@" - else - echo "Re-running $0 $extra_args $@" - ac_read_git_config=true exec "$0" $extra_args "$@" - fi - fi - fi -fi # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for OCaml 5.2.0. +# Generated by GNU Autoconf 2.72 for OCaml 5.2.0. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -73,7 +17,6 @@ fi # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -82,12 +25,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -159,7 +103,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -189,15 +133,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -205,12 +148,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -228,8 +172,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -251,14 +196,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -291,12 +237,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -318,7 +265,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -338,7 +285,8 @@ $0: manually run the script under such a shell if you do $0: have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -377,14 +325,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -453,11 +393,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -471,21 +412,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -559,6 +493,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -607,7 +543,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -619,9 +554,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -646,10 +581,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated SHELL=${CONFIG_SHELL-/bin/sh} @@ -1146,7 +1083,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1172,7 +1109,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1385,7 +1322,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1401,7 +1338,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1431,8 +1368,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1440,7 +1377,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1490,7 +1427,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1558,7 +1495,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1586,7 +1523,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OCaml 5.2.0 to adapt to many kinds of systems. +'configure' configures OCaml 5.2.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1600,11 +1537,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1612,10 +1549,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1756,7 +1693,7 @@ Some influential environment variables: User-defined run-time library search path. CPP C preprocessor -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1825,9 +1762,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF OCaml configure 5.2.0 -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1866,11 +1803,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1908,11 +1846,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1936,8 +1875,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1945,10 +1884,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1968,15 +1909,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1987,7 +1928,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -2006,11 +1947,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2046,11 +1989,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -2087,12 +2031,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -2112,8 +2057,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2143,12 +2088,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2202,18 +2149,19 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else $as_nop - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2248,20 +2196,23 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else $as_nop - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -2284,8 +2235,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else $as_nop - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -2333,8 +2285,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2384,12 +2337,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2410,8 +2365,8 @@ printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2427,8 +2382,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2444,12 +2399,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - eval "$4=no" +else case e in #( + e) eval "$4=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2482,7 +2440,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by OCaml $as_me 5.2.0, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2728,10 +2686,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2767,9 +2725,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2783,6 +2739,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2810,16 +2781,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2869,7 +2843,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2935,6 +2908,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2956,7 +2931,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -3148,8 +3123,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -3177,12 +3153,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -3191,18 +3167,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -3218,11 +3194,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -3555,15 +3531,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -3590,14 +3567,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -3624,14 +3602,15 @@ printf %s "checking target system type... " >&6; } if test ${ac_cv_target+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$target_alias" = x; then +else case e in #( + e) if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 printf "%s\n" "$ac_cv_target" >&6; } @@ -3710,8 +3689,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_csc+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$csc"; then +else case e in #( + e) if test -n "$csc"; then ac_cv_prog_csc="$csc" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3733,7 +3712,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi csc=$ac_cv_prog_csc if test -n "$csc"; then @@ -3782,8 +3762,9 @@ fi if test ${enable_ocamldebug+y} then : enableval=$enable_ocamldebug; -else $as_nop - enable_ocamldebug=auto +else case e in #( + e) enable_ocamldebug=auto ;; +esac fi @@ -3798,8 +3779,9 @@ fi if test ${enable_dependency_generation+y} then : enableval=$enable_dependency_generation; -else $as_nop - enable_dependency_generation=auto +else case e in #( + e) enable_dependency_generation=auto ;; +esac fi @@ -3809,8 +3791,9 @@ fi if test ${enable_instrumented_runtime+y} then : enableval=$enable_instrumented_runtime; -else $as_nop - enable_instrumented_runtime=auto +else case e in #( + e) enable_instrumented_runtime=auto ;; +esac fi @@ -3835,8 +3818,9 @@ fi if test ${enable_tsan+y} then : enableval=$enable_tsan; -else $as_nop - enable_tsan=no +else case e in #( + e) enable_tsan=no ;; +esac fi @@ -3885,8 +3869,9 @@ fi if test ${enable_ocamldoc+y} then : enableval=$enable_ocamldoc; -else $as_nop - enable_ocamldoc='auto' +else case e in #( + e) enable_ocamldoc='auto' ;; +esac fi @@ -4010,8 +3995,9 @@ fi if test ${with_target_bindir+y} then : withval=$with_target_bindir; target_bindir=$withval -else $as_nop - target_bindir='' +else case e in #( + e) target_bindir='' ;; +esac fi @@ -4022,11 +4008,13 @@ then : withval=$with_target_sh; if test x"$withval" = 'xno' then : target_launch_method='exe' -else $as_nop - target_launch_method="$withval" +else case e in #( + e) target_launch_method="$withval" ;; +esac fi -else $as_nop - target_launch_method='' +else case e in #( + e) target_launch_method='' ;; +esac fi @@ -4046,8 +4034,9 @@ fi if test ${enable_stdlib_manpages+y} then : enableval=$enable_stdlib_manpages; -else $as_nop - enable_stdlib_manpages='auto' +else case e in #( + e) enable_stdlib_manpages='auto' ;; +esac fi @@ -4087,8 +4076,9 @@ fi if test ${enable_function_sections+y} then : enableval=$enable_function_sections; -else $as_nop - enable_function_sections=auto +else case e in #( + e) enable_function_sections=auto ;; +esac fi @@ -4131,8 +4121,9 @@ then : if test x"$enable_ocamldebug" = "xyes" then : as_fn_error $? "ocamldebug requires the unix library" "$LINENO" 5 -else $as_nop - enable_ocamldebug="no" +else case e in #( + e) enable_ocamldebug="no" ;; +esac fi fi @@ -4141,12 +4132,14 @@ then : if test x"$enable_ocamldoc" = "xyes" then : as_fn_error $? "ocamldoc requires the unix and str libraries" "$LINENO" 5 -else $as_nop - enable_ocamldoc="no" - build_ocamltex=false +else case e in #( + e) enable_ocamldoc="no" + build_ocamltex=false ;; +esac fi -else $as_nop - build_ocamltex=true +else case e in #( + e) build_ocamltex=true ;; +esac fi if test x"$enable_ocamldoc" = "xno" @@ -4160,14 +4153,15 @@ fi with_ocamldoc="" enable_stdlib_manpages=no build_ocamldoc=false -else $as_nop - ocamldoc_target=ocamldoc +else case e in #( + e) ocamldoc_target=ocamldoc ocamldoc_opt_target=ocamldoc.opt with_ocamldoc=ocamldoc build_ocamldoc=true optional_libraries="$optional_libraries ocamldoc/odoc_info" ac_config_files="$ac_config_files ocamldoc/META" - + ;; +esac fi # Initialization of libtool @@ -4183,8 +4177,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LD"; then +else case e in #( + e) if test -n "$LD"; then ac_cv_prog_LD="$LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4206,7 +4200,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LD=$ac_cv_prog_LD if test -n "$LD"; then @@ -4232,8 +4227,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LD"; then +else case e in #( + e) if test -n "$ac_ct_LD"; then ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4255,7 +4250,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then @@ -4411,8 +4407,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4434,7 +4430,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4456,8 +4453,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4479,7 +4476,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4514,8 +4512,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4537,7 +4535,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4559,8 +4558,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -4599,7 +4598,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4623,8 +4623,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4646,7 +4646,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4672,8 +4673,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4695,7 +4696,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4733,8 +4735,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4756,7 +4758,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -4778,8 +4781,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4801,7 +4804,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -4830,10 +4834,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -4905,8 +4909,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -4926,7 +4930,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -4937,8 +4941,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -4947,13 +4952,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -4977,10 +4983,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -4990,11 +4996,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -5010,6 +5017,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -5049,26 +5058,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5100,16 +5110,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -5120,8 +5132,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5138,12 +5150,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -5161,8 +5175,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -5180,8 +5194,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5196,8 +5210,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5214,12 +5228,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -5246,8 +5263,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5264,25 +5281,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -5292,8 +5312,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5310,25 +5330,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -5338,8 +5361,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5356,25 +5379,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -5389,8 +5415,8 @@ printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ +else case e in #( + e) ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done @@ -5415,9 +5441,10 @@ do as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in +case `"$ac_path_SED" --version 2>&1` in #( *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5452,7 +5479,8 @@ IFS=$as_save_IFS else ac_cv_path_SED=$SED fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } @@ -5477,8 +5505,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5497,9 +5525,10 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5534,7 +5563,8 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -5546,8 +5576,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -5569,9 +5599,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5607,20 +5638,23 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else case e in #( + e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -5642,9 +5676,10 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in +case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -5680,7 +5715,8 @@ else ac_cv_path_FGREP=$FGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -5711,8 +5747,9 @@ test -z "$GREP" && GREP=grep if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else $as_nop - with_gnu_ld=no +else case e in #( + e) with_gnu_ld=no ;; +esac fi ac_prog=ld @@ -5757,8 +5794,8 @@ fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$LD"; then +else case e in #( + e) if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs @@ -5781,7 +5818,8 @@ else $as_nop IFS=$lt_save_ifs else lt_cv_path_LD=$LD # Let the user override the test with a path. -fi +fi ;; +esac fi LD=$lt_cv_path_LD @@ -5798,8 +5836,8 @@ printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 -else $as_nop - # I'd rather use --version here, but apparently some GNU lds only accept -v. +else case e in #( + e) # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 @@ -5826,8 +5865,8 @@ printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NM"; then +else case e in #( + e) if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else @@ -5874,7 +5913,8 @@ else IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } @@ -5895,8 +5935,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DUMPBIN"; then +else case e in #( + e) if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5918,7 +5958,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then @@ -5944,8 +5985,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DUMPBIN"; then +else case e in #( + e) if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5967,7 +6008,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then @@ -6021,8 +6063,8 @@ printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_nm_interface="BSD nm" +else case e in #( + e) lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) @@ -6035,7 +6077,8 @@ else $as_nop if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } @@ -6057,8 +6100,8 @@ printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 -else $as_nop - i=0 +else case e in #( + e) i=0 teststring=ABCD case $build_os in @@ -6180,7 +6223,8 @@ else $as_nop fi ;; esac - + ;; +esac fi if test -n "$lt_cv_sys_max_cmd_len"; then @@ -6237,8 +6281,8 @@ printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - case $host in +else case e in #( + e) case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys @@ -6269,7 +6313,8 @@ else $as_nop lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac - + ;; +esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd @@ -6285,8 +6330,8 @@ printf %s "checking how to convert $build file names to toolchain format... " >& if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - #assume ordinary cross tools, or native build. +else case e in #( + e) #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) @@ -6297,7 +6342,8 @@ case $host in esac ;; esac - + ;; +esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd @@ -6313,8 +6359,9 @@ printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_reload_flag='-r' +else case e in #( + e) lt_cv_ld_reload_flag='-r' ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } @@ -6355,8 +6402,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OBJDUMP"; then +else case e in #( + e) if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6378,7 +6425,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then @@ -6400,8 +6448,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OBJDUMP"; then +else case e in #( + e) if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6423,7 +6471,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then @@ -6464,8 +6513,8 @@ printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_file_magic_cmd='$MAGIC_CMD' +else case e in #( + e) lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -6658,7 +6707,8 @@ os2*) lt_cv_deplibs_check_method=pass_all ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } @@ -6710,8 +6760,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DLLTOOL"; then +else case e in #( + e) if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6733,7 +6783,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then @@ -6755,8 +6806,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DLLTOOL"; then +else case e in #( + e) if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6778,7 +6829,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then @@ -6820,8 +6872,8 @@ printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_sharedlib_from_linklib_cmd='unknown' +else case e in #( + e) lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) @@ -6841,7 +6893,8 @@ cygwin* | mingw* | pw32* | cegcc*) lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } @@ -6865,8 +6918,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6888,7 +6941,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -6914,8 +6968,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -6937,7 +6991,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -6983,8 +7038,8 @@ printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ar_at_file=no +else case e in #( + e) lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7021,7 +7076,8 @@ then : fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } @@ -7046,8 +7102,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7069,7 +7125,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -7091,8 +7148,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_STRIP"; then +else case e in #( + e) if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7114,7 +7171,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then @@ -7155,8 +7213,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7178,7 +7236,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -7200,8 +7259,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7223,7 +7282,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -7309,8 +7369,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7332,7 +7392,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -7381,8 +7442,8 @@ printf %s "checking command to parse $NM output from $compiler object... " >&6; if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -7637,7 +7698,8 @@ _LT_EOF lt_cv_sys_global_symbol_pipe= fi done - + ;; +esac fi if test -z "$lt_cv_sys_global_symbol_pipe"; then @@ -7701,8 +7763,9 @@ printf %s "checking for sysroot... " >&6; } if test ${with_sysroot+y} then : withval=$with_sysroot; -else $as_nop - with_sysroot=no +else case e in #( + e) with_sysroot=no ;; +esac fi @@ -7737,8 +7800,8 @@ printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then @@ -7774,7 +7837,8 @@ else ac_cv_path_lt_DD=$lt_DD fi -rm -f conftest.i conftest2.i conftest.out +rm -f conftest.i conftest2.i conftest.out ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } @@ -7785,8 +7849,8 @@ printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 -else $as_nop - printf 0123456789abcdef0123456789abcdef >conftest.i +else case e in #( + e) printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then @@ -7794,7 +7858,8 @@ if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; the && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -8004,8 +8069,8 @@ printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_ext=c +else case e in #( + e) ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -8025,8 +8090,9 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes -else $as_nop - lt_cv_cc_needs_belf=no +else case e in #( + e) lt_cv_cc_needs_belf=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -8035,7 +8101,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } @@ -8093,8 +8160,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8116,7 +8183,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then @@ -8138,8 +8206,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_MANIFEST_TOOL"; then +else case e in #( + e) if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8161,7 +8229,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then @@ -8193,15 +8262,16 @@ printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_path_mainfest_tool=no +else case e in #( + e) lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi - rm -f conftest* + rm -f conftest* ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } @@ -8224,8 +8294,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DSYMUTIL"; then +else case e in #( + e) if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8247,7 +8317,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then @@ -8269,8 +8340,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DSYMUTIL"; then +else case e in #( + e) if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8292,7 +8363,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then @@ -8326,8 +8398,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$NMEDIT"; then +else case e in #( + e) if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8349,7 +8421,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then @@ -8371,8 +8444,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_NMEDIT"; then +else case e in #( + e) if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8394,7 +8467,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then @@ -8428,8 +8502,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$LIPO"; then +else case e in #( + e) if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8451,7 +8525,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then @@ -8473,8 +8548,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_LIPO"; then +else case e in #( + e) if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8496,7 +8571,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then @@ -8530,8 +8606,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL"; then +else case e in #( + e) if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8553,7 +8629,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then @@ -8575,8 +8652,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8598,7 +8675,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then @@ -8632,8 +8710,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$OTOOL64"; then +else case e in #( + e) if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8655,7 +8733,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then @@ -8677,8 +8756,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_OTOOL64"; then +else case e in #( + e) if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -8700,7 +8779,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then @@ -8757,8 +8837,8 @@ printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_apple_cc_single_mod=no +else case e in #( + e) lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE @@ -8784,7 +8864,8 @@ else $as_nop fi rm -rf libconftest.dylib* rm -f conftest.* - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } @@ -8794,8 +8875,8 @@ printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" @@ -8813,13 +8894,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes -else $as_nop - lt_cv_ld_exported_symbols_list=no +else case e in #( + e) lt_cv_ld_exported_symbols_list=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } @@ -8829,8 +8912,8 @@ printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_ld_force_load=no +else case e in #( + e) lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF @@ -8855,7 +8938,8 @@ _LT_EOF fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } @@ -9000,8 +9084,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_shared=yes +else case e in #( + e) enable_shared=yes ;; +esac fi @@ -9032,8 +9117,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_static=yes +else case e in #( + e) enable_static=yes ;; +esac fi @@ -9064,8 +9150,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - pic_mode=default +else case e in #( + e) pic_mode=default ;; +esac fi @@ -9095,8 +9182,9 @@ then : IFS=$lt_save_ifs ;; esac -else $as_nop - enable_fast_install=yes +else case e in #( + e) enable_fast_install=yes ;; +esac fi @@ -9123,15 +9211,17 @@ then : ;; esac lt_cv_with_aix_soname=$with_aix_soname -else $as_nop - if test ${lt_cv_with_aix_soname+y} +else case e in #( + e) if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_with_aix_soname=aix +else case e in #( + e) lt_cv_with_aix_soname=aix ;; +esac fi - with_aix_soname=$lt_cv_with_aix_soname + with_aix_soname=$lt_cv_with_aix_soname ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 @@ -9222,8 +9312,8 @@ printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 -else $as_nop - rm -f .libs 2>/dev/null +else case e in #( + e) rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs @@ -9231,7 +9321,8 @@ else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi -rmdir .libs 2>/dev/null +rmdir .libs 2>/dev/null ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } @@ -9292,8 +9383,8 @@ printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -9336,6 +9427,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -9359,8 +9451,8 @@ printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 -else $as_nop - case $MAGIC_CMD in +else case e in #( + e) case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; @@ -9403,6 +9495,7 @@ _LT_EOF IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; +esac ;; esac fi @@ -9502,8 +9595,8 @@ printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_rtti_exceptions=no +else case e in #( + e) lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment @@ -9531,7 +9624,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } @@ -9896,8 +9990,9 @@ printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +else case e in #( + e) lt_cv_prog_compiler_pic=$lt_prog_compiler_pic ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } @@ -9912,8 +10007,8 @@ printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_pic_works=no +else case e in #( + e) lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment @@ -9941,7 +10036,8 @@ else $as_nop fi fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } @@ -9977,8 +10073,8 @@ printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_static_works=no +else case e in #( + e) lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -9999,7 +10095,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } @@ -10021,8 +10118,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -10062,7 +10159,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -10077,8 +10175,8 @@ printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler_c_o=no +else case e in #( + e) lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -10118,7 +10216,8 @@ else $as_nop cd .. $RM -r conftest $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -10715,8 +10814,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10748,7 +10847,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -10770,8 +10870,8 @@ else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10803,7 +10903,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi - + ;; +esac fi aix_libpath=$lt_cv_aix_libpath_ @@ -11054,8 +11155,8 @@ printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_prog_compiler__b=no +else case e in #( + e) lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -11076,7 +11177,8 @@ else $as_nop fi $RM -r conftest* LDFLAGS=$save_LDFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } @@ -11124,8 +11226,8 @@ printf %s "checking whether the $host_os linker accepts -exported_symbol... " >& if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 -else $as_nop - save_LDFLAGS=$LDFLAGS +else case e in #( + e) save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11134,12 +11236,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes -else $as_nop - lt_cv_irix_exported_symbol=no +else case e in #( + e) lt_cv_irix_exported_symbol=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS + LDFLAGS=$save_LDFLAGS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } @@ -11465,8 +11569,8 @@ printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 -else $as_nop - $RM conftest* +else case e in #( + e) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 @@ -11502,7 +11606,8 @@ else $as_nop cat conftest.err 1>&5 fi $RM conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } @@ -12229,8 +12334,8 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 -else $as_nop - lt_cv_shlibpath_overrides_runpath=no +else case e in #( + e) lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ @@ -12257,7 +12362,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir - + ;; +esac fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath @@ -12694,16 +12800,22 @@ printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -12715,24 +12827,27 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - +else case e in #( + e) lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes - + ;; +esac fi ;; @@ -12750,22 +12865,28 @@ fi if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shl_load (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (void); int main (void) { @@ -12777,39 +12898,47 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes -else $as_nop - ac_cv_lib_dld_shl_load=no +else case e in #( + e) ac_cv_lib_dld_shl_load=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else $as_nop - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -12821,34 +12950,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -12860,34 +12997,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes -else $as_nop - ac_cv_lib_svld_dlopen=no +else case e in #( + e) ac_cv_lib_svld_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dld_link (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (void); int main (void) { @@ -12899,12 +13044,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes -else $as_nop - ac_cv_lib_dld_dld_link=no +else case e in #( + e) ac_cv_lib_dld_dld_link=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } @@ -12913,19 +13060,24 @@ then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi ;; @@ -12953,8 +13105,8 @@ printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13048,7 +13200,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } @@ -13060,8 +13213,8 @@ printf %s "checking whether a statically linked program can dlopen itself... " > if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 -else $as_nop - if test yes = "$cross_compiling"; then : +else case e in #( + e) if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 @@ -13155,7 +13308,8 @@ _LT_EOF fi rm -fr conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } @@ -13327,8 +13481,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DEP_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DEP_CC"; then +else case e in #( + e) if test -n "$DEP_CC"; then ac_cv_prog_DEP_CC="$DEP_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13350,7 +13504,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DEP_CC=$ac_cv_prog_DEP_CC if test -n "$DEP_CC"; then @@ -13376,8 +13531,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DEP_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DEP_CC"; then +else case e in #( + e) if test -n "$ac_ct_DEP_CC"; then ac_cv_prog_ac_ct_DEP_CC="$ac_ct_DEP_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -13399,7 +13554,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DEP_CC=$ac_cv_prog_ac_ct_DEP_CC if test -n "$ac_ct_DEP_CC"; then @@ -13436,8 +13592,9 @@ case $enable_dependency_generation in #( if test "$DEP_CC" = "false" then : as_fn_error $? "The MSVC ports cannot generate dependency information. Install gcc (or another CC-like compiler)" "$LINENO" 5 -else $as_nop - compute_deps=true +else case e in #( + e) compute_deps=true ;; +esac fi ;; #( no) : compute_deps=false ;; #( @@ -13447,11 +13604,13 @@ then : if test "$DEP_CC" = "false" then : compute_deps=false -else $as_nop - compute_deps=true +else case e in #( + e) compute_deps=true ;; +esac fi -else $as_nop - compute_deps=false +else case e in #( + e) compute_deps=false ;; +esac fi ;; esac @@ -13470,8 +13629,9 @@ case $host in #( if test "$host_cpu" = "x86_64" then : machine="-machine:AMD64 " -else $as_nop - machine="" +else case e in #( + e) machine="" ;; +esac fi mklib="link -lib -nologo $machine /out:\$(1) \$(2)" ;; #( @@ -13497,8 +13657,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -13516,9 +13676,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -13532,15 +13693,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -13549,7 +13711,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -13572,9 +13735,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -13588,24 +13752,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -13656,19 +13822,21 @@ then : if test ${ocaml_cv_cc_vendor2+y} then : printf %s "(cached) " >&6 -else $as_nop - ocaml_cv_cc_vendor2=`sed -e '/^#/d' conftest.i | tr -s '[:space:]' '-' \ - | sed -e 's/^-//' -e 's/-$//'` +else case e in #( + e) ocaml_cv_cc_vendor2=`sed -e '/^#/d' conftest.i | tr -s '[:space:]' '-' \ + | sed -e 's/^-//' -e 's/-$//'` ;; +esac fi # Domain of values was changed in #12768, so the cache key became different # from the variable ocaml_cc_vendor="$ocaml_cv_cc_vendor2" -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "unexpected preprocessor failure -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ocaml_cc_vendor" >&5 @@ -13687,8 +13855,8 @@ then : # autoconf displays a warning if this parameter is missing, but # cross-compilation mode was disabled above. assert=false -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) {return 0;} _ACEOF @@ -13697,13 +13865,15 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } host_runnable=true -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - host_runnable=false + host_runnable=false ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi cross_compiling="$old_cross_compiling" @@ -13797,8 +13967,9 @@ then : ocamltest_unix_impl="real" unix_directory="otherlibs/unix" unix_library="${unix_directory}/unix" -else $as_nop - ocamltest_libunix="None" +else case e in #( + e) ocamltest_libunix="None" ;; +esac fi if test x"$enable_str_lib" != "xno" @@ -13818,8 +13989,8 @@ printf %s "checking whether #! works in shell scripts... " >&6; } if test ${ac_cv_sys_interpreter+y} then : printf %s "(cached) " >&6 -else $as_nop - echo '#! /bin/cat +else case e in #( + e) echo '#! /bin/cat exit 69 ' >conftest chmod u+x conftest @@ -13829,7 +14000,8 @@ if test $? -ne 69; then else ac_cv_sys_interpreter=no fi -rm -f conftest +rm -f conftest ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_interpreter" >&5 printf "%s\n" "$ac_cv_sys_interpreter" >&6; } @@ -13873,8 +14045,9 @@ ac_config_commands="$ac_config_commands shebang" if test x"$host" = x"$target" then : cross_compiler=false -else $as_nop - cross_compiler=true +else case e in #( + e) cross_compiler=true ;; +esac fi # Checks for programs @@ -13907,14 +14080,14 @@ case $ocaml_cc_vendor in #( esac # Use -Wold-style-declaration if supported -as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$warn_error_flag_-Wold-style-declaration" | $as_tr_sh` +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$warn_error_flag_-Wold-style-declaration" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wold-style-declaration" >&5 printf %s "checking whether C compiler accepts -Wold-style-declaration... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $warn_error_flag -Wold-style-declaration" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13931,11 +14104,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -13943,8 +14118,9 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : cc_warnings="$cc_warnings -Wold-style-declaration" -else $as_nop - : +else case e in #( + e) : ;; +esac fi @@ -14001,10 +14177,11 @@ then : cl_has_volatile_metadata=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - cl_has_volatile_metadata=false +else case e in #( + e) cl_has_volatile_metadata=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -14062,8 +14239,9 @@ then : *) : ;; esac -else $as_nop - supports_shared_libraries=true +else case e in #( + e) supports_shared_libraries=true ;; +esac fi # Define flexlink chain and flags correctly for the different Windows ports @@ -14103,8 +14281,8 @@ then : flexdll_source_dir='' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } -else $as_nop - flexmsg='' +else case e in #( + e) flexmsg='' case $target in #( *-*-cygwin*|*-w64-mingw32*|*-pc-windows) : if test x"$with_flexdll" = 'x' || test x"$with_flexdll" = 'xflexdll' @@ -14114,16 +14292,17 @@ then : flexdll_source_dir=flexdll iflexdir='$(ROOTDIR)/flexdll' with_flexdll="$iflexdir" -else $as_nop - if test x"$with_flexdll" != 'x' +else case e in #( + e) if test x"$with_flexdll" != 'x' then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 printf "%s\n" "requested but not available" >&6; } as_fn_error $? "exiting" "$LINENO" 5 +fi ;; +esac fi -fi -else $as_nop - rm -rf flexdll-sources +else case e in #( + e) rm -rf flexdll-sources if test -f "$with_flexdll/flexdll.h" then : mkdir -p flexdll-sources @@ -14131,23 +14310,26 @@ then : flexdll_source_dir='flexdll-sources' iflexdir='$(ROOTDIR)/flexdll-sources' flexmsg=" (from $with_flexdll)" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available" >&5 printf "%s\n" "requested but not available" >&6; } - as_fn_error $? "exiting" "$LINENO" 5 -fi + as_fn_error $? "exiting" "$LINENO" 5 ;; +esac +fi ;; +esac fi if test x"$flexdll_source_dir" = 'x' then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iflexdir$flexmsg" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $iflexdir$flexmsg" >&5 printf "%s\n" "$iflexdir$flexmsg" >&6; } bootstrapping_flexdll=true flexdll_dir=\"+flexdll\" # The submodule should be searched *before* any other -I paths - internal_cppflags="-I $iflexdir $internal_cppflags" + internal_cppflags="-I $iflexdir $internal_cppflags" ;; +esac fi ;; #( *) : if test x"$with_flexdll" != 'x' @@ -14156,6 +14338,7 @@ then : printf "%s\n" "requested but not supported" >&6; } as_fn_error $? "exiting" "$LINENO" 5 fi ;; +esac ;; esac fi @@ -14166,8 +14349,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_flexlink+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$flexlink"; then +else case e in #( + e) if test -n "$flexlink"; then ac_cv_prog_flexlink="$flexlink" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -14189,7 +14372,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi flexlink=$ac_cv_prog_flexlink if test -n "$flexlink"; then @@ -14251,17 +14435,19 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } - as_fn_error $? "$flexlink does not work" "$LINENO" 5 + as_fn_error $? "$flexlink does not work" "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unexpected compile error" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unexpected compile error" >&5 printf "%s\n" "unexpected compile error" >&6; } - as_fn_error $? "error calling the C compiler" "$LINENO" 5 + as_fn_error $? "error calling the C compiler" "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14313,8 +14499,9 @@ fi if test "x$ac_cv_header_flexdll_h" = xyes then : have_flexdll_h=yes -else $as_nop - have_flexdll_h=no +else case e in #( + e) have_flexdll_h=no ;; +esac fi if test x"$have_flexdll_h" = 'xno' @@ -14370,9 +14557,10 @@ then : have_flexdll_h=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -14435,10 +14623,11 @@ then : mkexe_cmd="flexlink -exe -chain ${flexdll_chain} ${flexlink_flags}" mkexe_cflags='' mkexe_ldflags_prefix='-link ' -else $as_nop - mkexe_extra_flags='' +else case e in #( + e) mkexe_extra_flags='' oc_ldflags='-Wl,--stack,16777216' - + ;; +esac fi ostype="Cygwin" ;; #( *,*-*-mingw32*) : @@ -14503,8 +14692,8 @@ if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -14558,7 +14747,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -14590,15 +14780,21 @@ printf %s "checking for library containing cos... " >&6; } if test ${ac_cv_search_cos+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char cos (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cos (void); int main (void) { @@ -14629,11 +14825,13 @@ done if test ${ac_cv_search_cos+y} then : -else $as_nop - ac_cv_search_cos=no +else case e in #( + e) ac_cv_search_cos=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cos" >&5 printf "%s\n" "$ac_cv_search_cos" >&6; } @@ -14733,10 +14931,11 @@ ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -14746,28 +14945,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_int" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_int" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } @@ -14779,28 +14980,30 @@ printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } @@ -14812,28 +15015,30 @@ printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long *" >&5 printf %s "checking size of long *... " >&6; } if test ${ac_cv_sizeof_long_p+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long *))" "ac_cv_sizeof_long_p" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long *))" "ac_cv_sizeof_long_p" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long_p" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long_p" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long *) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_p=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_p" >&5 printf "%s\n" "$ac_cv_sizeof_long_p" >&6; } @@ -14845,28 +15050,30 @@ printf "%s\n" "#define SIZEOF_LONG_P $ac_cv_sizeof_long_p" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 printf %s "checking size of short... " >&6; } if test ${ac_cv_sizeof_short+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_short" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_short" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (short) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 printf "%s\n" "$ac_cv_sizeof_short" >&6; } @@ -14878,28 +15085,30 @@ printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 printf %s "checking size of long long... " >&6; } if test ${ac_cv_sizeof_long_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } @@ -14918,9 +15127,10 @@ then : bits=64; arch64=true printf "%s\n" "#define ARCH_SIXTYFOUR 1" >>confdefs.h -else $as_nop - as_fn_error $? "Neither 32 nor 64 bits architecture." "$LINENO" 5 - +else case e in #( + e) as_fn_error $? "Neither 32 nor 64 bits architecture." "$LINENO" 5 + ;; +esac fi if test "x$ac_cv_sizeof_int" != "x4" && test "x$ac_cv_sizeof_long" != "x4" \ @@ -14950,8 +15160,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14997,8 +15207,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -15029,8 +15239,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -15074,8 +15285,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -15102,22 +15314,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -15126,9 +15339,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -15151,14 +15365,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -15187,22 +15404,24 @@ printf %s "checking alignment of double... " >&6; } if test ${ac_cv_alignof_double+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double" "$ac_includes_default +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_double" "$ac_includes_default typedef struct { char x; double y; } ac__type_alignof_;" then : -else $as_nop - if test "$ac_cv_type_double" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_double" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute alignment of double -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_alignof_double=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_double" >&5 printf "%s\n" "$ac_cv_alignof_double" >&6; } @@ -15219,22 +15438,24 @@ printf %s "checking alignment of long... " >&6; } if test ${ac_cv_alignof_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long" "$ac_includes_default +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long" "$ac_includes_default typedef struct { char x; long y; } ac__type_alignof_;" then : -else $as_nop - if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute alignment of long -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_alignof_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5 printf "%s\n" "$ac_cv_alignof_long" >&6; } @@ -15251,22 +15472,24 @@ printf %s "checking alignment of long long... " >&6; } if test ${ac_cv_alignof_long_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long" "$ac_includes_default +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long_long" "$ac_includes_default typedef struct { char x; long long y; } ac__type_alignof_;" then : -else $as_nop - if test "$ac_cv_type_long_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute alignment of long long -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_alignof_long_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long_long" >&5 printf "%s\n" "$ac_cv_alignof_long_long" >&6; } @@ -15293,13 +15516,14 @@ fi then : printf "%s\n" "#define ARCH_ALIGN_INT64 1" >>confdefs.h -else $as_nop - if test "x$ac_cv_sizeof_long_long" = "x8" && +else case e in #( + e) if test "x$ac_cv_sizeof_long_long" = "x8" && test "$ac_cv_alignof_long_long" -gt 4 then : printf "%s\n" "#define ARCH_ALIGN_INT64 1" >>confdefs.h -fi +fi ;; +esac fi ;; esac @@ -15345,10 +15569,11 @@ then : cc_supports_atomic=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - cc_supports_atomic=false +else case e in #( + e) cc_supports_atomic=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15356,10 +15581,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ if ! $cc_supports_atomic then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C11 atomic support is required, use another C compiler -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi # Full support for thread local storage @@ -15545,6 +15770,8 @@ then : natdynlink=true ;; #( riscv*-*-linux*) : natdynlink=true ;; #( + loongarch*-*-linux*) : + natdynlink=true ;; #( *) : ;; esac @@ -15576,10 +15803,11 @@ then : cc_has_fno_tree_vrp=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - cc_has_fno_tree_vrp=false +else case e in #( + e) cc_has_fno_tree_vrp=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -15605,9 +15833,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15630,9 +15859,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -15736,8 +15966,9 @@ case $host in #( if $arch64 then : has_native_backend=yes; arch=arm64; system=linux -else $as_nop - arch=arm; model=armv8; system=linux +else case e in #( + e) arch=arm; model=armv8; system=linux ;; +esac fi ;; #( aarch64-*-freebsd*) : has_native_backend=yes; arch=arm64; system=freebsd ;; #( @@ -15748,7 +15979,9 @@ fi ;; #( x86_64-*-cygwin*) : has_native_backend=yes; arch=amd64; system=cygwin ;; #( riscv64-*-linux*) : - has_native_backend=yes; arch=riscv; model=riscv64; system=linux + has_native_backend=yes; arch=riscv; model=riscv64; system=linux ;; #( + loongarch64-*-linux*) : + has_native_backend=yes; arch=loongarch64; system=linux ;; #( *) : ;; @@ -15789,8 +16022,9 @@ esac if $native_compiler then : default_build_target=world.opt -else $as_nop - default_build_target=world +else case e in #( + e) default_build_target=world ;; +esac fi if ! $native_compiler @@ -15801,14 +16035,16 @@ fi if $natdynlink then : cmxs="cmxs" -else $as_nop - cmxs="cmx" +else case e in #( + e) cmxs="cmx" ;; +esac fi if $natdynlink then : natdynlink_archive="dynlink.cmxa" -else $as_nop - natdynlink_archive="" +else case e in #( + e) natdynlink_archive="" ;; +esac fi printf "%s\n" "#define OCAML_OS_TYPE \"$ostype\"" >>confdefs.h @@ -15822,8 +16058,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DIRECT_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DIRECT_LD"; then +else case e in #( + e) if test -n "$DIRECT_LD"; then ac_cv_prog_DIRECT_LD="$DIRECT_LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15845,7 +16081,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DIRECT_LD=$ac_cv_prog_DIRECT_LD if test -n "$DIRECT_LD"; then @@ -15867,8 +16104,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DIRECT_LD+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_DIRECT_LD"; then +else case e in #( + e) if test -n "$ac_ct_DIRECT_LD"; then ac_cv_prog_ac_ct_DIRECT_LD="$ac_ct_DIRECT_LD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -15890,7 +16127,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_DIRECT_LD=$ac_cv_prog_ac_ct_DIRECT_LD if test -n "$ac_ct_DIRECT_LD"; then @@ -15927,8 +16165,9 @@ then : if $arch64 then : PACKLD_FLAGS=' -m elf64ppc' -else $as_nop - PACKLD_FLAGS=' -m elf32ppclinux' +else case e in #( + e) PACKLD_FLAGS=' -m elf32ppclinux' ;; +esac fi ;; #( *) : PACKLD_FLAGS='' ;; @@ -15945,8 +16184,9 @@ esac *) : PACKLD="$DIRECT_LD -r$PACKLD_FLAGS -o " ;; esac -else $as_nop - PACKLD="$PARTIALLD -o " +else case e in #( + e) PACKLD="$PARTIALLD -o " ;; +esac fi # Disable PIE at link time when ocamlopt does not produce position-independent @@ -15982,17 +16222,19 @@ then : toolpref="${target_alias}-" as_target="$target" as_cpu="$target_cpu" -else $as_nop - if test -n "$host_alias" +else case e in #( + e) if test -n "$host_alias" then : toolpref="${host_alias}-" as_target="$host" as_cpu="$host_cpu" -else $as_nop - toolpref="" +else case e in #( + e) toolpref="" as_target="$build" - as_cpu="$build_cpu" -fi + as_cpu="$build_cpu" ;; +esac +fi ;; +esac fi # Finding the assembler @@ -16011,7 +16253,7 @@ default_aspp="$CC -c" case $as_target,$ocaml_cc_vendor in #( *-*-linux*,gcc-*) : case $as_cpu in #( - x86_64|arm*|aarch64*|i[3-6]86|riscv*) : + x86_64|arm*|aarch64*|i[3-6]86|riscv*|loongarch*) : default_as="${toolpref}as" ;; #( *) : ;; @@ -16036,8 +16278,9 @@ then : internal_cflags="$internal_cflags $sharedlib_cflags" default_aspp="$default_aspp $sharedlib_cflags" -else $as_nop - fpic=false +else case e in #( + e) fpic=false ;; +esac fi if test -z "$AS" @@ -16058,8 +16301,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_rlwrap+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$rlwrap"; then +else case e in #( + e) if test -n "$rlwrap"; then ac_cv_prog_rlwrap="$rlwrap" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -16081,7 +16324,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi rlwrap=$ac_cv_prog_rlwrap if test -n "$rlwrap"; then @@ -16112,16 +16356,18 @@ printf "%s\n" "$as_me: checking semantics of signal handlers" >&6;} if test "x$ac_cv_func_sigaction" = xyes then : has_sigaction=true -else $as_nop - has_sigaction=false +else case e in #( + e) has_sigaction=false ;; +esac fi ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask" if test "x$ac_cv_func_sigprocmask" = xyes then : has_sigprocmask=true -else $as_nop - has_sigprocmask=false +else case e in #( + e) has_sigprocmask=false ;; +esac fi if $has_sigaction && $has_sigprocmask @@ -16130,11 +16376,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: POSIX signal handling found." >&5 printf "%s\n" "$as_me: POSIX signal handling found." >&6;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: assuming signals have the System V semantics." >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: assuming signals have the System V semantics." >&5 printf "%s\n" "$as_me: assuming signals have the System V semantics." >&6;} - + ;; +esac fi @@ -16144,16 +16391,17 @@ has_c99_float_ops=true for ac_func in expm1 log1p hypot fma exp2 log2 cbrt acosh asinh atanh erf erfc trunc round copysign do : - as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF -else $as_nop - has_c99_float_ops=false +else case e in #( + e) has_c99_float_ops=false ;; +esac fi done @@ -16184,8 +16432,8 @@ printf "%s\n" "cross-compiling; assume yes" >&6; } printf "%s\n" "#define HAS_WORKING_ROUND 1" >>confdefs.h ;; esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -16201,8 +16449,8 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAS_WORKING_ROUND 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } case $enable_imprecise_c99_float_ops,$target in #( no,*) : @@ -16217,13 +16465,16 @@ esac if test x"$hard_error" = "xtrue" then : as_fn_error $? "round does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: round does not work; emulation enabled" >&5 -printf "%s\n" "$as_me: WARNING: round does not work; emulation enabled" >&2;} -fi +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: round does not work; emulation enabled" >&5 +printf "%s\n" "$as_me: WARNING: round does not work; emulation enabled" >&2;} ;; +esac +fi ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi cross_compiling="$old_cross_compiling" @@ -16252,8 +16503,8 @@ printf "%s\n" "cross-compiling; assume yes" >&6; } printf "%s\n" "#define HAS_WORKING_FMA 1" >>confdefs.h ;; esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -16291,8 +16542,8 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAS_WORKING_FMA 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } case $enable_imprecise_c99_float_ops,$target in #( no,*) : @@ -16307,8 +16558,9 @@ printf "%s\n" "no" >&6; } if test "${ocaml_cc_vendor#msvc-}" -lt 1920 then : hard_error=false -else $as_nop - hard_error=true +else case e in #( + e) hard_error=true ;; +esac fi ;; #( *) : hard_error=true ;; @@ -16317,20 +16569,23 @@ esac if test x"$hard_error" = "xtrue" then : as_fn_error $? "fma does not work, enable emulation with --enable-imprecise-c99-float-ops" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: fma does not work; emulation enabled" >&5 -printf "%s\n" "$as_me: WARNING: fma does not work; emulation enabled" >&2;} -fi +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: fma does not work; emulation enabled" >&5 +printf "%s\n" "$as_me: WARNING: fma does not work; emulation enabled" >&2;} ;; +esac +fi ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi cross_compiling="$old_cross_compiling" -else $as_nop - if test x"$enable_imprecise_c99_float_ops" != "xyes" +else case e in #( + e) if test x"$enable_imprecise_c99_float_ops" != "xyes" then : case $enable_imprecise_c99_float_ops,$ocaml_cc_vendor in #( no,*) : @@ -16339,8 +16594,9 @@ then : if test "${ocaml_cc_vendor#msvc-}" -lt 1800 then : hard_error=false -else $as_nop - hard_error=true +else case e in #( + e) hard_error=true ;; +esac fi ;; #( *) : hard_error=true ;; @@ -16348,11 +16604,13 @@ esac if test x"$hard_error" = 'xtrue' then : as_fn_error $? "C99 float ops unavailable, enable replacements with --enable-imprecise-c99-float-ops" "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: C99 float ops unavailable, replacements enabled (ancient Visual Studio)" >&5 -printf "%s\n" "$as_me: WARNING: C99 float ops unavailable, replacements enabled (ancient Visual Studio)" >&2;} -fi +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: C99 float ops unavailable, replacements enabled (ancient Visual Studio)" >&5 +printf "%s\n" "$as_me: WARNING: C99 float ops unavailable, replacements enabled (ancient Visual Studio)" >&2;} ;; +esac fi +fi ;; +esac fi ## getentropy @@ -16361,8 +16619,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -16381,8 +16639,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -16410,26 +16668,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -16477,14 +16738,15 @@ if test "x$ac_cv_func_secure_getenv" = xyes then : printf "%s\n" "#define HAS_SECURE_GETENV 1" >>confdefs.h -else $as_nop - ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv" if test "x$ac_cv_func___secure_getenv" = xyes then : printf "%s\n" "#define HAS___SECURE_GETENV 1" >>confdefs.h fi - + ;; +esac fi @@ -16524,8 +16786,9 @@ then : printf "%s\n" "#define HAS_CLOCK_GETTIME_NSEC_NP 1" >>confdefs.h -else $as_nop - has_monotonic_clock=false +else case e in #( + e) has_monotonic_clock=false ;; +esac fi done ;; #( @@ -16552,8 +16815,9 @@ then : printf "%s\n" "#define HAS_POSIX_MONOTONIC_CLOCK 1" >>confdefs.h -else $as_nop - has_monotonic_clock=false +else case e in #( + e) has_monotonic_clock=false ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -16591,15 +16855,21 @@ printf %s "checking for library containing clock_gettime... " >&6; } if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char clock_gettime (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (void); int main (void) { @@ -16630,11 +16900,13 @@ done if test ${ac_cv_search_clock_gettime+y} then : -else $as_nop - ac_cv_search_clock_gettime=no +else case e in #( + e) ac_cv_search_clock_gettime=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } @@ -16643,8 +16915,9 @@ if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" has_clock_gettime=true -else $as_nop - has_clock_gettime=false +else case e in #( + e) has_clock_gettime=false ;; +esac fi case $enable_instrumented_runtime,$has_clock_gettime,$has_monotonic_clock in #( @@ -16658,9 +16931,10 @@ fi if test "x$ac_cv_search_clock_gettime" = "xnone required" then : instrumented_runtime_libs="" -else $as_nop - instrumented_runtime_libs=$ac_cv_search_clock_gettime - +else case e in #( + e) instrumented_runtime_libs=$ac_cv_search_clock_gettime + ;; +esac fi ;; #( yes,false,*) : @@ -16755,8 +17029,9 @@ esac ;; #( as_fn_error $? "thread sanitizer not supported on arch $arch" "$LINENO" 5 ;; esac -else $as_nop - tsan=false +else case e in #( + e) tsan=false ;; +esac fi if $tsan @@ -16781,9 +17056,10 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - as_fn_error $? "libtsan is necessary for TSan but cannot be found. - Try installing it on your system." "$LINENO" 5 +else case e in #( + e) as_fn_error $? "libtsan is necessary for TSan but cannot be found. + Try installing it on your system." "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16803,14 +17079,14 @@ esac *) : ;; esac - as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$warn_error_flag_-fsanitize=thread $tsan_distinguish_volatile_cflags" | $as_tr_sh` + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags_$warn_error_flag_-fsanitize=thread $tsan_distinguish_volatile_cflags" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fsanitize=thread $tsan_distinguish_volatile_cflags" >&5 printf %s "checking whether C compiler accepts -fsanitize=thread $tsan_distinguish_volatile_cflags... " >&6; } if eval test \${$as_CACHEVAR+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $warn_error_flag -fsanitize=thread $tsan_distinguish_volatile_cflags" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16827,11 +17103,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_CACHEVAR=yes" -else $as_nop - eval "$as_CACHEVAR=no" +else case e in #( + e) eval "$as_CACHEVAR=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - CFLAGS=$ax_check_save_flags + CFLAGS=$ax_check_save_flags ;; +esac fi eval ac_res=\$$as_CACHEVAR { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -16839,8 +17117,9 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_CACHEVAR"\" = x"yes" then : : -else $as_nop - as_fn_error $? "The C compiler does not support the \`$tsan_distinguish_volatile_cflags' flag. Try upgrading to GCC >= 11, or to Clang >= 11." "$LINENO" 5 +else case e in #( + e) as_fn_error $? "The C compiler does not support the \`$tsan_distinguish_volatile_cflags' flag. Try upgrading to GCC >= 11, or to Clang >= 11." "$LINENO" 5 ;; +esac fi oc_tsan_cflags="$oc_tsan_cflags $tsan_distinguish_volatile_cflags" @@ -16848,11 +17127,12 @@ fi native_cflags="$native_cflags $oc_tsan_cflags" ocamlc_cflags="$ocamlc_cflags $oc_tsan_cflags" tsan_native_runtime_c_sources="tsan" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not using thread sanitizer" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not using thread sanitizer" >&5 printf "%s\n" "$as_me: not using thread sanitizer" >&6;} tsan_native_runtime_c_sources="" - + ;; +esac fi # libunwind detection when TSan is enabled @@ -16874,8 +17154,9 @@ fi if test x"$LIBUNWIND_CPPFLAGS" != x then : libunwind_cppflags="$LIBUNWIND_CPPFLAGS" -else $as_nop - libunwind_cppflags="" +else case e in #( + e) libunwind_cppflags="" ;; +esac fi case "$system" in #( @@ -16919,8 +17200,9 @@ then : printf "%s\n" "#define HAS_LIBUNWIND 1" >>confdefs.h libunwind_available=true -else $as_nop - libunwind_available=false +else case e in #( + e) libunwind_available=false ;; +esac fi LDFLAGS="$SAVED_LDFLAGS" @@ -16960,15 +17242,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -16999,11 +17287,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -17028,15 +17318,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -17067,11 +17363,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -17096,15 +17394,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -17135,11 +17439,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -17157,15 +17463,21 @@ printf %s "checking for library containing socket... " >&6; } if test ${ac_cv_search_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -17196,11 +17508,13 @@ done if test ${ac_cv_search_socket+y} then : -else $as_nop - ac_cv_search_socket=no +else case e in #( + e) ac_cv_search_socket=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 printf "%s\n" "$ac_cv_search_socket" >&6; } @@ -17216,15 +17530,21 @@ printf %s "checking for library containing inet_ntop... " >&6; } if test ${ac_cv_search_inet_ntop+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char inet_ntop (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char inet_ntop (void); int main (void) { @@ -17255,11 +17575,13 @@ done if test ${ac_cv_search_inet_ntop+y} then : -else $as_nop - ac_cv_search_inet_ntop=no +else case e in #( + e) ac_cv_search_inet_ntop=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntop" >&5 printf "%s\n" "$ac_cv_search_inet_ntop" >&6; } @@ -17275,16 +17597,17 @@ fi for ac_func in socket socketpair bind listen accept connect do : - as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` + as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | sed "$as_sed_sh"` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_func" | sed "$as_sed_cpp"` 1 _ACEOF -else $as_nop - sockets=false +else case e in #( + e) sockets=false ;; +esac fi done @@ -17360,8 +17683,9 @@ case $host in #( if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : -else $as_nop - ipv6=false +else case e in #( + e) ipv6=false ;; +esac fi ;; #( *) : @@ -17375,8 +17699,9 @@ fi if test "x$ac_cv_type_struct_sockaddr_in6" = xyes then : -else $as_nop - ipv6=false +else case e in #( + e) ipv6=false ;; +esac fi ;; @@ -17388,8 +17713,9 @@ then : if test "x$ac_cv_func_getaddrinfo" = xyes then : -else $as_nop - ipv6=false +else case e in #( + e) ipv6=false ;; +esac fi fi @@ -17400,8 +17726,9 @@ then : if test "x$ac_cv_func_getnameinfo" = xyes then : -else $as_nop - ipv6=false +else case e in #( + e) ipv6=false ;; +esac fi fi @@ -17412,8 +17739,9 @@ then : if test "x$ac_cv_func_inet_pton" = xyes then : -else $as_nop - ipv6=false +else case e in #( + e) ipv6=false ;; +esac fi fi @@ -17545,8 +17873,9 @@ then : printf "%s\n" "#define HAS_SELECT 1" >>confdefs.h select=true -else $as_nop - select=false +else case e in #( + e) select=false ;; +esac fi fi @@ -17595,8 +17924,9 @@ then : printf "%s\n" "#define HAS_WAITPID 1" >>confdefs.h -else $as_nop - wait=false +else case e in #( + e) wait=false ;; +esac fi @@ -17683,8 +18013,9 @@ then : printf "%s\n" "#define HAS_SETITIMER 1" >>confdefs.h -else $as_nop - setitimer=false +else case e in #( + e) setitimer=false ;; +esac fi @@ -17730,8 +18061,9 @@ then : printf "%s\n" "#define HAS_GETTIMEOFDAY 1" >>confdefs.h -else $as_nop - gettimeofday=false +else case e in #( + e) gettimeofday=false ;; +esac fi @@ -17868,22 +18200,28 @@ then : if test "x$ac_cv_func_dlopen" = xyes then : supports_shared_libraries=true DLLIBS="" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlopen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (void); int main (void) { @@ -17895,27 +18233,32 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes -else $as_nop - ac_cv_lib_dl_dlopen=no +else case e in #( + e) ac_cv_lib_dl_dlopen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : supports_shared_libraries=true DLLIBS="-ldl $DLLIBS" -else $as_nop - supports_shared_libraries=false +else case e in #( + e) supports_shared_libraries=false ;; +esac fi - + ;; +esac fi ;; esac -else $as_nop - supports_shared_libraries=false +else case e in #( + e) supports_shared_libraries=false ;; +esac fi if $supports_shared_libraries @@ -17924,9 +18267,10 @@ then : printf "%s\n" "$as_me: Dynamic loading of shared libraries is supported." >&6;} printf "%s\n" "#define SUPPORT_DYNAMIC_LINKING 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Dynamic loading of shared libraries is not supported." >&5 -printf "%s\n" "$as_me: Dynamic loading of shared libraries is not supported." >&6;} +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Dynamic loading of shared libraries is not supported." >&5 +printf "%s\n" "$as_me: Dynamic loading of shared libraries is not supported." >&6;} ;; +esac fi ## mmap @@ -17984,10 +18328,11 @@ then : cc_has_debug_prefix_map=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - cc_has_debug_prefix_map=false +else case e in #( + e) cc_has_debug_prefix_map=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$saved_CFLAGS" @@ -18048,9 +18393,10 @@ if $stat_has_ns_precision then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: stat supports nanosecond precision" >&5 printf "%s\n" "$as_me: stat supports nanosecond precision" >&6;} -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: stat does not support nanosecond precision" >&5 -printf "%s\n" "$as_me: stat does not support nanosecond precision" >&6;} +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: stat does not support nanosecond precision" >&5 +printf "%s\n" "$as_me: stat does not support nanosecond precision" >&6;} ;; +esac fi # Number of arguments of gethostbyname_r @@ -18069,8 +18415,8 @@ printf %s "checking how many arguments gethostbyname_r() takes... " >&6; } if test ${ac_cv_func_which_gethostbyname_r+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ################################################################ @@ -18204,7 +18550,8 @@ fi ################################################################ - + ;; +esac fi case "$ac_cv_func_which_gethostbyname_r" in @@ -18294,8 +18641,8 @@ printf %s "checking how many arguments gethostbyaddr_r() takes... " >&6; } if test ${ac_cv_func_which_gethostbyaddr_r+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ################################################################ @@ -18400,7 +18747,8 @@ fi ################################################################ - + ;; +esac fi case "$ac_cv_func_which_gethostbyaddr_r" in @@ -18579,8 +18927,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $PKG_CONFIG in +else case e in #( + e) case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; @@ -18605,6 +18953,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG @@ -18627,8 +18976,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_PKG_CONFIG in +else case e in #( + e) case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; @@ -18653,6 +19002,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG @@ -18696,27 +19046,34 @@ then : zstd_libs=`${PKG_CONFIG} --libs libzstd` zstd_flags=`${PKG_CONFIG} --cflags libzstd` zstd_status="ok" -else $as_nop - zstd_status="zstd library too old: version 1.4 or later is needed" +else case e in #( + e) zstd_status="zstd library too old: version 1.4 or later is needed" ;; +esac fi -else $as_nop - # Otherwise, try to find zstd the old way, +else case e in #( + e) # Otherwise, try to find zstd the old way, # assuming it is installed in default places { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ZSTD_createCCtx in -lzstd" >&5 printf %s "checking for ZSTD_createCCtx in -lzstd... " >&6; } if test ${ac_cv_lib_zstd_ZSTD_createCCtx+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lzstd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char ZSTD_createCCtx (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ZSTD_createCCtx (void); int main (void) { @@ -18728,12 +19085,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_zstd_ZSTD_createCCtx=yes -else $as_nop - ac_cv_lib_zstd_ZSTD_createCCtx=no +else case e in #( + e) ac_cv_lib_zstd_ZSTD_createCCtx=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zstd_ZSTD_createCCtx" >&5 printf "%s\n" "$ac_cv_lib_zstd_ZSTD_createCCtx" >&6; } @@ -18746,13 +19105,16 @@ then : zstd_libs="-lzstd" zstd_flags="" zstd_status="ok" -else $as_nop - zstd_status="zstd library too old: version 1.4 or later is needed" +else case e in #( + e) zstd_status="zstd library too old: version 1.4 or later is needed" ;; +esac fi -else $as_nop - zstd_status="zstd library not found" +else case e in #( + e) zstd_status="zstd library not found" ;; +esac fi - + ;; +esac fi fi @@ -18807,24 +19169,27 @@ then : then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } zstd_libs='' zstd_flags='' zstd_status=\ -"programs linked with zstd do not appear to be executable." +"programs linked with zstd do not appear to be executable." ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 -printf "%s\n" "skipped" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: skipped" >&5 +printf "%s\n" "skipped" >&6; } ;; +esac fi -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } zstd_libs='' zstd_flags='' - zstd_status="zstd found, but programs cannot be linked with it." + zstd_status="zstd found, but programs cannot be linked with it." ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -18847,8 +19212,8 @@ printf "%s\n" "$as_me: compressed compilation artefacts supported" >&6;} internal_cppflags="$internal_cppflags $zstd_flags" printf "%s\n" "#define HAS_ZSTD 1" >>confdefs.h -else $as_nop - case "$with_zstd" in #( +else case e in #( + e) case "$with_zstd" in #( no) : ;; #( yes) : @@ -18858,6 +19223,7 @@ else $as_nop printf "%s\n" "$as_me: WARNING: $zstd_status" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compressed compilation artefacts not supported" >&5 printf "%s\n" "$as_me: WARNING: compressed compilation artefacts not supported" >&2;} ;; +esac ;; esac fi @@ -18877,11 +19243,12 @@ then : optional_bytecode_tools="$optional_bytecode_tools debugger/ocamldebug" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ocamldebug supported" >&5 printf "%s\n" "$as_me: ocamldebug supported" >&6;} -else $as_nop - with_debugger="" +else case e in #( + e) with_debugger="" build_ocamldebug=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: ocamldebug not supported" >&5 -printf "%s\n" "$as_me: ocamldebug not supported" >&6;} +printf "%s\n" "$as_me: ocamldebug not supported" >&6;} ;; +esac fi ;; esac @@ -18896,6 +19263,140 @@ esac ## Determine how to link with the POSIX threads library +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + case $host in #( *-*-mingw32*) : PTHREAD_LIBS="-l:libpthread.a -lgcc_eh" ;; #( @@ -18942,8 +19443,14 @@ printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char pthread_join (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (void); int main (void) { @@ -19037,7 +19544,7 @@ case $host_os in _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} @@ -19067,8 +19574,8 @@ printf %s "checking whether $CC is Clang... " >&6; } if test ${ax_cv_PTHREAD_CLANG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG=no +else case e in #( + e) ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -19080,14 +19587,15 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 + $EGREP_TRADITIONAL "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 then : ax_cv_PTHREAD_CLANG=yes fi rm -rf conftest* fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } @@ -19137,8 +19645,9 @@ esac if test "x$ax_pthread_check_macro" = "x--" then : ax_pthread_check_cond=0 -else $as_nop - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" +else case e in #( + e) ax_pthread_check_cond="!defined($ax_pthread_check_macro)" ;; +esac fi @@ -19172,8 +19681,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ax_pthread_config+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ax_pthread_config"; then +else case e in #( + e) if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19196,7 +19705,8 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" -fi +fi ;; +esac fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then @@ -19329,8 +19839,8 @@ printf %s "checking whether Clang needs flag to prevent \"argument unused\" warn if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown +else case e in #( + e) ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown # Create an alternate version of $ac_link that compiles and # links in two steps (.c -> .o, .o -> exe) instead of one # (.c -> exe), because the warning occurs only in the second @@ -19376,7 +19886,8 @@ then : ax_pthread_try=no fi ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } @@ -19403,8 +19914,8 @@ printf %s "checking for joinable pthread attribute... " >&6; } if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_JOINABLE_ATTR=unknown +else case e in #( + e) ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19424,7 +19935,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } @@ -19444,14 +19956,15 @@ printf %s "checking whether more special flags are required for pthreads... " >& if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} then : printf %s "(cached) " >&6 -else $as_nop - ax_cv_PTHREAD_SPECIAL_FLAGS=no +else case e in #( + e) ax_cv_PTHREAD_SPECIAL_FLAGS=no case $host_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } @@ -19467,8 +19980,8 @@ printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -19483,12 +19996,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_cv_PTHREAD_PRIO_INHERIT=yes -else $as_nop - ax_cv_PTHREAD_PRIO_INHERIT=no +else case e in #( + e) ax_cv_PTHREAD_PRIO_INHERIT=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } @@ -19538,8 +20053,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CC"; then +else case e in #( + e) if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19561,7 +20076,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then @@ -19588,8 +20104,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_PTHREAD_CXX+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$PTHREAD_CXX"; then +else case e in #( + e) if test -n "$PTHREAD_CXX"; then ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -19611,7 +20127,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX if test -n "$PTHREAD_CXX"; then @@ -19705,8 +20222,8 @@ then : printf "%s\n" "GNU" >&6; } printf "%s\n" "#define HAS_GNU_GETAFFINITY_NP 1" >>confdefs.h -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -19729,12 +20246,14 @@ then : printf "%s\n" "BSD" >&6; } printf "%s\n" "#define HAS_BSD_GETAFFINITY_NP 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: pthread_getaffinity_np not found" >&5 -printf "%s\n" "pthread_getaffinity_np not found" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: pthread_getaffinity_np not found" >&5 +printf "%s\n" "pthread_getaffinity_np not found" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -19805,10 +20324,11 @@ then : as_has_debug_prefix_map=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - ashas_debug_prefix_map=false +else case e in #( + e) ashas_debug_prefix_map=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -19831,8 +20351,8 @@ printf %s "checking whether the assembler supports CFI directives... " >&6; } then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 printf "%s\n" "disabled" >&6; } -else $as_nop - +else case e in #( + e) saved_CC="$CC" saved_CFLAGS="$CFLAGS" saved_CPPFLAGS="$CPPFLAGS" @@ -19866,16 +20386,17 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : aspp_ok=true -else $as_nop - aspp_ok=false +else case e in #( + e) aspp_ok=false ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$AS" = "$ASPP" then : as_ok="$aspp_ok" -else $as_nop - CC="$AS" +else case e in #( + e) CC="$AS" ac_compile='$CC $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19891,10 +20412,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : as_ok=true -else $as_nop - as_ok=false +else case e in #( + e) as_ok=false ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -19915,20 +20438,23 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - if test x"$enable_cfi" = "xyes" +else case e in #( + e) if test x"$enable_cfi" = "xyes" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: requested but not available as_fn_error $? "exiting" "$LINENO" 5" >&5 printf "%s\n" "requested but not available as_fn_error $? "exiting" "$LINENO" 5" >&6; } -else $as_nop - asm_cfi_supported=false +else case e in #( + e) asm_cfi_supported=false { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi +printf "%s\n" "no" >&6; } ;; +esac +fi ;; +esac fi - + ;; +esac fi ;; esac fi @@ -19949,10 +20475,11 @@ printf "%s\n" "$as_me: using frame pointers" >&6;} ;; #( as_fn_error $? "frame pointers not supported on this platform" "$LINENO" 5 ;; esac -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not using frame pointers" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not using frame pointers" >&5 printf "%s\n" "$as_me: not using frame pointers" >&6;} - frame_pointers=false + frame_pointers=false ;; +esac fi ## Check for mmap support for huge pages and contiguous heap @@ -19963,8 +20490,8 @@ printf %s "checking whether mmap supports huge pages... " >&6; } then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 printf "%s\n" "no assumed" >&6; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20013,12 +20540,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -20029,22 +20558,25 @@ printf "%s\n" "#define HEADER_RESERVED_BITS $reserved_header_bits" >>confdefs.h if test x"$enable_installing_bytecode_programs" = "xno" then : install_bytecode_programs=false -else $as_nop - install_bytecode_programs=true +else case e in #( + e) install_bytecode_programs=true ;; +esac fi if test x"$enable_installing_source_artifacts" = "xno" then : install_source_artifacts=false -else $as_nop - install_source_artifacts=true +else case e in #( + e) install_source_artifacts=true ;; +esac fi if test x"$enable_stdlib_manpages" != "xno" then : build_libraries_manpages=true -else $as_nop - build_libraries_manpages=false +else case e in #( + e) build_libraries_manpages=false ;; +esac fi documentation_tool_cmd='' @@ -20061,8 +20593,9 @@ then : documentation_tool_cmd="$withval" documentation_tool='odoc' ;; esac -else $as_nop - documentation_tool='ocamldoc' +else case e in #( + e) documentation_tool='ocamldoc' ;; +esac fi if test "x$documentation_tool_cmd" = 'x' @@ -20101,8 +20634,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DIFF+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$DIFF"; then +else case e in #( + e) if test -n "$DIFF"; then ac_cv_prog_DIFF="$DIFF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -20124,7 +20657,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi DIFF=$ac_cv_prog_DIFF if test -n "$DIFF"; then @@ -20158,9 +20692,10 @@ then : DIFF_FLAGS="$DIFF_FLAGS $flag" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi done fi @@ -20171,37 +20706,42 @@ then : if test x"$enable_flambda_invariants" = "xyes" then : flambda_invariants=true -else $as_nop - flambda_invariants=false +else case e in #( + e) flambda_invariants=false ;; +esac fi -else $as_nop - flambda=false - flambda_invariants=false +else case e in #( + e) flambda=false + flambda_invariants=false ;; +esac fi if $flambda then : CMX_MAGIC_NUMBER=Caml1999y034 CMXA_MAGIC_NUMBER=Caml1999z034 -else $as_nop - CMX_MAGIC_NUMBER=Caml1999Y034 - CMXA_MAGIC_NUMBER=Caml1999Z034 +else case e in #( + e) CMX_MAGIC_NUMBER=Caml1999Y034 + CMXA_MAGIC_NUMBER=Caml1999Z034 ;; +esac fi if test x"$enable_cmm_invariants" = "xyes" then : cmm_invariants=true -else $as_nop - cmm_invariants=false +else case e in #( + e) cmm_invariants=false ;; +esac fi if test x"$enable_flat_float_array" = "xno" then : flat_float_array=false -else $as_nop - printf "%s\n" "#define FLAT_FLOAT_ARRAY 1" >>confdefs.h +else case e in #( + e) printf "%s\n" "#define FLAT_FLOAT_ARRAY 1" >>confdefs.h - flat_float_array=true + flat_float_array=true ;; +esac fi @@ -20211,8 +20751,8 @@ printf %s "checking whether mmap supports MAP_STACK... " >&6; } then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no assumed" >&5 printf "%s\n" "no assumed" >&6; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20235,12 +20775,14 @@ then : has_mmap_map_stack=true { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -20256,12 +20798,13 @@ then : printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h ;; esac -else $as_nop - as_fn_error $? "mmap MAP_STACK requested but not found on $target" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "mmap MAP_STACK requested but not found on $target" "$LINENO" 5 ;; +esac fi -else $as_nop - case $target in #( +else case e in #( + e) case $target in #( *-openbsd*) : with_mmap_map_stack=true; printf "%s\n" "#define USE_MMAP_MAP_STACK 1" >>confdefs.h @@ -20271,7 +20814,8 @@ printf "%s\n" "$as_me: using MAP_STACK on OpenBSD due to stack checking" >&6;} ; *) : with_mmap_map_stack=false ;; esac - + ;; +esac fi oc_native_compflags='' @@ -20279,8 +20823,8 @@ oc_native_compflags='' if test x"$enable_function_sections" = "xno" then : function_sections=false -else $as_nop - case $arch in #( +else case e in #( + e) case $arch in #( amd64|arm64) : # not supported on arm32, see issue #9124. case $target in #( @@ -20324,18 +20868,21 @@ then : if test x"$enable_function_sections" = "xyes" then : as_fn_error $? "Function sections are not supported." "$LINENO" 5 -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling function sections." >&5 -printf "%s\n" "$as_me: Disabling function sections." >&6;} -fi +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Disabling function sections." >&5 +printf "%s\n" "$as_me: Disabling function sections." >&6;} ;; +esac fi +fi ;; +esac fi if test x"$with_afl" = "xyes" then : afl=true -else $as_nop - afl=false +else case e in #( + e) afl=false ;; +esac fi # Enable debugging support @@ -20408,8 +20955,8 @@ then : *) : ;; esac -else $as_nop - if test x"$unix_or_win32" = "xwin32" \ +else case e in #( + e) if test x"$unix_or_win32" = "xwin32" \ && test "$host_vendor-$host_os" != "$build_vendor-$build_os" then : case $build in #( @@ -20418,7 +20965,8 @@ then : *) : ;; esac -fi +fi ;; +esac fi # Define a few macros that were defined in config/m-nt.h @@ -20480,8 +21028,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -20511,14 +21059,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -20680,8 +21228,8 @@ fi mkdll_ldflags="\$(addprefix ${mkexe_ldflags_prefix},\$(OC_DLL_LDFLAGS)) \ ${mkdll_ldflags}" -else $as_nop - +else case e in #( + e) mkdll_ldflags='$(OC_DLL_LDFLAGS) $(LDFLAGS)' mkdll_ldflags_exp="${oc_dll_ldflags}" if test -n ${LDFLAGS} @@ -20690,7 +21238,8 @@ then : fi mkexe_ldflags="\$(OC_LDFLAGS) \$(LDFLAGS)" mkexe_ldflags_exp="${oc_ldflags} ${LDFLAGS}" - + ;; +esac fi mkexe="$mkexe $mkexe_ldflags" mkexe_exp="$mkexe_exp $mkexe_ldflags_exp" @@ -20706,19 +21255,21 @@ then : mkexe_via_cc_ldflags=\ "\$(addprefix ${mkexe_via_cc_ldflags_prefix},\$(OC_LDFLAGS) \$(LDFLAGS))" -else $as_nop - +else case e in #( + e) mkexe_via_cc_ldflags='$(OC_LDFLAGS) $(LDFLAGS)' - + ;; +esac fi # cl requires linker flags after the objects. if test "$ccomptype" = 'msvc' then : mkexe_via_cc_ldflags=\ "\$(OUTPUTEXE)\$(1) \$(2) $mkexe_via_cc_ldflags" -else $as_nop - mkexe_via_cc_ldflags=\ -"$mkexe_via_cc_ldflags \$(OUTPUTEXE)\$(1) \$(2)" +else case e in #( + e) mkexe_via_cc_ldflags=\ +"$mkexe_via_cc_ldflags \$(OUTPUTEXE)\$(1) \$(2)" ;; +esac fi if test -n "$mkexe_via_cc_extra_cmd" then : @@ -20754,7 +21305,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -20763,12 +21313,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -20840,7 +21391,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -20869,7 +21420,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -20909,11 +21459,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -20927,11 +21478,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -21014,9 +21566,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -21097,10 +21649,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -21116,7 +21670,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by OCaml $as_me 5.2.0, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21149,7 +21703,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -21189,10 +21743,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ OCaml config.status 5.2.0 -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -21253,8 +21807,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -21262,8 +21816,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -21631,7 +22185,7 @@ do "otherlibs/systhreads/META") CONFIG_FILES="$CONFIG_FILES otherlibs/systhreads/META" ;; "ocamltest/ocamltest_unix.ml") CONFIG_LINKS="$CONFIG_LINKS ocamltest/ocamltest_unix.ml:${ocamltest_unix_mod}" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -21652,7 +22206,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -21676,7 +22230,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -21834,13 +22388,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -21906,9 +22460,9 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\r?\$)/ { +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 - split(line, arg, /[ \r\t]/) + split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] @@ -21950,7 +22504,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -21972,19 +22526,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -22112,7 +22666,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -22142,9 +22696,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/configure.ac b/configure.ac index 0c9d63859a..0ba47947c3 100644 --- a/configure.ac +++ b/configure.ac @@ -1286,7 +1286,8 @@ AS_IF([test x"$supports_shared_libraries" = 'xtrue'], [aarch64-*-freebsd*], [natdynlink=true], [aarch64-*-openbsd*], [natdynlink=true], [aarch64-*-netbsd*], [natdynlink=true], - [riscv*-*-linux*], [natdynlink=true])]) + [riscv*-*-linux*], [natdynlink=true], + [loongarch*-*-linux*], [natdynlink=true])]) AS_CASE([$enable_native_toplevel,$natdynlink], [yes,false], @@ -1415,7 +1416,9 @@ AS_CASE([$host], [x86_64-*-cygwin*], [has_native_backend=yes; arch=amd64; system=cygwin], [riscv64-*-linux*], - [has_native_backend=yes; arch=riscv; model=riscv64; system=linux] + [has_native_backend=yes; arch=riscv; model=riscv64; system=linux], + [loongarch64-*-linux*], + [has_native_backend=yes; arch=loongarch64; system=linux] ) AS_CASE([$arch], @@ -1528,7 +1531,7 @@ default_aspp="$CC -c" AS_CASE([$as_target,$ocaml_cc_vendor], [*-*-linux*,gcc-*], [AS_CASE([$as_cpu], - [x86_64|arm*|aarch64*|i[[3-6]]86|riscv*], + [x86_64|arm*|aarch64*|i[[3-6]]86|riscv*|loongarch*], [default_as="${toolpref}as"])], [i686-pc-windows,*], [default_as="ml -nologo -coff -Cp -c -Fo" diff --git a/runtime/caml/config.h b/runtime/caml/config.h index 3fea87d8eb..a49667b3bc 100644 --- a/runtime/caml/config.h +++ b/runtime/caml/config.h @@ -276,7 +276,7 @@ typedef uint64_t uintnat; #define Cache_line_bsize 256 #elif defined(TARGET_arm64) || defined(TARGET_power) #define Cache_line_bsize 128 -#elif defined(TARGET_amd64) || defined(TARGET_riscv) +#elif defined(TARGET_amd64) || defined(TARGET_riscv) || defined(TARGET_loongarch64) #define Cache_line_bsize 64 #elif (!defined(NATIVE_CODE)) #define Cache_line_bsize 64 diff --git a/runtime/caml/stack.h b/runtime/caml/stack.h index 1d3f28db17..25ee9598ab 100644 --- a/runtime/caml/stack.h +++ b/runtime/caml/stack.h @@ -94,6 +94,16 @@ #define Stack_header_size 32 #endif +#ifdef TARGET_loongarch64 +/* Size of the gc_regs structure, in words. + See loongarch64.S and loongarch64/proc.ml for the indices */ +#define Wosize_gc_regs (2 + 23 /* int regs */ + 24 /* float regs */) +#define Saved_return_address(sp) *((intnat *)((sp) - 8)) +#define First_frame(sp) ((sp) + 16) +#define Saved_gc_regs(sp) (*(value **)((sp) + 24)) +#define Stack_header_size 32 +#endif + /* Declaration of variables used in the asm code */ extern value * caml_globals[]; extern intnat caml_globals_inited; diff --git a/runtime/loongarch64.S b/runtime/loongarch64.S new file mode 100644 index 0000000000..560436526d --- /dev/null +++ b/runtime/loongarch64.S @@ -0,0 +1,835 @@ +/**************************************************************************/ +/* */ +/* OCaml */ +/* */ +/* yala */ +/* */ +/* Copyright © 2008-2023 LOONGSON */ +/* */ +/* All rights reserved. This file is distributed under the terms of */ +/* the GNU Lesser General Public License version 2.1, with the */ +/* $special exception on linking described in the file LICENSE. */ +/* */ +/**************************************************************************/ + +/* Asm part of the runtime system, LoongArch processor, 64-bit mode */ +/* Must be preprocessed by cpp */ + +#include "caml/m.h" + +#define DOMAIN_STATE_PTR $s8 +#define TRAP_PTR $s1 +#define ALLOC_PTR $s7 +#define ADDITIONAL_ARG $t2 +#define STACK_ARG_BEGIN $s3 +#define STACK_ARG_END $s4 +#define TMP $t0 +#define TMP2 $t1 + +#define C_ARG_1 $a0 +#define C_ARG_2 $a1 +#define C_ARG_3 $a2 +#define C_ARG_4 $a3 + + .set domain_curr_field, 0 + .set domain_curr_cnt, 0 +#define DOMAIN_STATE(c_type, name) \ + .equ domain_field_caml_##name, domain_curr_field ; \ + .set domain_curr_cnt, domain_curr_cnt + 1; \ + .set domain_curr_field, domain_curr_cnt*8 +#include "../runtime/caml/domain_state.tbl" +#undef DOMAIN_STATE + +#define Caml_state(var) DOMAIN_STATE_PTR, domain_field_caml_##var + +/* Globals and labels */ +#define L(lbl) .L##lbl + +#define FUNCTION(name) \ + .align 2; \ + .globl name; \ + .type name, @function; \ +name:; \ + CFI_STARTPROC + +#define END_FUNCTION(name) \ + CFI_ENDPROC; \ + .size name, .-name + +#if defined(__PIC__) +#define PLT(r) %plt(r) +#else +#define PLT(r) r +#endif + +#define OBJECT(name) \ + .data; \ + .align 3; \ + .globl name; \ + .type name, @object; \ +name: +#define END_OBJECT(name) \ + .size name, .-name + +#undef ASM_CFI_SUPPORTED +#define CFI_STARTPROC +#define CFI_ENDPROC +#define CFI_ADJUST(n) +#define CFI_REGISTER(r1,r2) +#define CFI_OFFSET(r,n) +#define CFI_DEF_CFA_REGISTER(r) +#define CFI_REMEMBER_STATE +#define CFI_RESTORE_STATE + +/* Stack switching operations */ + +/* struct stack_info */ +#define Stack_sp(reg) reg, 0 +#define Stack_exception(reg) reg, 8 +#define Stack_handler(reg) reg, 16 +#define Stack_handler_from_cont(reg) reg, 15 + +/* struct c_stack_link */ +#define Cstack_stack(reg) reg, 0 +#define Cstack_sp(reg) reg, 8 +#define Cstack_prev(reg) reg, 16 + +/* struct stack_handler */ +#define Handler_value(reg) reg, 0 +#define Handler_exception(reg) reg, 8 +#define Handler_effect(reg) reg, 16 +#define Handler_parent(reg) reg, 24 + +/* Switch from OCaml to C stack. */ +.macro SWITCH_OCAML_TO_C + /* Fill in Caml_state->current_stack->$sp */ + ld.d TMP, Caml_state(current_stack) + st.d $sp, Stack_sp(TMP) + /* Fill in Caml_state->c_stack */ + ld.d TMP2, Caml_state(c_stack) + st.d TMP, Cstack_stack(TMP2) + st.d $sp, Cstack_sp(TMP2) + /* Switch to C stack */ + move $sp, TMP2 + CFI_REMEMBER_STATE +.endm + +/* Switch from C to OCaml stack. */ +.macro SWITCH_C_TO_OCAML + ld.d $sp, Cstack_sp($sp) + CFI_RESTORE_STATE +.endm + +/* Save all of the registers that may be in use to a free gc_regs bucket + and store ALLOC_PTR and TRAP_PTR back to Caml_state + At the end the saved registers are placed in Caml_state(gc_regs) + */ +.macro SAVE_ALL_REGS + /* First, save the young_ptr & exn_handler */ + st.d ALLOC_PTR, Caml_state(young_ptr) + st.d TRAP_PTR, Caml_state(exn_handler) + /* Now, use TMP to point to the gc_regs bucket */ + ld.d TMP, Caml_state(gc_regs_buckets) + ld.d TMP2, TMP, 0 /* next ptr */ + st.d TMP2, Caml_state(gc_regs_buckets) + /* Save allocatable integer registers Must be in + the same order as proc.ml int_reg_name*/ + st.d $a0, TMP, 2*8 + st.d $a1, TMP, 3*8 + st.d $a2, TMP, 4*8 + st.d $a3, TMP, 5*8 + st.d $a4, TMP, 6*8 + st.d $a5, TMP, 7*8 + st.d $a6, TMP, 8*8 + st.d $a7, TMP, 9*8 + st.d $s2, TMP, 10*8 + st.d $s3, TMP, 11*8 + st.d $s4, TMP, 12*8 + st.d $s5, TMP, 13*8 + st.d $s6, TMP, 14*8 + st.d $t2, TMP, 15*8 + st.d $t3, TMP, 16*8 + st.d $t4, TMP, 17*8 + st.d $t5, TMP, 18*8 + st.d $t6, TMP, 19*8 + st.d $t7, TMP, 20*8 + st.d $t8, TMP, 21*8 + st.d $s0, TMP, 22*8 + /* Save caller-save floating-point registers + (callee-saves are preserved by C functions) */ + fst.d $ft0, TMP, 23*8 + fst.d $ft1, TMP, 24*8 + fst.d $ft2, TMP, 25*8 + fst.d $ft3, TMP, 26*8 + fst.d $ft4, TMP, 27*8 + fst.d $ft5, TMP, 28*8 + fst.d $ft6, TMP, 29*8 + fst.d $ft7, TMP, 30*8 + fst.d $fa0, TMP, 31*8 + fst.d $fa1, TMP, 32*8 + fst.d $fa2, TMP, 33*8 + fst.d $fa3, TMP, 34*8 + fst.d $fa4, TMP, 35*8 + fst.d $fa5, TMP, 36*8 + fst.d $fa6, TMP, 37*8 + fst.d $fa7, TMP, 38*8 + fst.d $ft8, TMP, 39*8 + fst.d $ft9, TMP, 40*8 + fst.d $ft10, TMP, 41*8 + fst.d $ft11, TMP, 42*8 + fst.d $ft12, TMP, 43*8 + fst.d $ft13, TMP, 44*8 + fst.d $ft14, TMP, 45*8 + fst.d $ft15, TMP, 46*8 + addi.d TMP, TMP, 16 + st.d TMP, Caml_state(gc_regs) +.endm + +/* Undo SAVE_ALL_REGS by loading the registers saved in Caml_state(gc_regs) + and refreshing ALLOC_PTR & TRAP_PTR from Caml_state */ +.macro RESTORE_ALL_REGS + /* Restore $a0, $a1, freeing up the next ptr slot */ + ld.d TMP, Caml_state(gc_regs) + addi.d TMP, TMP, -16 + /* Restore registers */ + ld.d $a0, TMP, 2*8 + ld.d $a1, TMP, 3*8 + ld.d $a2, TMP, 4*8 + ld.d $a3, TMP, 5*8 + ld.d $a4, TMP, 6*8 + ld.d $a5, TMP, 7*8 + ld.d $a6, TMP, 8*8 + ld.d $a7, TMP, 9*8 + ld.d $s2, TMP, 10*8 + ld.d $s3, TMP, 11*8 + ld.d $s4, TMP, 12*8 + ld.d $s5, TMP, 13*8 + ld.d $s6, TMP, 14*8 + ld.d $t2, TMP, 15*8 + ld.d $t3, TMP, 16*8 + ld.d $t4, TMP, 17*8 + ld.d $t5, TMP, 18*8 + ld.d $t6, TMP, 19*8 + ld.d $t7, TMP, 20*8 + ld.d $t8, TMP, 21*8 + ld.d $s0, TMP, 22*8 + fld.d $ft0, TMP, 23*8 + fld.d $ft1, TMP, 24*8 + fld.d $ft2, TMP, 25*8 + fld.d $ft3, TMP, 26*8 + fld.d $ft4, TMP, 27*8 + fld.d $ft5, TMP, 28*8 + fld.d $ft6, TMP, 29*8 + fld.d $ft7, TMP, 30*8 + fld.d $fa0, TMP, 31*8 + fld.d $fa1, TMP, 32*8 + fld.d $fa2, TMP, 33*8 + fld.d $fa3, TMP, 34*8 + fld.d $fa4, TMP, 35*8 + fld.d $fa5, TMP, 36*8 + fld.d $fa6, TMP, 37*8 + fld.d $fa7, TMP, 38*8 + fld.d $ft8, TMP, 39*8 + fld.d $ft9, TMP, 40*8 + fld.d $ft10, TMP, 41*8 + fld.d $ft11, TMP, 42*8 + fld.d $ft12, TMP, 43*8 + fld.d $ft13, TMP, 44*8 + fld.d $ft14, TMP, 45*8 + fld.d $ft15, TMP, 46*8 + /* Put gc_regs struct back in bucket linked list */ + ld.d TMP2, Caml_state(gc_regs_buckets) + st.d TMP2, TMP, 0 /* next ptr */ + st.d TMP, Caml_state(gc_regs_buckets) + /* Reload new allocation pointer & exn handler */ + ld.d ALLOC_PTR, Caml_state(young_ptr) + ld.d TRAP_PTR, Caml_state(exn_handler) +.endm + + .section .text +/* Invoke the garbage collector. */ + + .globl caml_system__code_begin +caml_system__code_begin: + +FUNCTION(caml_call_realloc_stack) + /* Save return address */ + CFI_OFFSET($ra, -8) + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + //CFI_ADJUST(16) + /* Save all registers (including ALLOC_PTR & TRAP_PTR) */ + SAVE_ALL_REGS + ld.d C_ARG_1, $sp, 16 /* argument */ + SWITCH_OCAML_TO_C + bl PLT(caml_try_realloc_stack) + SWITCH_C_TO_OCAML + beqz $a0, 1f + RESTORE_ALL_REGS + /* Free stack $space and return to caller */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + jr $ra +1: RESTORE_ALL_REGS + /* Raise the Stack_overflow exception */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + addi.d $sp, $sp, 16 /* pop argument */ + la.global $a0, caml_exn_Stack_overflow + b caml_raise_exn +END_FUNCTION(caml_call_realloc_stack) + +FUNCTION(caml_call_gc) +L(caml_call_gc): + /* Save return address */ + CFI_OFFSET($ra, -8) + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + CFI_ADJUST(16) + /* Store all registers (including ALLOC_PTR & TRAP_PTR) */ + SAVE_ALL_REGS + SWITCH_OCAML_TO_C + /* Call the garbage collector */ + bl PLT(caml_garbage_collection) + SWITCH_C_TO_OCAML + RESTORE_ALL_REGS + /* Free stack $space and return to caller */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + jr $ra +END_FUNCTION(caml_call_gc) + +FUNCTION(caml_alloc1) + ld.d TMP, Caml_state(young_limit) + addi.d ALLOC_PTR, ALLOC_PTR, -16 + bltu ALLOC_PTR, TMP, L(caml_call_gc) + jr $ra +END_FUNCTION(caml_alloc1) + +FUNCTION(caml_alloc2) + ld.d TMP, Caml_state(young_limit) + addi.d ALLOC_PTR, ALLOC_PTR, -24 + bltu ALLOC_PTR, TMP, L(caml_call_gc) + jr $ra +END_FUNCTION(caml_alloc2) + +FUNCTION(caml_alloc3) + ld.d TMP, Caml_state(young_limit) + addi.d ALLOC_PTR, ALLOC_PTR, -32 + bltu ALLOC_PTR, TMP, L(caml_call_gc) + jr $ra +END_FUNCTION(caml_alloc3) + +FUNCTION(caml_allocN) + ld.d TMP, Caml_state(young_limit) + sub.d ALLOC_PTR, ALLOC_PTR, ADDITIONAL_ARG + bltu ALLOC_PTR, TMP, L(caml_call_gc) + jr $ra +END_FUNCTION(caml_allocN) + +/* Call a C function from OCaml */ +/* Function to call is in ADDITIONAL_ARG */ + +.macro RET_FROM_C_CALL + ld.d TMP, Caml_state(action_pending) + bnez TMP, 1f + jr $ra +1: li.d TMP, -1 + st.d TMP, Caml_state(young_limit) + jr $ra +.endm + +FUNCTION(caml_c_call) + CFI_OFFSET($ra, -8) + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + CFI_ADJUST(16) + /* Switch form OCaml to C */ + SWITCH_OCAML_TO_C + /* Make the exception handler alloc ptr available to the C code */ + st.d ALLOC_PTR, Caml_state(young_ptr) + st.d TRAP_PTR, Caml_state(exn_handler) + /* Call the function */ + jirl $ra, ADDITIONAL_ARG, 0 + /* Reload alloc ptr */ + ld.d ALLOC_PTR, Caml_state(young_ptr) + /* Load ocaml stack */ + SWITCH_C_TO_OCAML + /* Return */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + RET_FROM_C_CALL +END_FUNCTION(caml_c_call) + +FUNCTION(caml_c_call_stack_args) + /* Arguments: + C arguments : $a0 to a7, fa0 to fa7 + C function : ADDITIONAL_ARG + C stack args : begin=STACK_ARG_BEGIN + end=STACK_ARG_END */ + CFI_OFFSET($ra, -8) + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + CFI_ADJUST(16) + /* Switch from OCaml to C */ + SWITCH_OCAML_TO_C + /* Make the exception handler alloc ptr available to the C code */ + st.d ALLOC_PTR, Caml_state(young_ptr) + st.d TRAP_PTR, Caml_state(exn_handler) + /* Store $sp to restore after call */ + move $s2, $sp + /* Copy arguments from OCaml to C stack + NB: STACK_ARG_END - STACK_ARG_BEGIN is a multiple of 16 */ +1: addi.d STACK_ARG_END, STACK_ARG_END, -16 + bltu STACK_ARG_END, STACK_ARG_BEGIN, 2f + ld.d TMP, STACK_ARG_END, 0 + ld.d TMP2, STACK_ARG_END, 8 + addi.d $sp, $sp, -16 + st.d TMP, $sp, 0 + st.d TMP2, $sp, 8 + b 1b +2: /* Call the function */ + jirl $ra, ADDITIONAL_ARG, 0 + /* Restore stack */ + move $sp, $s2 + /* Reload alloc ptr */ + ld.d ALLOC_PTR, Caml_state(young_ptr) + /* Switch from C to OCaml */ + SWITCH_C_TO_OCAML + /* Return */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + RET_FROM_C_CALL +END_FUNCTION(caml_c_call_stack_args) + +/* Start the OCaml program */ + +FUNCTION(caml_start_program) + /* domain state is passed as arg from C */ + move TMP, C_ARG_1 + la.global TMP2, caml_program + +/* Code shared with caml_callback* */ +/* Address of domain state is in TMP */ +/* Address of OCaml code to call is in TMP2 */ +/* Arguments to the OCaml code are in $a0...a7 */ + +L(jump_to_caml): + /* Set up stack frame and save callee-save registers */ + CFI_OFFSET($ra, -200) + addi.d $sp, $sp, -208 + st.d $ra, $sp, 8 + CFI_ADJUST(208) + st.d $s0, $sp, 2*8 + st.d $s1, $sp, 3*8 + st.d $s2, $sp, 4*8 + st.d $s3, $sp, 5*8 + st.d $s4, $sp, 6*8 + st.d $s5, $sp, 7*8 + st.d $s6, $sp, 8*8 + st.d $s7, $sp, 9*8 + st.d $s8, $sp, 10*8 + st.d $fp, $sp, 11*8 + fst.d $fs0, $sp, 14*8 + fst.d $fs1, $sp, 15*8 + fst.d $fs2, $sp, 16*8 + fst.d $fs3, $sp, 17*8 + fst.d $fs4, $sp, 18*8 + fst.d $fs5, $sp, 19*8 + fst.d $fs6, $sp, 20*8 + fst.d $fs7, $sp, 21*8 + /* Load domain state pointer from argument */ + move DOMAIN_STATE_PTR, TMP + /* Reload allocation pointer */ + ld.d ALLOC_PTR, Caml_state(young_ptr) + /* Build (16-byte aligned) struct c_stack_link on the C stack */ + ld.d $t2, Caml_state(c_stack) + addi.d $sp, $sp, -32 + st.d $t2, Cstack_prev($sp) + st.d $zero, Cstack_stack($sp) + st.d $zero, Cstack_sp($sp) + CFI_ADJUST(32) + st.d $sp, Caml_state(c_stack) + /* Load the OCaml stack */ + ld.d $t2, Caml_state(current_stack) + ld.d $t2, Stack_sp($t2) + /* Store the gc_regs for callbacks during a GC */ + ld.d $t3, Caml_state(gc_regs) + addi.d $t2, $t2, -8 + st.d $t3, $t2, 0 + /* Store the stack pointer to allow DWARF unwind */ + addi.d $t2, $t2, -8 + st.d $sp, $t2, 0 /* C_stack_sp */ + /* Setup a trap frame to catch exceptions escaping the OCaml code */ + ld.d $t3, Caml_state(exn_handler) + la.local $t4, L(trap_handler) + addi.d $t2, $t2, -16 + st.d $t3, $t2, 0 + st.d $t4, $t2, 8 + move TRAP_PTR, $t2 + /* Switch stacks and call the OCaml code */ + move $sp, $t2 + CFI_REMEMBER_STATE + /* Call the OCaml code */ + jirl $ra, TMP2, 0 +L(caml_retaddr): + /* Pop the trap frame, restoring Caml_state->exn_handler */ + ld.d $t2, $sp, 0 + addi.d $sp, $sp, 16 + CFI_ADJUST(-16) + st.d $t2, Caml_state(exn_handler) +L(return_result): + /* Restore GC regs */ + ld.d $t2, $sp, 0 + ld.d $t3, $sp, 8 + addi.d $sp, $sp, 16 + CFI_ADJUST(-16) + st.d $t3, Caml_state(gc_regs) + /* Update allocation pointer */ + st.d ALLOC_PTR, Caml_state(young_ptr) + /* Return to C stack */ + ld.d $t2, Caml_state(current_stack) + st.d $sp, Stack_sp($t2) + ld.d $t3, Caml_state(c_stack) + move $sp, $t3 + CFI_RESTORE_STATE + /* Pop the struct c_stack_link */ + ld.d $t2, Cstack_prev($sp) + addi.d $sp, $sp, 32 + CFI_ADJUST(-32) + st.d $t2, Caml_state(c_stack) + /* Reload callee-save register and return address */ + ld.d $s0, $sp, 2*8 + ld.d $s1, $sp, 3*8 + ld.d $s2, $sp, 4*8 + ld.d $s3, $sp, 5*8 + ld.d $s4, $sp, 6*8 + ld.d $s5, $sp, 7*8 + ld.d $s6, $sp, 8*8 + ld.d $s7, $sp, 9*8 + ld.d $s8, $sp, 10*8 + ld.d $fp, $sp, 11*8 + fld.d $fs0, $sp, 14*8 + fld.d $fs1, $sp, 15*8 + fld.d $fs2, $sp, 16*8 + fld.d $fs3, $sp, 17*8 + fld.d $fs4, $sp, 18*8 + fld.d $fs5, $sp, 19*8 + fld.d $fs6, $sp, 20*8 + fld.d $fs7, $sp, 21*8 + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 208 + CFI_ADJUST(-208) + /* Return to C caller */ + jr $ra +END_FUNCTION(caml_start_program) + +/* The trap handler */ + + .align 2 +L(trap_handler): + CFI_STARTPROC + /* Save exception pointer */ + st.d TRAP_PTR, Caml_state(exn_handler) + /* Encode exception pointer */ + ori $a0, $a0, 2 + /* Return it */ + b L(return_result) + CFI_ENDPROC + +/* Exceptions */ + +.macro JUMP_TO_TRAP_PTR + /* Cut stack at current trap handler */ + move $sp, TRAP_PTR + /* Pop previous handler and jump to it */ + ld.d TMP, $sp, 8 + ld.d TRAP_PTR, $sp, 0 + addi.d $sp, $sp, 16 + jr TMP +.endm + +/* Raise an exception from OCaml */ +FUNCTION(caml_raise_exn) + /* Test if backtrace is active */ + ld.d TMP, Caml_state(backtrace_active) + bnez TMP, 2f +1: + JUMP_TO_TRAP_PTR +2: /* Zero backtrace_pos */ + st.d $zero, Caml_state(backtrace_pos) +L(caml_reraise_exn_stash): + /* Preserve exception bucket in callee-save register $s2 */ + move $s2, $a0 + /* Stash the backtrace */ + /* arg1: exn bucket, already in $a0 */ + move $a1, $ra /* arg2: pc of $raise */ + move $a2, $sp /* arg3: $sp of $raise */ + move $a3, TRAP_PTR /* arg4: $sp of handler */ + /* Switch to C stack */ + ld.d TMP, Caml_state(c_stack) + move $sp, TMP + bl PLT(caml_stash_backtrace) + /* Restore exception bucket and $raise */ + move $a0, $s2 + b 1b +END_FUNCTION(caml_raise_exn) + +FUNCTION(caml_reraise_exn) + ld.d TMP, Caml_state(backtrace_active) + bnez TMP, L(caml_reraise_exn_stash) + JUMP_TO_TRAP_PTR +END_FUNCTION(caml_reraise_exn) + +/* Raise an exception from C */ + +FUNCTION(caml_raise_exception) + /* Load the domain state ptr */ + move DOMAIN_STATE_PTR, C_ARG_1 + /* Load the exception bucket */ + move $a0, C_ARG_2 + /* Reload trap ptr and alloc ptr */ + ld.d TRAP_PTR, Caml_state(exn_handler) + ld.d ALLOC_PTR, Caml_state(young_ptr) + /* Discard the C stack pointer and reset to ocaml stack */ + ld.d TMP, Caml_state(current_stack) + ld.d TMP, Stack_sp(TMP) + move $sp, TMP + /* Restore frame and link on return to OCaml */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + b caml_raise_exn +END_FUNCTION(caml_raise_exception) + +/* Callback from C to OCaml */ + +FUNCTION(caml_callback_asm) + /* Initial shuffling of arguments */ + /* ($a0 = Caml_state, $a1 = closure, 0(a2) = first arg) */ + move TMP, $a0 + ld.d $a0, $a2, 0 /* $a0 = first arg */ + /* $a1 = closure environment */ + ld.d TMP2, $a1, 0 /* code pointer */ + b L(jump_to_caml) +END_FUNCTION(caml_callback_asm) + +FUNCTION(caml_callback2_asm) + /* Initial shuffling of arguments */ + /* ($a0 = Caml_state, $a1 = closure, 0(a2) = arg1, 8(a2) = arg2) */ + move TMP, $a0 + move TMP2, $a1 + ld.d $a0, $a2, 0 /* $a0 = first arg */ + ld.d $a1, $a2, 8 /* $a1 = second arg */ + move $a2, TMP2 /* a2 = closure environment */ + la.global TMP2, caml_apply2 + b L(jump_to_caml) +END_FUNCTION(caml_callback2_asm) + +FUNCTION(caml_callback3_asm) + /* Initial shuffling of arguments */ + /* ($a0 = Caml_state, $a1 = closure, 0(a2) = arg1, 8(a2) = arg2, + 16(a2) = arg3) */ + move TMP, $a0 + move $a3, $a1 /* a3 = closure environment */ + ld.d $a0, $a2, 0 /* $a0 = first arg */ + ld.d $a1, $a2, 8 /* $a1 = second arg */ + ld.d $a2, $a2, 16 /* a2 = third arg */ + la.global TMP2, caml_apply3 + b L(jump_to_caml) +END_FUNCTION(caml_callback3_asm) + +/* Fibers */ + +/* Switch between OCaml stacks. Clobbers TMP and switches TRAP_PTR + Preserves old_stack and new_stack registers */ +.macro SWITCH_OCAML_STACKS old_stack, new_stack + /* Save frame pointer and return address for old_stack */ + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + CFI_ADJUST(16) + /* Save OCaml SP and exn_handler in the stack info */ + st.d $sp, Stack_sp(\old_stack) + st.d TRAP_PTR, Stack_exception(\old_stack) + /* switch stacks */ + st.d \new_stack, Caml_state(current_stack) + ld.d TMP, Stack_sp(\new_stack) + move $sp, TMP + /* restore exn_handler for new stack */ + ld.d TRAP_PTR, Stack_exception(\new_stack) + /* Restore frame pointer and return address for new_stack */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 +.endm + +/* + * A continuation is a one word object that points to a fiber. A fiber [f] will + * point to its parent at Handler_parent(Stack_handler(f)). In the following, + * the [last_fiber] refers to the last fiber in the linked-list formed by the + * parent pointer. + */ + +FUNCTION(caml_perform) + /* $a0: effect to perform + $a1: freshly allocated continuation */ + ld.d $a2, Caml_state(current_stack) /* a2 := old stack */ + addi.d $a3, $a2, 1 /* a3 := Val_ptr(old stack) */ + st.d $a3, $a1, 0 /* Iniitalize continuation */ +L(do_perform): + /* $a0: effect to perform + $a1: continuation + a2: old_stack + a3: last_fiber */ + + ld.d $t3, Stack_handler($a2) /* $t3 := old stack -> handler */ + ld.d $t4, Handler_parent($t3) /* t4 := parent stack */ + beqz $t4, 1f + SWITCH_OCAML_STACKS $a2, $t4 + /* we have to null the Handler_parent after the switch because + the Handler_parent is needed to unwind the stack for backtraces */ + st.d $zero, Handler_parent($t3) /* Set parent of performer to NULL */ + ld.d TMP, Handler_effect($t3) + move $a2, $a3 /* a2 := last_fiber */ + move $a3, TMP /* a3 := effect handler */ + b PLT(caml_apply3) +1: + /* switch back to original performer before $raising Effect.Unhandled + (no-op unless this is a reperform) */ + ld.d $t4, $a1, 0 /* load performer stack from continuation */ + addi.d $t4, $t4, -1 /* t4 := Ptr_val(t4) */ + ld.d $t3, Caml_state(current_stack) + SWITCH_OCAML_STACKS $t3, $t4 + /* No parent stack. Raise Effect.Unhandled. */ + la.global ADDITIONAL_ARG, caml_raise_unhandled_effect + b caml_c_call +END_FUNCTION(caml_perform) + +FUNCTION(caml_reperform) + /* $a0: effect to perform + $a1: continuation + a2: last_fiber */ + ld.d TMP, Stack_handler_from_cont($a2) + ld.d $a2, Caml_state(current_stack) /* a2 := old stack */ + st.d $a2, Handler_parent(TMP) /* Append to last_fiber */ + addi.d $a3, $a2, 1 /* a3 (last_fiber) := Val_ptr(old stack) */ + b L(do_perform) +END_FUNCTION(caml_reperform) + +FUNCTION(caml_resume) + /* $a0: new fiber + $a1: fun + a2: arg */ + addi.d $a0, $a0, -1 /* $a0 = Ptr_val($a0) */ + ld.d $a3, $a1, 0 /* code pointer */ + /* Check if stack null, then already used */ + beqz $a0, 2f + /* Find end of list of stacks (put in $t2) */ + move TMP, $a0 +1: ld.d $t2, Stack_handler(TMP) + ld.d TMP, Handler_parent($t2) + bnez TMP, 1b + /* Add current stack to the end */ + ld.d $t3, Caml_state(current_stack) + st.d $t3, Handler_parent($t2) + SWITCH_OCAML_STACKS $t3, $a0 + move $a0, $a2 + jr $a3 +2: la.global ADDITIONAL_ARG, caml_raise_continuation_already_resumed + b caml_c_call +END_FUNCTION(caml_resume) + +/* Run a function on a new stack, then either + return the value or invoke exception handler */ +FUNCTION(caml_runstack) + /* $a0: fiber + $a1: fun + a2: arg */ + CFI_OFFSET($ra, -8) + addi.d $sp, $sp, -16 + st.d $ra, $sp, 8 + CFI_ADJUST(16) + addi.d $a0, $a0, -1 /* $a0 := Ptr_val($a0) */ + ld.d $a3, $a1, 0 /* code pointer */ + /* save old stack pointer and exception handler */ + ld.d $t2, Caml_state(current_stack) /* $t2 := old stack */ + st.d $sp, Stack_sp($t2) + st.d TRAP_PTR, Stack_exception($t2) + /* Load new stack pointer and set parent */ + ld.d TMP, Stack_handler($a0) + st.d $t2, Handler_parent(TMP) + st.d $a0, Caml_state(current_stack) + ld.d $t3, Stack_sp($a0) /* $t3 := $sp of new stack */ + /* Create an exception handler on the target stack + after 16byte DWARF & gc_regs block (which is unused here) */ + addi.d $t3, $t3, -32 + la.local TMP, L(fiber_exn_handler) + st.d TMP, $t3, 8 + /* link the previous exn_handler so that copying stacks works */ + ld.d TMP, Stack_exception($a0) + st.d TMP, $t3, 0 + move TRAP_PTR, $t3 + /* Switch to the new stack */ + move $sp, $t3 + CFI_REMEMBER_STATE + /* Call the function on the new stack */ + move $a0, $a2 + jirl $ra, $a3, 0 +L(frame_runstack): + addi.d $t2, $sp, 32 /* $t2 := stack_handler */ + ld.d $s2, Handler_value($t2) /* saved across C call */ +1: + move $s3, $a0 /* save return across C call */ + ld.d $a0, Caml_state(current_stack) /* arg to caml_free_stack */ + /* restore parent stack and exn_handler into Caml_state */ + ld.d TMP, Handler_parent($t2) + st.d TMP, Caml_state(current_stack) + ld.d TRAP_PTR, Stack_exception(TMP) + st.d TRAP_PTR, Caml_state(exn_handler) + /* free old stack by switching directly to c_stack; + is a no-alloc call */ + ld.d $s4, Stack_sp(TMP) /* saved across C call */ + CFI_RESTORE_STATE + CFI_REMEMBER_STATE + ld.d TMP, Caml_state(c_stack) + move $sp, TMP + bl PLT(caml_free_stack) + /* switch directly to parent stack with correct return */ + move $a0, $s3 + move $a1, $s2 + move $sp, $s4 + CFI_RESTORE_STATE + ld.d TMP, $s2, 0 /* code pointer */ + /* Invoke handle_value (or handle_exn) */ + ld.d $ra, $sp, 8 + addi.d $sp, $sp, 16 + CFI_ADJUST(-16) + jr TMP +L(fiber_exn_handler): + addi.d $t2, $sp, 16 /* $t2 := stack_handler */ + ld.d $s2, Handler_exception($t2) + b 1b +END_FUNCTION(caml_runstack) + +FUNCTION(caml_ml_array_bound_error) + /* Load address of [caml_array_bound_error_asm] in ADDITIONAL_ARG */ + la.global ADDITIONAL_ARG, caml_array_bound_error_asm + /* Call that function */ + b caml_c_call +END_FUNCTION(caml_ml_array_bound_error) + + .globl caml_system__code_end +caml_system__code_end: + +/* GC roots for callback */ + +OBJECT(caml_system.frametable) + .quad 2 /* two descriptors */ + .quad L(caml_retaddr) /* return address into callback */ + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ + .align 3 + .quad L(frame_runstack) /* return address into fiber handler */ + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ + .align 3 +END_OBJECT(caml_system.frametable) +.end diff --git a/testsuite/tools/asmgen_loongarch64.S b/testsuite/tools/asmgen_loongarch64.S new file mode 100644 index 0000000000..97fbeae046 --- /dev/null +++ b/testsuite/tools/asmgen_loongarch64.S @@ -0,0 +1,75 @@ +/**************************************************************************/ +/* */ +/* OCaml */ +/* */ +/* Nicolas Ojeda Bar */ +/* */ +/* Copyright 2019 Institut National de Recherche en Informatique et */ +/* en Automatique. */ +/* */ +/* All rights reserved. This file is distributed under the terms of */ +/* the GNU Lesser General Public License version 2.1, with the */ +/* special exception on linking described in the file LICENSE. */ +/* */ +/**************************************************************************/ + +#define STORE st.d +#define LOAD ld.d + + .globl call_gen_code + .align 2 +call_gen_code: + /* Set up stack frame and save callee-save registers */ + addi.d $sp, $sp, -208 + STORE $ra, $sp, 192 + STORE $s0, $sp, 0 + STORE $s1, $sp, 8 + STORE $s2, $sp, 16 + STORE $s3, $sp, 24 + STORE $s4, $sp, 32 + STORE $s5, $sp, 40 + STORE $s6, $sp, 48 + STORE $s7, $sp, 56 + STORE $s8, $sp, 64 + fst.d $fs0, $sp, 96 + fst.d $fs1, $sp, 104 + fst.d $fs2, $sp, 112 + fst.d $fs3, $sp, 120 + fst.d $fs4, $sp, 128 + fst.d $fs5, $sp, 136 + fst.d $fs6, $sp, 144 + fst.d $fs7, $sp, 152 + /* Shuffle arguments */ + move $t0, $a0 + move $a0, $a1 + move $a1, $a2 + move $a2, $a3 + move $a3, $a4 + /* Call generated asm */ + jirl $ra, $t0, 0 + /* Reload callee-save registers and return address */ + LOAD $ra, $sp, 192 + LOAD $s0, $sp, 0 + LOAD $s1, $sp, 8 + LOAD $s2, $sp ,16 + LOAD $s3, $sp ,24 + LOAD $s4, $sp ,32 + LOAD $s5, $sp ,40 + LOAD $s6, $sp ,48 + LOAD $s7, $sp ,56 + LOAD $s8, $sp ,64 + fld.d $fs0, $sp, 96 + fld.d $fs1, $sp, 104 + fld.d $fs2, $sp, 112 + fld.d $fs3, $sp, 120 + fld.d $fs4, $sp, 128 + fld.d $fs5, $sp, 136 + fld.d $fs6, $sp, 144 + fld.d $fs7, $sp, 152 + addi.d $sp, $sp, 208 + jr $ra + + .globl caml_c_call + .align 2 +caml_c_call: + jr $t2