Changeset df47e2f for configure.ac


Ignore:
Timestamp:
Mar 6, 2017, 2:06:52 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
3f80888
Parents:
e958ff8
Message:

Added partial support for renaming cfa through autoconf (using --program-transform-name)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    re958ff8 rdf47e2f  
    1717AM_INIT_AUTOMAKE
    1818AM_MAINTAINER_MODE(enable)                      # may require auto* software to be installed
     19
     20# Allow program name tansformation
     21# will fille program_transform_name with appropriate sed regex
     22AC_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}`
     29
     30#Trasforming cc1 will break compilation
     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
     42
     43#Define the new name of the installed command
     44AC_SUBST(CFA_NAME, ${cfa_name})
    1945
    2046rm -f version
     
    129155
    130156if test "$includedir" = '${prefix}/include'; then
    131         cfa_incdir="${cfa_prefix}/include/cfa"
     157        cfa_incdir="${cfa_prefix}/include/${cfa_name}"
    132158else
    133159        cfa_incdir=${includedir}
     
    145171
    146172if test "$libdir" = '${exec_prefix}/lib'; then
    147         cfa_libdir="${cfa_prefix}/lib/cfa"
     173        cfa_libdir="${cfa_prefix}/lib/${cfa_name}"
    148174else
    149175        cfa_libdir=${libdir}
Note: See TracChangeset for help on using the changeset viewer.