ath9k_htc: Update to upstream's commit d19607454d656cb14d8c16dfbf161eebb542e8fe dated...
[linux-libre-firmware.git] / ath9k_htc / target_firmware / configure
1 #!/bin/sh
2 ##
3  # Copyright (c) 2013 Qualcomm Atheros, Inc.
4  #
5  # All rights reserved.
6  #
7  # Redistribution and use in source and binary forms, with or without
8  # modification, are permitted (subject to the limitations in the
9  # disclaimer below) provided that the following conditions are met:
10  #
11  #  * Redistributions of source code must retain the above copyright
12  #    notice, this list of conditions and the following disclaimer.
13  #
14  #  * Redistributions in binary form must reproduce the above copyright
15  #    notice, this list of conditions and the following disclaimer in the
16  #    documentation and/or other materials provided with the
17  #    distribution.
18  #
19  #  * Neither the name of Qualcomm Atheros nor the names of its
20  #    contributors may be used to endorse or promote products derived
21  #    from this software without specific prior written permission.
22  #
23  # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
24  # GRANTED BY THIS LICENSE.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
25  # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
26  # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
27  # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28  # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29  # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30  # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32  # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33  # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
34  # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
35  # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  ##
37
38 TARGET=xtensa-elf
39
40 [ -z "$CROSS_COMPILE" ] &&
41     CROSS_COMPILE="$PWD/../toolchain/inst/bin/$TARGET-"
42
43 TOOLCHAIN_FILE="$PWD/build/toolchain.cmake"
44
45 set -e
46 rm -rf build
47 mkdir -p build
48
49 cat > "$TOOLCHAIN_FILE" <<EOF
50 SET(CMAKE_SYSTEM_NAME Generic)
51 SET(CMAKE_C_COMPILER  "${CROSS_COMPILE}gcc")
52 EOF
53
54 do_cmake() {
55         cmake -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" "$@"
56 }
57
58 mkdir -p build/k2 build/magpie
59 cd build/k2
60 do_cmake -DTARGET_K2=ON ../..
61 cd -
62 cd build/magpie
63 do_cmake -DTARGET_MAGPIE=ON ../..
64 cd -