Re: failing to build preproc.c on solaris with sun studio - Mailing list pgsql-hackers

From Justin Pryzby
Subject Re: failing to build preproc.c on solaris with sun studio
Date
Msg-id 20220914043419.GV31833@telsasoft.com
Whole thread Raw
In response to Re: failing to build preproc.c on solaris with sun studio  (Thomas Munro <thomas.munro@gmail.com>)
Responses Re: failing to build preproc.c on solaris with sun studio
List pgsql-hackers
On Wed, Sep 14, 2022 at 03:08:06PM +1200, Thomas Munro wrote:
> On Wed, Sep 14, 2022 at 10:23 AM Thomas Munro <thomas.munro@gmail.com> wrote:
> > Given the simplicity of this case, though, I suppose we could
> > have a little not-very-general shell/python/whatever wrapper script --
> > just compute a checksum of the input and keep the output files around.
> 
> Something as dumb as this perhaps...

> if [ -z "$c_file" ] ; then
>    c_file="(echo "$y_file" | sed 's/\.y/.tab.c/')"
> fi

This looks wrong.  I guess you mean to use $() and missing "$" ?

It could be:
[ -z "$c_file" ] &&
    c_file=${y_file%.y}.tab.c

> if [ -z "$SIMPLE_BISON_CACHE_PATH" ] ; then
>     SIMPLE_BISON_CACHE_PATH="/tmp/simple-bison-cache"
> fi

Should this default to CCACHE_DIR?  Then it would work under cirrusci...

> h_file="$(echo $c_file | sed 's/\.c/.h/')"

Could be ${c_file%.c}.h

> if [ ! -e "$cached_c_file" -o ! -e "$cached_h_file" ] ; then

You could write the easy case first (I forget whether it's considered to
be more portable to write && outside of []).

> if [ -e "$cached_c_file" ] && [ -e "$cached_h_file" ] ; then

I can't see what part of this would fail to handle filenames with spaces
(?)

-- 
Justin



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: build remaining Flex files standalone
Next
From: Tom Lane
Date:
Subject: Re: Expand palloc/pg_malloc API