File: bug_62343.at

package info (click to toggle)
libtool 2.5.4-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,724 kB
  • sloc: sh: 58,532; ansic: 4,292; makefile: 828
file content (67 lines) | stat: -rw-r--r-- 1,999 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# bug_62343.at -- bug 62343   -*- Autotest -*-

#   Copyright (C) 2024 Free Software Foundation, Inc.
#
#   This file is part of GNU Libtool.
#
# GNU Libtool is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# GNU Libtool is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool.  If not, see <https://www.gnu.org/licenses/>.
####

AT_BANNER([Testing bug 62343:])

AT_SETUP([Use -no-canonical-prefixes flag])

AT_CHECK([$LIBTOOL --config | $EGREP '^build_libtool_libs=no' && (exit 77)], 1)

AT_DATA([x.cpp],
[[
#include <iostream>

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
]])

# The -no-canonical-prefixes flag sometimes fails at the compiler level
# depending on how the environment is set up, or which other flags have to be passed.
# So first try to compile without libtool first to test if the current environment
# supports the -no-canonical-prefixes flag. If it doesn't, skip the test.

$CXX -no-canonical-prefixes -c x.cpp

result=$?

if test 0 -ne "$result"; then
    AT_SKIP_IF([:])
fi

AT_CHECK([$LIBTOOL --mode=compile --tag=CXX $CXX -no-canonical-prefixes -c x.cpp], [0], [stdout], [stderr])

AT_CHECK([$GREP -- '-no-canonical-prefixes' stdout], [0], [ignore])

host_flags=:
case $host_os in
  cygwin* | mingw* | windows*)
    host_flags=-no-undefined
    ;;
  *)
    ;;
esac

AT_CHECK([$LIBTOOL --mode=link --tag=CXX $CXX -no-canonical-prefixes $host_flags -o libx.la -rpath /usr/lib64/ x.lo], [0], [stdout], [stderr])

AT_CHECK([$GREP -- '-no-canonical-prefixes' stdout], [0], [ignore])

AT_CLEANUP