New on sourceware: xpm-nox-4.0.3-1 (replaces xpm-4.0.0-2)

Charles S. Wilson cwilson@ece.gatech.edu
Mon May 28 13:54:00 GMT 2001


The X-based xpm library distributed in the xpm package conflicts with
the X-based xpm dll in the cygwin-xfree distribution.  Therefore, I have
repackaged xpm and renamed the package 'xpm-nox'.  The 'xpm' package is
now DEPRECATED, and should be removed from your system BEFORE installing
the new 'xpm-nox' package (see the removal procedure below). 

The new 'xpm-nox' package contains only the X11FREE versions of the xpm
library.  The header files are now located in /usr/include/noX/, and the
import/static libs are now located in /usr/lib/noX/.

This means that in order to link against the non-X-based Xpm libraries,
you must
  a) compile using '-I/usr/include/noX'
  b) compile with the '-DXPM_NO_X' flag 
  c) link using '-L/usr/lib/noX'
In some cases, for instance 'configure'-based packages, you have to do
it this way:
  CFLAGS="-I/usr/include/noX -DXPM_NO_X" LDFLAGS=-L/usr/lib/noX
./configure

REMOVING the deprecated xpm package:
  The following procedure will remove all traces of the xpm package
EXCEPT the X-based dll.  That file should remain, in case you have
previously compiled an application that depends on it.  Also, the record
in /etc/setup/installed.db which indicates that xpm had been installed
on your system can stay -- otherwise, setup will keep prompting you to
reinstall it.

cd /
zcat /etc/setup/xpm.lst.gz | sed -e '/\/$/d' -e '/cygXpm-X4.dll/d' |
xargs rm
rmdir /usr/doc/xpm-4.0.0
rmdir /usr/include/X11

For more information about the new xpm-nox package see the NOTES section
below and /usr/doc/Cygwin/xpm-nox-4.0.3.README.

INSTALLATION:

AFTER removing xpm-4.0.0-2 as directed above,

To update your installation, click on the "Install Cygwin now" link on
the http://sources.redhat.com/cygwin web page.  This downloads setup.exe
to your system.

Run setup and answer all of the questions.  PLEASE, PLEASE, PLEASE
choose a mirror site for your download.  The 'sources.redhat.com' site
is badly overloaded.  The mirrors below are fairly reliable, and should
have the new version soon if they don't have it already:

ftp://mirrors.rcn.net/pub/sourceware/cygwin/ (US)
ftp://linux.sarang.net/mirror/development/compiler/cygwin/ (Korea)
ftp://ftp.mirror.ac.uk/sites/sourceware.cygnus.com/pub/cygwin (UK)

The setup.exe program will figure out what needs to be updated on your
system and should install the xpm package automatically. 

If you have questions or comments, please send them to the Cygwin
mailing list at:  cygwin@sources.redhat.com .  I would appreciate if you
would use this mailing list rather than emailing me directly. This
includes ideas and comments about the setup utility or Cygwin general.

If you want to make a point or ask a question the Cygwin mailing list is
the appropriate place.

              *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe to the cygwin-announce mailing list, look at
the "List-Unsubscribe: " tag in the email header of this message. Send
email to the address specified there.  It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain.com@sources.redhat.com

NOTES:

o Building the package from source requires gcc-2.95.2-2 and 
binutils-20000722-1 or later

o can coexist with the "libXpm.dll" provided by cygwin-XFree, but does
provide additional features. The cygwin-XFree version of the Xpm library
is dynamic only; this version provides the Xpm routines without
depending on other X libraries and doesn't require an Xserver.  Also,
this version can be linked statically OR dynamically.

o Comparison:  the cygwin-xfree version and the xpm-nox version:
  cygwin-xfree : + more complete		- requires Xserver
  xpm-nox      : + no Xserver needed	- a few missing routines (*)
The missing routines are the ones related to "Pixmaps" ("XpmImage"
"Buffer" "Image" and "Data" related functions are implemented).  I've
never run into a program that fails to link using the xpm-nox library --
and it works fine with cygwin-XEmacs; however, since it isn't fully
complete:

o Based on the xpm code from the XFree86-4.0.3 distribution (xpm was
*finally* absorbed into the main XFree distro as of v4.0).  However,
there a few non-cosmetic differences between the earlier
"xpm-3.4k.tar.gz" distribution and the "xpm" directory in the
XFree86-4.0.3 sources.

