Skip to content

Commit 0d33e87

Browse files
committed
Enable autotools to build rimage
This adds the necessary configuration files to enable autotools for configure/make files generation. Signed-off-by: Daniel Leung <danielcp@gmail.com>
1 parent 41cba2f commit 0d33e87

3 files changed

Lines changed: 104 additions & 0 deletions

File tree

Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
#
3+
# Copyright(c) 2019 Intel Corporation. All rights reserved.
4+
5+
EXTRA_DIST = README
6+
SUBDIRS = src

configure.ac

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
#
3+
# Copyright(c) 2019 Intel Corporation. All rights reserved.
4+
5+
AC_PREREQ([2.69])
6+
AC_INIT([rimage],[1.0])
7+
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
8+
AC_CONFIG_SRCDIR([src/rimage.c])
9+
AC_CONFIG_HEADERS([config.h])
10+
AC_CONFIG_FILES([Makefile
11+
src/Makefile])
12+
13+
# Checks for programs.
14+
AC_PROG_CC
15+
16+
# Checks for libraries.
17+
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
18+
19+
# Checks for header files.
20+
AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h])
21+
22+
# Checks for typedefs, structures, and compiler characteristics.
23+
AC_C_INLINE
24+
AC_TYPE_INT16_T
25+
AC_TYPE_INT32_T
26+
AC_TYPE_INT64_T
27+
AC_TYPE_INT8_T
28+
AC_TYPE_SIZE_T
29+
AC_TYPE_UINT16_T
30+
AC_TYPE_UINT32_T
31+
AC_TYPE_UINT64_T
32+
AC_TYPE_UINT8_T
33+
34+
# Checks for library functions.
35+
AC_CHECK_FUNCS([gettimeofday memset])
36+
37+
# Where SOF header files are
38+
AC_ARG_WITH(sof-source,
39+
AS_HELP_STRING([--with-sof-source=DIR],[where the root of SOF source is]),
40+
[ SOF_SOURCE_DIR="$with_sof_source/src" ],)
41+
AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"])
42+
43+
if test "x$SOF_SOURCE_DIR" != "x"; then
44+
SOF_INCLUDES="-I$SOF_SOURCE_DIR/include"
45+
CFLAGS="$CFLAGS $SOF_INCLUDES"
46+
CPPFLAGS="$CPPFLAGS $SOF_INCLUDES"
47+
AC_CHECK_HEADERS(ipc/header.h, ,
48+
[ AC_MSG_ERROR([Unable to find ipc/header.h. Aborting.]) ])
49+
AC_CHECK_HEADERS(ipc/info.h, ,
50+
[ AC_MSG_ERROR([Unable to find ipc/info.h. Aborting.]) ])
51+
AC_CHECK_HEADERS(ipc/stream.h, ,
52+
[ AC_MSG_ERROR([Unable to find ipc/stream.h. Aborting.]) ])
53+
AC_CHECK_HEADERS(kernel/fw.h, ,
54+
[ AC_MSG_ERROR([Unable to find kernel/fw.h. Aborting.]) ])
55+
AC_CHECK_HEADERS(sof/logs/file_format.h, ,
56+
[ AC_MSG_ERROR([Unable to find sof/logs/file_format.h. Aborting.]) ])
57+
AC_CHECK_HEADERS(user/manifest.h, ,
58+
[ AC_MSG_ERROR([Unable to find user/manifest.h. Aborting.]) ])
59+
fi
60+
61+
# Generate outputs
62+
AC_OUTPUT

src/Makefile.am

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
#
3+
# Copyright(c) 2019 Intel Corporation. All rights reserved.
4+
5+
bin_PROGRAMS = rimage
6+
7+
rimage_SOURCES = \
8+
cse.c \
9+
css.c \
10+
elf.c \
11+
file_simple.c \
12+
hash.c \
13+
man_apl.c \
14+
man_cnl.c \
15+
manifest.c \
16+
man_kbl.c \
17+
man_sue.c \
18+
man_tgl.c \
19+
pkcs1_5.c \
20+
plat_auth.c \
21+
rimage.c
22+
23+
if USE_PROVIDED_SOF_HEADER
24+
PROVIDED_SOF_HEADER = -Iinclude/sof
25+
EXTRA_SOF_MACROS =
26+
else
27+
EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H
28+
endif
29+
30+
rimage_CFLAGS = \
31+
$(PROVIDED_SOF_HEADER) -Iinclude/rimage \
32+
$(EXTRA_SOF_MACROS) \
33+
-O2 -g -Wall -Werror -Wl,-EL \
34+
-Wmissing-prototypes -Wimplicit-fallthrough=3
35+
36+
rimage_LDADD = -lcrypto

0 commit comments

Comments
 (0)