From a01016f945e67900313c85ca3ba16dc6feb84e78 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 11 Nov 2019 13:50:00 +0000 Subject: [PATCH 001/350] Initial commit --- LICENSE | 29 +++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..2ab88408298f --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Sound Open Firmware +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 000000000000..c5c67ede5194 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# rimage +DSP firmware image creation and signing tool From b537522a6501f0f7249f26c24eb1a4d8679f4bf1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 13 Feb 2018 20:29:40 +0000 Subject: [PATCH 002/350] rimage: import rimage image creation and signing tool rimage is being moved from tools repo to sof repo since there is now a cyclic dependency between both repos and sof needs rimage for it's build. Signed-off-by: Liam Girdwood --- rimage/Makefile.am | 25 ++ rimage/cse.c | 45 ++++ rimage/cse.h | 42 ++++ rimage/css.c | 70 ++++++ rimage/css.h | 69 ++++++ rimage/elf.c | 535 +++++++++++++++++++++++++++++++++++++++++++ rimage/file_format.h | 117 ++++++++++ rimage/file_simple.c | 311 +++++++++++++++++++++++++ rimage/hash.c | 72 ++++++ rimage/man_apl.c | 144 ++++++++++++ rimage/man_cnl.c | 143 ++++++++++++ rimage/manifest.c | 528 ++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.h | 90 ++++++++ rimage/pkcs1_5.c | 142 ++++++++++++ rimage/plat_auth.c | 50 ++++ rimage/plat_auth.h | 92 ++++++++ rimage/rimage.c | 136 +++++++++++ rimage/rimage.h | 170 ++++++++++++++ 18 files changed, 2781 insertions(+) create mode 100644 rimage/Makefile.am create mode 100644 rimage/cse.c create mode 100644 rimage/cse.h create mode 100644 rimage/css.c create mode 100644 rimage/css.h create mode 100644 rimage/elf.c create mode 100644 rimage/file_format.h create mode 100644 rimage/file_simple.c create mode 100644 rimage/hash.c create mode 100644 rimage/man_apl.c create mode 100644 rimage/man_cnl.c create mode 100644 rimage/manifest.c create mode 100644 rimage/manifest.h create mode 100644 rimage/pkcs1_5.c create mode 100644 rimage/plat_auth.c create mode 100644 rimage/plat_auth.h create mode 100644 rimage/rimage.c create mode 100644 rimage/rimage.h diff --git a/rimage/Makefile.am b/rimage/Makefile.am new file mode 100644 index 000000000000..467bfe638b50 --- /dev/null +++ b/rimage/Makefile.am @@ -0,0 +1,25 @@ +SUBDIRS=keys + +bin_PROGRAMS = rimage + +noinst_HEADERS = \ + rimage.h \ + css.h \ + cse.h \ + plat_auth.h \ + manifest.h \ + file_format.h + +rimage_SOURCES = \ + file_simple.c \ + man_apl.c \ + man_cnl.c \ + cse.c \ + css.c \ + plat_auth.c \ + hash.c \ + pkcs1_5.c \ + manifest.c \ + elf.c \ + rimage.c + diff --git a/rimage/cse.c b/rimage/cse.c new file mode 100644 index 000000000000..b5604153f120 --- /dev/null +++ b/rimage/cse.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include "rimage.h" +#include "cse.h" +#include "manifest.h" + +void ri_cse_create(struct image *image) +{ + struct CsePartitionDirHeader *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext *meta = image->fw_image + + MAN_META_EXT_OFFSET; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t csum = 0, *val = image->fw_image; + int i, size; + + fprintf(stdout, " cse: completing CSE manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET; + + /* calculate checksum using BSD algo */ + size = sizeof(*cse_hdr) + sizeof(*cse_entry) * MAN_CSE_PARTS; + for (i = 0; i < size; i++) { + if (i == 11) + continue; + csum += val[i]; + } + cse_hdr->checksum = 0x100 - csum; +} diff --git a/rimage/cse.h b/rimage/cse.h new file mode 100644 index 000000000000..28650dadec2b --- /dev/null +++ b/rimage/cse.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSE_H__ +#define __CSE_H__ + +#include + +struct image; + +#define CSE_HEADER_MAKER 0x44504324 /* "DPC$" */ + +struct CsePartitionDirHeader { + uint32_t header_marker; + uint32_t nb_entries; + uint8_t header_version; + uint8_t entry_version; + uint8_t header_length; + uint8_t checksum; + uint8_t partition_name[4]; +} __attribute__((packed)); + +struct CsePartitionDirEntry { + uint8_t entry_name[12]; + uint32_t offset; + uint32_t length; + uint32_t reserved; +} __attribute__((packed)); + +void ri_cse_create(struct image *image); + +#endif diff --git a/rimage/css.c b/rimage/css.c new file mode 100644 index 000000000000..bc69cf10b55e --- /dev/null +++ b/rimage/css.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include "rimage.h" +#include "css.h" +#include "manifest.h" + +void ri_css_hdr_create(struct image *image) +{ + struct css_header *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct tm *date; + struct timeval tv; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + date = localtime(&tv.tv_sec); + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} diff --git a/rimage/css.h b/rimage/css.h new file mode 100644 index 000000000000..0516f531ba9a --- /dev/null +++ b/rimage/css.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSS_H__ +#define __CSS_H__ + +#include + +struct image; + +#define MAN_CSS_MOD_TYPE 4 +#define MAN_CSS_HDR_SIZE 161 /* in words */ +#define MAN_CSS_HDR_VERSION 0x10000 +#define MAN_CSS_MOD_VENDOR 0x8086 +#define MAN_CSS_HDR_ID {'$', 'M', 'N', '2'} + +#define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) +#define MAN_CSS_MAN_SIZE \ + (sizeof(struct fw_image_manifest) >> 2) + +/* + * RSA Key and Crypto + */ +#define MAN_RSA_KEY_MODULUS_LEN 256 +#define MAN_RSA_KEY_EXPONENT_LEN 4 +#define MAN_RSA_SIGNATURE_LEN 256 + +struct fw_version { + uint16_t major_version; + uint16_t minor_version; + uint16_t hotfix_version; + uint16_t build_version; +} __attribute__((packed)); + +struct css_header { + uint32_t header_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x0 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint8_t header_id[4]; + uint32_t padding; /* must be 0x0 */ + struct fw_version version; + uint32_t svn; + uint32_t reserved1[18]; /* must be 0x0 */ + uint32_t modulus_size; + uint32_t exponent_size; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN]; +} __attribute__((packed)); + +void ri_css_hdr_create(struct image *image); + +#endif diff --git a/rimage/elf.c b/rimage/elf.c new file mode 100644 index 000000000000..672d6e3997bc --- /dev/null +++ b/rimage/elf.c @@ -0,0 +1,535 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include "rimage.h" +#include "cse.h" +#include "manifest.h" + +static int elf_read_sections(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Shdr *section = module->section; + size_t count; + int i, ret; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int man_section_idx; + + /* read in section header */ + ret = fseek(module->fd, hdr->e_shoff, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to %s section header %d\n", + module->elf_file, ret); + return ret; + } + + /* allocate space for each section header */ + section = calloc(sizeof(Elf32_Shdr), hdr->e_shnum); + if (section == NULL) + return -ENOMEM; + module->section = section; + + /* read in sections */ + count = fread(section, sizeof(Elf32_Shdr), hdr->e_shnum, module->fd); + if (count != hdr->e_shnum) { + fprintf(stderr, "error: failed to read %s section header %d\n", + module->elf_file, -errno); + return -errno; + } + + /* find manifest module data */ + man_section_idx = elf_find_section(image, module, ".bss"); + if (man_section_idx < 0) { + return -EINVAL; + } + module->bss_index = man_section_idx; + + fprintf(stdout, " BSS module metadata section at index %d\n", + man_section_idx); + + /* parse each section */ + for (i = 0; i < hdr->e_shnum; i++) { + + /* only write valid sections */ + if (!(section[i].sh_flags & valid)) + continue; + + switch (section[i].sh_type) { + case SHT_NOBITS: + /* bss */ + module->bss_size += section[i].sh_size; + module->num_bss++; + break; + case SHT_PROGBITS: + /* text or data */ + module->fw_size += section[i].sh_size; + + if (section[i].sh_flags & SHF_EXECINSTR) + module->text_size += section[i].sh_size; + else + module->data_size += section[i].sh_size; + break; + default: + continue; + } + + module->num_sections++; + + if (!image->verbose) + continue; + + fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_type); + fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_flags); + fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_addr); + fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_offset); + fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_size); + fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_link); + fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, + i, section[i].sh_info); + } + + return 0; +} + +static int elf_read_programs(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Phdr *prg = module->prg; + size_t count; + int i, ret; + + /* read in program header */ + ret = fseek(module->fd, hdr->e_phoff, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to %s program header %d\n", + module->elf_file, ret); + return ret; + } + + /* allocate space for programs */ + prg = calloc(sizeof(Elf32_Phdr), hdr->e_phnum); + if (prg == NULL) + return -ENOMEM; + module->prg = prg; + + /* read in programs */ + count = fread(prg, sizeof(Elf32_Phdr), hdr->e_phnum, module->fd); + if (count != hdr->e_phnum) { + fprintf(stderr, "error: failed to read %s program header %d\n", + module->elf_file, -errno); + return -errno; + } + + /* check each program */ + for (i = 0; i < hdr->e_phnum; i++) { + + if (prg[i].p_filesz == 0) + continue; + + if (!image->verbose) + continue; + + fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_type); + fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_offset); + fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_vaddr); + fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_paddr); + fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_filesz); + fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_memsz); + fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", + module->elf_file, i, prg[i].p_flags); + } + + return 0; +} + +static int elf_read_hdr(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + size_t count; + + /* read in elf header */ + count = fread(hdr, sizeof(*hdr), 1, module->fd); + if (count != 1) { + fprintf(stderr, "error: failed to read %s elf header %d\n", + module->elf_file, -errno); + return -errno; + } + + if (!image->verbose) + return 0; + + fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", + module->elf_file, hdr->e_entry); + fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", + module->elf_file, hdr->e_phoff); + fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", + module->elf_file, hdr->e_shoff); + fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", + module->elf_file, hdr->e_phentsize); + fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", + module->elf_file, hdr->e_phnum); + fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", + module->elf_file, hdr->e_shentsize); + fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", + module->elf_file, hdr->e_shnum); + fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", + module->elf_file, hdr->e_shstrndx); + + return 0; +} + +int elf_is_rom(struct image *image, Elf32_Shdr *section) +{ + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < image->adsp->rom_base || + start > image->adsp->rom_base + image->adsp->rom_size) + return 0; + if (end < image->adsp->rom_base || + end > image->adsp->rom_base + image->adsp->rom_size) + return 0; + return 1; +} + +static void elf_module_size(struct image *image, struct module *module, + Elf32_Shdr *section, int index) +{ + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) { + /* text */ + if (module->text_start > section->sh_addr) + module->text_start = section->sh_addr; + if (module->text_end < section->sh_addr + section->sh_size) + module->text_end = section->sh_addr + section->sh_size; + + fprintf(stdout, "\tTEXT\n"); + } else { + /* initialized data, also calc the writable sections */ + if (module->data_start > section->sh_addr) + module->data_start = section->sh_addr; + if (module->data_end < section->sh_addr + section->sh_size) + module->data_end = section->sh_addr + section->sh_size; + + fprintf(stdout, "\tDATA\n"); + } + break; + case SHT_NOBITS: + /* bss */ + if (index == module->bss_index) { + /* updated the .bss segment */ + module->bss_start = section->sh_addr; + module->bss_end = section->sh_addr + section->sh_size; + fprintf(stdout, "\tBSS\n"); + } else { + fprintf(stdout, "\tHEAP\n"); + } + break; + default: + break; + } +} + +static void elf_module_limits(struct image *image, struct module *module) +{ + Elf32_Shdr *section; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i; + + module->text_start = module->data_start = module->bss_start = 0xffffffff; + module->text_end = module->data_end = module->bss_end = 0; + + fprintf(stdout, " Found %d sections, listing valid sections......\n", + module->hdr.e_shnum); + + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\n"); + + /* iterate all sections and get size of segments */ + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + if (elf_is_rom(image, section)) + continue; + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, + section->sh_addr, section->sh_addr + section->sh_size, + section->sh_size); + + /* text or data section */ + elf_module_size(image, module, section, i); + + } + + fprintf(stdout, "\n"); +} + +/* make sure no section overlap from any modules */ +int elf_validate_section(struct image *image, struct module *module, + Elf32_Shdr *section) +{ + struct module *m; + Elf32_Shdr *s; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i, j; + + /* for each module */ + for (i = 0; i < image->num_modules; i++) { + m = &image->module[i]; + + if (m == module) + continue; + + /* for each section */ + for (j = 0; j < m->hdr.e_shnum; j++) { + s = &m->section[j]; + + if (s == section) + continue; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* is section non overlapping ? */ + if (section->sh_addr >= s->sh_addr && + section->sh_addr + section->sh_size <= + s->sh_addr + s->sh_size) { + goto err; + } + } + } + + return 0; + +err: + fprintf(stderr, "error: section overlap between %s and %s\n", + module->elf_file, m->elf_file); + fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", + section->sh_addr, section->sh_addr + section->sh_size, + s->sh_addr, s->sh_addr + s->sh_size); + return -EINVAL; +} + +/* make sure no section overlaps from any modules */ +int elf_validate_modules(struct image *image) +{ + struct module *module; + Elf32_Shdr *section; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i, j, ret; + + /* for each module */ + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + + /* for each section */ + for (j = 0; j < module->hdr.e_shnum; j++) { + section = &module->section[j]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* is section non overlapping ? */ + ret = elf_validate_section(image, module, section); + if (ret < 0) + return ret; + } + } + + return 0; +} + +int elf_find_section(struct image *image, struct module *module, + const char *name) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Shdr *section, *s; + char *buffer; + size_t count; + int ret, i; + + section = &module->section[hdr->e_shstrndx]; + + /* alloc data data */ + buffer = calloc(1, section->sh_size); + if (buffer == NULL) + return -ENOMEM; + + /* read in section string data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to string section %d\n", ret); + goto out; + } + + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't read string section %d\n", -errno); + ret = -errno; + goto out; + } + + /* find section with name */ + for (i = 0; i < hdr->e_shnum; i++) { + s = &module->section[i]; + if (!strcmp(name, buffer + s->sh_name)) { + ret = i; + goto out; + } + } + + fprintf(stderr, "error: can't find section %s in module %s\n", name, + module->elf_file); + ret = -EINVAL; + +out: + free(buffer); + return ret; +} + +int elf_parse_module(struct image *image, int module_index, const char *name) +{ + struct module *module; + uint32_t rem; + int ret = 0; + + /* validate module index */ + if (module_index >= MAX_MODULES) { + fprintf(stderr, "error: too any modules\n"); + return -EINVAL; + } + + module = &image->module[module_index]; + + /* open the elf input file */ + module->fd = fopen(name, "r"); + if (module->fd == NULL) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + name, errno); + return -EINVAL; + } + module->elf_file = name; + + /* read in elf header */ + ret = elf_read_hdr(image, module); + if (ret < 0) + goto hdr_err; + + /* read in programs */ + ret = elf_read_programs(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to read program sections %d\n", + ret); + goto hdr_err; + } + + /* read sections */ + ret = elf_read_sections(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to read base sections %d\n", + ret); + goto sec_err; + } + + /* check limits */ + elf_module_limits(image, module); + + elf_find_section(image, module, ""); + + fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", + module->fw_size, module->fw_size, module->num_sections); + fprintf(stdout, " module: text %d (0x%x) bytes\n" + " data %d (0x%x) bytes\n" + " bss %d (0x%x) bytes\n\n", + module->text_size, module->text_size, + module->data_size, module->data_size, + module->bss_size, module->bss_size); + + /* file sizes round up to nearest page */ + module->text_file_size = module->text_end - module->text_start; + rem = module->text_file_size % MAN_PAGE_SIZE; + if (rem) + module->text_file_size += MAN_PAGE_SIZE - rem; + + + /* apply any base FW fixups */ + if (image->adsp->base_fw_text_size_fixup && + module->text_start == image->adsp->sram_base) { + module->text_file_size += image->adsp->base_fw_text_size_fixup; + } + + /* data section */ + module->data_file_size = module->data_end - module->data_start; + rem = module->data_file_size % MAN_PAGE_SIZE; + if (rem) + module->data_file_size += MAN_PAGE_SIZE - rem; + + /* bss section */ + module->bss_file_size = module->bss_end - module->bss_start; + rem = module->bss_file_size % MAN_PAGE_SIZE; + if (rem) + module->bss_file_size += MAN_PAGE_SIZE - rem; + + return 0; + +sec_err: + free(module->prg); +hdr_err: + fclose(module->fd); + + return ret; +} + +void elf_free_module(struct image *image, int module_index) +{ + struct module *module = &image->module[module_index]; + + free(module->prg); + free(module->section); + fclose(module->fd); +} diff --git a/rimage/file_format.h b/rimage/file_format.h new file mode 100644 index 000000000000..15302589cc40 --- /dev/null +++ b/rimage/file_format.h @@ -0,0 +1,117 @@ +/* + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * The full GNU General Public License is included in this distribution + * in the file called LICENSE.GPL. + * + * BSD LICENSE + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Liam Girdwood + */ + + +/* + * Firmware file format . + */ + +#ifndef __INCLUDE_UAPI_SOF_FW_H__ +#define __INCLUDE_UAPI_SOF_FW_H__ + +#define SND_SOF_FW_SIG_SIZE 4 +#define SND_SOF_FW_ABI 1 +#define SND_SOF_FW_SIG "Reef" + +/* + * Firmware module is made up of 1 . N blocks of different types. The + * Block header is used to determine where and how block is to be copied in the + * DSP/host memory space. + */ +enum snd_sof_fw_blk_type { + SOF_BLK_IMAGE = 0, /* whole image - parsed by ROMs */ + SOF_BLK_TEXT = 1, + SOF_BLK_DATA = 2, + SOF_BLK_CACHE = 3, + SOF_BLK_REGS = 4, + SOF_BLK_SIG = 5, + SOF_BLK_ROM = 6, + /* add new block types here */ +}; + +struct snd_sof_blk_hdr { + enum snd_sof_fw_blk_type type; + uint32_t size; /* bytes minus this header */ + uint32_t offset; /* offset from base */ +} __attribute__((packed)); + +/* + * Firmware file is made up of 1 .. N different modules types. The module + * type is used to determine how to load and parse the module. + */ +enum snd_sof_fw_mod_type { + SOF_FW_BASE = 0, /* base firmware image */ + SOF_FW_MODULE = 1, /* firmware module */ +}; + +struct snd_sof_mod_hdr { + enum snd_sof_fw_mod_type type; + uint32_t size; /* bytes minus this header */ + uint32_t num_blocks; /* number of blocks */ +} __attribute__((packed)); + +/* + * Firmware file header. + */ +struct snd_sof_fw_header { + unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ + uint32_t file_size; /* size of file minus this header */ + uint32_t num_modules; /* number of modules */ + uint32_t abi; /* version of header format */ +} __attribute__((packed)); + +#endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c new file mode 100644 index 000000000000..dcf0d5b241b4 --- /dev/null +++ b/rimage/file_simple.c @@ -0,0 +1,311 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + + +#include +#include +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" + +#define BYT_IRAM_BASE 0xff2c0000 +#define BYT_IRAM_HOST_OFFSET 0x0C0000 +#define BYT_IRAM_SIZE (80 * 1024) +#define BYT_DRAM_BASE 0xff300000 +#define BYT_DRAM_HOST_OFFSET 0x100000 +#define BYT_DRAM_SIZE (160 * 1024) + +#define HSW_IRAM_BASE 0x00000000 +#define HSW_IRAM_HOST_OFFSET 0x00080000 +#define HSW_IRAM_SIZE (384 * 1024) +#define HSW_DRAM_BASE 0x00400000 +#define HSW_DRAM_HOST_OFFSET 0x00000000 +#define HSW_DRAM_SIZE (512 * 1024) + +#define BDW_IRAM_BASE 0x00000000 +#define BDW_IRAM_HOST_OFFSET 0x000A0000 +#define BDW_IRAM_SIZE (320 * 1024) +#define BDW_DRAM_BASE 0x00400000 +#define BDW_DRAM_HOST_OFFSET 0x00000000 +#define BDW_DRAM_SIZE (640 * 1024) + +static int is_iram(struct image *image, Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < adsp->iram_base) + return 0; + if (start >= adsp->iram_base + adsp->iram_size) + return 0; + if (end > adsp->iram_base + adsp->iram_size) + return 0; + return 1; +} + +static int is_dram(struct image *image, Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < adsp->dram_base) + return 0; + if (start >= adsp->dram_base + adsp->dram_size) + return 0; + if (end > adsp->dram_base + adsp->dram_size) + return 0; + return 1; +} + +static int block_idx; + +static int write_block(struct image *image, struct module *module, + Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + struct snd_sof_blk_hdr block; + size_t count; + void *buffer; + int ret; + + block.size = section->sh_size; + + if (is_iram(image, section)) { + block.type = SOF_BLK_TEXT; + block.offset = section->sh_addr - adsp->iram_base + + adsp->host_iram_offset; + } else if (is_dram(image, section)) { + block.type = SOF_BLK_DATA; + block.offset = section->sh_addr - adsp->dram_base + + adsp->host_dram_offset; + } else { + fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", + section->sh_addr, section->sh_size); + return -EINVAL; + } + + /* write header */ + count = fwrite(&block, sizeof(block), 1, image->out_fd); + if (count != 1) + return -errno; + + /* alloc data data */ + buffer = calloc(1, section->sh_size); + if (buffer == NULL) + return -ENOMEM; + + /* read in section data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to section %d\n", ret); + goto out; + } + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant read section %d\n", -errno); + ret = -errno; + goto out; + } + + /* write out section data */ + count = fwrite(buffer, 1, section->sh_size, image->out_fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant write section %d\n", -errno); + fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", + section->sh_offset, section->sh_size, section->sh_addr); + ret = -errno; + goto out; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + section->sh_addr, section->sh_size, ftell(image->out_fd), + block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + +out: + free(buffer); + return ret; +} + +static int simple_write_module(struct image *image, struct module *module) +{ + struct snd_sof_mod_hdr hdr; + Elf32_Shdr *section; + size_t count; + int i, err; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + + hdr.num_blocks = module->num_sections - module->num_bss; + hdr.size = module->text_size + module->data_size + + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; + hdr.type = SOF_FW_BASE; + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); + + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only write valid sections */ + if (!(module->section[i].sh_flags & valid)) + continue; + + /* dont write bss */ + if (section->sh_type == SHT_NOBITS) + continue; + + err = write_block(image, module, section); + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + } + + fprintf(stdout, "\n"); + return 0; +} + +/* used by others */ +static int simple_write_firmware(struct image *image) +{ + struct snd_sof_fw_header hdr; + struct module *module; + size_t count; + int i, ret; + + memcpy(hdr.sig, SND_SOF_FW_SIG, SND_SOF_FW_SIG_SIZE); + + hdr.num_modules = image->num_modules; + hdr.abi = SND_SOF_FW_ABI; + hdr.file_size = 0; + + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + module->fw_size += sizeof(struct snd_sof_blk_hdr) * + (module->num_sections - module->num_bss); + module->fw_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; + hdr.file_size += module->fw_size; + } + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) + return -errno; + + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + + fprintf(stdout, "writing module %d %s\n", i, module->elf_file); + + ret = simple_write_module(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to write module %d\n", + i); + return ret; + } + } + + fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", + hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), + hdr.num_modules); + + return 0; +} + +const struct adsp machine_byt = { + .name = "byt", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BAYTRAIL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_cht = { + .name = "cht", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_CHERRYTRAIL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_bsw = { + .name = "bsw", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BRASWELL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_hsw = { + .name = "hsw", + .iram_base = HSW_IRAM_BASE, + .iram_size = HSW_IRAM_SIZE, + .host_iram_offset = HSW_IRAM_HOST_OFFSET, + .dram_base = HSW_DRAM_BASE, + .dram_size = HSW_DRAM_SIZE, + .host_dram_offset = HSW_DRAM_HOST_OFFSET, + .machine_id = MACHINE_HASWELL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_bdw = { + .name = "bdw", + .iram_base = BDW_IRAM_BASE, + .iram_size = BDW_IRAM_SIZE, + .host_iram_offset = BDW_IRAM_HOST_OFFSET, + .dram_base = BDW_DRAM_BASE, + .dram_size = BDW_DRAM_SIZE, + .host_dram_offset = BDW_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BROADWELL, + .write_firmware = simple_write_firmware, +}; diff --git a/rimage/hash.c b/rimage/hash.c new file mode 100644 index 000000000000..d586e07fc1b6 --- /dev/null +++ b/rimage/hash.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" +#include "manifest.h" + +#define DEBUG_HASH 0 + +void module_sha256_create(struct image *image) +{ + image->md = EVP_sha256(); + image->mdctx = EVP_MD_CTX_create(); + + EVP_DigestInit_ex(image->mdctx, image->md, NULL); +} + +void module_sha256_update(struct image *image, uint8_t *data, size_t bytes) +{ + EVP_DigestUpdate(image->mdctx, data, bytes); +} + +void module_sha256_complete(struct image *image, uint8_t *hash) +{ + unsigned char md_value[EVP_MAX_MD_SIZE]; + unsigned int md_len; +#if DEBUG_HASH + int i; +#endif + EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); + EVP_MD_CTX_destroy(image->mdctx); + + memcpy(hash, md_value, md_len); +#if DEBUG_HASH + fprintf(stdout, "Module digest is: "); + for (i = 0; i < md_len; i++) + fprintf(stdout, "%02x", md_value[i]); + fprintf(stdout, "\n"); +#endif +} + +void ri_hash(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) +{ + module_sha256_create(image); + module_sha256_update(image, image->fw_image + offset, size); + module_sha256_complete(image, hash); +} diff --git a/rimage/man_apl.c b/rimage/man_apl.c new file mode 100644 index 000000000000..7b32ea1c3887 --- /dev/null +++ b/rimage/man_apl.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +/* hard coded atm - will pass this in from cmd line and git */ +#define MAN_FW_HDR_VERSION_MAJOR 9 +#define MAN_FW_HDR_VERSION_MINOR 22 +#define MAN_FW_HDR_VERSION_HOTFIX 1 +#define MAN_FW_HDR_VERSION_BUILD 0x7da + +/* manifest template */ +struct fw_image_manifest apl_manifest = { + + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .checksum = 0, + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET, + .length = sizeof(struct sof_man_adsp_meta_file_ext), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .imr_type = 3, + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + .load_offset = MAN_DESC_OFFSET, + }, + }, +}; diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c new file mode 100644 index 000000000000..2aec2a723d79 --- /dev/null +++ b/rimage/man_cnl.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +/* hard coded atm - will pass this in from cmd line and git */ +#define MAN_FW_HDR_VERSION_MAJOR 10 +#define MAN_FW_HDR_VERSION_MINOR 23 +#define MAN_FW_HDR_VERSION_HOTFIX 0 +#define MAN_FW_HDR_VERSION_BUILD 0x2a4 + +/* manifest template */ +struct fw_image_manifest cnl_manifest = { + + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET, + .length = sizeof(struct sof_man_adsp_meta_file_ext), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .imr_type = 3, + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + .load_offset = 0x30000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c new file mode 100644 index 000000000000..a4780b780118 --- /dev/null +++ b/rimage/manifest.c @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include "uapi/manifest.h" +#include "rimage.h" +#include "file_format.h" +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +static int man_open_rom_file(struct image *image) +{ + sprintf(image->out_rom_file, "%s.rom", image->out_file); + unlink(image->out_rom_file); + + /* allocate ROM image */ + image->rom_image = calloc(image->adsp->rom_size, 1); + if (image->rom_image == NULL) + return -ENOMEM; + + /* open ROM outfile for writing */ + image->out_rom_fd = fopen(image->out_rom_file, "w"); + if (image->out_rom_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_rom_file, errno); + } + + return 0; +} + +static int man_open_manifest_file(struct image *image) +{ + /* open manifest outfile for writing */ + sprintf(image->out_man_file, "%s.met", image->out_file); + unlink(image->out_man_file); + + image->out_man_fd = fopen(image->out_man_file, "w"); + if (image->out_man_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_man_file, errno); + } + + return 0; +} + +static int man_init_image(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (image->fw_image == NULL) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man, + sizeof(struct fw_image_manifest)); + + return 0; +} + +/* we should call this after all segments size set up via iterate */ +static uint32_t elf_to_file_offset(struct image *image, + struct module *module, struct sof_man_module *man_module, + Elf32_Shdr *section) +{ + uint32_t elf_addr = section->sh_addr, file_offset = 0; + + if (section->sh_type == SHT_PROGBITS) { + if (section->sh_flags & SHF_EXECINSTR) { + /* text segment */ + file_offset = elf_addr - module->text_start + + module->foffset; + } else { + /* rodata segment, append to text segment */ + file_offset = elf_addr - module->data_start + + module->foffset + module->text_file_size; + + } + } else if (section->sh_type == SHT_NOBITS) { + /* bss segment */ + file_offset = 0; + } + + return file_offset; +} + +/* write SRAM sections */ +static int man_copy_sram(struct image *image, Elf32_Shdr *section, + struct module *module, struct sof_man_module *man_module, + int section_idx) +{ + uint32_t offset = elf_to_file_offset(image, module, + man_module, section); + uint32_t end = offset + section->sh_size; + int seg_type = -1; + void *buffer = image->fw_image + offset; + size_t count; + + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) + seg_type = SOF_MAN_SEGMENT_TEXT; + else + seg_type = SOF_MAN_SEGMENT_RODATA; + break; + case SHT_NOBITS: + seg_type = SOF_MAN_SEGMENT_BSS; + default: + return 0; + } + + /* file_offset for segment should not be 0s, we set it to + * the smallest offset of its modules ATM. + */ + if (man_module->segment[seg_type].file_offset > offset || + man_module->segment[seg_type].file_offset == 0) + man_module->segment[seg_type].file_offset = offset; + + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant read section %d\n", -errno); + return -errno; + } + + /* get module end offset ? */ + if (end > image->image_end) + image->image_end = end; + + fprintf(stdout, "\t%d\t0x%x\t0x%x\t0x%x\t%s\n", section_idx, + section->sh_addr, section->sh_size, offset, + seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); + + return 0; +} + +static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, + struct module *module, struct sof_man_module *man_module, int idx) +{ + int ret; + + /* seek to ELF section */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + return ret; + } + + /* write data to DRAM or ROM image */ + if (!elf_is_rom(image, section)) + return man_copy_sram(image, section, module, man_module, idx); + + return 0; +} + +static int man_get_module_manifest(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + Elf32_Shdr *section; + struct sof_man_segment_desc *segment; + struct sof_man_module sof_mod; + size_t count; + int ret, man_section_idx; + + fprintf(stdout, "Module Write: %s\n", module->elf_file); + + /* find manifest module data */ + man_section_idx = elf_find_section(image, module, ".module"); + if (man_section_idx < 0) { + return -EINVAL; + } + + fprintf(stdout, " Manifest module metadata section at index %d\n", + man_section_idx); + section = &module->section[man_section_idx]; + + /* load in manifest data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + return ret; + } + count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); + if (count != sizeof(sof_mod)) { + fprintf(stderr, "error: can't read section %d\n", -errno); + return -errno; + } + + /* configure man_module with sofmod data */ + memcpy(man_module->struct_id, "$AME", 4); + man_module->entry_point = sof_mod.entry_point; + memcpy(man_module->name, sof_mod.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod.uuid, 16); + man_module->affinity_mask = sof_mod.affinity_mask; + man_module->type.auto_start = sof_mod.type.auto_start; + man_module->type.domain_dp = sof_mod.type.domain_dp; + man_module->type.domain_ll = sof_mod.type.domain_ll; + man_module->type.load_type = sof_mod.type.load_type; + + /* text segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; + segment->flags.r.contents = 1; + segment->flags.r.alloc = 1; + segment->flags.r.load = 1; + segment->flags.r.readonly = 1; + segment->flags.r.code = 1; + + /* data segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_RODATA]; + segment->flags.r.contents = 1; + segment->flags.r.alloc = 1; + segment->flags.r.load = 1; + segment->flags.r.readonly = 1; + segment->flags.r.data = 1; + segment->flags.r.type = 1; + + /* bss segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_BSS]; + segment->flags.r.alloc = 1; + segment->flags.r.type = 2; + + fprintf(stdout, " Entry point 0x%8.8x\n", man_module->entry_point); + + return 0; +} + +static int man_module_create(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + /* create module and segments */ + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + Elf32_Shdr *section; + int i, err; + unsigned int pages; + + image->image_end = 0; + + err = man_get_module_manifest(image, module, man_module); + if (err < 0) + return err; + + /* stack size ??? convert sizes to PAGES */ + man_module->instance_bss_size = 1; + + /* max number of instances of this module ?? */ + man_module->instance_max_count = 1; + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%x\t0x%x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%x\t0x%x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%x\t0x%x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + /* main module */ + /* text section is first */ + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = + module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = + module->text_start; + + /* calculates those padding 0s by the start of next segment */ + pages = module->text_file_size / MAN_PAGE_SIZE; + if (module->text_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; + + /* data section */ + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = + module->data_start; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = + module->foffset + module->text_file_size; + pages = module->data_file_size / MAN_PAGE_SIZE; + if (module->data_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + + /* bss is last */ + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = module->bss_start; + pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; + if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) + pages += 1; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; + + fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + + /* find all sections and copy to corresponding segments */ + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* text or data section */ + if (!elf_is_rom(image, section)) + err = man_copy_elf_section(image, section, module, + man_module, i); + + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + } + fprintf(stdout, "\n"); + + /* round module end upto nearest page */ + if (image->image_end % MAN_PAGE_SIZE) { + image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; + image->image_end *= MAN_PAGE_SIZE; + } + + fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length, + image->image_end); + return 0; +} + +static int man_write_fw_mod(struct image *image) +{ + int count; + + /* write ROM - for VM use only */ + count = fwrite(image->rom_image, image->adsp->rom_size, 1, + image->out_rom_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write rom %s %d\n", + image->out_rom_file, -errno); + return -errno; + } + fclose(image->out_rom_fd); + + /* write manifest and signed image */ + count = fwrite(image->fw_image, + image->image_end, + 1, image->out_fd); + + /* did the image write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write signed firmware %s %d\n", + image->out_file, -errno); + return -errno; + } + + return 0; +} + +/* used by others */ +static int man_write_fw(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest *m; + struct module *module; + struct sof_man_module *man_module; + uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image(image); + if (ret < 0) + goto err; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + for (i = 0; i < image->num_modules; i++) { + + man_module = sof_man_get_module(desc, i); + module = &image->module[i]; + + /* set module file offset */ + if (i == 0) { + module->foffset = FILE_TEXT_OFFSET; + } else { + module->foffset = image->image_end; + } + + ret = man_module_create(image, module, man_module); + if (ret < 0) + goto err; + } + + fprintf(stdout, "Firmware completing manifest\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image); + ri_plat_ext_data_create(image); + ri_css_hdr_create(image); + ri_cse_create(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + for (i = 0; i < image->num_modules; i++) { + + module = &image->module[i]; + man_module = sof_man_get_module(desc, i); + + ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); + } + + /* calculate hash for ADSP meta data extension - 0x480 to end */ + ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end + - MAN_FW_DESC_OFFSET, m->adsp_file_ext.comp_desc[0].hash); + + /* calculate hash for platform auth data - repeated in hash 2 and 4 */ + ri_hash(image, MAN_META_EXT_OFFSET, + sizeof(struct sof_man_adsp_meta_file_ext), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + m->partition_info.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA256_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + +#define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_APL_DSP_ROM_SIZE 0x00002000 +#define APL_DSP_BASE_ENTRY 0xa000a000 + +#define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_CNL_DSP_ROM_SIZE 0x00002000 +#define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define CNL_DSP_HP_BASE_ENTRY 0xbe040000 + +/* list of supported adsp */ +const struct adsp machine_apl = { + .name = "apl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_APOLLOLAKE, + .write_firmware = man_write_fw, + .man = &apl_manifest, + .base_fw_text_size_fixup = 0xa000, +}; + +const struct adsp machine_cnl = { + .name = "cnl", + .rom_base = ADSP_CNL_DSP_ROM_BASE, + .rom_size = ADSP_CNL_DSP_ROM_SIZE, + .imr_base = CNL_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = CNL_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_CANNONLAKE, + .write_firmware = man_write_fw, + .man = &cnl_manifest, +}; diff --git a/rimage/manifest.h b/rimage/manifest.h new file mode 100644 index 000000000000..ca951321f3a9 --- /dev/null +++ b/rimage/manifest.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MANIFEST_H__ +#define __MANIFEST_H__ + +#include +#include "uapi/manifest.h" +#include "css.h" +#include "cse.h" +#include "plat_auth.h" + +#define MAN_PAGE_SIZE 4096 + +/* start offset for base FW module */ +#define FILE_TEXT_OFFSET 0x8000 + +/* + * CSE values for CNL + */ +#define MAN_CSE_PARTS 3 + + +#define MAN_CSE_HDR_OFFSET 0 +#define MAN_CSE_PADDING_SIZE 0x30 +#define MAN_EXT_PADDING 0x20 +#define MAN_DESC_OFFSET 0x2000 + +#define MAN_CSS_HDR_OFFSET \ + (MAN_CSE_HDR_OFFSET + \ + sizeof(struct CsePartitionDirHeader) + \ + MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) + +#define MAN_SIG_PKG_OFFSET \ + (MAN_CSS_HDR_OFFSET + \ + sizeof(struct css_header)) + +#define MAN_PART_INFO_OFFSET \ + (MAN_SIG_PKG_OFFSET + \ + sizeof(struct signed_pkg_info_ext)) + +#define MAN_META_EXT_OFFSET \ + (MAN_SIG_PKG_OFFSET + \ + sizeof(struct signed_pkg_info_ext) + \ + sizeof(struct partition_info_ext) + \ + MAN_CSE_PADDING_SIZE) + +#define MAN_FW_DESC_OFFSET \ + (MAN_META_EXT_OFFSET + \ + sizeof(struct sof_man_adsp_meta_file_ext) + \ + MAN_EXT_PADDING) + +#define MAN_DESC_PADDING_SIZE \ + (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET) + +/* + * Firmware manifest header. + */ +struct fw_image_manifest { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header css; + struct signed_pkg_info_ext signed_pkg; + struct partition_info_ext partition_info; + uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct sof_man_adsp_meta_file_ext adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + +extern struct fw_image_manifest apl_manifest; +extern struct fw_image_manifest cnl_manifest; +#endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c new file mode 100644 index 000000000000..64a4b250015b --- /dev/null +++ b/rimage/pkcs1_5.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "rimage.h" +#include "css.h" +#include "manifest.h" + +#define DEBUG_PKCS 0 + +static void bytes_swap(uint8_t *ptr, uint32_t size) +{ + uint8_t tmp; + uint32_t index; + + for (index = 0; index < (size / 2); index++) { + tmp = ptr[index]; + ptr[index] = ptr[size - 1 - index]; + ptr[size - 1 - index] = tmp; + } +} + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). +*/ + +int pkcs_sign(struct image *image, struct fw_image_manifest *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* create new key */ + privkey = EVP_PKEY_new(); + if (privkey == NULL) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + if (image->key_name == NULL) { + sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); + image->key_name = path; + } + + fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); + fp = fopen(image->key_name, "r"); + if (fp == NULL) { + fprintf(stderr, "error: can't open file %s %d\n", path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha256_update(image, ptr1, size1); + module_sha256_update(image, ptr2, size2); + module_sha256_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css.signature, + &siglen, priv_rsa); + if (ret < 0) + fprintf(stderr, "error: failed to sign manifest\n"); + + /* copy public key modulus and exponent to manifest */ + BN_bn2bin(priv_rsa->n, mod); + BN_bn2bin(priv_rsa->e, (unsigned char *)man->css.exponent); + + /* modulus is reveresd */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN - (1 + i)]; + + /* signature is reveresd, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + +int ri_manifest_sign(struct image *image) +{ + struct fw_image_manifest *man = image->fw_image; + + pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, + sizeof(struct css_header) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET, + (man->css.size - man->css.header_len) * sizeof(uint32_t)); + return 0; +} diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c new file mode 100644 index 000000000000..21c7138cfbb1 --- /dev/null +++ b/rimage/plat_auth.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include "rimage.h" +#include "manifest.h" +#include "plat_auth.h" + +void ri_adsp_meta_data_create(struct image *image) +{ + struct sof_man_adsp_meta_file_ext *meta = + image->fw_image + MAN_META_EXT_OFFSET; + + fprintf(stdout, " meta: completing ADSP manifest\n"); + + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end + - MAN_FW_DESC_OFFSET; + + fprintf(stdout, " meta: limit is 0x%x\n", + meta->comp_desc[0].limit_offset); + /* now hash the AdspFwBinaryDesc -> EOF */ +} + +void ri_plat_ext_data_create(struct image *image) +{ + struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET; + struct sof_man_adsp_meta_file_ext *meta = + image->fw_image + MAN_META_EXT_OFFSET; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + part->length += MAN_PAGE_SIZE - (part->length % MAN_PAGE_SIZE); + + /* do this here atm */ + desc->header.preload_page_count = part->length / MAN_PAGE_SIZE; +} diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h new file mode 100644 index 000000000000..135f2d1ce07c --- /dev/null +++ b/rimage/plat_auth.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PLAT_AUTH_H__ +#define __PLAT_AUTH_H__ + +#include + +struct image; + +#define PLAT_AUTH_SHA256_LEN 32 +#define PLAT_AUTH_NAME_LEN 12 +#define PLAT_AUTH_PADDING 48 /* pad at end of struct */ + +#define SIGN_PKG_EXT_TYPE 15 +#define SIGN_PKG_NUM_MODULE 1 + +struct signed_pkg_info_module { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint16_t hash_size; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; +} __attribute__((packed)); + +struct signed_pkg_info_ext { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; + uint8_t bitmap[16]; + uint32_t svn; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); + + +#define PART_INFO_EXT_TYPE 3 +#define PART_INFO_NUM_MODULE 1 + +struct partition_info_module { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t reserved[3]; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; +} __attribute__((packed)); + +struct partition_info_ext { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; /* "ADSP" */ + uint32_t length; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; + + uint32_t vcn; + uint32_t part_version; + uint32_t fmt_version; + uint32_t instance_id; + uint32_t part_flags; + uint8_t reserved[20]; /* must be 0 */ + + /* variable length of modules */ + struct partition_info_module module[PART_INFO_NUM_MODULE]; +} __attribute__((packed)); + + +#define PLAT_AUTH_SIZE \ + (sizeof(struct partition_info_ext) + \ + sizeof(struct signed_pkg_info_ext)) + +void ri_adsp_meta_data_create(struct image *image); +void ri_plat_ext_data_create(struct image *image); + +#endif diff --git a/rimage/rimage.c b/rimage/rimage.c new file mode 100644 index 000000000000..322820b02612 --- /dev/null +++ b/rimage/rimage.c @@ -0,0 +1,136 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" +#include "manifest.h" + +static const struct adsp *machine[] = { + &machine_byt, + &machine_cht, + &machine_bsw, + &machine_hsw, + &machine_bdw, + &machine_apl, + &machine_cnl, +}; + +static void usage(char *name) +{ + fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "\t -v enable verbose output\n"); + exit(0); +} + +int main(int argc, char *argv[]) +{ + struct image image; + const char *mach = NULL; + int opt, ret, i, elf_argc = 0; + + memset(&image, 0, sizeof(image)); + + while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:")) != -1) { + switch (opt) { + case 'o': + image.out_file = optarg; + break; + case 'm': + mach = optarg; + break; + case 'v': + image.verbose = 1; + break; + case 's': + image.dump_sections = 1; + break; + case 'a': + image.abi = atoi(optarg); + break; + case 'k': + image.key_name = optarg; + break; + case 'h': + usage(argv[0]); + break; + default: + break; + } + } + + elf_argc = optind; + + /* make sure we have an outfile and machine */ + if (image.out_file == NULL || mach == NULL) + usage(argv[0]); + + + /* find machine */ + for (i = 0; i < ARRAY_SIZE(machine); i++) { + if (!strcmp(mach, machine[i]->name)) { + image.adsp = machine[i]; + goto found; + } + } + fprintf(stderr, "error: machine %s not found\n", mach); + fprintf(stderr, "error: available machines "); + for (i = 0; i < ARRAY_SIZE(machine); i++) + fprintf(stderr, "%s, ", machine[i]->name); + fprintf(stderr, "\n"); + + return -EINVAL; + +found: + + /* parse input ELF files */ + image.num_modules = argc - elf_argc; + for (i = elf_argc; i < argc; i++) { + fprintf(stdout, "\nModule Reading %s\n", argv[i]); + ret = elf_parse_module(&image, i - elf_argc, argv[i]); + if (ret < 0) + goto out; + } + + /* validate all modules */ + ret = elf_validate_modules(&image); + if (ret < 0) + goto out; + + /* open outfile for writing */ + unlink(image.out_file); + image.out_fd = fopen(image.out_file, "w"); + if (image.out_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image.out_file, errno); + ret = -EINVAL; + goto out; + } + + /* process and write output */ + ret = image.adsp->write_firmware(&image); +out: + /* close files */ + if (image.out_fd) + fclose(image.out_fd); + + + return ret; +} diff --git a/rimage/rimage.h b/rimage/rimage.h new file mode 100644 index 000000000000..4e387e9ff72c --- /dev/null +++ b/rimage/rimage.h @@ -0,0 +1,170 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015-2018 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __RIMAGE_H__ +#define __RIMAGE_H__ + +#include +#include +#include + +#include +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#define MAX_MODULES 32 + +struct adsp; +struct manifest; +struct man_module; + +/* list of supported targets */ +enum machine_id { + MACHINE_BAYTRAIL = 0, + MACHINE_CHERRYTRAIL, + MACHINE_BRASWELL, + MACHINE_HASWELL, + MACHINE_BROADWELL, + MACHINE_APOLLOLAKE, + MACHINE_CANNONLAKE, + MACHINE_MAX +}; + +/* + * ELF module data + */ +struct module { + const char *elf_file; + FILE *fd; + + Elf32_Ehdr hdr; + Elf32_Shdr *section; + Elf32_Phdr *prg; + + uint32_t text_start; + uint32_t text_end; + uint32_t data_start; + uint32_t data_end; + uint32_t bss_start; + uint32_t bss_end; + uint32_t foffset; + + int num_sections; + int num_bss; + int fw_size; + int bss_index; + + /* sizes do not include any gaps */ + int bss_size; + int text_size; + int data_size; + + /* sizes do include gaps to nearest page */ + int bss_file_size; + int text_file_size; + int data_file_size; +}; + +/* + * Firmware image context. + */ +struct image { + + const char *out_file; + FILE *out_fd; + void *pos; + + const struct adsp *adsp; + int abi; + int verbose; + int num_modules; + struct module module[MAX_MODULES]; + uint32_t image_end;/* module end, equal to output image size */ + int dump_sections; + + /* SHA 256 */ + const char *key_name; + EVP_MD_CTX *mdctx; + const EVP_MD *md; + + /* file IO */ + void *fw_image; + void *rom_image; + FILE *out_rom_fd; + FILE *out_man_fd; + FILE *out_unsigned_fd; + char out_rom_file[256]; + char out_man_file[256]; + char out_unsigned_file[256]; +}; + +/* + * Audio DSP descriptor and operations. + */ +struct adsp { + const char *name; + uint32_t iram_base; + uint32_t iram_size; + uint32_t dram_base; + uint32_t dram_size; + uint32_t sram_base; + uint32_t sram_size; + uint32_t host_iram_offset; + uint32_t host_dram_offset; + uint32_t rom_base; + uint32_t rom_size; + uint32_t imr_base; + uint32_t imr_size; + + uint32_t image_size; + uint32_t dram_offset; + + enum machine_id machine_id; + int (*write_firmware)(struct image *image); + struct fw_image_manifest *man; + + /* fixups */ + uint32_t base_fw_text_size_fixup; /* added to BASEFW text size */ +}; + +void module_sha256_create(struct image *image); +void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); +void module_sha256_complete(struct image *image, uint8_t *hash); +int ri_manifest_sign(struct image *image); +void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); + +int pkcs_sign(struct image *image, struct fw_image_manifest *man, + void *ptr1, unsigned size1, void *ptr2, unsigned size2); + +int elf_parse_module(struct image *image, int module_index, const char *name); +void elf_free_module(struct image *image, int module_index); +int elf_is_rom(struct image *image, Elf32_Shdr *section); +int elf_validate_modules(struct image *image); +int elf_find_section(struct image *image, struct module *module, + const char *name); +int elf_validate_section(struct image *image, struct module *module, + Elf32_Shdr *section); + +/* supported machines */ +extern const struct adsp machine_byt; +extern const struct adsp machine_cht; +extern const struct adsp machine_bsw; +extern const struct adsp machine_hsw; +extern const struct adsp machine_bdw; +extern const struct adsp machine_apl; +extern const struct adsp machine_cnl; + +#endif From 5f7a3a3a6606cd74a2a4ccd1a0455e75caf05805 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 21 Feb 2018 10:40:42 +0000 Subject: [PATCH 003/350] rimage: elf: validate module sections internally. Make sure we validate all module sections against each other. Signed-off-by: Liam Girdwood --- rimage/elf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 672d6e3997bc..3f00f1da68e3 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -314,9 +314,6 @@ int elf_validate_section(struct image *image, struct module *module, for (i = 0; i < image->num_modules; i++) { m = &image->module[i]; - if (m == module) - continue; - /* for each section */ for (j = 0; j < m->hdr.e_shnum; j++) { s = &m->section[j]; From 3d247c1094c51a8206db46bf7ec63c1ea5c16644 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 22 Feb 2018 15:40:25 +0000 Subject: [PATCH 004/350] rimage: fix elf section collision detection. Section end was not checked. Now fixed. Added more error output to identify. Signed-off-by: Liam Girdwood --- rimage/elf.c | 21 ++++++++++++++------- rimage/rimage.h | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 3f00f1da68e3..b96222b94964 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -303,7 +303,7 @@ static void elf_module_limits(struct image *image, struct module *module) /* make sure no section overlap from any modules */ int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section) + Elf32_Shdr *section, int index) { struct module *m; Elf32_Shdr *s; @@ -322,14 +322,21 @@ int elf_validate_section(struct image *image, struct module *module, continue; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(s->sh_flags & valid)) continue; - if (section->sh_size == 0) + if (s->sh_size == 0) continue; - /* is section non overlapping ? */ + /* is section start non overlapping ? */ if (section->sh_addr >= s->sh_addr && + section->sh_addr < + s->sh_addr + s->sh_size) { + goto err; + } + + /* is section end non overlapping ? */ + if (section->sh_addr + section->sh_size > s->sh_addr && section->sh_addr + section->sh_size <= s->sh_addr + s->sh_size) { goto err; @@ -340,8 +347,8 @@ int elf_validate_section(struct image *image, struct module *module, return 0; err: - fprintf(stderr, "error: section overlap between %s and %s\n", - module->elf_file, m->elf_file); + fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", + module->elf_file, index, m->elf_file, j); fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", section->sh_addr, section->sh_addr + section->sh_size, s->sh_addr, s->sh_addr + s->sh_size); @@ -372,7 +379,7 @@ int elf_validate_modules(struct image *image) continue; /* is section non overlapping ? */ - ret = elf_validate_section(image, module, section); + ret = elf_validate_section(image, module, section, j); if (ret < 0) return ret; } diff --git a/rimage/rimage.h b/rimage/rimage.h index 4e387e9ff72c..adcb8c552d88 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -156,7 +156,7 @@ int elf_validate_modules(struct image *image); int elf_find_section(struct image *image, struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section); + Elf32_Shdr *section, int index); /* supported machines */ extern const struct adsp machine_byt; From c5bd37f42899a2d4576f2d6cf5d585e527c0c76a Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 23 Feb 2018 01:40:19 +0800 Subject: [PATCH 005/350] rimage: add unsigned firmware support Add unsigned firmware support, that can directly use the FW or sign it with other tools. Signed-off-by: Pan Xiuli --- rimage/manifest.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index a4780b780118..2b7e07fd27cf 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -51,6 +51,21 @@ static int man_open_rom_file(struct image *image) return 0; } +static int man_open_unsigned_file(struct image *image) +{ + sprintf(image->out_unsigned_file, "%s.uns", image->out_file); + unlink(image->out_unsigned_file); + + /* open unsigned FW outfile for writing */ + image->out_unsigned_fd = fopen(image->out_unsigned_file, "w"); + if (image->out_unsigned_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_unsigned_file, errno); + } + + return 0; +} + static int man_open_manifest_file(struct image *image) { /* open manifest outfile for writing */ @@ -351,6 +366,39 @@ static int man_module_create(struct image *image, struct module *module, return 0; } +static int man_write_unsigned_mod(struct image *image) +{ + int count; + + /* write metadata file for unsigned FW */ + count = fwrite(image->fw_image + MAN_META_EXT_OFFSET, + sizeof(struct sof_man_adsp_meta_file_ext), 1, + image->out_man_fd); + + /* did the metadata/manifest write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write meta %s %d\n", + image->out_man_file, -errno); + return -errno; + } + fclose(image->out_man_fd); + + /* now prepare the unsigned rimage */ + count = fwrite(image->fw_image + MAN_FW_DESC_OFFSET, + image->image_end - MAN_FW_DESC_OFFSET, + 1, image->out_unsigned_fd); + + /* did the unsigned FW write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write firmware %s %d\n", + image->out_unsigned_file, -errno); + return -errno; + } + fclose(image->out_unsigned_fd); + + return 0; +} + static int man_write_fw_mod(struct image *image) { int count; @@ -400,6 +448,11 @@ static int man_write_fw(struct image *image) if (ret < 0) goto err; + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + /* create the manifest */ ret = man_open_manifest_file(image); if (ret < 0) @@ -477,6 +530,11 @@ static int man_write_fw(struct image *image) if (ret < 0) goto err; + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image); + if (ret < 0) + goto err; + fprintf(stdout, "Firmware manifest and signing completed !\n"); return 0; From 9b0ead72d3115c5de66648917ea402e4654e179c Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 27 Feb 2018 16:35:10 +0000 Subject: [PATCH 006/350] rimage: validate manifest segments make sure no manifest segments collide with each other and fail if they do. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 2b7e07fd27cf..b9848d04dd9e 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -260,6 +260,62 @@ static int man_get_module_manifest(struct image *image, struct module *module, return 0; } +static inline const char *segment_name(int i) +{ + switch (i) { + case SOF_MAN_SEGMENT_TEXT: + return "TEXT"; + case SOF_MAN_SEGMENT_RODATA: + return "DATA"; + case SOF_MAN_SEGMENT_BSS: + return "BSS"; + default: + return "NONE"; + } +} + +/* make sure no segments collide */ +static int man_module_validate(struct sof_man_module *man_module) +{ + uint32_t istart, iend; + uint32_t jstart, jend; + int i, j; + + for (i = 0; i < 3; i++) { + + istart = man_module->segment[i].v_base_addr; + iend = istart + man_module->segment[i].flags.r.length * + MAN_PAGE_SIZE; + + for (j = 0; j < 3; j++) { + + /* don't validate segment against itself */ + if (i == j) + continue; + + jstart = man_module->segment[j].v_base_addr; + jend = jstart + man_module->segment[j].flags.r.length * + MAN_PAGE_SIZE; + + if (jstart > istart && jstart < iend) + goto err; + + if (jend > istart && jend < iend) + goto err; + } + } + + /* success, no overlapping segments */ + return 0; + +err: + fprintf(stderr, "error: segment %s [0x%8.8x:0x%8.8x] overlaps", + segment_name(i), istart, iend); + fprintf(stderr, " with %s [0x%8.8x:0x%8.8x]\n", + segment_name(j), jstart, jend); + return -EINVAL; +} + static int man_module_create(struct image *image, struct module *module, struct sof_man_module *man_module) { @@ -328,6 +384,10 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + /* validate segments */ + if (man_module_validate(man_module) < 0) + return -EINVAL; + /* find all sections and copy to corresponding segments */ for (i = 0; i < module->hdr.e_shnum; i++) { From b54a48d177e38ca742f89c711993b13456890dc7 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 2 Mar 2018 15:55:27 +0800 Subject: [PATCH 007/350] rimage: read the fixup text size form ELF The actual text size will change and the hard code base_fw_text_size_fixup could not fit the changing size. We should get the fixup size from the module info just from the memory mapping. Signed-off-by: Pan Xiuli --- rimage/elf.c | 7 ------- rimage/manifest.c | 17 ++++++++++++++--- rimage/rimage.h | 4 +--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index b96222b94964..78f6d57dca84 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -500,13 +500,6 @@ int elf_parse_module(struct image *image, int module_index, const char *name) if (rem) module->text_file_size += MAN_PAGE_SIZE - rem; - - /* apply any base FW fixups */ - if (image->adsp->base_fw_text_size_fixup && - module->text_start == image->adsp->sram_base) { - module->text_file_size += image->adsp->base_fw_text_size_fixup; - } - /* data section */ module->data_file_size = module->data_end - module->data_start; rem = module->data_file_size % MAN_PAGE_SIZE; diff --git a/rimage/manifest.c b/rimage/manifest.c index b9848d04dd9e..337f82a409f9 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -109,7 +109,7 @@ static uint32_t elf_to_file_offset(struct image *image, } else { /* rodata segment, append to text segment */ file_offset = elf_addr - module->data_start + - module->foffset + module->text_file_size; + module->foffset + module->text_fixup_size; } } else if (section->sh_type == SHT_NOBITS) { @@ -233,6 +233,9 @@ static int man_get_module_manifest(struct image *image, struct module *module, man_module->type.domain_ll = sof_mod.type.domain_ll; man_module->type.load_type = sof_mod.type.load_type; + /* read out text_fixup_size from memory mapping */ + module->text_fixup_size = sof_mod.text_size; + /* text segment */ segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; segment->flags.r.contents = 1; @@ -361,13 +364,22 @@ static int man_module_create(struct image *image, struct module *module, if (module->text_file_size % MAN_PAGE_SIZE) pages += 1; + if (module->text_fixup_size == 0) + module->text_fixup_size = module->text_file_size; + + /* check if text_file_size is bigger then text_fixup_size */ + if (module->text_file_size > module->text_fixup_size) { + fprintf(stderr, "error: too small text size assigned!\n"); + return -EINVAL; + } + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; /* data section */ man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = module->data_start; man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset + module->text_file_size; + module->foffset + module->text_fixup_size; pages = module->data_file_size / MAN_PAGE_SIZE; if (module->data_file_size % MAN_PAGE_SIZE) pages += 1; @@ -627,7 +639,6 @@ const struct adsp machine_apl = { .machine_id = MACHINE_APOLLOLAKE, .write_firmware = man_write_fw, .man = &apl_manifest, - .base_fw_text_size_fixup = 0xa000, }; const struct adsp machine_cnl = { diff --git a/rimage/rimage.h b/rimage/rimage.h index adcb8c552d88..654ba90fca32 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -75,6 +75,7 @@ struct module { /* sizes do include gaps to nearest page */ int bss_file_size; int text_file_size; + int text_fixup_size; int data_file_size; }; @@ -135,9 +136,6 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); struct fw_image_manifest *man; - - /* fixups */ - uint32_t base_fw_text_size_fixup; /* added to BASEFW text size */ }; void module_sha256_create(struct image *image); From 8ce5f8efa6d39b651dee936e3d5a5dee497ec691 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 19 Mar 2018 08:34:52 +0000 Subject: [PATCH 008/350] rimage: manifest: Move text offset into non immutable ROM structure. text_offset was added to an immutable ROM structure that would break some tools and cause instability. Fix this by creating a new structure for rimage manifest data that can be modified without breaking the ROM ABI. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 337f82a409f9..243c194fb636 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -194,7 +194,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, { Elf32_Shdr *section; struct sof_man_segment_desc *segment; - struct sof_man_module sof_mod; + struct sof_man_module_manifest sof_mod; size_t count; int ret, man_section_idx; @@ -224,14 +224,14 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); - man_module->entry_point = sof_mod.entry_point; - memcpy(man_module->name, sof_mod.name, SOF_MAN_MOD_NAME_LEN); - memcpy(man_module->uuid, sof_mod.uuid, 16); - man_module->affinity_mask = sof_mod.affinity_mask; - man_module->type.auto_start = sof_mod.type.auto_start; - man_module->type.domain_dp = sof_mod.type.domain_dp; - man_module->type.domain_ll = sof_mod.type.domain_ll; - man_module->type.load_type = sof_mod.type.load_type; + man_module->entry_point = sof_mod.module.entry_point; + memcpy(man_module->name, sof_mod.module.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod.module.uuid, 16); + man_module->affinity_mask = sof_mod.module.affinity_mask; + man_module->type.auto_start = sof_mod.module.type.auto_start; + man_module->type.domain_dp = sof_mod.module.type.domain_dp; + man_module->type.domain_ll = sof_mod.module.type.domain_ll; + man_module->type.load_type = sof_mod.module.type.load_type; /* read out text_fixup_size from memory mapping */ module->text_fixup_size = sof_mod.text_size; From 273f73fc5cc09bf66aefdaa05e8e0ad23c6a0957 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 30 Mar 2018 14:44:17 +0100 Subject: [PATCH 009/350] cnl: core: Add support for xcc xcc has more strict rules than gcc: - Add missing sections to linker scripts - Fix compile warnings - Extend memory enabling timeout to infinite (too small delay for xcc) Signed-off-by: Tomasz Lauda # Conflicts: # src/platform/apollolake/platform.c # src/platform/cannonlake/platform.c --- rimage/manifest.c | 9 ++++++++- rimage/manifest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 243c194fb636..f3f856004239 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -211,11 +211,18 @@ static int man_get_module_manifest(struct image *image, struct module *module, section = &module->section[man_section_idx]; /* load in manifest data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + /* module built using xcc has preceding bytes */ + if (section->sh_size > sizeof(sof_mod)) + ret = fseek(module->fd, + section->sh_offset + XCC_MOD_OFFSET, SEEK_SET); + else + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); return ret; } + count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); if (count != sizeof(sof_mod)) { fprintf(stderr, "error: can't read section %d\n", -errno); diff --git a/rimage/manifest.h b/rimage/manifest.h index ca951321f3a9..8d1d3d2cae01 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -22,6 +22,9 @@ #define MAN_PAGE_SIZE 4096 +/* start offset for modules built using xcc */ +#define XCC_MOD_OFFSET 0x8 + /* start offset for base FW module */ #define FILE_TEXT_OFFSET 0x8000 From 269a477b63e52206f927415a01976a998355cb13 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 6 Apr 2018 21:16:12 +0100 Subject: [PATCH 010/350] rimage: display ELF section names. Display the name of each ELF section to aid build and debug. Signed-off-by: Liam Girdwood --- rimage/elf.c | 36 +++++++++++++++++++++++++++++++----- rimage/rimage.h | 1 + 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 78f6d57dca84..b1a1861b7a87 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -51,6 +51,29 @@ static int elf_read_sections(struct image *image, struct module *module) return -errno; } + /* read in strings */ + module->strings = calloc(1, section[hdr->e_shstrndx].sh_size); + if (!module->strings) { + fprintf(stderr, "error: failed %s to read ELF strings for %d\n", + module->elf_file, -errno); + return -errno; + } + + ret = fseek(module->fd, section[hdr->e_shstrndx].sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to %s stringss %d\n", + module->elf_file, ret); + return ret; + } + + count = fread(module->strings, 1, section[hdr->e_shstrndx].sh_size, + module->fd); + if (count != section[hdr->e_shstrndx].sh_size) { + fprintf(stderr, "error: failed to read %s strings %d\n", + module->elf_file, -errno); + return -errno; + } + /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".bss"); if (man_section_idx < 0) { @@ -233,7 +256,7 @@ static void elf_module_size(struct image *image, struct module *module, if (module->text_end < section->sh_addr + section->sh_size) module->text_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tTEXT\n"); + fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ if (module->data_start > section->sh_addr) @@ -241,7 +264,7 @@ static void elf_module_size(struct image *image, struct module *module, if (module->data_end < section->sh_addr + section->sh_size) module->data_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tDATA\n"); + fprintf(stdout, "\tDATA\t"); } break; case SHT_NOBITS: @@ -250,9 +273,9 @@ static void elf_module_size(struct image *image, struct module *module, /* updated the .bss segment */ module->bss_start = section->sh_addr; module->bss_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tBSS\n"); + fprintf(stdout, "\tBSS\t"); } else { - fprintf(stdout, "\tHEAP\n"); + fprintf(stdout, "\tHEAP\t"); } break; default: @@ -272,7 +295,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.e_shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\n"); + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.e_shnum; i++) { @@ -296,6 +319,8 @@ static void elf_module_limits(struct image *image, struct module *module) /* text or data section */ elf_module_size(image, module, section, i); + /* section name */ + fprintf(stdout, "%s\n", module->strings + section->sh_name); } fprintf(stdout, "\n"); @@ -528,5 +553,6 @@ void elf_free_module(struct image *image, int module_index) free(module->prg); free(module->section); + free(module->strings); fclose(module->fd); } diff --git a/rimage/rimage.h b/rimage/rimage.h index 654ba90fca32..8b46766d4cdf 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -53,6 +53,7 @@ struct module { Elf32_Ehdr hdr; Elf32_Shdr *section; Elf32_Phdr *prg; + char *strings; uint32_t text_start; uint32_t text_end; From 0f3b39954bf13fad32741bb4694c43349c7c92a3 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sun, 8 Apr 2018 16:32:57 +0100 Subject: [PATCH 011/350] rimage: fix formatting and alignment of manifest section printf Signed-off-by: Liam Girdwood --- rimage/manifest.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index f3f856004239..87f80d7c8719 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -163,7 +163,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, if (end > image->image_end) image->image_end = end; - fprintf(stdout, "\t%d\t0x%x\t0x%x\t0x%x\t%s\n", section_idx, + fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, section->sh_addr, section->sh_size, offset, seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); @@ -349,15 +349,15 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - fprintf(stdout, "\n\tTEXT\t0x%x\t0x%x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%x\t0x%x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%x\t0x%x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); /* main module */ /* text section is first */ @@ -401,7 +401,7 @@ static int man_module_create(struct image *image, struct module *module, pages += 1; man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; - fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); /* validate segments */ if (man_module_validate(man_module) < 0) From 8d8de881f9c501fb9cffc6d4e41aac180eb2d44a Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 12 Apr 2018 21:07:35 +0100 Subject: [PATCH 012/350] rimage: add support to build and sign runtime modules Currently rimage only supports building ELF images with know TEXT, DATA and BSS addresses. This patch adds support to build runtime relocatable modules that can be loaded linked into the base SOF FW at runtime. Signed-off-by: Liam Girdwood --- rimage/elf.c | 72 ++++++++++++++++++++++++++++---- rimage/file_simple.c | 97 +++++++++++++++++++++++++++++++++++++++++++- rimage/manifest.c | 97 +++++++++++++++++++++++++++++++++++++++++++- rimage/rimage.c | 9 +++- rimage/rimage.h | 4 ++ 5 files changed, 266 insertions(+), 13 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index b1a1861b7a87..6c7e3dae3db1 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -283,6 +283,42 @@ static void elf_module_size(struct image *image, struct module *module, } } +static void elf_module_size_reloc(struct image *image, struct module *module, + Elf32_Shdr *section, int index) +{ + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) { + /* text */ + module->text_start = 0; + module->text_end += section->sh_size; + + fprintf(stdout, "\tTEXT\t"); + } else { + /* initialized data, also calc the writable sections */ + module->data_start = 0; + module->data_end += section->sh_size; + + fprintf(stdout, "\tDATA\t"); + } + break; + case SHT_NOBITS: + /* bss */ + if (index == module->bss_index) { + /* updated the .bss segment */ + module->bss_start = section->sh_addr; + module->bss_end = section->sh_addr + section->sh_size; + fprintf(stdout, "\tBSS\t"); + } else { + fprintf(stdout, "\tHEAP\t"); + } + break; + default: + break; + } +} + static void elf_module_limits(struct image *image, struct module *module) { Elf32_Shdr *section; @@ -302,22 +338,29 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; - /* only check valid sections */ - if (!(section->sh_flags & valid)) - continue; + /* module bss can sometimes be missed */ + if (i != module->bss_index) { - if (section->sh_size == 0) - continue; + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; - if (elf_is_rom(image, section)) - continue; + if (section->sh_size == 0) + continue; + + if (elf_is_rom(image, section)) + continue; + } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, section->sh_addr, section->sh_addr + section->sh_size, section->sh_size); /* text or data section */ - elf_module_size(image, module, section, i); + if (image->reloc) + elf_module_size_reloc(image, module, section, i); + else + elf_module_size(image, module, section, i); /* section name */ fprintf(stdout, "%s\n", module->strings + section->sh_name); @@ -388,6 +431,10 @@ int elf_validate_modules(struct image *image) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j, ret; + /* relocatable modules have no physical addresses until runtime */ + if (image->reloc) + return 0; + /* for each module */ for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; @@ -484,6 +531,15 @@ int elf_parse_module(struct image *image, int module_index, const char *name) } module->elf_file = name; + /* get file size */ + ret = fseek(module->fd, 0, SEEK_END); + if (ret < 0) + goto hdr_err; + module->file_size = ftell(module->fd); + ret = fseek(module->fd, 0, SEEK_SET); + if (ret < 0) + goto hdr_err; + /* read in elf header */ ret = elf_read_hdr(image, module); if (ret < 0) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index dcf0d5b241b4..a9f22d046432 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -204,6 +204,98 @@ static int simple_write_module(struct image *image, struct module *module) return 0; } +static int write_block_reloc(struct image *image, struct module *module) +{ + struct snd_sof_blk_hdr block; + size_t count; + void *buffer; + int ret; + + block.size = module->file_size; + block.type = SOF_BLK_DATA; + block.offset = 0; + + /* write header */ + count = fwrite(&block, sizeof(block), 1, image->out_fd); + if (count != 1) + return -errno; + + /* alloc data data */ + buffer = calloc(1, module->file_size); + if (!buffer) + return -ENOMEM; + + /* read in section data */ + ret = fseek(module->fd, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + goto out; + } + count = fread(buffer, 1, module->file_size, module->fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't read section %d\n", -errno); + ret = -errno; + goto out; + } + + /* write out section data */ + count = fwrite(buffer, 1, module->file_size, image->out_fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't write section %d\n", -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + 0, module->file_size, ftell(image->out_fd), + block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + +out: + free(buffer); + return ret; +} + +static int simple_write_module_reloc(struct image *image, struct module *module) +{ + struct snd_sof_mod_hdr hdr; + size_t count; + int i, err; + + hdr.num_blocks = 1; + hdr.size = module->text_size + module->data_size; + hdr.type = SOF_FW_BASE; // module + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); + + err = write_block_reloc(image, module); + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + + fprintf(stdout, "\n"); + return 0; +} + /* used by others */ static int simple_write_firmware(struct image *image) { @@ -235,7 +327,10 @@ static int simple_write_firmware(struct image *image) fprintf(stdout, "writing module %d %s\n", i, module->elf_file); - ret = simple_write_module(image, module); + if (image->reloc) + ret = simple_write_module_reloc(image, module); + else + ret = simple_write_module(image, module); if (ret < 0) { fprintf(stderr, "error: failed to write module %d\n", i); diff --git a/rimage/manifest.c b/rimage/manifest.c index 87f80d7c8719..6bb4ad3f203c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -403,7 +403,6 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - /* validate segments */ if (man_module_validate(man_module) < 0) return -EINVAL; @@ -445,6 +444,96 @@ static int man_module_create(struct image *image, struct module *module, return 0; } +static int man_module_create_reloc(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + /* create module and segments */ + int err; + unsigned int pages; + void *buffer = image->fw_image + module->foffset; + size_t count; + + image->image_end = 0; + + err = man_get_module_manifest(image, module, man_module); + if (err < 0) + return err; + + /* stack size ??? convert sizes to PAGES */ + man_module->instance_bss_size = 1; + + /* max number of instances of this module ?? */ + man_module->instance_max_count = 1; + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + /* main module */ + /* text section is first */ + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = + module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = 0; + + /* data section */ + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = + module->foffset; + pages = module->data_file_size / MAN_PAGE_SIZE; + if (module->data_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + + /* bss is last */ + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = 0; + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); + + /* seek to beginning of file */ + err = fseek(module->fd, 0, SEEK_SET); + if (err < 0) { + fprintf(stderr, "error: can't seek to section %d\n", err); + return err; + } + + count = fread(buffer, 1, module->file_size, module->fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't read section %d\n", -errno); + return -errno; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x\t%s\n", 0, + 0, module->file_size, 0, "DATA"); + + fprintf(stdout, "\n"); + image->image_end = module->foffset + module->file_size; + + /* round module end up to nearest page */ + if (image->image_end % MAN_PAGE_SIZE) { + image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; + image->image_end *= MAN_PAGE_SIZE; + } + + fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length, + image->image_end); + return 0; +} + static int man_write_unsigned_mod(struct image *image) { int count; @@ -555,7 +644,11 @@ static int man_write_fw(struct image *image) module->foffset = image->image_end; } - ret = man_module_create(image, module, man_module); + if (image->reloc) + ret = man_module_create_reloc(image, module, + man_module); + else + ret = man_module_create(image, module, man_module); if (ret < 0) goto err; } diff --git a/rimage/rimage.c b/rimage/rimage.c index 322820b02612..cc0a6101c44d 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -35,8 +35,10 @@ static const struct adsp *machine[] = { static void usage(char *name) { - fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", + name); fprintf(stdout, "\t -v enable verbose output\n"); + fprintf(stdout, "\t -r enable relocatable ELF files\n"); exit(0); } @@ -48,7 +50,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -68,6 +70,9 @@ int main(int argc, char *argv[]) case 'k': image.key_name = optarg; break; + case 'r': + image.reloc = 1; + break; case 'h': usage(argv[0]); break; diff --git a/rimage/rimage.h b/rimage/rimage.h index 8b46766d4cdf..888e7e8e781a 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -78,6 +78,9 @@ struct module { int text_file_size; int text_fixup_size; int data_file_size; + + /* total file size */ + int file_size; }; /* @@ -92,6 +95,7 @@ struct image { const struct adsp *adsp; int abi; int verbose; + int reloc; /* ELF data is relocatable */ int num_modules; struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ From b199485177fa6f55d85b757073832a732523bc82 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Mon, 16 Apr 2018 16:24:30 +0800 Subject: [PATCH 013/350] FIX: Remove unused variable. The variable "i" shouldn't be used. Signed-off-by: Yan Wang --- rimage/file_simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index a9f22d046432..4068734ea1cc 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -259,7 +259,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) { struct snd_sof_mod_hdr hdr; size_t count; - int i, err; + int err; hdr.num_blocks = 1; hdr.size = module->text_size + module->data_size; @@ -288,7 +288,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) err = write_block_reloc(image, module); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", err); return err; } From 8aedb1c3e7aeb3193b48ba8f6354f31435bc6105 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 10 May 2018 21:31:01 +0100 Subject: [PATCH 014/350] rimage: openssl: fix build for openssl 1.1.0 Openssl 1.1.0 is latest stable version with minor API differences. Signed-off-by: Liam Girdwood --- rimage/hash.c | 4 ++-- rimage/pkcs1_5.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index d586e07fc1b6..2905d893d4ae 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -35,7 +35,7 @@ void module_sha256_create(struct image *image) { image->md = EVP_sha256(); - image->mdctx = EVP_MD_CTX_create(); + image->mdctx = EVP_MD_CTX_new(); EVP_DigestInit_ex(image->mdctx, image->md, NULL); } @@ -53,7 +53,7 @@ void module_sha256_complete(struct image *image, uint8_t *hash) int i; #endif EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); - EVP_MD_CTX_destroy(image->mdctx); + EVP_MD_CTX_free(image->mdctx); memcpy(hash, md_value, md_len); #if DEBUG_HASH diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 64a4b250015b..7df531bffdee 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -56,6 +57,7 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, RSA *priv_rsa = NULL; EVP_PKEY *privkey; FILE *fp; + const BIGNUM *n, *e, *d; unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; @@ -114,8 +116,9 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stderr, "error: failed to sign manifest\n"); /* copy public key modulus and exponent to manifest */ - BN_bn2bin(priv_rsa->n, mod); - BN_bn2bin(priv_rsa->e, (unsigned char *)man->css.exponent); + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) From 3530b55759f0c915ba5f950890ec1030de48daa6 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 11 May 2018 15:55:39 +0800 Subject: [PATCH 015/350] rimage: fix wrong error message If keyname can not be open, error message should output keyname insert of tmp path. Signed-off-by: Pan Xiuli --- rimage/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 7df531bffdee..0c91df0391d1 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -82,7 +82,8 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); fp = fopen(image->key_name, "r"); if (fp == NULL) { - fprintf(stderr, "error: can't open file %s %d\n", path, -errno); + fprintf(stderr, "error: can't open file %s %d\n", + image->key_name, -errno); return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL); From 82f6d74ee3b42e62a3003936d707759e982d231a Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 11 May 2018 15:55:40 +0800 Subject: [PATCH 016/350] rimage: add error handler for localtime call Signed-off-by: Pan Xiuli --- rimage/css.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rimage/css.c b/rimage/css.c index bc69cf10b55e..79b5acead7ae 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -32,6 +32,12 @@ void ri_css_hdr_create(struct image *image) /* get local time and date */ gettimeofday(&tv, NULL); date = localtime(&tv.tv_sec); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + date->tm_year += 1900; fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", date->tm_year, date->tm_mon, date->tm_mday); From 82f6bfba4ef87fa56833f3e7b16c4caa3b367659 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Mon, 14 May 2018 14:03:52 +0800 Subject: [PATCH 017/350] rimage: openssl: add compatibility for openssl 1.1.0 Add compatibility support for openssl 1.0.2 support alongsid with openssl 1.1.0 References: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes Compatibility Layer Signed-off-by: Pan Xiuli --- rimage/hash.c | 26 ++++++++++++++++++++++++++ rimage/pkcs1_5.c | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/rimage/hash.c b/rimage/hash.c index 2905d893d4ae..73b6d72dfab2 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -30,6 +30,32 @@ #include "file_format.h" #include "manifest.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +void EVP_MD_CTX_free(EVP_MD_CTX *ctx); +EVP_MD_CTX *EVP_MD_CTX_new(void); + +static void *OPENSSL_zalloc(size_t num) +{ + void *ret = OPENSSL_malloc(num); + + if (ret != NULL) + memset(ret, 0, num); + return ret; +} + +EVP_MD_CTX *EVP_MD_CTX_new(void) +{ + return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); +} + +void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} +#endif + + #define DEBUG_HASH 0 void module_sha256_create(struct image *image) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 0c91df0391d1..d80cf8d57f73 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -30,6 +30,22 @@ #include "css.h" #include "manifest.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, const BIGNUM **d); + +void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) +{ + if (n != NULL) + *n = r->n; + if (e != NULL) + *e = r->e; + if (d != NULL) + *d = r->d; +} +#endif + #define DEBUG_PKCS 0 static void bytes_swap(uint8_t *ptr, uint32_t size) From 220a74308d7fb8661a4186913aedf345235d8c1a Mon Sep 17 00:00:00 2001 From: Marcin Maka Date: Tue, 22 May 2018 17:07:40 +0100 Subject: [PATCH 018/350] Removing unneeded XTOS sections from boot_ldr and main fw. Signed-off-by: Marcin Maka --- rimage/elf.c | 10 +++++++--- rimage/manifest.c | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6c7e3dae3db1..4efed7a02150 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -77,9 +77,12 @@ static int elf_read_sections(struct image *image, struct module *module) /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".bss"); if (man_section_idx < 0) { - return -EINVAL; + /* no bss - it is OK for boot_ldr */ + module->bss_start = 0; + module->bss_end = 0; + } else { + module->bss_index = man_section_idx; } - module->bss_index = man_section_idx; fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); @@ -325,7 +328,8 @@ static void elf_module_limits(struct image *image, struct module *module) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i; - module->text_start = module->data_start = module->bss_start = 0xffffffff; + module->text_start = module->data_start = 0xffffffff; + module->bss_start = 0; module->text_end = module->data_end = module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", diff --git a/rimage/manifest.c b/rimage/manifest.c index 6bb4ad3f203c..257aa0d3ab50 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -400,6 +400,11 @@ static int man_module_create(struct image *image, struct module *module, if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) pages += 1; man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; + if (pages == 0) { + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.ul = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = + SOF_MAN_SEGMENT_EMPTY; + } fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); From d99e6d53c1c60e7a1f1dbe9659de532c6570b933 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Mon, 4 Jun 2018 12:03:41 +0100 Subject: [PATCH 019/350] rimage: add correct FW version to binary Now correct FW version is included into binary. Signed-off-by: Tomasz Lauda --- rimage/man_apl.c | 24 ++++++++++-------------- rimage/man_cnl.c | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 7b32ea1c3887..efe8583738d6 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -15,12 +15,8 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" - -/* hard coded atm - will pass this in from cmd line and git */ -#define MAN_FW_HDR_VERSION_MAJOR 9 -#define MAN_FW_HDR_VERSION_MINOR 22 -#define MAN_FW_HDR_VERSION_HOTFIX 1 -#define MAN_FW_HDR_VERSION_BUILD 0x7da +#include +#include /* manifest template */ struct fw_image_manifest apl_manifest = { @@ -65,10 +61,10 @@ struct fw_image_manifest apl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -134,10 +130,10 @@ struct fw_image_manifest apl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, .load_offset = MAN_DESC_OFFSET, }, }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 2aec2a723d79..5ce8c9d63b84 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -15,12 +15,8 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" - -/* hard coded atm - will pass this in from cmd line and git */ -#define MAN_FW_HDR_VERSION_MAJOR 10 -#define MAN_FW_HDR_VERSION_MINOR 23 -#define MAN_FW_HDR_VERSION_HOTFIX 0 -#define MAN_FW_HDR_VERSION_BUILD 0x2a4 +#include +#include /* manifest template */ struct fw_image_manifest cnl_manifest = { @@ -64,10 +60,10 @@ struct fw_image_manifest cnl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -133,10 +129,10 @@ struct fw_image_manifest cnl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, .load_offset = 0x30000, }, }, From 81eba29a2fcd3a28e0d61aaf448290b74002441c Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Mon, 4 Jun 2018 12:03:42 +0100 Subject: [PATCH 020/350] rimage: add support for automatic MEU signing This patch allows rimage to sign FW binaries using MEU tool. Paths to MEU and private key have to be provided during config step. Signed-off-by: Tomasz Lauda --- rimage/manifest.c | 172 +++++++++++++++++++++++++++++++++++---------- rimage/plat_auth.c | 7 +- rimage/plat_auth.h | 3 +- rimage/rimage.c | 10 ++- rimage/rimage.h | 3 +- 5 files changed, 149 insertions(+), 46 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 257aa0d3ab50..b758717b5348 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -539,12 +539,13 @@ static int man_module_create_reloc(struct image *image, struct module *module, return 0; } -static int man_write_unsigned_mod(struct image *image) +static int man_write_unsigned_mod(struct image *image, int meta_start_offset, + int meta_end_offset) { int count; /* write metadata file for unsigned FW */ - count = fwrite(image->fw_image + MAN_META_EXT_OFFSET, + count = fwrite(image->fw_image + meta_start_offset, sizeof(struct sof_man_adsp_meta_file_ext), 1, image->out_man_fd); @@ -557,8 +558,8 @@ static int man_write_unsigned_mod(struct image *image) fclose(image->out_man_fd); /* now prepare the unsigned rimage */ - count = fwrite(image->fw_image + MAN_FW_DESC_OFFSET, - image->image_end - MAN_FW_DESC_OFFSET, + count = fwrite(image->fw_image + meta_end_offset, + image->image_end - meta_end_offset, 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ @@ -601,13 +602,59 @@ static int man_write_fw_mod(struct image *image) return 0; } +static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) +{ + struct module *module; + struct sof_man_module *man_module; + int err; + int i; + + for (i = 0; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i); + module = &image->module[i]; + + /* set module file offset */ + if (i == 0) + module->foffset = FILE_TEXT_OFFSET; + else + module->foffset = image->image_end; + + if (image->reloc) + err = man_module_create_reloc(image, module, + man_module); + else + err = man_module_create(image, module, man_module); + + if (err < 0) + return err; + } + + return 0; +} + +static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) +{ + struct sof_man_module *man_module; + int i; + + for (i = 0; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i); + + ri_hash(image, + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); + } + + return 0; +} + /* used by others */ static int man_write_fw(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest *m; - struct module *module; - struct sof_man_module *man_module; uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; int ret, i; @@ -637,31 +684,13 @@ static int man_write_fw(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - for (i = 0; i < image->num_modules; i++) { - - man_module = sof_man_get_module(desc, i); - module = &image->module[i]; - - /* set module file offset */ - if (i == 0) { - module->foffset = FILE_TEXT_OFFSET; - } else { - module->foffset = image->image_end; - } - - if (image->reloc) - ret = man_module_create_reloc(image, module, - man_module); - else - ret = man_module_create(image, module, man_module); - if (ret < 0) - goto err; - } + man_create_modules(image, desc); fprintf(stdout, "Firmware completing manifest\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image); + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET, + MAN_FW_DESC_OFFSET); ri_plat_ext_data_create(image); ri_css_hdr_create(image); ri_cse_create(image); @@ -671,16 +700,7 @@ static int man_write_fw(struct image *image) desc->header.preload_page_count); /* calculate hash for each module */ - for (i = 0; i < image->num_modules; i++) { - - module = &image->module[i]; - man_module = sof_man_get_module(desc, i); - - ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); - } + man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end @@ -708,7 +728,8 @@ static int man_write_fw(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET, + MAN_FW_DESC_OFFSET); if (ret < 0) goto err; @@ -723,6 +744,79 @@ static int man_write_fw(struct image *image) return ret; } +/* used to sign with MEU */ +static int man_write_fw_meu(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (image->fw_image == NULL) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* copy data */ + memcpy(meta, &image->adsp->man->adsp_file_ext, + sizeof(struct sof_man_adsp_meta_file_ext)); + memcpy(desc, &image->adsp->man->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_hash(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + #define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_APL_DSP_ROM_SIZE 0x00002000 #define APL_DSP_BASE_ENTRY 0xa000a000 @@ -743,6 +837,7 @@ const struct adsp machine_apl = { .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, .man = &apl_manifest, }; @@ -758,5 +853,6 @@ const struct adsp machine_cnl = { .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, }; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 21c7138cfbb1..2fd62aa0aa5f 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -18,15 +18,16 @@ #include "manifest.h" #include "plat_auth.h" -void ri_adsp_meta_data_create(struct image *image) +void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, + int meta_end_offset) { struct sof_man_adsp_meta_file_ext *meta = - image->fw_image + MAN_META_EXT_OFFSET; + image->fw_image + meta_start_offset; fprintf(stdout, " meta: completing ADSP manifest\n"); meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end - - MAN_FW_DESC_OFFSET; + - meta_end_offset; fprintf(stdout, " meta: limit is 0x%x\n", meta->comp_desc[0].limit_offset); diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index 135f2d1ce07c..253a78bf40a3 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -86,7 +86,8 @@ struct partition_info_ext { (sizeof(struct partition_info_ext) + \ sizeof(struct signed_pkg_info_ext)) -void ri_adsp_meta_data_create(struct image *image); +void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, + int meta_end_offset); void ri_plat_ext_data_create(struct image *image); #endif diff --git a/rimage/rimage.c b/rimage/rimage.c index cc0a6101c44d..e8b9dc8e733f 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -39,6 +39,7 @@ static void usage(char *name) name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); + fprintf(stdout, "\t -s MEU signing offset\n"); exit(0); } @@ -50,7 +51,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:vba:s:k:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -62,7 +63,7 @@ int main(int argc, char *argv[]) image.verbose = 1; break; case 's': - image.dump_sections = 1; + image.meu_offset = atoi(optarg); break; case 'a': image.abi = atoi(optarg); @@ -130,7 +131,10 @@ int main(int argc, char *argv[]) } /* process and write output */ - ret = image.adsp->write_firmware(&image); + if (image.meu_offset) + ret = image.adsp->write_firmware_meu(&image); + else + ret = image.adsp->write_firmware(&image); out: /* close files */ if (image.out_fd) diff --git a/rimage/rimage.h b/rimage/rimage.h index 888e7e8e781a..3398ece5cd13 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -99,7 +99,7 @@ struct image { int num_modules; struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ - int dump_sections; + int meu_offset; /* SHA 256 */ const char *key_name; @@ -140,6 +140,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); + int (*write_firmware_meu)(struct image *image); struct fw_image_manifest *man; }; From c91c6f98c6c0f9330cdcb602ca58fac89168c457 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 29 Jun 2018 15:47:38 +0800 Subject: [PATCH 021/350] rimage: fix function returns address of local variable bug path may return out the function from rimage->key_name. Switch the usage for local variable to avoid this bug. Signed-off-by: Pan Xiuli --- rimage/pkcs1_5.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d80cf8d57f73..9b6598494702 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -90,16 +90,16 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, return -ENOMEM; /* load in RSA private key from PEM file */ - if (image->key_name == NULL) { + if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - image->key_name = path; - } + else + strcpy(path, image->key_name); - fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); - fp = fopen(image->key_name, "r"); + fprintf(stdout, " pkcs: signing with key %s\n", path); + fp = fopen(path, "r"); if (fp == NULL) { fprintf(stderr, "error: can't open file %s %d\n", - image->key_name, -errno); + path, -errno); return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL); From 513c47fd8c25b2830260baf4129b5f328e059a32 Mon Sep 17 00:00:00 2001 From: Zhang Keqiao Date: Mon, 2 Jul 2018 14:00:40 +0800 Subject: [PATCH 022/350] rimage: adding an include for all gcc version build Signed-off-by: Zhang Keqiao --- rimage/pkcs1_5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 9b6598494702..92535942c972 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "config.h" #include "rimage.h" From 4e9ef2347451b66cd80605cb90b3426c7d01c0b3 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 31 Aug 2018 15:19:33 +0200 Subject: [PATCH 023/350] icl: initial support Added icelake platform to platforms. Updated rimage to support icelake. Updated autoconf and automake files. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 24 +++++++++++++++++++++++- rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index b758717b5348..5ea712e8816a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2018, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -12,6 +12,7 @@ * * Author: Liam Girdwood * Keyon Jie + * Janusz Jankowski */ @@ -826,6 +827,11 @@ static int man_write_fw_meu(struct image *image) #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 #define CNL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_ICL_DSP_ROM_SIZE 0x00002000 +#define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define ICL_DSP_HP_BASE_ENTRY 0xbe040000 + /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", @@ -856,3 +862,19 @@ const struct adsp machine_cnl = { .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, }; + +const struct adsp machine_icl = { + .name = "icl", + .rom_base = ADSP_ICL_DSP_ROM_BASE, + .rom_size = ADSP_ICL_DSP_ROM_SIZE, + .imr_base = ICL_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = ICL_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_ICELAKE, + .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, + .man = &cnl_manifest, // use the same as CNL +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index e8b9dc8e733f..f7dd1949f3d0 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -31,6 +31,7 @@ static const struct adsp *machine[] = { &machine_bdw, &machine_apl, &machine_cnl, + &machine_icl, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 3398ece5cd13..f63404242c3c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -40,6 +40,7 @@ enum machine_id { MACHINE_BROADWELL, MACHINE_APOLLOLAKE, MACHINE_CANNONLAKE, + MACHINE_ICELAKE, MACHINE_MAX }; @@ -170,5 +171,6 @@ extern const struct adsp machine_hsw; extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; +extern const struct adsp machine_icl; #endif From fd628ec368cd6f5ed6be0c6abb39f5dd985593b5 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 11 Sep 2018 10:40:53 +0200 Subject: [PATCH 024/350] autoconf: optional implicit-fallthrough Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 5ea712e8816a..dc883cc2faaa 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -143,6 +143,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, break; case SHT_NOBITS: seg_type = SOF_MAN_SEGMENT_BSS; + /* FALLTHRU */ default: return 0; } From 202c655364bf60232fd3df5be24ac8dfdf6fa3a8 Mon Sep 17 00:00:00 2001 From: ArturX Kloniecki Date: Tue, 25 Sep 2018 15:19:25 +0200 Subject: [PATCH 025/350] debugability: rimage: extract .static_log_entries from elf .static_log_entries section is extracted to logs dictionary to remove xtensa toolchain dependency from logs parser. Signed-off-by: ArturX Kloniecki --- rimage/elf.c | 11 ++++++++- rimage/file_format.h | 12 ++++++++++ rimage/file_simple.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ rimage/rimage.c | 20 +++++++++++++++- rimage/rimage.h | 5 ++++ 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 4efed7a02150..6e9bd31a25e3 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -87,6 +87,12 @@ static int elf_read_sections(struct image *image, struct module *module) fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); + /* find log entries section */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); + fprintf(stdout, " static log entries section at index %d\n", + module->logs_index); + /* parse each section */ for (i = 0; i < hdr->e_shnum; i++) { @@ -281,6 +287,9 @@ static void elf_module_size(struct image *image, struct module *module, fprintf(stdout, "\tHEAP\t"); } break; + case SHT_NOTE: + fprintf(stdout, "\tNOTE\t"); + break; default: break; } @@ -343,7 +352,7 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index) { + if (i != module->bss_index && i != module->logs_index) { /* only check valid sections */ if (!(section->sh_flags & valid)) diff --git a/rimage/file_format.h b/rimage/file_format.h index 15302589cc40..ddc07c27a9b2 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -67,6 +67,9 @@ #define SND_SOF_FW_ABI 1 #define SND_SOF_FW_SIG "Reef" +#define SND_SOF_LOGS_SIG_SIZE 4 +#define SND_SOF_LOGS_SIG "Logs" + /* * Firmware module is made up of 1 . N blocks of different types. The * Block header is used to determine where and how block is to be copied in the @@ -114,4 +117,13 @@ struct snd_sof_fw_header { uint32_t abi; /* version of header format */ } __attribute__((packed)); +/* + * Logs dictionary file header. + */ +struct snd_sof_logs_header { + unsigned char sig[SND_SOF_LOGS_SIG_SIZE]; /* "Logs" */ + uint32_t base_address; /* address of log entries section */ + uint32_t data_length; /* amount of bytes following this header */ + uint32_t data_offset; /* offset to first entry in this file */ +}; #endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 4068734ea1cc..13f517a495c6 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -345,6 +345,60 @@ static int simple_write_firmware(struct image *image) return 0; } +int write_logs_dictionary(struct image *image) +{ + struct snd_sof_logs_header header; + int i, ret = 0; + void *buffer = NULL; + + memcpy(header.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE); + header.data_offset = sizeof(struct snd_sof_logs_header); + + for (i = 0; i < image->num_modules; i++) { + struct module *module = &image->module[i]; + + if (module->logs_index > 0) { + Elf32_Shdr *section = &module->section[module->logs_index]; + + header.base_address = section->sh_addr; + header.data_length = section->sh_size; + + fwrite(&header, sizeof(struct snd_sof_logs_header), 1, + image->ldc_out_fd); + + buffer = calloc(1, section->sh_size); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->sh_offset, SEEK_SET); + size_t count = fread(buffer, 1, section->sh_size, + module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't read section %d\n", + -errno); + ret = -errno; + goto out; + } + count = fwrite(buffer, 1, section->sh_size, + image->ldc_out_fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't write section %d\n", + -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "logs dictionary: size %d\n\n", + header.data_length + header.data_offset); + } + } +out: + if (buffer) + free(buffer); + + return ret; +} + const struct adsp machine_byt = { .name = "byt", .iram_base = BYT_IRAM_BASE, diff --git a/rimage/rimage.c b/rimage/rimage.c index f7dd1949f3d0..b67819646a3f 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -41,6 +41,7 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); + fprintf(stdout, "\t -p log dictionary outfile\n"); exit(0); } @@ -52,11 +53,14 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:s:k:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; + case 'p': + image.ldc_out_file = optarg; + break; case 'm': mach = optarg; break; @@ -89,6 +93,8 @@ int main(int argc, char *argv[]) if (image.out_file == NULL || mach == NULL) usage(argv[0]); + if (image.ldc_out_file == NULL) + image.ldc_out_file = "out.ldc"; /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { @@ -136,11 +142,23 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware_meu(&image); else ret = image.adsp->write_firmware(&image); + + unlink(image.ldc_out_file); + image.ldc_out_fd = fopen(image.ldc_out_file, "w"); + if (image.ldc_out_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image.ldc_out_file, errno); + ret = -EINVAL; + goto out; + } + ret = write_logs_dictionary(&image); out: /* close files */ if (image.out_fd) fclose(image.out_fd); + if (image.ldc_out_fd) + fclose(image.ldc_out_fd); return ret; } diff --git a/rimage/rimage.h b/rimage/rimage.h index f63404242c3c..4aeae29d3c5f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -68,6 +68,7 @@ struct module { int num_bss; int fw_size; int bss_index; + int logs_index; /* sizes do not include any gaps */ int bss_size; @@ -90,7 +91,9 @@ struct module { struct image { const char *out_file; + const char *ldc_out_file; FILE *out_fd; + FILE *ldc_out_fd; void *pos; const struct adsp *adsp; @@ -145,6 +148,8 @@ struct adsp { struct fw_image_manifest *man; }; +int write_logs_dictionary(struct image *image); + void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); From 15d5a9545b2bb0b7f74f524a7b6260d05050cad9 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 28 Sep 2018 15:48:29 +0100 Subject: [PATCH 026/350] rimage: add initial support for sue creek. Build tested. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 21 +++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index dc883cc2faaa..d988f16be4c1 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -828,6 +828,11 @@ static int man_write_fw_meu(struct image *image) #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 #define CNL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_SUE_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_SUE_DSP_ROM_SIZE 0x00002000 +#define SUE_DSP_IMR_BASE_ENTRY 0xb0038000 +#define SUE_DSP_HP_BASE_ENTRY 0xbe000000 + #define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_ICL_DSP_ROM_SIZE 0x00002000 #define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 @@ -879,3 +884,19 @@ const struct adsp machine_icl = { .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, // use the same as CNL }; + +const struct adsp machine_sue = { + .name = "sue", + .rom_base = ADSP_SUE_DSP_ROM_BASE, + .rom_size = ADSP_SUE_DSP_ROM_SIZE, + .imr_base = SUE_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = SUE_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_SUECREEK, + .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, + .man = &cnl_manifest, +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index b67819646a3f..e5affadebbac 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -32,6 +32,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_sue, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 4aeae29d3c5f..3ee8940905a1 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -41,6 +41,7 @@ enum machine_id { MACHINE_APOLLOLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, + MACHINE_SUECREEK, MACHINE_MAX }; @@ -177,5 +178,6 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_sue; #endif From 458272942242691dcfffe439c8499982f94139d3 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 15 Oct 2018 13:47:08 +0800 Subject: [PATCH 027/350] rimage: rename the old css_header and fw_image_manifest rename css_header to css_header_v1_8 rename fw_image_manifest to fw_image_manifest_v1_8 Signed-off-by: Zhu Yingjiang --- rimage/css.c | 2 +- rimage/css.h | 4 ++-- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 4 ++-- rimage/manifest.c | 4 ++-- rimage/manifest.h | 10 +++++----- rimage/pkcs1_5.c | 8 ++++---- rimage/rimage.h | 6 +++--- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index 79b5acead7ae..9f5db485e1c1 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -22,7 +22,7 @@ void ri_css_hdr_create(struct image *image) { - struct css_header *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index 0516f531ba9a..b8f39ad9a1da 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -28,7 +28,7 @@ struct image; #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE \ - (sizeof(struct fw_image_manifest) >> 2) + (sizeof(struct fw_image_manifest_v1_8) >> 2) /* * RSA Key and Crypto @@ -44,7 +44,7 @@ struct fw_version { uint16_t build_version; } __attribute__((packed)); -struct css_header { +struct css_header_v1_8 { uint32_t header_type; uint32_t header_len; uint32_t header_version; diff --git a/rimage/man_apl.c b/rimage/man_apl.c index efe8583738d6..2cd998297f3b 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -19,7 +19,7 @@ #include /* manifest template */ -struct fw_image_manifest apl_manifest = { +struct fw_image_manifest_v1_8 apl_manifest = { .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, @@ -36,7 +36,7 @@ struct fw_image_manifest apl_manifest = { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header) + + .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5ce8c9d63b84..6dc37900ec84 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -19,7 +19,7 @@ #include /* manifest template */ -struct fw_image_manifest cnl_manifest = { +struct fw_image_manifest_v1_8 cnl_manifest = { .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, @@ -35,7 +35,7 @@ struct fw_image_manifest cnl_manifest = { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header) + + .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ diff --git a/rimage/manifest.c b/rimage/manifest.c index d988f16be4c1..629be790f941 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -90,7 +90,7 @@ static int man_init_image(struct image *image) return -ENOMEM; memcpy(image->fw_image, image->adsp->man, - sizeof(struct fw_image_manifest)); + sizeof(struct fw_image_manifest_v1_8)); return 0; } @@ -656,7 +656,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) static int man_write_fw(struct image *image) { struct sof_man_fw_desc *desc; - struct fw_image_manifest *m; + struct fw_image_manifest_v1_8 *m; uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; int ret, i; diff --git a/rimage/manifest.h b/rimage/manifest.h index 8d1d3d2cae01..ce3f7fa5a83b 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -46,7 +46,7 @@ #define MAN_SIG_PKG_OFFSET \ (MAN_CSS_HDR_OFFSET + \ - sizeof(struct css_header)) + sizeof(struct css_header_v1_8)) #define MAN_PART_INFO_OFFSET \ (MAN_SIG_PKG_OFFSET + \ @@ -69,11 +69,11 @@ /* * Firmware manifest header. */ -struct fw_image_manifest { +struct fw_image_manifest_v1_8 { /* MEU tool needs these sections to be 0s */ struct CsePartitionDirHeader cse_partition_dir_header; struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; - struct css_header css; + struct css_header_v1_8 css; struct signed_pkg_info_ext signed_pkg; struct partition_info_ext partition_info; uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; @@ -88,6 +88,6 @@ struct fw_image_manifest { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest apl_manifest; -extern struct fw_image_manifest cnl_manifest; +extern struct fw_image_manifest_v1_8 apl_manifest; +extern struct fw_image_manifest_v1_8 cnl_manifest; #endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 92535942c972..ec6b9265226b 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,8 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign(struct image *image, struct fw_image_manifest *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -151,10 +151,10 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, int ri_manifest_sign(struct image *image) { - struct fw_image_manifest *man = image->fw_image; + struct fw_image_manifest_v1_8 *man = image->fw_image; pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header) - + sizeof(struct css_header_v1_8) - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + MAN_RSA_SIGNATURE_LEN), (void *)man + MAN_SIG_PKG_OFFSET, diff --git a/rimage/rimage.h b/rimage/rimage.h index 3ee8940905a1..bd1e03180a61 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -146,7 +146,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); - struct fw_image_manifest *man; + struct fw_image_manifest_v1_8 *man; }; int write_logs_dictionary(struct image *image); @@ -157,8 +157,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash); int ri_manifest_sign(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign(struct image *image, struct fw_image_manifest *man, - void *ptr1, unsigned size1, void *ptr2, unsigned size2); +int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From 2d9af17a90d7be2b2e963f2f04505342065a8e03 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 18 Oct 2018 14:21:04 +0800 Subject: [PATCH 028/350] rimage: modify the API to version 1.8 change the define to 1.8 modify the API name to 1.8 Signed-off-by: Zhu Yingjiang --- rimage/cse.c | 2 +- rimage/css.c | 4 ++-- rimage/css.h | 4 ++-- rimage/man_apl.c | 6 ++--- rimage/man_cnl.c | 6 ++--- rimage/manifest.c | 58 +++++++++++++++++++++++----------------------- rimage/manifest.h | 24 +++++++++---------- rimage/pkcs1_5.c | 20 +++++++++------- rimage/plat_auth.c | 5 ++-- rimage/rimage.h | 9 +++---- 10 files changed, 71 insertions(+), 67 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index b5604153f120..8bc1c30afa47 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -23,7 +23,7 @@ void ri_cse_create(struct image *image) { struct CsePartitionDirHeader *cse_hdr = image->fw_image; struct sof_man_adsp_meta_file_ext *meta = image->fw_image + - MAN_META_EXT_OFFSET; + MAN_META_EXT_OFFSET_V1_8; struct CsePartitionDirEntry *cse_entry = image->fw_image + sizeof(*cse_hdr); uint8_t csum = 0, *val = image->fw_image; diff --git a/rimage/css.c b/rimage/css.c index 9f5db485e1c1..6c87025a0293 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,9 +20,9 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create(struct image *image) +void ri_css_hdr_create_v1_8(struct image *image) { - struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET_V1_8; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index b8f39ad9a1da..eb910d42d3fb 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -27,7 +27,7 @@ struct image; #define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) -#define MAN_CSS_MAN_SIZE \ +#define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) /* @@ -64,6 +64,6 @@ struct css_header_v1_8 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create(struct image *image); +void ri_css_hdr_create_v1_8(struct image *image); #endif diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 2cd998297f3b..201e4361f3d8 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -35,18 +35,18 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, + .offset = MAN_CSS_HDR_OFFSET_V1_8, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET, + .offset = MAN_META_EXT_OFFSET_V1_8, .length = sizeof(struct sof_man_adsp_meta_file_ext), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET, + .offset = MAN_FW_DESC_OFFSET_V1_8, .length = 0, /* calculated by rimage - */ }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 6dc37900ec84..575b260a1857 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -34,18 +34,18 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, + .offset = MAN_CSS_HDR_OFFSET_V1_8, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET, + .offset = MAN_META_EXT_OFFSET_V1_8, .length = sizeof(struct sof_man_adsp_meta_file_ext), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET, + .offset = MAN_FW_DESC_OFFSET_V1_8, .length = 0, /* calculated by rimage - */ }, diff --git a/rimage/manifest.c b/rimage/manifest.c index 629be790f941..f5225628f520 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -82,15 +82,15 @@ static int man_open_manifest_file(struct image *image) return 0; } -static int man_init_image(struct image *image) +static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ image->fw_image = calloc(image->adsp->image_size, 1); if (image->fw_image == NULL) return -ENOMEM; - memcpy(image->fw_image, image->adsp->man, - sizeof(struct fw_image_manifest_v1_8)); + memcpy(image->fw_image, image->adsp->man_v1_8, + sizeof(struct fw_image_manifest_v1_8)); return 0; } @@ -653,7 +653,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) } /* used by others */ -static int man_write_fw(struct image *image) +static int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; @@ -661,7 +661,7 @@ static int man_write_fw(struct image *image) int ret, i; /* init image */ - ret = man_init_image(image); + ret = man_init_image_v1_8(image); if (ret < 0) goto err; @@ -691,10 +691,10 @@ static int man_write_fw(struct image *image) fprintf(stdout, "Firmware completing manifest\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET, - MAN_FW_DESC_OFFSET); + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create(image); + ri_css_hdr_create_v1_8(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -705,11 +705,11 @@ static int man_write_fw(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ - ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end - - MAN_FW_DESC_OFFSET, m->adsp_file_ext.comp_desc[0].hash); + ri_hash(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end + - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_hash(image, MAN_META_EXT_OFFSET, + ri_hash(image, MAN_META_EXT_OFFSET_V1_8, sizeof(struct sof_man_adsp_meta_file_ext), hash); /* hash values in reverse order */ @@ -720,7 +720,7 @@ static int man_write_fw(struct image *image) } /* sign manifest */ - ret = ri_manifest_sign(image); + ret = ri_manifest_sign_v1_8(image); if (ret < 0) goto err; @@ -730,8 +730,8 @@ static int man_write_fw(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET, - MAN_FW_DESC_OFFSET); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); if (ret < 0) goto err; @@ -747,7 +747,7 @@ static int man_write_fw(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu(struct image *image) +static int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; @@ -778,9 +778,9 @@ static int man_write_fw_meu(struct image *image) desc = image->fw_image + MAN_DESC_OFFSET; /* copy data */ - memcpy(meta, &image->adsp->man->adsp_file_ext, + memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, sizeof(struct sof_man_adsp_meta_file_ext)); - memcpy(desc, &image->adsp->man->desc, + memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); /* create each module */ @@ -848,9 +848,9 @@ const struct adsp machine_apl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &apl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &apl_manifest, }; const struct adsp machine_cnl = { @@ -864,9 +864,9 @@ const struct adsp machine_cnl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, }; const struct adsp machine_icl = { @@ -880,9 +880,9 @@ const struct adsp machine_icl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, // use the same as CNL + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL }; const struct adsp machine_sue = { @@ -896,7 +896,7 @@ const struct adsp machine_sue = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, }; diff --git a/rimage/manifest.h b/rimage/manifest.h index ce3f7fa5a83b..da03d9a71345 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -39,32 +39,32 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET 0x2000 -#define MAN_CSS_HDR_OFFSET \ +#define MAN_CSS_HDR_OFFSET_V1_8 \ (MAN_CSE_HDR_OFFSET + \ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) -#define MAN_SIG_PKG_OFFSET \ - (MAN_CSS_HDR_OFFSET + \ +#define MAN_SIG_PKG_OFFSET_V1_8 \ + (MAN_CSS_HDR_OFFSET_V1_8 + \ sizeof(struct css_header_v1_8)) -#define MAN_PART_INFO_OFFSET \ - (MAN_SIG_PKG_OFFSET + \ +#define MAN_PART_INFO_OFFSET_V1_8 \ + (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) -#define MAN_META_EXT_OFFSET \ - (MAN_SIG_PKG_OFFSET + \ +#define MAN_META_EXT_OFFSET_V1_8 \ + (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext) + \ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) -#define MAN_FW_DESC_OFFSET \ - (MAN_META_EXT_OFFSET + \ +#define MAN_FW_DESC_OFFSET_V1_8 \ + (MAN_META_EXT_OFFSET_V1_8 + \ sizeof(struct sof_man_adsp_meta_file_ext) + \ MAN_EXT_PADDING) -#define MAN_DESC_PADDING_SIZE \ - (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET) +#define MAN_DESC_PADDING_SIZE_V1_8 \ + (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) /* * Firmware manifest header. @@ -83,7 +83,7 @@ struct fw_image_manifest_v1_8 { uint8_t reserved[MAN_EXT_PADDING]; /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ - uint8_t padding[MAN_DESC_PADDING_SIZE]; + uint8_t padding[MAN_DESC_PADDING_SIZE_V1_8]; struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index ec6b9265226b..1483f0e6e388 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,9 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -149,15 +150,16 @@ int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, return ret; } -int ri_manifest_sign(struct image *image) +int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET, - (man->css.size - man->css.header_len) * sizeof(uint32_t)); + pkcs_sign_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET_V1_8, + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET_V1_8, + (man->css.size - man->css.header_len) + * sizeof(uint32_t)); return 0; } diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 2fd62aa0aa5f..48484bfd1959 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -36,9 +36,10 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, void ri_plat_ext_data_create(struct image *image) { - struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET; + struct partition_info_ext *part = image->fw_image + + MAN_PART_INFO_OFFSET_V1_8; struct sof_man_adsp_meta_file_ext *meta = - image->fw_image + MAN_META_EXT_OFFSET; + image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; fprintf(stdout, " auth: completing authentication manifest\n"); diff --git a/rimage/rimage.h b/rimage/rimage.h index bd1e03180a61..b3ca3bbe73d5 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -146,7 +146,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); - struct fw_image_manifest_v1_8 *man; + struct fw_image_manifest_v1_8 *man_v1_8; }; int write_logs_dictionary(struct image *image); @@ -154,11 +154,12 @@ int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); -int ri_manifest_sign(struct image *image); +int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From 75b6586f99d3e5fe32443817718fcd0900fd0b05 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 18 Oct 2018 14:39:36 +0800 Subject: [PATCH 029/350] rimage: add firmware 1.5 manifest header add manifest for skylake/kabylake, version 1.5 Signed-off-by: Zhu Yingjiang --- rimage/css.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rimage/css.h b/rimage/css.h index eb910d42d3fb..77597d1272d1 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -64,6 +64,23 @@ struct css_header_v1_8 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); +struct css_header_v1_5 { + uint32_t module_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x0 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint32_t key_size; + uint32_t modulus_size; + uint32_t exponent_size; + uint32_t reserved[22]; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN]; +} __attribute__((packed)); + void ri_css_hdr_create_v1_8(struct image *image); #endif From dd81092b6e0c001c02e1c8e7bd5650c84955795d Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 15 Oct 2018 14:21:38 +0800 Subject: [PATCH 030/350] rimage: add firmware 1.5 manifest binary descryptor add the 1.5 version manifest, for skylake and kabylake Signed-off-by: Zhu Yingjiang --- rimage/manifest.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rimage/manifest.h b/rimage/manifest.h index da03d9a71345..418d96d64cb7 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -90,4 +90,11 @@ struct fw_image_manifest_v1_8 { extern struct fw_image_manifest_v1_8 apl_manifest; extern struct fw_image_manifest_v1_8 cnl_manifest; + +struct fw_image_manifest_v1_5 { + struct css_header_v1_5 header; + struct sof_man_fw_desc adsp_fw_bin_desc; +} __attribute__((packed)); + +extern struct fw_image_manifest_v1_5 skl_manifest; #endif From f76b24ba0a368681dd567e530ae02729bbffbdd5 Mon Sep 17 00:00:00 2001 From: ArturX Kloniecki Date: Mon, 29 Oct 2018 12:55:23 +0100 Subject: [PATCH 031/350] rimage: debugability: include fw_version in .ldc file Extract fw_version from fw_ready section of elf and include it in header of .ldc file to allow verification by sof-logger. Signed-off-by: ArturX Kloniecki --- rimage/elf.c | 13 +++++++++---- rimage/file_format.h | 5 +++++ rimage/file_simple.c | 38 ++++++++++++++++++++++++++++++++++++-- rimage/rimage.h | 1 + 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6e9bd31a25e3..e2c6e8ff8257 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -87,11 +87,15 @@ static int elf_read_sections(struct image *image, struct module *module) fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); - /* find log entries section */ - module->logs_index = elf_find_section(image, module, - ".static_log_entries"); + /* find log entries and fw ready sections */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); fprintf(stdout, " static log entries section at index %d\n", module->logs_index); + module->fw_ready_index = elf_find_section(image, module, + ".fw_ready"); + fprintf(stdout, " fw ready section at index %d\n", + module->fw_ready_index); /* parse each section */ for (i = 0; i < hdr->e_shnum; i++) { @@ -352,7 +356,8 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index && i != module->logs_index) { + if (i != module->bss_index && i != module->logs_index && + i != module->fw_ready_index) { /* only check valid sections */ if (!(section->sh_flags & valid)) diff --git a/rimage/file_format.h b/rimage/file_format.h index ddc07c27a9b2..935df3dc7923 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,6 +63,10 @@ #ifndef __INCLUDE_UAPI_SOF_FW_H__ #define __INCLUDE_UAPI_SOF_FW_H__ +/* Skip inclusion of which causes errors */ +#define __INCLUDE_IO__ +#include + #define SND_SOF_FW_SIG_SIZE 4 #define SND_SOF_FW_ABI 1 #define SND_SOF_FW_SIG "Reef" @@ -125,5 +129,6 @@ struct snd_sof_logs_header { uint32_t base_address; /* address of log entries section */ uint32_t data_length; /* amount of bytes following this header */ uint32_t data_offset; /* offset to first entry in this file */ + struct sof_ipc_fw_version version; }; #endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 13f517a495c6..c88676c4e5cf 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -357,6 +357,37 @@ int write_logs_dictionary(struct image *image) for (i = 0; i < image->num_modules; i++) { struct module *module = &image->module[i]; + /* extract fw_version from fw_ready message located + * in .fw_ready section + */ + if (module->fw_ready_index > 0) { + Elf32_Shdr *section = + &module->section[module->fw_ready_index]; + + buffer = calloc(1, sizeof(struct sof_ipc_fw_ready)); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->sh_offset, SEEK_SET); + size_t count = fread(buffer, 1, + sizeof(struct sof_ipc_fw_ready), module->fd); + + if (count != sizeof(struct sof_ipc_fw_ready)) { + fprintf(stderr, + "error: can't read ready section %d\n", + -errno); + ret = -errno; + goto out; + } + + memcpy(&header.version, + &((struct sof_ipc_fw_ready *)buffer)->version, + sizeof(header.version)); + + free(buffer); + buffer = NULL; + } + if (module->logs_index > 0) { Elf32_Shdr *section = &module->section[module->logs_index]; @@ -374,7 +405,8 @@ int write_logs_dictionary(struct image *image) size_t count = fread(buffer, 1, section->sh_size, module->fd); if (count != section->sh_size) { - fprintf(stderr, "error: can't read section %d\n", + fprintf(stderr, + "error: can't read logs section %d\n", -errno); ret = -errno; goto out; @@ -388,8 +420,10 @@ int write_logs_dictionary(struct image *image) goto out; } - fprintf(stdout, "logs dictionary: size %d\n\n", + fprintf(stdout, "logs dictionary: size %u\n", header.data_length + header.data_offset); + fprintf(stdout, "including fw version of size: %lu\n\n", + sizeof(header.version)); } } out: diff --git a/rimage/rimage.h b/rimage/rimage.h index b3ca3bbe73d5..6752005a0e1c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -70,6 +70,7 @@ struct module { int fw_size; int bss_index; int logs_index; + int fw_ready_index; /* sizes do not include any gaps */ int bss_size; From fb5e8ac792fb8b25ae10b01147c7cb20d5831bb9 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:19:49 +0800 Subject: [PATCH 032/350] rimage: manifest: rename old manifest to 1.8 rename old API and comments print info to 1.8, as for add 1.5 manifest. Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 4 ++-- rimage/manifest.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index f5225628f520..8e9e8359006c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -688,7 +688,7 @@ static int man_write_fw_v1_8(struct image *image) m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc); - fprintf(stdout, "Firmware completing manifest\n"); + fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, @@ -787,7 +787,7 @@ static int man_write_fw_meu_v1_8(struct image *image) desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc); - fprintf(stdout, "Firmware completing manifest\n"); + fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); diff --git a/rimage/manifest.h b/rimage/manifest.h index 418d96d64cb7..29f598fcc65f 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -67,7 +67,7 @@ (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) /* - * Firmware manifest header. + * Firmware manifest header V1.8 used on APL onwards */ struct fw_image_manifest_v1_8 { /* MEU tool needs these sections to be 0s */ From 75533a65b5cf39fbe9f28e6080696b30e99ba2b6 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:31:43 +0800 Subject: [PATCH 033/350] rimage: manifest: add 1.5 manifest define add 1.5 manifest structure define, macro define, KBL and SKL 1.5 manifest defines Signed-off-by: Zhu Yingjiang --- rimage/css.h | 3 +++ rimage/man_kbl.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.h | 8 +++++-- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 rimage/man_kbl.c diff --git a/rimage/css.h b/rimage/css.h index 77597d1272d1..13135c55edbb 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -18,6 +18,7 @@ struct image; +#define MAN_CSS_LT_MODULE_TYPE 0x00000006 #define MAN_CSS_MOD_TYPE 4 #define MAN_CSS_HDR_SIZE 161 /* in words */ #define MAN_CSS_HDR_VERSION 0x10000 @@ -29,6 +30,8 @@ struct image; #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) +#define MAN_CSS_MAN_SIZE_V1_5 \ + (sizeof(struct fw_image_manifest_v1_5) >> 2) /* * RSA Key and Crypto diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c new file mode 100644 index 000000000000..5e614f5514f7 --- /dev/null +++ b/rimage/man_kbl.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include +#include + +#define KBL_HARDWARE_BUFFER_BASE 0xBE500000 +#define KBL_HARDWARE_BUFFER_LEN 0x4A000 + +/* manifest template */ +struct fw_image_manifest_v1_5 kbl_manifest = { + .css_header = { + .module_type = MAN_CSS_LT_MODULE_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 0x800, + .key_size = MAN_CSS_KEY_SIZE, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + /* size in pages from $CPD */ + .preload_page_count = 0, + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0, + .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, + .hw_buf_length = KBL_HARDWARE_BUFFER_LEN + }, + }, +}; diff --git a/rimage/manifest.h b/rimage/manifest.h index 29f598fcc65f..4c53a69a0e04 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -91,10 +91,14 @@ struct fw_image_manifest_v1_8 { extern struct fw_image_manifest_v1_8 apl_manifest; extern struct fw_image_manifest_v1_8 cnl_manifest; +/* + * Firmware manifest header V1.5 used on SKL and KBL + */ struct fw_image_manifest_v1_5 { - struct css_header_v1_5 header; - struct sof_man_fw_desc adsp_fw_bin_desc; + struct css_header_v1_5 css_header; + struct sof_man_fw_desc desc; } __attribute__((packed)); extern struct fw_image_manifest_v1_5 skl_manifest; +extern struct fw_image_manifest_v1_5 kbl_manifest; #endif From 91b917916fa3aa7cb447b54b0656b0d4c7b72263 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:43:16 +0800 Subject: [PATCH 034/350] rimage: manifest: add manifest APIs add the 1.5 manifest operation APIs Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 8e9e8359006c..8f87aeb21323 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -82,6 +82,19 @@ static int man_open_manifest_file(struct image *image) return 0; } +static int man_init_image_v1_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_v1_5, + sizeof(struct fw_image_manifest_v1_5)); + + return 0; +} + static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ @@ -652,6 +665,84 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) return 0; } +/* used by others */ +static int man_write_fw_v1_5(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest_v1_5 *m; + int ret; + + /* init image */ + ret = man_init_image_v1_5(image); + if (ret < 0) + goto err; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); + ri_plat_ext_data_create(image); + ri_css_hdr_create_v1_8(image); + ri_cse_create(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* sign manifest */ + ret = ri_manifest_sign_v1_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + /* used by others */ static int man_write_fw_v1_8(struct image *image) { @@ -746,6 +837,77 @@ static int man_write_fw_v1_8(struct image *image) return ret; } +/* used to sign with MEU */ +static int man_write_fw_meu_v1_5(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* copy data */ + memcpy(desc, &image->adsp->man_v1_5->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_hash(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + /* used to sign with MEU */ static int man_write_fw_meu_v1_8(struct image *image) { From 641fab27c768dd7612ce357949de03618cd6950f Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:52:21 +0800 Subject: [PATCH 035/350] rimage: add 1.5 rimage defines add 1.5 rimage defines for skl and kbl Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 28 ++++++++++++++++++++++++++++ rimage/rimage.c | 2 ++ rimage/rimage.h | 6 ++++++ 3 files changed, 36 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 8f87aeb21323..6e7ff9bbe371 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1015,6 +1015,34 @@ const struct adsp machine_apl = { .man_v1_8 = &apl_manifest, }; +const struct adsp machine_kbl = { + .name = "kbl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_KABYLAKE, + .write_firmware = man_write_fw_v1_5, + .write_firmware_meu = man_write_fw_meu_v1_5, + .man_v1_5 = &kbl_manifest, +}; + +const struct adsp machine_skl = { + .name = "skl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_SKYLAKE, + .write_firmware = man_write_fw_v1_5, + .write_firmware_meu = man_write_fw_meu_v1_5, + .man_v1_5 = &kbl_manifest, +}; + const struct adsp machine_cnl = { .name = "cnl", .rom_base = ADSP_CNL_DSP_ROM_BASE, diff --git a/rimage/rimage.c b/rimage/rimage.c index e5affadebbac..ae0299b707aa 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -33,6 +33,8 @@ static const struct adsp *machine[] = { &machine_cnl, &machine_icl, &machine_sue, + &machine_kbl, + &machine_skl, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 6752005a0e1c..f843992ca251 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -39,6 +39,8 @@ enum machine_id { MACHINE_HASWELL, MACHINE_BROADWELL, MACHINE_APOLLOLAKE, + MACHINE_KABYLAKE, + MACHINE_SKYLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, MACHINE_SUECREEK, @@ -148,6 +150,7 @@ struct adsp { int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); struct fw_image_manifest_v1_8 *man_v1_8; + struct fw_image_manifest_v1_5 *man_v1_5; }; int write_logs_dictionary(struct image *image); @@ -181,5 +184,8 @@ extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; extern const struct adsp machine_sue; +extern const struct adsp machine_skl; +extern const struct adsp machine_kbl; + #endif From ccdfa7972d8da9d489720fbaebc39eee84ef6ce8 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:57:47 +0800 Subject: [PATCH 036/350] rimage: add 1.5 rimage package API add API for making 1.5 rimage binary Signed-off-by: Zhu Yingjiang --- rimage/pkcs1_5.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++ rimage/rimage.h | 3 ++ 2 files changed, 103 insertions(+) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 1483f0e6e388..d78210968810 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,6 +68,97 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ +int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + + const BIGNUM *n, *e, *d; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + if (!image->key_name) + sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); + else + strcpy(path, image->key_name); + + fprintf(stdout, " pkcs: signing with key %s\n", path); + fp = fopen(path, "r"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha256_update(image, ptr1, size1); + module_sha256_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css_header.signature, + &siglen, priv_rsa); + if (ret < 0) + fprintf(stderr, "error: failed to sign manifest\n"); + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css_header.exponent); + + /* modulus is reveresd */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) + man->css_header.modulus[i] + = mod[MAN_RSA_KEY_MODULUS_LEN - (1 + i)]; + + /* signature is reveresd, swap it */ + bytes_swap(man->css_header.signature, + sizeof(man->css_header.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) @@ -150,6 +241,15 @@ int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, return ret; } +int ri_manifest_sign_v1_5(struct image *image) +{ + struct fw_image_manifest_v1_5 *man = image->fw_image; + + pkcs_sign_v1_5(image, man, (void *)man + MAN_CSS_MAN_SIZE_V1_5, + image->image_end - sizeof(*man)); + return 0; +} + int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; diff --git a/rimage/rimage.h b/rimage/rimage.h index f843992ca251..a1c7d464832e 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -158,9 +158,12 @@ int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); +int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); +int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); From 5674674a48163351d5377cb0f5e2595065d3f806 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 17:11:46 +0800 Subject: [PATCH 037/350] rimage: add build scripts to build 1.5 image add to build scripts and Makefiles to build firmware binary for kbl and skl Signed-off-by: Zhu Yingjiang --- rimage/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/Makefile.am b/rimage/Makefile.am index 467bfe638b50..fb0bf700da6d 100644 --- a/rimage/Makefile.am +++ b/rimage/Makefile.am @@ -14,6 +14,7 @@ rimage_SOURCES = \ file_simple.c \ man_apl.c \ man_cnl.c \ + man_kbl.c \ cse.c \ css.c \ plat_auth.c \ From 864cc7ef4d4b4a879de157155949f75434837bfd Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 8 Nov 2018 18:30:03 +0800 Subject: [PATCH 038/350] change the 1.8 and 1.5 header defines add comments and change the 1.5 1.8 header defines Signed-off-by: Zhu Yingjiang --- rimage/css.c | 4 ++-- rimage/css.h | 2 +- rimage/man_apl.c | 2 +- rimage/man_cnl.c | 2 +- rimage/man_kbl.c | 7 ++++++- rimage/manifest.c | 32 ++++++++++++++++++-------------- rimage/manifest.h | 23 +++++++++++++++++++++-- rimage/pkcs1_5.c | 32 ++++++++++++++++++-------------- rimage/rimage.h | 12 +++++++----- 9 files changed, 75 insertions(+), 41 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index 6c87025a0293..9f5db485e1c1 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,9 +20,9 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create_v1_8(struct image *image) +void ri_css_hdr_create(struct image *image) { - struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET_V1_8; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index 13135c55edbb..b87d613dcf3f 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -84,6 +84,6 @@ struct css_header_v1_5 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create_v1_8(struct image *image); +void ri_css_hdr_create(struct image *image); #endif diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 201e4361f3d8..7ad330f6cf02 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -35,7 +35,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET_V1_8, + .offset = MAN_CSS_HDR_OFFSET, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 575b260a1857..64d6424b01db 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -34,7 +34,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET_V1_8, + .offset = MAN_CSS_HDR_OFFSET, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 5e614f5514f7..4d5f5464dfe4 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2018, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -18,6 +18,11 @@ #include #include +/* + * TODO: check if all platform for 1.5 are the same base and length. + * if yes, define it as HARDWARE_BUFFER_BASE_V1_5, HARDWARE_BUFFER_LEN_v1_5 + * if not, define a platform specific base and length. + */ #define KBL_HARDWARE_BUFFER_BASE 0xBE500000 #define KBL_HARDWARE_BUFFER_LEN 0x4A000 diff --git a/rimage/manifest.c b/rimage/manifest.c index 6e7ff9bbe371..49dc36a78ff2 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -703,11 +703,7 @@ static int man_write_fw_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); - ri_plat_ext_data_create(image); - ri_css_hdr_create_v1_8(image); - ri_cse_create(image); + ri_css_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, @@ -727,8 +723,8 @@ static int man_write_fw_v1_5(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_5, + MAN_FW_DESC_OFFSET_V1_5); if (ret < 0) goto err; @@ -785,7 +781,7 @@ static int man_write_fw_v1_8(struct image *image) ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create_v1_8(image); + ri_css_hdr_create(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -985,6 +981,14 @@ static int man_write_fw_meu_v1_8(struct image *image) #define ADSP_APL_DSP_ROM_SIZE 0x00002000 #define APL_DSP_BASE_ENTRY 0xa000a000 +#define ADSP_KBL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_KBL_DSP_ROM_SIZE 0x00002000 +#define KBL_DSP_BASE_ENTRY 0xa000a000 + +#define ADSP_SKL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_SKL_DSP_ROM_SIZE 0x00002000 +#define SKL_DSP_BASE_ENTRY 0xa000a000 + #define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_CNL_DSP_ROM_SIZE 0x00002000 #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 @@ -1017,9 +1021,9 @@ const struct adsp machine_apl = { const struct adsp machine_kbl = { .name = "kbl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, + .rom_base = ADSP_KBL_DSP_ROM_BASE, + .rom_size = ADSP_KBL_DSP_ROM_SIZE, + .sram_base = KBL_DSP_BASE_ENTRY, .sram_size = 0x100000, .image_size = 0x100000, .dram_offset = 0, @@ -1031,9 +1035,9 @@ const struct adsp machine_kbl = { const struct adsp machine_skl = { .name = "skl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, + .rom_base = ADSP_SKL_DSP_ROM_BASE, + .rom_size = ADSP_SKL_DSP_ROM_SIZE, + .sram_base = SKL_DSP_BASE_ENTRY, .sram_size = 0x100000, .image_size = 0x100000, .dram_offset = 0, diff --git a/rimage/manifest.h b/rimage/manifest.h index 4c53a69a0e04..c57bcb0ebc2c 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -39,13 +39,13 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET 0x2000 -#define MAN_CSS_HDR_OFFSET_V1_8 \ +#define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) #define MAN_SIG_PKG_OFFSET_V1_8 \ - (MAN_CSS_HDR_OFFSET_V1_8 + \ + (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) #define MAN_PART_INFO_OFFSET_V1_8 \ @@ -66,6 +66,21 @@ #define MAN_DESC_PADDING_SIZE_V1_8 \ (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) +#define MAN_SIG_PKG_OFFSET_V1_5 \ + (MAN_CSS_HDR_OFFSET + \ + sizeof(struct css_header_v1_5)) + +#define MAN_META_EXT_OFFSET_V1_5 \ + (MAN_SIG_PKG_OFFSET_V1_5 + \ + sizeof(struct signed_pkg_info_ext) + \ + sizeof(struct partition_info_ext) + \ + MAN_CSE_PADDING_SIZE) + +#define MAN_FW_DESC_OFFSET_V1_5 \ + (MAN_META_EXT_OFFSET_V1_5 + \ + sizeof(struct sof_man_adsp_meta_file_ext) + \ + MAN_EXT_PADDING) + /* * Firmware manifest header V1.8 used on APL onwards */ @@ -99,6 +114,10 @@ struct fw_image_manifest_v1_5 { struct sof_man_fw_desc desc; } __attribute__((packed)); +/* + * TODO: verify if we need platform specific manifest, or just + * define manifest_v1_5 and manifest_v1_8. + */ extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; #endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d78210968810..309d3b472888 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,9 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1) +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -159,9 +160,10 @@ int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) +int pkcs_v1_5_sign_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -245,8 +247,9 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - pkcs_sign_v1_5(image, man, (void *)man + MAN_CSS_MAN_SIZE_V1_5, - image->image_end - sizeof(*man)); + pkcs_v1_5_sign_man_v1_5(image, man, + (void *)man + MAN_CSS_MAN_SIZE_V1_5, + image->image_end - sizeof(*man)); return 0; } @@ -254,12 +257,13 @@ int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_sign_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET_V1_8, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET_V1_8, - (man->css.size - man->css.header_len) - * sizeof(uint32_t)); + pkcs_v1_5_sign_man_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET, + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET_V1_8, + (man->css.size - man->css.header_len) + * sizeof(uint32_t)); return 0; } diff --git a/rimage/rimage.h b/rimage/rimage.h index a1c7d464832e..a9a161cdc9fe 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -162,11 +162,13 @@ int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1); -int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2); +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); +int pkcs_v1_5_sign_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From f5711ff689647e55b2ad5633f81980647bb06c6b Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 5 Nov 2018 21:42:58 +0000 Subject: [PATCH 039/350] uapi: split ipc.h and abi.h into small files. Split the larger ABI files into smaller more manageable chunks. Also split by end user into IPC and user space ABIs. Signed-off-by: Liam Girdwood --- rimage/file_format.h | 4 +--- rimage/manifest.c | 3 ++- rimage/manifest.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 935df3dc7923..58e5b117d312 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,9 +63,7 @@ #ifndef __INCLUDE_UAPI_SOF_FW_H__ #define __INCLUDE_UAPI_SOF_FW_H__ -/* Skip inclusion of which causes errors */ -#define __INCLUDE_IO__ -#include +#include #define SND_SOF_FW_SIG_SIZE 4 #define SND_SOF_FW_ABI 1 diff --git a/rimage/manifest.c b/rimage/manifest.c index 49dc36a78ff2..9837ac1b932a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -24,7 +24,8 @@ #include #include -#include "uapi/manifest.h" +#include + #include "rimage.h" #include "file_format.h" #include "css.h" diff --git a/rimage/manifest.h b/rimage/manifest.h index c57bcb0ebc2c..072b5a05a6a9 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define __MANIFEST_H__ #include -#include "uapi/manifest.h" +#include #include "css.h" #include "cse.h" #include "plat_auth.h" From 2a7f0c0de43770c3c049b17610fe687c1be41cc9 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Wed, 28 Nov 2018 12:35:57 +0100 Subject: [PATCH 040/350] rimage: fix possible buffer overflow Fixes possible buffer overflow with strcpy. Signed-off-by: Tomasz Lauda --- rimage/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 309d3b472888..a6f8fbf545e3 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -97,7 +97,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); else - strcpy(path, image->key_name); + strncpy(path, image->key_name, 256); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "r"); From 6847abad748582bc8bad74c82e82088e1e905aa1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 24 Nov 2018 15:33:59 +0000 Subject: [PATCH 041/350] rimage: make sure cavs1.5 manifest uses correct file offsets. cavs1.5 manifest file structure and offsets are different than cavs version 1.8 Signed-off-by: Liam Girdwood --- rimage/cse.c | 4 ++-- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 2 +- rimage/manifest.c | 29 +++++++++++++++-------------- rimage/manifest.h | 8 +++++--- rimage/plat_auth.c | 8 ++++---- 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index 8bc1c30afa47..cdfbc87e6088 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -29,10 +29,10 @@ void ri_cse_create(struct image *image) uint8_t csum = 0, *val = image->fw_image; int i, size; - fprintf(stdout, " cse: completing CSE manifest\n"); + fprintf(stdout, " cse: completing CSE V1.8 manifest\n"); cse_entry[2].length = meta->comp_desc[0].limit_offset - - MAN_DESC_OFFSET; + MAN_DESC_OFFSET_V1_8; /* calculate checksum using BSD algo */ size = sizeof(*cse_hdr) + sizeof(*cse_entry) * MAN_CSE_PARTS; diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 7ad330f6cf02..76082dd9111f 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -114,7 +114,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .imr_type = 3, .comp_desc[0] = { .version = 0, - .base_offset = MAN_DESC_OFFSET, + .base_offset = MAN_DESC_OFFSET_V1_8, .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ }, @@ -134,7 +134,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .minor_version = SOF_MINOR, .hotfix_version = 0, .build_version = SOF_BUILD, - .load_offset = MAN_DESC_OFFSET, + .load_offset = MAN_DESC_OFFSET_V1_8, }, }, }; diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 64d6424b01db..5e3480d1ef3d 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -113,7 +113,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .imr_type = 3, .comp_desc[0] = { .version = 0, - .base_offset = MAN_DESC_OFFSET, + .base_offset = MAN_DESC_OFFSET_V1_8, .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ }, diff --git a/rimage/manifest.c b/rimage/manifest.c index 9837ac1b932a..bab31909f9da 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -618,7 +618,8 @@ static int man_write_fw_mod(struct image *image) return 0; } -static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) +static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, + int file_text_offset) { struct module *module; struct sof_man_module *man_module; @@ -631,7 +632,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) /* set module file offset */ if (i == 0) - module->foffset = FILE_TEXT_OFFSET; + module->foffset = file_text_offset; else module->foffset = image->image_end; @@ -695,11 +696,11 @@ static int man_write_fw_v1_5(struct image *image) /* create the module */ m = image->fw_image; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_5; /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -707,7 +708,7 @@ static int man_write_fw_v1_5(struct image *image) ri_css_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + FILE_TEXT_OFFSET_V1_5 - MAN_DESC_OFFSET_V1_5 + image->image_end, desc->header.preload_page_count); /* calculate hash for each module */ @@ -770,11 +771,11 @@ static int man_write_fw_v1_8(struct image *image) /* create the module */ m = image->fw_image; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -786,7 +787,7 @@ static int man_write_fw_v1_8(struct image *image) ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, desc->header.preload_page_count); /* calculate hash for each module */ @@ -863,7 +864,7 @@ static int man_write_fw_meu_v1_5(struct image *image) /* create the module */ meta = image->fw_image + meta_start_offset; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_5; /* copy data */ memcpy(desc, &image->adsp->man_v1_5->desc, @@ -871,7 +872,7 @@ static int man_write_fw_meu_v1_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -879,7 +880,7 @@ static int man_write_fw_meu_v1_5(struct image *image) ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); /* write preload page count */ - preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_5; preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; @@ -934,7 +935,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* create the module */ meta = image->fw_image + meta_start_offset; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; /* copy data */ memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, @@ -944,7 +945,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -952,7 +953,7 @@ static int man_write_fw_meu_v1_8(struct image *image) ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); /* write preload page count */ - preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; diff --git a/rimage/manifest.h b/rimage/manifest.h index 072b5a05a6a9..7a4d118cd23f 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -26,7 +26,8 @@ #define XCC_MOD_OFFSET 0x8 /* start offset for base FW module */ -#define FILE_TEXT_OFFSET 0x8000 +#define FILE_TEXT_OFFSET_V1_8 0x8000 +#define FILE_TEXT_OFFSET_V1_5 0x2000 /* * CSE values for CNL @@ -37,7 +38,8 @@ #define MAN_CSE_HDR_OFFSET 0 #define MAN_CSE_PADDING_SIZE 0x30 #define MAN_EXT_PADDING 0x20 -#define MAN_DESC_OFFSET 0x2000 +#define MAN_DESC_OFFSET_V1_8 0x2000 +#define MAN_DESC_OFFSET_V1_5 0x284 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ @@ -64,7 +66,7 @@ MAN_EXT_PADDING) #define MAN_DESC_PADDING_SIZE_V1_8 \ - (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V1_8) #define MAN_SIG_PKG_OFFSET_V1_5 \ (MAN_CSS_HDR_OFFSET + \ diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 48484bfd1959..522732c24c59 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -26,8 +26,8 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, fprintf(stdout, " meta: completing ADSP manifest\n"); - meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end - - meta_end_offset; + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET_V1_8 + + image->image_end - meta_end_offset; fprintf(stdout, " meta: limit is 0x%x\n", meta->comp_desc[0].limit_offset); @@ -40,11 +40,11 @@ void ri_plat_ext_data_create(struct image *image) + MAN_PART_INFO_OFFSET_V1_8; struct sof_man_adsp_meta_file_ext *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; - struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; fprintf(stdout, " auth: completing authentication manifest\n"); - part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; part->length += MAN_PAGE_SIZE - (part->length % MAN_PAGE_SIZE); /* do this here atm */ From 90d75018d3ada02cd97976f9258c6a5449d8abff Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 30 Nov 2018 16:06:30 +0000 Subject: [PATCH 042/350] rimage: Add support for Sue creek WiP. Signed-off-by: Liam Girdwood --- rimage/Makefile.am | 1 + rimage/css.c | 57 +++++++++++++++++++- rimage/css.h | 3 +- rimage/man_sue.c | 39 ++++++++++++++ rimage/manifest.c | 129 ++++++++++++++++++++++++++++++++++++++------- rimage/manifest.h | 7 +++ rimage/rimage.h | 5 ++ 7 files changed, 220 insertions(+), 21 deletions(-) create mode 100644 rimage/man_sue.c diff --git a/rimage/Makefile.am b/rimage/Makefile.am index fb0bf700da6d..5af59059b7f3 100644 --- a/rimage/Makefile.am +++ b/rimage/Makefile.am @@ -15,6 +15,7 @@ rimage_SOURCES = \ man_apl.c \ man_cnl.c \ man_kbl.c \ + man_sue.c \ cse.c \ css.c \ plat_auth.c \ diff --git a/rimage/css.c b/rimage/css.c index 9f5db485e1c1..d76316891848 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,7 +20,7 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create(struct image *image) +void ri_css_v1_8_hdr_create(struct image *image) { struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; @@ -74,3 +74,58 @@ void ri_css_hdr_create(struct image *image) val = date->tm_mday; css->date |= val << 0; } + +void ri_css_v1_5_hdr_create(struct image *image) +{ + struct css_header_v1_5 *css = image->fw_image; + struct tm *date; + struct timeval tv; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + date = localtime(&tv.tv_sec); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} diff --git a/rimage/css.h b/rimage/css.h index b87d613dcf3f..a1237dbe5af1 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -84,6 +84,7 @@ struct css_header_v1_5 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create(struct image *image); +void ri_css_v1_8_hdr_create(struct image *image); +void ri_css_v1_5_hdr_create(struct image *image); #endif diff --git a/rimage/man_sue.c b/rimage/man_sue.c new file mode 100644 index 000000000000..2f3ce4abfbc1 --- /dev/null +++ b/rimage/man_sue.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include +#include + +/* manifest template */ +struct fw_image_manifest_v1_5_sue sue_manifest = { + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0x2000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c index bab31909f9da..17cab87ee0e0 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -96,6 +96,21 @@ static int man_init_image_v1_5(struct image *image) return 0; } +static int man_init_image_v1_5_sue(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + /* copy 1.5 sue manifest */ + memcpy(image->fw_image + MAN_DESC_OFFSET_V1_5_SUE, + image->adsp->man_v1_5_sue, + sizeof(struct fw_image_manifest_v1_5_sue)); + + return 0; +} + static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ @@ -451,12 +466,19 @@ static int man_module_create(struct image *image, struct module *module, } fprintf(stdout, "\n"); + /* no need to update end for exec headers */ + if (module->exec_header) { + image->image_end = FILE_TEXT_OFFSET_V1_5_SUE; + goto out; + } + /* round module end upto nearest page */ if (image->image_end % MAN_PAGE_SIZE) { image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; image->image_end *= MAN_PAGE_SIZE; } +out: fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, @@ -593,16 +615,6 @@ static int man_write_fw_mod(struct image *image) { int count; - /* write ROM - for VM use only */ - count = fwrite(image->rom_image, image->adsp->rom_size, 1, - image->out_rom_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write rom %s %d\n", - image->out_rom_file, -errno); - return -errno; - } - fclose(image->out_rom_fd); - /* write manifest and signed image */ count = fwrite(image->fw_image, image->image_end, @@ -624,13 +636,33 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, struct module *module; struct sof_man_module *man_module; int err; - int i; + int i = 0, offset = 0; - for (i = 0; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i); - module = &image->module[i]; + /* if first module is executable then write before manifest */ + if (image->adsp->exec_boot_ldr) { + man_module = sof_man_get_module(desc, 0); + module = &image->module[0]; + + fprintf(stdout, "Module: %s used as executable header\n", + module->elf_file); + module->exec_header = 1; /* set module file offset */ + module->foffset = 0; + + err = man_module_create(image, module, man_module); + if (err < 0) + return err; + + /* setup man_modules for missing exec loader module */ + i = 1; + offset = 1; + } + + for (; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i - offset); + module = &image->module[i]; + if (i == 0) module->foffset = file_text_offset; else @@ -657,6 +689,12 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) for (i = 0; i < image->num_modules; i++) { man_module = sof_man_get_module(desc, i); + if (image->adsp->exec_boot_ldr && i == 0) { + fprintf(stdout, " module: no need to hash %s\n as its exec header\n", + man_module->name); + continue; + } + ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + @@ -705,7 +743,7 @@ static int man_write_fw_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_css_hdr_create(image); + ri_css_v1_5_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", FILE_TEXT_OFFSET_V1_5 - MAN_DESC_OFFSET_V1_5 + image->image_end, @@ -741,6 +779,58 @@ static int man_write_fw_v1_5(struct image *image) return ret; } +/* used by others */ +static int man_write_fw_v1_5_sue(struct image *image) +{ + struct fw_image_manifest_v1_5_sue *m; + uint32_t preload_size; + int ret; + + /* init image */ + ret = man_init_image_v1_5_sue(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image + MAN_DESC_OFFSET_V1_5_SUE; + + /* create each module - subtract the boot loader exec header */ + m->desc.header.num_module_entries = image->num_modules - 1; + man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* write preload page count */ + preload_size = image->image_end - MAN_DESC_OFFSET_V1_5_SUE; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + m->desc.header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + image->image_end, + m->desc.header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, &m->desc); + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) { + goto err; + } + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + /* used by others */ static int man_write_fw_v1_8(struct image *image) { @@ -783,7 +873,7 @@ static int man_write_fw_v1_8(struct image *image) ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create(image); + ri_css_v1_8_hdr_create(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -1092,7 +1182,8 @@ const struct adsp machine_sue = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, + .write_firmware = man_write_fw_v1_5_sue, + .write_firmware_meu = man_write_fw_v1_5_sue, + .man_v1_5_sue = &sue_manifest, + .exec_boot_ldr = 1, }; diff --git a/rimage/manifest.h b/rimage/manifest.h index 7a4d118cd23f..d06c0b11ceb2 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -28,6 +28,7 @@ /* start offset for base FW module */ #define FILE_TEXT_OFFSET_V1_8 0x8000 #define FILE_TEXT_OFFSET_V1_5 0x2000 +#define FILE_TEXT_OFFSET_V1_5_SUE 0xA000 /* * CSE values for CNL @@ -40,6 +41,7 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 +#define MAN_DESC_OFFSET_V1_5_SUE 0x4000 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ @@ -116,10 +118,15 @@ struct fw_image_manifest_v1_5 { struct sof_man_fw_desc desc; } __attribute__((packed)); +struct fw_image_manifest_v1_5_sue { + struct sof_man_fw_desc desc; +} __attribute__((packed)); + /* * TODO: verify if we need platform specific manifest, or just * define manifest_v1_5 and manifest_v1_8. */ extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; +extern struct fw_image_manifest_v1_5_sue sue_manifest; #endif diff --git a/rimage/rimage.h b/rimage/rimage.h index a9a161cdc9fe..2c06f740ccfe 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -87,6 +87,9 @@ struct module { /* total file size */ int file_size; + + /* executable header module */ + int exec_header; }; /* @@ -151,6 +154,8 @@ struct adsp { int (*write_firmware_meu)(struct image *image); struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; + struct fw_image_manifest_v1_5_sue *man_v1_5_sue; + int exec_boot_ldr; }; int write_logs_dictionary(struct image *image); From 52b17106c91d3b6e0c0073337ac5f9f5a7d011cb Mon Sep 17 00:00:00 2001 From: Bard liao Date: Mon, 24 Dec 2018 01:26:51 +0800 Subject: [PATCH 043/350] rimage: make block divisible by 4 Add pandding to each block if the block size is not divisible by 4. Which can avoid unaligned memory accesses. Signed-off-by: Bard liao --- rimage/file_simple.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index c88676c4e5cf..b69bd8e52d6b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -85,11 +85,17 @@ static int write_block(struct image *image, struct module *module, { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; + uint32_t padding = 0; size_t count; void *buffer; int ret; block.size = section->sh_size; + if (block.size % 4) { + /* make block.size divisible by 4 to avoid unaligned accesses */ + padding = 4 - (block.size % 4); + block.size += padding; + } if (is_iram(image, section)) { block.type = SOF_BLK_TEXT; @@ -129,8 +135,8 @@ static int write_block(struct image *image, struct module *module, } /* write out section data */ - count = fwrite(buffer, 1, section->sh_size, image->out_fd); - if (count != section->sh_size) { + count = fwrite(buffer, 1, block.size, image->out_fd); + if (count != block.size) { fprintf(stderr, "error: cant write section %d\n", -errno); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", section->sh_offset, section->sh_size, section->sh_addr); @@ -144,6 +150,10 @@ static int write_block(struct image *image, struct module *module, out: free(buffer); + /* return padding size */ + if (ret >= 0) + return padding; + return ret; } @@ -154,12 +164,16 @@ static int simple_write_module(struct image *image, struct module *module) size_t count; int i, err; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int ptr_hdr, ptr_cur; + uint32_t padding = 0; hdr.num_blocks = module->num_sections - module->num_bss; hdr.size = module->text_size + module->data_size + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; hdr.type = SOF_FW_BASE; + /* Get the pointer of writing hdr */ + ptr_hdr = ftell(image->out_fd); count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) { fprintf(stderr, "error: failed to write section header %d\n", @@ -198,10 +212,25 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stderr, "error: failed to write section #%d\n", i); return err; } + /* write_block will return padding size */ + padding += err; } + hdr.size += padding; + /* Record current pointer, will set it back after overwriting hdr */ + ptr_cur = ftell(image->out_fd); + /* overwrite hdr */ + fseek(image->out_fd, ptr_hdr, SEEK_SET); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + fseek(image->out_fd, ptr_cur, SEEK_SET); fprintf(stdout, "\n"); - return 0; + /* return padding size */ + return padding; } static int write_block_reloc(struct image *image, struct module *module) @@ -336,7 +365,14 @@ static int simple_write_firmware(struct image *image) i); return ret; } + /* add padding size */ + hdr.file_size += ret; } + /* overwrite hdr */ + fseek(image->out_fd, 0, SEEK_SET); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) + return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), From 93b0d29571c2db3086f1d0b47d3440f1addb8838 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 11 Jan 2019 21:07:45 +0100 Subject: [PATCH 044/350] rimage: remove config.h dependency man_* files don't need it pkcs can use PEM_KEY_PREFIX from passed in defines Signed-off-by: Janusz Jankowski --- rimage/man_apl.c | 1 - rimage/man_cnl.c | 1 - rimage/man_kbl.c | 1 - rimage/man_sue.c | 1 - rimage/pkcs1_5.c | 1 - 5 files changed, 5 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 76082dd9111f..f7f1d25f3a13 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5e3480d1ef3d..7142fd26386a 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 4d5f5464dfe4..5fd16f8c3d24 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 2f3ce4abfbc1..741fd0b26a04 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index a6f8fbf545e3..adee7a9b3221 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -26,7 +26,6 @@ #include #include -#include "config.h" #include "rimage.h" #include "css.h" #include "manifest.h" From 4e3ead009638bbba2eea801cd6c8f77e908c7eed Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 11 Jan 2019 21:24:02 +0100 Subject: [PATCH 045/350] cmake: add rimage build Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 rimage/CMakeLists.txt diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt new file mode 100644 index 000000000000..940c9f513bfc --- /dev/null +++ b/rimage/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.10) + +project(SOF_RIMAGE C) + +set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") + +if(NOT DEFINED VERSION_H_PATH) + message(FATAL_ERROR + " Please specify version.h path.\n" + " Example: cmake -DVERSION_H_PATH=${VERSION_H_PATH} ...\n" +) +endif() + +if(NOT DEFINED PEM_KEY_PREFIX) + set(PEM_KEY_PREFIX "/usr/local/share/rimage") +endif() + +get_filename_component(VERSION_H_DIRECTORY ${VERSION_H_PATH} DIRECTORY) + +add_executable(rimage + file_simple.c + man_apl.c + man_cnl.c + man_kbl.c + man_sue.c + cse.c + css.c + plat_auth.c + hash.c + pkcs1_5.c + manifest.c + elf.c + rimage.c +) + +target_compile_options(rimage PRIVATE + -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 +) + +target_compile_definitions(rimage PRIVATE + PEM_KEY_PREFIX="${PEM_KEY_PREFIX}" +) + +target_link_libraries(rimage PRIVATE "-lcrypto") + +target_include_directories(rimage PRIVATE + "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" + "${VERSION_H_DIRECTORY}" +) From cd6f24a01591993165091a0191a558d5c841d33e Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 15 Jan 2019 22:16:23 +0100 Subject: [PATCH 046/350] buildsystem: remove autotools from sof This commit doesn't touch tools buildsystem. Signed-off-by: Janusz Jankowski --- rimage/Makefile.am | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 rimage/Makefile.am diff --git a/rimage/Makefile.am b/rimage/Makefile.am deleted file mode 100644 index 5af59059b7f3..000000000000 --- a/rimage/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -SUBDIRS=keys - -bin_PROGRAMS = rimage - -noinst_HEADERS = \ - rimage.h \ - css.h \ - cse.h \ - plat_auth.h \ - manifest.h \ - file_format.h - -rimage_SOURCES = \ - file_simple.c \ - man_apl.c \ - man_cnl.c \ - man_kbl.c \ - man_sue.c \ - cse.c \ - css.c \ - plat_auth.c \ - hash.c \ - pkcs1_5.c \ - manifest.c \ - elf.c \ - rimage.c - From cf665a03ec4ec60dd2fd233b3589d0aa48642fad Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 28 Jan 2019 14:06:14 +0200 Subject: [PATCH 047/350] rimage: Use fw.h instead of duplicating the code This is very useful when updating one of the types in UAPI because with the current implementation one needs to be careful to also update file_format.h Signed-off-by: Daniel Baluta --- rimage/file_format.h | 52 +------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 58e5b117d312..681bd5c25ff7 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -64,61 +64,11 @@ #define __INCLUDE_UAPI_SOF_FW_H__ #include - -#define SND_SOF_FW_SIG_SIZE 4 -#define SND_SOF_FW_ABI 1 -#define SND_SOF_FW_SIG "Reef" +#include #define SND_SOF_LOGS_SIG_SIZE 4 #define SND_SOF_LOGS_SIG "Logs" -/* - * Firmware module is made up of 1 . N blocks of different types. The - * Block header is used to determine where and how block is to be copied in the - * DSP/host memory space. - */ -enum snd_sof_fw_blk_type { - SOF_BLK_IMAGE = 0, /* whole image - parsed by ROMs */ - SOF_BLK_TEXT = 1, - SOF_BLK_DATA = 2, - SOF_BLK_CACHE = 3, - SOF_BLK_REGS = 4, - SOF_BLK_SIG = 5, - SOF_BLK_ROM = 6, - /* add new block types here */ -}; - -struct snd_sof_blk_hdr { - enum snd_sof_fw_blk_type type; - uint32_t size; /* bytes minus this header */ - uint32_t offset; /* offset from base */ -} __attribute__((packed)); - -/* - * Firmware file is made up of 1 .. N different modules types. The module - * type is used to determine how to load and parse the module. - */ -enum snd_sof_fw_mod_type { - SOF_FW_BASE = 0, /* base firmware image */ - SOF_FW_MODULE = 1, /* firmware module */ -}; - -struct snd_sof_mod_hdr { - enum snd_sof_fw_mod_type type; - uint32_t size; /* bytes minus this header */ - uint32_t num_blocks; /* number of blocks */ -} __attribute__((packed)); - -/* - * Firmware file header. - */ -struct snd_sof_fw_header { - unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ - uint32_t file_size; /* size of file minus this header */ - uint32_t num_modules; /* number of modules */ - uint32_t abi; /* version of header format */ -} __attribute__((packed)); - /* * Logs dictionary file header. */ From 139c3b4c88370b7e0c7d302df5e21026e529c790 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 28 Jan 2019 14:10:34 +0200 Subject: [PATCH 048/350] rimage: Fix file_format.h include guard This is most likely due to copy/paste. Signed-off-by: Daniel Baluta --- rimage/file_format.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 681bd5c25ff7..2ffdf0c68c61 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -60,8 +60,8 @@ * Firmware file format . */ -#ifndef __INCLUDE_UAPI_SOF_FW_H__ -#define __INCLUDE_UAPI_SOF_FW_H__ +#ifndef __INCLUDE_FILE_FORMAT_H__ +#define __INCLUDE_FILE_FORMAT_H__ #include #include From 5c7e400a409ffd752ceb0e456f61231bea135f6e Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:43:09 +0100 Subject: [PATCH 049/350] rimage: import elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.h | 961 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 961 insertions(+) create mode 100644 rimage/elf.h diff --git a/rimage/elf.h b/rimage/elf.h new file mode 100644 index 000000000000..d4f3955c2528 --- /dev/null +++ b/rimage/elf.h @@ -0,0 +1,961 @@ +/* + * Derived from: + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ + * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ + * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ + * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ + * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ + * + * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. + * Copyright (c) 2001 David E. O'Brien + * Portions Copyright 2009 The Go Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * ELF definitions that are independent of architecture or word size. + */ + +/* + * Note header. The ".note" section contains an array of notes. Each + * begins with this header, aligned to a word boundary. Immediately + * following the note header is n_namesz bytes of name, padded to the + * next word boundary. Then comes n_descsz bytes of descriptor, again + * padded to a word boundary. The values of n_namesz and n_descsz do + * not include the padding. + */ + +typedef unsigned __int64 uint64; +typedef unsigned __int32 uint32; +typedef unsigned __int16 uint16; +typedef unsigned __int8 uint8; + +typedef __int64 int64; +typedef __int32 int32; +typedef __int16 int16; +typedef __int8 int8; + + +typedef struct { + uint32 n_namesz; /* Length of name. */ + uint32 n_descsz; /* Length of descriptor. */ + uint32 n_type; /* Type of this note. */ +} Elf_Note; + +/* Indexes into the e_ident array. Keep synced with + http://www.sco.com/developer/gabi/ch4.eheader.html */ +#define EI_MAG0 0 /* Magic number, byte 0. */ +#define EI_MAG1 1 /* Magic number, byte 1. */ +#define EI_MAG2 2 /* Magic number, byte 2. */ +#define EI_MAG3 3 /* Magic number, byte 3. */ +#define EI_CLASS 4 /* Class of machine. */ +#define EI_DATA 5 /* Data format. */ +#define EI_VERSION 6 /* ELF format version. */ +#define EI_OSABI 7 /* Operating system / ABI identification */ +#define EI_ABIVERSION 8 /* ABI version */ +#define OLD_EI_BRAND 8 /* Start of architecture identification. */ +#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ +#define EI_NIDENT 16 /* Size of e_ident array. */ + +/* Values for the magic number bytes. */ +#define ELFMAG0 0x7f +#define ELFMAG1 'E' +#define ELFMAG2 'L' +#define ELFMAG3 'F' +#define ELFMAG "\177ELF" /* magic string */ +#define SELFMAG 4 /* magic string size */ + +/* Values for e_ident[EI_VERSION] and e_version. */ +#define EV_NONE 0 +#define EV_CURRENT 1 + +/* Values for e_ident[EI_CLASS]. */ +#define ELFCLASSNONE 0 /* Unknown class. */ +#define ELFCLASS32 1 /* 32-bit architecture. */ +#define ELFCLASS64 2 /* 64-bit architecture. */ + +/* Values for e_ident[EI_DATA]. */ +#define ELFDATANONE 0 /* Unknown data format. */ +#define ELFDATA2LSB 1 /* 2's complement little-endian. */ +#define ELFDATA2MSB 2 /* 2's complement big-endian. */ + +/* Values for e_ident[EI_OSABI]. */ +#define ELFOSABI_NONE 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_AIX 7 /* AIX */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_OPENVMS 13 /* Open VMS */ +#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ +#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ + +/* e_ident */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) + +/* Values for e_type. */ +#define ET_NONE 0 /* Unknown type. */ +#define ET_REL 1 /* Relocatable. */ +#define ET_EXEC 2 /* Executable. */ +#define ET_DYN 3 /* Shared object. */ +#define ET_CORE 4 /* Core file. */ +#define ET_LOOS 0xfe00 /* First operating system specific. */ +#define ET_HIOS 0xfeff /* Last operating system-specific. */ +#define ET_LOPROC 0xff00 /* First processor-specific. */ +#define ET_HIPROC 0xffff /* Last processor-specific. */ + +/* Values for e_machine. */ +#define EM_NONE 0 /* Unknown machine. */ +#define EM_M32 1 /* AT&T WE32100. */ +#define EM_SPARC 2 /* Sun SPARC. */ +#define EM_386 3 /* Intel i386. */ +#define EM_68K 4 /* Motorola 68000. */ +#define EM_88K 5 /* Motorola 88000. */ +#define EM_860 7 /* Intel i860. */ +#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */ +#define EM_S370 9 /* IBM System/370. */ +#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */ +#define EM_PARISC 15 /* HP PA-RISC. */ +#define EM_VPP500 17 /* Fujitsu VPP500. */ +#define EM_SPARC32PLUS 18 /* SPARC v8plus. */ +#define EM_960 19 /* Intel 80960. */ +#define EM_PPC 20 /* PowerPC 32-bit. */ +#define EM_PPC64 21 /* PowerPC 64-bit. */ +#define EM_S390 22 /* IBM System/390. */ +#define EM_V800 36 /* NEC V800. */ +#define EM_FR20 37 /* Fujitsu FR20. */ +#define EM_RH32 38 /* TRW RH-32. */ +#define EM_RCE 39 /* Motorola RCE. */ +#define EM_ARM 40 /* ARM. */ +#define EM_SH 42 /* Hitachi SH. */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit. */ +#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */ +#define EM_ARC 45 /* Argonaut RISC Core. */ +#define EM_H8_300 46 /* Hitachi H8/300. */ +#define EM_H8_300H 47 /* Hitachi H8/300H. */ +#define EM_H8S 48 /* Hitachi H8S. */ +#define EM_H8_500 49 /* Hitachi H8/500. */ +#define EM_IA_64 50 /* Intel IA-64 Processor. */ +#define EM_MIPS_X 51 /* Stanford MIPS-X. */ +#define EM_COLDFIRE 52 /* Motorola ColdFire. */ +#define EM_68HC12 53 /* Motorola M68HC12. */ +#define EM_MMA 54 /* Fujitsu MMA. */ +#define EM_PCP 55 /* Siemens PCP. */ +#define EM_NCPU 56 /* Sony nCPU. */ +#define EM_NDR1 57 /* Denso NDR1 microprocessor. */ +#define EM_STARCORE 58 /* Motorola Star*Core processor. */ +#define EM_ME16 59 /* Toyota ME16 processor. */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor. */ +#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ +#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ + +/* Non-standard or deprecated. */ +#define EM_486 6 /* Intel i486. */ +#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ +#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ +#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ + +/* Special section indexes. */ +#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ +#define SHN_LORESERVE 0xff00 /* First of reserved range. */ +#define SHN_LOPROC 0xff00 /* First processor-specific. */ +#define SHN_HIPROC 0xff1f /* Last processor-specific. */ +#define SHN_LOOS 0xff20 /* First operating system-specific. */ +#define SHN_HIOS 0xff3f /* Last operating system-specific. */ +#define SHN_ABS 0xfff1 /* Absolute values. */ +#define SHN_COMMON 0xfff2 /* Common data. */ +#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */ +#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ + +/* sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends */ +#define SHT_HASH 5 /* symbol hash table section */ +#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_NOTE 7 /* note section */ +#define SHT_NOBITS 8 /* no space section */ +#define SHT_REL 9 /* relocation section - no addends */ +#define SHT_SHLIB 10 /* reserved - purpose unknown */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ +#define SHT_FINI_ARRAY 15 /* Termination function pointers. */ +#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ +#define SHT_GROUP 17 /* Section group. */ +#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */ +#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ +#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ +#define SHT_GNU_VERDEF 0x6ffffffd +#define SHT_GNU_VERNEED 0x6ffffffe +#define SHT_GNU_VERSYM 0x6fffffff +#define SHT_LOPROC 0x70000000 /* reserved range for processor */ +#define SHT_HIPROC 0x7fffffff /* specific section header types */ +#define SHT_LOUSER 0x80000000 /* reserved range for application */ +#define SHT_HIUSER 0xffffffff /* specific indexes */ + +/* Flags for sh_flags. */ +#define SHF_WRITE 0x1 /* Section contains writable data. */ +#define SHF_ALLOC 0x2 /* Section occupies memory. */ +#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ +#define SHF_MERGE 0x10 /* Section may be merged. */ +#define SHF_STRINGS 0x20 /* Section contains strings. */ +#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */ +#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */ +#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ +#define SHF_GROUP 0x200 /* Member of section group. */ +#define SHF_TLS 0x400 /* Section contains TLS data. */ +#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ +#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ + +/* Values for p_type. */ +#define PT_NULL 0 /* Unused entry. */ +#define PT_LOAD 1 /* Loadable segment. */ +#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ +#define PT_INTERP 3 /* Pathname of interpreter. */ +#define PT_NOTE 4 /* Auxiliary information. */ +#define PT_SHLIB 5 /* Reserved (not used). */ +#define PT_PHDR 6 /* Location of program header itself. */ +#define PT_TLS 7 /* Thread local storage segment */ +#define PT_LOOS 0x60000000 /* First OS-specific. */ +#define PT_HIOS 0x6fffffff /* Last OS-specific. */ +#define PT_LOPROC 0x70000000 /* First processor-specific type. */ +#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ +#define PT_GNU_STACK 0x6474e551 +#define PT_PAX_FLAGS 0x65041580 + +/* Values for p_flags. */ +#define PF_X 0x1 /* Executable. */ +#define PF_W 0x2 /* Writable. */ +#define PF_R 0x4 /* Readable. */ +#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */ +#define PF_MASKPROC 0xf0000000 /* Processor-specific. */ + +/* Values for d_tag. */ +#define DT_NULL 0 /* Terminating entry. */ +/* String table offset of a needed shared library. */ +#define DT_NEEDED 1 +#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ +#define DT_PLTGOT 3 /* Processor-dependent address. */ +#define DT_HASH 4 /* Address of symbol hash table. */ +#define DT_STRTAB 5 /* Address of string table. */ +#define DT_SYMTAB 6 /* Address of symbol table. */ +#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ +#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ +#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ +#define DT_STRSZ 10 /* Size of string table. */ +#define DT_SYMENT 11 /* Size of each symbol table entry. */ +#define DT_INIT 12 /* Address of initialization function. */ +#define DT_FINI 13 /* Address of finalization function. */ +/* String table offset of shared object name. */ +#define DT_SONAME 14 +#define DT_RPATH 15 /* String table offset of library path. [sup] */ +#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ +#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ +#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ +#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ +#define DT_PLTREL 20 /* Type of relocation used for PLT. */ +#define DT_DEBUG 21 /* Reserved (not used). */ +/* Indicates there may be relocations in non-writable segments. [sup] */ +#define DT_TEXTREL 22 +#define DT_JMPREL 23 /* Address of PLT relocations. */ +#define DT_BIND_NOW 24 /* [sup] */ +/* Address of the array of pointers to initialization functions */ +#define DT_INIT_ARRAY 25 +/* Address of the array of pointers to termination functions */ +#define DT_FINI_ARRAY 26 +/* Size in bytes of the array of initialization functions. */ +#define DT_INIT_ARRAYSZ 27 +/* Size in bytes of the array of terminationfunctions. */ +#define DT_FINI_ARRAYSZ 28 +/* String table offset of a null-terminated library search path string. */ +#define DT_RUNPATH 29 +#define DT_FLAGS 30 /* Object specific flag values. */ +/* Values greater than or equal to DT_ENCODING and less than + DT_LOOS follow the rules for the interpretation of the d_un + union as follows: even == 'd_ptr', even == 'd_val' or none */ +#define DT_ENCODING 32 +/* Address of the array of pointers to pre-initialization functions. */ +#define DT_PREINIT_ARRAY 32 +/* Size in bytes of the array of pre-initialization functions. */ +#define DT_PREINIT_ARRAYSZ 33 +#define DT_LOOS 0x6000000d /* First OS-specific */ +#define DT_HIOS 0x6ffff000 /* Last OS-specific */ +#define DT_LOPROC 0x70000000 /* First processor-specific type. */ +#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ + +#define DT_VERNEED 0x6ffffffe +#define DT_VERNEEDNUM 0x6fffffff +#define DT_VERSYM 0x6ffffff0 + +/* Values for DT_FLAGS */ +/* Indicates that the object being loaded may make reference to + the $ORIGIN substitution string */ +#define DF_ORIGIN 0x0001 +#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ +/* Indicates there may be relocations in non-writable segments. */ +#define DF_TEXTREL 0x0004 +/* Indicates that the dynamic linker should process all + relocations for the object containing this entry before + transferring control to the program. */ +#define DF_BIND_NOW 0x0008 +/* Indicates that the shared object or executable contains code + using a static thread-local storage scheme. */ +#define DF_STATIC_TLS 0x0010 + +/* Values for n_type. Used in core files. */ +#define NT_PRSTATUS 1 /* Process status. */ +#define NT_FPREGSET 2 /* Floating point registers. */ +#define NT_PRPSINFO 3 /* Process state info. */ + +/* Symbol Binding - ELFNN_ST_BIND - st_info */ +#define STB_LOCAL 0 /* Local symbol */ +#define STB_GLOBAL 1 /* Global symbol */ +#define STB_WEAK 2 /* like global - lower precedence */ +#define STB_LOOS 10 /* Reserved range for operating system */ +#define STB_HIOS 12 /* specific semantics. */ +#define STB_LOPROC 13 /* reserved range for processor */ +#define STB_HIPROC 15 /* specific semantics. */ + +/* Symbol type - ELFNN_ST_TYPE - st_info */ +#define STT_NOTYPE 0 /* Unspecified type. */ +#define STT_OBJECT 1 /* Data object. */ +#define STT_FUNC 2 /* Function. */ +#define STT_SECTION 3 /* Section. */ +#define STT_FILE 4 /* Source file. */ +#define STT_COMMON 5 /* Uninitialized common block. */ +#define STT_TLS 6 /* TLS object. */ +#define STT_LOOS 10 /* Reserved range for operating system */ +#define STT_HIOS 12 /* specific semantics. */ +#define STT_LOPROC 13 /* reserved range for processor */ +#define STT_HIPROC 15 /* specific semantics. */ + +/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ +#define STV_DEFAULT 0x0 /* Default visibility (see binding). */ +#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */ +#define STV_HIDDEN 0x2 /* Not visible. */ +#define STV_PROTECTED 0x3 /* Visible but not preemptible. */ + +/* Special symbol table indexes. */ +#define STN_UNDEF 0 /* Undefined symbol index. */ + +/* + * ELF definitions common to all 32-bit architectures. + */ + +typedef uint32 Elf32_Addr; +typedef uint16 Elf32_Half; +typedef uint32 Elf32_Off; +typedef int32 Elf32_Sword; +typedef uint32 Elf32_Word; + +typedef Elf32_Word Elf32_Hashelt; + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf32_Word Elf32_Size; +typedef Elf32_Sword Elf32_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char ident[EI_NIDENT]; /* File identification. */ + Elf32_Half type; /* File type. */ + Elf32_Half machine; /* Machine architecture. */ + Elf32_Word version; /* ELF format version. */ + Elf32_Addr entry; /* Entry point. */ + Elf32_Off phoff; /* Program header file offset. */ + Elf32_Off shoff; /* Section header file offset. */ + Elf32_Word flags; /* Architecture-specific flags. */ + Elf32_Half ehsize; /* Size of ELF header in bytes. */ + Elf32_Half phentsize; /* Size of program header entry. */ + Elf32_Half phnum; /* Number of program header entries. */ + Elf32_Half shentsize; /* Size of section header entry. */ + Elf32_Half shnum; /* Number of section header entries. */ + Elf32_Half shstrndx; /* Section name strings section. */ +} Elf32_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf32_Word name; /* Section name (index into the + section header string table). */ + Elf32_Word type; /* Section type. */ + Elf32_Word flags; /* Section flags. */ + Elf32_Addr vaddr; /* Address in memory image. */ + Elf32_Off off; /* Offset in file. */ + Elf32_Word size; /* Size in bytes. */ + Elf32_Word link; /* Index of a related section. */ + Elf32_Word info; /* Depends on section type. */ + Elf32_Word addralign; /* Alignment in bytes. */ + Elf32_Word entsize; /* Size of each entry in section. */ +} Elf32_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf32_Word type; /* Entry type. */ + Elf32_Off off; /* File offset of contents. */ + Elf32_Addr vaddr; /* Virtual address in memory image. */ + Elf32_Addr paddr; /* Physical address (not used). */ + Elf32_Word filesz; /* Size of contents in file. */ + Elf32_Word memsz; /* Size of contents in memory. */ + Elf32_Word flags; /* Access permission flags. */ + Elf32_Word align; /* Alignment in memory and file. */ +} Elf32_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf32_Sword d_tag; /* Entry type. */ + union { + Elf32_Word d_val; /* Integer value. */ + Elf32_Addr d_ptr; /* Address value. */ + } d_un; +} Elf32_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf32_Addr off; /* Location to be relocated. */ + Elf32_Word info; /* Relocation type and symbol index. */ +} Elf32_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf32_Addr off; /* Location to be relocated. */ + Elf32_Word info; /* Relocation type and symbol index. */ + Elf32_Sword addend; /* Addend. */ +} Elf32_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((unsigned char)(info)) + +/* Macro for constructing r_info from field values. */ +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +/* + * Relocation types. + */ + +#define R_X86_64_NONE 0 /* No relocation. */ +#define R_X86_64_64 1 /* Add 64 bit symbol value. */ +#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ +#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ +#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ +#define R_X86_64_COPY 5 /* Copy data from shared object. */ +#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ +#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ +#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ +#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ +#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ +#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ +#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ +#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ +#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ +#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ +#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ +#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ +#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ +#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ +#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ +#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ + +#define R_X86_64_COUNT 24 /* Count of defined relocation types. */ + + +#define R_ALPHA_NONE 0 /* No reloc */ +#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ +#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ +#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ +#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ +#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ +#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ +#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ +#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ +#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ +#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ +#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ +#define R_ALPHA_OP_PUSH 12 /* OP stack push */ +#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */ +#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */ +#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */ +#define R_ALPHA_GPVALUE 16 +#define R_ALPHA_GPRELHIGH 17 +#define R_ALPHA_GPRELLOW 18 +#define R_ALPHA_IMMED_GP_16 19 +#define R_ALPHA_IMMED_GP_HI32 20 +#define R_ALPHA_IMMED_SCN_HI32 21 +#define R_ALPHA_IMMED_BR_HI32 22 +#define R_ALPHA_IMMED_LO32 23 +#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ +#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ +#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ +#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ + +#define R_ALPHA_COUNT 28 + + +#define R_ARM_NONE 0 /* No relocation. */ +#define R_ARM_PC24 1 +#define R_ARM_ABS32 2 +#define R_ARM_REL32 3 +#define R_ARM_PC13 4 +#define R_ARM_ABS16 5 +#define R_ARM_ABS12 6 +#define R_ARM_THM_ABS5 7 +#define R_ARM_ABS8 8 +#define R_ARM_SBREL32 9 +#define R_ARM_THM_PC22 10 +#define R_ARM_THM_PC8 11 +#define R_ARM_AMP_VCALL9 12 +#define R_ARM_SWI24 13 +#define R_ARM_THM_SWI8 14 +#define R_ARM_XPC25 15 +#define R_ARM_THM_XPC22 16 +#define R_ARM_COPY 20 /* Copy data from shared object. */ +#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ +#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ +#define R_ARM_RELATIVE 23 /* Add load address of shared object. */ +#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */ +#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */ +#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */ +#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */ +#define R_ARM_CALL 28 +#define R_ARM_JUMP24 29 +#define R_ARM_V4BX 40 +#define R_ARM_GOT_PREL 96 +#define R_ARM_GNU_VTENTRY 100 +#define R_ARM_GNU_VTINHERIT 101 +#define R_ARM_TLS_IE32 107 +#define R_ARM_TLS_LE32 108 +#define R_ARM_RSBREL32 250 +#define R_ARM_THM_RPC22 251 +#define R_ARM_RREL32 252 +#define R_ARM_RABS32 253 +#define R_ARM_RPC24 254 +#define R_ARM_RBASE 255 + +#define R_ARM_COUNT 38 /* Count of defined relocation types. */ + + +#define R_386_NONE 0 /* No relocation. */ +#define R_386_32 1 /* Add symbol value. */ +#define R_386_PC32 2 /* Add PC-relative symbol value. */ +#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ +#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ +#define R_386_COPY 5 /* Copy data from shared object. */ +#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_386_RELATIVE 8 /* Add load address of shared object. */ +#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ +#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ +#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ +#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ +#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ +#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ +#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */ +#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */ +#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */ +#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */ +#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ +#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ +#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ + +#define R_386_COUNT 38 /* Count of defined relocation types. */ + +#define R_PPC_NONE 0 /* No relocation. */ +#define R_PPC_ADDR32 1 +#define R_PPC_ADDR24 2 +#define R_PPC_ADDR16 3 +#define R_PPC_ADDR16_LO 4 +#define R_PPC_ADDR16_HI 5 +#define R_PPC_ADDR16_HA 6 +#define R_PPC_ADDR14 7 +#define R_PPC_ADDR14_BRTAKEN 8 +#define R_PPC_ADDR14_BRNTAKEN 9 +#define R_PPC_REL24 10 +#define R_PPC_REL14 11 +#define R_PPC_REL14_BRTAKEN 12 +#define R_PPC_REL14_BRNTAKEN 13 +#define R_PPC_GOT16 14 +#define R_PPC_GOT16_LO 15 +#define R_PPC_GOT16_HI 16 +#define R_PPC_GOT16_HA 17 +#define R_PPC_PLTREL24 18 +#define R_PPC_COPY 19 +#define R_PPC_GLOB_DAT 20 +#define R_PPC_JMP_SLOT 21 +#define R_PPC_RELATIVE 22 +#define R_PPC_LOCAL24PC 23 +#define R_PPC_UADDR32 24 +#define R_PPC_UADDR16 25 +#define R_PPC_REL32 26 +#define R_PPC_PLT32 27 +#define R_PPC_PLTREL32 28 +#define R_PPC_PLT16_LO 29 +#define R_PPC_PLT16_HI 30 +#define R_PPC_PLT16_HA 31 +#define R_PPC_SDAREL16 32 +#define R_PPC_SECTOFF 33 +#define R_PPC_SECTOFF_LO 34 +#define R_PPC_SECTOFF_HI 35 +#define R_PPC_SECTOFF_HA 36 + +#define R_PPC_COUNT 37 /* Count of defined relocation types. */ + +#define R_PPC_TLS 67 +#define R_PPC_DTPMOD32 68 +#define R_PPC_TPREL16 69 +#define R_PPC_TPREL16_LO 70 +#define R_PPC_TPREL16_HI 71 +#define R_PPC_TPREL16_HA 72 +#define R_PPC_TPREL32 73 +#define R_PPC_DTPREL16 74 +#define R_PPC_DTPREL16_LO 75 +#define R_PPC_DTPREL16_HI 76 +#define R_PPC_DTPREL16_HA 77 +#define R_PPC_DTPREL32 78 +#define R_PPC_GOT_TLSGD16 79 +#define R_PPC_GOT_TLSGD16_LO 80 +#define R_PPC_GOT_TLSGD16_HI 81 +#define R_PPC_GOT_TLSGD16_HA 82 +#define R_PPC_GOT_TLSLD16 83 +#define R_PPC_GOT_TLSLD16_LO 84 +#define R_PPC_GOT_TLSLD16_HI 85 +#define R_PPC_GOT_TLSLD16_HA 86 +#define R_PPC_GOT_TPREL16 87 +#define R_PPC_GOT_TPREL16_LO 88 +#define R_PPC_GOT_TPREL16_HI 89 +#define R_PPC_GOT_TPREL16_HA 90 + +#define R_PPC_EMB_NADDR32 101 +#define R_PPC_EMB_NADDR16 102 +#define R_PPC_EMB_NADDR16_LO 103 +#define R_PPC_EMB_NADDR16_HI 104 +#define R_PPC_EMB_NADDR16_HA 105 +#define R_PPC_EMB_SDAI16 106 +#define R_PPC_EMB_SDA2I16 107 +#define R_PPC_EMB_SDA2REL 108 +#define R_PPC_EMB_SDA21 109 +#define R_PPC_EMB_MRKREF 110 +#define R_PPC_EMB_RELSEC16 111 +#define R_PPC_EMB_RELST_LO 112 +#define R_PPC_EMB_RELST_HI 113 +#define R_PPC_EMB_RELST_HA 114 +#define R_PPC_EMB_BIT_FLD 115 +#define R_PPC_EMB_RELSDA 116 + + /* Count of defined relocation types. */ +#define R_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1) + + +#define R_SPARC_NONE 0 +#define R_SPARC_8 1 +#define R_SPARC_16 2 +#define R_SPARC_32 3 +#define R_SPARC_DISP8 4 +#define R_SPARC_DISP16 5 +#define R_SPARC_DISP32 6 +#define R_SPARC_WDISP30 7 +#define R_SPARC_WDISP22 8 +#define R_SPARC_HI22 9 +#define R_SPARC_22 10 +#define R_SPARC_13 11 +#define R_SPARC_LO10 12 +#define R_SPARC_GOT10 13 +#define R_SPARC_GOT13 14 +#define R_SPARC_GOT22 15 +#define R_SPARC_PC10 16 +#define R_SPARC_PC22 17 +#define R_SPARC_WPLT30 18 +#define R_SPARC_COPY 19 +#define R_SPARC_GLOB_DAT 20 +#define R_SPARC_JMP_SLOT 21 +#define R_SPARC_RELATIVE 22 +#define R_SPARC_UA32 23 +#define R_SPARC_PLT32 24 +#define R_SPARC_HIPLT22 25 +#define R_SPARC_LOPLT10 26 +#define R_SPARC_PCPLT32 27 +#define R_SPARC_PCPLT22 28 +#define R_SPARC_PCPLT10 29 +#define R_SPARC_10 30 +#define R_SPARC_11 31 +#define R_SPARC_64 32 +#define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 +#define R_SPARC_PC_HH22 37 +#define R_SPARC_PC_HM10 38 +#define R_SPARC_PC_LM22 39 +#define R_SPARC_WDISP16 40 +#define R_SPARC_WDISP19 41 +#define R_SPARC_GLOB_JMP 42 +#define R_SPARC_7 43 +#define R_SPARC_5 44 +#define R_SPARC_6 45 +#define R_SPARC_DISP64 46 +#define R_SPARC_PLT64 47 +#define R_SPARC_HIX22 48 +#define R_SPARC_LOX10 49 +#define R_SPARC_H44 50 +#define R_SPARC_M44 51 +#define R_SPARC_L44 52 +#define R_SPARC_REGISTER 53 +#define R_SPARC_UA64 54 +#define R_SPARC_UA16 55 + + +/* + * Magic number for the elf trampoline, chosen wisely to be an immediate + * value. + */ +#define ARM_MAGIC_TRAMP_NUMBER 0x5c000003 + + +/* + * Symbol table entries. + */ + +typedef struct { + Elf32_Word name; /* String table index of name. */ + Elf32_Addr value; /* Symbol value. */ + Elf32_Word size; /* Size of associated object. */ + unsigned char info; /* Type and binding information. */ + unsigned char other; /* Reserved (not used). */ + Elf32_Half shndx; /* Section index of symbol. */ +} Elf32_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF32_ST_BIND(info) ((info) >> 4) +#define ELF32_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* + * ELF definitions common to all 64-bit architectures. + */ + +typedef uint64 Elf64_Addr; +typedef uint16 Elf64_Half; +typedef uint64 Elf64_Off; +typedef int32 Elf64_Sword; +typedef int64 Elf64_Sxword; +typedef uint32 Elf64_Word; +typedef uint64 Elf64_Xword; + +/* + * Types of dynamic symbol hash table bucket and chain elements. + * + * This is inconsistent among 64 bit architectures, so a machine dependent + * typedef is required. + */ + +#ifdef __alpha__ +typedef Elf64_Off Elf64_Hashelt; +#else +typedef Elf64_Word Elf64_Hashelt; +#endif + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf64_Xword Elf64_Size; +typedef Elf64_Sxword Elf64_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char ident[EI_NIDENT]; /* File identification. */ + Elf64_Half type; /* File type. */ + Elf64_Half machine; /* Machine architecture. */ + Elf64_Word version; /* ELF format version. */ + Elf64_Addr entry; /* Entry point. */ + Elf64_Off phoff; /* Program header file offset. */ + Elf64_Off shoff; /* Section header file offset. */ + Elf64_Word flags; /* Architecture-specific flags. */ + Elf64_Half ehsize; /* Size of ELF header in bytes. */ + Elf64_Half phentsize; /* Size of program header entry. */ + Elf64_Half phnum; /* Number of program header entries. */ + Elf64_Half shentsize; /* Size of section header entry. */ + Elf64_Half shnum; /* Number of section header entries. */ + Elf64_Half shstrndx; /* Section name strings section. */ +} Elf64_Ehdr; + +/* + * Section header. + */ + +typedef struct Elf64_Shdr Elf64_Shdr; +struct Elf64_Shdr { + Elf64_Word name; /* Section name (index into the + section header string table). */ + Elf64_Word type; /* Section type. */ + Elf64_Xword flags; /* Section flags. */ + Elf64_Addr addr; /* Address in memory image. */ + Elf64_Off off; /* Offset in file. */ + Elf64_Xword size; /* Size in bytes. */ + Elf64_Word link; /* Index of a related section. */ + Elf64_Word info; /* Depends on section type. */ + Elf64_Xword addralign; /* Alignment in bytes. */ + Elf64_Xword entsize; /* Size of each entry in section. */ +}; + +/* + * Program header. + */ + +typedef struct { + Elf64_Word type; /* Entry type. */ + Elf64_Word flags; /* Access permission flags. */ + Elf64_Off off; /* File offset of contents. */ + Elf64_Addr vaddr; /* Virtual address in memory image. */ + Elf64_Addr paddr; /* Physical address (not used). */ + Elf64_Xword filesz; /* Size of contents in file. */ + Elf64_Xword memsz; /* Size of contents in memory. */ + Elf64_Xword align; /* Alignment in memory and file. */ +} Elf64_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf64_Sxword d_tag; /* Entry type. */ + union { + Elf64_Xword d_val; /* Integer value. */ + Elf64_Addr d_ptr; /* Address value. */ + } d_un; +} Elf64_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf64_Addr off; /* Location to be relocated. */ + Elf64_Xword info; /* Relocation type and symbol index. */ +} Elf64_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf64_Addr off; /* Location to be relocated. */ + Elf64_Xword info; /* Relocation type and symbol index. */ + Elf64_Sxword addend; /* Addend. */ +} Elf64_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((info) & 0xffffffffL) + +/* Macro for constructing r_info from field values. */ +#define ELF64_R_INFO(sym, type) ((((uint64)(sym)) << 32) + (((uint64)(type)) & 0xffffffffULL)) + +/* + * Symbol table entries. + */ + +typedef struct { + Elf64_Word name; /* String table index of name. */ + unsigned char info; /* Type and binding information. */ + unsigned char other; /* Reserved (not used). */ + Elf64_Half shndx; /* Section index of symbol. */ + Elf64_Addr value; /* Symbol value. */ + Elf64_Xword size; /* Size of associated object. */ +} Elf64_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF64_ST_BIND(info) ((info) >> 4) +#define ELF64_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* + * Go linker interface + */ + +#define ELF64HDRSIZE 64 +#define ELF64PHDRSIZE 56 +#define ELF64SHDRSIZE 64 +#define ELF64RELSIZE 16 +#define ELF64RELASIZE 24 +#define ELF64SYMSIZE sizeof(Elf64_Sym) + +#define ELF32HDRSIZE sizeof(Elf32_Ehdr) +#define ELF32PHDRSIZE sizeof(Elf32_Phdr) +#define ELF32SHDRSIZE sizeof(Elf32_Shdr) +#define ELF32SYMSIZE sizeof(Elf32_Sym) +#define ELF32RELSIZE 8 \ No newline at end of file From c80037bbab880d7cfb63f3e411ff3f3fc61c2962 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:47:11 +0100 Subject: [PATCH 050/350] rimage: elf.h: use stdint --- rimage/elf.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/rimage/elf.h b/rimage/elf.h index d4f3955c2528..aae7d92bc078 100644 --- a/rimage/elf.h +++ b/rimage/elf.h @@ -50,15 +50,17 @@ * not include the padding. */ -typedef unsigned __int64 uint64; -typedef unsigned __int32 uint32; -typedef unsigned __int16 uint16; -typedef unsigned __int8 uint8; +#include -typedef __int64 int64; -typedef __int32 int32; -typedef __int16 int16; -typedef __int8 int8; +typedef uint64_t uint64; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint8_t uint8; + +typedef int64_t int64; +typedef int32_t int32; +typedef int16_t int16; +typedef int8_t int8; typedef struct { @@ -958,4 +960,4 @@ typedef struct { #define ELF32PHDRSIZE sizeof(Elf32_Phdr) #define ELF32SHDRSIZE sizeof(Elf32_Shdr) #define ELF32SYMSIZE sizeof(Elf32_Sym) -#define ELF32RELSIZE 8 \ No newline at end of file +#define ELF32RELSIZE 8 From 552fc49e0f18993f1df242c8fea5bd1f01236b49 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:52:35 +0100 Subject: [PATCH 051/350] rimage: use local elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.c | 184 +++++++++++++++++++++---------------------- rimage/file_simple.c | 52 ++++++------ rimage/manifest.c | 34 ++++---- rimage/rimage.h | 3 +- 4 files changed, 137 insertions(+), 136 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index e2c6e8ff8257..2eec2c048dfe 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -30,7 +30,7 @@ static int elf_read_sections(struct image *image, struct module *module) int man_section_idx; /* read in section header */ - ret = fseek(module->fd, hdr->e_shoff, SEEK_SET); + ret = fseek(module->fd, hdr->shoff, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to %s section header %d\n", module->elf_file, ret); @@ -38,37 +38,37 @@ static int elf_read_sections(struct image *image, struct module *module) } /* allocate space for each section header */ - section = calloc(sizeof(Elf32_Shdr), hdr->e_shnum); + section = calloc(sizeof(Elf32_Shdr), hdr->shnum); if (section == NULL) return -ENOMEM; module->section = section; /* read in sections */ - count = fread(section, sizeof(Elf32_Shdr), hdr->e_shnum, module->fd); - if (count != hdr->e_shnum) { + count = fread(section, sizeof(Elf32_Shdr), hdr->shnum, module->fd); + if (count != hdr->shnum) { fprintf(stderr, "error: failed to read %s section header %d\n", module->elf_file, -errno); return -errno; } /* read in strings */ - module->strings = calloc(1, section[hdr->e_shstrndx].sh_size); + module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", module->elf_file, -errno); return -errno; } - ret = fseek(module->fd, section[hdr->e_shstrndx].sh_offset, SEEK_SET); + ret = fseek(module->fd, section[hdr->shstrndx].off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to %s stringss %d\n", module->elf_file, ret); return ret; } - count = fread(module->strings, 1, section[hdr->e_shstrndx].sh_size, + count = fread(module->strings, 1, section[hdr->shstrndx].size, module->fd); - if (count != section[hdr->e_shstrndx].sh_size) { + if (count != section[hdr->shstrndx].size) { fprintf(stderr, "error: failed to read %s strings %d\n", module->elf_file, -errno); return -errno; @@ -98,26 +98,26 @@ static int elf_read_sections(struct image *image, struct module *module) module->fw_ready_index); /* parse each section */ - for (i = 0; i < hdr->e_shnum; i++) { + for (i = 0; i < hdr->shnum; i++) { /* only write valid sections */ - if (!(section[i].sh_flags & valid)) + if (!(section[i].flags & valid)) continue; - switch (section[i].sh_type) { + switch (section[i].type) { case SHT_NOBITS: /* bss */ - module->bss_size += section[i].sh_size; + module->bss_size += section[i].size; module->num_bss++; break; case SHT_PROGBITS: /* text or data */ - module->fw_size += section[i].sh_size; + module->fw_size += section[i].size; - if (section[i].sh_flags & SHF_EXECINSTR) - module->text_size += section[i].sh_size; + if (section[i].flags & SHF_EXECINSTR) + module->text_size += section[i].size; else - module->data_size += section[i].sh_size; + module->data_size += section[i].size; break; default: continue; @@ -129,19 +129,19 @@ static int elf_read_sections(struct image *image, struct module *module) continue; fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_type); + i, section[i].type); fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_flags); + i, section[i].flags); fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_addr); + i, section[i].vaddr); fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_offset); + i, section[i].off); fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_size); + i, section[i].size); fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_link); + i, section[i].link); fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, - i, section[i].sh_info); + i, section[i].info); } return 0; @@ -155,7 +155,7 @@ static int elf_read_programs(struct image *image, struct module *module) int i, ret; /* read in program header */ - ret = fseek(module->fd, hdr->e_phoff, SEEK_SET); + ret = fseek(module->fd, hdr->phoff, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to %s program header %d\n", module->elf_file, ret); @@ -163,42 +163,42 @@ static int elf_read_programs(struct image *image, struct module *module) } /* allocate space for programs */ - prg = calloc(sizeof(Elf32_Phdr), hdr->e_phnum); + prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); if (prg == NULL) return -ENOMEM; module->prg = prg; /* read in programs */ - count = fread(prg, sizeof(Elf32_Phdr), hdr->e_phnum, module->fd); - if (count != hdr->e_phnum) { + count = fread(prg, sizeof(Elf32_Phdr), hdr->phnum, module->fd); + if (count != hdr->phnum) { fprintf(stderr, "error: failed to read %s program header %d\n", module->elf_file, -errno); return -errno; } /* check each program */ - for (i = 0; i < hdr->e_phnum; i++) { + for (i = 0; i < hdr->phnum; i++) { - if (prg[i].p_filesz == 0) + if (prg[i].filesz == 0) continue; if (!image->verbose) continue; fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_type); + module->elf_file, i, prg[i].type); fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_offset); + module->elf_file, i, prg[i].off); fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_vaddr); + module->elf_file, i, prg[i].vaddr); fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_paddr); + module->elf_file, i, prg[i].paddr); fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_filesz); + module->elf_file, i, prg[i].filesz); fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_memsz); + module->elf_file, i, prg[i].memsz); fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", - module->elf_file, i, prg[i].p_flags); + module->elf_file, i, prg[i].flags); } return 0; @@ -221,21 +221,21 @@ static int elf_read_hdr(struct image *image, struct module *module) return 0; fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", - module->elf_file, hdr->e_entry); + module->elf_file, hdr->entry); fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", - module->elf_file, hdr->e_phoff); + module->elf_file, hdr->phoff); fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", - module->elf_file, hdr->e_shoff); + module->elf_file, hdr->shoff); fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", - module->elf_file, hdr->e_phentsize); + module->elf_file, hdr->phentsize); fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", - module->elf_file, hdr->e_phnum); + module->elf_file, hdr->phnum); fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", - module->elf_file, hdr->e_shentsize); + module->elf_file, hdr->shentsize); fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", - module->elf_file, hdr->e_shnum); + module->elf_file, hdr->shnum); fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", - module->elf_file, hdr->e_shstrndx); + module->elf_file, hdr->shstrndx); return 0; } @@ -244,8 +244,8 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) { uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < image->adsp->rom_base || start > image->adsp->rom_base + image->adsp->rom_size) @@ -259,23 +259,23 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) static void elf_module_size(struct image *image, struct module *module, Elf32_Shdr *section, int index) { - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) { + if (section->flags & SHF_EXECINSTR) { /* text */ - if (module->text_start > section->sh_addr) - module->text_start = section->sh_addr; - if (module->text_end < section->sh_addr + section->sh_size) - module->text_end = section->sh_addr + section->sh_size; + if (module->text_start > section->vaddr) + module->text_start = section->vaddr; + if (module->text_end < section->vaddr + section->size) + module->text_end = section->vaddr + section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ - if (module->data_start > section->sh_addr) - module->data_start = section->sh_addr; - if (module->data_end < section->sh_addr + section->sh_size) - module->data_end = section->sh_addr + section->sh_size; + if (module->data_start > section->vaddr) + module->data_start = section->vaddr; + if (module->data_end < section->vaddr + section->size) + module->data_end = section->vaddr + section->size; fprintf(stdout, "\tDATA\t"); } @@ -284,8 +284,8 @@ static void elf_module_size(struct image *image, struct module *module, /* bss */ if (index == module->bss_index) { /* updated the .bss segment */ - module->bss_start = section->sh_addr; - module->bss_end = section->sh_addr + section->sh_size; + module->bss_start = section->vaddr; + module->bss_end = section->vaddr + section->size; fprintf(stdout, "\tBSS\t"); } else { fprintf(stdout, "\tHEAP\t"); @@ -302,19 +302,19 @@ static void elf_module_size(struct image *image, struct module *module, static void elf_module_size_reloc(struct image *image, struct module *module, Elf32_Shdr *section, int index) { - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) { + if (section->flags & SHF_EXECINSTR) { /* text */ module->text_start = 0; - module->text_end += section->sh_size; + module->text_end += section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ module->data_start = 0; - module->data_end += section->sh_size; + module->data_end += section->size; fprintf(stdout, "\tDATA\t"); } @@ -323,8 +323,8 @@ static void elf_module_size_reloc(struct image *image, struct module *module, /* bss */ if (index == module->bss_index) { /* updated the .bss segment */ - module->bss_start = section->sh_addr; - module->bss_end = section->sh_addr + section->sh_size; + module->bss_start = section->vaddr; + module->bss_end = section->vaddr + section->size; fprintf(stdout, "\tBSS\t"); } else { fprintf(stdout, "\tHEAP\t"); @@ -346,12 +346,12 @@ static void elf_module_limits(struct image *image, struct module *module) module->text_end = module->data_end = module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", - module->hdr.e_shnum); + module->hdr.shnum); fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); /* iterate all sections and get size of segments */ - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; @@ -360,10 +360,10 @@ static void elf_module_limits(struct image *image, struct module *module) i != module->fw_ready_index) { /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; if (elf_is_rom(image, section)) @@ -371,8 +371,8 @@ static void elf_module_limits(struct image *image, struct module *module) } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, - section->sh_addr, section->sh_addr + section->sh_size, - section->sh_size); + section->vaddr, section->vaddr + section->size, + section->size); /* text or data section */ if (image->reloc) @@ -381,7 +381,7 @@ static void elf_module_limits(struct image *image, struct module *module) elf_module_size(image, module, section, i); /* section name */ - fprintf(stdout, "%s\n", module->strings + section->sh_name); + fprintf(stdout, "%s\n", module->strings + section->name); } fprintf(stdout, "\n"); @@ -401,30 +401,30 @@ int elf_validate_section(struct image *image, struct module *module, m = &image->module[i]; /* for each section */ - for (j = 0; j < m->hdr.e_shnum; j++) { + for (j = 0; j < m->hdr.shnum; j++) { s = &m->section[j]; if (s == section) continue; /* only check valid sections */ - if (!(s->sh_flags & valid)) + if (!(s->flags & valid)) continue; - if (s->sh_size == 0) + if (s->size == 0) continue; /* is section start non overlapping ? */ - if (section->sh_addr >= s->sh_addr && - section->sh_addr < - s->sh_addr + s->sh_size) { + if (section->vaddr >= s->vaddr && + section->vaddr < + s->vaddr + s->size) { goto err; } /* is section end non overlapping ? */ - if (section->sh_addr + section->sh_size > s->sh_addr && - section->sh_addr + section->sh_size <= - s->sh_addr + s->sh_size) { + if (section->vaddr + section->size > s->vaddr && + section->vaddr + section->size <= + s->vaddr + s->size) { goto err; } } @@ -436,8 +436,8 @@ int elf_validate_section(struct image *image, struct module *module, fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", module->elf_file, index, m->elf_file, j); fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", - section->sh_addr, section->sh_addr + section->sh_size, - s->sh_addr, s->sh_addr + s->sh_size); + section->vaddr, section->vaddr + section->size, + s->vaddr, s->vaddr + s->size); return -EINVAL; } @@ -458,14 +458,14 @@ int elf_validate_modules(struct image *image) module = &image->module[i]; /* for each section */ - for (j = 0; j < module->hdr.e_shnum; j++) { + for (j = 0; j < module->hdr.shnum; j++) { section = &module->section[j]; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; /* is section non overlapping ? */ @@ -487,31 +487,31 @@ int elf_find_section(struct image *image, struct module *module, size_t count; int ret, i; - section = &module->section[hdr->e_shstrndx]; + section = &module->section[hdr->shstrndx]; /* alloc data data */ - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (buffer == NULL) return -ENOMEM; /* read in section string data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to string section %d\n", ret); goto out; } - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: can't read string section %d\n", -errno); ret = -errno; goto out; } /* find section with name */ - for (i = 0; i < hdr->e_shnum; i++) { + for (i = 0; i < hdr->shnum; i++) { s = &module->section[i]; - if (!strcmp(name, buffer + s->sh_name)) { + if (!strcmp(name, buffer + s->name)) { ret = i; goto out; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index b69bd8e52d6b..5d60de9bdda1 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -49,8 +49,8 @@ static int is_iram(struct image *image, Elf32_Shdr *section) const struct adsp *adsp = image->adsp; uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < adsp->iram_base) return 0; @@ -66,8 +66,8 @@ static int is_dram(struct image *image, Elf32_Shdr *section) const struct adsp *adsp = image->adsp; uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < adsp->dram_base) return 0; @@ -90,7 +90,7 @@ static int write_block(struct image *image, struct module *module, void *buffer; int ret; - block.size = section->sh_size; + block.size = section->size; if (block.size % 4) { /* make block.size divisible by 4 to avoid unaligned accesses */ padding = 4 - (block.size % 4); @@ -99,15 +99,15 @@ static int write_block(struct image *image, struct module *module, if (is_iram(image, section)) { block.type = SOF_BLK_TEXT; - block.offset = section->sh_addr - adsp->iram_base + block.offset = section->vaddr - adsp->iram_base + adsp->host_iram_offset; } else if (is_dram(image, section)) { block.type = SOF_BLK_DATA; - block.offset = section->sh_addr - adsp->dram_base + block.offset = section->vaddr - adsp->dram_base + adsp->host_dram_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", - section->sh_addr, section->sh_size); + section->vaddr, section->size); return -EINVAL; } @@ -117,18 +117,18 @@ static int write_block(struct image *image, struct module *module, return -errno; /* alloc data data */ - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (buffer == NULL) return -ENOMEM; /* read in section data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to section %d\n", ret); goto out; } - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: cant read section %d\n", -errno); ret = -errno; goto out; @@ -139,13 +139,13 @@ static int write_block(struct image *image, struct module *module, if (count != block.size) { fprintf(stderr, "error: cant write section %d\n", -errno); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", - section->sh_offset, section->sh_size, section->sh_addr); + section->off, section->size, section->vaddr); ret = -errno; goto out; } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, - section->sh_addr, section->sh_size, ftell(image->out_fd), + section->vaddr, section->size, ftell(image->out_fd), block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); out: @@ -195,16 +195,16 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; /* only write valid sections */ - if (!(module->section[i].sh_flags & valid)) + if (!(module->section[i].flags & valid)) continue; /* dont write bss */ - if (section->sh_type == SHT_NOBITS) + if (section->type == SHT_NOBITS) continue; err = write_block(image, module, section); @@ -404,7 +404,7 @@ int write_logs_dictionary(struct image *image) if (!buffer) return -ENOMEM; - fseek(module->fd, section->sh_offset, SEEK_SET); + fseek(module->fd, section->off, SEEK_SET); size_t count = fread(buffer, 1, sizeof(struct sof_ipc_fw_ready), module->fd); @@ -427,29 +427,29 @@ int write_logs_dictionary(struct image *image) if (module->logs_index > 0) { Elf32_Shdr *section = &module->section[module->logs_index]; - header.base_address = section->sh_addr; - header.data_length = section->sh_size; + header.base_address = section->vaddr; + header.data_length = section->size; fwrite(&header, sizeof(struct snd_sof_logs_header), 1, image->ldc_out_fd); - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (!buffer) return -ENOMEM; - fseek(module->fd, section->sh_offset, SEEK_SET); - size_t count = fread(buffer, 1, section->sh_size, + fseek(module->fd, section->off, SEEK_SET); + size_t count = fread(buffer, 1, section->size, module->fd); - if (count != section->sh_size) { + if (count != section->size) { fprintf(stderr, "error: can't read logs section %d\n", -errno); ret = -errno; goto out; } - count = fwrite(buffer, 1, section->sh_size, + count = fwrite(buffer, 1, section->size, image->ldc_out_fd); - if (count != section->sh_size) { + if (count != section->size) { fprintf(stderr, "error: can't write section %d\n", -errno); ret = -errno; diff --git a/rimage/manifest.c b/rimage/manifest.c index 17cab87ee0e0..3d07598a3a4b 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -129,10 +129,10 @@ static uint32_t elf_to_file_offset(struct image *image, struct module *module, struct sof_man_module *man_module, Elf32_Shdr *section) { - uint32_t elf_addr = section->sh_addr, file_offset = 0; + uint32_t elf_addr = section->vaddr, file_offset = 0; - if (section->sh_type == SHT_PROGBITS) { - if (section->sh_flags & SHF_EXECINSTR) { + if (section->type == SHT_PROGBITS) { + if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + module->foffset; @@ -142,7 +142,7 @@ static uint32_t elf_to_file_offset(struct image *image, module->foffset + module->text_fixup_size; } - } else if (section->sh_type == SHT_NOBITS) { + } else if (section->type == SHT_NOBITS) { /* bss segment */ file_offset = 0; } @@ -157,15 +157,15 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, { uint32_t offset = elf_to_file_offset(image, module, man_module, section); - uint32_t end = offset + section->sh_size; + uint32_t end = offset + section->size; int seg_type = -1; void *buffer = image->fw_image + offset; size_t count; - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) + if (section->flags & SHF_EXECINSTR) seg_type = SOF_MAN_SEGMENT_TEXT; else seg_type = SOF_MAN_SEGMENT_RODATA; @@ -184,8 +184,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: cant read section %d\n", -errno); return -errno; } @@ -195,7 +195,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, image->image_end = end; fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, - section->sh_addr, section->sh_size, offset, + section->vaddr, section->size, offset, seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); return 0; @@ -207,7 +207,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, int ret; /* seek to ELF section */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); return ret; @@ -243,11 +243,11 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* load in manifest data */ /* module built using xcc has preceding bytes */ - if (section->sh_size > sizeof(sof_mod)) + if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->sh_offset + XCC_MOD_OFFSET, SEEK_SET); + section->off + XCC_MOD_OFFSET, SEEK_SET); else - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); @@ -443,15 +443,15 @@ static int man_module_create(struct image *image, struct module *module, return -EINVAL; /* find all sections and copy to corresponding segments */ - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; /* text or data section */ diff --git a/rimage/rimage.h b/rimage/rimage.h index 2c06f740ccfe..4f294fc082cf 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -16,8 +16,9 @@ #ifndef __RIMAGE_H__ #define __RIMAGE_H__ +#include "elf.h" + #include -#include #include #include From 93c57421719a19dc1ce0433bd2bb3f8caeabd97a Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:33:30 +0100 Subject: [PATCH 052/350] rimage: fix for gcc8.1 -Wstringop-truncation Signed-off-by: Janusz Jankowski --- rimage/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index adee7a9b3221..670c3096a189 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -96,7 +96,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); else - strncpy(path, image->key_name, 256); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "r"); From e771e65125a95a8a49894e97c79341d1fe86698b Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:47:10 +0100 Subject: [PATCH 053/350] rimage: cast size_t to correct format types Signed-off-by: Janusz Jankowski --- rimage/file_simple.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 5d60de9bdda1..d1ff9377d5ae 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -375,8 +375,9 @@ static int simple_write_firmware(struct image *image) return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", - hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), - hdr.num_modules); + (long) (hdr.file_size + sizeof(hdr)), + (long) (hdr.file_size + sizeof(hdr)), + hdr.num_modules); return 0; } @@ -459,7 +460,7 @@ int write_logs_dictionary(struct image *image) fprintf(stdout, "logs dictionary: size %u\n", header.data_length + header.data_offset); fprintf(stdout, "including fw version of size: %lu\n\n", - sizeof(header.version)); + (unsigned long) sizeof(header.version)); } } out: From 13f74da9791375d2f590e5083be661f57b874864 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:53:06 +0100 Subject: [PATCH 054/350] rimage: use time_t for localtime Signed-off-by: Janusz Jankowski --- rimage/css.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index d76316891848..2dafff0dea07 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -25,13 +25,15 @@ void ri_css_v1_8_hdr_create(struct image *image) struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; + time_t seconds; int val; fprintf(stdout, " cse: completing CSS manifest\n"); /* get local time and date */ gettimeofday(&tv, NULL); - date = localtime(&tv.tv_sec); + seconds = tv.tv_sec; + date = localtime(&seconds); if (!date) { fprintf(stderr, "error: cant get localtime %d\n", -errno); @@ -80,13 +82,15 @@ void ri_css_v1_5_hdr_create(struct image *image) struct css_header_v1_5 *css = image->fw_image; struct tm *date; struct timeval tv; + time_t seconds; int val; fprintf(stdout, " cse: completing CSS manifest\n"); /* get local time and date */ gettimeofday(&tv, NULL); - date = localtime(&tv.tv_sec); + seconds = tv.tv_sec; + date = localtime(&seconds); if (!date) { fprintf(stderr, "error: cant get localtime %d\n", -errno); From 24259d7967953c0567696737df632a601145d2f8 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 08:04:54 +0100 Subject: [PATCH 055/350] rimage: use fopen binary mode --- rimage/elf.c | 2 +- rimage/manifest.c | 6 +++--- rimage/pkcs1_5.c | 4 ++-- rimage/rimage.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 2eec2c048dfe..0d7830806a52 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -541,7 +541,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module = &image->module[module_index]; /* open the elf input file */ - module->fd = fopen(name, "r"); + module->fd = fopen(name, "rb"); if (module->fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", name, errno); diff --git a/rimage/manifest.c b/rimage/manifest.c index 3d07598a3a4b..33d8abf542f7 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -44,7 +44,7 @@ static int man_open_rom_file(struct image *image) return -ENOMEM; /* open ROM outfile for writing */ - image->out_rom_fd = fopen(image->out_rom_file, "w"); + image->out_rom_fd = fopen(image->out_rom_file, "wb"); if (image->out_rom_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); @@ -59,7 +59,7 @@ static int man_open_unsigned_file(struct image *image) unlink(image->out_unsigned_file); /* open unsigned FW outfile for writing */ - image->out_unsigned_fd = fopen(image->out_unsigned_file, "w"); + image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); if (image->out_unsigned_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); @@ -74,7 +74,7 @@ static int man_open_manifest_file(struct image *image) sprintf(image->out_man_file, "%s.met", image->out_file); unlink(image->out_man_file); - image->out_man_fd = fopen(image->out_man_file, "w"); + image->out_man_fd = fopen(image->out_man_file, "wb"); if (image->out_man_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 670c3096a189..76d309ee5dfb 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -99,7 +99,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); - fp = fopen(path, "r"); + fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); @@ -190,7 +190,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, strcpy(path, image->key_name); fprintf(stdout, " pkcs: signing with key %s\n", path); - fp = fopen(path, "r"); + fp = fopen(path, "rb"); if (fp == NULL) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); diff --git a/rimage/rimage.c b/rimage/rimage.c index ae0299b707aa..807939b8fda0 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) /* open outfile for writing */ unlink(image.out_file); - image.out_fd = fopen(image.out_file, "w"); + image.out_fd = fopen(image.out_file, "wb"); if (image.out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware(&image); unlink(image.ldc_out_file); - image.ldc_out_fd = fopen(image.ldc_out_file, "w"); + image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); if (image.ldc_out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.ldc_out_file, errno); From b05f9bd3ffeb2f1185f42779db40e9b1c8700209 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 7 Jan 2019 13:44:44 +0100 Subject: [PATCH 056/350] sue: use rimage for image building Fix bugs in Sue Creek support for rimage: - use a correct manifest offset - place the image higher into RAM to avoid overwriting itself when copying the SOF proper. Signed-off-by: Guennadi Liakhovetski --- rimage/manifest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/manifest.h b/rimage/manifest.h index d06c0b11ceb2..6622f521aea5 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -41,7 +41,7 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 -#define MAN_DESC_OFFSET_V1_5_SUE 0x4000 +#define MAN_DESC_OFFSET_V1_5_SUE 0x2000 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ From b65618612b1904548de76bf8564f9d27d5686f0a Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Fri, 1 Feb 2019 17:15:40 +0200 Subject: [PATCH 057/350] rimage: Refine sof fw blk type Change the name of the enums to reflect the type of memory where the given block will be loaded. DATA section is mapped to DRAM, TEXT section is mapped to SRAM. No ABI breakage. We also reserve several slots for future use. Signed-off-by: Daniel Baluta --- rimage/file_simple.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index d1ff9377d5ae..2a76bd7b48ce 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -98,11 +98,11 @@ static int write_block(struct image *image, struct module *module, } if (is_iram(image, section)) { - block.type = SOF_BLK_TEXT; + block.type = SOF_FW_BLK_TYPE_IRAM; block.offset = section->vaddr - adsp->iram_base + adsp->host_iram_offset; } else if (is_dram(image, section)) { - block.type = SOF_BLK_DATA; + block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = section->vaddr - adsp->dram_base + adsp->host_dram_offset; } else { @@ -146,7 +146,7 @@ static int write_block(struct image *image, struct module *module, fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, section->vaddr, section->size, ftell(image->out_fd), - block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); out: free(buffer); @@ -241,7 +241,7 @@ static int write_block_reloc(struct image *image, struct module *module) int ret; block.size = module->file_size; - block.type = SOF_BLK_DATA; + block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = 0; /* write header */ @@ -277,7 +277,7 @@ static int write_block_reloc(struct image *image, struct module *module) fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, 0, module->file_size, ftell(image->out_fd), - block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); out: free(buffer); From 42aca3d129179577b6b362e4d9a0a42e431b4f43 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Fri, 1 Feb 2019 17:48:59 +0200 Subject: [PATCH 058/350] rimage: Describe memory as an array of zones Use new block types added to describe memory for a platform as an array of zones. The block type will be an index into the array. A memory zone is described by (base, size, host_offset). With this map we can now easily find for a given section in which memory zone it belongs. Because we have 10 zones reserved this patch will allocate extra 12 * 10 = 120 bytes that are not used yet. Signed-off-by: Daniel Baluta --- rimage/elf.c | 10 +-- rimage/file_simple.c | 144 ++++++++++++++++++++++++------------------- rimage/manifest.c | 108 ++++++++++++++++++++++---------- rimage/rimage.h | 20 +++--- 4 files changed, 171 insertions(+), 111 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 0d7830806a52..6abd23b17f5a 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -243,15 +243,17 @@ static int elf_read_hdr(struct image *image, struct module *module) int elf_is_rom(struct image *image, Elf32_Shdr *section) { uint32_t start, end; + uint32_t base, size; start = section->vaddr; end = section->vaddr + section->size; - if (start < image->adsp->rom_base || - start > image->adsp->rom_base + image->adsp->rom_size) + base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; + size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + + if (start < base || start > base + size) return 0; - if (end < image->adsp->rom_base || - end > image->adsp->rom_base + image->adsp->rom_size) + if (end < base || end > base + size) return 0; return 1; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 2a76bd7b48ce..bef7623df841 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -44,38 +44,27 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) -static int is_iram(struct image *image, Elf32_Shdr *section) -{ +static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; - uint32_t start, end; + uint32_t start, end, base, size; + int i; start = section->vaddr; end = section->vaddr + section->size; - if (start < adsp->iram_base) - return 0; - if (start >= adsp->iram_base + adsp->iram_size) - return 0; - if (end > adsp->iram_base + adsp->iram_size) - return 0; - return 1; -} - -static int is_dram(struct image *image, Elf32_Shdr *section) -{ - const struct adsp *adsp = image->adsp; - uint32_t start, end; - - start = section->vaddr; - end = section->vaddr + section->size; + for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { + base = adsp->mem_zones[i].base; + size = adsp->mem_zones[i].size; - if (start < adsp->dram_base) - return 0; - if (start >= adsp->dram_base + adsp->dram_size) - return 0; - if (end > adsp->dram_base + adsp->dram_size) - return 0; - return 1; + if (start < base) + continue; + if (start >= base + size) + continue; + if (end > base + size) + continue; + return i; + } + return SOF_FW_BLK_TYPE_INVALID; } static int block_idx; @@ -97,14 +86,11 @@ static int write_block(struct image *image, struct module *module, block.size += padding; } - if (is_iram(image, section)) { - block.type = SOF_FW_BLK_TYPE_IRAM; - block.offset = section->vaddr - adsp->iram_base - + adsp->host_iram_offset; - } else if (is_dram(image, section)) { - block.type = SOF_FW_BLK_TYPE_DRAM; - block.offset = section->vaddr - adsp->dram_base - + adsp->host_dram_offset; + ret = get_mem_zone_type(image, section); + if (ret != SOF_FW_BLK_TYPE_INVALID) { + block.type = ret; + block.offset = section->vaddr - adsp->mem_zones[ret].base + + adsp->mem_zones[ret].host_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", section->vaddr, section->size); @@ -472,60 +458,90 @@ int write_logs_dictionary(struct image *image) const struct adsp machine_byt = { .name = "byt", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BAYTRAIL, .write_firmware = simple_write_firmware, }; const struct adsp machine_cht = { .name = "cht", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_CHERRYTRAIL, .write_firmware = simple_write_firmware, }; const struct adsp machine_bsw = { .name = "bsw", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BRASWELL, .write_firmware = simple_write_firmware, }; const struct adsp machine_hsw = { .name = "hsw", - .iram_base = HSW_IRAM_BASE, - .iram_size = HSW_IRAM_SIZE, - .host_iram_offset = HSW_IRAM_HOST_OFFSET, - .dram_base = HSW_DRAM_BASE, - .dram_size = HSW_DRAM_SIZE, - .host_dram_offset = HSW_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = HSW_IRAM_BASE, + .size = HSW_IRAM_SIZE, + .host_offset = HSW_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = HSW_DRAM_BASE, + .size = HSW_DRAM_SIZE, + .host_offset = HSW_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_HASWELL, .write_firmware = simple_write_firmware, }; const struct adsp machine_bdw = { .name = "bdw", - .iram_base = BDW_IRAM_BASE, - .iram_size = BDW_IRAM_SIZE, - .host_iram_offset = BDW_IRAM_HOST_OFFSET, - .dram_base = BDW_DRAM_BASE, - .dram_size = BDW_DRAM_SIZE, - .host_dram_offset = BDW_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BDW_IRAM_BASE, + .size = BDW_IRAM_SIZE, + .host_offset = BDW_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BDW_DRAM_BASE, + .size = BDW_DRAM_SIZE, + .host_offset = BDW_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BROADWELL, .write_firmware = simple_write_firmware, }; diff --git a/rimage/manifest.c b/rimage/manifest.c index 33d8abf542f7..3ba3286dbed1 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -35,11 +35,15 @@ static int man_open_rom_file(struct image *image) { + uint32_t size; + sprintf(image->out_rom_file, "%s.rom", image->out_file); unlink(image->out_rom_file); + size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + /* allocate ROM image */ - image->rom_image = calloc(image->adsp->rom_size, 1); + image->rom_image = calloc(size, 1); if (image->rom_image == NULL) return -ENOMEM; @@ -1099,10 +1103,16 @@ static int man_write_fw_meu_v1_8(struct image *image) /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_APL_DSP_ROM_BASE, + .size = ADSP_APL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = APL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, @@ -1113,10 +1123,16 @@ const struct adsp machine_apl = { const struct adsp machine_kbl = { .name = "kbl", - .rom_base = ADSP_KBL_DSP_ROM_BASE, - .rom_size = ADSP_KBL_DSP_ROM_SIZE, - .sram_base = KBL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_KBL_DSP_ROM_BASE, + .size = ADSP_KBL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = KBL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_KABYLAKE, @@ -1127,10 +1143,16 @@ const struct adsp machine_kbl = { const struct adsp machine_skl = { .name = "skl", - .rom_base = ADSP_SKL_DSP_ROM_BASE, - .rom_size = ADSP_SKL_DSP_ROM_SIZE, - .sram_base = SKL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_SKL_DSP_ROM_BASE, + .size = ADSP_SKL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = SKL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SKYLAKE, @@ -1141,12 +1163,20 @@ const struct adsp machine_skl = { const struct adsp machine_cnl = { .name = "cnl", - .rom_base = ADSP_CNL_DSP_ROM_BASE, - .rom_size = ADSP_CNL_DSP_ROM_SIZE, - .imr_base = CNL_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = CNL_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_CNL_DSP_ROM_BASE, + .size = ADSP_CNL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = CNL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = CNL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, @@ -1157,12 +1187,20 @@ const struct adsp machine_cnl = { const struct adsp machine_icl = { .name = "icl", - .rom_base = ADSP_ICL_DSP_ROM_BASE, - .rom_size = ADSP_ICL_DSP_ROM_SIZE, - .imr_base = ICL_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = ICL_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_ICL_DSP_ROM_BASE, + .size = ADSP_ICL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = ICL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = ICL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_ICELAKE, @@ -1173,12 +1211,20 @@ const struct adsp machine_icl = { const struct adsp machine_sue = { .name = "sue", - .rom_base = ADSP_SUE_DSP_ROM_BASE, - .rom_size = ADSP_SUE_DSP_ROM_SIZE, - .imr_base = SUE_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = SUE_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_SUE_DSP_ROM_BASE, + .size = ADSP_SUE_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = SUE_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = SUE_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, diff --git a/rimage/rimage.h b/rimage/rimage.h index 4f294fc082cf..1b94a861ebf8 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -24,6 +24,7 @@ #include #include #include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 @@ -129,23 +130,18 @@ struct image { char out_unsigned_file[256]; }; +struct mem_zone { + uint32_t base; + uint32_t size; + uint32_t host_offset; +}; + /* * Audio DSP descriptor and operations. */ struct adsp { const char *name; - uint32_t iram_base; - uint32_t iram_size; - uint32_t dram_base; - uint32_t dram_size; - uint32_t sram_base; - uint32_t sram_size; - uint32_t host_iram_offset; - uint32_t host_dram_offset; - uint32_t rom_base; - uint32_t rom_size; - uint32_t imr_base; - uint32_t imr_size; + struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; uint32_t image_size; uint32_t dram_offset; From 57d567c2e5f0ca5b99f84d03b36a0e60acd59633 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 5 Mar 2019 13:05:30 +0100 Subject: [PATCH 059/350] rimage: make a "Module reading" view similar to "Module writing" view Size column in both cases instread of Bytes and Size Hex view in both cases instead of Dec and Hex Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6abd23b17f5a..88698816b1df 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -350,7 +350,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tSize\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { @@ -372,7 +372,7 @@ static void elf_module_limits(struct image *image, struct module *module) continue; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x", i, section->vaddr, section->vaddr + section->size, section->size); From 842b860367065ef98b0284830c41f0f2e2c5c3ef Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 12:52:50 +0200 Subject: [PATCH 060/350] rimage: Fix code alignment and indentation issues This was reported by checkpatch.pl and makes code easier to read. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 18 ++++++++--------- rimage/file_simple.c | 18 ++++++++--------- rimage/manifest.c | 47 ++++++++++++++++++++++---------------------- rimage/pkcs1_5.c | 4 ++-- rimage/plat_auth.c | 2 +- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 88698816b1df..598b891e4d07 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -55,7 +55,7 @@ static int elf_read_sections(struct image *image, struct module *module) module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", - module->elf_file, -errno); + module->elf_file, -errno); return -errno; } @@ -259,7 +259,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) } static void elf_module_size(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, int index) { switch (section->type) { case SHT_PROGBITS: @@ -391,7 +391,7 @@ static void elf_module_limits(struct image *image, struct module *module) /* make sure no section overlap from any modules */ int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, int index) { struct module *m; Elf32_Shdr *s; @@ -418,15 +418,15 @@ int elf_validate_section(struct image *image, struct module *module, /* is section start non overlapping ? */ if (section->vaddr >= s->vaddr && - section->vaddr < - s->vaddr + s->size) { + section->vaddr < + s->vaddr + s->size) { goto err; } /* is section end non overlapping ? */ if (section->vaddr + section->size > s->vaddr && - section->vaddr + section->size <= - s->vaddr + s->size) { + section->vaddr + section->size <= + s->vaddr + s->size) { goto err; } } @@ -481,7 +481,7 @@ int elf_validate_modules(struct image *image) } int elf_find_section(struct image *image, struct module *module, - const char *name) + const char *name) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Shdr *section, *s; @@ -546,7 +546,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module->fd = fopen(name, "rb"); if (module->fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", - name, errno); + name, errno); return -EINVAL; } module->elf_file = name; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index bef7623df841..207b84fcc82b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -70,7 +70,7 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { static int block_idx; static int write_block(struct image *image, struct module *module, - Elf32_Shdr *section) + Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; @@ -170,14 +170,14 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); + module->text_start, module->text_end, + module->text_end - module->text_start); fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); + module->data_start, module->data_end, + module->data_end - module->data_start); fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); @@ -418,7 +418,7 @@ int write_logs_dictionary(struct image *image) header.data_length = section->size; fwrite(&header, sizeof(struct snd_sof_logs_header), 1, - image->ldc_out_fd); + image->ldc_out_fd); buffer = calloc(1, section->size); if (!buffer) @@ -435,7 +435,7 @@ int write_logs_dictionary(struct image *image) goto out; } count = fwrite(buffer, 1, section->size, - image->ldc_out_fd); + image->ldc_out_fd); if (count != section->size) { fprintf(stderr, "error: can't write section %d\n", -errno); diff --git a/rimage/manifest.c b/rimage/manifest.c index 3ba3286dbed1..f2a46bc5ea52 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -51,7 +51,7 @@ static int man_open_rom_file(struct image *image) image->out_rom_fd = fopen(image->out_rom_file, "wb"); if (image->out_rom_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_rom_file, errno); + image->out_rom_file, errno); } return 0; @@ -66,7 +66,7 @@ static int man_open_unsigned_file(struct image *image) image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); if (image->out_unsigned_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_unsigned_file, errno); + image->out_unsigned_file, errno); } return 0; @@ -81,7 +81,7 @@ static int man_open_manifest_file(struct image *image) image->out_man_fd = fopen(image->out_man_file, "wb"); if (image->out_man_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_man_file, errno); + image->out_man_file, errno); } return 0; @@ -130,8 +130,9 @@ static int man_init_image_v1_8(struct image *image) /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, - struct module *module, struct sof_man_module *man_module, - Elf32_Shdr *section) + struct module *module, + struct sof_man_module *man_module, + Elf32_Shdr *section) { uint32_t elf_addr = section->vaddr, file_offset = 0; @@ -156,8 +157,9 @@ static uint32_t elf_to_file_offset(struct image *image, /* write SRAM sections */ static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct module *module, struct sof_man_module *man_module, - int section_idx) + struct module *module, + struct sof_man_module *man_module, + int section_idx) { uint32_t offset = elf_to_file_offset(image, module, man_module, section); @@ -185,7 +187,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, * the smallest offset of its modules ATM. */ if (man_module->segment[seg_type].file_offset > offset || - man_module->segment[seg_type].file_offset == 0) + man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; count = fread(buffer, 1, section->size, module->fd); @@ -206,7 +208,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct module *module, struct sof_man_module *man_module, int idx) + struct module *module, + struct sof_man_module *man_module, int idx) { int ret; @@ -225,7 +228,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, } static int man_get_module_manifest(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { Elf32_Shdr *section; struct sof_man_segment_desc *segment; @@ -249,7 +252,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* module built using xcc has preceding bytes */ if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->off + XCC_MOD_OFFSET, SEEK_SET); + section->off + XCC_MOD_OFFSET, SEEK_SET); else ret = fseek(module->fd, section->off, SEEK_SET); @@ -362,7 +365,7 @@ static int man_module_validate(struct sof_man_module *man_module) } static int man_module_create(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { /* create module and segments */ uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -461,7 +464,7 @@ static int man_module_create(struct image *image, struct module *module, /* text or data section */ if (!elf_is_rom(image, section)) err = man_copy_elf_section(image, section, module, - man_module, i); + man_module, i); if (err < 0) { fprintf(stderr, "error: failed to write section #%d\n", i); @@ -492,7 +495,7 @@ static int man_module_create(struct image *image, struct module *module, } static int man_module_create_reloc(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { /* create module and segments */ int err; @@ -582,14 +585,14 @@ static int man_module_create_reloc(struct image *image, struct module *module, } static int man_write_unsigned_mod(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset) { int count; /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext), 1, - image->out_man_fd); + sizeof(struct sof_man_adsp_meta_file_ext), 1, + image->out_man_fd); /* did the metadata/manifest write succeed ? */ if (count != 1) { @@ -601,8 +604,8 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, /* now prepare the unsigned rimage */ count = fwrite(image->fw_image + meta_end_offset, - image->image_end - meta_end_offset, - 1, image->out_unsigned_fd); + image->image_end - meta_end_offset, + 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ if (count != 1) { @@ -620,9 +623,7 @@ static int man_write_fw_mod(struct image *image) int count; /* write manifest and signed image */ - count = fwrite(image->fw_image, - image->image_end, - 1, image->out_fd); + count = fwrite(image->fw_image, image->image_end, 1, image->out_fd); /* did the image write succeed ? */ if (count != 1) { @@ -648,7 +649,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", - module->elf_file); + module->elf_file); module->exec_header = 1; /* set module file offset */ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 76d309ee5dfb..2872d3dc08d7 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -221,8 +221,8 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* sign the manifest */ ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - &siglen, priv_rsa); + (unsigned char *)man->css.signature, + &siglen, priv_rsa); if (ret < 0) fprintf(stderr, "error: failed to sign manifest\n"); diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 522732c24c59..54061b86caa2 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -19,7 +19,7 @@ #include "plat_auth.h" void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset) { struct sof_man_adsp_meta_file_ext *meta = image->fw_image + meta_start_offset; From 97ec5bac809ab55d5659d128167b83dd9f28a153 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 13:09:42 +0200 Subject: [PATCH 061/350] rimage: Remove explicit comparisons to NULL in the rimage/*.c files Comparisons to NULL are now implicit as the checkpatch.pl requires. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 8 ++++---- rimage/file_simple.c | 2 +- rimage/hash.c | 2 +- rimage/manifest.c | 12 ++++++------ rimage/pkcs1_5.c | 10 +++++----- rimage/rimage.c | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 598b891e4d07..f12808374f55 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -39,7 +39,7 @@ static int elf_read_sections(struct image *image, struct module *module) /* allocate space for each section header */ section = calloc(sizeof(Elf32_Shdr), hdr->shnum); - if (section == NULL) + if (!section) return -ENOMEM; module->section = section; @@ -164,7 +164,7 @@ static int elf_read_programs(struct image *image, struct module *module) /* allocate space for programs */ prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); - if (prg == NULL) + if (!prg) return -ENOMEM; module->prg = prg; @@ -493,7 +493,7 @@ int elf_find_section(struct image *image, struct module *module, /* alloc data data */ buffer = calloc(1, section->size); - if (buffer == NULL) + if (!buffer) return -ENOMEM; /* read in section string data */ @@ -544,7 +544,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) /* open the elf input file */ module->fd = fopen(name, "rb"); - if (module->fd == NULL) { + if (!module->fd) { fprintf(stderr, "error: unable to open %s for reading %d\n", name, errno); return -EINVAL; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 207b84fcc82b..f58f8a019020 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -104,7 +104,7 @@ static int write_block(struct image *image, struct module *module, /* alloc data data */ buffer = calloc(1, section->size); - if (buffer == NULL) + if (!buffer) return -ENOMEM; /* read in section data */ diff --git a/rimage/hash.c b/rimage/hash.c index 73b6d72dfab2..7888c72471e5 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -38,7 +38,7 @@ static void *OPENSSL_zalloc(size_t num) { void *ret = OPENSSL_malloc(num); - if (ret != NULL) + if (ret) memset(ret, 0, num); return ret; } diff --git a/rimage/manifest.c b/rimage/manifest.c index f2a46bc5ea52..53b2733a3347 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -44,12 +44,12 @@ static int man_open_rom_file(struct image *image) /* allocate ROM image */ image->rom_image = calloc(size, 1); - if (image->rom_image == NULL) + if (!image->rom_image) return -ENOMEM; /* open ROM outfile for writing */ image->out_rom_fd = fopen(image->out_rom_file, "wb"); - if (image->out_rom_fd == NULL) { + if (!image->out_rom_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); } @@ -64,7 +64,7 @@ static int man_open_unsigned_file(struct image *image) /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); - if (image->out_unsigned_fd == NULL) { + if (!image->out_unsigned_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); } @@ -79,7 +79,7 @@ static int man_open_manifest_file(struct image *image) unlink(image->out_man_file); image->out_man_fd = fopen(image->out_man_file, "wb"); - if (image->out_man_fd == NULL) { + if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); } @@ -119,7 +119,7 @@ static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ image->fw_image = calloc(image->adsp->image_size, 1); - if (image->fw_image == NULL) + if (!image->fw_image) return -ENOMEM; memcpy(image->fw_image, image->adsp->man_v1_8, @@ -1013,7 +1013,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* allocate image */ image->fw_image = calloc(image->adsp->image_size, 1); - if (image->fw_image == NULL) { + if (!image->fw_image) { ret = -ENOMEM; goto err; } diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 2872d3dc08d7..d72cc9f6f651 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -37,11 +37,11 @@ void RSA_get0_key(const RSA *r, void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { - if (n != NULL) + if (n) *n = r->n; - if (e != NULL) + if (e) *e = r->e; - if (d != NULL) + if (d) *d = r->d; } #endif @@ -180,7 +180,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* create new key */ privkey = EVP_PKEY_new(); - if (privkey == NULL) + if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ @@ -191,7 +191,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); - if (fp == NULL) { + if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); return -errno; diff --git a/rimage/rimage.c b/rimage/rimage.c index 807939b8fda0..46e14c30977c 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -93,10 +93,10 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (image.out_file == NULL || mach == NULL) + if (!image.out_file || !mach) usage(argv[0]); - if (image.ldc_out_file == NULL) + if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; /* find machine */ @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) /* open outfile for writing */ unlink(image.out_file); image.out_fd = fopen(image.out_file, "wb"); - if (image.out_fd == NULL) { + if (!image.out_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); ret = -EINVAL; @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) unlink(image.ldc_out_file); image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); - if (image.ldc_out_fd == NULL) { + if (!image.ldc_out_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.ldc_out_file, errno); ret = -EINVAL; From 7a802599ab83391f41ed2a30cb4fc89a8eee11a6 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 13:23:00 +0200 Subject: [PATCH 062/350] rimage: Remove blank lines before/after braces Blank lines aren't necessary after/before open or closed braces. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 4 ---- rimage/file_simple.c | 1 - rimage/man_apl.c | 2 -- rimage/man_cnl.c | 2 -- rimage/man_sue.c | 1 - rimage/manifest.c | 4 ---- 6 files changed, 14 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index f12808374f55..067e6b578ac0 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -99,7 +99,6 @@ static int elf_read_sections(struct image *image, struct module *module) /* parse each section */ for (i = 0; i < hdr->shnum; i++) { - /* only write valid sections */ if (!(section[i].flags & valid)) continue; @@ -178,7 +177,6 @@ static int elf_read_programs(struct image *image, struct module *module) /* check each program */ for (i = 0; i < hdr->phnum; i++) { - if (prg[i].filesz == 0) continue; @@ -354,13 +352,11 @@ static void elf_module_limits(struct image *image, struct module *module) /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* module bss can sometimes be missed */ if (i != module->bss_index && i != module->logs_index && i != module->fw_ready_index) { - /* only check valid sections */ if (!(section->flags & valid)) continue; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index f58f8a019020..109d7ddd9f10 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -182,7 +182,6 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* only write valid sections */ diff --git a/rimage/man_apl.c b/rimage/man_apl.c index f7f1d25f3a13..d03aa54aeb72 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { - .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, .nb_entries = MAN_CSE_PARTS, @@ -86,7 +85,6 @@ struct fw_image_manifest_v1_8 apl_manifest = { }, .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, .ext_len = sizeof(struct partition_info_ext), diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 7142fd26386a..545edb98ff47 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { - .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, .nb_entries = MAN_CSE_PARTS, @@ -85,7 +84,6 @@ struct fw_image_manifest_v1_8 cnl_manifest = { }, .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, .ext_len = sizeof(struct partition_info_ext), diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 741fd0b26a04..0c15157b75a3 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { - .desc = { .header = { .header_id = SOF_MAN_FW_HDR_ID, diff --git a/rimage/manifest.c b/rimage/manifest.c index 53b2733a3347..78ffd1899b0d 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -145,7 +145,6 @@ static uint32_t elf_to_file_offset(struct image *image, /* rodata segment, append to text segment */ file_offset = elf_addr - module->data_start + module->foffset + module->text_fixup_size; - } } else if (section->type == SHT_NOBITS) { /* bss segment */ @@ -330,13 +329,11 @@ static int man_module_validate(struct sof_man_module *man_module) int i, j; for (i = 0; i < 3; i++) { - istart = man_module->segment[i].v_base_addr; iend = istart + man_module->segment[i].flags.r.length * MAN_PAGE_SIZE; for (j = 0; j < 3; j++) { - /* don't validate segment against itself */ if (i == j) continue; @@ -451,7 +448,6 @@ static int man_module_create(struct image *image, struct module *module, /* find all sections and copy to corresponding segments */ for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* only check valid sections */ From a97804f9e9138c6d6587dcf8c2088194ccab4adb Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:45:39 +0200 Subject: [PATCH 063/350] rimage: Split lines over 80 characters Change long lines so they don't exceed 80 characters. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 37 ++++++++++++++++++++----------------- rimage/file_simple.c | 12 ++++++++---- rimage/hash.c | 3 ++- rimage/manifest.c | 10 ++++++---- rimage/pkcs1_5.c | 3 ++- 5 files changed, 38 insertions(+), 27 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 067e6b578ac0..45e47659fa04 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -127,20 +127,20 @@ static int elf_read_sections(struct image *image, struct module *module) if (!image->verbose) continue; - fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, - i, section[i].type); - fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, - i, section[i].flags); - fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, - i, section[i].vaddr); - fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, - i, section[i].off); - fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, - i, section[i].size); - fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, - i, section[i].link); - fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, - i, section[i].info); + fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", + module->elf_file, i, section[i].type); + fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", + module->elf_file, i, section[i].flags); + fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", + module->elf_file, i, section[i].vaddr); + fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", + module->elf_file, i, section[i].off); + fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", + module->elf_file, i, section[i].size); + fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", + module->elf_file, i, section[i].link); + fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", + module->elf_file, i, section[i].info); } return 0; @@ -267,7 +267,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->text_start > section->vaddr) module->text_start = section->vaddr; if (module->text_end < section->vaddr + section->size) - module->text_end = section->vaddr + section->size; + module->text_end = section->vaddr + + section->size; fprintf(stdout, "\tTEXT\t"); } else { @@ -275,7 +276,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->data_start > section->vaddr) module->data_start = section->vaddr; if (module->data_end < section->vaddr + section->size) - module->data_end = section->vaddr + section->size; + module->data_end = section->vaddr + + section->size; fprintf(stdout, "\tDATA\t"); } @@ -501,7 +503,8 @@ int elf_find_section(struct image *image, struct module *module, count = fread(buffer, 1, section->size, module->fd); if (count != section->size) { - fprintf(stderr, "error: can't read string section %d\n", -errno); + fprintf(stderr, "error: can't read string section %d\n", + -errno); ret = -errno; goto out; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 109d7ddd9f10..d546144fb46d 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -194,7 +194,8 @@ static int simple_write_module(struct image *image, struct module *module) err = write_block(image, module, section); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } /* write_block will return padding size */ @@ -328,7 +329,8 @@ static int simple_write_firmware(struct image *image) module = &image->module[i]; module->fw_size += sizeof(struct snd_sof_blk_hdr) * (module->num_sections - module->num_bss); - module->fw_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; + module->fw_size += sizeof(struct snd_sof_mod_hdr) * + hdr.num_modules; hdr.file_size += module->fw_size; } @@ -411,7 +413,8 @@ int write_logs_dictionary(struct image *image) } if (module->logs_index > 0) { - Elf32_Shdr *section = &module->section[module->logs_index]; + Elf32_Shdr *section = + &module->section[module->logs_index]; header.base_address = section->vaddr; header.data_length = section->size; @@ -436,7 +439,8 @@ int write_logs_dictionary(struct image *image) count = fwrite(buffer, 1, section->size, image->ldc_out_fd); if (count != section->size) { - fprintf(stderr, "error: can't write section %d\n", + fprintf(stderr, + "error: can't write section %d\n", -errno); ret = -errno; goto out; diff --git a/rimage/hash.c b/rimage/hash.c index 7888c72471e5..18e2d41e44d6 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -90,7 +90,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash) #endif } -void ri_hash(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) +void ri_hash(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) { module_sha256_create(image); module_sha256_update(image, image->fw_image + offset, size); diff --git a/rimage/manifest.c b/rimage/manifest.c index 78ffd1899b0d..217058080131 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -430,7 +430,8 @@ static int man_module_create(struct image *image, struct module *module, /* bss is last */ man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = module->bss_start; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = + module->bss_start; pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) pages += 1; @@ -463,7 +464,8 @@ static int man_module_create(struct image *image, struct module *module, man_module, i); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } } @@ -811,8 +813,8 @@ static int man_write_fw_v1_5_sue(struct image *image) m->desc.header.preload_page_count = preload_size / MAN_PAGE_SIZE; fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + image->image_end, - m->desc.header.preload_page_count); + FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + + image->image_end, m->desc.header.preload_page_count); /* calculate hash for each module */ man_hash_modules(image, &m->desc); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d72cc9f6f651..23ac4b517bac 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -168,7 +168,8 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, EVP_PKEY *privkey; FILE *fp; const BIGNUM *n, *e, *d; - unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; int ret = -EINVAL, i; From f9556455f168dcc3d74e3dec7264215f019b5c74 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:52:19 +0200 Subject: [PATCH 064/350] rimage: elf: Break down multiple assignment Multiple assignment should be avoided. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 45e47659fa04..9aeb89abf018 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -343,9 +343,12 @@ static void elf_module_limits(struct image *image, struct module *module) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i; - module->text_start = module->data_start = 0xffffffff; + module->text_start = 0xffffffff; + module->data_start = 0xffffffff; module->bss_start = 0; - module->text_end = module->data_end = module->bss_end = 0; + module->text_end = 0; + module->data_end = 0; + module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); From 2861df6cadd5eb9a71aff23334d1dbe1efd0f48e Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:56:05 +0200 Subject: [PATCH 065/350] rimage: Remove multiple blank lines Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 1 - rimage/hash.c | 1 - rimage/manifest.c | 1 - 3 files changed, 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index d546144fb46d..97439962f677 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -13,7 +13,6 @@ * more details. */ - #include #include #include diff --git a/rimage/hash.c b/rimage/hash.c index 18e2d41e44d6..24555bf880f2 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -55,7 +55,6 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) } #endif - #define DEBUG_HASH 0 void module_sha256_create(struct image *image) diff --git a/rimage/manifest.c b/rimage/manifest.c index 217058080131..fb58a5f5dbea 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -15,7 +15,6 @@ * Janusz Jankowski */ - #include #include #include From 8902341a347d2e10268a002bfbd3bf9c70f950be Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:02:48 +0200 Subject: [PATCH 066/350] rimage: file_simple: Move open brace to next line Open brace '{' following function declaration get_mem_zone_type goes on the next line. Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 97439962f677..fdeb0be54e4b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -43,7 +43,8 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) -static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { +static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) +{ const struct adsp *adsp = image->adsp; uint32_t start, end, base, size; int i; From d4949bf42f66c7f52df13fb2e4aff2d70e562f69 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:05:14 +0200 Subject: [PATCH 067/350] rimage: file_simple: Remove unnecessary spaces after cast Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index fdeb0be54e4b..64bbc0c937cc 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -362,8 +362,8 @@ static int simple_write_firmware(struct image *image) return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", - (long) (hdr.file_size + sizeof(hdr)), - (long) (hdr.file_size + sizeof(hdr)), + (long)(hdr.file_size + sizeof(hdr)), + (long)(hdr.file_size + sizeof(hdr)), hdr.num_modules); return 0; @@ -449,7 +449,7 @@ int write_logs_dictionary(struct image *image) fprintf(stdout, "logs dictionary: size %u\n", header.data_length + header.data_offset); fprintf(stdout, "including fw version of size: %lu\n\n", - (unsigned long) sizeof(header.version)); + (unsigned long)sizeof(header.version)); } } out: From bb795aeb2044aaec79b061ddc282683f7f041ae8 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:09:02 +0200 Subject: [PATCH 068/350] rimage: Align block comments on each line Signed-off-by: Diana Ungureanu --- rimage/manifest.c | 4 ++-- rimage/pkcs1_5.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index fb58a5f5dbea..1841b525916d 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -182,8 +182,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } /* file_offset for segment should not be 0s, we set it to - * the smallest offset of its modules ATM. - */ + * the smallest offset of its modules ATM. + */ if (man_module->segment[seg_type].file_offset > offset || man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 23ac4b517bac..957a160586db 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -65,7 +65,7 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * #1-v1_5 of the entire manifest structure, including all * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). -*/ + */ int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 30b456826a6a75f5fec0d9ca409441526fc119d7 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:10:23 +0200 Subject: [PATCH 069/350] rimage: manifest: Remove braces for single statement blocks Braces are unnecessary for single statement blocks. Signed-off-by: Diana Ungureanu --- rimage/manifest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 1841b525916d..c9601c7d7c04 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -238,9 +238,8 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".module"); - if (man_section_idx < 0) { + if (man_section_idx < 0) return -EINVAL; - } fprintf(stdout, " Manifest module metadata section at index %d\n", man_section_idx); @@ -820,9 +819,8 @@ static int man_write_fw_v1_5_sue(struct image *image) /* write the firmware */ ret = man_write_fw_mod(image); - if (ret < 0) { + if (ret < 0) goto err; - } fprintf(stdout, "Firmware manifest and signing completed !\n"); return 0; From 167282bbbecc167dc8d4238fe5943a726bc9d0f9 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 11 Apr 2019 14:09:02 +0200 Subject: [PATCH 070/350] rimage: add option to set imr type Signed-off-by: Janusz Jankowski --- rimage/man_apl.c | 1 - rimage/man_cnl.c | 1 - rimage/manifest.h | 1 + rimage/rimage.c | 11 ++++++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index d03aa54aeb72..ce634712cfe1 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -108,7 +108,6 @@ struct fw_image_manifest_v1_8 apl_manifest = { .adsp_file_ext = { .ext_type = 17, .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), - .imr_type = 3, .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 545edb98ff47..4bd08dff042e 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -107,7 +107,6 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .adsp_file_ext = { .ext_type = 17, .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), - .imr_type = 3, .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/manifest.h b/rimage/manifest.h index 6622f521aea5..c6624b82e982 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -42,6 +42,7 @@ #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 #define MAN_DESC_OFFSET_V1_5_SUE 0x2000 +#define MAN_DEFAULT_IMR_TYPE 3 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ diff --git a/rimage/rimage.c b/rimage/rimage.c index 46e14c30977c..8a64b421d2c3 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -45,6 +45,7 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); fprintf(stdout, "\t -p log dictionary outfile\n"); + fprintf(stdout, "\t -i set IMR type\n"); exit(0); } @@ -53,10 +54,11 @@ int main(int argc, char *argv[]) struct image image; const char *mach = NULL; int opt, ret, i, elf_argc = 0; + int imr_type = MAN_DEFAULT_IMR_TYPE; memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -82,6 +84,9 @@ int main(int argc, char *argv[]) case 'r': image.reloc = 1; break; + case 'i': + imr_type = atoi(optarg); + break; case 'h': usage(argv[0]); break; @@ -116,6 +121,10 @@ int main(int argc, char *argv[]) found: + /* set IMR Type in found machine definition */ + if (image.adsp->man_v1_8) + image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - elf_argc; for (i = elf_argc; i < argc; i++) { From 91d1b29dc9fcccb92060f75dc1045831eb14ac21 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 14 May 2019 10:47:13 +0200 Subject: [PATCH 071/350] uapi: replace sof_man_get_module with SOF_MAN_MODULE_OFFSET Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index c9601c7d7c04..672a761b535f 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -641,7 +641,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, /* if first module is executable then write before manifest */ if (image->adsp->exec_boot_ldr) { - man_module = sof_man_get_module(desc, 0); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(0); module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", @@ -661,7 +661,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, } for (; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i - offset); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); module = &image->module[i]; if (i == 0) @@ -688,7 +688,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) int i; for (i = 0; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); if (image->adsp->exec_boot_ldr && i == 0) { fprintf(stdout, " module: no need to hash %s\n as its exec header\n", From a38e40057f887fa7dd3cd7e385cbd7dd6fbca9dd Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Sat, 2 Feb 2019 00:23:45 +0200 Subject: [PATCH 072/350] rimage: Add support for imx8 Signed-off-by: Daniel Baluta --- rimage/file_simple.c | 31 +++++++++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 34 insertions(+) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 64bbc0c937cc..486818288c32 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -43,6 +43,14 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) +#define IMX8_IRAM_BASE 0x596f8000 +#define IMX8_IRAM_HOST_OFFSET 0x10000 +#define IMX8_IRAM_SIZE 0x800 +#define IMX8_DRAM_BASE 0x596e8000 +#define IMX8_DRAM_SIZE 0x8000 +#define IMX8_SRAM_BASE 0x92400000 +#define IMX8_SRAM_SIZE 0x800000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -548,3 +556,26 @@ const struct adsp machine_bdw = { .machine_id = MACHINE_BROADWELL, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8 = { + .name = "imx8", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8_IRAM_BASE, + .size = IMX8_IRAM_SIZE, + .host_offset = IMX8_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8_DRAM_BASE, + .size = IMX8_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8_SRAM_BASE, + .size = IMX8_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8, + .write_firmware = simple_write_firmware, +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index 8a64b421d2c3..ec0f3dbcf6d8 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -35,6 +35,7 @@ static const struct adsp *machine[] = { &machine_sue, &machine_kbl, &machine_skl, + &machine_imx8, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 1b94a861ebf8..184cadc46049 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -46,6 +46,7 @@ enum machine_id { MACHINE_CANNONLAKE, MACHINE_ICELAKE, MACHINE_SUECREEK, + MACHINE_IMX8, MACHINE_MAX }; @@ -193,6 +194,7 @@ extern const struct adsp machine_icl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; +extern const struct adsp machine_imx8; #endif From 9ce99db72e68d08870b3a5335815c9eb9277b7ad Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 31 May 2019 15:04:48 +0200 Subject: [PATCH 073/350] include: split uapi headers into more directories Some of interface headers are not needed by kernel, but are needed by user-space applications, so we can split them into multiple directories that indicate their purpose. Signed-off-by: Janusz Jankowski --- rimage/file_format.h | 4 ++-- rimage/manifest.c | 2 +- rimage/manifest.h | 2 +- rimage/rimage.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 2ffdf0c68c61..7e66984ec1ea 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,8 +63,8 @@ #ifndef __INCLUDE_FILE_FORMAT_H__ #define __INCLUDE_FILE_FORMAT_H__ -#include -#include +#include +#include #define SND_SOF_LOGS_SIG_SIZE 4 #define SND_SOF_LOGS_SIG "Logs" diff --git a/rimage/manifest.c b/rimage/manifest.c index 672a761b535f..0ff51e169796 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include "rimage.h" #include "file_format.h" diff --git a/rimage/manifest.h b/rimage/manifest.h index c6624b82e982..7858d3199019 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define __MANIFEST_H__ #include -#include +#include #include "css.h" #include "cse.h" #include "plat_auth.h" diff --git a/rimage/rimage.h b/rimage/rimage.h index 184cadc46049..96d04292d8ce 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 From bcf7e66f7d827906615e84ec785b03eb3747bbbf Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 17:44:07 +0200 Subject: [PATCH 074/350] rimage: add spdx identifier for elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.h | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/rimage/elf.h b/rimage/elf.h index aae7d92bc078..a9a6505e7793 100644 --- a/rimage/elf.h +++ b/rimage/elf.h @@ -1,40 +1,8 @@ -/* - * Derived from: - * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ - * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ - * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ - * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ - * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ - * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ +/* SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. * Copyright (c) 2001 David E. O'Brien * Portions Copyright 2009 The Go Authors. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * */ /* From a44fb2c3d86a3061f8dbdd5efe786a2fccd88b08 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 20:01:02 +0200 Subject: [PATCH 075/350] rimage: change license to bsd Signed-off-by: Janusz Jankowski --- rimage/cse.c | 21 +++++------------- rimage/cse.h | 12 ++-------- rimage/css.c | 21 +++++------------- rimage/css.h | 12 ++-------- rimage/elf.c | 21 +++++------------- rimage/file_format.h | 53 +------------------------------------------- rimage/file_simple.c | 17 +++----------- rimage/hash.c | 21 +++++------------- rimage/man_apl.c | 15 +++---------- rimage/man_cnl.c | 15 +++---------- rimage/man_kbl.c | 15 +++---------- rimage/man_sue.c | 15 +++---------- rimage/manifest.c | 23 ++++++------------- rimage/manifest.h | 12 ++-------- rimage/pkcs1_5.c | 21 +++++------------- rimage/plat_auth.c | 21 +++++------------- rimage/plat_auth.h | 12 ++-------- rimage/rimage.c | 17 +++----------- rimage/rimage.h | 14 ++---------- 19 files changed, 72 insertions(+), 286 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index cdfbc87e6088..3524be4eae38 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include "rimage.h" diff --git a/rimage/cse.h b/rimage/cse.h index 28650dadec2b..d262fbafd481 100644 --- a/rimage/cse.h +++ b/rimage/cse.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __CSE_H__ diff --git a/rimage/css.c b/rimage/css.c index 2dafff0dea07..1e9de6d8bc86 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/css.h b/rimage/css.h index a1237dbe5af1..e322cbf68dfc 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __CSS_H__ diff --git a/rimage/elf.c b/rimage/elf.c index 9aeb89abf018..755698dd9697 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/file_format.h b/rimage/file_format.h index 7e66984ec1ea..b0cea780d6f7 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -1,61 +1,10 @@ -/* - * This file is provided under a dual BSD/GPLv2 license. When using or - * redistributing this file, you may do so under either license. - * - * GPL LICENSE SUMMARY - * - * Copyright(c) 2017 Intel Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * The full GNU General Public License is included in this distribution - * in the file called LICENSE.GPL. - * - * BSD LICENSE +/* SPDX-License-Identifier: BSD-3-Clause * * Copyright(c) 2017 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Liam Girdwood */ - /* * Firmware file format . */ diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 486818288c32..be64c7d8aaa7 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -1,17 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2015 Intel Corporation. All rights reserved. #include #include diff --git a/rimage/hash.c b/rimage/hash.c index 24555bf880f2..259fa7b8face 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/man_apl.c b/rimage/man_apl.c index ce634712cfe1..fb84b69b9f6c 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 4bd08dff042e..5f2c993c4a97 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 5fd16f8c3d24..5c37f876c71a 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2018, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 0c15157b75a3..225ca519f4dd 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/manifest.c b/rimage/manifest.c index 0ff51e169796..e04232c45900 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1,19 +1,10 @@ -/* - * Copyright (c) 2018, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - * Janusz Jankowski - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie +// Janusz Jankowski #include #include diff --git a/rimage/manifest.h b/rimage/manifest.h index 7858d3199019..464dfd04078b 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __MANIFEST_H__ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 957a160586db..38bb7f5a59af 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 54061b86caa2..56344dd5bfc4 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include "rimage.h" #include "manifest.h" diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index 253a78bf40a3..c15d2372abb5 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __PLAT_AUTH_H__ diff --git a/rimage/rimage.c b/rimage/rimage.c index ec0f3dbcf6d8..f30e4749ede8 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -1,17 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2015 Intel Corporation. All rights reserved. #include #include diff --git a/rimage/rimage.h b/rimage/rimage.h index 96d04292d8ce..cf752d11548c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -1,16 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015-2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2015-2018 Intel Corporation. All rights reserved. */ #ifndef __RIMAGE_H__ From b737019a6f746f6b2f19573411769fbc4618d1c2 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 21:33:40 +0200 Subject: [PATCH 076/350] cmake: add spdx license identifier Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt index 940c9f513bfc..bdb01d45f0cd 100644 --- a/rimage/CMakeLists.txt +++ b/rimage/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause + cmake_minimum_required(VERSION 3.10) project(SOF_RIMAGE C) From 865f31152a7c5b9db9dadd253a3952d746a517c3 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 6 Jun 2019 10:38:09 +0200 Subject: [PATCH 077/350] rimage: fix possible strcpy and sprintf overflows It's for preventing possible buffer overflow. Signed-off-by: Janusz Jankowski --- rimage/pkcs1_5.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 38bb7f5a59af..ea0c911df75f 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -84,10 +84,12 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) - sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - else + if (!image->key_name) { + snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); + } else { + memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); + } fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); @@ -176,10 +178,12 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) - sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - else - strcpy(path, image->key_name); + if (!image->key_name) { + snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); + } else { + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + } fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); From ccce0999ba18ad66972933d2912ccb7356a8ec89 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 10 Jun 2019 15:42:49 +0200 Subject: [PATCH 078/350] rimage: ignore sections not used by bootloader In case of multiple modules, rimage should not expect these sections in bootloader module: .bss, .static_log_entries .fw_ready. Signed-off-by: Janusz Jankowski --- rimage/elf.c | 56 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 755698dd9697..4db362e8e520 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -11,14 +11,14 @@ #include "cse.h" #include "manifest.h" -static int elf_read_sections(struct image *image, struct module *module) +static int elf_read_sections(struct image *image, struct module *module, + int module_index) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Shdr *section = module->section; size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int man_section_idx; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -65,28 +65,42 @@ static int elf_read_sections(struct image *image, struct module *module) return -errno; } - /* find manifest module data */ - man_section_idx = elf_find_section(image, module, ".bss"); - if (man_section_idx < 0) { - /* no bss - it is OK for boot_ldr */ + if (image->num_modules > 1 && module_index == 0) { + /* In case of multiple modules first one should be bootloader, + * that should not have these sections. + */ + fprintf(stdout, "info: ignore .bss" + " section for bootloader module\n"); + module->bss_start = 0; module->bss_end = 0; - } else { - module->bss_index = man_section_idx; - } - fprintf(stdout, " BSS module metadata section at index %d\n", - man_section_idx); + fprintf(stdout, "info: ignore .static_log_entries" + " section for bootloader module\n"); + + module->logs_index = -EINVAL; - /* find log entries and fw ready sections */ - module->logs_index = elf_find_section(image, module, - ".static_log_entries"); - fprintf(stdout, " static log entries section at index %d\n", - module->logs_index); - module->fw_ready_index = elf_find_section(image, module, - ".fw_ready"); - fprintf(stdout, " fw ready section at index %d\n", - module->fw_ready_index); + fprintf(stdout, "info: ignore .fw_ready" + " section for bootloader module\n"); + + module->fw_ready_index = -EINVAL; + } else { + /* find manifest module data */ + module->bss_index = elf_find_section(image, module, ".bss"); + if (module->bss_index < 0) + return module->bss_index; + + /* find log entries and fw ready sections */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); + if (module->logs_index < 0) + return module->logs_index; + + module->fw_ready_index = elf_find_section(image, module, + ".fw_ready"); + if (module->fw_ready_index < 0) + return module->fw_ready_index; + } /* parse each section */ for (i = 0; i < hdr->shnum; i++) { @@ -567,7 +581,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) } /* read sections */ - ret = elf_read_sections(image, module); + ret = elf_read_sections(image, module, module_index); if (ret < 0) { fprintf(stderr, "error: failed to read base sections %d\n", ret); From 55d795489858439561dbaf75c813529f3d0f14a4 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Wed, 19 Jun 2019 11:57:49 +0200 Subject: [PATCH 079/350] rimage: make .static_log_entries optional section Thats because this section is optional in FW, it will be created only with TRACE enabled Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 4db362e8e520..9b6dbdd84dba 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -93,8 +93,6 @@ static int elf_read_sections(struct image *image, struct module *module, /* find log entries and fw ready sections */ module->logs_index = elf_find_section(image, module, ".static_log_entries"); - if (module->logs_index < 0) - return module->logs_index; module->fw_ready_index = elf_find_section(image, module, ".fw_ready"); From dad03fc17aa2d8d0def4f377f949d9c0eff80df3 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Wed, 19 Jun 2019 12:06:46 +0200 Subject: [PATCH 080/350] rimage: change error to warning if section not found Thats because this function is used also to find optional sections so it will be decided later (outside of this func) if this is actually error Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/elf.c b/rimage/elf.c index 9b6dbdd84dba..3796c9fb50d6 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -524,7 +524,7 @@ int elf_find_section(struct image *image, struct module *module, } } - fprintf(stderr, "error: can't find section %s in module %s\n", name, + fprintf(stderr, "warning: can't find section %s in module %s\n", name, module->elf_file); ret = -EINVAL; From 43e08a04269e00e766e5536f34d1336fc9a74755 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 23 Aug 2019 11:48:20 +0200 Subject: [PATCH 081/350] rimage: xcc module offset option This argument is needed in case of platforms that have different modules padding in xcc binaries. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 2 +- rimage/manifest.h | 2 +- rimage/rimage.c | 8 +++++++- rimage/rimage.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index e04232c45900..7e4cfbf09858 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -240,7 +240,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* module built using xcc has preceding bytes */ if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->off + XCC_MOD_OFFSET, SEEK_SET); + section->off + image->xcc_mod_offset, SEEK_SET); else ret = fseek(module->fd, section->off, SEEK_SET); diff --git a/rimage/manifest.h b/rimage/manifest.h index 464dfd04078b..e43fe524e9e3 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define MAN_PAGE_SIZE 4096 /* start offset for modules built using xcc */ -#define XCC_MOD_OFFSET 0x8 +#define DEFAULT_XCC_MOD_OFFSET 0x8 /* start offset for base FW module */ #define FILE_TEXT_OFFSET_V1_8 0x8000 diff --git a/rimage/rimage.c b/rimage/rimage.c index f30e4749ede8..2efbe941a0c6 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -36,6 +36,7 @@ static void usage(char *name) fprintf(stdout, "\t -s MEU signing offset\n"); fprintf(stdout, "\t -p log dictionary outfile\n"); fprintf(stdout, "\t -i set IMR type\n"); + fprintf(stdout, "\t -x set xcc module offset\n"); exit(0); } @@ -48,7 +49,9 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) { + image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; + + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:x:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -77,6 +80,9 @@ int main(int argc, char *argv[]) case 'i': imr_type = atoi(optarg); break; + case 'x': + image.xcc_mod_offset = atoi(optarg); + break; case 'h': usage(argv[0]); break; diff --git a/rimage/rimage.h b/rimage/rimage.h index cf752d11548c..e33446369a18 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -104,6 +104,7 @@ struct image { struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; + int xcc_mod_offset; /* SHA 256 */ const char *key_name; From 009cd503aa31bdeb5d66427e0b865550b540c8e7 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 23 Aug 2019 11:56:07 +0200 Subject: [PATCH 082/350] rimage: tgl machine definition Add support for tgl platform in rimage tool. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 29 +++++++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 7e4cfbf09858..0e4c1474947c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1087,6 +1087,11 @@ static int man_write_fw_meu_v1_8(struct image *image) #define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 #define ICL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_TGL_DSP_ROM_BASE 0x9F180000 +#define ADSP_TGL_DSP_ROM_SIZE 0x00002000 +#define TGL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define TGL_DSP_HP_BASE_ENTRY 0xbe040000 + /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", @@ -1196,6 +1201,30 @@ const struct adsp machine_icl = { .man_v1_8 = &cnl_manifest, // use the same as CNL }; +const struct adsp machine_tgl = { + .name = "tgl", + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_TGL_DSP_ROM_BASE, + .size = ADSP_TGL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = TGL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = TGL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_TIGERLAKE, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL +}; + const struct adsp machine_sue = { .name = "sue", .mem_zones = { diff --git a/rimage/rimage.c b/rimage/rimage.c index 2efbe941a0c6..cec510fd6031 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -21,6 +21,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_tgl, &machine_sue, &machine_kbl, &machine_skl, diff --git a/rimage/rimage.h b/rimage/rimage.h index e33446369a18..d69c9ff6b62f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -35,6 +35,7 @@ enum machine_id { MACHINE_SKYLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, + MACHINE_TIGERLAKE, MACHINE_SUECREEK, MACHINE_IMX8, MACHINE_MAX @@ -182,6 +183,7 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_tgl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; From b0d68a6bc626c3d56b523ae2b53e3062d5ff3deb Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 18:43:18 +0200 Subject: [PATCH 083/350] manifest: add v2.5 definitions New version of manifest introduced with TGL platform uses SHA384 for component hash. Signed-off-by: Janusz Jankowski --- rimage/cse.c | 2 +- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 4 ++-- rimage/manifest.c | 14 +++++++------- rimage/manifest.h | 6 +++--- rimage/plat_auth.c | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index 3524be4eae38..f3bea3826ae7 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -13,7 +13,7 @@ void ri_cse_create(struct image *image) { struct CsePartitionDirHeader *cse_hdr = image->fw_image; - struct sof_man_adsp_meta_file_ext *meta = image->fw_image + + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct CsePartitionDirEntry *cse_entry = image->fw_image + sizeof(*cse_hdr); diff --git a/rimage/man_apl.c b/rimage/man_apl.c index fb84b69b9f6c..7618fb2c576a 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -31,7 +31,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext), + .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", @@ -98,7 +98,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .adsp_file_ext = { .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5f2c993c4a97..575c2c8e6451 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -30,7 +30,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext), + .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", @@ -97,7 +97,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .adsp_file_ext = { .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/manifest.c b/rimage/manifest.c index 0e4c1474947c..171e479b179c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -578,7 +578,7 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext), 1, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), 1, image->out_man_fd); /* did the metadata/manifest write succeed ? */ @@ -880,7 +880,7 @@ static int man_write_fw_v1_8(struct image *image) /* calculate hash for platform auth data - repeated in hash 2 and 4 */ ri_hash(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext), hash); + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); /* hash values in reverse order */ for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { @@ -920,8 +920,8 @@ static int man_write_fw_v1_8(struct image *image) static int man_write_fw_meu_v1_5(struct image *image) { const int meta_start_offset = image->meu_offset - - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; - struct sof_man_adsp_meta_file_ext *meta; + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v1_8 *meta; struct sof_man_fw_desc *desc; uint32_t preload_size; int ret; @@ -991,8 +991,8 @@ static int man_write_fw_meu_v1_5(struct image *image) static int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; - struct sof_man_adsp_meta_file_ext *meta; + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v1_8 *meta; struct sof_man_fw_desc *desc; uint32_t preload_size; int ret; @@ -1020,7 +1020,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* copy data */ memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, - sizeof(struct sof_man_adsp_meta_file_ext)); + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); diff --git a/rimage/manifest.h b/rimage/manifest.h index e43fe524e9e3..1096dda433f1 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -57,7 +57,7 @@ #define MAN_FW_DESC_OFFSET_V1_8 \ (MAN_META_EXT_OFFSET_V1_8 + \ - sizeof(struct sof_man_adsp_meta_file_ext) + \ + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) #define MAN_DESC_PADDING_SIZE_V1_8 \ @@ -75,7 +75,7 @@ #define MAN_FW_DESC_OFFSET_V1_5 \ (MAN_META_EXT_OFFSET_V1_5 + \ - sizeof(struct sof_man_adsp_meta_file_ext) + \ + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) /* @@ -89,7 +89,7 @@ struct fw_image_manifest_v1_8 { struct signed_pkg_info_ext signed_pkg; struct partition_info_ext partition_info; uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; - struct sof_man_adsp_meta_file_ext adsp_file_ext; + struct sof_man_adsp_meta_file_ext_v1_8 adsp_file_ext; /* reserved / pading at end of ext data - all 0s*/ uint8_t reserved[MAN_EXT_PADDING]; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 56344dd5bfc4..52e3efa00aca 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -12,7 +12,7 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, int meta_end_offset) { - struct sof_man_adsp_meta_file_ext *meta = + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + meta_start_offset; fprintf(stdout, " meta: completing ADSP manifest\n"); @@ -29,7 +29,7 @@ void ri_plat_ext_data_create(struct image *image) { struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET_V1_8; - struct sof_man_adsp_meta_file_ext *meta = + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; From 308436906489e29e499f750fcface785fd65211b Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:16:31 +0200 Subject: [PATCH 084/350] rimage: rename ri_hash We are going to have more hashing function, so they should be named after hashing algorithms. Signed-off-by: Janusz Jankowski --- rimage/hash.c | 4 ++-- rimage/manifest.c | 23 ++++++++++++----------- rimage/rimage.h | 3 ++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index 259fa7b8face..3518c9698975 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -80,8 +80,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash) #endif } -void ri_hash(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) +void ri_sha256(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) { module_sha256_create(image); module_sha256_update(image, image->fw_image + offset, size); diff --git a/rimage/manifest.c b/rimage/manifest.c index 171e479b179c..07cf05c903dc 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -687,11 +687,11 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) continue; } - ri_hash(image, - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); + ri_sha256(image, + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); } return 0; @@ -875,12 +875,13 @@ static int man_write_fw_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ - ri_hash(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); + ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end + - MAN_FW_DESC_OFFSET_V1_8, + m->adsp_file_ext.comp_desc[0].hash); /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_hash(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); + ri_sha256(image, MAN_META_EXT_OFFSET_V1_8, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); /* hash values in reverse order */ for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { @@ -969,7 +970,7 @@ static int man_write_fw_meu_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_hash(image, image->meu_offset, image->image_end - + ri_sha256(image, image->meu_offset, image->image_end - image->meu_offset, meta->comp_desc[0].hash); /* write the unsigned files */ @@ -1042,7 +1043,7 @@ static int man_write_fw_meu_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_hash(image, image->meu_offset, image->image_end - + ri_sha256(image, image->meu_offset, image->image_end - image->meu_offset, meta->comp_desc[0].hash); /* write the unsigned files */ diff --git a/rimage/rimage.h b/rimage/rimage.h index d69c9ff6b62f..111b3c72fa11 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -155,7 +155,8 @@ void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); -void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); +void ri_sha256(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash); int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 1fabda97befd39cfd9ff9cd162e1e4114e573412 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:24:01 +0200 Subject: [PATCH 085/350] rimage: rename module_sha functions These functions are generic and can be used for other SHA algorithms. Signed-off-by: Janusz Jankowski --- rimage/hash.c | 8 ++++---- rimage/pkcs1_5.c | 10 +++++----- rimage/rimage.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index 3518c9698975..ab9d6fce8684 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -56,12 +56,12 @@ void module_sha256_create(struct image *image) EVP_DigestInit_ex(image->mdctx, image->md, NULL); } -void module_sha256_update(struct image *image, uint8_t *data, size_t bytes) +void module_sha_update(struct image *image, uint8_t *data, size_t bytes) { EVP_DigestUpdate(image->mdctx, data, bytes); } -void module_sha256_complete(struct image *image, uint8_t *hash) +void module_sha_complete(struct image *image, uint8_t *hash) { unsigned char md_value[EVP_MAX_MD_SIZE]; unsigned int md_len; @@ -84,6 +84,6 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { module_sha256_create(image); - module_sha256_update(image, image->fw_image + offset, size); - module_sha256_complete(image, hash); + module_sha_update(image, image->fw_image + offset, size); + module_sha_complete(image, hash); } diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index ea0c911df75f..4da4d4877284 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -112,8 +112,8 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, /* calculate the digest */ module_sha256_create(image); - module_sha256_update(image, ptr1, size1); - module_sha256_complete(image, digest); + module_sha_update(image, ptr1, size1); + module_sha_complete(image, digest); fprintf(stdout, " pkcs: digest for manifest is "); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) @@ -206,9 +206,9 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* calculate the digest */ module_sha256_create(image); - module_sha256_update(image, ptr1, size1); - module_sha256_update(image, ptr2, size2); - module_sha256_complete(image, digest); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); fprintf(stdout, " pkcs: digest for manifest is "); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) diff --git a/rimage/rimage.h b/rimage/rimage.h index 111b3c72fa11..919e4d3c62a5 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -151,8 +151,8 @@ struct adsp { int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); -void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); -void module_sha256_complete(struct image *image, uint8_t *hash); +void module_sha_update(struct image *image, uint8_t *data, size_t bytes); +void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, From d33ced649f7e2a4fc65173a59a17963610cafadb Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:28:44 +0200 Subject: [PATCH 086/350] rimage: add SHA384 hashing Signed-off-by: Janusz Jankowski --- rimage/hash.c | 16 ++++++++++++++++ rimage/rimage.h | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/rimage/hash.c b/rimage/hash.c index ab9d6fce8684..24d11a27b94c 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -87,3 +87,19 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); } + +static void module_sha384_create(struct image *image) +{ + image->md = EVP_sha384(); + image->mdctx = EVP_MD_CTX_new(); + + EVP_DigestInit_ex(image->mdctx, image->md, NULL); +} + +void ri_sha384(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) +{ + module_sha384_create(image); + module_sha_update(image, image->fw_image + offset, size); + module_sha_complete(image, hash); +} diff --git a/rimage/rimage.h b/rimage/rimage.h index 919e4d3c62a5..9e4727308dd1 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -107,7 +107,7 @@ struct image { int meu_offset; int xcc_mod_offset; - /* SHA 256 */ + /* SHA 256 & 384 */ const char *key_name; EVP_MD_CTX *mdctx; const EVP_MD *md; @@ -157,6 +157,8 @@ int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); +void ri_sha384(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash); int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 3bf866a961392f4a2f69e78d92c3a2fffe1c887c Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:37:44 +0200 Subject: [PATCH 087/350] rimage: image manifest v2.5 Signed-off-by: Janusz Jankowski --- rimage/manifest.h | 30 ++++++++++++++++++++++++++++++ rimage/rimage.h | 1 + 2 files changed, 31 insertions(+) diff --git a/rimage/manifest.h b/rimage/manifest.h index 1096dda433f1..1f3789b8a681 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -41,6 +41,14 @@ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_FW_DESC_OFFSET_V2_5 \ + (MAN_META_EXT_OFFSET_V1_8 + \ + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ + MAN_EXT_PADDING) + +#define MAN_DESC_PADDING_SIZE_V2_5 \ + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V2_5) + #define MAN_SIG_PKG_OFFSET_V1_8 \ (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) @@ -78,6 +86,28 @@ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) +/* + * Firmware manifest header V2.5 used on TGL onwards + */ +struct fw_image_manifest_v2_5 { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header_v1_8 css; + struct signed_pkg_info_ext signed_pkg; + struct partition_info_ext partition_info; + uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE_V2_5]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + /* * Firmware manifest header V1.8 used on APL onwards */ diff --git a/rimage/rimage.h b/rimage/rimage.h index 9e4727308dd1..def37083df8f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -142,6 +142,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); + struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; struct fw_image_manifest_v1_5_sue *man_v1_5_sue; From 2fd99129c337ee3ad515a531b27df0700616ef75 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 20:05:50 +0200 Subject: [PATCH 088/350] rimage: manifest v2.5 for MEU Add function writing manifest v2.5 for MEU. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 103 ++++++++++++++++++++++++++++++++++++++++----- rimage/plat_auth.c | 20 ++++++++- rimage/plat_auth.h | 6 ++- rimage/rimage.c | 3 ++ 4 files changed, 117 insertions(+), 15 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 07cf05c903dc..e9f8195161d8 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -572,13 +572,13 @@ static int man_module_create_reloc(struct image *image, struct module *module, } static int man_write_unsigned_mod(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset, size_t ext_file_size) { int count; /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), 1, + ext_file_size, 1, image->out_man_fd); /* did the metadata/manifest write succeed ? */ @@ -756,7 +756,8 @@ static int man_write_fw_v1_5(struct image *image) /* write the unsigned files*/ ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_5, - MAN_FW_DESC_OFFSET_V1_5); + MAN_FW_DESC_OFFSET_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -861,8 +862,8 @@ static int man_write_fw_v1_8(struct image *image) fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + ri_adsp_meta_data_create_v1_8(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); ri_css_v1_8_hdr_create(image); ri_cse_create(image); @@ -902,7 +903,8 @@ static int man_write_fw_v1_8(struct image *image) /* write the unsigned files*/ ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + MAN_FW_DESC_OFFSET_V1_8, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -959,7 +961,8 @@ static int man_write_fw_meu_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + ri_adsp_meta_data_create_v1_8(image, meta_start_offset, + image->meu_offset); /* write preload page count */ preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_5; @@ -975,7 +978,8 @@ static int man_write_fw_meu_v1_5(struct image *image) /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, - image->meu_offset); + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -1032,7 +1036,8 @@ static int man_write_fw_meu_v1_8(struct image *image) fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + ri_adsp_meta_data_create_v1_8(image, meta_start_offset, + image->meu_offset); /* write preload page count */ preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; @@ -1048,7 +1053,83 @@ static int man_write_fw_meu_v1_8(struct image *image) /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, - image->meu_offset); + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + +/* used to sign with MEU */ +static int man_write_fw_meu_v2_5(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v2_5 *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* copy data */ + memcpy(meta, &image->adsp->man_v2_5->adsp_file_ext, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + memcpy(desc, &image->adsp->man_v2_5->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, meta_start_offset, + image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_sha384(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); if (ret < 0) goto err; @@ -1222,7 +1303,7 @@ const struct adsp machine_tgl = { .dram_offset = 0, .machine_id = MACHINE_TIGERLAKE, .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, + .write_firmware_meu = man_write_fw_meu_v2_5, .man_v1_8 = &cnl_manifest, // use the same as CNL }; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 52e3efa00aca..e8645611f327 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -9,8 +9,8 @@ #include "manifest.h" #include "plat_auth.h" -void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset) +void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, + int meta_end_offset) { struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + meta_start_offset; @@ -25,6 +25,22 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, /* now hash the AdspFwBinaryDesc -> EOF */ } +void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, + int meta_end_offset) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + meta_start_offset; + + fprintf(stdout, " meta: completing ADSP manifest\n"); + + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET_V1_8 + + image->image_end - meta_end_offset; + + fprintf(stdout, " meta: limit is 0x%x\n", + meta->comp_desc[0].limit_offset); + /* now hash the AdspFwBinaryDesc -> EOF */ +} + void ri_plat_ext_data_create(struct image *image) { struct partition_info_ext *part = image->fw_image diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index c15d2372abb5..7e94f8ae12ba 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -78,8 +78,10 @@ struct partition_info_ext { (sizeof(struct partition_info_ext) + \ sizeof(struct signed_pkg_info_ext)) -void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset); +void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, + int meta_end_offset); +void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, + int meta_end_offset); void ri_plat_ext_data_create(struct image *image); #endif diff --git a/rimage/rimage.c b/rimage/rimage.c index cec510fd6031..cff9b7aa9eb5 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -122,6 +122,9 @@ int main(int argc, char *argv[]) if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + if (image.adsp->man_v2_5) + image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - elf_argc; for (i = elf_argc; i < argc; i++) { From dd77445f018c173f0e811092d23b50cfe2d1baa1 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 20:13:59 +0200 Subject: [PATCH 089/350] rimage: update tgl Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 1 + rimage/man_tgl.c | 126 ++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.c | 4 +- rimage/manifest.h | 2 + 4 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 rimage/man_tgl.c diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt index bdb01d45f0cd..dc5d3ac794f8 100644 --- a/rimage/CMakeLists.txt +++ b/rimage/CMakeLists.txt @@ -25,6 +25,7 @@ add_executable(rimage man_cnl.c man_kbl.c man_sue.c + man_tgl.c cse.c css.c plat_auth.c diff --git a/rimage/man_tgl.c b/rimage/man_tgl.c new file mode 100644 index 000000000000..83877e198af7 --- /dev/null +++ b/rimage/man_tgl.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2019 Intel Corporation. All rights reserved. + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include + +/* manifest template */ +struct fw_image_manifest_v2_5 tgl_manifest = { + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header_v1_8) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET_V1_8, + .length = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET_V2_5, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET_V1_8, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0x30000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c index e9f8195161d8..b4db79b0249e 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1302,9 +1302,9 @@ const struct adsp machine_tgl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_TIGERLAKE, - .write_firmware = man_write_fw_v1_8, + .write_firmware = NULL, /* not yet implemented */ .write_firmware_meu = man_write_fw_meu_v2_5, - .man_v1_8 = &cnl_manifest, // use the same as CNL + .man_v2_5 = &tgl_manifest, }; const struct adsp machine_sue = { diff --git a/rimage/manifest.h b/rimage/manifest.h index 1f3789b8a681..32e0574e8db5 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -108,6 +108,8 @@ struct fw_image_manifest_v2_5 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); +extern struct fw_image_manifest_v2_5 tgl_manifest; + /* * Firmware manifest header V1.8 used on APL onwards */ From f3be41dc40dcd2886fc6d13b2b284ca1cee26fea Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 30 Oct 2019 12:36:46 +0800 Subject: [PATCH 090/350] rimage: add support for jsl JSL should have almost same config as ICL, but they should have different fw name. Signed-off-by: Pan Xiuli --- rimage/manifest.c | 24 ++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 1 + 3 files changed, 26 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index b4db79b0249e..343a7dc59b4a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1283,6 +1283,30 @@ const struct adsp machine_icl = { .man_v1_8 = &cnl_manifest, // use the same as CNL }; +const struct adsp machine_jsl = { + .name = "jsl", + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_ICL_DSP_ROM_BASE, + .size = ADSP_ICL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = ICL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = ICL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_ICELAKE, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL +}; + const struct adsp machine_tgl = { .name = "tgl", .mem_zones = { diff --git a/rimage/rimage.c b/rimage/rimage.c index cff9b7aa9eb5..5d18b96d9569 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -21,6 +21,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_jsl, &machine_tgl, &machine_sue, &machine_kbl, diff --git a/rimage/rimage.h b/rimage/rimage.h index def37083df8f..9c3cf8e3537b 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -187,6 +187,7 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_jsl; extern const struct adsp machine_tgl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; From 27a9e918345f308ae9909fcc39a84137eb5d6f38 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 12 Nov 2019 09:27:14 -0800 Subject: [PATCH 091/350] Rename rimage to src and move headers into src/include/rimage This renames the rimage directory to "src". This also moves the header files into src/include/rimage. This is in preparation to allow rimage to be built outside of SOF tree, and it requires some SOF header files. Moving headers under src/include/rimage makes it obvious that these headers are for rimage. Signed-off-by: Daniel Leung --- {rimage => src}/CMakeLists.txt | 0 {rimage => src}/cse.c | 0 {rimage => src}/css.c | 0 {rimage => src}/elf.c | 0 {rimage => src}/file_simple.c | 0 {rimage => src}/hash.c | 0 {rimage => src/include/rimage}/cse.h | 0 {rimage => src/include/rimage}/css.h | 0 {rimage => src/include/rimage}/elf.h | 0 {rimage => src/include/rimage}/file_format.h | 0 {rimage => src/include/rimage}/manifest.h | 0 {rimage => src/include/rimage}/plat_auth.h | 0 {rimage => src/include/rimage}/rimage.h | 0 {rimage => src}/man_apl.c | 0 {rimage => src}/man_cnl.c | 0 {rimage => src}/man_kbl.c | 0 {rimage => src}/man_sue.c | 0 {rimage => src}/man_tgl.c | 0 {rimage => src}/manifest.c | 0 {rimage => src}/pkcs1_5.c | 0 {rimage => src}/plat_auth.c | 0 {rimage => src}/rimage.c | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {rimage => src}/CMakeLists.txt (100%) rename {rimage => src}/cse.c (100%) rename {rimage => src}/css.c (100%) rename {rimage => src}/elf.c (100%) rename {rimage => src}/file_simple.c (100%) rename {rimage => src}/hash.c (100%) rename {rimage => src/include/rimage}/cse.h (100%) rename {rimage => src/include/rimage}/css.h (100%) rename {rimage => src/include/rimage}/elf.h (100%) rename {rimage => src/include/rimage}/file_format.h (100%) rename {rimage => src/include/rimage}/manifest.h (100%) rename {rimage => src/include/rimage}/plat_auth.h (100%) rename {rimage => src/include/rimage}/rimage.h (100%) rename {rimage => src}/man_apl.c (100%) rename {rimage => src}/man_cnl.c (100%) rename {rimage => src}/man_kbl.c (100%) rename {rimage => src}/man_sue.c (100%) rename {rimage => src}/man_tgl.c (100%) rename {rimage => src}/manifest.c (100%) rename {rimage => src}/pkcs1_5.c (100%) rename {rimage => src}/plat_auth.c (100%) rename {rimage => src}/rimage.c (100%) diff --git a/rimage/CMakeLists.txt b/src/CMakeLists.txt similarity index 100% rename from rimage/CMakeLists.txt rename to src/CMakeLists.txt diff --git a/rimage/cse.c b/src/cse.c similarity index 100% rename from rimage/cse.c rename to src/cse.c diff --git a/rimage/css.c b/src/css.c similarity index 100% rename from rimage/css.c rename to src/css.c diff --git a/rimage/elf.c b/src/elf.c similarity index 100% rename from rimage/elf.c rename to src/elf.c diff --git a/rimage/file_simple.c b/src/file_simple.c similarity index 100% rename from rimage/file_simple.c rename to src/file_simple.c diff --git a/rimage/hash.c b/src/hash.c similarity index 100% rename from rimage/hash.c rename to src/hash.c diff --git a/rimage/cse.h b/src/include/rimage/cse.h similarity index 100% rename from rimage/cse.h rename to src/include/rimage/cse.h diff --git a/rimage/css.h b/src/include/rimage/css.h similarity index 100% rename from rimage/css.h rename to src/include/rimage/css.h diff --git a/rimage/elf.h b/src/include/rimage/elf.h similarity index 100% rename from rimage/elf.h rename to src/include/rimage/elf.h diff --git a/rimage/file_format.h b/src/include/rimage/file_format.h similarity index 100% rename from rimage/file_format.h rename to src/include/rimage/file_format.h diff --git a/rimage/manifest.h b/src/include/rimage/manifest.h similarity index 100% rename from rimage/manifest.h rename to src/include/rimage/manifest.h diff --git a/rimage/plat_auth.h b/src/include/rimage/plat_auth.h similarity index 100% rename from rimage/plat_auth.h rename to src/include/rimage/plat_auth.h diff --git a/rimage/rimage.h b/src/include/rimage/rimage.h similarity index 100% rename from rimage/rimage.h rename to src/include/rimage/rimage.h diff --git a/rimage/man_apl.c b/src/man_apl.c similarity index 100% rename from rimage/man_apl.c rename to src/man_apl.c diff --git a/rimage/man_cnl.c b/src/man_cnl.c similarity index 100% rename from rimage/man_cnl.c rename to src/man_cnl.c diff --git a/rimage/man_kbl.c b/src/man_kbl.c similarity index 100% rename from rimage/man_kbl.c rename to src/man_kbl.c diff --git a/rimage/man_sue.c b/src/man_sue.c similarity index 100% rename from rimage/man_sue.c rename to src/man_sue.c diff --git a/rimage/man_tgl.c b/src/man_tgl.c similarity index 100% rename from rimage/man_tgl.c rename to src/man_tgl.c diff --git a/rimage/manifest.c b/src/manifest.c similarity index 100% rename from rimage/manifest.c rename to src/manifest.c diff --git a/rimage/pkcs1_5.c b/src/pkcs1_5.c similarity index 100% rename from rimage/pkcs1_5.c rename to src/pkcs1_5.c diff --git a/rimage/plat_auth.c b/src/plat_auth.c similarity index 100% rename from rimage/plat_auth.c rename to src/plat_auth.c diff --git a/rimage/rimage.c b/src/rimage.c similarity index 100% rename from rimage/rimage.c rename to src/rimage.c From 0b34af27fa753ec728cb6761ee771721fbf19a20 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 12 Nov 2019 09:31:42 -0800 Subject: [PATCH 092/350] Add a minimal set of necessary SOF headers These headers are required for building rimage outside of the SOF source tree as a standalone tool. Signed-off-by: Daniel Leung --- src/include/sof/ipc/header.h | 241 ++++++++++++++++++++++++++++++++ src/include/sof/ipc/info.h | 126 +++++++++++++++++ src/include/sof/ipc/stream.h | 156 +++++++++++++++++++++ src/include/sof/kernel/fw.h | 80 +++++++++++ src/include/sof/user/manifest.h | 228 ++++++++++++++++++++++++++++++ 5 files changed, 831 insertions(+) create mode 100644 src/include/sof/ipc/header.h create mode 100644 src/include/sof/ipc/info.h create mode 100644 src/include/sof/ipc/stream.h create mode 100644 src/include/sof/kernel/fw.h create mode 100644 src/include/sof/user/manifest.h diff --git a/src/include/sof/ipc/header.h b/src/include/sof/ipc/header.h new file mode 100644 index 000000000000..3726c38a78a0 --- /dev/null +++ b/src/include/sof/ipc/header.h @@ -0,0 +1,241 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/header.h + * \brief IPC command header + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_HEADER_H__ +#define __IPC_HEADER_H__ + +#include + +/** \addtogroup sof_uapi uAPI + * SOF uAPI specification. + * + * IPC messages have a prefixed 32 bit identifier made up as follows :- + * + * 0xGCCCNNNN where + * - G is global cmd type (4 bits) + * - C is command type (12 bits) + * - N is the ID number (16 bits) - monotonic and overflows + * + * This is sent at the start of the IPM message in the mailbox. Messages should + * not be sent in the doorbell (special exceptions for firmware). + + * @{ + */ + +/** \name Global Message - Generic + * @{ + */ + +/** Shift-left bits to extract the global cmd type */ +#define SOF_GLB_TYPE_SHIFT 28 +#define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT) +#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT) + +/** @} */ + +/** \name Command Message - Generic + * @{ + */ + +/** Shift-left bits to extract the command type */ +#define SOF_CMD_TYPE_SHIFT 16 +#define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT) +#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT) + +/** @} */ + +/** \name Global Message Types + * @{ + */ + +#define SOF_IPC_GLB_REPLY SOF_GLB_TYPE(0x1U) +#define SOF_IPC_GLB_COMPOUND SOF_GLB_TYPE(0x2U) +#define SOF_IPC_GLB_TPLG_MSG SOF_GLB_TYPE(0x3U) +#define SOF_IPC_GLB_PM_MSG SOF_GLB_TYPE(0x4U) +#define SOF_IPC_GLB_COMP_MSG SOF_GLB_TYPE(0x5U) +#define SOF_IPC_GLB_STREAM_MSG SOF_GLB_TYPE(0x6U) +#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U) +#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U) +#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U) +#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU) +#define SOF_IPC_GLB_TEST SOF_GLB_TYPE(0xBU) + +/** @} */ + +/** \name DSP Command: Topology + * \anchor tplg_cmd_type + * @{ + */ + +#define SOF_IPC_TPLG_COMP_NEW SOF_CMD_TYPE(0x001) +#define SOF_IPC_TPLG_COMP_FREE SOF_CMD_TYPE(0x002) +#define SOF_IPC_TPLG_COMP_CONNECT SOF_CMD_TYPE(0x003) +#define SOF_IPC_TPLG_PIPE_NEW SOF_CMD_TYPE(0x010) +#define SOF_IPC_TPLG_PIPE_FREE SOF_CMD_TYPE(0x011) +#define SOF_IPC_TPLG_PIPE_CONNECT SOF_CMD_TYPE(0x012) +#define SOF_IPC_TPLG_PIPE_COMPLETE SOF_CMD_TYPE(0x013) +#define SOF_IPC_TPLG_BUFFER_NEW SOF_CMD_TYPE(0x020) +#define SOF_IPC_TPLG_BUFFER_FREE SOF_CMD_TYPE(0x021) + +/** @} */ + +/** \name DSP Command: PM + * @{ + */ + +#define SOF_IPC_PM_CTX_SAVE SOF_CMD_TYPE(0x001) +#define SOF_IPC_PM_CTX_RESTORE SOF_CMD_TYPE(0x002) +#define SOF_IPC_PM_CTX_SIZE SOF_CMD_TYPE(0x003) +#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004) +#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005) +#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006) +#define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007) +#define SOF_IPC_PM_GATE SOF_CMD_TYPE(0x008) + +/** \name DSP Command: Component runtime config - multiple different types + * @{ + */ + +#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001) +#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002) +#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003) +#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004) +#define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005) + +/** @} */ + +/** \name DSP Command: DAI messages + * @{ + */ +#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001) +#define SOF_IPC_DAI_LOOPBACK SOF_CMD_TYPE(0x002) + +/** @} */ + +/** \name DSP Command: Stream + * @{ + */ +#define SOF_IPC_STREAM_PCM_PARAMS SOF_CMD_TYPE(0x001) +#define SOF_IPC_STREAM_PCM_PARAMS_REPLY SOF_CMD_TYPE(0x002) +#define SOF_IPC_STREAM_PCM_FREE SOF_CMD_TYPE(0x003) +#define SOF_IPC_STREAM_TRIG_START SOF_CMD_TYPE(0x004) +#define SOF_IPC_STREAM_TRIG_STOP SOF_CMD_TYPE(0x005) +#define SOF_IPC_STREAM_TRIG_PAUSE SOF_CMD_TYPE(0x006) +#define SOF_IPC_STREAM_TRIG_RELEASE SOF_CMD_TYPE(0x007) +#define SOF_IPC_STREAM_TRIG_DRAIN SOF_CMD_TYPE(0x008) +#define SOF_IPC_STREAM_TRIG_XRUN SOF_CMD_TYPE(0x009) +#define SOF_IPC_STREAM_POSITION SOF_CMD_TYPE(0x00a) +#define SOF_IPC_STREAM_VORBIS_PARAMS SOF_CMD_TYPE(0x010) +#define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011) + +/** @} */ + +/** \name DSP Command: Trace and debug + * @{ + */ + +#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001) +#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002) +#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003) + +/** @} */ + +/** \name DSP Command: Test - Debug build only + * @{ + */ + +#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001) + +/** @} */ + +/** \name IPC Message Definitions + * @{ + */ + +/** Get message component id */ +#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff) + +/** Maximum message size for mailbox Tx/Rx */ +#define SOF_IPC_MSG_MAX_SIZE 384 + +/** @} */ + +/** + * Structure Header - Header for all IPC structures except command structs. + * The size can be greater than the structure size and that means there is + * extended bespoke data beyond the end of the structure including variable + * arrays. + */ +struct sof_ipc_hdr { + uint32_t size; /**< size of structure */ +} __attribute__((packed)); + +/** + * Command Header - Header for all IPC commands. Identifies IPC message. + * The size can be greater than the structure size and that means there is + * extended bespoke data beyond the end of the structure including variable + * arrays. + */ +struct sof_ipc_cmd_hdr { + uint32_t size; /**< size of structure */ + uint32_t cmd; /**< SOF_IPC_GLB_ + cmd */ +} __attribute__((packed)); + +/** + * Generic reply message. Some commands override this with their own reply + * types that must include this at start. + */ +struct sof_ipc_reply { + struct sof_ipc_cmd_hdr hdr; + int32_t error; /**< negative error numbers */ +} __attribute__((packed)); + +/** + * Compound commands - SOF_IPC_GLB_COMPOUND. + * + * Compound commands are sent to the DSP as a single IPC operation. The + * commands are split into blocks and each block has a header. This header + * identifies the command type and the number of commands before the next + * header. + */ +struct sof_ipc_compound_hdr { + struct sof_ipc_cmd_hdr hdr; + uint32_t count; /**< count of 0 means end of compound sequence */ +} __attribute__((packed)); + +/** + * OOPS header architecture specific data. + */ +struct sof_ipc_dsp_oops_arch_hdr { + uint32_t arch; /* Identifier of architecture */ + uint32_t totalsize; /* Total size of oops message */ +} __attribute__((packed)); + +/** + * OOPS header platform specific data. + */ +struct sof_ipc_dsp_oops_plat_hdr { + uint32_t configidhi; /* ConfigID hi 32bits */ + uint32_t configidlo; /* ConfigID lo 32bits */ + uint32_t numaregs; /* Special regs num */ + uint32_t stackoffset; /* Offset to stack pointer from beginning of + * oops message + */ + uint32_t stackptr; /* Stack ptr */ +} __attribute__((packed)); + +/** @}*/ + +#endif /* __IPC_HEADER_H__ */ diff --git a/src/include/sof/ipc/info.h b/src/include/sof/ipc/info.h new file mode 100644 index 000000000000..d34ba914954e --- /dev/null +++ b/src/include/sof/ipc/info.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/info.h + * \brief IPC definitions + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_INFO_H__ +#define __IPC_INFO_H__ + +#include +#include +#include + +/* + * Firmware boot and version + */ + +#define SOF_IPC_MAX_ELEMS 16 + +/* + * Firmware boot info flag bits (64-bit) + */ +#define SOF_IPC_INFO_BUILD BIT(0) +#define SOF_IPC_INFO_LOCKS BIT(1) +#define SOF_IPC_INFO_LOCKSV BIT(2) +#define SOF_IPC_INFO_GDB BIT(3) + +/* extended data types that can be appended onto end of sof_ipc_fw_ready */ +enum sof_ipc_ext_data { + SOF_IPC_EXT_DMA_BUFFER = 0, + SOF_IPC_EXT_WINDOW, +}; + +/* FW version - SOF_IPC_GLB_VERSION */ +struct sof_ipc_fw_version { + struct sof_ipc_hdr hdr; + uint16_t major; + uint16_t minor; + uint16_t micro; + uint16_t build; + uint8_t date[12]; + uint8_t time[10]; + uint8_t tag[6]; + uint32_t abi_version; + + /* reserved for future use */ + uint32_t reserved[4]; +} __attribute__((packed)); + +/* FW ready Message - sent by firmware when boot has completed */ +struct sof_ipc_fw_ready { + struct sof_ipc_cmd_hdr hdr; + uint32_t dspbox_offset; /* dsp initiated IPC mailbox */ + uint32_t hostbox_offset; /* host initiated IPC mailbox */ + uint32_t dspbox_size; + uint32_t hostbox_size; + struct sof_ipc_fw_version version; + + /* Miscellaneous flags */ + uint64_t flags; + + /* reserved for future use */ + uint32_t reserved[4]; +} __attribute__((packed)); + +/* + * Extended Firmware data. All optional, depends on platform/arch. + */ +enum sof_ipc_region { + SOF_IPC_REGION_DOWNBOX = 0, + SOF_IPC_REGION_UPBOX, + SOF_IPC_REGION_TRACE, + SOF_IPC_REGION_DEBUG, + SOF_IPC_REGION_STREAM, + SOF_IPC_REGION_REGS, + SOF_IPC_REGION_EXCEPTION, +}; + +struct sof_ipc_ext_data_hdr { + struct sof_ipc_cmd_hdr hdr; + uint32_t type; /**< SOF_IPC_EXT_ */ +} __attribute__((packed)); + +struct sof_ipc_dma_buffer_elem { + struct sof_ipc_hdr hdr; + uint32_t type; /**< SOF_IPC_REGION_ */ + uint32_t id; /**< platform specific - used to map to host memory */ + struct sof_ipc_host_buffer buffer; +} __attribute__((packed)); + +/* extended data DMA buffers for IPC, trace and debug */ +struct sof_ipc_dma_buffer_data { + struct sof_ipc_ext_data_hdr ext_hdr; + uint32_t num_buffers; + + /* host files in buffer[n].buffer */ + struct sof_ipc_dma_buffer_elem buffer[]; +} __attribute__((packed)); + +struct sof_ipc_window_elem { + struct sof_ipc_hdr hdr; + uint32_t type; /**< SOF_IPC_REGION_ */ + uint32_t id; /**< platform specific - used to map to host memory */ + uint32_t flags; /**< R, W, RW, etc - to define */ + uint32_t size; /**< size of region in bytes */ + /* offset in window region as windows can be partitioned */ + uint32_t offset; +} __attribute__((packed)); + +/* extended data memory windows for IPC, trace and debug */ +struct sof_ipc_window { + struct sof_ipc_ext_data_hdr ext_hdr; + uint32_t num_windows; + struct sof_ipc_window_elem window[]; +} __attribute__((packed)); + +#endif /* __IPC_INFO_H__ */ diff --git a/src/include/sof/ipc/stream.h b/src/include/sof/ipc/stream.h new file mode 100644 index 000000000000..ba10a41f50c8 --- /dev/null +++ b/src/include/sof/ipc/stream.h @@ -0,0 +1,156 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/stream.h + * \brief IPC definitions for streams. + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_STREAM_H__ +#define __IPC_STREAM_H__ + +#include +#include + +/* + * Stream configuration. + */ + +#define SOF_IPC_MAX_CHANNELS 8 + +/* common sample rates for use in masks */ +#define SOF_RATE_8000 (1 << 0) /**< 8000Hz */ +#define SOF_RATE_11025 (1 << 1) /**< 11025Hz */ +#define SOF_RATE_12000 (1 << 2) /**< 12000Hz */ +#define SOF_RATE_16000 (1 << 3) /**< 16000Hz */ +#define SOF_RATE_22050 (1 << 4) /**< 22050Hz */ +#define SOF_RATE_24000 (1 << 5) /**< 24000Hz */ +#define SOF_RATE_32000 (1 << 6) /**< 32000Hz */ +#define SOF_RATE_44100 (1 << 7) /**< 44100Hz */ +#define SOF_RATE_48000 (1 << 8) /**< 48000Hz */ +#define SOF_RATE_64000 (1 << 9) /**< 64000Hz */ +#define SOF_RATE_88200 (1 << 10) /**< 88200Hz */ +#define SOF_RATE_96000 (1 << 11) /**< 96000Hz */ +#define SOF_RATE_176400 (1 << 12) /**< 176400Hz */ +#define SOF_RATE_192000 (1 << 13) /**< 192000Hz */ + +/* continuous and non-standard rates for flexibility */ +#define SOF_RATE_CONTINUOUS (1 << 30) /**< range */ +#define SOF_RATE_KNOT (1 << 31) /**< non-continuous */ + +/* generic PCM flags for runtime settings */ +#define SOF_PCM_FLAG_XRUN_STOP (1 << 0) /**< Stop on any XRUN */ + +/* stream PCM frame format */ +enum sof_ipc_frame { + SOF_IPC_FRAME_S16_LE = 0, + SOF_IPC_FRAME_S24_4LE, + SOF_IPC_FRAME_S32_LE, + SOF_IPC_FRAME_FLOAT, + /* other formats here */ +}; + +/* stream buffer format */ +enum sof_ipc_buffer_format { + SOF_IPC_BUFFER_INTERLEAVED, + SOF_IPC_BUFFER_NONINTERLEAVED, + /* other formats here */ +}; + +/* stream direction */ +enum sof_ipc_stream_direction { + SOF_IPC_STREAM_PLAYBACK = 0, + SOF_IPC_STREAM_CAPTURE, +}; + +/* stream ring info */ +struct sof_ipc_host_buffer { + struct sof_ipc_hdr hdr; + uint32_t phy_addr; + uint32_t pages; + uint32_t size; + uint32_t reserved[3]; +} __attribute__((packed)); + +struct sof_ipc_stream_params { + struct sof_ipc_hdr hdr; + struct sof_ipc_host_buffer buffer; + uint32_t direction; /**< enum sof_ipc_stream_direction */ + uint32_t frame_fmt; /**< enum sof_ipc_frame */ + uint32_t buffer_fmt; /**< enum sof_ipc_buffer_format */ + uint32_t rate; + uint16_t stream_tag; + uint16_t channels; + uint16_t sample_valid_bytes; + uint16_t sample_container_bytes; + + uint32_t host_period_bytes; + uint16_t no_stream_position; /**< 1 means don't send stream position */ + + uint16_t reserved[3]; + uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ +} __attribute__((packed)); + +/* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */ +struct sof_ipc_pcm_params { + struct sof_ipc_cmd_hdr hdr; + uint32_t comp_id; + uint32_t flags; /**< generic PCM flags - SOF_PCM_FLAG_ */ + uint32_t reserved[2]; + struct sof_ipc_stream_params params; +} __attribute__((packed)); + +/* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */ +struct sof_ipc_pcm_params_reply { + struct sof_ipc_reply rhdr; + uint32_t comp_id; + uint32_t posn_offset; +} __attribute__((packed)); + +/* free stream - SOF_IPC_STREAM_PCM_PARAMS */ +struct sof_ipc_stream { + struct sof_ipc_cmd_hdr hdr; + uint32_t comp_id; +} __attribute__((packed)); + +/* flags indicating which time stamps are in sync with each other */ +#define SOF_TIME_HOST_SYNC (1 << 0) +#define SOF_TIME_DAI_SYNC (1 << 1) +#define SOF_TIME_WALL_SYNC (1 << 2) +#define SOF_TIME_STAMP_SYNC (1 << 3) + +/* flags indicating which time stamps are valid */ +#define SOF_TIME_HOST_VALID (1 << 8) +#define SOF_TIME_DAI_VALID (1 << 9) +#define SOF_TIME_WALL_VALID (1 << 10) +#define SOF_TIME_STAMP_VALID (1 << 11) + +/* flags indicating time stamps are 64bit else 3use low 32bit */ +#define SOF_TIME_HOST_64 (1 << 16) +#define SOF_TIME_DAI_64 (1 << 17) +#define SOF_TIME_WALL_64 (1 << 18) +#define SOF_TIME_STAMP_64 (1 << 19) + +struct sof_ipc_stream_posn { + struct sof_ipc_reply rhdr; + uint32_t comp_id; /**< host component ID */ + uint32_t flags; /**< SOF_TIME_ */ + uint32_t wallclock_hz; /**< frequency of wallclock in Hz */ + uint32_t timestamp_ns; /**< resolution of timestamp in ns */ + uint64_t host_posn; /**< host DMA position in bytes */ + uint64_t dai_posn; /**< DAI DMA position in bytes */ + uint64_t comp_posn; /**< comp position in bytes */ + uint64_t wallclock; /**< audio wall clock */ + uint64_t timestamp; /**< system time stamp */ + uint32_t xrun_comp_id; /**< comp ID of XRUN component */ + int32_t xrun_size; /**< XRUN size in bytes */ +} __attribute__((packed)); + +#endif /* __IPC_STREAM_H__ */ diff --git a/src/include/sof/kernel/fw.h b/src/include/sof/kernel/fw.h new file mode 100644 index 000000000000..2c0a123d23b7 --- /dev/null +++ b/src/include/sof/kernel/fw.h @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/* + * Firmware file format . + */ + +#ifndef __KERNEL_FW_H__ +#define __KERNEL_FW_H__ + +#include + +#define SND_SOF_FW_SIG_SIZE 4 +#define SND_SOF_FW_ABI 1 +#define SND_SOF_FW_SIG "Reef" + +/* + * Firmware module is made up of 1 . N blocks of different types. The + * Block header is used to determine where and how block is to be copied in the + * DSP/host memory space. + */ +enum snd_sof_fw_blk_type { + SOF_FW_BLK_TYPE_INVALID = -1, + SOF_FW_BLK_TYPE_START = 0, + SOF_FW_BLK_TYPE_RSRVD0 = SOF_FW_BLK_TYPE_START, + SOF_FW_BLK_TYPE_IRAM = 1, /* local instruction RAM */ + SOF_FW_BLK_TYPE_DRAM = 2, /* local data RAM */ + SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */ + SOF_FW_BLK_TYPE_ROM = 4, + SOF_FW_BLK_TYPE_IMR = 5, + SOF_FW_BLK_TYPE_RSRVD6 = 6, + SOF_FW_BLK_TYPE_RSRVD7 = 7, + SOF_FW_BLK_TYPE_RSRVD8 = 8, + SOF_FW_BLK_TYPE_RSRVD9 = 9, + SOF_FW_BLK_TYPE_RSRVD10 = 10, + SOF_FW_BLK_TYPE_RSRVD11 = 11, + SOF_FW_BLK_TYPE_RSRVD12 = 12, + SOF_FW_BLK_TYPE_RSRVD13 = 13, + SOF_FW_BLK_TYPE_RSRVD14 = 14, + /* use SOF_FW_BLK_TYPE_RSVRDX for new block types */ + SOF_FW_BLK_TYPE_NUM +}; + +struct snd_sof_blk_hdr { + enum snd_sof_fw_blk_type type; + uint32_t size; /* bytes minus this header */ + uint32_t offset; /* offset from base */ +} __attribute__((packed)); + +/* + * Firmware file is made up of 1 .. N different modules types. The module + * type is used to determine how to load and parse the module. + */ +enum snd_sof_fw_mod_type { + SOF_FW_BASE = 0, /* base firmware image */ + SOF_FW_MODULE = 1, /* firmware module */ +}; + +struct snd_sof_mod_hdr { + enum snd_sof_fw_mod_type type; + uint32_t size; /* bytes minus this header */ + uint32_t num_blocks; /* number of blocks */ +} __attribute__((packed)); + +/* + * Firmware file header. + */ +struct snd_sof_fw_header { + unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ + uint32_t file_size; /* size of file minus this header */ + uint32_t num_modules; /* number of modules */ + uint32_t abi; /* version of header format */ +} __attribute__((packed)); + +#endif /* __KERNEL_FW_H__ */ diff --git a/src/include/sof/user/manifest.h b/src/include/sof/user/manifest.h new file mode 100644 index 000000000000..bd598f907efe --- /dev/null +++ b/src/include/sof/user/manifest.h @@ -0,0 +1,228 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + */ + +/** + * \file include/user/manifest.h + * \brief FW Image Manifest definitions. + * \author Liam Girdwood + */ + +#ifndef __USER_MANIFEST_H__ +#define __USER_MANIFEST_H__ + +#include + +/* start offset for base FW module */ +#define SOF_MAN_ELF_TEXT_OFFSET 0x2000 + +/* FW Extended Manifest Header id = $AE1 */ +#define SOF_MAN_EXT_HEADER_MAGIC 0x31454124 + +/* module type load type */ +#define SOF_MAN_MOD_TYPE_BUILTIN 0 +#define SOF_MAN_MOD_TYPE_MODULE 1 + +struct sof_man_module_type { + uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ + uint32_t auto_start:1; + uint32_t domain_ll:1; + uint32_t domain_dp:1; + uint32_t rsvd_:25; +}; + +/* segment flags.type */ +#define SOF_MAN_SEGMENT_TEXT 0 +#define SOF_MAN_SEGMENT_RODATA 1 +#define SOF_MAN_SEGMENT_DATA 1 +#define SOF_MAN_SEGMENT_BSS 2 +#define SOF_MAN_SEGMENT_EMPTY 15 + +union sof_man_segment_flags { + uint32_t ul; + struct { + uint32_t contents:1; + uint32_t alloc:1; + uint32_t load:1; + uint32_t readonly:1; + uint32_t code:1; + uint32_t data:1; + uint32_t _rsvd0:2; + uint32_t type:4; /* MAN_SEGMENT_ */ + uint32_t _rsvd1:4; + uint32_t length:16; /* of segment in pages */ + } r; +} __attribute__((packed)); + +/* + * Module segment descriptor. Used by ROM - Immutable. + */ +struct sof_man_segment_desc { + union sof_man_segment_flags flags; + uint32_t v_base_addr; + uint32_t file_offset; +} __attribute__((packed)); + +/* + * The firmware binary can be split into several modules. + */ + +#define SOF_MAN_MOD_ID_LEN 4 +#define SOF_MAN_MOD_NAME_LEN 8 +#define SOF_MAN_MOD_SHA256_LEN 32 +#define SOF_MAN_MOD_ID {'$', 'A', 'M', 'E'} + +/* + * Each module has an entry in the FW header. Used by ROM - Immutable. + */ +struct sof_man_module { + uint8_t struct_id[SOF_MAN_MOD_ID_LEN]; /* SOF_MAN_MOD_ID */ + uint8_t name[SOF_MAN_MOD_NAME_LEN]; + uint8_t uuid[16]; + struct sof_man_module_type type; + uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; + uint32_t entry_point; + uint16_t cfg_offset; + uint16_t cfg_count; + uint32_t affinity_mask; + uint16_t instance_max_count; /* max number of instances */ + uint16_t instance_bss_size; /* instance (pages) */ + struct sof_man_segment_desc segment[3]; +} __attribute__((packed)); + +/* + * Each module has a configuration in the FW header. Used by ROM - Immutable. + */ +struct sof_man_mod_config { + uint32_t par[4]; /* module parameters */ + uint32_t is_pages; /* actual size of instance .bss (pages) */ + uint32_t cps; /* cycles per second */ + uint32_t ibs; /* input buffer size (bytes) */ + uint32_t obs; /* output buffer size (bytes) */ + uint32_t module_flags; /* flags, reserved for future use */ + uint32_t cpc; /* cycles per single run */ + uint32_t obls; /* output block size, reserved for future use */ +} __attribute__((packed)); + +/* + * FW Manifest Header + */ + +#define SOF_MAN_FW_HDR_FW_NAME_LEN 8 +#define SOF_MAN_FW_HDR_ID {'$', 'A', 'M', '1'} +#define SOF_MAN_FW_HDR_NAME "ADSPFW" +#define SOF_MAN_FW_HDR_FLAGS 0x0 +#define SOF_MAN_FW_HDR_FEATURES 0x1ff + +/* + * The firmware has a standard header that is checked by the ROM on firmware + * loading. preload_page_count is used by DMA code loader and is entire + * image size on CNL. i.e. CNL: total size of the binary’s .text and .rodata + * Used by ROM - Immutable. + */ +struct sof_man_fw_header { + uint8_t header_id[4]; + uint32_t header_len; + uint8_t name[SOF_MAN_FW_HDR_FW_NAME_LEN]; + /* number of pages of preloaded image loaded by driver */ + uint32_t preload_page_count; + uint32_t fw_image_flags; + uint32_t feature_mask; + uint16_t major_version; + uint16_t minor_version; + uint16_t hotfix_version; + uint16_t build_version; + uint32_t num_module_entries; + uint32_t hw_buf_base_addr; + uint32_t hw_buf_length; + /* target address for binary loading as offset in IMR - must be == base offset */ + uint32_t load_offset; +} __attribute__((packed)); + +/* + * Firmware manifest descriptor. This can contain N modules and N module + * configs. Used by ROM - Immutable. + */ +struct sof_man_fw_desc { + struct sof_man_fw_header header; + + /* Warning - hack for module arrays. For some unknown reason the we + * have a variable size array of struct man_module followed by a + * variable size array of struct mod_config. These should have been + * merged into a variable array of a parent structure. We have to hack + * around this in many places.... + * + * struct sof_man_module man_module[]; + * struct sof_man_mod_config mod_config[]; + */ + +} __attribute__((packed)); + +#define SOF_MAN_COMP_SHA256_LEN 32 +#define SOF_MAN_COMP_SHA384_LEN 48 + +/* + * Component Descriptor for manifest v1.8. Used by ROM - Immutable. + */ +struct sof_man_component_desc_v1_8 { + uint32_t reserved[2]; /* all 0 */ + uint32_t version; + uint8_t hash[SOF_MAN_COMP_SHA256_LEN]; + uint32_t base_offset; + uint32_t limit_offset; + uint32_t attributes[4]; +} __attribute__((packed)); + +/* + * Audio DSP extended metadata for manifest v1.8. Used by ROM - Immutable. + */ +struct sof_man_adsp_meta_file_ext_v1_8 { + uint32_t ext_type; /* always 17 for ADSP extension */ + uint32_t ext_len; + uint32_t imr_type; + uint8_t reserved[16]; /* all 0 */ + struct sof_man_component_desc_v1_8 comp_desc[1]; +} __attribute__((packed)); + +/* + * Component Descriptor for manifest v2.5. Used by ROM - Immutable. + */ +struct sof_man_component_desc_v2_5 { + uint32_t reserved[2]; /* all 0 */ + uint32_t version; + uint8_t hash[SOF_MAN_COMP_SHA384_LEN]; + uint32_t base_offset; + uint32_t limit_offset; + uint32_t attributes[4]; +} __attribute__((packed)); + +/* + * Audio DSP extended metadata for manifest v2.5. Used by ROM - Immutable. + */ +struct sof_man_adsp_meta_file_ext_v2_5 { + uint32_t ext_type; /* always 17 for ADSP extension */ + uint32_t ext_len; + uint32_t imr_type; + uint8_t reserved[16]; /* all 0 */ + struct sof_man_component_desc_v2_5 comp_desc[1]; +} __attribute__((packed)); + +/* + * Module Manifest for rimage module metadata. Not used by ROM. + */ +struct sof_man_module_manifest { + struct sof_man_module module; + uint32_t text_size; +}; + +/* + * Module offset in manifest. + */ +#define SOF_MAN_MODULE_OFFSET(index) \ + (sizeof(struct sof_man_fw_header) + \ + (index) * sizeof(struct sof_man_module)) + +#endif /* __USER_MANIFEST_H__ */ From e94452934f0c7aece4981c7d7657a5bc04d2c00c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 13:22:02 -0700 Subject: [PATCH 093/350] Do not include version.h The #define in version.h will be passed as command line argument instead, as the tool has to build on its own. Signed-off-by: Daniel Leung --- src/man_apl.c | 1 - src/man_cnl.c | 1 - src/man_kbl.c | 1 - src/man_sue.c | 1 - src/man_tgl.c | 1 - 5 files changed, 5 deletions(-) diff --git a/src/man_apl.c b/src/man_apl.c index 7618fb2c576a..b8365b4c3738 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { diff --git a/src/man_cnl.c b/src/man_cnl.c index 575c2c8e6451..264beaf77a86 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { diff --git a/src/man_kbl.c b/src/man_kbl.c index 5c37f876c71a..5bd66964f203 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* * TODO: check if all platform for 1.5 are the same base and length. diff --git a/src/man_sue.c b/src/man_sue.c index 225ca519f4dd..db4bfd600235 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { diff --git a/src/man_tgl.c b/src/man_tgl.c index 83877e198af7..6f8871ce25d2 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v2_5 tgl_manifest = { From d821534fed3fac53fc8cf3ac6a7d0df8b6c40593 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 13:29:54 -0700 Subject: [PATCH 094/350] Remove PEM_KEY_PREFIX and always requires key as cmd argument This removes the macro PEM_KEY_PREFIX and make rimage to always require key to be specified in command line. Signed-off-by: Daniel Leung --- src/pkcs1_5.c | 26 ++++++++++++++------------ src/rimage.c | 6 ++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 4da4d4877284..a55abb9d33c3 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -78,18 +78,19 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, ptr1 - (void *)man, size1); #endif + /* requires private key */ + if (!image->key_name) { + return -EINVAL; + } + /* create new key */ privkey = EVP_PKEY_new(); if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) { - snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); - } else { - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - } + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); @@ -172,18 +173,19 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + /* create new key */ privkey = EVP_PKEY_new(); if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) { - snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); - } else { - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - } + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); diff --git a/src/rimage.c b/src/rimage.c index 5d18b96d9569..03e265ec6e3e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -102,6 +102,12 @@ int main(int argc, char *argv[]) if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; + /* requires private key */ + if (!image.key_name) { + fprintf(stderr, "error: requires private key\n"); + return -EINVAL; + } + /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { if (!strcmp(mach, machine[i]->name)) { From 5bf839e99598712fa1f9ef18b0fc8424bbca6367 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 17:55:19 -0700 Subject: [PATCH 095/350] Make log dictionary output optional Signed-off-by: Daniel Leung --- src/file_simple.c | 7 +- src/hash.c | 1 - src/include/rimage/file_format.h | 31 ---- src/include/rimage/rimage.h | 8 +- src/include/sof/ipc/header.h | 241 ------------------------------- src/include/sof/ipc/info.h | 126 ---------------- src/include/sof/ipc/stream.h | 156 -------------------- src/manifest.c | 1 - src/rimage.c | 16 +- 9 files changed, 28 insertions(+), 559 deletions(-) delete mode 100644 src/include/rimage/file_format.h delete mode 100644 src/include/sof/ipc/header.h delete mode 100644 src/include/sof/ipc/info.h delete mode 100644 src/include/sof/ipc/stream.h diff --git a/src/file_simple.c b/src/file_simple.c index be64c7d8aaa7..8cdd05924537 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,8 +8,11 @@ #include #include +#ifdef HAS_FILE_FORMAT_H +#include +#endif /* HAS_FILE_FORMAT_H */ + #include "rimage.h" -#include "file_format.h" #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 @@ -366,6 +369,7 @@ static int simple_write_firmware(struct image *image) return 0; } +#ifdef HAS_FILE_FORMAT_H int write_logs_dictionary(struct image *image) { struct snd_sof_logs_header header; @@ -455,6 +459,7 @@ int write_logs_dictionary(struct image *image) return ret; } +#endif /* HAS_FILE_FORMAT_H */ const struct adsp machine_byt = { .name = "byt", diff --git a/src/hash.c b/src/hash.c index 24d11a27b94c..62c4e2f3540b 100644 --- a/src/hash.c +++ b/src/hash.c @@ -18,7 +18,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "manifest.h" #if OPENSSL_VERSION_NUMBER < 0x10100000L diff --git a/src/include/rimage/file_format.h b/src/include/rimage/file_format.h deleted file mode 100644 index b0cea780d6f7..000000000000 --- a/src/include/rimage/file_format.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2017 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - */ - -/* - * Firmware file format . - */ - -#ifndef __INCLUDE_FILE_FORMAT_H__ -#define __INCLUDE_FILE_FORMAT_H__ - -#include -#include - -#define SND_SOF_LOGS_SIG_SIZE 4 -#define SND_SOF_LOGS_SIG "Logs" - -/* - * Logs dictionary file header. - */ -struct snd_sof_logs_header { - unsigned char sig[SND_SOF_LOGS_SIG_SIZE]; /* "Logs" */ - uint32_t base_address; /* address of log entries section */ - uint32_t data_length; /* amount of bytes following this header */ - uint32_t data_offset; /* offset to first entry in this file */ - struct sof_ipc_fw_version version; -}; -#endif diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 9c3cf8e3537b..c1015256164d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -92,9 +92,13 @@ struct module { struct image { const char *out_file; - const char *ldc_out_file; FILE *out_fd; + +#ifdef HAS_FILE_FORMAT_H + const char *ldc_out_file; FILE *ldc_out_fd; +#endif /* HAS_FILE_FORMAT_H */ + void *pos; const struct adsp *adsp; @@ -149,7 +153,9 @@ struct adsp { int exec_boot_ldr; }; +#ifdef HAS_FILE_FORMAT_H int write_logs_dictionary(struct image *image); +#endif /* HAS_FILE_FORMAT_H */ void module_sha256_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); diff --git a/src/include/sof/ipc/header.h b/src/include/sof/ipc/header.h deleted file mode 100644 index 3726c38a78a0..000000000000 --- a/src/include/sof/ipc/header.h +++ /dev/null @@ -1,241 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2016 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/header.h - * \brief IPC command header - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_HEADER_H__ -#define __IPC_HEADER_H__ - -#include - -/** \addtogroup sof_uapi uAPI - * SOF uAPI specification. - * - * IPC messages have a prefixed 32 bit identifier made up as follows :- - * - * 0xGCCCNNNN where - * - G is global cmd type (4 bits) - * - C is command type (12 bits) - * - N is the ID number (16 bits) - monotonic and overflows - * - * This is sent at the start of the IPM message in the mailbox. Messages should - * not be sent in the doorbell (special exceptions for firmware). - - * @{ - */ - -/** \name Global Message - Generic - * @{ - */ - -/** Shift-left bits to extract the global cmd type */ -#define SOF_GLB_TYPE_SHIFT 28 -#define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT) -#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT) - -/** @} */ - -/** \name Command Message - Generic - * @{ - */ - -/** Shift-left bits to extract the command type */ -#define SOF_CMD_TYPE_SHIFT 16 -#define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT) -#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT) - -/** @} */ - -/** \name Global Message Types - * @{ - */ - -#define SOF_IPC_GLB_REPLY SOF_GLB_TYPE(0x1U) -#define SOF_IPC_GLB_COMPOUND SOF_GLB_TYPE(0x2U) -#define SOF_IPC_GLB_TPLG_MSG SOF_GLB_TYPE(0x3U) -#define SOF_IPC_GLB_PM_MSG SOF_GLB_TYPE(0x4U) -#define SOF_IPC_GLB_COMP_MSG SOF_GLB_TYPE(0x5U) -#define SOF_IPC_GLB_STREAM_MSG SOF_GLB_TYPE(0x6U) -#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U) -#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U) -#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U) -#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU) -#define SOF_IPC_GLB_TEST SOF_GLB_TYPE(0xBU) - -/** @} */ - -/** \name DSP Command: Topology - * \anchor tplg_cmd_type - * @{ - */ - -#define SOF_IPC_TPLG_COMP_NEW SOF_CMD_TYPE(0x001) -#define SOF_IPC_TPLG_COMP_FREE SOF_CMD_TYPE(0x002) -#define SOF_IPC_TPLG_COMP_CONNECT SOF_CMD_TYPE(0x003) -#define SOF_IPC_TPLG_PIPE_NEW SOF_CMD_TYPE(0x010) -#define SOF_IPC_TPLG_PIPE_FREE SOF_CMD_TYPE(0x011) -#define SOF_IPC_TPLG_PIPE_CONNECT SOF_CMD_TYPE(0x012) -#define SOF_IPC_TPLG_PIPE_COMPLETE SOF_CMD_TYPE(0x013) -#define SOF_IPC_TPLG_BUFFER_NEW SOF_CMD_TYPE(0x020) -#define SOF_IPC_TPLG_BUFFER_FREE SOF_CMD_TYPE(0x021) - -/** @} */ - -/** \name DSP Command: PM - * @{ - */ - -#define SOF_IPC_PM_CTX_SAVE SOF_CMD_TYPE(0x001) -#define SOF_IPC_PM_CTX_RESTORE SOF_CMD_TYPE(0x002) -#define SOF_IPC_PM_CTX_SIZE SOF_CMD_TYPE(0x003) -#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004) -#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005) -#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006) -#define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007) -#define SOF_IPC_PM_GATE SOF_CMD_TYPE(0x008) - -/** \name DSP Command: Component runtime config - multiple different types - * @{ - */ - -#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001) -#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002) -#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003) -#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004) -#define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005) - -/** @} */ - -/** \name DSP Command: DAI messages - * @{ - */ -#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001) -#define SOF_IPC_DAI_LOOPBACK SOF_CMD_TYPE(0x002) - -/** @} */ - -/** \name DSP Command: Stream - * @{ - */ -#define SOF_IPC_STREAM_PCM_PARAMS SOF_CMD_TYPE(0x001) -#define SOF_IPC_STREAM_PCM_PARAMS_REPLY SOF_CMD_TYPE(0x002) -#define SOF_IPC_STREAM_PCM_FREE SOF_CMD_TYPE(0x003) -#define SOF_IPC_STREAM_TRIG_START SOF_CMD_TYPE(0x004) -#define SOF_IPC_STREAM_TRIG_STOP SOF_CMD_TYPE(0x005) -#define SOF_IPC_STREAM_TRIG_PAUSE SOF_CMD_TYPE(0x006) -#define SOF_IPC_STREAM_TRIG_RELEASE SOF_CMD_TYPE(0x007) -#define SOF_IPC_STREAM_TRIG_DRAIN SOF_CMD_TYPE(0x008) -#define SOF_IPC_STREAM_TRIG_XRUN SOF_CMD_TYPE(0x009) -#define SOF_IPC_STREAM_POSITION SOF_CMD_TYPE(0x00a) -#define SOF_IPC_STREAM_VORBIS_PARAMS SOF_CMD_TYPE(0x010) -#define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011) - -/** @} */ - -/** \name DSP Command: Trace and debug - * @{ - */ - -#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001) -#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002) -#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003) - -/** @} */ - -/** \name DSP Command: Test - Debug build only - * @{ - */ - -#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001) - -/** @} */ - -/** \name IPC Message Definitions - * @{ - */ - -/** Get message component id */ -#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff) - -/** Maximum message size for mailbox Tx/Rx */ -#define SOF_IPC_MSG_MAX_SIZE 384 - -/** @} */ - -/** - * Structure Header - Header for all IPC structures except command structs. - * The size can be greater than the structure size and that means there is - * extended bespoke data beyond the end of the structure including variable - * arrays. - */ -struct sof_ipc_hdr { - uint32_t size; /**< size of structure */ -} __attribute__((packed)); - -/** - * Command Header - Header for all IPC commands. Identifies IPC message. - * The size can be greater than the structure size and that means there is - * extended bespoke data beyond the end of the structure including variable - * arrays. - */ -struct sof_ipc_cmd_hdr { - uint32_t size; /**< size of structure */ - uint32_t cmd; /**< SOF_IPC_GLB_ + cmd */ -} __attribute__((packed)); - -/** - * Generic reply message. Some commands override this with their own reply - * types that must include this at start. - */ -struct sof_ipc_reply { - struct sof_ipc_cmd_hdr hdr; - int32_t error; /**< negative error numbers */ -} __attribute__((packed)); - -/** - * Compound commands - SOF_IPC_GLB_COMPOUND. - * - * Compound commands are sent to the DSP as a single IPC operation. The - * commands are split into blocks and each block has a header. This header - * identifies the command type and the number of commands before the next - * header. - */ -struct sof_ipc_compound_hdr { - struct sof_ipc_cmd_hdr hdr; - uint32_t count; /**< count of 0 means end of compound sequence */ -} __attribute__((packed)); - -/** - * OOPS header architecture specific data. - */ -struct sof_ipc_dsp_oops_arch_hdr { - uint32_t arch; /* Identifier of architecture */ - uint32_t totalsize; /* Total size of oops message */ -} __attribute__((packed)); - -/** - * OOPS header platform specific data. - */ -struct sof_ipc_dsp_oops_plat_hdr { - uint32_t configidhi; /* ConfigID hi 32bits */ - uint32_t configidlo; /* ConfigID lo 32bits */ - uint32_t numaregs; /* Special regs num */ - uint32_t stackoffset; /* Offset to stack pointer from beginning of - * oops message - */ - uint32_t stackptr; /* Stack ptr */ -} __attribute__((packed)); - -/** @}*/ - -#endif /* __IPC_HEADER_H__ */ diff --git a/src/include/sof/ipc/info.h b/src/include/sof/ipc/info.h deleted file mode 100644 index d34ba914954e..000000000000 --- a/src/include/sof/ipc/info.h +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/info.h - * \brief IPC definitions - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_INFO_H__ -#define __IPC_INFO_H__ - -#include -#include -#include - -/* - * Firmware boot and version - */ - -#define SOF_IPC_MAX_ELEMS 16 - -/* - * Firmware boot info flag bits (64-bit) - */ -#define SOF_IPC_INFO_BUILD BIT(0) -#define SOF_IPC_INFO_LOCKS BIT(1) -#define SOF_IPC_INFO_LOCKSV BIT(2) -#define SOF_IPC_INFO_GDB BIT(3) - -/* extended data types that can be appended onto end of sof_ipc_fw_ready */ -enum sof_ipc_ext_data { - SOF_IPC_EXT_DMA_BUFFER = 0, - SOF_IPC_EXT_WINDOW, -}; - -/* FW version - SOF_IPC_GLB_VERSION */ -struct sof_ipc_fw_version { - struct sof_ipc_hdr hdr; - uint16_t major; - uint16_t minor; - uint16_t micro; - uint16_t build; - uint8_t date[12]; - uint8_t time[10]; - uint8_t tag[6]; - uint32_t abi_version; - - /* reserved for future use */ - uint32_t reserved[4]; -} __attribute__((packed)); - -/* FW ready Message - sent by firmware when boot has completed */ -struct sof_ipc_fw_ready { - struct sof_ipc_cmd_hdr hdr; - uint32_t dspbox_offset; /* dsp initiated IPC mailbox */ - uint32_t hostbox_offset; /* host initiated IPC mailbox */ - uint32_t dspbox_size; - uint32_t hostbox_size; - struct sof_ipc_fw_version version; - - /* Miscellaneous flags */ - uint64_t flags; - - /* reserved for future use */ - uint32_t reserved[4]; -} __attribute__((packed)); - -/* - * Extended Firmware data. All optional, depends on platform/arch. - */ -enum sof_ipc_region { - SOF_IPC_REGION_DOWNBOX = 0, - SOF_IPC_REGION_UPBOX, - SOF_IPC_REGION_TRACE, - SOF_IPC_REGION_DEBUG, - SOF_IPC_REGION_STREAM, - SOF_IPC_REGION_REGS, - SOF_IPC_REGION_EXCEPTION, -}; - -struct sof_ipc_ext_data_hdr { - struct sof_ipc_cmd_hdr hdr; - uint32_t type; /**< SOF_IPC_EXT_ */ -} __attribute__((packed)); - -struct sof_ipc_dma_buffer_elem { - struct sof_ipc_hdr hdr; - uint32_t type; /**< SOF_IPC_REGION_ */ - uint32_t id; /**< platform specific - used to map to host memory */ - struct sof_ipc_host_buffer buffer; -} __attribute__((packed)); - -/* extended data DMA buffers for IPC, trace and debug */ -struct sof_ipc_dma_buffer_data { - struct sof_ipc_ext_data_hdr ext_hdr; - uint32_t num_buffers; - - /* host files in buffer[n].buffer */ - struct sof_ipc_dma_buffer_elem buffer[]; -} __attribute__((packed)); - -struct sof_ipc_window_elem { - struct sof_ipc_hdr hdr; - uint32_t type; /**< SOF_IPC_REGION_ */ - uint32_t id; /**< platform specific - used to map to host memory */ - uint32_t flags; /**< R, W, RW, etc - to define */ - uint32_t size; /**< size of region in bytes */ - /* offset in window region as windows can be partitioned */ - uint32_t offset; -} __attribute__((packed)); - -/* extended data memory windows for IPC, trace and debug */ -struct sof_ipc_window { - struct sof_ipc_ext_data_hdr ext_hdr; - uint32_t num_windows; - struct sof_ipc_window_elem window[]; -} __attribute__((packed)); - -#endif /* __IPC_INFO_H__ */ diff --git a/src/include/sof/ipc/stream.h b/src/include/sof/ipc/stream.h deleted file mode 100644 index ba10a41f50c8..000000000000 --- a/src/include/sof/ipc/stream.h +++ /dev/null @@ -1,156 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/stream.h - * \brief IPC definitions for streams. - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_STREAM_H__ -#define __IPC_STREAM_H__ - -#include -#include - -/* - * Stream configuration. - */ - -#define SOF_IPC_MAX_CHANNELS 8 - -/* common sample rates for use in masks */ -#define SOF_RATE_8000 (1 << 0) /**< 8000Hz */ -#define SOF_RATE_11025 (1 << 1) /**< 11025Hz */ -#define SOF_RATE_12000 (1 << 2) /**< 12000Hz */ -#define SOF_RATE_16000 (1 << 3) /**< 16000Hz */ -#define SOF_RATE_22050 (1 << 4) /**< 22050Hz */ -#define SOF_RATE_24000 (1 << 5) /**< 24000Hz */ -#define SOF_RATE_32000 (1 << 6) /**< 32000Hz */ -#define SOF_RATE_44100 (1 << 7) /**< 44100Hz */ -#define SOF_RATE_48000 (1 << 8) /**< 48000Hz */ -#define SOF_RATE_64000 (1 << 9) /**< 64000Hz */ -#define SOF_RATE_88200 (1 << 10) /**< 88200Hz */ -#define SOF_RATE_96000 (1 << 11) /**< 96000Hz */ -#define SOF_RATE_176400 (1 << 12) /**< 176400Hz */ -#define SOF_RATE_192000 (1 << 13) /**< 192000Hz */ - -/* continuous and non-standard rates for flexibility */ -#define SOF_RATE_CONTINUOUS (1 << 30) /**< range */ -#define SOF_RATE_KNOT (1 << 31) /**< non-continuous */ - -/* generic PCM flags for runtime settings */ -#define SOF_PCM_FLAG_XRUN_STOP (1 << 0) /**< Stop on any XRUN */ - -/* stream PCM frame format */ -enum sof_ipc_frame { - SOF_IPC_FRAME_S16_LE = 0, - SOF_IPC_FRAME_S24_4LE, - SOF_IPC_FRAME_S32_LE, - SOF_IPC_FRAME_FLOAT, - /* other formats here */ -}; - -/* stream buffer format */ -enum sof_ipc_buffer_format { - SOF_IPC_BUFFER_INTERLEAVED, - SOF_IPC_BUFFER_NONINTERLEAVED, - /* other formats here */ -}; - -/* stream direction */ -enum sof_ipc_stream_direction { - SOF_IPC_STREAM_PLAYBACK = 0, - SOF_IPC_STREAM_CAPTURE, -}; - -/* stream ring info */ -struct sof_ipc_host_buffer { - struct sof_ipc_hdr hdr; - uint32_t phy_addr; - uint32_t pages; - uint32_t size; - uint32_t reserved[3]; -} __attribute__((packed)); - -struct sof_ipc_stream_params { - struct sof_ipc_hdr hdr; - struct sof_ipc_host_buffer buffer; - uint32_t direction; /**< enum sof_ipc_stream_direction */ - uint32_t frame_fmt; /**< enum sof_ipc_frame */ - uint32_t buffer_fmt; /**< enum sof_ipc_buffer_format */ - uint32_t rate; - uint16_t stream_tag; - uint16_t channels; - uint16_t sample_valid_bytes; - uint16_t sample_container_bytes; - - uint32_t host_period_bytes; - uint16_t no_stream_position; /**< 1 means don't send stream position */ - - uint16_t reserved[3]; - uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ -} __attribute__((packed)); - -/* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */ -struct sof_ipc_pcm_params { - struct sof_ipc_cmd_hdr hdr; - uint32_t comp_id; - uint32_t flags; /**< generic PCM flags - SOF_PCM_FLAG_ */ - uint32_t reserved[2]; - struct sof_ipc_stream_params params; -} __attribute__((packed)); - -/* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */ -struct sof_ipc_pcm_params_reply { - struct sof_ipc_reply rhdr; - uint32_t comp_id; - uint32_t posn_offset; -} __attribute__((packed)); - -/* free stream - SOF_IPC_STREAM_PCM_PARAMS */ -struct sof_ipc_stream { - struct sof_ipc_cmd_hdr hdr; - uint32_t comp_id; -} __attribute__((packed)); - -/* flags indicating which time stamps are in sync with each other */ -#define SOF_TIME_HOST_SYNC (1 << 0) -#define SOF_TIME_DAI_SYNC (1 << 1) -#define SOF_TIME_WALL_SYNC (1 << 2) -#define SOF_TIME_STAMP_SYNC (1 << 3) - -/* flags indicating which time stamps are valid */ -#define SOF_TIME_HOST_VALID (1 << 8) -#define SOF_TIME_DAI_VALID (1 << 9) -#define SOF_TIME_WALL_VALID (1 << 10) -#define SOF_TIME_STAMP_VALID (1 << 11) - -/* flags indicating time stamps are 64bit else 3use low 32bit */ -#define SOF_TIME_HOST_64 (1 << 16) -#define SOF_TIME_DAI_64 (1 << 17) -#define SOF_TIME_WALL_64 (1 << 18) -#define SOF_TIME_STAMP_64 (1 << 19) - -struct sof_ipc_stream_posn { - struct sof_ipc_reply rhdr; - uint32_t comp_id; /**< host component ID */ - uint32_t flags; /**< SOF_TIME_ */ - uint32_t wallclock_hz; /**< frequency of wallclock in Hz */ - uint32_t timestamp_ns; /**< resolution of timestamp in ns */ - uint64_t host_posn; /**< host DMA position in bytes */ - uint64_t dai_posn; /**< DAI DMA position in bytes */ - uint64_t comp_posn; /**< comp position in bytes */ - uint64_t wallclock; /**< audio wall clock */ - uint64_t timestamp; /**< system time stamp */ - uint32_t xrun_comp_id; /**< comp ID of XRUN component */ - int32_t xrun_size; /**< XRUN size in bytes */ -} __attribute__((packed)); - -#endif /* __IPC_STREAM_H__ */ diff --git a/src/manifest.c b/src/manifest.c index 343a7dc59b4a..6ca41283615b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -17,7 +17,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "css.h" #include "cse.h" #include "plat_auth.h" diff --git a/src/rimage.c b/src/rimage.c index 03e265ec6e3e..896fe1b7d268 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -9,7 +9,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "manifest.h" static const struct adsp *machine[] = { @@ -36,7 +35,9 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); +#ifdef HAS_FILE_FORMAT_H fprintf(stdout, "\t -p log dictionary outfile\n"); +#endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); exit(0); @@ -59,7 +60,13 @@ int main(int argc, char *argv[]) image.out_file = optarg; break; case 'p': +#ifdef HAS_FILE_FORMAT_H image.ldc_out_file = optarg; +#else + fprintf(stderr, + "error: log dictionary is not supported\n"); + return -EINVAL; +#endif /* HAS_FILE_FORMAT_H */ break; case 'm': mach = optarg; @@ -99,8 +106,10 @@ int main(int argc, char *argv[]) if (!image.out_file || !mach) usage(argv[0]); +#ifdef HAS_FILE_FORMAT_H if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; +#endif /* HAS_FILE_FORMAT_H */ /* requires private key */ if (!image.key_name) { @@ -162,6 +171,7 @@ int main(int argc, char *argv[]) else ret = image.adsp->write_firmware(&image); +#ifdef HAS_FILE_FORMAT_H unlink(image.ldc_out_file); image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); if (!image.ldc_out_fd) { @@ -171,13 +181,17 @@ int main(int argc, char *argv[]) goto out; } ret = write_logs_dictionary(&image); +#endif /* HAS_FILE_FORMAT_H */ + out: /* close files */ if (image.out_fd) fclose(image.out_fd); +#ifdef HAS_FILE_FORMAT_H if (image.ldc_out_fd) fclose(image.ldc_out_fd); +#endif /* HAS_FILE_FORMAT_H */ return ret; } From 606b4f0442df7c359664e101b19b92313945302f Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 18:00:57 -0700 Subject: [PATCH 096/350] Add .gitignore Signed-off-by: Daniel Leung --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..e77279505d50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +config.h +config.log +config.status +Makefile +stamp-h1 +.deps/ +src/*.o +src/Makefile +src/rimage From 41cba2f66316d94dc7f5af2c7c2ffe6499004caa Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 18:32:20 -0700 Subject: [PATCH 097/350] Take firmware version and build ID as command line arguments Since rimage is no longer built with the SOF code, the firmware version (SOF_MAJOR and SOF_MINOR) and build ID (SOF_BUILD) are no longer defined during build. So these needs to be passed as command line arguments. Signed-off-by: Daniel Leung --- src/include/rimage/rimage.h | 7 +++++++ src/man_apl.c | 12 ++++++------ src/man_cnl.c | 12 ++++++------ src/man_kbl.c | 6 +++--- src/man_sue.c | 6 +++--- src/man_tgl.c | 12 ++++++------ src/manifest.c | 18 ++++++++++++++++++ src/rimage.c | 34 +++++++++++++++++++++++++++++++++- 8 files changed, 82 insertions(+), 25 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index c1015256164d..02a840a9a62a 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -125,6 +125,13 @@ struct image { char out_rom_file[256]; char out_man_file[256]; char out_unsigned_file[256]; + + /* fw version and build id */ + char* fw_ver_string; + char* fw_ver_build_string; + uint16_t fw_ver_major; + uint16_t fw_ver_minor; + uint16_t fw_ver_build; }; struct mem_zone { diff --git a/src/man_apl.c b/src/man_apl.c index b8365b4c3738..b81bb759b8a6 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -49,10 +49,10 @@ struct fw_image_manifest_v1_8 apl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -116,10 +116,10 @@ struct fw_image_manifest_v1_8 apl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = MAN_DESC_OFFSET_V1_8, }, }, diff --git a/src/man_cnl.c b/src/man_cnl.c index 264beaf77a86..72ec898718aa 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -48,10 +48,10 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -115,10 +115,10 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x30000, }, }, diff --git a/src/man_kbl.c b/src/man_kbl.c index 5bd66964f203..4a078e5d99e8 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -37,10 +37,10 @@ struct fw_image_manifest_v1_5 kbl_manifest = { .preload_page_count = 0, .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0, .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, .hw_buf_length = KBL_HARDWARE_BUFFER_LEN diff --git a/src/man_sue.c b/src/man_sue.c index db4bfd600235..e170d9952095 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -17,10 +17,10 @@ struct fw_image_manifest_v1_5_sue sue_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x2000, }, }, diff --git a/src/man_tgl.c b/src/man_tgl.c index 6f8871ce25d2..f7c3c6f25787 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -48,10 +48,10 @@ struct fw_image_manifest_v2_5 tgl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -115,10 +115,10 @@ struct fw_image_manifest_v2_5 tgl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x30000, }, }, diff --git a/src/manifest.c b/src/manifest.c index 6ca41283615b..4c14d742cd55 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -727,6 +727,11 @@ static int man_write_fw_v1_5(struct image *image) m = image->fw_image; desc = image->fw_image + MAN_DESC_OFFSET_V1_5; + /* firmware and build version */ + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); @@ -791,6 +796,11 @@ static int man_write_fw_v1_5_sue(struct image *image) /* create the module */ m = image->fw_image + MAN_DESC_OFFSET_V1_5_SUE; + /* firmware and build version */ + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module - subtract the boot loader exec header */ m->desc.header.num_module_entries = image->num_modules - 1; man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); @@ -854,6 +864,14 @@ static int man_write_fw_v1_8(struct image *image) m = image->fw_image; desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); diff --git a/src/rimage.c b/src/rimage.c index 896fe1b7d268..98f0f5cdcd99 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -40,6 +40,8 @@ static void usage(char *name) #endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); + fprintf(stdout, "\t -f firmware version = x.y\n"); + fprintf(stdout, "\t -b build version\n"); exit(0); } @@ -54,7 +56,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:x:")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:va:s:k:l:ri:x:f:b:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -92,6 +94,12 @@ int main(int argc, char *argv[]) case 'x': image.xcc_mod_offset = atoi(optarg); break; + case 'f': + image.fw_ver_string = optarg; + break; + case 'b': + image.fw_ver_build_string = optarg; + break; case 'h': usage(argv[0]); break; @@ -117,6 +125,30 @@ int main(int argc, char *argv[]) return -EINVAL; } + /* firmware version and build id */ + if (image.fw_ver_string) { + ret = sscanf(image.fw_ver_string, "%hu.%hu", + &image.fw_ver_major, + &image.fw_ver_minor); + + if (ret != 2) { + fprintf(stderr, + "error: cannot parse firmware version\n"); + return -EINVAL; + } + } + + if (image.fw_ver_build_string) { + ret = sscanf(image.fw_ver_build_string, "%hu", + &image.fw_ver_build); + + if (ret != 1) { + fprintf(stderr, + "error: cannot parse build version\n"); + return -EINVAL; + } + } + /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { if (!strcmp(mach, machine[i]->name)) { From 0d33e87433865cdc84d249b5cb6633b24cf6ecfb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 24 Sep 2019 13:28:36 -0700 Subject: [PATCH 098/350] Enable autotools to build rimage This adds the necessary configuration files to enable autotools for configure/make files generation. Signed-off-by: Daniel Leung --- Makefile.am | 6 +++++ configure.ac | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 36 ++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 src/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000000..3d19426e7ea2 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +EXTRA_DIST = README +SUBDIRS = src diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000000..e39de6d54d37 --- /dev/null +++ b/configure.ac @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +AC_PREREQ([2.69]) +AC_INIT([rimage],[1.0]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_CONFIG_SRCDIR([src/rimage.c]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile + src/Makefile]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) + +# Checks for header files. +AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INT8_T +AC_TYPE_SIZE_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_CHECK_FUNCS([gettimeofday memset]) + +# Where SOF header files are +AC_ARG_WITH(sof-source, + AS_HELP_STRING([--with-sof-source=DIR],[where the root of SOF source is]), + [ SOF_SOURCE_DIR="$with_sof_source/src" ],) +AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + AC_CHECK_HEADERS(ipc/header.h, , + [ AC_MSG_ERROR([Unable to find ipc/header.h. Aborting.]) ]) + AC_CHECK_HEADERS(ipc/info.h, , + [ AC_MSG_ERROR([Unable to find ipc/info.h. Aborting.]) ]) + AC_CHECK_HEADERS(ipc/stream.h, , + [ AC_MSG_ERROR([Unable to find ipc/stream.h. Aborting.]) ]) + AC_CHECK_HEADERS(kernel/fw.h, , + [ AC_MSG_ERROR([Unable to find kernel/fw.h. Aborting.]) ]) + AC_CHECK_HEADERS(sof/logs/file_format.h, , + [ AC_MSG_ERROR([Unable to find sof/logs/file_format.h. Aborting.]) ]) + AC_CHECK_HEADERS(user/manifest.h, , + [ AC_MSG_ERROR([Unable to find user/manifest.h. Aborting.]) ]) +fi + +# Generate outputs +AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 000000000000..3d9c75a3a5b3 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +bin_PROGRAMS = rimage + +rimage_SOURCES = \ + cse.c \ + css.c \ + elf.c \ + file_simple.c \ + hash.c \ + man_apl.c \ + man_cnl.c \ + manifest.c \ + man_kbl.c \ + man_sue.c \ + man_tgl.c \ + pkcs1_5.c \ + plat_auth.c \ + rimage.c + +if USE_PROVIDED_SOF_HEADER + PROVIDED_SOF_HEADER = -Iinclude/sof + EXTRA_SOF_MACROS = +else + EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H +endif + +rimage_CFLAGS = \ + $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ + $(EXTRA_SOF_MACROS) \ + -O2 -g -Wall -Werror -Wl,-EL \ + -Wmissing-prototypes -Wimplicit-fallthrough=3 + +rimage_LDADD = -lcrypto From f6bf4b0d72d899861c34e7d08981ec37f5421986 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 11 Nov 2019 18:10:47 -0800 Subject: [PATCH 099/350] Add files created after running autoreconf This adds the files created after running `autoreconf -i`. This allows the project to be 'configure'-d and built. Signed-off-by: Daniel Leung --- Makefile.in | 772 +++++ aclocal.m4 | 1135 +++++++ autom4te.cache/output.0 | 6178 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/output.1 | 6178 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/requests | 154 + autom4te.cache/traces.0 | 953 ++++++ autom4te.cache/traces.1 | 509 ++++ compile | 348 +++ config.h.in | 141 + configure | 6178 +++++++++++++++++++++++++++++++++++++++ depcomp | 791 +++++ install-sh | 518 ++++ missing | 215 ++ src/Makefile.in | 853 ++++++ 14 files changed, 24923 insertions(+) create mode 100644 Makefile.in create mode 100644 aclocal.m4 create mode 100644 autom4te.cache/output.0 create mode 100644 autom4te.cache/output.1 create mode 100644 autom4te.cache/requests create mode 100644 autom4te.cache/traces.0 create mode 100644 autom4te.cache/traces.1 create mode 100755 compile create mode 100644 config.h.in create mode 100755 configure create mode 100755 depcomp create mode 100755 install-sh create mode 100755 missing create mode 100644 src/Makefile.in diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000000..59ef2e48a6ac --- /dev/null +++ b/Makefile.in @@ -0,0 +1,772 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \ + depcomp install-sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README +SUBDIRS = src +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000000..8c6b78f9d278 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1135 @@ +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 new file mode 100644 index 000000000000..19b6cbd5c002 --- /dev/null +++ b/autom4te.cache/output.0 @@ -0,0 +1,6178 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +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 + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --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" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # 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'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + 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' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +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_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --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 + --cache-file=FILE cache test results in FILE [disabled] + -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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --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'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +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 the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_find_intX_t LINENO BITS VAR +@%:@ ----------------------------------- +@%:@ Finds a signed integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in @%:@( + int$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_intX_t + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR +@%:@ ------------------------------------ +@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in @%:@( + uint$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_uintX_t + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* 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. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$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' +# 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. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + 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' + # 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. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$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'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* 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 don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $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. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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 : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_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_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_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 + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_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_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; 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=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +@%:@define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +@%:@ Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# 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 +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (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 + # 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. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$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. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# 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'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +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'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +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'. +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 +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +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 (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) 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 `:'. + 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;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$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 + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# 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 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +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"; } && + { $as_echo "$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 +$as_echo "$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" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 new file mode 100644 index 000000000000..19b6cbd5c002 --- /dev/null +++ b/autom4te.cache/output.1 @@ -0,0 +1,6178 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +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 + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --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" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # 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'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + 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' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +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_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --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 + --cache-file=FILE cache test results in FILE [disabled] + -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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --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'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +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 the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_find_intX_t LINENO BITS VAR +@%:@ ----------------------------------- +@%:@ Finds a signed integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in @%:@( + int$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_intX_t + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR +@%:@ ------------------------------------ +@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in @%:@( + uint$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_uintX_t + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* 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. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$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' +# 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. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + 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' + # 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. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$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'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* 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 don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $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. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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 : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_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_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_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 + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_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_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; 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=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +@%:@define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +@%:@ Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# 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 +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (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 + # 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. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$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. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# 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'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +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'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +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'. +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 +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +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 (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) 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 `:'. + 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;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$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 + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# 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 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +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"; } && + { $as_echo "$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 +$as_echo "$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" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/autom4te.cache/requests b/autom4te.cache/requests new file mode 100644 index 000000000000..31d47c7b6cc0 --- /dev/null +++ b/autom4te.cache/requests @@ -0,0 +1,154 @@ +# This file was generated. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf-2.69' + ], + [ + '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', + '-', + '/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4', + '/usr/share/aclocal-1.16/amversion.m4', + '/usr/share/aclocal-1.16/auxdir.m4', + '/usr/share/aclocal-1.16/cond.m4', + '/usr/share/aclocal-1.16/depend.m4', + '/usr/share/aclocal-1.16/depout.m4', + '/usr/share/aclocal-1.16/init.m4', + '/usr/share/aclocal-1.16/install-sh.m4', + '/usr/share/aclocal-1.16/lead-dot.m4', + '/usr/share/aclocal-1.16/make.m4', + '/usr/share/aclocal-1.16/missing.m4', + '/usr/share/aclocal-1.16/options.m4', + '/usr/share/aclocal-1.16/prog-cc-c-o.m4', + '/usr/share/aclocal-1.16/runlog.m4', + '/usr/share/aclocal-1.16/sanity.m4', + '/usr/share/aclocal-1.16/silent.m4', + '/usr/share/aclocal-1.16/strip.m4', + '/usr/share/aclocal-1.16/substnot.m4', + '/usr/share/aclocal-1.16/tar.m4', + 'configure.ac' + ], + { + 'AM_PROG_INSTALL_STRIP' => 1, + '_AM_MANGLE_OPTION' => 1, + 'm4_include' => 1, + 'AM_MISSING_HAS_RUN' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + '_AM_SET_OPTION' => 1, + 'AM_DEP_TRACK' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AM_MAKE_INCLUDE' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_SANITY_CHECK' => 1, + 'include' => 1, + '_AM_DEPENDENCIES' => 1, + 'AU_DEFUN' => 1, + 'AM_SET_DEPDIR' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_CONDITIONAL' => 1, + '_AM_IF_OPTION' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_MISSING_PROG' => 1, + '_m4_warn' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_PROG_TAR' => 1, + 'AC_DEFUN' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'm4_pattern_forbid' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/usr/share/autoconf-2.69' + ], + [ + '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + 'AC_SUBST_TRACE' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_NLS' => 1, + 'LT_INIT' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AM_PROG_AR' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'm4_sinclude' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'm4_include' => 1, + 'AM_PROG_FC_C_O' => 1, + 'm4_pattern_forbid' => 1, + 'AH_OUTPUT' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_FC_SRCEXT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_PATH_GUILE' => 1, + 'AC_FC_FREEFORM' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_CONFIG_FILES' => 1, + 'include' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_COND_ELSE' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AM_MAINTAINER_MODE' => 1, + '_AM_COND_ENDIF' => 1, + 'm4_pattern_allow' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'sinclude' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AC_INIT' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_GNU_GETTEXT' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + 'AC_CANONICAL_BUILD' => 1, + '_AM_COND_IF' => 1, + 'AC_SUBST' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 new file mode 100644 index 000000000000..a2519bc3d938 --- /dev/null +++ b/autom4te.cache/traces.0 @@ -0,0 +1,953 @@ +m4trace:/usr/share/aclocal-1.16/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.16/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.16/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) +m4trace:/usr/share/aclocal-1.16/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/usr/share/aclocal-1.16/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/usr/share/aclocal-1.16/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.16/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/usr/share/aclocal-1.16/depout.m4:11: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +]) +m4trace:/usr/share/aclocal-1.16/depout.m4:62: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) +m4trace:/usr/share/aclocal-1.16/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) +m4trace:/usr/share/aclocal-1.16/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.16/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) +m4trace:/usr/share/aclocal-1.16/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/usr/share/aclocal-1.16/make.m4:13: -1- AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +m4trace:/usr/share/aclocal-1.16/make.m4:42: -1- m4_pattern_allow([^am__quote$]) +m4trace:/usr/share/aclocal-1.16/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.16/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) +m4trace:/usr/share/aclocal-1.16/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.16/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) +m4trace:/usr/share/aclocal-1.16/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.16/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) +m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) +m4trace:/usr/share/aclocal-1.16/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.16/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) +m4trace:/usr/share/aclocal-1.16/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.16/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.16/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.16/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.16/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) +m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Wall]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Wall]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Werror]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Werror]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([foreign]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AM_SANITY_CHECK +m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:7: -1- AM_SILENT_RULES +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:14: -1- _AM_PROG_CC_C_O +m4trace:configure.ac:14: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) +m4trace:configure.ac:14: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:14: -1- AM_SET_DEPDIR +m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:14: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:14: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:14: -1- AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:14: -1- AM_DEP_TRACK +m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) +m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) +m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) +m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) +m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) +m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) +m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) +m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) +m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) +m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) +m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:62: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:62: -1- AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 new file mode 100644 index 000000000000..43633f948703 --- /dev/null +++ b/autom4te.cache/traces.1 @@ -0,0 +1,509 @@ +m4trace:aclocal.m4:679: -1- AC_SUBST([am__quote]) +m4trace:aclocal.m4:679: -1- AC_SUBST_TRACE([am__quote]) +m4trace:aclocal.m4:679: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:6: -1- AC_INIT([rimage], [1.0]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:6: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:7: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:7: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:7: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:7: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:7: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:7: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:7: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:7: -1- AC_SUBST([AWK]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:7: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:7: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:7: -1- AM_SILENT_RULES +m4trace:configure.ac:7: -1- AC_SUBST([AM_V]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_BACKSLASH]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_BACKSLASH]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.ac:10: -1- AC_CONFIG_FILES([Makefile + src/Makefile]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:14: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:14: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:14: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:14: -1- AC_SUBST([am__include]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:14: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:17: -1- AH_OUTPUT([HAVE_LIBCRYPTO], [/* Define to 1 if you have the `crypto\' library (-lcrypto). */ +@%:@undef HAVE_LIBCRYPTO]) +m4trace:configure.ac:17: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCRYPTO]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:20: -1- AC_SUBST([CPP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:20: -1- AC_SUBST([CPP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- AC_SUBST([GREP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:20: -1- AC_SUBST([EGREP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:20: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:20: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MEMORY_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:23: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:24: -1- AC_DEFINE_TRACE_LITERAL([int16_t]) +m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) +m4trace:configure.ac:24: -1- AH_OUTPUT([int16_t], [/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int16_t]) +m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([int32_t]) +m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) +m4trace:configure.ac:25: -1- AH_OUTPUT([int32_t], [/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int32_t]) +m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([int64_t]) +m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) +m4trace:configure.ac:26: -1- AH_OUTPUT([int64_t], [/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int64_t]) +m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([int8_t]) +m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) +m4trace:configure.ac:27: -1- AH_OUTPUT([int8_t], [/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +@%:@undef int8_t]) +m4trace:configure.ac:28: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:28: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ +@%:@undef size_t]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([uint16_t]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([uint16_t], [/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint16_t]) +m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_UINT32_T]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) +m4trace:configure.ac:30: -1- AH_OUTPUT([_UINT32_T], [/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT32_T]) +m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([uint32_t]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) +m4trace:configure.ac:30: -1- AH_OUTPUT([uint32_t], [/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint32_t]) +m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([_UINT64_T]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) +m4trace:configure.ac:31: -1- AH_OUTPUT([_UINT64_T], [/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT64_T]) +m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([uint64_t]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) +m4trace:configure.ac:31: -1- AH_OUTPUT([uint64_t], [/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint64_t]) +m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([_UINT8_T]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) +m4trace:configure.ac:32: -1- AH_OUTPUT([_UINT8_T], [/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT8_T]) +m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([uint8_t]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) +m4trace:configure.ac:32: -1- AH_OUTPUT([uint8_t], [/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint8_t]) +m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ +@%:@undef HAVE_MEMSET]) +m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) +m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) +m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:47: -1- AH_OUTPUT([HAVE_IPC_HEADER_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_HEADER_H]) +m4trace:configure.ac:47: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_HEADER_H]) +m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) +m4trace:configure.ac:49: -1- AH_OUTPUT([HAVE_IPC_INFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_INFO_H]) +m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_INFO_H]) +m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) +m4trace:configure.ac:51: -1- AH_OUTPUT([HAVE_IPC_STREAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_STREAM_H]) +m4trace:configure.ac:51: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_STREAM_H]) +m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) +m4trace:configure.ac:53: -1- AH_OUTPUT([HAVE_KERNEL_FW_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_KERNEL_FW_H]) +m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([HAVE_KERNEL_FW_H]) +m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) +m4trace:configure.ac:55: -1- AH_OUTPUT([HAVE_SOF_LOGS_FILE_FORMAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SOF_LOGS_FILE_FORMAT_H]) +m4trace:configure.ac:55: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOF_LOGS_FILE_FORMAT_H]) +m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) +m4trace:configure.ac:57: -1- AH_OUTPUT([HAVE_USER_MANIFEST_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_USER_MANIFEST_H]) +m4trace:configure.ac:57: -1- AC_DEFINE_TRACE_LITERAL([HAVE_USER_MANIFEST_H]) +m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) +m4trace:configure.ac:62: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:62: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/compile b/compile new file mode 100755 index 000000000000..99e50524b3ba --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 000000000000..ef2c623daf43 --- /dev/null +++ b/config.h.in @@ -0,0 +1,141 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_HEADER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_INFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_STREAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_KERNEL_FW_H + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_SOF_LOGS_FILE_FORMAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_USER_MANIFEST_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t diff --git a/configure b/configure new file mode 100755 index 000000000000..abc56f0e1ab4 --- /dev/null +++ b/configure @@ -0,0 +1,6178 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for rimage 1.0. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +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 + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +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'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + 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" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --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" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # 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'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + 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' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +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_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --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 + --cache-file=FILE cache test results in FILE [disabled] + -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 \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --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'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/rimage] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +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 the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* 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. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$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' +# 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. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + 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' + # 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. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$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'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* 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 don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $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. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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 : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +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' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + 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 +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_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_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_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 + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + 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 +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_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_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; 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=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +# Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# 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 +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (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 + # 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. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# 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 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +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'. + 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 + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +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'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$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. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# 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'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +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'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +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'. +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 +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +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 (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) 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 `:'. + 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;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$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 + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# 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 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +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"; } && + { $as_echo "$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 +$as_echo "$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" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/depcomp b/depcomp new file mode 100755 index 000000000000..65cbf7093a1e --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/install-sh b/install-sh new file mode 100755 index 000000000000..8175c640fe62 --- /dev/null +++ b/install-sh @@ -0,0 +1,518 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2018-03-11.20; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100755 index 000000000000..625aeb11897a --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 000000000000..3bef76b122f0 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,853 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = rimage$(EXEEXT) +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_rimage_OBJECTS = rimage-cse.$(OBJEXT) rimage-css.$(OBJEXT) \ + rimage-elf.$(OBJEXT) rimage-file_simple.$(OBJEXT) \ + rimage-hash.$(OBJEXT) rimage-man_apl.$(OBJEXT) \ + rimage-man_cnl.$(OBJEXT) rimage-manifest.$(OBJEXT) \ + rimage-man_kbl.$(OBJEXT) rimage-man_sue.$(OBJEXT) \ + rimage-man_tgl.$(OBJEXT) rimage-pkcs1_5.$(OBJEXT) \ + rimage-plat_auth.$(OBJEXT) rimage-rimage.$(OBJEXT) +rimage_OBJECTS = $(am_rimage_OBJECTS) +rimage_DEPENDENCIES = +rimage_LINK = $(CCLD) $(rimage_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/rimage-cse.Po \ + ./$(DEPDIR)/rimage-css.Po ./$(DEPDIR)/rimage-elf.Po \ + ./$(DEPDIR)/rimage-file_simple.Po ./$(DEPDIR)/rimage-hash.Po \ + ./$(DEPDIR)/rimage-man_apl.Po ./$(DEPDIR)/rimage-man_cnl.Po \ + ./$(DEPDIR)/rimage-man_kbl.Po ./$(DEPDIR)/rimage-man_sue.Po \ + ./$(DEPDIR)/rimage-man_tgl.Po ./$(DEPDIR)/rimage-manifest.Po \ + ./$(DEPDIR)/rimage-pkcs1_5.Po ./$(DEPDIR)/rimage-plat_auth.Po \ + ./$(DEPDIR)/rimage-rimage.Po +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(rimage_SOURCES) +DIST_SOURCES = $(rimage_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +rimage_SOURCES = \ + cse.c \ + css.c \ + elf.c \ + file_simple.c \ + hash.c \ + man_apl.c \ + man_cnl.c \ + manifest.c \ + man_kbl.c \ + man_sue.c \ + man_tgl.c \ + pkcs1_5.c \ + plat_auth.c \ + rimage.c + +@USE_PROVIDED_SOF_HEADER_TRUE@PROVIDED_SOF_HEADER = -Iinclude/sof +@USE_PROVIDED_SOF_HEADER_FALSE@EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H +@USE_PROVIDED_SOF_HEADER_TRUE@EXTRA_SOF_MACROS = +rimage_CFLAGS = \ + $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ + $(EXTRA_SOF_MACROS) \ + -O2 -g -Wall -Werror -Wl,-EL \ + -Wmissing-prototypes -Wimplicit-fallthrough=3 + +rimage_LDADD = -lcrypto +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +rimage$(EXEEXT): $(rimage_OBJECTS) $(rimage_DEPENDENCIES) $(EXTRA_rimage_DEPENDENCIES) + @rm -f rimage$(EXEEXT) + $(AM_V_CCLD)$(rimage_LINK) $(rimage_OBJECTS) $(rimage_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-cse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-css.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-elf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-file_simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_apl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_cnl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_kbl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_sue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_tgl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-manifest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-pkcs1_5.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-plat_auth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-rimage.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +rimage-cse.o: cse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.o -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c + +rimage-cse.obj: cse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.obj -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` + +rimage-css.o: css.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.o -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c + +rimage-css.obj: css.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.obj -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` + +rimage-elf.o: elf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.o -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c + +rimage-elf.obj: elf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.obj -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` + +rimage-file_simple.o: file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.o -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c + +rimage-file_simple.obj: file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.obj -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` + +rimage-hash.o: hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.o -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c + +rimage-hash.obj: hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.obj -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` + +rimage-man_apl.o: man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.o -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c + +rimage-man_apl.obj: man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.obj -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` + +rimage-man_cnl.o: man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.o -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c + +rimage-man_cnl.obj: man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.obj -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` + +rimage-manifest.o: manifest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.o -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c + +rimage-manifest.obj: manifest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.obj -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` + +rimage-man_kbl.o: man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.o -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c + +rimage-man_kbl.obj: man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.obj -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` + +rimage-man_sue.o: man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.o -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c + +rimage-man_sue.obj: man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.obj -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` + +rimage-man_tgl.o: man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.o -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c + +rimage-man_tgl.obj: man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.obj -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` + +rimage-pkcs1_5.o: pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.o -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c + +rimage-pkcs1_5.obj: pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.obj -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` + +rimage-plat_auth.o: plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.o -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c + +rimage-plat_auth.obj: plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.obj -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` + +rimage-rimage.o: rimage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.o -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c + +rimage-rimage.obj: rimage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.obj -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/rimage-cse.Po + -rm -f ./$(DEPDIR)/rimage-css.Po + -rm -f ./$(DEPDIR)/rimage-elf.Po + -rm -f ./$(DEPDIR)/rimage-file_simple.Po + -rm -f ./$(DEPDIR)/rimage-hash.Po + -rm -f ./$(DEPDIR)/rimage-man_apl.Po + -rm -f ./$(DEPDIR)/rimage-man_cnl.Po + -rm -f ./$(DEPDIR)/rimage-man_kbl.Po + -rm -f ./$(DEPDIR)/rimage-man_sue.Po + -rm -f ./$(DEPDIR)/rimage-man_tgl.Po + -rm -f ./$(DEPDIR)/rimage-manifest.Po + -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po + -rm -f ./$(DEPDIR)/rimage-plat_auth.Po + -rm -f ./$(DEPDIR)/rimage-rimage.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/rimage-cse.Po + -rm -f ./$(DEPDIR)/rimage-css.Po + -rm -f ./$(DEPDIR)/rimage-elf.Po + -rm -f ./$(DEPDIR)/rimage-file_simple.Po + -rm -f ./$(DEPDIR)/rimage-hash.Po + -rm -f ./$(DEPDIR)/rimage-man_apl.Po + -rm -f ./$(DEPDIR)/rimage-man_cnl.Po + -rm -f ./$(DEPDIR)/rimage-man_kbl.Po + -rm -f ./$(DEPDIR)/rimage-man_sue.Po + -rm -f ./$(DEPDIR)/rimage-man_tgl.Po + -rm -f ./$(DEPDIR)/rimage-manifest.Po + -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po + -rm -f ./$(DEPDIR)/rimage-plat_auth.Po + -rm -f ./$(DEPDIR)/rimage-rimage.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: From f2e92812afa18ad6d369dba9bae395de2a17790d Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 11 Nov 2019 18:20:34 -0800 Subject: [PATCH 100/350] Add building instructions to README.md This adds intructions to build the rimage tool. Signed-off-by: Daniel Leung --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5c67ede5194..4b484048dec4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # rimage -DSP firmware image creation and signing tool + +`rimage` is a DSP firmware image creation and signing tool targeting +the DSP on certain Intel System-on-Chip (SoC). This is used by +the [Sound Open Firmware (SOF)](https://github.com/thesofproject/sof) +to generate binary image files. + +## Building + +The `rimage` tool can be built with or without logging dictionary +support, where such support is required to decipher the log messages +produced the the SOF firmware. + +#### Build without dictionary support: + +```shell +$ ./configure +$ make +$ make install +``` + +#### Build with dictionary support: + +To build `rimage` with dictionary support, the SOF source is required. +First, clone the SOF source tree from +[here](https://github.com/thesofproject/sof). Then, do: + +```shell +$ ./configure --with-sof-source= +$ make +$ make install +``` + +Note that creating the SOF firmware image requires dicitionary support. From 713e0f8513de42d755868f01207657e1a6fb716f Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 13 Jan 2020 20:24:31 +0200 Subject: [PATCH 101/350] rimage: Add support for i.MX8X i.MX8X is very similar with i.MX8. Memory layout is the same except IRQSTEER address. Code will be shared but there will be different firmware binaries named: * sof-imx8.ri, for i.MX8 * sof-imx8x.ri, for i.MX8X Signed-off-by: Daniel Baluta --- src/file_simple.c | 23 +++++++++++++++++++++++ src/include/rimage/rimage.h | 3 ++- src/rimage.c | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/file_simple.c b/src/file_simple.c index 8cdd05924537..7e730fde1360 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -573,3 +573,26 @@ const struct adsp machine_imx8 = { .machine_id = MACHINE_IMX8, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8x = { + .name = "imx8x", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8_IRAM_BASE, + .size = IMX8_IRAM_SIZE, + .host_offset = IMX8_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8_DRAM_BASE, + .size = IMX8_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8_SRAM_BASE, + .size = IMX8_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8X, + .write_firmware = simple_write_firmware, +}; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 02a840a9a62a..594a995f11e2 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -38,6 +38,7 @@ enum machine_id { MACHINE_TIGERLAKE, MACHINE_SUECREEK, MACHINE_IMX8, + MACHINE_IMX8X, MACHINE_MAX }; @@ -206,6 +207,6 @@ extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; extern const struct adsp machine_imx8; - +extern const struct adsp machine_imx8x; #endif diff --git a/src/rimage.c b/src/rimage.c index 98f0f5cdcd99..8e4a91398ac6 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,6 +26,7 @@ static const struct adsp *machine[] = { &machine_kbl, &machine_skl, &machine_imx8, + &machine_imx8x, }; static void usage(char *name) From 0adacd5ac25a9ab3956602fcb8e601348567668d Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:40:55 -0700 Subject: [PATCH 102/350] Update source files from main SOF repo Update source files from main SOF repository @ commit 4e87899f25b0c859169c1dfd4dd9f9fd65d48ad2. Signed-off-by: Daniel Leung --- src/elf.c | 6 ++ src/file_simple.c | 198 ++++++++++++++++++++++++++++++------ src/include/rimage/rimage.h | 5 +- src/manifest.c | 3 + src/rimage.c | 3 +- 5 files changed, 184 insertions(+), 31 deletions(-) diff --git a/src/elf.c b/src/elf.c index 3796c9fb50d6..1b5420439da7 100644 --- a/src/elf.c +++ b/src/elf.c @@ -80,6 +80,9 @@ static int elf_read_sections(struct image *image, struct module *module, module->logs_index = -EINVAL; + fprintf(stdout, "info: ignore .static_uuids section for bootloader module\n"); + module->uids_index = -EINVAL; + fprintf(stdout, "info: ignore .fw_ready" " section for bootloader module\n"); @@ -94,6 +97,9 @@ static int elf_read_sections(struct image *image, struct module *module, module->logs_index = elf_find_section(image, module, ".static_log_entries"); + module->uids_index = elf_find_section(image, module, + ".static_uuid_entries"); + module->fw_ready_index = elf_find_section(image, module, ".fw_ready"); if (module->fw_ready_index < 0) diff --git a/src/file_simple.c b/src/file_simple.c index 7e730fde1360..419e7856da60 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -9,6 +9,7 @@ #include #ifdef HAS_FILE_FORMAT_H +#include #include #endif /* HAS_FILE_FORMAT_H */ @@ -43,6 +44,14 @@ #define IMX8_SRAM_BASE 0x92400000 #define IMX8_SRAM_SIZE 0x800000 +#define IMX8M_IRAM_BASE 0x3b6f8000 +#define IMX8M_IRAM_HOST_OFFSET 0x10000 +#define IMX8M_IRAM_SIZE 0x800 +#define IMX8M_DRAM_BASE 0x3b6e8000 +#define IMX8M_DRAM_SIZE 0x8000 +#define IMX8M_SRAM_BASE 0x92400000 +#define IMX8M_SRAM_SIZE 0x800000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -67,6 +76,75 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) return SOF_FW_BLK_TYPE_INVALID; } +#ifdef HAS_FILE_FORMAT_H +static int fw_version_copy(struct snd_sof_logs_header *header, + const struct module *module) +{ + Elf32_Shdr *section = NULL; + struct sof_ipc_ext_data_hdr *ext_hdr = NULL; + void *buffer = NULL; + + if (module->fw_ready_index <= 0) + return 0; + + section = &module->section[module->fw_ready_index]; + + buffer = calloc(1, section->size); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->off, SEEK_SET); + size_t count = fread(buffer, 1, + section->size, module->fd); + + if (count != section->size) { + fprintf(stderr, "error: can't read ready section %d\n", -errno); + free(buffer); + return -errno; + } + + memcpy(&header->version, + &((struct sof_ipc_fw_ready *)buffer)->version, + sizeof(header->version)); + + /* fw_ready structure contains main (primarily kernel) + * ABI version. + */ + + fprintf(stdout, "fw abi main version: %d:%d:%d\n", + SOF_ABI_VERSION_MAJOR(header->version.abi_version), + SOF_ABI_VERSION_MINOR(header->version.abi_version), + SOF_ABI_VERSION_PATCH(header->version.abi_version)); + + /* let's find dbg abi version, which the log client + * is interested in and override the kernel's one. + * + * skip the base fw-ready record and begin from the first extension. + */ + ext_hdr = buffer + ((struct sof_ipc_fw_ready *)buffer)->hdr.size; + while ((uintptr_t)ext_hdr < (uintptr_t)buffer + section->size) { + if (ext_hdr->type == SOF_IPC_EXT_USER_ABI_INFO) { + header->version.abi_version = + ((struct sof_ipc_user_abi_version *) + ext_hdr)->abi_dbg_version; + break; + } + //move to the next entry + ext_hdr = (struct sof_ipc_ext_data_hdr *) + ((uint8_t *)ext_hdr + ext_hdr->hdr.size); + } + + fprintf(stdout, "fw abi dbg version: %d:%d:%d\n", + SOF_ABI_VERSION_MAJOR(header->version.abi_version), + SOF_ABI_VERSION_MINOR(header->version.abi_version), + SOF_ABI_VERSION_PATCH(header->version.abi_version)); + + free(buffer); + + return 0; +} +#endif /* HAS_FILE_FORMAT_H */ + static int block_idx; static int write_block(struct image *image, struct module *module, @@ -370,7 +448,7 @@ static int simple_write_firmware(struct image *image) } #ifdef HAS_FILE_FORMAT_H -int write_logs_dictionary(struct image *image) +static int write_logs_dictionary(struct image *image) { struct snd_sof_logs_header header; int i, ret = 0; @@ -385,33 +463,9 @@ int write_logs_dictionary(struct image *image) /* extract fw_version from fw_ready message located * in .fw_ready section */ - if (module->fw_ready_index > 0) { - Elf32_Shdr *section = - &module->section[module->fw_ready_index]; - - buffer = calloc(1, sizeof(struct sof_ipc_fw_ready)); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, - sizeof(struct sof_ipc_fw_ready), module->fd); - - if (count != sizeof(struct sof_ipc_fw_ready)) { - fprintf(stderr, - "error: can't read ready section %d\n", - -errno); - ret = -errno; - goto out; - } - - memcpy(&header.version, - &((struct sof_ipc_fw_ready *)buffer)->version, - sizeof(header.version)); - - free(buffer); - buffer = NULL; - } + ret = fw_version_copy(&header, module); + if (ret < 0) + goto out; if (module->logs_index > 0) { Elf32_Shdr *section = @@ -449,7 +503,7 @@ int write_logs_dictionary(struct image *image) fprintf(stdout, "logs dictionary: size %u\n", header.data_length + header.data_offset); - fprintf(stdout, "including fw version of size: %lu\n\n", + fprintf(stdout, "including fw version of size: %lu\n", (unsigned long)sizeof(header.version)); } } @@ -459,6 +513,69 @@ int write_logs_dictionary(struct image *image) return ret; } + +static int write_uids_dictionary(struct image *image) +{ + struct snd_sof_uids_header header; + Elf32_Shdr *section; + int i, ret = 0; + void *buffer = NULL; + + memcpy(header.sig, SND_SOF_UIDS_SIG, SND_SOF_UIDS_SIG_SIZE); + header.data_offset = sizeof(struct snd_sof_uids_header); + + for (i = 0; i < image->num_modules; i++) { + struct module *module = &image->module[i]; + + if (module->uids_index <= 0) + continue; + section = &module->section[module->uids_index]; + + header.base_address = section->vaddr; + header.data_length = section->size; + + fwrite(&header, sizeof(struct snd_sof_uids_header), 1, + image->ldc_out_fd); + + buffer = calloc(1, section->size); + if (!buffer) + return -ENOMEM; + fseek(module->fd, section->off, SEEK_SET); + if (fread(buffer, 1, section->size, module->fd) != + section->size) { + fprintf(stderr, "error: can't read uids section %d\n", + -errno); + ret = -errno; + goto out; + } + if (fwrite(buffer, 1, section->size, image->ldc_out_fd) != + section->size) { + fprintf(stderr, "error: cant't write section %d\n", + -errno); + ret = -errno; + goto out; + } + fprintf(stdout, "uids dictionary: size %u\n", + header.data_length + header.data_offset); + } +out: + free(buffer); + return ret; +} + +int write_dictionaries(struct image *image) +{ + int ret = 0; + + ret = write_logs_dictionary(image); + if (ret) + goto out; + + ret = write_uids_dictionary(image); + +out: + return ret; +} #endif /* HAS_FILE_FORMAT_H */ const struct adsp machine_byt = { @@ -596,3 +713,26 @@ const struct adsp machine_imx8x = { .machine_id = MACHINE_IMX8X, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8m = { + .name = "imx8m", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8M_IRAM_BASE, + .size = IMX8M_IRAM_SIZE, + .host_offset = IMX8M_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8M_DRAM_BASE, + .size = IMX8M_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8M_SRAM_BASE, + .size = IMX8M_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8M, + .write_firmware = simple_write_firmware, +}; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 594a995f11e2..08e398b5f65e 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -39,6 +39,7 @@ enum machine_id { MACHINE_SUECREEK, MACHINE_IMX8, MACHINE_IMX8X, + MACHINE_IMX8M, MACHINE_MAX }; @@ -67,6 +68,7 @@ struct module { int fw_size; int bss_index; int logs_index; + int uids_index; int fw_ready_index; /* sizes do not include any gaps */ @@ -162,7 +164,7 @@ struct adsp { }; #ifdef HAS_FILE_FORMAT_H -int write_logs_dictionary(struct image *image); +int write_dictionaries(struct image *image); #endif /* HAS_FILE_FORMAT_H */ void module_sha256_create(struct image *image); @@ -208,5 +210,6 @@ extern const struct adsp machine_skl; extern const struct adsp machine_kbl; extern const struct adsp machine_imx8; extern const struct adsp machine_imx8x; +extern const struct adsp machine_imx8m; #endif diff --git a/src/manifest.c b/src/manifest.c index 4c14d742cd55..4f4ff763c02b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -41,6 +41,7 @@ static int man_open_rom_file(struct image *image) if (!image->out_rom_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); + return -errno; } return 0; @@ -56,6 +57,7 @@ static int man_open_unsigned_file(struct image *image) if (!image->out_unsigned_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); + return -errno; } return 0; @@ -71,6 +73,7 @@ static int man_open_manifest_file(struct image *image) if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); + return -errno; } return 0; diff --git a/src/rimage.c b/src/rimage.c index 8e4a91398ac6..c015dc8c96f7 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -27,6 +27,7 @@ static const struct adsp *machine[] = { &machine_skl, &machine_imx8, &machine_imx8x, + &machine_imx8m, }; static void usage(char *name) @@ -213,7 +214,7 @@ int main(int argc, char *argv[]) ret = -EINVAL; goto out; } - ret = write_logs_dictionary(&image); + ret = write_dictionaries(&image); #endif /* HAS_FILE_FORMAT_H */ out: From 58acbefc8ed704c9b6a93877b6986c7f4d3cd904 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:51:27 -0700 Subject: [PATCH 103/350] Remove autotools files CMake is to be used instead of autotools. So remove the autotools files. This revert commit f6bf4b0d72d899861c34e7d08981ec37f5421986 and commit 0d33e87433865cdc84d249b5cb6633b24cf6ecfb Signed-off-by: Daniel Leung --- Makefile.am | 6 - Makefile.in | 772 ----- aclocal.m4 | 1135 ------- autom4te.cache/output.0 | 6178 --------------------------------------- autom4te.cache/output.1 | 6178 --------------------------------------- autom4te.cache/requests | 154 - autom4te.cache/traces.0 | 953 ------ autom4te.cache/traces.1 | 509 ---- compile | 348 --- config.h.in | 141 - configure | 6178 --------------------------------------- configure.ac | 62 - depcomp | 791 ----- install-sh | 518 ---- missing | 215 -- src/Makefile.am | 36 - src/Makefile.in | 853 ------ 17 files changed, 25027 deletions(-) delete mode 100644 Makefile.am delete mode 100644 Makefile.in delete mode 100644 aclocal.m4 delete mode 100644 autom4te.cache/output.0 delete mode 100644 autom4te.cache/output.1 delete mode 100644 autom4te.cache/requests delete mode 100644 autom4te.cache/traces.0 delete mode 100644 autom4te.cache/traces.1 delete mode 100755 compile delete mode 100644 config.h.in delete mode 100755 configure delete mode 100644 configure.ac delete mode 100755 depcomp delete mode 100755 install-sh delete mode 100755 missing delete mode 100644 src/Makefile.am delete mode 100644 src/Makefile.in diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3d19426e7ea2..000000000000 --- a/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -EXTRA_DIST = README -SUBDIRS = src diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 59ef2e48a6ac..000000000000 --- a/Makefile.in +++ /dev/null @@ -1,772 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \ - depcomp install-sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = README -SUBDIRS = src -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) all install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distclean-hdr \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 8c6b78f9d278..000000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,1135 +0,0 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Copyright (C) 2002-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 deleted file mode 100644 index 19b6cbd5c002..000000000000 --- a/autom4te.cache/output.0 +++ /dev/null @@ -1,6178 +0,0 @@ -@%:@! /bin/sh -@%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. -@%:@ -@%:@ -@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@%:@ -@%:@ -@%:@ This configure script is free software; the Free Software Foundation -@%:@ gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -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 - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in @%:@( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIB@&t@OBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIB@&t@OBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --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" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # 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'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - 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' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -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_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -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 rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --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 - --cache-file=FILE cache test results in FILE [disabled] - -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 \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - @<:@@S|@ac_default_prefix@:>@ - --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'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -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 the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -@%:@ ac_fn_c_try_compile LINENO -@%:@ -------------------------- -@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_compile - -@%:@ ac_fn_c_try_link LINENO -@%:@ ----------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_link - -@%:@ ac_fn_c_try_cpp LINENO -@%:@ ---------------------- -@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_cpp - -@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using -@%:@ the include files in INCLUDES and setting the cache variable VAR -@%:@ accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_mongrel - -@%:@ ac_fn_c_try_run LINENO -@%:@ ---------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes -@%:@ that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_run - -@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists and can be compiled using the include files in -@%:@ INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_compile - -@%:@ ac_fn_c_find_intX_t LINENO BITS VAR -@%:@ ----------------------------------- -@%:@ Finds a signed integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in @%:@( - int$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_intX_t - -@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES -@%:@ ------------------------------------------- -@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache -@%:@ variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_type - -@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR -@%:@ ------------------------------------ -@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in @%:@( - uint$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_uintX_t - -@%:@ ac_fn_c_check_func LINENO FUNC VAR -@%:@ ---------------------------------- -@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* 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. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* 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. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in @%:@(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in @%:@(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -@%:@ Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $@%:@ != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$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' -# 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. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - 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' - # 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. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$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'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* 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 don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in @%:@( - '0:this is the am__doit target') : - case $s in @%:@( - BSD) : - am__include='.include' am__quote='"' ;; @%:@( - *) : - am__include='include' am__quote='' ;; -esac ;; @%:@( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -@%:@ Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $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. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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 : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_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_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_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 - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_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_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; 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=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -@%:@define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -@%:@ Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# 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 -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (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 - # 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. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIB@&t@OBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$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. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX -@%:@@%:@ Running $as_me. @%:@@%:@ -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# 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'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -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'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -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'. -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 -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -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 (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) 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 `:'. - 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;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$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 - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# 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 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -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"; } && - { $as_echo "$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 -$as_echo "$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" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in @%:@( - *\'*) : - eval set x "$CONFIG_FILES" ;; @%:@( - *) : - set x $CONFIG_FILES ;; @%:@( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 deleted file mode 100644 index 19b6cbd5c002..000000000000 --- a/autom4te.cache/output.1 +++ /dev/null @@ -1,6178 +0,0 @@ -@%:@! /bin/sh -@%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. -@%:@ -@%:@ -@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@%:@ -@%:@ -@%:@ This configure script is free software; the Free Software Foundation -@%:@ gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -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 - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in @%:@( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIB@&t@OBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIB@&t@OBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --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" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # 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'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - 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' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -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_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -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 rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --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 - --cache-file=FILE cache test results in FILE [disabled] - -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 \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - @<:@@S|@ac_default_prefix@:>@ - --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'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -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 the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -@%:@ ac_fn_c_try_compile LINENO -@%:@ -------------------------- -@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_compile - -@%:@ ac_fn_c_try_link LINENO -@%:@ ----------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_link - -@%:@ ac_fn_c_try_cpp LINENO -@%:@ ---------------------- -@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_cpp - -@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using -@%:@ the include files in INCLUDES and setting the cache variable VAR -@%:@ accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_mongrel - -@%:@ ac_fn_c_try_run LINENO -@%:@ ---------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes -@%:@ that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_run - -@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists and can be compiled using the include files in -@%:@ INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_compile - -@%:@ ac_fn_c_find_intX_t LINENO BITS VAR -@%:@ ----------------------------------- -@%:@ Finds a signed integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in @%:@( - int$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_intX_t - -@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES -@%:@ ------------------------------------------- -@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache -@%:@ variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_type - -@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR -@%:@ ------------------------------------ -@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in @%:@( - uint$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_uintX_t - -@%:@ ac_fn_c_check_func LINENO FUNC VAR -@%:@ ---------------------------------- -@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* 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. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* 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. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in @%:@(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in @%:@(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -@%:@ Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $@%:@ != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$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' -# 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. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - 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' - # 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. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$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'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* 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 don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in @%:@( - '0:this is the am__doit target') : - case $s in @%:@( - BSD) : - am__include='.include' am__quote='"' ;; @%:@( - *) : - am__include='include' am__quote='' ;; -esac ;; @%:@( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -@%:@ Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $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. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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 : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_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_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_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 - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_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_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; 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=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -@%:@define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -@%:@ Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# 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 -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (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 - # 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. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIB@&t@OBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$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. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX -@%:@@%:@ Running $as_me. @%:@@%:@ -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# 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'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -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'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -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'. -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 -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -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 (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) 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 `:'. - 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;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$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 - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# 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 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -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"; } && - { $as_echo "$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 -$as_echo "$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" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in @%:@( - *\'*) : - eval set x "$CONFIG_FILES" ;; @%:@( - *) : - set x $CONFIG_FILES ;; @%:@( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/autom4te.cache/requests b/autom4te.cache/requests deleted file mode 100644 index 31d47c7b6cc0..000000000000 --- a/autom4te.cache/requests +++ /dev/null @@ -1,154 +0,0 @@ -# This file was generated. -# It contains the lists of macros which have been traced. -# It can be safely removed. - -@request = ( - bless( [ - '0', - 1, - [ - '/usr/share/autoconf-2.69' - ], - [ - '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', - '-', - '/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4', - '/usr/share/aclocal-1.16/amversion.m4', - '/usr/share/aclocal-1.16/auxdir.m4', - '/usr/share/aclocal-1.16/cond.m4', - '/usr/share/aclocal-1.16/depend.m4', - '/usr/share/aclocal-1.16/depout.m4', - '/usr/share/aclocal-1.16/init.m4', - '/usr/share/aclocal-1.16/install-sh.m4', - '/usr/share/aclocal-1.16/lead-dot.m4', - '/usr/share/aclocal-1.16/make.m4', - '/usr/share/aclocal-1.16/missing.m4', - '/usr/share/aclocal-1.16/options.m4', - '/usr/share/aclocal-1.16/prog-cc-c-o.m4', - '/usr/share/aclocal-1.16/runlog.m4', - '/usr/share/aclocal-1.16/sanity.m4', - '/usr/share/aclocal-1.16/silent.m4', - '/usr/share/aclocal-1.16/strip.m4', - '/usr/share/aclocal-1.16/substnot.m4', - '/usr/share/aclocal-1.16/tar.m4', - 'configure.ac' - ], - { - 'AM_PROG_INSTALL_STRIP' => 1, - '_AM_MANGLE_OPTION' => 1, - 'm4_include' => 1, - 'AM_MISSING_HAS_RUN' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_RUN_LOG' => 1, - '_AM_SET_OPTION' => 1, - 'AM_DEP_TRACK' => 1, - 'm4_pattern_allow' => 1, - '_AM_AUTOCONF_VERSION' => 1, - 'AM_MAKE_INCLUDE' => 1, - 'AM_SET_LEADING_DOT' => 1, - '_AM_PROG_CC_C_O' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AM_SANITY_CHECK' => 1, - 'include' => 1, - '_AM_DEPENDENCIES' => 1, - 'AU_DEFUN' => 1, - 'AM_SET_DEPDIR' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, - 'AC_DEFUN_ONCE' => 1, - 'AM_CONDITIONAL' => 1, - '_AM_IF_OPTION' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AM_SILENT_RULES' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_MISSING_PROG' => 1, - '_m4_warn' => 1, - '_AM_SET_OPTIONS' => 1, - '_AM_PROG_TAR' => 1, - 'AC_DEFUN' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AM_SUBST_NOTMAKE' => 1, - 'AM_AUX_DIR_EXPAND' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'm4_pattern_forbid' => 1 - } - ], 'Autom4te::Request' ), - bless( [ - '1', - 1, - [ - '/usr/share/autoconf-2.69' - ], - [ - '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', - 'aclocal.m4', - 'configure.ac' - ], - { - 'AC_SUBST_TRACE' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AM_PROG_MOC' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AM_NLS' => 1, - 'LT_INIT' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AM_PROG_AR' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AC_FC_PP_SRCEXT' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'm4_sinclude' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'm4_include' => 1, - 'AM_PROG_FC_C_O' => 1, - 'm4_pattern_forbid' => 1, - 'AH_OUTPUT' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_PROG_LIBTOOL' => 1, - '_m4_warn' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AC_FC_SRCEXT' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AM_PATH_GUILE' => 1, - 'AC_FC_FREEFORM' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_CONFIG_FILES' => 1, - 'include' => 1, - 'AC_LIBSOURCE' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_COND_ELSE' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AM_MAINTAINER_MODE' => 1, - '_AM_COND_ENDIF' => 1, - 'm4_pattern_allow' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AM_ENABLE_MULTILIB' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'sinclude' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AC_INIT' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_POT_TOOLS' => 1, - 'AM_GNU_GETTEXT' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, - 'AC_CANONICAL_BUILD' => 1, - '_AM_COND_IF' => 1, - 'AC_SUBST' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1 - } - ], 'Autom4te::Request' ) - ); - diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 deleted file mode 100644 index a2519bc3d938..000000000000 --- a/autom4te.cache/traces.0 +++ /dev/null @@ -1,953 +0,0 @@ -m4trace:/usr/share/aclocal-1.16/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) -m4trace:/usr/share/aclocal-1.16/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -m4trace:/usr/share/aclocal-1.16/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) -m4trace:/usr/share/aclocal-1.16/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) -m4trace:/usr/share/aclocal-1.16/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) -m4trace:/usr/share/aclocal-1.16/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) -m4trace:/usr/share/aclocal-1.16/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) -m4trace:/usr/share/aclocal-1.16/depout.m4:11: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -]) -m4trace:/usr/share/aclocal-1.16/depout.m4:62: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) -m4trace:/usr/share/aclocal-1.16/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) -m4trace:/usr/share/aclocal-1.16/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -m4trace:/usr/share/aclocal-1.16/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) -m4trace:/usr/share/aclocal-1.16/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) -m4trace:/usr/share/aclocal-1.16/make.m4:13: -1- AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -m4trace:/usr/share/aclocal-1.16/make.m4:42: -1- m4_pattern_allow([^am__quote$]) -m4trace:/usr/share/aclocal-1.16/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) -m4trace:/usr/share/aclocal-1.16/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) -m4trace:/usr/share/aclocal-1.16/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -m4trace:/usr/share/aclocal-1.16/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) -m4trace:/usr/share/aclocal-1.16/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) -m4trace:/usr/share/aclocal-1.16/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) -m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -m4trace:/usr/share/aclocal-1.16/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) -m4trace:/usr/share/aclocal-1.16/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) -m4trace:/usr/share/aclocal-1.16/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) -m4trace:/usr/share/aclocal-1.16/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) -m4trace:/usr/share/aclocal-1.16/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) -m4trace:/usr/share/aclocal-1.16/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) -m4trace:/usr/share/aclocal-1.16/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION -m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) -m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Wall]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Wall]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Werror]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Werror]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([foreign]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AM_SANITY_CHECK -m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN -m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND -m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH -m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP -m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) -m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) -m4trace:configure.ac:7: -1- AM_SILENT_RULES -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) -m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) -m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:14: -1- _AM_PROG_CC_C_O -m4trace:configure.ac:14: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) -m4trace:configure.ac:14: -1- _AM_DEPENDENCIES([CC]) -m4trace:configure.ac:14: -1- AM_SET_DEPDIR -m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:14: -1- AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:14: -1- AM_MAKE_INCLUDE -m4trace:configure.ac:14: -1- AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:14: -1- AM_DEP_TRACK -m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) -m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) -m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) -m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) -m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) -m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) -m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) -m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) -m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) -m4trace:configure.ac:62: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:62: -1- AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 deleted file mode 100644 index 43633f948703..000000000000 --- a/autom4te.cache/traces.1 +++ /dev/null @@ -1,509 +0,0 @@ -m4trace:aclocal.m4:679: -1- AC_SUBST([am__quote]) -m4trace:aclocal.m4:679: -1- AC_SUBST_TRACE([am__quote]) -m4trace:aclocal.m4:679: -1- m4_pattern_allow([^am__quote$]) -m4trace:configure.ac:6: -1- AC_INIT([rimage], [1.0]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:6: -1- AC_SUBST([SHELL]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([SHELL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:6: -1- AC_SUBST([PATH_SEPARATOR]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_NAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_STRING]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_URL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- AC_SUBST([exec_prefix], [NONE]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([exec_prefix]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:6: -1- AC_SUBST([prefix], [NONE]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([prefix]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:6: -1- AC_SUBST([program_transform_name], [s,x,x,]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([program_transform_name]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:6: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([bindir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sbindir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:6: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libexecdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([datarootdir], ['${prefix}/share']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datarootdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([datadir], ['${datarootdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datadir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sysconfdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sharedstatedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([localstatedir], ['${prefix}/var']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localstatedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([includedir], ['${prefix}/include']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([includedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([oldincludedir], ['/usr/include']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([oldincludedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], - ['${datarootdir}/doc/${PACKAGE_TARNAME}'], - ['${datarootdir}/doc/${PACKAGE}'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([docdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([infodir], ['${datarootdir}/info']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([infodir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:6: -1- AC_SUBST([htmldir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([htmldir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:6: -1- AC_SUBST([dvidir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([dvidir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:6: -1- AC_SUBST([pdfdir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([pdfdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([psdir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([psdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([mandir], ['${datarootdir}/man']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([mandir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ -@%:@undef PACKAGE_NAME]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ -@%:@undef PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ -@%:@undef PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ -@%:@undef PACKAGE_STRING]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ -@%:@undef PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ -@%:@undef PACKAGE_URL]) -m4trace:configure.ac:6: -1- AC_SUBST([DEFS]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEFS]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_C]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_C]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_N]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_N]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_T]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_T]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:6: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:6: -1- AC_SUBST([build_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([build_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:6: -1- AC_SUBST([host_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([host_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:6: -1- AC_SUBST([target_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([target_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_DATA]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__isrc]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:7: -1- AC_SUBST([CYGPATH_W]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CYGPATH_W]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([PACKAGE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([VERSION]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ -@%:@undef PACKAGE]) -m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */ -@%:@undef VERSION]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([missing]) -m4trace:configure.ac:7: -1- AC_SUBST([ACLOCAL]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ACLOCAL]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOCONF]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOCONF]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOMAKE]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOMAKE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOHEADER]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOHEADER]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:7: -1- AC_SUBST([MAKEINFO]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MAKEINFO]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:7: -1- AC_SUBST([install_sh]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([install_sh]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:7: -1- AC_SUBST([STRIP]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([STRIP]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:7: -1- AC_SUBST([MKDIR_P]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MKDIR_P]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) -m4trace:configure.ac:7: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([mkdir_p]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:7: -1- AC_SUBST([AWK]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AWK]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:7: -1- AC_SUBST([SET_MAKE]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([SET_MAKE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__leading_dot]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__leading_dot]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:7: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AMTAR]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__tar]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__tar]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__untar]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__untar]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:7: -1- AM_SILENT_RULES -m4trace:configure.ac:7: -1- AC_SUBST([AM_V]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_BACKSLASH]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_BACKSLASH]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) -m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h]) -m4trace:configure.ac:10: -1- AC_CONFIG_FILES([Makefile - src/Makefile]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([ac_ct_CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([ac_ct_CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([EXEEXT]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:14: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([OBJEXT]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:14: -1- AC_REQUIRE_AUX_FILE([compile]) -m4trace:configure.ac:14: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([DEPDIR]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:14: -1- AC_SUBST([am__include]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__include]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- AC_SUBST([am__nodep]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__nodep]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) -m4trace:configure.ac:14: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CCDEPMODE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:17: -1- AH_OUTPUT([HAVE_LIBCRYPTO], [/* Define to 1 if you have the `crypto\' library (-lcrypto). */ -@%:@undef HAVE_LIBCRYPTO]) -m4trace:configure.ac:17: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCRYPTO]) -m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDINT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TIME_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.ac:20: -1- AC_SUBST([CPP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:20: -1- AC_SUBST([CPP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- AC_SUBST([GREP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([GREP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:20: -1- AC_SUBST([EGREP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([EGREP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:20: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:20: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ -@%:@undef STDC_HEADERS]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TYPES_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_STAT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_MEMORY_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRINGS_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_INTTYPES_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDINT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.ac:23: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler - calls it, or to nothing if \'inline\' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif]) -m4trace:configure.ac:24: -1- AC_DEFINE_TRACE_LITERAL([int16_t]) -m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) -m4trace:configure.ac:24: -1- AH_OUTPUT([int16_t], [/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int16_t]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([int32_t]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([int32_t], [/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int32_t]) -m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([int64_t]) -m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) -m4trace:configure.ac:26: -1- AH_OUTPUT([int64_t], [/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int64_t]) -m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([int8_t]) -m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) -m4trace:configure.ac:27: -1- AH_OUTPUT([int8_t], [/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -@%:@undef int8_t]) -m4trace:configure.ac:28: -1- AC_DEFINE_TRACE_LITERAL([size_t]) -m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:28: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ -@%:@undef size_t]) -m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([uint16_t]) -m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) -m4trace:configure.ac:29: -1- AH_OUTPUT([uint16_t], [/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint16_t]) -m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_UINT32_T]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) -m4trace:configure.ac:30: -1- AH_OUTPUT([_UINT32_T], [/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT32_T]) -m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([uint32_t]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) -m4trace:configure.ac:30: -1- AH_OUTPUT([uint32_t], [/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint32_t]) -m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([_UINT64_T]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) -m4trace:configure.ac:31: -1- AH_OUTPUT([_UINT64_T], [/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT64_T]) -m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([uint64_t]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) -m4trace:configure.ac:31: -1- AH_OUTPUT([uint64_t], [/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint64_t]) -m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([_UINT8_T]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) -m4trace:configure.ac:32: -1- AH_OUTPUT([_UINT8_T], [/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT8_T]) -m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([uint8_t]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) -m4trace:configure.ac:32: -1- AH_OUTPUT([uint8_t], [/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint8_t]) -m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ -@%:@undef HAVE_GETTIMEOFDAY]) -m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ -@%:@undef HAVE_MEMSET]) -m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) -m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) -m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:47: -1- AH_OUTPUT([HAVE_IPC_HEADER_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_HEADER_H]) -m4trace:configure.ac:47: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_HEADER_H]) -m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) -m4trace:configure.ac:49: -1- AH_OUTPUT([HAVE_IPC_INFO_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_INFO_H]) -m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_INFO_H]) -m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) -m4trace:configure.ac:51: -1- AH_OUTPUT([HAVE_IPC_STREAM_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_STREAM_H]) -m4trace:configure.ac:51: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_STREAM_H]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) -m4trace:configure.ac:53: -1- AH_OUTPUT([HAVE_KERNEL_FW_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_KERNEL_FW_H]) -m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([HAVE_KERNEL_FW_H]) -m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) -m4trace:configure.ac:55: -1- AH_OUTPUT([HAVE_SOF_LOGS_FILE_FORMAT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SOF_LOGS_FILE_FORMAT_H]) -m4trace:configure.ac:55: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOF_LOGS_FILE_FORMAT_H]) -m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) -m4trace:configure.ac:57: -1- AH_OUTPUT([HAVE_USER_MANIFEST_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_USER_MANIFEST_H]) -m4trace:configure.ac:57: -1- AC_DEFINE_TRACE_LITERAL([HAVE_USER_MANIFEST_H]) -m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) -m4trace:configure.ac:62: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:62: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LTLIBOBJS]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_build_prefix]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([INSTALL]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/compile b/compile deleted file mode 100755 index 99e50524b3ba..000000000000 --- a/compile +++ /dev/null @@ -1,348 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/config.h.in b/config.h.in deleted file mode 100644 index ef2c623daf43..000000000000 --- a/config.h.in +++ /dev/null @@ -1,141 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_HEADER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_INFO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_STREAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_KERNEL_FW_H - -/* Define to 1 if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_SOF_LOGS_FILE_FORMAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_USER_MANIFEST_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef int16_t - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -#undef int8_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -#undef uint8_t diff --git a/configure b/configure deleted file mode 100755 index abc56f0e1ab4..000000000000 --- a/configure +++ /dev/null @@ -1,6178 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rimage 1.0. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_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="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -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 - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -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'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - 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" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --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" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # 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'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - 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' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -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_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -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 rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --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 - --cache-file=FILE cache test results in FILE [disabled] - -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 \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --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'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/rimage] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -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 the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_intX_t - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* 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. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* 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. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - 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 - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$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' -# 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. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - 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' - # 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. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$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'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$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; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* 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 don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $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. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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 : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# 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_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -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' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - 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 -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_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_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_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 - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - 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 -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "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_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_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_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; 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=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_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 `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -# Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# 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 -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (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 - # 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. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# 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 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -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'. - 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 - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -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'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$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. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# 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'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -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'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -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'. -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 -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -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 (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) 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 `:'. - 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;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$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 - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# 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 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -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"; } && - { $as_echo "$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 -$as_echo "$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" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e39de6d54d37..000000000000 --- a/configure.ac +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -AC_PREREQ([2.69]) -AC_INIT([rimage],[1.0]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_CONFIG_SRCDIR([src/rimage.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile - src/Makefile]) - -# Checks for programs. -AC_PROG_CC - -# Checks for libraries. -AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) - -# Checks for header files. -AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_INLINE -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_INT8_T -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T - -# Checks for library functions. -AC_CHECK_FUNCS([gettimeofday memset]) - -# Where SOF header files are -AC_ARG_WITH(sof-source, - AS_HELP_STRING([--with-sof-source=DIR],[where the root of SOF source is]), - [ SOF_SOURCE_DIR="$with_sof_source/src" ],) -AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - AC_CHECK_HEADERS(ipc/header.h, , - [ AC_MSG_ERROR([Unable to find ipc/header.h. Aborting.]) ]) - AC_CHECK_HEADERS(ipc/info.h, , - [ AC_MSG_ERROR([Unable to find ipc/info.h. Aborting.]) ]) - AC_CHECK_HEADERS(ipc/stream.h, , - [ AC_MSG_ERROR([Unable to find ipc/stream.h. Aborting.]) ]) - AC_CHECK_HEADERS(kernel/fw.h, , - [ AC_MSG_ERROR([Unable to find kernel/fw.h. Aborting.]) ]) - AC_CHECK_HEADERS(sof/logs/file_format.h, , - [ AC_MSG_ERROR([Unable to find sof/logs/file_format.h. Aborting.]) ]) - AC_CHECK_HEADERS(user/manifest.h, , - [ AC_MSG_ERROR([Unable to find user/manifest.h. Aborting.]) ]) -fi - -# Generate outputs -AC_OUTPUT diff --git a/depcomp b/depcomp deleted file mode 100755 index 65cbf7093a1e..000000000000 --- a/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/install-sh b/install-sh deleted file mode 100755 index 8175c640fe62..000000000000 --- a/install-sh +++ /dev/null @@ -1,518 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2018-03-11.20; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/missing b/missing deleted file mode 100755 index 625aeb11897a..000000000000 --- a/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 3d9c75a3a5b3..000000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -bin_PROGRAMS = rimage - -rimage_SOURCES = \ - cse.c \ - css.c \ - elf.c \ - file_simple.c \ - hash.c \ - man_apl.c \ - man_cnl.c \ - manifest.c \ - man_kbl.c \ - man_sue.c \ - man_tgl.c \ - pkcs1_5.c \ - plat_auth.c \ - rimage.c - -if USE_PROVIDED_SOF_HEADER - PROVIDED_SOF_HEADER = -Iinclude/sof - EXTRA_SOF_MACROS = -else - EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H -endif - -rimage_CFLAGS = \ - $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ - $(EXTRA_SOF_MACROS) \ - -O2 -g -Wall -Werror -Wl,-EL \ - -Wmissing-prototypes -Wimplicit-fallthrough=3 - -rimage_LDADD = -lcrypto diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index 3bef76b122f0..000000000000 --- a/src/Makefile.in +++ /dev/null @@ -1,853 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -bin_PROGRAMS = rimage$(EXEEXT) -subdir = src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_rimage_OBJECTS = rimage-cse.$(OBJEXT) rimage-css.$(OBJEXT) \ - rimage-elf.$(OBJEXT) rimage-file_simple.$(OBJEXT) \ - rimage-hash.$(OBJEXT) rimage-man_apl.$(OBJEXT) \ - rimage-man_cnl.$(OBJEXT) rimage-manifest.$(OBJEXT) \ - rimage-man_kbl.$(OBJEXT) rimage-man_sue.$(OBJEXT) \ - rimage-man_tgl.$(OBJEXT) rimage-pkcs1_5.$(OBJEXT) \ - rimage-plat_auth.$(OBJEXT) rimage-rimage.$(OBJEXT) -rimage_OBJECTS = $(am_rimage_OBJECTS) -rimage_DEPENDENCIES = -rimage_LINK = $(CCLD) $(rimage_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/rimage-cse.Po \ - ./$(DEPDIR)/rimage-css.Po ./$(DEPDIR)/rimage-elf.Po \ - ./$(DEPDIR)/rimage-file_simple.Po ./$(DEPDIR)/rimage-hash.Po \ - ./$(DEPDIR)/rimage-man_apl.Po ./$(DEPDIR)/rimage-man_cnl.Po \ - ./$(DEPDIR)/rimage-man_kbl.Po ./$(DEPDIR)/rimage-man_sue.Po \ - ./$(DEPDIR)/rimage-man_tgl.Po ./$(DEPDIR)/rimage-manifest.Po \ - ./$(DEPDIR)/rimage-pkcs1_5.Po ./$(DEPDIR)/rimage-plat_auth.Po \ - ./$(DEPDIR)/rimage-rimage.Po -am__mv = mv -f -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(rimage_SOURCES) -DIST_SOURCES = $(rimage_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -rimage_SOURCES = \ - cse.c \ - css.c \ - elf.c \ - file_simple.c \ - hash.c \ - man_apl.c \ - man_cnl.c \ - manifest.c \ - man_kbl.c \ - man_sue.c \ - man_tgl.c \ - pkcs1_5.c \ - plat_auth.c \ - rimage.c - -@USE_PROVIDED_SOF_HEADER_TRUE@PROVIDED_SOF_HEADER = -Iinclude/sof -@USE_PROVIDED_SOF_HEADER_FALSE@EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H -@USE_PROVIDED_SOF_HEADER_TRUE@EXTRA_SOF_MACROS = -rimage_CFLAGS = \ - $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ - $(EXTRA_SOF_MACROS) \ - -O2 -g -Wall -Werror -Wl,-EL \ - -Wmissing-prototypes -Wimplicit-fallthrough=3 - -rimage_LDADD = -lcrypto -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -rimage$(EXEEXT): $(rimage_OBJECTS) $(rimage_DEPENDENCIES) $(EXTRA_rimage_DEPENDENCIES) - @rm -f rimage$(EXEEXT) - $(AM_V_CCLD)$(rimage_LINK) $(rimage_OBJECTS) $(rimage_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-cse.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-css.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-elf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-file_simple.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-hash.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_apl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_cnl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_kbl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_sue.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_tgl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-manifest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-pkcs1_5.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-plat_auth.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-rimage.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -rimage-cse.o: cse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.o -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c - -rimage-cse.obj: cse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.obj -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` - -rimage-css.o: css.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.o -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c - -rimage-css.obj: css.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.obj -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` - -rimage-elf.o: elf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.o -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c - -rimage-elf.obj: elf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.obj -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` - -rimage-file_simple.o: file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.o -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c - -rimage-file_simple.obj: file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.obj -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` - -rimage-hash.o: hash.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.o -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c - -rimage-hash.obj: hash.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.obj -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` - -rimage-man_apl.o: man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.o -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c - -rimage-man_apl.obj: man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.obj -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` - -rimage-man_cnl.o: man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.o -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c - -rimage-man_cnl.obj: man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.obj -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` - -rimage-manifest.o: manifest.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.o -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c - -rimage-manifest.obj: manifest.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.obj -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` - -rimage-man_kbl.o: man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.o -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c - -rimage-man_kbl.obj: man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.obj -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` - -rimage-man_sue.o: man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.o -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c - -rimage-man_sue.obj: man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.obj -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` - -rimage-man_tgl.o: man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.o -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c - -rimage-man_tgl.obj: man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.obj -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` - -rimage-pkcs1_5.o: pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.o -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c - -rimage-pkcs1_5.obj: pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.obj -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` - -rimage-plat_auth.o: plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.o -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c - -rimage-plat_auth.obj: plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.obj -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` - -rimage-rimage.o: rimage.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.o -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c - -rimage-rimage.obj: rimage.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.obj -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/rimage-cse.Po - -rm -f ./$(DEPDIR)/rimage-css.Po - -rm -f ./$(DEPDIR)/rimage-elf.Po - -rm -f ./$(DEPDIR)/rimage-file_simple.Po - -rm -f ./$(DEPDIR)/rimage-hash.Po - -rm -f ./$(DEPDIR)/rimage-man_apl.Po - -rm -f ./$(DEPDIR)/rimage-man_cnl.Po - -rm -f ./$(DEPDIR)/rimage-man_kbl.Po - -rm -f ./$(DEPDIR)/rimage-man_sue.Po - -rm -f ./$(DEPDIR)/rimage-man_tgl.Po - -rm -f ./$(DEPDIR)/rimage-manifest.Po - -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po - -rm -f ./$(DEPDIR)/rimage-plat_auth.Po - -rm -f ./$(DEPDIR)/rimage-rimage.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/rimage-cse.Po - -rm -f ./$(DEPDIR)/rimage-css.Po - -rm -f ./$(DEPDIR)/rimage-elf.Po - -rm -f ./$(DEPDIR)/rimage-file_simple.Po - -rm -f ./$(DEPDIR)/rimage-hash.Po - -rm -f ./$(DEPDIR)/rimage-man_apl.Po - -rm -f ./$(DEPDIR)/rimage-man_cnl.Po - -rm -f ./$(DEPDIR)/rimage-man_kbl.Po - -rm -f ./$(DEPDIR)/rimage-man_sue.Po - -rm -f ./$(DEPDIR)/rimage-man_tgl.Po - -rm -f ./$(DEPDIR)/rimage-manifest.Po - -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po - -rm -f ./$(DEPDIR)/rimage-plat_auth.Po - -rm -f ./$(DEPDIR)/rimage-rimage.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: From a2646979612efbc9e27277d7ab608ede4e6a4813 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:16:03 -0700 Subject: [PATCH 104/350] Use CMake to build rimage This adds the necessary bits to allow building rimage with CMake with similar configure options as the just removed autotools files. Also update README.md for new build instructions. Signed-off-by: Daniel Leung --- .gitignore | 10 +-------- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++++++--- src/CMakeLists.txt | 52 ---------------------------------------------- 4 files changed, 58 insertions(+), 64 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 src/CMakeLists.txt diff --git a/.gitignore b/.gitignore index e77279505d50..567609b1234a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1 @@ -config.h -config.log -config.status -Makefile -stamp-h1 -.deps/ -src/*.o -src/Makefile -src/rimage +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..b550b4d5a582 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.10) + +project(SOF_RIMAGE C) + +add_executable(rimage + src/file_simple.c + src/man_apl.c + src/man_cnl.c + src/man_kbl.c + src/man_sue.c + src/man_tgl.c + src/cse.c + src/css.c + src/plat_auth.c + src/hash.c + src/pkcs1_5.c + src/manifest.c + src/elf.c + src/rimage.c +) + +target_compile_options(rimage PRIVATE + -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 +) + +target_link_libraries(rimage PRIVATE "-lcrypto") + +target_include_directories(rimage PRIVATE + src/include/rimage +) + +if(DEFINED SOF_SOURCE_DIR) + # Use headers from SOF_SOURCE_DIR + target_compile_definitions(rimage PRIVATE + HAS_FILE_FORMAT_H + ) + + target_include_directories(rimage PRIVATE + "${SOF_SOURCE_DIR}/src/include" + ) +else() + # Use headers provided here + target_include_directories(rimage PRIVATE + src/include/sof + ) +endif() + +install(TARGETS rimage DESTINATION bin) diff --git a/README.md b/README.md index 4b484048dec4..59b4b94c7b4b 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ to generate binary image files. The `rimage` tool can be built with or without logging dictionary support, where such support is required to decipher the log messages -produced the the SOF firmware. +produced by the the SOF firmware. #### Build without dictionary support: ```shell -$ ./configure +$ mkdir build +$ cd build +$ cmake .. $ make $ make install ``` @@ -26,7 +28,9 @@ First, clone the SOF source tree from [here](https://github.com/thesofproject/sof). Then, do: ```shell -$ ./configure --with-sof-source= +$ mkdir build +$ cd build +$ cmake -DSOF_SOURCE_DIR= .. $ make $ make install ``` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index dc5d3ac794f8..000000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.10) - -project(SOF_RIMAGE C) - -set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") - -if(NOT DEFINED VERSION_H_PATH) - message(FATAL_ERROR - " Please specify version.h path.\n" - " Example: cmake -DVERSION_H_PATH=${VERSION_H_PATH} ...\n" -) -endif() - -if(NOT DEFINED PEM_KEY_PREFIX) - set(PEM_KEY_PREFIX "/usr/local/share/rimage") -endif() - -get_filename_component(VERSION_H_DIRECTORY ${VERSION_H_PATH} DIRECTORY) - -add_executable(rimage - file_simple.c - man_apl.c - man_cnl.c - man_kbl.c - man_sue.c - man_tgl.c - cse.c - css.c - plat_auth.c - hash.c - pkcs1_5.c - manifest.c - elf.c - rimage.c -) - -target_compile_options(rimage PRIVATE - -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 -) - -target_compile_definitions(rimage PRIVATE - PEM_KEY_PREFIX="${PEM_KEY_PREFIX}" -) - -target_link_libraries(rimage PRIVATE "-lcrypto") - -target_include_directories(rimage PRIVATE - "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${VERSION_H_DIRECTORY}" -) From e09354a5b5a82024a6ce83e5fcd7d3c7fbf3ef2a Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 5 Apr 2020 01:45:45 -0700 Subject: [PATCH 105/350] Update rimage to remove ldc generation ability This reflects the changes on SOF project commit b3c16790cd6fae9b4ce901d7ef36b47223f96dd7. Signed-off-by: Daniel Leung --- CMakeLists.txt | 4 - src/elf.c | 28 +---- src/file_simple.c | 205 ------------------------------------ src/include/rimage/rimage.h | 13 --- src/rimage.c | 36 +------ 5 files changed, 2 insertions(+), 284 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b550b4d5a582..c91f692aeb69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,6 @@ target_include_directories(rimage PRIVATE if(DEFINED SOF_SOURCE_DIR) # Use headers from SOF_SOURCE_DIR - target_compile_definitions(rimage PRIVATE - HAS_FILE_FORMAT_H - ) - target_include_directories(rimage PRIVATE "${SOF_SOURCE_DIR}/src/include" ) diff --git a/src/elf.c b/src/elf.c index 1b5420439da7..bfed5399cb84 100644 --- a/src/elf.c +++ b/src/elf.c @@ -74,36 +74,11 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_start = 0; module->bss_end = 0; - - fprintf(stdout, "info: ignore .static_log_entries" - " section for bootloader module\n"); - - module->logs_index = -EINVAL; - - fprintf(stdout, "info: ignore .static_uuids section for bootloader module\n"); - module->uids_index = -EINVAL; - - fprintf(stdout, "info: ignore .fw_ready" - " section for bootloader module\n"); - - module->fw_ready_index = -EINVAL; } else { /* find manifest module data */ module->bss_index = elf_find_section(image, module, ".bss"); if (module->bss_index < 0) return module->bss_index; - - /* find log entries and fw ready sections */ - module->logs_index = elf_find_section(image, module, - ".static_log_entries"); - - module->uids_index = elf_find_section(image, module, - ".static_uuid_entries"); - - module->fw_ready_index = elf_find_section(image, module, - ".fw_ready"); - if (module->fw_ready_index < 0) - return module->fw_ready_index; } /* parse each section */ @@ -369,8 +344,7 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index && i != module->logs_index && - i != module->fw_ready_index) { + if (i != module->bss_index) { /* only check valid sections */ if (!(section->flags & valid)) continue; diff --git a/src/file_simple.c b/src/file_simple.c index 419e7856da60..d570c5a8bad9 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,11 +8,6 @@ #include #include -#ifdef HAS_FILE_FORMAT_H -#include -#include -#endif /* HAS_FILE_FORMAT_H */ - #include "rimage.h" #define BYT_IRAM_BASE 0xff2c0000 @@ -76,75 +71,6 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) return SOF_FW_BLK_TYPE_INVALID; } -#ifdef HAS_FILE_FORMAT_H -static int fw_version_copy(struct snd_sof_logs_header *header, - const struct module *module) -{ - Elf32_Shdr *section = NULL; - struct sof_ipc_ext_data_hdr *ext_hdr = NULL; - void *buffer = NULL; - - if (module->fw_ready_index <= 0) - return 0; - - section = &module->section[module->fw_ready_index]; - - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, - section->size, module->fd); - - if (count != section->size) { - fprintf(stderr, "error: can't read ready section %d\n", -errno); - free(buffer); - return -errno; - } - - memcpy(&header->version, - &((struct sof_ipc_fw_ready *)buffer)->version, - sizeof(header->version)); - - /* fw_ready structure contains main (primarily kernel) - * ABI version. - */ - - fprintf(stdout, "fw abi main version: %d:%d:%d\n", - SOF_ABI_VERSION_MAJOR(header->version.abi_version), - SOF_ABI_VERSION_MINOR(header->version.abi_version), - SOF_ABI_VERSION_PATCH(header->version.abi_version)); - - /* let's find dbg abi version, which the log client - * is interested in and override the kernel's one. - * - * skip the base fw-ready record and begin from the first extension. - */ - ext_hdr = buffer + ((struct sof_ipc_fw_ready *)buffer)->hdr.size; - while ((uintptr_t)ext_hdr < (uintptr_t)buffer + section->size) { - if (ext_hdr->type == SOF_IPC_EXT_USER_ABI_INFO) { - header->version.abi_version = - ((struct sof_ipc_user_abi_version *) - ext_hdr)->abi_dbg_version; - break; - } - //move to the next entry - ext_hdr = (struct sof_ipc_ext_data_hdr *) - ((uint8_t *)ext_hdr + ext_hdr->hdr.size); - } - - fprintf(stdout, "fw abi dbg version: %d:%d:%d\n", - SOF_ABI_VERSION_MAJOR(header->version.abi_version), - SOF_ABI_VERSION_MINOR(header->version.abi_version), - SOF_ABI_VERSION_PATCH(header->version.abi_version)); - - free(buffer); - - return 0; -} -#endif /* HAS_FILE_FORMAT_H */ - static int block_idx; static int write_block(struct image *image, struct module *module, @@ -447,137 +373,6 @@ static int simple_write_firmware(struct image *image) return 0; } -#ifdef HAS_FILE_FORMAT_H -static int write_logs_dictionary(struct image *image) -{ - struct snd_sof_logs_header header; - int i, ret = 0; - void *buffer = NULL; - - memcpy(header.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE); - header.data_offset = sizeof(struct snd_sof_logs_header); - - for (i = 0; i < image->num_modules; i++) { - struct module *module = &image->module[i]; - - /* extract fw_version from fw_ready message located - * in .fw_ready section - */ - ret = fw_version_copy(&header, module); - if (ret < 0) - goto out; - - if (module->logs_index > 0) { - Elf32_Shdr *section = - &module->section[module->logs_index]; - - header.base_address = section->vaddr; - header.data_length = section->size; - - fwrite(&header, sizeof(struct snd_sof_logs_header), 1, - image->ldc_out_fd); - - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, section->size, - module->fd); - if (count != section->size) { - fprintf(stderr, - "error: can't read logs section %d\n", - -errno); - ret = -errno; - goto out; - } - count = fwrite(buffer, 1, section->size, - image->ldc_out_fd); - if (count != section->size) { - fprintf(stderr, - "error: can't write section %d\n", - -errno); - ret = -errno; - goto out; - } - - fprintf(stdout, "logs dictionary: size %u\n", - header.data_length + header.data_offset); - fprintf(stdout, "including fw version of size: %lu\n", - (unsigned long)sizeof(header.version)); - } - } -out: - if (buffer) - free(buffer); - - return ret; -} - -static int write_uids_dictionary(struct image *image) -{ - struct snd_sof_uids_header header; - Elf32_Shdr *section; - int i, ret = 0; - void *buffer = NULL; - - memcpy(header.sig, SND_SOF_UIDS_SIG, SND_SOF_UIDS_SIG_SIZE); - header.data_offset = sizeof(struct snd_sof_uids_header); - - for (i = 0; i < image->num_modules; i++) { - struct module *module = &image->module[i]; - - if (module->uids_index <= 0) - continue; - section = &module->section[module->uids_index]; - - header.base_address = section->vaddr; - header.data_length = section->size; - - fwrite(&header, sizeof(struct snd_sof_uids_header), 1, - image->ldc_out_fd); - - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - fseek(module->fd, section->off, SEEK_SET); - if (fread(buffer, 1, section->size, module->fd) != - section->size) { - fprintf(stderr, "error: can't read uids section %d\n", - -errno); - ret = -errno; - goto out; - } - if (fwrite(buffer, 1, section->size, image->ldc_out_fd) != - section->size) { - fprintf(stderr, "error: cant't write section %d\n", - -errno); - ret = -errno; - goto out; - } - fprintf(stdout, "uids dictionary: size %u\n", - header.data_length + header.data_offset); - } -out: - free(buffer); - return ret; -} - -int write_dictionaries(struct image *image) -{ - int ret = 0; - - ret = write_logs_dictionary(image); - if (ret) - goto out; - - ret = write_uids_dictionary(image); - -out: - return ret; -} -#endif /* HAS_FILE_FORMAT_H */ - const struct adsp machine_byt = { .name = "byt", .mem_zones = { diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 08e398b5f65e..05d1159d654d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -67,9 +67,6 @@ struct module { int num_bss; int fw_size; int bss_index; - int logs_index; - int uids_index; - int fw_ready_index; /* sizes do not include any gaps */ int bss_size; @@ -96,12 +93,6 @@ struct image { const char *out_file; FILE *out_fd; - -#ifdef HAS_FILE_FORMAT_H - const char *ldc_out_file; - FILE *ldc_out_fd; -#endif /* HAS_FILE_FORMAT_H */ - void *pos; const struct adsp *adsp; @@ -163,10 +154,6 @@ struct adsp { int exec_boot_ldr; }; -#ifdef HAS_FILE_FORMAT_H -int write_dictionaries(struct image *image); -#endif /* HAS_FILE_FORMAT_H */ - void module_sha256_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); diff --git a/src/rimage.c b/src/rimage.c index c015dc8c96f7..11bee8a49257 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -37,9 +37,6 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); -#ifdef HAS_FILE_FORMAT_H - fprintf(stdout, "\t -p log dictionary outfile\n"); -#endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); @@ -58,20 +55,11 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:p:m:va:s:k:l:ri:x:f:b:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; - case 'p': -#ifdef HAS_FILE_FORMAT_H - image.ldc_out_file = optarg; -#else - fprintf(stderr, - "error: log dictionary is not supported\n"); - return -EINVAL; -#endif /* HAS_FILE_FORMAT_H */ - break; case 'm': mach = optarg; break; @@ -116,11 +104,6 @@ int main(int argc, char *argv[]) if (!image.out_file || !mach) usage(argv[0]); -#ifdef HAS_FILE_FORMAT_H - if (!image.ldc_out_file) - image.ldc_out_file = "out.ldc"; -#endif /* HAS_FILE_FORMAT_H */ - /* requires private key */ if (!image.key_name) { fprintf(stderr, "error: requires private key\n"); @@ -205,27 +188,10 @@ int main(int argc, char *argv[]) else ret = image.adsp->write_firmware(&image); -#ifdef HAS_FILE_FORMAT_H - unlink(image.ldc_out_file); - image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); - if (!image.ldc_out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image.ldc_out_file, errno); - ret = -EINVAL; - goto out; - } - ret = write_dictionaries(&image); -#endif /* HAS_FILE_FORMAT_H */ - out: /* close files */ if (image.out_fd) fclose(image.out_fd); -#ifdef HAS_FILE_FORMAT_H - if (image.ldc_out_fd) - fclose(image.ldc_out_fd); -#endif /* HAS_FILE_FORMAT_H */ - return ret; } From ea04cb816e40a8cacf241a0ead8fc56d6a5529bb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 5 Apr 2020 02:03:14 -0700 Subject: [PATCH 106/350] Remove cmake option SOF_SOURCE_DIR Since both fw.h and manifest.h are being used in the main SOF repo and also here in the standalone rimage repo, to prevent them getting out of sync, the SOF main repo is going to use the ones coming from the rimage repo. So there is no need for the option anymore. Signed-off-by: Daniel Leung --- CMakeLists.txt | 13 +------------ README.md | 22 +--------------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c91f692aeb69..a7b29c077dad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,18 +29,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/rimage + src/include/sof ) -if(DEFINED SOF_SOURCE_DIR) - # Use headers from SOF_SOURCE_DIR - target_include_directories(rimage PRIVATE - "${SOF_SOURCE_DIR}/src/include" - ) -else() - # Use headers provided here - target_include_directories(rimage PRIVATE - src/include/sof - ) -endif() - install(TARGETS rimage DESTINATION bin) diff --git a/README.md b/README.md index 59b4b94c7b4b..bce02c06caa9 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,7 @@ to generate binary image files. ## Building -The `rimage` tool can be built with or without logging dictionary -support, where such support is required to decipher the log messages -produced by the the SOF firmware. - -#### Build without dictionary support: +The `rimage` tool can be built with the following commands: ```shell $ mkdir build @@ -20,19 +16,3 @@ $ cmake .. $ make $ make install ``` - -#### Build with dictionary support: - -To build `rimage` with dictionary support, the SOF source is required. -First, clone the SOF source tree from -[here](https://github.com/thesofproject/sof). Then, do: - -```shell -$ mkdir build -$ cd build -$ cmake -DSOF_SOURCE_DIR= .. -$ make -$ make install -``` - -Note that creating the SOF firmware image requires dicitionary support. From c4701c7664d4dbbdf7ba25af21ff5c09057dc1fe Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 10:43:15 +0100 Subject: [PATCH 107/350] rimage: Align function arguments in rimage.h Code formatting should be consistent and function arguments should be aligned to opening parenthesis. Signed-off-by: Karol Trzcinski --- src/include/rimage/rimage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 05d1159d654d..c95658394b2b 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -179,7 +179,7 @@ int elf_validate_modules(struct image *image); int elf_find_section(struct image *image, struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section, int index); + Elf32_Shdr *section, int index); /* supported machines */ extern const struct adsp machine_byt; From e433e878656f9b549283283c03d5ae899ef77b87 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 10:51:15 +0100 Subject: [PATCH 108/350] rimage: Remove unused 'image' argument in elf_find_section() Unused arguments shouldn't be passed to function because it makes code messy. Signed-off-by: Karol Trzcinski --- src/elf.c | 9 ++++----- src/include/rimage/rimage.h | 3 +-- src/manifest.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/elf.c b/src/elf.c index bfed5399cb84..35f97f21a9e8 100644 --- a/src/elf.c +++ b/src/elf.c @@ -76,7 +76,7 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_end = 0; } else { /* find manifest module data */ - module->bss_index = elf_find_section(image, module, ".bss"); + module->bss_index = elf_find_section(module, ".bss"); if (module->bss_index < 0) return module->bss_index; } @@ -464,11 +464,10 @@ int elf_validate_modules(struct image *image) return 0; } -int elf_find_section(struct image *image, struct module *module, - const char *name) +int elf_find_section(const struct module *module, const char *name) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section, *s; + const Elf32_Shdr *section, *s; char *buffer; size_t count; int ret, i; @@ -569,7 +568,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) /* check limits */ elf_module_limits(image, module); - elf_find_section(image, module, ""); + elf_find_section(module, ""); fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", module->fw_size, module->fw_size, module->num_sections); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index c95658394b2b..e129d52de822 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -176,8 +176,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); -int elf_find_section(struct image *image, struct module *module, - const char *name); +int elf_find_section(const struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); diff --git a/src/manifest.c b/src/manifest.c index 4f4ff763c02b..fd5b7997d5c1 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -230,7 +230,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, fprintf(stdout, "Module Write: %s\n", module->elf_file); /* find manifest module data */ - man_section_idx = elf_find_section(image, module, ".module"); + man_section_idx = elf_find_section(module, ".module"); if (man_section_idx < 0) return -EINVAL; From 6c4c873b9d867bbdffcfb32d827dc4ebcba87991 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Mar 2020 06:58:57 -0700 Subject: [PATCH 109/350] Match LICENSE from the main SOF repo This changes the LICENSE file to match the LICENSE file from the main SOF repo, except they entries for the kconfig scripts which are not here in this repo. Signed-off-by: Daniel Leung --- LICENSE | 114 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 91 insertions(+), 23 deletions(-) diff --git a/LICENSE b/LICENSE index 2ab88408298f..468893dff94b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,97 @@ -BSD 3-Clause License +/* + * BSD 3 Clause + * Copyright (c) 2016, Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ -Copyright (c) 2019, Sound Open Firmware -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +// Copyright (c) 2003-2014 Cadence Design Systems, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +Files with 2-Clause BSD licence: -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. +src/include/rimage/elf.h -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* + * Derived from: + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ + * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ + * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ + * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ + * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ + * + * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. + * Copyright (c) 2001 David E. O'Brien + * Portions Copyright 2009 The Go Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ From cc5eabb3499d0b661140d7fb1d5e63c188909c95 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 15 Apr 2020 15:29:53 +0300 Subject: [PATCH 110/350] Fix compiler errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following error when compiling code: ... src/elf.c: In function ‘elf_find_section’: src/elf.c:469:20: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 469 | Elf32_Ehdr *hdr = &module->hdr; | ^ cc1: all warnings being treated as errors ... Signed-off-by: Andrei Emeltchenko --- src/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elf.c b/src/elf.c index 35f97f21a9e8..c8a56d226231 100644 --- a/src/elf.c +++ b/src/elf.c @@ -466,7 +466,7 @@ int elf_validate_modules(struct image *image) int elf_find_section(const struct module *module, const char *name) { - Elf32_Ehdr *hdr = &module->hdr; + const Elf32_Ehdr *hdr = &module->hdr; const Elf32_Shdr *section, *s; char *buffer; size_t count; From ca65a442bb84a2b144438c681ef142bab04d6d75 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 15 Apr 2020 23:16:12 +0300 Subject: [PATCH 111/350] Handle missing .init_array section Fixes issue ".init_array" is not copied to ri image making it zero filled. This causes Zephyr crashing trying to execute functions from this section. Signed-off-by: Andrei Emeltchenko --- src/elf.c | 4 ++++ src/manifest.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/elf.c b/src/elf.c index c8a56d226231..dc6fd4d9c069 100644 --- a/src/elf.c +++ b/src/elf.c @@ -93,6 +93,8 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_size += section[i].size; module->num_bss++; break; + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ module->fw_size += section[i].size; @@ -244,6 +246,8 @@ static void elf_module_size(struct image *image, struct module *module, Elf32_Shdr *section, int index) { switch (section->type) { + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ if (section->flags & SHF_EXECINSTR) { diff --git a/src/manifest.c b/src/manifest.c index fd5b7997d5c1..e38b5884ec22 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -128,7 +128,7 @@ static uint32_t elf_to_file_offset(struct image *image, { uint32_t elf_addr = section->vaddr, file_offset = 0; - if (section->type == SHT_PROGBITS) { + if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + @@ -160,6 +160,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, size_t count; switch (section->type) { + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ if (section->flags & SHF_EXECINSTR) From aecc0b51d03717d74720d84cc413e82b7dd8bea0 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 17 Apr 2020 14:14:54 +0800 Subject: [PATCH 112/350] CI: Travis: init build test for rimage Enable simple build test for rimage. Signed-off-by: Pan Xiuli --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..28a7376b0af0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c + +git: + depth: false + +services: + - docker + +jobs: + include: + - name: "Build Test" + before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof + script: + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make' > build.sh && chmod +x build.sh + - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From f79d8d7f1ed5d1f25102a90f63740b6bdbe6f469 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 11:00:29 +0100 Subject: [PATCH 113/350] elf: Add function to read section content with allocation In many functions there is need to read user section content and check firmware version or write section content to some manifest or dictionary. Previously to do it, in each function was loop to search for proper section in proper module, then allocate buffer, read content and check for possible error between each step what is quite overwhelming. After change there will be one function responsible for this task. Signed-off-by: Karol Trzcinski --- src/elf.c | 46 +++++++++++++++++++++++++++++++++++++ src/include/rimage/rimage.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/src/elf.c b/src/elf.c index dc6fd4d9c069..663b2e0870e2 100644 --- a/src/elf.c +++ b/src/elf.c @@ -516,6 +516,52 @@ int elf_find_section(const struct module *module, const char *name) return ret; } +int elf_read_section(const struct image *image, const char *section_name, + const Elf32_Shdr **dst_section, void **dst_buff) +{ + const struct module *module; + const Elf32_Shdr *section; + int section_index = -1; + int read; + int i; + + /* when there is more than one module, then first one is bootloader */ + for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + module = &image->module[i]; + section_index = elf_find_section(module, section_name); + if (section_index >= 0) + break; + } + + if (section_index < 0) { + fprintf(stderr, "error: section %s can't be found\n", + section_name); + return -EINVAL; + } + + section = &module->section[section_index]; + if (dst_section) + *dst_section = section; + + /* alloc buffer for section content */ + *dst_buff = calloc(1, section->size); + if (!*dst_buff) + return -ENOMEM; + + /* fill buffer with section content */ + fseek(module->fd, section->off, SEEK_SET); + read = fread(*dst_buff, 1, section->size, module->fd); + if (read != section->size) { + fprintf(stderr, + "error: can't read %s section %d\n", section_name, + -errno); + free(*dst_buff); + return -errno; + } + + return section->size; +} + int elf_parse_module(struct image *image, int module_index, const char *name) { struct module *module; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e129d52de822..68c14c591e19 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -177,6 +177,8 @@ void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); int elf_find_section(const struct module *module, const char *name); +int elf_read_section(const struct image *image, const char *name, + const Elf32_Shdr **dst_section, void **dst_buff); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); From f0c6ee0f3aaf94a898bcf6fbdf8b6e054f3e03c8 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 7 Apr 2020 12:40:06 +0200 Subject: [PATCH 114/350] ext_man: Create extended manifest Extended manifest is a place to store metadata about firmware, known during compilation time - for example firmware version or used compiler. Given information are read on host side before firmware startup. This part of output binary is not signed. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 1 + src/ext_manifest.c | 161 ++++++++++++++++++++++ src/include/rimage/rimage.h | 2 + src/include/sof/kernel/ext_manifest.h | 81 +++++++++++ src/include/sof/kernel/ext_manifest_gen.h | 34 +++++ src/rimage.c | 11 ++ 6 files changed, 290 insertions(+) create mode 100644 src/ext_manifest.c create mode 100644 src/include/sof/kernel/ext_manifest.h create mode 100644 src/include/sof/kernel/ext_manifest_gen.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a7b29c077dad..4d176dd582e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(rimage src/hash.c src/pkcs1_5.c src/manifest.c + src/ext_manifest.c src/elf.c src/rimage.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c new file mode 100644 index 000000000000..90604a2027b9 --- /dev/null +++ b/src/ext_manifest.c @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2020 Intel Corporation. All rights reserved. +// +// Author: Karol Trzcinski + +#include +#include +#include +#include + +#include "kernel/ext_manifest_gen.h" +#include "kernel/ext_manifest.h" +#include "rimage.h" + +const struct ext_man_header ext_man_template = { + .magic = EXT_MAN_MAGIC_NUMBER, + .header_version = EXT_MAN_VERSION, + .header_size = sizeof(struct ext_man_header), + .full_size = 0, /* runtime variable */ +}; + +static int ext_man_open_file(struct image *image) +{ + /* open extended manifest outfile for writing */ + sprintf(image->out_ext_man_file, "%s.xman", image->out_file); + unlink(image->out_ext_man_file); + + image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); + if (!image->out_ext_man_fd) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_ext_man_file, errno); + return errno; + } + + return 0; +} + +static int ext_man_validate(uint32_t section_size, const void *section_data) +{ + uint8_t *sbuf = (uint8_t *)section_data; + struct ext_man_elem_header head; + uint32_t offset = 0; + + /* copy each head to local struct to omit memory align issues */ + while (offset < section_size) { + memcpy(&head, &sbuf[offset], sizeof(head)); + fprintf(stdout, "Extended manifest found module, type: 0x%04X size: 0x%04X (%4d) offset: 0x%04X\n", + head.type, head.elem_size, head.elem_size, offset); + if (head.elem_size == 0 || head.elem_size % EXT_MAN_ALIGN) { + fprintf(stderr, + "error: invalid extended manifest element size\n"); + return -EINVAL; + } + offset += head.elem_size; + } + + /* sum of packets size != section size */ + if (offset != section_size) { + fprintf(stderr, + "error: fw_metadata section is inconsistent, section size: 0x%04X != 0x%04X sum of packets size\n", + section_size, offset); + return -EINVAL; + } else { + return 0; + } +} + +static int ext_man_build(const struct image *image, + struct ext_man_header **dst_buff) +{ + struct ext_man_header ext_man; + const Elf32_Shdr *section; + uint8_t *buffer = NULL; + uint8_t *sec_buffer = NULL; + size_t offset; + int ret = 0; + + ret = elf_read_section(image, ".fw_metadata", §ion, + (void **)&sec_buffer); + if (ret < 0) { + fprintf(stderr, + "error: failed to read .fw_metadata section content, code %d\n", + ret); + goto out; + } + + /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ + memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); + ext_man.full_size = ext_man.header_size; + ext_man.full_size += section->size; + if (ext_man.full_size % 4) { + fprintf(stderr, + "error: extended manifest size must be aligned to 4\n"); + ret = -EINVAL; + goto out; + } + + /* alloc buffer for ext_man */ + buffer = calloc(1, ext_man.full_size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* fill buffer with ext_man and section content */ + memcpy(buffer, &ext_man, ext_man.header_size); + offset = ext_man.header_size; + + memcpy(&buffer[offset],sec_buffer, section->size); + + *dst_buff = (struct ext_man_header *)buffer; + +out: + return ret; +} + +int ext_man_write(struct image *image) +{ + struct ext_man_header *ext_man = NULL; + int count; + int ret; + + ret = ext_man_open_file(image); + if (ret) + goto out; + + ret = ext_man_build(image, &ext_man); + if (ret) + goto out; + + /* validate metadata section */ + ret = ext_man_validate(ext_man->full_size - ext_man->header_size, + (char *)ext_man + ext_man->header_size); + if (ret) { + ret = -errno; + goto out; + } + + /* write extended metadata to file */ + count = fwrite(ext_man, 1, ext_man->full_size, image->out_ext_man_fd); + + if (count != ext_man->full_size) { + fprintf(stderr, + "error: can't write extended manifest to file %d\n", + -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "Extended manifest saved to file %s size 0x%04X (%d) bytes\n\n", + image->out_ext_man_file, ext_man->full_size, + ext_man->full_size); + +out: + if (ext_man) + free(ext_man); + if (image->out_ext_man_fd) + fclose(image->out_ext_man_fd); + return ret; +} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 68c14c591e19..1f7d13fc48d2 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -115,9 +115,11 @@ struct image { void *rom_image; FILE *out_rom_fd; FILE *out_man_fd; + FILE *out_ext_man_fd; FILE *out_unsigned_fd; char out_rom_file[256]; char out_man_file[256]; + char out_ext_man_file[256]; char out_unsigned_file[256]; /* fw version and build id */ diff --git a/src/include/sof/kernel/ext_manifest.h b/src/include/sof/kernel/ext_manifest.h new file mode 100644 index 000000000000..d27bafeb50a6 --- /dev/null +++ b/src/include/sof/kernel/ext_manifest.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +/* + * Extended manifest is a place to store metadata about firmware, known during + * compilation time - for example firmware version or used compiler. + * Given information are read on host side before firmware startup. + * This part of output binary is not signed. + * + * To add new content to ext_man, in firmware code define struct which starts + * with ext_man_elem_head followed by usage dependent content and place whole + * struct in "fw_metadata" section. Moreover kernel code should be modified to + * properly read new packet. + * + * Extended manifest is designed to be extensible. In header there is a field + * which describe header length, so after appending some data to header then it + * can be easily skipped by device with older version of this header. + * Unknown ext_man elements should be just skipped by host, + * to be backward compatible. Field `ext_man_elem_header.elem_size` should be + * used in such a situation. + */ + +#ifndef __KERNEL_EXT_MANIFEST_H__ +#define __KERNEL_EXT_MANIFEST_H__ + +#include + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +/* In ASCII `XMan` */ +#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 + +/* Build u32 number in format MMmmmppp */ +#define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ + ((uint32_t)(MAJOR) << 24) | \ + ((uint32_t)(MINOR) << 12) | \ + (uint32_t)(PATH)) + +/* check extended manifest version consistency */ +#define EXT_MAN_VERSION_INCOMPATIBLE(host_ver, cli_ver) ( \ + ((host_ver) & GENMASK(31, 24)) != \ + ((cli_ver) & GENMASK(31, 24))) + +/* used extended manifest header version */ +#define EXT_MAN_VERSION EXT_MAN_BUILD_VERSION(1, 0, 0) + +/* struct size alignment for ext_man elements */ +#define EXT_MAN_ALIGN 16 + +/* extended manifest header, deleting any field breaks backward compatibility */ +struct ext_man_header { + uint32_t magic; /**< identification number, */ + /**< EXT_MAN_MAGIC_NUMBER */ + uint32_t full_size; /**< [bytes] full size of ext_man, */ + /**< (header + content + padding) */ + uint32_t header_size; /**< [bytes] makes header extensionable, */ + /**< after append new field to ext_man header */ + /**< then backward compatible won't be lost */ + uint32_t header_version; /**< value of EXT_MAN_VERSION */ + /**< not related with following content */ + + /* just after this header should be list of ext_man_elem_* elements */ +} __packed; + +/* Now define extended manifest elements */ + +/* extended manifest element header */ +struct ext_man_elem_header { + uint32_t type; /**< EXT_MAN_ELEM_* */ + uint32_t elem_size; /**< in bytes, including header size */ + + /* just after this header should be type dependent content */ +} __packed; + +#endif /* __KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/sof/kernel/ext_manifest_gen.h new file mode 100644 index 000000000000..16bebcf87f69 --- /dev/null +++ b/src/include/sof/kernel/ext_manifest_gen.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +/* + * Extended manifest is a place to store metadata about firmware, known during + * compilation time - for example firmware version or used compiler. + * Given information are read on host side before firmware startup. + * This part of output binary is not signed. + * + * To add new content to ext_man, in firmware code define struct which starts + * with ext_man_elem_head followed by usage dependent content and place whole + * struct in "fw_metadata" section. Moreover kernel code should be modified to + * properly read new packet. + * + * Extended manifest designed to be extensible. In header there is a field which + * describe header length, so after appending some data to header then it can be + * easily skipped by device with older version of this header. + * From other side, unknown ext_man elements should be just skipped by host, + * to be backward compatible. Field ext_man_elem_header.elem_size should be + * used in such a situation. + */ + +#ifndef __EXT_MAN_H__ +#define __EXT_MAN_H__ + +#include "rimage.h" + +int ext_man_write(struct image *image); + +#endif /* __EXT_MAN_H__ */ diff --git a/src/rimage.c b/src/rimage.c index 11bee8a49257..e2cced00ce0a 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,6 +8,7 @@ #include #include +#include "kernel/ext_manifest_gen.h" #include "rimage.h" #include "manifest.h" @@ -187,6 +188,16 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware_meu(&image); else ret = image.adsp->write_firmware(&image); + if (ret) + goto out; + + ret = ext_man_write(&image); + if (ret < 0) { + fprintf(stderr, "warning: unable to write extended manifest, %d\n", + ret); + /* ext man is optional until FW side merge to master */ + ret = 0; + } out: /* close files */ From 6b34a04527352171325714912c0d2b63c1aec89e Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 08:46:58 +0200 Subject: [PATCH 115/350] ext_man: Move data section name to global define This name is used in different part of source code so should refer to single place instead by copied. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 6 +++--- src/include/sof/kernel/ext_manifest_gen.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 90604a2027b9..38e0bc9e999c 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -76,12 +76,12 @@ static int ext_man_build(const struct image *image, size_t offset; int ret = 0; - ret = elf_read_section(image, ".fw_metadata", §ion, + ret = elf_read_section(image, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); if (ret < 0) { fprintf(stderr, - "error: failed to read .fw_metadata section content, code %d\n", - ret); + "error: failed to read %s section content, code %d\n", + EXT_MAN_DATA_SECTION, ret); goto out; } diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/sof/kernel/ext_manifest_gen.h index 16bebcf87f69..5bb8b74721de 100644 --- a/src/include/sof/kernel/ext_manifest_gen.h +++ b/src/include/sof/kernel/ext_manifest_gen.h @@ -29,6 +29,8 @@ #include "rimage.h" +#define EXT_MAN_DATA_SECTION ".fw_metadata" + int ext_man_write(struct image *image); #endif /* __EXT_MAN_H__ */ From 0fa22ac38c1aa3e592e48daee9febab25e7c9d95 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 08:57:50 +0200 Subject: [PATCH 116/350] ext_man: elf: Split module and section searching Such a solution improve code hermentization and flexibility. Also such a solution is more relevant because of focus on particular module during section reading, so there won't be possibility to implicity scan section 'A' from first module and section 'B' from second one. Signed-off-by: Karol Trzcinski --- src/elf.c | 13 ++----------- src/ext_manifest.c | 28 +++++++++++++++++++++++++--- src/include/rimage/rimage.h | 2 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/elf.c b/src/elf.c index 663b2e0870e2..851f60704fb1 100644 --- a/src/elf.c +++ b/src/elf.c @@ -516,23 +516,14 @@ int elf_find_section(const struct module *module, const char *name) return ret; } -int elf_read_section(const struct image *image, const char *section_name, +int elf_read_section(const struct module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { - const struct module *module; const Elf32_Shdr *section; int section_index = -1; int read; - int i; - - /* when there is more than one module, then first one is bootloader */ - for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { - module = &image->module[i]; - section_index = elf_find_section(module, section_name); - if (section_index >= 0) - break; - } + section_index = elf_find_section(module, section_name); if (section_index < 0) { fprintf(stderr, "error: section %s can't be found\n", section_name); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 38e0bc9e999c..743814614d0b 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -36,6 +36,21 @@ static int ext_man_open_file(struct image *image) return 0; } +static const struct module *ext_man_find_module(const struct image *image) +{ + const struct module *module; + int i; + + /* when there is more than one module, then first one is bootloader */ + for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + module = &image->module[i]; + if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) + return module; + } + + return NULL; +} + static int ext_man_validate(uint32_t section_size, const void *section_data) { uint8_t *sbuf = (uint8_t *)section_data; @@ -66,7 +81,7 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct image *image, +static int ext_man_build(const struct module *module, struct ext_man_header **dst_buff) { struct ext_man_header ext_man; @@ -76,7 +91,7 @@ static int ext_man_build(const struct image *image, size_t offset; int ret = 0; - ret = elf_read_section(image, EXT_MAN_DATA_SECTION, §ion, + ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); if (ret < 0) { fprintf(stderr, @@ -117,6 +132,7 @@ static int ext_man_build(const struct image *image, int ext_man_write(struct image *image) { + const struct module *module; struct ext_man_header *ext_man = NULL; int count; int ret; @@ -125,7 +141,13 @@ int ext_man_write(struct image *image) if (ret) goto out; - ret = ext_man_build(image, &ext_man); + module = ext_man_find_module(image); + if (!module) { + ret = -ECANCELED; + goto out; + } + + ret = ext_man_build(module, &ext_man); if (ret) goto out; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1f7d13fc48d2..3eb375c7cf80 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -179,7 +179,7 @@ void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); int elf_find_section(const struct module *module, const char *name); -int elf_read_section(const struct image *image, const char *name, +int elf_read_section(const struct module *module, const char *name, const Elf32_Shdr **dst_section, void **dst_buff); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); From 328867431ca74fa7c7101d1a5a441eea462f5f77 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 12:57:01 +0200 Subject: [PATCH 117/350] ext_man: Fix write flow when ext_man should be build elf_read_section() returns section size when everything is ok, so ret value should be reset to 0 after this function call Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 743814614d0b..b36f3d66fef6 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -99,6 +99,7 @@ static int ext_man_build(const struct module *module, EXT_MAN_DATA_SECTION, ret); goto out; } + ret = 0; /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); From 76b6301e5791c485bd9e13b1e87e8fbab7f30340 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 13:32:40 +0200 Subject: [PATCH 118/350] ext_man: Make extended manifest build optional Try to build extended manifest only when `e` flag will be set, to prevent error and warning printing during creating optional part of formware image. Signed-off-by: Karol Trzcinski --- src/rimage.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index e2cced00ce0a..1c8c228c222b 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -42,6 +42,7 @@ static void usage(char *name) fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); + fprintf(stdout, "\t -e build extended manifest\n"); exit(0); } @@ -51,12 +52,13 @@ int main(int argc, char *argv[]) const char *mach = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; + int use_ext_man = 0; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:e")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -91,6 +93,9 @@ int main(int argc, char *argv[]) case 'b': image.fw_ver_build_string = optarg; break; + case 'e': + use_ext_man = 1; + break; case 'h': usage(argv[0]); break; @@ -191,12 +196,14 @@ int main(int argc, char *argv[]) if (ret) goto out; - ret = ext_man_write(&image); - if (ret < 0) { - fprintf(stderr, "warning: unable to write extended manifest, %d\n", - ret); - /* ext man is optional until FW side merge to master */ - ret = 0; + /* build extended manifest */ + if (use_ext_man) { + ret = ext_man_write(&image); + if (ret < 0) { + fprintf(stderr, "error: unable to write extended manifest, %d\n", + ret); + goto out; + } } out: From 537255bdd0c08cb0f5792bfe3ebd0648697d96bd Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 24 Apr 2020 13:26:54 +0200 Subject: [PATCH 119/350] ext_man: Remove redundant variable assign ret variable is always set in elf_read_section(), to initial value is not important. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index b36f3d66fef6..17758845b6b3 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -89,7 +89,7 @@ static int ext_man_build(const struct module *module, uint8_t *buffer = NULL; uint8_t *sec_buffer = NULL; size_t offset; - int ret = 0; + int ret; ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); From ece04f96560f3bc7790a6e113da302f071eb123d Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 30 Apr 2020 07:40:48 +0200 Subject: [PATCH 120/350] manifest: ads: meu: Fill FW version description also when MEU is used This part of binary should contain valid firmware version. Signed-off-by: Karol Trzcinski --- src/manifest.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index e38b5884ec22..137268bc53ff 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -976,6 +976,11 @@ static int man_write_fw_meu_v1_5(struct image *image) memcpy(desc, &image->adsp->man_v1_5->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); @@ -1051,6 +1056,11 @@ static int man_write_fw_meu_v1_8(struct image *image) memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); @@ -1126,6 +1136,11 @@ static int man_write_fw_meu_v2_5(struct image *image) memcpy(desc, &image->adsp->man_v2_5->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); From 932478abd6b32ed0df0ed4cbcf50e05d647cc100 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 23 Mar 2020 10:14:28 +0100 Subject: [PATCH 121/350] rimage: show LMA and VMA in section view Sometimes they will be different and this will make developer aware of the differences Signed-off-by: Adrian Bonislawski --- src/elf.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/elf.c b/src/elf.c index 851f60704fb1..34a9aa775df2 100644 --- a/src/elf.c +++ b/src/elf.c @@ -243,7 +243,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) } static void elf_module_size(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, uint32_t lma, int index) { switch (section->type) { case SHT_INIT_ARRAY: @@ -252,20 +252,17 @@ static void elf_module_size(struct image *image, struct module *module, /* text or data */ if (section->flags & SHF_EXECINSTR) { /* text */ - if (module->text_start > section->vaddr) - module->text_start = section->vaddr; - if (module->text_end < section->vaddr + section->size) - module->text_end = section->vaddr + - section->size; - + if (module->text_start > lma) + module->text_start = lma; + if (module->text_end < lma + section->size) + module->text_end = lma + section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ - if (module->data_start > section->vaddr) - module->data_start = section->vaddr; - if (module->data_end < section->vaddr + section->size) - module->data_end = section->vaddr + - section->size; + if (module->data_start > lma) + module->data_start = lma; + if (module->data_end < lma + section->size) + module->data_end = lma + section->size; fprintf(stdout, "\tDATA\t"); } @@ -329,7 +326,8 @@ static void elf_module_limits(struct image *image, struct module *module) { Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i; + uint32_t section_lma; + int i, j; module->text_start = 0xffffffff; module->data_start = 0xffffffff; @@ -341,7 +339,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tSize\tType\tName\n"); + fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { @@ -359,16 +357,24 @@ static void elf_module_limits(struct image *image, struct module *module) if (elf_is_rom(image, section)) continue; } + /* check programs to get LMA */ + section_lma = section->vaddr; + for (j = 0; j < module->hdr.phnum; j++) { + if (section->vaddr == module->prg[j].vaddr) { + section_lma = module->prg[j].paddr; + break; + } + } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x", i, - section->vaddr, section->vaddr + section->size, - section->size); + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8x\t0x%x", i, + section_lma, section->vaddr, + section->vaddr + section->size, section->size); /* text or data section */ if (image->reloc) elf_module_size_reloc(image, module, section, i); else - elf_module_size(image, module, section, i); + elf_module_size(image, module, section, section_lma, i); /* section name */ fprintf(stdout, "%s\n", module->strings + section->name); From f23b2c2d07d13b60efe881203d754475b11fbfba Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 9 Mar 2020 14:11:01 +0100 Subject: [PATCH 122/350] rimage: use lma if available some sections may use different lma than vma address, in such case rimage needs to use lma Signed-off-by: Adrian Bonislawski --- src/manifest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/manifest.c b/src/manifest.c index 137268bc53ff..ff99af9d14b2 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -126,9 +126,16 @@ static uint32_t elf_to_file_offset(struct image *image, struct sof_man_module *man_module, Elf32_Shdr *section) { - uint32_t elf_addr = section->vaddr, file_offset = 0; + uint32_t elf_addr = section->vaddr, file_offset = 0, i; if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { + /* check programs for lma/vma change */ + for (i = 0; i < module->hdr.phnum; i++) { + if (section->vaddr == module->prg[i].vaddr) { + elf_addr = module->prg[i].paddr; + break; + } + } if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + From 67d09d61c8860ca4f336c5bcf7c2e201e2cc3ac3 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 14:09:18 +0200 Subject: [PATCH 123/350] ext_man: Move extended manifest generator out of kernel folder Generator is part of rimage tool and there is any reference to them in kernel source code, so it should be moved out of kernel folder. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 2 +- src/include/{sof/kernel => rimage}/ext_manifest_gen.h | 0 src/rimage.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/include/{sof/kernel => rimage}/ext_manifest_gen.h (100%) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 17758845b6b3..bb220ae38b49 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -9,7 +9,7 @@ #include #include -#include "kernel/ext_manifest_gen.h" +#include "ext_manifest_gen.h" #include "kernel/ext_manifest.h" #include "rimage.h" diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h similarity index 100% rename from src/include/sof/kernel/ext_manifest_gen.h rename to src/include/rimage/ext_manifest_gen.h diff --git a/src/rimage.c b/src/rimage.c index 1c8c228c222b..2bb0d6e77e1e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,7 +8,7 @@ #include #include -#include "kernel/ext_manifest_gen.h" +#include "ext_manifest_gen.h" #include "rimage.h" #include "manifest.h" From 116e14119331cbbd90b572e547e8d1c6feb28c9b Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 15:04:48 +0200 Subject: [PATCH 124/350] headers: Move headers to rimage namespace Because there is possibility to reference headers from this repo from another one, there is a need to put every header into rimage namespace. Otherwise reference to headers from duplicated namespace (like kernel) from external repo may be ambiguous. Update guard ifdef/define/endif sequence value, to make it more unique Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 2 +- src/include/{ => rimage}/sof/kernel/ext_manifest.h | 6 +++--- src/include/{ => rimage}/sof/kernel/fw.h | 6 +++--- src/include/{ => rimage}/sof/user/manifest.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename src/include/{ => rimage}/sof/kernel/ext_manifest.h (95%) rename src/include/{ => rimage}/sof/kernel/fw.h (95%) rename src/include/{ => rimage}/sof/user/manifest.h (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d176dd582e4..559f9695aa7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/rimage - src/include/sof + src/include/rimage/sof ) install(TARGETS rimage DESTINATION bin) diff --git a/src/include/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h similarity index 95% rename from src/include/sof/kernel/ext_manifest.h rename to src/include/rimage/sof/kernel/ext_manifest.h index d27bafeb50a6..7d9b77735a11 100644 --- a/src/include/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -24,8 +24,8 @@ * used in such a situation. */ -#ifndef __KERNEL_EXT_MANIFEST_H__ -#define __KERNEL_EXT_MANIFEST_H__ +#ifndef __RIMAGE_KERNEL_EXT_MANIFEST_H__ +#define __RIMAGE_KERNEL_EXT_MANIFEST_H__ #include @@ -78,4 +78,4 @@ struct ext_man_elem_header { /* just after this header should be type dependent content */ } __packed; -#endif /* __KERNEL_EXT_MANIFEST_H__ */ +#endif /* __RIMAGE_KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/include/sof/kernel/fw.h b/src/include/rimage/sof/kernel/fw.h similarity index 95% rename from src/include/sof/kernel/fw.h rename to src/include/rimage/sof/kernel/fw.h index 2c0a123d23b7..4a733b30e272 100644 --- a/src/include/sof/kernel/fw.h +++ b/src/include/rimage/sof/kernel/fw.h @@ -10,8 +10,8 @@ * Firmware file format . */ -#ifndef __KERNEL_FW_H__ -#define __KERNEL_FW_H__ +#ifndef __RIMAGE_KERNEL_FW_H__ +#define __RIMAGE_KERNEL_FW_H__ #include @@ -77,4 +77,4 @@ struct snd_sof_fw_header { uint32_t abi; /* version of header format */ } __attribute__((packed)); -#endif /* __KERNEL_FW_H__ */ +#endif /* __RIMAGE_KERNEL_FW_H__ */ diff --git a/src/include/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h similarity index 98% rename from src/include/sof/user/manifest.h rename to src/include/rimage/sof/user/manifest.h index bd598f907efe..ec5b03e23cdf 100644 --- a/src/include/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -11,8 +11,8 @@ * \author Liam Girdwood */ -#ifndef __USER_MANIFEST_H__ -#define __USER_MANIFEST_H__ +#ifndef __RIMAGE_USER_MANIFEST_H__ +#define __RIMAGE_USER_MANIFEST_H__ #include @@ -225,4 +225,4 @@ struct sof_man_module_manifest { (sizeof(struct sof_man_fw_header) + \ (index) * sizeof(struct sof_man_module)) -#endif /* __USER_MANIFEST_H__ */ +#endif /* __RIMAGE_USER_MANIFEST_H__ */ From 9f3f2d7d714908c1f8f3f77baebe9175682f02bc Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 16:03:34 +0200 Subject: [PATCH 125/350] headers: Use full path to header Path added to include should end at 'include' as usual, then it is easy to see where specific headers comes from during reading source code. It is especially important for projects composed from a few parts, like firmware, driver, build and debug tools in this project. Moreover changed "" to <> in include directives because there is specified full path to file from project include root and to be aligned with code style from firmware repository, Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 3 +-- src/cse.c | 6 +++--- src/css.c | 6 +++--- src/elf.c | 6 +++--- src/ext_manifest.c | 6 +++--- src/file_simple.c | 2 +- src/hash.c | 4 ++-- src/include/rimage/ext_manifest_gen.h | 2 +- src/include/rimage/manifest.h | 8 ++++---- src/include/rimage/rimage.h | 2 +- src/man_apl.c | 8 ++++---- src/man_cnl.c | 8 ++++---- src/man_kbl.c | 8 ++++---- src/man_sue.c | 8 ++++---- src/man_tgl.c | 8 ++++---- src/manifest.c | 12 ++++++------ src/pkcs1_5.c | 6 +++--- src/plat_auth.c | 6 +++--- src/rimage.c | 6 +++--- 19 files changed, 57 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 559f9695aa7c..fb0c5fdc8634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,7 @@ target_compile_options(rimage PRIVATE target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE - src/include/rimage - src/include/rimage/sof + src/include/ ) install(TARGETS rimage DESTINATION bin) diff --git a/src/cse.c b/src/cse.c index f3bea3826ae7..75f7630a65b1 100644 --- a/src/cse.c +++ b/src/cse.c @@ -6,9 +6,9 @@ // Keyon Jie #include -#include "rimage.h" -#include "cse.h" -#include "manifest.h" +#include +#include +#include void ri_cse_create(struct image *image) { diff --git a/src/css.c b/src/css.c index 1e9de6d8bc86..f2627e6f58e9 100644 --- a/src/css.c +++ b/src/css.c @@ -7,9 +7,9 @@ #include #include -#include "rimage.h" -#include "css.h" -#include "manifest.h" +#include +#include +#include void ri_css_v1_8_hdr_create(struct image *image) { diff --git a/src/elf.c b/src/elf.c index 34a9aa775df2..f53adcd75441 100644 --- a/src/elf.c +++ b/src/elf.c @@ -7,9 +7,9 @@ #include #include -#include "rimage.h" -#include "cse.h" -#include "manifest.h" +#include +#include +#include static int elf_read_sections(struct image *image, struct module *module, int module_index) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index bb220ae38b49..8f079bb9bd4b 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -9,9 +9,9 @@ #include #include -#include "ext_manifest_gen.h" -#include "kernel/ext_manifest.h" -#include "rimage.h" +#include +#include +#include const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, diff --git a/src/file_simple.c b/src/file_simple.c index d570c5a8bad9..1adcaa738826 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,7 +8,7 @@ #include #include -#include "rimage.h" +#include #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 diff --git a/src/hash.c b/src/hash.c index 62c4e2f3540b..a38e64c391ec 100644 --- a/src/hash.c +++ b/src/hash.c @@ -17,8 +17,8 @@ #include #include -#include "rimage.h" -#include "manifest.h" +#include +#include #if OPENSSL_VERSION_NUMBER < 0x10100000L void EVP_MD_CTX_free(EVP_MD_CTX *ctx); diff --git a/src/include/rimage/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h index 5bb8b74721de..e91ba229c1ab 100644 --- a/src/include/rimage/ext_manifest_gen.h +++ b/src/include/rimage/ext_manifest_gen.h @@ -27,7 +27,7 @@ #ifndef __EXT_MAN_H__ #define __EXT_MAN_H__ -#include "rimage.h" +#include #define EXT_MAN_DATA_SECTION ".fw_metadata" diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 32e0574e8db5..7f74b80e7d74 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,10 +7,10 @@ #define __MANIFEST_H__ #include -#include -#include "css.h" -#include "cse.h" -#include "plat_auth.h" +#include +#include +#include +#include #define MAN_PAGE_SIZE 4096 diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 3eb375c7cf80..04518ed5900d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 diff --git a/src/man_apl.c b/src/man_apl.c index b81bb759b8a6..616084b5f673 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { diff --git a/src/man_cnl.c b/src/man_cnl.c index 72ec898718aa..cf51089d30a5 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { diff --git a/src/man_kbl.c b/src/man_kbl.c index 4a078e5d99e8..9634e01a8167 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2018 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* * TODO: check if all platform for 1.5 are the same base and length. diff --git a/src/man_sue.c b/src/man_sue.c index e170d9952095..8c7df5a29b91 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { diff --git a/src/man_tgl.c b/src/man_tgl.c index f7c3c6f25787..97ee4ed08d10 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2019 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v2_5 tgl_manifest = { diff --git a/src/manifest.c b/src/manifest.c index ff99af9d14b2..6a389bad637c 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -14,13 +14,13 @@ #include #include -#include +#include -#include "rimage.h" -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include +#include static int man_open_rom_file(struct image *image) { diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index a55abb9d33c3..b4718bd0c025 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -17,9 +17,9 @@ #include #include -#include "rimage.h" -#include "css.h" -#include "manifest.h" +#include +#include +#include #if OPENSSL_VERSION_NUMBER < 0x10100000L void RSA_get0_key(const RSA *r, diff --git a/src/plat_auth.c b/src/plat_auth.c index e8645611f327..9b451798ad14 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -5,9 +5,9 @@ // Author: Liam Girdwood // Keyon Jie -#include "rimage.h" -#include "manifest.h" -#include "plat_auth.h" +#include +#include +#include void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, int meta_end_offset) diff --git a/src/rimage.c b/src/rimage.c index 2bb0d6e77e1e..5c5c15177482 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,9 +8,9 @@ #include #include -#include "ext_manifest_gen.h" -#include "rimage.h" -#include "manifest.h" +#include +#include +#include static const struct adsp *machine[] = { &machine_byt, From 4348e2a2bd6a8396a3f35bf1bf48f2662e3e73e0 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 15 Jun 2020 21:59:30 -0700 Subject: [PATCH 126/350] cmake: use CMAKE_BUILD_TYPE and default to Debug Unlike hardcoded target_compile_options(-g) can be overriden from the command line, from the parent ExternalProject_Add(CMAKE_ARGS) (tested) or from a CMake GUI (not tested). Default to Debug because the time spent running rimage is negligible compared to building the image to sign and because the time saved learning CMake when it crashes can be huge for some people. BTW -O2 -g is rarely ever useful. Signed-off-by: Marc Herbert --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb0c5fdc8634..02120515b8b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ cmake_minimum_required(VERSION 3.10) project(SOF_RIMAGE C) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No CMAKE_BUILD_TYPE, defaulting to Debug") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) +endif() + add_executable(rimage src/file_simple.c src/man_apl.c @@ -23,7 +28,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 + -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 ) target_link_libraries(rimage PRIVATE "-lcrypto") From 2156dcb00d2eb05a83f351feb88e55e09bfb27fe Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 15 Jun 2020 22:28:40 -0700 Subject: [PATCH 127/350] rimage.c: add assert(image.adsp->write_firmware[_meu]) This makes the write_firmware NULL pointer added by commit dd77445f018c and corresponding crash more user-friendly. Before: Program received signal SIGSEGV, Segmentation fault. After: rimage: src/rimage.c:197: main: Assertion `image.adsp->write_firmware' failed. Signed-off-by: Marc Herbert --- src/rimage.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 5c5c15177482..31c5a3f86fc1 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -2,6 +2,7 @@ // // Copyright(c) 2015 Intel Corporation. All rights reserved. +#include #include #include #include @@ -189,10 +190,13 @@ int main(int argc, char *argv[]) } /* process and write output */ - if (image.meu_offset) + if (image.meu_offset) { + assert(image.adsp->write_firmware_meu); ret = image.adsp->write_firmware_meu(&image); - else + } else { + assert(image.adsp->write_firmware); ret = image.adsp->write_firmware(&image); + } if (ret) goto out; From 7317f2af3901991becaecaa48400611b1a532cd5 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 14 Jul 2020 13:04:20 +0200 Subject: [PATCH 128/350] manifest: set feature mask to 0xffff This feature is not used by SOF anyway and only causes FW load failures, we can set it to 0xffff so it will work for ADL+ platforms. Signed-off-by: Janusz Jankowski --- src/include/rimage/sof/user/manifest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index ec5b03e23cdf..ccf23cf7b42f 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -115,7 +115,7 @@ struct sof_man_mod_config { #define SOF_MAN_FW_HDR_ID {'$', 'A', 'M', '1'} #define SOF_MAN_FW_HDR_NAME "ADSPFW" #define SOF_MAN_FW_HDR_FLAGS 0x0 -#define SOF_MAN_FW_HDR_FEATURES 0x1ff +#define SOF_MAN_FW_HDR_FEATURES 0xffff /* * The firmware has a standard header that is checked by the ROM on firmware From 29ed0da494841c01f03ea1b65c7c13af63cac589 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 4 Sep 2020 13:29:17 +0200 Subject: [PATCH 129/350] toml: Add TOML parsing library as git submodule TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. Signed-off-by: Karol Trzcinski --- .gitmodules | 4 ++++ tomlc99 | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 tomlc99 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000000..5ade8be2a063 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "tomlc99"] + path = tomlc99 + url = https://github.com/thesofproject/tomlc99.git + branch = master diff --git a/tomlc99 b/tomlc99 new file mode 160000 index 000000000000..e3a03f5ec7d8 --- /dev/null +++ b/tomlc99 @@ -0,0 +1 @@ +Subproject commit e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 From 210009c829ddd6fe2dc180a223b6014dca4a7afe Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Mon, 7 Sep 2020 16:33:49 +0200 Subject: [PATCH 130/350] adsp: Refactor machine searching This part should be moved to separate function, to allow easily add another way of machine description. Signed-off-by: Karol Trzcinski --- src/rimage.c | 71 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 31c5a3f86fc1..f3723fe05654 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -13,24 +13,6 @@ #include #include -static const struct adsp *machine[] = { - &machine_byt, - &machine_cht, - &machine_bsw, - &machine_hsw, - &machine_bdw, - &machine_apl, - &machine_cnl, - &machine_icl, - &machine_jsl, - &machine_tgl, - &machine_sue, - &machine_kbl, - &machine_skl, - &machine_imx8, - &machine_imx8x, - &machine_imx8m, -}; static void usage(char *name) { @@ -47,6 +29,40 @@ static void usage(char *name) exit(0); } +static const struct adsp *find_adsp(const char *mach) +{ + static const struct adsp *machine[] = { + &machine_byt, + &machine_cht, + &machine_bsw, + &machine_hsw, + &machine_bdw, + &machine_apl, + &machine_cnl, + &machine_icl, + &machine_jsl, + &machine_tgl, + &machine_sue, + &machine_kbl, + &machine_skl, + &machine_imx8, + &machine_imx8x, + &machine_imx8m, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(machine); i++) { + if (!strcmp(mach, machine[i]->name)) + return machine[i]; + } + fprintf(stderr, "error: machine %s not found\n", mach); + fprintf(stderr, "error: available machines "); + for (i = 0; i < ARRAY_SIZE(machine); i++) + fprintf(stderr, "%s, ", machine[i]->name); + fprintf(stderr, "\n"); + return NULL; +} + int main(int argc, char *argv[]) { struct image image; @@ -141,22 +157,9 @@ int main(int argc, char *argv[]) } } - /* find machine */ - for (i = 0; i < ARRAY_SIZE(machine); i++) { - if (!strcmp(mach, machine[i]->name)) { - image.adsp = machine[i]; - goto found; - } - } - fprintf(stderr, "error: machine %s not found\n", mach); - fprintf(stderr, "error: available machines "); - for (i = 0; i < ARRAY_SIZE(machine); i++) - fprintf(stderr, "%s, ", machine[i]->name); - fprintf(stderr, "\n"); - - return -EINVAL; - -found: + image.adsp = find_adsp(mach); + if (!image.adsp) + return -EINVAL; /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) From f654d5337d76358e4af4059bc2926b39e5a270d6 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 9 Sep 2020 08:25:51 +0200 Subject: [PATCH 131/350] manifest: Export man_write_fw_vX_Y() to global context Exported function will be used in configuration parser, to assign correct function version depending on manifest versiony Signed-off-by: Karol Trzcinski --- src/file_simple.c | 3 ++- src/include/rimage/manifest.h | 10 ++++++++++ src/manifest.c | 12 ++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index 1adcaa738826..396c24c2bf0d 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -9,6 +9,7 @@ #include #include +#include #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 @@ -316,7 +317,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) } /* used by others */ -static int simple_write_firmware(struct image *image) +int simple_write_firmware(struct image *image) { struct snd_sof_fw_header hdr; struct module *module; diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 7f74b80e7d74..7b54bc137b66 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -154,4 +154,14 @@ struct fw_image_manifest_v1_5_sue { extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; extern struct fw_image_manifest_v1_5_sue sue_manifest; + +struct image; +int simple_write_firmware(struct image *image); +int man_write_fw_v1_5(struct image *image); +int man_write_fw_v1_5_sue(struct image *image); +int man_write_fw_v1_8(struct image *image); +int man_write_fw_meu_v1_5(struct image *image); +int man_write_fw_meu_v1_8(struct image *image); +int man_write_fw_meu_v2_5(struct image *image); + #endif diff --git a/src/manifest.c b/src/manifest.c index 6a389bad637c..1c9a2a043119 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -709,7 +709,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) } /* used by others */ -static int man_write_fw_v1_5(struct image *image) +int man_write_fw_v1_5(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_5 *m; @@ -789,7 +789,7 @@ static int man_write_fw_v1_5(struct image *image) } /* used by others */ -static int man_write_fw_v1_5_sue(struct image *image) +int man_write_fw_v1_5_sue(struct image *image) { struct fw_image_manifest_v1_5_sue *m; uint32_t preload_size; @@ -845,7 +845,7 @@ static int man_write_fw_v1_5_sue(struct image *image) } /* used by others */ -static int man_write_fw_v1_8(struct image *image) +int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; @@ -949,7 +949,7 @@ static int man_write_fw_v1_8(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v1_5(struct image *image) +int man_write_fw_meu_v1_5(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; @@ -1027,7 +1027,7 @@ static int man_write_fw_meu_v1_5(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v1_8(struct image *image) +int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; @@ -1107,7 +1107,7 @@ static int man_write_fw_meu_v1_8(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v2_5(struct image *image) +int man_write_fw_meu_v2_5(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v2_5) - MAN_EXT_PADDING; From de1b0f7def6fce04fe5b5053c727f6fa8e62b659 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Mon, 7 Sep 2020 17:20:08 +0200 Subject: [PATCH 132/350] config: Add configuration file parsing interface This allow to add new platform with old version of rimage tool. Default values are easily to define for any fields, so fields duplication in config files should be reduced. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 3 + src/adsp_config.c | 1573 ++++++++++++++++++++++++++++++ src/include/rimage/adsp_config.h | 9 + src/rimage.c | 41 +- 4 files changed, 1620 insertions(+), 6 deletions(-) create mode 100644 src/adsp_config.c create mode 100644 src/include/rimage/adsp_config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 02120515b8b1..078fa8d9e3ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,8 @@ add_executable(rimage src/ext_manifest.c src/elf.c src/rimage.c + src/adsp_config.c + tomlc99/toml.c ) target_compile_options(rimage PRIVATE @@ -35,6 +37,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/ + tomlc99/ ) install(TARGETS rimage DESTINATION bin) diff --git a/src/adsp_config.c b/src/adsp_config.c new file mode 100644 index 000000000000..dc0b91c931c2 --- /dev/null +++ b/src/adsp_config.c @@ -0,0 +1,1573 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +#include "rimage/sof/user/manifest.h" +#include "rimage/adsp_config.h" +#include "rimage/plat_auth.h" +#include "rimage/manifest.h" +#include "rimage/rimage.h" +#include "rimage/cse.h" +#include "rimage/css.h" +#include "toml.h" +#include +#include +#include +#include +#include + +/* macros used to dump values after parsing */ +#define DUMP_KEY_FMT " %20s: " +#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) +#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) + +/** parser counter, used to assert nothing left unparsed in toml data */ +struct parse_ctx { + int key_cnt; /**< number of parsed key */ + int table_cnt; /**< number of parsed tables */ + int array_cnt; /**< number of parsed arrays */ +}; + +/** private parser error trace function */ +static void vlog_err(const char *msg, va_list vl) +{ + vfprintf(stderr, msg, vl); +} + +/** parser error trace function, error code is returned to shorten client code */ +static int log_err(int err_code, const char *msg, ...) +{ + va_list vl; + + va_start(vl, msg); + vlog_err(msg, vl); + va_end(vl); + return err_code; +} + +/** log malloc error message for given key */ +static int err_malloc(const char *key) +{ + return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); +} + +/** log key not found error */ +static int err_key_not_found(const char *key) +{ + return log_err(-ENOKEY, "error: '%s' not found\n", key); +} + +/** error during parsing key value, possible detailed message */ +static int err_key_parse(const char *key, const char *extra_msg, ...) +{ + int ret = -EBADE; + va_list vl; + + if (extra_msg) { + log_err(ret, "error: key '%s' parsing error, ", key); + va_start(vl, extra_msg); + vlog_err(extra_msg, vl); + va_end(vl); + return log_err(ret, "\n"); + } else { + return log_err(ret, "error: key '%s' parsing error\n", key); + } +} + +/** initialize parser context before parsing */ +static void parse_ctx_init(struct parse_ctx *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +/** check nothing left unparsed in given parsing context */ +static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) +{ + const char *key = toml_table_key(table); + int ret = 0; + + /* toml_table_key returns NULL for global context */ + if (!key) + key = "toml"; + + /* from number of parsed fields subtract fields count in given table */ + ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; + ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; + ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; + + /* when eny field left unparsed, then raise error */ + if (ctx->key_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); + if (ctx->array_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, + key); + if (ctx->table_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, + key); + return ret; +} + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value + */ +static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error) +{ + toml_raw_t raw; + char *temp_s; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is not build-in support for hex numbers in toml, so read then as string */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return UINT32_MAX; + } + val = strtol(temp_s, 0, 16); + free(temp_s); + /* assert parsing success and value is within uint32_t range */ + if (errno < 0) { + *error = err_key_parse(key, "can't convert hex value"); + return UINT32_MAX; + } + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value + */ +static int parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) +{ + toml_raw_t raw; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is build-in support for integer numbers in toml, so use lib function */ + ret = toml_rtoi(raw, &val); + if (ret < 0) { + *error = err_key_parse(key, "can't convert to integer value"); + return UINT32_MAX; + } + /* assert value is within uint32_t range */ + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse string value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst target buffer for string + * @param capacity dst buffer size + * @param error code, 0 when success + */ +static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + toml_raw_t raw; + char *temp_s; + int len; + int ret; + + /* look for key in given table */ + raw = toml_raw_in(table, key); + if (!raw) { + *error = err_key_not_found(key); + return; + } + /* read string from toml, theres malloc inside toml_rtos() */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return; + } + + len = strlen(temp_s); + if (len > capacity) { + *error = log_err(-EINVAL, "Too long input for key '%s' (%d > %d)\n", key, len, + capacity); + free(temp_s); + return; + } + + /* copy string to dst, free allocated memory and update parsing context */ + strncpy(dst, temp_s, capacity); + free(temp_s); + ++ctx->key_cnt; + *error = 0; +} + +/* map memory zone string name to enum value */ +static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) +{ + static const struct { + const char name[32]; + enum snd_sof_fw_blk_type type; + } mem_zone_name_dict[] = { + {"START", SOF_FW_BLK_TYPE_START}, + {"IRAM", SOF_FW_BLK_TYPE_IRAM}, + {"DRAM", SOF_FW_BLK_TYPE_DRAM}, + {"SRAM", SOF_FW_BLK_TYPE_SRAM}, + {"ROM", SOF_FW_BLK_TYPE_ROM}, + {"IMR", SOF_FW_BLK_TYPE_IMR}, + {"RSRVD0", SOF_FW_BLK_TYPE_RSRVD0}, + {"RSRVD6", SOF_FW_BLK_TYPE_RSRVD6}, + {"RSRVD7", SOF_FW_BLK_TYPE_RSRVD7}, + {"RSRVD8", SOF_FW_BLK_TYPE_RSRVD8}, + {"RSRVD9", SOF_FW_BLK_TYPE_RSRVD9}, + {"RSRVD10", SOF_FW_BLK_TYPE_RSRVD10}, + {"RSRVD11", SOF_FW_BLK_TYPE_RSRVD11}, + {"RSRVD12", SOF_FW_BLK_TYPE_RSRVD12}, + {"RSRVD13", SOF_FW_BLK_TYPE_RSRVD13}, + {"RSRVD14", SOF_FW_BLK_TYPE_RSRVD14}, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(mem_zone_name_dict); ++i) { + if (!strcmp(name, mem_zone_name_dict[i].name)) + return mem_zone_name_dict[i].type; + } + return SOF_FW_BLK_TYPE_INVALID; +} + +static void dump_adsp(const struct adsp *adsp) +{ + int i; + + DUMP("\nadsp"); + DUMP_KEY("name", "'%s'", adsp->name); + DUMP_KEY("machine_id", "%d", adsp->machine_id); + DUMP_KEY("image_size", "0x%x", adsp->image_size); + DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); + DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); + for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { + DUMP_KEY("mem_zone.idx", "%d", i); + DUMP_KEY("mem_zone.size", "0x%x", adsp->mem_zones[i].size); + DUMP_KEY("mem_zone.base", "0x%x", adsp->mem_zones[i].base); + DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem_zones[i].host_offset); + } +} + +static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct adsp *out, + bool verbose) +{ + toml_array_t *mem_zone_array; + toml_table_t *mem_zone; + struct mem_zone *zone; + struct parse_ctx ctx; + char zone_name[32]; + toml_table_t *adsp; + toml_raw_t raw; + int zone_idx; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp = toml_table_in(toml, "adsp"); + if (!adsp) + return err_key_not_found("adsp"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + raw = toml_raw_in(adsp, "name"); + if (!raw) + return err_key_not_found("name"); + ++ctx.key_cnt; + + /* free(out->name) is called in adsp_free() */ + ret = toml_rtos(raw, (char **)&out->name); + if (ret < 0) + return err_key_parse("name", NULL); + + out->machine_id = parse_uint32_key(adsp, &ctx, "machine_id", -1, &ret); + if (ret < 0) + return ret; + + out->image_size = parse_uint32_hex_key(adsp, &ctx, "image_size", 0, &ret); + if (ret < 0) + return ret; + + out->dram_offset = parse_uint32_hex_key(adsp, &ctx, "dram_offset", 0, &ret); + if (ret < 0) + return ret; + + out->exec_boot_ldr = parse_uint32_key(adsp, &ctx, "exec_boot_ldr", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, 1 table should be present */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp, &ctx); + if (ret < 0) + return ret; + + /* look for entry array */ + memset(out->mem_zones, 0, sizeof(out->mem_zones)); + mem_zone_array = toml_array_in(adsp, "mem_zone"); + if (!mem_zone_array) + return err_key_not_found("mem_zone"); + if (toml_array_kind(mem_zone_array) != 't' || + toml_array_nelem(mem_zone_array) > SOF_FW_BLK_TYPE_NUM) + return err_key_parse("mem_zone", "wrong array type or length > %d", + SOF_FW_BLK_TYPE_NUM); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(mem_zone_array); ++i) { + mem_zone = toml_table_at(mem_zone_array, i); + if (!mem_zone) + return err_key_parse("mem_zone", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(mem_zone, &ctx, "type", zone_name, sizeof(zone_name), &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone_idx = zone_name_to_idx(zone_name); + if (zone_idx < 0) + return err_key_parse("mem_zone.name", "unknown zone"); + + zone = &out->mem_zones[zone_idx]; + zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone->host_offset = parse_uint32_hex_key(mem_zone, &ctx, "host_offset", 0, + &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone->size = parse_uint32_hex_key(mem_zone, &ctx, "size", -1, &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(mem_zone, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp(out); + + /* + * values set in other places in code: + * - write_firmware + * - write_firmware_meu + * - man_vX_Y + */ + + return 0; +} + +static void dump_cse(const struct CsePartitionDirHeader *cse_header, + const struct CsePartitionDirEntry *cse_entry) +{ + int i; + + DUMP("\ncse"); + DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_KEY("header_version", "%d", cse_header->header_version); + DUMP_KEY("entry_version", "%d", cse_header->entry_version); + DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); + for (i = 0; i < cse_header->nb_entries; ++i) { + DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); + DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); + } +} + +static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, + struct CsePartitionDirHeader *hdr, struct CsePartitionDirEntry *out, + int entry_capacity, bool verbose) +{ + toml_array_t *cse_entry_array; + toml_table_t *cse_entry; + struct parse_ctx ctx; + toml_table_t *cse; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + cse = toml_table_in(toml, "cse"); + if (!cse) + return err_key_not_found("cse"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + hdr->header_marker = CSE_HEADER_MAKER; + hdr->header_length = sizeof(struct CsePartitionDirHeader); + + /* configurable fields */ + hdr->header_version = parse_uint32_key(cse, &ctx, "header_version", 1, &ret); + if (ret < 0) + return ret; + + hdr->entry_version = parse_uint32_key(cse, &ctx, "entry_version", 1, &ret); + if (ret < 0) + return ret; + + parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, + sizeof(hdr->partition_name), &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 table */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(cse, &ctx); + if (ret < 0) + return ret; + + /* entry array */ + cse_entry_array = toml_array_in(cse, "entry"); + if (!cse_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(cse_entry_array) != 't' || + toml_array_nelem(cse_entry_array) != entry_capacity) + return err_key_parse("entry", "wrong array type or length != %d", entry_capacity); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(cse_entry_array); ++i) { + cse_entry = toml_table_at(cse_entry_array, i); + if (!cse_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out[i].reserved = 0; + + /* configurable fields */ + parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, + sizeof(out[i].entry_name), &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].offset = parse_uint32_hex_key(cse_entry, &ctx, "offset", -1, &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].length = parse_uint32_hex_key(cse_entry, &ctx, "length", -1, &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(cse_entry, &ctx); + if (ret < 0) + return ret; + } + + hdr->nb_entries = toml_array_nelem(cse_entry_array); + + if (verbose) + dump_cse(hdr, out); + + /* + * values set in other places in code: + * - checksum + */ + + return 0; +} + +static void dump_css_v1_5(const struct css_header_v1_5 *css) +{ + DUMP("\ncss"); + DUMP_KEY("module_type", "%d", css->module_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("key_size", "%d", css->key_size); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v1_5 *out, bool verbose) +{ + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->reserved0 = 0; + memset(out->reserved, 0, sizeof(out->reserved)); + + /* configurable fields */ + out->module_type = parse_uint32_key(css, &ctx, "module_type", MAN_CSS_LT_MODULE_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 0x800, &ret); + if (ret < 0) + return ret; + + out->key_size = parse_uint32_key(css, &ctx, "key_size", MAN_CSS_KEY_SIZE, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v1_5(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + +static void dump_css_v1_8(const struct css_header_v1_8 *css) +{ + DUMP("\ncss"); + DUMP_KEY("header_type", "%d", css->header_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("svn", "%d", css->svn); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v1_8 *out, bool verbose) +{ + static const uint8_t hdr_id[4] = MAN_CSS_HDR_ID; + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(out->header_id, hdr_id, sizeof(out->header_id)); + out->padding = 0; + out->reserved0 = 0; + memset(out->reserved1, 0xff, sizeof(out->reserved1)); + + /* configurable fields */ + out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 222, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(css, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v1_8(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + +static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) + DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); + DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); + DUMP_KEY("meta.meta_size", "%d", signed_pkg->module[i].meta_size); + } +} + +static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext *out, bool verbose) +{ + struct signed_pkg_info_module *mod; + toml_array_t *bitmap_array; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + toml_raw_t raw; + int64_t temp_i; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE; + out->ext_len = sizeof(struct signed_pkg_info_ext); + memset(out->reserved, 0, sizeof(out->reserved)); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + /* bitmap array */ + bitmap_array = toml_array_in(signed_pkg, "bitmap"); + if (!bitmap_array) { + /* default value */ + memset(out->bitmap, 0, sizeof(out->bitmap)); + out->bitmap[4] = 8; + } else { + ++ctx.array_cnt; + if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || + toml_array_nelem(bitmap_array) > ARRAY_SIZE(out->bitmap)) + return err_key_parse("bitmap", "wrong array type or length > %d", + ARRAY_SIZE(out->bitmap)); + + for (i = 0; i < toml_array_nelem(bitmap_array); ++i) { + raw = toml_raw_at(bitmap_array, i); + if (!raw) + return err_key_parse("bitmap", NULL); + + ret = toml_rtoi(raw, &temp_i); + if (ret < 0 || temp_i < 0) + return err_key_parse("bitmap", "values can't be negative"); + out->bitmap[i] = temp_i; + } + } + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x02, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_size = parse_uint32_hex_key(module, &ctx, "hash_size", 0x20, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 96, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} + +static void dump_partition_info_ext(const struct partition_info_ext *part_info) +{ + int i; + + DUMP("\npartition_info"); + DUMP_KEY("name", "'%s'", part_info->name); + DUMP_KEY("part_version", "0x%x", part_info->part_version); + DUMP_KEY("instance_id", "%d", part_info->instance_id); + for (i = 0; i < ARRAY_SIZE(part_info->module); ++i) { + DUMP_KEY("module.name", "'%s'", part_info->module[i].name); + DUMP_KEY("module.meta_size", "0x%x", part_info->module[i].meta_size); + DUMP_KEY("module.type", "0x%x", part_info->module[i].type); + } +} + +static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx *pctx, + struct partition_info_ext *out, bool verbose) +{ + static const uint8_t module_reserved[3] = {0x00, 0xff, 0xff}; + struct partition_info_module *mod; + toml_table_t *partition_info; + toml_array_t *module_array; + toml_table_t *module; + struct parse_ctx ctx; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + partition_info = toml_table_in(toml, "partition_info"); + if (!partition_info) + return err_key_not_found("partition_info"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = PART_INFO_EXT_TYPE; + out->ext_len = sizeof(struct partition_info_ext); + memset(out->reserved, 0xff, sizeof(out->reserved)); + + /* configurable fields */ + parse_str_key(partition_info, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(partition_info, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->part_version = + parse_uint32_hex_key(partition_info, &ctx, "part_version", 0x10000000, &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_hex_key(partition_info, &ctx, "part_version", 0x10000000, &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_hex_key(partition_info, &ctx, "fmt_version", 0, &ret); + if (ret < 0) + return ret; + + out->instance_id = parse_uint32_key(partition_info, &ctx, "instance_id", 1, &ret); + if (ret < 0) + return ret; + + out->part_flags = parse_uint32_key(partition_info, &ctx, "part_flags", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(partition_info, &ctx); + if (ret < 0) + return ret; + + /* look for module array */ + module_array = toml_array_in(partition_info, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) > ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length > %d", + ARRAY_SIZE(out->module)); + + /* parse module array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(mod->reserved, module_reserved, sizeof(mod->reserved)); + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 96, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_partition_info_ext(out); + + /* + * values set in other places in code: + * - length + * - hash + * - module.hash + */ + + return 0; +} + +static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) +{ + int i; + + DUMP("\nadsp_file_ext"); + DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); + for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { + DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); + DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + } +} + +static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_adsp_meta_file_ext_v1_8 *out, bool verbose) +{ + struct sof_man_component_desc_v1_8 *desc; + toml_table_t *adsp_file_ext; + toml_array_t *comp_array; + struct parse_ctx ctx; + toml_table_t *comp; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp_file_ext = toml_table_in(toml, "adsp_file"); + if (!adsp_file_ext) + return err_key_not_found("adsp_file"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non configurable flieds */ + out->ext_type = 17; /* always 17 for ADSP extension */ + out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8); + + /* configurable fields */ + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp_file_ext, &ctx); + if (ret < 0) + return ret; + + /* parse comp array */ + comp_array = toml_array_in(adsp_file_ext, "comp"); + if (!comp_array) + return err_key_not_found("comp"); + if (toml_array_nelem(comp_array) != 1 || toml_array_kind(comp_array) != 't') + return err_key_parse("comp", "wrong array type or length != 1"); + + /* parse comp array elements */ + for (i = 0; i < toml_array_nelem(comp_array); ++i) { + comp = toml_table_at(comp_array, i); + if (!comp) + return err_key_parse("comp", NULL); + desc = &out->comp_desc[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + desc->limit_offset = 0; + + /* configurable fields */ + desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + desc->base_offset = parse_uint32_hex_key(comp, &ctx, "base_offset", + MAN_DESC_OFFSET_V1_8, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(comp, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp_file_ext_v1_8(out); + + /* + * values set in other places in code: + * - imr_type + * - comp.limit_offset + */ + + return 0; +} + +static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 *adsp_file) +{ + int i; + + DUMP("\nadsp_file"); + DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); + for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { + DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); + DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + } +} + +static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_adsp_meta_file_ext_v2_5 *out, bool verbose) +{ + struct sof_man_component_desc_v2_5 *desc; + toml_table_t *adsp_file_ext; + toml_array_t *comp_array; + struct parse_ctx ctx; + toml_table_t *comp; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp_file_ext = toml_table_in(toml, "adsp_file"); + if (!adsp_file_ext) + return err_key_not_found("adsp_file"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non configurable flieds */ + out->ext_type = 17; /* always 17 for ADSP extension */ + out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5); + + /* configurable fields */ + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp_file_ext, &ctx); + if (ret < 0) + return ret; + + /* parse comp array */ + comp_array = toml_array_in(adsp_file_ext, "comp"); + if (!comp_array) + return err_key_not_found("comp"); + if (toml_array_nelem(comp_array) != 1 || toml_array_kind(comp_array) != 't') + return err_key_parse("comp", "wrong array type or length != 1"); + + /* parse comp array elements */ + for (i = 0; i < toml_array_nelem(comp_array); ++i) { + comp = toml_table_at(comp_array, i); + if (!comp) + return err_key_parse("comp", NULL); + desc = &out->comp_desc[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non configurable flieds */ + desc->limit_offset = 0; + + /* configurable fields */ + desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + desc->base_offset = parse_uint32_hex_key(comp, &ctx, "base_offset", 0x2000, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(comp, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp_file_ext_v2_5(out); + + /* + * values set in other places in code: + * - imr_type + * - comp.limit_offset + */ + + return 0; +} + +static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) +{ + DUMP("\nfw_desc.header"); + DUMP_KEY("header_id", "'%c%c%c%c'", fw_desc->header.header_id[0], + fw_desc->header.header_id[1], fw_desc->header.header_id[2], + fw_desc->header.header_id[3]); + DUMP_KEY("name", "'%s'", fw_desc->header.name); + DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); + DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); + DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); + DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.hw_buf_base_addr); + DUMP_KEY("hw_buf_length", "0x%x", fw_desc->header.hw_buf_length); + DUMP_KEY("load_offset", "0x%x", fw_desc->header.load_offset); +} + +static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_fw_desc *out, bool verbose) +{ + static const uint8_t header_id[4] = SOF_MAN_FW_HDR_ID; + struct parse_ctx ctx; + toml_table_t *header; + toml_table_t *desc; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + desc = toml_table_in(toml, "fw_desc"); + if (!desc) + return err_key_not_found("fw_desc"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + header = toml_table_in(desc, "header"); + if (!header) + return err_key_not_found("header"); + ++ctx.table_cnt; + + /* check everything parsed */ + ret = assert_everything_parsed(desc, &ctx); + if (ret < 0) + return ret; + + /* initialize parser context for header subtable */ + parse_ctx_init(&ctx); + + /* non configurable flieds */ + memcpy(&out->header.header_id, header_id, sizeof(header_id)); + out->header.header_len = sizeof(struct sof_man_fw_header); + + /* configurable fields */ + parse_str_key(header, &ctx, "name", (char *)out->header.name, SOF_MAN_FW_HDR_FW_NAME_LEN, + &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.preload_page_count = + parse_uint32_key(header, &ctx, "preload_page_count", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.fw_image_flags = + parse_uint32_hex_key(header, &ctx, "fw_image_flags", SOF_MAN_FW_HDR_FLAGS, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.feature_mask = + parse_uint32_hex_key(header, &ctx, "feature_mask", SOF_MAN_FW_HDR_FEATURES, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.hw_buf_base_addr = + parse_uint32_hex_key(header, &ctx, "hw_buf_base_addr", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.hw_buf_length = parse_uint32_hex_key(header, &ctx, "hw_buf_length", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.load_offset = parse_uint32_hex_key(header, &ctx, "load_offset", -1, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(header, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_fw_desc(out); + + /* + * values set in other places in code: + * - major_version + * - minor_version + * - build_version + * - num_module_entries + */ + + return 0; +} + +static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each adsp subtable, sue platform has different manifest definition */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + /* assign correct write functions */ + out->write_firmware = simple_write_firmware; + out->write_firmware_meu = NULL; + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each adsp subtable, sue platform has different manifest definition */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + if (out->machine_id == MACHINE_SUECREEK) { + /* out free is done in client code */ + out->man_v1_5_sue = malloc(sizeof(struct fw_image_manifest_v1_5_sue)); + if (!out->man_v1_5_sue) + return err_malloc("man_v1_5_sue"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_v1_5_sue; + out->write_firmware_meu = man_write_fw_meu_v1_5; + + /* parse others sibtables */ + ret = parse_fw_desc(toml, &ctx, &out->man_v1_5_sue->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + } else { + /* out free is done in client code */ + out->man_v1_5 = malloc(sizeof(struct fw_image_manifest_v1_5)); + if (!out->man_v1_5) + return err_malloc("man_v1_5"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_meu_v1_5; + out->write_firmware_meu = man_write_fw_meu_v1_5; + + /* parse others sibtables */ + ret = parse_css_v1_5(toml, &ctx, &out->man_v1_5->css_header, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v1_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + } + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* out free is done in client code */ + out->man_v1_8 = malloc(sizeof(struct fw_image_manifest_v1_8)); + if (!out->man_v1_8) + return err_malloc("man_v1_8"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_v1_8; + out->write_firmware_meu = man_write_fw_meu_v1_8; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse(toml, &ctx, &out->man_v1_8->cse_partition_dir_header, + out->man_v1_8->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v1_8(toml, &ctx, &out->man_v1_8->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg(toml, &ctx, &out->man_v1_8->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_partition_info_ext(toml, &ctx, &out->man_v1_8->partition_info, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v1_8(toml, &ctx, &out->man_v1_8->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v1_8->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* out free is done in client code */ + out->man_v2_5 = malloc(sizeof(struct fw_image_manifest_v2_5)); + if (!out->man_v2_5) + return err_malloc("man_v2_5"); + + /* assign correct write functions */ + out->write_firmware = NULL; + out->write_firmware_meu = man_write_fw_meu_v2_5; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, + out->man_v2_5->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v1_8(toml, &ctx, &out->man_v2_5->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_partition_info_ext(toml, &ctx, &out->man_v2_5->partition_info, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v2_5(toml, &ctx, &out->man_v2_5->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v2_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static inline bool check_config_version(int major, int minor, const int64_t *version) +{ + return version[0] == major && version[1] == minor; +} + +static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) +{ + int64_t manifest_version[2]; + toml_table_t *toml; + toml_array_t *arr; + toml_raw_t raw; + char errbuf[256]; + int ret; + int i; + + /* whole toml file is parsed to global toml table at once */ + toml = toml_parse_file(fd, errbuf, ARRAY_SIZE(errbuf)); + if (!toml) + return log_err(-EINVAL, "error: toml file parsing, %s\n", errbuf); + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') { + ret = err_key_parse("version", "wrong array type or length != 2"); + goto error; + } + + /* parse "version" array elements */ + for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { + raw = toml_raw_at(arr, i); + if (ret < 0) + ret = err_key_parse("version", NULL); + ret = toml_rtoi(raw, &manifest_version[i]); + if (ret < 0) + ret = err_key_parse("version", "can't convert element to integer"); + } + + /* parsing function depends on manifest_version */ + if (check_config_version(1, 0, manifest_version)) { + ret = parse_adsp_config_v1_0(toml, out, verbose); + } else if (check_config_version(1, 5, manifest_version)) { + ret = parse_adsp_config_v1_5(toml, out, verbose); + } else if (check_config_version(1, 8, manifest_version)) { + ret = parse_adsp_config_v1_8(toml, out, verbose); + } else if (check_config_version(2, 5, manifest_version)) { + ret = parse_adsp_config_v2_5(toml, out, verbose); + } else { + ret = log_err(-EINVAL, "error: Unsupported config version %d.%d\n", + manifest_version[0], manifest_version[1]); + goto error; + } + +error: + toml_free(toml); + return ret; +} + +/* public function, fully handle parsing process */ +int adsp_parse_config(const char *file, struct adsp *out, bool verbose) +{ + FILE *fd; + int ret; + + fd = fopen(file, "r"); + if (!fd) + return log_err(-EIO, "error: can't open '%s' file\n", file); + ret = adsp_parse_config_fd(fd, out, verbose); + fclose(fd); + return ret; +} + +/* free given pointer and internally allocated memory */ +void adsp_free(struct adsp *adsp) +{ + if (!adsp) + return; + + if (adsp->man_v1_5) + free(adsp->man_v1_5); + + if (adsp->man_v1_5_sue) + free(adsp->man_v1_5_sue); + + if (adsp->man_v1_8) + free(adsp->man_v1_8); + + if (adsp->man_v2_5) + free(adsp->man_v2_5); + + if (adsp->name) + free((char *)adsp->name); + + free(adsp); +} diff --git a/src/include/rimage/adsp_config.h b/src/include/rimage/adsp_config.h new file mode 100644 index 000000000000..8b98c1cb7087 --- /dev/null +++ b/src/include/rimage/adsp_config.h @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2020 Intel Corporation. All rights reserved. + +#include +#include + +int adsp_parse_config(const char *file, struct adsp *out, bool verbose); +void adsp_free(struct adsp *adsp); diff --git a/src/rimage.c b/src/rimage.c index f3723fe05654..326994b8b28a 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,7 +8,9 @@ #include #include #include +#include +#include #include #include #include @@ -16,7 +18,7 @@ static void usage(char *name) { - fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", + fprintf(stdout, "%s:\t -c adsp_desc -o outfile -k [key] ELF files\n", name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); @@ -29,6 +31,7 @@ static void usage(char *name) exit(0); } +/* deprecated, use ads_config instead for new machines */ static const struct adsp *find_adsp(const char *mach) { static const struct adsp *machine[] = { @@ -66,16 +69,19 @@ static const struct adsp *find_adsp(const char *mach) int main(int argc, char *argv[]) { struct image image; + struct adsp *heap_adsp; const char *mach = NULL; + const char *adsp_config = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; + bool free_adsp_config = false; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:e")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -113,6 +119,9 @@ int main(int argc, char *argv[]) case 'e': use_ext_man = 1; break; + case 'c': + adsp_config = optarg; + break; case 'h': usage(argv[0]); break; @@ -124,7 +133,7 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (!image.out_file || !mach) + if (!image.out_file || (!mach && !adsp_config)) usage(argv[0]); /* requires private key */ @@ -156,10 +165,26 @@ int main(int argc, char *argv[]) return -EINVAL; } } - - image.adsp = find_adsp(mach); - if (!image.adsp) + /* find machine */ + if (adsp_config) { + heap_adsp = malloc(sizeof(struct adsp)); + if (!heap_adsp) { + fprintf(stderr, "error: cannot parse build version\n"); + return -ENOMEM; + } + free_adsp_config = true; + image.adsp = heap_adsp; + ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + if (ret < 0) + goto out; + } else if (mach) { + image.adsp = find_adsp(mach); + if (!image.adsp) + return -EINVAL; + } else { + fprintf(stderr, "error: Specify target machine\n"); return -EINVAL; + } /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) @@ -214,6 +239,10 @@ int main(int argc, char *argv[]) } out: + /* free memory */ + if (free_adsp_config) + adsp_free(heap_adsp); + /* close files */ if (image.out_fd) fclose(image.out_fd); From a94e12d7d65371a008ac269d473f371a08a80944 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 16 Sep 2020 12:34:46 +0200 Subject: [PATCH 133/350] toml: Add platform configuration files Given config files may be used as template for new platforms. Signed-off-by: Karol Trzcinski --- config/apl.toml | 50 +++++++++++++++++++++++++++++++++++++++++++ config/bdw.toml | 16 ++++++++++++++ config/bsw.toml | 16 ++++++++++++++ config/byt.toml | 16 ++++++++++++++ config/cht.toml | 16 ++++++++++++++ config/cnl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/hsw.toml | 16 ++++++++++++++ config/icl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/imx8.toml | 21 ++++++++++++++++++ config/imx8m.toml | 21 ++++++++++++++++++ config/imx8x.toml | 21 ++++++++++++++++++ config/jsl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/kbl.toml | 23 ++++++++++++++++++++ config/skl.toml | 23 ++++++++++++++++++++ config/sue.toml | 24 +++++++++++++++++++++ config/tgl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 16 files changed, 479 insertions(+) create mode 100644 config/apl.toml create mode 100644 config/bdw.toml create mode 100644 config/bsw.toml create mode 100644 config/byt.toml create mode 100644 config/cht.toml create mode 100644 config/cnl.toml create mode 100644 config/hsw.toml create mode 100644 config/icl.toml create mode 100644 config/imx8.toml create mode 100644 config/imx8m.toml create mode 100644 config/imx8x.toml create mode 100644 config/jsl.toml create mode 100644 config/kbl.toml create mode 100644 config/skl.toml create mode 100644 config/sue.toml create mode 100644 config/tgl.toml diff --git a/config/apl.toml b/config/apl.toml new file mode 100644 index 000000000000..869b95900ccb --- /dev/null +++ b/config/apl.toml @@ -0,0 +1,50 @@ +version = [1, 8] + +[adsp] +name = "apl" +machine_id = 5 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x2000" diff --git a/config/bdw.toml b/config/bdw.toml new file mode 100644 index 000000000000..6cc2402a198b --- /dev/null +++ b/config/bdw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "bdw" +machine_id = 4 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0" +size = "0x50000" +host_offset = "0x000A0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x00400000" +size = "0xA0000" +host_offset = "0x0" diff --git a/config/bsw.toml b/config/bsw.toml new file mode 100644 index 000000000000..77f2e5c3987f --- /dev/null +++ b/config/bsw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "bsw" +machine_id = 2 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/byt.toml b/config/byt.toml new file mode 100644 index 000000000000..8c2f27851d3e --- /dev/null +++ b/config/byt.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "byt" +machine_id = 0 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/cht.toml b/config/cht.toml new file mode 100644 index 000000000000..7cc9142716fe --- /dev/null +++ b/config/cht.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "cht" +machine_id = 1 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/cnl.toml b/config/cnl.toml new file mode 100644 index 000000000000..6a3de265318c --- /dev/null +++ b/config/cnl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "cnl" +machine_id = 8 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/hsw.toml b/config/hsw.toml new file mode 100644 index 000000000000..df5e5cec189f --- /dev/null +++ b/config/hsw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "hsw" +machine_id = 3 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0" +size = "0x60000" +host_offset = "0x80000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x00400000" +size = "0x80000" +host_offset = "0x0" diff --git a/config/icl.toml b/config/icl.toml new file mode 100644 index 000000000000..2e2e61799544 --- /dev/null +++ b/config/icl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "icl" +machine_id = 9 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/imx8.toml b/config/imx8.toml new file mode 100644 index 000000000000..69207806c8df --- /dev/null +++ b/config/imx8.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8" +machine_id = 12 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x596F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x596E8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/imx8m.toml b/config/imx8m.toml new file mode 100644 index 000000000000..5630d94d1bea --- /dev/null +++ b/config/imx8m.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8m" +machine_id = 14 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x3b6F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x3B6E8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/imx8x.toml b/config/imx8x.toml new file mode 100644 index 000000000000..eb4d579103db --- /dev/null +++ b/config/imx8x.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8x" +machine_id = 13 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x596F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x596e8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/jsl.toml b/config/jsl.toml new file mode 100644 index 000000000000..0bcb2666b080 --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "jsl" +machine_id = 9 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/kbl.toml b/config/kbl.toml new file mode 100644 index 000000000000..ac82149fdf1f --- /dev/null +++ b/config/kbl.toml @@ -0,0 +1,23 @@ +version = [1, 5] + +[adsp] +name = "kbl" +machine_id = 6 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[css] + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0" +hw_buf_base_addr = "0xBE500000" +hw_buf_length = "0x4A000" diff --git a/config/skl.toml b/config/skl.toml new file mode 100644 index 000000000000..f304a1849490 --- /dev/null +++ b/config/skl.toml @@ -0,0 +1,23 @@ +version = [1, 5] + +[adsp] +name = "skl" +machine_id = 7 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[css] + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0" +hw_buf_base_addr = "0xBE500000" +hw_buf_length = "0x4A000" diff --git a/config/sue.toml b/config/sue.toml new file mode 100644 index 000000000000..d326d0ae7a8e --- /dev/null +++ b/config/sue.toml @@ -0,0 +1,24 @@ +version = [1, 5] + +[adsp] +name = "sue" +machine_id = 11 +image_size = "0x100000" +exec_boot_ldr = 1 + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xb0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xbe000000" +size = "0x100000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x2000" diff --git a/config/tgl.toml b/config/tgl.toml new file mode 100644 index 000000000000..dc5c760ed802 --- /dev/null +++ b/config/tgl.toml @@ -0,0 +1,54 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x490" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From 29659081359ff305979b406c7290f800e1ea1231 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 16 Sep 2020 13:49:51 +0200 Subject: [PATCH 134/350] manifest: Remove -m option Used platform should be defined by config file, given in -c option. Double ways of defining platform may lead to missalignement, so old way should be removed. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 5 -- src/man_apl.c | 126 ----------------------------- src/man_cnl.c | 125 ----------------------------- src/man_kbl.c | 49 ----------- src/man_sue.c | 27 ------- src/man_tgl.c | 125 ----------------------------- src/manifest.c | 214 ------------------------------------------------- src/rimage.c | 73 +++-------------- 8 files changed, 11 insertions(+), 733 deletions(-) delete mode 100644 src/man_apl.c delete mode 100644 src/man_cnl.c delete mode 100644 src/man_kbl.c delete mode 100644 src/man_sue.c delete mode 100644 src/man_tgl.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 078fa8d9e3ed..b09760007629 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,6 @@ endif() add_executable(rimage src/file_simple.c - src/man_apl.c - src/man_cnl.c - src/man_kbl.c - src/man_sue.c - src/man_tgl.c src/cse.c src/css.c src/plat_auth.c diff --git a/src/man_apl.c b/src/man_apl.c deleted file mode 100644 index 616084b5f673..000000000000 --- a/src/man_apl.c +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_8 apl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .checksum = 0, - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V1_8, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = MAN_DESC_OFFSET_V1_8, - }, - }, -}; diff --git a/src/man_cnl.c b/src/man_cnl.c deleted file mode 100644 index cf51089d30a5..000000000000 --- a/src/man_cnl.c +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_8 cnl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V1_8, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x30000, - }, - }, -}; diff --git a/src/man_kbl.c b/src/man_kbl.c deleted file mode 100644 index 9634e01a8167..000000000000 --- a/src/man_kbl.c +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2018 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* - * TODO: check if all platform for 1.5 are the same base and length. - * if yes, define it as HARDWARE_BUFFER_BASE_V1_5, HARDWARE_BUFFER_LEN_v1_5 - * if not, define a platform specific base and length. - */ -#define KBL_HARDWARE_BUFFER_BASE 0xBE500000 -#define KBL_HARDWARE_BUFFER_LEN 0x4A000 - -/* manifest template */ -struct fw_image_manifest_v1_5 kbl_manifest = { - .css_header = { - .module_type = MAN_CSS_LT_MODULE_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 0x800, - .key_size = MAN_CSS_KEY_SIZE, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - /* size in pages from $CPD */ - .preload_page_count = 0, - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0, - .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, - .hw_buf_length = KBL_HARDWARE_BUFFER_LEN - }, - }, -}; diff --git a/src/man_sue.c b/src/man_sue.c deleted file mode 100644 index 8c7df5a29b91..000000000000 --- a/src/man_sue.c +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_5_sue sue_manifest = { - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x2000, - }, - }, -}; diff --git a/src/man_tgl.c b/src/man_tgl.c deleted file mode 100644 index 97ee4ed08d10..000000000000 --- a/src/man_tgl.c +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2019 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v2_5 tgl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V2_5, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x30000, - }, - }, -}; diff --git a/src/manifest.c b/src/manifest.c index 1c9a2a043119..d76c394154cc 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1185,217 +1185,3 @@ int man_write_fw_meu_v2_5(struct image *image) unlink(image->out_file); return ret; } - -#define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_APL_DSP_ROM_SIZE 0x00002000 -#define APL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_KBL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_KBL_DSP_ROM_SIZE 0x00002000 -#define KBL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_SKL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_SKL_DSP_ROM_SIZE 0x00002000 -#define SKL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_CNL_DSP_ROM_SIZE 0x00002000 -#define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define CNL_DSP_HP_BASE_ENTRY 0xbe040000 - -#define ADSP_SUE_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_SUE_DSP_ROM_SIZE 0x00002000 -#define SUE_DSP_IMR_BASE_ENTRY 0xb0038000 -#define SUE_DSP_HP_BASE_ENTRY 0xbe000000 - -#define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_ICL_DSP_ROM_SIZE 0x00002000 -#define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define ICL_DSP_HP_BASE_ENTRY 0xbe040000 - -#define ADSP_TGL_DSP_ROM_BASE 0x9F180000 -#define ADSP_TGL_DSP_ROM_SIZE 0x00002000 -#define TGL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define TGL_DSP_HP_BASE_ENTRY 0xbe040000 - -/* list of supported adsp */ -const struct adsp machine_apl = { - .name = "apl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_APL_DSP_ROM_BASE, - .size = ADSP_APL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = APL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_APOLLOLAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &apl_manifest, -}; - -const struct adsp machine_kbl = { - .name = "kbl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_KBL_DSP_ROM_BASE, - .size = ADSP_KBL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = KBL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_KABYLAKE, - .write_firmware = man_write_fw_v1_5, - .write_firmware_meu = man_write_fw_meu_v1_5, - .man_v1_5 = &kbl_manifest, -}; - -const struct adsp machine_skl = { - .name = "skl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_SKL_DSP_ROM_BASE, - .size = ADSP_SKL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = SKL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_SKYLAKE, - .write_firmware = man_write_fw_v1_5, - .write_firmware_meu = man_write_fw_meu_v1_5, - .man_v1_5 = &kbl_manifest, -}; - -const struct adsp machine_cnl = { - .name = "cnl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_CNL_DSP_ROM_BASE, - .size = ADSP_CNL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = CNL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = CNL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_CANNONLAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, -}; - -const struct adsp machine_icl = { - .name = "icl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_ICL_DSP_ROM_BASE, - .size = ADSP_ICL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = ICL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = ICL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, // use the same as CNL -}; - -const struct adsp machine_jsl = { - .name = "jsl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_ICL_DSP_ROM_BASE, - .size = ADSP_ICL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = ICL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = ICL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, // use the same as CNL -}; - -const struct adsp machine_tgl = { - .name = "tgl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_TGL_DSP_ROM_BASE, - .size = ADSP_TGL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = TGL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = TGL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_TIGERLAKE, - .write_firmware = NULL, /* not yet implemented */ - .write_firmware_meu = man_write_fw_meu_v2_5, - .man_v2_5 = &tgl_manifest, -}; - -const struct adsp machine_sue = { - .name = "sue", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_SUE_DSP_ROM_BASE, - .size = ADSP_SUE_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = SUE_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = SUE_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw_v1_5_sue, - .write_firmware_meu = man_write_fw_v1_5_sue, - .man_v1_5_sue = &sue_manifest, - .exec_boot_ldr = 1, -}; diff --git a/src/rimage.c b/src/rimage.c index 326994b8b28a..f021d3a5e6ba 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -31,64 +31,24 @@ static void usage(char *name) exit(0); } -/* deprecated, use ads_config instead for new machines */ -static const struct adsp *find_adsp(const char *mach) -{ - static const struct adsp *machine[] = { - &machine_byt, - &machine_cht, - &machine_bsw, - &machine_hsw, - &machine_bdw, - &machine_apl, - &machine_cnl, - &machine_icl, - &machine_jsl, - &machine_tgl, - &machine_sue, - &machine_kbl, - &machine_skl, - &machine_imx8, - &machine_imx8x, - &machine_imx8m, - }; - int i; - - for (i = 0; i < ARRAY_SIZE(machine); i++) { - if (!strcmp(mach, machine[i]->name)) - return machine[i]; - } - fprintf(stderr, "error: machine %s not found\n", mach); - fprintf(stderr, "error: available machines "); - for (i = 0; i < ARRAY_SIZE(machine); i++) - fprintf(stderr, "%s, ", machine[i]->name); - fprintf(stderr, "\n"); - return NULL; -} - int main(int argc, char *argv[]) { struct image image; struct adsp *heap_adsp; - const char *mach = NULL; const char *adsp_config = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; - bool free_adsp_config = false; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:l:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; - case 'm': - mach = optarg; - break; case 'v': image.verbose = 1; break; @@ -133,7 +93,7 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (!image.out_file || (!mach && !adsp_config)) + if (!image.out_file || !adsp_config) usage(argv[0]); /* requires private key */ @@ -166,25 +126,15 @@ int main(int argc, char *argv[]) } } /* find machine */ - if (adsp_config) { - heap_adsp = malloc(sizeof(struct adsp)); - if (!heap_adsp) { - fprintf(stderr, "error: cannot parse build version\n"); - return -ENOMEM; - } - free_adsp_config = true; - image.adsp = heap_adsp; - ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); - if (ret < 0) - goto out; - } else if (mach) { - image.adsp = find_adsp(mach); - if (!image.adsp) - return -EINVAL; - } else { - fprintf(stderr, "error: Specify target machine\n"); - return -EINVAL; + heap_adsp = malloc(sizeof(struct adsp)); + if (!heap_adsp) { + fprintf(stderr, "error: cannot parse build version\n"); + return -ENOMEM; } + image.adsp = heap_adsp; + ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + if (ret < 0) + goto out; /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) @@ -240,8 +190,7 @@ int main(int argc, char *argv[]) out: /* free memory */ - if (free_adsp_config) - adsp_free(heap_adsp); + adsp_free(heap_adsp); /* close files */ if (image.out_fd) From dab973039c36d714b69da37a5e30d198e5e0f1ab Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 11:32:42 +0200 Subject: [PATCH 135/350] toml: Add version information in verbose mode It allows to assure right version of chosen headers during reading logs in verbose mode. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index dc0b91c931c2..54a1548f8e02 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -532,7 +532,7 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, static void dump_css_v1_5(const struct css_header_v1_5 *css) { - DUMP("\ncss"); + DUMP("\ncss 1.5"); DUMP_KEY("module_type", "%d", css->module_type); DUMP_KEY("header_len", "%d", css->header_len); DUMP_KEY("header_version", "0x%x", css->header_version); @@ -617,7 +617,7 @@ static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, static void dump_css_v1_8(const struct css_header_v1_8 *css) { - DUMP("\ncss"); + DUMP("\ncss 1.8"); DUMP_KEY("header_type", "%d", css->header_type); DUMP_KEY("header_len", "%d", css->header_len); DUMP_KEY("header_version", "0x%x", css->header_version); @@ -994,7 +994,7 @@ static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 { int i; - DUMP("\nadsp_file_ext"); + DUMP("\nadsp_file_ext 1.8"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); @@ -1087,7 +1087,7 @@ static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 { int i; - DUMP("\nadsp_file"); + DUMP("\nadsp_file 2.5"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); From 3169dbd40da9d1e06f8f78cd6c653aebe846222d Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 12:05:02 +0200 Subject: [PATCH 136/350] toml: Add adsp_file_ext attributes parsing This field left without possibility to set value from config file. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index 54a1548f8e02..c0c919a229bc 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -993,12 +993,15 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) { int i; + int j; DUMP("\nadsp_file_ext 1.8"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + for (j = 0; j < ARRAY_SIZE(adsp_file->comp_desc->attributes); ++j) + DUMP_KEY("comp.atributes[]", "%d", adsp_file->comp_desc[i].attributes[j]); } } @@ -1006,12 +1009,16 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * struct sof_man_adsp_meta_file_ext_v1_8 *out, bool verbose) { struct sof_man_component_desc_v1_8 *desc; + toml_array_t *attributes_array; toml_table_t *adsp_file_ext; toml_array_t *comp_array; struct parse_ctx ctx; + toml_raw_t attribute; toml_table_t *comp; + int64_t temp_i; int ret; int i; + int j; /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ adsp_file_ext = toml_table_in(toml, "adsp_file"); @@ -1065,6 +1072,27 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * if (ret < 0) return err_key_parse("comp", NULL); + /* parse attributes array */ + attributes_array = toml_array_in(comp, "attributes"); + if (attributes_array) { + ++ctx.array_cnt; + if (toml_array_nelem(attributes_array) > ARRAY_SIZE(desc->attributes) || + toml_array_kind(attributes_array) != 'v' || + toml_array_type(attributes_array) != 'i') + return err_key_parse("comp.attributes", + "wrong array type or length > %d", + ARRAY_SIZE(desc->attributes)); + for (j = 0; j < toml_array_nelem(attributes_array); ++j) { + attribute = toml_raw_at(attributes_array, j); + if (!attribute) + err_key_parse("comp.attributes", NULL); + ret = toml_rtoi(attribute, &temp_i); + if (ret < 0 || temp_i < 0 || temp_i > UINT32_MAX) + err_key_parse("comp.attributes", NULL); + desc->attributes[j] = (uint32_t)temp_i; + } + } + /* check everything parsed */ ret = assert_everything_parsed(comp, &ctx); if (ret < 0) @@ -1086,12 +1114,15 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 *adsp_file) { int i; + int j; DUMP("\nadsp_file 2.5"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + for (j = 0; j < ARRAY_SIZE(adsp_file->comp_desc->attributes); ++j) + DUMP_KEY("comp.atributes[]", "%d", adsp_file->comp_desc[i].attributes[j]); } } @@ -1099,12 +1130,16 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * struct sof_man_adsp_meta_file_ext_v2_5 *out, bool verbose) { struct sof_man_component_desc_v2_5 *desc; + toml_array_t *attributes_array; toml_table_t *adsp_file_ext; toml_array_t *comp_array; struct parse_ctx ctx; + toml_raw_t attribute; toml_table_t *comp; + int64_t temp_i; int ret; int i; + int j; /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ adsp_file_ext = toml_table_in(toml, "adsp_file"); @@ -1157,6 +1192,27 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * if (ret < 0) return err_key_parse("comp", NULL); + /* parse attributes array */ + attributes_array = toml_array_in(comp, "attributes"); + if (attributes_array) { + ++ctx.array_cnt; + if (toml_array_nelem(attributes_array) > ARRAY_SIZE(desc->attributes) || + toml_array_kind(attributes_array) != 'v' || + toml_array_type(attributes_array) != 'i') + return err_key_parse("comp.attributes", + "wrong array type or length > %d", + ARRAY_SIZE(desc->attributes)); + for (j = 0; j < toml_array_nelem(attributes_array); ++j) { + attribute = toml_raw_at(attributes_array, j); + if (!attribute) + err_key_parse("comp.attributes", NULL); + ret = toml_rtoi(attribute, &temp_i); + if (ret < 0 || temp_i < 0 || temp_i > UINT32_MAX) + err_key_parse("comp.attributes", NULL); + desc->attributes[j] = (uint32_t)temp_i; + } + } + /* check everything parsed */ ret = assert_everything_parsed(comp, &ctx); if (ret < 0) From d3ead755c9f35c790cf6d780f89ac3661b4e1b22 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 11:23:00 +0200 Subject: [PATCH 137/350] toml: manifest: Clear manifest allocated on heap before use Memory clear allows to easily set seserved/padding fields to zero. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 22 ++++++++++++---------- src/rimage.c | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c0c919a229bc..02f0b2bd43dc 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -495,7 +495,6 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, parse_ctx_init(&ctx); /* non-configurable fields */ - out[i].reserved = 0; /* configurable fields */ parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, @@ -558,8 +557,6 @@ static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, parse_ctx_init(&ctx); /* non-configurable fields */ - out->reserved0 = 0; - memset(out->reserved, 0, sizeof(out->reserved)); /* configurable fields */ out->module_type = parse_uint32_key(css, &ctx, "module_type", MAN_CSS_LT_MODULE_TYPE, &ret); @@ -645,9 +642,6 @@ static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ memcpy(out->header_id, hdr_id, sizeof(out->header_id)); - out->padding = 0; - out->reserved0 = 0; - memset(out->reserved1, 0xff, sizeof(out->reserved1)); /* configurable fields */ out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); @@ -748,7 +742,6 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ out->ext_type = SIGN_PKG_EXT_TYPE; out->ext_len = sizeof(struct signed_pkg_info_ext); - memset(out->reserved, 0, sizeof(out->reserved)); /* configurable fields */ parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); @@ -775,7 +768,6 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { /* default value */ - memset(out->bitmap, 0, sizeof(out->bitmap)); out->bitmap[4] = 8; } else { ++ctx.array_cnt; @@ -1060,7 +1052,6 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * parse_ctx_init(&ctx); /* non-configurable fields */ - desc->limit_offset = 0; /* configurable fields */ desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); @@ -1181,7 +1172,6 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * parse_ctx_init(&ctx); /* non configurable flieds */ - desc->limit_offset = 0; /* configurable fields */ desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); @@ -1380,6 +1370,9 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_5_sue) return err_malloc("man_v1_5_sue"); + /* clear memory */ + memset(out->man_v1_5_sue, 0, sizeof(*out->man_v1_5_sue)); + /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5_sue; out->write_firmware_meu = man_write_fw_meu_v1_5; @@ -1394,6 +1387,9 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_5) return err_malloc("man_v1_5"); + /* clear memory */ + memset(out->man_v1_5, 0, sizeof(*out->man_v1_5)); + /* assign correct write functions */ out->write_firmware = man_write_fw_meu_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; @@ -1427,6 +1423,9 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_8) return err_malloc("man_v1_8"); + /* clear memory */ + memset(out->man_v1_8, 0, sizeof(*out->man_v1_8)); + /* assign correct write functions */ out->write_firmware = man_write_fw_v1_8; out->write_firmware_meu = man_write_fw_meu_v1_8; @@ -1484,6 +1483,9 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v2_5) return err_malloc("man_v2_5"); + /* clear memory */ + memset(out->man_v2_5, 0, sizeof(*out->man_v2_5)); + /* assign correct write functions */ out->write_firmware = NULL; out->write_firmware_meu = man_write_fw_meu_v2_5; diff --git a/src/rimage.c b/src/rimage.c index f021d3a5e6ba..cd3d63b09f2e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -132,6 +132,7 @@ int main(int argc, char *argv[]) return -ENOMEM; } image.adsp = heap_adsp; + memset(heap_adsp, 0, sizeof(*heap_adsp)); ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); if (ret < 0) goto out; From e9759df946f6f0352431d53aa9d990b98e1988bf Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 23:23:32 +0200 Subject: [PATCH 138/350] toml: Fix adsp v1.5 parsing Set right write function. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 02f0b2bd43dc..559767584181 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1391,7 +1391,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, memset(out->man_v1_5, 0, sizeof(*out->man_v1_5)); /* assign correct write functions */ - out->write_firmware = man_write_fw_meu_v1_5; + out->write_firmware = man_write_fw_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; /* parse others sibtables */ From 6dcf1b6ae8eb99e545eaf367528243136f95028e Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 10:52:08 +0200 Subject: [PATCH 139/350] toml: Use only standard error codes Error codes like ENOKEY and EBADE are not provide for all windows toolchains, so to immit possible build errors, some more standard error codes should be used. Detailed error message is printed in stderr, so end user still will be well informed about error source. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 559767584181..a6043834b669 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -57,13 +57,13 @@ static int err_malloc(const char *key) /** log key not found error */ static int err_key_not_found(const char *key) { - return log_err(-ENOKEY, "error: '%s' not found\n", key); + return log_err(-EINVAL, "error: '%s' not found\n", key); } /** error during parsing key value, possible detailed message */ static int err_key_parse(const char *key, const char *extra_msg, ...) { - int ret = -EBADE; + int ret = -EINVAL; va_list vl; if (extra_msg) { From 3b2398a97d731333e78dbf50cf5d68dd799900ac Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 16:15:00 +0200 Subject: [PATCH 140/350] travis: Add more warnings to make command Warnings may point some fatal error in source code. Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 28a7376b0af0..fcf01499cd9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ jobs: - name: "Build Test" before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make' > build.sh && chmod +x build.sh + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From f4e01789f055a69581aba30e1ccb86eba9c0a1af Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 16:18:48 +0200 Subject: [PATCH 141/350] travis: Treat warnings as errors Then each warning message should be addressed. Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fcf01499cd9c..7966559120db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ jobs: - name: "Build Test" before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From 82d4767ca5776b13f968d6f409fd407c87459d1b Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Sat, 19 Sep 2020 01:11:50 +0000 Subject: [PATCH 142/350] Stop silently discarding -l option Commit https://github.com/thesofproject/soft/commits/59d81995f6828 added an -l option (for --liam? :-) which was never implemented. Remove it because silently discarding user input is really not nice no matter how wrong it is. Signed-off-by: Marc Herbert --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index cd3d63b09f2e..04a3c4797dca 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:l:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From 91bd4fe796ee725700b3cf4bed66735fc05b34bc Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 04:54:17 +0000 Subject: [PATCH 143/350] rimage.c: print an error instead of crashing when zero ELF argument Also rename elf_argc to first_non_opt because it's a position, not a count. Signed-off-by: Marc Herbert --- src/manifest.c | 3 +++ src/rimage.c | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index d76c394154cc..f8b1f8173058 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -6,6 +6,7 @@ // Keyon Jie // Janusz Jankowski +#include #include #include #include @@ -905,6 +906,8 @@ int man_write_fw_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ + /* image_end is updated every time a section is added */ + assert(image->image_end > MAN_FW_DESC_OFFSET_V1_8); ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); diff --git a/src/rimage.c b/src/rimage.c index 04a3c4797dca..1ea2a7fa4c87 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) struct image image; struct adsp *heap_adsp; const char *adsp_config = NULL; - int opt, ret, i, elf_argc = 0; + int opt, ret, i, first_non_opt; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; @@ -86,11 +86,12 @@ int main(int argc, char *argv[]) usage(argv[0]); break; default: + /* getopt's default error message is good enough */ break; } } - elf_argc = optind; + first_non_opt = optind; /* make sure we have an outfile and machine */ if (!image.out_file || !adsp_config) @@ -145,10 +146,18 @@ int main(int argc, char *argv[]) image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; /* parse input ELF files */ - image.num_modules = argc - elf_argc; - for (i = elf_argc; i < argc; i++) { + image.num_modules = argc - first_non_opt; + + if (image.num_modules <= 0) { + fprintf(stderr, + "error: requires at least one ELF input module\n"); + return -EINVAL; + } + + /* getopt reorders argv[] */ + for (i = first_non_opt; i < argc; i++) { fprintf(stdout, "\nModule Reading %s\n", argv[i]); - ret = elf_parse_module(&image, i - elf_argc, argv[i]); + ret = elf_parse_module(&image, i - first_non_opt, argv[i]); if (ret < 0) goto out; } From 75f96956e05e8fe3da305e22f5b27d5bd5e5d1c5 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 04:57:25 +0000 Subject: [PATCH 144/350] elf.c: check ELF32-LE magic number instead of crashing Passing a 64 bits ELF file by accident (for instance: '/usr/bin/openssl' while messing up the command line options) caused an interesting cascade of errors and memory corruption which are all caught in this commit. This doesn't make rimage fuzz-proof far from it; only fool-proof which is still useful. In passing add some quotes so the error message when failing to find the SHT_NULL section with an empty name is a little bit more readable. Signed-off-by: Marc Herbert --- src/elf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/elf.c b/src/elf.c index f53adcd75441..fc9232b66578 100644 --- a/src/elf.c +++ b/src/elf.c @@ -5,6 +5,7 @@ // Author: Liam Girdwood // Keyon Jie +#include #include #include #include @@ -29,7 +30,7 @@ static int elf_read_sections(struct image *image, struct module *module, } /* allocate space for each section header */ - section = calloc(sizeof(Elf32_Shdr), hdr->shnum); + section = calloc(hdr->shnum, sizeof(Elf32_Shdr)); if (!section) return -ENOMEM; module->section = section; @@ -43,6 +44,7 @@ static int elf_read_sections(struct image *image, struct module *module, } /* read in strings */ + assert(hdr->shstrndx < count); module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", @@ -201,6 +203,11 @@ static int elf_read_hdr(struct image *image, struct module *module) return -errno; } + if (strncmp((char *)hdr->ident, "\177ELF\001\001", 5)) { + fprintf(stderr, "Not a 32 bits ELF-LE file\n"); + return -EINVAL; + } + if (!image->verbose) return 0; @@ -513,8 +520,8 @@ int elf_find_section(const struct module *module, const char *name) } } - fprintf(stderr, "warning: can't find section %s in module %s\n", name, - module->elf_file); + fprintf(stderr, "warning: can't find section named '%s' in module %s\n", + name, module->elf_file); ret = -EINVAL; out: From e67d68e8e1ea34f2c434ccba21c9609fac8c5989 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 05:03:30 +0000 Subject: [PATCH 145/350] adsp_config.c: actually check error when parsing "version" array elements Caveat: this was just reported by valgrind. I did not test any actual toml parsing error either (who tests error handling?) but this code can't be worse than the previous one. Signed-off-by: Marc Herbert --- src/adsp_config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index a6043834b669..d2269b818a43 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1565,11 +1565,15 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) /* parse "version" array elements */ for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { raw = toml_raw_at(arr, i); - if (ret < 0) + if (raw == 0) { ret = err_key_parse("version", NULL); + goto error; + } ret = toml_rtoi(raw, &manifest_version[i]); - if (ret < 0) + if (ret < 0) { ret = err_key_parse("version", "can't convert element to integer"); + goto error; + } } /* parsing function depends on manifest_version */ From e29baaa8b9dc90fcff9b8914b1d0ac2768474b54 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 23 Sep 2020 07:59:39 +0200 Subject: [PATCH 146/350] travis: Use $(...) instead `...` in bash scripts It's encouraged to use version with $(...). Backtick command substitution `...` is legacy syntax with several issues. 1. It has a series of undefined behaviors related to quoting in POSIX. 2. It imposes a custom escaping mode with surprising results. 3. It's exceptionally hard to nest. ~https://github.com/koalaman/shellcheck/wiki/SC2006 Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7966559120db..e266ad50ce44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ jobs: before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file + - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh From fccf52133104987d9a532e6a9c332ba5c7a1bd91 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 10:49:43 +0200 Subject: [PATCH 147/350] travis: Scan patch codestyle Checkpatch is a tool which checks patch code style alignment with Linux kernel code. By the way print short graphs of used commits, to show whats under test. Checkpatch call is precede by `set -x`, to show used arguments values, especially checked commits range. Signed-off-by: Karol Trzcinski --- .travis.yml | 7 + scripts/checkpatch.pl | 6845 ++++++++++++++++++++++++++++++ scripts/const_structs.checkpatch | 0 scripts/spelling.txt | 1254 ++++++ 4 files changed, 8106 insertions(+) create mode 100755 scripts/checkpatch.pl create mode 100644 scripts/const_structs.checkpatch create mode 100644 scripts/spelling.txt diff --git a/.travis.yml b/.travis.yml index e266ad50ce44..d89521056ee9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,10 @@ jobs: script: - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh + - name: checkpatch + before_install: + - sudo apt-get -y install codespell + script: + - git --no-pager log --oneline --graph --decorate --max-count=5 + - git --no-pager log --oneline --graph --decorate --max-count=5 "${TRAVIS_BRANCH}" + - (set -x; scripts/checkpatch.pl --no-tree --strict --codespell --no-signoff -g ${TRAVIS_COMMIT_RANGE/.../..}) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl new file mode 100755 index 000000000000..ce33a3b0ac98 --- /dev/null +++ b/scripts/checkpatch.pl @@ -0,0 +1,6845 @@ +#!/usr/bin/env perl +# SPDX-License-Identifier: GPL-2.0 +# +# (c) 2001, Dave Jones. (the file handling bit) +# (c) 2005, Joel Schopp (the ugly bit) +# (c) 2007,2008, Andy Whitcroft (new conditions, test suite) +# (c) 2008-2010 Andy Whitcroft +# (c) 2010-2018 Joe Perches + +use strict; +use warnings; +use POSIX; +use File::Basename; +use Cwd 'abs_path'; +use Term::ANSIColor qw(:constants); +use Encode qw(decode encode); + +my $P = $0; +my $D = dirname(abs_path($P)); + +my $V = '0.32'; + +use Getopt::Long qw(:config no_auto_abbrev); + +my $SOF = 1; # enables SOF-specific behaviour +my $quiet = 0; +my $tree = 1; +my $chk_signoff = 1; +my $chk_patch = 1; +my $tst_only; +my $emacs = 0; +my $terse = 0; +my $showfile = 0; +my $file = 0; +my $git = 0; +my %git_commits = (); +my $check = 0; +my $check_orig = 0; +my $summary = 1; +my $mailback = 0; +my $summary_file = 0; +my $show_types = 0; +my $list_types = 0; +my $fix = 0; +my $fix_inplace = 0; +my $root; +my %debug; +my %camelcase = (); +my %use_type = (); +my @use = (); +my %ignore_type = (); +my @ignore = (); +my $help = 0; +my $configuration_file = ".checkpatch.conf"; +my $max_line_length = 100; +my $ignore_perl_version = 0; +my $minimum_perl_version = 5.10.0; +my $min_conf_desc_length = 4; +my $spelling_file = "$D/spelling.txt"; +my $codespell = 0; +my $codespellfile = "/usr/share/codespell/dictionary.txt"; +my $conststructsfile = "$D/const_structs.checkpatch"; +my $typedefsfile = ""; +my $color = "auto"; +my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE +# git output parsing needs US English output, so first set backtick child process LANGUAGE +my $git_command ='export LANGUAGE=en_US.UTF-8; git'; + +sub help { + my ($exitcode) = @_; + + print << "EOM"; +Usage: $P [OPTION]... [FILE]... +Version: $V + +Options: + -q, --quiet quiet + --no-tree run without a kernel tree + --no-signoff do not check for 'Signed-off-by' line + --patch treat FILE as patchfile (default) + --emacs emacs compile window format + --terse one line per report + --showfile emit diffed file position, not input file position + -g, --git treat FILE as a single commit or git revision range + single git commit with: + + ^ + ~n + multiple git commits with: + .. + ... + - + git merges are ignored + -f, --file treat FILE as regular source file + --subjective, --strict enable more subjective tests + --list-types list the possible message types + --types TYPE(,TYPE2...) show only these comma separated message types + --ignore TYPE(,TYPE2...) ignore various comma separated message types + --show-types show the specific message type in the output + --max-line-length=n set the maximum line length, (default $max_line_length) + if exceeded, warn on patches + requires --strict for use with --file + --min-conf-desc-length=n set the min description length, if shorter, warn + --root=PATH PATH to the kernel tree root + --no-summary suppress the per-file summary + --mailback only produce a report in case of warnings/errors + --summary-file include the filename in summary + --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of + 'values', 'possible', 'type', and 'attr' (default + is all off) + --test-only=WORD report only warnings/errors containing WORD + literally + --fix EXPERIMENTAL - may create horrible results + If correctable single-line errors exist, create + ".EXPERIMENTAL-checkpatch-fixes" + with potential errors corrected to the preferred + checkpatch style + --fix-inplace EXPERIMENTAL - may create horrible results + Is the same as --fix, but overwrites the input + file. It's your fault if there's no backup or git + --ignore-perl-version override checking of perl version. expect + runtime errors. + --codespell Use the codespell dictionary for spelling/typos + (default:/usr/share/codespell/dictionary.txt) + --codespellfile Use this codespell dictionary + --typedefsfile Read additional types from this file + --color[=WHEN] Use colors 'always', 'never', or only when output + is a terminal ('auto'). Default is 'auto'. + -h, --help, --version display this help and exit + +When FILE is - read standard input. +EOM + + exit($exitcode); +} + +sub uniq { + my %seen; + return grep { !$seen{$_}++ } @_; +} + +sub list_types { + my ($exitcode) = @_; + + my $count = 0; + + local $/ = undef; + + open(my $script, '<', abs_path($P)) or + die "$P: Can't read '$P' $!\n"; + + my $text = <$script>; + close($script); + + my @types = (); + # Also catch when type or level is passed through a variable + for ($text =~ /(?:(?:\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) { + push (@types, $_); + } + @types = sort(uniq(@types)); + print("#\tMessage type\n\n"); + foreach my $type (@types) { + print(++$count . "\t" . $type . "\n"); + } + + exit($exitcode); +} + +my $conf = which_conf($configuration_file); +if (-f $conf) { + my @conf_args; + open(my $conffile, '<', "$conf") + or warn "$P: Can't find a readable $configuration_file file $!\n"; + + while (<$conffile>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + $line =~ s/\s+/ /g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + + my @words = split(" ", $line); + foreach my $word (@words) { + last if ($word =~ m/^#/); + push (@conf_args, $word); + } + } + close($conffile); + unshift(@ARGV, @conf_args) if @conf_args; +} + +# Perl's Getopt::Long allows options to take optional arguments after a space. +# Prevent --color by itself from consuming other arguments +foreach (@ARGV) { + if ($_ eq "--color" || $_ eq "-color") { + $_ = "--color=$color"; + } +} + +GetOptions( + 'q|quiet+' => \$quiet, + 'tree!' => \$tree, + 'signoff!' => \$chk_signoff, + 'patch!' => \$chk_patch, + 'emacs!' => \$emacs, + 'terse!' => \$terse, + 'showfile!' => \$showfile, + 'f|file!' => \$file, + 'g|git!' => \$git, + 'subjective!' => \$check, + 'strict!' => \$check, + 'ignore=s' => \@ignore, + 'types=s' => \@use, + 'show-types!' => \$show_types, + 'list-types!' => \$list_types, + 'max-line-length=i' => \$max_line_length, + 'min-conf-desc-length=i' => \$min_conf_desc_length, + 'root=s' => \$root, + 'summary!' => \$summary, + 'mailback!' => \$mailback, + 'summary-file!' => \$summary_file, + 'fix!' => \$fix, + 'fix-inplace!' => \$fix_inplace, + 'ignore-perl-version!' => \$ignore_perl_version, + 'debug=s' => \%debug, + 'test-only=s' => \$tst_only, + 'codespell!' => \$codespell, + 'codespellfile=s' => \$codespellfile, + 'typedefsfile=s' => \$typedefsfile, + 'color=s' => \$color, + 'no-color' => \$color, #keep old behaviors of -nocolor + 'nocolor' => \$color, #keep old behaviors of -nocolor + 'h|help' => \$help, + 'version' => \$help +) or help(1); + +help(0) if ($help); + +list_types(0) if ($list_types); + +$fix = 1 if ($fix_inplace); +$check_orig = $check; + +my $exit = 0; + +my $perl_version_ok = 1; +if ($^V && $^V lt $minimum_perl_version) { + $perl_version_ok = 0; + printf "$P: requires at least perl version %vd\n", $minimum_perl_version; + exit(1) if (!$ignore_perl_version); +} + +#if no filenames are given, push '-' to read patch from stdin +if ($#ARGV < 0) { + push(@ARGV, '-'); +} + +if ($color =~ /^[01]$/) { + $color = !$color; +} elsif ($color =~ /^always$/i) { + $color = 1; +} elsif ($color =~ /^never$/i) { + $color = 0; +} elsif ($color =~ /^auto$/i) { + $color = (-t STDOUT); +} else { + die "Invalid color mode: $color\n"; +} + +sub hash_save_array_words { + my ($hashRef, $arrayRef) = @_; + + my @array = split(/,/, join(',', @$arrayRef)); + foreach my $word (@array) { + $word =~ s/\s*\n?$//g; + $word =~ s/^\s*//g; + $word =~ s/\s+/ /g; + $word =~ tr/[a-z]/[A-Z]/; + + next if ($word =~ m/^\s*#/); + next if ($word =~ m/^\s*$/); + + $hashRef->{$word}++; + } +} + +sub hash_show_words { + my ($hashRef, $prefix) = @_; + + if (keys %$hashRef) { + print "\nNOTE: $prefix message types:"; + foreach my $word (sort keys %$hashRef) { + print " $word"; + } + print "\n"; + } +} + +hash_save_array_words(\%ignore_type, \@ignore); +hash_save_array_words(\%use_type, \@use); + +my $dbg_values = 0; +my $dbg_possible = 0; +my $dbg_type = 0; +my $dbg_attr = 0; +for my $key (keys %debug) { + ## no critic + eval "\${dbg_$key} = '$debug{$key}';"; + die "$@" if ($@); +} + +my $rpt_cleaners = 0; + +if ($terse) { + $emacs = 1; + $quiet++; +} + +if ($tree) { + if (defined $root) { + if (!top_of_kernel_tree($root)) { + die "$P: $root: --root does not point at a valid tree\n"; + } + } else { + if (top_of_kernel_tree('.')) { + $root = '.'; + } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && + top_of_kernel_tree($1)) { + $root = $1; + } + } + + if (!defined $root) { + print "Must be run from the top-level dir. of a kernel tree\n"; + exit(2); + } +} + +my $emitted_corrupt = 0; + +our $Ident = qr{ + [A-Za-z_][A-Za-z\d_]* + (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* + }x; +our $Storage = qr{extern|static|asmlinkage}; +our $Sparse = qr{ + __user| + __kernel| + __force| + __iomem| + __must_check| + __kprobes| + __ref| + __refconst| + __refdata| + __rcu| + __private + }x; +our $InitAttributePrefix = qr{__(?:mem|cpu|dev|net_|)}; +our $InitAttributeData = qr{$InitAttributePrefix(?:initdata\b)}; +our $InitAttributeConst = qr{$InitAttributePrefix(?:initconst\b)}; +our $InitAttributeInit = qr{$InitAttributePrefix(?:init\b)}; +our $InitAttribute = qr{$InitAttributeData|$InitAttributeConst|$InitAttributeInit}; + +# Notes to $Attribute: +# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check +our $Attribute = qr{ + const| + __percpu| + __nocast| + __safe| + __bitwise| + __packed__| + __packed2__| + __naked| + __maybe_unused| + __always_unused| + __noreturn| + __used| + __cold| + __pure| + __noclone| + __deprecated| + __read_mostly| + __ro_after_init| + __kprobes| + $InitAttribute| + ____cacheline_aligned| + ____cacheline_aligned_in_smp| + ____cacheline_internodealigned_in_smp| + __weak + }x; +our $Modifier; +our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__}; +our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; +our $Lval = qr{$Ident(?:$Member)*}; + +our $Int_type = qr{(?i)llu|ull|ll|lu|ul|l|u}; +our $Binary = qr{(?i)0b[01]+$Int_type?}; +our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; +our $Int = qr{[0-9]+$Int_type?}; +our $Octal = qr{0[0-7]+$Int_type?}; +our $String = qr{"[X\t]*"}; +our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; +our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; +our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; +our $Float = qr{$Float_hex|$Float_dec|$Float_int}; +our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; +our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; +our $Compare = qr{<=|>=|==|!=|<|(?}; +our $Arithmetic = qr{\+|-|\*|\/|%}; +our $Operators = qr{ + <=|>=|==|!=| + =>|->|<<|>>|<|>|!|~| + &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic + }x; + +our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; + +our $BasicType; +our $NonptrType; +our $NonptrTypeMisordered; +our $NonptrTypeWithAttr; +our $Type; +our $TypeMisordered; +our $Declare; +our $DeclareMisordered; + +our $NON_ASCII_UTF8 = qr{ + [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 +}x; + +our $UTF8 = qr{ + [\x09\x0A\x0D\x20-\x7E] # ASCII + | $NON_ASCII_UTF8 +}x; + +our $typeC99Typedefs = qr{(?:__)?(?:[us]_?)?int_?(?:8|16|32|64)_t}; +our $typeOtherOSTypedefs = qr{(?x: + u_(?:char|short|int|long) | # bsd + u(?:nchar|short|int|long) # sysv +)}; +our $typeKernelTypedefs = qr{(?x: + (?:__)?(?:u|s|be|le)(?:8|16|32|64)| + atomic_t +)}; +our $typeTypedefs = qr{(?x: + $typeC99Typedefs\b| + $typeOtherOSTypedefs\b| + $typeKernelTypedefs\b +)}; + +our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; + +our $logFunctions = qr{(?x: + printk(?:_ratelimited|_once|_deferred_once|_deferred|)| + (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| + TP_printk| + WARN(?:_RATELIMIT|_ONCE|)| + panic| + MODULE_[A-Z_]+| + seq_vprintf|seq_printf|seq_puts| + trace[a-z_]+ +)}; + +our $allocFunctions = qr{(?x: + (?:(?:devm_)? + (?:kv|k|v)[czm]alloc(?:_node|_array)? | + kstrdup(?:_const)? | + kmemdup(?:_nul)?) | + (?:\w+)?alloc_skb(?:ip_align)? | + # dev_alloc_skb/netdev_alloc_skb, et al + dma_alloc_coherent +)}; + +our $signature_tags = qr{(?xi: + Signed-off-by:| + Co-developed-by:| + Acked-by:| + Tested-by:| + Reviewed-by:| + Reported-by:| + Suggested-by:| + To:| + Cc: +)}; + +our @typeListMisordered = ( + qr{char\s+(?:un)?signed}, + qr{int\s+(?:(?:un)?signed\s+)?short\s}, + qr{int\s+short(?:\s+(?:un)?signed)}, + qr{short\s+int(?:\s+(?:un)?signed)}, + qr{(?:un)?signed\s+int\s+short}, + qr{short\s+(?:un)?signed}, + qr{long\s+int\s+(?:un)?signed}, + qr{int\s+long\s+(?:un)?signed}, + qr{long\s+(?:un)?signed\s+int}, + qr{int\s+(?:un)?signed\s+long}, + qr{int\s+(?:un)?signed}, + qr{int\s+long\s+long\s+(?:un)?signed}, + qr{long\s+long\s+int\s+(?:un)?signed}, + qr{long\s+long\s+(?:un)?signed\s+int}, + qr{long\s+long\s+(?:un)?signed}, + qr{long\s+(?:un)?signed}, +); + +our @typeList = ( + qr{void}, + qr{(?:(?:un)?signed\s+)?char}, + qr{(?:(?:un)?signed\s+)?short\s+int}, + qr{(?:(?:un)?signed\s+)?short}, + qr{(?:(?:un)?signed\s+)?int}, + qr{(?:(?:un)?signed\s+)?long\s+int}, + qr{(?:(?:un)?signed\s+)?long\s+long\s+int}, + qr{(?:(?:un)?signed\s+)?long\s+long}, + qr{(?:(?:un)?signed\s+)?long}, + qr{(?:un)?signed}, + qr{float}, + qr{double}, + qr{bool}, + qr{struct\s+$Ident}, + qr{union\s+$Ident}, + qr{enum\s+$Ident}, + qr{${Ident}_t}, + qr{${Ident}_handler}, + qr{${Ident}_handler_fn}, + @typeListMisordered, +); + +our $C90_int_types = qr{(?x: + long\s+long\s+int\s+(?:un)?signed| + long\s+long\s+(?:un)?signed\s+int| + long\s+long\s+(?:un)?signed| + (?:(?:un)?signed\s+)?long\s+long\s+int| + (?:(?:un)?signed\s+)?long\s+long| + int\s+long\s+long\s+(?:un)?signed| + int\s+(?:(?:un)?signed\s+)?long\s+long| + + long\s+int\s+(?:un)?signed| + long\s+(?:un)?signed\s+int| + long\s+(?:un)?signed| + (?:(?:un)?signed\s+)?long\s+int| + (?:(?:un)?signed\s+)?long| + int\s+long\s+(?:un)?signed| + int\s+(?:(?:un)?signed\s+)?long| + + int\s+(?:un)?signed| + (?:(?:un)?signed\s+)?int +)}; + +our @typeListFile = (); +our @typeListWithAttr = ( + @typeList, + qr{struct\s+$InitAttribute\s+$Ident}, + qr{union\s+$InitAttribute\s+$Ident}, +); + +our @modifierList = ( + qr{fastcall}, +); +our @modifierListFile = (); + +our @mode_permission_funcs = ( + ["module_param", 3], + ["module_param_(?:array|named|string)", 4], + ["module_param_array_named", 5], + ["debugfs_create_(?:file|u8|u16|u32|u64|x8|x16|x32|x64|size_t|atomic_t|bool|blob|regset32|u32_array)", 2], + ["proc_create(?:_data|)", 2], + ["(?:CLASS|DEVICE|SENSOR|SENSOR_DEVICE|IIO_DEVICE)_ATTR", 2], + ["IIO_DEV_ATTR_[A-Z_]+", 1], + ["SENSOR_(?:DEVICE_|)ATTR_2", 2], + ["SENSOR_TEMPLATE(?:_2|)", 3], + ["__ATTR", 2], +); + +#Create a search pattern for all these functions to speed up a loop below +our $mode_perms_search = ""; +foreach my $entry (@mode_permission_funcs) { + $mode_perms_search .= '|' if ($mode_perms_search ne ""); + $mode_perms_search .= $entry->[0]; +} +$mode_perms_search = "(?:${mode_perms_search})"; + +our %deprecated_apis = ( + "synchronize_rcu_bh" => "synchronize_rcu", + "synchronize_rcu_bh_expedited" => "synchronize_rcu_expedited", + "call_rcu_bh" => "call_rcu", + "rcu_barrier_bh" => "rcu_barrier", + "synchronize_sched" => "synchronize_rcu", + "synchronize_sched_expedited" => "synchronize_rcu_expedited", + "call_rcu_sched" => "call_rcu", + "rcu_barrier_sched" => "rcu_barrier", + "get_state_synchronize_sched" => "get_state_synchronize_rcu", + "cond_synchronize_sched" => "cond_synchronize_rcu", +); + +#Create a search pattern for all these strings to speed up a loop below +our $deprecated_apis_search = ""; +foreach my $entry (keys %deprecated_apis) { + $deprecated_apis_search .= '|' if ($deprecated_apis_search ne ""); + $deprecated_apis_search .= $entry; +} +$deprecated_apis_search = "(?:${deprecated_apis_search})"; + +our $mode_perms_world_writable = qr{ + S_IWUGO | + S_IWOTH | + S_IRWXUGO | + S_IALLUGO | + 0[0-7][0-7][2367] +}x; + +our %mode_permission_string_types = ( + "S_IRWXU" => 0700, + "S_IRUSR" => 0400, + "S_IWUSR" => 0200, + "S_IXUSR" => 0100, + "S_IRWXG" => 0070, + "S_IRGRP" => 0040, + "S_IWGRP" => 0020, + "S_IXGRP" => 0010, + "S_IRWXO" => 0007, + "S_IROTH" => 0004, + "S_IWOTH" => 0002, + "S_IXOTH" => 0001, + "S_IRWXUGO" => 0777, + "S_IRUGO" => 0444, + "S_IWUGO" => 0222, + "S_IXUGO" => 0111, +); + +#Create a search pattern for all these strings to speed up a loop below +our $mode_perms_string_search = ""; +foreach my $entry (keys %mode_permission_string_types) { + $mode_perms_string_search .= '|' if ($mode_perms_string_search ne ""); + $mode_perms_string_search .= $entry; +} +our $single_mode_perms_string_search = "(?:${mode_perms_string_search})"; +our $multi_mode_perms_string_search = qr{ + ${single_mode_perms_string_search} + (?:\s*\|\s*${single_mode_perms_string_search})* +}x; + +sub perms_to_octal { + my ($string) = @_; + + return trim($string) if ($string =~ /^\s*0[0-7]{3,3}\s*$/); + + my $val = ""; + my $oval = ""; + my $to = 0; + my $curpos = 0; + my $lastpos = 0; + while ($string =~ /\b(($single_mode_perms_string_search)\b(?:\s*\|\s*)?\s*)/g) { + $curpos = pos($string); + my $match = $2; + my $omatch = $1; + last if ($lastpos > 0 && ($curpos - length($omatch) != $lastpos)); + $lastpos = $curpos; + $to |= $mode_permission_string_types{$match}; + $val .= '\s*\|\s*' if ($val ne ""); + $val .= $match; + $oval .= $omatch; + } + $oval =~ s/^\s*\|\s*//; + $oval =~ s/\s*\|\s*$//; + return sprintf("%04o", $to); +} + +our $allowed_asm_includes = qr{(?x: + irq| + memory| + time| + reboot +)}; +# memory.h: ARM has a custom one + +# Load common spelling mistakes and build regular expression list. +my $misspellings; +my %spelling_fix; + +if (open(my $spelling, '<', $spelling_file)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + + my ($suspect, $fix) = split(/\|\|/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); +} else { + warn "No typos will be found - file '$spelling_file': $!\n"; +} + +if ($codespell) { + if (open(my $spelling, '<', $codespellfile)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + next if ($line =~ m/, disabled/i); + + $line =~ s/,.*$//; + + my ($suspect, $fix) = split(/->/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); + } else { + warn "No codespell typos will be found - file '$codespellfile': $!\n"; + } +} + +$misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix; + +sub read_words { + my ($wordsRef, $file) = @_; + + if (open(my $words, '<', $file)) { + while (<$words>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + if ($line =~ /\s/) { + print("$file: '$line' invalid - ignored\n"); + next; + } + + $$wordsRef .= '|' if ($$wordsRef ne ""); + $$wordsRef .= $line; + } + close($file); + return 1; + } + + return 0; +} + +my $const_structs = ""; +read_words(\$const_structs, $conststructsfile) + or warn "No structs that should be const will be found - file '$conststructsfile': $!\n"; + +my $typeOtherTypedefs = ""; +if (length($typedefsfile)) { + read_words(\$typeOtherTypedefs, $typedefsfile) + or warn "No additional types will be considered - file '$typedefsfile': $!\n"; +} +$typeTypedefs .= '|' . $typeOtherTypedefs if ($typeOtherTypedefs ne ""); + +sub build_types { + my $mods = "(?x: \n" . join("|\n ", (@modifierList, @modifierListFile)) . "\n)"; + my $all = "(?x: \n" . join("|\n ", (@typeList, @typeListFile)) . "\n)"; + my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)"; + my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)"; + $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; + $BasicType = qr{ + (?:$typeTypedefs\b)| + (?:${all}\b) + }x; + $NonptrType = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:typeof|__typeof__)\s*\([^\)]*\)| + (?:$typeTypedefs\b)| + (?:${all}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $NonptrTypeMisordered = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:${Misordered}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $NonptrTypeWithAttr = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:typeof|__typeof__)\s*\([^\)]*\)| + (?:$typeTypedefs\b)| + (?:${allWithAttr}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $Type = qr{ + $NonptrType + (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)? + (?:\s+$Inline|\s+$Modifier)* + }x; + $TypeMisordered = qr{ + $NonptrTypeMisordered + (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)? + (?:\s+$Inline|\s+$Modifier)* + }x; + $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type}; + $DeclareMisordered = qr{(?:$Storage\s+(?:$Inline\s+)?)?$TypeMisordered}; +} +build_types(); + +our $Typecast = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*}; + +# Using $balanced_parens, $LvalOrFunc, or $FuncArg +# requires at least perl version v5.10.0 +# Any use must be runtime checked with $^V + +our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; +our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*}; +our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; + +our $declaration_macros = qr{(?x: + (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| + (?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(| + (?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(| + (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\( +)}; + +sub deparenthesize { + my ($string) = @_; + return "" if (!defined($string)); + + while ($string =~ /^\s*\(.*\)\s*$/) { + $string =~ s@^\s*\(\s*@@; + $string =~ s@\s*\)\s*$@@; + } + + $string =~ s@\s+@ @g; + + return $string; +} + +sub seed_camelcase_file { + my ($file) = @_; + + return if (!(-f $file)); + + local $/; + + open(my $include_file, '<', "$file") + or warn "$P: Can't read '$file' $!\n"; + my $text = <$include_file>; + close($include_file); + + my @lines = split('\n', $text); + + foreach my $line (@lines) { + next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/); + if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) { + $camelcase{$1} = 1; + } + } +} + +sub is_maintained_obsolete { + my ($filename) = @_; + + return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl")); + + my $status = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`; + + return $status =~ /obsolete/i; +} + +sub is_SPDX_License_valid { + my ($license) = @_; + + return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$root/.git")); + + my $root_path = abs_path($root); + my $status = `cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`; + return 0 if ($status ne ""); + return 1; +} + +my $camelcase_seeded = 0; +sub seed_camelcase_includes { + return if ($camelcase_seeded); + + my $files; + my $camelcase_cache = ""; + my @include_files = (); + + $camelcase_seeded = 1; + + if (-e ".git") { + my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`; + chomp $git_last_include_commit; + $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; + } else { + my $last_mod_date = 0; + $files = `find $root/include -name "*.h"`; + @include_files = split('\n', $files); + foreach my $file (@include_files) { + my $date = POSIX::strftime("%Y%m%d%H%M", + localtime((stat $file)[9])); + $last_mod_date = $date if ($last_mod_date < $date); + } + $camelcase_cache = ".checkpatch-camelcase.date.$last_mod_date"; + } + + if ($camelcase_cache ne "" && -f $camelcase_cache) { + open(my $camelcase_file, '<', "$camelcase_cache") + or warn "$P: Can't read '$camelcase_cache' $!\n"; + while (<$camelcase_file>) { + chomp; + $camelcase{$_} = 1; + } + close($camelcase_file); + + return; + } + + if (-e ".git") { + $files = `${git_command} ls-files "include/*.h"`; + @include_files = split('\n', $files); + } + + foreach my $file (@include_files) { + seed_camelcase_file($file); + } + + if ($camelcase_cache ne "") { + unlink glob ".checkpatch-camelcase.*"; + open(my $camelcase_file, '>', "$camelcase_cache") + or warn "$P: Can't write '$camelcase_cache' $!\n"; + foreach (sort { lc($a) cmp lc($b) } keys(%camelcase)) { + print $camelcase_file ("$_\n"); + } + close($camelcase_file); + } +} + +sub git_commit_info { + my ($commit, $id, $desc) = @_; + + return ($id, $desc) if ((which("git") eq "") || !(-e ".git")); + + my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`; + $output =~ s/^\s*//gm; + my @lines = split("\n", $output); + + return ($id, $desc) if ($#lines < 0); + + if ($lines[0] =~ /^error: short SHA1 $commit is ambiguous/) { +# Maybe one day convert this block of bash into something that returns +# all matching commit ids, but it's very slow... +# +# echo "checking commits $1..." +# git rev-list --remotes | grep -i "^$1" | +# while read line ; do +# git log --format='%H %s' -1 $line | +# echo "commit $(cut -c 1-12,41-)" +# done + } elsif ($lines[0] =~ /^fatal: ambiguous argument '$commit': unknown revision or path not in the working tree\./) { + $id = undef; + } else { + $id = substr($lines[0], 0, 12); + $desc = substr($lines[0], 41); + } + + return ($id, $desc); +} + +$chk_signoff = 0 if ($file); + +my @rawlines = (); +my @lines = (); +my @fixed = (); +my @fixed_inserted = (); +my @fixed_deleted = (); +my $fixlinenr = -1; + +# If input is git commits, extract all commits from the commit expressions. +# For example, HEAD-3 means we need check 'HEAD, HEAD~1, HEAD~2'. +die "$P: No git repository found\n" if ($git && !-e ".git"); + +if ($git) { + my @commits = (); + foreach my $commit_expr (@ARGV) { + my $git_range; + if ($commit_expr =~ m/^(.*)-(\d+)$/) { + $git_range = "-$2 $1"; + } elsif ($commit_expr =~ m/\.\./) { + $git_range = "$commit_expr"; + } else { + $git_range = "-1 $commit_expr"; + } + my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`; + foreach my $line (split(/\n/, $lines)) { + $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/; + next if (!defined($1) || !defined($2)); + my $sha1 = $1; + my $subject = $2; + unshift(@commits, $sha1); + $git_commits{$sha1} = $subject; + } + } + die "$P: no git commits after extraction!\n" if (@commits == 0); + @ARGV = @commits; +} + +my $vname; +$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"}; +for my $filename (@ARGV) { + my $FILE; + if ($git) { + open($FILE, '-|', "git format-patch -M --stdout -1 $filename") || + die "$P: $filename: git format-patch failed - $!\n"; + } elsif ($file) { + open($FILE, '-|', "diff -u /dev/null $filename") || + die "$P: $filename: diff failed - $!\n"; + } elsif ($filename eq '-') { + open($FILE, '<&STDIN'); + } else { + open($FILE, '<', "$filename") || + die "$P: $filename: open failed - $!\n"; + } + if ($filename eq '-') { + $vname = 'Your patch'; + } elsif ($git) { + $vname = "Commit " . substr($filename, 0, 12) . ' ("' . $git_commits{$filename} . '")'; + } else { + $vname = $filename; + } + while (<$FILE>) { + chomp; + push(@rawlines, $_); + } + close($FILE); + + if ($#ARGV > 0 && $quiet == 0) { + print '-' x length($vname) . "\n"; + print "$vname\n"; + print '-' x length($vname) . "\n"; + } + + if (!process($filename)) { + $exit = 1; + } + @rawlines = (); + @lines = (); + @fixed = (); + @fixed_inserted = (); + @fixed_deleted = (); + $fixlinenr = -1; + @modifierListFile = (); + @typeListFile = (); + build_types(); +} + +if (!$quiet) { + hash_show_words(\%use_type, "Used"); + hash_show_words(\%ignore_type, "Ignored"); + + if (!$perl_version_ok) { + print << "EOM" + +NOTE: perl $^V is not modern enough to detect all possible issues. + An upgrade to at least perl $minimum_perl_version is suggested. +EOM + } + if ($exit) { + print << "EOM" + +NOTE: If any of the errors are false positives, please report + them to the maintainer, see CHECKPATCH in MAINTAINERS. +EOM + } +} + +exit($exit); + +sub top_of_kernel_tree { + my ($root) = @_; + + my @tree_check = ( + "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", + "README", "Documentation", "arch", "include", "drivers", + "fs", "init", "ipc", "kernel", "lib", "scripts", + ); + + if ($SOF) { + @tree_check = ( + "LICENCE", "README.md", "rimage", "tools", + "scripts", "doc", "src", "CODEOWNERS", + "CMakeLists.txt", + ); + } + + foreach my $check (@tree_check) { + if (! -e $root . '/' . $check) { + return 0; + } + } + return 1; +} + +sub parse_email { + my ($formatted_email) = @_; + + my $name = ""; + my $address = ""; + my $comment = ""; + + if ($formatted_email =~ /^(.*)<(\S+\@\S+)>(.*)$/) { + $name = $1; + $address = $2; + $comment = $3 if defined $3; + } elsif ($formatted_email =~ /^\s*<(\S+\@\S+)>(.*)$/) { + $address = $1; + $comment = $2 if defined $2; + } elsif ($formatted_email =~ /(\S+\@\S+)(.*)$/) { + $address = $1; + $comment = $2 if defined $2; + $formatted_email =~ s/\Q$address\E.*$//; + $name = $formatted_email; + $name = trim($name); + $name =~ s/^\"|\"$//g; + # If there's a name left after stripping spaces and + # leading quotes, and the address doesn't have both + # leading and trailing angle brackets, the address + # is invalid. ie: + # "joe smith joe@smith.com" bad + # "joe smith ]+>$/) { + $name = ""; + $address = ""; + $comment = ""; + } + } + + $name = trim($name); + $name =~ s/^\"|\"$//g; + $address = trim($address); + $address =~ s/^\<|\>$//g; + + if ($name =~ /[^\w \-]/i) { ##has "must quote" chars + $name =~ s/(?"; + } + + return $formatted_email; +} + +sub which { + my ($bin) = @_; + + foreach my $path (split(/:/, $ENV{PATH})) { + if (-e "$path/$bin") { + return "$path/$bin"; + } + } + + return ""; +} + +sub which_conf { + my ($conf) = @_; + + foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) { + if (-e "$path/$conf") { + return "$path/$conf"; + } + } + + return ""; +} + +sub expand_tabs { + my ($str) = @_; + + my $res = ''; + my $n = 0; + for my $c (split(//, $str)) { + if ($c eq "\t") { + $res .= ' '; + $n++; + for (; ($n % 8) != 0; $n++) { + $res .= ' '; + } + next; + } + $res .= $c; + $n++; + } + + return $res; +} +sub copy_spacing { + (my $res = shift) =~ tr/\t/ /c; + return $res; +} + +sub line_stats { + my ($line) = @_; + + # Drop the diff line leader and expand tabs + $line =~ s/^.//; + $line = expand_tabs($line); + + # Pick the indent from the front of the line. + my ($white) = ($line =~ /^(\s*)/); + + return (length($line), length($white)); +} + +my $sanitise_quote = ''; + +sub sanitise_line_reset { + my ($in_comment) = @_; + + if ($in_comment) { + $sanitise_quote = '*/'; + } else { + $sanitise_quote = ''; + } +} +sub sanitise_line { + my ($line) = @_; + + my $res = ''; + my $l = ''; + + my $qlen = 0; + my $off = 0; + my $c; + + # Always copy over the diff marker. + $res = substr($line, 0, 1); + + for ($off = 1; $off < length($line); $off++) { + $c = substr($line, $off, 1); + + # Comments we are whacking completely including the begin + # and end, all to $;. + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') { + $sanitise_quote = '*/'; + + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { + $sanitise_quote = ''; + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') { + $sanitise_quote = '//'; + + substr($res, $off, 2, $sanitise_quote); + $off++; + next; + } + + # A \ in a string means ignore the next character. + if (($sanitise_quote eq "'" || $sanitise_quote eq '"') && + $c eq "\\") { + substr($res, $off, 2, 'XX'); + $off++; + next; + } + # Regular quotes. + if ($c eq "'" || $c eq '"') { + if ($sanitise_quote eq '') { + $sanitise_quote = $c; + + substr($res, $off, 1, $c); + next; + } elsif ($sanitise_quote eq $c) { + $sanitise_quote = ''; + } + } + + #print "c<$c> SQ<$sanitise_quote>\n"; + if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote && $c ne "\t") { + substr($res, $off, 1, 'X'); + } else { + substr($res, $off, 1, $c); + } + } + + if ($sanitise_quote eq '//') { + $sanitise_quote = ''; + } + + # The pathname on a #include may be surrounded by '<' and '>'. + if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) { + my $clean = 'X' x length($1); + $res =~ s@\<.*\>@<$clean>@; + + # The whole of a #error is a string. + } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) { + my $clean = 'X' x length($1); + $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@; + } + + if ($allow_c99_comments && $res =~ m@(//.*$)@) { + my $match = $1; + $res =~ s/\Q$match\E/"$;" x length($match)/e; + } + + return $res; +} + +sub get_quoted_string { + my ($line, $rawline) = @_; + + return "" if (!defined($line) || !defined($rawline)); + return "" if ($line !~ m/($String)/g); + return substr($rawline, $-[0], $+[0] - $-[0]); +} + +sub ctx_statement_block { + my ($linenr, $remain, $off) = @_; + my $line = $linenr - 1; + my $blk = ''; + my $soff = $off; + my $coff = $off - 1; + my $coff_set = 0; + + my $loff = 0; + + my $type = ''; + my $level = 0; + my @stack = (); + my $p; + my $c; + my $len = 0; + + my $remainder; + while (1) { + @stack = (['', 0]) if ($#stack == -1); + + #warn "CSB: blk<$blk> remain<$remain>\n"; + # If we are about to drop off the end, pull in more + # context. + if ($off >= $len) { + for (; $remain > 0; $line++) { + last if (!defined $lines[$line]); + next if ($lines[$line] =~ /^-/); + $remain--; + $loff = $len; + $blk .= $lines[$line] . "\n"; + $len = length($blk); + $line++; + last; + } + # Bail if there is no further context. + #warn "CSB: blk<$blk> off<$off> len<$len>\n"; + if ($off >= $len) { + last; + } + if ($level == 0 && substr($blk, $off) =~ /^.\s*#\s*define/) { + $level++; + $type = '#'; + } + } + $p = $c; + $c = substr($blk, $off, 1); + $remainder = substr($blk, $off); + + #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n"; + + # Handle nested #if/#else. + if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, [ $type, $level ]); + } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) { + ($type, $level) = @{$stack[$#stack - 1]}; + } elsif ($remainder =~ /^#\s*endif\b/) { + ($type, $level) = @{pop(@stack)}; + } + + # Statement ends at the ';' or a close '}' at the + # outermost level. + if ($level == 0 && $c eq ';') { + last; + } + + # An else is really a conditional as long as its not else if + if ($level == 0 && $coff_set == 0 && + (!defined($p) || $p =~ /(?:\s|\}|\+)/) && + $remainder =~ /^(else)(?:\s|{)/ && + $remainder !~ /^else\s+if\b/) { + $coff = $off + length($1) - 1; + $coff_set = 1; + #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n"; + #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n"; + } + + if (($type eq '' || $type eq '(') && $c eq '(') { + $level++; + $type = '('; + } + if ($type eq '(' && $c eq ')') { + $level--; + $type = ($level != 0)? '(' : ''; + + if ($level == 0 && $coff < $soff) { + $coff = $off; + $coff_set = 1; + #warn "CSB: mark coff<$coff>\n"; + } + } + if (($type eq '' || $type eq '{') && $c eq '{') { + $level++; + $type = '{'; + } + if ($type eq '{' && $c eq '}') { + $level--; + $type = ($level != 0)? '{' : ''; + + if ($level == 0) { + if (substr($blk, $off + 1, 1) eq ';') { + $off++; + } + last; + } + } + # Preprocessor commands end at the newline unless escaped. + if ($type eq '#' && $c eq "\n" && $p ne "\\") { + $level--; + $type = ''; + $off++; + last; + } + $off++; + } + # We are truly at the end, so shuffle to the next line. + if ($off == $len) { + $loff = $len + 1; + $line++; + $remain--; + } + + my $statement = substr($blk, $soff, $off - $soff + 1); + my $condition = substr($blk, $soff, $coff - $soff + 1); + + #warn "STATEMENT<$statement>\n"; + #warn "CONDITION<$condition>\n"; + + #print "coff<$coff> soff<$off> loff<$loff>\n"; + + return ($statement, $condition, + $line, $remain + 1, $off - $loff + 1, $level); +} + +sub statement_lines { + my ($stmt) = @_; + + # Strip the diff line prefixes and rip blank lines at start and end. + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_rawlines { + my ($stmt) = @_; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_block_size { + my ($stmt) = @_; + + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*{//; + $stmt =~ s/}\s*$//; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + my @stmt_statements = ($stmt =~ /;/g); + + my $stmt_lines = $#stmt_lines + 2; + my $stmt_statements = $#stmt_statements + 1; + + if ($stmt_lines > $stmt_statements) { + return $stmt_lines; + } else { + return $stmt_statements; + } +} + +sub ctx_statement_full { + my ($linenr, $remain, $off) = @_; + my ($statement, $condition, $level); + + my (@chunks); + + # Grab the first conditional/block pair. + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "F: c<$condition> s<$statement> remain<$remain>\n"; + push(@chunks, [ $condition, $statement ]); + if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) { + return ($level, $linenr, @chunks); + } + + # Pull in the following conditional/block pairs and see if they + # could continue the statement. + for (;;) { + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "C: c<$condition> s<$statement> remain<$remain>\n"; + last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s)); + #print "C: push\n"; + push(@chunks, [ $condition, $statement ]); + } + + return ($level, $linenr, @chunks); +} + +sub ctx_block_get { + my ($linenr, $remain, $outer, $open, $close, $off) = @_; + my $line; + my $start = $linenr - 1; + my $blk = ''; + my @o; + my @c; + my @res = (); + + my $level = 0; + my @stack = ($level); + for ($line = $start; $remain > 0; $line++) { + next if ($rawlines[$line] =~ /^-/); + $remain--; + + $blk .= $rawlines[$line]; + + # Handle nested #if/#else. + if ($lines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, $level); + } elsif ($lines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) { + $level = $stack[$#stack - 1]; + } elsif ($lines[$line] =~ /^.\s*#\s*endif\b/) { + $level = pop(@stack); + } + + foreach my $c (split(//, $lines[$line])) { + ##print "C<$c>L<$level><$open$close>O<$off>\n"; + if ($off > 0) { + $off--; + next; + } + + if ($c eq $close && $level > 0) { + $level--; + last if ($level == 0); + } elsif ($c eq $open) { + $level++; + } + } + + if (!$outer || $level <= 1) { + push(@res, $rawlines[$line]); + } + + last if ($level == 0); + } + + return ($level, @res); +} +sub ctx_block_outer { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0); + return @r; +} +sub ctx_block { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0); + return @r; +} +sub ctx_statement { + my ($linenr, $remain, $off) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off); + return @r; +} +sub ctx_block_level { + my ($linenr, $remain) = @_; + + return ctx_block_get($linenr, $remain, 0, '{', '}', 0); +} +sub ctx_statement_level { + my ($linenr, $remain, $off) = @_; + + return ctx_block_get($linenr, $remain, 0, '(', ')', $off); +} + +sub ctx_locate_comment { + my ($first_line, $end_line) = @_; + + # Catch a comment on the end of the line itself. + my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@); + return $current_comment if (defined $current_comment); + + # Look through the context and try and figure out if there is a + # comment. + my $in_comment = 0; + $current_comment = ''; + for (my $linenr = $first_line; $linenr < $end_line; $linenr++) { + my $line = $rawlines[$linenr - 1]; + #warn " $line\n"; + if ($linenr == $first_line and $line =~ m@^.\s*\*@) { + $in_comment = 1; + } + if ($line =~ m@/\*@) { + $in_comment = 1; + } + if (!$in_comment && $current_comment ne '') { + $current_comment = ''; + } + $current_comment .= $line . "\n" if ($in_comment); + if ($line =~ m@\*/@) { + $in_comment = 0; + } + } + + chomp($current_comment); + return($current_comment); +} +sub ctx_has_comment { + my ($first_line, $end_line) = @_; + my $cmt = ctx_locate_comment($first_line, $end_line); + + ##print "LINE: $rawlines[$end_line - 1 ]\n"; + ##print "CMMT: $cmt\n"; + + return ($cmt ne ''); +} + +sub raw_line { + my ($linenr, $cnt) = @_; + + my $offset = $linenr - 1; + $cnt++; + + my $line; + while ($cnt) { + $line = $rawlines[$offset++]; + next if (defined($line) && $line =~ /^-/); + $cnt--; + } + + return $line; +} + +sub get_stat_real { + my ($linenr, $lc) = @_; + + my $stat_real = raw_line($linenr, 0); + for (my $count = $linenr + 1; $count <= $lc; $count++) { + $stat_real = $stat_real . "\n" . raw_line($count, 0); + } + + return $stat_real; +} + +sub get_stat_here { + my ($linenr, $cnt, $here) = @_; + + my $herectx = $here . "\n"; + for (my $n = 0; $n < $cnt; $n++) { + $herectx .= raw_line($linenr, $n) . "\n"; + } + + return $herectx; +} + +sub cat_vet { + my ($vet) = @_; + my ($res, $coded); + + $res = ''; + while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) { + $res .= $1; + if ($2 ne '') { + $coded = sprintf("^%c", unpack('C', $2) + 64); + $res .= $coded; + } + } + $res =~ s/$/\$/; + + return $res; +} + +my $av_preprocessor = 0; +my $av_pending; +my @av_paren_type; +my $av_pend_colon; + +sub annotate_reset { + $av_preprocessor = 0; + $av_pending = '_'; + @av_paren_type = ('E'); + $av_pend_colon = 'O'; +} + +sub annotate_values { + my ($stream, $type) = @_; + + my $res; + my $var = '_' x length($stream); + my $cur = $stream; + + print "$stream\n" if ($dbg_values > 1); + + while (length($cur)) { + @av_paren_type = ('E') if ($#av_paren_type < 0); + print " <" . join('', @av_paren_type) . + "> <$type> <$av_pending>" if ($dbg_values > 1); + if ($cur =~ /^(\s+)/o) { + print "WS($1)\n" if ($dbg_values > 1); + if ($1 =~ /\n/ && $av_preprocessor) { + $type = pop(@av_paren_type); + $av_preprocessor = 0; + } + + } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') { + print "CAST($1)\n" if ($dbg_values > 1); + push(@av_paren_type, $type); + $type = 'c'; + + } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\(|\s*$)/) { + print "DECLARE($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^($Modifier)\s*/) { + print "MODIFIER($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) { + print "DEFINE($1,$2)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + if ($2 ne '') { + $av_pending = 'N'; + } + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) { + print "UNDEF($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + + } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) { + print "PRE_START($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) { + print "PRE_RESTART($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $av_paren_type[$#av_paren_type]); + + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:endif))/o) { + print "PRE_END($1)\n" if ($dbg_values > 1); + + $av_preprocessor = 1; + + # Assume all arms of the conditional end as this + # one does, and continue as if the #endif was not here. + pop(@av_paren_type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\\\n)/o) { + print "PRECONT($1)\n" if ($dbg_values > 1); + + } elsif ($cur =~ /^(__attribute__)\s*\(?/o) { + print "ATTR($1)\n" if ($dbg_values > 1); + $av_pending = $type; + $type = 'N'; + + } elsif ($cur =~ /^(sizeof)\s*(\()?/o) { + print "SIZEOF($1)\n" if ($dbg_values > 1); + if (defined $2) { + $av_pending = 'V'; + } + $type = 'N'; + + } elsif ($cur =~ /^(if|while|for)\b/o) { + print "COND($1)\n" if ($dbg_values > 1); + $av_pending = 'E'; + $type = 'N'; + + } elsif ($cur =~/^(case)/o) { + print "CASE($1)\n" if ($dbg_values > 1); + $av_pend_colon = 'C'; + $type = 'N'; + + } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) { + print "KEYWORD($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(\()/o) { + print "PAREN('$1')\n" if ($dbg_values > 1); + push(@av_paren_type, $av_pending); + $av_pending = '_'; + $type = 'N'; + + } elsif ($cur =~ /^(\))/o) { + my $new_type = pop(@av_paren_type); + if ($new_type ne '_') { + $type = $new_type; + print "PAREN('$1') -> $type\n" + if ($dbg_values > 1); + } else { + print "PAREN('$1')\n" if ($dbg_values > 1); + } + + } elsif ($cur =~ /^($Ident)\s*\(/o) { + print "FUNC($1)\n" if ($dbg_values > 1); + $type = 'V'; + $av_pending = 'V'; + + } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) { + if (defined $2 && $type eq 'C' || $type eq 'T') { + $av_pend_colon = 'B'; + } elsif ($type eq 'E') { + $av_pend_colon = 'L'; + } + print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Ident|$Constant)/o) { + print "IDENT($1)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Assignment)/o) { + print "ASSIGN($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~/^(;|{|})/) { + print "END($1)\n" if ($dbg_values > 1); + $type = 'E'; + $av_pend_colon = 'O'; + + } elsif ($cur =~/^(,)/) { + print "COMMA($1)\n" if ($dbg_values > 1); + $type = 'C'; + + } elsif ($cur =~ /^(\?)/o) { + print "QUESTION($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(:)/o) { + print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1); + + substr($var, length($res), 1, $av_pend_colon); + if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') { + $type = 'E'; + } else { + $type = 'N'; + } + $av_pend_colon = 'O'; + + } elsif ($cur =~ /^(\[)/o) { + print "CLOSE($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) { + my $variant; + + print "OPV($1)\n" if ($dbg_values > 1); + if ($type eq 'V') { + $variant = 'B'; + } else { + $variant = 'U'; + } + + substr($var, length($res), 1, $variant); + $type = 'N'; + + } elsif ($cur =~ /^($Operators)/o) { + print "OP($1)\n" if ($dbg_values > 1); + if ($1 ne '++' && $1 ne '--') { + $type = 'N'; + } + + } elsif ($cur =~ /(^.)/o) { + print "C($1)\n" if ($dbg_values > 1); + } + if (defined $1) { + $cur = substr($cur, length($1)); + $res .= $type x length($1); + } + } + + return ($res, $var); +} + +sub possible { + my ($possible, $line) = @_; + my $notPermitted = qr{(?: + ^(?: + $Modifier| + $Storage| + $Type| + DEFINE_\S+ + )$| + ^(?: + goto| + return| + case| + else| + asm|__asm__| + do| + \#| + \#\#| + )(?:\s|$)| + ^(?:typedef|struct|enum)\b + )}x; + warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); + if ($possible !~ $notPermitted) { + # Check for modifiers. + $possible =~ s/\s*$Storage\s*//g; + $possible =~ s/\s*$Sparse\s*//g; + if ($possible =~ /^\s*$/) { + + } elsif ($possible =~ /\s/) { + $possible =~ s/\s*$Type\s*//g; + for my $modifier (split(' ', $possible)) { + if ($modifier !~ $notPermitted) { + warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); + push(@modifierListFile, $modifier); + } + } + + } else { + warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); + push(@typeListFile, $possible); + } + build_types(); + } else { + warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1); + } +} + +my $prefix = ''; + +sub show_type { + my ($type) = @_; + + $type =~ tr/[a-z]/[A-Z]/; + + return defined $use_type{$type} if (scalar keys %use_type > 0); + + return !defined $ignore_type{$type}; +} + +sub report { + my ($level, $type, $msg) = @_; + + if (!show_type($type) || + (defined $tst_only && $msg !~ /\Q$tst_only\E/)) { + return 0; + } + my $output = ''; + if ($color) { + if ($level eq 'ERROR') { + $output .= RED; + } elsif ($level eq 'WARNING') { + $output .= YELLOW; + } else { + $output .= GREEN; + } + } + $output .= $prefix . $level . ':'; + if ($show_types) { + $output .= BLUE if ($color); + $output .= "$type:"; + } + $output .= RESET if ($color); + $output .= ' ' . $msg . "\n"; + + if ($showfile) { + my @lines = split("\n", $output, -1); + splice(@lines, 1, 1); + $output = join("\n", @lines); + } + $output = (split('\n', $output))[0] . "\n" if ($terse); + + push(our @report, $output); + + return 1; +} + +sub report_dump { + our @report; +} + +sub fixup_current_range { + my ($lineRef, $offset, $length) = @_; + + if ($$lineRef =~ /^\@\@ -\d+,\d+ \+(\d+),(\d+) \@\@/) { + my $o = $1; + my $l = $2; + my $no = $o + $offset; + my $nl = $l + $length; + $$lineRef =~ s/\+$o,$l \@\@/\+$no,$nl \@\@/; + } +} + +sub fix_inserted_deleted_lines { + my ($linesRef, $insertedRef, $deletedRef) = @_; + + my $range_last_linenr = 0; + my $delta_offset = 0; + + my $old_linenr = 0; + my $new_linenr = 0; + + my $next_insert = 0; + my $next_delete = 0; + + my @lines = (); + + my $inserted = @{$insertedRef}[$next_insert++]; + my $deleted = @{$deletedRef}[$next_delete++]; + + foreach my $old_line (@{$linesRef}) { + my $save_line = 1; + my $line = $old_line; #don't modify the array + if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\S+/) { #new filename + $delta_offset = 0; + } elsif ($line =~ /^\@\@ -\d+,\d+ \+\d+,\d+ \@\@/) { #new hunk + $range_last_linenr = $new_linenr; + fixup_current_range(\$line, $delta_offset, 0); + } + + while (defined($deleted) && ${$deleted}{'LINENR'} == $old_linenr) { + $deleted = @{$deletedRef}[$next_delete++]; + $save_line = 0; + fixup_current_range(\$lines[$range_last_linenr], $delta_offset--, -1); + } + + while (defined($inserted) && ${$inserted}{'LINENR'} == $old_linenr) { + push(@lines, ${$inserted}{'LINE'}); + $inserted = @{$insertedRef}[$next_insert++]; + $new_linenr++; + fixup_current_range(\$lines[$range_last_linenr], $delta_offset++, 1); + } + + if ($save_line) { + push(@lines, $line); + $new_linenr++; + } + + $old_linenr++; + } + + return @lines; +} + +sub fix_insert_line { + my ($linenr, $line) = @_; + + my $inserted = { + LINENR => $linenr, + LINE => $line, + }; + push(@fixed_inserted, $inserted); +} + +sub fix_delete_line { + my ($linenr, $line) = @_; + + my $deleted = { + LINENR => $linenr, + LINE => $line, + }; + + push(@fixed_deleted, $deleted); +} + +sub ERROR { + my ($type, $msg) = @_; + + if (report("ERROR", $type, $msg)) { + our $clean = 0; + our $cnt_error++; + return 1; + } + return 0; +} +sub WARN { + my ($type, $msg) = @_; + + if (report("WARNING", $type, $msg)) { + our $clean = 0; + our $cnt_warn++; + return 1; + } + return 0; +} +sub CHK { + my ($type, $msg) = @_; + + if ($check && report("CHECK", $type, $msg)) { + our $clean = 0; + our $cnt_chk++; + return 1; + } + return 0; +} + +sub check_absolute_file { + my ($absolute, $herecurr) = @_; + my $file = $absolute; + + ##print "absolute<$absolute>\n"; + + # See if any suffix of this path is a path within the tree. + while ($file =~ s@^[^/]*/@@) { + if (-f "$root/$file") { + ##print "file<$file>\n"; + last; + } + } + if (! -f _) { + return 0; + } + + # It is, so see if the prefix is acceptable. + my $prefix = $absolute; + substr($prefix, -length($file)) = ''; + + ##print "prefix<$prefix>\n"; + if ($prefix ne ".../") { + WARN("USE_RELATIVE_PATH", + "use relative pathname instead of absolute in changelog text\n" . $herecurr); + } +} + +sub trim { + my ($string) = @_; + + $string =~ s/^\s+|\s+$//g; + + return $string; +} + +sub ltrim { + my ($string) = @_; + + $string =~ s/^\s+//; + + return $string; +} + +sub rtrim { + my ($string) = @_; + + $string =~ s/\s+$//; + + return $string; +} + +sub string_find_replace { + my ($string, $find, $replace) = @_; + + $string =~ s/$find/$replace/g; + + return $string; +} + +sub tabify { + my ($leading) = @_; + + my $source_indent = 8; + my $max_spaces_before_tab = $source_indent - 1; + my $spaces_to_tab = " " x $source_indent; + + #convert leading spaces to tabs + 1 while $leading =~ s@^([\t]*)$spaces_to_tab@$1\t@g; + #Remove spaces before a tab + 1 while $leading =~ s@^([\t]*)( {1,$max_spaces_before_tab})\t@$1\t@g; + + return "$leading"; +} + +sub pos_last_openparen { + my ($line) = @_; + + my $pos = 0; + + my $opens = $line =~ tr/\(/\(/; + my $closes = $line =~ tr/\)/\)/; + + my $last_openparen = 0; + + if (($opens == 0) || ($closes >= $opens)) { + return -1; + } + + my $len = length($line); + + for ($pos = 0; $pos < $len; $pos++) { + my $string = substr($line, $pos); + if ($string =~ /^($FuncArg|$balanced_parens)/) { + $pos += length($1) - 1; + } elsif (substr($line, $pos, 1) eq '(') { + $last_openparen = $pos; + } elsif (index($string, '(') == -1) { + last; + } + } + + return length(expand_tabs(substr($line, 0, $last_openparen))) + 1; +} + +sub process { + my $filename = shift; + + my $linenr=0; + my $prevline=""; + my $prevrawline=""; + my $stashline=""; + my $stashrawline=""; + + my $length; + my $indent; + my $previndent=0; + my $stashindent=0; + + our $clean = 1; + my $signoff = 0; + my $author = ''; + my $authorsignoff = 0; + my $is_patch = 0; + my $is_binding_patch = -1; + my $in_header_lines = $file ? 0 : 1; + my $in_commit_log = 0; #Scanning lines before patch + my $has_commit_log = 0; #Encountered lines before patch + my $commit_log_lines = 0; #Number of commit log lines + my $commit_log_possible_stack_dump = 0; + my $commit_log_long_line = 0; + my $commit_log_has_diff = 0; + my $reported_maintainer_file = 0; + my $reported_abi_update = 0; + my $last_abi_file = ''; + my $non_utf8_charset = 0; + + my $last_blank_line = 0; + my $last_coalesced_string_linenr = -1; + + our @report = (); + our $cnt_lines = 0; + our $cnt_error = 0; + our $cnt_warn = 0; + our $cnt_chk = 0; + + # Trace the real file/line as we go. + my $realfile = ''; + my $realline = 0; + my $realcnt = 0; + my $here = ''; + my $context_function; #undef'd unless there's a known function + my $in_comment = 0; + my $comment_edge = 0; + my $first_line = 0; + my $p1_prefix = ''; + + my $prev_values = 'E'; + + # suppression flags + my %suppress_ifbraces; + my %suppress_whiletrailers; + my %suppress_export; + my $suppress_statement = 0; + + my %signatures = (); + + # Pre-scan the patch sanitizing the lines. + # Pre-scan the patch looking for any __setup documentation. + # + my @setup_docs = (); + my $setup_docs = 0; + + my $camelcase_file_seeded = 0; + + my $checklicenseline = 1; + + sanitise_line_reset(); + my $line; + foreach my $rawline (@rawlines) { + $linenr++; + $line = $rawline; + + push(@fixed, $rawline) if ($fix); + + if ($rawline=~/^\+\+\+\s+(\S+)/) { + $setup_docs = 0; + if ($1 =~ m@Documentation/admin-guide/kernel-parameters.rst$@) { + $setup_docs = 1; + } + #next; + } + if ($rawline =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + $in_comment = 0; + + # Guestimate if this is a continuing comment. Run + # the context looking for a comment "edge". If this + # edge is a close comment then we must be in a comment + # at context start. + my $edge; + my $cnt = $realcnt; + for (my $ln = $linenr + 1; $cnt > 0; $ln++) { + next if (defined $rawlines[$ln - 1] && + $rawlines[$ln - 1] =~ /^-/); + $cnt--; + #print "RAW<$rawlines[$ln - 1]>\n"; + last if (!defined $rawlines[$ln - 1]); + if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ && + $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) { + ($edge) = $1; + last; + } + } + if (defined $edge && $edge eq '*/') { + $in_comment = 1; + } + + # Guestimate if this is a continuing comment. If this + # is the start of a diff block and this line starts + # ' *' then it is very likely a comment. + if (!defined $edge && + $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@) + { + $in_comment = 1; + } + + ##print "COMMENT:$in_comment edge<$edge> $rawline\n"; + sanitise_line_reset($in_comment); + + } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) { + # Standardise the strings and chars within the input to + # simplify matching -- only bother with positive lines. + $line = sanitise_line($rawline); + } + + # Check if ABI is being updated. If so, there's probably no need to + # emit the "does ABI need updating?" message on file add/move/delete + if ($SOF && + ($line =~ /\+#define SOF_ABI_MAJOR*/ || + $line =~ /\+#define SOF_ABI_MINOR*/ || + $line =~ /\+#define SOF_ABI_PATCH*/)) { + $reported_abi_update = 1; + } + + push(@lines, $line); + + if ($realcnt > 1) { + $realcnt-- if ($line =~ /^(?:\+| |$)/); + } else { + $realcnt = 0; + } + + #print "==>$rawline\n"; + #print "-->$line\n"; + + if ($setup_docs && $line =~ /^\+/) { + push(@setup_docs, $line); + } + } + + $prefix = ''; + + $realcnt = 0; + $linenr = 0; + $fixlinenr = -1; + foreach my $line (@lines) { + $linenr++; + $fixlinenr++; + my $sline = $line; #copy of $line + $sline =~ s/$;/ /g; #with comments as spaces + + my $rawline = $rawlines[$linenr - 1]; + +# check if it's a mode change, rename or start of a patch + if (!$in_commit_log && + ($line =~ /^ mode change [0-7]+ => [0-7]+ \S+\s*$/ || + ($line =~ /^rename (?:from|to) \S+\s*$/ || + $line =~ /^diff --git a\/[\w\/\.\_\-]+ b\/\S+\s*$/))) { + $is_patch = 1; + } + +#extract the line range in the file after the patch is applied + if (!$in_commit_log && + $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { + my $context = $4; + $is_patch = 1; + $first_line = $linenr + 1; + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + annotate_reset(); + $prev_values = 'E'; + + %suppress_ifbraces = (); + %suppress_whiletrailers = (); + %suppress_export = (); + $suppress_statement = 0; + if ($context =~ /\b(\w+)\s*\(/) { + $context_function = $1; + } else { + undef $context_function; + } + next; + +# track the line number as we move through the hunk, note that +# new versions of GNU diff omit the leading space on completely +# blank context lines so we need to count that too. + } elsif ($line =~ /^( |\+|$)/) { + $realline++; + $realcnt-- if ($realcnt != 0); + + # Measure the line length and indent. + ($length, $indent) = line_stats($rawline); + + # Track the previous line. + ($prevline, $stashline) = ($stashline, $line); + ($previndent, $stashindent) = ($stashindent, $indent); + ($prevrawline, $stashrawline) = ($stashrawline, $rawline); + + #warn "line<$line>\n"; + + } elsif ($realcnt == 1) { + $realcnt--; + } + + my $hunk_line = ($realcnt != 0); + + $here = "#$linenr: " if (!$file); + $here = "#$realline: " if ($file); + + my $found_file = 0; + # extract the filename as it passes + if ($line =~ /^diff --git.*?(\S+)$/) { + $realfile = $1; + $realfile =~ s@^([^/]*)/@@ if (!$file); + $in_commit_log = 0; + $found_file = 1; + } elsif ($line =~ /^\+\+\+\s+(\S+)/) { + $realfile = $1; + $realfile =~ s@^([^/]*)/@@ if (!$file); + $in_commit_log = 0; + + $p1_prefix = $1; + if (!$file && $tree && $p1_prefix ne '' && + -e "$root/$p1_prefix") { + WARN("PATCH_PREFIX", + "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); + } + + if ($realfile =~ m@^include/asm/@) { + ERROR("MODIFIED_INCLUDE_ASM", + "do not modify files in include/asm, change architecture specific files in include/asm-\n" . "$here$rawline\n"); + } + $found_file = 1; + } + +#make up the handle for any error we report on this line + if ($showfile) { + $prefix = "$realfile:$realline: " + } elsif ($emacs) { + if ($file) { + $prefix = "$filename:$realline: "; + } else { + $prefix = "$filename:$linenr: "; + } + } + + if ($found_file) { + if (is_maintained_obsolete($realfile)) { + WARN("OBSOLETE", + "$realfile is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.\n"); + } + if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) { + $check = 1; + } else { + $check = $check_orig; + } + $checklicenseline = 1; + + if ($realfile !~ /^MAINTAINERS/) { + my $last_binding_patch = $is_binding_patch; + + $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@; + + if (($last_binding_patch != -1) && + ($last_binding_patch ^ $is_binding_patch)) { + WARN("DT_SPLIT_BINDING_PATCH", + "DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt\n"); + } + } + + next; + } + + $here .= "FILE: $realfile:$realline:" if ($realcnt != 0); + + my $hereline = "$here\n$rawline\n"; + my $herecurr = "$here\n$rawline\n"; + my $hereprev = "$here\n$prevrawline\n$rawline\n"; + + $cnt_lines++ if ($realcnt != 0); + +# Verify the existence of a commit log if appropriate +# 2 is used because a $signature is counted in $commit_log_lines + if ($in_commit_log) { + if ($line !~ /^\s*$/) { + $commit_log_lines++; #could be a $signature + } + } elsif ($has_commit_log && $commit_log_lines < 2) { + WARN("COMMIT_MESSAGE", + "Missing commit description - Add an appropriate one\n"); + $commit_log_lines = 2; #warn only once + } + +# Check if the commit log has what seems like a diff which can confuse patch + if ($in_commit_log && !$commit_log_has_diff && + (($line =~ m@^\s+diff\b.*a/[\w/]+@ && + $line =~ m@^\s+diff\b.*a/([\w/]+)\s+b/$1\b@) || + $line =~ m@^\s*(?:\-\-\-\s+a/|\+\+\+\s+b/)@ || + $line =~ m/^\s*\@\@ \-\d+,\d+ \+\d+,\d+ \@\@/)) { + ERROR("DIFF_IN_COMMIT_MSG", + "Avoid using diff content in the commit message - patch(1) might not work\n" . $herecurr); + $commit_log_has_diff = 1; + } + +# Check for incorrect file permissions + if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) { + my $permhere = $here . "FILE: $realfile\n"; + if ($realfile !~ m@scripts/@ && + $realfile !~ /\.(py|pl|awk|sh)$/) { + ERROR("EXECUTE_PERMISSIONS", + "do not set execute permissions for source files\n" . $permhere); + } + } + +# Check the patch for a From: + if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) { + $author = $1; + $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); + $author =~ s/"//g; + } + +# Check the patch for a signoff: + if ($line =~ /^\s*signed-off-by:/i) { + $signoff++; + $in_commit_log = 0; + if ($author ne '') { + my $l = $line; + $l =~ s/"//g; + if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) { + $authorsignoff = 1; + } + } + } + + +# Check if MAINTAINERS is being updated. If so, there's probably no need to +# emit the "does MAINTAINERS need updating?" message on file add/move/delete + if ($line =~ /^\s*MAINTAINERS\s*\|/) { + $reported_maintainer_file = 1; + } + +# Check signature styles + if (!$in_header_lines && + $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) { + my $space_before = $1; + my $sign_off = $2; + my $space_after = $3; + my $email = $4; + my $ucfirst_sign_off = ucfirst(lc($sign_off)); + + if ($sign_off !~ /$signature_tags/) { + WARN("BAD_SIGN_OFF", + "Non-standard signature: $sign_off\n" . $herecurr); + } + if (defined $space_before && $space_before ne "") { + if (WARN("BAD_SIGN_OFF", + "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + } + if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) { + if (WARN("BAD_SIGN_OFF", + "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + + } + if (!defined $space_after || $space_after ne " ") { + if (WARN("BAD_SIGN_OFF", + "Use a single space after $ucfirst_sign_off\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + } + + my ($email_name, $email_address, $comment) = parse_email($email); + my $suggested_email = format_email(($email_name, $email_address)); + if ($suggested_email eq "") { + ERROR("BAD_SIGN_OFF", + "Unrecognized email address: '$email'\n" . $herecurr); + } else { + my $dequoted = $suggested_email; + $dequoted =~ s/^"//; + $dequoted =~ s/" $comment" ne $email && + "$suggested_email$comment" ne $email) { + WARN("BAD_SIGN_OFF", + "email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr); + } + } + +# Check for duplicate signatures + my $sig_nospace = $line; + $sig_nospace =~ s/\s//g; + $sig_nospace = lc($sig_nospace); + if (defined $signatures{$sig_nospace}) { + WARN("BAD_SIGN_OFF", + "Duplicate signature\n" . $herecurr); + } else { + $signatures{$sig_nospace} = 1; + } + +# Check Co-developed-by: immediately followed by Signed-off-by: with same name and email + if ($sign_off =~ /^co-developed-by:$/i) { + if ($email eq $author) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline); + } + if (!defined $lines[$linenr]) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline); + } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } elsif ($1 ne $email) { + WARN("BAD_SIGN_OFF", + "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } + } + } + +# Check email subject for common tools that don't need to be mentioned + if ($in_header_lines && + $line =~ /^Subject:.*\b(?:checkpatch|sparse|smatch)\b[^:]/i) { + WARN("EMAIL_SUBJECT", + "A patch subject line should describe the change not the tool that found it\n" . $herecurr); + } + +# Check for unwanted Gerrit info + if ($in_commit_log && $line =~ /^\s*change-id:/i) { + ERROR("GERRIT_CHANGE_ID", + "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); + } + +# Check if the commit log is in a possible stack dump + if ($in_commit_log && !$commit_log_possible_stack_dump && + ($line =~ /^\s*(?:WARNING:|BUG:)/ || + $line =~ /^\s*\[\s*\d+\.\d{6,6}\s*\]/ || + # timestamp + $line =~ /^\s*\[\<[0-9a-fA-F]{8,}\>\]/) || + $line =~ /^(?:\s+\w+:\s+[0-9a-fA-F]+){3,3}/ || + $line =~ /^\s*\#\d+\s*\[[0-9a-fA-F]+\]\s*\w+ at [0-9a-fA-F]+/) { + # stack dump address styles + $commit_log_possible_stack_dump = 1; + } + +# Check for line lengths > 75 in commit log, warn once + if ($in_commit_log && !$commit_log_long_line && + length($line) > 75 && + !($line =~ /^\s*[a-zA-Z0-9_\/\.]+\s+\|\s+\d+/ || + # file delta changes + $line =~ /^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:/ || + # filename then : + $line =~ /^\s*(?:Fixes:|Link:)/i || + # A Fixes: or Link: line + $commit_log_possible_stack_dump)) { + WARN("COMMIT_LOG_LONG_LINE", + "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); + $commit_log_long_line = 1; + } + +# Reset possible stack dump if a blank line is found + if ($in_commit_log && $commit_log_possible_stack_dump && + $line =~ /^\s*$/) { + $commit_log_possible_stack_dump = 0; + } + +# Check for git id commit length and improperly formed commit descriptions + if ($in_commit_log && !$commit_log_possible_stack_dump && + $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i && + $line !~ /^This reverts commit [0-9a-f]{7,40}/ && + ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i || + ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i && + $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i && + $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) { + my $init_char = "c"; + my $orig_commit = ""; + my $short = 1; + my $long = 0; + my $case = 1; + my $space = 1; + my $hasdesc = 0; + my $hasparens = 0; + my $id = '0123456789ab'; + my $orig_desc = "commit description"; + my $description = ""; + + if ($line =~ /\b(c)ommit\s+([0-9a-f]{5,})\b/i) { + $init_char = $1; + $orig_commit = lc($2); + } elsif ($line =~ /\b([0-9a-f]{12,40})\b/i) { + $orig_commit = lc($1); + } + + $short = 0 if ($line =~ /\bcommit\s+[0-9a-f]{12,40}/i); + $long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i); + $space = 0 if ($line =~ /\bcommit [0-9a-f]/i); + $case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/); + if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) { + $orig_desc = $1; + $hasparens = 1; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) { + $orig_desc = $1; + $hasparens = 1; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*[^"]+"\)/) { + $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i; + $orig_desc = $1; + $rawlines[$linenr] =~ /^\s*([^"]+)"\)/; + $orig_desc .= " " . $1; + $hasparens = 1; + } + + ($id, $description) = git_commit_info($orig_commit, + $id, $orig_desc); + + if (defined($id) && + ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) { + ERROR("GIT_COMMIT_ID", + "Please use git commit description style 'commit <12+ chars of sha1> (\"\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr); + } + } + +# Check for added, moved or deleted files + if (!$SOF && + (!$reported_maintainer_file && !$in_commit_log && + ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ || + $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ || + ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ && + (defined($1) || defined($2)))))) { + $is_patch = 1; + $reported_maintainer_file = 1; + WARN("FILE_PATH_CHANGES", + "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr); + } + +# Check for wrappage within a valid hunk of the file + if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { + ERROR("CORRUPTED_PATCH", + "patch seems to be corrupt (line wrapped?)\n" . + $herecurr) if (!$emitted_corrupt++); + } + +# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php + if (($realfile =~ /^$/ || $line =~ /^\+/) && + $rawline !~ m/^$UTF8*$/) { + my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/); + + my $blank = copy_spacing($rawline); + my $ptr = substr($blank, 0, length($utf8_prefix)) . "^"; + my $hereptr = "$hereline$ptr\n"; + + CHK("INVALID_UTF8", + "Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); + } + +# Check if it's the start of a commit log +# (not a header line and we haven't seen the patch filename) + if ($in_header_lines && $realfile =~ /^$/ && + !($rawline =~ /^\s+(?:\S|$)/ || + $rawline =~ /^(?:commit\b|from\b|[\w-]+:)/i)) { + $in_header_lines = 0; + $in_commit_log = 1; + $has_commit_log = 1; + } + +# Check if there is UTF-8 in a commit log when a mail header has explicitly +# declined it, i.e defined some charset where it is missing. + if ($in_header_lines && + $rawline =~ /^Content-Type:.+charset="(.+)".*$/ && + $1 !~ /utf-8/i) { + $non_utf8_charset = 1; + } + + if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ && + $rawline =~ /$NON_ASCII_UTF8/) { + WARN("UTF8_BEFORE_PATCH", + "8-bit UTF-8 used in possible commit log\n" . $herecurr); + } + +# Check for absolute kernel paths in commit message + if ($tree && $in_commit_log) { + while ($line =~ m{(?:^|\s)(/\S*)}g) { + my $file = $1; + + if ($file =~ m{^(.*?)(?::\d+)+:?$} && + check_absolute_file($1, $herecurr)) { + # + } else { + check_absolute_file($file, $herecurr); + } + } + } + +# Check for various typo / spelling mistakes + if (defined($misspellings) && + ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { + while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) { + my $typo = $1; + my $typo_fix = $spelling_fix{lc($typo)}; + $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/); + $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/); + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + if (&{$msg_level}("TYPO_SPELLING", + "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($typo)($|[^A-Za-z@])/$1$typo_fix$3/; + } + } + } + +# check for invalid commit id + if ($in_commit_log && $line =~ /(^fixes:|\bcommit)\s+([0-9a-f]{6,40})\b/i) { + my $id; + my $description; + ($id, $description) = git_commit_info($2, undef, undef); + if (!defined($id)) { + WARN("UNKNOWN_COMMIT_ID", + "Unknown commit id '$2', maybe rebased or not pulled?\n" . $herecurr); + } + } + +# ignore non-hunk lines and lines being removed + next if (!$hunk_line || $line =~ /^-/); + +#trailing whitespace + if ($line =~ /^\+.*\015/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (ERROR("DOS_LINE_ENDINGS", + "DOS line endings\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/[\s\015]+$//; + } + } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (ERROR("TRAILING_WHITESPACE", + "trailing whitespace\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+$//; + } + + $rpt_cleaners = 1; + } + +# Check for FSF mailing addresses. + if ($rawline =~ /\bwrite to the Free/i || + $rawline =~ /\b675\s+Mass\s+Ave/i || + $rawline =~ /\b59\s+Temple\s+Pl/i || + $rawline =~ /\b51\s+Franklin\s+St/i) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + my $msg_level = \&ERROR; + $msg_level = \&CHK if ($file); + &{$msg_level}("FSF_MAILING_ADDRESS", + "Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL.\n" . $herevet) + } + +# check for Kconfig help text having a real description +# Only applies when adding the entry originally, after that we do not have +# sufficient context to determine whether it is indeed long enough. + if ($realfile =~ /Kconfig/ && + # 'choice' is usually the last thing on the line (though + # Kconfig supports named choices), so use a word boundary + # (\b) rather than a whitespace character (\s) + $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) { + my $length = 0; + my $cnt = $realcnt; + my $ln = $linenr + 1; + my $f; + my $is_start = 0; + my $is_end = 0; + for (; $cnt > 0 && defined $lines[$ln - 1]; $ln++) { + $f = $lines[$ln - 1]; + $cnt-- if ($lines[$ln - 1] !~ /^-/); + $is_end = $lines[$ln - 1] =~ /^\+/; + + next if ($f =~ /^-/); + last if (!$file && $f =~ /^\@\@/); + + if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { + $is_start = 1; + } elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) { + if ($lines[$ln - 1] =~ "---help---") { + WARN("CONFIG_DESCRIPTION", + "prefer 'help' over '---help---' for new help texts\n" . $herecurr); + } + $length = -1; + } + + $f =~ s/^.//; + $f =~ s/#.*//; + $f =~ s/^\s+//; + next if ($f =~ /^$/); + + # This only checks context lines in the patch + # and so hopefully shouldn't trigger false + # positives, even though some of these are + # common words in help texts + if ($f =~ /^\s*(?:config|menuconfig|choice|endchoice| + if|endif|menu|endmenu|source)\b/x) { + $is_end = 1; + last; + } + $length++; + } + if ($is_start && $is_end && $length < $min_conf_desc_length) { + WARN("CONFIG_DESCRIPTION", + "please write a paragraph that describes the config symbol fully\n" . $herecurr); + } + #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; + } + +# check for MAINTAINERS entries that don't have the right form + if ($realfile =~ /^MAINTAINERS$/ && + $rawline =~ /^\+[A-Z]:/ && + $rawline !~ /^\+[A-Z]:\t\S/) { + if (WARN("MAINTAINERS_STYLE", + "MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/; + } + } + +# discourage the use of boolean for type definition attributes of Kconfig options + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bboolean\b/) { + WARN("CONFIG_TYPE_BOOLEAN", + "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); + } + + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && + ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { + my $flag = $1; + my $replacement = { + 'EXTRA_AFLAGS' => 'asflags-y', + 'EXTRA_CFLAGS' => 'ccflags-y', + 'EXTRA_CPPFLAGS' => 'cppflags-y', + 'EXTRA_LDFLAGS' => 'ldflags-y', + }; + + WARN("DEPRECATED_VARIABLE", + "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag}); + } + +# check for DT compatible documentation + if (defined $root && + (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) || + ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) { + + my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; + + my $dt_path = $root . "/Documentation/devicetree/bindings/"; + my $vp_file = $dt_path . "vendor-prefixes.yaml"; + + foreach my $compat (@compats) { + my $compat2 = $compat; + $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/; + my $compat3 = $compat; + $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/; + `grep -Erq "$compat|$compat2|$compat3" $dt_path`; + if ( $? >> 8 ) { + WARN("UNDOCUMENTED_DT_STRING", + "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); + } + + next if $compat !~ /^([a-zA-Z0-9\-]+)\,/; + my $vendor = $1; + `grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`; + if ( $? >> 8 ) { + WARN("UNDOCUMENTED_DT_STRING", + "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr); + } + } + } + +# check for using SPDX license tag at beginning of files + if ($realline == $checklicenseline) { + if ($rawline =~ /^[ \+]\s*\#\!\s*\//) { + $checklicenseline = 2; + } elsif ($rawline =~ /^\+/) { + my $comment = ""; + if ($realfile =~ /\.(h|s|S)$/) { + $comment = '/*'; + } elsif ($realfile =~ /\.(c|dts|dtsi)$/) { + $comment = '//'; + } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc)$/) { + $comment = '#'; + } elsif ($realfile =~ /\.rst$/) { + $comment = '..'; + } + +# check SPDX comment style for .[chsS] files + if ($realfile =~ /\.[chsS]$/ && + $rawline =~ /SPDX-License-Identifier:/ && + $rawline !~ m@^\+\s*\Q$comment\E\s*@) { + WARN("SPDX_LICENSE_TAG", + "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr); + } + + if ($comment !~ /^$/ && + $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) { + WARN("SPDX_LICENSE_TAG", + "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); + } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { + my $spdx_license = $1; + if (!is_SPDX_License_valid($spdx_license)) { + WARN("SPDX_LICENSE_TAG", + "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); + } + } + } + } + +# check we are in a valid source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); + +# check for using SPDX-License-Identifier on the wrong line number + if ($realline != $checklicenseline && + $rawline =~ /\bSPDX-License-Identifier:/ && + substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) { + WARN("SPDX_LICENSE_TAG", + "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); + } + +# line length limit (with some exclusions) +# +# There are a few types of lines that may extend beyond $max_line_length: +# logging functions like pr_info that end in a string +# lines with a single string +# #defines that are a single string +# lines with an RFC3986 like URL +# +# There are 3 different line length message types: +# LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length +# LONG_LINE_STRING a string starts before but extends beyond $max_line_length +# LONG_LINE all other lines longer than $max_line_length +# +# if LONG_LINE is ignored, the other 2 types are also ignored +# + + if ($line =~ /^\+/ && $length > $max_line_length) { + my $msg_type = "LONG_LINE"; + + # Check the allowed long line types first + + # logging functions that end in a string that starts + # before $max_line_length + if ($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(?:KERN_\S+\s*|[^"]*))?($String\s*(?:|,|\)\s*;)\s*)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = ""; + + # lines with only strings (w/ possible termination) + # #defines with only strings + } elsif ($line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ || + $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) { + $msg_type = ""; + + # More special cases + } elsif ($line =~ /^\+.*\bEFI_GUID\s*\(/ || + $line =~ /^\+\s*(?:\w+)?\s*DEFINE_PER_CPU/) { + $msg_type = ""; + + # URL ($rawline is used in case the URL is in a comment) + } elsif ($rawline =~ /^\+.*\b[a-z][\w\.\+\-]*:\/\/\S+/i) { + $msg_type = ""; + + # Otherwise set the alternate message types + + # a comment starts before $max_line_length + } elsif ($line =~ /($;[\s$;]*)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = "LONG_LINE_COMMENT" + + # a quoted string starts before $max_line_length + } elsif ($sline =~ /\s*($String(?:\s*(?:\\|,\s*|\)\s*;\s*))?)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = "LONG_LINE_STRING" + } + + if ($msg_type ne "" && + (show_type("LONG_LINE") || show_type($msg_type))) { + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + &{$msg_level}($msg_type, + "line length of $length exceeds $max_line_length columns\n" . $herecurr); + } + } + +# check for adding lines without a newline. + if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { + WARN("MISSING_EOF_NEWLINE", + "adding a line without newline at end of file\n" . $herecurr); + } + +# check we are in a valid source file C or perl if not then ignore this hunk + next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/); + +# at the beginning of a line any tabs must come first and anything +# more than 8 must use tabs. + if ($rawline =~ /^\+\s* \t\s*\S/ || + $rawline =~ /^\+\s* \s*/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + $rpt_cleaners = 1; + if (ERROR("CODE_INDENT", + "code indent should use tabs where possible\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/^\+([ \t]+)/"\+" . tabify($1)/e; + } + } + +# check for space before tabs. + if ($rawline =~ /^\+/ && $rawline =~ / \t/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (WARN("SPACE_BEFORE_TAB", + "please, no space before tabs\n" . $herevet) && + $fix) { + while ($fixed[$fixlinenr] =~ + s/(^\+.*) {8,8}\t/$1\t\t/) {} + while ($fixed[$fixlinenr] =~ + s/(^\+.*) +\t/$1\t/) {} + } + } + +# check for assignments on the start of a line + if ($sline =~ /^\+\s+($Assignment)[^=]/) { + CHK("ASSIGNMENT_CONTINUATIONS", + "Assignment operator '$1' should be on the previous line\n" . $hereprev); + } + +# check for && or || at the start of a line + if ($rawline =~ /^\+\s*(&&|\|\|)/) { + CHK("LOGICAL_CONTINUATIONS", + "Logical continuations should be on the previous line\n" . $hereprev); + } + +# check indentation starts on a tab stop + if ($perl_version_ok && + $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) { + my $indent = length($1); + if ($indent % 8) { + if (WARN("TABSTOP", + "Statements should start on a tabstop\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s@(^\+\t+) +@$1 . "\t" x ($indent/8)@e; + } + } + } + +# check multi-line statement indentation matches previous line + if ($perl_version_ok && + $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { + $prevline =~ /^\+(\t*)(.*)$/; + my $oldindent = $1; + my $rest = $2; + + my $pos = pos_last_openparen($rest); + if ($pos >= 0) { + $line =~ /^(\+| )([ \t]*)/; + my $newindent = $2; + + my $goodtabindent = $oldindent . + "\t" x ($pos / 8) . + " " x ($pos % 8); + my $goodspaceindent = $oldindent . " " x $pos; + + if ($newindent ne $goodtabindent && + $newindent ne $goodspaceindent) { + + if (CHK("PARENTHESIS_ALIGNMENT", + "Alignment should match open parenthesis\n" . $hereprev) && + $fix && $line =~ /^\+/) { + $fixed[$fixlinenr] =~ + s/^\+[ \t]*/\+$goodtabindent/; + } + } + } + } + +# check for space after cast like "(int) foo" or "(struct foo) bar" +# avoid checking a few false positives: +# "sizeof(<type>)" or "__alignof__(<type>)" +# function pointer declarations like "(*foo)(int) = bar;" +# structure definitions like "(struct foo) { 0 };" +# multiline macros that define functions +# known attributes or the __attribute__ keyword + if ($line =~ /^\+(.*)\(\s*$Type\s*\)([ \t]++)((?![={]|\\$|$Attribute|__attribute__))/ && + (!defined($1) || $1 !~ /\b(?:sizeof|__alignof__)\s*$/)) { + if (CHK("SPACING", + "No space is necessary after a cast\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/(\(\s*$Type\s*\))[ \t]+/$1/; + } + } + +# Block comment styles +# Networking with an initial /* + if ($realfile =~ m@^(drivers/net/|net/)@ && + $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && + $rawline =~ /^\+[ \t]*\*/ && + $realline > 2) { + WARN("NETWORKING_BLOCK_COMMENT_STYLE", + "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); + } + +# UAPI ABI version + if ($SOF && $realfile ne $last_abi_file && + $realfile =~ m@^(src/include/ipc/|src/include/kernel/|src/include/user/)@ && + $rawline =~ /^\+/ && + !$reported_abi_update) { + $last_abi_file = $realfile; + WARN("ABI update ??", + "Please update ABI in accordance with http://semver.org\n" . $hereprev); + } + +# Block comments use * on subsequent lines + if ($prevline =~ /$;[ \t]*$/ && #ends in comment + $prevrawline =~ /^\+.*?\/\*/ && #starting /* + $prevrawline !~ /\*\/[ \t]*$/ && #no trailing */ + $rawline =~ /^\+/ && #line is new + $rawline !~ /^\+[ \t]*\*/) { #no leading * + WARN("BLOCK_COMMENT_STYLE", + "Block comments use * on subsequent lines\n" . $hereprev); + } + +# Block comments use */ on trailing lines + if ($rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */ + $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/ + $rawline !~ m@^\+.*\*{2,}/[ \t]*$@ && #trailing **/ + $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) { #non blank */ + WARN("BLOCK_COMMENT_STYLE", + "Block comments use a trailing */ on a separate line\n" . $herecurr); + } + +# Block comment * alignment + if ($prevline =~ /$;[ \t]*$/ && #ends in comment + $line =~ /^\+[ \t]*$;/ && #leading comment + $rawline =~ /^\+[ \t]*\*/ && #leading * + (($prevrawline =~ /^\+.*?\/\*/ && #leading /* + $prevrawline !~ /\*\/[ \t]*$/) || #no trailing */ + $prevrawline =~ /^\+[ \t]*\*/)) { #leading * + my $oldindent; + $prevrawline =~ m@^\+([ \t]*/?)\*@; + if (defined($1)) { + $oldindent = expand_tabs($1); + } else { + $prevrawline =~ m@^\+(.*/?)\*@; + $oldindent = expand_tabs($1); + } + $rawline =~ m@^\+([ \t]*)\*@; + my $newindent = $1; + $newindent = expand_tabs($newindent); + if (length($oldindent) ne length($newindent)) { + WARN("BLOCK_COMMENT_STYLE", + "Block comments should align the * on each line\n" . $hereprev); + } + } + +# check for missing blank lines after struct/union declarations +# with exceptions for various attributes and macros + if ($prevline =~ /^[\+ ]};?\s*$/ && + $line =~ /^\+/ && + !($line =~ /^\+\s*$/ || + $line =~ /^\+\s*EXPORT_SYMBOL/ || + $line =~ /^\+\s*MODULE_/i || + $line =~ /^\+\s*\#\s*(?:end|elif|else)/ || + $line =~ /^\+[a-z_]*init/ || + $line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ || + $line =~ /^\+\s*DECLARE/ || + $line =~ /^\+\s*builtin_[\w_]*driver/ || + $line =~ /^\+\s*__setup/)) { + if (CHK("LINE_SPACING", + "Please use a blank line after function/struct/union/enum declarations\n" . $hereprev) && + $fix) { + fix_insert_line($fixlinenr, "\+"); + } + } + +# check for multiple consecutive blank lines + if ($prevline =~ /^[\+ ]\s*$/ && + $line =~ /^\+\s*$/ && + $last_blank_line != ($linenr - 1)) { + if (CHK("LINE_SPACING", + "Please don't use multiple blank lines\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + + $last_blank_line = $linenr; + } + +# check for missing blank lines after declarations + if ($sline =~ /^\+\s+\S/ && #Not at char 1 + # actual declarations + ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || + # foo bar; where foo is some local typedef or #define + $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || + # known declaration macros + $prevline =~ /^\+\s+$declaration_macros/) && + # for "else if" which can look like "$Ident $Ident" + !($prevline =~ /^\+\s+$c90_Keywords\b/ || + # other possible extensions of declaration lines + $prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ || + # not starting a section or a macro "\" extended line + $prevline =~ /(?:\{\s*|\\)$/) && + # looks like a declaration + !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || + # foo bar; where foo is some local typedef or #define + $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || + # known declaration macros + $sline =~ /^\+\s+$declaration_macros/ || + # start of struct or union or enum + $sline =~ /^\+\s+(?:static\s+)?(?:const\s+)?(?:union|struct|enum|typedef)\b/ || + # start or end of block or continuation of declaration + $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ || + # bitfield continuation + $sline =~ /^\+\s+$Ident\s*:\s*\d+\s*[,;]/ || + # other possible extensions of declaration lines + $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/) && + # indentation of previous and current line are the same + (($prevline =~ /\+(\s+)\S/) && $sline =~ /^\+$1\S/)) { + if (WARN("LINE_SPACING", + "Missing a blank line after declarations\n" . $hereprev) && + $fix) { + fix_insert_line($fixlinenr, "\+"); + } + } + +# check for spaces at the beginning of a line. +# Exceptions: +# 1) within comments +# 2) indented preprocessor commands +# 3) hanging labels + if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (WARN("LEADING_SPACE", + "please, no spaces at the start of a line\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/^\+([ \t]+)/"\+" . tabify($1)/e; + } + } + +# check we are in a valid C source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c)$/); + +# check for unusual line ending [ or ( + if ($line =~ /^\+.*([\[\(])\s*$/) { + CHK("OPEN_ENDED_LINE", + "Lines should not end with a '$1'\n" . $herecurr); + } + +# check if this appears to be the start function declaration, save the name + if ($sline =~ /^\+\{\s*$/ && + $prevline =~ /^\+(?:(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*)?($Ident)\(/) { + $context_function = $1; + } + +# check if this appears to be the end of function declaration + if ($sline =~ /^\+\}\s*$/) { + undef $context_function; + } + +# check indentation of any line with a bare else +# (but not if it is a multiple line "if (foo) return bar; else return baz;") +# if the previous line is a break or return and is indented 1 tab more... + if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) { + my $tabs = length($1) + 1; + if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ || + ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ && + defined $lines[$linenr] && + $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) { + WARN("UNNECESSARY_ELSE", + "else is not generally useful after a break or return\n" . $hereprev); + } + } + +# check indentation of a line with a break; +# if the previous line is a goto or return and is indented the same # of tabs + if ($sline =~ /^\+([\t]+)break\s*;\s*$/) { + my $tabs = $1; + if ($prevline =~ /^\+$tabs(?:goto|return)\b/) { + WARN("UNNECESSARY_BREAK", + "break is not useful after a goto or return\n" . $hereprev); + } + } + +# check for RCS/CVS revision markers + if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { + WARN("CVS_KEYWORD", + "CVS style keyword markers, these will _not_ be updated\n". $herecurr); + } + +# check for old HOTPLUG __dev<foo> section markings + if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) { + WARN("HOTPLUG_SECTION", + "Using $1 is unnecessary\n" . $herecurr); + } + +# Check for potential 'bare' types + my ($stat, $cond, $line_nr_next, $remain_next, $off_next, + $realline_next); +#print "LINE<$line>\n"; + if ($linenr > $suppress_statement && + $realcnt && $sline =~ /.\s*\S/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0); + $stat =~ s/\n./\n /g; + $cond =~ s/\n./\n /g; + +#print "linenr<$linenr> <$stat>\n"; + # If this statement has no statement boundaries within + # it there is no point in retrying a statement scan + # until we hit end of it. + my $frag = $stat; $frag =~ s/;+\s*$//; + if ($frag !~ /(?:{|;)/) { +#print "skip<$line_nr_next>\n"; + $suppress_statement = $line_nr_next; + } + + # Find the real next line. + $realline_next = $line_nr_next; + if (defined $realline_next && + (!defined $lines[$realline_next - 1] || + substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) { + $realline_next++; + } + + my $s = $stat; + $s =~ s/{.*$//s; + + # Ignore goto labels. + if ($s =~ /$Ident:\*$/s) { + + # Ignore functions being called + } elsif ($s =~ /^.\s*$Ident\s*\(/s) { + + } elsif ($s =~ /^.\s*else\b/s) { + + # declarations always start with types + } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) { + my $type = $1; + $type =~ s/\s+/ /g; + possible($type, "A:" . $s); + + # definitions in global scope can only start with types + } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) { + possible($1, "B:" . $s); + } + + # any (foo ... *) is a pointer cast, and foo is a type + while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) { + possible($1, "C:" . $s); + } + + # Check for any sort of function declaration. + # int foo(something bar, other baz); + # void (*store_gdt)(x86_descr_ptr *); + if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) { + my ($name_len) = length($1); + + my $ctx = $s; + substr($ctx, 0, $name_len + 1, ''); + $ctx =~ s/\)[^\)]*$//; + + for my $arg (split(/\s*,\s*/, $ctx)) { + if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) { + + possible($1, "D:" . $s); + } + } + } + + } + +# +# Checks which may be anchored in the context. +# + +# Check for switch () and associated case and default +# statements should be at the same indent. + if ($line=~/\bswitch\s*\(.*\)/) { + my $err = ''; + my $sep = ''; + my @ctx = ctx_block_outer($linenr, $realcnt); + shift(@ctx); + for my $ctx (@ctx) { + my ($clen, $cindent) = line_stats($ctx); + if ($ctx =~ /^\+\s*(case\s+|default:)/ && + $indent != $cindent) { + $err .= "$sep$ctx\n"; + $sep = ''; + } else { + $sep = "[...]\n"; + } + } + if ($err ne '') { + ERROR("SWITCH_CASE_INDENT_LEVEL", + "switch and case should be at the same indent\n$hereline$err"); + } + } + +# if/while/etc brace do not go on next line, unless defining a do while loop, +# or if that brace on the next line is for something else + if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { + my $pre_ctx = "$1$2"; + + my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); + + if ($line =~ /^\+\t{6,}/) { + WARN("DEEP_INDENTATION", + "Too many leading tabs - consider code refactoring\n" . $herecurr); + } + + my $ctx_cnt = $realcnt - $#ctx - 1; + my $ctx = join("\n", @ctx); + + my $ctx_ln = $linenr; + my $ctx_skip = $realcnt; + + while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt && + defined $lines[$ctx_ln - 1] && + $lines[$ctx_ln - 1] =~ /^-/)) { + ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n"; + $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/); + $ctx_ln++; + } + + #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; + #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; + + if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln - 1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { + ERROR("OPEN_BRACE", + "that open brace { should be on the previous line\n" . + "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); + } + if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ && + $ctx =~ /\)\s*\;\s*$/ && + defined $lines[$ctx_ln - 1]) + { + my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]); + if ($nindent > $indent) { + WARN("TRAILING_SEMICOLON", + "trailing semicolon indicates no statements, indent implies otherwise\n" . + "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); + } + } + } + +# Check relative indent for conditionals and blocks. + if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0) + if (!defined $stat); + my ($s, $c) = ($stat, $cond); + + substr($s, 0, length($c), ''); + + # remove inline comments + $s =~ s/$;/ /g; + $c =~ s/$;/ /g; + + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + + # Make sure we remove the line prefixes as we have + # none on the first line, and are going to readd them + # where necessary. + $s =~ s/\n./\n/gs; + while ($s =~ /\n\s+\\\n/) { + $cond_lines += $s =~ s/\n\s+\\\n/\n/g; + } + + # We want to check the first line inside the block + # starting at the end of the conditional, so remove: + # 1) any blank line termination + # 2) any opening brace { on end of the line + # 3) any do (...) { + my $continuation = 0; + my $check = 0; + $s =~ s/^.*\bdo\b//; + $s =~ s/^\s*{//; + if ($s =~ s/^\s*\\//) { + $continuation = 1; + } + if ($s =~ s/^\s*?\n//) { + $check = 1; + $cond_lines++; + } + + # Also ignore a loop construct at the end of a + # preprocessor statement. + if (($prevline =~ /^.\s*#\s*define\s/ || + $prevline =~ /\\\s*$/) && $continuation == 0) { + $check = 0; + } + + my $cond_ptr = -1; + $continuation = 0; + while ($cond_ptr != $cond_lines) { + $cond_ptr = $cond_lines; + + # If we see an #else/#elif then the code + # is not linear. + if ($s =~ /^\s*\#\s*(?:else|elif)/) { + $check = 0; + } + + # Ignore: + # 1) blank lines, they should be at 0, + # 2) preprocessor lines, and + # 3) labels. + if ($continuation || + $s =~ /^\s*?\n/ || + $s =~ /^\s*#\s*?/ || + $s =~ /^\s*$Ident\s*:/) { + $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; + if ($s =~ s/^.*?\n//) { + $cond_lines++; + } + } + } + + my (undef, $sindent) = line_stats("+" . $s); + my $stat_real = raw_line($linenr, $cond_lines); + + # Check if either of these lines are modified, else + # this is not this patch's fault. + if (!defined($stat_real) || + $stat !~ /^\+/ && $stat_real !~ /^\+/) { + $check = 0; + } + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n"; + + if ($check && $s ne '' && + (($sindent % 8) != 0 || + ($sindent < $indent) || + ($sindent == $indent && + ($s !~ /^\s*(?:\}|\{|else\b)/)) || + ($sindent > $indent + 8))) { + WARN("SUSPECT_CODE_INDENT", + "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); + } + } + + # Track the 'values' across context and added lines. + my $opline = $line; $opline =~ s/^./ /; + my ($curr_values, $curr_vars) = + annotate_values($opline . "\n", $prev_values); + $curr_values = $prev_values . $curr_values; + if ($dbg_values) { + my $outline = $opline; $outline =~ s/\t/ /g; + print "$linenr > .$outline\n"; + print "$linenr > $curr_values\n"; + print "$linenr > $curr_vars\n"; + } + $prev_values = substr($curr_values, -1); + +#ignore lines not being added + next if ($line =~ /^[^\+]/); + +# check for dereferences that span multiple lines + if ($prevline =~ /^\+.*$Lval\s*(?:\.|->)\s*$/ && + $line =~ /^\+\s*(?!\#\s*(?!define\s+|if))\s*$Lval/) { + $prevline =~ /($Lval\s*(?:\.|->))\s*$/; + my $ref = $1; + $line =~ /^.\s*($Lval)/; + $ref .= $1; + $ref =~ s/\s//g; + WARN("MULTILINE_DEREFERENCE", + "Avoid multiple line dereference - prefer '$ref'\n" . $hereprev); + } + +# check for declarations of signed or unsigned without int + while ($line =~ m{\b($Declare)\s*(?!char\b|short\b|int\b|long\b)\s*($Ident)?\s*[=,;\[\)\(]}g) { + my $type = $1; + my $var = $2; + $var = "" if (!defined $var); + if ($type =~ /^(?:(?:$Storage|$Inline|$Attribute)\s+)*((?:un)?signed)((?:\s*\*)*)\s*$/) { + my $sign = $1; + my $pointer = $2; + + $pointer = "" if (!defined $pointer); + + if (WARN("UNSPECIFIED_INT", + "Prefer '" . trim($sign) . " int" . rtrim($pointer) . "' to bare use of '$sign" . rtrim($pointer) . "'\n" . $herecurr) && + $fix) { + my $decl = trim($sign) . " int "; + my $comp_pointer = $pointer; + $comp_pointer =~ s/\s//g; + $decl .= $comp_pointer; + $decl = rtrim($decl) if ($var eq ""); + $fixed[$fixlinenr] =~ s@\b$sign\s*\Q$pointer\E\s*$var\b@$decl$var@; + } + } + } + +# TEST: allow direct testing of the type matcher. + if ($dbg_type) { + if ($line =~ /^.\s*$Declare\s*$/) { + ERROR("TEST_TYPE", + "TEST: is type\n" . $herecurr); + } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { + ERROR("TEST_NOT_TYPE", + "TEST: is not type ($1 is)\n". $herecurr); + } + next; + } +# TEST: allow direct testing of the attribute matcher. + if ($dbg_attr) { + if ($line =~ /^.\s*$Modifier\s*$/) { + ERROR("TEST_ATTR", + "TEST: is attr\n" . $herecurr); + } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { + ERROR("TEST_NOT_ATTR", + "TEST: is not attr ($1 is)\n". $herecurr); + } + next; + } + +# check for initialisation to aggregates open brace on the next line + if ($line =~ /^.\s*{/ && + $prevline =~ /(?:^|[^=])=\s*$/) { + if (ERROR("OPEN_BRACE", + "that open brace { should be on the previous line\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/\s*=\s*$/ = {/; + fix_insert_line($fixlinenr, $fixedline); + $fixedline = $line; + $fixedline =~ s/^(.\s*)\{\s*/$1/; + fix_insert_line($fixlinenr, $fixedline); + } + } + +# +# Checks which are anchored on the added line. +# + +# check for malformed paths in #include statements (uses RAW line) + if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) { + my $path = $1; + if ($path =~ m{//}) { + ERROR("MALFORMED_INCLUDE", + "malformed #include filename\n" . $herecurr); + } + if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) { + ERROR("UAPI_INCLUDE", + "No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr); + } + } + +# no C99 // comments + if ($line =~ m{//}) { + if (ERROR("C99_COMMENTS", + "do not use C99 // comments\n" . $herecurr) && + $fix) { + my $line = $fixed[$fixlinenr]; + if ($line =~ /\/\/(.*)$/) { + my $comment = trim($1); + $fixed[$fixlinenr] =~ s@\/\/(.*)$@/\* $comment \*/@; + } + } + } + # Remove C99 comments. + $line =~ s@//.*@@; + $opline =~ s@//.*@@; + +# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider +# the whole statement. +#print "APW <$lines[$realline_next - 1]>\n"; + if (defined $realline_next && + exists $lines[$realline_next - 1] && + !defined $suppress_export{$realline_next} && + ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { + # Handle definitions which produce identifiers with + # a prefix: + # XXX(foo); + # EXPORT_SYMBOL(something_foo); + my $name = $1; + if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && + $name =~ /^${Ident}_$2/) { +#print "FOO C name<$name>\n"; + $suppress_export{$realline_next} = 1; + + } elsif ($stat !~ /(?: + \n.}\s*$| + ^.DEFINE_$Ident\(\Q$name\E\)| + ^.DECLARE_$Ident\(\Q$name\E\)| + ^.LIST_HEAD\(\Q$name\E\)| + ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| + \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() + )/x) { +#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n"; + $suppress_export{$realline_next} = 2; + } else { + $suppress_export{$realline_next} = 1; + } + } + if (!defined $suppress_export{$linenr} && + $prevline =~ /^.\s*$/ && + ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { +#print "FOO B <$lines[$linenr - 1]>\n"; + $suppress_export{$linenr} = 2; + } + if (defined $suppress_export{$linenr} && + $suppress_export{$linenr} == 2) { + WARN("EXPORT_SYMBOL", + "EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); + } + +# check for global initialisers. + if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*($zero_initializer)\s*;/) { + if (ERROR("GLOBAL_INITIALISERS", + "do not initialise globals to $1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*$zero_initializer\s*;/$1;/; + } + } +# check for static initialisers. + if ($line =~ /^\+.*\bstatic\s.*=\s*($zero_initializer)\s*;/) { + if (ERROR("INITIALISED_STATIC", + "do not initialise statics to $1\n" . + $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\bstatic\s.*?)\s*=\s*$zero_initializer\s*;/$1;/; + } + } + +# check for misordered declarations of char/short/int/long with signed/unsigned + while ($sline =~ m{(\b$TypeMisordered\b)}g) { + my $tmp = trim($1); + WARN("MISORDERED_TYPE", + "type '$tmp' should be specified in [[un]signed] [short|int|long|long long] order\n" . $herecurr); + } + +# check for unnecessary <signed> int declarations of short/long/long long + while ($sline =~ m{\b($TypeMisordered(\s*\*)*|$C90_int_types)\b}g) { + my $type = trim($1); + next if ($type !~ /\bint\b/); + next if ($type !~ /\b(?:short|long\s+long|long)\b/); + my $new_type = $type; + $new_type =~ s/\b\s*int\s*\b/ /; + $new_type =~ s/\b\s*(?:un)?signed\b\s*/ /; + $new_type =~ s/^const\s+//; + $new_type = "unsigned $new_type" if ($type =~ /\bunsigned\b/); + $new_type = "const $new_type" if ($type =~ /^const\b/); + $new_type =~ s/\s+/ /g; + $new_type = trim($new_type); + if (WARN("UNNECESSARY_INT", + "Prefer '$new_type' over '$type' as the int is unnecessary\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b\Q$type\E\b/$new_type/; + } + } + +# check for static const char * arrays. + if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "static const char * array should probably be static const char * const\n" . + $herecurr); + } + +# check for initialized const char arrays that should be static const + if ($line =~ /^\+\s*const\s+(char|unsigned\s+char|_*u8|(?:[us]_)?int8_t)\s+\w+\s*\[\s*(?:\w+\s*)?\]\s*=\s*"/) { + if (WARN("STATIC_CONST_CHAR_ARRAY", + "const array should probably be static const\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^.\s*)const\b/${1}static const/; + } + } + +# check for static char foo[] = "bar" declarations. + if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "static char array declaration should probably be static const char\n" . + $herecurr); + } + +# check for const <foo> const where <foo> is not a pointer or array type + if ($sline =~ /\bconst\s+($BasicType)\s+const\b/) { + my $found = $1; + if ($sline =~ /\bconst\s+\Q$found\E\s+const\b\s*\*/) { + WARN("CONST_CONST", + "'const $found const *' should probably be 'const $found * const'\n" . $herecurr); + } elsif ($sline !~ /\bconst\s+\Q$found\E\s+const\s+\w+\s*\[/) { + WARN("CONST_CONST", + "'const $found const' should probably be 'const $found'\n" . $herecurr); + } + } + +# check for non-global char *foo[] = {"bar", ...} declarations. + if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "char * array declaration might be better as static const\n" . + $herecurr); + } + +# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo) + if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) { + my $array = $1; + if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))@) { + my $array_div = $1; + if (WARN("ARRAY_SIZE", + "Prefer ARRAY_SIZE($array)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($array)/; + } + } + } + +# check for function declarations without arguments like "int foo()" + if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { + if (ERROR("FUNCTION_WITHOUT_ARGS", + "Bad function definition - $1() should probably be $1(void)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\b($Type)\s+($Ident))\s*\(\s*\)/$2 $3(void)/; + } + } + +# check for new typedefs, only function parameters and sparse annotations +# make sense. + if ($line =~ /\btypedef\s/ && + $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ && + $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && + $line !~ /\b$typeTypedefs\b/ && + $line !~ /\b__bitwise\b/) { + WARN("NEW_TYPEDEFS", + "do not add new typedefs\n" . $herecurr); + } + +# * goes on variable not on type + # (char*[ const]) + while ($line =~ m{(\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\))}g) { + #print "AA<$1>\n"; + my ($ident, $from, $to) = ($1, $2, $2); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + +## print "1: from<$from> to<$to> ident<$ident>\n"; + if ($from ne $to) { + if (ERROR("POINTER_LOCATION", + "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr) && + $fix) { + my $sub_from = $ident; + my $sub_to = $ident; + $sub_to =~ s/\Q$from\E/$to/; + $fixed[$fixlinenr] =~ + s@\Q$sub_from\E@$sub_to@; + } + } + } + while ($line =~ m{(\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident))}g) { + #print "BB<$1>\n"; + my ($match, $from, $to, $ident) = ($1, $2, $2, $3); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + # Modifiers should have spaces. + $to =~ s/(\b$Modifier$)/$1 /; + +## print "2: from<$from> to<$to> ident<$ident>\n"; + if ($from ne $to && $ident !~ /^$Modifier$/) { + if (ERROR("POINTER_LOCATION", + "\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr) && + $fix) { + + my $sub_from = $match; + my $sub_to = $match; + $sub_to =~ s/\Q$from\E/$to/; + $fixed[$fixlinenr] =~ + s@\Q$sub_from\E@$sub_to@; + } + } + } + +# avoid BUG() or BUG_ON() + if ($line =~ /\b(?:BUG|BUG_ON)\b/) { + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + &{$msg_level}("AVOID_BUG", + "Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()\n" . $herecurr); + } + +# avoid LINUX_VERSION_CODE + if ($line =~ /\bLINUX_VERSION_CODE\b/) { + WARN("LINUX_VERSION_CODE", + "LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); + } + +# check for uses of printk_ratelimit + if ($line =~ /\bprintk_ratelimit\s*\(/) { + WARN("PRINTK_RATELIMITED", + "Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr); + } + +# printk should use KERN_* levels + if ($line =~ /\bprintk\s*\(\s*(?!KERN_[A-Z]+\b)/) { + WARN("PRINTK_WITHOUT_KERN_LEVEL", + "printk() should include KERN_<LEVEL> facility level\n" . $herecurr); + } + + if ($line =~ /\bprintk\s*\(\s*KERN_([A-Z]+)/) { + my $orig = $1; + my $level = lc($orig); + $level = "warn" if ($level eq "warning"); + my $level2 = $level; + $level2 = "dbg" if ($level eq "debug"); + WARN("PREFER_PR_LEVEL", + "Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr); + } + + if ($line =~ /\bpr_warning\s*\(/) { + if (WARN("PREFER_PR_LEVEL", + "Prefer pr_warn(... to pr_warning(...\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\bpr_warning\b/pr_warn/; + } + } + + if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) { + my $orig = $1; + my $level = lc($orig); + $level = "warn" if ($level eq "warning"); + $level = "dbg" if ($level eq "debug"); + WARN("PREFER_DEV_LEVEL", + "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); + } + +# ENOSYS means "bad syscall nr" and nothing else. This will have a small +# number of false positives, but assembly files are not checked, so at +# least the arch entry code will not trigger this warning. + if ($line =~ /\bENOSYS\b/) { + WARN("ENOSYS", + "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr); + } + +# function brace can't be on same line, except for #defines of do while, +# or if closed on same line + if ($perl_version_ok && + $sline =~ /$Type\s*$Ident\s*$balanced_parens\s*\{/ && + $sline !~ /\#\s*define\b.*do\s*\{/ && + $sline !~ /}/) { + if (ERROR("OPEN_BRACE", + "open brace '{' following function definitions go on the next line\n" . $herecurr) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + my $fixed_line = $rawline; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + my $line1 = $1; + my $line2 = $2; + fix_insert_line($fixlinenr, ltrim($line1)); + fix_insert_line($fixlinenr, "\+{"); + if ($line2 !~ /^\s*$/) { + fix_insert_line($fixlinenr, "\+\t" . trim($line2)); + } + } + } + +# open braces for enum, union and struct go on the same line. + if ($line =~ /^.\s*{/ && + $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { + if (ERROR("OPEN_BRACE", + "open brace '{' following $1 go on the same line\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = rtrim($prevrawline) . " {"; + fix_insert_line($fixlinenr, $fixedline); + $fixedline = $rawline; + $fixedline =~ s/^(.\s*)\{\s*/$1\t/; + if ($fixedline !~ /^\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + } + } + +# missing space after union, struct or enum definition + if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident){1,2}[=\{]/) { + if (WARN("SPACING", + "missing space after $1 definition\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*(?:typedef\s+)?(?:enum|union|struct)(?:\s+$Ident){1,2})([=\{])/$1 $2/; + } + } + +# Function pointer declarations +# check spacing between type, funcptr, and args +# canonical declaration is "type (*funcptr)(args...)" + if ($line =~ /^.\s*($Declare)\((\s*)\*(\s*)($Ident)(\s*)\)(\s*)\(/) { + my $declare = $1; + my $pre_pointer_space = $2; + my $post_pointer_space = $3; + my $funcname = $4; + my $post_funcname_space = $5; + my $pre_args_space = $6; + +# the $Declare variable will capture all spaces after the type +# so check it for a missing trailing missing space but pointer return types +# don't need a space so don't warn for those. + my $post_declare_space = ""; + if ($declare =~ /(\s+)$/) { + $post_declare_space = $1; + $declare = rtrim($declare); + } + if ($declare !~ /\*$/ && $post_declare_space =~ /^$/) { + WARN("SPACING", + "missing space after return type\n" . $herecurr); + $post_declare_space = " "; + } + +# unnecessary space "type (*funcptr)(args...)" +# This test is not currently implemented because these declarations are +# equivalent to +# int foo(int bar, ...) +# and this is form shouldn't/doesn't generate a checkpatch warning. +# +# elsif ($declare =~ /\s{2,}$/) { +# WARN("SPACING", +# "Multiple spaces after return type\n" . $herecurr); +# } + +# unnecessary space "type ( *funcptr)(args...)" + if (defined $pre_pointer_space && + $pre_pointer_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space after function pointer open parenthesis\n" . $herecurr); + } + +# unnecessary space "type (* funcptr)(args...)" + if (defined $post_pointer_space && + $post_pointer_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space before function pointer name\n" . $herecurr); + } + +# unnecessary space "type (*funcptr )(args...)" + if (defined $post_funcname_space && + $post_funcname_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space after function pointer name\n" . $herecurr); + } + +# unnecessary space "type (*funcptr) (args...)" + if (defined $pre_args_space && + $pre_args_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space before function pointer arguments\n" . $herecurr); + } + + if (show_type("SPACING") && $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*)$Declare\s*\(\s*\*\s*$Ident\s*\)\s*\(/$1 . $declare . $post_declare_space . '(*' . $funcname . ')('/ex; + } + } + +# check for spacing round square brackets; allowed: +# 1. with a type on the left -- int [] a; +# 2. at the beginning of a line for slice initialisers -- [0...10] = 5, +# 3. inside a curly brace -- = { [0...10] = 5 } + while ($line =~ /(.*?\s)\[/g) { + my ($where, $prefix) = ($-[1], $1); + if ($prefix !~ /$Type\s+$/ && + ($where != 0 || $prefix !~ /^.\s+$/) && + $prefix !~ /[{,:]\s+$/) { + if (ERROR("BRACKET_SPACE", + "space prohibited before open square bracket '['\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(\+.*?)\s+\[/$1\[/; + } + } + } + +# check for spaces between functions and their parentheses. + while ($line =~ /($Ident)\s+\(/g) { + my $name = $1; + my $ctx_before = substr($line, 0, $-[1]); + my $ctx = "$ctx_before$name"; + + # Ignore those directives where spaces _are_ permitted. + if ($name =~ /^(?: + if|for|while|switch|return|case| + volatile|__volatile__| + __attribute__|format|__extension__| + asm|__asm__)$/x) + { + # cpp #define statements have non-optional spaces, ie + # if there is a space between the name and the open + # parenthesis it is simply not a parameter group. + } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) { + + # cpp #elif statement condition may start with a ( + } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) { + + # If this whole things ends with a type its most + # likely a typedef for a function. + } elsif ($ctx =~ /$Type$/) { + + } else { + if (WARN("SPACING", + "space prohibited between function name and open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\b$name\s+\(/$name\(/; + } + } + } + +# Check operator spacing. + if (!($line=~/\#\s*include/)) { + my $fixed_line = ""; + my $line_fixed = 0; + + my $ops = qr{ + <<=|>>=|<=|>=|==|!=| + \+=|-=|\*=|\/=|%=|\^=|\|=|&=| + =>|->|<<|>>|<|>|=|!|~| + &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%| + \?:|\?|: + }x; + my @elements = split(/($ops|;)/, $opline); + +## print("element count: <" . $#elements . ">\n"); +## foreach my $el (@elements) { +## print("el: <$el>\n"); +## } + + my @fix_elements = (); + my $off = 0; + + foreach my $el (@elements) { + push(@fix_elements, substr($rawline, $off, length($el))); + $off += length($el); + } + + $off = 0; + + my $blank = copy_spacing($opline); + my $last_after = -1; + + for (my $n = 0; $n < $#elements; $n += 2) { + + my $good = $fix_elements[$n] . $fix_elements[$n + 1]; + +## print("n: <$n> good: <$good>\n"); + + $off += length($elements[$n]); + + # Pick up the preceding and succeeding characters. + my $ca = substr($opline, 0, $off); + my $cc = ''; + if (length($opline) >= ($off + length($elements[$n + 1]))) { + $cc = substr($opline, $off + length($elements[$n + 1])); + } + my $cb = "$ca$;$cc"; + + my $a = ''; + $a = 'V' if ($elements[$n] ne ''); + $a = 'W' if ($elements[$n] =~ /\s$/); + $a = 'C' if ($elements[$n] =~ /$;$/); + $a = 'B' if ($elements[$n] =~ /(\[|\()$/); + $a = 'O' if ($elements[$n] eq ''); + $a = 'E' if ($ca =~ /^\s*$/); + + my $op = $elements[$n + 1]; + + my $c = ''; + if (defined $elements[$n + 2]) { + $c = 'V' if ($elements[$n + 2] ne ''); + $c = 'W' if ($elements[$n + 2] =~ /^\s/); + $c = 'C' if ($elements[$n + 2] =~ /^$;/); + $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); + $c = 'O' if ($elements[$n + 2] eq ''); + $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/); + } else { + $c = 'E'; + } + + my $ctx = "${a}x${c}"; + + my $at = "(ctx:$ctx)"; + + my $ptr = substr($blank, 0, $off) . "^"; + my $hereptr = "$hereline$ptr\n"; + + # Pull out the value of this operator. + my $op_type = substr($curr_values, $off + 1, 1); + + # Get the full operator variant. + my $opv = $op . substr($curr_vars, $off, 1); + + # Ignore operators passed as parameters. + if ($op_type ne 'V' && + $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) { + +# # Ignore comments +# } elsif ($op =~ /^$;+$/) { + + # ; should have either the end of line or a space or \ after it + } elsif ($op eq ';') { + if ($ctx !~ /.x[WEBC]/ && + $cc !~ /^\\/ && $cc !~ /^;/) { + if (ERROR("SPACING", + "space required after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " "; + $line_fixed = 1; + } + } + + # // is a comment + } elsif ($op eq '//') { + + # : when part of a bitfield + } elsif ($opv eq ':B') { + # skip the bitfield test for now + + # No spaces for: + # -> + } elsif ($op eq '->') { + if ($ctx =~ /Wx.|.xW/) { + if (ERROR("SPACING", + "spaces prohibited around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # , must not have a space before and must have a space on the right. + } elsif ($op eq ',') { + my $rtrim_before = 0; + my $space_after = 0; + if ($ctx =~ /Wx./) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $line_fixed = 1; + $rtrim_before = 1; + } + } + if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { + if (ERROR("SPACING", + "space required after that '$op' $at\n" . $hereptr)) { + $line_fixed = 1; + $last_after = $n; + $space_after = 1; + } + } + if ($rtrim_before || $space_after) { + if ($rtrim_before) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + } else { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]); + } + if ($space_after) { + $good .= " "; + } + } + + # '*' as part of a type definition -- reported already. + } elsif ($opv eq '*_') { + #warn "'*' is part of type\n"; + + # unary operators should have a space before and + # none after. May be left adjacent to another + # unary operator, or a cast + } elsif ($op eq '!' || $op eq '~' || + $opv eq '*U' || $opv eq '-U' || + $opv eq '&U' || $opv eq '&&U') { + if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { + if (ERROR("SPACING", + "space required before that '$op' $at\n" . $hereptr)) { + if ($n != $last_after + 2) { + $good = $fix_elements[$n] . " " . ltrim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + } + if ($op eq '*' && $cc =~/\s*$Modifier\b/) { + # A unary '*' may be const + + } elsif ($ctx =~ /.xW/) { + if (ERROR("SPACING", + "space prohibited after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . rtrim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # unary ++ and unary -- are allowed no space on one side. + } elsif ($op eq '++' or $op eq '--') { + if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) { + if (ERROR("SPACING", + "space required one side of that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " "; + $line_fixed = 1; + } + } + if ($ctx =~ /Wx[BE]/ || + ($ctx =~ /Wx./ && $cc =~ /^;/)) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + if ($ctx =~ /ExW/) { + if (ERROR("SPACING", + "space prohibited after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # << and >> may either have or not have spaces both sides + } elsif ($op eq '<<' or $op eq '>>' or + $op eq '&' or $op eq '^' or $op eq '|' or + $op eq '+' or $op eq '-' or + $op eq '*' or $op eq '/' or + $op eq '%') + { + if ($check) { + if (defined $fix_elements[$n + 2] && $ctx !~ /[EW]x[EW]/) { + if (CHK("SPACING", + "spaces preferred around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + $fix_elements[$n + 2] =~ s/^\s+//; + $line_fixed = 1; + } + } elsif (!defined $fix_elements[$n + 2] && $ctx !~ /Wx[OE]/) { + if (CHK("SPACING", + "space preferred before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + } elsif ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { + if (ERROR("SPACING", + "need consistent spacing around '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # A colon needs no spaces before when it is + # terminating a case value or a label. + } elsif ($opv eq ':C' || $opv eq ':L') { + if ($ctx =~ /Wx./) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + + # All the others need spaces both sides. + } elsif ($ctx !~ /[EWC]x[CWE]/) { + my $ok = 0; + + # Ignore email addresses <foo@bar> + if (($op eq '<' && + $cc =~ /^\S+\@\S+>/) || + ($op eq '>' && + $ca =~ /<\S+\@\S+$/)) + { + $ok = 1; + } + + # for asm volatile statements + # ignore a colon with another + # colon immediately before or after + if (($op eq ':') && + ($ca =~ /:$/ || $cc =~ /^:/)) { + $ok = 1; + } + + # messages are ERROR, but ?: are CHK + if ($ok == 0) { + my $msg_level = \&ERROR; + $msg_level = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/); + + if (&{$msg_level}("SPACING", + "spaces required around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + } + $off += length($elements[$n + 1]); + +## print("n: <$n> GOOD: <$good>\n"); + + $fixed_line = $fixed_line . $good; + } + + if (($#elements % 2) == 0) { + $fixed_line = $fixed_line . $fix_elements[$#elements]; + } + + if ($fix && $line_fixed && $fixed_line ne $fixed[$fixlinenr]) { + $fixed[$fixlinenr] = $fixed_line; + } + + + } + +# check for whitespace before a non-naked semicolon + if ($line =~ /^\+.*\S\s+;\s*$/) { + if (WARN("SPACING", + "space prohibited before semicolon\n" . $herecurr) && + $fix) { + 1 while $fixed[$fixlinenr] =~ + s/^(\+.*\S)\s+;/$1;/; + } + } + +# check for multiple assignments + if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { + CHK("MULTIPLE_ASSIGNMENTS", + "multiple assignments should be avoided\n" . $herecurr); + } + +## # check for multiple declarations, allowing for a function declaration +## # continuation. +## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && +## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { +## +## # Remove any bracketed sections to ensure we do not +## # falsly report the parameters of functions. +## my $ln = $line; +## while ($ln =~ s/\([^\(\)]*\)//g) { +## } +## if ($ln =~ /,/) { +## WARN("MULTIPLE_DECLARATION", +## "declaring multiple variables together should be avoided\n" . $herecurr); +## } +## } + +#need space before brace following if, while, etc + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || + $line =~ /\b(?:else|do)\{/) { + if (ERROR("SPACING", + "space required before the open brace '{'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+.*(?:do|else|\)))\{/$1 {/; + } + } + +## # check for blank lines before declarations +## if ($line =~ /^.\t+$Type\s+$Ident(?:\s*=.*)?;/ && +## $prevrawline =~ /^.\s*$/) { +## WARN("SPACING", +## "No blank lines before declarations\n" . $hereprev); +## } +## + +# closing brace should have a space following it when it has anything +# on the line + if ($line =~ /}(?!(?:,|;|\)|\}))\S/) { + if (ERROR("SPACING", + "space required after that close brace '}'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/}((?!(?:,|;|\)))\S)/} $1/; + } + } + +# check spacing on square brackets + if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { + if (ERROR("SPACING", + "space prohibited after that open square bracket '['\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\[\s+/\[/; + } + } + if ($line =~ /\s\]/) { + if (ERROR("SPACING", + "space prohibited before that close square bracket ']'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\s+\]/\]/; + } + } + +# check spacing on parentheses + if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && + $line !~ /for\s*\(\s+;/) { + if (ERROR("SPACING", + "space prohibited after that open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\(\s+/\(/; + } + } + if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && + $line !~ /for\s*\(.*;\s+\)/ && + $line !~ /:\s+\)/) { + if (ERROR("SPACING", + "space prohibited before that close parenthesis ')'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\s+\)/\)/; + } + } + +# check unnecessary parentheses around addressof/dereference single $Lvals +# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar + + while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) { + my $var = $1; + if (CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around $var\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\(\s*\Q$var\E\s*\)/$var/; + } + } + +# check for unnecessary parentheses around function pointer uses +# ie: (foo->bar)(); should be foo->bar(); +# but not "if (foo->bar) (" to avoid some false positives + if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) { + my $var = $2; + if (CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around function pointer $var\n" . $herecurr) && + $fix) { + my $var2 = deparenthesize($var); + $var2 =~ s/\s//g; + $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/; + } + } + +# check for unnecessary parentheses around comparisons in if uses +# when !drivers/staging or command-line uses --strict + if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) && + $perl_version_ok && defined($stat) && + $stat =~ /(^.\s*if\s*($balanced_parens))/) { + my $if_stat = $1; + my $test = substr($2, 1, -1); + my $herectx; + while ($test =~ /(?:^|[^\w\&\!\~])+\s*\(\s*([\&\!\~]?\s*$Lval\s*(?:$Compare\s*$FuncArg)?)\s*\)/g) { + my $match = $1; + # avoid parentheses around potential macro args + next if ($match =~ /^\s*\w+\s*$/); + if (!defined($herectx)) { + $herectx = $here . "\n"; + my $cnt = statement_rawlines($if_stat); + for (my $n = 0; $n < $cnt; $n++) { + my $rl = raw_line($linenr, $n); + $herectx .= $rl . "\n"; + last if $rl =~ /^[ \+].*\{/; + } + } + CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around '$match'\n" . $herectx); + } + } + +#goto labels aren't indented, allow a single space however + if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and + !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { + if (WARN("INDENTED_LABEL", + "labels should not be indented\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.)\s+/$1/; + } + } + +# return is not a function + if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { + my $spacing = $1; + if ($perl_version_ok && + $stat =~ /^.\s*return\s*($balanced_parens)\s*;\s*$/) { + my $value = $1; + $value = deparenthesize($value); + if ($value =~ m/^\s*$FuncArg\s*(?:\?|$)/) { + ERROR("RETURN_PARENTHESES", + "return is not a function, parentheses are not required\n" . $herecurr); + } + } elsif ($spacing !~ /\s+/) { + ERROR("SPACING", + "space required before the open parenthesis '('\n" . $herecurr); + } + } + +# unnecessary return in a void function +# at end-of-function, with the previous line a single leading tab, then return; +# and the line before that not a goto label target like "out:" + if ($sline =~ /^[ \+]}\s*$/ && + $prevline =~ /^\+\treturn\s*;\s*$/ && + $linenr >= 3 && + $lines[$linenr - 3] =~ /^[ +]/ && + $lines[$linenr - 3] !~ /^[ +]\s*$Ident\s*:/) { + WARN("RETURN_VOID", + "void function return statements are not generally useful\n" . $hereprev); + } + +# if statements using unnecessary parentheses - ie: if ((foo == bar)) + if ($perl_version_ok && + $line =~ /\bif\s*((?:\(\s*){2,})/) { + my $openparens = $1; + my $count = $openparens =~ tr@\(@\(@; + my $msg = ""; + if ($line =~ /\bif\s*(?:\(\s*){$count,$count}$LvalOrFunc\s*($Compare)\s*$LvalOrFunc(?:\s*\)){$count,$count}/) { + my $comp = $4; #Not $1 because of $LvalOrFunc + $msg = " - maybe == should be = ?" if ($comp eq "=="); + WARN("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses$msg\n" . $herecurr); + } + } + +# comparisons with a constant or upper case identifier on the left +# avoid cases like "foo + BAR < baz" +# only fix matches surrounded by parentheses to avoid incorrect +# conversions like "FOO < baz() + 5" being "misfixed" to "baz() > FOO + 5" + if ($perl_version_ok && + $line =~ /^\+(.*)\b($Constant|[A-Z_][A-Z0-9_]*)\s*($Compare)\s*($LvalOrFunc)/) { + my $lead = $1; + my $const = $2; + my $comp = $3; + my $to = $4; + my $newcomp = $comp; + if ($lead !~ /(?:$Operators|\.)\s*$/ && + $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ && + WARN("CONSTANT_COMPARISON", + "Comparisons should place the constant on the right side of the test\n" . $herecurr) && + $fix) { + if ($comp eq "<") { + $newcomp = ">"; + } elsif ($comp eq "<=") { + $newcomp = ">="; + } elsif ($comp eq ">") { + $newcomp = "<"; + } elsif ($comp eq ">=") { + $newcomp = "<="; + } + $fixed[$fixlinenr] =~ s/\(\s*\Q$const\E\s*$Compare\s*\Q$to\E\s*\)/($to $newcomp $const)/; + } + } + +# Return of what appears to be an errno should normally be negative + if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) { + my $name = $1; + if ($name ne 'EOF' && $name ne 'ERROR') { + WARN("USE_NEGATIVE_ERRNO", + "return of an errno should typically be negative (ie: return -$1)\n" . $herecurr); + } + } + +# Need a space before open parenthesis after if, while etc + if ($line =~ /\b(if|while|for|switch)\(/) { + if (ERROR("SPACING", + "space required before the open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\b(if|while|for|switch)\(/$1 \(/; + } + } + +# Check for illegal assignment in if conditional -- and check for trailing +# statements after the conditional. + if ($line =~ /do\s*(?!{)/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0) + if (!defined $stat); + my ($stat_next) = ctx_statement_block($line_nr_next, + $remain_next, $off_next); + $stat_next =~ s/\n./\n /g; + ##print "stat<$stat> stat_next<$stat_next>\n"; + + if ($stat_next =~ /^\s*while\b/) { + # If the statement carries leading newlines, + # then count those as offsets. + my ($whitespace) = + ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = + statement_rawlines($whitespace) - 1; + + $suppress_whiletrailers{$line_nr_next + + $offset} = 1; + } + } + if (!defined $suppress_whiletrailers{$linenr} && + defined($stat) && defined($cond) && + $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { + my ($s, $c) = ($stat, $cond); + + if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { + ERROR("ASSIGN_IN_IF", + "do not use assignment in if condition\n" . $herecurr); + } + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + $s =~ s/$;//g; # Remove any comments + if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && + $c !~ /}\s*while\s*/) + { + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + my $stat_real = ''; + + $stat_real = raw_line($linenr, $cond_lines) + . "\n" if ($cond_lines); + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr . $stat_real); + } + } + +# Check for bitwise tests written as boolean + if ($line =~ / + (?: + (?:\[|\(|\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\|) + | + (?:\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\||\)|\]) + )/x) + { + WARN("HEXADECIMAL_BOOLEAN_TEST", + "boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr); + } + +# if and else should not have general statements after it + if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) { + my $s = $1; + $s =~ s/$;//g; # Remove any comments + if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr); + } + } +# if should not continue a brace + if ($line =~ /}\s*if\b/) { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line (or did you mean 'else if'?)\n" . + $herecurr); + } +# case and default should not have general statements after them + if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && + $line !~ /\G(?: + (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$| + \s*return\s+ + )/xg) + { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr); + } + + # Check for }<nl>else {, these must be at the same + # indent level to be relevant to each other. + if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ && + $previndent == $indent) { + if (ERROR("ELSE_AFTER_BRACE", + "else should follow close brace '}'\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/}\s*$//; + if ($fixedline !~ /^\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + $fixedline = $rawline; + $fixedline =~ s/^(.\s*)else/$1} else/; + fix_insert_line($fixlinenr, $fixedline); + } + } + + if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ && + $previndent == $indent) { + my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0); + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + + if ($s =~ /^\s*;/) { + if (ERROR("WHILE_AFTER_BRACE", + "while should follow close brace '}'\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + my $trailing = $rawline; + $trailing =~ s/^\+//; + $trailing = trim($trailing); + $fixedline =~ s/}\s*$/} $trailing/; + fix_insert_line($fixlinenr, $fixedline); + } + } + } + +#Specific variable tests + while ($line =~ m{($Constant|$Lval)}g) { + my $var = $1; + +#CamelCase + if ($var !~ /^$Constant$/ && + $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && +#Ignore Page<foo> variants + $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show) + $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ && +#Ignore some three character SI units explicitly, like MiB and KHz + $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { + while ($var =~ m{($Ident)}g) { + my $word = $1; + next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); + if ($check) { + seed_camelcase_includes(); + if (!$file && !$camelcase_file_seeded) { + seed_camelcase_file($realfile); + $camelcase_file_seeded = 1; + } + } + if (!defined $camelcase{$word}) { + $camelcase{$word} = 1; + CHK("CAMELCASE", + "Avoid CamelCase: <$word>\n" . $herecurr); + } + } + } + } + +#no spaces allowed after \ in define + if ($line =~ /\#\s*define.*\\\s+$/) { + if (WARN("WHITESPACE_AFTER_LINE_CONTINUATION", + "Whitespace after \\ makes next lines useless\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+$//; + } + } + +# warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes +# itself <asm/foo.h> (uses RAW line) + if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) { + my $file = "$1.h"; + my $checkfile = "include/linux/$file"; + if (-f "$root/$checkfile" && + $realfile ne $checkfile && + $1 !~ /$allowed_asm_includes/) + { + my $asminclude = `grep -Ec "#include\\s+<asm/$file>" $root/$checkfile`; + if ($asminclude > 0) { + if ($realfile =~ m{^arch/}) { + CHK("ARCH_INCLUDE_LINUX", + "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); + } else { + WARN("INCLUDE_LINUX", + "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr); + } + } + } + } + +# multi-statement macros should be enclosed in a do while loop, grab the +# first statement and ensure its the whole macro if its not enclosed +# in a known good container + if ($realfile !~ m@/vmlinux.lds.h$@ && + $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) { + my $ln = $linenr; + my $cnt = $realcnt; + my ($off, $dstat, $dcond, $rest); + my $ctx = ''; + my $has_flow_statement = 0; + my $has_arg_concat = 0; + ($dstat, $dcond, $ln, $cnt, $off) = + ctx_statement_block($linenr, $realcnt, 0); + $ctx = $dstat; + #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n"; + #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n"; + + $has_flow_statement = 1 if ($ctx =~ /\b(goto|return)\b/); + $has_arg_concat = 1 if ($ctx =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/); + + $dstat =~ s/^.\s*\#\s*define\s+$Ident(\([^\)]*\))?\s*//; + my $define_args = $1; + my $define_stmt = $dstat; + my @def_args = (); + + if (defined $define_args && $define_args ne "") { + $define_args = substr($define_args, 1, length($define_args) - 2); + $define_args =~ s/\s*//g; + $define_args =~ s/\\\+?//g; + @def_args = split(",", $define_args); + } + + $dstat =~ s/$;//g; + $dstat =~ s/\\\n.//g; + $dstat =~ s/^\s*//s; + $dstat =~ s/\s*$//s; + + # Flatten any parentheses and braces + while ($dstat =~ s/\([^\(\)]*\)/1/ || + $dstat =~ s/\{[^\{\}]*\}/1/ || + $dstat =~ s/.\[[^\[\]]*\]/1/) + { + } + + # Flatten any obvious string concatentation. + while ($dstat =~ s/($String)\s*$Ident/$1/ || + $dstat =~ s/$Ident\s*($String)/$1/) + { + } + + # Make asm volatile uses seem like a generic function + $dstat =~ s/\b_*asm_*\s+_*volatile_*\b/asm_volatile/g; + + my $exceptions = qr{ + $Declare| + module_param_named| + MODULE_PARM_DESC| + DECLARE_PER_CPU| + DEFINE_PER_CPU| + __typeof__\(| + union| + struct| + \.$Ident\s*=\s*| + ^\"|\"$| + ^\[ + }x; + #print "REST<$rest> dstat<$dstat> ctx<$ctx>\n"; + + $ctx =~ s/\n*$//; + my $stmt_cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $stmt_cnt, $here); + + if ($dstat ne '' && + $dstat !~ /^(?:$Ident|-?$Constant),$/ && # 10, // foo(), + $dstat !~ /^(?:$Ident|-?$Constant);$/ && # foo(); + $dstat !~ /^[!~-]?(?:$Lval|$Constant)$/ && # 10 // foo() // !foo // ~foo // -foo // foo->bar // foo.bar->baz + $dstat !~ /^'X'$/ && $dstat !~ /^'XX'$/ && # character constants + $dstat !~ /$exceptions/ && + $dstat !~ /^\.$Ident\s*=/ && # .foo = + $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo + $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) + $dstat !~ /^for\s*$Constant$/ && # for (...) + $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar() + $dstat !~ /^do\s*{/ && # do {... + $dstat !~ /^\(\{/ && # ({... + $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/) + { + if ($dstat =~ /^\s*if\b/) { + ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", + "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects\n" . "$herectx"); + } elsif ($dstat =~ /;/) { + ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", + "Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx"); + } else { + ERROR("COMPLEX_MACRO", + "Macros with complex values should be enclosed in parentheses\n" . "$herectx"); + } + + } + + # Make $define_stmt single line, comment-free, etc + my @stmt_array = split('\n', $define_stmt); + my $first = 1; + $define_stmt = ""; + foreach my $l (@stmt_array) { + $l =~ s/\\$//; + if ($first) { + $define_stmt = $l; + $first = 0; + } elsif ($l =~ /^[\+ ]/) { + $define_stmt .= substr($l, 1); + } + } + $define_stmt =~ s/$;//g; + $define_stmt =~ s/\s+/ /g; + $define_stmt = trim($define_stmt); + +# check if any macro arguments are reused (ignore '...' and 'type') + foreach my $arg (@def_args) { + next if ($arg =~ /\.\.\./); + next if ($arg =~ /^type$/i); + my $tmp_stmt = $define_stmt; + $tmp_stmt =~ s/\b(sizeof|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; + $tmp_stmt =~ s/\#+\s*$arg\b//g; + $tmp_stmt =~ s/\b$arg\s*\#\#//g; + my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g; + if ($use_cnt > 1) { + CHK("MACRO_ARG_REUSE", + "Macro argument reuse '$arg' - possible side-effects?\n" . "$herectx"); + } +# check if any macro arguments may have other precedence issues + if ($tmp_stmt =~ m/($Operators)?\s*\b$arg\b\s*($Operators)?/m && + ((defined($1) && $1 ne ',') || + (defined($2) && $2 ne ','))) { + CHK("MACRO_ARG_PRECEDENCE", + "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx"); + } + } + +# check for macros with flow control, but without ## concatenation +# ## concatenation is commonly a macro that defines a function so ignore those + if ($has_flow_statement && !$has_arg_concat) { + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("MACRO_WITH_FLOW_CONTROL", + "Macros with flow control statements should be avoided\n" . "$herectx"); + } + +# check for line continuations outside of #defines, preprocessor #, and asm + + } else { + if ($prevline !~ /^..*\\$/ && + $line !~ /^\+\s*\#.*\\$/ && # preprocessor + $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm + $line =~ /^\+.*\\$/) { + WARN("LINE_CONTINUATIONS", + "Avoid unnecessary line continuations\n" . $herecurr); + } + } + +# do {} while (0) macro tests: +# single-statement macros do not need to be enclosed in do while (0) loop, +# macro should not end with a semicolon + if ($perl_version_ok && + $realfile !~ m@/vmlinux.lds.h$@ && + $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) { + my $ln = $linenr; + my $cnt = $realcnt; + my ($off, $dstat, $dcond, $rest); + my $ctx = ''; + ($dstat, $dcond, $ln, $cnt, $off) = + ctx_statement_block($linenr, $realcnt, 0); + $ctx = $dstat; + + $dstat =~ s/\\\n.//g; + $dstat =~ s/$;/ /g; + + if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*\)\s*([;\s]*)\s*$/) { + my $stmts = $2; + my $semis = $3; + + $ctx =~ s/\n*$//; + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + if (($stmts =~ tr/;/;/) == 1 && + $stmts !~ /^\s*(if|while|for|switch)\b/) { + WARN("SINGLE_STATEMENT_DO_WHILE_MACRO", + "Single statement macros should not use a do {} while (0) loop\n" . "$herectx"); + } + if (defined $semis && $semis ne "") { + WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON", + "do {} while (0) macros should not be semicolon terminated\n" . "$herectx"); + } + } elsif ($dstat =~ /^\+\s*#\s*define\s+$Ident.*;\s*$/) { + $ctx =~ s/\n*$//; + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("TRAILING_SEMICOLON", + "macros should not use a trailing semicolon\n" . "$herectx"); + } + } + +# check for redundant bracing round if etc + if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) { + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, 1); + #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n"; + #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n"; + if ($#chunks > 0 && $level == 0) { + my @allowed = (); + my $allow = 0; + my $seen = 0; + my $herectx = $here . "\n"; + my $ln = $linenr - 1; + for my $chunk (@chunks) { + my ($cond, $block) = @{$chunk}; + + # If the condition carries leading newlines, then count those as offsets. + my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = statement_rawlines($whitespace) - 1; + + $allowed[$allow] = 0; + #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n"; + + # We have looked at and allowed this specific line. + $suppress_ifbraces{$ln + $offset} = 1; + + $herectx .= "$rawlines[$ln + $offset]\n[...]\n"; + $ln += statement_rawlines($block) - 1; + + substr($block, 0, length($cond), ''); + + $seen++ if ($block =~ /^\s*{/); + + #print "cond<$cond> block<$block> allowed<$allowed[$allow]>\n"; + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed[$allow] = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed[$allow] = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed[$allow] = 1; + } + $allow++; + } + if ($seen) { + my $sum_allowed = 0; + foreach (@allowed) { + $sum_allowed += $_; + } + if ($sum_allowed == 0) { + WARN("BRACES", + "braces {} are not necessary for any arm of this statement\n" . $herectx); + } elsif ($sum_allowed != $allow && + $seen != $allow) { + CHK("BRACES", + "braces {} should be used on all arms of this statement\n" . $herectx); + } + } + } + } + if (!defined $suppress_ifbraces{$linenr - 1} && + $line =~ /\b(if|while|for|else)\b/) { + my $allowed = 0; + + # Check the pre-context. + if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) { + #print "APW: ALLOWED: pre<$1>\n"; + $allowed = 1; + } + + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, $-[0]); + + # Check the condition. + my ($cond, $block) = @{$chunks[0]}; + #print "CHECKING<$linenr> cond<$cond> block<$block>\n"; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed = 1; + } + # Check the post-context. + if (defined $chunks[1]) { + my ($cond, $block) = @{$chunks[1]}; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if ($block =~ /^\s*\{/) { + #print "APW: ALLOWED: chunk-1 block<$block>\n"; + $allowed = 1; + } + } + if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) { + my $cnt = statement_rawlines($block); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("BRACES", + "braces {} are not necessary for single statement blocks\n" . $herectx); + } + } + +# check for single line unbalanced braces + if ($sline =~ /^.\s*\}\s*else\s*$/ || + $sline =~ /^.\s*else\s*\{\s*$/) { + CHK("BRACES", "Unbalanced braces around else statement\n" . $herecurr); + } + +# check for unnecessary blank lines around braces + if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) { + if (CHK("BRACES", + "Blank lines aren't necessary before a close brace '}'\n" . $hereprev) && + $fix && $prevrawline =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + } + } + if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) { + if (CHK("BRACES", + "Blank lines aren't necessary after an open brace '{'\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + } + +# no volatiles please + my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; + if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { + WARN("VOLATILE", + "Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst\n" . $herecurr); + } + +# Check for user-visible strings broken across lines, which breaks the ability +# to grep for the string. Make exceptions when the previous string ends in a +# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{' +# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value + if ($line =~ /^\+\s*$String/ && + $prevline =~ /"\s*$/ && + $prevrawline !~ /(?:\\(?:[ntr]|[0-7]{1,3}|x[0-9a-fA-F]{1,2})|;\s*|\{\s*)"\s*$/) { + if (WARN("SPLIT_STRING", + "quoted string split across lines\n" . $hereprev) && + $fix && + $prevrawline =~ /^\+.*"\s*$/ && + $last_coalesced_string_linenr != $linenr - 1) { + my $extracted_string = get_quoted_string($line, $rawline); + my $comma_close = ""; + if ($rawline =~ /\Q$extracted_string\E(\s*\)\s*;\s*$|\s*,\s*)/) { + $comma_close = $1; + } + + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/"\s*$//; + $fixedline .= substr($extracted_string, 1) . trim($comma_close); + fix_insert_line($fixlinenr - 1, $fixedline); + $fixedline = $rawline; + $fixedline =~ s/\Q$extracted_string\E\Q$comma_close\E//; + if ($fixedline !~ /\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + $last_coalesced_string_linenr = $linenr; + } + } + +# check for missing a space in a string concatenation + if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) { + WARN('MISSING_SPACE', + "break quoted strings at a space character\n" . $hereprev); + } + +# check for an embedded function name in a string when the function is known +# This does not work very well for -f --file checking as it depends on patch +# context providing the function name or a single line form for in-file +# function declarations + if (!$SOF && + $line =~ /^\+.*$String/ && + defined($context_function) && + get_quoted_string($line, $rawline) =~ /\b$context_function\b/ && + length(get_quoted_string($line, $rawline)) != (length($context_function) + 2)) { + WARN("EMBEDDED_FUNCTION_NAME", + "Prefer using '\"%s...\", __func__' to using '$context_function', this function's name, in a string\n" . $herecurr); + } + +# check for spaces before a quoted newline + if ($rawline =~ /^.*\".*\s\\n/) { + if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE", + "unnecessary whitespace before a quoted newline\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+.*\".*)\s+\\n/$1\\n/; + } + + } + +# concatenated string without spaces between elements + if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) { + if (CHK("CONCATENATED_STRING", + "Concatenated strings should use spaces between elements\n" . $herecurr) && + $fix) { + while ($line =~ /($String)/g) { + my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); + $fixed[$fixlinenr] =~ s/\Q$extracted_string\E([A-Za-z0-9_])/$extracted_string $1/; + $fixed[$fixlinenr] =~ s/([A-Za-z0-9_])\Q$extracted_string\E/$1 $extracted_string/; + } + } + } + +# uncoalesced string fragments + if ($line =~ /$String\s*"/) { + if (WARN("STRING_FRAGMENTS", + "Consecutive strings are generally better as a single string\n" . $herecurr) && + $fix) { + while ($line =~ /($String)(?=\s*")/g) { + my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); + $fixed[$fixlinenr] =~ s/\Q$extracted_string\E\s*"/substr($extracted_string, 0, -1)/e; + } + } + } + +# check for non-standard and hex prefixed decimal printf formats + my $show_L = 1; #don't show the same defect twice + my $show_Z = 1; + while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { + my $string = substr($rawline, $-[1], $+[1] - $-[1]); + $string =~ s/%%/__/g; + # check for %L + if ($show_L && $string =~ /%[\*\d\.\$]*L([diouxX])/) { + WARN("PRINTF_L", + "\%L$1 is non-standard C, use %ll$1\n" . $herecurr); + $show_L = 0; + } + # check for %Z + if ($show_Z && $string =~ /%[\*\d\.\$]*Z([diouxX])/) { + WARN("PRINTF_Z", + "%Z$1 is non-standard C, use %z$1\n" . $herecurr); + $show_Z = 0; + } + # check for 0x<decimal> + if ($string =~ /0x%[\*\d\.\$\Llzth]*[diou]/) { + ERROR("PRINTF_0XDECIMAL", + "Prefixing 0x with decimal output is defective\n" . $herecurr); + } + } + +# check for line continuations in quoted strings with odd counts of " + if ($rawline =~ /\\$/ && $sline =~ tr/"/"/ % 2) { + WARN("LINE_CONTINUATIONS", + "Avoid line continuations in quoted strings\n" . $herecurr); + } + +# warn about #if 0 + if ($line =~ /^.\s*\#\s*if\s+0\b/) { + WARN("IF_0", + "Consider removing the code enclosed by this #if 0 and its #endif\n" . $herecurr); + } + +# warn about #if 1 + if ($line =~ /^.\s*\#\s*if\s+1\b/) { + WARN("IF_1", + "Consider removing the #if 1 and its #endif\n" . $herecurr); + } + +# check for needless "if (<foo>) fn(<foo>)" uses + if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) { + my $tested = quotemeta($1); + my $expr = '\s*\(\s*' . $tested . '\s*\)\s*;'; + if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?|(?:kmem_cache|mempool|dma_pool)_destroy)$expr/) { + my $func = $1; + if (WARN('NEEDLESS_IF', + "$func(NULL) is safe and this check is probably not required\n" . $hereprev) && + $fix) { + my $do_fix = 1; + my $leading_tabs = ""; + my $new_leading_tabs = ""; + if ($lines[$linenr - 2] =~ /^\+(\t*)if\s*\(\s*$tested\s*\)\s*$/) { + $leading_tabs = $1; + } else { + $do_fix = 0; + } + if ($lines[$linenr - 1] =~ /^\+(\t+)$func\s*\(\s*$tested\s*\)\s*;\s*$/) { + $new_leading_tabs = $1; + if (length($leading_tabs) + 1 ne length($new_leading_tabs)) { + $do_fix = 0; + } + } else { + $do_fix = 0; + } + if ($do_fix) { + fix_delete_line($fixlinenr - 1, $prevrawline); + $fixed[$fixlinenr] =~ s/^\+$new_leading_tabs/\+$leading_tabs/; + } + } + } + } + +# check for unnecessary "Out of Memory" messages + if ($line =~ /^\+.*\b$logFunctions\s*\(/ && + $prevline =~ /^[ \+]\s*if\s*\(\s*(\!\s*|NULL\s*==\s*)?($Lval)(\s*==\s*NULL\s*)?\s*\)/ && + (defined $1 || defined $3) && + $linenr > 3) { + my $testval = $2; + my $testline = $lines[$linenr - 3]; + + my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); +# print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); + + if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ && + $s !~ /\b__GFP_NOWARN\b/ ) { + WARN("OOM_MESSAGE", + "Possible unnecessary 'out of memory' message\n" . $hereprev); + } + } + +# check for logging functions with KERN_<LEVEL> + if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ && + $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) { + my $level = $1; + if (WARN("UNNECESSARY_KERN_LEVEL", + "Possible unnecessary $level\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s*$level\s*//; + } + } + +# check for logging continuations + if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) { + WARN("LOGGING_CONTINUATION", + "Avoid logging continuation uses where feasible\n" . $herecurr); + } + +# check for mask then right shift without a parentheses + if ($perl_version_ok && + $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ && + $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so + WARN("MASK_THEN_SHIFT", + "Possible precedence defect with mask then right shift - may need parentheses\n" . $herecurr); + } + +# check for pointer comparisons to NULL + if ($perl_version_ok) { + while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) { + my $val = $1; + my $equal = "!"; + $equal = "" if ($4 eq "!="); + if (CHK("COMPARISON_TO_NULL", + "Comparison to NULL could be written \"${equal}${val}\"\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b\Q$val\E\s*(?:==|\!=)\s*NULL\b/$equal$val/; + } + } + } + +# check for bad placement of section $InitAttribute (e.g.: __initdata) + if ($line =~ /(\b$InitAttribute\b)/) { + my $attr = $1; + if ($line =~ /^\+\s*static\s+(?:const\s+)?(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(?:\[[^]]*\])?)\s*[=;]/) { + my $ptr = $1; + my $var = $2; + if ((($ptr =~ /\b(union|struct)\s+$attr\b/ && + ERROR("MISPLACED_INIT", + "$attr should be placed after $var\n" . $herecurr)) || + ($ptr !~ /\b(union|struct)\s+$attr\b/ && + WARN("MISPLACED_INIT", + "$attr should be placed after $var\n" . $herecurr))) && + $fix) { + $fixed[$fixlinenr] =~ s/(\bstatic\s+(?:const\s+)?)(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(?:\[[^]]*\])?)\s*([=;])\s*/"$1" . trim(string_find_replace($2, "\\s*$attr\\s*", " ")) . " " . trim(string_find_replace($3, "\\s*$attr\\s*", "")) . " $attr" . ("$4" eq ";" ? ";" : " = ")/e; + } + } + } + +# check for $InitAttributeData (ie: __initdata) with const + if ($line =~ /\bconst\b/ && $line =~ /($InitAttributeData)/) { + my $attr = $1; + $attr =~ /($InitAttributePrefix)(.*)/; + my $attr_prefix = $1; + my $attr_type = $2; + if (ERROR("INIT_ATTRIBUTE", + "Use of const init definition must use ${attr_prefix}initconst\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/$InitAttributeData/${attr_prefix}initconst/; + } + } + +# check for $InitAttributeConst (ie: __initconst) without const + if ($line !~ /\bconst\b/ && $line =~ /($InitAttributeConst)/) { + my $attr = $1; + if (ERROR("INIT_ATTRIBUTE", + "Use of $attr requires a separate use of const\n" . $herecurr) && + $fix) { + my $lead = $fixed[$fixlinenr] =~ + /(^\+\s*(?:static\s+))/; + $lead = rtrim($1); + $lead = "$lead " if ($lead !~ /^\+$/); + $lead = "${lead}const "; + $fixed[$fixlinenr] =~ s/(^\+\s*(?:static\s+))/$lead/; + } + } + +# check for __read_mostly with const non-pointer (should just be const) + if ($line =~ /\b__read_mostly\b/ && + $line =~ /($Type)\s*$Ident/ && $1 !~ /\*\s*$/ && $1 =~ /\bconst\b/) { + if (ERROR("CONST_READ_MOSTLY", + "Invalid use of __read_mostly with const type\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+__read_mostly\b//; + } + } + +# don't use __constant_<foo> functions outside of include/uapi/ + if ($realfile !~ m@^include/uapi/@ && + $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { + my $constant_func = $1; + my $func = $constant_func; + $func =~ s/^__constant_//; + if (WARN("CONSTANT_CONVERSION", + "$constant_func should be $func\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b$constant_func\b/$func/g; + } + } + +# prefer usleep_range over udelay + if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { + my $delay = $1; + # ignore udelay's < 10, however + if (! ($delay < 10) ) { + CHK("USLEEP_RANGE", + "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst\n" . $herecurr); + } + if ($delay > 2000) { + WARN("LONG_UDELAY", + "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $herecurr); + } + } + +# warn about unexpectedly long msleep's + if ($line =~ /\bmsleep\s*\((\d+)\);/) { + if ($1 < 20) { + WARN("MSLEEP", + "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst\n" . $herecurr); + } + } + +# check for comparisons of jiffies + if ($line =~ /\bjiffies\s*$Compare|$Compare\s*jiffies\b/) { + WARN("JIFFIES_COMPARISON", + "Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr); + } + +# check for comparisons of get_jiffies_64() + if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) { + WARN("JIFFIES_COMPARISON", + "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr); + } + +# warn about #ifdefs in C files +# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { +# print "#ifdef in C files should be avoided\n"; +# print "$herecurr"; +# $clean = 0; +# } + +# warn about spacing in #ifdefs + if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) { + if (ERROR("SPACING", + "exactly one space required after that #$1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*\#\s*(ifdef|ifndef|elif))\s{2,}/$1 /; + } + + } + +# check for spinlock_t definitions without a comment. + if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || + $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { + my $which = $1; + if (!ctx_has_comment($first_line, $linenr)) { + CHK("UNCOMMENTED_DEFINITION", + "$1 definition without comment\n" . $herecurr); + } + } +# check for memory barriers without a comment. + + my $barriers = qr{ + mb| + rmb| + wmb| + read_barrier_depends + }x; + my $barrier_stems = qr{ + mb__before_atomic| + mb__after_atomic| + store_release| + load_acquire| + store_mb| + (?:$barriers) + }x; + my $all_barriers = qr{ + (?:$barriers)| + smp_(?:$barrier_stems)| + virt_(?:$barrier_stems) + }x; + + if ($line =~ /\b(?:$all_barriers)\s*\(/) { + if (!ctx_has_comment($first_line, $linenr)) { + WARN("MEMORY_BARRIER", + "memory barrier without comment\n" . $herecurr); + } + } + + my $underscore_smp_barriers = qr{__smp_(?:$barrier_stems)}x; + + if ($realfile !~ m@^include/asm-generic/@ && + $realfile !~ m@/barrier\.h$@ && + $line =~ m/\b(?:$underscore_smp_barriers)\s*\(/ && + $line !~ m/^.\s*\#\s*define\s+(?:$underscore_smp_barriers)\s*\(/) { + WARN("MEMORY_BARRIER", + "__smp memory barriers shouldn't be used outside barrier.h and asm-generic\n" . $herecurr); + } + +# check for waitqueue_active without a comment. + if ($line =~ /\bwaitqueue_active\s*\(/) { + if (!ctx_has_comment($first_line, $linenr)) { + WARN("WAITQUEUE_ACTIVE", + "waitqueue_active without comment\n" . $herecurr); + } + } + +# check for smp_read_barrier_depends and read_barrier_depends + if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) { + WARN("READ_BARRIER_DEPENDS", + "$1read_barrier_depends should only be used in READ_ONCE or DEC Alpha code\n" . $herecurr); + } + +# check of hardware specific defines + if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { + CHK("ARCH_DEFINES", + "architecture specific defines should be avoided\n" . $herecurr); + } + +# check that the storage class is not after a type + if ($line =~ /\b($Type)\s+($Storage)\b/) { + WARN("STORAGE_CLASS", + "storage class '$2' should be located before type '$1'\n" . $herecurr); + } +# Check that the storage class is at the beginning of a declaration + if ($line =~ /\b$Storage\b/ && + $line !~ /^.\s*$Storage/ && + $line =~ /^.\s*(.+?)\$Storage\s/ && + $1 !~ /[\,\)]\s*$/) { + WARN("STORAGE_CLASS", + "storage class should be at the beginning of the declaration\n" . $herecurr); + } + +# check the location of the inline attribute, that it is between +# storage class and type. + if ($line =~ /\b$Type\s+$Inline\b/ || + $line =~ /\b$Inline\s+$Storage\b/) { + ERROR("INLINE_LOCATION", + "inline keyword should sit between storage class and type\n" . $herecurr); + } + +# Check for __inline__ and __inline, prefer inline + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b(__inline__|__inline)\b/) { + if (WARN("INLINE", + "plain inline is preferred over $1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b(__inline__|__inline)\b/inline/; + + } + } + +# Check for __attribute__ packed, prefer __packed + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) { + WARN("PREFER_PACKED", + "__packed is preferred over __attribute__((packed))\n" . $herecurr); + } + +# Check for __attribute__ aligned, prefer __aligned + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*aligned/) { + WARN("PREFER_ALIGNED", + "__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr); + } + +# Check for __attribute__ section, prefer __section + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*_*section_*\s*\(\s*("[^"]*")/) { + my $old = substr($rawline, $-[1], $+[1] - $-[1]); + my $new = substr($old, 1, -1); + if (WARN("PREFER_SECTION", + "__section($new) is preferred over __attribute__((section($old)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*_*section_*\s*\(\s*\Q$old\E\s*\)\s*\)\s*\)/__section($new)/; + } + } + +# Check for __attribute__ format(printf, prefer __printf + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf/) { + if (WARN("PREFER_PRINTF", + "__printf(string-index, first-to-check) is preferred over __attribute__((format(printf, string-index, first-to-check)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.*)\)\s*\)\s*\)/"__printf(" . trim($1) . ")"/ex; + + } + } + +# Check for __attribute__ format(scanf, prefer __scanf + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*scanf\b/) { + if (WARN("PREFER_SCANF", + "__scanf(string-index, first-to-check) is preferred over __attribute__((format(scanf, string-index, first-to-check)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*scanf\s*,\s*(.*)\)\s*\)\s*\)/"__scanf(" . trim($1) . ")"/ex; + } + } + +# Check for __attribute__ weak, or __weak declarations (may have link issues) + if ($perl_version_ok && + $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ && + ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ || + $line =~ /\b__weak\b/)) { + ERROR("WEAK_DECLARATION", + "Using weak declarations can have unintended link defects\n" . $herecurr); + } + +# check for c99 types like uint8_t used outside of uapi/ and tools/ + if (!$SOF && + $realfile !~ m@\binclude/uapi/@ && + $realfile !~ m@\btools/@ && + $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) { + my $type = $1; + if ($type =~ /\b($typeC99Typedefs)\b/) { + $type = $1; + my $kernel_type = 'u'; + $kernel_type = 's' if ($type =~ /^_*[si]/); + $type =~ /(\d+)/; + $kernel_type .= $1; + if (CHK("PREFER_KERNEL_TYPES", + "Prefer kernel type '$kernel_type' over '$type'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b$type\b/$kernel_type/; + } + } + } + +# check for cast of C90 native int or longer types constants + if ($line =~ /(\(\s*$C90_int_types\s*\)\s*)($Constant)\b/) { + my $cast = $1; + my $const = $2; + if (WARN("TYPECAST_INT_CONSTANT", + "Unnecessary typecast of c90 int constant\n" . $herecurr) && + $fix) { + my $suffix = ""; + my $newconst = $const; + $newconst =~ s/${Int_type}$//; + $suffix .= 'U' if ($cast =~ /\bunsigned\b/); + if ($cast =~ /\blong\s+long\b/) { + $suffix .= 'LL'; + } elsif ($cast =~ /\blong\b/) { + $suffix .= 'L'; + } + $fixed[$fixlinenr] =~ s/\Q$cast\E$const\b/$newconst$suffix/; + } + } + +# check for sizeof(&) + if ($line =~ /\bsizeof\s*\(\s*\&/) { + WARN("SIZEOF_ADDRESS", + "sizeof(& should be avoided\n" . $herecurr); + } + +# check for sizeof without parenthesis + if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) { + if (WARN("SIZEOF_PARENTHESIS", + "sizeof $1 should be sizeof($1)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/"sizeof(" . trim($1) . ")"/ex; + } + } + +# check for struct spinlock declarations + if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) { + WARN("USE_SPINLOCK_T", + "struct spinlock should be spinlock_t\n" . $herecurr); + } + +# check for seq_printf uses that could be seq_puts + if ($sline =~ /\bseq_printf\s*\(.*"\s*\)\s*;\s*$/) { + my $fmt = get_quoted_string($line, $rawline); + $fmt =~ s/%%//g; + if ($fmt !~ /%/) { + if (WARN("PREFER_SEQ_PUTS", + "Prefer seq_puts to seq_printf\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bseq_printf\b/seq_puts/; + } + } + } + +# check for memcpy uses that should be memcpy_s + if ($SOF && ($line =~ /memcpy\s*\(.*/)) { + my $fmt = get_quoted_string($line, $rawline); + $fmt =~ s/%%//g; + if ($fmt !~ /%/) { + if (WARN("PREFER_MEMCPY_S", + "Use safe version of memcpy - memcpy_s whenever possible\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/memcpy\b/memcpy_s/; + } + } + } + +# check for vsprintf extension %p<foo> misuses + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s && + $1 !~ /^_*volatile_*$/) { + my $stat_real; + + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + for (my $count = $linenr; $count <= $lc; $count++) { + my $specifier; + my $extension; + my $bad_specifier = ""; + my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); + $fmt =~ s/%%//g; + + while ($fmt =~ /(\%[\*\d\.]*p(\w))/g) { + $specifier = $1; + $extension = $2; + if ($extension !~ /[SsBKRraEhMmIiUDdgVCbGNOxt]/) { + $bad_specifier = $specifier; + last; + } + if ($extension eq "x" && !defined($stat_real)) { + if (!defined($stat_real)) { + $stat_real = get_stat_real($linenr, $lc); + } + WARN("VSPRINTF_SPECIFIER_PX", + "Using vsprintf specifier '\%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '\%p'.\n" . "$here\n$stat_real\n"); + } + } + if ($bad_specifier ne "") { + my $stat_real = get_stat_real($linenr, $lc); + my $ext_type = "Invalid"; + my $use = ""; + if ($bad_specifier =~ /p[Ff]/) { + $ext_type = "Deprecated"; + $use = " - use %pS instead"; + $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/); + } + + WARN("VSPRINTF_POINTER_EXTENSION", + "$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n"); + } + } + } + +# Check for misused memsets + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*$FuncArg\s*\)/) { + + my $ms_addr = $2; + my $ms_val = $7; + my $ms_size = $12; + + if ($ms_size =~ /^(0x|)0$/i) { + ERROR("MEMSET", + "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n"); + } elsif ($ms_size =~ /^(0x|)1$/i) { + WARN("MEMSET", + "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n"); + } + } + +# Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar) +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# if (WARN("PREFER_ETHER_ADDR_COPY", +# "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/ether_addr_copy($2, $7)/; +# } +# } + +# Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar) +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# WARN("PREFER_ETHER_ADDR_EQUAL", +# "Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()\n" . "$here\n$stat\n") +# } + +# check for memset(foo, 0x0, ETH_ALEN) that could be eth_zero_addr +# check for memset(foo, 0xFF, ETH_ALEN) that could be eth_broadcast_addr +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# +# my $ms_val = $7; +# +# if ($ms_val =~ /^(?:0x|)0+$/i) { +# if (WARN("PREFER_ETH_ZERO_ADDR", +# "Prefer eth_zero_addr over memset()\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_zero_addr($2)/; +# } +# } elsif ($ms_val =~ /^(?:0xff|255)$/i) { +# if (WARN("PREFER_ETH_BROADCAST_ADDR", +# "Prefer eth_broadcast_addr() over memset()\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_broadcast_addr($2)/; +# } +# } +# } + +# typecasts on min/max could be min_t/max_t + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) { + if (defined $2 || defined $7) { + my $call = $1; + my $cast1 = deparenthesize($2); + my $arg1 = $3; + my $cast2 = deparenthesize($7); + my $arg2 = $8; + my $cast; + + if ($cast1 ne "" && $cast2 ne "" && $cast1 ne $cast2) { + $cast = "$cast1 or $cast2"; + } elsif ($cast1 ne "") { + $cast = $cast1; + } else { + $cast = $cast2; + } + WARN("MINMAX", + "$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . "$here\n$stat\n"); + } + } + +# check usleep_range arguments + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) { + my $min = $1; + my $max = $7; + if ($min eq $max) { + WARN("USLEEP_RANGE", + "usleep_range should not use min == max args; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + } elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ && + $min > $max) { + WARN("USLEEP_RANGE", + "usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + } + } + +# check for naked sscanf + if ($perl_version_ok && + defined $stat && + $line =~ /\bsscanf\b/ && + ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && + $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ && + $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) { + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + WARN("NAKED_SSCANF", + "unchecked sscanf return value\n" . "$here\n$stat_real\n"); + } + +# check for simple sscanf that should be kstrto<foo> + if ($perl_version_ok && + defined $stat && + $line =~ /\bsscanf\b/) { + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) { + my $format = $6; + my $count = $format =~ tr@%@%@; + if ($count == 1 && + $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { + WARN("SSCANF_TO_KSTRTO", + "Prefer kstrto<type> to single variable sscanf\n" . "$here\n$stat_real\n"); + } + } + } + +# check for new externs in .h files. + if ($realfile =~ /\.h$/ && + $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { + if (CHK("AVOID_EXTERNS", + "extern prototypes should be avoided in .h files\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(.*)\bextern\b\s*(.*)/$1$2/; + } + } + +# check for new externs in .c files. + if ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) + { + my $function_name = $1; + my $paren_space = $2; + + my $s = $stat; + if (defined $cond) { + substr($s, 0, length($cond), ''); + } + if ($s =~ /^\s*;/ && + $function_name ne 'uninitialized_var') + { + WARN("AVOID_EXTERNS", + "externs should be avoided in .c files\n" . $herecurr); + } + + if ($paren_space =~ /\n/) { + WARN("FUNCTION_ARGUMENTS", + "arguments for function declarations should follow identifier\n" . $herecurr); + } + + } elsif ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*extern\s+/) + { + WARN("AVOID_EXTERNS", + "externs should be avoided in .c files\n" . $herecurr); + } + +# check for function declarations that have arguments without identifier names + if (defined $stat && + $stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s && + $1 ne "void") { + my $args = trim($1); + while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) { + my $arg = trim($1); + if ($arg =~ /^$Type$/ && $arg !~ /enum\s+$Ident$/) { + WARN("FUNCTION_ARGUMENTS", + "function definition argument '$arg' should also have an identifier name\n" . $herecurr); + } + } + } + +# check for function definitions + if ($perl_version_ok && + defined $stat && + $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) { + $context_function = $1; + +# check for multiline function definition with misplaced open brace + my $ok = 0; + my $cnt = statement_rawlines($stat); + my $herectx = $here . "\n"; + for (my $n = 0; $n < $cnt; $n++) { + my $rl = raw_line($linenr, $n); + $herectx .= $rl . "\n"; + $ok = 1 if ($rl =~ /^[ \+]\{/); + $ok = 1 if ($rl =~ /\{/ && $n == 0); + last if $rl =~ /^[ \+].*\{/; + } + if (!$ok) { + ERROR("OPEN_BRACE", + "open brace '{' following function definitions go on the next line\n" . $herectx); + } + } + +# checks for new __setup's + if ($rawline =~ /\b__setup\("([^"]*)"/) { + my $name = $1; + + if (!grep(/$name/, @setup_docs)) { + CHK("UNDOCUMENTED_SETUP", + "__setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst\n" . $herecurr); + } + } + +# check for pointless casting of alloc functions + if ($line =~ /\*\s*\)\s*$allocFunctions\b/) { + WARN("UNNECESSARY_CASTS", + "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); + } + +# alloc style +# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) + if ($perl_version_ok && + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { + CHK("ALLOC_SIZEOF_STRUCT", + "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); + } + +# check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { + my $oldfunc = $3; + my $a1 = $4; + my $a2 = $10; + my $newfunc = "kmalloc_array"; + $newfunc = "kcalloc" if ($oldfunc eq "kzalloc"); + my $r1 = $a1; + my $r2 = $a2; + if ($a1 =~ /^sizeof\s*\S/) { + $r1 = $a2; + $r2 = $a1; + } + if ($r1 !~ /^sizeof\b/ && $r2 =~ /^sizeof\s*\S/ && + !($r1 =~ /^$Constant$/ || $r1 =~ /^[A-Z_][A-Z0-9_]*$/)) { + my $cnt = statement_rawlines($stat); + my $herectx = get_stat_here($linenr, $cnt, $here); + + if (WARN("ALLOC_WITH_MULTIPLY", + "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) && + $cnt == 1 && + $fix) { + $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e; + } + } + } + +# check for krealloc arg reuse + if ($perl_version_ok && + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*($Lval)\s*,/ && + $1 eq $3) { + WARN("KREALLOC_ARG_REUSE", + "Reusing the krealloc arg is almost always a bug\n" . $herecurr); + } + +# check for alloc argument mismatch + if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { + WARN("ALLOC_ARRAY_ARGS", + "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); + } + +# check for multiple semicolons + if ($line =~ /;\s*;\s*$/) { + if (WARN("ONE_SEMICOLON", + "Statements terminations use 1 semicolon\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\s*;\s*){2,}$/;/g; + } + } + +# check for #defines like: 1 << <digit> that could be BIT(digit), it is not exported to uapi + if ($realfile !~ m@^include/uapi/@ && + $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) { + my $ull = ""; + $ull = "_ULL" if (defined($1) && $1 =~ /ll/i); + if (CHK("BIT_MACRO", + "Prefer using the BIT$ull macro\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/; + } + } + +# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE + if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) { + my $config = $1; + if (WARN("PREFER_IS_ENABLED", + "Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)"; + } + } + +# check for case / default statements not preceded by break/fallthrough/switch + if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) { + my $has_break = 0; + my $has_statement = 0; + my $count = 0; + my $prevline = $linenr; + while ($prevline > 1 && ($file || $count < 3) && !$has_break) { + $prevline--; + my $rline = $rawlines[$prevline - 1]; + my $fline = $lines[$prevline - 1]; + last if ($fline =~ /^\@\@/); + next if ($fline =~ /^\-/); + next if ($fline =~ /^.(?:\s*(?:case\s+(?:$Ident|$Constant)[\s$;]*|default):[\s$;]*)*$/); + $has_break = 1 if ($rline =~ /fall[\s_-]*(through|thru)/i); + next if ($fline =~ /^.[\s$;]*$/); + $has_statement = 1; + $count++; + $has_break = 1 if ($fline =~ /\bswitch\b|\b(?:break\s*;[\s$;]*$|exit\s*\(\b|return\b|goto\b|continue\b)/); + } + if (!$has_break && $has_statement) { + WARN("MISSING_BREAK", + "Possible switch case/default not preceded by break or fallthrough comment\n" . $herecurr); + } + } + +# check for switch/default statements without a break; + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+[$;\s]*(?:case[$;\s]+\w+[$;\s]*:[$;\s]*|)*[$;\s]*\bdefault[$;\s]*:[$;\s]*;/g) { + my $cnt = statement_rawlines($stat); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("DEFAULT_NO_BREAK", + "switch default: should use break\n" . $herectx); + } + +# check for gcc specific __FUNCTION__ + if ($line =~ /\b__FUNCTION__\b/) { + if (WARN("USE_FUNC", + "__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__FUNCTION__\b/__func__/g; + } + } + +# check for uses of __DATE__, __TIME__, __TIMESTAMP__ + while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) { + ERROR("DATE_TIME", + "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr); + } + +# check for use of yield() + if ($line =~ /\byield\s*\(\s*\)/) { + WARN("YIELD", + "Using yield() is generally wrong. See yield() kernel-doc (sched/core.c)\n" . $herecurr); + } + +# check for comparisons against true and false + if ($line =~ /\+\s*(.*?)\b(true|false|$Lval)\s*(==|\!=)\s*(true|false|$Lval)\b(.*)$/i) { + my $lead = $1; + my $arg = $2; + my $test = $3; + my $otype = $4; + my $trail = $5; + my $op = "!"; + + ($arg, $otype) = ($otype, $arg) if ($arg =~ /^(?:true|false)$/i); + + my $type = lc($otype); + if ($type =~ /^(?:true|false)$/) { + if (("$test" eq "==" && "$type" eq "true") || + ("$test" eq "!=" && "$type" eq "false")) { + $op = ""; + } + + CHK("BOOL_COMPARISON", + "Using comparison to $otype is error prone\n" . $herecurr); + +## maybe suggesting a correct construct would better +## "Using comparison to $otype is error prone. Perhaps use '${lead}${op}${arg}${trail}'\n" . $herecurr); + + } + } + +# check for semaphores initialized locked + if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { + WARN("CONSIDER_COMPLETION", + "consider using a completion\n" . $herecurr); + } + +# recommend kstrto* over simple_strto* and strict_strto* + if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) { + WARN("CONSIDER_KSTRTO", + "$1 is obsolete, use k$3 instead\n" . $herecurr); + } + +# check for __initcall(), use device_initcall() explicitly or more appropriate function please + if ($line =~ /^.\s*__initcall\s*\(/) { + WARN("USE_DEVICE_INITCALL", + "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr); + } + +# check for spin_is_locked(), suggest lockdep instead + if ($line =~ /\bspin_is_locked\(/) { + WARN("USE_LOCKDEP", + "Where possible, use lockdep_assert_held instead of assertions based on spin_is_locked\n" . $herecurr); + } + +# check for deprecated apis + if ($line =~ /\b($deprecated_apis_search)\b\s*\(/) { + my $deprecated_api = $1; + my $new_api = $deprecated_apis{$deprecated_api}; + WARN("DEPRECATED_API", + "Deprecated use of '$deprecated_api', prefer '$new_api' instead\n" . $herecurr); + } + +# check for various structs that are normally const (ops, kgdb, device_tree) +# and avoid what seem like struct definitions 'struct foo {' + if ($line !~ /\bconst\b/ && + $line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) { + WARN("CONST_STRUCT", + "struct $1 should normally be const\n" . $herecurr); + } + +# use of NR_CPUS is usually wrong +# ignore definitions of NR_CPUS and usage to define arrays as likely right + if ($line =~ /\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/) + { + WARN("NR_CPUS", + "usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr); + } + +# Use of __ARCH_HAS_<FOO> or ARCH_HAVE_<BAR> is wrong. + if ($line =~ /\+\s*#\s*define\s+((?:__)?ARCH_(?:HAS|HAVE)\w*)\b/) { + ERROR("DEFINE_ARCH_HAS", + "#define of '$1' is wrong - use Kconfig variables or standard guards instead\n" . $herecurr); + } + +# likely/unlikely comparisons similar to "(likely(foo) > 0)" + if ($perl_version_ok && + $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) { + WARN("LIKELY_MISUSE", + "Using $1 should generally have parentheses around the comparison\n" . $herecurr); + } + +# nested likely/unlikely calls + if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { + WARN("LIKELY_MISUSE", + "nested (un)?likely() calls, $1 already uses unlikely() internally\n" . $herecurr); + } + +# whine mightly about in_atomic + if ($line =~ /\bin_atomic\s*\(/) { + if ($realfile =~ m@^drivers/@) { + ERROR("IN_ATOMIC", + "do not use in_atomic in drivers\n" . $herecurr); + } elsif ($realfile !~ m@^kernel/@) { + WARN("IN_ATOMIC", + "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); + } + } + +# check for mutex_trylock_recursive usage + if ($line =~ /mutex_trylock_recursive/) { + ERROR("LOCKING", + "recursive locking is bad, do not use this ever.\n" . $herecurr); + } + +# check for lockdep_set_novalidate_class + if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || + $line =~ /__lockdep_no_validate__\s*\)/ ) { + if ($realfile !~ m@^kernel/lockdep@ && + $realfile !~ m@^include/linux/lockdep@ && + $realfile !~ m@^drivers/base/core@) { + ERROR("LOCKDEP", + "lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr); + } + } + + if ($line =~ /debugfs_create_\w+.*\b$mode_perms_world_writable\b/ || + $line =~ /DEVICE_ATTR.*\b$mode_perms_world_writable\b/) { + WARN("EXPORTED_WORLD_WRITABLE", + "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); + } + +# check for DEVICE_ATTR uses that could be DEVICE_ATTR_<FOO> +# and whether or not function naming is typical and if +# DEVICE_ATTR permissions uses are unusual too + if ($perl_version_ok && + defined $stat && + $stat =~ /\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?\s*(\s*(?:${multi_mode_perms_string_search}|0[0-7]{3,3})\s*)\s*\)?\s*,\s*(\w+)\s*,\s*(\w+)\s*\)/) { + my $var = $1; + my $perms = $2; + my $show = $3; + my $store = $4; + my $octal_perms = perms_to_octal($perms); + if ($show =~ /^${var}_show$/ && + $store =~ /^${var}_store$/ && + $octal_perms eq "0644") { + if (WARN("DEVICE_ATTR_RW", + "Use DEVICE_ATTR_RW\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*$store\s*\)/DEVICE_ATTR_RW(${var})/; + } + } elsif ($show =~ /^${var}_show$/ && + $store =~ /^NULL$/ && + $octal_perms eq "0444") { + if (WARN("DEVICE_ATTR_RO", + "Use DEVICE_ATTR_RO\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(${var})/; + } + } elsif ($show =~ /^NULL$/ && + $store =~ /^${var}_store$/ && + $octal_perms eq "0200") { + if (WARN("DEVICE_ATTR_WO", + "Use DEVICE_ATTR_WO\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*NULL\s*,\s*$store\s*\)/DEVICE_ATTR_WO(${var})/; + } + } elsif ($octal_perms eq "0644" || + $octal_perms eq "0444" || + $octal_perms eq "0200") { + my $newshow = "$show"; + $newshow = "${var}_show" if ($show ne "NULL" && $show ne "${var}_show"); + my $newstore = $store; + $newstore = "${var}_store" if ($store ne "NULL" && $store ne "${var}_store"); + my $rename = ""; + if ($show ne $newshow) { + $rename .= " '$show' to '$newshow'"; + } + if ($store ne $newstore) { + $rename .= " '$store' to '$newstore'"; + } + WARN("DEVICE_ATTR_FUNCTIONS", + "Consider renaming function(s)$rename\n" . $herecurr); + } else { + WARN("DEVICE_ATTR_PERMS", + "DEVICE_ATTR unusual permissions '$perms' used\n" . $herecurr); + } + } + +# Mode permission misuses where it seems decimal should be octal +# This uses a shortcut match to avoid unnecessary uses of a slow foreach loop +# o Ignore module_param*(...) uses with a decimal 0 permission as that has a +# specific definition of not visible in sysfs. +# o Ignore proc_create*(...) uses with a decimal 0 permission as that means +# use the default permissions + if ($perl_version_ok && + defined $stat && + $line =~ /$mode_perms_search/) { + foreach my $entry (@mode_permission_funcs) { + my $func = $entry->[0]; + my $arg_pos = $entry->[1]; + + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + + my $skip_args = ""; + if ($arg_pos > 1) { + $arg_pos--; + $skip_args = "(?:\\s*$FuncArg\\s*,\\s*){$arg_pos,$arg_pos}"; + } + my $test = "\\b$func\\s*\\(${skip_args}($FuncArg(?:\\|\\s*$FuncArg)*)\\s*[,\\)]"; + if ($stat =~ /$test/) { + my $val = $1; + $val = $6 if ($skip_args ne ""); + if (!($func =~ /^(?:module_param|proc_create)/ && $val eq "0") && + (($val =~ /^$Int$/ && $val !~ /^$Octal$/) || + ($val =~ /^$Octal$/ && length($val) ne 4))) { + ERROR("NON_OCTAL_PERMISSIONS", + "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real); + } + if ($val =~ /^$Octal$/ && (oct($val) & 02)) { + ERROR("EXPORTED_WORLD_WRITABLE", + "Exporting writable files is usually an error. Consider more restrictive permissions.\n" . "$here\n" . $stat_real); + } + } + } + } + +# check for uses of S_<PERMS> that could be octal for readability + while ($line =~ m{\b($multi_mode_perms_string_search)\b}g) { + my $oval = $1; + my $octal = perms_to_octal($oval); + if (WARN("SYMBOLIC_PERMS", + "Symbolic permissions '$oval' are not preferred. Consider using octal permissions '$octal'.\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\Q$oval\E/$octal/; + } + } + +# validate content of MODULE_LICENSE against list from include/linux/module.h + if ($line =~ /\bMODULE_LICENSE\s*\(\s*($String)\s*\)/) { + my $extracted_string = get_quoted_string($line, $rawline); + my $valid_licenses = qr{ + GPL| + GPL\ v2| + GPL\ and\ additional\ rights| + Dual\ BSD/GPL| + Dual\ MIT/GPL| + Dual\ MPL/GPL| + Proprietary + }x; + if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) { + WARN("MODULE_LICENSE", + "unknown module license " . $extracted_string . "\n" . $herecurr); + } + } + +# check for sysctl duplicate constants + if ($line =~ /\.extra[12]\s*=\s*&(zero|one|int_max)\b/) { + WARN("DUPLICATED_SYSCTL_CONST", + "duplicated sysctl range checking value '$1', consider using the shared one in include/linux/sysctl.h\n" . $herecurr); + } + } + + # If we have no input at all, then there is nothing to report on + # so just keep quiet. + if ($#rawlines == -1) { + exit(0); + } + + # In mailback mode only produce a report in the negative, for + # things that appear to be patches. + if ($mailback && ($clean == 1 || !$is_patch)) { + exit(0); + } + + # This is not a patch, and we are are in 'no-patch' mode so + # just keep quiet. + if (!$chk_patch && !$is_patch) { + exit(0); + } + + if (!$is_patch && $filename !~ /cover-letter\.patch$/) { + ERROR("NOT_UNIFIED_DIFF", + "Does not appear to be a unified-diff format patch\n"); + } + if ($is_patch && $has_commit_log && $chk_signoff) { + if ($signoff == 0) { + ERROR("MISSING_SIGN_OFF", + "Missing Signed-off-by: line(s)\n"); + } elsif (!$authorsignoff) { + WARN("NO_AUTHOR_SIGN_OFF", + "Missing Signed-off-by: line by nominal patch author '$author'\n"); + } + } + + print report_dump(); + if ($summary && !($clean == 1 && $quiet == 1)) { + print "$filename " if ($summary_file); + print "total: $cnt_error errors, $cnt_warn warnings, " . + (($check)? "$cnt_chk checks, " : "") . + "$cnt_lines lines checked\n"; + } + + if ($quiet == 0) { + # If there were any defects found and not already fixing them + if (!$clean and !$fix) { + print << "EOM" + +NOTE: For some of the reported defects, checkpatch may be able to + mechanically convert to the typical style using --fix or --fix-inplace. +EOM + } + # If there were whitespace errors which cleanpatch can fix + # then suggest that. + if ($rpt_cleaners) { + $rpt_cleaners = 0; + print << "EOM" + +NOTE: Whitespace errors detected. + You may wish to use scripts/cleanpatch or scripts/cleanfile +EOM + } + } + + if ($clean == 0 && $fix && + ("@rawlines" ne "@fixed" || + $#fixed_inserted >= 0 || $#fixed_deleted >= 0)) { + my $newfile = $filename; + $newfile .= ".EXPERIMENTAL-checkpatch-fixes" if (!$fix_inplace); + my $linecount = 0; + my $f; + + @fixed = fix_inserted_deleted_lines(\@fixed, \@fixed_inserted, \@fixed_deleted); + + open($f, '>', $newfile) + or die "$P: Can't open $newfile for write\n"; + foreach my $fixed_line (@fixed) { + $linecount++; + if ($file) { + if ($linecount > 3) { + $fixed_line =~ s/^\+//; + print $f $fixed_line . "\n"; + } + } else { + print $f $fixed_line . "\n"; + } + } + close($f); + + if (!$quiet) { + print << "EOM"; + +Wrote EXPERIMENTAL --fix correction(s) to '$newfile' + +Do _NOT_ trust the results written to this file. +Do _NOT_ submit these changes without inspecting them for correctness. + +This EXPERIMENTAL file is simply a convenience to help rewrite patches. +No warranties, expressed or implied... +EOM + } + } + + if ($quiet == 0) { + print "\n"; + if ($clean == 1) { + print "$vname has no obvious style problems and is ready for submission.\n"; + } else { + print "$vname has style problems, please review.\n"; + } + } + return $clean; +} diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/scripts/spelling.txt b/scripts/spelling.txt new file mode 100644 index 000000000000..9a058cff49d4 --- /dev/null +++ b/scripts/spelling.txt @@ -0,0 +1,1254 @@ +# Originally from Debian's Lintian tool. Various false positives have been +# removed, and various additions have been made as they've been discovered +# in the kernel source. +# +# License: GPLv2 +# +# The format of each line is: +# mistake||correction +# +abandonning||abandoning +abigious||ambiguous +abitrate||arbitrate +abov||above +abreviated||abbreviated +absense||absence +absolut||absolute +absoulte||absolute +acccess||access +acceess||access +acceleratoin||acceleration +accelleration||acceleration +accesing||accessing +accesnt||accent +accessable||accessible +accesss||access +accidentaly||accidentally +accidentually||accidentally +accoding||according +accomodate||accommodate +accomodates||accommodates +accordign||according +accoring||according +accout||account +accquire||acquire +accquired||acquired +accross||across +acessable||accessible +acess||access +achitecture||architecture +acient||ancient +acitions||actions +acitve||active +acknowldegement||acknowledgment +acknowledgement||acknowledgment +ackowledge||acknowledge +ackowledged||acknowledged +acording||according +activete||activate +actived||activated +actualy||actually +acumulating||accumulating +acumulator||accumulator +adapater||adapter +addional||additional +additionaly||additionally +additonal||additional +addres||address +adddress||address +addreses||addresses +addresss||address +aditional||additional +aditionally||additionally +aditionaly||additionally +adminstrative||administrative +adress||address +adresses||addresses +adviced||advised +afecting||affecting +againt||against +agaist||against +aggreataon||aggregation +aggreation||aggregation +albumns||albums +alegorical||allegorical +algined||aligned +algorith||algorithm +algorithmical||algorithmically +algoritm||algorithm +algoritms||algorithms +algorrithm||algorithm +algorritm||algorithm +aligment||alignment +alignement||alignment +allign||align +alligned||aligned +alllocate||allocate +alloated||allocated +allocatote||allocate +allocatrd||allocated +allocte||allocate +allpication||application +alocate||allocate +alogirhtms||algorithms +alogrithm||algorithm +alot||a lot +alow||allow +alows||allows +altough||although +alue||value +ambigious||ambiguous +amoung||among +amout||amount +an union||a union +an user||a user +an userspace||a userspace +an one||a one +analysator||analyzer +ang||and +anniversery||anniversary +annoucement||announcement +anomolies||anomalies +anomoly||anomaly +anway||anyway +aplication||application +appearence||appearance +applicaion||application +appliction||application +applictions||applications +applys||applies +appplications||applications +appropiate||appropriate +appropriatly||appropriately +approriate||appropriate +approriately||appropriately +apropriate||appropriate +aquainted||acquainted +aquired||acquired +aquisition||acquisition +arbitary||arbitrary +architechture||architecture +arguement||argument +arguements||arguments +aritmetic||arithmetic +arne't||aren't +arraival||arrival +artifical||artificial +artillary||artillery +asign||assign +asser||assert +assertation||assertion +assiged||assigned +assigment||assignment +assigments||assignments +assistent||assistant +assocation||association +associcated||associated +assotiated||associated +assum||assume +assumtpion||assumption +asuming||assuming +asycronous||asynchronous +asynchnous||asynchronous +atomatically||automatically +atomicly||atomically +atempt||attempt +attachement||attachment +attched||attached +attemps||attempts +attemping||attempting +attruibutes||attributes +authentification||authentication +automaticaly||automatically +automaticly||automatically +automatize||automate +automatized||automated +automatizes||automates +autonymous||autonomous +auxillary||auxiliary +auxilliary||auxiliary +avaiable||available +avaible||available +availabe||available +availabled||available +availablity||availability +availale||available +availavility||availability +availble||available +availiable||available +availible||available +avalable||available +avaliable||available +aysnc||async +backgroud||background +backword||backward +backwords||backwards +bahavior||behavior +bakup||backup +baloon||balloon +baloons||balloons +bandwith||bandwidth +banlance||balance +batery||battery +beacuse||because +becasue||because +becomming||becoming +becuase||because +beeing||being +befor||before +begining||beginning +beter||better +betweeen||between +bianries||binaries +bitmast||bitmask +boardcast||broadcast +borad||board +boundry||boundary +brievely||briefly +broadcat||broadcast +cacluated||calculated +caculation||calculation +calender||calendar +calescing||coalescing +calle||called +callibration||calibration +calucate||calculate +calulate||calculate +cancelation||cancellation +cancle||cancel +capabilites||capabilities +capabilty||capability +capabitilies||capabilities +capatibilities||capabilities +capapbilities||capabilities +carefuly||carefully +cariage||carriage +catagory||category +cehck||check +challange||challenge +challanges||challenges +chanell||channel +changable||changeable +chanined||chained +channle||channel +channnel||channel +charachter||character +charachters||characters +charactor||character +charater||character +charaters||characters +charcter||character +chcek||check +chck||check +checksuming||checksumming +childern||children +childs||children +chiled||child +chked||checked +chnage||change +chnages||changes +chnnel||channel +choosen||chosen +chouse||chose +circumvernt||circumvent +claread||cleared +clared||cleared +closeing||closing +clustred||clustered +coexistance||coexistence +collapsable||collapsible +colorfull||colorful +comand||command +comit||commit +commerical||commercial +comming||coming +comminucation||communication +commited||committed +commiting||committing +committ||commit +commoditiy||commodity +comsume||consume +comsumer||consumer +comsuming||consuming +compability||compatibility +compaibility||compatibility +compatability||compatibility +compatable||compatible +compatibiliy||compatibility +compatibilty||compatibility +compatiblity||compatibility +competion||completion +compilant||compliant +compleatly||completely +completition||completion +completly||completely +complient||compliant +componnents||components +compoment||component +compres||compress +compresion||compression +comression||compression +comunication||communication +conbination||combination +conditionaly||conditionally +conected||connected +connecetd||connected +configuartion||configuration +configuratoin||configuration +configuraton||configuration +configuretion||configuration +configutation||configuration +conider||consider +conjuction||conjunction +connectinos||connections +connnection||connection +connnections||connections +consistancy||consistency +consistant||consistent +containes||contains +containts||contains +contaisn||contains +contant||contact +contence||contents +continious||continuous +continous||continuous +continously||continuously +continueing||continuing +contraints||constraints +contol||control +contoller||controller +controled||controlled +controler||controller +controll||control +contruction||construction +contry||country +conuntry||country +convertion||conversion +convertor||converter +convienient||convenient +convinient||convenient +corected||corrected +correponding||corresponding +correponds||corresponds +correspoding||corresponding +cotrol||control +cound||could +couter||counter +coutner||counter +cryptocraphic||cryptographic +cunter||counter +curently||currently +cylic||cyclic +dafault||default +deafult||default +deamon||daemon +decompres||decompress +decription||description +dectected||detected +defailt||default +defferred||deferred +definate||definite +definately||definitely +defintion||definition +defintions||definitions +defualt||default +defult||default +deintializing||deinitializing +deintialize||deinitialize +deintialized||deinitialized +deivce||device +delared||declared +delare||declare +delares||declares +delaring||declaring +delemiter||delimiter +demodualtor||demodulator +demension||dimension +dependancies||dependencies +dependancy||dependency +dependant||dependent +depreacted||deprecated +depreacte||deprecate +desactivate||deactivate +desciptor||descriptor +desciptors||descriptors +descripton||description +descrition||description +descritptor||descriptor +desctiptor||descriptor +desriptor||descriptor +desriptors||descriptors +destionation||destination +destory||destroy +destoryed||destroyed +destorys||destroys +destroied||destroyed +detabase||database +deteced||detected +develope||develop +developement||development +developped||developed +developpement||development +developper||developer +developpment||development +deveolpment||development +devided||divided +deviece||device +diable||disable +dictionnary||dictionary +didnt||didn't +diferent||different +differrence||difference +diffrent||different +diffrentiate||differentiate +difinition||definition +dimesions||dimensions +diplay||display +direectly||directly +disassocation||disassociation +disapear||disappear +disapeared||disappeared +disappared||disappeared +disble||disable +disbled||disabled +disconnet||disconnect +discontinous||discontinuous +dispertion||dispersion +dissapears||disappears +distiction||distinction +docuentation||documentation +documantation||documentation +documentaion||documentation +documment||document +doesnt||doesn't +dorp||drop +dosen||doesn +downlad||download +downlads||downloads +druing||during +dynmaic||dynamic +easilly||easily +ecspecially||especially +edditable||editable +editting||editing +efective||effective +efficently||efficiently +ehther||ether +eigth||eight +elementry||elementary +eletronic||electronic +embeded||embedded +enabledi||enabled +enchanced||enhanced +encorporating||incorporating +encrupted||encrypted +encrypiton||encryption +encryptio||encryption +endianess||endianness +enhaced||enhanced +enlightnment||enlightenment +entrys||entries +enocded||encoded +enterily||entirely +enviroiment||environment +enviroment||environment +environement||environment +environent||environment +eqivalent||equivalent +equiped||equipped +equivelant||equivalent +equivilant||equivalent +eror||error +errorr||error +estbalishment||establishment +etsablishment||establishment +etsbalishment||establishment +excecutable||executable +exceded||exceeded +excellant||excellent +exeed||exceed +existance||existence +existant||existent +exixt||exist +exlcude||exclude +exlcusive||exclusive +exmaple||example +expecially||especially +explicite||explicit +explicitely||explicitly +explict||explicit +explictely||explicitly +explictly||explicitly +expresion||expression +exprimental||experimental +extened||extended +extensability||extensibility +extention||extension +extracter||extractor +falied||failed +faild||failed +faill||fail +failied||failed +faillure||failure +failue||failure +failuer||failure +failng||failing +faireness||fairness +falied||failed +faliure||failure +fallbck||fallback +familar||familiar +fatser||faster +feauture||feature +feautures||features +fetaure||feature +fetaures||features +fileystem||filesystem +fimware||firmware +firware||firmware +finanize||finalize +findn||find +finilizes||finalizes +finsih||finish +flusing||flushing +folloing||following +followign||following +followings||following +follwing||following +fonud||found +forseeable||foreseeable +forse||force +fortan||fortran +forwardig||forwarding +framming||framing +framwork||framework +frequncy||frequency +frome||from +fucntion||function +fuction||function +fuctions||functions +funcion||function +functionallity||functionality +functionaly||functionally +functionnality||functionality +functonality||functionality +funtion||function +funtions||functions +furthur||further +futhermore||furthermore +futrue||future +gaurenteed||guaranteed +generiously||generously +genereate||generate +genric||generic +globel||global +grabing||grabbing +grahical||graphical +grahpical||graphical +grapic||graphic +grranted||granted +guage||gauge +guarenteed||guaranteed +guarentee||guarantee +halfs||halves +hander||handler +handfull||handful +hanled||handled +happend||happened +harware||hardware +heirarchically||hierarchically +helpfull||helpful +hybernate||hibernate +hierachy||hierarchy +hierarchie||hierarchy +howver||however +hsould||should +hypervior||hypervisor +hypter||hyper +identidier||identifier +iligal||illegal +illigal||illegal +imblance||imbalance +immeadiately||immediately +immedaite||immediate +immediatelly||immediately +immediatly||immediately +immidiate||immediate +impelentation||implementation +impementated||implemented +implemantation||implementation +implemenation||implementation +implementaiton||implementation +implementated||implemented +implemention||implementation +implementd||implemented +implemetation||implementation +implemntation||implementation +implentation||implementation +implmentation||implementation +implmenting||implementing +incative||inactive +incomming||incoming +incompatabilities||incompatibilities +incompatable||incompatible +inconsistant||inconsistent +increas||increase +incremeted||incremented +incrment||increment +indendation||indentation +indended||intended +independant||independent +independantly||independently +independed||independent +indiate||indicate +indicat||indicate +inexpect||inexpected +infomation||information +informatiom||information +informations||information +informtion||information +infromation||information +ingore||ignore +inital||initial +initalized||initialized +initalised||initialized +initalise||initialize +initalize||initialize +initation||initiation +initators||initiators +initialiazation||initialization +initializiation||initialization +initialzed||initialized +initilization||initialization +initilize||initialize +inofficial||unofficial +insititute||institute +instal||install +instanciated||instantiated +inteface||interface +integreated||integrated +integrety||integrity +integrey||integrity +intendet||intended +intented||intended +interanl||internal +interchangable||interchangeable +interferring||interfering +interger||integer +intermittant||intermittent +internel||internal +interoprability||interoperability +interuupt||interrupt +interrface||interface +interrrupt||interrupt +interrup||interrupt +interrups||interrupts +interruptted||interrupted +interupted||interrupted +interupt||interrupt +intial||initial +intialisation||initialisation +intialised||initialised +intialise||initialise +intialization||initialization +intialized||initialized +intialize||initialize +intregral||integral +intrrupt||interrupt +intterrupt||interrupt +intuative||intuitive +invaid||invalid +invald||invalid +invalde||invalid +invalide||invalid +invalidiate||invalidate +invalud||invalid +invididual||individual +invokation||invocation +invokations||invocations +irrelevent||irrelevant +isnt||isn't +isssue||issue +iternations||iterations +itertation||iteration +itslef||itself +jave||java +jeffies||jiffies +juse||just +jus||just +kown||known +langage||language +langauage||language +langauge||language +langugage||language +lauch||launch +layed||laid +leightweight||lightweight +lengh||length +lenght||length +lenth||length +lesstiff||lesstif +libaries||libraries +libary||library +librairies||libraries +libraris||libraries +licenceing||licencing +loggging||logging +loggin||login +logile||logfile +loosing||losing +losted||lost +machinary||machinery +maintainance||maintenance +maintainence||maintenance +maintan||maintain +makeing||making +malplaced||misplaced +malplace||misplace +managable||manageable +managment||management +mangement||management +manoeuvering||maneuvering +mappping||mapping +mathimatical||mathematical +mathimatic||mathematic +mathimatics||mathematics +maxium||maximum +mechamism||mechanism +meetign||meeting +ment||meant +mergable||mergeable +mesage||message +messags||messages +messgaes||messages +messsage||message +messsages||messages +micropone||microphone +microprocesspr||microprocessor +milliseonds||milliseconds +minium||minimum +minimam||minimum +minumum||minimum +misalinged||misaligned +miscelleneous||miscellaneous +misformed||malformed +mispelled||misspelled +mispelt||misspelt +mising||missing +mismactch||mismatch +missmanaged||mismanaged +missmatch||mismatch +miximum||maximum +mmnemonic||mnemonic +mnay||many +modulues||modules +momery||memory +memomry||memory +monochorome||monochrome +monochromo||monochrome +monocrome||monochrome +mopdule||module +mroe||more +mulitplied||multiplied +multidimensionnal||multidimensional +multple||multiple +mumber||number +muticast||multicast +mutilcast||multicast +mutiple||multiple +mutli||multi +nams||names +navagating||navigating +nead||need +neccecary||necessary +neccesary||necessary +neccessary||necessary +necesary||necessary +neded||needed +negaive||negative +negoitation||negotiation +negotation||negotiation +nerver||never +nescessary||necessary +nessessary||necessary +noticable||noticeable +notications||notifications +notifed||notified +numebr||number +numner||number +obtaion||obtain +occassionally||occasionally +occationally||occasionally +occurance||occurrence +occurances||occurrences +occured||occurred +occurence||occurrence +occure||occurred +occured||occurred +occuring||occurring +offet||offset +omited||omitted +omiting||omitting +omitt||omit +ommiting||omitting +ommitted||omitted +onself||oneself +ony||only +operatione||operation +opertaions||operations +optionnal||optional +optmizations||optimizations +orientatied||orientated +orientied||oriented +orignal||original +otherise||otherwise +ouput||output +oustanding||outstanding +overaall||overall +overhread||overhead +overlaping||overlapping +overide||override +overrided||overridden +overriden||overridden +overun||overrun +overwritting||overwriting +overwriten||overwritten +pacakge||package +pachage||package +packacge||package +packege||package +packge||package +packtes||packets +pakage||package +pallette||palette +paln||plan +paramameters||parameters +paramaters||parameters +paramater||parameter +parametes||parameters +parametised||parametrised +paramter||parameter +paramters||parameters +particuarly||particularly +particularily||particularly +partiton||partition +pased||passed +passin||passing +pathes||paths +pecularities||peculiarities +peformance||performance +peice||piece +pendantic||pedantic +peprocessor||preprocessor +perfoming||performing +permissons||permissions +peroid||period +persistance||persistence +persistant||persistent +plalform||platform +platfrom||platform +plattform||platform +pleaes||please +ploting||plotting +plugable||pluggable +poinnter||pointer +pointeur||pointer +poiter||pointer +posible||possible +positon||position +possibilites||possibilities +powerfull||powerful +preample||preamble +preapre||prepare +preceeded||preceded +preceeding||preceding +preceed||precede +precendence||precedence +precission||precision +preemptable||preemptible +prefered||preferred +prefferably||preferably +premption||preemption +prepaired||prepared +pressre||pressure +primative||primitive +princliple||principle +priorty||priority +privilaged||privileged +privilage||privilege +priviledge||privilege +priviledges||privileges +probaly||probably +procceed||proceed +proccesors||processors +procesed||processed +proces||process +procesing||processing +processessing||processing +processess||processes +processpr||processor +processsed||processed +processsing||processing +procteted||protected +prodecure||procedure +progams||programs +progess||progress +programers||programmers +programm||program +programms||programs +progresss||progress +promiscous||promiscuous +promps||prompts +pronnounced||pronounced +prononciation||pronunciation +pronouce||pronounce +pronunce||pronounce +propery||property +propigate||propagate +propigation||propagation +propogate||propagate +prosess||process +protable||portable +protcol||protocol +protecion||protection +protocoll||protocol +promixity||proximity +psudo||pseudo +psuedo||pseudo +psychadelic||psychedelic +pwoer||power +quering||querying +randomally||randomly +raoming||roaming +reasearcher||researcher +reasearchers||researchers +reasearch||research +recepient||recipient +receving||receiving +recieved||received +recieve||receive +reciever||receiver +recieves||receives +recogniced||recognised +recognizeable||recognizable +recommanded||recommended +recyle||recycle +redircet||redirect +redirectrion||redirection +reename||rename +refcounf||refcount +refence||reference +refered||referred +referenace||reference +refering||referring +refernces||references +refernnce||reference +refrence||reference +registerd||registered +registeresd||registered +registerred||registered +registes||registers +registraration||registration +regsiter||register +regster||register +regualar||regular +reguator||regulator +regulamentations||regulations +reigstration||registration +releated||related +relevent||relevant +remoote||remote +remore||remote +removeable||removable +repectively||respectively +replacable||replaceable +replacments||replacements +replys||replies +reponse||response +representaion||representation +reqeust||request +requestied||requested +requiere||require +requirment||requirement +requred||required +requried||required +requst||request +reseting||resetting +resizeable||resizable +resouce||resource +resouces||resources +resoures||resources +responce||response +ressizes||resizes +ressource||resource +ressources||resources +retransmited||retransmitted +retreived||retrieved +retreive||retrieve +retrive||retrieve +retuned||returned +reudce||reduce +reuest||request +reuqest||request +reutnred||returned +revsion||revision +rmeoved||removed +rmeove||remove +rmeoves||removes +rountine||routine +routins||routines +rquest||request +runing||running +runned||ran +runnning||running +runtine||runtime +sacrifying||sacrificing +safly||safely +safty||safety +savable||saveable +scaned||scanned +scaning||scanning +scarch||search +seach||search +searchs||searches +secquence||sequence +secund||second +segement||segment +senarios||scenarios +sentivite||sensitive +separatly||separately +sepcify||specify +sepc||spec +seperated||separated +seperately||separately +seperate||separate +seperatly||separately +seperator||separator +sepperate||separate +sequece||sequence +sequencial||sequential +serveral||several +setts||sets +settting||setting +shotdown||shutdown +shoud||should +shouldnt||shouldn't +shoule||should +shrinked||shrunk +siginificantly||significantly +signabl||signal +similary||similarly +similiar||similar +simlar||similar +simliar||similar +simpified||simplified +singaled||signaled +singal||signal +singed||signed +sleeped||slept +softwares||software +speach||speech +specfic||specific +speciefied||specified +specifc||specific +specifed||specified +specificatin||specification +specificaton||specification +specifing||specifying +specifiying||specifying +speficied||specified +speicify||specify +speling||spelling +spinlcok||spinlock +spinock||spinlock +splitted||split +spreaded||spread +spurrious||spurious +sructure||structure +stablilization||stabilization +staically||statically +staion||station +standardss||standards +standartization||standardization +standart||standard +staticly||statically +stoped||stopped +stoppped||stopped +straming||streaming +struc||struct +structres||structures +stuct||struct +strucuture||structure +stucture||structure +sturcture||structure +subdirectoires||subdirectories +suble||subtle +substract||subtract +submition||submission +succesfully||successfully +succesful||successful +successed||succeeded +successfull||successful +successfuly||successfully +sucessfully||successfully +sucess||success +superflous||superfluous +superseeded||superseded +suplied||supplied +suported||supported +suport||support +supportet||supported +suppored||supported +supportin||supporting +suppoted||supported +suppported||supported +suppport||support +supress||suppress +surpressed||suppressed +surpresses||suppresses +susbsystem||subsystem +suspeneded||suspended +suspicously||suspiciously +swaping||swapping +switchs||switches +swith||switch +swithable||switchable +swithc||switch +swithced||switched +swithcing||switching +swithed||switched +swithing||switching +swtich||switch +symetric||symmetric +synax||syntax +synchonized||synchronized +syncronize||synchronize +syncronized||synchronized +syncronizing||synchronizing +syncronus||synchronous +syste||system +sytem||system +sythesis||synthesis +taht||that +targetted||targeted +targetting||targeting +teh||the +temorary||temporary +temproarily||temporarily +therfore||therefore +thier||their +threds||threads +threshhold||threshold +thresold||threshold +throught||through +troughput||throughput +thses||these +tiggered||triggered +tipically||typically +timout||timeout +tmis||this +torerable||tolerable +tramsmitted||transmitted +tramsmit||transmit +tranasction||transaction +tranfer||transfer +transciever||transceiver +transferd||transferred +transfered||transferred +transfering||transferring +transision||transition +transmittd||transmitted +transormed||transformed +trasfer||transfer +trasmission||transmission +treshold||threshold +trigerring||triggering +trun||turn +tunning||tuning +ture||true +tyep||type +udpate||update +uesd||used +uncommited||uncommitted +unconditionaly||unconditionally +underun||underrun +unecessary||unnecessary +unexecpted||unexpected +unexepected||unexpected +unexpcted||unexpected +unexpectd||unexpected +unexpeted||unexpected +unexpexted||unexpected +unfortunatelly||unfortunately +unifiy||unify +unintialized||uninitialized +unkmown||unknown +unknonw||unknown +unknow||unknown +unkown||unknown +unneded||unneeded +unneccecary||unnecessary +unneccesary||unnecessary +unneccessary||unnecessary +unnecesary||unnecessary +unneedingly||unnecessarily +unnsupported||unsupported +unmached||unmatched +unregester||unregister +unresgister||unregister +unrgesiter||unregister +unsinged||unsigned +unstabel||unstable +unsolicitied||unsolicited +unsuccessfull||unsuccessful +unsuported||unsupported +untill||until +unuseful||useless +upate||update +usefule||useful +usefull||useful +usege||usage +usera||users +usualy||usually +utilites||utilities +utillities||utilities +utilties||utilities +utiltity||utility +utitity||utility +utitlty||utility +vaid||valid +vaild||valid +valide||valid +variantions||variations +varible||variable +varient||variant +vaule||value +verbse||verbose +verisons||versions +verison||version +verson||version +vicefersa||vice-versa +virtal||virtual +virtaul||virtual +virtiual||virtual +visiters||visitors +vitual||virtual +wakeus||wakeups +wating||waiting +wiat||wait +wether||whether +whataver||whatever +whcih||which +whenver||whenever +wheter||whether +whe||when +wierd||weird +wiil||will +wirte||write +withing||within +wnat||want +workarould||workaround +writeing||writing +writting||writing +zombe||zombie +zomebie||zombie From 7322c023493a2b3fe96fce16438d7dcea17f2212 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 07:03:10 +0000 Subject: [PATCH 148/350] manifest.c: assert buffer overflow in man_copy_sram() Does not solve https://github.com/thesofproject/sof/issues/3423 but converts a buffer overflow and crash into a more usable assert. Buffer overflow found by running rimage with valgrind and the binaries provided by @singalsu Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/manifest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index f8b1f8173058..237954b0560c 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -167,6 +167,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, void *buffer = image->fw_image + offset; size_t count; + assert((uint64_t)offset + section->size <= image->adsp->image_size); + switch (section->type) { case SHT_INIT_ARRAY: /* fall through */ From 86754c138941e0c43d2b0c5bbccb6e2d01baf0c7 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:51:43 +0200 Subject: [PATCH 149/350] hash: Assert memory overflow during hash calculation ri_sha*() functions are often called with arguments calculated on the fly, so at list basic assertion here may save debugging time in the future. Cast size to uint64_t to properly handle nagative sizes, casted to uint32_t in argument list. Otherwise, sum size and offset may overflow uint32_t and don't trigger assert. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hash.c b/src/hash.c index a38e64c391ec..8c1117f812cb 100644 --- a/src/hash.c +++ b/src/hash.c @@ -5,6 +5,7 @@ // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> // Keyon Jie <yang.jie@linux.intel.com> +#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -82,6 +83,7 @@ void module_sha_complete(struct image *image, uint8_t *hash) void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { + assert((uint64_t)size + offset <= image->adsp->image_size); module_sha256_create(image); module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); @@ -98,6 +100,7 @@ static void module_sha384_create(struct image *image) void ri_sha384(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { + assert((uint64_t)size + offset <= image->adsp->image_size); module_sha384_create(image); module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); From e87db0f08010a6dce3b93d6202f5a5985e40f196 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 22:28:37 +0000 Subject: [PATCH 150/350] pkcs1_5.c: intermediate named constants in ri_manifest_sign_v1_x() As suggested by Karol in the review of the next commit. Makes the function call shorter and naming the parameters makes the code much more readable. Can help for debugging too. Absolutely zero change: the two CMAKE_BUILD_TYPE=Release rimage binaries before and after this commit are actually identical. In passing, replace void * arithmetic in that function with char *. void * arithmetic is an actually illegal gcc extension (not just "undefined"). Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index b4718bd0c025..1b653977a38c 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -244,9 +244,10 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - pkcs_v1_5_sign_man_v1_5(image, man, - (void *)man + MAN_CSS_MAN_SIZE_V1_5, - image->image_end - sizeof(*man)); + char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + unsigned const size1 = image->image_end - sizeof(*man); + + pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); return 0; } @@ -254,13 +255,16 @@ int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_v1_5_sign_man_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + - MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET_V1_8, - (man->css.size - man->css.header_len) - * sizeof(uint32_t)); + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET; + unsigned const size1 = + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V1_8; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); return 0; } From b9cf1aeb3b9530782e31d8ac0ba63a69bc709198 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 22:41:11 +0000 Subject: [PATCH 151/350] pkcs1_5.c: don't pretend everything is fine when failing to sign Found by chance and reproduced by making a typo in the key's filename. Note there is already an (unchanged) error message: pkcs: signing with key sof/keys/otc_private_key_3k.pemX error: can't open file sof/keys/otc_private_key_3k.pemX -2 Firmware manifest and signing completed ! But now rimage does not pretend success and the build does not keep going with an unsigned image like nothing happened. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 1b653977a38c..5de82aa8597f 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -247,8 +247,7 @@ int ri_manifest_sign_v1_5(struct image *image) char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; unsigned const size1 = image->image_end - sizeof(*man); - pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); - return 0; + return pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); } int ri_manifest_sign_v1_8(struct image *image) @@ -265,6 +264,5 @@ int ri_manifest_sign_v1_8(struct image *image) unsigned const size2 = (man->css.size - man->css.header_len) * sizeof(uint32_t); - pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); - return 0; + return pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); } From c98a29da14e5f5590eb6bb150bc70fd5b4b990b3 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:15:15 +0200 Subject: [PATCH 152/350] toml: Extract version parsing to separate function This task is fully separatable from adsp_parse_config_fd(), so should be done in separate function, to improve code readability. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 58 +++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index d2269b818a43..8707e055e053 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1532,6 +1532,36 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +static int parse_version(toml_table_t *toml, int64_t version[2]) +{ + toml_array_t *arr; + toml_raw_t raw; + int ret; + int i; + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + /* parse "version" array elements */ + for (i = 0; i < 2; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + return err_key_parse("version", NULL); + ret = toml_rtoi(raw, &version[i]); + if (ret < 0) + return err_key_parse("version", "can't convert element to integer"); + } + return 0; +} + static inline bool check_config_version(int major, int minor, const int64_t *version) { return version[0] == major && version[1] == minor; @@ -1541,40 +1571,18 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) { int64_t manifest_version[2]; toml_table_t *toml; - toml_array_t *arr; - toml_raw_t raw; char errbuf[256]; int ret; - int i; /* whole toml file is parsed to global toml table at once */ toml = toml_parse_file(fd, errbuf, ARRAY_SIZE(errbuf)); if (!toml) return log_err(-EINVAL, "error: toml file parsing, %s\n", errbuf); - /* check "version" key */ - arr = toml_array_in(toml, "version"); - if (!arr) - return err_key_not_found("version"); - if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || - toml_array_kind(arr) != 'v') { - ret = err_key_parse("version", "wrong array type or length != 2"); + /* manifest version is in toml root */ + ret = parse_version(toml, manifest_version); + if (ret < 0) goto error; - } - - /* parse "version" array elements */ - for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { - raw = toml_raw_at(arr, i); - if (raw == 0) { - ret = err_key_parse("version", NULL); - goto error; - } - ret = toml_rtoi(raw, &manifest_version[i]); - if (ret < 0) { - ret = err_key_parse("version", "can't convert element to integer"); - goto error; - } - } /* parsing function depends on manifest_version */ if (check_config_version(1, 0, manifest_version)) { From 8249abfa11f6552678b362820b6723ff75fedf90 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:17:55 +0200 Subject: [PATCH 153/350] toml: Keep available manifest parsers in list This approach allows to easily expand parsers list in future, without harming code readability. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8707e055e053..865a891aec3f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1562,13 +1562,35 @@ static int parse_version(toml_table_t *toml, int64_t version[2]) return 0; } -static inline bool check_config_version(int major, int minor, const int64_t *version) +struct config_parser { + int major; + int minor; + int (*parse)(const toml_table_t *toml, struct adsp *out, bool verbose); +}; + +static const struct config_parser *find_config_parser(int64_t version[2]) { - return version[0] == major && version[1] == minor; + /* list of supported configuration version with handler to parser */ + static const struct config_parser parsers[] = { + {1, 0, parse_adsp_config_v1_0}, + {1, 5, parse_adsp_config_v1_5}, + {1, 8, parse_adsp_config_v1_8}, + {2, 5, parse_adsp_config_v2_5}, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(parsers); ++i) { + if (parsers[i].major == version[0] && + parsers[i].minor == version[1]) { + return &parsers[i]; + } + } + return NULL; } static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) { + const struct config_parser *parser; int64_t manifest_version[2]; toml_table_t *toml; char errbuf[256]; @@ -1584,21 +1606,16 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) if (ret < 0) goto error; - /* parsing function depends on manifest_version */ - if (check_config_version(1, 0, manifest_version)) { - ret = parse_adsp_config_v1_0(toml, out, verbose); - } else if (check_config_version(1, 5, manifest_version)) { - ret = parse_adsp_config_v1_5(toml, out, verbose); - } else if (check_config_version(1, 8, manifest_version)) { - ret = parse_adsp_config_v1_8(toml, out, verbose); - } else if (check_config_version(2, 5, manifest_version)) { - ret = parse_adsp_config_v2_5(toml, out, verbose); - } else { + /* find parser compatible with manifest version */ + parser = find_config_parser(manifest_version); + if (!parser) { ret = log_err(-EINVAL, "error: Unsupported config version %d.%d\n", manifest_version[0], manifest_version[1]); goto error; } + /* run dedicated parser */ + ret = parser->parse(toml, out, verbose); error: toml_free(toml); return ret; From 0d2af68a9e2bc8454de343722e263f9594fa9d82 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 22 Oct 2020 08:46:18 +0200 Subject: [PATCH 154/350] gitignore: Add checkpatch temporary file to gitignore Any generated file should be tracked by git to keep repositiry clean. Such an file should be added to .gitignore to reduce possibility of accidentally pushig this file to remote branches, eg. after typing `git add *` before pushing changes. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 567609b1234a..7693903fddf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build/ +.checkpatch-camelcase.git.* From f0fa6616eac86c2385a330a4cc97411f966e57a2 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 13 Nov 2020 19:20:22 +0000 Subject: [PATCH 155/350] README: install is optional and missed "sudo". CMake 3.13 -B option. Also show useful "make help" that lists all targets. Show -B option of CMake that avoids changing the current directory to the build directory: especially inconvenient considering the recommended, CMake way to clean is to delete this directory and the recommended way to build multiple configurations is to use multiple build directories. -B was introduced in CMake 3.13 which has been released two years ago now and CMake spoils its users with a choice of ways to upgrade: https://cmake.org/download/ https://apt.kitware.com/ https://pypi.org/project/cmake/ This does _not_ imply CMakeLists.txt should drop backward compatibility with CMake < 3.13. I only think a README.md file should not keep the majority of users in the dark only for the convenience of a minority of obsolete CMake users. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bce02c06caa9..8118edeaaf4b 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,11 @@ to generate binary image files. ## Building -The `rimage` tool can be built with the following commands: +The `rimage` tool can be built with the usual CMake commands: ```shell -$ mkdir build -$ cd build -$ cmake .. -$ make -$ make install +$ cmake -B build/ +$ make -C build/ help # lists all targets +$ make -C build/ +$ sudo make -C build/ install # optional ``` From d6cf6960662f3f5b3f65e0f27d74f20de4edc41e Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 10:41:17 +0000 Subject: [PATCH 156/350] config: tgl: fix CSE offsets for TGL Now aligns with actual offsets. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- config/tgl.toml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/config/tgl.toml b/config/tgl.toml index dc5c760ed802..57a1e13f4f73 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -22,15 +22,15 @@ size = "0x100000" partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" -offset = "0x58" -length = "0x378" +offset = "0x5c" +length = "0x464" [[cse.entry]] name = "cavs0015.met" -offset = "0x400" +offset = "0x4c0" length = "0x70" [[cse.entry]] name = "cavs0015" -offset = "0x490" +offset = "0x540" length = "0x0" # calculated by rimage [css] @@ -40,11 +40,6 @@ name = "ADSP" [[signed_pkg.module]] name = "cavs0015.met" -[partition_info] -name = "ADSP" -[[partition_info.module]] -name = "cavs0015.met" - [adsp_file] [[adsp_file.comp]] base_offset = "0x2000" From 48ba01ec4571658863f7585442faa84426be3319 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 10:42:42 +0000 Subject: [PATCH 157/350] css: add css header for cavs v2.5 Header contests are the same but with bigger key. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/css.c | 57 ++++++++++++++++++++++++++++++++++++++++ src/include/rimage/css.h | 26 ++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/src/css.c b/src/css.c index f2627e6f58e9..c86148b89015 100644 --- a/src/css.c +++ b/src/css.c @@ -11,6 +11,63 @@ #include <rimage/css.h> #include <rimage/manifest.h> +void ri_css_v2_5_hdr_create(struct image *image) +{ + struct css_header_v2_5 *css = image->fw_image + MAN_CSS_HDR_OFFSET_2_5; + struct tm *date; + struct timeval tv; + time_t seconds; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + seconds = tv.tv_sec; + date = localtime(&seconds); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} + void ri_css_v1_8_hdr_create(struct image *image) { struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; diff --git a/src/include/rimage/css.h b/src/include/rimage/css.h index e322cbf68dfc..6283cdaf9042 100644 --- a/src/include/rimage/css.h +++ b/src/include/rimage/css.h @@ -13,12 +13,15 @@ struct image; #define MAN_CSS_LT_MODULE_TYPE 0x00000006 #define MAN_CSS_MOD_TYPE 4 #define MAN_CSS_HDR_SIZE 161 /* in words */ +#define MAN_CSS_HDR_SIZE_2_5 225 /* in words */ #define MAN_CSS_HDR_VERSION 0x10000 +#define MAN_CSS_HDR_VERSION_2_5 0x21000 #define MAN_CSS_MOD_VENDOR 0x8086 #define MAN_CSS_HDR_ID {'$', 'M', 'N', '2'} #define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_MOD_SIZE_2_5 (MAN_RSA_KEY_MODULUS_LEN_2_5 >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) @@ -29,8 +32,10 @@ struct image; * RSA Key and Crypto */ #define MAN_RSA_KEY_MODULUS_LEN 256 +#define MAN_RSA_KEY_MODULUS_LEN_2_5 384 #define MAN_RSA_KEY_EXPONENT_LEN 4 #define MAN_RSA_SIGNATURE_LEN 256 +#define MAN_RSA_SIGNATURE_LEN_2_5 384 struct fw_version { uint16_t major_version; @@ -39,6 +44,26 @@ struct fw_version { uint16_t build_version; } __attribute__((packed)); +struct css_header_v2_5 { + uint32_t header_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x1 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint8_t header_id[4]; + uint32_t padding; /* must be 0x0 */ + struct fw_version version; + uint32_t svn; + uint32_t reserved1[18]; /* must be 0x0 */ + uint32_t modulus_size; + uint32_t exponent_size; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN_2_5]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN_2_5]; +} __attribute__((packed)); + struct css_header_v1_8 { uint32_t header_type; uint32_t header_len; @@ -78,5 +103,6 @@ struct css_header_v1_5 { void ri_css_v1_8_hdr_create(struct image *image); void ri_css_v1_5_hdr_create(struct image *image); +void ri_css_v2_5_hdr_create(struct image *image); #endif From 8478c03483396267940b90d2826858eb674fd7a9 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Mon, 26 Oct 2020 10:51:17 +0000 Subject: [PATCH 158/350] cse: add simple crc32 function to calculate the v2.5 header checksum Add simple crc32 function to calculate the checksum for v2.5 headers. Implementation is very simple using shift register as we don't require speed. Calculate the v2.5 header checksum with crc-32/iso-hdlc parameters. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/cse.c | 72 ++++++++++++++++++++++++++++++++++++++++ src/include/rimage/cse.h | 12 +++++++ 2 files changed, 84 insertions(+) diff --git a/src/cse.c b/src/cse.c index 75f7630a65b1..85554308601f 100644 --- a/src/cse.c +++ b/src/cse.c @@ -6,6 +6,7 @@ // Keyon Jie <yang.jie@linux.intel.com> #include <stdio.h> +#include <stdbool.h> #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> @@ -34,3 +35,74 @@ void ri_cse_create(struct image *image) } cse_hdr->checksum = 0x100 - csum; } + +static uint32_t crc32(uint8_t *input, int size, uint32_t poly, uint32_t init, + bool rev_in, bool rev_out, uint32_t xor_out) +{ + uint32_t crc = init; + uint32_t t32; + uint8_t val; + uint8_t t8; + int i; + int j; + + for (i = 0; i < size; i++) { + val = input[i]; + if (rev_in) { + t8 = 0; + for (j = 0; j < 8; j++) { + if (val & (1 << j)) + t8 |= (uint8_t)(1 << (7 - j)); + } + val = t8; + } + crc ^= (uint32_t)(val << 24); + for (j = 0; j < 8; j++) { + if (crc & 0x80000000) + crc = (uint32_t)((crc << 1) ^ poly); + else + crc <<= 1; + } + } + + if (rev_out) { + t32 = 0; + for (i = 0; i < 32; i++) { + if (crc & (1 << i)) + t32 |= (uint32_t)(1 << (31 - i)); + } + crc = t32; + } + + return crc ^ xor_out; +} + +void ri_cse_create_v2_5(struct image *image) +{ + struct CsePartitionDirHeader_v2_5 *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext_v2_5 *meta = image->fw_image + + MAN_META_EXT_OFFSET_V2_5; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t *val = image->fw_image; + int size; + + fprintf(stdout, " cse: completing CSE V2.5 manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET_V1_8; + + /* + * calculate checksum using crc-32/iso-hdlc + * + * polynomial: 0x04c11db7 + * initial value: 0xffffffff + * reverse input: true + * reverse output: true + * xor output: 0xffffffff + */ + size = (sizeof(*cse_hdr) + (sizeof(*cse_entry) * MAN_CSE_PARTS)); + cse_hdr->checksum = crc32(val, size, 0x04c11db7, 0xffffffff, true, true, 0xffffffff); + + fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); +} diff --git a/src/include/rimage/cse.h b/src/include/rimage/cse.h index d262fbafd481..6ce46561f214 100644 --- a/src/include/rimage/cse.h +++ b/src/include/rimage/cse.h @@ -22,6 +22,17 @@ struct CsePartitionDirHeader { uint8_t partition_name[4]; } __attribute__((packed)); +struct CsePartitionDirHeader_v2_5 { + uint32_t header_marker; + uint32_t nb_entries; + uint8_t header_version; + uint8_t entry_version; + uint8_t header_length; + uint8_t not_used; /* set to zero - old checksum */ + uint8_t partition_name[4]; + uint32_t checksum; /* crc32 checksum */ +} __attribute__((packed)); + struct CsePartitionDirEntry { uint8_t entry_name[12]; uint32_t offset; @@ -30,5 +41,6 @@ struct CsePartitionDirEntry { } __attribute__((packed)); void ri_cse_create(struct image *image); +void ri_cse_create_v2_5(struct image *image); #endif From 7e9952f2c8d5a4d70abd76a5c49d0bf39b6cda5f Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:23:29 +0000 Subject: [PATCH 159/350] manifest: Add cavs2.5 structures and offsets cavs2.5 has different offsets and structures. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/manifest.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 7b54bc137b66..cd44b118d953 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -41,8 +41,13 @@ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_CSS_HDR_OFFSET_2_5 \ + (MAN_CSE_HDR_OFFSET + \ + sizeof(struct CsePartitionDirHeader_v2_5) + \ + MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) + #define MAN_FW_DESC_OFFSET_V2_5 \ - (MAN_META_EXT_OFFSET_V1_8 + \ + (MAN_META_EXT_OFFSET_V2_5 + \ sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ MAN_EXT_PADDING) @@ -53,16 +58,30 @@ (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) +#define MAN_SIG_PKG_OFFSET_V2_5 \ + (MAN_CSS_HDR_OFFSET_2_5 + \ + sizeof(struct css_header_v2_5)) + #define MAN_PART_INFO_OFFSET_V1_8 \ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) +#define MAN_PART_INFO_OFFSET_V2_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_v2_5)) + #define MAN_META_EXT_OFFSET_V1_8 \ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext) + \ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) +#define MAN_META_EXT_OFFSET_V2_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_v2_5) + \ + sizeof(struct info_ext_0x16) + \ + 0) + #define MAN_FW_DESC_OFFSET_V1_8 \ (MAN_META_EXT_OFFSET_V1_8 + \ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ @@ -91,12 +110,12 @@ */ struct fw_image_manifest_v2_5 { /* MEU tool needs these sections to be 0s */ - struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirHeader_v2_5 cse_partition_dir_header; struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; - struct css_header_v1_8 css; - struct signed_pkg_info_ext signed_pkg; - struct partition_info_ext partition_info; - uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct css_header_v2_5 css; + struct signed_pkg_info_ext_v2_5 signed_pkg; + struct info_ext_0x16 info_0x16; + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; /* reserved / pading at end of ext data - all 0s*/ From 0c3f8e29c5d81a572856e3957aa1006bdd648833 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:24:23 +0000 Subject: [PATCH 160/350] user: manifest: add macros for SHA385 modulus length Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/sof/user/manifest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index ccf23cf7b42f..d90014ffb198 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -73,6 +73,7 @@ struct sof_man_segment_desc { #define SOF_MAN_MOD_ID_LEN 4 #define SOF_MAN_MOD_NAME_LEN 8 #define SOF_MAN_MOD_SHA256_LEN 32 +#define SOF_MAN_MOD_SHA384_LEN 48 #define SOF_MAN_MOD_ID {'$', 'A', 'M', 'E'} /* From df204853b9e7fedea7fb0f46c2278666e95de92a Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:12:10 +0000 Subject: [PATCH 161/350] pkcs: Add PSS signing mechanism for CAVS2.5 Add RSA PSS signing support for CAVS 2.5 platforms. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/rimage.h | 4 ++ src/pkcs1_5.c | 120 ++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 04518ed5900d..ba35df390469 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -173,6 +173,10 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 5de82aa8597f..7e8592b0ceda 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -240,6 +240,109 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return ret; } +/* + * RSA signature of manifest. The signature is an RSA PSS + * of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + const BIGNUM *n, *e, *d; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, + digest, image->md, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to sign manifest %s\n", path); + } + + /* encrypt the signature using the private key */ + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, + (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to encrypt signature %s\n", path); + } + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); + + /* modulus is reversed */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN_2_5 - (1 + i)]; + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; @@ -266,3 +369,20 @@ int ri_manifest_sign_v1_8(struct image *image) return pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); } + +int ri_manifest_sign_v2_5(struct image *image) +{ + struct fw_image_manifest_v2_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); +} From f84676f5d9f03abee1571c08e449e4867c9b0a32 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:20:25 +0000 Subject: [PATCH 162/350] hash: make module_sha384_create non static. Used by other clients now. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/hash.c | 2 +- src/include/rimage/rimage.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hash.c b/src/hash.c index 8c1117f812cb..ff68f82f5f05 100644 --- a/src/hash.c +++ b/src/hash.c @@ -89,7 +89,7 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, module_sha_complete(image, hash); } -static void module_sha384_create(struct image *image) +void module_sha384_create(struct image *image) { image->md = EVP_sha384(); image->mdctx = EVP_MD_CTX_new(); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ba35df390469..45e26b69c3f0 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -157,6 +157,7 @@ struct adsp { }; void module_sha256_create(struct image *image); +void module_sha384_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); From 68b3693de14c4ccd31fc2d02bca261855527da0f Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:22:42 +0000 Subject: [PATCH 163/350] plat_auth: use cavs 2.5 plat auth offsets cavs2.5 has different offsets for plat auth data. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/plat_auth.h | 38 ++++++++++++++++++++++++++++++++++ src/plat_auth.c | 18 ++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/include/rimage/plat_auth.h b/src/include/rimage/plat_auth.h index 7e94f8ae12ba..8eb3ad967a56 100644 --- a/src/include/rimage/plat_auth.h +++ b/src/include/rimage/plat_auth.h @@ -11,6 +11,7 @@ struct image; #define PLAT_AUTH_SHA256_LEN 32 +#define PLAT_AUTH_SHA384_LEN 48 #define PLAT_AUTH_NAME_LEN 12 #define PLAT_AUTH_PADDING 48 /* pad at end of struct */ @@ -26,6 +27,15 @@ struct signed_pkg_info_module { uint8_t hash[PLAT_AUTH_SHA256_LEN]; } __attribute__((packed)); +struct signed_pkg_info_module_v2_5 { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint16_t hash_size; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA384_LEN]; +} __attribute__((packed)); + struct signed_pkg_info_ext { uint32_t ext_type; uint32_t ext_len; @@ -42,6 +52,22 @@ struct signed_pkg_info_ext { struct signed_pkg_info_module module[SIGN_PKG_NUM_MODULE]; } __attribute__((packed)); +struct signed_pkg_info_ext_v2_5 { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; /* 0 */ + uint8_t bitmap[16]; + uint32_t svn; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module_v2_5 module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); + #define PART_INFO_EXT_TYPE 3 #define PART_INFO_NUM_MODULE 1 @@ -73,6 +99,17 @@ struct partition_info_ext { struct partition_info_module module[PART_INFO_NUM_MODULE]; } __attribute__((packed)); +/* offset 0x458 id */ +struct info_ext_0x16 { + uint32_t ext_type; /* 0x16 */ + uint32_t ext_len; /* 0x68 */ + uint8_t name[4]; /* ADSP */ + uint32_t size; /* file size */ + uint32_t data[5]; /* 0 = 0x10000000, 0, 1, 1, 0x3003 */ + uint8_t hash[PLAT_AUTH_SHA384_LEN]; + uint32_t data1[5]; +} __attribute__((packed)); + #define PLAT_AUTH_SIZE \ (sizeof(struct partition_info_ext) + \ @@ -83,5 +120,6 @@ void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, int meta_end_offset); void ri_plat_ext_data_create(struct image *image); +void ri_plat_ext_data_create_v2_5(struct image *image); #endif diff --git a/src/plat_auth.c b/src/plat_auth.c index 9b451798ad14..46a2473ae44f 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -57,3 +57,21 @@ void ri_plat_ext_data_create(struct image *image) /* do this here atm */ desc->header.preload_page_count = part->length / MAN_PAGE_SIZE; } + +void ri_plat_ext_data_create_v2_5(struct image *image) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + MAN_META_EXT_OFFSET_V2_5; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + struct info_ext_0x16 *ext = image->fw_image + MAN_PART_INFO_OFFSET_V2_5; + uint32_t size; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + size += MAN_PAGE_SIZE - (size % MAN_PAGE_SIZE); + + /* do this here atm */ + desc->header.preload_page_count = size / MAN_PAGE_SIZE; + ext->size = image->image_end; +} From db40934e57aa80a187e611717b5b731d355bc49b Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:28:12 +0000 Subject: [PATCH 164/350] cavs: add support for cavs2.5 code signing cavs 2.5 uses a larger key and the RSA signing PSS mode. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/adsp_config.c | 389 +++++++++++++++++++++++++++++++++- src/include/rimage/manifest.h | 1 + src/include/rimage/rimage.h | 1 + src/manifest.c | 123 +++++++++++ 4 files changed, 509 insertions(+), 5 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 865a891aec3f..6d1b59afe748 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -529,6 +529,118 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_cse_v2_5(const struct CsePartitionDirHeader_v2_5 *cse_header, + const struct CsePartitionDirEntry *cse_entry) +{ + int i; + + DUMP("\ncse"); + DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_KEY("header_version", "%d", cse_header->header_version); + DUMP_KEY("entry_version", "%d", cse_header->entry_version); + DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); + for (i = 0; i < cse_header->nb_entries; ++i) { + DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); + DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); + } +} + +/* TODO: fix up constants in headers for v2.5 */ +static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct CsePartitionDirHeader_v2_5 *hdr, struct CsePartitionDirEntry *out, + int entry_capacity, bool verbose) +{ + toml_array_t *cse_entry_array; + toml_table_t *cse_entry; + struct parse_ctx ctx; + toml_table_t *cse; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + cse = toml_table_in(toml, "cse"); + if (!cse) + return err_key_not_found("cse"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + hdr->header_marker = CSE_HEADER_MAKER; + hdr->header_length = sizeof(struct CsePartitionDirHeader_v2_5); + + /* configurable fields */ + hdr->header_version = parse_uint32_key(cse, &ctx, "header_version", 2, &ret); + if (ret < 0) + return ret; + + hdr->entry_version = parse_uint32_key(cse, &ctx, "entry_version", 1, &ret); + if (ret < 0) + return ret; + + parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, + sizeof(hdr->partition_name), &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 table */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(cse, &ctx); + if (ret < 0) + return ret; + + /* entry array */ + cse_entry_array = toml_array_in(cse, "entry"); + if (!cse_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(cse_entry_array) != 't' || + toml_array_nelem(cse_entry_array) != entry_capacity) + return err_key_parse("entry", "wrong array type or length != %d", entry_capacity); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(cse_entry_array); ++i) { + cse_entry = toml_table_at(cse_entry_array, i); + if (!cse_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, + sizeof(out[i].entry_name), &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].offset = parse_uint32_hex_key(cse_entry, &ctx, "offset", -1, &ret); + if (ret < 0) + return err_key_parse("offset", NULL); + + out[i].length = parse_uint32_hex_key(cse_entry, &ctx, "length", -1, &ret); + if (ret < 0) + return err_key_parse("length", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(cse_entry, &ctx); + if (ret < 0) + return ret; + } + + hdr->nb_entries = toml_array_nelem(cse_entry_array); + + if (1 || verbose) + dump_cse_v2_5(hdr, out); + + /* + * values set in other places in code: + * - checksum + */ + + return 0; +} + static void dump_css_v1_5(const struct css_header_v1_5 *css) { DUMP("\ncss 1.5"); @@ -697,6 +809,96 @@ static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_css_v2_5(const struct css_header_v2_5 *css) +{ + DUMP("\ncss 2.5"); + DUMP_KEY("header_type", "%d", css->header_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("svn", "%d", css->svn); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v2_5 *out, bool verbose) +{ + static const uint8_t hdr_id[4] = MAN_CSS_HDR_ID; + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(out->header_id, hdr_id, sizeof(out->header_id)); + + /* configurable fields */ + out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE_2_5, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION_2_5, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 281, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(css, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE_2_5, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* hardcoded to align with meu */ + out->reserved0 = 0; + out->reserved1[0] = 0xf; + out->reserved1[1] = 0x048e0000; // TODO: what is this ? + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v2_5(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) { int i; @@ -853,6 +1055,163 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) + DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); + DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); + DUMP_KEY("meta.meta_size", "%d", signed_pkg->module[i].meta_size); + } +} + +static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext_v2_5 *out, bool verbose) +{ + struct signed_pkg_info_module_v2_5 *mod; + toml_array_t *bitmap_array; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + toml_raw_t raw; + int64_t temp_i; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE; + out->ext_len = sizeof(struct signed_pkg_info_ext_v2_5); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + /* bitmap array */ + bitmap_array = toml_array_in(signed_pkg, "bitmap"); + if (!bitmap_array) { + /* default value - some use 0x10*/ + out->bitmap[4] = 0x8; + } else { + ++ctx.array_cnt; + if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || + toml_array_nelem(bitmap_array) > ARRAY_SIZE(out->bitmap)) + return err_key_parse("bitmap", "wrong array type or length > %d", + ARRAY_SIZE(out->bitmap)); + + for (i = 0; i < toml_array_nelem(bitmap_array); ++i) { + raw = toml_raw_at(bitmap_array, i); + if (!raw) + return err_key_parse("bitmap", NULL); + + ret = toml_rtoi(raw, &temp_i); + if (ret < 0 || temp_i < 0) + return err_key_parse("bitmap", "values can't be negative"); + out->bitmap[i] = temp_i; + } + } + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x00, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_size = parse_uint32_hex_key(module, &ctx, "hash_size", 0x30, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 112, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg_v2_5(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} + + static void dump_partition_info_ext(const struct partition_info_ext *part_info) { int i; @@ -982,6 +1341,26 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * return 0; } +static int parse_info_ext_0x16(const toml_table_t *toml, struct parse_ctx *pctx, + struct info_ext_0x16 *out, bool verbose) +{ + /* known */ + out->ext_type = 0x16; + out->ext_len = sizeof(*out); + out->name[0] = 'A'; + out->name[1] = 'D'; + out->name[2] = 'S'; + out->name[3] = 'P'; + + /* copied from meu - unknown */ + out->data[0] = 0x10000000; + out->data[2] = 0x1; + out->data[3] = 0x0; + out->data[4] = 0x3003; + + return 0; +} + static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) { int i; @@ -1487,7 +1866,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, memset(out->man_v2_5, 0, sizeof(*out->man_v2_5)); /* assign correct write functions */ - out->write_firmware = NULL; + out->write_firmware = man_write_fw_v2_5; out->write_firmware_meu = man_write_fw_meu_v2_5; /* version array has already been parsed, so increment ctx.array_cnt */ @@ -1499,20 +1878,20 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("adsp", NULL); - ret = parse_cse(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, + ret = parse_cse_v2_5(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, out->man_v2_5->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); if (ret < 0) return err_key_parse("cse", NULL); - ret = parse_css_v1_8(toml, &ctx, &out->man_v2_5->css, verbose); + ret = parse_css_v2_5(toml, &ctx, &out->man_v2_5->css, verbose); if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + ret = parse_signed_pkg_v2_5(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); - ret = parse_partition_info_ext(toml, &ctx, &out->man_v2_5->partition_info, verbose); + ret = parse_info_ext_0x16(toml, &ctx, &out->man_v2_5->info_0x16, verbose); if (ret < 0) return err_key_parse("partition_info", NULL); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index cd44b118d953..5e13fd21cd9a 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -179,6 +179,7 @@ int simple_write_firmware(struct image *image); int man_write_fw_v1_5(struct image *image); int man_write_fw_v1_5_sue(struct image *image); int man_write_fw_v1_8(struct image *image); +int man_write_fw_v2_5(struct image *image); int man_write_fw_meu_v1_5(struct image *image); int man_write_fw_meu_v1_8(struct image *image); int man_write_fw_meu_v2_5(struct image *image); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 45e26b69c3f0..fdefc41dc100 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -162,6 +162,7 @@ void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); +int ri_manifest_sign_v2_5(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); void ri_sha384(struct image *image, unsigned int offset, unsigned int size, diff --git a/src/manifest.c b/src/manifest.c index 237954b0560c..d586d5b25186 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -121,6 +121,19 @@ static int man_init_image_v1_8(struct image *image) return 0; } +static int man_init_image_v2_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_v2_5, + sizeof(struct fw_image_manifest_v2_5)); + + return 0; +} + /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, struct module *module, @@ -1190,3 +1203,113 @@ int man_write_fw_meu_v2_5(struct image *image) unlink(image->out_file); return ret; } + +/* used by others */ +int man_write_fw_v2_5(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest_v2_5 *m; + uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image_v2_5(image); + if (ret < 0) + goto err; + + /* use default meu offset for TGL if not provided */ + if (!image->meu_offset) + image->meu_offset = MAN_FW_DESC_OFFSET_V2_5 - 0x10; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, MAN_META_EXT_OFFSET_V2_5, + image->meu_offset); + ri_plat_ext_data_create_v2_5(image); + ri_css_v2_5_hdr_create(image); + ri_cse_create_v2_5(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash inside ADSP meta data extension for padding to end */ + ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash); + + /* mue writes 0xff to 16 bytes of padding */ + for (i = 0; i < 16; i++) + m->reserved[i] = 0xff; + + /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ + ri_sha384(image, MAN_META_EXT_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign_v2_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V2_5, + MAN_FW_DESC_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} From 1c1c09ce7ee4eba8a41a2e61aba78447de07ca88 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Thu, 12 Nov 2020 22:07:53 +0000 Subject: [PATCH 165/350] manifest: cavs25: Add support for ext data type 0x16 This type was used by early versions of meu, but the hash is not used in later versions. Leave the code in in case it has to come back. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/manifest.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index d586d5b25186..2ad8946b4db4 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1291,6 +1291,21 @@ int man_write_fw_v2_5(struct image *image) if (ret < 0) goto err; +#if 0 + /* calculate hash - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); + module_sha_complete(image, hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->info_0x16.hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } +#endif /* write the firmware */ ret = man_write_fw_mod(image); if (ret < 0) From 7b7c192e70c23a6024902e6781c32fc0f058c37a Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Thu, 12 Nov 2020 22:08:49 +0000 Subject: [PATCH 166/350] verify: add signature verification support Add support to verify signatures of cavs firmware binaries. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/adsp_config.c | 4 + src/include/rimage/rimage.h | 18 +++ src/manifest.c | 74 +++++++++ src/pkcs1_5.c | 307 ++++++++++++++++++++++++++++++++++++ src/rimage.c | 25 ++- 5 files changed, 425 insertions(+), 3 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6d1b59afe748..2c5669025082 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1755,6 +1755,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5_sue; out->write_firmware_meu = man_write_fw_meu_v1_5; + out->verify_firmware = ri_manifest_verify_v1_5; /* parse others sibtables */ ret = parse_fw_desc(toml, &ctx, &out->man_v1_5_sue->desc, verbose); @@ -1772,6 +1773,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; + out->verify_firmware = ri_manifest_verify_v1_5; /* parse others sibtables */ ret = parse_css_v1_5(toml, &ctx, &out->man_v1_5->css_header, verbose); @@ -1808,6 +1810,7 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_8; out->write_firmware_meu = man_write_fw_meu_v1_8; + out->verify_firmware = ri_manifest_verify_v1_8; /* version array has already been parsed, so increment ctx.array_cnt */ parse_ctx_init(&ctx); @@ -1868,6 +1871,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v2_5; out->write_firmware_meu = man_write_fw_meu_v2_5; + out->verify_firmware = ri_manifest_verify_v2_5; /* version array has already been parsed, so increment ctx.array_cnt */ parse_ctx_init(&ctx); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index fdefc41dc100..1cb75fa707fe 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -104,6 +104,7 @@ struct image { uint32_t image_end;/* module end, equal to output image size */ int meu_offset; int xcc_mod_offset; + const char *verify_file; /* SHA 256 & 384 */ const char *key_name; @@ -149,6 +150,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); + int (*verify_firmware)(struct image *image); struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; @@ -180,6 +182,22 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int verify_image(struct image *image); +int ri_manifest_verify_v1_5(struct image *image); +int ri_manifest_verify_v1_8(struct image *image); +int ri_manifest_verify_v2_5(struct image *image); +int pkcs_v1_5_verify_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); +int pkcs_v1_5_verify_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); +int pkcs_v1_5_verify_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); + int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); diff --git a/src/manifest.c b/src/manifest.c index 2ad8946b4db4..6c781a2e7deb 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1328,3 +1328,77 @@ int man_write_fw_v2_5(struct image *image) unlink(image->out_rom_file); return ret; } + +int verify_image(struct image *image) +{ + FILE *in_file; + int ret, i; + long size; + void *buffer; + size_t read; + + /* is verify supported for target ? */ + if (!image->adsp->verify_firmware) { + fprintf(stderr, "error: verify not supported for target\n"); + return -EINVAL; + } + + /* open image for reading */ + in_file = fopen(image->verify_file, "rb"); + if (!in_file) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + + /* get file size */ + ret = fseek(in_file, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + size = ftell(in_file); + if (size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", + image->verify_file, errno); + return -errno; + } + ret = fseek(in_file, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + + /* allocate buffer for parsing */ + buffer = malloc(size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* find start of fw image and verify */ + read = fread(buffer, 1, size, in_file); + if (read != size) { + fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + size, image->verify_file, errno); + ret = errno; + goto out; + } + for (i = 0; i < size; i += sizeof(uint32_t)) { + /* find CSE header marker "$CPD" */ + if (*(uint32_t *)(buffer + i) == CSE_HEADER_MAKER) { + image->fw_image = buffer + i; + ret = image->adsp->verify_firmware(image); + goto out; + } + } + + /* no header found */ + fprintf(stderr, "error: could not find valid CSE header $CPD in %s\n", + image->verify_file); +out: + fclose(in_file); + return 0; +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 7e8592b0ceda..b138d51c0ab0 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -386,3 +386,310 @@ int ri_manifest_sign_v2_5(struct image *image) return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); } + +/* + * RSA verify of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + /* requires private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: verify with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha_update(image, ptr1, size1); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css_header.signature, + sizeof(man->css_header.signature)); + + /* sign the manifest */ + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css_header.signature, + siglen, priv_rsa); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA verify of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: verifying with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reveresd, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* sign the manifest */ + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css.signature, + siglen, priv_rsa); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA signature of manifest. The signature is an RSA PSS + * of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS verify with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* decrypt signature */ + ret = RSA_public_decrypt(RSA_size(priv_rsa), (unsigned char *)man->css.signature, + sig, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to decrypt signature %s\n", path); + } + + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + +int ri_manifest_verify_v1_5(struct image *image) +{ + struct fw_image_manifest_v1_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + unsigned const size1 = image->image_end - sizeof(*man); + + return pkcs_v1_5_verify_man_v1_5(image, man, data1, size1); +} + +int ri_manifest_verify_v1_8(struct image *image) +{ + struct fw_image_manifest_v1_8 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET; + unsigned const size1 = + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V1_8; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_verify_man_v1_8(image, man, data1, size1, data2, size2); +} + +int ri_manifest_verify_v2_5(struct image *image) +{ + struct fw_image_manifest_v2_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_verify_man_v2_5(image, man, data1, size1, data2, size2); +} diff --git a/src/rimage.c b/src/rimage.c index 1ea2a7fa4c87..a0e906654370 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -20,6 +20,8 @@ static void usage(char *name) { fprintf(stdout, "%s:\t -c adsp_desc -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "%s:\t -c adsp_desc -y infile -k [key]\n", + name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); @@ -28,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); + fprintf(stdout, "\t -y verify signed file\n"); exit(0); } @@ -44,7 +47,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -82,6 +85,9 @@ int main(int argc, char *argv[]) case 'c': adsp_config = optarg; break; + case 'y': + image.verify_file = optarg; + break; case 'h': usage(argv[0]); break; @@ -93,9 +99,11 @@ int main(int argc, char *argv[]) first_non_opt = optind; - /* make sure we have an outfile and machine */ - if (!image.out_file || !adsp_config) + /* we must have config */ + if (!adsp_config) { + fprintf(stderr, "error: must have adsp desc"); usage(argv[0]); + } /* requires private key */ if (!image.key_name) { @@ -103,6 +111,11 @@ int main(int argc, char *argv[]) return -EINVAL; } + /* make sure we have an outfile if nt verifying */ + if ((!image.out_file && !image.verify_file)) + usage(argv[0]); + + /* firmware version and build id */ if (image.fw_ver_string) { ret = sscanf(image.fw_ver_string, "%hu.%hu", @@ -138,6 +151,12 @@ int main(int argc, char *argv[]) if (ret < 0) goto out; + /* verify mode ? */ + if (image.verify_file) { + ret = verify_image(&image); + goto out; + } + /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; From 2e29db45230c52291a8399dc549eb8e7d3b46de1 Mon Sep 17 00:00:00 2001 From: Pan Xiuli <xiuli.pan@linux.intel.com> Date: Fri, 4 Dec 2020 04:05:58 +0000 Subject: [PATCH 167/350] config: merge icl and jsl toml file ICL and JSL is same DSP with differnt HW config. They can share same toml file Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> --- config/jsl.toml | 55 +------------------------------------------------ 1 file changed, 1 insertion(+), 54 deletions(-) mode change 100644 => 120000 config/jsl.toml diff --git a/config/jsl.toml b/config/jsl.toml deleted file mode 100644 index 0bcb2666b080..000000000000 --- a/config/jsl.toml +++ /dev/null @@ -1,54 +0,0 @@ -version = [1, 8] - -[adsp] -name = "jsl" -machine_id = 9 -image_size = "0x100000" - -[[adsp.mem_zone]] -type = "ROM" -base = "0xBEFE0000" -size = "0x00002000" -[[adsp.mem_zone]] -type = "IMR" -base = "0xB0038000" -size = "0x100000" -[[adsp.mem_zone]] -type = "SRAM" -base = "0xBE040000" -size = "0x100000" - -[cse] -partition_name = "ADSP" -[[cse.entry]] -name = "ADSP.man" -offset = "0x58" -length = "0x378" -[[cse.entry]] -name = "cavs0015.met" -offset = "0x400" -length = "0x60" -[[cse.entry]] -name = "cavs0015" -offset = "0x480" -length = "0x0" # calculated by rimage - -[css] - -[signed_pkg] -name = "ADSP" -[[signed_pkg.module]] -name = "cavs0015.met" - -[partition_info] -name = "ADSP" -[[partition_info.module]] -name = "cavs0015.met" - -[adsp_file] -[[adsp_file.comp]] -base_offset = "0x2000" - -[fw_desc.header] -name = "ADSPFW" -load_offset = "0x30000" diff --git a/config/jsl.toml b/config/jsl.toml new file mode 120000 index 000000000000..6d3aa32fedec --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1 @@ +icl.toml \ No newline at end of file From d1f91efdc1e19093df9c88f0b9779010b0177616 Mon Sep 17 00:00:00 2001 From: Pan Xiuli <xiuli.pan@linux.intel.com> Date: Fri, 4 Dec 2020 04:07:57 +0000 Subject: [PATCH 168/350] config: add tgl-h toml file to support tglh build Add tgl-h toml file to support sof-tgl-h.ri binary build Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> --- config/tgl-h.toml | 1 + 1 file changed, 1 insertion(+) create mode 120000 config/tgl-h.toml diff --git a/config/tgl-h.toml b/config/tgl-h.toml new file mode 120000 index 000000000000..887bba2c8411 --- /dev/null +++ b/config/tgl-h.toml @@ -0,0 +1 @@ +tgl.toml \ No newline at end of file From 0dba230832122da32bc10c8267658a0544bc41d1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 17 Dec 2020 01:55:10 +0000 Subject: [PATCH 169/350] pkcs_v1_5_sign_man_v2_5(): add "salt length" comment This comment is meant for "git grep salt", that's its main purpose. Much more obvious timestamps aside, this new code is the only non-deterministic part of rimage - learned the very hard way (OpenSSL "documentation" calls it "sLen"...) A/B testing of build system changes is much, much easier when locally and temporarily making the build 100% deterministic. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index b138d51c0ab0..0bfb901f4cbb 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -313,7 +313,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, /* sign the manifest */ ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, 32); + digest, image->md, /* salt length */ 32); if (ret <= 0) { ERR_error_string(ERR_get_error(), path); fprintf(stderr, "error: failed to sign manifest %s\n", path); From 0d641a7b05cff9a250bf14c754d970ef335e0586 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 9 Mar 2021 05:40:06 +0000 Subject: [PATCH 170/350] minor -h fix: -s meu_offset disables rimage signing It wasn't exactly obvious who does what. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index a0e906654370..0fedc6a4889d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -24,7 +24,7 @@ static void usage(char *name) name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); - fprintf(stdout, "\t -s MEU signing offset\n"); + fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); From dbb49e03b9d811359f946e1a4b74c018caec95a0 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 12 Apr 2021 14:55:36 +0800 Subject: [PATCH 171/350] rimage: add cavs fw layout support Add support of cavs extended manifest and modules. Now we will have another config tgl-cavs for tgl. Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/tgl-cavs.toml | 216 +++++++++++ src/adsp_config.c | 377 +++++++++++++++++++- src/ext_manifest.c | 47 +++ src/include/rimage/cavs/cavs_ext_manifest.h | 249 +++++++++++++ src/include/rimage/ext_manifest_gen.h | 1 + src/include/rimage/rimage.h | 25 ++ src/include/rimage/sof/kernel/fw.h | 4 +- src/manifest.c | 27 ++ src/rimage.c | 6 +- 9 files changed, 947 insertions(+), 5 deletions(-) create mode 100644 config/tgl-cavs.toml create mode 100644 src/include/rimage/cavs/cavs_ext_manifest.h diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml new file mode 100644 index 000000000000..057fa6038f63 --- /dev/null +++ b/config/tgl-cavs.toml @@ -0,0 +1,216 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0000000" +size = "0x1000000" +[[adsp.mem_zone]] +type = "HP-SRAM" +base = "0xBE000000" +size = "0x800000" +[[adsp.mem_zone]] +type = "LP-SRAM" +base = "0xBE800000" +size = "0x40" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "383B9BE2-3518-4DB0-8891-B1470A8914F8" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + diff --git a/src/adsp_config.c b/src/adsp_config.c index 2c5669025082..6a8bb4e74296 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -5,8 +5,10 @@ * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> */ +#include "rimage/sof/user/manifest.h" #include "rimage/sof/user/manifest.h" #include "rimage/adsp_config.h" +#include "rimage/ext_manifest_gen.h" #include "rimage/plat_auth.h" #include "rimage/manifest.h" #include "rimage/rimage.h" @@ -262,8 +264,8 @@ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) {"ROM", SOF_FW_BLK_TYPE_ROM}, {"IMR", SOF_FW_BLK_TYPE_IMR}, {"RSRVD0", SOF_FW_BLK_TYPE_RSRVD0}, - {"RSRVD6", SOF_FW_BLK_TYPE_RSRVD6}, - {"RSRVD7", SOF_FW_BLK_TYPE_RSRVD7}, + {"HP-SRAM", SOF_FW_BLK_TYPE_HPSRAM}, + {"LP-SRAM", SOF_FW_BLK_TYPE_LPSRAM}, {"RSRVD8", SOF_FW_BLK_TYPE_RSRVD8}, {"RSRVD9", SOF_FW_BLK_TYPE_RSRVD9}, {"RSRVD10", SOF_FW_BLK_TYPE_RSRVD10}, @@ -1701,6 +1703,370 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static int parse_scheduling(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_ext_mod_config *ext_mod_config, int *ext_length) +{ + toml_array_t *arr; + toml_raw_t raw; + int64_t val; + int ret; + + /* check "sched_caps" key */ + arr = toml_array_in(mod_entry, "sched_caps"); + if (!arr) { + ext_mod_config->header.num_scheduling_capabilities = 0; + *ext_length = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + ctx->array_cnt++; + + raw = toml_raw_at(arr, 0); + if (raw == 0) + return err_key_parse("frame_length", NULL); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("frame_length", "can't convert element to integer"); + ext_mod_config->sched_caps.frame_length = val; + + raw = toml_raw_at(arr, 1); + if (raw == 0) + return err_key_parse("multiples_supported", NULL); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("multiples_supported", "can't convert element to integer"); + ext_mod_config->sched_caps.multiples_supported.ul = val; + + ext_mod_config->header.num_scheduling_capabilities = 1; + *ext_length = sizeof(const struct mod_scheduling_caps); + + return 0; +} + +static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_ext_mod_config *ext_mod_config, int *ext_length) +{ + toml_array_t *arr; + toml_raw_t raw; + int64_t val; + int ret; + int i, j; + + /* check "pin" key */ + arr = toml_array_in(mod_entry, "pin"); + if (!arr) { + ext_mod_config->header.num_pin_entries = 0; + *ext_length = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type"); + + ctx->array_cnt++; + + ext_mod_config->header.num_pin_entries = toml_array_nelem(arr) / 6; + ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description), + toml_array_nelem(arr) / 6); + + j = 0; + for (i = 0; ; i += 6, j++) { + raw = toml_raw_at(arr, i); + if (raw == 0) + break; + + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].caps.ul = (uint16_t)val; + + raw = toml_raw_at(arr, i + 1); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].format_type = (enum mod_stream_type)val; + + raw = toml_raw_at(arr, i + 2); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_rate.ul = (uint32_t)val; + + raw = toml_raw_at(arr, i + 3); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_size.ul = (uint16_t)val; + + raw = toml_raw_at(arr, i + 4); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_container.ul = (uint32_t)val; + + raw = toml_raw_at(arr, i + 5); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].ch_cfg.ul = (uint32_t)val; + } + + *ext_length = ext_mod_config->header.num_pin_entries * + sizeof(const struct fw_pin_description); + + return 0; +} + +static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_manifest_module *modules, + struct sof_man_module *mod_man) +{ + toml_array_t *arr; + toml_raw_t raw; + int *pin_data; + int64_t val; + int ret; + int i; + + /* check "pin" key */ + arr = toml_array_in(mod_entry, "mod_cfg"); + if (!arr) { + mod_man->cfg_count = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type"); + + ctx->array_cnt++; + + pin_data = (int *)(modules->mod_cfg + modules->mod_cfg_count); + mod_man->cfg_offset = modules->mod_cfg_count; + modules->mod_cfg_count += toml_array_nelem(arr) / 11; + mod_man->cfg_count = toml_array_nelem(arr) / 11; + + /* parse "pin" array elements */ + for (i = 0; ; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + break; + + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + pin_data[i] = val; + } + + return 0; +} + +static void parse_uuid(char *buf, uint8_t *uuid) +{ + struct uuid_t id; + uint32_t d[9]; + + sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], + &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + id.d1 = (uint16_t)d[0]; + id.d2 = (uint16_t)d[1]; + id.d3 = (uint8_t)d[2]; + id.d4 = (uint8_t)d[3]; + id.d5 = (uint8_t)d[4]; + id.d6 = (uint8_t)d[5]; + id.d7 = (uint8_t)d[6]; + id.d8 = (uint8_t)d[7]; + id.d9 = (uint8_t)d[8]; + id.d10 = (uint8_t)d[9]; + + memcpy(uuid, &id, sizeof(id)); +} + +static void dump_module(struct fw_image_manifest_module *man_cavs) +{ + int i; + + DUMP("\nmodule"); + DUMP_KEY("moudle count", "%d", man_cavs->mod_man_count); + DUMP_KEY("module config count", "%d", man_cavs->mod_cfg_count); + + for (i = 0; i < man_cavs->mod_man_count; i++) { + DUMP_KEY("module name", "%s", man_cavs->mod_man[i].name); + DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); + DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); + DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); + DUMP_KEY("config count", "%d", man_cavs->mod_man[i].cfg_count); + DUMP_KEY("config offset", "%d", man_cavs->mod_man[i].cfg_offset); + } +} + +static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, + struct adsp *out, bool verbose) +{ + struct fw_image_manifest_module *modules; + toml_array_t *mod_entry_array; + toml_table_t *module; + toml_table_t *mod_entry; + struct parse_ctx ctx; + int entry_count; + int type, ext_length; + int tmp_cfg_count; + int ret, i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + module = toml_table_in(toml, "module"); + if (!module) + return 0; + + out->write_firmware_ext_man = ext_man_write_cavs_25; + + modules = calloc(sizeof(struct fw_image_manifest_module), 1); + if (!modules) + return err_malloc("man_cavs"); + out->modules = modules; + + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + entry_count = parse_uint32_key(module, &ctx, "count", 2, &ret); + if (ret < 0) + return ret; + + ctx.array_cnt += 1; + + mod_entry_array = toml_array_in(module, "entry"); + if (!mod_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(mod_entry_array) != 't' || + toml_array_nelem(mod_entry_array) != entry_count) + return err_key_parse("entry", "wrong array type or length != %d", entry_count); + + modules->mod_ext.mod_conf_count = entry_count; + modules->mod_man = calloc(sizeof(const struct sof_man_module), entry_count); + if (!modules->mod_man) + return -ENOMEM; + + modules->mod_man_count = toml_array_nelem(mod_entry_array); + + tmp_cfg_count = entry_count * 32; + modules->mod_cfg = calloc(sizeof(const struct sof_man_mod_config), tmp_cfg_count); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(mod_entry_array); ++i) { + struct fw_ext_mod_config_header *header; + struct sof_man_module *mod_man; + struct parse_ctx ctx_entry; + char buf[48]; + + mod_entry = toml_table_at(mod_entry_array, i); + if (!mod_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx_entry); + + mod_man = &modules->mod_man[i]; + + memcpy(mod_man->struct_id, "$AME", 4); + + /* configurable fields */ + parse_str_key(mod_entry, &ctx_entry, "name", (char *)mod_man->name, + SOF_MAN_MOD_NAME_LEN, &ret); + if (ret < 0) + return err_key_parse("name", NULL); + + parse_str_key(mod_entry, &ctx_entry, "uuid", buf, 48, &ret); + if (ret < 0) + return err_key_parse("uuid", NULL); + + parse_uuid(buf, mod_man->uuid); + + mod_man->affinity_mask = parse_uint32_hex_key(mod_entry, &ctx_entry, + "affinity_mask", 1, &ret); + if (ret < 0) + return err_key_parse("offset", NULL); + + mod_man->instance_max_count = parse_uint32_hex_key(mod_entry, &ctx_entry, + "instance_count", 1, &ret); + if (ret < 0) + return err_key_parse("length", NULL); + + type = parse_uint32_hex_key(mod_entry, &ctx_entry, "domain_types", 0, &ret); + if (ret < 0) + return err_key_parse("domain_types", NULL); + if (!type) + mod_man->type.domain_ll = 1; + else + mod_man->type.domain_dp = 1; + + mod_man->type.load_type = parse_uint32_hex_key(mod_entry, &ctx_entry, + "load_type", 1, &ret); + if (ret < 0) + return err_key_parse("load_type", NULL); + + mod_man->type.auto_start = parse_uint32_hex_key(mod_entry, &ctx_entry, + "auto_start", 1, &ret); + if (ret < 0) + return err_key_parse("auto_start", NULL); + + header = &modules->mod_ext.ext_mod_config_array[i].header; + header->version_major = 2; + header->version_minor = 5; + header->ext_module_config_length = sizeof(struct fw_ext_mod_config_header); + memcpy(header->guid, mod_man->uuid, sizeof(mod_man->uuid)); + + type = parse_uint32_hex_key(mod_entry, &ctx_entry, "module_type", 1, &ret); + if (ret < 0) + return err_key_parse("module_type", NULL); + + if (strcmp((char *)mod_man->name, "BRNGUP") && + strcmp((char *)mod_man->name, "BASEFW")) { + if (type != i - 1) { + log_err(ret, "error: invalid type %s", type); + return -EINVAL; + } + } + header->module_type = type; + + ret = parse_scheduling(mod_entry, &ctx_entry, + modules->mod_ext.ext_mod_config_array + i, &ext_length); + if (ret < 0) + return err_key_parse("schd_caps", NULL); + header->ext_module_config_length += ext_length; + + ret = parse_pin(mod_entry, &ctx_entry, modules->mod_ext.ext_mod_config_array + i, + &ext_length); + if (ret < 0) + return err_key_parse("pin", NULL); + header->ext_module_config_length += ext_length; + + ret = parse_mod_config(mod_entry, &ctx_entry, modules, mod_man); + if (ret < 0) + return err_key_parse("mod_cfg", NULL); + + if (modules->mod_cfg_count > tmp_cfg_count) + return -ENOMEM; + + /* check everything parsed */ + ret = assert_everything_parsed(mod_entry, &ctx_entry); + if (ret < 0) + return ret; + } + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_module(modules); + + return 0; +} + static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, bool verbose) { @@ -1907,6 +2273,10 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("fw_desc", NULL); + ret = parse_module(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("module", NULL); + /* check everything parsed */ ret = assert_everything_parsed(toml, &ctx); if (ret < 0) @@ -2036,6 +2406,9 @@ void adsp_free(struct adsp *adsp) if (adsp->man_v2_5) free(adsp->man_v2_5); + if (adsp->modules) + free(adsp->modules); + if (adsp->name) free((char *)adsp->name); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 8f079bb9bd4b..b389210c1f2e 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -12,6 +12,8 @@ #include <rimage/ext_manifest_gen.h> #include <rimage/sof/kernel/ext_manifest.h> #include <rimage/rimage.h> +#include <rimage/cavs/cavs_ext_manifest.h> +#include <rimage/manifest.h> const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, @@ -182,3 +184,48 @@ int ext_man_write(struct image *image) fclose(image->out_ext_man_fd); return ret; } + +int ext_man_write_cavs_25(struct image *image) +{ + struct fw_image_ext_module *mod_ext; + struct fw_ext_man_cavs_header header; + int pin_count; + int count, i; + int ret; + + ret = ext_man_open_file(image); + if (ret) + goto out; + + mod_ext = &image->adsp->modules->mod_ext; + count = mod_ext->mod_conf_count; + + header.version_major = mod_ext->ext_mod_config_array->header.version_major; + header.version_minor = mod_ext->ext_mod_config_array->header.version_minor; + header.num_module_entries = count; + header.id = EXTENDED_MANIFEST_MAGIC_HEADER_ID; + header.len = sizeof(const struct fw_ext_man_cavs_header); + + for (i = 0; i < count; i++) + header.len += mod_ext->ext_mod_config_array[i].header.ext_module_config_length; + fwrite(&header, 1, sizeof(header), image->out_ext_man_fd); + + for (i = 0; i < count; i++) { + fwrite(&mod_ext->ext_mod_config_array[i].header, 1, + sizeof(struct fw_ext_mod_config_header), image->out_ext_man_fd); + + if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) + fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, 1, + sizeof(struct mod_scheduling_caps), image->out_ext_man_fd); + + pin_count = mod_ext->ext_mod_config_array[i].header.num_pin_entries; + if (pin_count) + fwrite(mod_ext->ext_mod_config_array[i].pin_desc, pin_count, + sizeof(struct fw_pin_description), image->out_ext_man_fd); + } + +out: + if (image->out_ext_man_fd) + fclose(image->out_ext_man_fd); + return ret; +} diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/src/include/rimage/cavs/cavs_ext_manifest.h new file mode 100644 index 000000000000..cc8fe4dc8ac0 --- /dev/null +++ b/src/include/rimage/cavs/cavs_ext_manifest.h @@ -0,0 +1,249 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2021 Intel Corporation. All rights reserved. + * + * Author: Rander Wang <rander.wang@linux.intel.com> + */ + +#ifndef __RIMAGE_CAVS_EXT_MANIFEST_H__ +#define __RIMAGE_CAVS_EXT_MANIFEST_H__ + +/* Structure of ext manifest : + * ExtendedManifestHeader + * ExtendedModuleConfig[0] + * SchedulingCapability[] + * PinDescr[] + * ExtendedModuleConfig[1] + * SchedulingCapability[] + * PinDescr[] + * ... + * ExtendedModuleConfig[N] + * SchedulingCapability[] + * PinDescr[] + */ + +/* ExtendedManifestHeader id $AE1 */ +#define EXTENDED_MANIFEST_MAGIC_HEADER_ID 0x31454124 + +#define FW_MAX_EXT_MODULE_NUM 32 + +struct uuid_t { + uint32_t d0; + uint16_t d1; + uint16_t d2; + uint8_t d3; + uint8_t d4; + uint8_t d5; + uint8_t d6; + uint8_t d7; + uint8_t d8; + uint8_t d9; + uint8_t d10; +} __attribute__((packed)); + +union mod_multiples { + uint16_t ul; + struct { + uint16_t x1 : 1; + uint16_t x2 : 1; + uint16_t x3 : 1; + uint16_t x4 : 1; + uint16_t x5 : 1; + uint16_t x6 : 1; + uint16_t x7 : 1; + uint16_t x8 : 1; + uint16_t x9 : 1; + uint16_t x10 : 1; + uint16_t x11 : 1; + uint16_t x12 : 1; + uint16_t x13 : 1; + uint16_t x14 : 1; + uint16_t x15 : 1; + uint16_t all : 1; + } r; +} __attribute__((packed)); + +struct mod_scheduling_caps { + /* scheduling period in Samples (sample groups) (note: 1 Sample = 1 sample per channel) */ + uint16_t frame_length; + union mod_multiples multiples_supported; +} __attribute__((packed)); + +enum mod_pin_direction { + pin_input = 0, + pin_output = 1 +}; + +union mod_pin_caps { + uint32_t ul; + struct { + uint16_t direction : 1; /* 0 : input; 1: output */ + uint16_t reserved0 : 15; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_sample_rates { + uint32_t ul; + struct { + uint32_t freq_8000 : 1; + uint32_t freq_11025 : 1; + uint32_t freq_12000 : 1; + uint32_t freq_16000 : 1; + uint32_t freq_18900 : 1; + uint32_t freq_22050 : 1; + uint32_t freq_24000 : 1; + uint32_t freq_32000 : 1; + uint32_t freq_37800 : 1; + uint32_t freq_44100 : 1; + uint32_t freq_48000 : 1; + uint32_t freq_64000 : 1; + uint32_t freq_88200 : 1; + uint32_t freq_96000 : 1; + uint32_t freq_176400 : 1; + uint32_t freq_192000 : 1; + uint32_t reserved : 16; + } r; +} __attribute__((packed)); + +union mod_sample_sizes { + uint32_t ul; + struct { + uint16_t bits_8 : 1; + uint16_t bits_16 : 1; + uint16_t bits_24 : 1; + uint16_t bits_32 : 1; + uint16_t bits_64 : 1; + uint16_t reserved0 : 11; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_sample_containers { + uint32_t ul; + struct { + uint16_t bits_8 : 1; + uint16_t bits_16 : 1; + uint16_t bits_24 : 1; + uint16_t bits_32 : 1; + uint16_t bits_64 : 1; + uint16_t reserved0 : 11; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_channel_config { + uint32_t ul; + struct { + /* FRONT_CENTER */ + uint32_t channel_mono : 1; + /* FRONT_LEFT | BACK_LEFT */ + uint32_t channel_dual_mono : 1; + /* FRONT_LEFT | FRONT_RIGHT */ + uint32_t channel_stereo : 1; + /* FRONT_LEFT | FRONT_RIGHT | LOW_FREQUENCY */ + uint32_t channel_2_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER */ + uint32_t channel_3_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT */ + uint32_t channel_quad : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_CENTER */ + uint32_t channel_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY */ + uint32_t channel_3_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT */ + uint32_t channel_5_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT */ + uint32_t channel_5_0_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT + */ + uint32_t channel_5_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SIDE_LEFT | + * SIDE_RIGHT + */ + uint32_t channel_5_1_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | + * FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER + */ + uint32_t channel_7_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | + * SIDE_LEFT | SIDE_RIGHT + */ + uint32_t channel_7_0_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER + */ + uint32_t channel_7_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT + */ + uint32_t channel_7_1_surround : 1; + uint32_t reserved : 16; + } r; +} __attribute__((packed)); + +enum mod_stream_type { + epcm = 0, /* PCM stream */ + emp3, /* MP3 encoded stream */ + eaac, /* AAC encoded stream */ + emax_stream_type, + estream_type_invalid = 0xFF +}; + +enum mod_type { + ebasefw = 0, + emixin, + emixout, + ecopier, + epeakvol, + eupdwmix, + emux, + esrc, + ewov, + efx, + eaec, + ekpb, + emicselect, + efxf, /*i.e.SmartAmp */ + eaudclass, + efakecopier, + eiodriver, + ewhm, + egdbstub, + esensing, + emax, + einvalid = emax +} ; + +struct fw_pin_description { + union mod_pin_caps caps; + enum mod_stream_type format_type; + union mod_sample_rates sample_rate; + union mod_sample_sizes sample_size; + union mod_sample_containers sample_container; + union mod_channel_config ch_cfg; +} __attribute__((packed)); + +struct fw_ext_man_cavs_header { + uint32_t id; + uint32_t len; /* sizeof(Extend Manifest) in bytes */ + uint16_t version_major; /* Version of Extended Manifest structure */ + uint16_t version_minor; /* Version of Extended Manifest structure */ + uint32_t num_module_entries; +} __attribute__((packed)); + +struct fw_ext_mod_config_header { + uint32_t ext_module_config_length; /* sizeof(fw_ext_mod_config_header) in bytes */ + uint32_t guid[4]; /* Module GUID */ + uint16_t version_major; /* Module version */ + uint16_t version_minor; /* Module version */ + uint16_t version_hotfix; /* Module version */ + uint16_t version_build; /* Module version */ + enum mod_type module_type; + uint32_t init_settings_min_size; /* Minimum size of initialization settings (in bytes) */ + uint16_t num_scheduling_capabilities; /* number scheduling capabilities supported by the module */ + uint16_t num_pin_entries; /* Number of Pin (inputs + ouptuts) */ +} __attribute__((packed)); + +#endif diff --git a/src/include/rimage/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h index e91ba229c1ab..7f106834a0ca 100644 --- a/src/include/rimage/ext_manifest_gen.h +++ b/src/include/rimage/ext_manifest_gen.h @@ -32,5 +32,6 @@ #define EXT_MAN_DATA_SECTION ".fw_metadata" int ext_man_write(struct image *image); +int ext_man_write_cavs_25(struct image *image); #endif /* __EXT_MAN_H__ */ diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1cb75fa707fe..8abb07c514c9 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -14,6 +14,7 @@ #include <openssl/conf.h> #include <openssl/evp.h> #include <openssl/err.h> +#include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) @@ -137,6 +138,28 @@ struct mem_zone { uint32_t host_offset; }; +struct fw_image_ext_mod_config { + struct fw_ext_mod_config_header header; + struct mod_scheduling_caps sched_caps; + struct fw_pin_description *pin_desc; +}; + +struct fw_image_ext_module { + uint32_t mod_conf_count; + struct fw_image_ext_mod_config ext_mod_config_array[FW_MAX_EXT_MODULE_NUM]; +}; + +/* + * module manifest information defined in config file + */ +struct fw_image_manifest_module { + struct fw_image_ext_module mod_ext; + uint32_t mod_cfg_count; + struct sof_man_mod_config *mod_cfg; + uint32_t mod_man_count; + struct sof_man_module *mod_man; +}; + /* * Audio DSP descriptor and operations. */ @@ -148,6 +171,7 @@ struct adsp { uint32_t dram_offset; enum machine_id machine_id; + int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); int (*verify_firmware)(struct image *image); @@ -155,6 +179,7 @@ struct adsp { struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; struct fw_image_manifest_v1_5_sue *man_v1_5_sue; + struct fw_image_manifest_module *modules; int exec_boot_ldr; }; diff --git a/src/include/rimage/sof/kernel/fw.h b/src/include/rimage/sof/kernel/fw.h index 4a733b30e272..14c8ca0c1585 100644 --- a/src/include/rimage/sof/kernel/fw.h +++ b/src/include/rimage/sof/kernel/fw.h @@ -33,8 +33,8 @@ enum snd_sof_fw_blk_type { SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */ SOF_FW_BLK_TYPE_ROM = 4, SOF_FW_BLK_TYPE_IMR = 5, - SOF_FW_BLK_TYPE_RSRVD6 = 6, - SOF_FW_BLK_TYPE_RSRVD7 = 7, + SOF_FW_BLK_TYPE_HPSRAM = 6, + SOF_FW_BLK_TYPE_LPSRAM = 7, SOF_FW_BLK_TYPE_RSRVD8 = 8, SOF_FW_BLK_TYPE_RSRVD9 = 9, SOF_FW_BLK_TYPE_RSRVD10 = 10, diff --git a/src/manifest.c b/src/manifest.c index 6c781a2e7deb..593a17e72076 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -700,6 +700,29 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, return 0; } +static void man_create_modules_in_config(struct image *image, struct sof_man_fw_desc *desc) +{ + struct fw_image_manifest_module *modules; + struct sof_man_module *man_module; + void *cfg_start; + int i; + + modules = image->adsp->modules; + if (!modules) + return; + + /*skip bringup and base module */ + for (i = 2; i < modules->mod_man_count; i++) { + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); + memcpy(man_module, &modules->mod_man[i], sizeof(*man_module)); + } + + cfg_start = (void *)desc + SOF_MAN_MODULE_OFFSET(i); + memcpy(cfg_start, modules->mod_cfg, modules->mod_cfg_count * sizeof(struct sof_man_mod_config)); + + desc->header.num_module_entries = modules->mod_man_count; +} + static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) { struct sof_man_module *man_module; @@ -1169,6 +1192,8 @@ int man_write_fw_meu_v2_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); fprintf(stdout, "Firmware completing manifest v2.5\n"); @@ -1251,6 +1276,8 @@ int man_write_fw_v2_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); fprintf(stdout, "Firmware completing manifest v2.5\n"); diff --git a/src/rimage.c b/src/rimage.c index 0fedc6a4889d..c74c462401c7 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -209,7 +209,11 @@ int main(int argc, char *argv[]) /* build extended manifest */ if (use_ext_man) { - ret = ext_man_write(&image); + if (image.adsp->write_firmware_ext_man) + ret = image.adsp->write_firmware_ext_man(&image); + else + ret = ext_man_write(&image); + if (ret < 0) { fprintf(stderr, "error: unable to write extended manifest, %d\n", ret); From 6c44aefb1f1ac3974eca40ee64fe33550f60a653 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Mon, 26 Apr 2021 12:19:54 +0200 Subject: [PATCH 172/350] ext_man: Fix memory leak after manifest build sec_buffer allocated inside elf_read_section() was not being freed before and is freed now. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/ext_manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index b389210c1f2e..cb854c5153f1 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -130,6 +130,7 @@ static int ext_man_build(const struct module *module, *dst_buff = (struct ext_man_header *)buffer; out: + free(sec_buffer); return ret; } From 994ee247e13ab2d044dae03a83aa7594b4fc6e7c Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Mon, 26 Apr 2021 12:25:20 +0200 Subject: [PATCH 173/350] ext_man: Fix code formating Function parameters should be separated by ', '. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/ext_manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index cb854c5153f1..be6c80daaea2 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -125,7 +125,7 @@ static int ext_man_build(const struct module *module, memcpy(buffer, &ext_man, ext_man.header_size); offset = ext_man.header_size; - memcpy(&buffer[offset],sec_buffer, section->size); + memcpy(&buffer[offset], sec_buffer, section->size); *dst_buff = (struct ext_man_header *)buffer; From 0297c671fc90c2e4aaa15fe8f050d6115cb5b124 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 5 May 2021 08:57:04 +0200 Subject: [PATCH 174/350] config: Fix 'module' parsing error messages 'key' argument must describe 'key' which triggered error message to keep stderr output helpful. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6a8bb4e74296..354119968701 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1721,7 +1721,7 @@ static int parse_scheduling(const toml_table_t *mod_entry, struct parse_ctx *ctx if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type or length != 2"); + return err_key_parse("sched_caps", "wrong array type or length != 2"); ctx->array_cnt++; @@ -1765,7 +1765,7 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, } if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type"); + return err_key_parse("pin", "wrong array type"); ctx->array_cnt++; @@ -1840,7 +1840,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx } if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type"); + return err_key_parse("mod_cfg", "wrong array type"); ctx->array_cnt++; @@ -1857,7 +1857,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx ret = toml_rtoi(raw, &val); if (ret < 0) - return err_key_parse("pin", "can't convert element to integer"); + return err_key_parse("mod_cfg", "can't convert element to integer"); pin_data[i] = val; } @@ -1987,12 +1987,12 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, mod_man->affinity_mask = parse_uint32_hex_key(mod_entry, &ctx_entry, "affinity_mask", 1, &ret); if (ret < 0) - return err_key_parse("offset", NULL); + return err_key_parse("affinity_mask", NULL); mod_man->instance_max_count = parse_uint32_hex_key(mod_entry, &ctx_entry, "instance_count", 1, &ret); if (ret < 0) - return err_key_parse("length", NULL); + return err_key_parse("instance_count", NULL); type = parse_uint32_hex_key(mod_entry, &ctx_entry, "domain_types", 0, &ret); if (ret < 0) From 8f42ee88cc113a8a270314f228014f93daa0cf0e Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:05:26 -0700 Subject: [PATCH 175/350] adsp_config: fix out of bounds error cppcheck find Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 354119968701..a9e33894e117 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1867,7 +1867,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx static void parse_uuid(char *buf, uint8_t *uuid) { struct uuid_t id; - uint32_t d[9]; + uint32_t d[10]; sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); From 1cca9bf01d11f7c9d2a46ead774e939c6dc94add Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:27:58 -0700 Subject: [PATCH 176/350] ext_manifest: cppcheck: refactor to silence false positive memory clearly has exit path through argument, factor out temporary variable to silence cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/ext_manifest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index be6c80daaea2..962415674f11 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -88,7 +88,6 @@ static int ext_man_build(const struct module *module, { struct ext_man_header ext_man; const Elf32_Shdr *section; - uint8_t *buffer = NULL; uint8_t *sec_buffer = NULL; size_t offset; int ret; @@ -114,20 +113,17 @@ static int ext_man_build(const struct module *module, goto out; } - /* alloc buffer for ext_man */ - buffer = calloc(1, ext_man.full_size); - if (!buffer) { + *dst_buff = calloc(1, ext_man.full_size); + if (!*dst_buff) { ret = -ENOMEM; goto out; } /* fill buffer with ext_man and section content */ - memcpy(buffer, &ext_man, ext_man.header_size); + memcpy(*dst_buff, &ext_man, ext_man.header_size); offset = ext_man.header_size; - memcpy(&buffer[offset], sec_buffer, section->size); - - *dst_buff = (struct ext_man_header *)buffer; + memcpy(((char *)*dst_buff) + offset, sec_buffer, section->size); out: free(sec_buffer); From 7764a8bd3162e35f8ca231373620775e164c88ed Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:38:14 -0700 Subject: [PATCH 177/350] manifest: close file on error found via cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/manifest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 593a17e72076..f29355b66dbf 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1383,19 +1383,22 @@ int verify_image(struct image *image) if (ret < 0) { fprintf(stderr, "error: unable to seek eof %s for reading %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } size = ftell(in_file); if (size < 0) { fprintf(stderr, "error: unable to get file size for %s %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } ret = fseek(in_file, 0, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: unable to seek %s for reading %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } /* allocate buffer for parsing */ From 6f45b619210b2dc1fc84baa521e2d01a6b7a485a Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 17:01:24 -0700 Subject: [PATCH 178/350] actions: add cppcheck and yamllint CI saves lives Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- .github/workflows/cppcheck.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/pull-request.yml | 25 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/cppcheck.yml create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 000000000000..211e4004692c --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,30 @@ +--- +# SPDX-License-Identifier: BSD-3-Clause +# Tools that can save round-trips to github and a lot of time: +# +# yamllint -f parsable this.yml +# pip3 install ruamel.yaml.cmd +# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml +# +# github.com also has a powerful web editor that can be used without +# committing. + +name: cppcheck + +# yamllint disable-line rule:truthy +on: [pull_request, push] + +jobs: + cppcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 50, submodules: recursive} + + - name: apt install cppcheck + run: sudo apt update && sudo apt-get -y install cppcheck + + # TODO enable more types of checks as they are fixed + - name: run cppcheck + run: cppcheck --platform=unix32 --force --max-configs=1024 + --inconclusive --quiet --inline-suppr . diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000000..b821ce4fb5f7 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,25 @@ +--- +# SPDX-License-Identifier: BSD-3-Clause +# Tools that can save round-trips to github and a lot of time: +# +# yamllint -f parsable this.yml +# pip3 install ruamel.yaml.cmd +# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml +# +# github.com also has a powerful web editor that can be used without +# committing. + +name: checkpatch + +# yamllint disable-line rule:truthy +on: [pull_request] + +jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 50, submodules: recursive} + + - name: run yamllint + run: yamllint .github/workflows/*.yml From 5aeb95b19bba15801fef4ee37760a6e776d3bd1a Mon Sep 17 00:00:00 2001 From: Slawomir Blauciak <slawomir.blauciak@linux.intel.com> Date: Tue, 25 May 2021 16:55:10 +0200 Subject: [PATCH 179/350] sanity check allocated memory Issue detected by Klocwork Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com> --- src/adsp_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index a9e33894e117..5b26f4589123 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1773,6 +1773,9 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description), toml_array_nelem(arr) / 6); + if(!ext_mod_config->pin_desc) + return err_malloc("pin"); + j = 0; for (i = 0; ; i += 6, j++) { raw = toml_raw_at(arr, i); From 9e50a02f1b0dabd2225a791d63bd48cd61feb3c6 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 13:37:31 +0800 Subject: [PATCH 180/350] config: tgl: change image_size to the real SRAM size We have 46 bank HP and 1 bank LP SRAM on TGL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/tgl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/tgl.toml b/config/tgl.toml index 57a1e13f4f73..a095b33c59da 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,7 +3,7 @@ version = [2, 5] [adsp] name = "tgl" machine_id = 10 -image_size = "0x100000" +image_size = "0x2F0000" # (46 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 8073ea3ef93ce740b3a8a8fa617af9988c990838 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 13:48:58 +0800 Subject: [PATCH 181/350] config: tgl-h: change image_size to the real SRAM size We have 30 bank HP and 1 bank LP SRAM on TGL-H, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/tgl-h.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) mode change 120000 => 100644 config/tgl-h.toml diff --git a/config/tgl-h.toml b/config/tgl-h.toml deleted file mode 120000 index 887bba2c8411..000000000000 --- a/config/tgl-h.toml +++ /dev/null @@ -1 +0,0 @@ -tgl.toml \ No newline at end of file diff --git a/config/tgl-h.toml b/config/tgl-h.toml new file mode 100644 index 000000000000..b6653b2b7afd --- /dev/null +++ b/config/tgl-h.toml @@ -0,0 +1,49 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x1F0000" # (30 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From f52a078aadf19457275db5748a2b2a542bc7bf4e Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:39:01 +0800 Subject: [PATCH 182/350] config: icl: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on ICL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/icl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/icl.toml b/config/icl.toml index 2e2e61799544..6b4dfa730748 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "icl" machine_id = 9 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 1de9ccca3388b87caf98f4e125b3d6ff0a55fccf Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:41:49 +0800 Subject: [PATCH 183/350] config: jsl: change image_size to the real SRAM size We have 16 bank HP and 1 bank LP SRAM on JSL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/jsl.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) mode change 120000 => 100644 config/jsl.toml diff --git a/config/jsl.toml b/config/jsl.toml deleted file mode 120000 index 6d3aa32fedec..000000000000 --- a/config/jsl.toml +++ /dev/null @@ -1 +0,0 @@ -icl.toml \ No newline at end of file diff --git a/config/jsl.toml b/config/jsl.toml new file mode 100644 index 000000000000..cd40317b6041 --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "icl" +machine_id = 9 +image_size = "0x110000" # (16 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From 8a2ea0044dcfd71da952ecd3ca8662c4b25dab43 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:43:46 +0800 Subject: [PATCH 184/350] config: cnl: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on CNL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/cnl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cnl.toml b/config/cnl.toml index 6a3de265318c..88b6d42e3099 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "cnl" machine_id = 8 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 9a26e4558094f19f3f7becd89eb9e8a9a9dd82b9 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:45:56 +0800 Subject: [PATCH 185/350] config: apl: change image_size to the real SRAM size We have 8 bank HP and 2 bank LP SRAM on APL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/apl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/apl.toml b/config/apl.toml index 869b95900ccb..9751623a2114 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "apl" machine_id = 5 -image_size = "0x100000" +image_size = "0x0A0000" # (8 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 580e4d674e06eb6d515d1479c082b46709ab743f Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Tue, 20 Jul 2021 13:36:04 +0800 Subject: [PATCH 186/350] config: tgl-cavs: change image_size to the real SRAM size Apply "config: tgl: change image_size to the real SRAM size" (9e50a02f1b) to tgl-cavs Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/tgl-cavs.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 057fa6038f63..8f5316fbb093 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -3,7 +3,7 @@ version = [2, 5] [adsp] name = "tgl" machine_id = 10 -image_size = "0x100000" +image_size = "0x2F0000" [[adsp.mem_zone]] type = "ROM" From 44b37d19a24cab75d83f99f3d9083f5574917aa3 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Wed, 21 Jul 2021 18:06:24 +0800 Subject: [PATCH 187/350] config: sue: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on Suecreek, change the toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/sue.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sue.toml b/config/sue.toml index d326d0ae7a8e..c0c4a01fa898 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "sue" machine_id = 11 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 [[adsp.mem_zone]] From 9c9e07c6507daecca2d6923876340a1d35849925 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 23 Jul 2021 13:49:38 +0800 Subject: [PATCH 188/350] config: kbl: change image_size to the real SRAM size We have 30 bank HP and 2 bank LP SRAM on KBL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/kbl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/kbl.toml b/config/kbl.toml index ac82149fdf1f..48e47cce3a88 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "kbl" machine_id = 6 -image_size = "0x100000" +image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 246ea6469abdc677b7038285654fd64fc387c5f1 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 23 Jul 2021 13:50:35 +0800 Subject: [PATCH 189/350] config: skl: change image_size to the real SRAM size We have 30 bank HP and 2 bank LP SRAM on SKL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/skl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/skl.toml b/config/skl.toml index f304a1849490..7bde4f8c68e8 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "skl" machine_id = 7 -image_size = "0x100000" +image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From d1553e9321a954e597b82dbe91f9387836685020 Mon Sep 17 00:00:00 2001 From: balakishorepati <87635673+balakishorepati@users.noreply.github.com> Date: Mon, 26 Jul 2021 17:06:32 +0530 Subject: [PATCH 190/350] config: add rn toml file to support renoir build Add rn toml file to support sof-rn.ri binary build Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com> Signed-off-by: balapati <balakishore.pati@amd.com> --- config/rn.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/rn.toml diff --git a/config/rn.toml b/config/rn.toml new file mode 100644 index 000000000000..f05902583f37 --- /dev/null +++ b/config/rn.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "rn" +machine_id = 14 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x20000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x21000000" +size = "0xE0000" +host_offset = "0x0" From b28b9939dcd73fa44a00679c95b13b51f3b32c43 Mon Sep 17 00:00:00 2001 From: sunil <sunil-kumar.dommati@amd.com> Date: Mon, 26 Jul 2021 18:51:30 +0530 Subject: [PATCH 191/350] fixing incorrect data offset in ri_manifest_sign_v1_5 --- src/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 0bfb901f4cbb..966ef2222aa6 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -347,7 +347,8 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + /* excluding the manifest header */ + char *const data1 = (char *)man + sizeof(struct fw_image_manifest_v1_5); unsigned const size1 = image->image_end - sizeof(*man); return pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); From 9716e10a3e000aa485b37c8cfd20ce184120809b Mon Sep 17 00:00:00 2001 From: Zhang Peng <peng.zhang_8@nxp.com> Date: Mon, 12 Apr 2021 14:19:04 +0800 Subject: [PATCH 192/350] config: Add imx8ulp.toml Add imx8ulp toml file to support sof-imx8ulp.ri binary build. Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com> --- config/imx8ulp.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 config/imx8ulp.toml diff --git a/config/imx8ulp.toml b/config/imx8ulp.toml new file mode 100644 index 000000000000..ef4c1ad9a02c --- /dev/null +++ b/config/imx8ulp.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8ulp" +machine_id = 15 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x21170000" +size = "0x10000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x21180000" +size = "0x10000" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x1a000000" +size = "0x800000" +host_offset = "0x0" From aea19692251b76c66439e50f81853521a915445c Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Wed, 25 Aug 2021 11:57:41 +0200 Subject: [PATCH 193/350] adsp_config: fix potential overflow in strtol() This patch fixes the potential overflow which may happen during conversion of signed long. On a platforms where signed long is only 32 bits the address which is stored in temp_s will experience overflow. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/adsp_config.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 5b26f4589123..6bbb1273642f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -126,7 +126,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx { toml_raw_t raw; char *temp_s; - int64_t val; + uint32_t val; int ret; /* look for key in given table, assign def value when key not found */ @@ -145,17 +145,15 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *error = err_key_parse(key, NULL); return UINT32_MAX; } - val = strtol(temp_s, 0, 16); + val = strtoul(temp_s, 0, 16); + free(temp_s); /* assert parsing success and value is within uint32_t range */ if (errno < 0) { *error = err_key_parse(key, "can't convert hex value"); return UINT32_MAX; } - if (val < 0 || val > UINT32_MAX) { - *error = log_err(-ERANGE, "key %s out of uint32_t range", key); - return UINT32_MAX; - } + /* set success error code and increment parsed key counter */ *error = 0; ++ctx->key_cnt; From 9bf46d3fe2c69b6831c448be01703f664e17725e Mon Sep 17 00:00:00 2001 From: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Date: Thu, 26 Aug 2021 19:28:16 +0800 Subject: [PATCH 194/350] rimage: Add support for mt8195 Add mt8195.toml to support sof-mt8195.ri binary build. Add mt8195 memory layout Add mt8195 machine_id Signed-off-by: YC Hung <yc.hung@mediatek.com> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> --- config/mt8195.toml | 16 ++++++++++++++++ src/file_simple.c | 26 ++++++++++++++++++++++++++ src/include/rimage/rimage.h | 1 + 3 files changed, 43 insertions(+) create mode 100644 config/mt8195.toml diff --git a/config/mt8195.toml b/config/mt8195.toml new file mode 100644 index 000000000000..e2678bace08d --- /dev/null +++ b/config/mt8195.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "mt8195" +machine_id = 15 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x40000000" +size = "0x00040000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" diff --git a/src/file_simple.c b/src/file_simple.c index 396c24c2bf0d..cd1fa0d27d72 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -48,6 +48,13 @@ #define IMX8M_SRAM_BASE 0x92400000 #define IMX8M_SRAM_SIZE 0x800000 +#define MT8195_IRAM_BASE 0x40000000 +#define MT8195_IRAM_HOST_OFFSET 0x00000 +#define MT8195_IRAM_SIZE 0x4000 +#define MT8195_SRAM_BASE 0x60000000 +#define MT8195_SRAM_SIZE 0x600000 +#define MT8195_SRAM_HOST_OFFSET 0x00000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -532,3 +539,22 @@ const struct adsp machine_imx8m = { .machine_id = MACHINE_IMX8M, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_mt8195= { + .name = "mt8195", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = MT8195_IRAM_BASE, + .size = MT8195_IRAM_SIZE, + .host_offset = MT8195_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = MT8195_SRAM_BASE, + .size = MT8195_SRAM_SIZE, + .host_offset = MT8195_SRAM_HOST_OFFSET, + }, + }, + .machine_id = MACHINE_MT8195, + .write_firmware = simple_write_firmware, +}; + diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 8abb07c514c9..e62adb33d519 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -41,6 +41,7 @@ enum machine_id { MACHINE_IMX8, MACHINE_IMX8X, MACHINE_IMX8M, + MACHINE_MT8195, MACHINE_MAX }; From 916fc2cd73ff95dd4f1c78e5052b7aedb8718b6f Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 11:26:31 +0200 Subject: [PATCH 195/350] config: Remove unused adsp structs After commit 2965908 "manifest: Remove -m option" those structs are unused. ADSP configuration comes from toml configuration files. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/file_simple.c | 178 ------------------------------------ src/include/rimage/rimage.h | 18 ---- 2 files changed, 196 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index cd1fa0d27d72..43aa175c3e70 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -380,181 +380,3 @@ int simple_write_firmware(struct image *image) return 0; } - -const struct adsp machine_byt = { - .name = "byt", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BAYTRAIL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_cht = { - .name = "cht", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_CHERRYTRAIL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_bsw = { - .name = "bsw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BRASWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_hsw = { - .name = "hsw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = HSW_IRAM_BASE, - .size = HSW_IRAM_SIZE, - .host_offset = HSW_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = HSW_DRAM_BASE, - .size = HSW_DRAM_SIZE, - .host_offset = HSW_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_HASWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_bdw = { - .name = "bdw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BDW_IRAM_BASE, - .size = BDW_IRAM_SIZE, - .host_offset = BDW_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BDW_DRAM_BASE, - .size = BDW_DRAM_SIZE, - .host_offset = BDW_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BROADWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8 = { - .name = "imx8", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8_IRAM_BASE, - .size = IMX8_IRAM_SIZE, - .host_offset = IMX8_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8_DRAM_BASE, - .size = IMX8_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8_SRAM_BASE, - .size = IMX8_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8x = { - .name = "imx8x", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8_IRAM_BASE, - .size = IMX8_IRAM_SIZE, - .host_offset = IMX8_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8_DRAM_BASE, - .size = IMX8_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8_SRAM_BASE, - .size = IMX8_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8X, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8m = { - .name = "imx8m", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8M_IRAM_BASE, - .size = IMX8M_IRAM_SIZE, - .host_offset = IMX8M_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8M_DRAM_BASE, - .size = IMX8M_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8M_SRAM_BASE, - .size = IMX8M_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8M, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_mt8195= { - .name = "mt8195", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = MT8195_IRAM_BASE, - .size = MT8195_IRAM_SIZE, - .host_offset = MT8195_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = MT8195_SRAM_BASE, - .size = MT8195_SRAM_SIZE, - .host_offset = MT8195_SRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_MT8195, - .write_firmware = simple_write_firmware, -}; - diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e62adb33d519..75ce5dd8b8c0 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -234,22 +234,4 @@ int elf_read_section(const struct module *module, const char *name, int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); -/* supported machines */ -extern const struct adsp machine_byt; -extern const struct adsp machine_cht; -extern const struct adsp machine_bsw; -extern const struct adsp machine_hsw; -extern const struct adsp machine_bdw; -extern const struct adsp machine_apl; -extern const struct adsp machine_cnl; -extern const struct adsp machine_icl; -extern const struct adsp machine_jsl; -extern const struct adsp machine_tgl; -extern const struct adsp machine_sue; -extern const struct adsp machine_skl; -extern const struct adsp machine_kbl; -extern const struct adsp machine_imx8; -extern const struct adsp machine_imx8x; -extern const struct adsp machine_imx8m; - #endif From c4a74562544603197d644ebb35f82f2248b1b411 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 12:37:51 +0200 Subject: [PATCH 196/350] config: Remove machine_id field This enum value is used only to distinguish suecreek from other platforms, which can be done also by platform name. Manual enumeration, in separate toml files with manual synchronization in enum definition is quite error prone. After commit 9bf46d3: "rimage: Add support for mt8195" and 9716e10: "config: Add imx8ulp.toml" there are two different platform with the same enum value 15 specified, which proves such a thesis. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- config/apl.toml | 1 - config/bdw.toml | 1 - config/bsw.toml | 1 - config/byt.toml | 1 - config/cht.toml | 1 - config/cnl.toml | 1 - config/hsw.toml | 1 - config/icl.toml | 1 - config/imx8.toml | 1 - config/imx8m.toml | 1 - config/imx8ulp.toml | 1 - config/imx8x.toml | 1 - config/jsl.toml | 1 - config/kbl.toml | 1 - config/mt8195.toml | 1 - config/rn.toml | 1 - config/skl.toml | 1 - config/sue.toml | 1 - config/tgl-cavs.toml | 1 - config/tgl-h.toml | 1 - config/tgl.toml | 1 - src/adsp_config.c | 8 ++------ src/include/rimage/rimage.h | 22 ---------------------- 23 files changed, 2 insertions(+), 49 deletions(-) diff --git a/config/apl.toml b/config/apl.toml index 9751623a2114..fafd01853da7 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "apl" -machine_id = 5 image_size = "0x0A0000" # (8 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/bdw.toml b/config/bdw.toml index 6cc2402a198b..6b642fcd882e 100644 --- a/config/bdw.toml +++ b/config/bdw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "bdw" -machine_id = 4 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/bsw.toml b/config/bsw.toml index 77f2e5c3987f..6746ca6cff34 100644 --- a/config/bsw.toml +++ b/config/bsw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "bsw" -machine_id = 2 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/byt.toml b/config/byt.toml index 8c2f27851d3e..4afd1c0dd523 100644 --- a/config/byt.toml +++ b/config/byt.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "byt" -machine_id = 0 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/cht.toml b/config/cht.toml index 7cc9142716fe..2ed88370d16a 100644 --- a/config/cht.toml +++ b/config/cht.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "cht" -machine_id = 1 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/cnl.toml b/config/cnl.toml index 88b6d42e3099..fae7fe80c6d1 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "cnl" -machine_id = 8 image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/hsw.toml b/config/hsw.toml index df5e5cec189f..2f96a675b89d 100644 --- a/config/hsw.toml +++ b/config/hsw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "hsw" -machine_id = 3 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/icl.toml b/config/icl.toml index 6b4dfa730748..20ba7765fc56 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "icl" -machine_id = 9 image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/imx8.toml b/config/imx8.toml index 69207806c8df..865be902e840 100644 --- a/config/imx8.toml +++ b/config/imx8.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8" -machine_id = 12 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8m.toml b/config/imx8m.toml index 5630d94d1bea..5b7ba20870bd 100644 --- a/config/imx8m.toml +++ b/config/imx8m.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8m" -machine_id = 14 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8ulp.toml b/config/imx8ulp.toml index ef4c1ad9a02c..7fd4c16a52f3 100644 --- a/config/imx8ulp.toml +++ b/config/imx8ulp.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8ulp" -machine_id = 15 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8x.toml b/config/imx8x.toml index eb4d579103db..ea9059c174ae 100644 --- a/config/imx8x.toml +++ b/config/imx8x.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8x" -machine_id = 13 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/jsl.toml b/config/jsl.toml index cd40317b6041..a501066a2531 100644 --- a/config/jsl.toml +++ b/config/jsl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "icl" -machine_id = 9 image_size = "0x110000" # (16 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/kbl.toml b/config/kbl.toml index 48e47cce3a88..442c886b99ec 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "kbl" -machine_id = 6 image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/mt8195.toml b/config/mt8195.toml index e2678bace08d..5c8abc92557a 100644 --- a/config/mt8195.toml +++ b/config/mt8195.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "mt8195" -machine_id = 15 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/rn.toml b/config/rn.toml index f05902583f37..d4e0b34b685c 100644 --- a/config/rn.toml +++ b/config/rn.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "rn" -machine_id = 14 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/skl.toml b/config/skl.toml index 7bde4f8c68e8..a907a121d74c 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "skl" -machine_id = 7 image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/sue.toml b/config/sue.toml index c0c4a01fa898..bcf093c70fc3 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "sue" -machine_id = 11 image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8f5316fbb093..62448e347d73 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x2F0000" [[adsp.mem_zone]] diff --git a/config/tgl-h.toml b/config/tgl-h.toml index b6653b2b7afd..908c3bfc8a1f 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x1F0000" # (30 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/tgl.toml b/config/tgl.toml index a095b33c59da..d6183faf5345 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x2F0000" # (46 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/src/adsp_config.c b/src/adsp_config.c index 6bbb1273642f..6d0346f5a16b 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -287,7 +287,6 @@ static void dump_adsp(const struct adsp *adsp) DUMP("\nadsp"); DUMP_KEY("name", "'%s'", adsp->name); - DUMP_KEY("machine_id", "%d", adsp->machine_id); DUMP_KEY("image_size", "0x%x", adsp->image_size); DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); @@ -333,10 +332,6 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return err_key_parse("name", NULL); - out->machine_id = parse_uint32_key(adsp, &ctx, "machine_id", -1, &ret); - if (ret < 0) - return ret; - out->image_size = parse_uint32_hex_key(adsp, &ctx, "image_size", 0, &ret); if (ret < 0) return ret; @@ -2110,7 +2105,8 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("adsp", NULL); - if (out->machine_id == MACHINE_SUECREEK) { + /* suecreek has dedicated manifest file */ + if (!strcmp(out->name, "sue")) { /* out free is done in client code */ out->man_v1_5_sue = malloc(sizeof(struct fw_image_manifest_v1_5_sue)); if (!out->man_v1_5_sue) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 75ce5dd8b8c0..dc25eb037101 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -24,27 +24,6 @@ struct adsp; struct manifest; struct man_module; -/* list of supported targets */ -enum machine_id { - MACHINE_BAYTRAIL = 0, - MACHINE_CHERRYTRAIL, - MACHINE_BRASWELL, - MACHINE_HASWELL, - MACHINE_BROADWELL, - MACHINE_APOLLOLAKE, - MACHINE_KABYLAKE, - MACHINE_SKYLAKE, - MACHINE_CANNONLAKE, - MACHINE_ICELAKE, - MACHINE_TIGERLAKE, - MACHINE_SUECREEK, - MACHINE_IMX8, - MACHINE_IMX8X, - MACHINE_IMX8M, - MACHINE_MT8195, - MACHINE_MAX -}; - /* * ELF module data */ @@ -171,7 +150,6 @@ struct adsp { uint32_t image_size; uint32_t dram_offset; - enum machine_id machine_id; int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From de9177b841255816f501f8ffc4853775bbeb9696 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@intel.com> Date: Tue, 31 Aug 2021 11:14:01 +0200 Subject: [PATCH 197/350] config: Adjust return type with function name Function with `parse_uint32` should return uint32_t value Signed-off-by: Karol Trzcinski <karolx.trzcinski@intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6d0346f5a16b..8af6c911ac9f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -169,8 +169,8 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx * @param error code, 0 when success * @return default, parsed, or UINT32_MAX value */ -static int parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - int64_t def, int *error) +static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) { toml_raw_t raw; int64_t val; From ada30c15b5d365d621125c4b4419a8ae7fb6342f Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 18:13:53 +0200 Subject: [PATCH 198/350] config: Explicit state return value for error cases in parse_uint32_* functions Developer should know what is ther return value for error cases. Improved doxydoc may be used eg. by IDE to speed-up code development. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8af6c911ac9f..9cd3805a40e9 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -119,7 +119,7 @@ static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx * @param key field name * @param def is default value or -1 when value don't have default value * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value + * @return default, parsed, or UINT32_MAX value for error cases */ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, int64_t def, int *error) @@ -167,7 +167,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx * @param key field name * @param def is default value or -1 when value don't have default value * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value + * @return default, parsed, or UINT32_MAX value for error cases */ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, int64_t def, int *error) From 3e20076f979830e7bdf615bad7d3643680cf7398 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 18:10:04 +0200 Subject: [PATCH 199/350] config: Return error value in parse_uint32_* functions when key is not found Return value, for error case should be unified. For those functions, default error value is UINT32_MAX. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index 9cd3805a40e9..c97817716921 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -134,6 +134,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx if (!raw) { if (def < 0 || def > UINT32_MAX) { *error = err_key_not_found(key); + return UINT32_MAX; } else { *error = 0; return (uint32_t)def; @@ -181,6 +182,7 @@ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ct if (!raw) { if (def < 0 || def > UINT32_MAX) { *error = err_key_not_found(key); + return UINT32_MAX; } else { *error = 0; return (uint32_t)def; From fc4d7b8519e4ca3c7cf9eb51e6ab2d8ac6ada988 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 1 Sep 2021 08:33:33 +0200 Subject: [PATCH 200/350] rimage: Fix error message content after adsp malloc fail Message should reflect error root cause. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index c74c462401c7..b0fc9cd4dcfb 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) /* find machine */ heap_adsp = malloc(sizeof(struct adsp)); if (!heap_adsp) { - fprintf(stderr, "error: cannot parse build version\n"); + fprintf(stderr, "error: memory allocation for adsp struct failed\n"); return -ENOMEM; } image.adsp = heap_adsp; From dcfcef80cbd454eb33fdeaae2f8b600e0693238c Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 1 Sep 2021 08:19:22 +0200 Subject: [PATCH 201/350] config: Remove unused, platform specific, memory region definitions After commit 916fc2cd73ff: "config: Remove unused adsp structs" those defines are unused. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/file_simple.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index 43aa175c3e70..3c344968e00d 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -11,50 +11,6 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> -#define BYT_IRAM_BASE 0xff2c0000 -#define BYT_IRAM_HOST_OFFSET 0x0C0000 -#define BYT_IRAM_SIZE (80 * 1024) -#define BYT_DRAM_BASE 0xff300000 -#define BYT_DRAM_HOST_OFFSET 0x100000 -#define BYT_DRAM_SIZE (160 * 1024) - -#define HSW_IRAM_BASE 0x00000000 -#define HSW_IRAM_HOST_OFFSET 0x00080000 -#define HSW_IRAM_SIZE (384 * 1024) -#define HSW_DRAM_BASE 0x00400000 -#define HSW_DRAM_HOST_OFFSET 0x00000000 -#define HSW_DRAM_SIZE (512 * 1024) - -#define BDW_IRAM_BASE 0x00000000 -#define BDW_IRAM_HOST_OFFSET 0x000A0000 -#define BDW_IRAM_SIZE (320 * 1024) -#define BDW_DRAM_BASE 0x00400000 -#define BDW_DRAM_HOST_OFFSET 0x00000000 -#define BDW_DRAM_SIZE (640 * 1024) - -#define IMX8_IRAM_BASE 0x596f8000 -#define IMX8_IRAM_HOST_OFFSET 0x10000 -#define IMX8_IRAM_SIZE 0x800 -#define IMX8_DRAM_BASE 0x596e8000 -#define IMX8_DRAM_SIZE 0x8000 -#define IMX8_SRAM_BASE 0x92400000 -#define IMX8_SRAM_SIZE 0x800000 - -#define IMX8M_IRAM_BASE 0x3b6f8000 -#define IMX8M_IRAM_HOST_OFFSET 0x10000 -#define IMX8M_IRAM_SIZE 0x800 -#define IMX8M_DRAM_BASE 0x3b6e8000 -#define IMX8M_DRAM_SIZE 0x8000 -#define IMX8M_SRAM_BASE 0x92400000 -#define IMX8M_SRAM_SIZE 0x800000 - -#define MT8195_IRAM_BASE 0x40000000 -#define MT8195_IRAM_HOST_OFFSET 0x00000 -#define MT8195_IRAM_SIZE 0x4000 -#define MT8195_SRAM_BASE 0x60000000 -#define MT8195_SRAM_SIZE 0x600000 -#define MT8195_SRAM_HOST_OFFSET 0x00000 - static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; From 4823e87f29d96f95704e2334fc2fa7b65c09a5fa Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 2 Sep 2021 21:27:43 +0000 Subject: [PATCH 202/350] pkcs: quote the name of key file when logging it This makes is more obvious when the filename is empty, which happened in bug https://github.com/thesofproject/sof/pull/4711 Also prefix identical log statements with their different __func__ names. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 966ef2222aa6..9b23a54db1a7 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -92,7 +92,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", @@ -187,7 +187,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", @@ -281,7 +281,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", From 241af313dab49db06d6e6f0af3330f1a916de664 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Sat, 11 Sep 2021 19:22:25 +0200 Subject: [PATCH 203/350] ext_manifest: Fix incorrect signature This patch changes the incorrect signature of extended manifest to the correct one "$AE1" Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/include/rimage/sof/kernel/ext_manifest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h index 7d9b77735a11..e415d486fafb 100644 --- a/src/include/rimage/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -33,8 +33,8 @@ #define __packed __attribute__((packed)) #endif -/* In ASCII `XMan` */ -#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 +/* In ASCII `$AE1` */ +#define EXT_MAN_MAGIC_NUMBER 0x31454124 /* Build u32 number in format MMmmmppp */ #define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ From a9faf85fe50fb01c7aa6d86607142ed5c60936c8 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Tue, 14 Sep 2021 09:12:49 +0200 Subject: [PATCH 204/350] remove '-x' option This patch removes the unnecessary and unscalable -x option. This option aims to add an offset to the .data section of its parent .module section. This is horrible idea because this offset will vary depend on the compiler used. It is better and much easier to just store only the .data section so the offset is always 0. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/include/rimage/rimage.h | 1 - src/manifest.c | 7 +------ src/rimage.c | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index dc25eb037101..e6d38ebedb10 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -84,7 +84,6 @@ struct image { struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; - int xcc_mod_offset; const char *verify_file; /* SHA 256 & 384 */ diff --git a/src/manifest.c b/src/manifest.c index f29355b66dbf..1bf10d9b60a6 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -264,12 +264,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, section = &module->section[man_section_idx]; /* load in manifest data */ - /* module built using xcc has preceding bytes */ - if (section->size > sizeof(sof_mod)) - ret = fseek(module->fd, - section->off + image->xcc_mod_offset, SEEK_SET); - else - ret = fseek(module->fd, section->off, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); diff --git a/src/rimage.c b/src/rimage.c index b0fc9cd4dcfb..e30a4092ab2f 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,7 +26,6 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); - fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); @@ -45,8 +44,6 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { switch (opt) { case 'o': @@ -70,9 +67,6 @@ int main(int argc, char *argv[]) case 'i': imr_type = atoi(optarg); break; - case 'x': - image.xcc_mod_offset = atoi(optarg); - break; case 'f': image.fw_ver_string = optarg; break; From 6e22944e05ea7c6d6c2b61e9632bdbf017644323 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 16 Sep 2021 23:09:29 +0000 Subject: [PATCH 205/350] README.md: explain how to run SOF tests on new rimage code Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/README.md b/README.md index 8118edeaaf4b..f8d099e0bf1a 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,77 @@ $ make -C build/ help # lists all targets $ make -C build/ $ sudo make -C build/ install # optional ``` + +## Testing rimage changes with SOF Continuous Integration + +This section is about leveraging SOF validation to test rimage changes +_before_ submitting them to the rimage repository. + +Nothing here is actually specific to SOF and rimage; you can apply the +same test logic to any submodule and parent on Github. In fact the same +logic applies to submodule alternatives. Github is the only requirement. + +### Get familiar with git submodules + +This is unfortunately not optional for SOF and rimage. + +For various reasons submodules seem to confuse many git users. Maybe +because the versions of the submodules are not directly visible in some +configuration file like with most alternatives? Either way, an +unfortunate prerequisite before doing any rimage work is to get familiar +with git submodules in general. As submodules are built-in there are +many resources about them on the Internet. One possible starting point +is https://git-scm.com/book/en/v2/Git-Tools-Submodules but feel free +to use any other good tutorial instead. Make sure you actually practice +a tutorial; don't just read it. Practicing on a temporary and throw-away +copy of SOF + rimage is a great idea. + +Obviously, you also need to be familiar with regular Github pull +requests. + +### Run SOF tests on unmerged rimage commits + +First, push the rimage commits you want to be tested to any branch of +your rimage fork on Github. Do _not_ submit an rimage pull request yet. + +Then, **pretend** these rimage commits have already been accepted and +merged (they have been neither) and submit to SOF a draft pull request +that updates the main SOF branch with your brand new rimage commits to +test. The only SOF commit in this SOF TEST pull request is an SOF commit +that updates the rimage pointer to the SHA of your last rimage +commit. If you're not sure how to do this then you must go back to the +previous section and practice submodules more. + +Submit this SOF pull request as a Github _draft_ so reviewers are _not_ +notified. Starting every pull request as a draft is always a good idea +but in this case this particular SOF pull request can be especially +confusing because it points at commits in a different repo and commits +that are not merged yet. So you _really_ don't want to bother busy +reviewers (here's a secret: some of the reviewers don't like submodules +either). You can freely switch back and forth between draft and ready +status and should indeed switch to draft if you forgot at submission +time but you can never "un-notify" reviewers. + +Github has very good support for submodules and will display your SOF +TEST pull request better than what the git command line can show. For +instance Github will list your rimage changes directly in the SOF Pull +Request. So if something looks unexpected on Github then it means you +did something wrong. Stop immediately (except for switching to draft if +you forgot) and ask the closest git guru for help. + +Search for "Submodule" in the build logs and make sure the last of your +new rimage commits has been checked out. + +Iterate and force-push your rimage branch and your SOF TEST pull request +until all the SOF tests pass. Then you can submit your rimage pull +request as usual. In the comments section of the rimage pull request, +point at your test results on the SOF side to impress the rimage +reviewers and get your rimage changes merged faster. + +Finally, after your rimage changes have been merged, you can if you want +submit one final SOF pull request that points to the final rimage +SHA. Or, if your rimage change is not urgently needed, you can just wait +for someone else to do it later. If you do it, copy the rimage git log +--oneline in the SOF commit message. Find some good (and less good) +rimage commit message examples at +https://github.com/thesofproject/sof/commits/main/rimage From 0d7f2d4a3428b10cdadd3f30d0bb335a8a2cf824 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 16 Sep 2021 22:44:19 +0000 Subject: [PATCH 206/350] Do not exit(0) on invalid options or parameters When some automation script gets some rimage flag wrong then rimage exits and does not run at all. In such a case we want the build to fail immediately and see the error at the bottom of the build logs and not obscured by other, consecutive failures caused by the lack of rimage output. Take control of the exit code away from usage() and give it back to main() where it belongs. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index e30a4092ab2f..507911ca469d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,7 +30,6 @@ static void usage(char *name) fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); - exit(0); } int main(int argc, char *argv[]) @@ -84,10 +83,10 @@ int main(int argc, char *argv[]) break; case 'h': usage(argv[0]); - break; + return 0; default: /* getopt's default error message is good enough */ - break; + return 1; } } @@ -95,8 +94,9 @@ int main(int argc, char *argv[]) /* we must have config */ if (!adsp_config) { - fprintf(stderr, "error: must have adsp desc"); usage(argv[0]); + fprintf(stderr, "error: must have adsp desc\n"); + return -EINVAL; } /* requires private key */ @@ -105,10 +105,11 @@ int main(int argc, char *argv[]) return -EINVAL; } - /* make sure we have an outfile if nt verifying */ - if ((!image.out_file && !image.verify_file)) + /* make sure we have an outfile if not verifying */ + if ((!image.out_file && !image.verify_file)) { usage(argv[0]); - + return -EINVAL; + } /* firmware version and build id */ if (image.fw_ver_string) { From 89600974030fcbca903894c327c3c64afcede14d Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 17 Sep 2021 17:11:08 +0000 Subject: [PATCH 207/350] Revert "ext_manifest: Fix incorrect signature" This reverts commit 241af313dab49db06d6e6f0af3330f1a916de664 so the DSP can boot again. On my APL UP2 this fixes: 10:06:38: 00:0e.0: unstall/run core: core_mask = 1 10:06:38: 00:0e.0: DSP core(s) enabled? 1 : core_mask 1 10:06:38: 00:0e.0: FW Poll Status: reg[0x4c]=0x40000000 successful 10:06:38: 00:0e.0: FW Poll Status: reg[0x4]=0x3030202 successful 10:06:38: 00:0e.0: FW Poll Status: reg[0x4]=0x1010202 successful 10:06:38: 00:0e.0: DSP core(s) enabled? 0 : core_mask 2 10:06:38: 00:0e.0: FW Poll Status: reg[0x80000]=0x5000001 successful 10:06:41: 00:0e.0: FW Poll Status: reg[0x80000]=0x80000007 timedout 10:06:41: 00:0e.0: error: cl_copy_fw: timeout HDA_DSP_SRAM_REG_ROM_STATUS read 10:06:41: 00:0e.0: FW Poll Status: reg[0x160]=0x140000 successful 10:06:41: 00:0e.0: ------------[ DSP dump start ]------------ 10:06:41: 00:0e.0: unknown ROM status value 80000007 10:06:41: 00:0e.0: error: extended rom status: 0x80000007 0x2f 0x0 0x0 \ 0x0 0x0 0x1522100 0x0 10:06:41: 00:0e.0: ------------[ DSP dump end ]------------ 10:06:41: 00:0e.0: error: load fw failed ret: -110 10:06:41: 00:0e.0: error: failed to start DSP 10:06:41: 00:0e.0: error: failed to boot DSP firmware -110 10:06:41: 00:0e.0: FW Poll Status: reg[0x4]=0x1d003c timedout 10:06:41: 00:0e.0: error: hda_dsp_core_reset_enter: timeout on \ HDA_DSP_REG_ADSPCS read 10:06:41: 00:0e.0: error: dsp core reset failed: core_mask 3 10:06:41: probe of 0000:00:0e.0 failed with error -110 Test PR https://github.com/thesofproject/sof/pull/4782 show this commit broke the DSP boot on ALL platforms https://sof-ci.01.org/sofpr/PR4782/build10387/devicetest/ ``` [ 7.798750] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: invalid firmware signature [ 7.798827] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: invalid FW header [ 7.798943] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: failed to load DSP firmware -22 [ 7.810348] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: sof_probe_work failed err: -22 ``` This also broke QEMU boot on a number of platforms: BDW, BYT and CHT, see `error: invalid firmware signature` in https://sof-ci.01.org/sofpr/PR4782/build10387/boottest/ and https://github.com/thesofproject/sof/pull/4782/checks?check_run_id=3634915322 How was it tested? Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/include/rimage/sof/kernel/ext_manifest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h index e415d486fafb..7d9b77735a11 100644 --- a/src/include/rimage/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -33,8 +33,8 @@ #define __packed __attribute__((packed)) #endif -/* In ASCII `$AE1` */ -#define EXT_MAN_MAGIC_NUMBER 0x31454124 +/* In ASCII `XMan` */ +#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 /* Build u32 number in format MMmmmppp */ #define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ From c038d628048bae44040a0f86be17f101c0037570 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 21 Sep 2021 20:37:47 +0000 Subject: [PATCH 208/350] README.md: add warning that forks must be created using Github Otherwise the SHA1 is not found and the rest of the process fails. Problem discovered in https://github.com/thesofproject/sof/pull/4790#discussion_r713326709 Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8d099e0bf1a..de6556334468 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ to generate binary image files. ## Building -The `rimage` tool can be built with the usual CMake commands: +Most users don't build `rimage` directly but as an ExternalProject +defined by CMake in SOF. This being said, `rimage` can be built with the +usual CMake commands: ```shell $ cmake -B build/ @@ -48,6 +50,12 @@ requests. First, push the rimage commits you want to be tested to any branch of your rimage fork on Github. Do _not_ submit an rimage pull request yet. +Note your rimage fork must have been created using the actual "fork" +button on Github so Github is aware of the connection with the upstream +rimage repo. In the top-left corner you should see `forked from +thesofproject/rimage` under the name of your fork. If not then search +the Internet for "re-attach detached github fork". + Then, **pretend** these rimage commits have already been accepted and merged (they have been neither) and submit to SOF a draft pull request that updates the main SOF branch with your brand new rimage commits to From 0c66aa912226c4e7b9151e50a5e3a9b6abc29117 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 4 Oct 2021 18:27:30 +0000 Subject: [PATCH 209/350] css.c: add __func__ to "completing manifest" log This is useful to show which one of the 3 duplicated functions runs. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/css.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/css.c b/src/css.c index c86148b89015..92f6ea89fd93 100644 --- a/src/css.c +++ b/src/css.c @@ -19,7 +19,7 @@ void ri_css_v2_5_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); @@ -76,7 +76,7 @@ void ri_css_v1_8_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); @@ -133,7 +133,7 @@ void ri_css_v1_5_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); From ecb921227e88a8797bf2f2719bcc99411b32323f Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sun, 24 Oct 2021 08:04:42 +0000 Subject: [PATCH 210/350] cmake: drop '3' from -Wimplicit-fallthrough=3, it's the default value From the gcc documentation: '-Wimplicit-fallthrough' '-Wimplicit-fallthrough' is the same as '-Wimplicit-fallthrough=3' and '-Wno-implicit-fallthrough' is the same as '-Wimplicit-fallthrough=0'. clang supports only the number-less option. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b09760007629..29bbb456e17b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 + -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough ) target_link_libraries(rimage PRIVATE "-lcrypto") From bcbcec79e5824d04f5eadde2f53d817fce939b19 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sun, 24 Oct 2021 08:08:08 +0000 Subject: [PATCH 211/350] cmake: drop binutils-specific '-Wl,-EL' option Fixes clang failure: clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument] -EL has an effect only when using OUTPUT_FORMAT or --oformat but rimage uses neither. The binaries produced by ld version 2.34 are strictly identical before and after this removal. It is not clear why -EL was ever added. It was added to src/Makefile.am by commit 0d33e8743386 and to src/CMakeLists.txt by commit 4e3ead009638 but these commits were initial additions of the entire files and they did not get into detail. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29bbb456e17b..056a92217474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough + -Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough ) target_link_libraries(rimage PRIVATE "-lcrypto") From bd51ec1aef445d8f3962d9c0cb28112717cfcc7d Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Tue, 16 Nov 2021 09:50:21 +0200 Subject: [PATCH 212/350] rimage: add functionality to resign fw image Add function to resign already signed images. This can be done with switch "q" as follows: "rimage -q sof-tgl.ri -o sof-tgl-mod.ri -c tgl.toml -k key.pem" Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/include/rimage/rimage.h | 4 ++ src/manifest.c | 124 ++++++++++++++++++++++++++++++++++++ src/pkcs1_5.c | 35 ++++++++++ src/rimage.c | 11 +++- 4 files changed, 173 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e6d38ebedb10..e5b918e3c600 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -73,6 +73,7 @@ struct module { struct image { const char *out_file; + const char *in_file; FILE *out_fd; void *pos; @@ -201,6 +202,9 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int resign_image(struct image *image); +int get_key_size(struct image *image); + int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); diff --git a/src/manifest.c b/src/manifest.c index 1bf10d9b60a6..e682503b179b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1427,3 +1427,127 @@ int verify_image(struct image *image) fclose(in_file); return 0; } + + +int resign_image(struct image *image) +{ + int key_size, key_file_size; + size_t size, read; + FILE *in_file; + void *buffer; + int ret, i; + + /* open image for reading */ + in_file = fopen(image->in_file, "rb"); + if (!in_file) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + image->in_file, errno); + return -errno; + } + + /* get file size */ + ret = fseek(in_file, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s for reading %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + size = ftell(in_file); + if (size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + ret = fseek(in_file, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek %s for reading %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + /* allocate buffer for parsing */ + buffer = malloc(size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* read file into buffer */ + read = fread(buffer, 1, size, in_file); + if (read != size) { + fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + size, image->in_file, errno); + ret = errno; + goto out; + } + + fclose(in_file); + + for (i = 0; i < size; i += sizeof(uint32_t)) { + /* find CSE header marker "$CPD" */ + if (*(uint32_t *)(buffer + i) == CSE_HEADER_MAKER) { + image->fw_image = buffer + i; + break; + } + } + + if (i >= size) { + fprintf(stderr, "error: didn't found header marker %d\n", i); + ret = -EINVAL; + goto out; + } + + image->image_end = size; + + /* check that key size matches */ + if (image->adsp->man_v2_5) { + key_size = 384; + } else { + key_size = 256; + } + + key_file_size = get_key_size(image); + + if (key_file_size > key_size) { + fprintf(stderr, "error: key size %d is longer than original key %d\n", + key_file_size, key_size); + ret = -EINVAL; + goto out; + } + + /* resign */ + if (image->adsp->man_v1_5) + ret = ri_manifest_sign_v1_5(image); + else if (image->adsp->man_v1_8) + ret = ri_manifest_sign_v1_8(image); + else if (image->adsp->man_v2_5) + ret = ri_manifest_sign_v2_5(image); + else + ret = -EINVAL; + + if (ret < 0) { + fprintf(stderr, "error: unable to sign image\n"); + goto out; + } + + /* open outfile for writing */ + unlink(image->out_file); + image->out_fd = fopen(image->out_file, "wb"); + if (!image->out_fd) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_file, errno); + ret = -EINVAL; + goto out; + } + + man_write_fw_mod(image); + +out: + free(buffer); + return ret; +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 9b23a54db1a7..c4be1856ea2e 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -694,3 +694,38 @@ int ri_manifest_verify_v2_5(struct image *image) return pkcs_v1_5_verify_man_v2_5(image, man, data1, size1, data2, size2); } + +int get_key_size(struct image *image) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + int key_length; + char path[256]; + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + key_length = RSA_size(priv_rsa); + + RSA_free(priv_rsa); + EVP_PKEY_free(privkey); + + return key_length; +} diff --git a/src/rimage.c b/src/rimage.c index 507911ca469d..67710d9f360e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); + fprintf(stdout, "\t -q resign binary\n"); } int main(int argc, char *argv[]) @@ -43,7 +44,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:q:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -84,6 +85,9 @@ int main(int argc, char *argv[]) case 'h': usage(argv[0]); return 0; + case 'q': + image.in_file = optarg; + break; default: /* getopt's default error message is good enough */ return 1; @@ -152,6 +156,11 @@ int main(int argc, char *argv[]) goto out; } + if (image.in_file) { + fprintf(stdout, "going to re-sign\n"); + return resign_image(&image); + } + /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; From 3c232422a7389c04171b38caf8263c192f9b6760 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 24 Nov 2021 15:34:46 +0200 Subject: [PATCH 213/350] rimage: refactor and add openssl 3.0 support Refactor the signing and verification functions as they have a lot of duplicated code and adding openssl 3.0 support without refactor would make things even more messy. 1) Add common "rimage_read_key" to read the key from file. 2) Variate most important functionality based on different openssl versions: - rimage_check_key - rimage_set_modexp - rimage_sign - rimage_verify - rimage_get_key_size Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/pkcs1_5.c | 740 +++++++++++++++++++++++++++++++------------------- 1 file changed, 465 insertions(+), 275 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index c4be1856ea2e..0d704e96b3de 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -13,6 +13,9 @@ #include <openssl/sha.h> #include <openssl/objects.h> #include <openssl/bn.h> +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +#include <openssl/core_names.h> +#endif #include <stdio.h> #include <errno.h> #include <string.h> @@ -21,24 +24,14 @@ #include <rimage/css.h> #include <rimage/manifest.h> -#if OPENSSL_VERSION_NUMBER < 0x10100000L -void RSA_get0_key(const RSA *r, - const BIGNUM **n, const BIGNUM **e, const BIGNUM **d); - -void RSA_get0_key(const RSA *r, - const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) -{ - if (n) - *n = r->n; - if (e) - *e = r->e; - if (d) - *d = r->d; -} -#endif - #define DEBUG_PKCS 0 +enum manver { + V15 = 0, + V18 = 1, + V25 = 2 +}; + static void bytes_swap(uint8_t *ptr, uint32_t size) { uint8_t tmp; @@ -51,60 +44,423 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) } } -/* - * RSA signature of manifest. The signature is an PKCS - * #1-v1_5 of the entire manifest structure, including all - * extensions, and excluding the last 3 fields of the - * manifest header (Public Key, Exponent and Signature). - */ - -int pkcs_v1_5_sign_man_v1_5(struct image *image, - struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1) +static int rimage_read_key(EVP_PKEY **privkey, struct image *image) { - RSA *priv_rsa = NULL; - EVP_PKEY *privkey; - FILE *fp; - - const BIGNUM *n, *e, *d; - unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; - int ret = -EINVAL, i; - -#if DEBUG_PKCS - fprintf(stdout, "offsets 0x%lx size 0x%x\n", - ptr1 - (void *)man, size1); -#endif + FILE *fp; /* requires private key */ if (!image->key_name) { + fprintf(stderr, "error: no private key set \n"); return -EINVAL; } /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) + *privkey = EVP_PKEY_new(); + if (!(*privkey)) return -ENOMEM; /* load in RSA private key from PEM file */ memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); + fprintf(stdout, " %s: read key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); return -errno; } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + PEM_read_PrivateKey(fp, privkey, NULL, NULL); fclose(fp); - /* validate RSA private key */ + return 0; +} + +/* + * Here we have different implementations of following functionality + * (based on different openssl versions): + * + * rimage_check_key + * + * rimage_set_modexp + * + * rimage_sign + * + * rimage_verify + * + * rimage_get_key_size + * +*/ + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_check_key(EVP_PKEY *privkey) +{ + RSA *priv_rsa = NULL; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + return RSA_check_key(priv_rsa); +} +#else +static int rimage_check_key(EVP_PKEY *privkey) +{ + EVP_PKEY_CTX *ctx; + int ret = 0; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -EINVAL; + + ret = EVP_PKEY_private_check(ctx); + + EVP_PKEY_CTX_free(ctx); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + const BIGNUM *n; + const BIGNUM *e; + const BIGNUM *d; + + *n = r->n; + *e = r->e; + *d = r->d; + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#elif OPENSSL_VERSION_NUMBER < 0x30000000L +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + const BIGNUM *n; + const BIGNUM *e; + const BIGNUM *d; + RSA *priv_rsa = NULL; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + RSA_get0_key(priv_rsa, &n, &e, &d); + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#else +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + BIGNUM *n = NULL; + BIGNUM *e = NULL; + + EVP_PKEY_get_bn_param(privkey, OSSL_PKEY_PARAM_RSA_N, &n); + EVP_PKEY_get_bn_param(privkey, OSSL_PKEY_PARAM_RSA_E, &e); + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + RSA *priv_rsa = NULL; + int ret; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + signature, &siglen, priv_rsa); + break; + case V25: + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, + /* salt length */ 32); + if (ret > 0) + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, signature, priv_rsa, + RSA_NO_PADDING); + break; + default: + return -EINVAL; + } + + return ret; +} +#else +static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx2 = NULL; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + size_t siglen = MAN_RSA_SIGNATURE_LEN; + size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; + size_t sig_out = MAN_RSA_SIGNATURE_LEN_2_5; + int ret; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_sign_init(ctx); + if (ret <= 0) + goto out; + + if (ver == V25) { + ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); + if (ret <= 0) { + fprintf(stderr, "error: failed to set rsa padding\n"); + goto out; + } + + ret = EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, 32); + if (ret <= 0) { + fprintf(stderr, "error: failed to set saltlen\n"); + goto out; + } + + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature\n"); + goto out; + } + + ret = EVP_PKEY_sign(ctx, sig, &sig_in, digest, SHA384_DIGEST_LENGTH); + if (ret <= 0) { + fprintf(stderr, "error: failed to sign manifest\n"); + goto out; + } + + /* encryption done with different context */ + ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_encrypt_init(ctx2); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); + if (ret <= 0) { + fprintf(stderr, "error: failed to set 0 padding \n"); + goto out; + } + + ret = EVP_PKEY_encrypt(ctx2, signature, &sig_out, sig, sig_in); + if (ret <= 0) + fprintf(stderr, "error: failed to encrypt signature\n"); + } + else { + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature\n"); + goto out; + } + + ret = EVP_PKEY_sign(ctx, signature, &siglen, digest, SHA256_DIGEST_LENGTH); + if (ret <= 0) + fprintf(stderr, "error: failed to sign manifest\n"); + } + +out: + EVP_PKEY_CTX_free(ctx); + if (ctx2) + EVP_PKEY_CTX_free(ctx2); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + RSA *priv_rsa = NULL; + char err_buf[256]; + int ret; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, signature, siglen, + priv_rsa); + + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + break; + case V25: + /* decrypt signature */ + ret = RSA_public_decrypt(RSA_size(priv_rsa), signature, sig, priv_rsa, + RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify decrypt %s\n", err_buf); + return ret; + } + + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + break; + default: + return -EINVAL; + } + + return ret; +} +#else +static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx2 = NULL; + size_t siglen = MAN_RSA_SIGNATURE_LEN; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; + char err_buf[256]; + int ret; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_verify_init(ctx); + if (ret <= 0) + goto out; + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set signature %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_verify(ctx, signature, siglen, digest, SHA256_DIGEST_LENGTH); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + case V25: + ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + if (ret <= 0) + goto out; + + /* decrypt signature */ + ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_decrypt_init(ctx2); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set padding %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_decrypt(ctx2, sig, &siglen25, signature, siglen25); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: decrypt %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_verify(ctx, sig, siglen25, digest, SHA384_DIGEST_LENGTH); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + default: + return -EINVAL; + } + +out: + EVP_PKEY_CTX_free(ctx); + if (ctx2) + EVP_PKEY_CTX_free(ctx2); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_get_key_size(EVP_PKEY *privkey) +{ + RSA *priv_rsa = NULL; + int key_length; + priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + key_length = RSA_size(priv_rsa); + + RSA_free(priv_rsa); + + return key_length; +} +#else +static int rimage_get_key_size(EVP_PKEY *privkey) +{ + return EVP_PKEY_get_size(privkey); +} +#endif + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + EVP_PKEY *privkey; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; + + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -122,16 +478,16 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css_header.signature, - &siglen, priv_rsa); - if (ret < 0) + ret = rimage_sign(privkey, image, V15, digest, + (unsigned char *)man->css_header.signature); + + if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); + return ret; + } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css_header.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css_header.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) @@ -158,14 +514,9 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA256_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -173,33 +524,12 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -218,16 +548,15 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - &siglen, priv_rsa); - if (ret < 0) + ret = rimage_sign(privkey, image, V18, digest, + (unsigned char *)man->css.signature); + if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); + return ret; + } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) @@ -252,14 +581,9 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA384_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -267,33 +591,12 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -312,25 +615,15 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, /* salt length */ 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to sign manifest %s\n", path); - } - - /* encrypt the signature using the private key */ - ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, - (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + ret = rimage_sign(privkey, image, V25, digest, + (unsigned char *)man->css.signature); if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to encrypt signature %s\n", path); + fprintf(stderr, "error: failed to sign manifest\n"); + return ret; } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reversed */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) @@ -399,12 +692,8 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, void *ptr1, unsigned int size1) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -412,33 +701,12 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, ptr1 - (void *)man, size1); #endif - /* requires private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: verify with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -459,14 +727,12 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); - /* sign the manifest */ - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css_header.signature, - siglen, priv_rsa); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + /* verify */ + ret = rimage_verify(privkey, image, V15, digest, + (unsigned char *)man->css_header.signature); + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); @@ -486,12 +752,8 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -499,33 +761,12 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: verifying with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -546,14 +787,12 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); - /* sign the manifest */ - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - siglen, priv_rsa); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + /* verify */ + ret = rimage_verify(privkey, image, V18, digest, + (unsigned char *)man->css.signature); + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); EVP_PKEY_free(privkey); @@ -572,12 +811,8 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA384_DIGEST_LENGTH]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -585,33 +820,12 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: PSS verify with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -632,19 +846,13 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); - /* decrypt signature */ - ret = RSA_public_decrypt(RSA_size(priv_rsa), (unsigned char *)man->css.signature, - sig, priv_rsa, RSA_NO_PADDING); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to decrypt signature %s\n", path); - } + /* verify */ + ret = rimage_verify(privkey, image, V25, digest, + (unsigned char *)man->css.signature); - ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); EVP_PKEY_free(privkey); @@ -697,35 +905,17 @@ int ri_manifest_verify_v2_5(struct image *image) int get_key_size(struct image *image) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - int key_length; - char path[256]; + int key_len; + int ret; - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; - priv_rsa = EVP_PKEY_get1_RSA(privkey); - key_length = RSA_size(priv_rsa); + key_len = rimage_get_key_size(privkey); - RSA_free(priv_rsa); EVP_PKEY_free(privkey); - return key_length; + return key_len; } From 0f64a20183a8db9bc39a4044679a51c1cc334f8f Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Wed, 1 Dec 2021 21:48:48 +0200 Subject: [PATCH 214/350] manifest: fix buffer init in resign Set buffer to NULL to prevent freeing bogus memory in error case. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.c b/src/manifest.c index e682503b179b..3639b33a1236 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1432,9 +1432,9 @@ int verify_image(struct image *image) int resign_image(struct image *image) { int key_size, key_file_size; + void *buffer = NULL; size_t size, read; FILE *in_file; - void *buffer; int ret, i; /* open image for reading */ From 32052add9968a22d81ffecc76fe905c042fe02a3 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Wed, 8 Dec 2021 09:39:38 -0800 Subject: [PATCH 215/350] remove x from getopt x param was removed from switch case but not from getopt. So if you use x rimage silently fails on the switch case. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index 67710d9f360e..3cf02328234f 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:q:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From 23a53ac8b641ca78679e81ae1bcbff6df37f9ed6 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Tue, 11 Jan 2022 17:17:48 -0800 Subject: [PATCH 216/350] cse: fix signed integer overflow literals are signed by default, so shifting them 32 times is an overflow, found via cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/cse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cse.c b/src/cse.c index 85554308601f..19561701281b 100644 --- a/src/cse.c +++ b/src/cse.c @@ -68,7 +68,7 @@ static uint32_t crc32(uint8_t *input, int size, uint32_t poly, uint32_t init, if (rev_out) { t32 = 0; for (i = 0; i < 32; i++) { - if (crc & (1 << i)) + if (crc & (1U << i)) t32 |= (uint32_t)(1 << (31 - i)); } crc = t32; From 3b4b1429b07e9da8ca5000da4f7d3ced2f39da2b Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Wed, 12 Jan 2022 08:09:05 +0200 Subject: [PATCH 217/350] rimage: fix openssl 1.0 support cppcheck gives errors from openssl 1.0 related code that has some old churn and should be fixed, so fix it. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/pkcs1_5.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 0d704e96b3de..6e3dad8db6ff 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -123,13 +123,14 @@ static int rimage_check_key(EVP_PKEY *privkey) #if OPENSSL_VERSION_NUMBER < 0x10100000L static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) { + RSA *priv_rsa = NULL; const BIGNUM *n; const BIGNUM *e; - const BIGNUM *d; - *n = r->n; - *e = r->e; - *d = r->d; + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + n = priv_rsa->n; + e = priv_rsa->e; BN_bn2bin(n, mod); BN_bn2bin(e, exp); From 8753a9e162f75e27f72fe4ae8f38243cd80da07d Mon Sep 17 00:00:00 2001 From: "Trzcinski, Karol" <karol.trzcinski@intel.com> Date: Thu, 13 Jan 2022 13:12:34 +0100 Subject: [PATCH 218/350] Remove unused declaration of global platform specific manifests Such a global variables does not exists, so should not be declared. It has been deprecated since: 2965908 (manifest: Remove -m option) Signed-off-by: Trzcinski, Karol <karol.trzcinski@intel.com> --- src/include/rimage/manifest.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 5e13fd21cd9a..0e06e8f20df2 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -127,8 +127,6 @@ struct fw_image_manifest_v2_5 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest_v2_5 tgl_manifest; - /* * Firmware manifest header V1.8 used on APL onwards */ @@ -151,9 +149,6 @@ struct fw_image_manifest_v1_8 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest_v1_8 apl_manifest; -extern struct fw_image_manifest_v1_8 cnl_manifest; - /* * Firmware manifest header V1.5 used on SKL and KBL */ @@ -166,14 +161,6 @@ struct fw_image_manifest_v1_5_sue { struct sof_man_fw_desc desc; } __attribute__((packed)); -/* - * TODO: verify if we need platform specific manifest, or just - * define manifest_v1_5 and manifest_v1_8. - */ -extern struct fw_image_manifest_v1_5 skl_manifest; -extern struct fw_image_manifest_v1_5 kbl_manifest; -extern struct fw_image_manifest_v1_5_sue sue_manifest; - struct image; int simple_write_firmware(struct image *image); int man_write_fw_v1_5(struct image *image); From ce69d7bad82aa34e0db925f627daf45e275c4221 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrianx.warecki@intel.com> Date: Mon, 17 Jan 2022 10:42:58 +0100 Subject: [PATCH 219/350] adsp_config: fix invalid format specifier This patch fixes an invalid format specifier that causes a numeric value to be interpreted as a string, resulting in an Segmentation fault. Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c97817716921..2e6f39f6b274 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2023,7 +2023,7 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (strcmp((char *)mod_man->name, "BRNGUP") && strcmp((char *)mod_man->name, "BASEFW")) { if (type != i - 1) { - log_err(ret, "error: invalid type %s", type); + log_err(ret, "error: invalid type %d", type); return -EINVAL; } } From ecb6a6693212ff8733f927e780a1d0e767183dac Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Thu, 20 Jan 2022 15:24:06 +0100 Subject: [PATCH 220/350] Update to C99 standard to match SOF. Silenced warning generated by newest GCC compiler related to int cast of char typed values that may result in negative values. Syntax fix in linkage of crypto library to more generic approach. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 056a92217474..1607b36a8b54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,11 +24,17 @@ add_executable(rimage tomlc99/toml.c ) +set_property(TARGET rimage PROPERTY C_STANDARD 99) + target_compile_options(rimage PRIVATE -Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough ) -target_link_libraries(rimage PRIVATE "-lcrypto") +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.1) + target_compile_options(rimage PRIVATE -Wno-char-subscripts) +endif() + +target_link_libraries(rimage PRIVATE crypto) target_include_directories(rimage PRIVATE src/include/ From d855fbfe7c878999ef6bc352a5c410e454be4d59 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 26 Jan 2022 00:12:55 +0000 Subject: [PATCH 221/350] Remove unconditional "(1 || verbose)" debug hack in cavs25 This is especially a problem considering the -v option outputs non-ASCII garbage which can break some automation, see issue #86 Fixes commit db40934e57aa8 ("cavs: add support for cavs2.5 code signing") Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 2e6f39f6b274..5d5aa5a91048 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -627,7 +627,7 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, hdr->nb_entries = toml_array_nelem(cse_entry_array); - if (1 || verbose) + if (verbose) dump_cse_v2_5(hdr, out); /* From d0062122a8d966f9f9edd3d99e8d99db742fbcf0 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 26 Jan 2022 02:51:41 +0000 Subject: [PATCH 222/350] Fix confusion in headers between uint8_t arrays and strings Strings are null terminated, byte arrays not always. Fixes garbage in debug output issue #86 Add new parse_printable_key() function that takes a uint8_t * argument instead of char *. Casting the argument on almost every call was a clear indication of the problem. Add new DUMP_PRINTABLE_BYTES() to printf uint8_t arrays _and_ their _optional_ padding. No change to the .ri output, bit for bit identical. Here's an example of how the -v output is fixed: ```diff mem_zone.host_offset: 0x0 cse - partition_name: 'ADSPADSP.man' + partition_name: ADSP header_version: 1 entry_version: 1 nb_entries: 3 - entry.name: 'ADSP.man' + entry.name: ADSP.man\x00\x00\x00\x00 entry.offset: 0x58 entry.length: 0x378 - entry.name: 'cavs0015.met' + entry.name: cavs0015.met entry.offset: 0x400 entry.length: 0x60 - entry.name: 'cavs0015' + entry.name: cavs0015\x00\x00\x00\x00 entry.offset: 0x480 entry.length: 0x0 @@ -140,7 +132,7 @@ exponent_size: 1 signed_pkg - name: 'ADSP' + name: ADSP vcn: 0 svn: 0 fw_type: 0 @@ -161,17 +153,17 @@ bitmap: 0 bitmap: 0 bitmap: 0 - meta.name: 'cavs0015.met^C^B ' + meta.name: cavs0015.met meta.type: 0x3 meta.hash_algo: 0x2 meta.hash_size: 0x20 meta.meta_size: 96 partition_info - name: 'ADSP' + name: ADSP part_version: 0x10000000 instance_id: 1 - module.name: 'cavs0015.met^C' + module.name: cavs0015.met module.meta_size: 0x60 module.type: 0x3 @@ -186,7 +178,7 @@ fw_desc.header header_id: '$AM1' - name: 'ADSPFW' + name: ADSPFW\x00\x00 preload_page_count: 0 fw_image_flags: 0x0 feature_mask: 0xffff ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/adsp_config.c | 140 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 99 insertions(+), 41 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 5d5aa5a91048..cff5ba5d079c 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -20,12 +20,34 @@ #include <string.h> #include <stdio.h> #include <errno.h> +#include <ctype.h> /* macros used to dump values after parsing */ #define DUMP_KEY_FMT " %20s: " #define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) #define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) +static void print_bytes(FILE *out, const uint8_t *arr, size_t len) +{ + for (const uint8_t *pos = arr; pos < arr + len; pos++) { + char c = *pos; + + if (isprint(c)) + fputc(c, out); + else + fprintf(out, "\\x%.2x", c); + } +} + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +static void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) +{ + printf(DUMP_KEY_FMT, name); + print_bytes(stdout, arr, len); + printf("\n"); +} + /** parser counter, used to assert nothing left unparsed in toml data */ struct parse_ctx { int key_cnt; /**< number of parsed key */ @@ -206,16 +228,20 @@ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ct } /** - * Parse string value from key in given toml table + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * * @param table toml table where key is specified * @param ctx parsing context, key counter will be incremented after successful key parse * @param key field name - * @param dst target buffer for string - * @param capacity dst buffer size + * @param dst uint8_t[] destination + * @param capacity dst array size * @param error code, 0 when success */ -static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - char *dst, int capacity, int *error) +static void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error) { toml_raw_t raw; char *temp_s; @@ -237,19 +263,50 @@ static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, cons len = strlen(temp_s); if (len > capacity) { - *error = log_err(-EINVAL, "Too long input for key '%s' (%d > %d)\n", key, len, - capacity); + if (len > 20) { + static const char ellipsis[] = "..."; + const size_t el_len = sizeof(ellipsis); + + strncpy(temp_s + 20 - el_len, ellipsis, el_len); + } + + *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", + temp_s, key, len, capacity); free(temp_s); return; } - /* copy string to dst, free allocated memory and update parsing context */ - strncpy(dst, temp_s, capacity); + /* copy string to dst, pad with zeros the space left if any */ + strncpy((char *)dst, temp_s, capacity); free(temp_s); + /* update parsing context */ ++ctx->key_cnt; *error = 0; } +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); + if (*error) /* return immediately to help forensics */ + return; + dst[capacity - 1] = 0; +} + /* map memory zone string name to enum value */ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) { @@ -380,7 +437,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a zone_idx = zone_name_to_idx(zone_name); if (zone_idx < 0) - return err_key_parse("mem_zone.name", "unknown zone"); + return err_key_parse("mem_zone.name", "unknown zone '%s'", zone_name); zone = &out->mem_zones[zone_idx]; zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); @@ -421,12 +478,12 @@ static void dump_cse(const struct CsePartitionDirHeader *cse_header, int i; DUMP("\ncse"); - DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_PRINTABLE_BYTES("partition_name", cse_header->partition_name); DUMP_KEY("header_version", "%d", cse_header->header_version); DUMP_KEY("entry_version", "%d", cse_header->entry_version); DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); for (i = 0; i < cse_header->nb_entries; ++i) { - DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_PRINTABLE_BYTES("entry.name", cse_entry[i].entry_name); DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); } @@ -463,8 +520,8 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return ret; - parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, - sizeof(hdr->partition_name), &ret); + parse_printable_key(cse, &ctx, "partition_name", hdr->partition_name, + sizeof(hdr->partition_name), &ret); if (ret < 0) return ret; @@ -494,8 +551,8 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, - sizeof(out[i].entry_name), &ret); + parse_printable_key(cse_entry, &ctx, "name", out[i].entry_name, + sizeof(out[i].entry_name), &ret); if (ret < 0) return err_key_parse("entry", NULL); @@ -532,12 +589,12 @@ static void dump_cse_v2_5(const struct CsePartitionDirHeader_v2_5 *cse_header, int i; DUMP("\ncse"); - DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_PRINTABLE_BYTES("partition_name", cse_header->partition_name); DUMP_KEY("header_version", "%d", cse_header->header_version); DUMP_KEY("entry_version", "%d", cse_header->entry_version); DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); for (i = 0; i < cse_header->nb_entries; ++i) { - DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_PRINTABLE_BYTES("entry.name", cse_entry[i].entry_name); DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); } @@ -575,8 +632,8 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return ret; - parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, - sizeof(hdr->partition_name), &ret); + parse_printable_key(cse, &ctx, "partition_name", hdr->partition_name, + sizeof(hdr->partition_name), &ret); if (ret < 0) return ret; @@ -606,8 +663,8 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, - sizeof(out[i].entry_name), &ret); + parse_printable_key(cse_entry, &ctx, "name", out[i].entry_name, + sizeof(out[i].entry_name), &ret); if (ret < 0) return err_key_parse("entry", NULL); @@ -901,7 +958,7 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) int i; DUMP("\nsigned_pkg"); - DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_PRINTABLE_BYTES("name", signed_pkg->name); DUMP_KEY("vcn", "%d", signed_pkg->vcn); DUMP_KEY("svn", "%d", signed_pkg->svn); DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); @@ -909,7 +966,7 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { - DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_PRINTABLE_BYTES("meta.name", signed_pkg->module[i].name); DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); @@ -943,7 +1000,7 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, out->ext_len = sizeof(struct signed_pkg_info_ext); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1015,7 +1072,7 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1057,7 +1114,7 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p int i; DUMP("\nsigned_pkg"); - DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_PRINTABLE_BYTES("name", signed_pkg->name); DUMP_KEY("vcn", "%d", signed_pkg->vcn); DUMP_KEY("svn", "%d", signed_pkg->svn); DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); @@ -1065,7 +1122,7 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { - DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_PRINTABLE_BYTES("meta.name", signed_pkg->module[i].name); DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); @@ -1099,7 +1156,7 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct out->ext_len = sizeof(struct signed_pkg_info_ext_v2_5); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1171,7 +1228,7 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1214,11 +1271,11 @@ static void dump_partition_info_ext(const struct partition_info_ext *part_info) int i; DUMP("\npartition_info"); - DUMP_KEY("name", "'%s'", part_info->name); + DUMP_PRINTABLE_BYTES("name", part_info->name); DUMP_KEY("part_version", "0x%x", part_info->part_version); DUMP_KEY("instance_id", "%d", part_info->instance_id); for (i = 0; i < ARRAY_SIZE(part_info->module); ++i) { - DUMP_KEY("module.name", "'%s'", part_info->module[i].name); + DUMP_PRINTABLE_BYTES("module.name", part_info->module[i].name); DUMP_KEY("module.meta_size", "0x%x", part_info->module[i].meta_size); DUMP_KEY("module.type", "0x%x", part_info->module[i].type); } @@ -1249,7 +1306,7 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * memset(out->reserved, 0xff, sizeof(out->reserved)); /* configurable fields */ - parse_str_key(partition_info, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(partition_info, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1307,7 +1364,7 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * memcpy(mod->reserved, module_reserved, sizeof(mod->reserved)); /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1603,7 +1660,7 @@ static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) DUMP_KEY("header_id", "'%c%c%c%c'", fw_desc->header.header_id[0], fw_desc->header.header_id[1], fw_desc->header.header_id[2], fw_desc->header.header_id[3]); - DUMP_KEY("name", "'%s'", fw_desc->header.name); + DUMP_PRINTABLE_BYTES("name", fw_desc->header.name); DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); @@ -1646,8 +1703,8 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, out->header.header_len = sizeof(struct sof_man_fw_header); /* configurable fields */ - parse_str_key(header, &ctx, "name", (char *)out->header.name, SOF_MAN_FW_HDR_FW_NAME_LEN, - &ret); + parse_printable_key(header, &ctx, "name", out->header.name, sizeof(out->header.name), + &ret); if (ret < 0) return err_key_parse("header", NULL); @@ -1892,7 +1949,7 @@ static void dump_module(struct fw_image_manifest_module *man_cavs) DUMP_KEY("module config count", "%d", man_cavs->mod_cfg_count); for (i = 0; i < man_cavs->mod_man_count; i++) { - DUMP_KEY("module name", "%s", man_cavs->mod_man[i].name); + DUMP_PRINTABLE_BYTES("module name", man_cavs->mod_man[i].name); DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); @@ -1971,12 +2028,13 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, memcpy(mod_man->struct_id, "$AME", 4); /* configurable fields */ - parse_str_key(mod_entry, &ctx_entry, "name", (char *)mod_man->name, - SOF_MAN_MOD_NAME_LEN, &ret); + parse_printable_key(mod_entry, &ctx_entry, "name", mod_man->name, + sizeof(mod_man->name), &ret); if (ret < 0) return err_key_parse("name", NULL); - parse_str_key(mod_entry, &ctx_entry, "uuid", buf, 48, &ret); + parse_str_key(mod_entry, &ctx_entry, "uuid", buf, sizeof(buf), + &ret); if (ret < 0) return err_key_parse("uuid", NULL); From 15896419037114106b8989a096229bd0198d34ec Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Wed, 26 Jan 2022 10:48:20 +0100 Subject: [PATCH 223/350] Fixed warning of wrong variable type in fprintf Fixed warning where variable passed to fprintf was of type size_t and fprintf expected format of long int. Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com> --- src/manifest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3639b33a1236..cb6d70390507 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause // -// Copyright(c) 2018 Intel Corporation. All rights reserved. +// Copyright(c) 2018-2022 Intel Corporation. All rights reserved. // // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> // Keyon Jie <yang.jie@linux.intel.com> @@ -1480,7 +1480,7 @@ int resign_image(struct image *image) /* read file into buffer */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + fprintf(stderr, "error: unable to read %zu bytes from %s err %d\n", size, image->in_file, errno); ret = errno; goto out; From ee5c3e1deb1436a6e52b653bb523b594511cf330 Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Wed, 26 Jan 2022 10:52:36 +0100 Subject: [PATCH 224/350] Added handling of OpenSSL on Windows with MSYS2 Added new MSYS_INSTALL_DIR variable that points to MSYS2 installation for Windows users. It is used to include POSIX native headers from /usr/include also required openssl headers. Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com> --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1607b36a8b54..0e253d8d1b50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,27 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.1) target_compile_options(rimage PRIVATE -Wno-char-subscripts) endif() +# Windows builds use MSYS2 https://www.msys2.org/ to get linux tools and headers. +# MSYS_INSTALL_DIR variable points to MSYS2 installation directory. +# You may pass it as environmental or cmake configure variable. +if(${CMAKE_HOST_WIN32}) + cmake_minimum_required(VERSION 3.20) + if(DEFINED ENV{MSYS_INSTALL_DIR} AND NOT MSYS_INSTALL_DIR) + set(MSYS_INSTALL_DIR $ENV{MSYS_INSTALL_DIR}) + endif() + + if(MSYS_INSTALL_DIR) + cmake_path(IS_ABSOLUTE MSYS_INSTALL_DIR IS_MSYS_INSTALL_DIR_ABSOLUTE) + if(NOT IS_MSYS_INSTALL_DIR_ABSOLUTE) + message(FATAL_ERROR "Please provide absolute path to MSYS2 installation + setting MSYS_INSTALL_DIR env variable") + endif() + # Include standard posix headers. Requires pacman openssl-devel package. + cmake_path(APPEND MSYS_INSTALL_DIR "usr" "include" OUTPUT_VARIABLE MSYS_SYSTEM_INCLUDE_PATH) + target_include_directories(rimage PRIVATE "${MSYS_SYSTEM_INCLUDE_PATH}") + endif() +endif() + target_link_libraries(rimage PRIVATE crypto) target_include_directories(rimage PRIVATE From 05be213d46d4755ff039fe8703a16293738e226f Mon Sep 17 00:00:00 2001 From: Tinghan Shen <tinghan.shen@mediatek.com> Date: Tue, 30 Nov 2021 11:01:00 +0800 Subject: [PATCH 225/350] config: Add mt8186.toml Add mt8186.toml to support sof-mt8186.ri binary build Signed-off-by: Allen-KH Cheng <Allen-KH.Cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> --- config/mt8186.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/mt8186.toml diff --git a/config/mt8186.toml b/config/mt8186.toml new file mode 100644 index 000000000000..80b011b4bfd4 --- /dev/null +++ b/config/mt8186.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "mt8186" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x4e100000" +size = "0x00100000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" From 9d453321f892b7ec3f0c74d3382eaa4e674a6e6a Mon Sep 17 00:00:00 2001 From: mengdonglin <mengdong.lin@intel.com> Date: Wed, 4 May 2022 06:25:47 -0400 Subject: [PATCH 226/350] Write firmware file micro version to manifest for cAVS platforms SOF CMake can extract FW file version from latest git tag and defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 version fields. But rimage only gets major and minor version from SOF CMake and writes them into the standard firmware manifest header of cAVS platforms. This patch make rimage also get the micro version from SOF CMake, and write it to the unused hotfix_version field of manifest header. This update will enable sof_ri_info.py to dump entire file version from a FW binary for cAVS platforms. So we can check if a FW release candidate is built from the correct git tag. Signed-off-by: mengdonglin <mengdong.lin@intel.com> update --- src/include/rimage/rimage.h | 1 + src/manifest.c | 7 +++++++ src/rimage.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e5b918e3c600..1ce609c67127 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -109,6 +109,7 @@ struct image { char* fw_ver_build_string; uint16_t fw_ver_major; uint16_t fw_ver_minor; + uint16_t fw_ver_micro; uint16_t fw_ver_build; }; diff --git a/src/manifest.c b/src/manifest.c index cb6d70390507..d3d7f26e2f93 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -776,6 +776,7 @@ int man_write_fw_v1_5(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -845,6 +846,7 @@ int man_write_fw_v1_5_sue(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module - subtract the boot loader exec header */ @@ -916,6 +918,7 @@ int man_write_fw_v1_8(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -1022,6 +1025,7 @@ int man_write_fw_meu_v1_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1102,6 +1106,7 @@ int man_write_fw_meu_v1_8(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1182,6 +1187,7 @@ int man_write_fw_meu_v2_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1266,6 +1272,7 @@ int man_write_fw_v2_5(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ diff --git a/src/rimage.c b/src/rimage.c index 3cf02328234f..c7b112dcaa72 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,7 +26,7 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); - fprintf(stdout, "\t -f firmware version = x.y\n"); + fprintf(stdout, "\t -f firmware version = major.minor.micro\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); @@ -115,19 +115,21 @@ int main(int argc, char *argv[]) return -EINVAL; } - /* firmware version and build id */ + /* firmware version: major.minor.micro */ if (image.fw_ver_string) { - ret = sscanf(image.fw_ver_string, "%hu.%hu", + ret = sscanf(image.fw_ver_string, "%hu.%hu.%hu", &image.fw_ver_major, - &image.fw_ver_minor); + &image.fw_ver_minor, + &image.fw_ver_micro); - if (ret != 2) { + if (ret != 3) { fprintf(stderr, - "error: cannot parse firmware version\n"); + "error: cannot parse firmware version major.minor.micro\n"); return -EINVAL; } } + /* firmware build id */ if (image.fw_ver_build_string) { ret = sscanf(image.fw_ver_build_string, "%hu", &image.fw_ver_build); From 1b233f68bdee6de24b0447917d8d44c98970efce Mon Sep 17 00:00:00 2001 From: Balakishorepati <balaKishore.pati@amd.com> Date: Mon, 9 May 2022 21:15:52 +0530 Subject: [PATCH 227/350] config: add rmb toml file to support rembrandt build Add rmb toml file to support sof-rmb.ri binary build Signed-off-by: Balakishorepati <balaKishore.pati@amd.com> --- config/rmb.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/rmb.toml diff --git a/config/rmb.toml b/config/rmb.toml new file mode 100644 index 000000000000..7d43f3a3dc33 --- /dev/null +++ b/config/rmb.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "rmb" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x7F000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xE0000000" +size = "0xE0000" +host_offset = "0x0" From c484d99abf89e08d702e2097a11e86d9631c7af0 Mon Sep 17 00:00:00 2001 From: bkolodzi <96577572+bkolodzi@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:51:17 +0100 Subject: [PATCH 228/350] rimage: add ACE V1.5 handling Add ACE 1.5 set of functions to support v3.0 manifest Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- src/adsp_config.c | 192 ++++++++++++++++++++++++- src/cse.c | 30 ++++ src/include/rimage/cse.h | 1 + src/include/rimage/manifest.h | 41 ++++++ src/include/rimage/plat_auth.h | 30 ++++ src/include/rimage/rimage.h | 7 + src/include/rimage/sof/user/manifest.h | 2 +- src/manifest.c | 142 ++++++++++++++++++ src/pkcs1_5.c | 112 +++++++++++++++ src/plat_auth.c | 17 +++ src/rimage.c | 3 + 11 files changed, 574 insertions(+), 3 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index cff5ba5d079c..efd21e86920a 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1265,6 +1265,129 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct return 0; } +static void dump_signed_pkg_ace_v1_5(const struct signed_pkg_info_ext_ace_v1_5 *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + } +} + +static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext_ace_v1_5 *out, bool verbose) +{ + struct signed_pkg_info_module_ace_v1_5 *mod; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE_ACE_V1_5; + out->ext_len = sizeof(struct signed_pkg_info_ext_ace_v1_5); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + out->partition_usage = parse_uint32_hex_key(signed_pkg, &ctx, "partition_usage", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x00, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 112, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg_ace_v1_5(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} static void dump_partition_info_ext(const struct partition_info_ext *part_info) { @@ -1664,7 +1787,7 @@ static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); - DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.hw_buf_base_addr); + DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.fw_compat); DUMP_KEY("hw_buf_length", "0x%x", fw_desc->header.hw_buf_length); DUMP_KEY("load_offset", "0x%x", fw_desc->header.load_offset); } @@ -1723,7 +1846,7 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("header", NULL); - out->header.hw_buf_base_addr = + out->header.fw_compat = parse_uint32_hex_key(header, &ctx, "hw_buf_base_addr", 0, &ret); if (ret < 0) return err_key_parse("header", NULL); @@ -2342,6 +2465,70 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } +static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + out->man_ace_v1_5 = malloc(sizeof(struct fw_image_manifest_ace_v1_5)); + if (!out->man_ace_v1_5) + return err_malloc("man_ace_v1_5"); + + /* clear memory */ + memset(out->man_ace_v1_5, 0, sizeof(*out->man_ace_v1_5)); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_ace_v1_5; + out->write_firmware_meu = man_write_fw_meu_v2_5; + out->verify_firmware = ri_manifest_verify_v2_5; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse_v2_5(toml, &ctx, &out->man_ace_v1_5->cse_partition_dir_header, + out->man_ace_v1_5->cse_partition_dir_entry, 3, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v2_5(toml, &ctx, &out->man_ace_v1_5->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg_ace_v1_5(toml, &ctx, &out->man_ace_v1_5->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_info_ext_0x16(toml, &ctx, &out->man_ace_v1_5->info_0x16, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v2_5(toml, &ctx, &out->man_ace_v1_5->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_ace_v1_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + ret = parse_module(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + /** version is stored as toml array with integer number, something like: * "version = [1, 8]" */ @@ -2386,6 +2573,7 @@ static const struct config_parser *find_config_parser(int64_t version[2]) {1, 5, parse_adsp_config_v1_5}, {1, 8, parse_adsp_config_v1_8}, {2, 5, parse_adsp_config_v2_5}, + {3, 0, parse_adsp_config_ace_v1_5}, }; int i; diff --git a/src/cse.c b/src/cse.c index 19561701281b..3c5e9c561856 100644 --- a/src/cse.c +++ b/src/cse.c @@ -106,3 +106,33 @@ void ri_cse_create_v2_5(struct image *image) fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); } + +void ri_cse_create_ace_v1_5(struct image *image) +{ + struct CsePartitionDirHeader_v2_5 *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext_v2_5 *meta = image->fw_image + + MAN_META_EXT_OFFSET_ACE_V1_5; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t *val = image->fw_image; + int size; + + fprintf(stdout, " cse: completing CSE V2.5 manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET_V1_8; + + /* + * calculate checksum using crc-32/iso-hdlc + * + * polynomial: 0x04c11db7 + * initial value: 0xffffffff + * reverse input: true + * reverse output: true + * xor output: 0xffffffff + */ + size = (sizeof(*cse_hdr) + (sizeof(*cse_entry) * MAN_CSE_PARTS)); + cse_hdr->checksum = crc32(val, size, 0x04c11db7, 0xffffffff, true, true, 0xffffffff); + + fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); +} diff --git a/src/include/rimage/cse.h b/src/include/rimage/cse.h index 6ce46561f214..9a14b93b99f6 100644 --- a/src/include/rimage/cse.h +++ b/src/include/rimage/cse.h @@ -42,5 +42,6 @@ struct CsePartitionDirEntry { void ri_cse_create(struct image *image); void ri_cse_create_v2_5(struct image *image); +void ri_cse_create_ace_v1_5(struct image *image); #endif diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 0e06e8f20df2..819f398b2c89 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -46,11 +46,19 @@ sizeof(struct CsePartitionDirHeader_v2_5) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_FW_DESC_OFFSET_ACE_V1_5 \ + (MAN_META_EXT_OFFSET_ACE_V1_5 + \ + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ + MAN_EXT_PADDING) + #define MAN_FW_DESC_OFFSET_V2_5 \ (MAN_META_EXT_OFFSET_V2_5 + \ sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ MAN_EXT_PADDING) +#define MAN_DESC_PADDING_SIZE_ACE_V1_5 \ + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_ACE_V1_5) + #define MAN_DESC_PADDING_SIZE_V2_5 \ (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V2_5) @@ -66,6 +74,10 @@ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) +#define MAN_PART_INFO_OFFSET_ACE_V1_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_ace_v1_5)) + #define MAN_PART_INFO_OFFSET_V2_5 \ (MAN_SIG_PKG_OFFSET_V2_5 + \ sizeof(struct signed_pkg_info_ext_v2_5)) @@ -76,6 +88,12 @@ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) +#define MAN_META_EXT_OFFSET_ACE_V1_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_ace_v1_5) + \ + sizeof(struct info_ext_0x16) + \ + 0) + #define MAN_META_EXT_OFFSET_V2_5 \ (MAN_SIG_PKG_OFFSET_V2_5 + \ sizeof(struct signed_pkg_info_ext_v2_5) + \ @@ -105,6 +123,28 @@ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) +/* + * Firmware manifest header ACE V1_5 used on MTL onwards + */ +struct fw_image_manifest_ace_v1_5 { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader_v2_5 cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header_v2_5 css; + struct signed_pkg_info_ext_ace_v1_5 signed_pkg; + struct info_ext_0x16 info_0x16; + + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE_ACE_V1_5]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + /* * Firmware manifest header V2.5 used on TGL onwards */ @@ -167,6 +207,7 @@ int man_write_fw_v1_5(struct image *image); int man_write_fw_v1_5_sue(struct image *image); int man_write_fw_v1_8(struct image *image); int man_write_fw_v2_5(struct image *image); +int man_write_fw_ace_v1_5(struct image *image); int man_write_fw_meu_v1_5(struct image *image); int man_write_fw_meu_v1_8(struct image *image); int man_write_fw_meu_v2_5(struct image *image); diff --git a/src/include/rimage/plat_auth.h b/src/include/rimage/plat_auth.h index 8eb3ad967a56..64cdcd98db5f 100644 --- a/src/include/rimage/plat_auth.h +++ b/src/include/rimage/plat_auth.h @@ -18,6 +18,8 @@ struct image; #define SIGN_PKG_EXT_TYPE 15 #define SIGN_PKG_NUM_MODULE 1 +#define SIGN_PKG_EXT_TYPE_ACE_V1_5 0x23 + struct signed_pkg_info_module { uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ uint8_t type; @@ -68,6 +70,33 @@ struct signed_pkg_info_ext_v2_5 { struct signed_pkg_info_module_v2_5 module[SIGN_PKG_NUM_MODULE]; } __attribute__((packed)); +struct signed_pkg_info_module_ace_v1_5 { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint8_t reserved[2]; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA384_LEN]; +} __attribute__((packed)); + +struct signed_pkg_info_ext_ace_v1_5 { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; /* 0 */ + uint32_t svn; + uint8_t partition_usage; + uint8_t reserved0; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t number_of_modules; + uint8_t boot_strap_svn; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module_ace_v1_5 module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); #define PART_INFO_EXT_TYPE 3 #define PART_INFO_NUM_MODULE 1 @@ -121,5 +150,6 @@ void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, int meta_end_offset); void ri_plat_ext_data_create(struct image *image); void ri_plat_ext_data_create_v2_5(struct image *image); +void ri_plat_ext_data_create_ace_v1_5(struct image *image); #endif diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1ce609c67127..0f719dc5b9ed 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -155,6 +155,7 @@ struct adsp { int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); int (*verify_firmware)(struct image *image); + struct fw_image_manifest_ace_v1_5 *man_ace_v1_5; struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; @@ -170,6 +171,8 @@ void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); int ri_manifest_sign_v2_5(struct image *image); +int ri_manifest_sign_ace_v1_5(struct image *image); + void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); void ri_sha384(struct image *image, unsigned int offset, unsigned int size, @@ -186,6 +189,10 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int verify_image(struct image *image); int ri_manifest_verify_v1_5(struct image *image); diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index d90014ffb198..d7c3d3d98afa 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -137,7 +137,7 @@ struct sof_man_fw_header { uint16_t hotfix_version; uint16_t build_version; uint32_t num_module_entries; - uint32_t hw_buf_base_addr; + uint32_t fw_compat; uint32_t hw_buf_length; /* target address for binary loading as offset in IMR - must be == base offset */ uint32_t load_offset; diff --git a/src/manifest.c b/src/manifest.c index d3d7f26e2f93..7c8b46aa8c21 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1358,6 +1358,148 @@ int man_write_fw_v2_5(struct image *image) return ret; } +static int man_init_image_ace_v1_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_ace_v1_5, + sizeof(struct fw_image_manifest_ace_v1_5)); + + return 0; +} + +int man_write_fw_ace_v1_5(struct image *image) +{ + + struct sof_man_fw_desc *desc; + struct fw_image_manifest_ace_v1_5 *m; + uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image_ace_v1_5(image); + if (ret < 0) + goto err; + + /* use default meu offset for TGL if not provided */ + if (!image->meu_offset) + image->meu_offset = MAN_FW_DESC_OFFSET_ACE_V1_5 - 0x10; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + + m->desc.header.feature_mask = 0x2; // -> should be feature mask - to fix + m->desc.header.fw_image_flags = 0x2; // -> should be feature mask - to fix + m->desc.header.fw_compat = 0x100000; // -> PUT PROPER STRUCT + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, MAN_META_EXT_OFFSET_ACE_V1_5, + image->meu_offset); + ri_plat_ext_data_create_ace_v1_5(image); + ri_css_v2_5_hdr_create(image); + ri_cse_create_ace_v1_5(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash inside ADSP meta data extension for padding to end */ + ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash); + + /* mue writes 0xff to 16 bytes of padding */ + for (i = 0; i < 16; i++) + m->reserved[i] = 0xff; + + /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ + ri_sha384(image, MAN_META_EXT_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* calculate hash - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); + module_sha_complete(image, hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->info_0x16.hash[i] = hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign_ace_v1_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_ACE_V1_5, + MAN_FW_DESC_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + int verify_image(struct image *image) { FILE *in_file; diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 6e3dad8db6ff..62ba0ea062b0 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -576,6 +576,101 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). */ +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + const BIGNUM *n, *e, *d; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, + digest, image->md, /* salt length */ 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to sign manifest %s\n", path); + } + + /* encrypt the signature using the private key */ + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, + (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to encrypt signature %s\n", path); + } + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); + + /* modulus is reversed */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN_2_5 - (1 + i)]; + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, @@ -682,6 +777,23 @@ int ri_manifest_sign_v2_5(struct image *image) return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); } +int ri_manifest_sign_ace_v1_5(struct image *image) +{ + struct fw_image_manifest_ace_v1_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_sign_man_ace_v1_5(image, man, data1, size1, data2, size2); +} + /* * RSA verify of manifest. The signature is an PKCS * #1-v1_5 of the entire manifest structure, including all diff --git a/src/plat_auth.c b/src/plat_auth.c index 46a2473ae44f..321d1712d0e4 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -75,3 +75,20 @@ void ri_plat_ext_data_create_v2_5(struct image *image) desc->header.preload_page_count = size / MAN_PAGE_SIZE; ext->size = image->image_end; } + +void ri_plat_ext_data_create_ace_v1_5(struct image *image) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + struct info_ext_0x16 *ext = image->fw_image + MAN_PART_INFO_OFFSET_ACE_V1_5; + uint32_t size; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + size += MAN_PAGE_SIZE - (size % MAN_PAGE_SIZE); + + desc->header.preload_page_count = size / MAN_PAGE_SIZE; + ext->size = image->image_end; +} diff --git a/src/rimage.c b/src/rimage.c index c7b112dcaa72..617656852c83 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -170,6 +170,9 @@ int main(int argc, char *argv[]) if (image.adsp->man_v2_5) image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + if (image.adsp->man_ace_v1_5) + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - first_non_opt; From af947cb63dd6269e004b11b4b4cde8a7c0424a94 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Mon, 6 Dec 2021 14:20:43 +0100 Subject: [PATCH 229/350] config: Add toml config for mtl This patch will add mtl support Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 210 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 config/mtl.toml diff --git a/config/mtl.toml b/config/mtl.toml new file mode 100644 index 000000000000..1de62e5414a3 --- /dev/null +++ b/config/mtl.toml @@ -0,0 +1,210 @@ +version = [3, 0] + +[adsp] +name = "mtl" +image_size = "0x2C0000" # (22) bank * 128KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x1FF80000" +size = "0x400" +[[adsp.mem_zone]] +type = "IMR" +base = "0xA104A000" +size = "0x2000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xa00f0000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "ADSP.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "ADSP" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +partition_usage = "0x23" +[[signed_pkg.module]] +name = "ADSP.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x40000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] From fe4dcaa62c13888d4535945ef33f86629aedc430 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrianx.warecki@intel.com> Date: Fri, 11 Feb 2022 11:53:13 +0100 Subject: [PATCH 230/350] mtl: Add ASRC module to the manifest Added ASRC module to config/mtl.toml Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com> --- config/mtl.toml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 1de62e5414a3..9e94f8b60bc1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -208,3 +208,35 @@ count = 7 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "ASRC" + uuid = "66B4402D-B468-42F2-81A7-B37121863DD4" + affinity_mask = "0x3" + instance_count = "2" + domain_types = "0" + + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, + 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, + 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, + 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, + 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, + 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, + 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, + 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, + 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, + 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, + 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, + 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, + 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, + 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, + 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] From 8ba3d17296563af5166f2f59448e9c21e11194bf Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Fri, 11 Mar 2022 14:00:30 +0100 Subject: [PATCH 231/350] adsp_config: fix name parsing error in parse_signed_pkg_ace_v1_5 Fix name parsing error in parse_signed_pkg_ace_v1_5 Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index efd21e86920a..96152e185714 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1304,7 +1304,7 @@ static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx out->ext_len = sizeof(struct signed_pkg_info_ext_ace_v1_5); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1356,7 +1356,7 @@ static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); From 73a9d7c897d3658486dc5cb5d69c7a587dfc042a Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Thu, 16 Jun 2022 10:00:18 +0300 Subject: [PATCH 232/350] rimage: fix openssl 3.0 support in ver25 signing Fix a misunderstanding with openssl APIs and don't "double sign" the binary. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/pkcs1_5.c | 55 ++++----------------------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 62ba0ea062b0..2f46f4b4f346 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -200,11 +200,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, unsigned char *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; - EVP_PKEY_CTX *ctx2 = NULL; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; size_t siglen = MAN_RSA_SIGNATURE_LEN; size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; - size_t sig_out = MAN_RSA_SIGNATURE_LEN_2_5; int ret; ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); @@ -234,30 +231,11 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, goto out; } - ret = EVP_PKEY_sign(ctx, sig, &sig_in, digest, SHA384_DIGEST_LENGTH); + ret = EVP_PKEY_sign(ctx, signature, &sig_in, digest, SHA384_DIGEST_LENGTH); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); goto out; } - - /* encryption done with different context */ - ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); - if (!ctx) - return -ENOMEM; - - ret = EVP_PKEY_encrypt_init(ctx2); - if (ret <= 0) - goto out; - - ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); - if (ret <= 0) { - fprintf(stderr, "error: failed to set 0 padding \n"); - goto out; - } - - ret = EVP_PKEY_encrypt(ctx2, signature, &sig_out, sig, sig_in); - if (ret <= 0) - fprintf(stderr, "error: failed to encrypt signature\n"); } else { ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); @@ -273,8 +251,6 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, out: EVP_PKEY_CTX_free(ctx); - if (ctx2) - EVP_PKEY_CTX_free(ctx2); return ret; } @@ -331,9 +307,7 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver unsigned char *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; - EVP_PKEY_CTX *ctx2 = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; char err_buf[256]; int ret; @@ -369,34 +343,15 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + ret = EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, 32); if (ret <= 0) goto out; - /* decrypt signature */ - ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); - if (!ctx) - return -ENOMEM; - - ret = EVP_PKEY_decrypt_init(ctx2); + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: set padding %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_decrypt(ctx2, sig, &siglen25, signature, siglen25); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: decrypt %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_verify(ctx, sig, siglen25, digest, SHA384_DIGEST_LENGTH); + ret = EVP_PKEY_verify(ctx, signature, siglen25, digest, SHA384_DIGEST_LENGTH); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); fprintf(stderr, "error: verify %s\n", err_buf); @@ -409,8 +364,6 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver out: EVP_PKEY_CTX_free(ctx); - if (ctx2) - EVP_PKEY_CTX_free(ctx2); return ret; } From 02abc5d342a3ee6965bdc933ea1439d85d0256da Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Thu, 16 Jun 2022 10:10:52 +0300 Subject: [PATCH 233/350] rimage: ace signing functions need openssl 3.0 guards Ace signing functions need guards for not to use deprecated openssl functions and thus fail the compilation. Openssl3 implementation needs to be done as the added stub now returns just -EINVAL. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/pkcs1_5.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 2f46f4b4f346..23bb0f4a6132 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -529,6 +529,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). */ +#if OPENSSL_VERSION_NUMBER < 0x30000000L int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, struct fw_image_manifest_ace_v1_5 *man, void *ptr1, unsigned int size1, void *ptr2, @@ -624,6 +625,15 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, EVP_PKEY_free(privkey); return ret; } +#else +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + return -EINVAL; +} +#endif int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, From 452847ddc04ebf865e3e03926cc3298db4b66a81 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Tue, 7 Jun 2022 12:43:02 +0200 Subject: [PATCH 234/350] mtl: Add SRC module to the manifest Added SRC module to config/mtl.toml. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 9e94f8b60bc1..36a3b18edd95 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 8 +count = 9 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -240,3 +240,43 @@ count = 8 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + + [[module.entry]] + name = "SRC" + uuid = "E61BB28D-149A-4C1F-B709-46823EF5F5AE" + affinity_mask = "0x1" + #instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] From 12bb32712266202a39ec716e9f6a3ee2050ff9ae Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 22 Jun 2022 12:17:21 +0300 Subject: [PATCH 235/350] toml: add tgl-h config file for IPC4 tgl-h target is missing the IPC4 toml config file, so add it. tgl-h-cavs.toml is a direct copy from tgl-cavs.toml, only the image size has been changed. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- config/tgl-h-cavs.toml | 215 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 config/tgl-h-cavs.toml diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml new file mode 100644 index 000000000000..b5c55d5319fa --- /dev/null +++ b/config/tgl-h-cavs.toml @@ -0,0 +1,215 @@ +version = [2, 5] + +[adsp] +name = "tgl" +image_size = "0x1F0000" # (30 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0000000" +size = "0x1000000" +[[adsp.mem_zone]] +type = "HP-SRAM" +base = "0xBE000000" +size = "0x800000" +[[adsp.mem_zone]] +type = "LP-SRAM" +base = "0xBE800000" +size = "0x40" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "383B9BE2-3518-4DB0-8891-B1470A8914F8" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + From 5504179137c56948abaa77ec5c137dc8cf3c336f Mon Sep 17 00:00:00 2001 From: jxstelter <Jaroslaw.Stelter@intel.com> Date: Fri, 24 Jun 2022 12:01:19 +0200 Subject: [PATCH 236/350] Add lib_code module type. External libraries can contain processing module code or common library code. Library manager need to distinguish between both type of modules for proper loading. Signed-off-by: Jaroslaw Stelter <jaroslaw.stelter@intel.com> --- src/include/rimage/sof/user/manifest.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index d7c3d3d98afa..9d410ca3cf86 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -31,7 +31,8 @@ struct sof_man_module_type { uint32_t auto_start:1; uint32_t domain_ll:1; uint32_t domain_dp:1; - uint32_t rsvd_:25; + uint32_t lib_code:1; + uint32_t rsvd_:24; }; /* segment flags.type */ From d94cfc9cc6dc2e7cd6b9fc07a6c6fc2da8717fe9 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 27 Jun 2022 15:33:35 +0800 Subject: [PATCH 237/350] mtl: add MicSel support Add MicSel config int mtl.toml Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 36a3b18edd95..babec1d72e7c 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 9 +count = 10 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -280,3 +280,22 @@ count = 9 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From d50aefcb6375960c58c8f7ef25a05b8eabec9e28 Mon Sep 17 00:00:00 2001 From: "Dobrowolski, PawelX" <pawelx.dobrowolski@intel.com> Date: Wed, 20 Jul 2022 15:25:25 +0200 Subject: [PATCH 238/350] manifest max size for loadable modules Library manager during loading modules needs manifest max size Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com> --- src/include/rimage/manifest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 819f398b2c89..a1c9e39ec174 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -13,6 +13,7 @@ #include <rimage/plat_auth.h> #define MAN_PAGE_SIZE 4096 +#define MAN_MAX_SIZE_V1_8 (38 * 1024) /* start offset for modules built using xcc */ #define DEFAULT_XCC_MOD_OFFSET 0x8 From 6b4848e25d8aaabdf6cd9d402db9a02e5c62ae56 Mon Sep 17 00:00:00 2001 From: Arsen Eloglian <ArsenX.Eloglian@intel.com> Date: Thu, 11 Aug 2022 11:32:48 +0200 Subject: [PATCH 239/350] mtl: Add UPDWMIX module to the manifest Added Up Down Mixer module to config/mtl.toml Increased modules count. Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com> --- config/mtl.toml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index babec1d72e7c..2ca9659c2e91 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 10 +count = 11 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -299,3 +299,28 @@ count = 10 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "UPDWMIX" + uuid = "42F8060C-832F-4DBF-B247-51E961997B34" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "1" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xffff, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, + 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, + 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, + 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, + 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] From 5b076f17384c51a0fbe4ed86fa19cbcbab33b7b6 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:20:34 +0200 Subject: [PATCH 240/350] config: tgl-cavs: add probe module Add probe module to tgl-cavs config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/tgl-cavs.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 62448e347d73..446a71255d5b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -213,3 +213,17 @@ count = 7 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + From 542924d70c1715671ad8213440f01dc6dadb52e4 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:24:42 +0200 Subject: [PATCH 241/350] config: tgl-h-cavs: add probe module Add probe module to tgl-h-cavs config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/tgl-h-cavs.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index b5c55d5319fa..bb38c790e3dc 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -213,3 +213,17 @@ count = 7 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + From fb28357912da32d90b9fabbdfefaa28553b1d20a Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:26:34 +0200 Subject: [PATCH 242/350] config: mtl: add probe module Add probe module to mtl config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 2ca9659c2e91..54682ac9af00 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 11 +count = 12 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -324,3 +324,17 @@ count = 11 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "10" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] From a1b6e6db33abb2702a242db1c9417b9fef81bc5b Mon Sep 17 00:00:00 2001 From: Damian Nikodem <damian.nikodem@intel.com> Date: Thu, 8 Sep 2022 17:36:49 +0200 Subject: [PATCH 243/350] manifest: add fw_ver_micro to manifest Pass fw_ver_micro value to manifest. Signed-off-by: Damian Nikodem <damian.nikodem@intel.com> --- src/manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/manifest.c b/src/manifest.c index 7c8b46aa8c21..c7a37266f198 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1413,6 +1413,7 @@ int man_write_fw_ace_v1_5(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; m->desc.header.feature_mask = 0x2; // -> should be feature mask - to fix From d957e0368b8671ca52fed422ffe9384e8f899de8 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Tue, 27 Sep 2022 08:36:00 +0300 Subject: [PATCH 244/350] rimage: make ace15 signing to support openssl3 Ace signing is currently missing openssl3 support, so let's add it. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/include/rimage/rimage.h | 10 ++- src/pkcs1_5.c | 148 +++++++++++++++++++----------------- 2 files changed, 85 insertions(+), 73 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 0f719dc5b9ed..e4117f3f3c6c 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -190,9 +190,9 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2); + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int verify_image(struct image *image); int ri_manifest_verify_v1_5(struct image *image); @@ -209,6 +209,10 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int resign_image(struct image *image); int get_key_size(struct image *image); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 23bb0f4a6132..2f58b8720269 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -29,7 +29,8 @@ enum manver { V15 = 0, V18 = 1, - V25 = 2 + V25 = 2, + VACE15 = 3 }; static void bytes_swap(uint8_t *ptr, uint32_t size) @@ -183,6 +184,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, signature, &siglen, priv_rsa); break; case V25: + /* fallthrough */ + case VACE15: ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, /* salt length */ 32); if (ret > 0) @@ -212,7 +215,7 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, if (ret <= 0) goto out; - if (ver == V25) { + if (ver == V25 || ver == VACE15) { ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) { fprintf(stderr, "error: failed to set rsa padding\n"); @@ -281,6 +284,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver } break; case V25: + /* fallthrough */ + case VACE15: /* decrypt signature */ ret = RSA_public_decrypt(RSA_size(priv_rsa), signature, sig, priv_rsa, RSA_NO_PADDING); @@ -339,6 +344,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver break; case V25: + /* fallthrough */ + case VACE15: ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) goto out; @@ -523,26 +530,14 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return ret; } -/* - * RSA signature of manifest. The signature is an RSA PSS - * of the entire manifest structure, including all - * extensions, and excluding the last 3 fields of the - * manifest header (Public Key, Exponent and Signature). - */ -#if OPENSSL_VERSION_NUMBER < 0x30000000L -int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA384_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -550,33 +545,12 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: PSS signing with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -595,25 +569,15 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, /* salt length */ 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to sign manifest %s\n", path); - } - - /* encrypt the signature using the private key */ - ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, - (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + ret = rimage_sign(privkey, image, V25, digest, + (unsigned char *)man->css.signature); if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to encrypt signature %s\n", path); + fprintf(stderr, "error: failed to sign manifest\n"); + return ret; } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reversed */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) @@ -625,20 +589,11 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, EVP_PKEY_free(privkey); return ret; } -#else -int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) -{ - return -EINVAL; -} -#endif -int pkcs_v1_5_sign_man_v2_5(struct image *image, - struct fw_image_manifest_v2_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { EVP_PKEY *privkey; unsigned char digest[SHA384_DIGEST_LENGTH]; @@ -674,7 +629,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = rimage_sign(privkey, image, V25, digest, + ret = rimage_sign(privkey, image, VACE15, digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); @@ -935,6 +890,59 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, return ret; } +int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + EVP_PKEY *privkey; + unsigned char digest[SHA384_DIGEST_LENGTH]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; + + /* validate RSA private key */ + if (rimage_check_key(privkey) > 0) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* verify */ + ret = rimage_verify(privkey, image, VACE15, digest, + (unsigned char *)man->css.signature); + + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + int ri_manifest_verify_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; From dcfd11bc4d5b85d258666825c287e62df790ab5d Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Mon, 10 Oct 2022 16:11:36 +0200 Subject: [PATCH 245/350] mux: add mux cfg to list of modules No mux in the manifest Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 54682ac9af00..a9c59932eb20 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 12 +count = 13 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -338,3 +338,21 @@ count = 12 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + + [[module.entry]] + name = "MUX" + uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] \ No newline at end of file From 1f4a36e21f0002b536a4a80d58d3f82ad034f291 Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Thu, 13 Oct 2022 14:49:22 +0200 Subject: [PATCH 246/350] mux: fix module type error: invalid type /error: key 'module' parsing error Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index a9c59932eb20..3e0d3b0f5841 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -346,7 +346,7 @@ count = 13 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "0xB" + module_type = "11" auto_start = "0" sched_caps = [1, 0x00008000] From 3ee717eebc6a2a512a0216363ae77473f94532c1 Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Thu, 13 Oct 2022 15:22:09 +0200 Subject: [PATCH 247/350] probe: mtl.toml invaliv probe type error: invalid type 16error: key 'module' parsing error probe module type is 10,which is treated hexally Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 3e0d3b0f5841..1066af98c329 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -332,7 +332,7 @@ count = 13 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "10" + module_type = "0xA" auto_start = "0" sched_caps = [1, 0x00008000] @@ -346,7 +346,7 @@ count = 13 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "11" + module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] From 85a2d1ebc9f54afecbb16fc2c47713c6156e521b Mon Sep 17 00:00:00 2001 From: Ievgen Ganakov <ievgen.ganakov@intel.com> Date: Tue, 8 Nov 2022 08:57:10 +0100 Subject: [PATCH 248/350] config: mtl: add kd module Add KD module config Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com> --- config/mtl.toml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 1066af98c329..5570dc810ad0 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 13 +count = 14 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -338,7 +338,7 @@ count = 13 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] - + [[module.entry]] name = "MUX" uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" @@ -354,5 +354,24 @@ count = 13 pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] \ No newline at end of file + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] From 6623073ca84dbc1e5ed7f30d9cceeb3b0161d67e Mon Sep 17 00:00:00 2001 From: Ievgen Ganakov <ievgen.ganakov@intel.com> Date: Tue, 8 Nov 2022 08:59:24 +0100 Subject: [PATCH 249/350] config: mtl: add kpb module Add KPB module config Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com> --- config/mtl.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 5570dc810ad0..0baff95c135a 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 14 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -375,3 +375,21 @@ count = 14 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xD" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] From f51ff46635ed62c6e5ac03b300eb564eb16ccf26 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 21 Nov 2022 13:50:23 +0800 Subject: [PATCH 250/350] rimage: remove incorrect module order check The original check for "i - 1 == type" is used to make sure that all modules in toml file are in order from 0 to max continuously. But the problem is that some modules are not supported now or some modules share the same module type of efx, so this check is incorrect. Signed-off-by: Rander Wang <rander.wang@intel.com> --- src/adsp_config.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 96152e185714..2f10e5c847da 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2201,13 +2201,6 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("module_type", NULL); - if (strcmp((char *)mod_man->name, "BRNGUP") && - strcmp((char *)mod_man->name, "BASEFW")) { - if (type != i - 1) { - log_err(ret, "error: invalid type %d", type); - return -EINVAL; - } - } header->module_type = type; ret = parse_scheduling(mod_entry, &ctx_entry, From fe5b959adbebaf66ba7c7c087b53412d6bea1f43 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Tue, 22 Nov 2022 14:12:33 +0800 Subject: [PATCH 251/350] rimage: correct module type Currently some module types are incorrect and it was set by the change sequence. The module type is used by windows driver not Linux driver. It is defined in the following enum definition in cavs_ext_manifest.h. UpDwMix module type is 5, Mux is 6 kpb is 11, and Selector is 12. The module ASRC, GAIN, PROBE are type of efx (9) according to spec. enum mod_type { ebasefw = 0, emixin, emixout, ecopier, epeakvol, eupdwmix, emux, esrc, ewov, efx, eaec, ekpb, emicselect, efxf, /*i.e.SmartAmp */ eaudclass, efakecopier, eiodriver, ewhm, egdbstub, esensing, emax, einvalid = emax } ; Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 0baff95c135a..6b5fa1fa9276 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -192,7 +192,7 @@ count = 15 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -217,7 +217,7 @@ count = 15 domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -288,7 +288,7 @@ count = 15 instance_count = "8" domain_types = "0" load_type = "0" - module_type = "8" + module_type = "12" auto_start = "0" sched_caps = [1, 0x00008000] @@ -307,7 +307,7 @@ count = 15 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "9" + module_type = "5" auto_start = "0" sched_caps = [1, 0x00008000] @@ -332,7 +332,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "0xA" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -346,7 +346,7 @@ count = 15 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "0xB" + module_type = "6" auto_start = "0" sched_caps = [1, 0x00008000] @@ -365,7 +365,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "1" - module_type = "0xC" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -383,7 +383,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "1" - module_type = "0xD" + module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] From 65f345a52e06a084192124364c563d8133d834c2 Mon Sep 17 00:00:00 2001 From: Gongjun Song <gongjun.song@intel.com> Date: Mon, 17 Oct 2022 19:01:40 +0800 Subject: [PATCH 252/350] rimage: add src support Add src's params to rimage Signed-off-by: Gongjun Song <gongjun.song@intel.com> --- config/tgl-cavs.toml | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 446a71255d5b..088271d74790 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 8 +count = 9 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -227,3 +227,42 @@ count = 8 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + [[module.entry]] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "1" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] From 082b6261c9dc54d0e5587a57f67b02d3d973fc8d Mon Sep 17 00:00:00 2001 From: Tinghan Shen <tinghan.shen@mediatek.com> Date: Tue, 28 Jun 2022 12:01:06 +0800 Subject: [PATCH 253/350] config: Add mt8188.toml Add mt8188.toml to support sof-mt8188.ri binary build. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> --- config/mt8188.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/mt8188.toml diff --git a/config/mt8188.toml b/config/mt8188.toml new file mode 100644 index 000000000000..0dcc4b4b3244 --- /dev/null +++ b/config/mt8188.toml @@ -0,0 +1,15 @@ +version = [1, 0] # parse_adsp_config_v1_0() + +[adsp] +name = "mt8188" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x4e100000" +size = "0x00080000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" From 1c48208850c91322b033d5d59fb1a0b4e6648e20 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 8 Dec 2022 13:44:22 +0800 Subject: [PATCH 254/350] config: tgl-cavs: add smart amp test module config This patch adds module config for smart amp test module. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/tgl-cavs.toml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 088271d74790..53bef8963cf2 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 9 +count = 10 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -266,3 +266,23 @@ count = 9 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From bdba8259fe3c557bf02008b0cb51d58ecf533188 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 23 Dec 2022 12:07:04 +0100 Subject: [PATCH 255/350] Add a command line option to set an Intel-specific PV bit Add a '-p' command line flag to set Intel reserved bit in IMR area. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 1 - src/rimage.c | 21 ++++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 2f10e5c847da..25091940afbf 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -929,7 +929,6 @@ static int parse_css_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, return ret; /* hardcoded to align with meu */ - out->reserved0 = 0; out->reserved1[0] = 0xf; out->reserved1[1] = 0x048e0000; // TODO: what is this ? diff --git a/src/rimage.c b/src/rimage.c index 617656852c83..96194977c367 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -31,6 +31,7 @@ static void usage(char *name) fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); fprintf(stdout, "\t -q resign binary\n"); + fprintf(stdout, "\t -p set PV bit\n"); } int main(int argc, char *argv[]) @@ -41,10 +42,11 @@ int main(int argc, char *argv[]) int opt, ret, i, first_non_opt; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; + unsigned int pv_bit = 0; memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -88,6 +90,9 @@ int main(int argc, char *argv[]) case 'q': image.in_file = optarg; break; + case 'p': + pv_bit = 1; + break; default: /* getopt's default error message is good enough */ return 1; @@ -163,15 +168,21 @@ int main(int argc, char *argv[]) return resign_image(&image); } - /* set IMR Type in found machine definition */ - if (image.adsp->man_v1_8) + /* set IMR Type and the PV bit in found machine definition */ + if (image.adsp->man_v1_8) { image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v1_8->css.reserved0 = pv_bit; + } - if (image.adsp->man_v2_5) + if (image.adsp->man_v2_5) { image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v2_5->css.reserved0 = pv_bit; + } - if (image.adsp->man_ace_v1_5) + if (image.adsp->man_ace_v1_5) { image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; + } /* parse input ELF files */ image.num_modules = argc - first_non_opt; From f3eef3cfb6ffd7d519d513e9cb28b52f063aaf89 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Tue, 3 Jan 2023 10:55:39 +0100 Subject: [PATCH 256/350] Fix IMR type parsing The IMR type can be specified either in the TOML configuration file or on the command line. The command line value should override the one from the configuration file. But the current code overwrites the configuration file value with the default value even if no value has been specified on the command line, which is wrong. Fix this by using the default value when reading the configuration file and only overwriting it when the respective command line parameter is used. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 6 ++++-- src/rimage.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 25091940afbf..8d213e93f7cd 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1579,7 +1579,8 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; @@ -1699,7 +1700,8 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; diff --git a/src/rimage.c b/src/rimage.c index 96194977c367..7c985e1570e4 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; unsigned int pv_bit = 0; + bool imr_type_override = false; memset(&image, 0, sizeof(image)); @@ -68,6 +69,7 @@ int main(int argc, char *argv[]) break; case 'i': imr_type = atoi(optarg); + imr_type_override = true; break; case 'f': image.fw_ver_string = optarg; @@ -170,17 +172,20 @@ int main(int argc, char *argv[]) /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { - image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; image.adsp->man_v1_8->css.reserved0 = pv_bit; } if (image.adsp->man_v2_5) { - image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_v2_5->css.reserved0 = pv_bit; } if (image.adsp->man_ace_v1_5) { - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; } From ba8534bb237881beb281c56f5d03d92fa67eb0ec Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 23 Dec 2022 16:02:33 +0100 Subject: [PATCH 257/350] Fix bitmap according to the IMR type When the IMR type is set to 4, the default bitmap field #4 must be 0x10. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 61 +++++++++++++++++++------------- src/include/rimage/adsp_config.h | 2 +- src/include/rimage/rimage.h | 4 ++- src/rimage.c | 13 +++---- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8d213e93f7cd..7f7fccb23146 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -974,8 +974,10 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) } static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext *out = &adsp->man_v1_8->signed_pkg; struct signed_pkg_info_module *mod; toml_array_t *bitmap_array; toml_array_t *module_array; @@ -1022,8 +1024,8 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* bitmap array */ bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { - /* default value */ - out->bitmap[4] = 8; + /* default value, depending on the IMR type */ + out->bitmap[4] = image->imr_type == 4 ? 0x10 : 0x8; } else { ++ctx.array_cnt; if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || @@ -1130,8 +1132,10 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p } static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext_v2_5 *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext_v2_5 *out = &adsp->man_v2_5->signed_pkg; struct signed_pkg_info_module_v2_5 *mod; toml_array_t *bitmap_array; toml_array_t *module_array; @@ -1178,8 +1182,8 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct /* bitmap array */ bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { - /* default value - some use 0x10*/ - out->bitmap[4] = 0x8; + /* default value, depending on the IMR type */ + out->bitmap[4] = image->imr_type == 4 ? 0x10 : 0x8; } else { ++ctx.array_cnt; if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || @@ -1281,8 +1285,10 @@ static void dump_signed_pkg_ace_v1_5(const struct signed_pkg_info_ext_ace_v1_5 * } static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext_ace_v1_5 *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext_ace_v1_5 *out = &adsp->man_ace_v1_5->signed_pkg; struct signed_pkg_info_module_ace_v1_5 *mod; toml_array_t *module_array; toml_table_t *signed_pkg; @@ -2240,9 +2246,10 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } -static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_0(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2267,9 +2274,10 @@ static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2333,9 +2341,10 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_8(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2370,7 +2379,7 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg(toml, &ctx, &out->man_v1_8->signed_pkg, verbose); + ret = parse_signed_pkg(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2394,9 +2403,10 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v2_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2431,7 +2441,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg_v2_5(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + ret = parse_signed_pkg_v2_5(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2459,9 +2469,10 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2495,7 +2506,7 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg_ace_v1_5(toml, &ctx, &out->man_ace_v1_5->signed_pkg, verbose); + ret = parse_signed_pkg_ace_v1_5(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2556,7 +2567,7 @@ static int parse_version(toml_table_t *toml, int64_t version[2]) struct config_parser { int major; int minor; - int (*parse)(const toml_table_t *toml, struct adsp *out, bool verbose); + int (*parse)(const toml_table_t *toml, struct image *image); }; static const struct config_parser *find_config_parser(int64_t version[2]) @@ -2580,7 +2591,7 @@ static const struct config_parser *find_config_parser(int64_t version[2]) return NULL; } -static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) +static int adsp_parse_config_fd(FILE *fd, struct image *image) { const struct config_parser *parser; int64_t manifest_version[2]; @@ -2607,14 +2618,14 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) } /* run dedicated parser */ - ret = parser->parse(toml, out, verbose); + ret = parser->parse(toml, image); error: toml_free(toml); return ret; } /* public function, fully handle parsing process */ -int adsp_parse_config(const char *file, struct adsp *out, bool verbose) +int adsp_parse_config(const char *file, struct image *image) { FILE *fd; int ret; @@ -2622,7 +2633,7 @@ int adsp_parse_config(const char *file, struct adsp *out, bool verbose) fd = fopen(file, "r"); if (!fd) return log_err(-EIO, "error: can't open '%s' file\n", file); - ret = adsp_parse_config_fd(fd, out, verbose); + ret = adsp_parse_config_fd(fd, image); fclose(fd); return ret; } diff --git a/src/include/rimage/adsp_config.h b/src/include/rimage/adsp_config.h index 8b98c1cb7087..e87c78c65f91 100644 --- a/src/include/rimage/adsp_config.h +++ b/src/include/rimage/adsp_config.h @@ -5,5 +5,5 @@ #include <rimage/rimage.h> #include <stdbool.h> -int adsp_parse_config(const char *file, struct adsp *out, bool verbose); +int adsp_parse_config(const char *file, struct image *image); void adsp_free(struct adsp *adsp); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e4117f3f3c6c..22fbda730cac 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -77,7 +77,7 @@ struct image { FILE *out_fd; void *pos; - const struct adsp *adsp; + struct adsp *adsp; int abi; int verbose; int reloc; /* ELF data is relocatable */ @@ -111,6 +111,8 @@ struct image { uint16_t fw_ver_minor; uint16_t fw_ver_micro; uint16_t fw_ver_build; + + uint32_t imr_type; }; struct mem_zone { diff --git a/src/rimage.c b/src/rimage.c index 7c985e1570e4..6aa4eabea844 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -40,13 +40,14 @@ int main(int argc, char *argv[]) struct adsp *heap_adsp; const char *adsp_config = NULL; int opt, ret, i, first_non_opt; - int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; unsigned int pv_bit = 0; bool imr_type_override = false; memset(&image, 0, sizeof(image)); + image.imr_type = MAN_DEFAULT_IMR_TYPE; + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { switch (opt) { case 'o': @@ -68,7 +69,7 @@ int main(int argc, char *argv[]) image.reloc = 1; break; case 'i': - imr_type = atoi(optarg); + image.imr_type = atoi(optarg); imr_type_override = true; break; case 'f': @@ -155,7 +156,7 @@ int main(int argc, char *argv[]) } image.adsp = heap_adsp; memset(heap_adsp, 0, sizeof(*heap_adsp)); - ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + ret = adsp_parse_config(adsp_config, &image); if (ret < 0) goto out; @@ -173,19 +174,19 @@ int main(int argc, char *argv[]) /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { if (imr_type_override) - image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v1_8->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_v1_8->css.reserved0 = pv_bit; } if (image.adsp->man_v2_5) { if (imr_type_override) - image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v2_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_v2_5->css.reserved0 = pv_bit; } if (image.adsp->man_ace_v1_5) { if (imr_type_override) - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; } From bdf48ee7e63779a804f709634e68d274090f510d Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 4 Jan 2023 21:05:31 +0200 Subject: [PATCH 258/350] config: tgl-cavs: add fir and iir eq module config This patch adds module config for fir and iir eq module. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- config/tgl-cavs.toml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 53bef8963cf2..d50c46fc45af 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 10 +count = 12 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -286,3 +286,41 @@ count = 10 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From bc7d49dcfc154996599586fffc366a7147ec804e Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Wed, 1 Feb 2023 13:04:30 +0800 Subject: [PATCH 259/350] config: align module_type with mtl for tgl and tgl-h The module_type member in module config should be assigned according to the mod_type enum. Previously, for tgl and tgl-h, it is assigned in an incremental way, which is wrong. MTL assigns module_type in the correct way, so align the module_type with mtl for tgl and tgl-h in this patch. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/tgl-cavs.toml | 6 +++--- config/tgl-h-cavs.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index d50c46fc45af..b787ee611ebe 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -196,7 +196,7 @@ count = 12 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -220,7 +220,7 @@ count = 12 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -275,7 +275,7 @@ count = 12 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "8" + module_type = "13" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index bb38c790e3dc..31b9d913b6d5 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -196,7 +196,7 @@ count = 8 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -220,7 +220,7 @@ count = 8 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] From 3da7739b5f0cd4e2d338910d5ac88d17babb3180 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Wed, 1 Feb 2023 13:22:48 +0800 Subject: [PATCH 260/350] config: correct module config load_type The load_type in extended manifest is used to indicate if a module is a built-in module(0) or a loadable(1) module. We don't have loadable module yet, so load_type should be zero for all modules. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 12 ++++++------ config/tgl-cavs.toml | 4 ++-- config/tgl-h-cavs.toml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 6b5fa1fa9276..23a4f02aad73 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -56,7 +56,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -66,7 +66,7 @@ count = 15 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -306,7 +306,7 @@ count = 15 affinity_mask = "0x1" instance_count = "15" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "5" auto_start = "0" sched_caps = [1, 0x00008000] @@ -345,7 +345,7 @@ count = 15 affinity_mask = "0x1" instance_count = "15" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "6" auto_start = "0" sched_caps = [1, 0x00008000] @@ -364,7 +364,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -382,7 +382,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index b787ee611ebe..6fcac3dc72e7 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -59,7 +59,7 @@ count = 12 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -69,7 +69,7 @@ count = 12 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 31b9d913b6d5..75429596e099 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -59,7 +59,7 @@ count = 8 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -69,7 +69,7 @@ count = 8 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" From 7bc3cfc946a04cbceebf7d0202a6d490c85dca72 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 31 Jan 2023 16:03:06 +0800 Subject: [PATCH 261/350] config: mtl: add smart amp test module config This patch adds smart amp test module config for mtl. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 23a4f02aad73..a805159446a7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -393,3 +393,23 @@ count = 15 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "13" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From ec649f37d661cb2853cf9e1338cc7f853b91e36d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 27 Jan 2023 12:59:42 +0100 Subject: [PATCH 262/350] Convert all ELF addresses to cached for calculations Rimage calculates sizes of ELF sections, for which it has to use addresses from the same address space: either all cached or all uncached. The ELF image itself can contain mixed addresses. Convert all to cached for internal calculations. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/tgl-cavs.toml | 8 +++++ src/adsp_config.c | 69 ++++++++++++++++++++++++++++++------- src/elf.c | 10 ++++-- src/include/rimage/rimage.h | 4 +++ 4 files changed, 76 insertions(+), 15 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 6fcac3dc72e7..4010f685d5f5 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -21,6 +22,13 @@ type = "LP-SRAM" base = "0xBE800000" size = "0x40" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/src/adsp_config.c b/src/adsp_config.c index 7f7fccb23146..7ad3ce4dbcdb 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -122,7 +122,7 @@ static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; - /* when eny field left unparsed, then raise error */ + /* when any field left unparsed, then raise error */ if (ctx->key_cnt != 0) ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); if (ctx->array_cnt != 0) @@ -360,14 +360,15 @@ static void dump_adsp(const struct adsp *adsp) static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct adsp *out, bool verbose) { - toml_array_t *mem_zone_array; - toml_table_t *mem_zone; + toml_array_t *mem_zone_array, *alias_array; struct mem_zone *zone; struct parse_ctx ctx; - char zone_name[32]; toml_table_t *adsp; toml_raw_t raw; int zone_idx; + char a_kind; + int a_size; + bool alias_found; int ret; int i; @@ -403,25 +404,67 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - /* check everything parsed, 1 table should be present */ - ctx.array_cnt += 1; + out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", 0, &ret); + alias_found = !ret; + + /* check everything parsed, 1 or 2 tables should be present */ + ctx.array_cnt += 1 + alias_found; ret = assert_everything_parsed(adsp, &ctx); if (ret < 0) return ret; + if (alias_found) { + alias_array = toml_array_in(adsp, "mem_alias"); + if (!alias_array) + return err_key_not_found("mem_alias"); + a_kind = toml_array_kind(alias_array); + a_size = toml_array_nelem(alias_array); + if (a_kind != 't' || a_size != 2) + return err_key_parse("mem_alias", "wrong array type %c or length %d", + a_kind, a_size); + + /* retrieve "cached" and "uncached" alias base addresses */ + for (i = 0; i < a_size; ++i) { + toml_table_t *alias = toml_table_at(alias_array, i); + char alias_name[16]; + uint32_t base; + + if (!alias) + return err_key_parse("mem_alias", NULL); + + parse_str_key(alias, &ctx, "type", alias_name, sizeof(alias_name), &ret); + if (ret < 0) + return err_key_parse("mem_alias", NULL); + + base = parse_uint32_hex_key(alias, &ctx, "base", -1, &ret); + + if (!strncmp("cached", alias_name, sizeof("cached"))) + out->alias_cached = base & out->alias_mask; + else if (!strncmp("uncached", alias_name, sizeof("uncached"))) + out->alias_uncached = base & out->alias_mask; + } + } else { + /* Make uncache_to_cache() an identity transform */ + out->alias_cached = 0; + out->alias_mask = 0; + } + /* look for entry array */ memset(out->mem_zones, 0, sizeof(out->mem_zones)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); - if (toml_array_kind(mem_zone_array) != 't' || - toml_array_nelem(mem_zone_array) > SOF_FW_BLK_TYPE_NUM) - return err_key_parse("mem_zone", "wrong array type or length > %d", - SOF_FW_BLK_TYPE_NUM); + a_kind = toml_array_kind(mem_zone_array); + a_size = toml_array_nelem(mem_zone_array); + if (a_kind != 't' || a_size > SOF_FW_BLK_TYPE_NUM) + return err_key_parse("mem_zone", "wrong array type %c or length %d", + a_kind, a_size); /* parse entry array elements */ - for (i = 0; i < toml_array_nelem(mem_zone_array); ++i) { - mem_zone = toml_table_at(mem_zone_array, i); + for (i = 0; i < a_size; ++i) { + toml_table_t *mem_zone = toml_table_at(mem_zone_array, i); + char zone_name[32]; + if (!mem_zone) return err_key_parse("mem_zone", NULL); @@ -2617,7 +2660,7 @@ static int adsp_parse_config_fd(FILE *fd, struct image *image) goto error; } - /* run dedicated parser */ + /* run dedicated toml configuration parser */ ret = parser->parse(toml, image); error: toml_free(toml); diff --git a/src/elf.c b/src/elf.c index fc9232b66578..4218c025df54 100644 --- a/src/elf.c +++ b/src/elf.c @@ -12,6 +12,11 @@ #include <rimage/cse.h> #include <rimage/manifest.h> +static unsigned long uncache_to_cache(const struct image *image, unsigned long address) +{ + return ((address & ~image->adsp->alias_mask) | image->adsp->alias_cached); +} + static int elf_read_sections(struct image *image, struct module *module, int module_index) { @@ -110,6 +115,7 @@ static int elf_read_sections(struct image *image, struct module *module, continue; } + section[i].vaddr = uncache_to_cache(image, section[i].vaddr); module->num_sections++; if (!image->verbose) @@ -367,8 +373,8 @@ static void elf_module_limits(struct image *image, struct module *module) /* check programs to get LMA */ section_lma = section->vaddr; for (j = 0; j < module->hdr.phnum; j++) { - if (section->vaddr == module->prg[j].vaddr) { - section_lma = module->prg[j].paddr; + if (section->vaddr == uncache_to_cache(image, module->prg[j].vaddr)) { + section_lma = uncache_to_cache(image, module->prg[j].paddr); break; } } diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 22fbda730cac..8c4f2e98446c 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -153,6 +153,10 @@ struct adsp { uint32_t image_size; uint32_t dram_offset; + uint32_t alias_cached; + uint32_t alias_uncached; + uint32_t alias_mask; + int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From 15ea48177a2b4cb93eaa9858e90a4da89f9f84b1 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:02:55 -0800 Subject: [PATCH 263/350] src: adsp_config: Use reserved bits for module init config Use some of the reserved bits to add a new field, init_config, in struct sof_man_module_type. This will be used to specify the type of payload that the module expects. For now, the 2 options are to have the base config only or the base config with an extension that contains the pin formats. This can be extended in the future to support additional options for modules that need more than the base config or base config + extension. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/adsp_config.c | 5 +++++ src/include/rimage/sof/user/manifest.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 7ad3ce4dbcdb..76de00a5428a 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2236,6 +2236,11 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("load_type", NULL); + mod_man->type.init_config = parse_uint32_hex_key(mod_entry, &ctx_entry, + "init_config", 1, &ret); + if (ret < 0) + return err_key_parse("init_config", NULL); + mod_man->type.auto_start = parse_uint32_hex_key(mod_entry, &ctx_entry, "auto_start", 1, &ret); if (ret < 0) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index 9d410ca3cf86..e49a76f76fcb 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -26,13 +26,18 @@ #define SOF_MAN_MOD_TYPE_BUILTIN 0 #define SOF_MAN_MOD_TYPE_MODULE 1 +/* module init config */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG 0 /* Base config only */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG_WITH_EXT 1 /* Base config with extension */ + struct sof_man_module_type { uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ uint32_t auto_start:1; uint32_t domain_ll:1; uint32_t domain_dp:1; uint32_t lib_code:1; - uint32_t rsvd_:24; + uint32_t init_config:4; /* SOF_MAN_MOD_INIT_CONFIG_ */ + uint32_t rsvd_:20; }; /* segment flags.type */ From b5d762290f1aed7bb02b60dd5139169ccea09e4f Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:05:51 -0800 Subject: [PATCH 264/350] config: tgl-cavs: set init_config for smart test Smart amp needs the base config extension during init. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/tgl-cavs.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 4010f685d5f5..8b5960d52923 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -284,6 +284,7 @@ count = 12 domain_types = "0" load_type = "0" module_type = "13" + init_config = "1" auto_start = "0" sched_caps = [1, 0x00008000] From d48ae7aadaa4806a12cc3a73b8d28ceb232911ce Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:06:49 -0800 Subject: [PATCH 265/350] config: mtl: Set init_config for smart amp Smart amp needs the base config extension during module init. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/mtl.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mtl.toml b/config/mtl.toml index a805159446a7..758f6f34de11 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -402,6 +402,7 @@ count = 16 instance_count = "1" domain_types = "0" load_type = "0" + init_config = "1" module_type = "13" auto_start = "0" sched_caps = [1, 0x00008000] From def9d51d7d8186e8f70e5f15dbc1752cee1deb64 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Thu, 9 Feb 2023 14:49:54 +0100 Subject: [PATCH 266/350] Fix regression - make default return code an error A recent commit ec649f37d661 ("Convert all ELF addresses to cached for calculations") had a bug: it assumed a call to parse_uint32_hex_key() for an absent key would return an error by default, which isn't the case. To force it set the default return code to an error value. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 76de00a5428a..c02ea04c9458 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -404,7 +404,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", 0, &ret); + out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); alias_found = !ret; /* check everything parsed, 1 or 2 tables should be present */ From 9b507ecc82d9d9db1b8d4c72809de4fc8c05d77d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Thu, 9 Feb 2023 15:45:35 +0100 Subject: [PATCH 267/350] config: set cached and uncached aliases for affected platforms Set cached and uncached address aliases for all Intel ADSP platforms, supported by Zephyr. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/mtl.toml | 8 ++++++++ config/tgl-h-cavs.toml | 8 ++++++++ config/tgl-h.toml | 8 ++++++++ config/tgl.toml | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/config/mtl.toml b/config/mtl.toml index 758f6f34de11..ee50cbfe083c 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -3,6 +3,7 @@ version = [3, 0] [adsp] name = "mtl" image_size = "0x2C0000" # (22) bank * 128KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xa00f0000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x40000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xA0000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 75429596e099..cab16a4365a8 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -21,6 +22,13 @@ type = "LP-SRAM" base = "0xBE800000" size = "0x40" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 908c3bfc8a1f..997e1a832899 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index d6183faf5345..9a64c694c7f8 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] From 1e0a85b44a19db37f9dd18906091d87abd8bd5e6 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 10 Feb 2023 08:42:49 -0800 Subject: [PATCH 268/350] config:tgl/tglh: Do not set cached/uncached address aliases tgl.toml and tgl-h.toml are only used for xtos builds. Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/tgl-h.toml | 8 -------- config/tgl.toml | 8 -------- 2 files changed, 16 deletions(-) diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 997e1a832899..908c3bfc8a1f 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,7 +3,6 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB -alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,13 +17,6 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" -[[adsp.mem_alias]] -type = "uncached" -base = "0x9E000000" -[[adsp.mem_alias]] -type = "cached" -base = "0xBE000000" - [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index 9a64c694c7f8..d6183faf5345 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,7 +3,6 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB -alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,13 +17,6 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" -[[adsp.mem_alias]] -type = "uncached" -base = "0x9E000000" -[[adsp.mem_alias]] -type = "cached" -base = "0xBE000000" - [cse] partition_name = "ADSP" [[cse.entry]] From 3863e94fa5d361e434f404655dac17541dbf20c6 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Mon, 13 Feb 2023 12:29:29 +0100 Subject: [PATCH 269/350] Don't convert ROM addresses to cached aliases We don't include ROM sections into the output image. If conversion is applied to them, they end up in the SRAM address range, which then generates corrupted images. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/elf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/elf.c b/src/elf.c index 4218c025df54..9b51c5f87b08 100644 --- a/src/elf.c +++ b/src/elf.c @@ -14,7 +14,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { - return ((address & ~image->adsp->alias_mask) | image->adsp->alias_cached); + return (address & ~image->adsp->alias_mask) | image->adsp->alias_cached; } static int elf_read_sections(struct image *image, struct module *module, @@ -25,6 +25,8 @@ static int elf_read_sections(struct image *image, struct module *module, size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + unsigned long rom_base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; + size_t rom_size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -115,7 +117,13 @@ static int elf_read_sections(struct image *image, struct module *module, continue; } - section[i].vaddr = uncache_to_cache(image, section[i].vaddr); + /* + * Don't convert ROM addresses, ROM sections aren't included in + * the output image + */ + if (section[i].vaddr < rom_base || section[i].vaddr >= rom_base + rom_size) + section[i].vaddr = uncache_to_cache(image, section[i].vaddr); + module->num_sections++; if (!image->verbose) From bf23b5ea00b6a3a1a4cb6aea14f517acd1114a8c Mon Sep 17 00:00:00 2001 From: Libin Yang <libin.yang@intel.com> Date: Thu, 2 Feb 2023 09:11:54 +0800 Subject: [PATCH 270/350] config: mtl: set KDTEST module_type to 8 KDTEST module_type should be 8 Signed-off-by: Libin Yang <libin.yang@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index ee50cbfe083c..61d9b52ddd2d 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -373,7 +373,7 @@ count = 16 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "9" + module_type = "8" auto_start = "0" sched_caps = [1, 0x00008000] From cb9c880b6e8d74c32b8fbfc2a0a6ff2b030df0e9 Mon Sep 17 00:00:00 2001 From: Libin Yang <libin.yang@intel.com> Date: Sun, 29 Jan 2023 14:19:41 +0800 Subject: [PATCH 271/350] config: tgl-cavs: add kpb, selector and kd support Add KPB, Selector and KD module config Signed-off-by: Libin Yang <libin.yang@intel.com> --- config/tgl-cavs.toml | 57 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8b5960d52923..5b10f0869c4b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 12 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -333,3 +333,58 @@ count = 12 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "12" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From ffd0542127bc101b8a09f09a92a9f193f2be260e Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 14 Feb 2023 15:14:19 +0800 Subject: [PATCH 272/350] adsp_config: make the default value zero for init_config The init_config is used to indicate if base config extension is used (1) or not (0). Its default value is used if not specified in module config, the default value for init_config should be zero instead of one. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c02ea04c9458..c2970edfa348 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2237,7 +2237,7 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, return err_key_parse("load_type", NULL); mod_man->type.init_config = parse_uint32_hex_key(mod_entry, &ctx_entry, - "init_config", 1, &ret); + "init_config", 0, &ret); if (ret < 0) return err_key_parse("init_config", NULL); From d48ad6b67baf23fbbb65fa95493cac486071d8a2 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 14 Feb 2023 15:17:44 +0800 Subject: [PATCH 273/350] adsp_config: add dump for init_config This patch adds dump for init_config for debug. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/adsp_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index c2970edfa348..e1f7e5ac41d9 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2124,6 +2124,7 @@ static void dump_module(struct fw_image_manifest_module *man_cavs) for (i = 0; i < man_cavs->mod_man_count; i++) { DUMP_PRINTABLE_BYTES("module name", man_cavs->mod_man[i].name); DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); + DUMP_KEY("init config", "%d", man_cavs->mod_man[i].type.init_config); DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); DUMP_KEY("config count", "%d", man_cavs->mod_man[i].cfg_count); From 3aa199fb07b7d14cb31c5697ccf8b9be9c363d39 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 16 Feb 2023 17:46:38 +0800 Subject: [PATCH 274/350] config: mtl: set init_config for micsel The micsel module will use base config extension, init_config should be one for it. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mtl.toml b/config/mtl.toml index 61d9b52ddd2d..8d8f63a2d2fa 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -296,6 +296,7 @@ count = 16 instance_count = "8" domain_types = "0" load_type = "0" + init_config = "1" module_type = "12" auto_start = "0" sched_caps = [1, 0x00008000] From 0931d9cc4be979142daf50793d137dedece1e885 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 16 Feb 2023 16:50:57 +0100 Subject: [PATCH 275/350] main: heap_adsp release fix In image re-signing mode or if there are no input files, the memory allocated for heap_adsp was not released. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/rimage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 6aa4eabea844..4ec34a856840 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -168,7 +168,8 @@ int main(int argc, char *argv[]) if (image.in_file) { fprintf(stdout, "going to re-sign\n"); - return resign_image(&image); + ret = resign_image(&image); + goto out; } /* set IMR Type and the PV bit in found machine definition */ @@ -196,7 +197,8 @@ int main(int argc, char *argv[]) if (image.num_modules <= 0) { fprintf(stderr, "error: requires at least one ELF input module\n"); - return -EINVAL; + ret = -EINVAL; + goto out; } /* getopt reorders argv[] */ From fed69d453f7eec28f62f4ea14bd422480c03756f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 23 Feb 2023 17:27:25 +0100 Subject: [PATCH 276/350] toml_utils: adsp_config: Moved generic parser functions to toml_utils A set of functions which make it easier to parse toml files has been separated into a new file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/adsp_config.c | 337 +------------------------------ src/include/rimage/toml_utils.h | 121 ++++++++++++ src/toml_utils.c | 341 ++++++++++++++++++++++++++++++++ 4 files changed, 464 insertions(+), 336 deletions(-) create mode 100644 src/include/rimage/toml_utils.h create mode 100644 src/toml_utils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e253d8d1b50..3001ebc790e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(rimage src/ext_manifest.c src/elf.c src/rimage.c + src/toml_utils.c src/adsp_config.c tomlc99/toml.c ) diff --git a/src/adsp_config.c b/src/adsp_config.c index e1f7e5ac41d9..9c4c94c50be2 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -14,6 +14,7 @@ #include "rimage/rimage.h" #include "rimage/cse.h" #include "rimage/css.h" +#include "rimage/toml_utils.h" #include "toml.h" #include <stdbool.h> #include <stdint.h> @@ -22,291 +23,6 @@ #include <errno.h> #include <ctype.h> -/* macros used to dump values after parsing */ -#define DUMP_KEY_FMT " %20s: " -#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) -#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) - -static void print_bytes(FILE *out, const uint8_t *arr, size_t len) -{ - for (const uint8_t *pos = arr; pos < arr + len; pos++) { - char c = *pos; - - if (isprint(c)) - fputc(c, out); - else - fprintf(out, "\\x%.2x", c); - } -} - -#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) - -static void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) -{ - printf(DUMP_KEY_FMT, name); - print_bytes(stdout, arr, len); - printf("\n"); -} - -/** parser counter, used to assert nothing left unparsed in toml data */ -struct parse_ctx { - int key_cnt; /**< number of parsed key */ - int table_cnt; /**< number of parsed tables */ - int array_cnt; /**< number of parsed arrays */ -}; - -/** private parser error trace function */ -static void vlog_err(const char *msg, va_list vl) -{ - vfprintf(stderr, msg, vl); -} - -/** parser error trace function, error code is returned to shorten client code */ -static int log_err(int err_code, const char *msg, ...) -{ - va_list vl; - - va_start(vl, msg); - vlog_err(msg, vl); - va_end(vl); - return err_code; -} - -/** log malloc error message for given key */ -static int err_malloc(const char *key) -{ - return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); -} - -/** log key not found error */ -static int err_key_not_found(const char *key) -{ - return log_err(-EINVAL, "error: '%s' not found\n", key); -} - -/** error during parsing key value, possible detailed message */ -static int err_key_parse(const char *key, const char *extra_msg, ...) -{ - int ret = -EINVAL; - va_list vl; - - if (extra_msg) { - log_err(ret, "error: key '%s' parsing error, ", key); - va_start(vl, extra_msg); - vlog_err(extra_msg, vl); - va_end(vl); - return log_err(ret, "\n"); - } else { - return log_err(ret, "error: key '%s' parsing error\n", key); - } -} - -/** initialize parser context before parsing */ -static void parse_ctx_init(struct parse_ctx *ctx) -{ - memset(ctx, 0, sizeof(*ctx)); -} - -/** check nothing left unparsed in given parsing context */ -static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) -{ - const char *key = toml_table_key(table); - int ret = 0; - - /* toml_table_key returns NULL for global context */ - if (!key) - key = "toml"; - - /* from number of parsed fields subtract fields count in given table */ - ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; - ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; - ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; - - /* when any field left unparsed, then raise error */ - if (ctx->key_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); - if (ctx->array_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, - key); - if (ctx->table_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, - key); - return ret; -} - -/** - * Parse hex value from key in given toml table - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param def is default value or -1 when value don't have default value - * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value for error cases - */ -static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, - const char *key, int64_t def, int *error) -{ - toml_raw_t raw; - char *temp_s; - uint32_t val; - int ret; - - /* look for key in given table, assign def value when key not found */ - raw = toml_raw_in(table, key); - if (!raw) { - if (def < 0 || def > UINT32_MAX) { - *error = err_key_not_found(key); - return UINT32_MAX; - } else { - *error = 0; - return (uint32_t)def; - } - } - /* there is not build-in support for hex numbers in toml, so read then as string */ - ret = toml_rtos(raw, &temp_s); - if (ret < 0) { - *error = err_key_parse(key, NULL); - return UINT32_MAX; - } - val = strtoul(temp_s, 0, 16); - - free(temp_s); - /* assert parsing success and value is within uint32_t range */ - if (errno < 0) { - *error = err_key_parse(key, "can't convert hex value"); - return UINT32_MAX; - } - - /* set success error code and increment parsed key counter */ - *error = 0; - ++ctx->key_cnt; - return (uint32_t)val; -} - -/** - * Parse integer value from key in given toml table - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param def is default value or -1 when value don't have default value - * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value for error cases - */ -static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - int64_t def, int *error) -{ - toml_raw_t raw; - int64_t val; - int ret; - - /* look for key in given table, assign def value when key not found */ - raw = toml_raw_in(table, key); - if (!raw) { - if (def < 0 || def > UINT32_MAX) { - *error = err_key_not_found(key); - return UINT32_MAX; - } else { - *error = 0; - return (uint32_t)def; - } - } - /* there is build-in support for integer numbers in toml, so use lib function */ - ret = toml_rtoi(raw, &val); - if (ret < 0) { - *error = err_key_parse(key, "can't convert to integer value"); - return UINT32_MAX; - } - /* assert value is within uint32_t range */ - if (val < 0 || val > UINT32_MAX) { - *error = log_err(-ERANGE, "key %s out of uint32_t range", key); - return UINT32_MAX; - } - /* set success error code and increment parsed key counter */ - *error = 0; - ++ctx->key_cnt; - return (uint32_t)val; -} - -/** - * Parse string value from key in given toml table to uint8_t array. The - * destination is NOT a string because it is padded with zeros if and - * only if there is some capacity left. For string destinations use - * parse_str_key(). - * - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param dst uint8_t[] destination - * @param capacity dst array size - * @param error code, 0 when success - */ -static void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - uint8_t *dst, int capacity, int *error) -{ - toml_raw_t raw; - char *temp_s; - int len; - int ret; - - /* look for key in given table */ - raw = toml_raw_in(table, key); - if (!raw) { - *error = err_key_not_found(key); - return; - } - /* read string from toml, theres malloc inside toml_rtos() */ - ret = toml_rtos(raw, &temp_s); - if (ret < 0) { - *error = err_key_parse(key, NULL); - return; - } - - len = strlen(temp_s); - if (len > capacity) { - if (len > 20) { - static const char ellipsis[] = "..."; - const size_t el_len = sizeof(ellipsis); - - strncpy(temp_s + 20 - el_len, ellipsis, el_len); - } - - *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", - temp_s, key, len, capacity); - free(temp_s); - return; - } - - /* copy string to dst, pad with zeros the space left if any */ - strncpy((char *)dst, temp_s, capacity); - free(temp_s); - /* update parsing context */ - ++ctx->key_cnt; - *error = 0; -} - -/** - * Parse string value from key in given toml table to given - * char[]. Destination is padded with zeros. As the only difference with - * parse_printable_key(), dst is guaranteed to be null-terminated when - * there is no error because the last destination byte is reserved for - * that. - * - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param dst char[] destination - * @param capacity dst array size including null termination. - * @param error code, 0 when success - */ -static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - char *dst, int capacity, int *error) -{ - parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); - if (*error) /* return immediately to help forensics */ - return; - dst[capacity - 1] = 0; -} - /* map memory zone string name to enum value */ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) { @@ -2092,27 +1808,6 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx return 0; } -static void parse_uuid(char *buf, uint8_t *uuid) -{ - struct uuid_t id; - uint32_t d[10]; - - sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], - &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); - id.d1 = (uint16_t)d[0]; - id.d2 = (uint16_t)d[1]; - id.d3 = (uint8_t)d[2]; - id.d4 = (uint8_t)d[3]; - id.d5 = (uint8_t)d[4]; - id.d6 = (uint8_t)d[5]; - id.d7 = (uint8_t)d[6]; - id.d8 = (uint8_t)d[7]; - id.d9 = (uint8_t)d[8]; - id.d10 = (uint8_t)d[9]; - - memcpy(uuid, &id, sizeof(id)); -} - static void dump_module(struct fw_image_manifest_module *man_cavs) { int i; @@ -2583,36 +2278,6 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *im return 0; } -/** version is stored as toml array with integer number, something like: - * "version = [1, 8]" - */ -static int parse_version(toml_table_t *toml, int64_t version[2]) -{ - toml_array_t *arr; - toml_raw_t raw; - int ret; - int i; - - /* check "version" key */ - arr = toml_array_in(toml, "version"); - if (!arr) - return err_key_not_found("version"); - if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || - toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type or length != 2"); - - /* parse "version" array elements */ - for (i = 0; i < 2; ++i) { - raw = toml_raw_at(arr, i); - if (raw == 0) - return err_key_parse("version", NULL); - ret = toml_rtoi(raw, &version[i]); - if (ret < 0) - return err_key_parse("version", "can't convert element to integer"); - } - return 0; -} - struct config_parser { int major; int minor; diff --git a/src/include/rimage/toml_utils.h b/src/include/rimage/toml_utils.h new file mode 100644 index 000000000000..cd17bb4af28d --- /dev/null +++ b/src/include/rimage/toml_utils.h @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + * Marc Herbert <marc.herbert@intel.com> + */ + +#ifndef __TOML_UTILS_H__ +#define __TOML_UTILS_H__ + +#include "toml.h" + +#include <stdint.h> +#include <stdio.h> +#include <stdarg.h> + +/** parser counter, used to assert nothing left unparsed in toml data */ +struct parse_ctx { + int key_cnt; /**< number of parsed key */ + int table_cnt; /**< number of parsed tables */ + int array_cnt; /**< number of parsed arrays */ +}; + +/* macros used to dump values after parsing */ +#define DUMP_KEY_FMT " %20s: " +#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) +#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) + +void print_bytes(FILE *out, const uint8_t *arr, size_t len); + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len); + +/** private parser error trace function */ +void vlog_err(const char *msg, va_list vl); + +/** parser error trace function, error code is returned to shorten client code */ +int log_err(int err_code, const char *msg, ...); + +/** log malloc error message for given key */ +int err_malloc(const char *key); + +/** log key not found error */ +int err_key_not_found(const char *key); + +/** error during parsing key value, possible detailed message */ +int err_key_parse(const char *key, const char *extra_msg, ...); + +/** initialize parser context before parsing */ +void parse_ctx_init(struct parse_ctx *ctx); + +/** check nothing left unparsed in given parsing context */ +int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx); + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error); + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error); + +/** + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst uint8_t[] destination + * @param capacity dst array size + * @param error code, 0 when success + */ +void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error); + +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error); + +void parse_uuid(char *buf, uint8_t *uuid); + +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +int parse_version(toml_table_t *toml, int64_t version[2]); + +#endif /* __TOML_UTILS_H__ */ diff --git a/src/toml_utils.c b/src/toml_utils.c new file mode 100644 index 000000000000..85567f3d8caa --- /dev/null +++ b/src/toml_utils.c @@ -0,0 +1,341 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + * Marc Herbert <marc.herbert@intel.com> + */ + +#include "toml.h" +#include <rimage/toml_utils.h> +#include <rimage/cavs/cavs_ext_manifest.h> + +#include <errno.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> +#include <stdarg.h> + +void print_bytes(FILE *out, const uint8_t *arr, size_t len) +{ + for (const uint8_t *pos = arr; pos < arr + len; pos++) { + char c = *pos; + + if (isprint(c)) + fputc(c, out); + else + fprintf(out, "\\x%.2x", c); + } +} + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) +{ + printf(DUMP_KEY_FMT, name); + print_bytes(stdout, arr, len); + printf("\n"); +} + +/** private parser error trace function */ +void vlog_err(const char *msg, va_list vl) +{ + vfprintf(stderr, msg, vl); +} + +/** parser error trace function, error code is returned to shorten client code */ +int log_err(int err_code, const char *msg, ...) +{ + va_list vl; + + va_start(vl, msg); + vlog_err(msg, vl); + va_end(vl); + return err_code; +} + +/** log malloc error message for given key */ +int err_malloc(const char *key) +{ + return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); +} + +/** log key not found error */ +int err_key_not_found(const char *key) +{ + return log_err(-EINVAL, "error: '%s' not found\n", key); +} + +/** error during parsing key value, possible detailed message */ +int err_key_parse(const char *key, const char *extra_msg, ...) +{ + int ret = -EINVAL; + va_list vl; + + if (extra_msg) { + log_err(ret, "error: key '%s' parsing error, ", key); + va_start(vl, extra_msg); + vlog_err(extra_msg, vl); + va_end(vl); + return log_err(ret, "\n"); + } else { + return log_err(ret, "error: key '%s' parsing error\n", key); + } +} + +/** initialize parser context before parsing */ +void parse_ctx_init(struct parse_ctx *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +/** check nothing left unparsed in given parsing context */ +int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) +{ + const char *key = toml_table_key(table); + int ret = 0; + + /* toml_table_key returns NULL for global context */ + if (!key) + key = "toml"; + + /* from number of parsed fields subtract fields count in given table */ + ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; + ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; + ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; + + /* when any field left unparsed, then raise error */ + if (ctx->key_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); + if (ctx->array_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, + key); + if (ctx->table_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, + key); + return ret; +} + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error) +{ + toml_raw_t raw; + char *temp_s; + uint32_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + return UINT32_MAX; + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is not build-in support for hex numbers in toml, so read then as string */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return UINT32_MAX; + } + val = strtoul(temp_s, 0, 16); + + free(temp_s); + /* assert parsing success and value is within uint32_t range */ + if (errno < 0) { + *error = err_key_parse(key, "can't convert hex value"); + return UINT32_MAX; + } + + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) +{ + toml_raw_t raw; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + return UINT32_MAX; + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is build-in support for integer numbers in toml, so use lib function */ + ret = toml_rtoi(raw, &val); + if (ret < 0) { + *error = err_key_parse(key, "can't convert to integer value"); + return UINT32_MAX; + } + /* assert value is within uint32_t range */ + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst uint8_t[] destination + * @param capacity dst array size + * @param error code, 0 when success + */ +void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error) +{ + toml_raw_t raw; + char *temp_s; + int len; + int ret; + + /* look for key in given table */ + raw = toml_raw_in(table, key); + if (!raw) { + *error = err_key_not_found(key); + return; + } + /* read string from toml, theres malloc inside toml_rtos() */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return; + } + + len = strlen(temp_s); + if (len > capacity) { + if (len > 20) { + static const char ellipsis[] = "..."; + const size_t el_len = sizeof(ellipsis); + + strncpy(temp_s + 20 - el_len, ellipsis, el_len); + } + + *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", + temp_s, key, len, capacity); + free(temp_s); + return; + } + + /* copy string to dst, pad with zeros the space left if any */ + strncpy((char *)dst, temp_s, capacity); + free(temp_s); + /* update parsing context */ + ++ctx->key_cnt; + *error = 0; +} + +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); + if (*error) /* return immediately to help forensics */ + return; + dst[capacity - 1] = 0; +} + +void parse_uuid(char *buf, uint8_t *uuid) +{ + struct uuid_t id; + uint32_t d[10]; + + sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], + &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + id.d1 = (uint16_t)d[0]; + id.d2 = (uint16_t)d[1]; + id.d3 = (uint8_t)d[2]; + id.d4 = (uint8_t)d[3]; + id.d5 = (uint8_t)d[4]; + id.d6 = (uint8_t)d[5]; + id.d7 = (uint8_t)d[6]; + id.d8 = (uint8_t)d[7]; + id.d9 = (uint8_t)d[8]; + id.d10 = (uint8_t)d[9]; + + memcpy(uuid, &id, sizeof(id)); +} + +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +int parse_version(toml_table_t *toml, int64_t version[2]) +{ + toml_array_t *arr; + toml_raw_t raw; + int ret; + int i; + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + /* parse "version" array elements */ + for (i = 0; i < 2; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + return err_key_parse("version", NULL); + ret = toml_rtoi(raw, &version[i]); + if (ret < 0) + return err_key_parse("version", "can't convert element to integer"); + } + return 0; +} From 055ea7eca8dce0d15026045e5551f5e8c6cb55ca Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:01:27 +0100 Subject: [PATCH 277/350] file_utils: manifest: ext_manifest: Add new create_file_name function A new function create_file_name has been created that prepares the name of the output file with the given extensions. Unlike the previous solution, it checks whether the new name will fit in the output buffer. A new file_utils.c file has been prepared, into which generic functions to simplify the use of files will be moved. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/ext_manifest.c | 11 +++++++--- src/file_utils.c | 38 +++++++++++++++++++++++++++++++++ src/include/rimage/file_utils.h | 22 +++++++++++++++++++ src/manifest.c | 26 ++++++++++++++++------ 5 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 src/file_utils.c create mode 100644 src/include/rimage/file_utils.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 3001ebc790e3..f43150c0d64e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(rimage src/rimage.c src/toml_utils.c src/adsp_config.c + src/file_utils.c tomlc99/toml.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 962415674f11..de920422196f 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -14,6 +14,7 @@ #include <rimage/rimage.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, @@ -24,10 +25,14 @@ const struct ext_man_header ext_man_template = { static int ext_man_open_file(struct image *image) { - /* open extended manifest outfile for writing */ - sprintf(image->out_ext_man_file, "%s.xman", image->out_file); - unlink(image->out_ext_man_file); + int ret; + ret = create_file_name(image->out_ext_man_file, sizeof(image->out_ext_man_file), + image->out_file, "xman"); + if (ret) + return ret; + + /* open extended manifest outfile for writing */ image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); if (!image->out_ext_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", diff --git a/src/file_utils.c b/src/file_utils.c new file mode 100644 index 000000000000..a71236cf9c5e --- /dev/null +++ b/src/file_utils.c @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018-2023 Intel Corporation. All rights reserved. +// +// Author: Adrian Warecki <adrian.warecki@intel.com> + +#include <stdio.h> +#include <unistd.h> +#include <errno.h> +#include <assert.h> + +#include <rimage/file_utils.h> + +/** + * Create new file name using output file name as template. + * @param [out] new_name char[] destination of new file name + * @param [in] name_size new file name buffer capacity + * @param [in] template_name File name used as a template for the new name + * @param [in] new_ext extension of the new file name + * @param error code, 0 when success + */ +int create_file_name(char *new_name, const size_t name_size, const char *template_name, + const char *new_ext) +{ + int len; + + assert(new_name); + + len = snprintf(new_name, name_size, "%s.%s", template_name, new_ext); + if (len >= name_size) { + fprintf(stderr, "error: output file name too long\n"); + return -ENAMETOOLONG; + } + + unlink(new_name); + + return 0; +} diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h new file mode 100644 index 000000000000..702568044766 --- /dev/null +++ b/src/include/rimage/file_utils.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#ifndef __FILE_UTILS_H__ +#define __FILE_UTILS_H__ + +#include <stddef.h> + +/** + * Create new file name using output file name as template. + * @param [out] new_name char[] destination of new file name + * @param [in] name_size new file name buffer capacity + * @param [in] template_name File name used as a template for the new name + * @param [in] new_ext extension of the new file name + * @param error code, 0 when success + */ +int create_file_name(char *new_name, const size_t name_size, const char *template_name, + const char *new_ext); + +#endif /* __FILE_UTILS_H__ */ diff --git a/src/manifest.c b/src/manifest.c index c7a37266f198..9e985bda2685 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -22,13 +22,17 @@ #include <rimage/cse.h> #include <rimage/plat_auth.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static int man_open_rom_file(struct image *image) { uint32_t size; + int ret; - sprintf(image->out_rom_file, "%s.rom", image->out_file); - unlink(image->out_rom_file); + ret = create_file_name(image->out_rom_file, sizeof(image->out_rom_file), image->out_file, + "rom"); + if (ret) + return ret; size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; @@ -50,8 +54,12 @@ static int man_open_rom_file(struct image *image) static int man_open_unsigned_file(struct image *image) { - sprintf(image->out_unsigned_file, "%s.uns", image->out_file); - unlink(image->out_unsigned_file); + int ret; + + ret = create_file_name(image->out_unsigned_file, sizeof(image->out_unsigned_file), + image->out_file, "uns"); + if (ret) + return ret; /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); @@ -66,10 +74,14 @@ static int man_open_unsigned_file(struct image *image) static int man_open_manifest_file(struct image *image) { - /* open manifest outfile for writing */ - sprintf(image->out_man_file, "%s.met", image->out_file); - unlink(image->out_man_file); + int ret; + ret = create_file_name(image->out_man_file, sizeof(image->out_man_file), image->out_file, + "met"); + if (ret) + return ret; + + /* open manifest outfile for writing */ image->out_man_fd = fopen(image->out_man_file, "wb"); if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", From 6a64cb9c1b607743120d543ba083ea053a055407 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:17:45 +0100 Subject: [PATCH 278/350] file_utils: Add a new get_file_size function The get_file_size function allows to conveniently get the size of the file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 35 +++++++++++++++++++++++++++++++++ src/include/rimage/file_utils.h | 9 +++++++++ 2 files changed, 44 insertions(+) diff --git a/src/file_utils.c b/src/file_utils.c index a71236cf9c5e..48055840d159 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -36,3 +36,38 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat return 0; } + +/** + * Get file size + * @param [in] f file handle + * @param [in] filename File name used to display the error message + * @param [out] size output for file size + * @param error code, 0 when success + */ +int get_file_size(FILE *f, const char* filename, size_t *size) +{ + int ret; + + assert(size); + + /* get file size */ + ret = fseek(f, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s %d\n", filename, errno); + return -errno; + } + + *size = ftell(f); + if (*size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", filename, errno); + return -errno; + } + + ret = fseek(f, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek set %s %d\n", filename, errno); + return -errno; + } + + return 0; +} diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h index 702568044766..2c7ef6528dd8 100644 --- a/src/include/rimage/file_utils.h +++ b/src/include/rimage/file_utils.h @@ -19,4 +19,13 @@ int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext); +/** + * Get file size + * @param [in] f file handle + * @param [in] filename File name used to display the error message + * @param [out] size output for file size + * @param error code, 0 when success + */ +int get_file_size(FILE *f, const char *filename, size_t *size); + #endif /* __FILE_UTILS_H__ */ From 98c7f7b56756527b1bd84faa95e1e3e2e4168043 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 20 Feb 2023 13:42:03 +0100 Subject: [PATCH 279/350] manifest: Use the get_file_size function Simplified retrieval of file size by using the function get_file_size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 9e985bda2685..90f427496e83 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1516,10 +1516,9 @@ int man_write_fw_ace_v1_5(struct image *image) int verify_image(struct image *image) { FILE *in_file; - int ret, i; - long size; + int ret; void *buffer; - size_t read; + size_t size, read, i; /* is verify supported for target ? */ if (!image->adsp->verify_firmware) { @@ -1536,25 +1535,8 @@ int verify_image(struct image *image) } /* get file size */ - ret = fseek(in_file, 0, SEEK_END); - if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s for reading %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - size = ftell(in_file); - if (size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - ret = fseek(in_file, 0, SEEK_SET); + ret = get_file_size(in_file, image->verify_file, &size); if (ret < 0) { - fprintf(stderr, "error: unable to seek %s for reading %d\n", - image->verify_file, errno); - ret = -errno; goto out; } @@ -1608,27 +1590,8 @@ int resign_image(struct image *image) } /* get file size */ - ret = fseek(in_file, 0, SEEK_END); + ret = get_file_size(in_file, image->in_file, &size); if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s for reading %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - - size = ftell(in_file); - if (size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - - ret = fseek(in_file, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: unable to seek %s for reading %d\n", - image->verify_file, errno); - ret = -errno; goto out; } From 36c0c907698aed6db3b4317ec997eb9efe3d8045 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:30:59 +0100 Subject: [PATCH 280/350] elf: Use the get_file_size function Simplified retrieval of file size by using the function get_file_size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 7 ++----- src/file_simple.c | 2 +- src/include/rimage/rimage.h | 2 +- src/manifest.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/elf.c b/src/elf.c index 9b51c5f87b08..552bc44d3c05 100644 --- a/src/elf.c +++ b/src/elf.c @@ -11,6 +11,7 @@ #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { @@ -604,11 +605,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module->elf_file = name; /* get file size */ - ret = fseek(module->fd, 0, SEEK_END); - if (ret < 0) - goto hdr_err; - module->file_size = ftell(module->fd); - ret = fseek(module->fd, 0, SEEK_SET); + ret = get_file_size(module->fd, name, &module->file_size); if (ret < 0) goto hdr_err; diff --git a/src/file_simple.c b/src/file_simple.c index 3c344968e00d..b85bbb18dadf 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -229,7 +229,7 @@ static int write_block_reloc(struct image *image, struct module *module) goto out; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\n", block_idx++, 0, module->file_size, ftell(image->out_fd), block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 8c4f2e98446c..0d7143941ca5 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -61,7 +61,7 @@ struct module { int data_file_size; /* total file size */ - int file_size; + size_t file_size; /* executable header module */ int exec_header; diff --git a/src/manifest.c b/src/manifest.c index 90f427496e83..3ae8efc5c68d 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -585,7 +585,7 @@ static int man_module_create_reloc(struct image *image, struct module *module, return -errno; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x\t%s\n", 0, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, 0, module->file_size, 0, "DATA"); fprintf(stdout, "\n"); From 5ebbd6530ce79f30ca2ef2d42a4992893fa4b34f Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Fri, 24 Feb 2023 09:15:59 +0800 Subject: [PATCH 281/350] rimage: use hex number Module type is interpreted as hex number Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 4 ++-- config/tgl-cavs.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 8d8f63a2d2fa..d091df5c58fb 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -297,7 +297,7 @@ count = 16 domain_types = "0" load_type = "0" init_config = "1" - module_type = "12" + module_type = "0xC" auto_start = "0" sched_caps = [1, 0x00008000] @@ -412,7 +412,7 @@ count = 16 domain_types = "0" load_type = "0" init_config = "1" - module_type = "13" + module_type = "0xD" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 5b10f0869c4b..2125cda5ed4f 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -283,7 +283,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "13" + module_type = "0xD" init_config = "1" auto_start = "0" sched_caps = [1, 0x00008000] @@ -377,7 +377,7 @@ count = 15 instance_count = "8" domain_types = "0" load_type = "0" - module_type = "12" + module_type = "0xC" auto_start = "0" sched_caps = [1, 0x00008000] From a4ca53c9f164501e821d396768c3df98cc5ee5fd Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:57:06 +0100 Subject: [PATCH 282/350] toml_utils: Adding support for decimal numbers in hex parser Modified the strtoul function parameter to automatically recognize the value format. This will avoid the situation when a decimal value is parsed as hexadecimal. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/toml_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toml_utils.c b/src/toml_utils.c index 85567f3d8caa..128286d7194b 100644 --- a/src/toml_utils.c +++ b/src/toml_utils.c @@ -150,7 +150,7 @@ uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, *error = err_key_parse(key, NULL); return UINT32_MAX; } - val = strtoul(temp_s, 0, 16); + val = strtoul(temp_s, 0, 0); free(temp_s); /* assert parsing success and value is within uint32_t range */ From 9ce1cc89881a06ae013a35f5b01799aa1812e27f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 1 Mar 2023 16:40:54 +0100 Subject: [PATCH 283/350] ext_manifest: Fix fw_ext_man_cavs_header version The version fields in the fw_ext_man_cavs_header structure describe version of the structure itself, not the image. The correct version number has been set. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/ext_manifest.c | 5 ++--- src/include/rimage/cavs/cavs_ext_manifest.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index de920422196f..6985b919c379 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -201,9 +201,8 @@ int ext_man_write_cavs_25(struct image *image) mod_ext = &image->adsp->modules->mod_ext; count = mod_ext->mod_conf_count; - - header.version_major = mod_ext->ext_mod_config_array->header.version_major; - header.version_minor = mod_ext->ext_mod_config_array->header.version_minor; + header.version_major = EXTENDED_MANIFEST_VERSION_MAJOR; + header.version_minor = EXTENDED_MANIFEST_VERSION_MINOR; header.num_module_entries = count; header.id = EXTENDED_MANIFEST_MAGIC_HEADER_ID; header.len = sizeof(const struct fw_ext_man_cavs_header); diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/src/include/rimage/cavs/cavs_ext_manifest.h index cc8fe4dc8ac0..4002f37fddb1 100644 --- a/src/include/rimage/cavs/cavs_ext_manifest.h +++ b/src/include/rimage/cavs/cavs_ext_manifest.h @@ -24,6 +24,8 @@ /* ExtendedManifestHeader id $AE1 */ #define EXTENDED_MANIFEST_MAGIC_HEADER_ID 0x31454124 +#define EXTENDED_MANIFEST_VERSION_MAJOR 0x0001 +#define EXTENDED_MANIFEST_VERSION_MINOR 0x0000 #define FW_MAX_EXT_MODULE_NUM 32 From 93c5e8b51fb98fab822d4566458ce49a1aa97f5b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 12:26:20 +0100 Subject: [PATCH 284/350] misc_utils: Move byte_swap function to new misc_utils.c file This function will be used in different places in the code, so I moved it to a separate file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/include/rimage/misc_utils.h | 13 +++++++++++++ src/misc_utils.c | 18 ++++++++++++++++++ src/pkcs1_5.c | 13 +------------ 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 src/include/rimage/misc_utils.h create mode 100644 src/misc_utils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f43150c0d64e..76ed18a3392a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(rimage src/rimage.c src/toml_utils.c src/adsp_config.c + src/misc_utils.c src/file_utils.c tomlc99/toml.c ) diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h new file mode 100644 index 000000000000..cf9353ac9d8d --- /dev/null +++ b/src/include/rimage/misc_utils.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#include <stdint.h> + +/** + * Reverses the order of bytes in the array + * @param ptr pointer to a array + * @param size of the array + */ +void bytes_swap(uint8_t *ptr, uint32_t size); diff --git a/src/misc_utils.c b/src/misc_utils.c new file mode 100644 index 000000000000..e4b5e4d4ce5c --- /dev/null +++ b/src/misc_utils.c @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2018-2023 Intel Corporation. All rights reserved. + */ + +#include <rimage/misc_utils.h> + +void bytes_swap(uint8_t *ptr, uint32_t size) +{ + uint8_t tmp; + uint32_t index; + + for (index = 0; index < (size / 2); index++) { + tmp = ptr[index]; + ptr[index] = ptr[size - 1 - index]; + ptr[size - 1 - index] = tmp; + } +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 2f58b8720269..c1b38e0cb030 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -23,6 +23,7 @@ #include <rimage/rimage.h> #include <rimage/css.h> #include <rimage/manifest.h> +#include <rimage/misc_utils.h> #define DEBUG_PKCS 0 @@ -33,18 +34,6 @@ enum manver { VACE15 = 3 }; -static void bytes_swap(uint8_t *ptr, uint32_t size) -{ - uint8_t tmp; - uint32_t index; - - for (index = 0; index < (size / 2); index++) { - tmp = ptr[index]; - ptr[index] = ptr[size - 1 - index]; - ptr[size - 1 - index] = tmp; - } -} - static int rimage_read_key(EVP_PKEY **privkey, struct image *image) { char path[256]; From 2bd8be35d21504bcf69dc99e10e36caecc58343e Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:41:47 +0100 Subject: [PATCH 285/350] hash: New hash functions Prepared a new set of functions for computing digest with error handling. The hash context has been placed into a separate structure. This allows to conveniently pass the calculated digest along with its length and used algorithm. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/hash.c | 163 ++++++++++++++++++++++++++++++++++++-- src/include/rimage/hash.h | 111 ++++++++++++++++++++++++++ 2 files changed, 266 insertions(+), 8 deletions(-) create mode 100644 src/include/rimage/hash.h diff --git a/src/hash.c b/src/hash.c index ff68f82f5f05..f6409e3cd7cc 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1,9 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. -// -// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> -// Keyon Jie <yang.jie@linux.intel.com> +/* + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + * Adrian Warecki <adrian.warecki@intel.com> + */ #include <assert.h> #include <stdlib.h> @@ -11,8 +13,6 @@ #include <unistd.h> #include <errno.h> #include <string.h> -#include <time.h> -#include <sys/time.h> #include <openssl/conf.h> #include <openssl/evp.h> @@ -20,6 +20,9 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/hash.h> + +#define DEBUG_HASH 0 #if OPENSSL_VERSION_NUMBER < 0x10100000L void EVP_MD_CTX_free(EVP_MD_CTX *ctx); @@ -46,7 +49,151 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) } #endif -#define DEBUG_HASH 0 +static int hash_error(struct hash_context *context, int errcode, const char *msg) +{ + EVP_MD_CTX_free(context->context); + context->context = NULL; + context->state = HS_ERROR; + context->error = -errcode; + fprintf(stderr, "hash: %s\n", msg); + return context->error; +} + +int hash_init(struct hash_context *context, const EVP_MD *algo) +{ + assert(context); + assert(algo); + + context->error = 0; + context->digest_length = 0; + context->algo = algo; + + context->context = EVP_MD_CTX_new(); + if (!context->context) + return hash_error(context, ENOMEM, "Unable to allocate hash context."); + + if (!EVP_DigestInit_ex(context->context, context->algo, NULL)) { + EVP_MD_CTX_free(context->context); + return hash_error(context, ENOTRECOVERABLE, "Unable to initialize hash context."); + } + + context->state = HS_UPDATE; + return 0; +} + +int hash_sha256_init(struct hash_context *context) +{ + return hash_init(context, EVP_sha256()); +} + +int hash_sha384_init(struct hash_context *context) +{ + return hash_init(context, EVP_sha384()); +} + +int hash_update(struct hash_context *context, const void *data, size_t size) +{ + assert(context); + assert(data); + + if (context->error) + return context->error; + + assert(context->state == HS_UPDATE); + + if (!EVP_DigestUpdate(context->context, data, size)) + return hash_error(context, EINVAL, "Unable to update hash context."); + + return 0; +} + +int hash_finalize(struct hash_context *context) +{ + assert(context); + + if (context->error) + return context->error; + + assert(context->state == HS_UPDATE); + + if (!EVP_DigestFinal_ex(context->context, context->digest, &context->digest_length)) + return hash_error(context, EINVAL, "Unable to finalize hash context."); + + context->state = HS_DONE; + +#if DEBUG_HASH + fprintf(stdout, "Hash result is: "); + hash_print(context); +#endif + + EVP_MD_CTX_free(context->context); + context->context = NULL; + return 0; +} + +int hash_get_digest(struct hash_context *context, void *output, size_t output_len) +{ + assert(context); + assert(output); + + if (context->error) + return context->error; + + assert(context->state == HS_DONE); + + if (context->digest_length > output_len) + return -ENOBUFS; + + memcpy(output, context->digest, context->digest_length); + return context->digest_length; +} + +void hash_print(struct hash_context *context) +{ + unsigned int i; + + assert(context); + assert(context->state == HS_DONE); + assert(context->digest_length); + + for (i = 0; i < context->digest_length; i++) + fprintf(stdout, "%02x", context->digest[i]); + fprintf(stdout, "\n"); +} + +int hash_single(const void *data, size_t size, const EVP_MD *algo, void *output, size_t output_len) +{ + int algo_out_size; + + assert(algo); + assert(data); + assert(output); + + //algo_out_size = EVP_MD_get_size(algo); + algo_out_size = EVP_MD_size(algo); + if (algo_out_size <= 0) + return -EINVAL; + + if (output_len > algo_out_size) + return -ENOBUFS; + + if (!EVP_Digest(data, size, output, NULL, algo, NULL)) { + fprintf(stderr, "Unable to compute hash."); + return -ENOTRECOVERABLE; + } + + return 0; +} + +int hash_sha256(const void *data, size_t size, void *output, size_t output_len) +{ + return hash_single(data, size, EVP_sha256(), output, output_len); +} + +int hash_sha384(const void *data, size_t size, void *output, size_t output_len) +{ + return hash_single(data, size, EVP_sha384(), output, output_len); +} void module_sha256_create(struct image *image) { diff --git a/src/include/rimage/hash.h b/src/include/rimage/hash.h new file mode 100644 index 000000000000..47a00101af4f --- /dev/null +++ b/src/include/rimage/hash.h @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#ifndef __HASH_H__ +#define __HASH_H__ + +#include <openssl/conf.h> +#include <openssl/evp.h> +#include <openssl/err.h> + +#include <stdint.h> + +/* Hash context state used to detect invalid use of hash functions */ +enum hash_state { HS_INIT, HS_UPDATE, HS_DONE, HS_ERROR }; + +struct hash_context { + enum hash_state state; + EVP_MD_CTX *context; + const EVP_MD *algo; + uint8_t digest[EVP_MAX_MD_SIZE]; + unsigned int digest_length; + int error; +}; + +/** + * Initialize hash context with given algorithm + * @param [out]context structure storing the hash context + * @param [in]algo hash algorithm + * @return error code, 0 when success + */ +int hash_init(struct hash_context *context, const EVP_MD *algo); + +/** + * Initialize sha256 hash context + * @param [out]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_sha256_init(struct hash_context *context); + +/** + * Initialize sha384 hash context + * @param [out]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_sha384_init(struct hash_context *context); + +/** + * Add data to hash + * @param [in]context structure storing the hash context + * @param [in]data data to be added + * @param [in]size length of data in bytes + * @return error code, 0 when success + */ +int hash_update(struct hash_context *context, const void *data, size_t size); + +/** + * Completes the hash calculation. No more data can be added! + * @param [in]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_finalize(struct hash_context *context); + +/** + * Read out computed digest. Must finalize first. + * @param [in]context structure storing the hash context + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return copied digest length, < 0 if error + */ +int hash_get_digest(struct hash_context *context, void *output, size_t output_len); + +/** + * Print digest value + * @param [in]context structure storing the hash context + */ +void hash_print(struct hash_context *context); + +/** + * Calculates hash of a single memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [in]algo hash algorithm + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_single(const void* data, size_t size, const EVP_MD *algo, void *output, size_t output_len); + +/** + * Calculates sha256 hash of a memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_sha256(const void* data, size_t size, void *output, size_t output_len); + +/** + * Calculates sha384 hash of a memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_sha384(const void* data, size_t size, void *output, size_t output_len); + +#endif /* __HASH_H__ */ From d258ea23fc4d7f5e82553c2c800a7c019c0cf75e Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:42:01 +0100 Subject: [PATCH 286/350] manifest: pkcs1_5: Use new hash functions Switched to use new hash functions. The parameter list for the rimage_sign and rimage_verify functions has been simplified. The necessary information is now included in the hash_context structure. In addition, code fragments that may be common to different versions of the manifest have been separated. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 157 +++++++++++++++++----------- src/pkcs1_5.c | 279 +++++++++++++++++++++++-------------------------- 2 files changed, 227 insertions(+), 209 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3ae8efc5c68d..1161e037943b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -23,6 +23,8 @@ #include <rimage/plat_auth.h> #include <rimage/manifest.h> #include <rimage/file_utils.h> +#include <rimage/misc_utils.h> +#include <rimage/hash.h> static int man_open_rom_file(struct image *image) { @@ -733,7 +735,8 @@ static void man_create_modules_in_config(struct image *image, struct sof_man_fw_ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) { struct sof_man_module *man_module; - int i; + size_t mod_offset, mod_size; + int i, ret = 0; for (i = 0; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); @@ -744,14 +747,19 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) continue; } - ri_sha256(image, - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); + mod_offset = man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset; + mod_size = (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE; + + assert((mod_offset + mod_size) <= image->adsp->image_size); + + ret = hash_sha256(image->fw_image + mod_offset, mod_size, man_module->hash, sizeof(man_module->hash)); + if (ret) + break; } - return 0; + return ret; } /* used by others */ @@ -897,8 +905,7 @@ int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; - uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_v1_8(image); @@ -956,20 +963,31 @@ int man_write_fw_v1_8(struct image *image) /* calculate hash for ADSP meta data extension - 0x480 to end */ /* image_end is updated every time a section is added */ assert(image->image_end > MAN_FW_DESC_OFFSET_V1_8); - ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - - MAN_FW_DESC_OFFSET_V1_8, - m->adsp_file_ext.comp_desc[0].hash); + ret = hash_sha256(image->fw_image + MAN_FW_DESC_OFFSET_V1_8, + image->image_end - MAN_FW_DESC_OFFSET_V1_8, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_sha256(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); + assert(image->image_end > (MAN_FW_DESC_OFFSET_V1_8 + + sizeof(struct sof_man_adsp_meta_file_ext_v1_8))); + + ret = hash_sha256(image->fw_image + MAN_FW_DESC_OFFSET_V1_8, + image->image_end - MAN_FW_DESC_OFFSET_V1_8, + m->signed_pkg.module[0].hash, + sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - m->partition_info.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA256_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + + /* Copy module hash to partition_info */ + assert(sizeof(m->partition_info.module[0].hash) == sizeof(m->signed_pkg.module[0].hash)); + memcpy(m->partition_info.module[0].hash, m->signed_pkg.module[0].hash, + sizeof(m->partition_info.module[0].hash)); /* sign manifest */ ret = ri_manifest_sign_v1_8(image); @@ -1059,8 +1077,11 @@ int man_write_fw_meu_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha256(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha256(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1140,8 +1161,11 @@ int man_write_fw_meu_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha256(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha256(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1223,8 +1247,11 @@ int man_write_fw_meu_v2_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha384(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1247,8 +1274,7 @@ int man_write_fw_v2_5(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v2_5 *m; - uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_v2_5(image); @@ -1310,22 +1336,28 @@ int man_write_fw_v2_5(struct image *image) man_hash_modules(image, desc); /* calculate hash inside ADSP meta data extension for padding to end */ - ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, - m->adsp_file_ext.comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* mue writes 0xff to 16 bytes of padding */ - for (i = 0; i < 16; i++) - m->reserved[i] = 0xff; + memset(m->reserved, 0xff, 16); /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ - ri_sha384(image, MAN_META_EXT_OFFSET_V2_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + assert((MAN_META_EXT_OFFSET_V2_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < + image->image_end); + + ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); /* sign manifest */ ret = ri_manifest_sign_v2_5(image); @@ -1385,11 +1417,10 @@ static int man_init_image_ace_v1_5(struct image *image) int man_write_fw_ace_v1_5(struct image *image) { - + struct hash_context hash; struct sof_man_fw_desc *desc; struct fw_image_manifest_ace_v1_5 *m; - uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_ace_v1_5(image); @@ -1455,35 +1486,43 @@ int man_write_fw_ace_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash inside ADSP meta data extension for padding to end */ - ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, - m->adsp_file_ext.comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* mue writes 0xff to 16 bytes of padding */ - for (i = 0; i < 16; i++) - m->reserved[i] = 0xff; + memset(m->reserved, 0xff, 16); /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ - ri_sha384(image, MAN_META_EXT_OFFSET_ACE_V1_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + assert((MAN_META_EXT_OFFSET_ACE_V1_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < + image->image_end); + + ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); /* calculate hash - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, image->fw_image, - sizeof(struct CsePartitionDirHeader_v2_5) + - sizeof(struct CsePartitionDirEntry) * 3); - module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); - module_sha_complete(image, hash); + hash_sha384_init(&hash); + hash_update(&hash, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + + hash_update(&hash, image->fw_image + 0x4c0, image->image_end - 0x4c0); + hash_finalize(&hash); /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->info_0x16.hash[i] = hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + ret = hash_get_digest(&hash, m->info_0x16.hash, sizeof(m->info_0x16.hash)); + if (ret < 0) + goto err; + bytes_swap(m->info_0x16.hash, sizeof(m->info_0x16.hash)); /* sign manifest */ ret = ri_manifest_sign_ace_v1_5(image); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index c1b38e0cb030..4817f8beef89 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -24,6 +24,7 @@ #include <rimage/css.h> #include <rimage/manifest.h> #include <rimage/misc_utils.h> +#include <rimage/hash.h> #define DEBUG_PKCS 0 @@ -155,8 +156,8 @@ static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned ch #endif #if OPENSSL_VERSION_NUMBER < 0x30000000L -static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_sign(EVP_PKEY *privkey, enum manver ver, struct hash_context *digest, + unsigned char *signature) { unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; @@ -169,13 +170,13 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, case V15: /* fallthrough */ case V18: - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + ret = RSA_sign(NID_sha256, digest->digest, digest->digest_length, signature, &siglen, priv_rsa); break; case V25: /* fallthrough */ case VACE15: - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest->digest, digest->algo, /* salt length */ 32); if (ret > 0) ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, signature, priv_rsa, @@ -188,12 +189,11 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, return ret; } #else -static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_sign(EVP_PKEY *privkey, enum manver ver, + struct hash_context *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; int ret; ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); @@ -217,28 +217,19 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, goto out; } - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); - if (ret <= 0) { - fprintf(stderr, "error: failed to set signature\n"); - goto out; - } + siglen = MAN_RSA_SIGNATURE_LEN_2_5; + } - ret = EVP_PKEY_sign(ctx, signature, &sig_in, digest, SHA384_DIGEST_LENGTH); - if (ret <= 0) { - fprintf(stderr, "error: failed to sign manifest\n"); - goto out; - } + ret = EVP_PKEY_CTX_set_signature_md(ctx, digest->algo); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature algorithm\n"); + goto out; } - else { - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); - if (ret <= 0) { - fprintf(stderr, "error: failed to set signature\n"); - goto out; - } - ret = EVP_PKEY_sign(ctx, signature, &siglen, digest, SHA256_DIGEST_LENGTH); - if (ret <= 0) - fprintf(stderr, "error: failed to sign manifest\n"); + ret = EVP_PKEY_sign(ctx, signature, &siglen, digest->digest, digest->digest_length); + if (ret <= 0) { + fprintf(stderr, "error: failed to sign manifest\n"); + goto out; } out: @@ -249,8 +240,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, #endif #if OPENSSL_VERSION_NUMBER < 0x30000000L -static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_verify(EVP_PKEY *privkey, enum manver ver, struct hash_context *digest, + unsigned char *signature) { unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; @@ -264,8 +255,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver case V15: /* fallthrough */ case V18: - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, signature, siglen, - priv_rsa); + ret = RSA_verify(NID_sha256, digest->digest, digest->digest_length, signature, + siglen, priv_rsa); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); @@ -284,7 +275,7 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver return ret; } - ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest->digest, digest->algo, sig, 32); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); fprintf(stderr, "error: verify %s\n", err_buf); @@ -297,12 +288,11 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver return ret; } #else -static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context *digest, + unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; char err_buf[256]; int ret; @@ -314,26 +304,19 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; + ret = EVP_PKEY_CTX_set_signature_md(ctx, digest->algo); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set signature %s\n", err_buf); + goto out; + } + switch (ver) { - case V15: - /* fallthrough */ + case V15 /* fallthrough */ case V18: - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: set signature %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_verify(ctx, signature, siglen, digest, SHA256_DIGEST_LENGTH); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: verify %s\n", err_buf); - } - break; - case V25: - /* fallthrough */ + + case V25: /* fallthrough */ case VACE15: ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) @@ -343,21 +326,20 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); - if (ret <= 0) - goto out; - - ret = EVP_PKEY_verify(ctx, signature, siglen25, digest, SHA384_DIGEST_LENGTH); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: verify %s\n", err_buf); - } - + siglen = MAN_RSA_SIGNATURE_LEN_2_5; break; default: return -EINVAL; } + ret = EVP_PKEY_verify(ctx, signature, siglen, digest->digest, digest->digest_length); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + out: EVP_PKEY_CTX_free(ctx); @@ -397,7 +379,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, void *ptr1, unsigned int size1) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; int ret = -EINVAL, i; @@ -418,22 +400,20 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V15, digest, - (unsigned char *)man->css_header.signature); - + ret = rimage_sign(privkey, V15, &digest, (unsigned char *)man->css_header.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -448,6 +428,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -465,7 +446,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; int ret = -EINVAL, i; @@ -487,22 +468,21 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V18, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, V18, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -515,6 +495,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -525,7 +506,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; int ret = -EINVAL, i; @@ -547,22 +528,21 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V25, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, V25, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -575,6 +555,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -585,7 +566,7 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; int ret = -EINVAL, i; @@ -607,22 +588,21 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, VACE15, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, VACE15, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -635,6 +615,7 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -713,8 +694,8 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, void *ptr1, unsigned int size1) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x\n", @@ -734,28 +715,27 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); /* verify */ - ret = rimage_verify(privkey, image, V15, digest, - (unsigned char *)man->css_header.signature); + ret = rimage_verify(privkey, V15, &digest, (unsigned char *)man->css_header.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); - +err: EVP_PKEY_free(privkey); return ret; } @@ -773,8 +753,8 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -794,27 +774,27 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, V18, digest, - (unsigned char *)man->css.signature); + ret = rimage_verify(privkey, V18, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } @@ -832,8 +812,8 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -853,28 +833,28 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, V25, digest, - (unsigned char *)man->css.signature); + ret = rimage_verify(privkey, V25, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } @@ -885,8 +865,8 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -906,28 +886,27 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, VACE15, digest, - (unsigned char *)man->css.signature); - + ret = rimage_verify(privkey, VACE15, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } From 6c7a1512c6bc645718da68abd889ec44e99ea3d2 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 10:52:58 +0100 Subject: [PATCH 287/350] hash: Remove old hash functions Removed currently unused functions. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/hash.c | 58 ------------------------------------- src/include/rimage/rimage.h | 9 ------ 2 files changed, 67 deletions(-) diff --git a/src/hash.c b/src/hash.c index f6409e3cd7cc..4a47730f4c99 100644 --- a/src/hash.c +++ b/src/hash.c @@ -194,61 +194,3 @@ int hash_sha384(const void *data, size_t size, void *output, size_t output_len) { return hash_single(data, size, EVP_sha384(), output, output_len); } - -void module_sha256_create(struct image *image) -{ - image->md = EVP_sha256(); - image->mdctx = EVP_MD_CTX_new(); - - EVP_DigestInit_ex(image->mdctx, image->md, NULL); -} - -void module_sha_update(struct image *image, uint8_t *data, size_t bytes) -{ - EVP_DigestUpdate(image->mdctx, data, bytes); -} - -void module_sha_complete(struct image *image, uint8_t *hash) -{ - unsigned char md_value[EVP_MAX_MD_SIZE]; - unsigned int md_len; -#if DEBUG_HASH - int i; -#endif - EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); - EVP_MD_CTX_free(image->mdctx); - - memcpy(hash, md_value, md_len); -#if DEBUG_HASH - fprintf(stdout, "Module digest is: "); - for (i = 0; i < md_len; i++) - fprintf(stdout, "%02x", md_value[i]); - fprintf(stdout, "\n"); -#endif -} - -void ri_sha256(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) -{ - assert((uint64_t)size + offset <= image->adsp->image_size); - module_sha256_create(image); - module_sha_update(image, image->fw_image + offset, size); - module_sha_complete(image, hash); -} - -void module_sha384_create(struct image *image) -{ - image->md = EVP_sha384(); - image->mdctx = EVP_MD_CTX_new(); - - EVP_DigestInit_ex(image->mdctx, image->md, NULL); -} - -void ri_sha384(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) -{ - assert((uint64_t)size + offset <= image->adsp->image_size); - module_sha384_create(image); - module_sha_update(image, image->fw_image + offset, size); - module_sha_complete(image, hash); -} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 0d7143941ca5..063f5ccec507 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -170,20 +170,11 @@ struct adsp { int exec_boot_ldr; }; -void module_sha256_create(struct image *image); -void module_sha384_create(struct image *image); -void module_sha_update(struct image *image, uint8_t *data, size_t bytes); -void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); int ri_manifest_sign_v2_5(struct image *image); int ri_manifest_sign_ace_v1_5(struct image *image); -void ri_sha256(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash); -void ri_sha384(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash); - int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, void *ptr1, unsigned int size1); From 6fad35625fafee5a06926c6896fa5013e6509e3c Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 14:57:12 +0100 Subject: [PATCH 288/350] rimage: Removed hash context from image structure Fields related to hash computing have been removed from the image structure. Removed openssl headers from rimage.h, which made it necessary to add some missing includes in several files. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 2 ++ src/css.c | 1 + src/elf.c | 2 ++ src/ext_manifest.c | 1 + src/include/rimage/rimage.h | 7 +------ 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 9c4c94c50be2..4b086f4fd5f8 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -18,6 +18,8 @@ #include "toml.h" #include <stdbool.h> #include <stdint.h> +#include <stdarg.h> +#include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> diff --git a/src/css.c b/src/css.c index 92f6ea89fd93..631c3ee431a9 100644 --- a/src/css.c +++ b/src/css.c @@ -6,6 +6,7 @@ // Keyon Jie <yang.jie@linux.intel.com> #include <stdio.h> +#include <errno.h> #include <sys/time.h> #include <rimage/rimage.h> #include <rimage/css.h> diff --git a/src/elf.c b/src/elf.c index 552bc44d3c05..0275a194ed79 100644 --- a/src/elf.c +++ b/src/elf.c @@ -7,7 +7,9 @@ #include <assert.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <errno.h> #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 6985b919c379..8ed899406537 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -8,6 +8,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <errno.h> #include <rimage/ext_manifest_gen.h> #include <rimage/sof/kernel/ext_manifest.h> diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 063f5ccec507..692dbcdd7d28 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -11,9 +11,6 @@ #include <stdint.h> #include <stdio.h> -#include <openssl/conf.h> -#include <openssl/evp.h> -#include <openssl/err.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> @@ -87,10 +84,8 @@ struct image { int meu_offset; const char *verify_file; - /* SHA 256 & 384 */ + /* private key file name*/ const char *key_name; - EVP_MD_CTX *mdctx; - const EVP_MD *md; /* file IO */ void *fw_image; From 35bc64467a943c402022f1962e9e63a9be8f7f61 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 6 Mar 2023 10:01:24 +0800 Subject: [PATCH 289/350] mtl: add eq-iir and fir support Port from tgl-cavs.toml Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index d091df5c58fb..df541c9869a9 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 16 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -423,3 +423,41 @@ count = 16 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + +# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 5bc201039d91457ad9b9068ac228e57bc2713d3b Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Mon, 6 Mar 2023 16:44:37 +0800 Subject: [PATCH 290/350] rimage: fix build error Recent changes introduce build error, fix the build error. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/css.c | 1 + src/pkcs1_5.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/css.c b/src/css.c index 631c3ee431a9..a69d5c80f76b 100644 --- a/src/css.c +++ b/src/css.c @@ -7,6 +7,7 @@ #include <stdio.h> #include <errno.h> +#include <time.h> #include <sys/time.h> #include <rimage/rimage.h> #include <rimage/css.h> diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 4817f8beef89..ef0169b66e36 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -312,7 +312,7 @@ static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context } switch (ver) { - case V15 /* fallthrough */ + case V15: /* fallthrough */ case V18: break; @@ -338,8 +338,6 @@ static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context fprintf(stderr, "error: verify %s\n", err_buf); } - break; - out: EVP_PKEY_CTX_free(ctx); From d32db50b6104968e61adb2eb206f0b31e1682c18 Mon Sep 17 00:00:00 2001 From: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com> Date: Mon, 6 Mar 2023 14:05:57 +0100 Subject: [PATCH 291/350] mtl: add Aria module to extended manifest Add ARIA module to MTL extended manifest. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com> --- config/mtl.toml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index df541c9869a9..a762ea7696c7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -459,5 +459,30 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] -# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From dd15443129ba0de553627d42d4fc9dc4735cfad3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 12:16:25 +0100 Subject: [PATCH 292/350] file_utils: Removed duplicated function descriptions Functions are already described in the header file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index 48055840d159..6511dd90cee2 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -11,14 +11,6 @@ #include <rimage/file_utils.h> -/** - * Create new file name using output file name as template. - * @param [out] new_name char[] destination of new file name - * @param [in] name_size new file name buffer capacity - * @param [in] template_name File name used as a template for the new name - * @param [in] new_ext extension of the new file name - * @param error code, 0 when success - */ int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext) { @@ -37,13 +29,6 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat return 0; } -/** - * Get file size - * @param [in] f file handle - * @param [in] filename File name used to display the error message - * @param [out] size output for file size - * @param error code, 0 when success - */ int get_file_size(FILE *f, const char* filename, size_t *size) { int ret; From 32a5388c10b5c71514c05dd4623c45a9bfe9c741 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 12:18:47 +0100 Subject: [PATCH 293/350] file_utils: Add file_error function Added a generic function that displays a file operation error message. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 30 ++++++++++++++++++------------ src/include/rimage/file_utils.h | 8 ++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index 6511dd90cee2..c8d406d677ba 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -8,9 +8,21 @@ #include <unistd.h> #include <errno.h> #include <assert.h> +#include <string.h> #include <rimage/file_utils.h> +int file_error(const char *msg, const char *filename) +{ + int code = errno; + char sys_msg[256]; + + strerror_r(code, sys_msg, sizeof(sys_msg)); + + fprintf(stderr, "%s:\terror: %s. %s (errno = %d)\n", filename, msg, sys_msg, code); + return -code; +} + int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext) { @@ -37,22 +49,16 @@ int get_file_size(FILE *f, const char* filename, size_t *size) /* get file size */ ret = fseek(f, 0, SEEK_END); - if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s %d\n", filename, errno); - return -errno; - } + if (ret) + return file_error("unable to seek eof", filename); *size = ftell(f); - if (*size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", filename, errno); - return -errno; - } + if (*size < 0) + return file_error("unable to get file size", filename); ret = fseek(f, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: unable to seek set %s %d\n", filename, errno); - return -errno; - } + if (ret) + return file_error("unable to seek set", filename); return 0; } diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h index 2c7ef6528dd8..34ecc89f5bad 100644 --- a/src/include/rimage/file_utils.h +++ b/src/include/rimage/file_utils.h @@ -8,6 +8,14 @@ #include <stddef.h> +/** + * Print file operation error message + * @param [in]msg error message + * @param [in]filename File name used to display the error message + * @param error code + */ +int file_error(const char *msg, const char *filename); + /** * Create new file name using output file name as template. * @param [out] new_name char[] destination of new file name From 4aacac3460f21a65b335cbada8857f1c452947ad Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:37:43 +0100 Subject: [PATCH 294/350] Use file_error function to print file related errors Added error handling where it was missing. According to the documentation, the fseek function returns a non-zero value on error. The conditions for checking this value have been corrected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 4 +- src/ext_manifest.c | 50 +++++++++++++++-------- src/file_simple.c | 72 +++++++++++++++++---------------- src/manifest.c | 99 ++++++++++++++-------------------------------- src/pkcs1_5.c | 9 ++--- src/rimage.c | 5 +-- 6 files changed, 110 insertions(+), 129 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 4b086f4fd5f8..4cab5cbe489f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -15,6 +15,7 @@ #include "rimage/cse.h" #include "rimage/css.h" #include "rimage/toml_utils.h" +#include "rimage/file_utils.h" #include "toml.h" #include <stdbool.h> #include <stdint.h> @@ -2348,7 +2349,8 @@ int adsp_parse_config(const char *file, struct image *image) fd = fopen(file, "r"); if (!fd) - return log_err(-EIO, "error: can't open '%s' file\n", file); + return file_error("unable to open file for reading", file); + ret = adsp_parse_config_fd(fd, image); fclose(fd); return ret; diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 8ed899406537..e670b47825e5 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -35,11 +35,8 @@ static int ext_man_open_file(struct image *image) /* open extended manifest outfile for writing */ image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); - if (!image->out_ext_man_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_ext_man_file, errno); - return errno; - } + if (!image->out_ext_man_fd) + return file_error("unable to open file for writing", image->out_ext_man_file); return 0; } @@ -169,10 +166,7 @@ int ext_man_write(struct image *image) count = fwrite(ext_man, 1, ext_man->full_size, image->out_ext_man_fd); if (count != ext_man->full_size) { - fprintf(stderr, - "error: can't write extended manifest to file %d\n", - -errno); - ret = -errno; + ret = file_error("can't write extended manifest", image->out_ext_man_file); goto out; } @@ -195,6 +189,7 @@ int ext_man_write_cavs_25(struct image *image) int pin_count; int count, i; int ret; + size_t write_ret; ret = ext_man_open_file(image); if (ret) @@ -213,17 +208,38 @@ int ext_man_write_cavs_25(struct image *image) fwrite(&header, 1, sizeof(header), image->out_ext_man_fd); for (i = 0; i < count; i++) { - fwrite(&mod_ext->ext_mod_config_array[i].header, 1, - sizeof(struct fw_ext_mod_config_header), image->out_ext_man_fd); + write_ret = fwrite(&mod_ext->ext_mod_config_array[i].header, + sizeof(struct fw_ext_mod_config_header), 1, + image->out_ext_man_fd); + if (write_ret != 1) { + ret = file_error("can't write fw_ext_mod_config_header", + image->out_ext_man_file); + goto out; + } - if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) - fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, 1, - sizeof(struct mod_scheduling_caps), image->out_ext_man_fd); + if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) { + write_ret = fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, + sizeof(struct mod_scheduling_caps), 1, + image->out_ext_man_fd); + if (write_ret != 1) { + ret = file_error("can't write mod_scheduling_caps", + image->out_ext_man_file); + goto out; + } + } pin_count = mod_ext->ext_mod_config_array[i].header.num_pin_entries; - if (pin_count) - fwrite(mod_ext->ext_mod_config_array[i].pin_desc, pin_count, - sizeof(struct fw_pin_description), image->out_ext_man_fd); + if (pin_count) { + write_ret = fwrite(mod_ext->ext_mod_config_array[i].pin_desc, + sizeof(struct fw_pin_description), pin_count, + image->out_ext_man_fd); + + if (write_ret != pin_count) { + ret = file_error("can't write fw_pin_description", + image->out_ext_man_file); + goto out; + } + } } out: diff --git a/src/file_simple.c b/src/file_simple.c index b85bbb18dadf..a63afa8de815 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -10,6 +10,7 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { @@ -68,7 +69,7 @@ static int write_block(struct image *image, struct module *module, /* write header */ count = fwrite(&block, sizeof(block), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("Write header failed", image->out_file); /* alloc data data */ buffer = calloc(1, section->size); @@ -77,24 +78,22 @@ static int write_block(struct image *image, struct module *module, /* read in section data */ ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to section %d\n", ret); + if (ret) { + ret = file_error("seek to section failed", module->elf_file); goto out; } count = fread(buffer, 1, section->size, module->fd); if (count != section->size) { - fprintf(stderr, "error: cant read section %d\n", -errno); - ret = -errno; + ret = file_error("cant read section", module->elf_file); goto out; } /* write out section data */ count = fwrite(buffer, 1, block.size, image->out_fd); if (count != block.size) { - fprintf(stderr, "error: cant write section %d\n", -errno); + ret = file_error("cant write section", image->out_file); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", section->off, section->size, section->vaddr); - ret = -errno; goto out; } @@ -128,12 +127,12 @@ static int simple_write_module(struct image *image, struct module *module) /* Get the pointer of writing hdr */ ptr_hdr = ftell(image->out_fd); + if (ptr_hdr < 0) + return file_error("cant get file position", image->out_file); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write section header", image->out_file); fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); @@ -172,15 +171,21 @@ static int simple_write_module(struct image *image, struct module *module) hdr.size += padding; /* Record current pointer, will set it back after overwriting hdr */ ptr_cur = ftell(image->out_fd); + if (ptr_cur < 0) + return file_error("cant get file position", image->out_file); + /* overwrite hdr */ - fseek(image->out_fd, ptr_hdr, SEEK_SET); + err = fseek(image->out_fd, ptr_hdr, SEEK_SET); + if (err) + return file_error("cant seek to header", image->out_file); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } - fseek(image->out_fd, ptr_cur, SEEK_SET); + if (count != 1) + return file_error("failed to write section header", image->out_file); + + err = fseek(image->out_fd, ptr_cur, SEEK_SET); + if (err) + return file_error("cant seek", image->out_file); fprintf(stdout, "\n"); /* return padding size */ @@ -201,7 +206,7 @@ static int write_block_reloc(struct image *image, struct module *module) /* write header */ count = fwrite(&block, sizeof(block), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("cant write header", image->out_file); /* alloc data data */ buffer = calloc(1, module->file_size); @@ -210,22 +215,20 @@ static int write_block_reloc(struct image *image, struct module *module) /* read in section data */ ret = fseek(module->fd, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); + if (ret) { + ret = file_error("can't seek to section", module->elf_file); goto out; } count = fread(buffer, 1, module->file_size, module->fd); if (count != module->file_size) { - fprintf(stderr, "error: can't read section %d\n", -errno); - ret = -errno; + ret = file_error("can't read section", module->elf_file); goto out; } /* write out section data */ count = fwrite(buffer, 1, module->file_size, image->out_fd); if (count != module->file_size) { - fprintf(stderr, "error: can't write section %d\n", -errno); - ret = -errno; + ret = file_error("can't write section", image->out_file); goto out; } @@ -249,11 +252,8 @@ static int simple_write_module_reloc(struct image *image, struct module *module) hdr.type = SOF_FW_BASE; // module count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write section header", image->out_file); fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); @@ -304,7 +304,7 @@ int simple_write_firmware(struct image *image) count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("failed to write header", image->out_file); for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; @@ -324,10 +324,14 @@ int simple_write_firmware(struct image *image) hdr.file_size += ret; } /* overwrite hdr */ - fseek(image->out_fd, 0, SEEK_SET); + ret = fseek(image->out_fd, 0, SEEK_SET); + if (ret) + return file_error("can't seek set", image->out_file); + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("failed to write header", image->out_file); fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", (long)(hdr.file_size + sizeof(hdr)), diff --git a/src/manifest.c b/src/manifest.c index 1161e037943b..5ce0c1d91744 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -45,11 +45,8 @@ static int man_open_rom_file(struct image *image) /* open ROM outfile for writing */ image->out_rom_fd = fopen(image->out_rom_file, "wb"); - if (!image->out_rom_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_rom_file, errno); - return -errno; - } + if (!image->out_rom_fd) + return file_error("unable to open file for writing", image->out_rom_file); return 0; } @@ -65,11 +62,8 @@ static int man_open_unsigned_file(struct image *image) /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); - if (!image->out_unsigned_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_unsigned_file, errno); - return -errno; - } + if (!image->out_unsigned_fd) + return file_error("unable to open file for writing", image->out_unsigned_file); return 0; } @@ -85,11 +79,8 @@ static int man_open_manifest_file(struct image *image) /* open manifest outfile for writing */ image->out_man_fd = fopen(image->out_man_file, "wb"); - if (!image->out_man_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_man_file, errno); - return -errno; - } + if (!image->out_man_fd) + return file_error("unable to open file for writing", image->out_man_file); return 0; } @@ -221,10 +212,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, man_module->segment[seg_type].file_offset = offset; count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - fprintf(stderr, "error: cant read section %d\n", -errno); - return -errno; - } + if (count != section->size) + return file_error("cant read section", module->elf_file); /* get module end offset ? */ if (end > image->image_end) @@ -245,10 +234,8 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, /* seek to ELF section */ ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); - return ret; - } + if (ret) + return file_error("can't seek to section", module->elf_file); /* write data to DRAM or ROM image */ if (!elf_is_rom(image, section)) @@ -286,10 +273,8 @@ static int man_get_module_manifest(struct image *image, struct module *module, } count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); - if (count != sizeof(sof_mod)) { - fprintf(stderr, "error: can't read section %d\n", -errno); - return -errno; - } + if (count != sizeof(sof_mod)) + return file_error("can't read section", module->elf_file); /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); @@ -576,16 +561,12 @@ static int man_module_create_reloc(struct image *image, struct module *module, /* seek to beginning of file */ err = fseek(module->fd, 0, SEEK_SET); - if (err < 0) { - fprintf(stderr, "error: can't seek to section %d\n", err); - return err; - } + if (err) + return file_error("can't seek to section", module->elf_file); count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) { - fprintf(stderr, "error: can't read section %d\n", -errno); - return -errno; - } + if (count != module->file_size) + return file_error("can't read section", module->elf_file); fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, 0, module->file_size, 0, "DATA"); @@ -618,11 +599,9 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, image->out_man_fd); /* did the metadata/manifest write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write meta %s %d\n", - image->out_man_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write meta", image->out_man_file); + fclose(image->out_man_fd); /* now prepare the unsigned rimage */ @@ -631,11 +610,8 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write firmware %s %d\n", - image->out_unsigned_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write firmware", image->out_unsigned_file); fclose(image->out_unsigned_fd); return 0; @@ -649,11 +625,8 @@ static int man_write_fw_mod(struct image *image) count = fwrite(image->fw_image, image->image_end, 1, image->out_fd); /* did the image write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write signed firmware %s %d\n", - image->out_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write signed firmware", image->out_file); return 0; } @@ -1567,11 +1540,8 @@ int verify_image(struct image *image) /* open image for reading */ in_file = fopen(image->verify_file, "rb"); - if (!in_file) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - image->verify_file, errno); - return -errno; - } + if (!in_file) + return file_error("unable to open file for reading", image->verify_file); /* get file size */ ret = get_file_size(in_file, image->verify_file, &size); @@ -1589,9 +1559,7 @@ int verify_image(struct image *image) /* find start of fw image and verify */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", - size, image->verify_file, errno); - ret = errno; + ret = file_error("unable to read whole file", image->verify_file); goto out; } for (i = 0; i < size; i += sizeof(uint32_t)) { @@ -1622,11 +1590,8 @@ int resign_image(struct image *image) /* open image for reading */ in_file = fopen(image->in_file, "rb"); - if (!in_file) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - image->in_file, errno); - return -errno; - } + if (!in_file) + return file_error("unable to open file for reading", image->in_file); /* get file size */ ret = get_file_size(in_file, image->in_file, &size); @@ -1644,9 +1609,7 @@ int resign_image(struct image *image) /* read file into buffer */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %zu bytes from %s err %d\n", - size, image->in_file, errno); - ret = errno; + ret = file_error("unable to read whole file", image->in_file); goto out; } @@ -1703,9 +1666,7 @@ int resign_image(struct image *image) unlink(image->out_file); image->out_fd = fopen(image->out_file, "wb"); if (!image->out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_file, errno); - ret = -EINVAL; + ret = file_error("unable to open file for writting", image->out_file); goto out; } diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index ef0169b66e36..de063ee03bec 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -24,6 +24,7 @@ #include <rimage/css.h> #include <rimage/manifest.h> #include <rimage/misc_utils.h> +#include <rimage/file_utils.h> #include <rimage/hash.h> #define DEBUG_PKCS 0 @@ -57,11 +58,9 @@ static int rimage_read_key(EVP_PKEY **privkey, struct image *image) fprintf(stdout, " %s: read key '%s'\n", __func__, path); fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } + if (!fp) + return file_error("unable to open file for reading", path); + PEM_read_PrivateKey(fp, privkey, NULL, NULL); fclose(fp); diff --git a/src/rimage.c b/src/rimage.c index 4ec34a856840..a6e23470d698 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -14,6 +14,7 @@ #include <rimage/ext_manifest_gen.h> #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static void usage(char *name) @@ -218,9 +219,7 @@ int main(int argc, char *argv[]) unlink(image.out_file); image.out_fd = fopen(image.out_file, "wb"); if (!image.out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image.out_file, errno); - ret = -EINVAL; + ret = file_error("unable to open file for writing", image.out_file); goto out; } From 125745bcad1742b2bc2aac20096857bb66f704d0 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:52:42 +0100 Subject: [PATCH 295/350] file_utils: Fix error detection in get_file_size function The fseek function returns -1 to signal an error. Return value was assigned to a variable without a sign, so the error could not be detected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index c8d406d677ba..89a89ae40954 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -44,7 +44,7 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat int get_file_size(FILE *f, const char* filename, size_t *size) { int ret; - + long pos; assert(size); /* get file size */ @@ -52,13 +52,14 @@ int get_file_size(FILE *f, const char* filename, size_t *size) if (ret) return file_error("unable to seek eof", filename); - *size = ftell(f); - if (*size < 0) + pos = ftell(f); + if (pos < 0) return file_error("unable to get file size", filename); ret = fseek(f, 0, SEEK_SET); if (ret) return file_error("unable to seek set", filename); + *size = pos; return 0; } From 343b6d863da53ad29deb47b4fbb3f3cc51a289c2 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 10 Mar 2023 16:08:11 +0100 Subject: [PATCH 296/350] Revert "config:tgl/tglh: Do not set cached/uncached address aliases" Now that rimage can distinguish between Zephyr and XTOS builds, we can use memory alias specifiers with both. This reverts commit 1e0a85b44a19db37f9dd18906091d87abd8bd5e6. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/tgl-h.toml | 8 ++++++++ config/tgl.toml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 908c3bfc8a1f..997e1a832899 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index d6183faf5345..9a64c694c7f8 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] From 63eb6ffb0a0b81b328c209173f743f5b6750e521 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Tue, 21 Mar 2023 16:05:27 +0100 Subject: [PATCH 297/350] cAVS: add alias definitions to cAVS 1.5-2.0 cAVS 1.5, 1.8 and 2.0 are supported by Zephyr, their configurations need alias definitions. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/apl.toml | 8 ++++++++ config/cnl.toml | 8 ++++++++ config/icl.toml | 8 ++++++++ config/jsl.toml | 8 ++++++++ config/kbl.toml | 8 ++++++++ config/skl.toml | 8 ++++++++ config/sue.toml | 8 ++++++++ 7 files changed, 56 insertions(+) diff --git a/config/apl.toml b/config/apl.toml index fafd01853da7..e100c78a754c 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "apl" image_size = "0x0A0000" # (8 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/cnl.toml b/config/cnl.toml index fae7fe80c6d1..ccf33fb68e2a 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "cnl" image_size = "0x300000" # (47 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/icl.toml b/config/icl.toml index 20ba7765fc56..f6e0fc9cb209 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "icl" image_size = "0x300000" # (47 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/jsl.toml b/config/jsl.toml index a501066a2531..bec0e6bd3a7e 100644 --- a/config/jsl.toml +++ b/config/jsl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "icl" image_size = "0x110000" # (16 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/kbl.toml b/config/kbl.toml index 442c886b99ec..f1c83d594905 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -3,6 +3,7 @@ version = [1, 5] [adsp] name = "kbl" image_size = "0x200000" # (30 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [css] [fw_desc.header] diff --git a/config/skl.toml b/config/skl.toml index a907a121d74c..0fff3a382bbf 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -3,6 +3,7 @@ version = [1, 5] [adsp] name = "skl" image_size = "0x200000" # (30 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [css] [fw_desc.header] diff --git a/config/sue.toml b/config/sue.toml index bcf093c70fc3..7579c7fcfb06 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -4,6 +4,7 @@ version = [1, 5] name = "sue" image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,6 +19,13 @@ type = "SRAM" base = "0xbe000000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [fw_desc.header] name = "ADSPFW" load_offset = "0x2000" From 1bf447c8c2992b53c6028ea38165babe5640128b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Thu, 30 Mar 2023 13:48:54 +0300 Subject: [PATCH 298/350] config: tgl-h-cavs: align modules to tgl-cavs config Update the list of modules to match that of "tgl-cavs". Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- config/tgl-h-cavs.toml | 155 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index cab16a4365a8..69f8de7ab581 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 8 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -235,3 +235,156 @@ count = 8 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + [[module.entry]] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "1" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0xD" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From 01fd742605985351cfb4a8e50356764ec4e1fd01 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Fri, 23 Sep 2022 15:17:03 +0200 Subject: [PATCH 299/350] lnl: Add LNL configuration file Add base LNL config derived from MTL. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- config/lnl.toml | 488 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 488 insertions(+) create mode 100644 config/lnl.toml diff --git a/config/lnl.toml b/config/lnl.toml new file mode 100644 index 000000000000..0093e40a3eee --- /dev/null +++ b/config/lnl.toml @@ -0,0 +1,488 @@ +version = [3, 0] + +[adsp] +name = "lnl" +image_size = "0x2C0000" # (22) bank * 128KB +alias_mask = "0xE0000000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x1FF80000" +size = "0x400" +[[adsp.mem_zone]] +type = "IMR" +base = "0xA104A000" +size = "0x2000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xa00f0000" +size = "0x100000" + +[[adsp.mem_alias]] +type = "uncached" +base = "0x40000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xA0000000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "ADSP.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "ADSP" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +partition_usage = "0x23" +[[signed_pkg.module]] +name = "ADSP.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x40000" + +[module] +count = 19 + [[module.entry]] + name = "BRNGUP" + uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "ASRC" + uuid = "66B4402D-B468-42F2-81A7-B37121863DD4" + affinity_mask = "0x3" + instance_count = "2" + domain_types = "0" + + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, + 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, + 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, + 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, + 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, + 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, + 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, + 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, + 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, + 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, + 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, + 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, + 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, + 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, + 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + + [[module.entry]] + name = "SRC" + uuid = "E61BB28D-149A-4C1F-B709-46823EF5F5AE" + affinity_mask = "0x1" + #instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "UPDWMIX" + uuid = "42F8060C-832F-4DBF-B247-51E961997B34" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xffff, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, + 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, + 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, + 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, + 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + + [[module.entry]] + name = "MUX" + uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "0xD" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From 9643a986dda97c6cb339d5c75c0eaa178d8317da Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Mon, 3 Apr 2023 11:18:04 +0200 Subject: [PATCH 300/350] kpb: update UUID Change of uuid regarding Windows compatibility Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index a762ea7696c7..38698b8e2c39 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -387,7 +387,7 @@ count = 19 [[module.entry]] name = "KPB" - uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + uuid = "A8A0CB32-4A77-4DB1-85C7-53D7EE07BCE6" affinity_mask = "0x1" instance_count = "1" domain_types = "0" From b2177e55856279f3a0f381327c73b61bc6221c5c Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:40:21 +0100 Subject: [PATCH 301/350] elf: Add header guard to elf.h Added header guard in elf.h file to allow safe include this header by multiple units. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/elf.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/rimage/elf.h b/src/include/rimage/elf.h index a9a6505e7793..13a4965e059e 100644 --- a/src/include/rimage/elf.h +++ b/src/include/rimage/elf.h @@ -5,6 +5,9 @@ * Portions Copyright 2009 The Go Authors. All rights reserved. */ +#ifndef __ELF_H__ +#define __ELF_H__ + /* * ELF definitions that are independent of architecture or word size. */ @@ -929,3 +932,5 @@ typedef struct { #define ELF32SHDRSIZE sizeof(Elf32_Shdr) #define ELF32SYMSIZE sizeof(Elf32_Sym) #define ELF32RELSIZE 8 + +#endif /* __ELF_H__ */ From 9633c3b66ff77f41c5a8b5b070b0ee5fc6ed5798 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 10 Mar 2023 16:45:32 +0100 Subject: [PATCH 302/350] manifest: Check return value of man_create_modules The man_create_modules function may return an error that was ignored. Added check of a return value. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 5ce0c1d91744..f2a7c3e7a35b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -774,7 +774,9 @@ int man_write_fw_v1_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -844,7 +846,10 @@ int man_write_fw_v1_5_sue(struct image *image) /* create each module - subtract the boot loader exec header */ m->desc.header.num_module_entries = image->num_modules - 1; - man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + ret = man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + if (ret) + goto err; + fprintf(stdout, "Firmware completing manifest v1.5\n"); /* write preload page count */ @@ -915,7 +920,9 @@ int man_write_fw_v1_8(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -1033,7 +1040,9 @@ int man_write_fw_meu_v1_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -1117,7 +1126,9 @@ int man_write_fw_meu_v1_8(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -1201,7 +1212,10 @@ int man_write_fw_meu_v2_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); @@ -1288,7 +1302,10 @@ int man_write_fw_v2_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); @@ -1438,7 +1455,10 @@ int man_write_fw_ace_v1_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); From c21018335af5d4b501376fa9d5b86187b64284a1 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 21 Mar 2023 13:10:49 +0100 Subject: [PATCH 303/350] Remove unused dram_offset field / config option There was no dram_offset value in any configuration file. It also wasn't used anywhere in the code. So the code reading it from the tolm file has been removed. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 5 ----- src/include/rimage/rimage.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 4cab5cbe489f..fdeadb7b9a52 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -66,7 +66,6 @@ static void dump_adsp(const struct adsp *adsp) DUMP("\nadsp"); DUMP_KEY("name", "'%s'", adsp->name); DUMP_KEY("image_size", "0x%x", adsp->image_size); - DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { DUMP_KEY("mem_zone.idx", "%d", i); @@ -115,10 +114,6 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->dram_offset = parse_uint32_hex_key(adsp, &ctx, "dram_offset", 0, &ret); - if (ret < 0) - return ret; - out->exec_boot_ldr = parse_uint32_key(adsp, &ctx, "exec_boot_ldr", 0, &ret); if (ret < 0) return ret; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 692dbcdd7d28..ec2449dfcaac 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -146,7 +146,6 @@ struct adsp { struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; uint32_t image_size; - uint32_t dram_offset; uint32_t alias_cached; uint32_t alias_uncached; From d20916066e1a8226ac3a0b91bb10781ac2219fad Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 15:28:12 +0100 Subject: [PATCH 304/350] misc_utils: Added functions to print enum and flags value Added name_val structure representing name/value tuple. Added function print_enum which displays the name of the enum corresponding to a given value. Added print_flags function which display names of flags constituting a given value. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/misc_utils.h | 16 ++++++++++++++++ src/misc_utils.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h index cf9353ac9d8d..8ec051d74e91 100644 --- a/src/include/rimage/misc_utils.h +++ b/src/include/rimage/misc_utils.h @@ -3,6 +3,9 @@ * Copyright(c) 2023 Intel Corporation. All rights reserved. */ +#ifndef __MISC_UTILS_H__ +#define __MISC_UTILS_H__ + #include <stdint.h> /** @@ -11,3 +14,16 @@ * @param size of the array */ void bytes_swap(uint8_t *ptr, uint32_t size); + +struct name_val { + const char *name; + unsigned long value; +}; + +#define NAME_VAL_ENTRY(x) { .name = #x, .value = x } +#define NAME_VAL_END { .name = 0, .value = 0 } + +void print_enum(unsigned long value, const struct name_val *values); +void print_flags(unsigned long value, const struct name_val *flags); + +#endif /* __MISC_UTILS_H__ */ diff --git a/src/misc_utils.c b/src/misc_utils.c index e4b5e4d4ce5c..2c0146f5bdd9 100644 --- a/src/misc_utils.c +++ b/src/misc_utils.c @@ -1,8 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause /* * Copyright(c) 2018-2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> */ +#include <stdio.h> #include <rimage/misc_utils.h> void bytes_swap(uint8_t *ptr, uint32_t size) @@ -16,3 +19,33 @@ void bytes_swap(uint8_t *ptr, uint32_t size) ptr[size - 1 - index] = tmp; } } + +void print_enum(unsigned long value, const struct name_val *values) +{ + while (values->name) { + if (values->value == value) { + fprintf(stdout, "%s\n", values->name); + return; + } + + values++; + } + + printf("Unknown: 0x%lx\n", value); +} + +void print_flags(unsigned long value, const struct name_val *flags) +{ + while (flags->name) { + if (value & flags->value) { + fprintf(stdout, "%s ", flags->name); + value &= ~flags->value; + } + + flags++; + } + + if (value) + fprintf(stdout, "+ 0x%lx", value); + printf("\n"); +} From b9ecb0072d5dc39e6e7fcf3c5b3a92c00da2a84b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 16:19:14 +0200 Subject: [PATCH 305/350] rimage: adsp_config: Create new memory_config structure. Moved mem_zone field from adsp structure to the new memory_config structure Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 14 +++++++------- src/elf.c | 8 ++++---- src/file_simple.c | 13 ++++++------- src/include/rimage/rimage.h | 8 ++++++-- src/manifest.c | 2 +- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index fdeadb7b9a52..7835883a1452 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -67,11 +67,11 @@ static void dump_adsp(const struct adsp *adsp) DUMP_KEY("name", "'%s'", adsp->name); DUMP_KEY("image_size", "0x%x", adsp->image_size); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); - for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { + for (i = 0; i < ARRAY_SIZE(adsp->mem.zones); ++i) { DUMP_KEY("mem_zone.idx", "%d", i); - DUMP_KEY("mem_zone.size", "0x%x", adsp->mem_zones[i].size); - DUMP_KEY("mem_zone.base", "0x%x", adsp->mem_zones[i].base); - DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem_zones[i].host_offset); + DUMP_KEY("mem_zone.size", "0x%x", adsp->mem.zones[i].size); + DUMP_KEY("mem_zone.base", "0x%x", adsp->mem.zones[i].base); + DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem.zones[i].host_offset); } } @@ -79,7 +79,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a bool verbose) { toml_array_t *mem_zone_array, *alias_array; - struct mem_zone *zone; + struct memory_zone *zone; struct parse_ctx ctx; toml_table_t *adsp; toml_raw_t raw; @@ -164,7 +164,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a } /* look for entry array */ - memset(out->mem_zones, 0, sizeof(out->mem_zones)); + memset(&out->mem, 0, sizeof(out->mem)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); @@ -196,7 +196,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (zone_idx < 0) return err_key_parse("mem_zone.name", "unknown zone '%s'", zone_name); - zone = &out->mem_zones[zone_idx]; + zone = &out->mem.zones[zone_idx]; zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); if (ret < 0) return err_key_parse("mem_zone", NULL); diff --git a/src/elf.c b/src/elf.c index 0275a194ed79..5bad95fb26b7 100644 --- a/src/elf.c +++ b/src/elf.c @@ -28,8 +28,8 @@ static int elf_read_sections(struct image *image, struct module *module, size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - unsigned long rom_base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; - size_t rom_size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + unsigned long rom_base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; + size_t rom_size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -256,8 +256,8 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) start = section->vaddr; end = section->vaddr + section->size; - base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; - size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; + size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; if (start < base || start > base + size) return 0; diff --git a/src/file_simple.c b/src/file_simple.c index a63afa8de815..b15d739ed98a 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -12,9 +12,8 @@ #include <rimage/manifest.h> #include <rimage/file_utils.h> -static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) +static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *section) { - const struct adsp *adsp = image->adsp; uint32_t start, end, base, size; int i; @@ -22,8 +21,8 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) end = section->vaddr + section->size; for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { - base = adsp->mem_zones[i].base; - size = adsp->mem_zones[i].size; + base = memory->zones[i].base; + size = memory->zones[i].size; if (start < base) continue; @@ -55,11 +54,11 @@ static int write_block(struct image *image, struct module *module, block.size += padding; } - ret = get_mem_zone_type(image, section); + ret = get_mem_zone_type(&image->adsp->mem, section); if (ret != SOF_FW_BLK_TYPE_INVALID) { block.type = ret; - block.offset = section->vaddr - adsp->mem_zones[ret].base - + adsp->mem_zones[ret].host_offset; + block.offset = section->vaddr - adsp->mem.zones[ret].base + + adsp->mem.zones[ret].host_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", section->vaddr, section->size); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ec2449dfcaac..fc88981c2401 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -110,12 +110,16 @@ struct image { uint32_t imr_type; }; -struct mem_zone { +struct memory_zone { uint32_t base; uint32_t size; uint32_t host_offset; }; +struct memory_config { + struct memory_zone zones[SOF_FW_BLK_TYPE_NUM]; +}; + struct fw_image_ext_mod_config { struct fw_ext_mod_config_header header; struct mod_scheduling_caps sched_caps; @@ -143,7 +147,7 @@ struct fw_image_manifest_module { */ struct adsp { const char *name; - struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; + struct memory_config mem; uint32_t image_size; diff --git a/src/manifest.c b/src/manifest.c index f2a7c3e7a35b..f212b9d4ed33 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -36,7 +36,7 @@ static int man_open_rom_file(struct image *image) if (ret) return ret; - size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; /* allocate ROM image */ image->rom_image = calloc(size, 1); From 9ecae53e2828e77976bc4d5f840579f256a08014 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 16:24:08 +0200 Subject: [PATCH 306/350] rimage: Moved memory alias configuration to a new struct A new memory_alias structure containing memory address alias configurations has been created. It was placed in the memory_config structure. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 13 +++++++------ src/elf.c | 2 +- src/include/rimage/rimage.h | 11 +++++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 7835883a1452..ac196075a2b0 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -118,7 +118,8 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); + memset(&out->mem, 0, sizeof(out->mem)); + out->mem.alias.mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); alias_found = !ret; /* check everything parsed, 1 or 2 tables should be present */ @@ -153,18 +154,18 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a base = parse_uint32_hex_key(alias, &ctx, "base", -1, &ret); if (!strncmp("cached", alias_name, sizeof("cached"))) - out->alias_cached = base & out->alias_mask; + out->mem.alias.cached = base & out->mem.alias.mask; else if (!strncmp("uncached", alias_name, sizeof("uncached"))) - out->alias_uncached = base & out->alias_mask; + out->mem.alias.uncached = base & out->mem.alias.mask; } } else { /* Make uncache_to_cache() an identity transform */ - out->alias_cached = 0; - out->alias_mask = 0; + out->mem.alias.uncached = 0; + out->mem.alias.cached = 0; + out->mem.alias.mask = 0; } /* look for entry array */ - memset(&out->mem, 0, sizeof(out->mem)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); diff --git a/src/elf.c b/src/elf.c index 5bad95fb26b7..a8a98c9618f1 100644 --- a/src/elf.c +++ b/src/elf.c @@ -17,7 +17,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { - return (address & ~image->adsp->alias_mask) | image->adsp->alias_cached; + return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; } static int elf_read_sections(struct image *image, struct module *module, diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index fc88981c2401..e682dc01ce66 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -116,8 +116,15 @@ struct memory_zone { uint32_t host_offset; }; +struct memory_alias { + uint32_t mask; + uint32_t cached; + uint32_t uncached; +}; + struct memory_config { struct memory_zone zones[SOF_FW_BLK_TYPE_NUM]; + struct memory_alias alias; }; struct fw_image_ext_mod_config { @@ -151,10 +158,6 @@ struct adsp { uint32_t image_size; - uint32_t alias_cached; - uint32_t alias_uncached; - uint32_t alias_mask; - int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From 99195d2ee6a7eeb926b6dd75be9a7ac23d6859fa Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 17:00:36 +0200 Subject: [PATCH 307/350] rimage: manifest: Rename struct module to manifest_module Changing the name of the structure type is a prelude to separating information about the elf file from the information used during creation of a manifest. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 26 ++++++++-------- src/ext_manifest.c | 8 ++--- src/file_simple.c | 10 +++---- src/include/rimage/manifest.h | 51 +++++++++++++++++++++++++++++++ src/include/rimage/rimage.h | 56 ++++------------------------------- src/manifest.c | 14 ++++----- 6 files changed, 85 insertions(+), 80 deletions(-) diff --git a/src/elf.c b/src/elf.c index a8a98c9618f1..e152b7588a00 100644 --- a/src/elf.c +++ b/src/elf.c @@ -20,7 +20,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long a return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; } -static int elf_read_sections(struct image *image, struct module *module, +static int elf_read_sections(struct image *image, struct manifest_module *module, int module_index) { Elf32_Ehdr *hdr = &module->hdr; @@ -151,7 +151,7 @@ static int elf_read_sections(struct image *image, struct module *module, return 0; } -static int elf_read_programs(struct image *image, struct module *module) +static int elf_read_programs(struct image *image, struct manifest_module *module) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Phdr *prg = module->prg; @@ -207,7 +207,7 @@ static int elf_read_programs(struct image *image, struct module *module) return 0; } -static int elf_read_hdr(struct image *image, struct module *module) +static int elf_read_hdr(struct image *image, struct manifest_module *module) { Elf32_Ehdr *hdr = &module->hdr; size_t count; @@ -266,7 +266,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) return 1; } -static void elf_module_size(struct image *image, struct module *module, +static void elf_module_size(struct image *image, struct manifest_module *module, Elf32_Shdr *section, uint32_t lma, int index) { switch (section->type) { @@ -310,7 +310,7 @@ static void elf_module_size(struct image *image, struct module *module, } } -static void elf_module_size_reloc(struct image *image, struct module *module, +static void elf_module_size_reloc(struct image *image, struct manifest_module *module, Elf32_Shdr *section, int index) { switch (section->type) { @@ -346,7 +346,7 @@ static void elf_module_size_reloc(struct image *image, struct module *module, } } -static void elf_module_limits(struct image *image, struct module *module) +static void elf_module_limits(struct image *image, struct manifest_module *module) { Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -408,10 +408,10 @@ static void elf_module_limits(struct image *image, struct module *module) } /* make sure no section overlap from any modules */ -int elf_validate_section(struct image *image, struct module *module, +int elf_validate_section(struct image *image, struct manifest_module *module, Elf32_Shdr *section, int index) { - struct module *m; + struct manifest_module *m; Elf32_Shdr *s; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j; @@ -464,7 +464,7 @@ int elf_validate_section(struct image *image, struct module *module, /* make sure no section overlaps from any modules */ int elf_validate_modules(struct image *image) { - struct module *module; + struct manifest_module *module; Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j, ret; @@ -498,7 +498,7 @@ int elf_validate_modules(struct image *image) return 0; } -int elf_find_section(const struct module *module, const char *name) +int elf_find_section(const struct manifest_module *module, const char *name) { const Elf32_Ehdr *hdr = &module->hdr; const Elf32_Shdr *section, *s; @@ -546,7 +546,7 @@ int elf_find_section(const struct module *module, const char *name) return ret; } -int elf_read_section(const struct module *module, const char *section_name, +int elf_read_section(const struct manifest_module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { const Elf32_Shdr *section; @@ -585,7 +585,7 @@ int elf_read_section(const struct module *module, const char *section_name, int elf_parse_module(struct image *image, int module_index, const char *name) { - struct module *module; + struct manifest_module *module; uint32_t rem; int ret = 0; @@ -676,7 +676,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) void elf_free_module(struct image *image, int module_index) { - struct module *module = &image->module[module_index]; + struct manifest_module *module = &image->module[module_index]; free(module->prg); free(module->section); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index e670b47825e5..92360d6bbf98 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -41,9 +41,9 @@ static int ext_man_open_file(struct image *image) return 0; } -static const struct module *ext_man_find_module(const struct image *image) +static const struct manifest_module *ext_man_find_module(const struct image *image) { - const struct module *module; + const struct manifest_module *module; int i; /* when there is more than one module, then first one is bootloader */ @@ -86,7 +86,7 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct module *module, +static int ext_man_build(const struct manifest_module *module, struct ext_man_header **dst_buff) { struct ext_man_header ext_man; @@ -135,7 +135,7 @@ static int ext_man_build(const struct module *module, int ext_man_write(struct image *image) { - const struct module *module; + const struct manifest_module *module; struct ext_man_header *ext_man = NULL; int count; int ret; diff --git a/src/file_simple.c b/src/file_simple.c index b15d739ed98a..931bee3c3d5b 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -37,7 +37,7 @@ static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *sec static int block_idx; -static int write_block(struct image *image, struct module *module, +static int write_block(struct image *image, struct manifest_module *module, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -109,7 +109,7 @@ static int write_block(struct image *image, struct module *module, return ret; } -static int simple_write_module(struct image *image, struct module *module) +static int simple_write_module(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; Elf32_Shdr *section; @@ -191,7 +191,7 @@ static int simple_write_module(struct image *image, struct module *module) return padding; } -static int write_block_reloc(struct image *image, struct module *module) +static int write_block_reloc(struct image *image, struct manifest_module *module) { struct snd_sof_blk_hdr block; size_t count; @@ -240,7 +240,7 @@ static int write_block_reloc(struct image *image, struct module *module) return ret; } -static int simple_write_module_reloc(struct image *image, struct module *module) +static int simple_write_module_reloc(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; size_t count; @@ -282,7 +282,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) int simple_write_firmware(struct image *image) { struct snd_sof_fw_header hdr; - struct module *module; + struct manifest_module *module; size_t count; int i, ret; diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index a1c9e39ec174..2f345779a6b8 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,10 +7,61 @@ #define __MANIFEST_H__ #include <stdint.h> +#include <stdio.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> #include <rimage/plat_auth.h> +#include <rimage/elf.h> + +/* + * Manifest module data + */ +struct manifest_module { + /* This fields will be moved to module structure */ + const char *elf_file; + FILE *fd; + + Elf32_Ehdr hdr; + Elf32_Shdr *section; + Elf32_Phdr *prg; + char *strings; + + uint32_t text_start; + uint32_t text_end; + uint32_t data_start; + uint32_t data_end; + uint32_t bss_start; + uint32_t bss_end; + + int num_sections; + int num_bss; + int bss_index; + + /* sizes do not include any gaps */ + int bss_size; + int text_size; + int data_size; + + /* sizes do include gaps to nearest page */ + int bss_file_size; + int text_file_size; + int data_file_size; + + /* total file size */ + size_t file_size; + + /* Following fields are used in manifest creation process */ + int fw_size; + + /* executable header module */ + int exec_header; + + /* module offset in image file */ + size_t foffset; + + size_t text_fixup_size; +}; #define MAN_PAGE_SIZE 4096 #define MAN_MAX_SIZE_V1_8 (38 * 1024) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e682dc01ce66..ac0595bd893d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -6,11 +6,10 @@ #ifndef __RIMAGE_H__ #define __RIMAGE_H__ -#include "elf.h" - #include <stdint.h> #include <stdio.h> +#include <rimage/manifest.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> @@ -18,51 +17,6 @@ #define MAX_MODULES 32 struct adsp; -struct manifest; -struct man_module; - -/* - * ELF module data - */ -struct module { - const char *elf_file; - FILE *fd; - - Elf32_Ehdr hdr; - Elf32_Shdr *section; - Elf32_Phdr *prg; - char *strings; - - uint32_t text_start; - uint32_t text_end; - uint32_t data_start; - uint32_t data_end; - uint32_t bss_start; - uint32_t bss_end; - uint32_t foffset; - - int num_sections; - int num_bss; - int fw_size; - int bss_index; - - /* sizes do not include any gaps */ - int bss_size; - int text_size; - int data_size; - - /* sizes do include gaps to nearest page */ - int bss_file_size; - int text_file_size; - int text_fixup_size; - int data_file_size; - - /* total file size */ - size_t file_size; - - /* executable header module */ - int exec_header; -}; /* * Firmware image context. @@ -79,7 +33,7 @@ struct image { int verbose; int reloc; /* ELF data is relocatable */ int num_modules; - struct module module[MAX_MODULES]; + struct manifest_module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; const char *verify_file; @@ -219,10 +173,10 @@ int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); -int elf_find_section(const struct module *module, const char *name); -int elf_read_section(const struct module *module, const char *name, +int elf_find_section(const struct manifest_module *module, const char *name); +int elf_read_section(const struct manifest_module *module, const char *name, const Elf32_Shdr **dst_section, void **dst_buff); -int elf_validate_section(struct image *image, struct module *module, +int elf_validate_section(struct image *image, struct manifest_module *manifest_module, Elf32_Shdr *section, int index); #endif diff --git a/src/manifest.c b/src/manifest.c index f212b9d4ed33..76754a542650 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -141,7 +141,7 @@ static int man_init_image_v2_5(struct image *image) /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, Elf32_Shdr *section) { @@ -174,7 +174,7 @@ static uint32_t elf_to_file_offset(struct image *image, /* write SRAM sections */ static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, int section_idx) { @@ -227,7 +227,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, int idx) { int ret; @@ -244,7 +244,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, return 0; } -static int man_get_module_manifest(struct image *image, struct module *module, +static int man_get_module_manifest(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { Elf32_Shdr *section; @@ -371,7 +371,7 @@ static int man_module_validate(struct sof_man_module *man_module) return -EINVAL; } -static int man_module_create(struct image *image, struct module *module, +static int man_module_create(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { /* create module and segments */ @@ -502,7 +502,7 @@ static int man_module_create(struct image *image, struct module *module, return 0; } -static int man_module_create_reloc(struct image *image, struct module *module, +static int man_module_create_reloc(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { /* create module and segments */ @@ -634,7 +634,7 @@ static int man_write_fw_mod(struct image *image) static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, int file_text_offset) { - struct module *module; + struct manifest_module *module; struct sof_man_module *man_module; int err; int i = 0, offset = 0; From 7367fdf1e6133ca36a38eb7ddbf7d2a85565e358 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 18:21:23 +0200 Subject: [PATCH 308/350] manifest_module: rename fw_size to output_size Changed the name of the fw_size variable to a more clear one and added a description. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 6 +++--- src/file_simple.c | 6 +++--- src/include/rimage/manifest.h | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/elf.c b/src/elf.c index e152b7588a00..6ea44cffe274 100644 --- a/src/elf.c +++ b/src/elf.c @@ -109,7 +109,7 @@ static int elf_read_sections(struct image *image, struct manifest_module *module /* fall through */ case SHT_PROGBITS: /* text or data */ - module->fw_size += section[i].size; + module->output_size += section[i].size; if (section[i].flags & SHF_EXECINSTR) module->text_size += section[i].size; @@ -637,8 +637,8 @@ int elf_parse_module(struct image *image, int module_index, const char *name) elf_find_section(module, ""); - fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", - module->fw_size, module->fw_size, module->num_sections); + fprintf(stdout, " module: input size %zu (0x%zx) bytes %d sections\n", + module->output_size, module->output_size, module->num_sections); fprintf(stdout, " module: text %d (0x%x) bytes\n" " data %d (0x%x) bytes\n" " bss %d (0x%x) bytes\n\n", diff --git a/src/file_simple.c b/src/file_simple.c index 931bee3c3d5b..872473525703 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -294,11 +294,11 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; - module->fw_size += sizeof(struct snd_sof_blk_hdr) * + module->output_size += sizeof(struct snd_sof_blk_hdr) * (module->num_sections - module->num_bss); - module->fw_size += sizeof(struct snd_sof_mod_hdr) * + module->output_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; - hdr.file_size += module->fw_size; + hdr.file_size += module->output_size; } count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 2f345779a6b8..e97982a2bdae 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -54,6 +54,10 @@ struct manifest_module { /* Following fields are used in manifest creation process */ int fw_size; + /* Size of the module in the output image. + * Includes text and data sections size + image headers*/ + size_t output_size; + /* executable header module */ int exec_header; From 1bda0c52541ee64132ff005ac5ed333fe7126080 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 18:30:05 +0200 Subject: [PATCH 309/350] manifest_module: Add is_bootloader field A is_bootloader field has been added to determine whether a module is a bootloader. This is clearer than checking the module index and the number of modules in different places in the program. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 2 +- src/ext_manifest.c | 7 +++++-- src/include/rimage/manifest.h | 3 +++ src/rimage.c | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/elf.c b/src/elf.c index 6ea44cffe274..3843635d469f 100644 --- a/src/elf.c +++ b/src/elf.c @@ -77,7 +77,7 @@ static int elf_read_sections(struct image *image, struct manifest_module *module return -errno; } - if (image->num_modules > 1 && module_index == 0) { + if (module->is_bootloader) { /* In case of multiple modules first one should be bootloader, * that should not have these sections. */ diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 92360d6bbf98..fb021e3dc270 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -46,9 +46,12 @@ static const struct manifest_module *ext_man_find_module(const struct image *ima const struct manifest_module *module; int i; - /* when there is more than one module, then first one is bootloader */ - for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; + + if (module->is_bootloader) + continue; + if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) return module; } diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index e97982a2bdae..15c79b732661 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -8,6 +8,7 @@ #include <stdint.h> #include <stdio.h> +#include <stdbool.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> @@ -54,6 +55,8 @@ struct manifest_module { /* Following fields are used in manifest creation process */ int fw_size; + bool is_bootloader; + /* Size of the module in the output image. * Includes text and data sections size + image headers*/ size_t output_size; diff --git a/src/rimage.c b/src/rimage.c index a6e23470d698..75c4a8bff56d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -204,6 +204,10 @@ int main(int argc, char *argv[]) /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { + /* When there is more than one module, then first one is bootloader. */ + image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && + i == first_non_opt; + fprintf(stdout, "\nModule Reading %s\n", argv[i]); ret = elf_parse_module(&image, i - first_non_opt, argv[i]); if (ret < 0) From 6e3abe6afed380e7e9a6f430552f3ce54915eb40 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 10 Mar 2023 16:44:20 +0100 Subject: [PATCH 310/350] rimage: Add suport for loadable modules A new -l parameter has been added to the program's command line. It instructs the program to not treat the first module as a bootloader and not to skip the bss section for it. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/rimage.h | 3 +++ src/rimage.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ac0595bd893d..2b9a26ef5b41 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -62,6 +62,9 @@ struct image { uint16_t fw_ver_build; uint32_t imr_type; + + /* Output image is a loadable module */ + bool loadable_module; }; struct memory_zone { diff --git a/src/rimage.c b/src/rimage.c index 75c4a8bff56d..556e05890507 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -f firmware version = major.minor.micro\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); + fprintf(stdout, "\t -l build loadable modules image (don't treat the first module as a bootloader)\n"); fprintf(stdout, "\t -y verify signed file\n"); fprintf(stdout, "\t -q resign binary\n"); fprintf(stdout, "\t -p set PV bit\n"); @@ -49,7 +50,7 @@ int main(int argc, char *argv[]) image.imr_type = MAN_DEFAULT_IMR_TYPE; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p:l")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -97,6 +98,9 @@ int main(int argc, char *argv[]) case 'p': pv_bit = 1; break; + case 'l': + image.loadable_module = true; + break; default: /* getopt's default error message is good enough */ return 1; @@ -204,9 +208,10 @@ int main(int argc, char *argv[]) /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { - /* When there is more than one module, then first one is bootloader. */ + /* When there is more than one module, then first one is bootloader. + * Does not apply to building a image of a loadable module. */ image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && - i == first_non_opt; + i == first_non_opt && !image.loadable_module; fprintf(stdout, "\nModule Reading %s\n", argv[i]); ret = elf_parse_module(&image, i - first_non_opt, argv[i]); From debf4cf605ef39b283abb1f9bce582afaebc96cf Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 10:13:57 +0200 Subject: [PATCH 311/350] manifest: Move MAN_MAX_SIZE_V1_8 define to the public manifest header Currently, sof incorrectly includes a private manifest.h header belonging to the manifest.c module. Moved the MAN_MAX_SIZE_V1_8 definition used by sof, to the public manifest header to allow sof to switch to using the correct file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/manifest.h | 1 - src/include/rimage/sof/user/manifest.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 15c79b732661..c1f820c5a624 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -71,7 +71,6 @@ struct manifest_module { }; #define MAN_PAGE_SIZE 4096 -#define MAN_MAX_SIZE_V1_8 (38 * 1024) /* start offset for modules built using xcc */ #define DEFAULT_XCC_MOD_OFFSET 0x8 diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index e49a76f76fcb..d270ce98b309 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -30,6 +30,9 @@ #define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG 0 /* Base config only */ #define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG_WITH_EXT 1 /* Base config with extension */ +#define MAN_MAX_SIZE_V1_8 (38 * 1024) + + struct sof_man_module_type { uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ uint32_t auto_start:1; From 25804e7dc8ee37f3cb87b0a96b58300478cd3cff Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 12:50:25 +0200 Subject: [PATCH 312/350] manifest: Use module manifest from toml as a template for elf modules The manifest for elf modules is read from their .module section. The modules configuration parsed from a toml file was completely ignored. After this change, the parsed configuration is treated as a template for the module manifest. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 10 ++++++++-- src/rimage.c | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 76754a542650..3e8f2fc7e81d 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -662,6 +662,10 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, for (; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); + /* Use manifest created using toml files as template */ + assert(i < image->adsp->modules->mod_man_count); + memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + module = &image->module[i]; if (i == 0) @@ -693,12 +697,14 @@ static void man_create_modules_in_config(struct image *image, struct sof_man_fw_ if (!modules) return; - /*skip bringup and base module */ - for (i = 2; i < modules->mod_man_count; i++) { + /* skip modules passed as parameters. Their manifests have already been copied by the + * man_create_modules function. */ + for (i = image->num_modules; i < modules->mod_man_count; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); memcpy(man_module, &modules->mod_man[i], sizeof(*man_module)); } + /* We need to copy the configurations for all modules. */ cfg_start = (void *)desc + SOF_MAN_MODULE_OFFSET(i); memcpy(cfg_start, modules->mod_cfg, modules->mod_cfg_count * sizeof(struct sof_man_mod_config)); diff --git a/src/rimage.c b/src/rimage.c index 556e05890507..d181a3da5096 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -206,6 +206,12 @@ int main(int argc, char *argv[]) goto out; } + if (image.num_modules > image.adsp->modules->mod_man_count) { + fprintf(stderr, "error: Each ELF input module requires entry in toml file.\n"); + ret = -EINVAL; + goto out; + } + /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { /* When there is more than one module, then first one is bootloader. From ab0429fdbe563ef6abe499c69b2483e96c4762d0 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 6 Apr 2023 15:42:23 +0200 Subject: [PATCH 313/350] Fix: Use module manifest from toml as a template for elf modules Some platforms (eg. tgl) dont have modules configuration in a toml files. An attempt to use the configuration template ended with a reference to a null pointer. This commit fixes this issue. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 10 +++++++--- src/rimage.c | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3e8f2fc7e81d..673740ecaa87 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -662,9 +662,13 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, for (; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); - /* Use manifest created using toml files as template */ - assert(i < image->adsp->modules->mod_man_count); - memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + + /* Some platforms dont have modules configuration in toml file */ + if (image->adsp->modules) { + /* Use manifest created using toml files as template */ + assert(i < image->adsp->modules->mod_man_count); + memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + } module = &image->module[i]; diff --git a/src/rimage.c b/src/rimage.c index d181a3da5096..2be83efe104d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -206,7 +206,8 @@ int main(int argc, char *argv[]) goto out; } - if (image.num_modules > image.adsp->modules->mod_man_count) { + /* Some platforms dont have modules configuration in toml file */ + if (image.adsp->modules && image.num_modules > image.adsp->modules->mod_man_count) { fprintf(stderr, "error: Each ELF input module requires entry in toml file.\n"); ret = -EINVAL; goto out; From 77d4a2acd7512ca2fe2d6147ea30ce34a2ca505e Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 18 Apr 2023 17:57:07 +0000 Subject: [PATCH 314/350] cmake: remove "install" target The deleted "install" target copied only the rimage executable and left the config files behind. This gave the wrong impression that the executable is useful without config files. "Installing" also gave the wrong impression that rimage versions are somewhat stable and relatively independent of SOF versions: they're not. In fact there is no such thing as an rimage "version": everyone should always use the exact rimage _git commit_ from the west manifest or git submodule. There are no rimage "releases" and no semantic versioning or anything like it, rimage is effectively part of the SOF source and build and run directly from its build directory by practically every SOF developer and SOF CI thanks to sof/src/arch/xtensa/CMakeLists.txt#ExternalProject_Add(rimage_ep ... sof/scripts/xtensa-build-zephyr.py#def build_rimage() sof/zephyr/CMakeLists.txt#set(RIMAGE_CONFIG_PATH ... etc. Providing an "install" target greatly increases the chances of different people and CIs using different rimage versions which is the last thing we want considering the many significant rimage changes happening right now, examples: - https://github.com/zephyrproject-rtos/zephyr/pull/56099 - https://github.com/zephyrproject-rtos/zephyr/pull/54700 - https://github.com/thesofproject/sof/issues/7270 - https://github.com/thesofproject/sof/issues/7304 - https://github.com/thesofproject/sof/pull/7320 - https://github.com/thesofproject/rimage/pull/155 While it's useful for multiple files (e.g.: config files), a CMake target was always overkill to copy a single file. Someone or some script who really wants to copy the rimage binary to some other place that the build directory for some (discouraged) reason _can still do so_ with a much more basic, simpler and more transparent file copy command. Finally, the default "bin" DESTINATION required root access which is otherwise totally unncessary to build SOF. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76ed18a3392a..2f8b0c56a6f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,5 +64,3 @@ target_include_directories(rimage PRIVATE src/include/ tomlc99/ ) - -install(TARGETS rimage DESTINATION bin) From acd8a2bc1bc05f0c38e0bd1b1e7142f09d0b7d04 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 18 Apr 2023 14:15:06 +0300 Subject: [PATCH 315/350] Config: Change SRCINTC for tgl-cavs.toml and tgl-h-cavs.toml to LL The SRC should be a normal LL component, it can process 1 ms blocks of audio in real-time. The domain_types = "1" is for DP scheduling that is not enabled currently in Zephyr configuration. It causes a pipeline prepare fail when a topology contains SRC. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 2 +- config/tgl-h-cavs.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 2125cda5ed4f..851481ba2b35 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -240,7 +240,7 @@ count = 15 uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" affinity_mask = "0xF" instance_count = "10" - domain_types = "1" + domain_types = "0" load_type = "0" module_type = "0x7" auto_start = "0" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 69f8de7ab581..a499e985625a 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -240,7 +240,7 @@ count = 15 uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" affinity_mask = "0xF" instance_count = "10" - domain_types = "1" + domain_types = "0" load_type = "0" module_type = "0x7" auto_start = "0" From 8f250a99eb27e43c2bbc27c428b3f52606b42ad7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 18 Apr 2023 14:17:13 +0300 Subject: [PATCH 316/350] Config: Change indent for SRCINTC This patch removes one unnecessary tab from section for SRCINTC. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 851481ba2b35..1f9de2936cbc 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -236,15 +236,15 @@ count = 15 mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] [[module.entry]] - name = "SRCINTC" - uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" - affinity_mask = "0xF" - instance_count = "10" - domain_types = "0" - load_type = "0" - module_type = "0x7" - auto_start = "0" - sched_caps = [1, 0x00008000] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] # pin = [dir, type, sample rate, size, container, channel-cfg] pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, From 1ea1327b9cf169c847734c7dca716869534e2c51 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 24 May 2023 01:17:37 +0000 Subject: [PATCH 317/350] README.md: remove "install" target Fixes commit 77d4a2acd751 ("cmake: remove "install" target") Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de6556334468..64fe71e11ce5 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,23 @@ to generate binary image files. ## Building -Most users don't build `rimage` directly but as an ExternalProject -defined by CMake in SOF. This being said, `rimage` can be built with the -usual CMake commands: +Most SOF users never build `rimage` directly but as an ExternalProject +defined by CMake in SOF. This makes sure they always use an up-to-date +version of rimage and configuration files that have been fully tested. + +If needed, `rimage` can be built manually with the usual CMake commands: ```shell $ cmake -B build/ $ make -C build/ help # lists all targets $ make -C build/ -$ sudo make -C build/ install # optional ``` +The `build/rimage` executable can then be copied to a directory in the +PATH. Zephyr users can run `west config rimage.path +/path/to/rimage/build/rimage`; Zephyr documentation and `west sign -h` +have more details. + ## Testing rimage changes with SOF Continuous Integration This section is about leveraging SOF validation to test rimage changes From 649b0a6790a9f2c878fc6cce8a42e0f76a36a418 Mon Sep 17 00:00:00 2001 From: Paul Olaru <paul.olaru@nxp.com> Date: Tue, 30 May 2023 12:29:52 +0300 Subject: [PATCH 318/350] file_simple: Allocate correct buffer size for writing sections out The original size given to the "calloc" call did not account for the necessity to pad section sizes to a multiple of 4 bytes. As such, every time we wrote a section that did not have a size multiple of 4 we would overflow the allocated buffer. Fix the calloc call to account for that padding requirement. Signed-off-by: Paul Olaru <paul.olaru@nxp.com> --- src/file_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_simple.c b/src/file_simple.c index 872473525703..251053498f1b 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -71,7 +71,7 @@ static int write_block(struct image *image, struct manifest_module *module, return file_error("Write header failed", image->out_file); /* alloc data data */ - buffer = calloc(1, section->size); + buffer = calloc(1, block.size); if (!buffer) return -ENOMEM; From 4ce79b152e23c7b3937a09ef57cdd69d125a9214 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Fri, 19 May 2023 15:25:37 +0200 Subject: [PATCH 319/350] kpb: update kpb uuid for lnl Change of uuid regarding Windows compatibility Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- config/lnl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/lnl.toml b/config/lnl.toml index 0093e40a3eee..d4d7f6404055 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -387,7 +387,7 @@ count = 19 [[module.entry]] name = "KPB" - uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + uuid = "A8A0CB32-4A77-4DB1-85C7-53D7EE07BCE6" affinity_mask = "0x1" instance_count = "1" domain_types = "0" From 089157d4617fd0b6a2d9b18578ebba1fcd28621d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 15 Jun 2023 15:27:36 +0300 Subject: [PATCH 320/350] Config: Add Aria module to tgl-cavs.toml and tgl-h-cavs.toml This patch adds Aria module for TGL and TGL-H platforms. The used configuration data is copy from mtl.toml. This change allows to use Aria component in topologies. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 27 ++++++++++++++++++++++++++- config/tgl-h-cavs.toml | 27 ++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 1f9de2936cbc..8e859ee0921a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -388,3 +388,28 @@ count = 15 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index a499e985625a..c277c6235fd9 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -388,3 +388,28 @@ count = 15 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From 48777207f5fdc49314dd4709d660e891c48d5ba9 Mon Sep 17 00:00:00 2001 From: "SaiSurya, Ch" <saisurya.chakkaveeravenkatanaga@amd.com> Date: Tue, 6 Jun 2023 11:59:23 +0530 Subject: [PATCH 321/350] config: add vangogh toml file to support vangogh build Add vangogh toml file to support sof-vangogh.ri binary build Signed-off-by: SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- config/vangogh.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/vangogh.toml diff --git a/config/vangogh.toml b/config/vangogh.toml new file mode 100644 index 000000000000..c5acdb9c9ba3 --- /dev/null +++ b/config/vangogh.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "vangogh" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x20000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xE0000000" +size = "0x100000" +host_offset = "0x0" From aa0ac9eae67506b86e30d66ec75b6f514d729150 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 11 Jul 2023 17:27:03 +0000 Subject: [PATCH 322/350] rimage.c: fix bug where -p requires a new and ignored parameter Fixes commit 6e3abe6afed3 ("rimage: Add suport for loadable modules") It looks like that commit mistook the `:` sign as a separator. This accidentally added the requirement to give `-p` a parameter which is then ignored. Remove the spurious `:`. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index 2be83efe104d..7c89e0921d18 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) image.imr_type = MAN_DEFAULT_IMR_TYPE; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p:l")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:pl")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From b8ee1aa8f6953c84eff384fb30dd7f5afa288108 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 16 May 2023 12:58:15 +0300 Subject: [PATCH 323/350] Config: Add DRC component to TGL, TGL-H, MTL, LNL This patch allows to load the DRC component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index d4d7f6404055..990805e9bcfe 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -486,3 +486,19 @@ count = 19 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 38698b8e2c39..989a07e8dae1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -486,3 +486,19 @@ count = 19 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8e859ee0921a..6d2d77daf93b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 16 +count = 17 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -413,3 +413,19 @@ count = 16 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index c277c6235fd9..46547ca5a3a6 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 16 +count = 17 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -413,3 +413,19 @@ count = 16 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From af9a2fe58f2141dc10720df8c296dd8301ec513d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 16 May 2023 12:59:29 +0300 Subject: [PATCH 324/350] Config: Fix comment typo for EQ FIR module The comment for FIR module entry is corrected. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 2 +- config/mtl.toml | 2 +- config/tgl-cavs.toml | 2 +- config/tgl-h-cavs.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 990805e9bcfe..83b7b867731a 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -443,7 +443,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/mtl.toml b/config/mtl.toml index 989a07e8dae1..1ee803e3dcf7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -443,7 +443,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 6d2d77daf93b..e3a70e0f030a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -315,7 +315,7 @@ count = 17 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 46547ca5a3a6..d84388d99aec 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -315,7 +315,7 @@ count = 17 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" From d20f1d8a85e7342a74e7f3865681d21b3988d3f6 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 18:42:52 -0700 Subject: [PATCH 325/350] actions: remove travis We removed them from the main repo, lets remove them here too. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- .checkpatch.conf | 6 ++++++ .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/pull-request.yml | 23 ++++++++++++++++++++--- .travis.yml | 22 ---------------------- 4 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 .checkpatch.conf create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 000000000000..98ddafcb3fb1 --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,6 @@ +--codespell +--codespellfile scripts/spelling.txt +--ignore C99_COMMENT_TOLERANCE +--no-tree +--strict +-g diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000000..2102fae4f8f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +--- +# Basic build test + +name: build + +# yamllint disable-line rule:truthy +on: [pull_request, push, workflow_dispatch] + +env: + CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\ + -Wimplicit-fallthrough=3 -Wpointer-arith" + +jobs: + build-test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: {fetch-depth: 50, submodules: recursive} + + - name: install tools + run: sudo apt update && sudo apt install -y ninja-build + + - name: build + run: cmake -B build/ -G Ninja + - run: cmake --build build/ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b821ce4fb5f7..c0400490b276 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,17 +9,34 @@ # github.com also has a powerful web editor that can be used without # committing. -name: checkpatch +name: codestyle # yamllint disable-line rule:truthy on: [pull_request] jobs: yamllint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - with: {fetch-depth: 50, submodules: recursive} + with: + fetch-depth: 50 + submodules: recursive - name: run yamllint run: yamllint .github/workflows/*.yml + checkpatch: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + + - name: install codespell + run: sudo apt update && sudo apt install -y codespell + + - name: checkpatch.pl PR review + uses: webispy/checkpatch-action@v9 + env: + CHECKPATCH_COMMAND: ./scripts/checkpatch.pl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d89521056ee9..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: c - -git: - depth: false - -services: - - docker - -jobs: - include: - - name: "Build Test" - before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof - script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh - - name: checkpatch - before_install: - - sudo apt-get -y install codespell - script: - - git --no-pager log --oneline --graph --decorate --max-count=5 - - git --no-pager log --oneline --graph --decorate --max-count=5 "${TRAVIS_BRANCH}" - - (set -x; scripts/checkpatch.pl --no-tree --strict --codespell --no-signoff -g ${TRAVIS_COMMIT_RANGE/.../..}) From 8c8440070a08fd9ff54f8dcb5e528b30bf0fc9eb Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Thu, 27 Jul 2023 13:03:23 -0700 Subject: [PATCH 326/350] style: trailing whitespace is the root of all evil Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- config/lnl.toml | 4 ++-- config/mtl.toml | 4 ++-- src/file_simple.c | 2 +- src/hash.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 83b7b867731a..dc10a4bd95bd 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -247,7 +247,7 @@ count = 20 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] [[module.entry]] name = "SRC" @@ -461,7 +461,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - + # Aria module config [[module.entry]] name = "ARIA" diff --git a/config/mtl.toml b/config/mtl.toml index 1ee803e3dcf7..6b8be7de6559 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -247,7 +247,7 @@ count = 20 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] [[module.entry]] name = "SRC" @@ -461,7 +461,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - + # Aria module config [[module.entry]] name = "ARIA" diff --git a/src/file_simple.c b/src/file_simple.c index 251053498f1b..f79cc4b50365 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -179,7 +179,7 @@ static int simple_write_module(struct image *image, struct manifest_module *modu return file_error("cant seek to header", image->out_file); count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) + if (count != 1) return file_error("failed to write section header", image->out_file); err = fseek(image->out_fd, ptr_cur, SEEK_SET); diff --git a/src/hash.c b/src/hash.c index 4a47730f4c99..0604670e9c6e 100644 --- a/src/hash.c +++ b/src/hash.c @@ -100,7 +100,7 @@ int hash_update(struct hash_context *context, const void *data, size_t size) return context->error; assert(context->state == HS_UPDATE); - + if (!EVP_DigestUpdate(context->context, data, size)) return hash_error(context, EINVAL, "Unable to update hash context."); @@ -168,7 +168,7 @@ int hash_single(const void *data, size_t size, const EVP_MD *algo, void *output, assert(algo); assert(data); assert(output); - + //algo_out_size = EVP_MD_get_size(algo); algo_out_size = EVP_MD_size(algo); if (algo_out_size <= 0) From c809af816859f7213d67a90c04efff57f7b05a59 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 29 Jun 2023 20:02:34 +0300 Subject: [PATCH 327/350] Config: Add crossover component for TGL and TGL-H cAVS platforms The configuration is for now copy from IIR, name and UUID are changed. The init_config is set to 1 to let kernel know that the base_cfg_ext is passed to firmware. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 21 ++++++++++++++++++++- config/tgl-h-cavs.toml | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index e3a70e0f030a..1f439bbf4a9a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 17 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -429,3 +429,22 @@ count = 17 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index d84388d99aec..2c737f94f2be 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 17 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -429,3 +429,22 @@ count = 17 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 4fb9fe00575bc2e9f14570803d811987fb27f010 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Thu, 24 Aug 2023 19:22:29 +0300 Subject: [PATCH 328/350] config: lnl+mtl: fix length of ADSP.man CSE manifest The ADSP.man contents is different for ACE_V1_5 layout compared to CAVS_V2_5 layout. so the ADSP.man length should be adjusted accordingly. With this fix, sof_ri_info.py can be used to analyze LNL and MTL firmware images created with rimage. Closes: https://github.com/thesofproject/sof/issues/8073 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- config/lnl.toml | 2 +- config/mtl.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index dc10a4bd95bd..7d1967bee61f 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -30,7 +30,7 @@ partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" offset = "0x5c" -length = "0x464" +length = "0x4b8" [[cse.entry]] name = "ADSP.met" offset = "0x4c0" diff --git a/config/mtl.toml b/config/mtl.toml index 6b8be7de6559..065731bc8166 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -30,7 +30,7 @@ partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" offset = "0x5c" -length = "0x464" +length = "0x4b8" [[cse.entry]] name = "ADSP.met" offset = "0x4c0" From 43eb2a435c2962cf500daa602866f536c8bc7cd2 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 21 Aug 2023 17:58:59 +0300 Subject: [PATCH 329/350] Config: Add crossover component for MTL and LNL platforms This PR adds the crossover component for MTL and LNL. The parameters are copied from TGL and TGL-H configuration of crossover. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 21 ++++++++++++++++++++- config/mtl.toml | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 7d1967bee61f..032cc3a2371a 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -502,3 +502,22 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 065731bc8166..c68b0291f741 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -502,3 +502,22 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From c183ce2739435a6a49bd3f64869ffd3ef78d7005 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Fri, 24 Feb 2023 16:50:34 +0100 Subject: [PATCH 330/350] mtl: add measured cps and cpc values Add CPS and CPC consumptions for given modules Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 74 ++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index c68b0291f741..feb0450f4542 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -96,16 +96,16 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, - 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, - 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, - 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, - 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, - 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, - 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, - 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, - 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, - 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + mod_cfg = [ 0, 0, 0, 0, 296, 5048000, 45, 60, 0, 5048, 0, + 1, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 2, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 3, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 4, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 5, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 6, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0, + 7, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 8, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 9, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0] [[module.entry]] name = "MIXOUT" @@ -130,14 +130,14 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, - 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, - 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, - 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, - 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, + 1, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, + 2, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, + 3, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 4, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 5, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 6, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, + 7, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0] [[module.entry]] name = "COPIER" @@ -158,16 +158,16 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, - 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, - 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, - 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, - 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, - 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, - 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, - 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + mod_cfg = [ 0, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, + 1, 0, 0, 0, 280, 4288000, 192, 192, 0, 4288, 0, + 2, 0, 0, 0, 280, 4288000, 45, 45, 0, 4288, 0, + 3, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 4, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 5, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 6, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, + 7, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 8, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 9, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0] [[module.entry]] name = "PEAKVOL" @@ -209,13 +209,13 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, - 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, - 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, + 1, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 2, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 3, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, + 4, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 5, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 6, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0] [[module.entry]] name = "ASRC" @@ -265,7 +265,7 @@ count = 21 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + mod_cfg = [0, 0, 0, 0, 12832, 15920000, 0, 0, 0, 15920, 0, 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, @@ -325,7 +325,7 @@ count = 21 1, 0, 0xffff, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + mod_cfg = [0, 0, 0, 0, 216, 2700000, 12, 16, 0, 2700, 0, 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, From 352f01fee4ba0b1282091bb41dd08c51c353d79a Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Mon, 27 Feb 2023 20:16:34 +0100 Subject: [PATCH 331/350] mtl: fill in subsequent measured cps and mcps data Fill in measured cps consumption data for: mixin, mixout, copier, peakvol, gain, src, updwnmixer for a range of supported formats. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 188 +++++++++++++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 73 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index feb0450f4542..c4566359d8a5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -96,16 +96,11 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 296, 5048000, 45, 60, 0, 5048, 0, - 1, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 2, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 3, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 4, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 5, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 6, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0, - 7, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 8, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 9, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0] + mod_cfg = [1, 0, 0, 0, 296, 4996000, 384, 384, 0, 4996, 0, + 2, 0, 0, 0, 296, 2652000, 384, 384, 0, 2652, 0, + 3, 0, 0, 0, 296, 2928000, 512, 512, 0, 2928, 0, + 4, 0, 0, 0, 296, 2572000, 128, 128, 0, 2572, 0, + 5, 0, 0, 0, 296, 3760000, 1536, 1536, 0, 3760, 0] [[module.entry]] name = "MIXOUT" @@ -130,14 +125,11 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, - 1, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, - 2, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, - 3, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 4, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 5, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 6, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, - 7, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0] + mod_cfg = [1, 0, 0, 0, 520, 2280000, 384, 384, 0, 2280, 0, + 2, 0, 0, 0, 520, 1988000, 384, 384, 0, 1988, 0, + 3, 0, 0, 0, 520, 7631000, 512, 512, 0, 7631, 0, + 4, 0, 0, 0, 520, 1953000, 128, 128, 0, 1953, 0, + 5, 0, 0, 0, 520, 2301000, 1536, 1536, 0, 2301, 0] [[module.entry]] name = "COPIER" @@ -158,16 +150,46 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, - 1, 0, 0, 0, 280, 4288000, 192, 192, 0, 4288, 0, - 2, 0, 0, 0, 280, 4288000, 45, 45, 0, 4288, 0, - 3, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 4, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 5, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 6, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, - 7, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 8, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 9, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0] + mod_cfg = [1, 0, 0, 0, 280, 4918000, 768, 768, 0, 4918, 0, + 2, 0, 0, 0, 280, 6526000, 768, 768, 0, 6526, 0, + 3, 0, 0, 0, 280, 6388000, 384, 384, 0, 6388, 0, + 4, 0, 0, 0, 280, 4682000, 512, 512, 0, 4682, 0, + 5, 0, 0, 0, 280, 5738000, 512, 512, 0, 5738, 0, + 6, 0, 0, 0, 280, 6250000, 256, 256, 0, 6250, 0, + 7, 0, 0, 0, 280, 6460000, 768, 768, 0, 6460, 0, + 8, 0, 0, 0, 280, 7116000, 768, 768, 0, 7116, 0, + 9, 0, 0, 0, 280, 6008000, 384, 384, 0, 6008, 0, + 10, 0, 0, 0, 280, 6258000, 512, 512, 0, 6258, 0, + 11, 0, 0, 0, 280, 7188000, 1024, 1024, 0, 7188, 0, + 12, 0, 0, 0, 280, 7272000, 1536, 1536, 0, 7272, 0, + 13, 0, 0, 0, 280, 6290000, 768, 768, 0, 6290, 0, + 14, 0, 0, 0, 280, 6604000, 1024, 1024, 0, 6604, 0, + 15, 0, 0, 0, 280, 6198000, 384, 384, 0, 6198, 0, + 16, 0, 0, 0, 280, 6250000, 384, 384, 0, 6250, 0, + 17, 0, 0, 0, 280, 6258000, 256, 256, 0, 6258, 0, + 18, 0, 0, 0, 280, 4354000, 256, 256, 0, 4354, 0, + 19, 0, 0, 0, 280, 6198000, 256, 256, 0, 6198, 0, + 20, 0, 0, 0, 280, 6250000, 128, 128, 0, 6250, 0, + 21, 0, 0, 0, 280, 6250000, 128, 128, 0, 6250, 0, + 22, 0, 0, 0, 280, 6206000, 128, 128, 0, 6206, 0, + 23, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, + 24, 0, 0, 0, 280, 4234000, 96, 96, 0, 4234, 0, + 25, 0, 0, 0, 280, 6198000, 96, 96, 0, 6198, 0, + 26, 0, 0, 0, 280, 6250000, 96, 96, 0, 6250, 0, + 27, 0, 0, 0, 280, 6198000, 192, 192, 0, 6198, 0, + 28, 0, 0, 0, 280, 6258000, 192, 192, 0, 6258, 0, + 29, 0, 0, 0, 280, 6392000, 720, 720, 0, 6392, 0, + 30, 0, 0, 0, 280, 6250000, 360, 360, 0, 6250, 0, + 31, 0, 0, 0, 280, 5326000, 360, 360, 0, 5326, 0, + 32, 0, 0, 0, 280, 6258000, 180, 180, 0, 6258, 0, + 33, 0, 0, 0, 280, 4354000, 256, 256, 0, 4354, 0, + 34, 0, 0, 0, 280, 4898000, 256, 256, 0, 4898, 0, + 35, 0, 0, 0, 280, 6246000, 128, 128, 0, 6246, 0, + 36, 0, 0, 0, 280, 6250000, 192, 192, 0, 6250, 0, + 37, 0, 0, 0, 280, 6250000, 48, 48, 0, 6250, 0, + 38, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, + 39, 0, 0, 0, 280, 6198000, 64, 64, 0, 6198, 0, + 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0] [[module.entry]] name = "PEAKVOL" @@ -185,13 +207,11 @@ count = 21 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, - 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, - 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 480, 11667000, 384, 384, 0, 11667, 0, + 2, 0, 0, 0, 480, 5943000, 192, 192, 0, 5943, 0, + 3, 0, 0, 0, 480, 12567000, 720, 720, 0, 12567, 0, + 4, 0, 0, 0, 480, 7360000, 768, 768, 0, 7360, 0, + 5, 0, 0, 0, 480, 12236000, 1536, 1536, 0, 12236, 0] [[module.entry]] name = "GAIN" @@ -209,13 +229,10 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, - 1, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 2, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 3, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, - 4, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 5, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 6, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0] + mod_cfg = [1, 0, 0, 0, 416, 12100000, 1536, 1536, 0, 12100, 0, + 2, 0, 0, 0, 416, 10183000, 384, 384, 0, 10183, 0, + 3, 0, 0, 0, 416, 8192000, 512, 512, 0, 8192, 0, + 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0] [[module.entry]] name = "ASRC" @@ -265,29 +282,32 @@ count = 21 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 12832, 15920000, 0, 0, 0, 15920, 0, - 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, - 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, - 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, - 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, - 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, - 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, - 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, - 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, - 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, - 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, - 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, - 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, - 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, - 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, - 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, - 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, - 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, - 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, - 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, - 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, - 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, - 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + mod_cfg = [1, 0, 0, 0, 12832, 15976000, 128, 512, 0, 15976, 0, + 2, 0, 0, 0, 12832, 15340000, 64, 256, 0, 15340, 0, + 3, 0, 0, 0, 12832, 21880000, 96, 512, 0, 21880, 0, + 4, 0, 0, 0, 12832, 19968000, 48, 256, 0, 19968, 0, + 5, 0, 0, 0, 12832, 18236000, 64, 256, 0, 18236, 0, + 6, 0, 0, 0, 12832, 15244000, 32, 256, 0, 15244, 0, + 7, 0, 0, 0, 12832, 56028000, 1536, 512, 0, 56028, 0, + 8, 0, 0, 0, 12832, 46740000, 768, 256, 0, 46740, 0, + 9, 0, 0, 0, 12832, 24656000, 768, 512, 0, 24656, 0, + 10, 0, 0, 0, 12832, 23516000, 384, 256, 0, 23516, 0, + 11, 0, 0, 0, 12832, 29368000, 384, 488, 0, 29368, 0, + 12, 0, 0, 0, 12832, 27164000, 192, 244, 0, 27164, 0, + 13, 0, 0, 0, 12832, 15892000, 384, 384, 0, 15892, 0, + 14, 0, 0, 0, 12832, 19916000, 192, 512, 0, 19916, 0, + 15, 0, 0, 0, 12832, 19176000, 96, 256, 0, 19176, 0, + 16, 0, 0, 0, 12832, 12676000, 192, 192, 0, 12676, 0, + 17, 0, 0, 0, 12832, 16280000, 384, 320, 0, 16280, 0, + 18, 0, 0, 0, 12832, 13076000, 192, 160, 0, 13076, 0, + 19, 0, 0, 0, 12832, 11440000, 384, 256, 0, 11440, 0, + 20, 0, 0, 0, 12832, 10996000, 192, 128, 0, 10996, 0, + 21, 0, 0, 0, 12832, 11428000, 384, 192, 0, 11428, 0, + 22, 0, 0, 0, 12832, 10740000, 192, 96, 0, 10740, 0, + 23, 0, 0, 0, 12832, 29936000, 360, 512, 0, 29936, 0, + 24, 0, 0, 0, 12832, 27696000, 180, 256, 0, 27696, 0, + 25, 0, 0, 0, 12832, 18368000, 256, 512, 0, 18368, 0, + 26, 0, 0, 0, 12832, 15204000, 128, 256, 0, 15204, 0] [[module.entry]] name = "MICSEL" @@ -325,14 +345,36 @@ count = 21 1, 0, 0xffff, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 216, 2700000, 12, 16, 0, 2700, 0, - 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, - 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, - 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, - 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, - 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, - 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 216, 5044000, 384, 192, 0, 5044, 0, + 2, 0, 0, 0, 216, 2660000, 384, 384, 0, 2660, 0, + 3, 0, 0, 0, 216, 3164000, 576, 384, 0, 3164, 0, + 4, 0, 0, 0, 216, 3316000, 768, 384, 0, 3316, 0, + 5, 0, 0, 0, 216, 5264000, 768, 384, 0, 5264, 0, + 6, 0, 0, 0, 216, 5440000, 768, 384, 0, 5440, 0, + 7, 0, 0, 0, 216, 2888000, 768, 192, 0, 2888, 0, + 8, 0, 0, 0, 216, 2856000, 768, 192, 0, 2856, 0, + 9, 0, 0, 0, 216, 2876000, 768, 192, 0, 2876, 0, + 10, 0, 0, 0, 216, 2956000, 960, 192, 0, 2956, 0, + 11, 0, 0, 0, 216, 2888000, 1152, 192, 0, 2888, 0, + 12, 0, 0, 0, 216, 2888000, 1152, 192, 0, 2888, 0, + 13, 0, 0, 0, 216, 2816000, 1536, 192, 0, 2816, 0, + 14, 0, 0, 0, 216, 2468000, 192, 384, 0, 2468, 0, + 15, 0, 0, 0, 216, 3084000, 576, 384, 0, 3084, 0, + 16, 0, 0, 0, 216, 3442000, 960, 384, 0, 3442, 0, + 17, 0, 0, 0, 216, 3478000, 1152, 384, 0, 3478, 0, + 18, 0, 0, 0, 216, 3478000, 1152, 384, 0, 3478, 0, + 19, 0, 0, 0, 216, 3736000, 1536, 384, 0, 3736, 0, + 20, 0, 0, 0, 216, 3216000, 192, 1152, 0, 3216, 0, + 21, 0, 0, 0, 216, 3308000, 384, 1152, 0, 3308, 0, + 22, 0, 0, 0, 216, 3616000, 768, 1152, 0, 3616, 0, + 23, 0, 0, 0, 216, 3616000, 768, 1152, 0, 3616, 0, + 24, 0, 0, 0, 216, 4916000, 1536, 1152, 0, 4916, 0, + 25, 0, 0, 0, 216, 3228000, 192, 1152, 0, 3228, 0, + 26, 0, 0, 0, 216, 3452000, 384, 1152, 0, 3452, 0, + 27, 0, 0, 0, 216, 4016000, 768, 1152, 0, 4016, 0, + 28, 0, 0, 0, 216, 5080000, 1536, 1152, 0, 5080, 0, + 29, 0, 0, 0, 216, 3552000, 384, 1536, 0, 3552, 0, + 30, 0, 0, 0, 216, 3728000, 768, 1152, 0, 3728, 0] [[module.entry]] name = "PROBE" From 476d63608bccd5f6e26ae308be573706be3cefe8 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Tue, 28 Feb 2023 14:09:17 +0100 Subject: [PATCH 332/350] mtl: fill in cps and cpc data for ASRC module Fill in measured cps consumption data for ASRC module for various formats. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index c4566359d8a5..0c1f9fdb72d1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -249,22 +249,21 @@ count = 21 pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] - mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, - 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, - 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, - 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, - 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, - 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, - 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, - 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, - 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, - 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, - 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, - 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, - 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, - 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, - 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 20480, 21808000, 64, 192, 0, 21808, 0, + 2, 0, 0, 0, 20480, 45820000, 64, 384, 0, 45820, 0, + 3, 0, 0, 0, 20480, 75236000, 512, 1440, 0, 75236, 0, + 4, 0, 0, 0, 20480, 79732000, 512, 1536, 0, 79732, 0, + 5, 0, 0, 0, 20480, 50411000, 184, 384, 0, 50411, 0, + 6, 0, 0, 0, 20480, 24236000, 192, 128, 0, 24236, 0, + 7, 0, 0, 0, 20480, 46753000, 192, 384, 0, 46753, 0, + 8, 0, 0, 0, 20480, 30032000, 256, 256, 0, 30032, 0, + 9, 0, 0, 0, 20480, 48676000, 256, 384, 0, 48676, 0, + 10, 0, 0, 0, 20480, 46548000, 360, 360, 0, 46548, 0, + 11, 0, 0, 0, 20480, 94372000, 1440, 1536, 0, 94372, 0, + 12, 0, 0, 0, 20480, 42912000, 1536, 512, 0, 42912, 0, + 13, 0, 0, 0, 20480, 31871000, 384, 192, 0, 31871, 0, + 14, 0, 0, 0, 20480, 34216000, 384, 256, 0, 34216, 0, + 15, 0, 0, 0, 20480, 83448000, 1536, 1440, 0, 83448, 0] [[module.entry]] name = "SRC" From fea2a30e56911eefbdf88870547317873f204a01 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Fri, 10 Mar 2023 08:25:30 +0100 Subject: [PATCH 333/350] mtl: fill in cps and cpc data for smart_amp_test module Fill in measured cps consumption data for SMATEST module Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 0c1f9fdb72d1..bf32358dd6b5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -463,7 +463,7 @@ count = 21 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 296, 5000000, 384, 384, 0, 5000, 0] # eq iir module config [[module.entry]] From 4a36634db6122393003b9489aedfbd236c6ca501 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Thu, 18 May 2023 09:36:22 +0200 Subject: [PATCH 334/350] mtl: fill in cps and cpc data for EQIIR module Fill in measured cps consumption data for EQIIR module Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index bf32358dd6b5..b9cc7502b0a5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -482,7 +482,8 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 1000, 0, + 0, 0, 0, 0, 4096, 20663000, 768, 768, 0, 20663, 0] # eq fir module config [[module.entry]] From 8bcf1fc9114765cf91de80a00415d350293445c0 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Wed, 19 Jul 2023 09:36:34 +0200 Subject: [PATCH 335/350] mtl: fill in cps and cpc data for COPIER & GAIN modules Fill in measured cps consumption data for COPIER & GAIN modules Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index b9cc7502b0a5..49ebe055e4f0 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -189,7 +189,8 @@ count = 21 37, 0, 0, 0, 280, 6250000, 48, 48, 0, 6250, 0, 38, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, 39, 0, 0, 0, 280, 6198000, 64, 64, 0, 6198, 0, - 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0] + 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0, + 41, 0, 0, 0, 280, 5272000, 192, 384, 0, 5272, 0] [[module.entry]] name = "PEAKVOL" @@ -232,7 +233,8 @@ count = 21 mod_cfg = [1, 0, 0, 0, 416, 12100000, 1536, 1536, 0, 12100, 0, 2, 0, 0, 0, 416, 10183000, 384, 384, 0, 10183, 0, 3, 0, 0, 0, 416, 8192000, 512, 512, 0, 8192, 0, - 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0] + 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0, + 5, 0, 0, 0, 416, 5908000, 768, 768, 0, 5908, 0] [[module.entry]] name = "ASRC" From e8b380d4aec2eab7f0e0ab82246f8bcc22964ffa Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 13 Jun 2023 16:52:33 +0300 Subject: [PATCH 336/350] Config: Add Multiband-DRC component to TGL, TGL-H, MTL, LNL This patch allows to load the Multiband-DRC component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 032cc3a2371a..3c499e4f7459 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -521,3 +521,19 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 49ebe055e4f0..450400325dbe 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -565,3 +565,19 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 1f439bbf4a9a..d4b4be11e36d 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -448,3 +448,19 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 2c737f94f2be..ff79f92c71db 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -448,3 +448,19 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 7bc2958ba4fd8bab351e688225c2241812cf1cb4 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 1 Sep 2023 20:25:48 +0300 Subject: [PATCH 337/350] Config: Add DCblock to TGL, TGL-H, MTL, and LNL This patch enables load of the DC blocker component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 3c499e4f7459..30e567b060ec 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 22 +count = 23 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -537,3 +537,19 @@ count = 22 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 450400325dbe..4a246dcf140d 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 22 +count = 23 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -581,3 +581,19 @@ count = 22 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index d4b4be11e36d..15638424c9fe 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -464,3 +464,19 @@ count = 19 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index ff79f92c71db..04a0df56a861 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -464,3 +464,19 @@ count = 19 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 5f47509b6757d260a22d1bf8f3e1e15be13b009f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:10:10 +0200 Subject: [PATCH 338/350] elf_file: Set of new functions for reading elf files A structure was created to represent a file, a section and a strings section. Created a new functions to read a elf file, retrieve a section header based on index or name, read a section contents based on a header or name, retrieve section name and functions that print file, section and program headers. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/elf_file.c | 571 ++++++++++++++++++++++++++++++++++ src/include/rimage/elf_file.h | 178 +++++++++++ 3 files changed, 750 insertions(+) create mode 100644 src/elf_file.c create mode 100644 src/include/rimage/elf_file.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f8b0c56a6f2..6413713617c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ add_executable(rimage src/adsp_config.c src/misc_utils.c src/file_utils.c + src/elf_file.c tomlc99/toml.c ) diff --git a/src/elf_file.c b/src/elf_file.c new file mode 100644 index 000000000000..efb9cc912b4e --- /dev/null +++ b/src/elf_file.c @@ -0,0 +1,571 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +#include <rimage/elf_file.h> +#include <rimage/file_utils.h> +#include <rimage/misc_utils.h> + + /* Values for e_type. */ +static struct name_val e_type[] = { + NAME_VAL_ENTRY(ET_NONE), /* Unknown type. */ + NAME_VAL_ENTRY(ET_REL), /* Relocatable. */ + NAME_VAL_ENTRY(ET_EXEC), /* Executable. */ + NAME_VAL_ENTRY(ET_DYN), /* Shared object. */ + NAME_VAL_ENTRY(ET_CORE), /* Core file. */ + NAME_VAL_END +}; + +static struct name_val sh_types[] = { + NAME_VAL_ENTRY(SHT_NULL), /* inactive */ + NAME_VAL_ENTRY(SHT_PROGBITS), /* program defined information */ + NAME_VAL_ENTRY(SHT_SYMTAB), /* symbol table section */ + NAME_VAL_ENTRY(SHT_STRTAB), /* string table section */ + NAME_VAL_ENTRY(SHT_RELA), /* relocation section with addends */ + NAME_VAL_ENTRY(SHT_HASH), /* symbol hash table section */ + NAME_VAL_ENTRY(SHT_DYNAMIC), /* dynamic section */ + NAME_VAL_ENTRY(SHT_NOTE), /* note section */ + NAME_VAL_ENTRY(SHT_NOBITS), /* no space section */ + NAME_VAL_ENTRY(SHT_REL), /* relocation section - no addends */ + NAME_VAL_ENTRY(SHT_SHLIB), /* reserved - purpose unknown */ + NAME_VAL_ENTRY(SHT_DYNSYM), /* dynamic symbol table section */ + NAME_VAL_ENTRY(SHT_INIT_ARRAY), /* Initialization function pointers. */ + NAME_VAL_ENTRY(SHT_FINI_ARRAY), /* Termination function pointers. */ + NAME_VAL_ENTRY(SHT_PREINIT_ARRAY), /* Pre-initialization function ptrs. */ + NAME_VAL_ENTRY(SHT_GROUP), /* Section group. */ + NAME_VAL_ENTRY(SHT_SYMTAB_SHNDX), /* Section indexes (see SHN_XINDEX). */ + NAME_VAL_ENTRY(SHT_LOOS), /* First of OS specific semantics */ + NAME_VAL_ENTRY(SHT_HIOS), /* Last of OS specific semantics */ + NAME_VAL_ENTRY(SHT_GNU_VERDEF), + NAME_VAL_ENTRY(SHT_GNU_VERNEED), + NAME_VAL_ENTRY(SHT_GNU_VERSYM), + NAME_VAL_ENTRY(SHT_LOPROC), /* reserved range for processor */ + NAME_VAL_ENTRY(SHT_HIPROC), /* specific section header types */ + NAME_VAL_ENTRY(SHT_LOUSER), /* reserved range for application */ + NAME_VAL_ENTRY(SHT_HIUSER), /* specific indexes */ + NAME_VAL_END +}; + +/* Flags for sh_flags. */ +static struct name_val sh_flags[] = { + NAME_VAL_ENTRY(SHF_WRITE), /* Section contains writable data. */ + NAME_VAL_ENTRY(SHF_ALLOC), /* Section occupies memory. */ + NAME_VAL_ENTRY(SHF_EXECINSTR), /* Section contains instructions. */ + NAME_VAL_ENTRY(SHF_MERGE), /* Section may be merged. */ + NAME_VAL_ENTRY(SHF_STRINGS), /* Section contains strings. */ + NAME_VAL_ENTRY(SHF_INFO_LINK), /* sh_info holds section index. */ + NAME_VAL_ENTRY(SHF_LINK_ORDER), /* Special ordering requirements. */ + NAME_VAL_ENTRY(SHF_OS_NONCONFORMING), /* OS-specific processing required. */ + NAME_VAL_ENTRY(SHF_GROUP), /* Member of section group. */ + NAME_VAL_ENTRY(SHF_TLS), /* Section contains TLS data. */ + NAME_VAL_END +}; + +/* Values for p_type. */ +static struct name_val p_type[] = { + NAME_VAL_ENTRY(PT_NULL), /* Unused entry. */ + NAME_VAL_ENTRY(PT_LOAD), /* Loadable segment. */ + NAME_VAL_ENTRY(PT_DYNAMIC), /* Dynamic linking information segment. */ + NAME_VAL_ENTRY(PT_INTERP), /* Pathname of interpreter. */ + NAME_VAL_ENTRY(PT_NOTE), /* Auxiliary information. */ + NAME_VAL_ENTRY(PT_SHLIB), /* Reserved (not used). */ + NAME_VAL_ENTRY(PT_PHDR), /* Location of program header itself. */ + NAME_VAL_ENTRY(PT_TLS), /* Thread local storage segment */ + NAME_VAL_END +}; + +/* Values for p_flags. */ +static struct name_val p_flags[] = { + NAME_VAL_ENTRY(PF_X), /* Executable. */ + NAME_VAL_ENTRY(PF_W), /* Writable. */ + NAME_VAL_ENTRY(PF_R), /* Readable. */ + NAME_VAL_END +}; + +/** + * Print elf related error message + * + * @param elf elf file structure + * @param msg error message + * @param error error code to return + * @return error code + */ +static int elf_error(const struct elf_file *elf, const char *msg, int error) +{ + fprintf(stderr, "Error: %s: %s\n", elf->filename, msg); + return -error; +} + +/** + * Read elf header + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_header_read(struct elf_file *elf) +{ + size_t count; + + /* read in elf header */ + count = fread(&elf->header, sizeof(elf->header), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read elf header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + + if (strncmp((char *)elf->header.ident, "\177ELF\001\001", 5)) + return elf_error(elf, "Not a 32 bits ELF-LE file", EILSEQ); + + if (elf->header.version != EV_CURRENT) + return elf_error(elf, "Unsupported file version.", EINVAL); + + if (elf->header.ehsize < sizeof(Elf32_Ehdr)) + return elf_error(elf, "Invalid file header size.", EINVAL); + + if (elf->header.phoff >= elf->file_size) + return elf_error(elf, "Invalid program header file offset.", EINVAL); + + if (elf->header.phentsize < sizeof(Elf32_Phdr)) + return elf_error(elf, "Invalid program header size.", EINVAL); + + if (elf->header.phoff + elf->header.phnum * sizeof(Elf32_Phdr) > elf->file_size) + return elf_error(elf, "Invalid number of program header entries.", EINVAL); + + if (elf->header.shoff >= elf->file_size) + return elf_error(elf, "Invalid section header file offset.", EINVAL); + + if (elf->header.shentsize < sizeof(Elf32_Shdr)) + return elf_error(elf, "Invalid section header size.", EINVAL); + + if (elf->header.shoff + elf->header.shnum * sizeof(Elf32_Shdr) > elf->file_size) + return elf_error(elf, "Invalid number of section header entries.", EINVAL); + + if (elf->header.shstrndx >= elf->header.shnum) + return elf_error(elf, "Invalid section name strings section index.", EINVAL); + + return 0; +} + +void elf_header_print(const struct elf_file *elf) +{ + fprintf(stdout, "\tfile type\t 0x%8.8x ", elf->header.type); + print_enum(elf->header.type, e_type); + fprintf(stdout, "\tarchitecture\t 0x%8.8x\n", elf->header.machine); + fprintf(stdout, "\tformat version\t 0x%8.8x\n", elf->header.version); + fprintf(stdout, "\tarch flags\t 0x%8.8x\n", elf->header.flags); + fprintf(stdout, "\theader size\t 0x%8.8x\n", elf->header.ehsize); + fprintf(stdout, "\tentry point\t 0x%8.8x\n", elf->header.entry); + fprintf(stdout, "\tprogram offset\t 0x%8.8x\n", elf->header.phoff); + fprintf(stdout, "\tsection offset\t 0x%8.8x\n", elf->header.shoff); + fprintf(stdout, "\tprogram size\t 0x%8.8x\n", elf->header.phentsize); + fprintf(stdout, "\tprogram count\t 0x%8.8x\n", elf->header.phnum); + fprintf(stdout, "\tsection size\t 0x%8.8x\n", elf->header.shentsize); + fprintf(stdout, "\tsection count\t 0x%8.8x\n", elf->header.shnum); + fprintf(stdout, "\tstring index\t 0x%8.8x\n\n", elf->header.shstrndx); +} + +/** + * Read sections headers from elf file + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_section_headers_read(struct elf_file *elf) +{ + int i, ret; + size_t offset, count; + + elf->sections = calloc(elf->header.shnum, sizeof(struct elf_section_header)); + if (!elf->sections) + return elf_error(elf, "Cannot allocate section array.", ENOMEM); + + /* In case of error, sections memory are released in elf_open function. */ + + offset = elf->header.shoff; + for (i = 0; i < elf->header.shnum; i++, offset += elf->header.shentsize) { + ret = fseek(elf->file, offset, SEEK_SET); + if (ret) + return file_error("unable to seek to section header", elf->filename); + + count = fread(&elf->sections[i].data, sizeof(Elf32_Shdr), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read section header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + } + + elf->sections_count = elf->header.shnum; + return 0; +} + +/** + * Update name of a section in the section headers + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_set_sections_names(struct elf_file *elf, const struct elf_strings *strings) +{ + int ret, i; + + for (i = 0; i < elf->sections_count; i++) { + ret = elf_strings_get(strings, elf->sections[i].data.name, &elf->sections[i].name); + if (ret) + return ret; + } + + return 0; +} + +void elf_print_sections(const struct elf_file *elf) +{ + int i; + + for (i = 0; i < elf->sections_count; i++) { + fprintf(stdout, "Section %d:\n", i); + elf_section_header_print(&elf->sections[i]); + } +} + +/** + * Read program headers from elf file + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_program_headers_read(struct elf_file *elf) +{ + int i, ret; + size_t offset, count; + + elf->programs = calloc(elf->header.phnum, sizeof(Elf32_Phdr)); + if (!elf->programs) + return elf_error(elf, "Cannot allocate program array.", ENOMEM); + + /* In case of error, programs memory are released in elf_open function. */ + + offset = elf->header.phoff; + for (i = 0; i < elf->header.phnum; i++, offset += elf->header.phentsize) { + ret = fseek(elf->file, offset, SEEK_SET); + if (ret) + return file_error("unable to seek to program header", elf->filename); + + count = fread(&elf->programs[i], sizeof(Elf32_Phdr), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read program header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + } + + elf->programs_count = elf->header.phnum; + return 0; +} + +void elf_print_programs(const struct elf_file *elf) +{ + int i; + + for (i = 0; i < elf->programs_count; i++) { + fprintf(stdout, "\nProgram %d:\n", i); + elf_program_header_print(&elf->programs[i]); + } +} + +/** + * Copy elf_header structure. Allocates a new copy of the name string. + * + * @param [in]src Source section header structure + * @param [out]dst Destination section header structure + * @return error code, 0 when success + */ +static int elf_section_header_copy(const struct elf_section_header *src, + struct elf_section_header *dst) +{ + if (src->name) { + dst->name = strdup(src->name); + if (!dst->name) + return -ENOMEM; + } else { + dst->name = NULL; + } + + memcpy(&dst->data, &src->data, sizeof(dst->data)); + return 0; +} + +int elf_section_header_get_by_index(const struct elf_file *elf, int index, + const struct elf_section_header **header) +{ + if (index >= elf->sections_count) + return elf_error(elf, "Invalid section index.", EINVAL); + + *header = &elf->sections[index]; + + return 0; +} + +int elf_section_header_get_by_name(const struct elf_file *elf, const char* name, + const struct elf_section_header **header) +{ + int i; + + *header = NULL; + + for (i = 0; i < elf->sections_count; i++) + if (strcmp(elf->sections[i].name, name) == 0) { + *header = &elf->sections[i]; + return 0; + } + + return -ENOENT; +} + +void elf_section_header_print(const struct elf_section_header *header) +{ + fprintf(stdout, "\tname\t\t0x%8.8x\n", header->data.name); + fprintf(stdout, "\tname\t\t%s\n", header->name); + fprintf(stdout, "\ttype\t\t0x%8.8x ", header->data.type); + print_enum(header->data.type, sh_types); + fprintf(stdout, "\tflags\t\t0x%8.8x ", header->data.flags); + print_flags(header->data.flags, sh_flags); + fprintf(stdout, "\taddr\t\t0x%8.8x\n", header->data.vaddr); + fprintf(stdout, "\toffset\t\t0x%8.8x\n", header->data.off); + fprintf(stdout, "\tsize\t\t0x%8.8x\n", header->data.size); + fprintf(stdout, "\tlink\t\t0x%8.8x\n", header->data.link); + fprintf(stdout, "\tinfo\t\t0x%8.8x\n", header->data.info); + fprintf(stdout, "\taddralign\t0x%8.8x\n", header->data.addralign); + fprintf(stdout, "\tentsize\t\t0x%8.8x\n\n", header->data.entsize); +} + +/** + * Release section header structure + * + * @param sec_hdr Section header structure + */ +static void elf_section_header_free(struct elf_section_header *sec_hdr) +{ + free(sec_hdr->name); + sec_hdr->name = NULL; +} + + +int elf_open(struct elf_file *elf, const char *filename) +{ + struct elf_strings names; + int ret = -ENOMEM; + + memset(elf, 0, sizeof(*elf)); + elf->filename = strdup(filename); + if (!elf->filename) { + ret = -ENOMEM; + goto err; + } + + elf->file = fopen(filename, "rb"); + if (!elf->file) { + ret = file_error("Unable to open elf file", elf->filename); + goto err; + } + + ret = get_file_size(elf->file, elf->filename, &elf->file_size); + if (ret) + goto err; + + ret = elf_header_read(elf); + if (ret) + goto err; + + ret = elf_program_headers_read(elf); + if (ret) + goto err; + + ret = elf_section_headers_read(elf); + if (ret) + goto err; + + ret = elf_strings_read_by_index(elf, elf->header.shstrndx, &names); + if (ret) + goto err; + + ret = elf_set_sections_names(elf, &names); + if (ret) { + elf_strings_free(&names); + goto err; + } + elf_strings_free(&names); + + return 0; + +err: + free(elf->filename); + free(elf->programs); + + if (elf->file) + fclose(elf->file); + + if (elf->sections) { + for (int i = 0; i < elf->sections_count; i++) + elf_section_header_free(&elf->sections[i]); + + free(elf->sections); + } + + return ret; +} + +/** +* Close elf file and release resources +* @param elf elf file structure +*/ +void elf_free(struct elf_file *elf) +{ + int i; + + free(elf->filename); + fclose(elf->file); + + for (i = 0; i < elf->sections_count; i++) + elf_section_header_free(&elf->sections[i]); + + free(elf->sections); + free(elf->programs); +} + +int elf_section_read_content(const struct elf_file *elf, const struct elf_section_header *header, + void *buffer, const size_t size) +{ + int ret; + size_t count; + + if ((header->data.type == SHT_NOBITS) || (header->data.type == SHT_NULL) || + !header->data.size) + return elf_error(elf, "Can't read section without data.", ENODATA); + + if (!header->data.off || (header->data.off + header->data.size) > elf->file_size) + return elf_error(elf, "Invalid section position in file.", ENFILE); + + if (header->data.size > size) + return elf_error(elf, "Output buffer too small.", ENOSPC); + + ret = fseek(elf->file, header->data.off, SEEK_SET); + if (ret) + return file_error("unable to seek to section data", elf->filename); + + count = fread(buffer, header->data.size, 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read section data", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + + return 0; +} + +int elf_section_read(const struct elf_file *elf, const struct elf_section_header *header, + struct elf_section *section) +{ + int ret; + + section->data = malloc(header->data.size); + if (!section->data) + return elf_error(elf, "No memory for section buffer.", ENOMEM); + + ret = elf_section_header_copy(header, §ion->header); + if (ret) + goto err; + + ret = elf_section_read_content(elf, header, section->data, header->data.size); + if (ret) + goto err; + + return 0; + +err: + elf_section_header_free(§ion->header); + free(section->data); + return ret; +} + +int elf_section_read_by_name(const struct elf_file *elf, const char *name, + struct elf_section *section) +{ + const struct elf_section_header *header; + int ret; + + ret = elf_section_header_get_by_name(elf, name, &header); + + if (ret) + return ret; + + return elf_section_read(elf, header, section); +} + +void elf_section_free(struct elf_section *section) +{ + free(section->data); +} + +int elf_strings_read_by_index(const struct elf_file *elf, int index, struct elf_strings *strings) +{ + const struct elf_section_header *header; + int ret; + + ret = elf_section_header_get_by_index(elf, index, &header); + if (ret) + return ret; + + if (header->data.type != SHT_STRTAB) + return elf_error(elf, "Invalid section type.", EINVAL); + + ret = elf_section_read(elf, header, &strings->section); + if (ret) + return elf_error(elf, "Unable to read section names section.", ret); + + return 0; +} + +int elf_strings_get(const struct elf_strings *strings, int index, char **str) +{ + if (index >= strings->section.header.data.size) + return -EINVAL; + + *str = strdup((const char *)strings->section.data + index); + if (!*str) + return -ENOMEM; + + return 0; +} + +void elf_strings_free(struct elf_strings *strings) +{ + elf_section_free(&strings->section); +} + +void elf_program_header_print(const Elf32_Phdr *header) +{ + fprintf(stdout, "\ttype\t 0x%8.8x ", header->type); + print_enum(header->type, p_type); + fprintf(stdout, "\tflags\t 0x%8.8x ", header->flags); + print_flags(header->flags, p_flags); + fprintf(stdout, "\toffset\t 0x%8.8x\n", header->off); + fprintf(stdout, "\tvaddr\t 0x%8.8x\n", header->vaddr); + fprintf(stdout, "\tpaddr\t 0x%8.8x\n", header->paddr); + fprintf(stdout, "\tfilesz\t 0x%8.8x\n", header->filesz); + fprintf(stdout, "\tmemsz\t 0x%8.8x\n", header->memsz); + fprintf(stdout, "\talign\t 0x%8.8x\n\n", header->align); +} diff --git a/src/include/rimage/elf_file.h b/src/include/rimage/elf_file.h new file mode 100644 index 000000000000..13bfe98cf1f7 --- /dev/null +++ b/src/include/rimage/elf_file.h @@ -0,0 +1,178 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#ifndef __ELF_FILE_H__ +#define __ELF_FILE_H__ + +#include <stddef.h> + +#include "elf.h" + +struct elf_section_header { + Elf32_Shdr data; + char *name; +}; + +struct elf_section { + struct elf_section_header header; + void *data; +}; + +struct elf_strings { + struct elf_section section; +}; + +struct elf_file { + FILE *file; + char *filename; + size_t file_size; + Elf32_Ehdr header; + struct elf_section_header *sections; + Elf32_Phdr *programs; + uint16_t sections_count; + uint16_t programs_count; +}; + +/** + * Open elf file + * + * @param [out]elf elf file structure + * @param [in]filename File name to open + * @return error code, 0 when success + */ +int elf_open(struct elf_file *elf, const char *filename); + +/** + * Close elf file and release resources + * + * @param elf elf file structure + */ +void elf_free(struct elf_file *elf); + +/** + * Print elf file header + * + * @param elf elf file structure + */ +void elf_header_print(const struct elf_file *elf); + +/** + * Print program headers + * + * @param elf elf file structure + */ +void elf_print_programs(const struct elf_file *elf); + +/** + * Print single program header + * + * @param header program header structure + */ +void elf_program_header_print(const Elf32_Phdr *header); + +/** + * Print elf sections headers + * + * @param elf elf file structure + */ +void elf_print_sections(const struct elf_file *elf); + +/** + * Return section header by index + * + * @param [in]elf elf file structure + * @param [in]index section index + * @param [out]header section header data + * @return error code, 0 when success + */ +int elf_section_header_get_by_index(const struct elf_file *elf, int index, + const struct elf_section_header **header); + +/** + * Return section header by index + * + * @param [in]elf elf file structure + * @param [in]index section index + * @param [out]header section header data + * @return error code, 0 when success + */ +int elf_section_header_get_by_name(const struct elf_file *elf, const char* name, + const struct elf_section_header **header); +/** + * Print elf section header + * + * @param header section header structure + */ +void elf_section_header_print(const struct elf_section_header *header); + +/** + * Read elf section using given header + * + * @param [in]elf elf file structure + * @param [in]header section header + * @param [out]section section data + * @return error code, 0 when success + */ +int elf_section_read(const struct elf_file *elf, const struct elf_section_header *header, + struct elf_section *section); + +/** +* Read elf section using given header to specified buffer +* +* @param [in]elf elf file structure +* @param [in]header section header +* @param [out]buffer buffer for a section data +* @param [in]size buffer size +* @return error code, 0 when success +*/ +int elf_section_read_content(const struct elf_file *elf, const struct elf_section_header *header, + void *buffer, const size_t size); + +/** + * Read elf section with given name + * + * @param [in]elf elf file structure + * @param [in]name section name + * @param [out]section section data + * @return error code, 0 when success + */ +int elf_section_read_by_name(const struct elf_file *elf, const char *name, struct elf_section *section); + +/** + * Release section + * + * @param [in]section section structure + */ +void elf_section_free(struct elf_section *section); + +/** + * Read elf strings section with given index + * + * @param [in]elf elf file structure + * @param [in]index strings section index + * @param [out]strings strings section data + * @return error code, 0 when success + */ +int elf_strings_read_by_index(const struct elf_file *elf, int index, struct elf_strings *strings); + +/** + * Get string value. Allocate new copy using strdup. + * + * @param [in]strings strings section structure + * @param [in]index string index + * @param [out]str Pointer to the variable in which the pointer to the allocated string will be placed + * @return error code, 0 when success + */ +int elf_strings_get(const struct elf_strings *strings, int index, char **str); + +/** + * Release string section + * @param [in]strings strings section structure + */ +void elf_strings_free(struct elf_strings *strings); + +#endif /* __ELF_FILE_H__ */ From 539c2b388cc54ef6e7427ea55c6a77d7636bf99b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:10:50 +0200 Subject: [PATCH 339/350] module: Set of a new functions to parse modules A structure was created to represent the module, module section and section informations. Added a set of new functions for parsing a module and reading its contents. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/module.h | 190 ++++++++++++++ src/module.c | 503 ++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+) create mode 100644 src/include/rimage/module.h create mode 100644 src/module.c diff --git a/src/include/rimage/module.h b/src/include/rimage/module.h new file mode 100644 index 000000000000..3c265b20823b --- /dev/null +++ b/src/include/rimage/module.h @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#ifndef __MODULE_H__ +#define __MODULE_H__ + +#include <stdint.h> +#include <stdbool.h> +#include <stdio.h> + +#include <rimage/elf_file.h> + +enum module_section_type { + MST_UNKNOWN, MST_DATA, MST_TEXT, MST_BSS, MST_NOTE +}; + +struct module_section { + const struct elf_section_header *header; + enum module_section_type type; + + /* The contents of the section lie in the rom memory space */ + bool rom; + + /* ADSP devices have their RAM regions mapped twice. The first mapping is set in the CPU + * to bypass the L1 cache, and so access through pointers in that region is coherent between + * CPUs (but slow). The second region accesses the same memory through the L1 cache and + * requires careful flushing when used with shared data. + * + * This distinction is exposed in the linker script, where some symbols (e.g. stack regions) + * are linked into cached memory, but others (general kernel memory) are not. + * + * Addresses of sections belonging to a rom memory are not converted. */ + + /* section virtual address, converted to cached address space */ + uint32_t address; + + /* section physical load address, converted to cached address space */ + uint32_t load_address; + + size_t size; + + /* next section of this type */ + struct module_section *next_section; +}; + +struct module_sections_info { + /* start address */ + uint32_t start; + + /* end address */ + uint32_t end; + + /* size without any gaps */ + size_t size; + + /* size include gap to nearest page */ + size_t file_size; + + /* sections count */ + unsigned int count; + + /* First section */ + struct module_section *first_section; +}; + +/* + * ELF module data + */ +struct module { + struct elf_file elf; + + /* Array of valid sections */ + struct module_section *sections; + + /* Number of valid sections */ + unsigned int num_sections; + + struct module_sections_info text; + struct module_sections_info data; + struct module_sections_info bss; +}; + +struct image; +struct memory_alias; +struct memory_config; + +/** + * Convert uncached memory address to cached + * + * @param alias alias memory configration + * @param address address to be converted + * @return cached address + */ +unsigned long uncache_to_cache(const struct memory_alias *alias, unsigned long address); + + +/** + * Load module file + * + * @param module module structure + * @param filename module file name + * @param verbose verbose logging selection + * @return error code + */ +int module_open(struct module *module, const char *filename, const bool verbose); + +/** + * Unloads module + * + * @param module module structure + */ +void module_close(struct module *module); + +/** + * Parse module sections + * + * @param module module structure + * @param mem_cfg memory configration structure + * @param verbose verbose logging selection + * @return error code + */ +void module_parse_sections(struct module *module, const struct memory_config *mem_cfg, + bool verbose); + +/** + * Read module section to memory buffer + * + * @param [in]module module structure + * @param [in]section module section structure + * @param [out]buffer destination buffer + * @param [in]size destination buffer size + * @return error code + */ +int module_read_section(const struct module *module, const struct module_section *section, + void *buffer, const size_t size); + +/** + * Read module section and write it to a file + * + * @param module module structure + * @param section module section structure + * @param padding count of padding bytes to write after section content + * @param out_file destination file handle + * @param filename output file name used to print error message + * @return error code + */ +int module_write_section(const struct module *module, const struct module_section *section, + const int padding, FILE *out_file, const char *filename); + +/** + * Read whole module elf file to a memory buffer + * + * @param [in]module module structure + * @param [out]buffer destination buffer + * @param [in]size destination buffer size + * @return error code + */ +int module_read_whole_elf(const struct module *module, void *buffer, size_t size); + +/** + * Read whore module elf file and write it to a file + * + * @param module module structure + * @param out_file destination file handle + * @param filename output file name used to print error message + * @return error code + */ +int module_write_whole_elf(const struct module *module, FILE *out_file, const char *filename); + +/** + * Displays information about the occupancy of each memory zone + * + * @param module module structure + */ +void module_print_zones(const struct module *module); + +/** + * Checks all modules to make sure their sections do not overlap with each other + * + * @param module module structure + * @param image program global structure + * @return error code + */ +int modules_validate(const struct image *image); + +#endif /* __MODULE_H__ */ diff --git a/src/module.c b/src/module.c new file mode 100644 index 000000000000..0fb4de075de7 --- /dev/null +++ b/src/module.c @@ -0,0 +1,503 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#include <string.h> +#include <stdlib.h> +#include <errno.h> +#include <assert.h> + +#include <rimage/module.h> +#include <rimage/elf_file.h> +#include <rimage/file_utils.h> +#include <rimage/rimage.h> + + +int module_read_section(const struct module *module, const struct module_section *section, + void *buffer, const size_t size) +{ + return elf_section_read_content(&module->elf, section->header, buffer, size); +} + +int module_write_section(const struct module *module, const struct module_section *section, + const int padding, FILE *out_file, const char *filename) +{ + int ret; + struct elf_section section_data; + size_t count; + char padding_buf[4]; + + ret = elf_section_read(&module->elf, section->header, §ion_data); + if (ret) + return ret; + + /* write out section data */ + count = fwrite(section_data.data, section->size, 1, out_file); + if (count != 1) { + ret = file_error("cant write section", filename); + goto out; + } + + /* write padding data */ + if (padding) { + assert(padding <= sizeof(padding_buf)); + + memset(padding_buf, 0, padding); + count = fwrite(padding_buf, padding, 1, out_file); + if (count != 1) { + ret = file_error("cant write padding", filename); + goto out; + } + } + +out: + elf_section_free(§ion_data); + return ret; +} + +int module_read_whole_elf(const struct module *module, void *buffer, size_t size) +{ + int ret; + size_t count; + + if (module->elf.file_size > size) { + fprintf(stderr, "error: Output buffer too small.\n"); + return -ENOSPC; + } + + /* read in file data */ + ret = fseek(module->elf.file, 0, SEEK_SET); + if (ret) + return file_error("can't seek set", module->elf.filename); + + count = fread(buffer, module->elf.file_size, 1, module->elf.file); + if (count != 1) + return file_error("can't read data", module->elf.filename); + + return ret; +} + +int module_write_whole_elf(const struct module *module, FILE *out_file, const char *filename) +{ + int ret; + char *buffer; + size_t count; + + /* alloc data data */ + buffer = calloc(1, module->elf.file_size); + if (!buffer) + return -ENOMEM; + + ret = module_read_whole_elf(module, buffer, module->elf.file_size); + if (ret) + goto out; + + /* write out section data */ + count = fwrite(buffer, module->elf.file_size, 1, out_file); + if (count != 1) { + ret = file_error("can't write data", "");// TODO: image->out_file); + goto out; + } + +out: + free(buffer); + return ret; +} + +void module_print_zones(const struct module *module) +{ + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text.start, module->text.end, + module->text.end - module->text.start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data.start, module->data.end, + module->data.end - module->data.start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n", + module->bss.start, module->bss.end, + module->bss.end - module->bss.start); +} + +/** + * Print a list of valid program headers + * + * @param module pointer to a module structure + */ +static void module_print_programs(const struct module *module) +{ + const Elf32_Phdr *header; + int i; + + /* check each program */ + for (i = 0; i < module->elf.header.phnum; i++) { + header = &module->elf.programs[i]; + + if (header->filesz == 0 || header->type != PT_LOAD) + continue; + + fprintf(stdout, "%s program-%d:\n", module->elf.filename, i); + elf_program_header_print(header); + } +} + +/** + * Goes through program headers array to find the physical address based on the virtual address. + * + * @param elf elf file structure + * @param vaddr virtual address + * @return physical address when success, virtual address on error + */ +static uint32_t find_physical_address(struct elf_file *file, size_t vaddr) +{ + uint16_t i; + const Elf32_Phdr *prog; + + for (i = 0; i < file->programs_count; i++) { + prog = &file->programs[i]; + + if (prog->type != PT_LOAD) + continue; + + if (vaddr >= prog->vaddr && vaddr < (prog->vaddr + file->programs[i].memsz)) + return file->programs[i].paddr + vaddr - prog->vaddr; + } + + return vaddr; +} + +unsigned long uncache_to_cache(const struct memory_alias *alias, unsigned long address) +{ + return (address & ~alias->mask) | alias->cached; +} + +/** + * Checks if the section is placed in the rom memory address space + * + * @param config Memory configuration structure + * @param section section to be checked + * @return true if section is placed in rom memory address space + */ +static bool section_is_rom(const struct memory_config *config, + const struct elf_section_header *section) +{ + uint32_t sect_start, sect_end; + uint32_t rom_start, rom_end; + + sect_start = section->data.vaddr; + sect_end = sect_start + section->data.size; + + rom_start = config->zones[SOF_FW_BLK_TYPE_ROM].base; + rom_end = rom_start + config->zones[SOF_FW_BLK_TYPE_ROM].size; + + if (sect_end <= rom_start || sect_start >= rom_end) + return false; + if (sect_start >= rom_start && sect_end <= rom_end) + return true; + + fprintf(stderr, "Warning! Section %s partially overlaps with rom memory.\n", section->name); + return false; +} + +/** + * Initialize module_sections_info structure + * + * @param info Pointer to a module_sections_info structure + */ +static void sections_info_init(struct module_sections_info *info) +{ + memset(info, 0, sizeof(*info)); + + info->start = UINT32_MAX; +} + +/** + * Adds section to module_sections_info structure + * + * @param info Pointer to a module_sections_info structure + * @param address section address + * @param size section size + */ +static void sections_info_add(struct module_sections_info *info, const uint32_t address, + const size_t size) +{ + const uint32_t end = address + size; + + if (address < info->start) + info->start = address; + + if (end > info->end) + info->end = end; + + info->size += size; + info->count++; +} + +/** + * Calculates file size after adding all sections + * + * @param info Pointer to a module_sections_info structure + */ +static void sections_info_finalize(struct module_sections_info *info) +{ + info->file_size = info->end - info->start; + + /* file sizes round up to nearest page */ + info->file_size = (info->file_size + MAN_PAGE_SIZE - 1) & ~(MAN_PAGE_SIZE - 1); +} + +/** + * Checks the section header (type and flags) to determine the section type. + * + * @param section section header + * @return enum module_section_type + */ +static enum module_section_type get_section_type(const struct elf_section_header *section) +{ + switch (section->data.type) { + case SHT_INIT_ARRAY: + /* fall through */ + case SHT_PROGBITS: + /* text or data */ + return (section->data.flags & SHF_EXECINSTR) ? MST_TEXT : MST_DATA; + + case SHT_NOBITS: + /* bss or heap */ + return MST_BSS; + + case SHT_NOTE: + return MST_NOTE; + + default: + return MST_UNKNOWN; + } +} + +void module_parse_sections(struct module *module, const struct memory_config *mem_cfg, bool verbose) +{ + const uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + uint16_t i; + + struct module_section *out_section = module->sections; + + fprintf(stdout, " Found %d sections, listing valid sections...\n", + module->elf.sections_count); + + fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); + + /* parse each section */ + for (i = 0; i < module->elf.sections_count; i++) { + const struct elf_section_header *sect = &module->elf.sections[i]; + struct module_sections_info *info = NULL; + + /* only write valid sections */ + if (!(sect->data.flags & valid)) + continue; + + /* Comment from fix_elf_addrs.py: + * The sof-derived linker scripts currently emit some zero-length sections + * at address zero. This is benign, and the linker is happy + * + * So we gleefully skip them. */ + if (sect->data.size == 0) + continue; + + out_section->header = sect; + out_section->size = sect->data.size; + out_section->type = get_section_type(sect); + out_section->rom = section_is_rom(mem_cfg, sect); + out_section->address = sect->data.vaddr; + out_section->load_address = find_physical_address(&module->elf, sect->data.vaddr); + + /* Don't convert ROM addresses, ROM sections aren't included in the output image */ + if (!out_section->rom) { + /* Walk the sections in the ELF file, changing the VMA/LMA of each uncached section + * to the equivalent address in the cached area of memory. */ + out_section->address = uncache_to_cache(&mem_cfg->alias, + out_section->address); + out_section->load_address = uncache_to_cache(&mem_cfg->alias, + out_section->load_address); + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8zx\t0x%zx", i, + out_section->load_address, out_section->address, + out_section->address + out_section->size, out_section->size); + + + switch (out_section->type) { + case MST_DATA: + info = &module->data; + fprintf(stdout, "\tDATA"); + break; + + case MST_TEXT: + info = &module->text; + fprintf(stdout, "\tTEXT"); + break; + + case MST_BSS: + info = &module->bss; + fprintf(stdout, "\tBSS"); + break; + + case MST_NOTE: + fprintf(stdout, "\tNOTE"); + break; + + default: + break; + } + + if (out_section->rom) { + /* ROM sections aren't included in the output image */ + fprintf(stdout, " ROM"); + } else { + /* Add section to list */ + if (info) { + sections_info_add(info, out_section->load_address, out_section->size); + out_section->next_section = info->first_section; + info->first_section = out_section; + } + } + + module->num_sections++; + out_section++; + + /* section name */ + fprintf(stdout, "\t%s\n", sect->name); + + if (verbose) { + fprintf(stdout, "%s section-%d:\n", module->elf.filename, i); + elf_section_header_print(sect); + } + } + + sections_info_finalize(&module->text); + sections_info_finalize(&module->data); + sections_info_finalize(&module->bss); + + size_t fw_size = module->data.size + module->text.size; + + fprintf(stdout, " module: input size %zd (0x%zx) bytes %d sections\n", + fw_size, fw_size, module->num_sections); + fprintf(stdout, " module: text %zu (0x%zx) bytes\n" + "\tdata %zu (0x%zx) bytes\n" + "\tbss %zu (0x%zx) bytes\n\n", + module->text.size, module->text.size, + module->data.size, module->data.size, + module->bss.size, module->bss.size); +} + +int module_open(struct module *module, const char *filename, const bool verbose) +{ + int ret; + + memset(module, 0, sizeof(*module)); + + ret = elf_open(&module->elf, filename); + if (ret) + return ret; + + if (verbose) { + fprintf(stdout, "%s elf header:\n", module->elf.filename); + elf_header_print(&module->elf); + module_print_programs(module); + } + + module->sections = calloc(module->elf.sections_count, sizeof(struct module_section)); + if (!module->sections) { + elf_free(&module->elf); + return -ENOMEM; + } + + sections_info_init(&module->data); + sections_info_init(&module->bss); + sections_info_init(&module->text); + + return 0; +} + +void module_close(struct module *module) +{ + elf_free(&module->elf); +} + +/** + * Checks if the contents of the section overlaps + * + * @param a first section to check + * @param b second section to check + * @return true if space of a sections overlap + */ +static bool section_check_overlap(const struct module_section *a, const struct module_section *b) +{ + uint32_t a_start = a->address; + uint32_t a_end = a_start + a->size; + + uint32_t b_start = b->address; + uint32_t b_end = b_start + b->size; + + /* is section start overlapping ? */ + return (a_start >= b_start && a_start < b_end) || + /* is section end overlapping ? */ + (a_end > b_start && a_end <= b_end); +} + +/** + * Checks if the contents of the modules overlaps + * + * @param mod first module to check + * @param mod2 second module to check + * @return error code + */ +static int module_check_overlap(const struct module *mod, const struct module *mod2) +{ + unsigned int i, j; + + /* for each section from first module */ + for (i = 0; i < mod->num_sections; i++) { + /* and for each section from second module */ + for (j = 0; j < mod2->num_sections; j++) { + const struct module_section *section = &mod->sections[i]; + const struct module_section *section2 = &mod2->sections[j]; + + /* don't compare section with itself */ + if (section == section2) + continue; + + /* check section overlapping */ + if (section_check_overlap(section, section2)) { + + fprintf(stderr, "error: Detected overlapping sections:\n"); + fprintf(stderr, "\t[0x%x : 0x%zx] %s from %s\n", section->address, + section->address + section->size - 1, + section->header->name, mod->elf.filename); + fprintf(stderr, "\t[0x%x : 0x%zx] %s from %s\n", section2->address, + section2->address + section2->size - 1, + section2->header->name, mod2->elf.filename); + + return -EINVAL; + } + } + } + + return 0; +} + +int modules_validate(const struct image *image) +{ + int i, j, ret; + + for (i = 0; i < image->num_modules; i++) { + for (j = 0; j < image->num_modules; j++) { + ret = module_check_overlap(&image->module[i].file, &image->module[j].file); + if (ret) + return ret; + } + } + + return 0; +} From 71553274b5690b672a8955afcf8a0f9bb52f98ee Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:15:35 +0200 Subject: [PATCH 340/350] Switch to new elf reader and module parse functions. Moved the module information to the new module structure. Used new functions to parse module. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 2 +- src/ext_manifest.c | 74 +++---- src/file_simple.c | 189 +++++++----------- src/include/rimage/manifest.h | 38 +--- src/include/rimage/misc_utils.h | 2 + src/manifest.c | 337 ++++++++++++-------------------- src/rimage.c | 26 ++- 7 files changed, 257 insertions(+), 411 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6413713617c7..8e0a5da7d267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,13 +18,13 @@ add_executable(rimage src/pkcs1_5.c src/manifest.c src/ext_manifest.c - src/elf.c src/rimage.c src/toml_utils.c src/adsp_config.c src/misc_utils.c src/file_utils.c src/elf_file.c + src/module.c tomlc99/toml.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index fb021e3dc270..c6d3c02e887e 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -41,7 +41,8 @@ static int ext_man_open_file(struct image *image) return 0; } -static const struct manifest_module *ext_man_find_module(const struct image *image) +static const struct elf_file *ext_man_find_module(const struct image *image, + const struct elf_section_header **section) { const struct manifest_module *module; int i; @@ -52,8 +53,9 @@ static const struct manifest_module *ext_man_find_module(const struct image *ima if (module->is_bootloader) continue; - if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) - return module; + if (!elf_section_header_get_by_name(&module->file.elf, EXT_MAN_DATA_SECTION, + section)) + return &module->file.elf; } return NULL; @@ -89,57 +91,45 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct manifest_module *module, +static int ext_man_build(const struct elf_file *file, const struct elf_section_header *section, struct ext_man_header **dst_buff) { - struct ext_man_header ext_man; - const Elf32_Shdr *section; - uint8_t *sec_buffer = NULL; - size_t offset; + struct ext_man_header *ext_man; + size_t size; int ret; - ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, - (void **)&sec_buffer); - if (ret < 0) { - fprintf(stderr, - "error: failed to read %s section content, code %d\n", - EXT_MAN_DATA_SECTION, ret); - goto out; + size = ext_man_template.header_size + section->data.size; + if (size % 4) { + fprintf(stderr, "error: extended manifest size must be aligned to 4\n"); + return -EINVAL; } - ret = 0; + + ext_man = calloc(1, size); + if (!ext_man) + return -ENOMEM; /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ - memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); - ext_man.full_size = ext_man.header_size; - ext_man.full_size += section->size; - if (ext_man.full_size % 4) { - fprintf(stderr, - "error: extended manifest size must be aligned to 4\n"); - ret = -EINVAL; - goto out; - } + memcpy(ext_man, &ext_man_template, ext_man_template.header_size); + ext_man->full_size = size; - *dst_buff = calloc(1, ext_man.full_size); - if (!*dst_buff) { - ret = -ENOMEM; - goto out; + ret = elf_section_read_content(file, section, ext_man + 1, + size - ext_man_template.header_size); + if (ret < 0) { + fprintf(stderr, "error: failed to read %s section content, code %d\n", + EXT_MAN_DATA_SECTION, ret); + free(ext_man); + return ret; } - /* fill buffer with ext_man and section content */ - memcpy(*dst_buff, &ext_man, ext_man.header_size); - offset = ext_man.header_size; - - memcpy(((char *)*dst_buff) + offset, sec_buffer, section->size); - -out: - free(sec_buffer); - return ret; + *dst_buff = ext_man; + return 0; } int ext_man_write(struct image *image) { - const struct manifest_module *module; + const struct elf_file *file; struct ext_man_header *ext_man = NULL; + const struct elf_section_header *section; int count; int ret; @@ -147,13 +137,13 @@ int ext_man_write(struct image *image) if (ret) goto out; - module = ext_man_find_module(image); - if (!module) { + file = ext_man_find_module(image, §ion); + if (!file) { ret = -ECANCELED; goto out; } - ret = ext_man_build(module, &ext_man); + ret = ext_man_build(file, section, &ext_man); if (ret) goto out; diff --git a/src/file_simple.c b/src/file_simple.c index f79cc4b50365..e87689f44133 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -12,17 +12,18 @@ #include <rimage/manifest.h> #include <rimage/file_utils.h> -static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *section) +static int get_mem_zone_type(const struct memory_config *memory, + const struct module_section *section) { uint32_t start, end, base, size; int i; - start = section->vaddr; - end = section->vaddr + section->size; + start = section->load_address; + end = start + section->size; for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { - base = memory->zones[i].base; - size = memory->zones[i].size; + base = memory->zones[i].base; + size = memory->zones[i].size; if (start < base) continue; @@ -38,13 +39,12 @@ static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *sec static int block_idx; static int write_block(struct image *image, struct manifest_module *module, - Elf32_Shdr *section) + const struct module_section *section) { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; uint32_t padding = 0; size_t count; - void *buffer; int ret; block.size = section->size; @@ -54,14 +54,14 @@ static int write_block(struct image *image, struct manifest_module *module, block.size += padding; } - ret = get_mem_zone_type(&image->adsp->mem, section); + ret = get_mem_zone_type(&adsp->mem, section); if (ret != SOF_FW_BLK_TYPE_INVALID) { block.type = ret; - block.offset = section->vaddr - adsp->mem.zones[ret].base + block.offset = section->load_address - adsp->mem.zones[ret].base + adsp->mem.zones[ret].host_offset; } else { - fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", - section->vaddr, section->size); + fprintf(stderr, "error: invalid block address/size 0x%x/0x%zx\n", + section->load_address, section->size); return -EINVAL; } @@ -70,38 +70,19 @@ static int write_block(struct image *image, struct manifest_module *module, if (count != 1) return file_error("Write header failed", image->out_file); - /* alloc data data */ - buffer = calloc(1, block.size); - if (!buffer) - return -ENOMEM; - - /* read in section data */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret) { - ret = file_error("seek to section failed", module->elf_file); - goto out; - } - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - ret = file_error("cant read section", module->elf_file); - goto out; - } - /* write out section data */ - count = fwrite(buffer, 1, block.size, image->out_fd); - if (count != block.size) { - ret = file_error("cant write section", image->out_file); - fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", - section->off, section->size, section->vaddr); - goto out; + ret = module_write_section(&module->file, section, padding, image->out_fd, image->out_file); + if (ret) { + fprintf(stderr, "error: cant write section data. foffset %d size 0x%zx mem addr 0x%x\n", + section->header->data.off, section->size, section->load_address); + return ret; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, - section->vaddr, section->size, ftell(image->out_fd), - block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\t%s\n", block_idx++, + section->load_address, section->size, ftell(image->out_fd), + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA", + section->header->name); -out: - free(buffer); /* return padding size */ if (ret >= 0) return padding; @@ -109,18 +90,44 @@ static int write_block(struct image *image, struct manifest_module *module, return ret; } +/** + * Write all linked sections + * + * @param image program global structure + * @param module modules manifest description + * @param section module section descriptor + * @return size of used padding, error code on error + */ +static int write_blocks(struct image *image, struct manifest_module *module, + const struct module_section *section) +{ + int ret, padding = 0; + + while (section) { + ret = write_block(image, module, section); + if (ret < 0) { + fprintf(stderr, "error: failed to write section %s\n", + section->header->name); + return ret; + } + + padding += ret; + section = section->next_section; + } + + return padding; +} + static int simple_write_module(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; - Elf32_Shdr *section; size_t count; - int i, err; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int err; int ptr_hdr, ptr_cur; - uint32_t padding = 0; + uint32_t padding; - hdr.num_blocks = module->num_sections - module->num_bss; - hdr.size = module->text_size + module->data_size + + hdr.num_blocks = module->file.text.count + module->file.data.count; + hdr.size = module->file.text.size + module->file.data.size + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; hdr.type = SOF_FW_BASE; @@ -133,40 +140,22 @@ static int simple_write_module(struct image *image, struct manifest_module *modu if (count != 1) return file_error("failed to write section header", image->out_file); - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + module_print_zones(&module->file); - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\tName\n"); - fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); - - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* only write valid sections */ - if (!(module->section[i].flags & valid)) - continue; - - /* dont write bss */ - if (section->type == SHT_NOBITS) - continue; + /* Write text sections */ + err = write_blocks(image, module, module->file.text.first_section); + if (err < 0) + return err; + padding = err; - err = write_block(image, module, section); - if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", - i); + /* Write data sections */ + err = write_blocks(image, module, module->file.data.first_section); + if (err < 0) return err; - } - /* write_block will return padding size */ padding += err; - } + hdr.size += padding; /* Record current pointer, will set it back after overwriting hdr */ ptr_cur = ftell(image->out_fd); @@ -195,10 +184,9 @@ static int write_block_reloc(struct image *image, struct manifest_module *module { struct snd_sof_blk_hdr block; size_t count; - void *buffer; int ret; - block.size = module->file_size; + block.size = module->file.elf.file_size; block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = 0; @@ -207,36 +195,14 @@ static int write_block_reloc(struct image *image, struct manifest_module *module if (count != 1) return file_error("cant write header", image->out_file); - /* alloc data data */ - buffer = calloc(1, module->file_size); - if (!buffer) - return -ENOMEM; - - /* read in section data */ - ret = fseek(module->fd, 0, SEEK_SET); - if (ret) { - ret = file_error("can't seek to section", module->elf_file); - goto out; - } - count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) { - ret = file_error("can't read section", module->elf_file); - goto out; - } - - /* write out section data */ - count = fwrite(buffer, 1, module->file_size, image->out_fd); - if (count != module->file_size) { - ret = file_error("can't write section", image->out_file); - goto out; - } + ret = module_write_whole_elf(&module->file, image->out_fd, image->out_file); + if (ret) + return ret; fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\n", block_idx++, - 0, module->file_size, ftell(image->out_fd), + 0, module->file.elf.file_size, ftell(image->out_fd), block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); -out: - free(buffer); return ret; } @@ -247,24 +213,14 @@ static int simple_write_module_reloc(struct image *image, struct manifest_module int err; hdr.num_blocks = 1; - hdr.size = module->text_size + module->data_size; + hdr.size = module->file.text.size + module->file.data.size; hdr.type = SOF_FW_BASE; // module count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) return file_error("failed to write section header", image->out_file); - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); @@ -294,8 +250,9 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; + module->output_size = module->file.data.size + module->file.text.size; module->output_size += sizeof(struct snd_sof_blk_hdr) * - (module->num_sections - module->num_bss); + (module->file.data.count + module->file.text.count); module->output_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; hdr.file_size += module->output_size; @@ -308,7 +265,7 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; - fprintf(stdout, "writing module %d %s\n", i, module->elf_file); + fprintf(stdout, "writing module %d %s\n", i, module->file.elf.filename); if (image->reloc) ret = simple_write_module_reloc(image, module); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index c1f820c5a624..840cd7d797bf 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,54 +7,20 @@ #define __MANIFEST_H__ #include <stdint.h> -#include <stdio.h> #include <stdbool.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> #include <rimage/plat_auth.h> -#include <rimage/elf.h> +#include <rimage/module.h> /* * Manifest module data */ struct manifest_module { - /* This fields will be moved to module structure */ - const char *elf_file; - FILE *fd; - - Elf32_Ehdr hdr; - Elf32_Shdr *section; - Elf32_Phdr *prg; - char *strings; - - uint32_t text_start; - uint32_t text_end; - uint32_t data_start; - uint32_t data_end; - uint32_t bss_start; - uint32_t bss_end; - - int num_sections; - int num_bss; - int bss_index; - - /* sizes do not include any gaps */ - int bss_size; - int text_size; - int data_size; - - /* sizes do include gaps to nearest page */ - int bss_file_size; - int text_file_size; - int data_file_size; - - /* total file size */ - size_t file_size; + struct module file; /* Following fields are used in manifest creation process */ - int fw_size; - bool is_bootloader; /* Size of the module in the output image. diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h index 8ec051d74e91..e3432d57a391 100644 --- a/src/include/rimage/misc_utils.h +++ b/src/include/rimage/misc_utils.h @@ -8,6 +8,8 @@ #include <stdint.h> +#define DIV_ROUND_UP(val, div) (((val) + (div) - 1) / (div)) + /** * Reverses the order of bytes in the array * @param ptr pointer to a array diff --git a/src/manifest.c b/src/manifest.c index 673740ecaa87..19b73ee38e35 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -139,107 +139,58 @@ static int man_init_image_v2_5(struct image *image) return 0; } -/* we should call this after all segments size set up via iterate */ -static uint32_t elf_to_file_offset(struct image *image, - struct manifest_module *module, - struct sof_man_module *man_module, - Elf32_Shdr *section) -{ - uint32_t elf_addr = section->vaddr, file_offset = 0, i; - - if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { - /* check programs for lma/vma change */ - for (i = 0; i < module->hdr.phnum; i++) { - if (section->vaddr == module->prg[i].vaddr) { - elf_addr = module->prg[i].paddr; - break; - } - } - if (section->flags & SHF_EXECINSTR) { - /* text segment */ - file_offset = elf_addr - module->text_start + - module->foffset; - } else { - /* rodata segment, append to text segment */ - file_offset = elf_addr - module->data_start + - module->foffset + module->text_fixup_size; - } - } else if (section->type == SHT_NOBITS) { - /* bss segment */ - file_offset = 0; - } - - return file_offset; -} - /* write SRAM sections */ -static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct manifest_module *module, - struct sof_man_module *man_module, - int section_idx) +static int man_copy_sram(struct image *image, const struct manifest_module *module, + const struct sof_man_segment_desc *segment, + const struct module_section *section) { - uint32_t offset = elf_to_file_offset(image, module, - man_module, section); - uint32_t end = offset + section->size; - int seg_type = -1; - void *buffer = image->fw_image + offset; - size_t count; + uint32_t offset, end; + int ret; + assert(section->load_address >= segment->v_base_addr); + offset = segment->file_offset + section->load_address - segment->v_base_addr; + end = offset + section->size; assert((uint64_t)offset + section->size <= image->adsp->image_size); - switch (section->type) { - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) - seg_type = SOF_MAN_SEGMENT_TEXT; - else - seg_type = SOF_MAN_SEGMENT_RODATA; - break; - case SHT_NOBITS: - seg_type = SOF_MAN_SEGMENT_BSS; - /* FALLTHRU */ - default: - return 0; - } - - /* file_offset for segment should not be 0s, we set it to - * the smallest offset of its modules ATM. - */ - if (man_module->segment[seg_type].file_offset > offset || - man_module->segment[seg_type].file_offset == 0) - man_module->segment[seg_type].file_offset = offset; - - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) - return file_error("cant read section", module->elf_file); + ret = module_read_section(&module->file, section, image->fw_image + offset, + image->adsp->image_size - offset); + if (ret) + return ret; /* get module end offset ? */ if (end > image->image_end) image->image_end = end; - fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, - section->vaddr, section->size, offset, - seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); + fprintf(stdout, "\t0x%x\t0x%zx\t\t0x%x\t%s\t%s\n", section->load_address, section->size, + offset, section->type == MST_TEXT ? "TEXT" : "DATA", section->header->name); return 0; } -static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct manifest_module *module, - struct sof_man_module *man_module, int idx) +/** + * Write all linked sections + * + * @param image program global structure + * @param module modules manifest description + * @param section module section descriptor + * @return error code on error, 0 on success + */ +static int man_copy_elf_sections(struct image *image, struct manifest_module *module, + const struct sof_man_segment_desc *segment, + const struct module_section *section) { int ret; - /* seek to ELF section */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret) - return file_error("can't seek to section", module->elf_file); + while (section) { + ret = man_copy_sram(image, module, segment, section); + if (ret < 0) { + fprintf(stderr, "error: failed to write section %s\n", + section->header->name); + return ret; + } - /* write data to DRAM or ROM image */ - if (!elf_is_rom(image, section)) - return man_copy_sram(image, section, module, man_module, idx); + section = section->next_section; + } return 0; } @@ -247,48 +198,40 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, static int man_get_module_manifest(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { - Elf32_Shdr *section; + struct elf_section section; struct sof_man_segment_desc *segment; - struct sof_man_module_manifest sof_mod; - size_t count; - int ret, man_section_idx; - - fprintf(stdout, "Module Write: %s\n", module->elf_file); - - /* find manifest module data */ - man_section_idx = elf_find_section(module, ".module"); - if (man_section_idx < 0) - return -EINVAL; - - fprintf(stdout, " Manifest module metadata section at index %d\n", - man_section_idx); - section = &module->section[man_section_idx]; + const struct sof_man_module_manifest *sof_mod; + int ret; - /* load in manifest data */ - ret = fseek(module->fd, section->off, SEEK_SET); + fprintf(stdout, "Module Write: %s\n", module->file.elf.filename); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); + /* load in module manifest data */ + ret = elf_section_read_by_name(&module->file.elf, ".module", §ion); + if (ret) { + fprintf(stderr, "error: can't read module manifest from '.module' section.\n"); return ret; } - count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); - if (count != sizeof(sof_mod)) - return file_error("can't read section", module->elf_file); + if (sizeof(*sof_mod) > section.header.data.size) { + fprintf(stderr, "error: Invalid module manifest in '.module' section.\n"); + ret = -ENODATA; + goto error; + } + sof_mod = section.data; /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); - man_module->entry_point = sof_mod.module.entry_point; - memcpy(man_module->name, sof_mod.module.name, SOF_MAN_MOD_NAME_LEN); - memcpy(man_module->uuid, sof_mod.module.uuid, 16); - man_module->affinity_mask = sof_mod.module.affinity_mask; - man_module->type.auto_start = sof_mod.module.type.auto_start; - man_module->type.domain_dp = sof_mod.module.type.domain_dp; - man_module->type.domain_ll = sof_mod.module.type.domain_ll; - man_module->type.load_type = sof_mod.module.type.load_type; + man_module->entry_point = sof_mod->module.entry_point; + memcpy(man_module->name, sof_mod->module.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod->module.uuid, 16); + man_module->affinity_mask = sof_mod->module.affinity_mask; + man_module->type.auto_start = sof_mod->module.type.auto_start; + man_module->type.domain_dp = sof_mod->module.type.domain_dp; + man_module->type.domain_ll = sof_mod->module.type.domain_ll; + man_module->type.load_type = sof_mod->module.type.load_type; /* read out text_fixup_size from memory mapping */ - module->text_fixup_size = sof_mod.text_size; + module->text_fixup_size = sof_mod->text_size; /* text segment */ segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; @@ -314,7 +257,9 @@ static int man_get_module_manifest(struct image *image, struct manifest_module * fprintf(stdout, " Entry point 0x%8.8x\n", man_module->entry_point); - return 0; +error: + elf_section_free(§ion); + return ret; } static inline const char *segment_name(int i) @@ -375,10 +320,9 @@ static int man_module_create(struct image *image, struct manifest_module *module struct sof_man_module *man_module) { /* create module and segments */ - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - Elf32_Shdr *section; - int i, err; + int err; unsigned int pages; + const struct elf_section_header *bss; image->image_end = 0; @@ -392,93 +336,92 @@ static int man_module_create(struct image *image, struct manifest_module *module /* max number of instances of this module ?? */ man_module->instance_max_count = 1; - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); /* main module */ + fprintf(stdout, "\tAddress\t\tSize\t\tFile\tType\tName\n"); + /* text section is first */ - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = - module->foffset; - man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = - module->text_start; + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = module->file.text.start; /* calculates those padding 0s by the start of next segment */ - pages = module->text_file_size / MAN_PAGE_SIZE; - if (module->text_file_size % MAN_PAGE_SIZE) - pages += 1; + /* file_size is already aligned to MAN_PAGE_SIZE */ + pages = module->file.text.file_size / MAN_PAGE_SIZE; if (module->text_fixup_size == 0) - module->text_fixup_size = module->text_file_size; + module->text_fixup_size = module->file.text.file_size; /* check if text_file_size is bigger then text_fixup_size */ - if (module->text_file_size > module->text_fixup_size) { + if (module->file.text.file_size > module->text_fixup_size) { fprintf(stderr, "error: too small text size assigned!\n"); return -EINVAL; } man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; + /* Copy text sections content */ + err = man_copy_elf_sections(image, module, &man_module->segment[SOF_MAN_SEGMENT_TEXT], + module->file.text.first_section); + if (err) + return err; + + /* data section */ - man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = - module->data_start; - man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset + module->text_fixup_size; - pages = module->data_file_size / MAN_PAGE_SIZE; - if (module->data_file_size % MAN_PAGE_SIZE) - pages += 1; + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = module->file.data.start; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = module->foffset + + module->text_fixup_size; + + /* file_size is already aligned to MAN_PAGE_SIZE */ + pages = module->file.data.file_size / MAN_PAGE_SIZE; man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + /* Copy data sections content */ + err = man_copy_elf_sections(image, module, &man_module->segment[SOF_MAN_SEGMENT_RODATA], + module->file.data.first_section); + if (err) + return err; + /* bss is last */ + + /* I do not understand why only the section named .bss was taken into account. Other + * sections of the same type were ignored (type = SHT_NOBITS, flags = SHF_ALLOC). I added + * the reading of the .bss section here, to not change the behavior of the program. + */ + bss = NULL; + + if (module->is_bootloader) { + /* Bootloader should not have .bss section. */ + fprintf(stdout, "info: ignore .bss section for bootloader module\n"); + } else { + err = elf_section_header_get_by_name(&module->file.elf, ".bss", &bss); + if (err) + fprintf(stderr, "warning: can't find '.bss' section in module %s.\n", + module->file.elf.filename); + + } + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = - module->bss_start; - pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; - if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) - pages += 1; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = 0; + pages = 0; + + if (bss) { + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = + uncache_to_cache(&image->adsp->mem.alias, bss->data.vaddr); + + pages = DIV_ROUND_UP(bss->data.size, MAN_PAGE_SIZE); + } + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; if (pages == 0) { man_module->segment[SOF_MAN_SEGMENT_BSS].flags.ul = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = - SOF_MAN_SEGMENT_EMPTY; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = SOF_MAN_SEGMENT_EMPTY; } - fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - if (man_module_validate(man_module) < 0) return -EINVAL; - /* find all sections and copy to corresponding segments */ - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - /* text or data section */ - if (!elf_is_rom(image, section)) - err = man_copy_elf_section(image, section, module, - man_module, i); - - if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", - i); - return err; - } - } fprintf(stdout, "\n"); /* no need to update end for exec headers */ @@ -507,9 +450,6 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * { /* create module and segments */ int err; - unsigned int pages; - void *buffer = image->fw_image + module->foffset; - size_t count; image->image_end = 0; @@ -523,17 +463,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * /* max number of instances of this module ?? */ man_module->instance_max_count = 1; - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); /* main module */ /* text section is first */ @@ -544,13 +474,9 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * /* data section */ man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = 0; - man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset; - pages = module->data_file_size / MAN_PAGE_SIZE; - if (module->data_file_size % MAN_PAGE_SIZE) - pages += 1; - - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = module->foffset; + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = module->file.data.file_size / + MAN_PAGE_SIZE; /* bss is last */ man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; @@ -559,20 +485,17 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - /* seek to beginning of file */ - err = fseek(module->fd, 0, SEEK_SET); + assert((module->file.elf.file_size + module->foffset) <= image->adsp->image_size); + err = module_read_whole_elf(&module->file, image->fw_image + module->foffset, + image->image_end - module->foffset); if (err) - return file_error("can't seek to section", module->elf_file); - - count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) - return file_error("can't read section", module->elf_file); + return err; fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, - 0, module->file_size, 0, "DATA"); + 0, module->file.elf.file_size, 0, "DATA"); fprintf(stdout, "\n"); - image->image_end = module->foffset + module->file_size; + image->image_end = module->foffset + module->file.elf.file_size; /* round module end up to nearest page */ if (image->image_end % MAN_PAGE_SIZE) { @@ -645,7 +568,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", - module->elf_file); + module->file.elf.filename); module->exec_header = 1; /* set module file offset */ diff --git a/src/rimage.c b/src/rimage.c index 7c89e0921d18..735075c130cc 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -214,20 +214,23 @@ int main(int argc, char *argv[]) } /* getopt reorders argv[] */ - for (i = first_non_opt; i < argc; i++) { - /* When there is more than one module, then first one is bootloader. - * Does not apply to building a image of a loadable module. */ - image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && - i == first_non_opt && !image.loadable_module; - - fprintf(stdout, "\nModule Reading %s\n", argv[i]); - ret = elf_parse_module(&image, i - first_non_opt, argv[i]); + for (opt = first_non_opt; opt < argc; opt++) { + i = opt - first_non_opt; + fprintf(stdout, "\nModule Reading %s\n", argv[opt]); + ret = module_open(&image.module[i].file, argv[opt], image.verbose); if (ret < 0) goto out; + + module_parse_sections(&image.module[i].file, &image.adsp->mem, image.verbose); + + /* When there is more than one module, then first one is bootloader. + * Does not apply to building a image of a loadable module. */ + image.module[i].is_bootloader = image.num_modules > 1 && i == 0 && + !image.loadable_module; } /* validate all modules */ - ret = elf_validate_modules(&image); + ret = modules_validate(&image); if (ret < 0) goto out; @@ -272,5 +275,10 @@ int main(int argc, char *argv[]) if (image.out_fd) fclose(image.out_fd); + /* Free loaded modules */ + for (i = 0; i < image.num_modules; i++) { + module_close(&image.module[i].file); + } + return ret; } From 4fc431b355e1e818be19f5d533356cf21d80bfd3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 30 Mar 2023 16:26:48 +0200 Subject: [PATCH 341/350] elf: Remove unused elf.c Removed elf.c file that is no longer in use. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 685 ------------------------------------ src/include/rimage/rimage.h | 10 - 2 files changed, 695 deletions(-) delete mode 100644 src/elf.c diff --git a/src/elf.c b/src/elf.c deleted file mode 100644 index 3843635d469f..000000000000 --- a/src/elf.c +++ /dev/null @@ -1,685 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. -// -// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> -// Keyon Jie <yang.jie@linux.intel.com> - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <rimage/rimage.h> -#include <rimage/cse.h> -#include <rimage/manifest.h> -#include <rimage/file_utils.h> - -static unsigned long uncache_to_cache(const struct image *image, unsigned long address) -{ - return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; -} - -static int elf_read_sections(struct image *image, struct manifest_module *module, - int module_index) -{ - Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section = module->section; - size_t count; - int i, ret; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - unsigned long rom_base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; - size_t rom_size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; - - /* read in section header */ - ret = fseek(module->fd, hdr->shoff, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to %s section header %d\n", - module->elf_file, ret); - return ret; - } - - /* allocate space for each section header */ - section = calloc(hdr->shnum, sizeof(Elf32_Shdr)); - if (!section) - return -ENOMEM; - module->section = section; - - /* read in sections */ - count = fread(section, sizeof(Elf32_Shdr), hdr->shnum, module->fd); - if (count != hdr->shnum) { - fprintf(stderr, "error: failed to read %s section header %d\n", - module->elf_file, -errno); - return -errno; - } - - /* read in strings */ - assert(hdr->shstrndx < count); - module->strings = calloc(1, section[hdr->shstrndx].size); - if (!module->strings) { - fprintf(stderr, "error: failed %s to read ELF strings for %d\n", - module->elf_file, -errno); - return -errno; - } - - ret = fseek(module->fd, section[hdr->shstrndx].off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to %s stringss %d\n", - module->elf_file, ret); - return ret; - } - - count = fread(module->strings, 1, section[hdr->shstrndx].size, - module->fd); - if (count != section[hdr->shstrndx].size) { - fprintf(stderr, "error: failed to read %s strings %d\n", - module->elf_file, -errno); - return -errno; - } - - if (module->is_bootloader) { - /* In case of multiple modules first one should be bootloader, - * that should not have these sections. - */ - fprintf(stdout, "info: ignore .bss" - " section for bootloader module\n"); - - module->bss_start = 0; - module->bss_end = 0; - } else { - /* find manifest module data */ - module->bss_index = elf_find_section(module, ".bss"); - if (module->bss_index < 0) - return module->bss_index; - } - - /* parse each section */ - for (i = 0; i < hdr->shnum; i++) { - /* only write valid sections */ - if (!(section[i].flags & valid)) - continue; - - switch (section[i].type) { - case SHT_NOBITS: - /* bss */ - module->bss_size += section[i].size; - module->num_bss++; - break; - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - module->output_size += section[i].size; - - if (section[i].flags & SHF_EXECINSTR) - module->text_size += section[i].size; - else - module->data_size += section[i].size; - break; - default: - continue; - } - - /* - * Don't convert ROM addresses, ROM sections aren't included in - * the output image - */ - if (section[i].vaddr < rom_base || section[i].vaddr >= rom_base + rom_size) - section[i].vaddr = uncache_to_cache(image, section[i].vaddr); - - module->num_sections++; - - if (!image->verbose) - continue; - - fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, section[i].type); - fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", - module->elf_file, i, section[i].flags); - fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", - module->elf_file, i, section[i].vaddr); - fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, section[i].off); - fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", - module->elf_file, i, section[i].size); - fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", - module->elf_file, i, section[i].link); - fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", - module->elf_file, i, section[i].info); - } - - return 0; -} - -static int elf_read_programs(struct image *image, struct manifest_module *module) -{ - Elf32_Ehdr *hdr = &module->hdr; - Elf32_Phdr *prg = module->prg; - size_t count; - int i, ret; - - /* read in program header */ - ret = fseek(module->fd, hdr->phoff, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to %s program header %d\n", - module->elf_file, ret); - return ret; - } - - /* allocate space for programs */ - prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); - if (!prg) - return -ENOMEM; - module->prg = prg; - - /* read in programs */ - count = fread(prg, sizeof(Elf32_Phdr), hdr->phnum, module->fd); - if (count != hdr->phnum) { - fprintf(stderr, "error: failed to read %s program header %d\n", - module->elf_file, -errno); - return -errno; - } - - /* check each program */ - for (i = 0; i < hdr->phnum; i++) { - if (prg[i].filesz == 0) - continue; - - if (!image->verbose) - continue; - - fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, prg[i].type); - fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, prg[i].off); - fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].vaddr); - fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].paddr); - fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].filesz); - fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].memsz); - fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", - module->elf_file, i, prg[i].flags); - } - - return 0; -} - -static int elf_read_hdr(struct image *image, struct manifest_module *module) -{ - Elf32_Ehdr *hdr = &module->hdr; - size_t count; - - /* read in elf header */ - count = fread(hdr, sizeof(*hdr), 1, module->fd); - if (count != 1) { - fprintf(stderr, "error: failed to read %s elf header %d\n", - module->elf_file, -errno); - return -errno; - } - - if (strncmp((char *)hdr->ident, "\177ELF\001\001", 5)) { - fprintf(stderr, "Not a 32 bits ELF-LE file\n"); - return -EINVAL; - } - - if (!image->verbose) - return 0; - - fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", - module->elf_file, hdr->entry); - fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", - module->elf_file, hdr->phoff); - fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", - module->elf_file, hdr->shoff); - fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", - module->elf_file, hdr->phentsize); - fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", - module->elf_file, hdr->phnum); - fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", - module->elf_file, hdr->shentsize); - fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", - module->elf_file, hdr->shnum); - fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", - module->elf_file, hdr->shstrndx); - - return 0; -} - -int elf_is_rom(struct image *image, Elf32_Shdr *section) -{ - uint32_t start, end; - uint32_t base, size; - - start = section->vaddr; - end = section->vaddr + section->size; - - base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; - size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; - - if (start < base || start > base + size) - return 0; - if (end < base || end > base + size) - return 0; - return 1; -} - -static void elf_module_size(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, uint32_t lma, int index) -{ - switch (section->type) { - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) { - /* text */ - if (module->text_start > lma) - module->text_start = lma; - if (module->text_end < lma + section->size) - module->text_end = lma + section->size; - fprintf(stdout, "\tTEXT\t"); - } else { - /* initialized data, also calc the writable sections */ - if (module->data_start > lma) - module->data_start = lma; - if (module->data_end < lma + section->size) - module->data_end = lma + section->size; - - fprintf(stdout, "\tDATA\t"); - } - break; - case SHT_NOBITS: - /* bss */ - if (index == module->bss_index) { - /* updated the .bss segment */ - module->bss_start = section->vaddr; - module->bss_end = section->vaddr + section->size; - fprintf(stdout, "\tBSS\t"); - } else { - fprintf(stdout, "\tHEAP\t"); - } - break; - case SHT_NOTE: - fprintf(stdout, "\tNOTE\t"); - break; - default: - break; - } -} - -static void elf_module_size_reloc(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, int index) -{ - switch (section->type) { - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) { - /* text */ - module->text_start = 0; - module->text_end += section->size; - - fprintf(stdout, "\tTEXT\t"); - } else { - /* initialized data, also calc the writable sections */ - module->data_start = 0; - module->data_end += section->size; - - fprintf(stdout, "\tDATA\t"); - } - break; - case SHT_NOBITS: - /* bss */ - if (index == module->bss_index) { - /* updated the .bss segment */ - module->bss_start = section->vaddr; - module->bss_end = section->vaddr + section->size; - fprintf(stdout, "\tBSS\t"); - } else { - fprintf(stdout, "\tHEAP\t"); - } - break; - default: - break; - } -} - -static void elf_module_limits(struct image *image, struct manifest_module *module) -{ - Elf32_Shdr *section; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - uint32_t section_lma; - int i, j; - - module->text_start = 0xffffffff; - module->data_start = 0xffffffff; - module->bss_start = 0; - module->text_end = 0; - module->data_end = 0; - module->bss_end = 0; - - fprintf(stdout, " Found %d sections, listing valid sections......\n", - module->hdr.shnum); - - fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); - - /* iterate all sections and get size of segments */ - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* module bss can sometimes be missed */ - if (i != module->bss_index) { - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - if (elf_is_rom(image, section)) - continue; - } - /* check programs to get LMA */ - section_lma = section->vaddr; - for (j = 0; j < module->hdr.phnum; j++) { - if (section->vaddr == uncache_to_cache(image, module->prg[j].vaddr)) { - section_lma = uncache_to_cache(image, module->prg[j].paddr); - break; - } - } - - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8x\t0x%x", i, - section_lma, section->vaddr, - section->vaddr + section->size, section->size); - - /* text or data section */ - if (image->reloc) - elf_module_size_reloc(image, module, section, i); - else - elf_module_size(image, module, section, section_lma, i); - - /* section name */ - fprintf(stdout, "%s\n", module->strings + section->name); - } - - fprintf(stdout, "\n"); -} - -/* make sure no section overlap from any modules */ -int elf_validate_section(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, int index) -{ - struct manifest_module *m; - Elf32_Shdr *s; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i, j; - - /* for each module */ - for (i = 0; i < image->num_modules; i++) { - m = &image->module[i]; - - /* for each section */ - for (j = 0; j < m->hdr.shnum; j++) { - s = &m->section[j]; - - if (s == section) - continue; - - /* only check valid sections */ - if (!(s->flags & valid)) - continue; - - if (s->size == 0) - continue; - - /* is section start non overlapping ? */ - if (section->vaddr >= s->vaddr && - section->vaddr < - s->vaddr + s->size) { - goto err; - } - - /* is section end non overlapping ? */ - if (section->vaddr + section->size > s->vaddr && - section->vaddr + section->size <= - s->vaddr + s->size) { - goto err; - } - } - } - - return 0; - -err: - fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", - module->elf_file, index, m->elf_file, j); - fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", - section->vaddr, section->vaddr + section->size, - s->vaddr, s->vaddr + s->size); - return -EINVAL; -} - -/* make sure no section overlaps from any modules */ -int elf_validate_modules(struct image *image) -{ - struct manifest_module *module; - Elf32_Shdr *section; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i, j, ret; - - /* relocatable modules have no physical addresses until runtime */ - if (image->reloc) - return 0; - - /* for each module */ - for (i = 0; i < image->num_modules; i++) { - module = &image->module[i]; - - /* for each section */ - for (j = 0; j < module->hdr.shnum; j++) { - section = &module->section[j]; - - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - /* is section non overlapping ? */ - ret = elf_validate_section(image, module, section, j); - if (ret < 0) - return ret; - } - } - - return 0; -} - -int elf_find_section(const struct manifest_module *module, const char *name) -{ - const Elf32_Ehdr *hdr = &module->hdr; - const Elf32_Shdr *section, *s; - char *buffer; - size_t count; - int ret, i; - - section = &module->section[hdr->shstrndx]; - - /* alloc data data */ - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - /* read in section string data */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to string section %d\n", ret); - goto out; - } - - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - fprintf(stderr, "error: can't read string section %d\n", - -errno); - ret = -errno; - goto out; - } - - /* find section with name */ - for (i = 0; i < hdr->shnum; i++) { - s = &module->section[i]; - if (!strcmp(name, buffer + s->name)) { - ret = i; - goto out; - } - } - - fprintf(stderr, "warning: can't find section named '%s' in module %s\n", - name, module->elf_file); - ret = -EINVAL; - -out: - free(buffer); - return ret; -} - -int elf_read_section(const struct manifest_module *module, const char *section_name, - const Elf32_Shdr **dst_section, void **dst_buff) -{ - const Elf32_Shdr *section; - int section_index = -1; - int read; - - section_index = elf_find_section(module, section_name); - if (section_index < 0) { - fprintf(stderr, "error: section %s can't be found\n", - section_name); - return -EINVAL; - } - - section = &module->section[section_index]; - if (dst_section) - *dst_section = section; - - /* alloc buffer for section content */ - *dst_buff = calloc(1, section->size); - if (!*dst_buff) - return -ENOMEM; - - /* fill buffer with section content */ - fseek(module->fd, section->off, SEEK_SET); - read = fread(*dst_buff, 1, section->size, module->fd); - if (read != section->size) { - fprintf(stderr, - "error: can't read %s section %d\n", section_name, - -errno); - free(*dst_buff); - return -errno; - } - - return section->size; -} - -int elf_parse_module(struct image *image, int module_index, const char *name) -{ - struct manifest_module *module; - uint32_t rem; - int ret = 0; - - /* validate module index */ - if (module_index >= MAX_MODULES) { - fprintf(stderr, "error: too any modules\n"); - return -EINVAL; - } - - module = &image->module[module_index]; - - /* open the elf input file */ - module->fd = fopen(name, "rb"); - if (!module->fd) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - name, errno); - return -EINVAL; - } - module->elf_file = name; - - /* get file size */ - ret = get_file_size(module->fd, name, &module->file_size); - if (ret < 0) - goto hdr_err; - - /* read in elf header */ - ret = elf_read_hdr(image, module); - if (ret < 0) - goto hdr_err; - - /* read in programs */ - ret = elf_read_programs(image, module); - if (ret < 0) { - fprintf(stderr, "error: failed to read program sections %d\n", - ret); - goto hdr_err; - } - - /* read sections */ - ret = elf_read_sections(image, module, module_index); - if (ret < 0) { - fprintf(stderr, "error: failed to read base sections %d\n", - ret); - goto sec_err; - } - - /* check limits */ - elf_module_limits(image, module); - - elf_find_section(module, ""); - - fprintf(stdout, " module: input size %zu (0x%zx) bytes %d sections\n", - module->output_size, module->output_size, module->num_sections); - fprintf(stdout, " module: text %d (0x%x) bytes\n" - " data %d (0x%x) bytes\n" - " bss %d (0x%x) bytes\n\n", - module->text_size, module->text_size, - module->data_size, module->data_size, - module->bss_size, module->bss_size); - - /* file sizes round up to nearest page */ - module->text_file_size = module->text_end - module->text_start; - rem = module->text_file_size % MAN_PAGE_SIZE; - if (rem) - module->text_file_size += MAN_PAGE_SIZE - rem; - - /* data section */ - module->data_file_size = module->data_end - module->data_start; - rem = module->data_file_size % MAN_PAGE_SIZE; - if (rem) - module->data_file_size += MAN_PAGE_SIZE - rem; - - /* bss section */ - module->bss_file_size = module->bss_end - module->bss_start; - rem = module->bss_file_size % MAN_PAGE_SIZE; - if (rem) - module->bss_file_size += MAN_PAGE_SIZE - rem; - - return 0; - -sec_err: - free(module->prg); -hdr_err: - fclose(module->fd); - - return ret; -} - -void elf_free_module(struct image *image, int module_index) -{ - struct manifest_module *module = &image->module[module_index]; - - free(module->prg); - free(module->section); - free(module->strings); - fclose(module->fd); -} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 2b9a26ef5b41..61bc77bfca42 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -172,14 +172,4 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, int resign_image(struct image *image); int get_key_size(struct image *image); -int elf_parse_module(struct image *image, int module_index, const char *name); -void elf_free_module(struct image *image, int module_index); -int elf_is_rom(struct image *image, Elf32_Shdr *section); -int elf_validate_modules(struct image *image); -int elf_find_section(const struct manifest_module *module, const char *name); -int elf_read_section(const struct manifest_module *module, const char *name, - const Elf32_Shdr **dst_section, void **dst_buff); -int elf_validate_section(struct image *image, struct manifest_module *manifest_module, - Elf32_Shdr *section, int index); - #endif From d89b7d28f6367f1ec66c1d9f0e4d8ed5b9bc41c2 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Wed, 11 Jan 2023 10:41:50 +0800 Subject: [PATCH 342/350] ipc4: add google rtc AEC support for mtl Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 4a246dcf140d..b9decdefc4ac 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 23 +count = 24 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -597,3 +597,20 @@ count = 23 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "RTC_AEC" + uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" + affinity_mask = "0x3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "10" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0x8, 0x2, 0x2, 0x1, + 0, 0, 0x8, 0x2, 0x2, 0x4, + 1, 0, 0x8, 0x2, 0x2, 0x1] From ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 10:38:00 +0300 Subject: [PATCH 343/350] Congfig: Add TDFB to TGL, TGL-H, MTL, and LNL This patch enables load the of Time domain fixed beamformer (TDFB). Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 30e567b060ec..9c245b9ca8e9 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 23 +count = 24 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -553,3 +553,19 @@ count = 23 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index b9decdefc4ac..2d2742c91c83 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 24 +count = 25 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -614,3 +614,19 @@ count = 24 pin = [0, 0, 0x8, 0x2, 0x2, 0x1, 0, 0, 0x8, 0x2, 0x2, 0x4, 1, 0, 0x8, 0x2, 0x2, 0x1] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 15638424c9fe..320c1f3531e4 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -480,3 +480,19 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 04a0df56a861..61c3c01ad464 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -480,3 +480,19 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From b5f3ed9fa5186e91278eeb2cb77fd105f0a22e00 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 17:53:34 -0700 Subject: [PATCH 344/350] rimage: move everything down to subdir tools/rimage/, prepare move to sof Preparation to move everything back into the https://github.com/thesofproject/sof/ repo, see https://github.com/thesofproject/sof/issues/8178 for details. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .checkpatch.conf => tools/rimage/.checkpatch.conf | 0 {.github => tools/rimage/.github}/workflows/build.yml | 0 {.github => tools/rimage/.github}/workflows/cppcheck.yml | 0 {.github => tools/rimage/.github}/workflows/pull-request.yml | 0 .gitignore => tools/rimage/.gitignore | 0 .gitmodules => tools/rimage/.gitmodules | 0 CMakeLists.txt => tools/rimage/CMakeLists.txt | 0 LICENSE => tools/rimage/LICENSE | 0 README.md => tools/rimage/README.md | 0 {config => tools/rimage/config}/apl.toml | 0 {config => tools/rimage/config}/bdw.toml | 0 {config => tools/rimage/config}/bsw.toml | 0 {config => tools/rimage/config}/byt.toml | 0 {config => tools/rimage/config}/cht.toml | 0 {config => tools/rimage/config}/cnl.toml | 0 {config => tools/rimage/config}/hsw.toml | 0 {config => tools/rimage/config}/icl.toml | 0 {config => tools/rimage/config}/imx8.toml | 0 {config => tools/rimage/config}/imx8m.toml | 0 {config => tools/rimage/config}/imx8ulp.toml | 0 {config => tools/rimage/config}/imx8x.toml | 0 {config => tools/rimage/config}/jsl.toml | 0 {config => tools/rimage/config}/kbl.toml | 0 {config => tools/rimage/config}/lnl.toml | 0 {config => tools/rimage/config}/mt8186.toml | 0 {config => tools/rimage/config}/mt8188.toml | 0 {config => tools/rimage/config}/mt8195.toml | 0 {config => tools/rimage/config}/mtl.toml | 0 {config => tools/rimage/config}/rmb.toml | 0 {config => tools/rimage/config}/rn.toml | 0 {config => tools/rimage/config}/skl.toml | 0 {config => tools/rimage/config}/sue.toml | 0 {config => tools/rimage/config}/tgl-cavs.toml | 0 {config => tools/rimage/config}/tgl-h-cavs.toml | 0 {config => tools/rimage/config}/tgl-h.toml | 0 {config => tools/rimage/config}/tgl.toml | 0 {config => tools/rimage/config}/vangogh.toml | 0 {scripts => tools/rimage/scripts}/checkpatch.pl | 0 {scripts => tools/rimage/scripts}/const_structs.checkpatch | 0 {scripts => tools/rimage/scripts}/spelling.txt | 0 {src => tools/rimage/src}/adsp_config.c | 0 {src => tools/rimage/src}/cse.c | 0 {src => tools/rimage/src}/css.c | 0 {src => tools/rimage/src}/elf_file.c | 0 {src => tools/rimage/src}/ext_manifest.c | 0 {src => tools/rimage/src}/file_simple.c | 0 {src => tools/rimage/src}/file_utils.c | 0 {src => tools/rimage/src}/hash.c | 0 {src => tools/rimage/src}/include/rimage/adsp_config.h | 0 {src => tools/rimage/src}/include/rimage/cavs/cavs_ext_manifest.h | 0 {src => tools/rimage/src}/include/rimage/cse.h | 0 {src => tools/rimage/src}/include/rimage/css.h | 0 {src => tools/rimage/src}/include/rimage/elf.h | 0 {src => tools/rimage/src}/include/rimage/elf_file.h | 0 {src => tools/rimage/src}/include/rimage/ext_manifest_gen.h | 0 {src => tools/rimage/src}/include/rimage/file_utils.h | 0 {src => tools/rimage/src}/include/rimage/hash.h | 0 {src => tools/rimage/src}/include/rimage/manifest.h | 0 {src => tools/rimage/src}/include/rimage/misc_utils.h | 0 {src => tools/rimage/src}/include/rimage/module.h | 0 {src => tools/rimage/src}/include/rimage/plat_auth.h | 0 {src => tools/rimage/src}/include/rimage/rimage.h | 0 .../rimage/src}/include/rimage/sof/kernel/ext_manifest.h | 0 {src => tools/rimage/src}/include/rimage/sof/kernel/fw.h | 0 {src => tools/rimage/src}/include/rimage/sof/user/manifest.h | 0 {src => tools/rimage/src}/include/rimage/toml_utils.h | 0 {src => tools/rimage/src}/manifest.c | 0 {src => tools/rimage/src}/misc_utils.c | 0 {src => tools/rimage/src}/module.c | 0 {src => tools/rimage/src}/pkcs1_5.c | 0 {src => tools/rimage/src}/plat_auth.c | 0 {src => tools/rimage/src}/rimage.c | 0 {src => tools/rimage/src}/toml_utils.c | 0 tomlc99 => tools/rimage/tomlc99 | 0 74 files changed, 0 insertions(+), 0 deletions(-) rename .checkpatch.conf => tools/rimage/.checkpatch.conf (100%) rename {.github => tools/rimage/.github}/workflows/build.yml (100%) rename {.github => tools/rimage/.github}/workflows/cppcheck.yml (100%) rename {.github => tools/rimage/.github}/workflows/pull-request.yml (100%) rename .gitignore => tools/rimage/.gitignore (100%) rename .gitmodules => tools/rimage/.gitmodules (100%) rename CMakeLists.txt => tools/rimage/CMakeLists.txt (100%) rename LICENSE => tools/rimage/LICENSE (100%) rename README.md => tools/rimage/README.md (100%) rename {config => tools/rimage/config}/apl.toml (100%) rename {config => tools/rimage/config}/bdw.toml (100%) rename {config => tools/rimage/config}/bsw.toml (100%) rename {config => tools/rimage/config}/byt.toml (100%) rename {config => tools/rimage/config}/cht.toml (100%) rename {config => tools/rimage/config}/cnl.toml (100%) rename {config => tools/rimage/config}/hsw.toml (100%) rename {config => tools/rimage/config}/icl.toml (100%) rename {config => tools/rimage/config}/imx8.toml (100%) rename {config => tools/rimage/config}/imx8m.toml (100%) rename {config => tools/rimage/config}/imx8ulp.toml (100%) rename {config => tools/rimage/config}/imx8x.toml (100%) rename {config => tools/rimage/config}/jsl.toml (100%) rename {config => tools/rimage/config}/kbl.toml (100%) rename {config => tools/rimage/config}/lnl.toml (100%) rename {config => tools/rimage/config}/mt8186.toml (100%) rename {config => tools/rimage/config}/mt8188.toml (100%) rename {config => tools/rimage/config}/mt8195.toml (100%) rename {config => tools/rimage/config}/mtl.toml (100%) rename {config => tools/rimage/config}/rmb.toml (100%) rename {config => tools/rimage/config}/rn.toml (100%) rename {config => tools/rimage/config}/skl.toml (100%) rename {config => tools/rimage/config}/sue.toml (100%) rename {config => tools/rimage/config}/tgl-cavs.toml (100%) rename {config => tools/rimage/config}/tgl-h-cavs.toml (100%) rename {config => tools/rimage/config}/tgl-h.toml (100%) rename {config => tools/rimage/config}/tgl.toml (100%) rename {config => tools/rimage/config}/vangogh.toml (100%) rename {scripts => tools/rimage/scripts}/checkpatch.pl (100%) rename {scripts => tools/rimage/scripts}/const_structs.checkpatch (100%) rename {scripts => tools/rimage/scripts}/spelling.txt (100%) rename {src => tools/rimage/src}/adsp_config.c (100%) rename {src => tools/rimage/src}/cse.c (100%) rename {src => tools/rimage/src}/css.c (100%) rename {src => tools/rimage/src}/elf_file.c (100%) rename {src => tools/rimage/src}/ext_manifest.c (100%) rename {src => tools/rimage/src}/file_simple.c (100%) rename {src => tools/rimage/src}/file_utils.c (100%) rename {src => tools/rimage/src}/hash.c (100%) rename {src => tools/rimage/src}/include/rimage/adsp_config.h (100%) rename {src => tools/rimage/src}/include/rimage/cavs/cavs_ext_manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/cse.h (100%) rename {src => tools/rimage/src}/include/rimage/css.h (100%) rename {src => tools/rimage/src}/include/rimage/elf.h (100%) rename {src => tools/rimage/src}/include/rimage/elf_file.h (100%) rename {src => tools/rimage/src}/include/rimage/ext_manifest_gen.h (100%) rename {src => tools/rimage/src}/include/rimage/file_utils.h (100%) rename {src => tools/rimage/src}/include/rimage/hash.h (100%) rename {src => tools/rimage/src}/include/rimage/manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/misc_utils.h (100%) rename {src => tools/rimage/src}/include/rimage/module.h (100%) rename {src => tools/rimage/src}/include/rimage/plat_auth.h (100%) rename {src => tools/rimage/src}/include/rimage/rimage.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/kernel/ext_manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/kernel/fw.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/user/manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/toml_utils.h (100%) rename {src => tools/rimage/src}/manifest.c (100%) rename {src => tools/rimage/src}/misc_utils.c (100%) rename {src => tools/rimage/src}/module.c (100%) rename {src => tools/rimage/src}/pkcs1_5.c (100%) rename {src => tools/rimage/src}/plat_auth.c (100%) rename {src => tools/rimage/src}/rimage.c (100%) rename {src => tools/rimage/src}/toml_utils.c (100%) rename tomlc99 => tools/rimage/tomlc99 (100%) diff --git a/.checkpatch.conf b/tools/rimage/.checkpatch.conf similarity index 100% rename from .checkpatch.conf rename to tools/rimage/.checkpatch.conf diff --git a/.github/workflows/build.yml b/tools/rimage/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to tools/rimage/.github/workflows/build.yml diff --git a/.github/workflows/cppcheck.yml b/tools/rimage/.github/workflows/cppcheck.yml similarity index 100% rename from .github/workflows/cppcheck.yml rename to tools/rimage/.github/workflows/cppcheck.yml diff --git a/.github/workflows/pull-request.yml b/tools/rimage/.github/workflows/pull-request.yml similarity index 100% rename from .github/workflows/pull-request.yml rename to tools/rimage/.github/workflows/pull-request.yml diff --git a/.gitignore b/tools/rimage/.gitignore similarity index 100% rename from .gitignore rename to tools/rimage/.gitignore diff --git a/.gitmodules b/tools/rimage/.gitmodules similarity index 100% rename from .gitmodules rename to tools/rimage/.gitmodules diff --git a/CMakeLists.txt b/tools/rimage/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to tools/rimage/CMakeLists.txt diff --git a/LICENSE b/tools/rimage/LICENSE similarity index 100% rename from LICENSE rename to tools/rimage/LICENSE diff --git a/README.md b/tools/rimage/README.md similarity index 100% rename from README.md rename to tools/rimage/README.md diff --git a/config/apl.toml b/tools/rimage/config/apl.toml similarity index 100% rename from config/apl.toml rename to tools/rimage/config/apl.toml diff --git a/config/bdw.toml b/tools/rimage/config/bdw.toml similarity index 100% rename from config/bdw.toml rename to tools/rimage/config/bdw.toml diff --git a/config/bsw.toml b/tools/rimage/config/bsw.toml similarity index 100% rename from config/bsw.toml rename to tools/rimage/config/bsw.toml diff --git a/config/byt.toml b/tools/rimage/config/byt.toml similarity index 100% rename from config/byt.toml rename to tools/rimage/config/byt.toml diff --git a/config/cht.toml b/tools/rimage/config/cht.toml similarity index 100% rename from config/cht.toml rename to tools/rimage/config/cht.toml diff --git a/config/cnl.toml b/tools/rimage/config/cnl.toml similarity index 100% rename from config/cnl.toml rename to tools/rimage/config/cnl.toml diff --git a/config/hsw.toml b/tools/rimage/config/hsw.toml similarity index 100% rename from config/hsw.toml rename to tools/rimage/config/hsw.toml diff --git a/config/icl.toml b/tools/rimage/config/icl.toml similarity index 100% rename from config/icl.toml rename to tools/rimage/config/icl.toml diff --git a/config/imx8.toml b/tools/rimage/config/imx8.toml similarity index 100% rename from config/imx8.toml rename to tools/rimage/config/imx8.toml diff --git a/config/imx8m.toml b/tools/rimage/config/imx8m.toml similarity index 100% rename from config/imx8m.toml rename to tools/rimage/config/imx8m.toml diff --git a/config/imx8ulp.toml b/tools/rimage/config/imx8ulp.toml similarity index 100% rename from config/imx8ulp.toml rename to tools/rimage/config/imx8ulp.toml diff --git a/config/imx8x.toml b/tools/rimage/config/imx8x.toml similarity index 100% rename from config/imx8x.toml rename to tools/rimage/config/imx8x.toml diff --git a/config/jsl.toml b/tools/rimage/config/jsl.toml similarity index 100% rename from config/jsl.toml rename to tools/rimage/config/jsl.toml diff --git a/config/kbl.toml b/tools/rimage/config/kbl.toml similarity index 100% rename from config/kbl.toml rename to tools/rimage/config/kbl.toml diff --git a/config/lnl.toml b/tools/rimage/config/lnl.toml similarity index 100% rename from config/lnl.toml rename to tools/rimage/config/lnl.toml diff --git a/config/mt8186.toml b/tools/rimage/config/mt8186.toml similarity index 100% rename from config/mt8186.toml rename to tools/rimage/config/mt8186.toml diff --git a/config/mt8188.toml b/tools/rimage/config/mt8188.toml similarity index 100% rename from config/mt8188.toml rename to tools/rimage/config/mt8188.toml diff --git a/config/mt8195.toml b/tools/rimage/config/mt8195.toml similarity index 100% rename from config/mt8195.toml rename to tools/rimage/config/mt8195.toml diff --git a/config/mtl.toml b/tools/rimage/config/mtl.toml similarity index 100% rename from config/mtl.toml rename to tools/rimage/config/mtl.toml diff --git a/config/rmb.toml b/tools/rimage/config/rmb.toml similarity index 100% rename from config/rmb.toml rename to tools/rimage/config/rmb.toml diff --git a/config/rn.toml b/tools/rimage/config/rn.toml similarity index 100% rename from config/rn.toml rename to tools/rimage/config/rn.toml diff --git a/config/skl.toml b/tools/rimage/config/skl.toml similarity index 100% rename from config/skl.toml rename to tools/rimage/config/skl.toml diff --git a/config/sue.toml b/tools/rimage/config/sue.toml similarity index 100% rename from config/sue.toml rename to tools/rimage/config/sue.toml diff --git a/config/tgl-cavs.toml b/tools/rimage/config/tgl-cavs.toml similarity index 100% rename from config/tgl-cavs.toml rename to tools/rimage/config/tgl-cavs.toml diff --git a/config/tgl-h-cavs.toml b/tools/rimage/config/tgl-h-cavs.toml similarity index 100% rename from config/tgl-h-cavs.toml rename to tools/rimage/config/tgl-h-cavs.toml diff --git a/config/tgl-h.toml b/tools/rimage/config/tgl-h.toml similarity index 100% rename from config/tgl-h.toml rename to tools/rimage/config/tgl-h.toml diff --git a/config/tgl.toml b/tools/rimage/config/tgl.toml similarity index 100% rename from config/tgl.toml rename to tools/rimage/config/tgl.toml diff --git a/config/vangogh.toml b/tools/rimage/config/vangogh.toml similarity index 100% rename from config/vangogh.toml rename to tools/rimage/config/vangogh.toml diff --git a/scripts/checkpatch.pl b/tools/rimage/scripts/checkpatch.pl similarity index 100% rename from scripts/checkpatch.pl rename to tools/rimage/scripts/checkpatch.pl diff --git a/scripts/const_structs.checkpatch b/tools/rimage/scripts/const_structs.checkpatch similarity index 100% rename from scripts/const_structs.checkpatch rename to tools/rimage/scripts/const_structs.checkpatch diff --git a/scripts/spelling.txt b/tools/rimage/scripts/spelling.txt similarity index 100% rename from scripts/spelling.txt rename to tools/rimage/scripts/spelling.txt diff --git a/src/adsp_config.c b/tools/rimage/src/adsp_config.c similarity index 100% rename from src/adsp_config.c rename to tools/rimage/src/adsp_config.c diff --git a/src/cse.c b/tools/rimage/src/cse.c similarity index 100% rename from src/cse.c rename to tools/rimage/src/cse.c diff --git a/src/css.c b/tools/rimage/src/css.c similarity index 100% rename from src/css.c rename to tools/rimage/src/css.c diff --git a/src/elf_file.c b/tools/rimage/src/elf_file.c similarity index 100% rename from src/elf_file.c rename to tools/rimage/src/elf_file.c diff --git a/src/ext_manifest.c b/tools/rimage/src/ext_manifest.c similarity index 100% rename from src/ext_manifest.c rename to tools/rimage/src/ext_manifest.c diff --git a/src/file_simple.c b/tools/rimage/src/file_simple.c similarity index 100% rename from src/file_simple.c rename to tools/rimage/src/file_simple.c diff --git a/src/file_utils.c b/tools/rimage/src/file_utils.c similarity index 100% rename from src/file_utils.c rename to tools/rimage/src/file_utils.c diff --git a/src/hash.c b/tools/rimage/src/hash.c similarity index 100% rename from src/hash.c rename to tools/rimage/src/hash.c diff --git a/src/include/rimage/adsp_config.h b/tools/rimage/src/include/rimage/adsp_config.h similarity index 100% rename from src/include/rimage/adsp_config.h rename to tools/rimage/src/include/rimage/adsp_config.h diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/tools/rimage/src/include/rimage/cavs/cavs_ext_manifest.h similarity index 100% rename from src/include/rimage/cavs/cavs_ext_manifest.h rename to tools/rimage/src/include/rimage/cavs/cavs_ext_manifest.h diff --git a/src/include/rimage/cse.h b/tools/rimage/src/include/rimage/cse.h similarity index 100% rename from src/include/rimage/cse.h rename to tools/rimage/src/include/rimage/cse.h diff --git a/src/include/rimage/css.h b/tools/rimage/src/include/rimage/css.h similarity index 100% rename from src/include/rimage/css.h rename to tools/rimage/src/include/rimage/css.h diff --git a/src/include/rimage/elf.h b/tools/rimage/src/include/rimage/elf.h similarity index 100% rename from src/include/rimage/elf.h rename to tools/rimage/src/include/rimage/elf.h diff --git a/src/include/rimage/elf_file.h b/tools/rimage/src/include/rimage/elf_file.h similarity index 100% rename from src/include/rimage/elf_file.h rename to tools/rimage/src/include/rimage/elf_file.h diff --git a/src/include/rimage/ext_manifest_gen.h b/tools/rimage/src/include/rimage/ext_manifest_gen.h similarity index 100% rename from src/include/rimage/ext_manifest_gen.h rename to tools/rimage/src/include/rimage/ext_manifest_gen.h diff --git a/src/include/rimage/file_utils.h b/tools/rimage/src/include/rimage/file_utils.h similarity index 100% rename from src/include/rimage/file_utils.h rename to tools/rimage/src/include/rimage/file_utils.h diff --git a/src/include/rimage/hash.h b/tools/rimage/src/include/rimage/hash.h similarity index 100% rename from src/include/rimage/hash.h rename to tools/rimage/src/include/rimage/hash.h diff --git a/src/include/rimage/manifest.h b/tools/rimage/src/include/rimage/manifest.h similarity index 100% rename from src/include/rimage/manifest.h rename to tools/rimage/src/include/rimage/manifest.h diff --git a/src/include/rimage/misc_utils.h b/tools/rimage/src/include/rimage/misc_utils.h similarity index 100% rename from src/include/rimage/misc_utils.h rename to tools/rimage/src/include/rimage/misc_utils.h diff --git a/src/include/rimage/module.h b/tools/rimage/src/include/rimage/module.h similarity index 100% rename from src/include/rimage/module.h rename to tools/rimage/src/include/rimage/module.h diff --git a/src/include/rimage/plat_auth.h b/tools/rimage/src/include/rimage/plat_auth.h similarity index 100% rename from src/include/rimage/plat_auth.h rename to tools/rimage/src/include/rimage/plat_auth.h diff --git a/src/include/rimage/rimage.h b/tools/rimage/src/include/rimage/rimage.h similarity index 100% rename from src/include/rimage/rimage.h rename to tools/rimage/src/include/rimage/rimage.h diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/tools/rimage/src/include/rimage/sof/kernel/ext_manifest.h similarity index 100% rename from src/include/rimage/sof/kernel/ext_manifest.h rename to tools/rimage/src/include/rimage/sof/kernel/ext_manifest.h diff --git a/src/include/rimage/sof/kernel/fw.h b/tools/rimage/src/include/rimage/sof/kernel/fw.h similarity index 100% rename from src/include/rimage/sof/kernel/fw.h rename to tools/rimage/src/include/rimage/sof/kernel/fw.h diff --git a/src/include/rimage/sof/user/manifest.h b/tools/rimage/src/include/rimage/sof/user/manifest.h similarity index 100% rename from src/include/rimage/sof/user/manifest.h rename to tools/rimage/src/include/rimage/sof/user/manifest.h diff --git a/src/include/rimage/toml_utils.h b/tools/rimage/src/include/rimage/toml_utils.h similarity index 100% rename from src/include/rimage/toml_utils.h rename to tools/rimage/src/include/rimage/toml_utils.h diff --git a/src/manifest.c b/tools/rimage/src/manifest.c similarity index 100% rename from src/manifest.c rename to tools/rimage/src/manifest.c diff --git a/src/misc_utils.c b/tools/rimage/src/misc_utils.c similarity index 100% rename from src/misc_utils.c rename to tools/rimage/src/misc_utils.c diff --git a/src/module.c b/tools/rimage/src/module.c similarity index 100% rename from src/module.c rename to tools/rimage/src/module.c diff --git a/src/pkcs1_5.c b/tools/rimage/src/pkcs1_5.c similarity index 100% rename from src/pkcs1_5.c rename to tools/rimage/src/pkcs1_5.c diff --git a/src/plat_auth.c b/tools/rimage/src/plat_auth.c similarity index 100% rename from src/plat_auth.c rename to tools/rimage/src/plat_auth.c diff --git a/src/rimage.c b/tools/rimage/src/rimage.c similarity index 100% rename from src/rimage.c rename to tools/rimage/src/rimage.c diff --git a/src/toml_utils.c b/tools/rimage/src/toml_utils.c similarity index 100% rename from src/toml_utils.c rename to tools/rimage/src/toml_utils.c diff --git a/tomlc99 b/tools/rimage/tomlc99 similarity index 100% rename from tomlc99 rename to tools/rimage/tomlc99 From 99206de401e6c42ae1d07b61b0e2028ea24a74a8 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 5 Oct 2023 10:45:29 -0700 Subject: [PATCH 345/350] Clean just inherited tools/rimage/.gitmodules file (for tomlc99) .gitmodules files have no effect unless they're at the top-level. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/.gitmodules | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tools/rimage/.gitmodules diff --git a/tools/rimage/.gitmodules b/tools/rimage/.gitmodules deleted file mode 100644 index 5ade8be2a063..000000000000 --- a/tools/rimage/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "tomlc99"] - path = tomlc99 - url = https://github.com/thesofproject/tomlc99.git - branch = master From 9b31875318a2640d1047f26976fe402b0bb68388 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 18:05:23 -0700 Subject: [PATCH 346/350] Add new sof/tools/rimage/tomlc99 submodule to west.yml too Add it both as a git submodule and west submodule to minimize disruption. The current focus is on rimage and that's a dramatic enough change; one problem at at time. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- west.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e90e99d134bc..edc522eab8c0 100644 --- a/west.yml +++ b/west.yml @@ -38,11 +38,20 @@ manifest: path: sof/rimage revision: ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a - - name: tomlc99 + # To be removed in the next commits + - name: tomlc99-old-location repo-path: tomlc99 path: sof/rimage/tomlc99 revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 + # West convenience for Zephyr people who forgot --recursive when + # cloning sof.git. This adds the burden of keeping both tomlc99 + # SHA1s synchronized but in practice it barely ever moves. + - name: tomlc99 + repo-path: tomlc99 + path: sof/tools/rimage/tomlc99 + revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 + - name: zephyr repo-path: zephyr revision: 8c4eec7ac6e37be89af89e021c6f5c96e1ac1e0a From f55338a985acf0d54aaa1c93a784217492291ea1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 16:38:36 -0700 Subject: [PATCH 347/350] Switch Zephyr build to new sof/tools/rimage location Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- scripts/xtensa-build-zephyr.py | 15 ++++++--------- zephyr/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 5f8cdd5ce361..0d8e28921c3d 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -512,7 +512,7 @@ def clean_staging(platform): # for now we must stick to `sof/rimage/[tomlc99]` for # backwards-compatibility with XTOS platforms and git submodules, see more # detailed comments in west.yml -RIMAGE_SOURCE_DIR = west_top / "sof" / "rimage" +RIMAGE_SOURCE_DIR = west_top / "sof" / "tools" / "rimage" def rimage_west_configuration(platform_dict, dest_dir): @@ -563,14 +563,11 @@ def rimage_west_configuration(platform_dict, dest_dir): def build_rimage(): - # Detect non-west rimage duplicates, example: git submdule - # SOF_TOP/rimage = sof2/rimage - nested_rimage = pathlib.Path(SOF_TOP, "rimage") - if nested_rimage.is_dir() and not nested_rimage.samefile(RIMAGE_SOURCE_DIR): - raise RuntimeError( - f"""Two rimage source directories found. - Move non-west {nested_rimage} out of west workspace {west_top}. - See output of 'west list'.""" + old_rimage_loc = SOF_TOP / "rimage" + # Don't warn on empty directories + if ( old_rimage_loc / "CMakeLists.txt" ).exists(): + warnings.warn(f"""{old_rimage_loc} is now ignored, + new location is {RIMAGE_SOURCE_DIR}""" ) rimage_dir_name = RIMAGE_BUILD_DIR.name # CMake build rimage module diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a618f966eee6..a087b216217d 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -58,7 +58,7 @@ set(SOF_IPC_PATH "${SOF_SRC_PATH}/ipc") set(SOF_DEBUG_PATH "${SOF_SRC_PATH}/debug") set(SOF_MATH_PATH "${SOF_SRC_PATH}/math") set(SOF_TRACE_PATH "${SOF_SRC_PATH}/trace") -set(RIMAGE_TOP ${sof_top_dir}/rimage) +set(RIMAGE_TOP ${sof_top_dir}/tools/rimage) # Save path to rimage configuration files in cmake cache for later use by # rimage during the "west sign" stage From 157457c1273927976212590804e0acb6659d6bd1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 17:36:55 -0700 Subject: [PATCH 348/350] Switch smex and sof-logger to new sof/tools/rimage location Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- smex/CMakeLists.txt | 2 +- tools/logger/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smex/CMakeLists.txt b/smex/CMakeLists.txt index 5d198832f472..23eeb3a775f3 100644 --- a/smex/CMakeLists.txt +++ b/smex/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_options(smex PRIVATE target_include_directories(smex PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include" + "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include" ) # TODO: smex should not need RTOS headers: FIX. diff --git a/tools/logger/CMakeLists.txt b/tools/logger/CMakeLists.txt index 0c7b2d8d914b..271f54e559c9 100644 --- a/tools/logger/CMakeLists.txt +++ b/tools/logger/CMakeLists.txt @@ -35,7 +35,7 @@ target_compile_options(sof-logger PRIVATE target_include_directories(sof-logger PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include" + "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include" "${SOF_ROOT_SOURCE_DIRECTORY}" ) From 98ee39f44cad36e582d53d50babb5890f5802196 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 16:38:36 -0700 Subject: [PATCH 349/350] cmake: switch XTOS build to sof/tools/rimage Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- scripts/cmake/git-submodules.cmake | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b0ddd8ddd2..075d1a33c636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ project(SOF C ASM) set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}") set(SOF_ROOT_BINARY_DIRECTORY "${PROJECT_BINARY_DIR}") -set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/rimage") +set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/tools/rimage") # check git hooks include(scripts/cmake/git-hooks.cmake) diff --git a/scripts/cmake/git-submodules.cmake b/scripts/cmake/git-submodules.cmake index 5b486e4af87c..56c559491b90 100644 --- a/scripts/cmake/git-submodules.cmake +++ b/scripts/cmake/git-submodules.cmake @@ -1,11 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause -find_package(Git) -set(RIMAGE_CMAKE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/CMakeLists.txt") +set(RIMAGE_SUBMODULE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage") +if(EXISTS "${RIMAGE_SUBMODULE}/CMakeLists.txt") + message(WARNING + "${RIMAGE_SUBMODULE} is deprecated and ignored" + ) +endif() +find_package(Git) +set(TOMLC99_MAKE "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/tomlc99/Makefile") if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") - if(EXISTS "${RIMAGE_CMAKE}") + if(EXISTS "${TOMLC99_MAKE}") # As incredible as it sounds, some people run neither # "git status" nor "git diff" every few minutes and not @@ -36,10 +42,10 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") NOT CONFIG_LIBRARY) message(FATAL_ERROR -"${RIMAGE_CMAKE} not found. You should have used 'git clone --recursive'. \ +"${TOMLC99_MAKE} not found. You should have used 'git clone --recursive'. \ To fix this existing git clone run: -git submodule update --init --merge --recursive +git submodule update --init --merge tools/rimage/tomlc99 ") - endif() # rimage/CMakeLists.txt + endif() # tomlc99/Makefile endif() # .git/ From e330fb4ec727c3a060ad6b1fb6e8c21a4afe7357 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 18:05:23 -0700 Subject: [PATCH 350/350] Delete old rimage submodule and old rimage west module Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .gitmodules | 22 ---------------------- rimage | 1 - west.yml | 11 ----------- 3 files changed, 34 deletions(-) delete mode 160000 rimage diff --git a/.gitmodules b/.gitmodules index 62ccbac18f36..99bed093e833 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,25 +1,3 @@ - -# Old, independent rimage submodule. To be removed. -[submodule "rimage"] - path = rimage -# This is a _relative_ submodule URL. In some use cases it's better than -# an _absolute_ submodule URL, in other cases it's not. One size does -# unfortunately not fit all. -# -# Among other pages, http://blog.tremily.us/posts/Relative_submodules/ -# has a good comparison -# -# If you use Zephyr you must also look at the comments in sof/west.yml. -# -# If you want to fork or mirror sof.git _without_ doing the same for -# rimage.git then your automation may want you to change and git commit -# an absolute URL in your branch. No need to git commit for interactive -# use; a local and temporary edit of this file is enough for interactive -# use because .gitmodules is used only once to --init[ialize] -# .git/config the first time. Then .gitmodules is never used again after -# cloning. - url = ../rimage - # This is required for non-Zephyr ("XTOS") configurations. Zephyr # configs also get it from sof/west.yml which adds the burden of keeping # both tomlc99 SHA1s synchronized but in practice this barely ever moves. diff --git a/rimage b/rimage deleted file mode 160000 index ac487e09ca5b..000000000000 --- a/rimage +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a diff --git a/west.yml b/west.yml index edc522eab8c0..876ae1b41df5 100644 --- a/west.yml +++ b/west.yml @@ -33,17 +33,6 @@ manifest: # https://github.com/zephyrproject-rtos/zephyr/issues/58212 projects: - - name: rimage - repo-path: rimage - path: sof/rimage - revision: ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a - - # To be removed in the next commits - - name: tomlc99-old-location - repo-path: tomlc99 - path: sof/rimage/tomlc99 - revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 - # West convenience for Zephyr people who forgot --recursive when # cloning sof.git. This adds the burden of keeping both tomlc99 # SHA1s synchronized but in practice it barely ever moves.