This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 4.0 patch 21: patch #20, continued
[perl5.git] / cflags.SH
CommitLineData
1c3d792e
LW
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)
2b317908 8 fi
11aea360 9 . ./config.sh
1c3d792e
LW
10 ;;
11esac
2b317908
LW
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.
1c3d792e
LW
14case "$0" in
15*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
16esac
2b317908
LW
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
1c3d792e
LW
41
42also=': '
43case $# in
2b317908 441) also='echo 1>&2 " CCCMD = "'
1c3d792e
LW
45esac
46
47case $# in
480) set *.c; echo "The current C flags are:" ;;
1c3d792e 49esac
2b317908
LW
50
51set `echo "$* " | sed 's/\.[oc] / /g'`
52
1c3d792e
LW
53for file do
54
55 case "$#" in
56 1) ;;
2b317908 57 *) echo $n " $file.c $c" ;;
1c3d792e
LW
58 esac
59
2b317908
LW
60 : allow variables like toke_cflags to be evaluated
61
62 eval 'eval ${'"${file}_cflags"'-""}'
63
64 : or customize here
65
1c3d792e 66 case "$file" in
2b317908
LW
67 array) ;;
68 cmd) ;;
69 cons) ;;
70 consarg) ;;
71 doarg) ;;
72 doio) ;;
73 dolist) ;;
74 dump) ;;
75 eval) ;;
76 form) ;;
77 hash) ;;
78 malloc) ;;
79 perl) ;;
80 perly) ;;
81 regcomp) ;;
82 regexec) ;;
83 stab) ;;
84 str) ;;
85 toke) ;;
86 usersub) ;;
87 util) ;;
88 tarray) ;;
89 tcmd) ;;
90 tcons) ;;
91 tconsarg) ;;
92 tdoarg) ;;
93 tdoio) ;;
94 tdolist) ;;
95 tdump) ;;
96 teval) ;;
97 tform) ;;
98 thash) ;;
99 tmalloc) ;;
100 tperl) ;;
101 tperly) ;;
102 tregcomp) ;;
103 tregexec) ;;
104 tstab) ;;
105 tstr) ;;
106 ttoke) ;;
107 tusersub) ;;
108 tutil) ;;
1c3d792e
LW
109 *) ;;
110 esac
111
2b317908
LW
112 echo "$cc -c $ccflags $optimize $large $split"
113 eval "$also "'"$cc -c $ccflags $optimize $large $split"'
114
115 . ./config.sh
116
1c3d792e 117done
2b317908
LW
118!NO!SUBS!
119chmod +x cflags
120$eunicefix cflags