@@ -19,7 +19,7 @@ AC_DEFINE_UNQUOTED([REEF_MICRO], reef_micro, [Reef micro version])
1919AC_CANONICAL_HOST
2020
2121# General compiler flags
22- CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -fno-inline-functions -nostdlib - Wmissing-prototypes"
22+ CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes"
2323
2424# General assembler flags
2525ASFLAGS="-DASSEMBLY"
@@ -37,6 +37,13 @@ if test "$have_library" = "yes"; then
3737fi
3838AM_CONDITIONAL(BUILD_LIB, test "$have_library" = "yes")
3939
40+ # check if we are building tools
41+ AC_ARG_ENABLE ( rimage , [ AS_HELP_STRING ( [ --enable-rimage] ,[ build rimage tool] ) ] , have_rimage=$enableval , have_rimage=no )
42+ if test "$have_rimage" = "yes"; then
43+ AC_DEFINE ( [ CONFIG_RIMAGE] , [ 1] , [ Configure to build rimage] )
44+ fi
45+ AM_CONDITIONAL(BUILD_RIMAGE, test "$have_rimage" = "yes")
46+
4047# Architecture support
4148AC_ARG_WITH ( [ arch] ,
4249 AS_HELP_STRING ( [ --with-arch] , [ Specify DSP architecture] ) ,
@@ -52,7 +59,7 @@ case "$with_arch" in
5259 AC_SUBST ( XTENSA_LDFLAGS )
5360
5461 # extra CFLAGS defined here otherwise configure working gcc tests fails.
55- CFLAGS="${CFLAGS:+$CFLAGS }-mlongcalls"
62+ CFLAGS="${CFLAGS:+$CFLAGS }-fno-inline-functions -nostdlib - mlongcalls"
5663 LDFLAGS="${LDFLAGS:+$LDFLAGS }-nostdlib"
5764
5865 # ARCH_ASFLAGS=""
@@ -79,7 +86,9 @@ case "$with_arch" in
7986 AC_SUBST ( ARCH )
8087 ;;
8188 *)
82- AC_MSG_ERROR ( [ DSP architecture not specified] )
89+ if test "$have_rimage" = "no"; then
90+ AC_MSG_ERROR ( [ DSP architecture not specified] )
91+ fi
8392 ;;
8493esac
8594
@@ -197,11 +206,13 @@ case "$with_platform" in
197206 AC_DEFINE ( [ CONFIG_DMA_GW] , [ 1] , [ Configure DMA Gateway] )
198207 ;;
199208 *)
200- if test "$ARCH" = "host"; then
201- PLATFORM="host"
202- AC_SUBST ( PLATFORM )
203- else
204- AC_MSG_ERROR ( [ Host platform not specified] )
209+ if test "$have_rimage" = "no"; then
210+ if test "$ARCH" = "host"; then
211+ PLATFORM="host"
212+ AC_SUBST ( PLATFORM )
213+ else
214+ AC_MSG_ERROR ( [ Host platform not specified] )
215+ fi
205216 fi
206217 ;;
207218esac
@@ -315,12 +326,26 @@ LT_INIT
315326AC_CHECK_TOOL ( [ OBJCOPY] , [ objcopy] , [ ] )
316327AC_CHECK_TOOL ( [ OBJDUMP] , [ objdump] , [ ] )
317328
329+ # Check for openssl - used by rimage
330+ AC_CHECK_LIB ( [ crypto] , [ OPENSSL_config] , , [ have_openssl="no"] )
331+ if test "$have_rimage" = "yes"; then
332+ if test "$have_openssl" = "no"; then
333+ AC_MSG_ERROR ( [ Need OpenSSL libcrypto for rimage code signing] )
334+ fi
335+ fi
336+
337+ PEM_KEY_PREFIX="/usr/local/share/rimage"
338+ AC_DEFINE_UNQUOTED ( [ PEM_KEY_PREFIX] , [ "$PEM_KEY_PREFIX"] , [ "Path for PEM keys"] )
339+ AC_SUBST ( PEM_KEY_PREFIX )
340+
318341AM_EXTRA_RECURSIVE_TARGETS([ bin] )
319342
320343AM_EXTRA_RECURSIVE_TARGETS([ vminstall] )
321344
322345AC_CONFIG_FILES ( [
323346 Makefile
347+ rimage/Makefile
348+ rimage/keys/Makefile
324349 src/Makefile
325350 src/tasks/Makefile
326351 src/init/Makefile
@@ -380,6 +405,7 @@ echo "
380405Target Architecture: ${ARCH}
381406Target Platform: ${PLATFORM}
382407Target Core: ${XTENSA_CORE}
408+ PEM: ${PEM_KEY_PREFIX}
383409
384410Compiler: ${CC}
385411CFLAGS: ${CFLAGS}
0 commit comments