Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    r5222605 rdf47e2f  
    1919
    2020# Allow program name tansformation
    21 # will fill program_transform_name with appropriate sed regex
     21# will fille program_transform_name with appropriate sed regex
    2222AC_ARG_PROGRAM
     23#autoconf escapes $ and \ since automake wiill un-escape them.
     24#Since we need to use the sed transform in autoconf we need to manualy un-escape these characters
     25name_transform=`echo ${program_transform_name} | sed 's/\\$\\$/\\$/g' | sed 's/\\\\\\\/\\\/g'`
     26cfa_name=`echo cfa | sed ${name_transform}`
     27cc1_name=`echo cc1 | sed ${name_transform}`
     28cpp_name=`echo cfa-cpp | sed ${name_transform}`
    2329
    2430#Trasforming cc1 will break compilation
    25 if test "${program_transform_name}" = ""; then
    26     AC_MSG_ERROR([Program transform not supported.
    27                 Use --with-cfa-name='[[Desired name here]]' instead])
    28 fi
    29 
    30 AC_ARG_WITH(cfa-name,
    31         [  --with-cfa-name=NAME     NAME too which cfa will be installed],
    32         cfa_name=$withval, cfa_name="cfa")
     31if ! test "${cc1_name}" = "cc1"; then
     32    AC_MSG_ERROR([Program transform must not modify cc1.
     33                --program-sufix and --program-prefix not supported.
     34                Use -program-transform-name='s/cfa$/[[Desired name here]]/' instead])
     35fi
     36#We could support transforming cfa-cpp but since it is located in a unique subfolder we don't need to
     37if ! test "${cpp_name}" = "cfa-cpp"; then
     38    AC_MSG_ERROR([Program transform must not modify cfa-cpp.
     39                --program-sufix and --program-prefix not supported.
     40                Use -program-transform-name='s/cfa$/[[Desired name here]]/' instead])
     41fi
    3342
    3443#Define the new name of the installed command
     
    169178AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
    170179
    171 AC_CANONICAL_BUILD
     180AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
     181AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
     182
    172183AC_CANONICAL_HOST
    173184AC_SUBST([MACHINE_TYPE],[$host_cpu])
    174 
    175 if ! test "$host_cpu" = "$build_cpu"; then
    176         case $host_cpu in
    177                 i386)
    178                         CFLAGS+="-m32"
    179                         CXXFLAGS+="-m32"
    180                         CFAFLAGS+="-m32"
    181                         LDFLAGS+="-m32"
    182                         ;;
    183                 i686)
    184                         CFLAGS+="-m32"
    185                         CXXFLAGS+="-m32"
    186                         CFAFLAGS+="-m32"
    187                         LDFLAGS+="-m32"
    188                         ;;
    189                 x86_64)
    190                         CFLAGS+="-m64"
    191                         CXXFLAGS+="-m64"
    192                         CFAFLAGS+="-m64"
    193                         LDFLAGS+="-m64"
    194                         ;;
    195         esac
    196 fi
    197 
    198 AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
    199 AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
    200185
    201186# Checks for programs.
Note: See TracChangeset for help on using the changeset viewer.