From kde-commits Mon Jun 04 13:02:34 2012 From: Stephan Kulow Date: Mon, 04 Jun 2012 13:02:34 +0000 To: kde-commits Subject: icecream Message-Id: <20120604130234.F1E70AC76E () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133881514921850 SVN commit 1298238 by coolo: move the gcc specifics to a new source file - and make sure we can compile with automake 1.12 M +2 -1 client/Makefile.am M +0 -4 configure.in M +1 -32 daemon/workit.cpp M +1 -2 services/Makefile.am A services/gcc.cpp [License: UNKNOWN] M +3 -0 services/platform.h --- trunk/icecream/client/Makefile.am #1298237:1298238 @@ -1,10 +1,11 @@ INCLUDES = -I$(srcdir)/../services bin_PROGRAMS = icecc -pkglib_SCRIPTS = icecc-create-env +pkglibexec_SCRIPTS = icecc-create-env icecc_SOURCES = main.cpp arg.cpp cpp.cpp local.cpp remote.cpp util.cpp md5.c safeguard.cpp icecc_LDADD = ../services/libicecc.la $(LIBRSYNC) noinst_HEADERS = client.h md5.h util.h +AM_CPPFLAGS = -DPLIBDIR=\"$(pkglibexecdir)\" EXTRA_DIST = icecc-create-env --- trunk/icecream/configure.in #1298237:1298238 @@ -246,10 +246,6 @@ KDE_EXPAND_MAKEVAR(mybindir, bindir) AC_DEFINE_UNQUOTED(BINDIR, "$mybindir", [Where to look for icecc]) -myopkglibdir='${libdir}/'"$PACKAGE" -KDE_EXPAND_MAKEVAR(mypkglibdir, myopkglibdir) -AC_DEFINE_UNQUOTED(PLIBDIR, "$mypkglibdir", [Where to look for icecc-create-env]) - myorundir='${localstatedir}/run' KDE_EXPAND_MAKEVAR(myrundir, myorundir) AC_DEFINE_UNQUOTED(RUNDIR, "$myrundir", [Where to place pid files]) --- trunk/icecream/daemon/workit.cpp #1298237:1298238 @@ -59,41 +59,10 @@ #include #include "comm.h" +#include "platform.h" using namespace std; -// code based on gcc - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. - -/* Heuristic to set a default for GGC_MIN_EXPAND. */ -static int -ggc_min_expand_heuristic(unsigned int mem_limit) -{ - double min_expand = mem_limit; - - /* The heuristic is a percentage equal to 30% + 70%*(RAM/1GB), yielding - a lower bound of 30% and an upper bound of 100% (when RAM >= 1GB). */ - min_expand /= 1024; - min_expand *= 70; - min_expand = std::min (min_expand, 70.); - min_expand += 30; - - return int( min_expand ); -} - -/* Heuristic to set a default for GGC_MIN_HEAPSIZE. */ -static unsigned int -ggc_min_heapsize_heuristic(unsigned int mem_limit) -{ - /* The heuristic is RAM/8, with a lower bound of 4M and an upper - bound of 128M (when RAM >= 1GB). */ - mem_limit /= 8; - mem_limit = std::max (mem_limit, 4U); - mem_limit = std::min (mem_limit, 128U); - - return mem_limit * 1024; -} - - static int death_pipe[2]; extern "C" { --- trunk/icecream/services/Makefile.am #1298237:1298238 @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libicecc.la -libicecc_la_SOURCES = job.cpp comm.cpp getifaddrs.cpp logging.cpp tempfile.c platform.cpp +libicecc_la_SOURCES = job.cpp comm.cpp getifaddrs.cpp logging.cpp tempfile.c platform.cpp gcc.cpp libicecc_la_LIBADD = ../minilzo/libminilzo.la -ldl libicecc_la_CFLAGS = -fPIC -DPIC libicecc_la_CXXFLAGS = -fPIC -DPIC @@ -17,4 +17,3 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = icecc.pc - --- trunk/icecream/services/platform.h #1298237:1298238 @@ -25,4 +25,7 @@ extern const std::string& determine_platform(); +extern int ggc_min_expand_heuristic(unsigned int mem_limit); +extern unsigned int ggc_min_heapsize_heuristic(unsigned int mem_limit); + #endif