[PATCH] convert crashrep to gbuild and add to tail_build

Peter Foley (via Code Review) gerrit at gerrit.libreoffice.org
Tue Jan 22 18:34:54 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1818

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/18/1818/1

convert crashrep to gbuild and add to tail_build

Change-Id: I90cf6c2c5fb806855b7e4fec18c890f7bd2ff6b5
---
M Module_tail_build.mk
M Repository.mk
M RepositoryModule_ooo.mk
A crashrep/CustomTarget_crashrep_res.mk
A crashrep/Executable_crashrep.mk
A crashrep/Makefile
A crashrep/Module_crashrep.mk
A crashrep/WinResTarget_crashrep.mk
M crashrep/prj/build.lst
M crashrep/prj/d.lst
D crashrep/prj/dmake
D crashrep/source/all/makefile.mk
M crashrep/source/unx/main.cxx
D crashrep/source/unx/makefile.mk
R crashrep/source/win32/base64.cxx
A crashrep/source/win32/crashrep.rc
R crashrep/source/win32/crashrep.ulf
D crashrep/source/win32/makefile.mk
R crashrep/source/win32/soreport.cxx
M postprocess/prj/build.lst
20 files changed, 180 insertions(+), 213 deletions(-)



diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index dfac982..85adfab 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -57,6 +57,7 @@
 	cppuhelper \
 	$(call gb_Helper_optional,CPPUNIT,cppunit) \
 	cpputools \
+	$(call gb_Helper_optional,CRASHREP,crashrep) \
 	$(call gb_Helper_optional,CT2N,ct2n) \
 	cui \
 	$(call gb_Helper_optional,CURL,curl) \
diff --git a/Repository.mk b/Repository.mk
index 133bbfe..19e9c4d 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -36,6 +36,7 @@
     cfgex \
     cpp \
     cppunit/cppunittester \
+    $(call gb_Helper_optional,CRASHREP,crashrep) \
     g2g \
     gencoll_rule \
     genconv_dict \
diff --git a/RepositoryModule_ooo.mk b/RepositoryModule_ooo.mk
index f2bde73..002993e 100644
--- a/RepositoryModule_ooo.mk
+++ b/RepositoryModule_ooo.mk
@@ -62,6 +62,7 @@
 	cppuhelper \
 	$(call gb_Helper_optional,CPPUNIT,cppunit) \
 	cpputools \
+	$(call gb_Helper_optional,CRASHREP,crashrep) \
 	$(call gb_Helper_optional,CT2N,ct2n) \
 	cui \
 	$(call gb_Helper_optional,CURL,curl) \
