perl 4.0 patch 14: patch #11, continued
[p5sagit/p5-mst-13.2.git] / x2p / cflags.SH
CommitLineData
2b317908 1case $CONFIG in
2'')
3 if test ! -f config.sh; then
4 ln ../config.sh . || \
5 ln ../../config.sh . || \
6 ln ../../../config.sh . || \
7 (echo "Can't find config.sh."; exit 1)
8 fi
9 . config.sh
10 ;;
11esac
12: This forces SH files to create target in same directory as SH file.
13: This is so that make depend always knows where to find SH derivatives.
14case "$0" in
15*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
16esac
17echo "Extracting cflags (with variable substitutions)"
18: This section of the file will have variable substitutions done on it.
19: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
20: Protect any dollar signs and backticks that you do not want interpreted
21: by putting a backslash in front. You may delete these comments.
22$spitshell >cflags <<!GROK!THIS!
23!GROK!THIS!
24
25: In the following dollars and backticks do not need the extra backslash.
26$spitshell >>cflags <<'!NO!SUBS!'
27case "$0" in
28*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
29esac
30case $CONFIG in
31'')
32 if test ! -f config.sh; then
33 ln ../config.sh . || \
34 ln ../../config.sh . || \
35 ln ../../../config.sh . || \
36 (echo "Can't find config.sh."; exit 1)
37 fi 2>/dev/null
38 . ./config.sh
39 ;;
40esac
41
42also=': '
43case $# in
441) also='echo 1>&2 " CCCMD = "'
45esac
46
47case $# in
480) set *.c; echo "The current C flags are:" ;;
49esac
50
51set `echo "$* " | sed 's/\.[oc] / /g'`
52
53for file do
54
55 case "$#" in
56 1) ;;
57 *) echo $n " $file.c $c" ;;
58 esac
59
60 : allow variables like str_cflags to be evaluated
61
62 eval 'eval ${'"${file}_cflags"'-""}'
63
64 : or customize here
65
66 case "$file" in
67 a2p) ;;
68 a2py) ;;
69 hash) ;;
70 str) ;;
71 util) ;;
72 walk) ;;
73 *) ;;
74 esac
75
76 echo "$cc -c $ccflags $optimize $large $split"
77 eval "$also "'"$cc -c $ccflags $optimize $large $split"'
78
79 . ./config.sh
80
81done
82!NO!SUBS!
83chmod +x cflags
84$eunicefix cflags