This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / Sysroot.U
CommitLineData
9c11722e
MB
1?RCS: $Id$
2?RCS:
3?RCS: You may distribute under the terms of either the GNU General Public
4?RCS: License or the Artistic License, as specified in the README file.
5?RCS:
bfa0199f 6?MAKE:sysroot: Head
9c11722e
MB
7?MAKE: -pick add $@ %<
8?S:sysroot:
9?S: This variable is empty unless supplied by the Configure user.
10?S: It can contain a path to an alternative root directory, under which
11?S: headers and libraries for the compilation target can be found. This
12?S: is generally used when cross-compiling using a gcc-like compiler.
13?S:.
9c11722e
MB
14?LINT:extern cc
15?LINT:extern cppflags
16?LINT:change cppflags
17?LINT:extern ccflags
18?LINT:change ccflags
19?LINT:extern ldflags
20?LINT:change ldflags
21?LINT:extern cccdlflags
bfa0199f
MB
22?X: _sysroot is later used in ccflags, but we do not want it in config.sh
23?T:var xxx path _sysroot
9c11722e
MB
24: Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
25: This is primarily meant for cross-compile environments, and may fail to be useful in other cases
26if test "X$sysroot" = X; then
27 sysroot=""
28else
29 case "$cc" in
30 *gcc*|*g++*)
31 echo "Using $sysroot to find your headers and libraries, adding to ccflags"
32 # _sysroot is used in places where we need --sysroot=foo
33 # but using the rest of the flags could cause issues.
34 _sysroot="--sysroot=$sysroot";
35 case "$ccflags" in
36 *sysroot*) ;;
37 'undef'|*)
38 ccflags="$ccflags $_sysroot"
39 esac
40 case "$ldflags" in
41 *sysroot*) ;;
42 'undef'|*)
43 ldflags="$ldflags $_sysroot"
44 esac
45 case "$cppflags" in
46 *sysroot*) ;;
47 'undef'|*)
48 cppflags="$cppflags $_sysroot"
49 esac
50 # lddlflags updated below in lddlflags section;
51 # same with cccdlflags
52 ;;
53 esac
54
55 # Adjust some defaults to also use $sysroot
56 for var in xlibpth loclibpth locincpth glibpth; do
57 eval xxx=\$$var
58 eval $var=''
59 for path in $xxx; do
60 eval $var=\"\$$var $sysroot$path\"
61 done
62 done
63
64fi
65