-
Notifications
You must be signed in to change notification settings - Fork 3
/
configure.ac
183 lines (146 loc) · 4.57 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
AC_PREREQ([2.69])
AC_INIT([Reef],[m4_esyscmd(./git-version.sh), m4_esyscmd(rm -f .build)],[[email protected]])
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"
# 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}
"