Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 1995 03:44:36 -0700
From:      asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=)
To:        taob@gate.sinica.edu.tw
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: mfsm 1.1 for FreeBSD
Message-ID:  <199504101044.DAA05118@silvia.HIP.Berkeley.EDU>
In-Reply-To: <Pine.BSI.3.91.950410141734.27785A-100000@aries.ibms.sinica.edu.tw> (message from Brian Tao on Mon, 10 Apr 1995 14:41:31 %2B0800 (CST))

next in thread | previous in thread | raw e-mail | index | archive | help
 * > The usual trick is to wrap -Bstatic and -Bdynamic lines around JUST
 * > the Motif libraries, so that you can leave all the other ones dynamic.
 * > Man ld for details.. :-)
 * 
 *     Is there a "ports" FAQ with these "usual tricks" documented?  :)

I don't know...it's not really a ports question, more of a general
compiler/linker question.  But we get this "how do I compile something
static for Motif only" question all the time, it's worth mentioning
it...who's the maintainer of the ports.FAQ?  (The "portsmeister"? :)

 * I tried using "ld -s -L/usr/local/lib/X11 -L/usr/X11/lib -lXpm -lXt
 * -lSM -lICE -lXExExt -lXext -lX11 -Bstatic -lXm" but I immediately get
 * a "ld: No reference to __DYNAMIC" error.

Is this really what you did?  Then it won't work anyway, you are
missing the standard C library (libc), to say the least.  I usually
don't call ld directly, as cc wants to give it all sorts of funky
options that I can never learn.  Try "cc -v" to see what is really
happening.

Also, libXm calls some routines in libXt and libX11 (AFAIK), so you
need to put it before those, no?  Or does the order in the command
line doesn't matter anymore in the current ld?  (Sorry, ld is changing 
too fast for me to keep track.)

Anyway, I believe the easiest fix for this is to put "-Xlinker -
Bstatic" and "-Xlinker -Bdynamic" around the definition of XMLIB (or
MOTIFLIB...I don't know how it's called in the Motif imake template
files) in your /usr/X11R6/lib/X11/config/Motif.tmpl (or something).
This will tell cc to give "-Bstatic" and "-Bdynamic" to the linker (-B
usually means a totally different thing to cc).

Or you can edit your Imakefile to do the same thing (but it won't work
if it's referring to XmClientLibs...well you can replace it with
"XMLIB XawClientLibs" if you want).  I just tried it on the math
library and it worked here. :)

 * 					     The object file itself
 * wasn't compiled with -static though.  Hint, please?

It shouldn't matter how the object file is compiled, as long as you
are just using shared/static libraries, not trying to *build* a
library (the -fpic flag is for that).

Satoshi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504101044.DAA05118>