Target in Makefile.am to make a completly static version



Hi all,

How does one add a target in Makefile.am to make completely static binary.

My Makefile.am has these instructions:

## Process this file with automake to produce Makefile.in

INCLUDES = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
@PACKAGE_CFLAGS@

bin_PROGRAMS = tptest-gui tptest-gui-static

tptest_gui_SOURCES = \
main.c \
support.h \
support.c \
interface.h \
interface.c \
callbacks.h \
callbacks.c \
utils.h \
utils.c

tptest_gui_static_SOURCES = \
main.c \
support.h \
support.c \
interface.h \
interface.c \
callbacks.h \
callbacks.c \
utils.h \
utils.c


tptest_gui_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
tptest_gui_static_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)

tptest_gui_static_LDFLAGS = @LDFLAGS@ -static

Adding the option -static does not solve my problem and adding -all-static
gives link errors since apparently some of the dependent libraries are
dynamically linked.

Error message:
/usr/bin/ld: attempted static link of dynamic object
`/usr/lib/libgtk-x11-2.0.so'

--
Hilsen/Regards
Michael Rasmussen
http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917

.