plperl win32

Started by Magnus Haganderabout 22 years ago5 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

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>>

Attachments:

plperl_win32.patchapplication/octet-stream; name=plperl_win32.patchDownload+15-12
#2Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#1)
Re: plperl win32

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
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Magnus Hagander
magnus@hagander.net
In reply to: Bruce Momjian (#2)
Re: plperl win32

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#3)
Re: plperl win32

"Magnus Hagander" <mha@sollentuna.net> 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

#5Bruce Momjian
bruce@momjian.us
In reply to: Magnus Hagander (#1)
Re: plperl win32

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
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+11-8