diff --git a/crashrep/CustomTarget_crashrep_res.mk b/crashrep/CustomTarget_crashrep_res.mk
new file mode 100644
index 0000000..e29ecc5
--- /dev/null
+++ b/crashrep/CustomTarget_crashrep_res.mk
@@ -0,0 +1,35 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,crashrep/source/win32))
+
+$(eval $(call gb_CustomTarget_register_targets,crashrep/source/win32, \
+	crashrep_impl.rc \
+))
+
+$(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep_impl.rc : \
+	$(SRCDIR)/crashrep/source/win32/rcfooter.txt \
+	$(SRCDIR)/crashrep/source/win32/rcheader.txt \
+	$(SRCDIR)/crashrep/source/win32/rctemplate.txt \
+	$(SRCDIR)/crashrep/source/win32/crashrep.ulf \
+	$(call gb_Executable_get_runtime_dependencies,lngconvex)
+
+#BRAND_BASE_DIR=$(call gb_Helper_make_url,$(OUTDIR)/unittest/install)
+$(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep_impl.rc :
+	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),LCX,1)
+	$(call gb_Helper_abbreviate_dirs,\
+		cd $(SRCDIR)/crashrep/source/win32 && \
+		$(call gb_Executable_get_command,lngconvex) \
+			-ulf crashrep.ulf \
+			-rc $@ \
+			-rct rctemplate.txt \
+			-rch rcheader.txt \
+			-rcf rcfooter.txt)
+
+# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/crashrep/Executable_crashrep.mk b/crashrep/Executable_crashrep.mk
new file mode 100644
index 0000000..eea1b05
--- /dev/null
+++ b/crashrep/Executable_crashrep.mk
@@ -0,0 +1,65 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Executable_Executable,crashrep))
+
+$(eval $(call gb_Executable_add_defs,crashrep,\
+	-D_INPATH=\"$(INPATH)\" \
+))
+
+ifeq ($(OS),WNT)
+
+$(eval $(call gb_Executable_add_exception_objects,crashrep,\
+	crashrep/source/win32/soreport \
+	crashrep/source/win32/base64 \
+))
+
+$(eval $(call gb_Executable_use_libraries,crashrep,\
+	sal \
+))
+
+$(eval $(call gb_Executable_use_system_win32_libs,crashrep,\
+	gdi32 \
+	comctl32 \
+	comdlg32 \
+	advapi32 \
+	ws2_32 \
+	shell32 \
+	dbghelp \
+	psapi \
+))
+
+$(eval $(call gb_Executable_set_targettype_gui,crashrep,YES))
+
+$(eval $(call gb_Executable_add_nativeres,crashrep,crashrep))
+
+else
+
+$(eval $(call gb_Executable_add_exception_objects,crashrep,\
+	crashrep/source/unx/main \
+))
+
+ifeq ($(filter FREEBSD NETBSD DRAGONFLY MACOSX,$(OS)),)
+$(eval $(call gb_Executable_add_libs,crashrep,\
+   -ldl \
+   -lnsl \
+))
+endif
+
+ifeq ($(OS),SOLARIS)
+$(eval $(call gb_Executable_add_libs,crashrep,\
+   -lsocket \
+))
+endif
+
+endif
+
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/crashrep/Makefile b/crashrep/Makefile
new file mode 100644
index 0000000..0997e62
--- /dev/null
+++ b/crashrep/Makefile
@@ -0,0 +1,14 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/crashrep/Module_crashrep.mk b/crashrep/Module_crashrep.mk
new file mode 100644
index 0000000..6b44ea0
--- /dev/null
+++ b/crashrep/Module_crashrep.mk
@@ -0,0 +1,27 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,crashrep))
+
+ifeq ($(ENABLE_CRASHDUMP),TRUE)
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Module_add_targets,crashrep,\
+	CustomTarget_crashrep_res \
+	Executable_crashrep \
+	WinResTarget_crashrep \
+))
+else ifneq ($(PRODUCT),)
+$(eval $(call gb_Module_add_targets,crashrep,\
+	Executable_crashrep \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/crashrep/WinResTarget_crashrep.mk b/crashrep/WinResTarget_crashrep.mk
new file mode 100644
index 0000000..6206dc7
--- /dev/null
+++ b/crashrep/WinResTarget_crashrep.mk
@@ -0,0 +1,22 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_WinResTarget_WinResTarget,crashrep))
+
+$(eval $(call gb_WinResTarget_use_custom_headers,crashrep,\
+	crashrep/source/win32 \
+))
+
+$(eval $(call gb_WinResTarget_add_defs,crashrep,\
+	-DVERVARIANT=$(BUILD) \
+))
+
+$(eval $(call gb_WinResTarget_set_rcfile,crashrep,crashrep/source/win32/crashrep))
+
+# vim: set noet sw=4 ts=4:
diff --git a/crashrep/prj/build.lst b/crashrep/prj/build.lst
index 5d22c2d..5707de5 100644
--- a/crashrep/prj/build.lst
+++ b/crashrep/prj/build.lst
@@ -1,5 +1,2 @@
 cr	crashrep	:    sal sysui shell NULL
