Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 1 | AC_PREREQ([2.69]) |
Liam Girdwood | 6bb3783 | 2018-01-10 20:43:25 +0000 | [diff] [blame^] | 2 | AC_INIT([sof],[m4_esyscmd(./version.sh)],[sound-open-firmware@alsa-project.org]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 3 | AC_CONFIG_SRCDIR([src/init/init.c]) |
| 4 | AC_CONFIG_HEADERS([src/include/config.h]) |
| 5 | AC_CONFIG_MACRO_DIRS([m4]) |
| 6 | AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability subdir-objects silent-rules color-tests dist-xz tar-ustar]) |
| 7 | |
| 8 | # Initialize maintainer mode |
| 9 | AM_MAINTAINER_MODE([enable]) |
| 10 | |
| 11 | # get version info from git |
Liam Girdwood | 77bc065 | 2016-12-22 16:01:21 +0000 | [diff] [blame] | 12 | m4_define(reef_major, `cat .version | cut -dv -f2 | cut -d. -f1`) |
| 13 | m4_define(reef_minor, `cat .version | cut -d. -f2 | cut -d- -f1`) |
Liam Girdwood | 93d62e5 | 2018-01-10 20:26:08 +0000 | [diff] [blame] | 14 | m4_define(reef_micro, `cat .version | cut -d. -f3 | cut -d- -f1`) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 15 | AC_DEFINE_UNQUOTED([REEF_MAJOR], reef_major, [Reef major version]) |
| 16 | AC_DEFINE_UNQUOTED([REEF_MINOR], reef_minor, [Reef minor version]) |
Liam Girdwood | 93d62e5 | 2018-01-10 20:26:08 +0000 | [diff] [blame] | 17 | AC_DEFINE_UNQUOTED([REEF_MICRO], reef_micro, [Reef micro version]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 18 | |
| 19 | AC_CANONICAL_HOST |
| 20 | |
| 21 | # General compiler flags |
Pierre-Louis Bossart | d46dd35 | 2017-09-25 14:55:09 -0500 | [diff] [blame] | 22 | CFLAGS="${CFLAGS:+$CFLAGS } -O2 -g -Wall -Werror -Wl,-EL -fno-inline-functions -nostdlib -Wmissing-prototypes" |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 23 | |
| 24 | # Cross compiler tool libgcc and headers |
Liam Girdwood | 8855ce5 | 2016-10-18 17:18:16 +0100 | [diff] [blame] | 25 | AC_ARG_WITH([root-dir], |
| 26 | AS_HELP_STRING([--with-root-dir], [Specify location of cross gcc libraries and headers]), |
| 27 | [], [with_root_dir=no]) |
| 28 | AS_IF([test "x$with_root_dir" = xno], |
| 29 | AC_MSG_ERROR([Please specify cross compiler root header directory]), |
| 30 | [ROOT_DIR=$with_root_dir]) |
| 31 | AC_SUBST(ROOT_DIR) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 32 | |
| 33 | # Architecture support |
| 34 | AC_ARG_WITH([arch], |
| 35 | AS_HELP_STRING([--with-arch], [Specify DSP architecture]), |
| 36 | [], [with_arch=no]) |
| 37 | |
| 38 | case "$with_arch" in |
| 39 | xtensa*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 40 | |
| 41 | ARCH_CFLAGS="-mtext-section-literals" |
| 42 | AC_SUBST(ARCH_CFLAGS) |
| 43 | |
| 44 | ARCH_LDFLAGS="-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static" |
| 45 | AC_SUBST(XTENSA_LDFLAGS) |
| 46 | |
| 47 | # extra CFLAGS defined here otherwise configure working gcc tests fails. |
| 48 | CFLAGS="${CFLAGS:+$CFLAGS }-mlongcalls" |
| 49 | LDFLAGS="${LDFLAGS:+$LDFLAGS }-nostdlib" |
| 50 | |
| 51 | #ARCH_ASFLAGS="" |
| 52 | AC_SUBST(ARCH_ASFLAGS) |
| 53 | |
| 54 | ARCH="xtensa" |
| 55 | AC_SUBST(ARCH) |
| 56 | ;; |
| 57 | *) |
| 58 | AC_MSG_ERROR([DSP architecture not specified]) |
| 59 | ;; |
| 60 | esac |
| 61 | |
Liam Girdwood | 2eab467 | 2017-11-27 05:24:51 +0800 | [diff] [blame] | 62 | AM_CONDITIONAL(BUILD_XTENSA, test "$ARCH" = "xtensa") |
| 63 | |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 64 | |
| 65 | # Platform support |
| 66 | AC_ARG_WITH([platform], |
| 67 | AS_HELP_STRING([--with-platform], [Specify Host Platform]), |
| 68 | [], [with_platform=no]) |
| 69 | |
| 70 | case "$with_platform" in |
| 71 | baytrail*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 72 | |
| 73 | PLATFORM_LDSCRIPT="baytrail.x" |
| 74 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 75 | |
| 76 | PLATFORM="baytrail" |
| 77 | AC_SUBST(PLATFORM) |
| 78 | |
| 79 | FW_NAME="byt" |
| 80 | AC_SUBST(FW_NAME) |
| 81 | |
Liam Girdwood | f63c789 | 2017-12-04 20:08:39 +0000 | [diff] [blame] | 82 | XTENSA_CORE="hifiep_bd5" |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 83 | AC_SUBST(XTENSA_CORE) |
| 84 | |
| 85 | AC_DEFINE([CONFIG_BAYTRAIL], [1], [Configure for Baytrail]) |
Keyon Jie | fb78421 | 2017-12-06 21:16:32 +0800 | [diff] [blame] | 86 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 87 | ;; |
| 88 | cherrytrail*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 89 | |
| 90 | PLATFORM_LDSCRIPT="baytrail.x" |
| 91 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 92 | |
| 93 | PLATFORM="baytrail" |
| 94 | AC_SUBST(PLATFORM) |
| 95 | |
| 96 | FW_NAME="cht" |
| 97 | AC_SUBST(FW_NAME) |
| 98 | |
Liam Girdwood | f63c789 | 2017-12-04 20:08:39 +0000 | [diff] [blame] | 99 | XTENSA_CORE="hifiep_bd5" |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 100 | AC_SUBST(XTENSA_CORE) |
| 101 | |
| 102 | AC_DEFINE([CONFIG_CHERRYTRAIL], [1], [Configure for Cherrytrail]) |
Keyon Jie | fb78421 | 2017-12-06 21:16:32 +0800 | [diff] [blame] | 103 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 104 | ;; |
| 105 | *) |
| 106 | AC_MSG_ERROR([Host platform not specified]) |
| 107 | ;; |
| 108 | esac |
| 109 | |
Liam Girdwood | 2eab467 | 2017-11-27 05:24:51 +0800 | [diff] [blame] | 110 | AM_CONDITIONAL(BUILD_BAYTRAIL, test "$FW_NAME" = "byt") |
| 111 | AM_CONDITIONAL(BUILD_CHERRYTRAIL, test "$FW_NAME" = "cht") |
| 112 | AM_CONDITIONAL(BUILD_HASWELL, test "$FW_NAME" = "hsw") |
| 113 | AM_CONDITIONAL(BUILD_BROADWELL, test "$FW_NAME" = "bdw") |
| 114 | AM_CONDITIONAL(BUILD_APOLLOLAKE, test "$FW_NAME" = "apl") |
Sebastien Guiriec | ca23f51 | 2016-11-02 08:44:19 +0100 | [diff] [blame] | 115 | # DSP core support (Optional) |
| 116 | AC_ARG_WITH([dsp-core], |
| 117 | AS_HELP_STRING([--with-dsp-core], [Specify DSP Core]), |
| 118 | [], [with_dsp_core=no]) |
| 119 | |
| 120 | case "$with_dsp_core" in |
| 121 | CHT_audio_hifiep*) |
| 122 | # BXT/CHT DSP Core |
| 123 | XTENSA_CORE="CHT_audio_hifiep" |
| 124 | AC_SUBST(XTENSA_CORE) |
| 125 | ;; |
| 126 | |
| 127 | esac |
| 128 | |
Keyon Jie | 0e42030 | 2017-12-06 21:16:30 +0800 | [diff] [blame] | 129 | # dma trace support (Optional), dma trace by default |
| 130 | AC_ARG_ENABLE([dma-trace], |
| 131 | AS_HELP_STRING([--disable-dma-trace], [Disabled dma trace and use fallback mailbox trace])) |
| 132 | |
| 133 | AS_IF([test "x$enable_dma_trace" != "xno"], [ |
| 134 | AC_DEFINE([CONFIG_DMA_TRACE], [1], [Configure DMA trace]) |
| 135 | ]) |
| 136 | |
Keyon Jie | 1a8a653 | 2017-12-22 23:10:56 +0800 | [diff] [blame] | 137 | AM_CONDITIONAL(BUILD_DMA_TRACE, test "x$enable_dma_trace" != "xno") |
| 138 | |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 139 | # Test after CFLAGS set othewise test of cross compiler fails. |
| 140 | AM_PROG_AS |
| 141 | AM_PROG_AR |
| 142 | AC_PROG_CC |
| 143 | LT_INIT |
| 144 | AC_CHECK_TOOL([OBJCOPY], [objcopy], []) |
| 145 | AC_CHECK_TOOL([OBJDUMP], [objdump], []) |
| 146 | |
| 147 | AM_EXTRA_RECURSIVE_TARGETS([bin]) |
| 148 | |
| 149 | AM_EXTRA_RECURSIVE_TARGETS([vminstall]) |
| 150 | |
| 151 | AC_CONFIG_FILES([ |
| 152 | Makefile |
| 153 | src/Makefile |
| 154 | src/tasks/Makefile |
| 155 | src/init/Makefile |
| 156 | src/arch/Makefile |
| 157 | src/arch/xtensa/Makefile |
| 158 | src/arch/xtensa/include/Makefile |
Liam Girdwood | b14e852 | 2018-01-10 17:36:41 +0000 | [diff] [blame] | 159 | src/arch/xtensa/include/arch/Makefile |
| 160 | src/arch/xtensa/include/xtensa/Makefile |
| 161 | src/arch/xtensa/include/xtensa/config/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 162 | src/arch/xtensa/hal/Makefile |
| 163 | src/arch/xtensa/xtos/Makefile |
| 164 | src/audio/Makefile |
Seppo Ingalsuo | 6a27483 | 2017-06-07 14:17:55 +0300 | [diff] [blame] | 165 | src/math/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 166 | src/drivers/Makefile |
| 167 | src/include/Makefile |
| 168 | src/include/reef/Makefile |
| 169 | src/include/reef/audio/Makefile |
Liam Girdwood | b14e852 | 2018-01-10 17:36:41 +0000 | [diff] [blame] | 170 | src/include/reef/audio/coefficients/Makefile |
| 171 | src/include/reef/audio/coefficients/src/Makefile |
| 172 | src/include/reef/math/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 173 | src/include/uapi/Makefile |
| 174 | src/ipc/Makefile |
| 175 | src/lib/Makefile |
| 176 | src/platform/Makefile |
| 177 | src/platform/baytrail/Makefile |
| 178 | src/platform/baytrail/include/Makefile |
| 179 | src/platform/baytrail/include/platform/Makefile |
| 180 | src/platform/baytrail/include/xtensa/Makefile |
| 181 | src/platform/baytrail/include/xtensa/config/Makefile |
| 182 | ]) |
| 183 | AC_OUTPUT |
| 184 | |
| 185 | echo " |
| 186 | ---{ $PACKAGE_NAME $VERSION }--- |
| 187 | |
| 188 | Target Architecture: ${ARCH} |
| 189 | Target Platform: ${PLATFORM} |
Sebastien Guiriec | ca23f51 | 2016-11-02 08:44:19 +0100 | [diff] [blame] | 190 | Target Core: ${XTENSA_CORE} |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 191 | |
| 192 | Compiler: ${CC} |
| 193 | CFLAGS: ${CFLAGS} |
| 194 | LDFLAGS: ${LDFLAGS} |
| 195 | ARCH_CFLAGS: ${ARCH_CFLAGS} |
| 196 | ARCH_LDFLAGS: ${ARCH_LDFLAGS} |
| 197 | " |
| 198 | |