Subject: Re: FVWM: FvwmButton bug ????

From: "Randall S. Winchester" <[email-masked]>
Date: Tue, 21 Jan 1997 17:36:58 -0500 (EST)

On Fri, 17 Jan 1997, Eddy J. Gurney wrote:

: On Jan 17, 23:25, Albrecht Kadlec wrote:
: 
: ....stuff deleted.
: 
: Finally, something that needs to be fixed in Fvwm.tmpl: in order for
: the Solaris dynamic linker to find the X libraries, I needed to change
: the FvwmModuleTarget and FvwmProgramTarget from '$(CC) -o $@...' to
: '$(CCLINK) -o $@...'. This is very important! It makes sure the
: LD_LIBRARY_PATH gets set before the link so the dynamic linker can find
: the X libraries. Prior to making this change, 'fvwm2' would not run,
: with the linker complaining about not be able to find the X libraries,
: and 'ldd' confirmed it. I tracked it down to this oversight in 'Fvwm.tmpl'.
: Can this be fixed?
:
: ....stuff deleted. 
: 
: Eddy
: --

This is indeed a problem with CC=cc. It is also true with some versions of
gcc. I have just upgraded from gcc 2.7.0 which did not have this problem to
2.7.2 which does as well as older gcc 2.6.*. In the gcc case it is not
LD_LIBRARY_PATH that gets set but rather LD_RUN_PATH, but the end result is
the same. Either of thses are supposed to get set to $(USRLIBDIR). In my
case this would be USRLIBDIR = /usr/local/X11R6/lib. Imake of corse thakes
care of this part.

The following command shows the problem with out the fix; 

ldd fvwm/fvwm2
        libXpm.so.4.3 =>   (unknown)
        libXext.so.6.0 =>  (unknown)
        libX11.so.6.0 =>   (unknown)
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libintl.so.1 =>  /usr/lib/libintl.so.1
        libmp.so.1 =>    /usr/lib/libmp.so.1

I looked at the source to xdm and the builds on my various platforms, and
that all use a line like;
 $(CCLINK) -o $@ $(LDOPTIONS).......
with;
 CCLINK = $(CC)
automaticaly by imake for the non trivial case. 

Thus I believe the following patch to Fvwm.tmpl should be in fvwm-2.0.45.
Would the fvwm-workers please try this on their platforms, if they are not
using X11R6.

Randall

diff -u -r1.1 Fvwm.tmpl
--- 1.1 1997/01/21 20:01:00
+++ Fvwm.tmpl   1997/01/21 22:25:30
@@ -466,7 +466,7 @@
                                                                        @@\
 program: $(OBJS) $(DEPLIBS)                                            @@\
        RemoveTargetProgram($@)                                         @@\
-       $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+       $(CCLINK) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
                                                                        @@\
 InstallProgram(program,$(FVWMDIR))                                     @@\
 InstallManPage(program,$(MANDIR))                                      @@\
@@ -491,7 +491,7 @@
                                                                        @@\
 program: $(OBJS) $(DEPLIBS)                                            @@\
        RemoveTargetProgram($@)                                         @@\
-       $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+       $(CCLINK) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
                                                                        @@\
 InstallProgram(program,$(FVWMBINDIR))                                  @@\
 InstallManPage(program,$(MANDIR))                                      @@\

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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] (Albrecht Kadlec)
Date: Wed, 22 Jan 97 00:27:20 +0100

diff -u -r1.1 Fvwm.tmpl
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I install fvwm2 under my home dir.

I need the following diffs to Fvwm.tmpl:

0:18 einstein:~/bin/tools/44/fvwm-2.0.44> diff Fvwm.tmpl ../../fvwm-2.0.45-almos
t/
67c67
< #define HasXpm  YES     /* NO */
---
> #define HasXpm YES     /* NO */
69a70
> #define XpmLibs -L/XTech/lib/X11
280a282
> #define FvwmBinDir /net/einstein/home/einstein/albrecht/bin
283a286
> #define FvwmDir /net/einstein/home/einstein/albrecht/bin/Fvwm
286a290
> #define FvwmLibDir /net/einstein/home/einstein/albrecht/bin/lib

