This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure: eliminate some left over debug output
[metaconfig.git] / U / perl / Mksymlinks.U
1 ?RCS:
2 ?RCS: $Id$
3 ?RCS:
4 ?RCS: Copyright (c) 2000, Jarkko Hietaniemi
5 ?RCS:
6 ?X:
7 ?X: This unit tries to create a symlink tree on a -Dmksymlinks request
8 ?X: to Configure
9 ?X:
10 ?MAKE:Mksymlinks: lns issymlink src
11 ?MAKE:  -pick add $@ %<
12 ?T:dir source file
13 ?LINT:extern mksymlinks
14 : Make symlinks util
15 case "$mksymlinks" in
16 $define|true|[yY]*)
17         case "$src" in
18         ''|'.') echo "Cannot create symlinks in the original directory." >&4
19                 exit 1
20                 ;;
21         *)      case "$lns:$issymlink" in
22                 *"ln"*" -s:"*"test -"?)
23                         echo "Creating the symbolic links..." >&4
24                         cd ..
25                         awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: \1:' |
26                         awk 'NF == 1 {
27                                 dir=".";
28                                 file=$1 "";
29                              }
30                              NF == 2 {
31                                 dir=$1 "";
32                                 file=$2 "";
33                              }
34                              {
35                                  print "# dir = ", dir, "file = ", file
36                                  mf[dir] = mf[dir]" "source"/"dir"/"file;
37                              } END {
38                                  for (d in mf) {
39                                      if (d != ".") { print("mkdir -p "d) }
40                                      print("ln -sf "mf[d]" "d);
41                                  }
42                              }' source="$src" > UU/mksymlinks.$$
43                         sh UU/mksymlinks.$$
44                         rm UU/mksymlinks.$$
45                         # Sanity check 1.
46                         if test ! -d t/base; then
47                                 echo "Failed to create the subdirectories.  Aborting." >&4
48                                 exit 1
49                         fi
50                         # Sanity check 2.
51                         if test ! -f t/base/lex.t; then
52                                 echo "Failed to create the symlinks (t/base/lex.t missing).  Aborting." >&4
53                                 exit 1
54                         fi
55                         if test ! -f win32/win32.c; then
56                                 echo "Failed to create the symlinks (win32/win32.c missing).  Aborting." >&4
57                                 exit 1
58                         fi
59                         cd UU
60                         ;;
61                 *)      echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
62                         ;;
63                 esac
64                 ;;
65         esac
66         ;;
67 esac
68