From 9a2868e7155bcb5c1605ee48121c06a2633279b2 Mon Sep 17 00:00:00 2001 From: "Eric J. Korpela" Date: Fri, 16 Jan 2009 00:24:44 +0000 Subject: [PATCH] -Made static linkage of BOINC libraries the default for client, manager, and server components svn path=/trunk/boinc/; revision=16928 --- checkin_notes | 16 ++++++++++++++++ client/Makefile.am | 9 +++++++++ clientgui/Makefile.am | 9 +++++++++ configure.ac | 7 +++++++ samples/example_app/Makefile | 10 +++++----- tools/Makefile.am | 1 + 6 files changed, 47 insertions(+), 5 deletions(-) diff --git a/checkin_notes b/checkin_notes index eb16deda69..8fe17465e8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -435,3 +435,19 @@ David 15 Jan 2009 sched/ sched_plan.cpp + +Eric 15 Jan 2009 + - build: Made static linkage of BOINC libraries the default for client, + manager, and server components + + configure.ac + tools/ + Makefile.am + clientgui/ + Makefile.am + client/ + Makefile.am + samples/ + example_app/ + Makefile + diff --git a/client/Makefile.am b/client/Makefile.am index 6ad5c89d8d..27981ce941 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -5,7 +5,16 @@ include $(top_srcdir)/Makefile.incl if ENABLE_CLIENT_RELEASE AM_LDFLAGS += -static-libtool-libs +## for an entirely statically linked library, you may want to try +## -all-static instead. There's a good chance it won't work properly, +## so we'll use the safer "-static-libtool-libs" by default. +else +if DYNAMIC_CLIENT +## if libtool starts to need flags for dynamic linking, add them here +else + AM_LDFLAGS += -static endif +endif ## ENABLE_CLIENT_RELEASE LIBS += $(CLIENTLIBS) diff --git a/clientgui/Makefile.am b/clientgui/Makefile.am index 90b0d54101..488e5b543b 100644 --- a/clientgui/Makefile.am +++ b/clientgui/Makefile.am @@ -5,7 +5,16 @@ include $(top_srcdir)/Makefile.incl if ENABLE_CLIENT_RELEASE AM_LDFLAGS += -static-libtool-libs +## for an entirely statically linked library, you may want to try +## -all-static instead. There's a good chance it won't work properly, +## so we'll use the safer "-static-libtool-libs" by default. +else +if DYNAMIC_CLIENT +## if libtool starts to need flags for dynamic linking, add them here +else + AM_LDFLAGS += -static endif +endif ## ENABLE_CLIENT_RELEASE if OS_DARWIN LIBS += -framework IOKit -framework Foundation -framework ScreenSaver -framework Cocoa -framework Security diff --git a/configure.ac b/configure.ac index 8c598289f9..35032815fa 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,12 @@ AM_PROG_CC_C_O m4_divert_once([HELP_ENABLE], AS_HELP_STRING([BOINC Default enable values], [--enable-server --enable-client --enable-libraries --enable-manager: builds server, client, and libraries])) +AC_ARG_ENABLE(dynamic-client-linkage, + AS_HELP_STRING([--enable-dynamic-client-linkage], + [dynamically link the client to the boinc libraries]), + [dynamic_client=${enableval}], + [dynamic_client=no]) + AC_ARG_ENABLE(server, AS_HELP_STRING([--disable-server], [disable building the scheduling server]), @@ -655,6 +661,7 @@ dnl Whether to build fcgi components AM_CONDITIONAL(ENABLE_FCGI,[test "${enable_fcgi}" = yes]) dnl tell automake about whether to build client and/or server +AM_CONDITIONAL(DYNAMIC_CLIENT, [test "${dynamic_client}" = yes]) AM_CONDITIONAL(ENABLE_SERVER, [test "${enable_server}" = yes]) AM_CONDITIONAL(ENABLE_CLIENT, [test "${enable_client}" = yes]) AM_CONDITIONAL(ENABLE_MANAGER, [ test "x${ac_cv_have_wxwidgets}" = xyes -a "${enable_manager}" = yes ]) diff --git a/samples/example_app/Makefile b/samples/example_app/Makefile index 8d71c6e1d6..fb3e47bc11 100644 --- a/samples/example_app/Makefile +++ b/samples/example_app/Makefile @@ -47,13 +47,13 @@ install: uc2 uc2: uc2.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a $(CXX) $(CXXFLAGS) -o uc2 uc2.o libstdc++.a -pthread \ - $(BOINC_API_DIR)/boinc_api.a \ - $(BOINC_LIB_DIR)/boinc.a + $(BOINC_API_DIR)/libboinc_api.a \ + $(BOINC_LIB_DIR)/libboinc.a uc2_graphics: uc2_graphics.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_graphics2.a $(CXX) $(CXXFLAGS) -o uc2_graphics uc2_graphics.o libstdc++.a -pthread \ - $(BOINC_API_DIR)/boinc_graphics2.a \ - $(BOINC_API_DIR)/boinc_api.a \ - $(BOINC_LIB_DIR)/boinc.a \ + $(BOINC_API_DIR)/libboinc_graphics2.a \ + $(BOINC_API_DIR)/libboinc_api.a \ + $(BOINC_LIB_DIR)/libboinc.a \ $(LIBGLUT) $(LIBGLU) $(LIBJPEG) \ -lGL -lX11 -lXmu -lm diff --git a/tools/Makefile.am b/tools/Makefile.am index cb7577fc5b..8362b65f96 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -6,6 +6,7 @@ bin_PROGRAMS = create_work sign_executable dir_hier_path dir_hier_move EXTRA_DIST = make_project xadd update_versions dbcheck_files_exist upgrade makelog.sh cleanlogs.sh vote_monitor calculate_credit_multiplier AM_CXXFLAGS += $(MYSQL_CFLAGS) +AM_LDFLAGS += -static create_work_SOURCES = create_work.cpp create_work_LDADD = $(SERVERLIBS)