-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
executable file
·69 lines (62 loc) · 2.54 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
AC_PREREQ([2.69])
AC_INIT
AC_PREFIX_DEFAULT([/opt/wii])
AC_SUBST([CFLAGS_FOR_TARGET])
AC_SUBST([CXXFLAGS_FOR_TARGET])
CFLAGS_FOR_TARGET="-g -ffunction-sections -fdata-sections -O2 $CFLAGS_FOR_TARGET"
CXXFLAGS_FOR_TARGET="-g -ffunction-sections -fdata-sections -O2 $CXXFLAGS_FOR_TARGET"
AC_SUBST([CONFIG_BINUTILS])
AC_SUBST([CONFIG_GCC])
AC_SUBST([CONFIG_NEWLIB])
AC_ARG_WITH([configure-binutils],
[AC_HELP_STRING([--with-configure-binutils=<params>],
[additional parameters for binutils configuraiton])],
[CONFIG_BINUTILS="$withval"])
AC_ARG_WITH([configure-gcc],
[AC_HELP_STRING([--with-configure-gcc=<params>],
[additional parameters for gcc configuraiton])],
[CONFIG_GCC="$withval"])
AC_ARG_WITH([configure-newlib],
[AC_HELP_STRING([--with-configure-newlib=<params>],
[additional parameters for newlib configuraiton])],
[CONFIG_NEWLIB="$withval"])
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_CHECK_PROGS([WGET], [wget curl])
AS_IF([test "x$WGET" = xwget], [WGET="wget -O"; WGET_Q="wget -q -O";],
[test "x$WGET" = xcurl], [WGET="curl -o"; WGET_Q ="curl -s -o";])
AC_C_BIGENDIAN
AC_ARG_VAR([BINUTILS_VERSION], [select binutils version])
AC_ARG_VAR([GCC_VERSION], [select gcc version])
AC_ARG_VAR([NEWLIB_VERSION], [select newlib version])
AC_MSG_CHECKING([binutils version])
AS_IF([test -z "$BINUTILS_VERSION"],
[
BINUTILS_VERSION=`$WGET_Q - "https://ftp.gnu.org/gnu/binutils/" |
grep -E -o ">binutils-[[0-9\\\\.]]+tar\\\\.gz<" |
tail -n 1 |
sed -e s/\\>// -e s/\\\\.tar\\\\.gz\\<//`
])
AC_MSG_RESULT([$BINUTILS_VERSION])
AC_MSG_CHECKING([gcc version])
AS_IF([test -z "$GCC_VERSION"],
[
GCC_VERSION=`$WGET_Q - "https://ftp.gnu.org/gnu/gcc/" |
grep -E -o ">gcc-[[0-9\\\\.]]+/<" |
tail -n 1 |
sed -e s/\\>// -e s/\\\\/\\<//`
])
AC_MSG_RESULT([$GCC_VERSION])
AC_MSG_CHECKING([newlib version])
AS_IF([test -z "$NEWLIB_VERSION"],
[
NEWLIB_VERSION=`$WGET_Q - "https://sourceware.org/pub/newlib/" |
grep -E -o ">newlib-[[0-9\\\\.]]+tar\\\\.gz<" |
head -n 1 |
sed -e s/\\>// -e s/\\\\.tar\\\\.gz\\<//`
])
AC_MSG_RESULT([$NEWLIB_VERSION])
AC_CONFIG_FILES([makefile])
AC_OUTPUT