This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.0 alpha 9
[perl5.git] / cflags.SH
... / ...
CommitLineData
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.
22rm -f cflags
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
42
43also=': '
44case $# in
451) also='echo 1>&2 " CCCMD = "'
46esac
47
48case $# in
490) set *.c; echo "The current C flags are:" ;;
50esac
51
52set `echo "$* " | sed 's/\.[oc] / /g'`
53
54for file do
55
56 case "$#" in
57 1) ;;
58 *) echo $n " $file.c $c" ;;
59 esac
60
61 : allow variables like toke_cflags to be evaluated
62
63 eval 'eval ${'"${file}_cflags"'-""}'
64
65 : or customize here
66
67 case "$file" in
68 NDBM_File) ;;
69 ODBM_File) ;;
70 POSIX) ;;
71 SDBM_File) ;;
72 av) ;;
73 deb) ;;
74 dl) ;;
75 doio) ;;
76 doop) ;;
77 dump) ;;
78 gv) ;;
79 hv) ;;
80 main) ;;
81 malloc) ;;
82 mg) ;;
83 miniperlmain) ;;
84 op) ;;
85 perl) ;;
86 perlmain) ;;
87 perly) ;;
88 pp) ;;
89 regcomp) ;;
90 regexec) ;;
91 run) ;;
92 scope) ;;
93 sv) ;;
94 taint) ;;
95 toke) ;;
96 usersub) ;;
97 util) ;;
98 *) ;;
99 esac
100
101 echo "$cc -c $ccflags $optimize $large $split"
102 eval "$also "'"$cc -c $ccflags $optimize $large $split"'
103
104 . ./config.sh
105
106done
107!NO!SUBS!
108chmod +x cflags
109$eunicefix cflags