Ticket #37878: library_path_test_2.diff

File library_path_test_2.diff, 1.5 KB (added by michaelld (Michael Dickens), 11 years ago)
  • config.tests/mac/library_path/library_path.test

    old new  
    55VERBOSE=$2
    66WORKDIR=$3
    77
     8done=no
    89cd $3
    910
    1011# (1) make the library
    1112if "$COMPILER" -dynamiclib -o library_path_lib.dylib library_path_lib.c; then
    1213    # (2) do the test, without LIBRARY_PATH; should fail
    13     if "$COMPILER" -nostdlib -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib; then
    14         true
     14    unset LIBRARY_PATH
     15    if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib; then
     16        echo "Compile seems to work even with LIBRARY_PATH not set; assuming LIBRARY_PATH works"
     17        done=yes
    1518    else
    16         # (3) do the test, with LIBRARY_PATH set; should pass
     19        # (3) do the test, with LIBRARY_PATH now set; should pass
    1720        export LIBRARY_PATH=.
    18         if "$COMPILER" -nostdlib -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib; then
     21        if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib; then
    1922            LIBRARY_PATH_SUPPORT=yes
    2023        fi
    2124    fi
    2225    rm -f library_path_test.o library_path_test
    2326else
    2427    echo "Unable to compile library; assuming LIBRARY_PATH works"
    25     exit 1
     28    done=yes
    2629fi
    2730rm -f library_path_lib.dylib library_path_lib.o
    2831
     32# if done above, assume it works and exit
     33[ "$done" = "yes" ] && exit 1
     34
    2935if [ "$LIBRARY_PATH_SUPPORT" != "yes" ]; then
    3036    [ "$VERBOSE" = "yes" ] && echo "LIBRARY_PATH support not detected"
    3137    exit 0