source: automake/cfa.m4 @ 40290497

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resnenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 40290497 was 305581d, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Fix problem where configure would set default CPU to which ever was the last target

  • Property mode set to 100644
File size: 2.3 KB
Line 
1
2m4_define([M4CFA_PARSE_PREFIX], [
3        if test "x$prefix" = "xNONE"; then
4                cfa_prefix=${ac_default_prefix}
5        else
6                cfa_prefix=${prefix}
7        fi
8        cfa_prefix="$(readlink -m ${cfa_prefix})/"
9        AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
10        AC_SUBST(CFA_PREFIX, ${cfa_prefix})
11
12        if test "$includedir" = '${prefix}/include'; then
13                cfa_incdir="${cfa_prefix}include/${cfa_name}"
14        else
15                cfa_incdir=${includedir}
16        fi
17        cfa_incdir="$(readlink -m ${cfa_incdir})/"
18        AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
19        AC_SUBST(CFA_INCDIR, ${cfa_incdir})
20
21        if test "$bindir" = '${exec_prefix}/bin'; then
22                cfa_bindir="${cfa_prefix}bin"
23        else
24                cfa_bindir=${bindir}
25        fi
26        cfa_bindir="$(readlink -m ${cfa_bindir})/"
27        AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
28        AC_SUBST(CFA_BINDIR, ${cfa_bindir})
29
30        if test "$libdir" = '${exec_prefix}/lib'; then
31                if test "${ARCHITECTURE}" != ""; then
32                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/${ARCHITECTURE}-${CONFIGURATION}/"
33                else
34                        cfa_libdir="${cfa_prefix}lib/${cfa_name}/"
35                fi
36        else
37                cfa_libdir="${libdir}/${ARCHITECTURE}${CONFIGURATION}"
38        fi
39        cfa_libdir="$(readlink -m ${cfa_libdir})/"
40        AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
41        AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
42])
43
44m4_define([M4CFA_PROGRAM_NAME], [
45        if test "${program_transform_name}" = ""; then
46        AC_MSG_ERROR([Program transform not supported.
47                        Use --with-cfa-name='[[Desired name here]]' instead])
48        fi
49
50        #Define the new name of the installed command
51        AC_ARG_WITH(cfa-name,
52                [  --with-cfa-name=NAME     NAME too which cfa will be installed],
53                cfa_name=$withval, cfa_name="cfa")
54
55        AC_SUBST(CFA_NAME, ${cfa_name})
56])
57
58AC_DEFUN([M4CFA_CANNON_CPU], [
59        case $1 in
60                "host") arch_name=${host_cpu};;
61                *) arch_name=$1;;
62        esac
63
64        case $arch_name in
65                "x64"        ) cannon_arch_name="x64";;
66                "x86-64"     ) cannon_arch_name="x64";;
67                "x86_64"     ) cannon_arch_name="x64";;
68                "x86"        ) cannon_arch_name="x86";;
69                "i386"       ) cannon_arch_name="x86";;
70                "i486"       ) cannon_arch_name="x86";;
71                "i686"       ) cannon_arch_name="x86";;
72                "Intel 80386") cannon_arch_name="x86";;
73                "arm"        ) cannon_arch_name="arm";;
74                "ARM"        ) cannon_arch_name="arm";;
75                *)
76                >&2 echo "Unkown architecture " $arch_name;
77                exit 1
78                ;;
79        esac
80])
Note: See TracBrowser for help on using the repository browser.