o follows new naming scheme for dlls (with some complications because of
the need NOT to interfere with the cygwin-xfree version):
  - /usr/lib/noX/libXpm.dll.a  (import lib, X11-free)
  - /usr/lib/noX/libXpm-noX.a  (static lib, X11-free)
  - /usr/bin/cygXpm-noX4.dll   (dll, X11-free)
  - /usr/include/noX/xpm.h, simx.h  
       (specially-hacked versions of the xpm header files)
  - cygwin-specific docs in /usr/doc/Cygwin/xpm-nox-4.0.3.README
  - generic docs in /usr/doc/xpm-nox-4.0.3/*

So ordinarily, configure-based clients will find the cygwin-xfree
versions of the header files and libraries: xpm-nox "hides" itself in a
/noX/ subdirectory to avoid conflicts.  To use the xpm-nox headers and
libraries, you must
  a) use -I/usr/include/noX when compiling
  b) define -DXPM_NO_X when compiling (or "FOR_MSW")
  c) use -L/usr/lib/noX when linking
For configure-based clients, this may require
  export CFLAGS="-I/usr/include/noX -DXPM_NO_X"
  export LDFLAGS=-L/usr/lib/noX
  ./configure

o The dll's are versioned as "4", not "3" -- but this is NOT because the
sources came from XFree86- ***4*** .0.0.  According to xpm.h, the
library version number, which remains "3.4k" even in the XFree86-4.0.3
sources, should be parsed as follows:
   XpmFormat "3"
   XpmVersion "4"
   XpmRevision "11" ( "k" is the 11th letter of the alphabet )
Quoting: "we forget the 3 which is the format number" so the SO version
is 4.11 (which I simplified down to just SOMAJOR = 4 ).

o A cygwin-specific README and PATCH are stored in the source archive,
under <top>/CYGWIN-PATCHES/* (although that patch has already been
applied to the archive itself). The cygwin-specific README is also
installed by the binary distribution as described above.

o If you are building a package that depends on xpm, and you want to use
the cygwin-xfree version, you don't need to do anything special.  Just
use ./configure as normal, or explicitly put /usr/X11R6/include and
/usr/X11R6/lib in your header/lib search paths.  No special defines are
needed; your app will be dynamically linked to the cygwin-xfree libXpm
dll.  You can't link statically; the cygwin xfree project doesn't
provide static libraries.

o If you are building a package that depends on xpm, and you wish to
link to the xpm-nox version, AND you wish to
link *statically*, define -DXPM_STATIC to get the 'correct' #define's in
Xpm.h when compiling the .o files in your package. Note: "-DALL_STATIC"
acts as synonym for -DXPM_STATIC.  (Don't forget, you also must specify
'-DXPM_NO_X' and -I/usr/include/noX as described previously).  Finally,
use 'gcc -static -L/usr/lib/noX' when linking your package. For more
information, see /usr/doc/Cygwin/xpm-nox-4.0.3.README.

o Now, if you are building a package that depends on xpm, and you wish
to link to the xpm-nox version, AND you wish to link *dynamically*, then
just define -DXPM_NO_X and use -I/usr/include/noX when compiling.  Link
using 'gcc -L/usr/lib/noX'.  For more information, see
/usr/doc/Cygwin/xpm-nox-4.0.3.README.

o Thus, there are two flags you may define, which affect how your
programs will build and link: -DXPM_STATIC and -DXPM_NO_X.  Note that
the XPM_NO_X flag is synonymous with the FOR_MSW flag in the original
xpm-3.4k source code, and -Ddefining either one will work.  Also, 

o Proactive answer to the obvious question: "Why don't you merge this
into the cygwin-XFree86 distribution?"  Answer: Not easy, and probably
not a good idea.  The cygwin-XFree86 builds using standard "xmkmf"
X11-style configuration and builds.  This generates makefiles for
building the "X11 world".  Then you do "make world" and build
everything.  It's just not part of the mindset to hack up xmkmf so that
"if building on cygwin, when generating the makefiles for the xpm target
(but not the other targets), do the X thing, but also cheat a bit over
here and generate this extra library that is not part of the X world,
etc etc".  It really is easier, on cygwin, to pull xpm-nox out and build
it separately.

The X11free code (not my special Makefile changes) is actually part of
the official xpm-3.4k distro, which was absorbed en mass into XFree86. 
However, the inclusion of the X11free stuff was probably an accidental
oversight on the part of the XFree86 folks, or they just included it
because there was no better place to put it so that it doesn't get lost;
now that libXpm has been absorbed by XFree86, the "old" separate xpm-3.4
distro will probably fade into obscurity.

You're not supposed to actually *USE* the X11free code when building X11
-- that's why the official Makefiles, even the so-called "-noX"
makefiles, don't activate the X11free code.  (Yes, it's confusing.  In
the X11 world, a "-noX" makefile is a makefile that builds X11-based
code, but does not rely on a working xmkmf program; a "-noX" makefiles
does NOT mean "this-makefile-builds-an-X11free-library".)  Anway, the
X11free code is *only* provided in the official xpm-3.4k distro (and
now, in the XFree86 distro) in case you (a) want libXpm on windows, and
(b) don't want X11.  

Cygwin kinda straddles the fence, so libXpm straddles the fence too --
these sources and the official XFree86-xpm/xpm-3.4k sources are
synchronized aside from Makefile issues, but my version *can* build a
no-X library "out-of-box"; the cygwin-XFree86 version can't and IMO
shouldn't.

whew.

--Chuck Wilson



More information about the Cygwin-announce mailing list