mirror of https://github.com/thesofproject/sof.git
184 lines
4.6 KiB
Plaintext
184 lines
4.6 KiB
Plaintext
|
|
AC_PREREQ([2.69])
|
|
AC_INIT([Reef],[m4_esyscmd(./git-version.sh), m4_esyscmd(rm -f .build)],[sound-open-firmware@alsa-project.org])
|
|
AC_CONFIG_SRCDIR([src/init/init.c])
|
|
AC_CONFIG_HEADERS([src/include/config.h])
|
|
AC_CONFIG_MACRO_DIRS([m4])
|
|
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability subdir-objects silent-rules color-tests dist-xz tar-ustar])
|
|
|
|
# Initialize maintainer mode
|
|
AM_MAINTAINER_MODE([enable])
|
|
|
|
# get version info from git
|
|
m4_define(reef_major, `cat .version | cut -dv -f2 | cut -d. -f1`)
|
|
m4_define(reef_minor, `cat .version | cut -d. -f2 | cut -d- -f1`)
|
|
AC_DEFINE_UNQUOTED([REEF_MAJOR], reef_major, [Reef major version])
|
|
AC_DEFINE_UNQUOTED([REEF_MINOR], reef_minor, [Reef minor version])
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
# General compiler flags
|
|
CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -fno-inline-functions -nostdlib -Wmissing-prototypes"
|
|
|
|
# Cross compiler tool libgcc and headers
|
|
AC_ARG_WITH([root-dir],
|
|
AS_HELP_STRING([--with-root-dir], [Specify location of cross gcc libraries and headers]),
|
|
[], [with_root_dir=no])
|
|
AS_IF([test "x$with_root_dir" = xno],
|
|
AC_MSG_ERROR([Please specify cross compiler root header directory]),
|
|
[ROOT_DIR=$with_root_dir])
|
|
AC_SUBST(ROOT_DIR)
|
|
|
|
# Architecture support
|
|
AC_ARG_WITH([arch],
|
|
AS_HELP_STRING([--with-arch], [Specify DSP architecture]),
|
|
[], [with_arch=no])
|
|
|
|
case "$with_arch" in
|
|
xtensa*)
|
|
AM_CONDITIONAL(BUILD_XTENSA, true)
|
|
|
|
ARCH_CFLAGS="-mtext-section-literals"
|
|
AC_SUBST(ARCH_CFLAGS)
|
|
|
|
ARCH_LDFLAGS="-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static"
|
|
AC_SUBST(XTENSA_LDFLAGS)
|
|
|
|
# extra CFLAGS defined here otherwise configure working gcc tests fails.
|
|
CFLAGS="${CFLAGS:+$CFLAGS }-mlongcalls"
|
|
LDFLAGS="${LDFLAGS:+$LDFLAGS }-nostdlib"
|
|
|
|
#ARCH_ASFLAGS=""
|
|
AC_SUBST(ARCH_ASFLAGS)
|
|
|
|
ARCH="xtensa"
|
|
AC_SUBST(ARCH)
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR([DSP architecture not specified])
|
|
;;
|
|
esac
|
|
|
|
|
|
# Platform support
|
|
AC_ARG_WITH([platform],
|
|
AS_HELP_STRING([--with-platform], [Specify Host Platform]),
|
|
[], [with_platform=no])
|
|
|
|
case "$with_platform" in
|
|
baytrail*)
|
|
AM_CONDITIONAL(BUILD_BAYTRAIL, true)
|
|
AM_CONDITIONAL(BUILD_CHERRYTRAIL, false)
|
|
AM_CONDITIONAL(BUILD_HASWELL, false)
|
|
AM_CONDITIONAL(BUILD_BROADWELL, false)
|
|
AM_CONDITIONAL(BUILD_BROXTON, false)
|
|
|
|
PLATFORM_LDSCRIPT="baytrail.x"
|
|
AC_SUBST(PLATFORM_LDSCRIPT)
|
|
|
|
PLATFORM="baytrail"
|
|
AC_SUBST(PLATFORM)
|
|
|
|
FW_NAME="byt"
|
|
AC_SUBST(FW_NAME)
|
|
|
|
XTENSA_CORE="hifi2_std"
|
|
AC_SUBST(XTENSA_CORE)
|
|
|
|
AC_DEFINE([CONFIG_BAYTRAIL], [1], [Configure for Baytrail])
|
|
;;
|
|
cherrytrail*)
|
|
AM_CONDITIONAL(BUILD_BAYTRAIL, false)
|
|
AM_CONDITIONAL(BUILD_CHERRYTRAIL, true)
|
|
AM_CONDITIONAL(BUILD_HASWELL, false)
|
|
AM_CONDITIONAL(BUILD_BROADWELL, false)
|
|
AM_CONDITIONAL(BUILD_BROXTON, false)
|
|
|
|
PLATFORM_LDSCRIPT="baytrail.x"
|
|
AC_SUBST(PLATFORM_LDSCRIPT)
|
|
|
|
PLATFORM="baytrail"
|
|
AC_SUBST(PLATFORM)
|
|
|
|
FW_NAME="cht"
|
|
AC_SUBST(FW_NAME)
|
|
|
|
XTENSA_CORE="hifi2_std"
|
|
AC_SUBST(XTENSA_CORE)
|
|
|
|
AC_DEFINE([CONFIG_CHERRYTRAIL], [1], [Configure for Cherrytrail])
|
|
;;
|
|
*)
|
|
AC_MSG_ERROR([Host platform not specified])
|
|
;;
|
|
esac
|
|
|
|
# DSP core support (Optional)
|
|
AC_ARG_WITH([dsp-core],
|
|
AS_HELP_STRING([--with-dsp-core], [Specify DSP Core]),
|
|
[], [with_dsp_core=no])
|
|
|
|
case "$with_dsp_core" in
|
|
CHT_audio_hifiep*)
|
|
# BXT/CHT DSP Core
|
|
XTENSA_CORE="CHT_audio_hifiep"
|
|
AC_SUBST(XTENSA_CORE)
|
|
;;
|
|
|
|
esac
|
|
|
|
# Test after CFLAGS set othewise test of cross compiler fails.
|
|
AM_PROG_AS
|
|
AM_PROG_AR
|
|
AC_PROG_CC
|
|
LT_INIT
|
|
AC_CHECK_TOOL([OBJCOPY], [objcopy], [])
|
|
AC_CHECK_TOOL([OBJDUMP], [objdump], [])
|
|
|
|
AM_EXTRA_RECURSIVE_TARGETS([bin])
|
|
|
|
AM_EXTRA_RECURSIVE_TARGETS([vminstall])
|
|
|
|
AC_CONFIG_FILES([
|
|
Makefile
|
|
src/Makefile
|
|
src/tasks/Makefile
|
|
src/init/Makefile
|
|
src/arch/Makefile
|
|
src/arch/xtensa/Makefile
|
|
src/arch/xtensa/include/Makefile
|
|
src/arch/xtensa/hal/Makefile
|
|
src/arch/xtensa/xtos/Makefile
|
|
src/audio/Makefile
|
|
src/math/Makefile
|
|
src/drivers/Makefile
|
|
src/include/Makefile
|
|
src/include/reef/Makefile
|
|
src/include/reef/audio/Makefile
|
|
src/include/uapi/Makefile
|
|
src/ipc/Makefile
|
|
src/lib/Makefile
|
|
src/platform/Makefile
|
|
src/platform/baytrail/Makefile
|
|
src/platform/baytrail/include/Makefile
|
|
src/platform/baytrail/include/platform/Makefile
|
|
src/platform/baytrail/include/xtensa/Makefile
|
|
src/platform/baytrail/include/xtensa/config/Makefile
|
|
])
|
|
AC_OUTPUT
|
|
|
|
echo "
|
|
---{ $PACKAGE_NAME $VERSION }---
|
|
|
|
Target Architecture: ${ARCH}
|
|
Target Platform: ${PLATFORM}
|
|
Target Core: ${XTENSA_CORE}
|
|
|
|
Compiler: ${CC}
|
|
CFLAGS: ${CFLAGS}
|
|
LDFLAGS: ${LDFLAGS}
|
|
ARCH_CFLAGS: ${ARCH_CFLAGS}
|
|
ARCH_LDFLAGS: ${ARCH_LDFLAGS}
|
|
"
|
|
|