source: trunk/third/perl/cflags.SH @ 10724

Revision 10724, 3.0 KB checked in by ghudson, 27 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r10723, which included commits to RCS files with non-trunk default branches.
Line 
1case $CONFIG in
2'')
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        ;;
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
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.
24rm -f cflags
25$spitshell >cflags <<!GROK!THIS!
26$startsh
27!GROK!THIS!
28
29: In the following dollars and backticks do not need the extra backslash.
30$spitshell >>cflags <<'!NO!SUBS!'
31case $CONFIG in
32'')
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 ;;
57esac
58
59also=': '
60case $# in
611) also='echo 1>&2 "      CCCMD = "'
62esac
63
64case $# in
650) set *.c; echo "The current C flags are:" ;;
66esac
67
68set `echo "$* " | sed -e 's/\.[oc] / /g' -e 's/\.obj / /g'`
69
70for file do
71
72    case "$#" in
73    1) ;;
74    *) echo $n "    $file.c     $c" ;;
75    esac
76
77    : allow variables like toke_cflags to be evaluated
78
79    eval 'eval ${'"${file}_cflags"'-""}'
80
81    : or customize here
82
83    case "$file" in
84    DB_File) ;;
85    GDBM_File) ;;
86    NDBM_File) ;;
87    ODBM_File) ;;
88    POSIX) ;;
89    SDBM_File) ;;
90    av) ;;
91    deb) ;;
92    dl) ;;
93    doio) ;;
94    doop) ;;
95    dump) ;;
96    gv) ;;
97    hv) ;;
98    main) ;;
99    malloc) ;;
100    mg) ;;
101    miniperlmain) ;;
102    op) ;;
103    perl) ;;
104    perlmain) ;;
105    perly) ;;
106    pp) ;;
107    pp_ctl) ;;
108    pp_hot) ;;
109    pp_sys) ;;
110    regcomp) ;;
111    regexec) ;;
112    run) ;;
113    scope) ;;
114    sv) ;;
115    taint) ;;
116    toke) ;;
117    usersub) ;;
118    util) ;;
119    *) ;;
120    esac
121
122        if test "X$optdebug" != "X"; then
123                optimize="$optdebug"
124        fi
125
126    echo "$cc -c -DPERL_CORE $ccflags $optimize $perltype $large $split"
127    eval "$also "'"$cc -DPERL_CORE -c $ccflags $optimize $perltype $large $split"'
128
129    . $TOP/config.sh
130
131done
132!NO!SUBS!
133chmod 755 cflags
134$eunicefix cflags
Note: See TracBrowser for help on using the repository browser.