Programs will be, by default, linke with "-Wl,--as-needed" to

reduce unused library dependencies.
This commit is contained in:
Sanel Zukan 2008-08-10 18:18:16 +00:00
parent ef7c53d33d
commit 3f821eb1e5
2 changed files with 10 additions and 2 deletions

View File

@ -29,14 +29,17 @@ EDEDESKTOPDIR ?= "$(PREFIX)/data/desktop" ;
GLOBALFLAGS ?= -Wall -pedantic -g3 -D_DEBUG -I$(TOP) ;
STDLIB ?= -lstdc++ ;
# some options
REMOVE_UNUSED_DEPENDENCIES_TRICK = 1 ;
# edelib libraries path
EDELIBINCLUDE ?= -I/opt/ede/include ;
EDELIBLIB ?= -L/opt/ede/lib -ledelib ;
# fltk libraries path
FLTKINCLUDE ?= -I/usr/local/include ;
FLTKLIB ?= -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -ldl -lm -lXext -lX11 -lXpm ;
FLTKLIB_NOIMAGES ?= -L/usr/local/lib -lfltk -ldl -lm -lXext -lX11 ;
FLTKLIB ?= -L/usr/local/lib -lfltk_images -lpng -lz -ljpeg -lfltk -ldl -lm -lXext -lXft -lX11 -lXpm ;
FLTKLIB_NOIMAGES ?= -L/usr/local/lib -lfltk -ldl -lm -lXext -lXft -lX11 ;
# backward; efltk libraries path
EFLTKINCLUDE ?= -I/usr/local/include ;

View File

@ -32,6 +32,11 @@ rule MakeProgramPrivate
CFLAGS on $(objects) += $(4) ;
C++FLAGS on $(objects) += $(4) ;
if $(REMOVE_UNUSED_DEPENDENCIES_TRICK) = 1 {
# remove unused dependencies in binaries, as U.Drepper prescribed ;-)
LINKFLAGS on $(target) = -Wl,--as-needed [ on $(target) return $(LINKFLAGS) ] ;
}
LINKLIBS on $(target) = $(3) [ on $(target) return $(LINKLIBS) ] ;
MainFromObjects $(target) : $(objects) ;