Changeset 19097

Show
Ignore:
Timestamp:
08/03/06 08:09:59 (2 years ago)
Author:
dshipton
Message:

This is the magic glue that figures out all of the information and flags to set for vpr for the build.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/macros/vpr.m4

    r18824 r19097  
    4444 
    4545    dnl Get the cflags and libraries from the vpr-config script 
    46     AC_ARG_WITH(vpr, 
    47                 [  --with-vpr=<PATH>       Directory where VPR is 
    48                           installed (optional)            [No default]], 
    49                 vpr_config_prefix="$withval", vpr_config_prefix="") 
    50     AC_ARG_WITH(vpr-exec-prefix, 
    51                 [  --with-vpr-exec-prefix=<PATH> 
    52                           Exec prefix where VPR is 
    53                           installed (optional)            [No default]], 
    54                 vpr_config_exec_prefix="$withval", vpr_config_exec_prefix="") 
     46    AC_ARG_WITH(vpr-meta-file, 
     47                [  --with-vpr-meta-file=<PATH>       Flagpoll metadata file 
     48                          for VPR (optional)            [No default]], 
     49                vpr_meta_file="$withval", vpr_meta_file="") 
    5550 
    56     if test "x$vpr_config_exec_prefix" != "x" ; then 
    57         vpr_config_args="$vpr_config_args --exec-prefix=$vpr_config_exec_prefix" 
    58  
    59         if test x${VPR_CONFIG+set} != xset ; then 
    60             VPR_CONFIG="$vpr_config_exec_prefix/bin/vpr-config" 
    61         fi 
     51    dnl See if the user specified where to find vapor 
     52    dnl if they didn't take a guess for them 
     53    if test "x$vpr_meta_file" != "x" ; then 
     54        vpr_flagpoll_args="--from-file=$vpr_meta_file" 
     55    else 
     56        vpr_flagpoll_args="--from-file=$instlinks/share/flagpoll/vpr.fpc" 
    6257    fi 
    6358 
    64     if test "x$vpr_config_prefix" != "x" ; then 
    65         vpr_config_args="$vpr_config_args --prefix=$vpr_config_prefix" 
     59    vpr_flagpoll_args="vpr $vpr_flagpoll_args" 
    6660 
    67         if test x${VPR_CONFIG+set} != xset ; then 
    68             VPR_CONFIG="$vpr_config_prefix/bin/vpr-config" 
    69         fi 
    70     fi 
    71  
    72     if test "x$VPR_BASE_DIR" != "x" ; then 
    73         vpr_config_args="$vpr_config_args --prefix=$VPR_BASE_DIR" 
    74  
    75         if test x${VPR_CONFIG+set} != xset ; then 
    76             VPR_CONFIG="$VPR_BASE_DIR/bin/vpr-config" 
    77         fi 
    78     fi 
    79  
    80     AC_PATH_PROG(VPR_CONFIG, vpr-config, no) 
     61    AC_PATH_PROG(FLAGPOLL, flagpoll, no) 
    8162    min_vpr_version=ifelse([$1], ,0.0.1,$1) 
    8263 
    83     dnl Do a sanity check to ensure that $VPR_CONFIG actually works. 
    84     if ! (eval $VPR_CONFIG --cxxflags >/dev/null 2>&1) 2>&1 ; then 
    85         VPR_CONFIG='no' 
     64    dnl Do a sanity check to ensure that all is well 
     65    if ! (eval $FLAGPOLL --help >/dev/null 2>&1) 2>&1 ; then 
     66        FLAGPOLL='no' 
    8667    fi 
    8768 
    8869    no_vpr='' 
    89     if test "x$VPR_CONFIG" = "xno" ; then 
     70    if test "x$FLAGPOLL" = "xno" ; then 
    9071        no_vpr=yes 
    9172    else 
    92         VPR_CXXFLAGS=`$VPR_CONFIG $vpr_config_args --cxxflags $ABI` 
    93         VPR_INCLUDES=`$VPR_CONFIG $vpr_config_args --includes` 
    94         VPR_LIBS_LD="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker`" 
    95         VPR_LIBS_CC="`$VPR_CONFIG $vpr_config_args --libs $ABI`" 
    96         VPR_PROF_LIBS_LD="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --profiled`" 
    97         VPR_PROF_LIBS_CC="`$VPR_CONFIG $vpr_config_args --libs $ABI --profiled`" 
    98         VPR_LIBS_STATIC_LD="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --static`" 
    99         VPR_LIBS_STATIC_CC="`$VPR_CONFIG $vpr_config_args --libs $ABI --static`" 
    100         VPR_PROF_LIBS_STATIC_LD="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --static --profiled`" 
    101         VPR_PROF_LIBS_STATIC_CC="`$VPR_CONFIG $vpr_config_args --libs $ABI --static --profiled`" 
    102         VPR_EXTRA_LIBS_CC=`$VPR_CONFIG $vpr_config_args --extra-libs $ABI` 
    103         VPR_EXTRA_LIBS_LD=`$VPR_CONFIG $vpr_config_args --extra-libs $ABI --linker` 
     73        VPR_CXXFLAGS="`$FLAGPOLL $vpr_flagpoll_args --cflags`" 
     74        VPR_LIBS="`$FLAGPOLL $vpr_flagpoll_args --get-libs`" 
     75        VPR_PROF_LIBS="`$FLAGPOLL $vpr_flagpoll_args --get-profiled-libs`" 
     76        VPR_LIBS_STATIC="`$FLAGPOLL $vpr_flagpoll_args --get-static-libs`" 
     77        VPR_PROF_LIBS_STATIC="`$FLAGPOLL $vpr_flagpoll_args --get-profiled-static-libs`" 
     78        VPR_EXTRA_LIBS=`$FLAGPOLL $vpr_flagpoll_args --get-extra-libs` 
    10479 
    105         VPR_CXXFLAGS_MIN=`$VPR_CONFIG $vpr_config_args --cxxflags $ABI --min` 
    106         VPR_INCLUDES_MIN=`$VPR_CONFIG $vpr_config_args --includes --min` 
    107         VPR_LIBS_LD_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --min`" 
    108         VPR_LIBS_CC_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --min`" 
    109         VPR_PROF_LIBS_LD_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --min --profiled`" 
    110         VPR_PROF_LIBS_CC_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --min --profiled`" 
    111         VPR_LIBS_STATIC_LD_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --static --min`" 
    112         VPR_LIBS_STATIC_CC_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --static --min`" 
    113         VPR_PROF_LIBS_STATIC_LD_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --linker --static --min --profiled`" 
    114         VPR_PROF_LIBS_STATIC_CC_MIN="`$VPR_CONFIG $vpr_config_args --libs $ABI --static --min --profiled`" 
    115         VPR_EXTRA_LIBS_CC_MIN=`$VPR_CONFIG $vpr_config_args --extra-libs $ABI --min` 
    116         VPR_EXTRA_LIBS_LD_MIN=`$VPR_CONFIG $vpr_config_args --extra-libs $ABI --linker --min` 
    117         VPR_VERSION=`$VPR_CONFIG --version` 
     80        VPR_SUBSYSTEM=`$FLAGPOLL $vpr_flagpoll_args --get-subsystem` 
     81        VPR_VERSION=`$FLAGPOLL $vpr_flagpoll_args --modversion` 
    11882 
    11983        DPP_VERSION_CHECK_MSG_NO_CACHE([VPR], [$VPR_VERSION], 
     
    12286 
    12387    if test "x$no_vpr" != x ; then 
    124         if test "$VPR_CONFIG" = "no" ; then 
     88        if test "$FLAGPOLL" = "no" ; then 
    12589            echo "*** The vpr-config script installed by VPR could not be found" 
    12690            echo "*** If VPR was installed in PREFIX, make sure PREFIX/bin is in" 
    127             echo "*** your path, or set the VPR_CONFIG environment variable to the" 
     91            echo "*** your path, or set the FLAGPOLL environment variable to the" 
    12892            echo "*** full path to vpr-config." 
    12993        fi 
    13094 
    13195        VPR_CXXFLAGS='' 
    132         VPR_LIBS_LD='' 
    133         VPR_LIBS_CC='' 
    134         VPR_PROF_LIBS_LD='' 
    135         VPR_PROF_LIBS_CC='' 
    136         VPR_LIBS_STATIC_LD='' 
    137         VPR_LIBS_STATIC_CC='' 
    138         VPR_PROF_LIBS_STATIC_LD='' 
    139         VPR_PROF_LIBS_STATIC_CC='' 
    140         VPR_EXTRA_LIBS_CC='' 
    141         VPR_EXTRA_LIBS_LD='' 
     96        VPR_LIBS='' 
     97        VPR_PROF_LIBS='' 
     98        VPR_LIBS_STATIC='' 
     99        VPR_PROF_LIBS_STATIC='' 
     100        VPR_EXTRA_LIBS='' 
    142101 
    143         VPR_CXXFLAGS_MIN='' 
    144         VPR_INCLUDES_MIN='' 
    145         VPR_LIBS_LD_MIN='' 
    146         VPR_LIBS_CC_MIN='' 
    147         VPR_PROF_LIBS_LD_MIN='' 
    148         VPR_PROF_LIBS_CC_MIN='' 
    149         VPR_LIBS_STATIC_LD_MIN='' 
    150         VPR_LIBS_STATIC_CC_MIN='' 
    151         VPR_PROF_LIBS_STATIC_LD_MIN='' 
    152         VPR_PROF_LIBS_STATIC_CC_MIN='' 
    153         VPR_EXTRA_LIBS_CC_MIN='' 
    154         VPR_EXTRA_LIBS_LD_MIN='' 
     102        VPR_SUBSYSTEM='' 
    155103        VPR_VERSION='-1' 
    156104        ifelse([$3], , :, [$3]) 
     
    158106 
    159107    AC_SUBST(VPR_CXXFLAGS) 
    160     AC_SUBST(VPR_INCLUDES) 
    161     AC_SUBST(VPR_LIBS_LD) 
    162     AC_SUBST(VPR_LIBS_CC) 
    163     AC_SUBST(VPR_PROF_LIBS_LD) 
    164     AC_SUBST(VPR_PROF_LIBS_CC) 
    165     AC_SUBST(VPR_LIBS_STATIC_LD) 
    166     AC_SUBST(VPR_LIBS_STATIC_CC) 
    167     AC_SUBST(VPR_PROF_LIBS_STATIC_LD) 
    168     AC_SUBST(VPR_PROF_LIBS_STATIC_CC) 
    169     AC_SUBST(VPR_EXTRA_LIBS_CC) 
    170     AC_SUBST(VPR_EXTRA_LIBS_LD) 
    171     AC_SUBST(VPR_CXXFLAGS_MIN) 
     108    AC_SUBST(VPR_LIBS) 
     109    AC_SUBST(VPR_PROF_LIBS) 
     110    AC_SUBST(VPR_LIBS_STATIC) 
     111    AC_SUBST(VPR_PROF_LIBS_STATIC) 
     112    AC_SUBST(VPR_EXTRA_LIBS) 
    172113 
    173     AC_SUBST(VPR_CXXFLAGS_MIN) 
    174     AC_SUBST(VPR_INCLUDES_MIN) 
    175     AC_SUBST(VPR_LIBS_LD_MIN) 
    176     AC_SUBST(VPR_LIBS_CC_MIN) 
    177     AC_SUBST(VPR_PROF_LIBS_LD_MIN) 
    178     AC_SUBST(VPR_PROF_LIBS_CC_MIN) 
    179     AC_SUBST(VPR_LIBS_STATIC_LD_MIN) 
    180     AC_SUBST(VPR_LIBS_STATIC_CC_MIN) 
    181     AC_SUBST(VPR_PROF_LIBS_STATIC_LD_MIN) 
    182     AC_SUBST(VPR_PROF_LIBS_STATIC_CC_MIN) 
    183     AC_SUBST(VPR_EXTRA_LIBS_CC_MIN) 
    184     AC_SUBST(VPR_EXTRA_LIBS_LD_MIN) 
     114    AC_SUBST(VPR_SUBSYSTEM) 
    185115    AC_SUBST(VPR_VERSION) 
    186116])