Building on Windows with XPM

156 views
Skip to first unread message

Bram Moolenaar

unread,
Aug 2, 2012, 12:16:02 PM8/2/12
to vim...@googlegroups.com

I was trying to get Vim to build with MSVC 2008 on a clean system with
all the optional extras. One thing that doesn't work is the XPM
feature.

The Make_mvc.mak file recommeds:

# XPM - Include support for XPM signs
# You need to download or build xpm.lib somehow.
# You can get the most recent version of libXpm-*.zip from
# http://cgit.freedesktop.org/xorg/lib/libXpm


But that site is down. I found an alternate xpm_w32 zip file on
ftp.gnu.org, but it does not include libXpm.lib and no way to build it.

Any suggestions?

--
hundred-and-one symptoms of being an internet addict:
197. Your desk collapses under the weight of your computer peripherals.

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///

Sergey Khorev

unread,
Aug 2, 2012, 2:26:29 PM8/2/12
to vim...@googlegroups.com
> # XPM - Include support for XPM signs
> # You need to download or build xpm.lib somehow.
> # You can get the most recent version of libXpm-*.zip from
> # http://cgit.freedesktop.org/xorg/lib/libXpm
>
>
> But that site is down. I found an alternate xpm_w32 zip file on
> ftp.gnu.org, but it does not include libXpm.lib and no way to build it.


I have built libXpm some 8 years ago. It is available from
https://sites.google.com/site/khorser/opensource/vim/xpm.zip?attredirects=0&d=1
Is it possible to put the file on Vim ftp?

tux.

unread,
Aug 2, 2012, 3:19:32 PM8/2/12
to vim...@googlegroups.com
Sergey Khorev schrob am 02. Aug. 2012 um 20:26 Zeit:
> I have built libXpm some 8 years ago. It is available from
> https://sites.google.com/site/khorser/opensource/vim/xpm.zip?attredirects=0&d=1


It does not compile though. It says it can't find xpm.h although the
directory is correctly added per -I parametert.

Sergey Khorev

unread,
Aug 2, 2012, 3:31:56 PM8/2/12
to vim...@googlegroups.com
> It does not compile though. It says it can't find xpm.h although the
> directory is correctly added per -I parametert.

You didn't mention how you tried to build Vim, here is how I did it:
nmake -f Make_mvc.mak GUI=yes CSCOPE=yes NETBEANS=yes XPM=e:\hg\xpm

E:\HG\vim\src>dir /B /S e:\hg\xpm
e:\hg\xpm\include
e:\hg\xpm\lib
e:\hg\xpm\include\simx.h
e:\hg\xpm\include\xpm.h
e:\hg\xpm\lib\libXpm.lib

Bram Moolenaar

unread,
Aug 2, 2012, 3:48:48 PM8/2/12
to Sergey Khorev, vim...@googlegroups.com
Thanks. I tried and it builds with MSVC 2008. Don't know how to try if
it actually works.

> Is it possible to put the file on Vim ftp?

OK, I'll put it here: ftp://ftp.vim.org/pub/vim/pcextra/xpm.zip

Can you give some information about what it was build with? I suppose
it only works for 32 bits builds?

--
hundred-and-one symptoms of being an internet addict:
201. When somebody asks you where you are, you tell them in which chat room.

tux.

unread,
Aug 2, 2012, 3:51:02 PM8/2/12
to vim...@googlegroups.com
Sergey Khorev schrob am 02. Aug. 2012 um 21:31 Zeit:
> nmake -f Make_mvc.mak GUI=yes CSCOPE=yes NETBEANS=yes XPM=e:\hg\xpm


Ah, I used relative folders. My fault, thanks!

Sergey Khorev

unread,
Aug 3, 2012, 12:03:29 AM8/3/12
to Bram Moolenaar, vim...@googlegroups.com
> Thanks. I tried and it builds with MSVC 2008. Don't know how to try if
> it actually works.

Originally I did it for that Netbeans plugin which for some reason
used only XPM icons. Commands below will show whether XPM lib is
working or not:
:exe 'sign define vimxpm icon='.$VIMRUNTIME.'\\vim32x32.xpm'
:exe 'sign place 1 line=1 name=vimxpm file='.expand('%:p')

> Can you give some information about what it was build with? I suppose
> it only works for 32 bits builds?

Correct, the binary is 32bit only but it can be built for 64bit
without any problems. Here are the makefiles:

Makefile for MSVC:

---- snip ----
src = Attrib.c CrBufFrI.c CrDatFrI.c create.c CrIFrBuf.c CrIFrDat.c \
data.c hashtab.c Image.c Info.c misc.c RdFToBuf.c RdFToDat.c \
RdFToI.c rgb.c scan.c simx.c WrFFrBuf.c parse.c \
WrFFrDat.c WrFFrI.c

obj = Attrib.obj CrBufFrI.obj CrDatFrI.obj create.obj CrIFrBuf.obj
CrIFrDat.obj \
data.obj hashtab.obj Image.obj Info.obj misc.obj RdFToBuf.obj RdFToDat.obj \
RdFToI.obj rgb.obj scan.obj simx.obj WrFFrBuf.obj parse.obj \
WrFFrDat.obj WrFFrI.obj

