Commits

Anonymous committed 5e73474

callcatcher: get callcatcher into build environment; with the friendly help of Ause

Comments (0)

Files changed (12)

lpsolve/lp_solve_5.5-callcatcher.patch

+--- misc/lp_solve_5.5/lpsolve55/ccc	2011-03-29 13:00:51.476387993 +0200
++++ misc/build/lp_solve_5.5/lpsolve55/ccc	2011-03-29 12:57:36.969541258 +0200
+@@ -12,13 +12,17 @@
+ 
+ opts='-O3'
+ 
+-$c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++for file in $src; do
++    $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $file
++done
+ ar rv liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'`
+ ranlib liblpsolve55.a
+ 
+ if [ "$so" != "" ]
+ then
+-  $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src
++  for file in $src; do
++    $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $file
++  done
+   $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl
+ fi
+ 

lpsolve/makefile.mk

 .ELSE
 PATCH_FILES=lp_solve_5.5.patch
 ADDITIONAL_FILES=lpsolve55$/ccc.solaris lpsolve55$/ccc.os2
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXI" || "$(COM)$(OS)$(CPU)" == "GCCLINUXX"
+PATCH_FILES+=lp_solve_5.5-callcatcher.patch
+.ENDIF
 .ENDIF
 
 CONFIGURE_DIR=

postprocess/callcatcher/cc_analyse.sh

