[comp.lang.perl] cflags

victor@watson.ibm.com (Victor Miller) (06/15/91)

I've had a working perl 4.003.  I just got patches 4 through 10 from
devvax, and applied them.  I did a make clean, then a Configure, make
depend, and make.  However, after running bison make dies as follows:

`sh cflags perly.o` perly.c
cflags: cflags: cannot open
*** Exit 1

There is NO cflags in the perl directory.  There is a cflags.SH.  I
tried a

	ln cflags.SH cflags

and then make gives:

`sh cflags perly.o` perly.c
          CFLAGS =  -Hpcc -O
sh: -Hpcc: not found
*** Exit 1

From looking at patch04 I find that there has been a change from
cflags to cflags.SH and and cflags.SH now puts out the name of the
compiler.  Why didn't the patch update my stuff?  The only thing that
I can think, is that I had customized cflags.SH to remove the -O flag
for certain programs (because the compiler couldn't hack it).  What
should I do?
--
			Victor S. Miller
			Vnet and Bitnet:  VICTOR at WATSON
			Internet: victor@watson.ibm.com
			IBM, TJ Watson Research Center

lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) (06/16/91)

In article <VICTOR.91Jun14145621@irt.watson.ibm.com> victor@watson.ibm.com writes:
: I've had a working perl 4.003.  I just got patches 4 through 10 from
: devvax, and applied them.  I did a make clean, then a Configure, make
: depend, and make.  However, after running bison make dies as follows:
: 
: `sh cflags perly.o` perly.c
: cflags: cflags: cannot open
: *** Exit 1
: 
: There is NO cflags in the perl directory.  There is a cflags.SH.  I
: tried a
: 
: 	ln cflags.SH cflags
: 
: and then make gives:
: 
: `sh cflags perly.o` perly.c
:           CFLAGS =  -Hpcc -O
: sh: -Hpcc: not found
: *** Exit 1
: 
: From looking at patch04 I find that there has been a change from
: cflags to cflags.SH and and cflags.SH now puts out the name of the
: compiler.  Why didn't the patch update my stuff?  The only thing that
: I can think, is that I had customized cflags.SH to remove the -O flag
: for certain programs (because the compiler couldn't hack it).  What
: should I do?

Well, your cflags.SH may be trashed by now, since cflags.SH now writes cflags,
and you linked them.  Your mistake was probably back when you didn't notice
that a patch failed.  There might even be a reject file out there still.

Here's what cflags.SH should look like:

#! /bin/sh
echo Extracting cflags.SH
sed >cflags.SH <<'!STUFFY!FUNK!' -e 's/X//'
Xcase $CONFIG in
X'')
X    if test ! -f config.sh; then
X	ln ../config.sh . || \
X	ln ../../config.sh . || \
X	ln ../../../config.sh . || \
X	(echo "Can't find config.sh."; exit 1)
X    fi
X    . config.sh
X    ;;
Xesac
X: This forces SH files to create target in same directory as SH file.
X: This is so that make depend always knows where to find SH derivatives.
Xcase "$0" in
X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
Xesac
Xecho "Extracting cflags (with variable substitutions)"
X: This section of the file will have variable substitutions done on it.
X: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
X: Protect any dollar signs and backticks that you do not want interpreted
X: by putting a backslash in front.  You may delete these comments.
X$spitshell >cflags <<!GROK!THIS!
X!GROK!THIS!
X
X: In the following dollars and backticks do not need the extra backslash.
X$spitshell >>cflags <<'!NO!SUBS!'
Xcase "$0" in
X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
Xesac
Xcase $CONFIG in
X'')
X    if test ! -f config.sh; then
X	ln ../config.sh . || \
X	ln ../../config.sh . || \
X	ln ../../../config.sh . || \
X	(echo "Can't find config.sh."; exit 1)
X    fi 2>/dev/null
X    . ./config.sh
X    ;;
Xesac
X
Xalso=': '
Xcase $# in
X1) also='echo 1>&2 "	  CCCMD = "'
Xesac
X
Xcase $# in
X0) set *.c; echo "The current C flags are:" ;;
Xesac
X
Xset `echo "$* " | sed 's/\.[oc] / /g'`
X
Xfor file do
X
X    case "$#" in
X    1) ;;
X    *) echo $n "    $file.c	$c" ;;
X    esac
X
X    : allow variables like toke_cflags to be evaluated
X
X    eval 'eval ${'"${file}_cflags"'-""}'
X
X    : or customize here
X
X    case "$file" in
X    array) ;;
X    cmd) ;;
X    cons) ;;
X    consarg) ;;
X    doarg) ;;
X    doio) ;;
X    dolist) ;;
X    dump) ;;
X    eval) ;;
X    form) ;;
X    hash) ;;
X    malloc) ;;
X    perl) ;;
X    perly) ;;
X    regcomp) ;;
X    regexec) ;;
X    stab) ;;
X    str) ;;
X    toke) ;;
X    usersub) ;;
X    util) ;;
X    tarray) ;;
X    tcmd) ;;
X    tcons) ;;
X    tconsarg) ;;
X    tdoarg) ;;
X    tdoio) ;;
X    tdolist) ;;
X    tdump) ;;
X    teval) ;;
X    tform) ;;
X    thash) ;;
X    tmalloc) ;;
X    tperl) ;;
X    tperly) ;;
X    tregcomp) ;;
X    tregexec) ;;
X    tstab) ;;
X    tstr) ;;
X    ttoke) ;;
X    tusersub) ;;
X    tutil) ;;
X    *) ;;
X    esac
X
X    echo "$cc -c $ccflags $optimize $large $split"
X    eval "$also "'"$cc -c $ccflags $optimize $large $split"'
X
X    . ./config.sh
X
Xdone
X!NO!SUBS!
Xchmod +x cflags
X$eunicefix cflags
!STUFFY!FUNK!
exit