This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Print CONFIGURE params in ExtUtils::MakeMaker output
[perl5.git] / cflags.SH
CommitLineData
a02608de 1case $PERL_CONFIG_SH in
1c3d792e 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 ;;
1c3d792e 13esac
2b317908
LW
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.
1c3d792e
LW
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
2b317908
LW
19echo "Extracting cflags (with variable substitutions)"
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.
165b7424 24rm -f cflags
2b317908 25$spitshell >cflags <<!GROK!THIS!
ecfc5424 26$startsh
2b317908
LW
27!GROK!THIS!
28
29: In the following dollars and backticks do not need the extra backslash.
30$spitshell >>cflags <<'!NO!SUBS!'
a02608de 31case $PERL_CONFIG_SH in
2b317908 32'')
a0d0e21e
LW
33 if test -f config.sh; then TOP=.;
34 elif test -f ../config.sh; then TOP=..;
35 elif test -f ../../config.sh; then TOP=../..;
36 elif test -f ../../../config.sh; then TOP=../../..;
37 elif test -f ../../../../config.sh; then TOP=../../../..;
38 else
39 echo "Can't find config.sh."; exit 1
40 fi
41 . $TOP/config.sh
42 ;;
43esac
44
45perltype=''
46optdebug='' # ensure -g used if building a -DDEBUGGING libperl
47case $# in
482) case $1 in
49 *perl.*) perltype='';;
50 *perld.*) perltype='-DDEBUGGING'; optdebug='-g' ;;
51 *perle.*) perltype='-DEMBED';;
52 *perlde.*) perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;;
53 *perlm.*) perltype='-DEMBED -DMULTIPLICITY';;
54 *perldm.*) perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;;
55 esac
56 shift ;;
2b317908 57esac
1c3d792e
LW
58
59also=': '
60case $# in
2b317908 611) also='echo 1>&2 " CCCMD = "'
1c3d792e
LW
62esac
63
64case $# in
650) set *.c; echo "The current C flags are:" ;;
1c3d792e 66esac
2b317908 67
578789a7 68set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g' -e "s/\\$obj_ext / /g"`
2b317908 69
1c3d792e
LW
70for file do
71
72 case "$#" in
73 1) ;;
2b317908 74 *) echo $n " $file.c $c" ;;
1c3d792e
LW
75 esac
76
2b317908
LW
77 : allow variables like toke_cflags to be evaluated
78
8736538c
AS
79 if echo $file | grep -v / >/dev/null
80 then
81 eval 'eval ${'"${file}_cflags"'-""}'
82 fi
2b317908
LW
83
84 : or customize here
85
1c3d792e 86 case "$file" in
a0d0e21e
LW
87 DB_File) ;;
88 GDBM_File) ;;
2304df62
AD
89 NDBM_File) ;;
90 ODBM_File) ;;
91 POSIX) ;;
92 SDBM_File) ;;
93 av) ;;
4b6be2dd 94 byterun) ;;
2304df62
AD
95 deb) ;;
96 dl) ;;
2b317908 97 doio) ;;
2304df62 98 doop) ;;
2b317908 99 dump) ;;
2304df62
AD
100 gv) ;;
101 hv) ;;
a6ec74c1 102 locale) ;;
2304df62 103 main) ;;
2b317908 104 malloc) ;;
2304df62
AD
105 mg) ;;
106 miniperlmain) ;;
a6ec74c1 107 numeric) ;;
2304df62 108 op) ;;
2b317908 109 perl) ;;
6f4183fe 110 perlapi) ;;
2304df62 111 perlmain) ;;
2b317908 112 perly) ;;
2304df62 113 pp) ;;
a0d0e21e
LW
114 pp_ctl) ;;
115 pp_hot) ;;
a6ec74c1 116 pp_pack) ;;
a0d0e21e 117 pp_sys) ;;
2b317908
LW
118 regcomp) ;;
119 regexec) ;;
2304df62
AD
120 run) ;;
121 scope) ;;
122 sv) ;;
123 taint) ;;
2b317908
LW
124 toke) ;;
125 usersub) ;;
126 util) ;;
1c3d792e
LW
127 *) ;;
128 esac
129
a0d0e21e
LW
130 if test "X$optdebug" != "X"; then
131 optimize="$optdebug"
132 fi
133
c4f23d77 134 : Can we perhaps use $ansi2knr here
5869b1f1
JH
135 echo "$cc -c -DPERL_CORE $ccflags $optimize $perltype"
136 eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $perltype"'
2b317908 137
a0d0e21e 138 . $TOP/config.sh
2b317908 139
1c3d792e 140done
2b317908 141!NO!SUBS!
a0d0e21e 142chmod 755 cflags
2b317908 143$eunicefix cflags