Subject: fvwm-2.2.2 & xpm-3.4k

From: Nadim Saeed <[email-masked]>
Date: Thu, 1 Jul 1999 16:25:52 -0700 (PDT)

Fvwm compiled fine (thank you -> Paul Smith) without XPM.  I downloaded a
precompiled xpm solaris library from 'ftp.x.org' as noted in the FAQ that
is called "xpm-3.4k-solaris"

Yet, when I do a clean configure (after a 'make distclean' of course :-), I
see the following:

checking for usleep... yes
checking for atexit... yes
checking for XpmReadFileToXpmImage in -lXpm... yes
checking for X11/xpm.h... yes
checking for Xpm 3.4f or better... no
.....
.....
Configuration:
 
  FVWM Version:             2.2.2
 
  Build extra modules?      no
  Have ReadLine support?    no
  Have RPlay support?       no
  Have XPM support?         no
 
I thought 3.4k would in fact be better/higher than 3.4f (I am doing something
wrong ?)

uname -a     : SunOS cosmo 5.5.1 Generic_103640-17 sun4u sparc SUNW,Ultra-2
command-line :
 ./configure --with-xpm-library=/usr13/new/xpm-3.4k-solaris/lib
             --with-xpm-includes=/usr13/new/xpm-3.4k-solaris/include
             --without-cxx

Couldn't find anything similar to this problem in the archives !!

 - Nadim
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 02 Jul 1999 15:12:26 -0400

%% Nadim Saeed <[email-masked]> writes:

  ns> Fvwm compiled fine (thank you -> Paul Smith) without XPM.  I
  ns> downloaded a precompiled xpm solaris library from 'ftp.x.org' as
  ns> noted in the FAQ that is called "xpm-3.4k-solaris"

  ns> checking for Xpm 3.4f or better... no
 
  ns> I thought 3.4k would in fact be better/higher than 3.4f (I am
  ns> doing something wrong ?)

3.4k is higher.  One possibility is you have an older version of xpm.h
somewhere and the compiler is choosing that one instead.

First, look in config.log where it checks for the XPM version and see if
there's anything interesting logged there.

Also, look in /usr13/new/xpm-3.4k-solaris/include/X11/xpm.h and make
sure that XpmRevision is 11 (for your "k" version).

If that all fails, try this little test program:

  #include <stdio.h>
  #include <X11/xpm.h>
  int main() { printf("Format=%d  Version=%d  Revision=%d (%c)\n",
               XpmFormat, XpmVersion, XpmRevision, 'a'+(XpmRevision-1)); }

and compile it using the same command line as configure does (you can
find this in the config.log file).

What does it say?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Nadim Saeed <[email-masked]>
Date: Fri, 2 Jul 1999 13:09:40 -0700 (PDT)

On  - July.2.1999 [15:12:26 -0400],
 Paul D. Smith ([email-masked]) wrote:
 > %% Nadim Saeed <[email-masked]> writes:
 > 

I didn't try the program above (since I didn't think I needed to), here's the
info:

config.log:

configure:4230: checking for atexit
configure:4258: gcc -o conftest -g -O2   conftest.c  1>&5
configure:4384: checking for XpmReadFileToXpmImage in -lXpm
configure:4403: gcc -o conftest -g -O2   conftest.c -lXpm -L/usr13/new/xpm-3.4k-
solaris/lib -lXpm  -L/usr/openwin/lib -R/usr/openwin/lib  -lX11 -lsocket  -lnsl 
 1>&5
configure:4448: checking for X11/xpm.h
configure:4458: gcc -E  -I/usr13/new/xpm-3.4k-solaris/include  -I/usr/openwin/in
clude conftest.c >/dev/null 2>conftest.out
configure:4510: checking for Xpm 3.4f or better
configure:4527: gcc -o conftest -g -O2  -I/usr13/new/xpm-3.4k-solaris/include  -
I/usr/openwin/include  conftest.c  -L/usr13/new/xpm-3.4k-solaris/lib -lXpm  -L/u
sr/openwin/lib -R/usr/openwin/lib  -lX11 -lsocket  -lnsl 1>&5
configure: failed program was:
#line 4519 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
   int main(int c, char **v) {
   return c == 1 ? 0 :
     XpmIncludeVersion != XpmLibraryVersion() ? 1 :
     XpmIncludeVersion < 30406 ? 2 : 0 ;}
configure:4615: checking for rplay_create in -lrplay

The "/usr13/new/xpm-3.4k-solaris/include/X11/xpm.h" looks OK with:
#define XpmFormat 3
#define XpmVersion 4
#define XpmRevision 11
#define XpmIncludeVersion ((XpmFormat * 100 + XpmVersion) * 100 + XpmRevision)

I guess its due to the above noted program "failure"..

 - Nadim

---

From: [email-masked] (Paul D. Smith)
Date: 02 Jul 1999 16:59:07 -0400

>> XpmFormat, XpmVersion, XpmRevision, 'a'+(XpmRevision-1)); }

  ns> I didn't try the program above (since I didn't think I needed to),
  ns> here's the info:

  ns> configure:4510: checking for Xpm 3.4f or better
  ns> configure:4527: gcc -o conftest -g -O2  -I/usr13/new/xpm-3.4k-solaris/include  -I/usr/openwin/include  conftest.c  -L/usr13/new/xpm-3.4k-solaris/lib -lXpm  -L/usr/openwin/lib -R/usr/openwin/lib  -lX11 -lsocket  -lnsl 1>&5
  ns> configure: failed program was:
  ns> #line 4519 "configure"
  ns> #include "confdefs.h"
  ns> #include <X11/xpm.h>
  ns>    int main(int c, char **v) {
  ns>    return c == 1 ? 0 :
  ns>      XpmIncludeVersion != XpmLibraryVersion() ? 1 :
  ns>      XpmIncludeVersion < 30406 ? 2 : 0 ;}