-cr	crashrep				usr1	-	all	cr_mkout NULL
-cr	crashrep\source\all		nmake	-	all	cr_sresource NULL
-cr	crashrep\source\unx		nmake	-	u	cr_sunx NULL
-cr	crashrep\source\win32	nmake	-	n	cr_swin32 cr_sresource NULL
+cr	crashrep\prj		nmake	-	all	cr_crashrep NULL
diff --git a/crashrep/prj/d.lst b/crashrep/prj/d.lst
index 3ca113b..e69de29 100644
--- a/crashrep/prj/d.lst
+++ b/crashrep/prj/d.lst
@@ -1,3 +0,0 @@
-..\%__SRC%\bin\soreport.exe %_DEST%\bin\crashrep.exe
-..\%__SRC%\bin\soreport.exe.manifest %_DEST%\bin\crashrep.exe.manifest
-..\%__SRC%\bin\crashrep %_DEST%\bin\crashrep
diff --git a/crashrep/prj/dmake b/crashrep/prj/dmake
deleted file mode 100644
index e69de29..0000000
--- a/crashrep/prj/dmake
+++ /dev/null
diff --git a/crashrep/source/all/makefile.mk b/crashrep/source/all/makefile.mk
deleted file mode 100644
index 5b4f08a..0000000
--- a/crashrep/source/all/makefile.mk
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..$/..
-
-PRJNAME=crashrep
-TARGET=crash_res
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-# ------------------------------------------------------------------
-
-ULFFILES = \
-    crashrep.ulf
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE :	target.mk
-
-.IF "$(WITH_LANG)"!=""
-ALLTAR : $(foreach,i,$(ULFFILES) $(COMMONMISC)$/$(TARGET)$/$i)
-.ENDIF			# "$(WITH_LANG)"!=""
-
diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index 652593d..7041f8c 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -19,7 +19,6 @@
 #include <cstdio>
 #include <stdlib.h>
 #include <sys/utsname.h>
-#include <_version.h>
 #include <errno.h>
 #include <string.h>
 #include <assert.h>
diff --git a/crashrep/source/unx/makefile.mk b/crashrep/source/unx/makefile.mk
deleted file mode 100644
index 376e45c..0000000
--- a/crashrep/source/unx/makefile.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..$/..
-
-PRJNAME=crashrep
-TARGET=crashrep
-TARGETTYPE=CUI
-
-ENABLE_EXCEPTIONS=TRUE
-LIBTARGET=NO
-LIBSALCPPRT=$(0)
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-# ------------------------------------------------------------------
-
-# Only build crash reporter if either a product build with debug info
-# or a non-pro build is done.
-
-.IF "$(ENABLE_CRASHDUMP)" != "" || "$(PRODUCT)" == ""
-
-SOLARLIB!:=$(SOLARLIB:s/jre/jnore/)
-
-OBJFILES=\
-    $(OBJ)$/main.obj
-
-APP1NOSAL=TRUE
-APP1TARGET=$(TARGET)
-APP1OBJS=$(OBJFILES)
-APP1RPATH=OOO
-
-.IF "$(OS)" != "FREEBSD" && "$(OS)" != "MACOSX" && "$(OS)"!="NETBSD" && \
-    "$(OS)" != "DRAGONFLY"
-APP1STDLIBS+=-ldl -lnsl
-.ENDIF
-.IF "$(OS)" == "SOLARIS"
-APP1STDLIBS+=-lsocket
-.ENDIF
-
-.ENDIF #  "$(ENABLE_CRASHDUMP)" != "" || "$(PRODUCT)" == ""
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE :	target.mk
-
-$(OBJ)$/main.obj: $(INCCOM)$/_version.h
-
-# Building crash_report
diff --git a/crashrep/source/win32/base64.cpp b/crashrep/source/win32/base64.cxx
similarity index 100%
rename from crashrep/source/win32/base64.cpp
rename to crashrep/source/win32/base64.cxx
diff --git a/crashrep/source/win32/crashrep.rc b/crashrep/source/win32/crashrep.rc
new file mode 100755
index 0000000..250ed92
--- /dev/null
+++ b/crashrep/source/win32/crashrep.rc
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "crashrep_impl.rc"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/all/crashrep.ulf b/crashrep/source/win32/crashrep.ulf
similarity index 85%
rename from crashrep/source/all/crashrep.ulf
rename to crashrep/source/win32/crashrep.ulf
index ae5e93b..12ef7e7 100644
--- a/crashrep/source/all/crashrep.ulf
+++ b/crashrep/source/win32/crashrep.ulf
@@ -1,20 +1,3 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
 
 [%WELCOME_CAPTION%]
 en-US = "%PRODUCTNAME% %PRODUCTVERSION% Error Report"
