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 | |
Liam Girdwood | cc9fba3 | 2018-01-22 23:31:24 +0000 | [diff] [blame^] | 24 | # General assembler flags |
| 25 | ASFLAGS="-DASSEMBLY" |
| 26 | AC_SUBST(ASFLAGS) |
| 27 | |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 28 | # Cross compiler tool libgcc and headers |
Liam Girdwood | 8855ce5 | 2016-10-18 17:18:16 +0100 | [diff] [blame] | 29 | AC_ARG_WITH([root-dir], |
| 30 | AS_HELP_STRING([--with-root-dir], [Specify location of cross gcc libraries and headers]), |
| 31 | [], [with_root_dir=no]) |
| 32 | AS_IF([test "x$with_root_dir" = xno], |
| 33 | AC_MSG_ERROR([Please specify cross compiler root header directory]), |
| 34 | [ROOT_DIR=$with_root_dir]) |
| 35 | AC_SUBST(ROOT_DIR) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 36 | |
| 37 | # Architecture support |
| 38 | AC_ARG_WITH([arch], |
| 39 | AS_HELP_STRING([--with-arch], [Specify DSP architecture]), |
| 40 | [], [with_arch=no]) |
| 41 | |
| 42 | case "$with_arch" in |
| 43 | xtensa*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 44 | |
| 45 | ARCH_CFLAGS="-mtext-section-literals" |
| 46 | AC_SUBST(ARCH_CFLAGS) |
| 47 | |
| 48 | ARCH_LDFLAGS="-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static" |
| 49 | AC_SUBST(XTENSA_LDFLAGS) |
| 50 | |
| 51 | # extra CFLAGS defined here otherwise configure working gcc tests fails. |
| 52 | CFLAGS="${CFLAGS:+$CFLAGS }-mlongcalls" |
| 53 | LDFLAGS="${LDFLAGS:+$LDFLAGS }-nostdlib" |
| 54 | |
| 55 | #ARCH_ASFLAGS="" |
| 56 | AC_SUBST(ARCH_ASFLAGS) |
| 57 | |
| 58 | ARCH="xtensa" |
| 59 | AC_SUBST(ARCH) |
| 60 | ;; |
| 61 | *) |
| 62 | AC_MSG_ERROR([DSP architecture not specified]) |
| 63 | ;; |
| 64 | esac |
| 65 | |
Liam Girdwood | 2eab467 | 2017-11-27 05:24:51 +0800 | [diff] [blame] | 66 | AM_CONDITIONAL(BUILD_XTENSA, test "$ARCH" = "xtensa") |
| 67 | |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 68 | |
| 69 | # Platform support |
| 70 | AC_ARG_WITH([platform], |
| 71 | AS_HELP_STRING([--with-platform], [Specify Host Platform]), |
| 72 | [], [with_platform=no]) |
| 73 | |
| 74 | case "$with_platform" in |
| 75 | baytrail*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 76 | |
| 77 | PLATFORM_LDSCRIPT="baytrail.x" |
| 78 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 79 | |
| 80 | PLATFORM="baytrail" |
| 81 | AC_SUBST(PLATFORM) |
| 82 | |
| 83 | FW_NAME="byt" |
| 84 | AC_SUBST(FW_NAME) |
| 85 | |
Liam Girdwood | f63c789 | 2017-12-04 20:08:39 +0000 | [diff] [blame] | 86 | XTENSA_CORE="hifiep_bd5" |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 87 | AC_SUBST(XTENSA_CORE) |
| 88 | |
| 89 | AC_DEFINE([CONFIG_BAYTRAIL], [1], [Configure for Baytrail]) |
Keyon Jie | fb78421 | 2017-12-06 21:16:32 +0800 | [diff] [blame] | 90 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 91 | ;; |
| 92 | cherrytrail*) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 93 | |
| 94 | PLATFORM_LDSCRIPT="baytrail.x" |
| 95 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 96 | |
| 97 | PLATFORM="baytrail" |
| 98 | AC_SUBST(PLATFORM) |
| 99 | |
| 100 | FW_NAME="cht" |
| 101 | AC_SUBST(FW_NAME) |
| 102 | |
Liam Girdwood | f63c789 | 2017-12-04 20:08:39 +0000 | [diff] [blame] | 103 | XTENSA_CORE="hifiep_bd5" |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 104 | AC_SUBST(XTENSA_CORE) |
| 105 | |
| 106 | AC_DEFINE([CONFIG_CHERRYTRAIL], [1], [Configure for Cherrytrail]) |
Keyon Jie | fb78421 | 2017-12-06 21:16:32 +0800 | [diff] [blame] | 107 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 108 | ;; |
Liam Girdwood | f198ad9 | 2018-01-21 23:48:35 +0000 | [diff] [blame] | 109 | haswell*) |
| 110 | |
| 111 | PLATFORM_LDSCRIPT="haswell.x" |
| 112 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 113 | |
| 114 | PLATFORM="haswell" |
| 115 | AC_SUBST(PLATFORM) |
| 116 | |
| 117 | FW_NAME="hsw" |
| 118 | AC_SUBST(FW_NAME) |
| 119 | |
| 120 | XTENSA_CORE="hifiep_bd5" |
| 121 | AC_SUBST(XTENSA_CORE) |
| 122 | |
| 123 | AC_DEFINE([CONFIG_HASWELL], [1], [Configure for Haswell]) |
| 124 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
| 125 | ;; |
| 126 | broadwell*) |
| 127 | |
| 128 | PLATFORM_LDSCRIPT="broadwell.x" |
| 129 | AC_SUBST(PLATFORM_LDSCRIPT) |
| 130 | |
| 131 | PLATFORM="haswell" |
| 132 | AC_SUBST(PLATFORM) |
| 133 | |
| 134 | FW_NAME="bdw" |
| 135 | AC_SUBST(FW_NAME) |
| 136 | |
| 137 | XTENSA_CORE="hifiep_bd5" |
| 138 | AC_SUBST(XTENSA_CORE) |
| 139 | |
| 140 | AC_DEFINE([CONFIG_BROADWELL], [1], [Configure for Broadwell]) |
| 141 | AC_DEFINE([CONFIG_HOST_PTABLE], [1], [Configure handling host page table]) |
| 142 | ;; |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 143 | *) |
| 144 | AC_MSG_ERROR([Host platform not specified]) |
| 145 | ;; |
| 146 | esac |
| 147 | |
Liam Girdwood | 2eab467 | 2017-11-27 05:24:51 +0800 | [diff] [blame] | 148 | AM_CONDITIONAL(BUILD_BAYTRAIL, test "$FW_NAME" = "byt") |
| 149 | AM_CONDITIONAL(BUILD_CHERRYTRAIL, test "$FW_NAME" = "cht") |
| 150 | AM_CONDITIONAL(BUILD_HASWELL, test "$FW_NAME" = "hsw") |
| 151 | AM_CONDITIONAL(BUILD_BROADWELL, test "$FW_NAME" = "bdw") |
| 152 | AM_CONDITIONAL(BUILD_APOLLOLAKE, test "$FW_NAME" = "apl") |
Liam Girdwood | f198ad9 | 2018-01-21 23:48:35 +0000 | [diff] [blame] | 153 | |
Sebastien Guiriec | ca23f51 | 2016-11-02 08:44:19 +0100 | [diff] [blame] | 154 | # DSP core support (Optional) |
| 155 | AC_ARG_WITH([dsp-core], |
| 156 | AS_HELP_STRING([--with-dsp-core], [Specify DSP Core]), |
| 157 | [], [with_dsp_core=no]) |
| 158 | |
| 159 | case "$with_dsp_core" in |
| 160 | CHT_audio_hifiep*) |
| 161 | # BXT/CHT DSP Core |
| 162 | XTENSA_CORE="CHT_audio_hifiep" |
| 163 | AC_SUBST(XTENSA_CORE) |
| 164 | ;; |
| 165 | |
| 166 | esac |
| 167 | |
Keyon Jie | 0e42030 | 2017-12-06 21:16:30 +0800 | [diff] [blame] | 168 | # dma trace support (Optional), dma trace by default |
| 169 | AC_ARG_ENABLE([dma-trace], |
| 170 | AS_HELP_STRING([--disable-dma-trace], [Disabled dma trace and use fallback mailbox trace])) |
| 171 | |
| 172 | AS_IF([test "x$enable_dma_trace" != "xno"], [ |
| 173 | AC_DEFINE([CONFIG_DMA_TRACE], [1], [Configure DMA trace]) |
| 174 | ]) |
| 175 | |
Keyon Jie | 1a8a653 | 2017-12-22 23:10:56 +0800 | [diff] [blame] | 176 | AM_CONDITIONAL(BUILD_DMA_TRACE, test "x$enable_dma_trace" != "xno") |
| 177 | |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 178 | # Test after CFLAGS set othewise test of cross compiler fails. |
| 179 | AM_PROG_AS |
| 180 | AM_PROG_AR |
| 181 | AC_PROG_CC |
| 182 | LT_INIT |
| 183 | AC_CHECK_TOOL([OBJCOPY], [objcopy], []) |
| 184 | AC_CHECK_TOOL([OBJDUMP], [objdump], []) |
| 185 | |
| 186 | AM_EXTRA_RECURSIVE_TARGETS([bin]) |
| 187 | |
| 188 | AM_EXTRA_RECURSIVE_TARGETS([vminstall]) |
| 189 | |
| 190 | AC_CONFIG_FILES([ |
| 191 | Makefile |
| 192 | src/Makefile |
| 193 | src/tasks/Makefile |
| 194 | src/init/Makefile |
| 195 | src/arch/Makefile |
| 196 | src/arch/xtensa/Makefile |
| 197 | src/arch/xtensa/include/Makefile |
Liam Girdwood | b14e852 | 2018-01-10 17:36:41 +0000 | [diff] [blame] | 198 | src/arch/xtensa/include/arch/Makefile |
| 199 | src/arch/xtensa/include/xtensa/Makefile |
| 200 | src/arch/xtensa/include/xtensa/config/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 201 | src/arch/xtensa/hal/Makefile |
| 202 | src/arch/xtensa/xtos/Makefile |
| 203 | src/audio/Makefile |
Seppo Ingalsuo | 6a27483 | 2017-06-07 14:17:55 +0300 | [diff] [blame] | 204 | src/math/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 205 | src/drivers/Makefile |
| 206 | src/include/Makefile |
| 207 | src/include/reef/Makefile |
| 208 | src/include/reef/audio/Makefile |
Liam Girdwood | b14e852 | 2018-01-10 17:36:41 +0000 | [diff] [blame] | 209 | src/include/reef/audio/coefficients/Makefile |
| 210 | src/include/reef/audio/coefficients/src/Makefile |
| 211 | src/include/reef/math/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 212 | src/include/uapi/Makefile |
| 213 | src/ipc/Makefile |
| 214 | src/lib/Makefile |
| 215 | src/platform/Makefile |
| 216 | src/platform/baytrail/Makefile |
| 217 | src/platform/baytrail/include/Makefile |
| 218 | src/platform/baytrail/include/platform/Makefile |
| 219 | src/platform/baytrail/include/xtensa/Makefile |
| 220 | src/platform/baytrail/include/xtensa/config/Makefile |
Liam Girdwood | f198ad9 | 2018-01-21 23:48:35 +0000 | [diff] [blame] | 221 | src/platform/haswell/Makefile |
| 222 | src/platform/haswell/include/Makefile |
| 223 | src/platform/haswell/include/platform/Makefile |
| 224 | src/platform/haswell/include/xtensa/Makefile |
| 225 | src/platform/haswell/include/xtensa/config/Makefile |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 226 | ]) |
| 227 | AC_OUTPUT |
| 228 | |
| 229 | echo " |
| 230 | ---{ $PACKAGE_NAME $VERSION }--- |
| 231 | |
| 232 | Target Architecture: ${ARCH} |
| 233 | Target Platform: ${PLATFORM} |
Sebastien Guiriec | ca23f51 | 2016-11-02 08:44:19 +0100 | [diff] [blame] | 234 | Target Core: ${XTENSA_CORE} |
Liam Girdwood | c0dfb4e | 2016-09-21 15:57:22 +0100 | [diff] [blame] | 235 | |
| 236 | Compiler: ${CC} |
| 237 | CFLAGS: ${CFLAGS} |
| 238 | LDFLAGS: ${LDFLAGS} |
| 239 | ARCH_CFLAGS: ${ARCH_CFLAGS} |
| 240 | ARCH_LDFLAGS: ${ARCH_LDFLAGS} |
| 241 | " |
| 242 | |