Cesar Romani wrote:

> >> On 01/12/2013 09:11 a.m., Steve Hall wrote:
> >>> FINALLY! Thanks Ken and Cesar for the help.
> >>>
> >>> Okay, it took three parts to get my Cygwin cross-compile for Windows
> >>> build to work with Perl:
> >>>
> >>> 1. Patching vim\Make_cyg.mak (via Cesar Romani)
> >>>
> >>> --- C:\vim\Make_cyg.mak
> >>> +++ C:\vim\Make_cyg.mak
> >>> @@ -155,6 +155,7 @@
> >>> ifeq (yes, $(DYNAMIC_PERL))
> >>> DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
> >>> +EXTRA_LIBS += $(PERL)/lib/CORE/libperl$(PERL_VER).a
> >>> else
> >>> -EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
> >>> +EXTRA_LIBS += $(PERL)/lib/CORE/libperl$(PERL_VER).a
> >>> endif
> >>> endif
> >>>
> >>> 2. Replacing src\if_perl.xs with the fix from here (by
> >>>      [email protected])
> >>>
> >>>      http://code.google.com/p/vim/issues/detail?id=170#c5
> >>>
> >>>
> >>> 3. Patching a Strawberry Perl distribution file (by Ken Takata)
> >>>
> >>> --- C:\Perl\lib\CORE\sys\socket.h.org   Wed Mar 27 12:44:16 2013
> >>> +++ C:\Perl\lib\CORE\sys\socket.h       Sun Dec 01 16:06:52 2013
> >>> @@ -13,7 +13,7 @@
> >>> #include<windows.h>
> >>>
> >>> /* Too late to include winsock2.h if winsock.h has already been loaded */
> >>> -#ifndef _WINSOCKAPI_
> >>> +#if !defined(_WINSOCKAPI_)&&   !defined(_WINSOCK_H)
> >>> #  ifndef FD_SETSIZE
> >>> #    define FD_SETSIZE 2048
> >>> #  endif
> >>>
> >>> Only after all three changes were implemented would it build. Plenty
> >>> of warnings, but I was able to cross-compile both a gvim.exe and
> >>> vim.exe with +perl/dyn.
> >>>
> >>
> >> Actually you don't need to modify any file, except Make_cyg.mak.
> >> I managed to build vim under cygwin with strawberry perl 5.18.1.1, using
> >> only the makefile patch:
> >>
> >> --- C:\vim\Make_cyg.mak
> >> +++ C:\vim\Make_cyg.mak
> >> @@ -155,6 +155,7 @@
> >> ifeq (yes, $(DYNAMIC_PERL))
> >> DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
> >> +EXTRA_LIBS += $(PERL)/lib/CORE/libperl$(PERL_VER).a
> >> else
> >> -EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
> >> +EXTRA_LIBS += $(PERL)/lib/CORE/libperl$(PERL_VER).a
> >> endif
> >> endif
> >
> > Is this specific for this version of Perl?  If so, what kind of
> > condition (flag) should we use for this?
> >
> 
> Cygwin
> ------
> Both Strawberry 5.18 and ActivePerl 5.18 only need the following patch:
> 
> --------------------
> --- Make_cyg.mak.org  2013-11-21 22:55:56.014250100 -0500
> +++ Make_cyg.mak      2013-12-04 17:57:07.550500300 -0500
> @@ -139,6 +139,7 @@
>   ##############################
>   # DYNAMIC_PERL=yes and no both work
>   ##############################
> +PERL=/cygdrive/c/perl
>   ifdef PERL
>   DEFINES += -DFEAT_PERL
>   INCLUDES += -I$(PERL)/lib/CORE
> @@ -149,11 +150,12 @@
>   endif
> 
>   ifndef PERL_VER
> -PERL_VER = 56
> +PERL_VER = 518
>   endif

The above can be done on the command line, since it will change with
every Perl version.

>   ifeq (yes, $(DYNAMIC_PERL))
>   DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
> +EXTRA_LIBS += -L$(PERL)/lib/CORE -lperl$(PERL_VER)
>   else
>   EXTRA_LIBS += $(PERL)/lib/CORE/perl$(PERL_VER).lib
>   endif

Although this addition looks OK, does it work for older Perl versions?
If not, what condition should be put around the new line?

> @@ -688,8 +688,7 @@
>       $(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
> 
>   $(TARGET): $(OUTDIR) $(OBJ)
> -     $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid 
> $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) 
> $(RUBYLIB)
> -
> +     $(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid 
> $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) 
> $(RUBYLIB) -L$(PERLLIBS) -lperl$(PERL_VER)
>   upx: exes
>       upx gvim.exe
>       upx vim.exe

This isn't right, it will fail when compiling without Perl.
Look around line 635.

> Actually ActivePerl 5.16 doesn't need this patch, but applying it
> doesn't change anything.
> 
> Ken Tanaka said that one needs his C:\Perl\lib\CORE\sys\socket.h patch
> for non-W64 MinGW, but I didn't need it.
 

-- 
How To Keep A Healthy Level Of Insanity:
7. Finish all your sentences with "in accordance with the prophecy".

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui