"Fossies" - the Fresh Open Source Software Archive

Member "pkg-config-0.29.2/check/check-relocatable" (19 Mar 2017, 2142 Bytes) of package /linux/misc/pkg-config-0.29.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "check-relocatable": 0.29.1_vs_0.29.2.

    1 #! /bin/sh
    2 
    3 set -e
    4 . ${srcdir}/common
    5 
    6 # Convert absolute directories to Windows format if necessary.
    7 if [ "$native_win32" = yes ]; then
    8     # Assume we have cmd to do the conversion, except we have to escape
    9     # the command switch on MSYS.
   10     [ "$OSTYPE" = msys ] && opt="\\/C" || opt="/C"
   11     abs_top_srcdir=$($WINE cmd $opt echo "$abs_top_srcdir" | tr -d '\r')
   12     abs_srcdir=$($WINE cmd $opt echo "$abs_srcdir" | tr -d '\r')
   13 fi
   14 
   15 # See if the pcfiledir variable is defined. First, with the path
   16 # built from the relative PKG_CONFIG_LIBDIR. Second, with the path
   17 # built from the full path to the pc file.
   18 RESULT=$srcdir
   19 run_test --variable=pcfiledir pcfiledir
   20 RESULT=$abs_srcdir
   21 run_test --variable=pcfiledir "$abs_srcdir/pcfiledir.pc"
   22 
   23 # Test if pcfiledir metadata variable is substituted correctly
   24 RESULT="-I${srcdir}/include -L${srcdir}/lib -lfoo"
   25 run_test --cflags --libs pcfiledir
   26 
   27 # Test prefix redefinition for .pc files in pkgconfig directory. Try .pc
   28 # files with both unexpanded and expanded variables. Use the absolute
   29 # directory for the search path so that pkg-config can strip enough
   30 # components of the file directory to be useful.
   31 PKG_CONFIG_LIBDIR="${abs_srcdir}/pkgconfig"
   32 for pkg in prefixdef prefixdef-expanded; do
   33     # Typical redefinition
   34     RESULT="-I${abs_top_srcdir}/include -L${abs_top_srcdir}/lib -lfoo"
   35     run_test --define-prefix --cflags --libs $pkg
   36 
   37     RESULT="-I/reloc/include -L/reloc/lib -lfoo"
   38     run_test --dont-define-prefix --cflags --libs $pkg
   39 
   40     # Non-standard redefinition
   41     RESULT="-I/reloc/include -L${abs_top_srcdir} -lfoo"
   42     run_test --define-prefix --prefix-variable=libdir --cflags --libs $pkg
   43 
   44     RESULT="-I/reloc/include -L/reloc/lib -lfoo"
   45     run_test --dont-define-prefix --cflags --libs $pkg
   46 done
   47 
   48 # Test prefix redefinition for .pc files with an empty prefix. In this
   49 # case, there should be no prefix adjustment to the other variables. The
   50 # result should be the same regardless of prefix redefinition.
   51 RESULT="-I/some/path/include -L/some/path/lib -lfoo"
   52 run_test --define-prefix --cflags --libs empty-prefix
   53 run_test --dont-define-prefix --cflags --libs empty-prefix