.c.obj:
cl -DFOR_MSW /c $<

target = ..\lib\libXpm.lib

all: $(target)

$(target): $(obj)
lib /out:$(target) $(obj)
---- snip ----


Makefile for MinGW:

---- snip ----
src = Attrib.c CrBufFrI.c CrDatFrI.c create.c CrIFrBuf.c CrIFrDat.c \
data.c hashtab.c Image.c Info.c misc.c RdFToBuf.c RdFToDat.c \
RdFToI.c rgb.c scan.c simx.c WrFFrBuf.c parse.c \
WrFFrDat.c WrFFrI.c

obj = Attrib.o CrBufFrI.o CrDatFrI.o create.o CrIFrBuf.o CrIFrDat.o \
data.o hashtab.o Image.o Info.o misc.o RdFToBuf.o RdFToDat.o \
RdFToI.o rgb.o scan.o simx.o WrFFrBuf.o parse.o \
WrFFrDat.o WrFFrI.o

.c.o:
gcc -O2 -DFOR_MSW -c $<

target = libXpm.a

all: $(target)

$(target): $(obj)
ar r $(target) $(obj)
---- snip ----

Bram Moolenaar

unread,
Aug 3, 2012, 4:28:49 PM8/3/12
to Sergey Khorev, vim...@googlegroups.com

Sergey Khorev wrote:

> > Thanks. I tried and it builds with MSVC 2008. Don't know how to try if
> > it actually works.
>
> Originally I did it for that Netbeans plugin which for some reason
> used only XPM icons. Commands below will show whether XPM lib is
> working or not:
> :exe 'sign define vimxpm icon='.$VIMRUNTIME.'\\vim32x32.xpm'
> :exe 'sign place 1 line=1 name=vimxpm file='.expand('%:p')

Thanks, it works (although the image is too big :-)).


> > Can you give some information about what it was build with? I suppose
> > it only works for 32 bits builds?
>
> Correct, the binary is 32bit only but it can be built for 64bit
> without any problems. Here are the makefiles:

I would prefer for people to be able to easily download and install the
dependencies. It's difficult enough to build Vim already.

Perhaps you can make one zip file that contains the required header
files and the .lib files for 32 and 64 bit?

Note that depending on the license the source files need to be included
as well. At least include a README that mentions the copyright.

--
hundred-and-one symptoms of being an internet addict:
207. You're given one phone call in prison and you ask them for a laptop.

Sergey Khorev

unread,
Aug 3, 2012, 11:43:59 PM8/3/12
to Bram Moolenaar, vim...@googlegroups.com
Hi Bram,

> I would prefer for people to be able to easily download and install the
> dependencies. It's difficult enough to build Vim already.
>
> Perhaps you can make one zip file that contains the required header
> files and the .lib files for 32 and 64 bit?
>
> Note that depending on the license the source files need to be included
> as well. At least include a README that mentions the copyright.

I am travelling now and don't have 64bit compiler on my laptop. Will
prepare the zip when I'm back (in 2 weeks).

Sergey Khorev

unread,
Aug 26, 2012, 10:00:18 AM8/26/12
to Bram Moolenaar, vim...@googlegroups.com
Hi Bram,

>> Note that depending on the license the source files need to be included
>> as well. At least include a README that mentions the copyright.
>
> I am travelling now and don't have 64bit compiler on my laptop. Will
> prepare the zip when I'm back (in 2 weeks).

Here is the zip containing the library:
https://sites.google.com/site/khorser/opensource/vim/xpmWin.zip?attredirects=0&d=1

For some reason gmail thinks that libraries are executable and does
not allow sending them.

Bram Moolenaar

unread,
Aug 27, 2012, 3:56:55 PM8/27/12
to Sergey Khorev, vim...@googlegroups.com
Thanks for making this available. It's fairly small and a quick glance
shows the license is liberal, so perhaps we should simply include it in
the distribution. Otherwise I can put it on the Vim ftp site.

--
FIRST HEAD: All right! All right! We'll kill him first and then have tea and
biscuits.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

Sergey Khorev

unread,
Aug 28, 2012, 12:24:36 AM8/28/12
to Bram Moolenaar, vim...@googlegroups.com
> Thanks for making this available. It's fairly small and a quick glance
> shows the license is liberal, so perhaps we should simply include it in
> the distribution. Otherwise I can put it on the Vim ftp site.

I think it's a good idea to include it into the distribution.

Bram Moolenaar

unread,
Aug 29, 2012, 8:19:00 AM8/29/12
to Sergey Khorev, vim...@googlegroups.com

Sergey -
I think it's OK to include the files under src/xpm.

I don't think it is useful to include the makefiles, since the required
source files are not included.

Including the include files twice, because of the different path, isn't
nice. I'll find a way to avoid that.

- Bram

--
GALAHAD hurries to the door and pushes through it. As he leaves the room
we CUT TO the reverse to show that he is now in a room full of bathing
and romping GIRLIES, all innocent, wide-eyed and beautiful. They smile
enchantingly at him as he tries to keep walking without being diverted by
the lovely sights assaulting his eyeballs.
Reply all
Reply to author
Forward
0 new messages