+#!/bin/bash -e
+files=''
+for repo in $gb_REPOS; do
+    files="$files $repo/*/${INPATH}/lib/*.so $repo/*/${INPATH}/bin/*"
+done
+# Call with unquoted variables so pathname expansion works.
+$SOLARENV/bin/cc_wrap.sh $CALLCATCHER_PREFIX/bin/callanalyse $files ${SOURCE_ROOT_DIR}/${INPATH}/workdir/LinkTarget/{Library/*.so,Executable/*}

postprocess/callcatcher/makefile.mk

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..
+
+
+
+PRJNAME=postprocess
+TARGET=callcatcher
+
+.INCLUDE : settings.mk
+
+.INCLUDE : target.mk
+
+ALLTAR : $(MISC)$/callcatcher.done
+
+.IF "$(CALLCATCHER)" != ""
+
+CC_OUTFILE=$(SOLARVERSION)/$(INPATH)/callcatcher/callanalyse
+
+$(MISC)$/callcatcher.done .PHONY:
+	@-$(RM) $(CC_OUTFILE)
+	@echo callanalyse to $(CC_OUTFILE)
+	$(shell cc_analyse.sh > $(CC_OUTFILE))
+
+.ELSE
+
+$(MISC)$/callcatcher.done .PHONY:
+	@echo Nothing to do in non-callcatcher build.
+
+.ENDIF

postprocess/prj/build.lst

 po      postprocess\packcomponents      nmake   -       all     po_packcomponents NULL
 po	postprocess\rebase	    	nmake	-	w	po_rebase NULL
 po	postprocess\signing	    	nmake	-	w,sign	po_signing po_rebase.w NULL
+po	postprocess\callcatcher     nmake	-	all	po_callcatcher NULL

solenv/bin/cc_wrap.sh

+#!/bin/bash -e
+# wrap callcatcher to set required PYTHONPATH
+if [ -n "$CALLCATCHER_PREFIX" ]; then
+    export PYTHONPATH="$CALLCATCHER_PREFIX/lib/python2.6/site-packages"
+    "$@"
+fi

solenv/config/sdev300.ini

             SOURCE_ROOT %SOURCE_ROOT_TMP%
             SOURCE_ROOT_USED TRUE
         }
+        callcatcher
+        {
+            CC %SOLARENV%/bin/cc_wrap.sh callcatcher gcc
+            CXX %SOLARENV%/bin/cc_wrap.sh callcatcher g++
+            LIBMGR PYTHONPATH=%COMMON_ENV_TOOLS%/%WORK_STAMP%/lib/python2.6/site-packages callarchive ar
+            LINK %SOLARENV%/bin/cc_wrap.sh callcatcher g++
+            PATHEXTRA %PATHEXTRA%:%COMMON_ENV_TOOLS%/%WORK_STAMP%/bin
+            CALLCATCHER TRUE
+            CALLCATCHER_PREFIX %COMMON_ENV_TOOLS%/%WORK_STAMP%
+        }
         cap
         {
             COPYALL TRUE
         SYSBASE_ROOT
         USER
     }
-    order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 ojdk16path:0 distroot:0 cap cax compath common2 pro common3:0 common jdk14 jdk15 ojdk16
+    order common0 bs_sourceroot envroot:0 sourceroot:0 sysbaseroot common1 jdk14path:0 jdk15path:0 ojdk16path:0 distroot:0 cap cax compath common2 pro common3:0 common callcatcher jdk14 jdk15 ojdk16
     reset
     {
         CLASSPATH
     {
         bs_sourceroot SOURCE_ROOT_TMP
         bsclient
+        callcatcher
         cap
         cax
         compath STAR_COMPATH

solenv/gbuild/platform/linux.mk

 GUI := UNX
 COM := GCC
 
-gb_MKTEMP := mktemp -t gbuild.XXXXXX
+gb_MKTEMP ?= mktemp -t gbuild.XXXXXX
 
 gb_CC := gcc
 gb_CXX := g++
 gb_GCCP := gcc
+gb_LINK := g++
 gb_AR := ar
 gb_AWK := awk
 gb_CLASSPATHSEP := :
 CPUNAME := X86_64
 endif
 
-# use CC/CXX if they are nondefaults
+# use defined nondefaults
 ifneq ($(origin CC),default)
 gb_CC := $(CC)
 gb_GCCP := $(CC)
 ifneq ($(origin CXX),default)
 gb_CXX := $(CXX)
 endif
+ifneq ($(origin LIBMGR),default)
+gb_AR := $(LIBMGR)
+endif
+ifneq ($(origin LINK),default)
+gb_LINK := $(LINK)
+endif
 
 gb_OSDEFS := \
 	-D$(OS) \
 define gb_LinkTarget__command_dynamiclink
 $(call gb_Helper_abbreviate_dirs,\
 	mkdir -p $(dir $(1)) && \
-	$(gb_CXX) \
+	$(gb_LINK) \
 		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
 		$(subst \d,$$,$(RPATH)) $(LDFLAGS) \
 		$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \

solenv/gbuild/platform/macosx.mk

 COM := GCC
 
 # Darwin mktemp -t expects a prefix, not a pattern
-gb_MKTEMP := /usr/bin/mktemp -t gbuild.
+gb_MKTEMP ?= /usr/bin/mktemp -t gbuild.
 
 gb_CC := cc
 gb_CXX := g++
 gb_GCCP := gcc
+gb_LINK := g++
 gb_AR := ar
 gb_AWK := awk
 gb_CLASSPATHSEP := :
 
-# use CC/CXX if they are nondefaults
+# use defined nondefaults
 ifneq ($(origin CC),default)
 gb_CC := $(CC)
 gb_GCCP := $(CC)
 ifneq ($(origin CXX),default)
 gb_CXX := $(CXX)
 endif
+ifneq ($(origin LIBMGR),default)
+gb_AR := $(LIBMGR)
+endif
+ifneq ($(origin LINK),default)
+gb_LINK := $(LINK)
+endif
 
 gb_OSDEFS := \
 	-D$(OS) \
 		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
 		$(subst \d,$$,$(RPATH)) $(LDFLAGS) \
 		$(patsubst lib%.dylib,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) > $${DYLIB_FILE} && \
-	$(gb_CXX) \
+	$(gb_LINK) \
 		$(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \
 		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
 		$(subst \d,$$,$(RPATH)) $(LDFLAGS) \

solenv/gbuild/platform/solaris.mk

 GUI := UNX
 COM := C52
 
-gb_MKTEMP := mktemp -t gbuild.XXXXXX
+gb_MKTEMP ?= mktemp -t gbuild.XXXXXX
 
 gb_CC := cc
 gb_CXX := CC
 gb_GCCP := cc
+gb_LINK := CC
 gb_AR := ar
 gb_AWK := /usr/xpg4/bin/awk
 gb_CLASSPATHSEP := :
 
-# use CC/CXX if they are nondefaults
+# use defined nondefaults
 ifneq ($(origin CC),default)
 gb_CC := $(CC)
 gb_GCCP := $(CC)
 ifneq ($(origin CXX),default)
 gb_CXX := $(CXX)
 endif
+ifneq ($(origin LIBMGR),default)
+gb_AR := $(LIBMGR)
+endif
+ifneq ($(origin LINK),default)
+gb_LINK := $(LINK)
+endif
 
 gb_OSDEFS := \
 	-D$(OS) \
 define gb_LinkTarget__command_dynamiclink
 $(call gb_Helper_abbreviate_dirs,\
 	mkdir -p $(dir $(1)) && \
-	$(gb_CXX) \
+	$(gb_LINK) \
 		$(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \
 		$(subst \d,$$,$(RPATH)) $(LDFLAGS) \
 		$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))) \

solenv/gbuild/platform/windows.mk

 
 # set tmpdir to some mixed case path, suitable for native tools
 gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
-gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
+gb_MKTEMP ?= mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
 gb_CC := cl
 gb_CXX := cl
 gb_AWK := awk
 gb_CLASSPATHSEP := ;
 
-# use CC/CXX if they are nondefaults
+# use defined nondefaults
 ifneq ($(origin CC),default)
 gb_CC := $(CC)
 gb_GCCP := $(CC)
 ifneq ($(origin CXX),default)
 gb_CXX := $(CXX)
 endif
+ifneq ($(origin LIBMGR),default)
+gb_AR := $(LIBMGR)
+endif
+ifneq ($(origin LINK),default)
+gb_LINK := $(LINK)
+endif
 
 gb_OSDEFS := \
 	-DWINVER=0x0500 \

solenv/gbuild/platform/winmingw.mk

 
 # set tmpdir to some mixed case path, suitable for native tools
 gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp))
-gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
+gb_MKTEMP ?= mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX
 
 gb_CC := $(CC)
 gb_CXX := $(CXX)
 gb_LINK := $(shell $(CC) -print-prog-name=ld)
 gb_AR := $(shell $(CC) -print-prog-name=ar)
 gb_AWK := awk
+
+# use defined nondefaults
+ifneq ($(origin CC),default)
+gb_CC := $(CC)
+gb_GCCP := $(CC)
+endif
+ifneq ($(origin CXX),default)
+gb_CXX := $(CXX)
+endif
+ifneq ($(origin LIBMGR),default)
+gb_AR := $(LIBMGR)
+endif
+ifneq ($(origin LINK),default)
+gb_LINK := $(LINK)
+endif
+
 ifeq ($(USE_MINGW),cygwin)
 gb_MINGWLIBDIR := $(COMPATH)/lib/mingw
 else