This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove "" from command line args
[perl5.git] / x2p / cflags.SH
CommitLineData
2b317908
LW
1case $CONFIG in
2'')
a0d0e21e
LW
3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
8 else
9 echo "Can't find config.sh."; exit 1
10 fi
11 . $TOP/config.sh
12 ;;
2b317908
LW
13esac
14: This forces SH files to create target in same directory as SH file.
15: This is so that make depend always knows where to find SH derivatives.
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
a0d0e21e 19echo "Extracting x2p/cflags (with variable substitutions)"
2b317908
LW
20: This section of the file will have variable substitutions done on it.
21: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
22: Protect any dollar signs and backticks that you do not want interpreted
23: by putting a backslash in front. You may delete these comments.
24$spitshell >cflags <<!GROK!THIS!
25!GROK!THIS!
26
27: In the following dollars and backticks do not need the extra backslash.
28$spitshell >>cflags <<'!NO!SUBS!'
2b317908
LW
29case $CONFIG in
30'')
a0d0e21e
LW
31 if test -f config.sh; then TOP=.;
32 elif test -f ../config.sh; then TOP=..;
33 elif test -f ../../config.sh; then TOP=../..;
34 elif test -f ../../../config.sh; then TOP=../../..;
35 elif test -f ../../../../config.sh; then TOP=../../../..;
36 else
37 echo "Can't find config.sh."; exit 1
38 fi
39 . $TOP/config.sh
40 ;;
2b317908
LW
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
4633a7c4 52set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g'`
2b317908
LW
53
54for file do
55
56 case "$#" in
57 1) ;;
58 *) echo $n " $file.c $c" ;;
59 esac
60
61 : allow variables like str_cflags to be evaluated
62
63 eval 'eval ${'"${file}_cflags"'-""}'
64
65 : or customize here
66
67 case "$file" in
68 a2p) ;;
69 a2py) ;;
70 hash) ;;
71 str) ;;
72 util) ;;
73 walk) ;;
74 *) ;;
75 esac
76
a0d0e21e
LW
77 ccflags="`echo $ccflags | sed -e 's/-DEMBED//'`"
78
2b317908
LW
79 echo "$cc -c $ccflags $optimize $large $split"
80 eval "$also "'"$cc -c $ccflags $optimize $large $split"'
81
a0d0e21e 82 . $TOP/config.sh
2b317908
LW
83
84done
85!NO!SUBS!
a0d0e21e 86chmod 755 cflags
2b317908 87$eunicefix cflags