Re: patch for configure for enabling of pl/tcl unknown support - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: patch for configure for enabling of pl/tcl unknown support
Date
Msg-id 200105092147.f49LlxF22597@candle.pha.pa.us
Whole thread Raw
In response to patch for configure for enabling of pl/tcl unknown support  (<seva@sevasoft.kiev.ua>)
List pgsql-patches
> >     tcl_unknown: $(top_builddir)/src/Makefile.global \
> >             modules/pltcl_loadmod.in \
> >             modules/pltcl_delmod.in \
> >             modules/pltcl_listmod.in
> >     ifeq ($(enable_pltcl_unknown), yes)
> >             sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_loadmod.in > modules/pltcl_$
> >             sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_delmod.in > modules/pltcl_d$
> >             sed -e 's,@TCLSH@,$(TCLSH),g' modules/pltcl_listmod.in > modules/pltcl_$
> >             chmod a+x modules/pltcl_loadmod modules/pltcl_delmod modules/pltcl_list$
> >     endif
>
> Probably something like this:
>
> all: pltcl_loadmod pltcl_delmod pltcl_listmod
>
> pltcl_%mod: pltcl_%mod.in
>     sed 's/@TCLSH@/$(TCLSH)/g' $< >$@
>
> Do they need to be executable?  I don't know exactly how this "unknown"
> thing works anyway, I'll probably take a look later.  As long as it
> doesn't break anything now.  ;-)

I did much better than that because I didn't want to generate those
files unless they asked for unknown.  I did:

    ifeq ($(enable_pltcl_unknown), yes)
    override CPPFLAGS+= -DPLTCL_UNKNOWN_SUPPORT
    TCL_UNKNOWN_MODS=       modules/pltcl_loadmod \
                            modules/pltcl_delmod \
                            modules/pltcl_listmod
    endif

and later:

    all: $(INFILES) $(TCL_UNKNOWN_MODS)

    modules/pltcl_loadmod: modules/pltcl_loadmod.in \
            $(top_builddir)/src/Makefile.global
            sed -e 's,@TCLSH@,$(TCLSH),g' \
              $< >$@
            chmod a+x $@
    ...

Yes, they are tcl scripts so they have to be executable.  That is what
the author had.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: JDBC part of KOI8-U [was: patch to support KOI8-U <==> UTF-8 conversions (2nd try)]
Next
From: Peter Eisentraut
Date:
Subject: Re: patch for configure for enabling of pl/tcl unknown support