source: automake/cfa.m4 @ a5121bf

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since a5121bf was a5121bf, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Tests can now be run from installed binaries or tree binaries

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