diff --git a/crashrep/source/win32/makefile.mk b/crashrep/source/win32/makefile.mk
deleted file mode 100644
index 79e02b9..0000000
--- a/crashrep/source/win32/makefile.mk
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-PRJ=..$/..
-
-PRJNAME=crashrep
-TARGET=soreport
-LIBTARGET=NO
-ENABLE_EXCEPTIONS=TRUE
-TARGETTYPE=GUI
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE :  settings.mk
-
-# --- Resources ----------------------------------------------------
-
-RCFILES=$(RES)$/$(TARGET).rc
-
-# --- Files --------------------------------------------------------
-
-OBJFILES=\
-    $(OBJ)$/soreport.obj\
-    $(OBJ)$/base64.obj
-    
-.IF "$(WITH_LANG)"!=""
-ULFDIR:=$(COMMONMISC)$/crash_res
-.ELSE			# "$(WITH_LANG)"!=""
-ULFDIR:=..$/all
-.ENDIF			# "$(WITH_LANG)"!=""
-LNGFILES=$(ULFDIR)$/crashrep.ulf
-
-APP1OBJS=$(OBJFILES)
-
-APP1NOSAL=TRUE
-                        
-APP1TARGET=$(TARGET)
-APP1RPATH=OOO
-
-STDLIB1=\
-    $(SALLIB)\
-    $(GDI32LIB)\
-    $(COMCTL32LIB)\
-    $(COMDLG32LIB)\
-    $(ADVAPI32LIB)\
-    $(WS2_32LIB)\
-    $(SHELL32LIB)\
-    $(DBGHELPLIB)\
-    psapi.lib
-
-APP1NOSVRES=$(RES)$/$(TARGET).res
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE :	target.mk
-
-$(OBJ)$/soreport.obj: $(INCCOM)$/_version.h
-
-# Generate the native Windows resource file
-# using lngconvex.exe 
-
-$(RCFILES) : $(LNGFILES) makefile.mk rcfooter.txt rcheader.txt rctemplate.txt ctrylnglist.txt
-    $(LNGCONVEX) -ulf $(ULFDIR)$/crashrep.ulf -rc $(RES)$/$(TARGET).rc  -rct rctemplate.txt -rch rcheader.txt -rcf rcfooter.txt
-    
diff --git a/crashrep/source/win32/soreport.cpp b/crashrep/source/win32/soreport.cxx
similarity index 99%
rename from crashrep/source/win32/soreport.cpp
rename to crashrep/source/win32/soreport.cxx
index 0721950..fc8886c 100644
--- a/crashrep/source/win32/soreport.cpp
+++ b/crashrep/source/win32/soreport.cxx
@@ -66,8 +66,6 @@
 #include <malloc.h>
 #include <process.h>
 
-#include <_version.h>
-
 #include "resource.h"
 #include "base64.h"
 
diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst
index fbeebca..2ba45e2 100644
--- a/postprocess/prj/build.lst
+++ b/postprocess/prj/build.lst
@@ -1,2 +1,2 @@
-po      postprocess     ::      CRASHREP:crashrep HELP:helpcontent2 ODK:odk MYSQLC:mysqlc DESKTOP:setup_native sysui tail_build NULL
+po      postprocess     ::      HELP:helpcontent2 ODK:odk MYSQLC:mysqlc DESKTOP:setup_native sysui tail_build NULL
 po	postprocess\prj		nmake	-	all	po_prj NULL

-- 
To view, visit https://gerrit.libreoffice.org/1818
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90cf6c2c5fb806855b7e4fec18c890f7bd2ff6b5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Peter Foley <pefoley2 at verizon.net>



More information about the LibreOffice mailing list