Commit | Line | Data |
---|---|---|
68f55076 JH |
1 | ?RCS: |
2 | ?RCS: $Id$ | |
3 | ?RCS: | |
4 | ?RCS: Copyright (c) 2000, Jarkko Hietaniemi | |
5 | ?RCS: | |
6 | ?X: | |
7 | ?X: This unit produces a bit of shell code that must be dotted in order | |
8 | ?X: to make quick check on whether the current C compiler is working. | |
9 | ?X: | |
628b34e8 | 10 | ?MAKE:Mksymlinks: lns issymlink src |
68f55076 JH |
11 | ?MAKE: -pick add $@ %< |
12 | ?T: directory filename | |
13 | ?LINT:extern mksymlinks | |
14 | ||
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 | ;; | |
628b34e8 | 21 | *) case "$lns:$issymlink" in |
44726213 | 22 | *"ln"*" -s:"*"test -"?) |
68f55076 JH |
23 | echo "Creating the symbolic links..." >&4 |
24 | echo "(First creating the subdirectories...)" >&4 | |
25 | cd .. | |
26 | awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do | |
27 | read directory | |
28 | test -z "$directory" && break | |
29 | mkdir -p $directory | |
30 | done | |
31 | # Sanity check 1. | |
32 | if test ! -d t/base; then | |
33 | echo "Failed to create the subdirectories. Aborting." >&4 | |
34 | exit 1 | |
35 | fi | |
36 | echo "(Then creating the symlinks...)" >&4 | |
37 | awk '{print $1}' $src/MANIFEST | while true; do | |
38 | read filename | |
39 | test -z "$filename" && break | |
40 | if test -f $filename; then | |
12e20a24 | 41 | if $issymlink $filename; then |
68f55076 JH |
42 | rm -f $filename |
43 | fi | |
44 | fi | |
45 | if test -f $filename; then | |
46 | echo "$filename already exists, not symlinking." | |
47 | else | |
48 | ln -s $src/$filename $filename | |
49 | fi | |
50 | done | |
51 | # Sanity check 2. | |
0aac658d JH |
52 | if test ! -f t/base/lex.t; then |
53 | echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4 | |
68f55076 JH |
54 | exit 1 |
55 | fi | |
56 | cd UU | |
57 | ;; | |
58 | *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4 | |
59 | ;; | |
60 | esac | |
61 | ;; | |
62 | esac | |
63 | ;; | |
64 | esac | |
65 |