this is ok.

289c293
< /* #define FvwmManPath /usr/local/X11R6/man */
---
> /* #define FvwmManDir /usr/local/X11R6/man */
291a296,297
> #define FvwmManDir /net/einstein/home/einstein/albrecht/bin/tools/man/mann
> #define FvwmManSuffix 1
377,378c383,384
< #ifdef FvwmManPath
<         MANPATH = FvwmManPath
---
> #ifdef FvwmManDir
>         MANDIR = FvwmManDir

This is not, I guess.
Make tries to install the man pages to obscure locations, but not to the
one I specified.

cause:
The man pages are installed under MANDIR (see last line of above patch from
Randall S. Winchester)

so _this_ should be changed instead of MANPATH (which is the search path,
with different directories, not the man-page install directory)

albrecht
-- 
When we came back from the war the banners and Flags hung on everyones door
We danced and we sang in the street and the church bells rang
But burning in my heart my memory smoulders on
Of the gunners dying words on the intercom	-- Pink Floyd, "A Hero's Return"
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Mark Borges <[email-masked]>
Date: 23 Jan 1997 09:48:13 -0700

>> On Tue, 21 Jan 1997 17:36:58 -0500 (EST),
>> Randall S Winchester(r) wrote:
r> On Fri, 17 Jan 1997, Eddy J. Gurney wrote:
r> : On Jan 17, 23:25, Albrecht Kadlec wrote:
r> : 
r> : ....stuff deleted.
r> : 
r> : Finally, something that needs to be fixed in Fvwm.tmpl: in order for
r> : the Solaris dynamic linker to find the X libraries, I needed to change
r> : the FvwmModuleTarget and FvwmProgramTarget from '$(CC) -o $@...' to
r> : '$(CCLINK) -o $@...'. This is very important! It makes sure the
r> : LD_LIBRARY_PATH gets set before the link so the dynamic linker can find
r> : the X libraries. Prior to making this change, 'fvwm2' would not run,

r> This is indeed a problem with CC=cc. It is also true with some versions of
r> gcc. I have just upgraded from gcc 2.7.0 which did not have this problem to
r> 2.7.2 which does as well as older gcc 2.6.*. In the gcc case it is not
r> LD_LIBRARY_PATH that gets set but rather LD_RUN_PATH, but the end result is

I see LD_RUN_PATH set as well. I always explicitly unset LD_LIBRARY_PATH
before any builds -- it seems to always lead to trouble
here. Solaris-2.5, cc-4.0, X11R6.3.

r> the same. Either of thses are supposed to get set to $(USRLIBDIR). In my
r> case this would be USRLIBDIR = /usr/local/X11R6/lib. Imake of corse thakes
r> care of this part.

This (use of CCLINK instead of CC) is a nice trick -- do older xmkmf's
generate this CCLINK as well?

Previously I was building with 

    make EXTRA_LDOPTIONS=-R/usr/local/X11R6/lib

which also works (but is more typing).

Thanks.

-- 
  -mb-

---

From: "Charles Hines" <[email-masked]>
Date: Thu, 23 Jan 1997 12:29:38 -0500

>>>>> "mb" == Mark Borges <[email-masked]> writes:

mb> This (use of CCLINK instead of CC) is a nice trick -- do older xmkmf's
mb> generate this CCLINK as well?

No.  At least my AIX X11R5 stuff doesn't, which is why I never changed
it the other times it was suggested.

mb> Previously I was building with

mb>     make EXTRA_LDOPTIONS=-R/usr/local/X11R6/lib

mb> which also works (but is more typing).

Which I don't see in my X11R5 imake stuff either - I have
EXTRA_LOAD_FLAGS.

I could probably try and put more stuff in the Fvwm.tmpl to handle
these under both situations though, and make generic vars
(FvwmLinkFlags or FvwmExtraLinkFlags) to deal with it.

Chuck