Changeset 3800


Ignore:
Timestamp:
May 4, 2019, 9:12:42 AM (5 months ago)
Author:
Peter
Message:

allow multiple arguments in yat-config. closes #911

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build_support/yat-config.in

    r3792 r3800  
    22
    33# Copyright (C) 2008 Jari Häkkinen, Peter Johansson
    4 # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2017 Peter Johansson
     4# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2019 Peter Johansson
    55#
    66# This file is part of the yat library, http://dev.thep.lu.se/yat
     
    9797fi
    9898
    99 flags=""
     99output=""
    100100
    101101while test $# -gt 0; do
    102102    case "$1" in
    103103    --prefix)
    104     echo $prefix
    105     exit 0
     104    output="$output $prefix"
    106105    ;;
    107106    --bindir)
    108     echo $bindir
    109     exit 0
     107    output="$output $bindir"
    110108    ;;
    111109    --includedir)
    112     echo $includedir
    113     exit 0
     110    output="$output $includedir"
    114111    ;;
    115112    --libdir)
    116     echo $libdir
    117     exit 0
     113    output="$output $libdir"
    118114    ;;
    119115    --cxx)
    120     echo $CXX
    121     exit 0
     116    output="$output $CXX"
    122117    ;;
    123118    --cxxcpp)
    124     echo $CXXCPP
    125     exit 0
     119    output="$output $CXXCPP"
    126120    ;;
    127121    --cppflags)
     
    140134       fi
    141135       if test x"$add_path" = x"yes"; then
    142          flags="$flags -I$includedir"
     136         output="$output -I$includedir"
    143137       fi
    144138    else
     
    147141       # include generated files simply as "generated.h".
    148142       if test "x$abs_top_builddir" != "x$abs_top_srcdir"; then
    149           flags="$flags -I$abs_top_builddir"
    150           flags="$flags -I$abs_top_builddir/yat/utility"
     143          output="$output -I$abs_top_builddir"
     144          output="$output -I$abs_top_builddir/yat/utility"
    151145       fi
    152        flags="$flags -I$abs_top_srcdir"
     146       output="$output -I$abs_top_srcdir"
    153147    fi
    154     flags="$flags $YAT_CPPFLAGS $CPPFLAGS $YAT_CONFIG_CPPFLAGS"
     148    output="$output $YAT_CPPFLAGS $CPPFLAGS $YAT_CONFIG_CPPFLAGS"
    155149    ;;
    156150    --cxxflags)
    157     flags="$flags $YAT_CXXFLAGS $CXXFLAGS $YAT_CONFIG_CXXFLAGS"
     151    output="$output $YAT_CXXFLAGS $CXXFLAGS $YAT_CONFIG_CXXFLAGS"
    158152    ;;
    159153    --libs)
    160     flags="$flags -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $YAT_CBLAS_LIB $LIBM $LIBS"
     154    output="$output -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $YAT_CBLAS_LIB $LIBM $LIBS"
    161155    ;;
    162156    --libs-without-cblas)
    163     flags="$flags -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $LIBM $LIBS"
     157    output="$output -lyat $YAT_STATIC_LIBS $YAT_PRIMARY_LIBS $LIBM $LIBS"
    164158    ;;
    165159    --ldflags)
     
    170164      : # ignore '/usr/local/lib' if we use g++
    171165    else
    172       flags="$flags -L$libdir"
     166      output="$output -L$libdir"
    173167    fi
    174     flags="$flags $YAT_LDFLAGS $LDFLAGS $YAT_CONFIG_LDFLAGS"
     168    output="$output $YAT_LDFLAGS $LDFLAGS $YAT_CONFIG_LDFLAGS"
    175169    ;;
    176170    --link-libtool)
    177     flags="$flags $LA_FILE $YAT_STATIC_LIBS $YAT_CBLAS_LIB"
     171    output="$output $LA_FILE $YAT_STATIC_LIBS $YAT_CBLAS_LIB"
    178172    ;;
    179173    --yat-la-file)
    180     flags="$flags $LA_FILE"
     174    output="$output $LA_FILE"
    181175    ;;
    182176    --atleast-version=*)
     
    243237done
    244238
    245 echo $flags
     239echo $output
    246240exit 0
  • trunk/test/yat_config_test.sh

    r3188 r3800  
    4848grep lgsl stdout || exit_fail
    4949
     50sh $prog --cxx > expected.txt
     51sh $prog --cppflags >> expected.txt
     52sh $prog --cxxflags >> expected.txt
     53cat expected.txt
     54tr ' \t' '\n\n' < expected.txt | sort -u | grep '[a-z]' > expected2.txt
     55cat expected2.txt
     56run sh 0 $prog --cxx --cppflags --cxxflags
     57tr ' \t' '\n\n' < stdout | sort -u | grep '[a-z]' > stdout2
     58cat stdout2
     59diff -u expected2.txt stdout2 || exit_fail
     60
    5061exit_success
Note: See TracChangeset for help on using the changeset viewer.