Bleah.  Unfortunately, the _reason_ for the failure isn't shown here, it
just says it failed but none of the error messages are shown.

Did you see any errors printed to stdout when you ran configure?

If not, you'll have to try to compile the program above with the
commandline above, and see what failure the compiler is talking about.

---

From: Nadim Saeed <[email-masked]>
Date: Fri, 2 Jul 1999 14:39:14 -0700 (PDT)

On  - July.2.1999 [16:59:07 -0400],
 > commandline above, and see what failure the compiler is talking about.

Paul, I compiled the source you'd sent without a problem.  When I try to
execute it, I see the following --

ld.so.1: junker: fatal: libXpm.so.4.11: can't open file: errno=2
Killed

Here's the command-line compilation:
gcc -o junker -g -O2 -I/usr13/new/xpm-3.4k-solaris/include \
    -I/usr/openwin/include junker.c -L/usr13/new/xpm-3.4k-solaris/lib \
    -lXpm -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lsocket -lnsl

now what ?

 - Nadim

---

From: Dan Espen <[email-masked]>
Date: Fri, 02 Jul 1999 18:01:52 -0400

>     -lXpm -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lsocket -lnsl

Configure with:

--x-libraries=/usr/openwin/lib:/usr13/new/xpm-3.4k-solaris/lib

remember to remove config.cache first.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: [email-masked] (Paul D. Smith)
Date: 02 Jul 1999 18:24:59 -0400

ns> ld.so.1: junker: fatal: libXpm.so.4.11: can't open file: errno=2
  ns> Killed

  ns> Here's the command-line compilation:
  ns> gcc -o junker -g -O2 -I/usr13/new/xpm-3.4k-solaris/include \
  ns>     -I/usr/openwin/include junker.c -L/usr13/new/xpm-3.4k-solaris/lib \
  ns>     -lXpm -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lsocket -lnsl

  ns> now what ?

Doh.  I should have noticed that.

You need to get the -R option on the link line for the directory
containing the libXpm shared library, too, or the runtime linker can't
find it.

I typically use something like:

  $ LDFLAGS=-R/usr13/new/xpm-3.4k-solaris/lib ./configure ...

to do that (this only works in a Bourne-like shell, not csh; there
you'll have to setenv it first I guess).

Remember to remove config.cache first.

---

From: Nadim Saeed <[email-masked]>
Date: Fri, 2 Jul 1999 15:46:08 -0700 (PDT)

On  - July.2.1999 [18:24:59 -0400],
 > Remember to remove config.cache first.

Paul,
      you're one of a kind.  Yup that did the job (I owe ya a beer (or two)
if and when you make it to San Diego).

Out of curiosity, why didn't the "--with-xpm-library=" AND
"--with-xpm-includes=" take care of the problem.  I've compiled fvwm2 with
the same type of setup (different job-site) and it worked without a
problem -- why now and why didn't configure catch this querk ?

Dan,
     I tried to include
"--x-libraries=/usr/openwin/lib:/usr13/new/xpm-3.4k-solaris/lib" in the
configure, that didn't get me anywhere (it didn't even find xpm); thought
I'd mention it for compeletness.

Thanks again .. Finally a running xpm'ized fvwm !!!!!!

 - Nadim

---

From: Mikhael Goikhman <[email-masked]>
Date: Sat, 3 Jul 1999 03:13:55 +0300 (IDT)

> you'll have to setenv it first I guess).

This must work for any shell:

$ env LDFLAGS=-R/usr13/new/xpm-3.4k-solaris/lib ./configure ...

Regards,
Mikhael.

---

From: [email-masked] (Paul D. Smith)
Date: 02 Jul 1999 21:36:40 -0400

ns> Out of curiosity, why didn't the "--with-xpm-library=" AND
  ns> "--with-xpm-includes=" take care of the problem.  I've compiled
  ns> fvwm2 with the same type of setup (different job-site) and it
  ns> worked without a problem -- why now and why didn't configure catch
  ns> this querk ?

Sigh.  The $64.00 question.  The answer is long and varied :).

As to why configure doesn't handle adding the -R... because no one has
fixed it.  And not for lack of moaning on the autoconf mailing lists,
you may be sure.  Autoconf has this builtin to the X location stuff (you
noticed it added -R/usr/openwin/lib by itself) but that's it.

As to why it worked elsewhere, it all depends on the OS.  Many OS's
don't make a distinction between link-time and run-time paths; for
example SunOS just used -Lxxxx and those same paths were used at both
link time and runtime.  So, that works OK.

Other systems let you change the default directories the runtime linker
uses, with ldconfig, so you could add more directories that way.

Solaris does neither, which makes it pretty unusual.  So far I've just
sucked it up and remembered to add this every time :-/.

---

From: Dan Espen <[email-masked]>
Date: Sat, 03 Jul 1999 21:46:03 -0400

> I'd mention it for compeletness.

Thats odd, my xpm library is in /usr/local/lib and
for me it puts -L/usr/openwin/lib:/opt/local/lib and
-R/usr/openwin/lib:/opt/local/lib on the linker command line
The second part should have fixed the problem.

I've used this with Solaris 2.5.1 and 2.6.