This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 6
[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.
68decaef 22rm -f cflags
2b317908
LW
23$spitshell >cflags <<!GROK!THIS!
24!GROK!THIS!
25
26: In the following dollars and backticks do not need the extra backslash.
27$spitshell >>cflags <<'!NO!SUBS!'
28case "$0" in
29*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
30esac
31case $CONFIG in
32'')
33 if test ! -f config.sh; then
34 ln ../config.sh . || \
35 ln ../../config.sh . || \
36 ln ../../../config.sh . || \
37 (echo "Can't find config.sh."; exit 1)
38 fi 2>/dev/null
39 . ./config.sh
40 ;;
41esac
1c3d792e
LW
42
43also=': '
44case $# in
2b317908 451) also='echo 1>&2 " CCCMD = "'
1c3d792e
LW
46esac
47
48case $# in
490) set *.c; echo "The current C flags are:" ;;
1c3d792e 50esac
2b317908
LW
51
52set `echo "$* " | sed 's/\.[oc] / /g'`
53
1c3d792e
LW
54for file do
55
56 case "$#" in
57 1) ;;
2b317908 58 *) echo $n " $file.c $c" ;;
1c3d792e
LW
59 esac
60
2b317908
LW
61 : allow variables like toke_cflags to be evaluated
62
63 eval 'eval ${'"${file}_cflags"'-""}'
64
65 : or customize here
66
1c3d792e 67 case "$file" in
2b317908
LW
68 array) ;;
69 cmd) ;;
70 cons) ;;
71 consarg) ;;
72 doarg) ;;
73 doio) ;;
74 dolist) ;;
75 dump) ;;
76 eval) ;;
77 form) ;;
78 hash) ;;
79 malloc) ;;
80 perl) ;;
81 perly) ;;
82 regcomp) ;;
83 regexec) ;;
84 stab) ;;
85 str) ;;
86 toke) ;;
87 usersub) ;;
88 util) ;;
89 tarray) ;;
90 tcmd) ;;
91 tcons) ;;
92 tconsarg) ;;
93 tdoarg) ;;
94 tdoio) ;;
95 tdolist) ;;
96 tdump) ;;
97 teval) ;;
98 tform) ;;
99 thash) ;;
100 tmalloc) ;;
101 tperl) ;;
102 tperly) ;;
103 tregcomp) ;;
104 tregexec) ;;
105 tstab) ;;
106 tstr) ;;
107 ttoke) ;;
108 tusersub) ;;
109 tutil) ;;
1c3d792e
LW
110 *) ;;
111 esac
112
2b317908
LW
113 echo "$cc -c $ccflags $optimize $large $split"
114 eval "$also "'"$cc -c $ccflags $optimize $large $split"'
115
116 . ./config.sh
117
1c3d792e 118done
2b317908
LW
119!NO!SUBS!
120chmod +x cflags
121$eunicefix cflags