RE: Forcing static-linking on a port?

2005-05-24 Thread Darren Pilgrim
From: Dan Nelson [mailto:[EMAIL PROTECTED] 
 
 In the last episode (May 23), Darren Pilgrim said:
  I need to make use of a port during start up, but it has library
  dependencies that aren't available, before the complete library path is
  established.  I've tried the following:
  
  NO_SHARED=true (added to /etc/make.conf)
  make -DNO_SHARED
  make LDFLAGS+=-static
  
  Every time, running file on the compiled program tells me that the
binary is
  dynamically-linked.  I couldn't find anything else in any man pages, Mk
  files, mailing lists, Google, etc.  Sorry for the semi-inappropriate
list
  choice, but this one would get swallowed up on -questions.
 
 NO_SHARED only works on programs that use the bsd.prog.mk makefile
 template; I'd guess under a dozen ports do this.
 
 Some pieces of software have dynamic-link options hardcoded in their
 Makefiles, probably as a workaround for bugs in other OSes.  Those
 options override -static.  I can't think of a valid reason for them to
 be used in FreeBSD.  Search for (and remove) any occurances of
 -Wl,-Bdynamic and -Wl,-Bstatic , and you should be set.

No luck on either string.  I ended up getting what I wanted by going through
the source Makefile and adding -static to the appropriate line in the
target for the program I needed static-linked.  Now devd can bring up my
wireless NIC at boot.  Works great!


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Forcing static-linking on a port?

2005-05-23 Thread Dan Nelson
In the last episode (May 23), Darren Pilgrim said:
 I need to make use of a port during start up, but it has library
 dependencies that aren't available, before the complete library path is
 established.  I've tried the following:
 
 NO_SHARED=true (added to /etc/make.conf)
 make -DNO_SHARED
 make LDFLAGS+=-static
 
 Every time, running file on the compiled program tells me that the binary is
 dynamically-linked.  I couldn't find anything else in any man pages, Mk
 files, mailing lists, Google, etc.  Sorry for the semi-inappropriate list
 choice, but this one would get swallowed up on -questions.

NO_SHARED only works on programs that use the bsd.prog.mk makefile
template; I'd guess under a dozen ports do this.

Some pieces of software have dynamic-link options hardcoded in their
Makefiles, probably as a workaround for bugs in other OSes.  Those
options override -static.  I can't think of a valid reason for them to
be used in FreeBSD.  Search for (and remove) any occurances of
-Wl,-Bdynamic and -Wl,-Bstatic , and you should be set.

-- 
Dan Nelson
[EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]