Changeset ff1e0f38 for configure.ac


Ignore:
Timestamp:
Aug 3, 2018, 1:57:12 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
ba9baad
Parents:
c59712e
Message:

configure flags are now propagated properly to libcfa

File:
1 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rc59712e rff1e0f38  
    2828
    2929AC_SUBST(CFA_NAME, ${cfa_name})
    30 
    31 #==============================================================================
    32 # handle the list of hosts to build for
    33 for var in $ac_configure_args
    34 do
    35         #strip quotes surrouding values
    36         var=$(echo $var | sed s/\'//g)
    37         case $var in
    38                 # skip cross compilation related arguments
    39                 --host=*) ;; host_alias=*) ;; --build=*) ;; build_alias=*) ;; --target=*) ;; target_alias=*) ;;
    40 
    41                 # append all other arguments to the sub configure arguments
    42                 *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";;
    43         esac
    44 done
    45 
    46 echo $LIBCFA_GENERAL_ARGS
    47 
    48 #==============================================================================
    49 # handle the list of hosts to build for
    50 AC_CANONICAL_BUILD
    51 AC_CANONICAL_HOST
    52 
    53 default_target="${host_cpu}:debug, ${host_cpu}:nodebug"
    54 AC_ARG_WITH(target-hosts,
    55         [  --with-target-hosts=HOSTS     HOSTS comma seperated list of hosts to build for, format ARCH:[debug|nodebug|nolib]],
    56         target_hosts=$withval, target_hosts=${default_target})
    57 
    58 AC_SUBST(TARGET_HOSTS, ${target_hosts})
    59 
    60 for i in $(echo $target_hosts | sed "s/,/ /g")
    61 do
    62         # call your procedure/other scripts here below
    63         lib_arch=$(echo $i | sed -r "s/:(.*)//g")
    64         lib_config=$(echo $i | sed -r "s/(.*)://g")
    65         lib_dir="libcfa-${lib_arch}-${lib_config}"
    66 
    67         LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}"
    68         LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile"
    69 
    70         mkdir -p libcfa-${lib_arch}-${lib_config}
    71         echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data
    72         echo -n "--host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data
    73         echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data
    74 done
    75 
    76 AC_SUBST(LIBCFA_TARGET_DIRS)
    77 AC_SUBST(LIBCFA_TARGET_MAKEFILES)
    7830
    7931
     
    163115#==============================================================================
    164116# Create variables for commonly used targets
    165 DRIVER_DIR='$(top_builddir)/driver'
    166 CFACC=${DRIVER_DIR}/cfa
    167 CFACPP=${DRIVER_DIR}/cfa-cpp
     117
     118TOP_SRCDIR=$ac_pwd/$ac_confdir/
     119TOP_BUILDDIR=$ac_pwd/
     120PRELUDE_BUILDDIR=$ac_pwd/libcfa-x86_64-debug/prelude/
     121
     122AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$TOP_SRCDIR", [Top src directory])
     123AC_DEFINE_UNQUOTED(TOP_BUILDDIR, "$TOP_BUILDDIR", [Top build directory])
     124AC_DEFINE_UNQUOTED(PRELUDE_BUILDDIR, "$PRELUDE_BUILDDIR", [Directory where the prelude files are built])
     125
     126DRIVER_DIR=${TOP_BUILDDIR}driver/
     127CFACC=${DRIVER_DIR}cfa
     128CFACPP=${DRIVER_DIR}cfa-cpp
    168129AC_SUBST(DRIVER_DIR)
    169130AC_SUBST(CFACC)
    170131AC_SUBST(CFACPP)
    171 AC_DEFINE_UNQUOTED(TOP_SRCDIR, "$ac_pwd/$ac_confdir/", [Top src directory])
    172 AC_DEFINE_UNQUOTED(TOP_BUILDDIR, "$ac_pwd/", [Top build directory])
    173 AC_DEFINE_UNQUOTED(PRELUDE_BUILDDIR, "$ac_pwd/libcfa/prelude/", [Directory where the prelude files are built])
    174132
    175133#==============================================================================
    176134# Flag variables needed to build in tree
    177 LIBCFA_SRC='$(top_srcdir)/libcfa/src'
    178 LIBCFA_BUILD='$(top_builddir)/libcfa/src'
    179 BUILD_IN_TREE_FLAGS_NOLIB="-XCFA -t -B${DRIVER_DIR}"
    180 BUILD_IN_TREE_FLAGS="${BUILD_IN_TREE_FLAGS_NOLIB} -L${LIBCFA_BUILD} -I${LIBCFA_SRC} -I${LIBCFA_SRC}/containers -I${LIBCFA_SRC}/concurrency -I${LIBCFA_SRC}/stdhdr"
    181 AC_SUBST(BUILD_IN_TREE_FLAGS_NOLIB)
     135LIBCFA_SRC='${TOP_SRCDIR}/libcfa/src'
     136BUILD_IN_TREE_FLAGS="-XCFA -t -B${DRIVER_DIR}"
    182137AC_SUBST(BUILD_IN_TREE_FLAGS)
     138
     139#==============================================================================
     140# handle the list of hosts to build for
     141for var in $ac_configure_args
     142do
     143        #strip quotes surrouding values
     144        var=$(echo $var | sed s/\'//g)
     145        case $var in
     146                # skip cross compilation related arguments
     147                --host=*) ;; host_alias=*) ;; --build=*) ;; build_alias=*) ;; --target=*) ;; target_alias=*) ;;
     148
     149                # skip the target hosts
     150                --with-target-hosts=*) ;;
     151
     152                # append all other arguments to the sub configure arguments
     153                *) LIBCFA_GENERAL_ARGS="${LIBCFA_GENERAL_ARGS} $var";;
     154        esac
     155done
     156
     157#==============================================================================
     158# handle the list of hosts to build for
     159AC_CANONICAL_BUILD
     160AC_CANONICAL_HOST
     161
     162default_target="${host_cpu}:debug, ${host_cpu}:nodebug"
     163AC_ARG_WITH(target-hosts,
     164        [  --with-target-hosts=HOSTS     HOSTS comma seperated list of hosts to build for, format ARCH:[debug|nodebug|nolib]],
     165        target_hosts=$withval, target_hosts=${default_target})
     166
     167AC_SUBST(TARGET_HOSTS, ${target_hosts})
     168
     169LIBCFA_PATHS="DRIVER_DIR=${DRIVER_DIR}"
     170
     171for i in $(echo $target_hosts | sed "s/,/ /g")
     172do
     173        # call your procedure/other scripts here below
     174        lib_arch=$(echo $i | sed -r "s/:(.*)//g")
     175        lib_config=$(echo $i | sed -r "s/(.*)://g")
     176        lib_dir="libcfa-${lib_arch}-${lib_config}"
     177
     178        LIBCFA_TARGET_DIRS="${LIBCFA_TARGET_DIRS} ${lib_dir}"
     179        LIBCFA_TARGET_MAKEFILES="${LIBCFA_TARGET_MAKEFILES} ${lib_dir}/Makefile"
     180
     181        mkdir -p libcfa-${lib_arch}-${lib_config}
     182        echo -n "${LIBCFA_GENERAL_ARGS} " > libcfa-${lib_arch}-${lib_config}/config.data
     183        echo -n "${LIBCFA_PATHS} " >> libcfa-${lib_arch}-${lib_config}/config.data
     184        echo -n "--host=${lib_arch} " >> libcfa-${lib_arch}-${lib_config}/config.data
     185        echo -n "CONFIGURATION=${lib_config}" >> libcfa-${lib_arch}-${lib_config}/config.data
     186done
     187
     188AC_SUBST(LIBCFA_TARGET_DIRS)
     189AC_SUBST(LIBCFA_TARGET_MAKEFILES)
    183190
    184191#==============================================================================
Note: See TracChangeset for help on using the changeset viewer.