Re: [PATCHES] plperl win32

2004-07-16 Thread Bruce Momjian

Magnus, why is this reassignment needed, basically the 'else' part:

! ifeq ($(PORTNAME), win32)
! xperl_archlibexp=$(subst \,/,$(perl_archlibexp))
! xperl_privlibexp=$(subst \,/,$(perl_privlibexp))
! perl_embed_ldflags=-L $(xperl_archlibexp)/CORE -lperl58
! else
! xperl_archlibexp=$(perl_archlibxep)
! xperl_privlibexp=$(perl_privlibexp)
! endif


---

Magnus Hagander wrote:
 Here is a patch required to build plperl with win32. The issues were:
 
 * perl_useshrplib gets set to yes and not to true. I assume it's set
 to true on unix, so I left both.
 * Need to translate backslashes into slashes
 * The linker config coming out of perl was for MSVC and not for mingw
 
 
 Some of this is pretty ugly stuff - the reassigning into a second
 variable etc. If somebody with a little better makefile knowledge
 would clean that up (if it can be, but it should be possible), please
 do!
 
 
 //Magnus
  
  plperl_win32.patch 

Content-Description: plperl_win32.patch

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 8: explain analyze is your friend

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] plperl win32

2004-07-16 Thread Magnus Hagander

Magnus, why is this reassignment needed, basically the 'else' part:

! ifeq ($(PORTNAME), win32)
! xperl_archlibexp=$(subst \,/,$(perl_archlibexp))
! xperl_privlibexp=$(subst \,/,$(perl_privlibexp))
! perl_embed_ldflags=-L $(xperl_archlibexp)/CORE -lperl58
! else
! xperl_archlibexp=$(perl_archlibxep)
! xperl_privlibexp=$(perl_privlibexp)
! endif


Most likely because I'm not experienced enough at writing makefiles ;-)

I originally tried the approach with
ifeq ($(PORTNAME),win32)
perl_archlibexp=$(subst, \,/,$(perl_archlibexp))
...

but then make complained about recursive assignment of the variable. If
there is a simple way to get around that, it wouldn't be necessary.
Since I didn't know of one, I had to change the name of the variable,
which in turned required the part under else, so I didn't have to ifeq
the actual build rule.

//Magnus

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] plperl win32

2004-07-16 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes:
 I originally tried the approach with
 ifeq ($(PORTNAME),win32)
 perl_archlibexp=$(subst, \,/,$(perl_archlibexp))
 ...

 but then make complained about recursive assignment of the variable. If
 there is a simple way to get around that, it wouldn't be necessary.

Use := not = ...

When you write foo = something, you are defining something that acts
like a macro rather than a constant string, and so the above is a
self-referential macro.  In particular $(x) references are not expanded
yet in something that's assigned with =.

Here is an example of the difference:

x = foo
y = bar$(x)
x = baz

If you now evaluate $(y) you will get barbaz, not barfoo (in fact,
there is no need to define x before y at all in this case).
On the other hand, in

x = foo
y := bar$(x)

y is assigned barfoo, and it won't change if x is modified later.

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [PATCHES] plperl win32

2004-07-16 Thread Bruce Momjian


Attached is the modified patch I applied.  Thanks.

---


Magnus Hagander wrote:
 Here is a patch required to build plperl with win32. The issues were:
 
 * perl_useshrplib gets set to yes and not to true. I assume it's set
 to true on unix, so I left both.
 * Need to translate backslashes into slashes
 * The linker config coming out of perl was for MSVC and not for mingw
 
 
 Some of this is pretty ugly stuff - the reassigning into a second
 variable etc. If somebody with a little better makefile knowledge
 would clean that up (if it can be, but it should be possible), please
 do!
 
 
 //Magnus
  
  plperl_win32.patch 

Content-Description: plperl_win32.patch

[ Attachment, skipping... ]

 
 ---(end of broadcast)---
 TIP 8: explain analyze is your friend

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073
Index: src/pl/plperl/GNUmakefile
===
RCS file: /cvsroot/pgsql-server/src/pl/plperl/GNUmakefile,v
retrieving revision 1.14
diff -c -c -r1.14 GNUmakefile
*** src/pl/plperl/GNUmakefile   5 Jul 2004 23:24:12 -   1.14
--- src/pl/plperl/GNUmakefile   16 Jul 2004 19:16:57 -
***
*** 8,13 
--- 8,16 
  ifeq ($(perl_useshrplib),true)
  shared_libperl = yes
  endif
+ ifeq ($(perl_useshrplib),yes)
+ shared_libperl = yes
+ endif
  
  # If we don't have a shared library and the platform doesn't allow it
  # to work without, we have to skip it.
***
*** 18,24 
  override CFLAGS := $(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes, 
$(CFLAGS))
  endif
  
! override CPPFLAGS := -I$(srcdir) -I$(perl_archlibexp)/CORE $(CPPFLAGS)
  
  
  NAME = plperl
--- 21,33 
  override CFLAGS := $(filter-out -Wall -Wmissing-declarations -Wmissing-prototypes, 
$(CFLAGS))
  endif
  
! ifeq ($(PORTNAME), win32)
! perl_archlibexp := $(subst \,/,$(perl_archlibexp))
! perl_privlibexp := $(subst \,/,$(perl_privlibexp))
! perl_embed_ldflags := -L $(perl_archlibexp)/CORE -lperl58
! endif
! 
! override CPPFLAGS := -I$(srcdir) $(CPPFLAGS) -I$(perl_archlibexp)/CORE
  
  
  NAME = plperl

---(end of broadcast)---
TIP 8: explain analyze is your friend