diff options
Diffstat (limited to 'solenv/gbuild/platform')
57 files changed, 4183 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/ANDROID_AARCH64_GCC.mk b/solenv/gbuild/platform/ANDROID_AARCH64_GCC.mk new file mode 100644 index 000000000..0fab5ede8 --- /dev/null +++ b/solenv/gbuild/platform/ANDROID_AARCH64_GCC.mk @@ -0,0 +1,17 @@ +# -*- 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/. +# + +# please make generic modifications to unxgcc.mk or android.mk +gb_CPUDEFS += -DARM32 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/unxgcc.mk +include $(GBUILDDIR)/platform/android.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/ANDROID_ARM_GCC.mk b/solenv/gbuild/platform/ANDROID_ARM_GCC.mk new file mode 100644 index 000000000..0fab5ede8 --- /dev/null +++ b/solenv/gbuild/platform/ANDROID_ARM_GCC.mk @@ -0,0 +1,17 @@ +# -*- 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/. +# + +# please make generic modifications to unxgcc.mk or android.mk +gb_CPUDEFS += -DARM32 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/unxgcc.mk +include $(GBUILDDIR)/platform/android.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/ANDROID_INTEL_GCC.mk b/solenv/gbuild/platform/ANDROID_INTEL_GCC.mk new file mode 100644 index 000000000..597366a7f --- /dev/null +++ b/solenv/gbuild/platform/ANDROID_INTEL_GCC.mk @@ -0,0 +1,17 @@ +# -*- 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/. +# + +# please make generic modifications to unxgcc.mk or android.mk +gb_CPUDEFS += -DX86 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/unxgcc.mk +include $(GBUILDDIR)/platform/android.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk b/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk new file mode 100644 index 000000000..bb57e8ae0 --- /dev/null +++ b/solenv/gbuild/platform/ANDROID_X86_64_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +# please make generic modifications to unxgcc.mk or android.mk + +include $(GBUILDDIR)/platform/unxgcc.mk +include $(GBUILDDIR)/platform/android.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/DRAGONFLY_INTEL_GCC.mk b/solenv/gbuild/platform/DRAGONFLY_INTEL_GCC.mk new file mode 100644 index 000000000..00ccf8a03 --- /dev/null +++ b/solenv/gbuild/platform/DRAGONFLY_INTEL_GCC.mk @@ -0,0 +1,18 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_CPUDEFS := -DX86 + +include $(GBUILDDIR)/platform/unxgcc.mk + +gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs:/usr/pkg/lib + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/DRAGONFLY_X86_64_GCC.mk b/solenv/gbuild/platform/DRAGONFLY_X86_64_GCC.mk new file mode 100644 index 000000000..71b53d522 --- /dev/null +++ b/solenv/gbuild/platform/DRAGONFLY_X86_64_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +include $(GBUILDDIR)/platform/unxgcc.mk + +gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs:/usr/pkg/lib + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/DeclareDPIAware.manifest b/solenv/gbuild/platform/DeclareDPIAware.manifest new file mode 100644 index 000000000..bb0123062 --- /dev/null +++ b/solenv/gbuild/platform/DeclareDPIAware.manifest @@ -0,0 +1,7 @@ +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" > + <asmv3:application> + <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"> + <dpiAware>true</dpiAware> + </asmv3:windowsSettings> + </asmv3:application> +</assembly> diff --git a/solenv/gbuild/platform/FREEBSD_INTEL_GCC.mk b/solenv/gbuild/platform/FREEBSD_INTEL_GCC.mk new file mode 100644 index 000000000..5582d2dc8 --- /dev/null +++ b/solenv/gbuild/platform/FREEBSD_INTEL_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_CPUDEFS := -DX86 + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk b/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk new file mode 100644 index 000000000..6199f17b3 --- /dev/null +++ b/solenv/gbuild/platform/FREEBSD_X86_64_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/HAIKU_INTEL_GCC.mk b/solenv/gbuild/platform/HAIKU_INTEL_GCC.mk new file mode 100644 index 000000000..5582d2dc8 --- /dev/null +++ b/solenv/gbuild/platform/HAIKU_INTEL_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_CPUDEFS := -DX86 + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/HAIKU_X86_64_GCC.mk b/solenv/gbuild/platform/HAIKU_X86_64_GCC.mk new file mode 100644 index 000000000..6199f17b3 --- /dev/null +++ b/solenv/gbuild/platform/HAIKU_X86_64_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk new file mode 100644 index 000000000..0531389e8 --- /dev/null +++ b/solenv/gbuild/platform/LINUX_AARCH64_GCC.mk @@ -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/. +# + +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_ARM_GCC.mk b/solenv/gbuild/platform/LINUX_ARM_GCC.mk new file mode 100644 index 000000000..cccf5772b --- /dev/null +++ b/solenv/gbuild/platform/LINUX_ARM_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS += -DARM32 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_AXP_GCC.mk b/solenv/gbuild/platform/LINUX_AXP_GCC.mk new file mode 100644 index 000000000..b0d41078f --- /dev/null +++ b/solenv/gbuild/platform/LINUX_AXP_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_COMPILEROPTFLAGS := -Os +gb_LinkTarget_LDFLAGS += -Wl,--no-relax + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_GODSON64_GCC.mk b/solenv/gbuild/platform/LINUX_GODSON64_GCC.mk new file mode 100644 index 000000000..4a0a619e4 --- /dev/null +++ b/solenv/gbuild/platform/LINUX_GODSON64_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS += -DMIPS64 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_GODSON_GCC.mk b/solenv/gbuild/platform/LINUX_GODSON_GCC.mk new file mode 100644 index 000000000..976aaedf9 --- /dev/null +++ b/solenv/gbuild/platform/LINUX_GODSON_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS += -DMIPS +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_HPPA_GCC.mk b/solenv/gbuild/platform/LINUX_HPPA_GCC.mk new file mode 100644 index 000000000..c1a1ceeee --- /dev/null +++ b/solenv/gbuild/platform/LINUX_HPPA_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_IA64_GCC.mk b/solenv/gbuild/platform/LINUX_IA64_GCC.mk new file mode 100644 index 000000000..c1a1ceeee --- /dev/null +++ b/solenv/gbuild/platform/LINUX_IA64_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_INTEL_GCC.mk b/solenv/gbuild/platform/LINUX_INTEL_GCC.mk new file mode 100644 index 000000000..146e95cf9 --- /dev/null +++ b/solenv/gbuild/platform/LINUX_INTEL_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS := -DX86 +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_M68K_GCC.mk b/solenv/gbuild/platform/LINUX_M68K_GCC.mk new file mode 100644 index 000000000..9e007101d --- /dev/null +++ b/solenv/gbuild/platform/LINUX_M68K_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_POWERPC64_GCC.mk b/solenv/gbuild/platform/LINUX_POWERPC64_GCC.mk new file mode 100644 index 000000000..1880b3bad --- /dev/null +++ b/solenv/gbuild/platform/LINUX_POWERPC64_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS += -DPPC + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_POWERPC_GCC.mk b/solenv/gbuild/platform/LINUX_POWERPC_GCC.mk new file mode 100644 index 000000000..1880b3bad --- /dev/null +++ b/solenv/gbuild/platform/LINUX_POWERPC_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_CPUDEFS += -DPPC + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_S390X_GCC.mk b/solenv/gbuild/platform/LINUX_S390X_GCC.mk new file mode 100644 index 000000000..c1a1ceeee --- /dev/null +++ b/solenv/gbuild/platform/LINUX_S390X_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_S390_GCC.mk b/solenv/gbuild/platform/LINUX_S390_GCC.mk new file mode 100644 index 000000000..c1a1ceeee --- /dev/null +++ b/solenv/gbuild/platform/LINUX_S390_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_SPARC64_GCC.mk b/solenv/gbuild/platform/LINUX_SPARC64_GCC.mk new file mode 100644 index 000000000..9e007101d --- /dev/null +++ b/solenv/gbuild/platform/LINUX_SPARC64_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_SPARC_GCC.mk b/solenv/gbuild/platform/LINUX_SPARC_GCC.mk new file mode 100644 index 000000000..9e007101d --- /dev/null +++ b/solenv/gbuild/platform/LINUX_SPARC_GCC.mk @@ -0,0 +1,15 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk +gb_COMPILEROPTFLAGS := -Os + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/LINUX_X86_64_GCC.mk b/solenv/gbuild/platform/LINUX_X86_64_GCC.mk new file mode 100644 index 000000000..c1a1ceeee --- /dev/null +++ b/solenv/gbuild/platform/LINUX_X86_64_GCC.mk @@ -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/. +# + +#please make generic modifications to unxgcc.mk or linux.mk + +include $(GBUILDDIR)/platform/linux.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/MACOSX_AARCH64_GCC.mk b/solenv/gbuild/platform/MACOSX_AARCH64_GCC.mk new file mode 100644 index 000000000..d8845ccbb --- /dev/null +++ b/solenv/gbuild/platform/MACOSX_AARCH64_GCC.mk @@ -0,0 +1,13 @@ +# -*- 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/. +# +#************************************************************************* + +include $(GBUILDDIR)/platform/macosx.mk + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk b/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk new file mode 100644 index 000000000..d8845ccbb --- /dev/null +++ b/solenv/gbuild/platform/MACOSX_X86_64_GCC.mk @@ -0,0 +1,13 @@ +# -*- 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/. +# +#************************************************************************* + +include $(GBUILDDIR)/platform/macosx.mk + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk b/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk new file mode 100644 index 000000000..feb527ba9 --- /dev/null +++ b/solenv/gbuild/platform/NETBSD_INTEL_GCC.mk @@ -0,0 +1,21 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_CPUDEFS := -DX86 +gb_COMPILEROPTFLAGS := -O -g + +include $(GBUILDDIR)/platform/unxgcc.mk + +NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib + +gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs:$(NB_ADD_LIBPATH) + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk b/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk new file mode 100644 index 000000000..fbbf7b428 --- /dev/null +++ b/solenv/gbuild/platform/NETBSD_X86_64_GCC.mk @@ -0,0 +1,20 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_COMPILEROPTFLAGS := -O -g + +include $(GBUILDDIR)/platform/unxgcc.mk + +NB_ADD_LIBPATH := /usr/pkg/lib:/usr/X11R7/lib + +gb_CppunitTest_CPPTESTPRECOMMAND := LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs:$(NB_ADD_LIBPATH) + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk b/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk new file mode 100644 index 000000000..50d803d29 --- /dev/null +++ b/solenv/gbuild/platform/OPENBSD_INTEL_GCC.mk @@ -0,0 +1,17 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_CPUDEFS := -DX86 +gb_STDLIBS := $(PTHREAD_LIBS) + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/OPENBSD_X86_64_GCC.mk b/solenv/gbuild/platform/OPENBSD_X86_64_GCC.mk new file mode 100644 index 000000000..15908054d --- /dev/null +++ b/solenv/gbuild/platform/OPENBSD_X86_64_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# + +#please make generic modifications to unxgcc.mk + +gb_STDLIBS := $(PTHREAD_LIBS) + +include $(GBUILDDIR)/platform/unxgcc.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/SOLARIS_INTEL_GCC.mk b/solenv/gbuild/platform/SOLARIS_INTEL_GCC.mk new file mode 100644 index 000000000..7f31c8a8a --- /dev/null +++ b/solenv/gbuild/platform/SOLARIS_INTEL_GCC.mk @@ -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/. +# +#************************************************************************* + +include $(GBUILDDIR)/platform/solaris.mk + + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/SOLARIS_SPARC_GCC.mk b/solenv/gbuild/platform/SOLARIS_SPARC_GCC.mk new file mode 100644 index 000000000..25b383489 --- /dev/null +++ b/solenv/gbuild/platform/SOLARIS_SPARC_GCC.mk @@ -0,0 +1,16 @@ +# -*- 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/. +# +#************************************************************************* + +gb_CPUDEFS := -D__sparcv8plus + +include $(GBUILDDIR)/platform/solaris.mk + + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk new file mode 100644 index 000000000..704c7f781 --- /dev/null +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.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/. +# +# 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 . +# + +gb_CPPU_ENV := msci +gb_CPUDEFS := -D_X86_=1 + +include $(GBUILDDIR)/platform/com_MSC_defs.mk + +include $(GBUILDDIR)/platform/com_MSC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/WNT_X86_64_MSC.mk b/solenv/gbuild/platform/WNT_X86_64_MSC.mk new file mode 100644 index 000000000..54533f749 --- /dev/null +++ b/solenv/gbuild/platform/WNT_X86_64_MSC.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/. +# +# 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 . +# + +gb_CPPU_ENV := mscx +gb_CPUDEFS := -D_AMD64_=1 + +include $(GBUILDDIR)/platform/com_MSC_defs.mk + +include $(GBUILDDIR)/platform/com_MSC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/android.mk b/solenv/gbuild/platform/android.mk new file mode 100644 index 000000000..9205e3288 --- /dev/null +++ b/solenv/gbuild/platform/android.mk @@ -0,0 +1,128 @@ +# -*- 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/. +# + +ifeq ($(DISABLE_DYNLOADING),TRUE) + +gb_STDLIBS := -static-libstdc++ + +endif + +# No unit testing can be run +gb_CppunitTest_CPPTESTPRECOMMAND := : + +# Re-define this from unxgcc.mk with some small but important +# changes. Just temporarily done this way, shm_get promised to +# eventually enable this to be done this in some more elegant and less +# redundant fashion. + +gb_LinkTarget_LDFLAGS += \ + -Wl,-z,defs \ + -Wl,--as-needed \ + -Wl,--no-add-needed + +define gb_LinkTarget__command_dynamiclink +$(call gb_Helper_abbreviate_dirs,\ + $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ + -shared \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(subst \d,$$,$(RPATH)) \ + $(T_LDFLAGS) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ + -Wl$(COMMA)--start-group $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) -Wl$(COMMA)--end-group \ + $(T_LIBS) \ + $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))))) \ + -o $(1)) +endef + +ifeq ($(DISABLE_DYNLOADING),TRUE) + +# Library class + +gb_Library_DEFS := +gb_Library_SYSPRE := lib +gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ +gb_Library_PLAINEXT := .a +gb_Library_DLLEXT := .a +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) + +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) +gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) + +endif + +# Prefix UNO library filenames with "lib" +gb_Library_FILENAMES := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \ + + +ifeq ($(DISABLE_DYNLOADING),TRUE) + +gb_Library_FILENAMES += \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):OOO) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +define gb_Library_Library_platform +$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1)) + +endef + +# CppunitTest class + +gb_CppunitTest_get_filename = libtest_$(1).a + +# No use for Cppunit targets now for Android (which would be just +# static archives), they are just a waste of disk space. +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(if $(filter CppunitTest,$(TARGETTYPE)), \ + touch $(1), \ + $(call gb_LinkTarget__command_staticlink,$(1))) + $(call gb_Trace_EndRange,$(2),LNK) +endef + +endif + +# No DT_RPATH or DT_RUNPATH support in the Bionic dynamic linker so +# don't bother generating such. + +define gb_Library_get_rpath +endef + +define gb_Executable_get_rpath +endef + +gb_LinkTarget_LDFLAGS := $(subst -Wl$(COMMA)-rpath-link$(COMMA)$(SYSBASE)/lib:$(SYSBASE)/usr/lib,,$(gb_LinkTarget_LDFLAGS)) + +gb_Library__set_soversion_script_platform = + + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk new file mode 100644 index 000000000..d19f0d368 --- /dev/null +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -0,0 +1,239 @@ +# -*- 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/. +# + +ifeq ($(gb_FULLDEPS),$(true)) +ifneq (,$(CCACHE_HARDLINK)) +# cannot move hardlink over itself, so create dep file directly, even if that +# might leave a broken file behind in case the build is interrupted forcefully +define gb_cxx_dep_generation_options +-MMD -MT $(1) -MP -MF $(2) +endef +define gb_cxx_dep_copy +endef +else +define gb_cxx_dep_generation_options +-MMD -MT $(1) -MP -MF $(2)_ +endef +define gb_cxx_dep_copy +&& mv $(1)_ $(1) +endef +endif +else +define gb_cxx_dep_generation_options +endef +define gb_cxx_dep_copy +endef +endif + +# AsmObject class + +gb_AsmObject_get_source = $(1)/$(2).s + +# $(call gb_AsmObject__command,object,relative-source,source,dep-file) +define gb_AsmObject__command +$(call gb_Output_announce,$(2),$(true),ASM,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ + $(gb_CC) \ + -x assembler-with-cpp \ + $(gb_LTOFLAGS) \ + $(gb_AFLAGS) \ + -c $(3) \ + -o $(1)) \ + $(INCLUDE) && \ + echo "$(1) : $(3)" > $(4) +endef + +# CObject class + +# $(call gb_CObject__compiler,source,compiler) +define gb_CObject__compiler + $(if $(filter %.c %.m,$(1)), \ + $(if $(2), $(2), $(gb_CC)), \ + $(if $(2), $(2), $(gb_CXX))) +endef + +# When gb_LinkTarget_use_clang is used, filter out GCC flags that Clang doesn't know. +# $(call gb_CObject__filter_out_clang_cflags,cflags) +define gb_CObject__filter_out_clang_cflags + $(filter-out $(gb_FilterOutClangCFLAGS),$(1)) +endef + +# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler) +define gb_CObject__command_pattern +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \ + $(gb_COMPILER_SETUP) \ + $(if $(5),$(gb_COMPILER_PLUGINS_SETUP)) \ + $(call gb_CObject__compiler,$(3),$(7)) \ + $(DEFS) \ + $(gb_LTOFLAGS) \ + $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ + $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \ + $(if $(5),$(gb_COMPILER_PLUGINS)) \ + $(if $(COMPILER_TEST),-fsyntax-only -ferror-limit=0 -Xclang -verify) \ + $(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(2)),$(2)) \ + $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ + -c $(3) \ + -o $(1) \ + $(if $(COMPILER_TEST),,$(call gb_cxx_dep_generation_options,$(1),$(4))) \ + $(INCLUDE) \ + $(PCHFLAGS) \ + $(if $(COMPILER_TEST),,$(call gb_cxx_dep_copy,$(4))) \ + ) +endef + +# PrecompiledHeader class + +ifeq ($(COM_IS_CLANG),TRUE) +gb_PrecompiledHeader_get_enableflags = -include-pch $(call gb_PrecompiledHeader_get_target,$(1),$(2)) +gb_PrecompiledHeader_EXT := .pch +else +gb_PrecompiledHeader_get_enableflags = \ +-include $(dir $(call gb_PrecompiledHeader_get_target,$(1),$(2)))$(notdir $(subst .gch,,$(call gb_PrecompiledHeader_get_target,$(1),$(2)))) +gb_PrecompiledHeader_EXT := .gch +endif + +# Clang supports building extra object file where it puts code that would be shared by all users of the PCH. +# Unlike with MSVC it is built as a separate step. The relevant options are used only when generating the PCH +# and when creating the PCH's object file, normal compilations using the PCH do not need extra options. +gb_PrecompiledHeader_pch_with_obj = $(BUILDING_PCH_WITH_OBJ) +ifneq ($(BUILDING_PCH_WITH_OBJ),) +# If using Clang's PCH extra object, we may need to strip unused sections, otherwise inline and template functions +# emitted in that object may in some cases cause unresolved references to private symbols in other libraries. +gb_LinkTarget_LDFLAGS += $(LD_GC_SECTIONS) +gb_PrecompiledHeader_pch_with_obj += -ffunction-sections -fdata-sections +# Enable generating more shared code and debuginfo in the PCH object file. +gb_PrecompiledHeader_pch_with_obj += $(PCH_MODULES_DEBUGINFO) +ifeq ($(ENABLE_OPTIMIZED),) +# -fmodules-codegen appears to be worth it only if not optimizing, otherwise optimizing all the functions emitted +# in the PCH object file may take way too long, especially given that many of those may get thrown away +gb_PrecompiledHeader_pch_with_obj += $(PCH_MODULES_CODEGEN) +endif +endif + +# This is for MSVC's object file built directly as a side-effect of building the PCH. +gb_PrecompiledHeader_get_objectfile = + +define gb_PrecompiledHeader__command +$(call gb_Output_announce,$(2),$(true),PCH,1) + $(call gb_Trace_StartRange,$(2),PCH) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2),$(7))) && \ + cd $(BUILDDIR)/ && \ + CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \ + $(if $(8),$(8),$(gb_CXX)) \ + -x c++-header \ + $(4) \ + $(if $(7), $(call gb_CObject__filter_out_clang_cflags,$(5)),$(5)) \ + $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \ + $(gb_COMPILERDEPFLAGS) \ + $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ + $(gb_NO_PCH_TIMESTAMP) \ + $(gb_PrecompiledHeader_pch_with_obj) \ + $(6) \ + $(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7))) \ + -c $(patsubst %.cxx,%.hxx,$(3)) \ + -o$(1) \ + $(call gb_cxx_dep_copy,$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7))) \ + ) + $(call gb_Trace_EndRange,$(2),PCH) +endef + +ifeq ($(COM_IS_CLANG),TRUE) +# Clang has -fno-pch-timestamp, just checksum the file for CCACHE_PCH_EXTSUM +define gb_PrecompiledHeader__sum_command + $(SHA256SUM) $(1) >$(1).sum +endef +else +# GCC does not generate the same .gch for the same input, so checksum the (preprocessed) input +define gb_PrecompiledHeader__sum_command +$(call gb_Helper_abbreviate_dirs,\ + CCACHE_DISABLE=1 $(gb_COMPILER_SETUP) \ + $(gb_CXX) \ + -x c++-header \ + $(4) $(5) \ + $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS)) \ + $(gb_COMPILERDEPFLAGS) \ + $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ + $(gb_NO_PCH_TIMESTAMP) \ + $(6) \ + -E $(patsubst %.cxx,%.hxx,$(3)) \ + -o- \ + | $(SHA256SUM) >$(1).sum \ + ) +endef +endif + +# not needed +gb_PrecompiledHeader__create_reuse_files = +gb_PrecompiledHeader__copy_reuse_files = + +# YaccTarget class + +define gb_YaccTarget__command +$(call gb_Output_announce,$(2),$(true),YAC,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(3)) && \ + $(BISON) $(T_YACCFLAGS) -v --defines=$(4) -o $(5) $(1) && touch $(3) ) + +endef + +# CppunitTest class + +ifeq ($(strip $(DEBUGCPPUNIT)),TRUE) +gb_CppunitTest_GDBTRACE := gdb -nx -ex "add-auto-load-safe-path $(INSTDIR)" -ex "set environment $(subst =, ,$(gb_CppunitTest_CPPTESTPRECOMMAND))" --batch --command=$(SRCDIR)/solenv/bin/gdbtrycatchtrace-stdout -return-child-result --args +endif + +# ExternalProject class + +gb_ExternalProject_use_autoconf := +gb_ExternalProject_use_nmake := + +# StaticLibrary class + +gb_StaticLibrary_get_filename = lib$(1).a +gb_StaticLibrary_PLAINEXT := .a +gb_StaticLibrary_StaticLibrary_platform := + +gb_LinkTarget_get_linksearchpath_for_layer = \ + -L$(WORKDIR)/LinkTarget/StaticLibrary \ + -L$(call gb_Library_get_sdk_link_dir) \ + $(foreach layer,\ + $(subst +, ,$(patsubst $(1):%.,%,\ + $(filter $(1):%.,$(gb_LinkTarget_LAYER_LINKPATHS)))),\ + $(patsubst $(layer):%,-L%,\ + $(filter $(layer):%,$(gb_Library_LAYER_DIRS)))) + + +gb_ICU_PRECOMMAND := $(call gb_Helper_extend_ld_path,$(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source/lib) + +# UIConfig class + +# macOS sort(1) cannot read a response file +define gb_UIConfig__command +$(call gb_Helper_abbreviate_dirs,\ + $(SORT) -u $(UI_IMAGELISTS) /dev/null > $@ \ +) + +endef + +define gb_UIConfig__gla11y_command +$(call gb_Helper_abbreviate_dirs,\ + $(gb_UIConfig_LXML_PATH) $(if $(SYSTEM_LIBXML)$(SYSTEM_LIBXSLT),,$(gb_Helper_set_ld_path)) \ + $(call gb_ExternalExecutable_get_command,python) \ + $(gb_UIConfig_gla11y_SCRIPT) $(gb_UIConfig_gla11y_PARAMETERS) -o $@ $(UIFILES) +) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk new file mode 100644 index 000000000..1707a7481 --- /dev/null +++ b/solenv/gbuild/platform/com_GCC_defs.mk @@ -0,0 +1,324 @@ +# -*- 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/. +# + +gb_AWK := awk + +gb_CLASSPATHSEP := : +gb_LICENSE := LICENSE +gb_README = README_$(1) + +# use CC/CXX if they are nondefaults +ifneq ($(origin CC),default) +gb_CC := $(CC) +gb_GCCP := $(CC) +else +gb_CC := gcc +gb_GCCP := gcc +endif + +ifneq ($(origin CXX),default) +gb_CXX := $(CXX) +else +gb_CXX := g++ +endif + +ifneq ($(origin AR),default) +gb_AR := $(AR) +else +gb_AR := $(shell $(CC) -print-prog-name=ar) +endif + +# shell setup (env.vars) for the compiler +gb_COMPILER_SETUP := + +ifneq ($(USE_LD),) +gb_LinkTarget_LDFLAGS += -fuse-ld=$(USE_LD) +endif + +ifeq ($(strip $(gb_COMPILEROPTFLAGS)),) +gb_COMPILEROPTFLAGS := -O2 +endif + +gb_CPPU_ENV := gcc3 + +gb_AFLAGS := $(AFLAGS) + +gb_COMPILERDEFS := \ + -DBOOST_ERROR_CODE_HEADER_ONLY \ + -DBOOST_SYSTEM_NO_DEPRECATED \ + -DCPPU_ENV=$(gb_CPPU_ENV) \ + +gb_CFLAGS_COMMON := \ + -Wall \ + -Wendif-labels \ + -Wextra \ + -Wstrict-prototypes \ + -Wundef \ + -Wunreachable-code \ + $(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \ + $(if $(COM_IS_CLANG),-Wembedded-directive) \ + -finput-charset=UTF-8 \ + -fmessage-length=0 \ + -fno-common \ + -pipe \ + -fstack-protector-strong \ + $(if $(gb_COLOR),-fdiagnostics-color=always) \ + +gb_CXXFLAGS_COMMON := \ + -Wall \ + -Wno-missing-braces \ + -Wnon-virtual-dtor \ + -Wendif-labels \ + -Wextra \ + -Wundef \ + -Wunreachable-code \ + $(if $(and $(COM_IS_CLANG),$(or $(findstring icecc,$(CC)),$(findstring icecc,$(CCACHE_PREFIX)))),,-Wunused-macros) \ + $(if $(COM_IS_CLANG),-Wembedded-directive) \ + -finput-charset=UTF-8 \ + -fmessage-length=0 \ + -fno-common \ + -pipe \ + -fstack-protector-strong \ + $(if $(gb_COLOR),-fdiagnostics-color=always) \ + +ifeq ($(HAVE_WDEPRECATED_COPY_DTOR),TRUE) +gb_CXXFLAGS_COMMON += -Wdeprecated-copy-dtor +endif + +gb_CXXFLAGS_DISABLE_WARNINGS = -w + +ifeq ($(HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED),TRUE) +gb_CXXFLAGS_COMMON += -Wno-maybe-uninitialized +endif + +gb_CXXFLAGS_Wundef = -Wno-undef + +ifeq ($(strip $(gb_GCOV)),YES) +gb_CFLAGS_COMMON += -fprofile-arcs -ftest-coverage +gb_CXXFLAGS_COMMON += -fprofile-arcs -ftest-coverage +gb_LinkTarget_LDFLAGS += -fprofile-arcs -lgcov +gb_COMPILEROPTFLAGS := -O0 +endif + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_CFLAGS_COMMON += -ffunction-sections -fdata-sections +gb_CXXFLAGS_COMMON += -ffunction-sections -fdata-sections +gb_LinkTarget_LDFLAGS += -Wl,--gc-sections +endif + +ifeq ($(COM_IS_CLANG),TRUE) +gb_CXXFLAGS_COMMON += \ + -Wimplicit-fallthrough \ + -Wunused-exception-parameter \ + -Wrange-loop-analysis +else +gb_CFLAGS_COMMON += \ + -Wduplicated-cond \ + -Wlogical-op \ + -Wshift-overflow=2 +gb_CXXFLAGS_COMMON += \ + -Wduplicated-cond \ + -Wlogical-op \ + -Wshift-overflow=2 \ + -Wunused-const-variable=1 +endif + +# GCC 8 -Wcast-function-type (included in -Wextra) unhelpfully even warns on reinterpret_cast +# between incompatible function types: +ifeq ($(shell expr '$(GCC_VERSION)' '>=' 800),1) +gb_CXXFLAGS_COMMON += \ + -Wno-cast-function-type +endif + +# If CC or CXX already include -fvisibility=hidden, don't duplicate it +ifeq (,$(filter -fvisibility=hidden,$(CC))) +gb_VISIBILITY_FLAGS := -fvisibility=hidden +endif +gb_VISIBILITY_FLAGS_CXX := -fvisibility-inlines-hidden +gb_CXXFLAGS_COMMON += $(gb_VISIBILITY_FLAGS_CXX) + +gb_LinkTarget_LDFLAGS += -fstack-protector-strong + +ifneq ($(gb_ENABLE_PCH),) +ifeq ($(COM_IS_CLANG),TRUE) +# Clang by default includes in the PCH timestamps of the files it was +# generated from, which would make the PCH be a "new" file for ccache +# even if the file has not actually changed. Disabling the timestamp +# prevents this at the cost of risking using an outdated PCH (which +# should be unlikely, given that gbuild has dependencies set up +# for our includes and system includes are unlikely to change). +gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp +else +gb_CFLAGS_COMMON += -fpch-preprocess -Winvalid-pch +gb_CXXFLAGS_COMMON += -fpch-preprocess -Winvalid-pch +gb_NO_PCH_TIMESTAMP := +endif +endif + +gb_CFLAGS_WERROR = $(if $(ENABLE_WERROR),-Werror) +ifeq ($(ENABLE_OPTIMIZED)-$(COM_IS_CLANG),TRUE-) +gb_CFLAGS_WERROR += -Wno-stringop-overflow +endif + +# This is the default in non-C++11 mode +ifeq ($(COM_IS_CLANG),TRUE) +gb_CXX03FLAGS := -std=gnu++98 -Werror=c++11-extensions -Wno-c++11-long-long \ + -Wno-deprecated-declarations +else +gb_CXX03FLAGS := -std=gnu++98 -Wno-long-long \ + -Wno-variadic-macros -Wno-non-virtual-dtor -Wno-deprecated-declarations +endif + +# On Windows MSVC only supports C90 so force gnu89 (especially in clang) to +# to catch potential gnu89/C90 incompatibilities locally. +gb_CFLAGS_COMMON += -std=gnu89 + +ifeq ($(ENABLE_LTO),TRUE) +ifeq ($(COM_IS_CLANG),TRUE) +gb_LTOFLAGS := -flto +gb_LTOPLUGINFLAGS := --plugin LLVMgold.so +else +gb_LTOFLAGS := -flto=$(PARALLELISM) -fuse-linker-plugin -O2 +endif +endif + +gb_LinkTarget_EXCEPTIONFLAGS := \ + -DEXCEPTIONS_ON \ + -fexceptions + +ifeq ($(gb_ENABLE_DBGUTIL),$(false)) +# Clang doesn't have this option +ifeq ($(HAVE_GCC_FNO_ENFORCE_EH_SPECS),TRUE) +gb_LinkTarget_EXCEPTIONFLAGS += \ + -fno-enforce-eh-specs +gb_FilterOutClangCFLAGS += -fno-enforce-eh-specs +endif +endif + +gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS) + +# optimization level +gb_COMPILERNOOPTFLAGS := -O0 -fstrict-aliasing -fstrict-overflow +gb_COMPILERDEBUGOPTFLAGS := -Og + +ifeq ($(OS),ANDROID) +gb_DEBUGINFO_FLAGS=-glldb +# Clang does not know -ggdb2 or some other options +else ifeq ($(HAVE_GCC_GGDB2),TRUE) +gb_DEBUGINFO_FLAGS=-ggdb2 +else +gb_DEBUGINFO_FLAGS=-g2 +endif +gb_LINKER_DEBUGINFO_FLAGS= + +ifeq ($(HAVE_GCC_SPLIT_DWARF),TRUE) +gb_DEBUGINFO_FLAGS+=-gsplit-dwarf +endif + +ifeq ($(HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR),TRUE) +gb_DEBUGINFO_FLAGS+=-Xclang -debug-info-kind=constructor +endif + +ifeq ($(ENABLE_GDB_INDEX),TRUE) +gb_LINKER_DEBUGINFO_FLAGS += -Wl,--gdb-index +gb_DEBUGINFO_FLAGS += -ggnu-pubnames +endif + +gb_LinkTarget_INCLUDE :=\ + $(SOLARINC) \ + -I$(BUILDDIR)/config_$(gb_Side) \ + +ifeq ($(COM_IS_CLANG),TRUE) +gb_COMPILER_TEST_FLAGS := -Xclang -plugin-arg-loplugin -Xclang --unit-test-mode +ifeq ($(COMPILER_PLUGIN_TOOL),) +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/clang/plugin.so -Xclang -add-plugin -Xclang loplugin +ifneq ($(COMPILER_PLUGIN_WARNINGS_ONLY),) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang \ + --warnings-only='$(COMPILER_PLUGIN_WARNINGS_ONLY)' +endif +else +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/clang/plugin.so -Xclang -plugin -Xclang loplugin $(foreach plugin,$(COMPILER_PLUGIN_TOOL), -Xclang -plugin-arg-loplugin -Xclang $(plugin)) +ifneq ($(UPDATE_FILES),) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --scope=$(UPDATE_FILES) +endif +endif +ifeq ($(COMPILER_PLUGINS_DEBUG),TRUE) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --debug +endif +# set CCACHE_CPP2=1 to prevent clang generating spurious warnings +gb_COMPILER_SETUP += CCACHE_CPP2=1 +gb_COMPILER_PLUGINS_SETUP := ICECC_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox CCACHE_EXTRAFILES=$(SRCDIR)/include/sal/log-areas.dox +gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \ + -Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors +else +# Set CCACHE_CPP2 to prevent GCC -Werror=implicit-fallthrough= when ccache strips comments from C +# code (which still needs /*fallthrough*/-style comments to silence that warning): +ifeq ($(ENABLE_WERROR),TRUE) +gb_COMPILER_SETUP += CCACHE_CPP2=1 +endif +gb_COMPILER_TEST_FLAGS := +gb_COMPILER_PLUGINS := +gb_COMPILER_PLUGINS_SETUP := +gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := +endif + +# Executable class + +gb_Executable_EXT_for_build := + +# Helper class + +ifeq ($(OS_FOR_BUILD),MACOSX) +gb_Helper_LIBRARY_PATH_VAR := DYLD_LIBRARY_PATH +else ifeq ($(OS_FOR_BUILD),AIX) +gb_Helper_LIBRARY_PATH_VAR := LIBPATH +else ifeq ($(OS_FOR_BUILD),WNT) +# In theory possible if cross-compiling to some Unix from Windows, +# in practice strongly discouraged to even try that +gb_Helper_LIBRARY_PATH_VAR := PATH +else ifeq ($(OS_FOR_BUILD),HAIKU) +gb_Helper_LIBRARY_PATH_VAR := LIBRARY_PATH +else +gb_Helper_LIBRARY_PATH_VAR := LD_LIBRARY_PATH +endif + +gb_Helper_set_ld_path := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}"$(INSTROOT_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER_FOR_BUILD):$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER_FOR_BUILD)" + +# $(1): list of : separated directory pathnames to append to the ld path +define gb_Helper_extend_ld_path +$(gb_Helper_set_ld_path):$(1) +endef + +# Convert path to file URL. +define gb_Helper_make_url +file://$(strip $(1)) +endef + +gb_Helper_get_rcfile = $(1)rc + +ifneq ($(gb_ENABLE_PCH),) +# Enable use of .sum files for PCHs. +gb_COMPILER_SETUP += CCACHE_PCH_EXTSUM=1 +# CCACHE_SLOPPINESS should contain pch_defines,time_macros for PCHs. +gb_CCACHE_SLOPPINESS := +ifeq ($(shell test -z "$$CCACHE_SLOPPINESS" && echo 1),1) +gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=pch_defines,time_macros +else +ifeq ($(shell echo "$$CCACHE_SLOPPINESS" | grep -q pch_defines | grep -q time_macros && echo 1),1) +gb_CCACHE_SLOPPINESS := CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS:pch_defines,time_macros +endif +endif +gb_COMPILER_SETUP += $(gb_CCACHE_SLOPPINESS) +endif + +ifneq ($(CCACHE_DEPEND_MODE),) +gb_COMPILER_SETUP += CCACHE_DEPEND=1 +endif + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk new file mode 100644 index 000000000..b9bde52cd --- /dev/null +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -0,0 +1,685 @@ +# -*- 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/. +# +# 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 . +# + +# Convert path to file URL. +define gb_Helper_make_url +file:///$(strip $(1)) +endef + +# YaccTarget class + +define gb_YaccTarget__command +$(call gb_Output_announce,$(2),$(true),YAC,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(3)) && \ + $(BISON) $(T_YACCFLAGS) --defines=$(4) -o $(5) $(1) && touch $(3) ) + +endef + +# CObject class + +# $(call gb_CObject__compiler,flags,source,compiler) +define gb_CObject__compiler + $(if $(filter YES,$(LIBRARY_X64)), $(CXX_X64_BINARY), \ + $(if $(filter YES,$(PE_X86)), $(CXX_X86_BINARY), \ + $(if $(filter %.c,$(2)), \ + $(if $(3), $(3), $(gb_CC)), \ + $(if $(filter -clr,$(1)), \ + $(MSVC_CXX) -I$(SRCDIR)/solenv/clang-cl, \ + $(if $(3), $(3), $(gb_CXX)))))) +endef + +# Avoid annoying warning D9025 about overriding command-line arguments. +gb_Helper_remove_overridden_flags = \ + $(lastword $(filter -W4 -w,$(1))) \ + $(filter-out -W4 -w -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2 -Od -O2,$(1)) \ + $(lastword $(filter -Od -O2,$(1))) \ + $(lastword $(filter -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2,$(1))) + +# $(call gb_CObject__command_pattern,object,flags,source,dep-file,compiler-plugins,symbols,compiler) +define gb_CObject__command_pattern +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && \ + unset INCLUDE && \ + $(call gb_CObject__compiler,$(2),$(3),$(7)) \ + $(DEFS) \ + $(gb_LTOFLAGS) \ + $(call gb_Helper_remove_overridden_flags, \ + $(2) $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS))) \ + $(if $(EXTERNAL_CODE), \ + $(if $(filter -clr,$(2)),,$(if $(COM_IS_CLANG),-Wno-undef)), \ + $(gb_DEFS_INTERNAL)) \ + $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \ + $(if $(filter -clr,$(2)),,$(if $(5),$(gb_COMPILER_PLUGINS))) \ + $(if $(COMPILER_TEST),-fsyntax-only -ferror-limit=0 -Xclang -verify) \ + -Fd$(PDBFILE) \ + $(PCHFLAGS) \ + $(if $(COMPILER_TEST),,$(gb_COMPILERDEPFLAGS)) \ + $(INCLUDE) \ + $(if $(filter YES,$(LIBRARY_X64)), -U_X86_ -D_AMD64_,) \ + $(if $(filter YES,$(PE_X86)), -D_X86_ -U_AMD64_,) \ + -c $(3) \ + -Fo$(1)) $(if $(filter $(true),$(6)),/link /DEBUG:FASTLINK) \ + $(if $(COMPILER_TEST),,$(call gb_create_deps,$(4),$(1),$(3))) +endef + +# PrecompiledHeader class + +gb_PrecompiledHeader_get_enableflags = \ + -Yu$(SRCDIR)/$(3).hxx \ + -FI$(SRCDIR)/$(3).hxx \ + -Fp$(call gb_PrecompiledHeader_get_target,$(1),$(2)) \ + $(gb_PCHWARNINGS) + +gb_PrecompiledHeader_EXT := .pch + +# MSVC PCH needs extra .obj created during the creation of the PCH file +gb_PrecompiledHeader_get_objectfile = $(1).obj + +define gb_PrecompiledHeader__command +$(call gb_Output_announce,$(2),$(true),PCH,1) + $(call gb_Trace_StartRange,$(2),PCH) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(call gb_PrecompiledHeader_get_dep_target,$(2),$(7))) && \ + unset INCLUDE && \ + $(call gb_CObject__compiler,$(4) $(5),$(3),$(8)) \ + $(call gb_Helper_remove_overridden_flags, \ + $(4) $(5) $(if $(WARNINGS_DISABLED),$(gb_CXXFLAGS_DISABLE_WARNINGS))) \ + -Fd$(PDBFILE) \ + $(if $(EXTERNAL_CODE),$(if $(COM_IS_CLANG),-Wno-undef),$(gb_DEFS_INTERNAL)) \ + $(gb_LTOFLAGS) \ + $(gb_COMPILERDEPFLAGS) \ + $(6) \ + -c $(3) \ + -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7)),$(1),$(3)) + $(call gb_Trace_EndRange,$(2),PCH) +endef + +# No ccache with MSVC, no need to create a checksum for it. +define gb_PrecompiledHeader__sum_command +endef + +# When building a PCH, MSVC also creates a .pdb file with debug info. So for reuse +# add the .pdb to the PCH's files and then use the .pdb also for linktargets that reuse the PCH. +# call gb_PrecompiledHeader__create_reuse_files,linktarget,pchtarget,linktargetmakefilename +define gb_PrecompiledHeader__create_reuse_files +rm -f $(call gb_PrecompiledHeader_get_target,$(2),$(3)).pdb; \ +if test -f $(call gb_LinkTarget_get_pdbfile_in,$(1)); then \ + cp $(call gb_LinkTarget_get_pdbfile_in,$(1)) $(call gb_PrecompiledHeader_get_target,$(2),$(3)).pdb; \ +fi +endef + +# call gb_PrecompiledHeader__copy_reuse_files,linktarget,pchtarget,linktargetmakefilename +define gb_PrecompiledHeader__copy_reuse_files +rm -f $(call gb_LinkTarget_get_pdbfile_in,$(1)); \ +if test -f $(call gb_PrecompiledHeader_get_target,$(2),$(3)).pdb; then \ + cp $(call gb_PrecompiledHeader_get_target,$(2),$(3)).pdb $(call gb_LinkTarget_get_pdbfile_in,$(1)); \ +fi +endef + +# AsmObject class +gb_AsmObject_get_source = $(1)/$(2).asm + +define gb_AsmObject__command +$(call gb_Output_announce,$(2),$(true),ASM,3) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) $(dir $(4)) && \ + "$(ML_EXE)" \ + $(if $(filter X86_64,$(CPUNAME)),, /safeseh) \ + /c /Cp $(gb_AFLAGS) -D$(COM) /Fo$(1) $(3)) && \ + echo "$(1) : $(3)" > $(4) +endef + + +# LinkTarget class + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_CXXCLRFLAGS := $(gb_CXXCLRFLAGS) + +gb_LinkTarget_INCLUDE :=\ + $(SOLARINC) \ + $(foreach inc,$(subst ;, ,$(JDKINC)),-I$(inc)) \ + -I$(BUILDDIR)/config_$(gb_Side) \ + +# We must name the .pdb like libname.pdb, not libname.\(dll\|exe\|pyd\).pdb, +# otherwise WinDbg does not find it. +define gb_LinkTarget__get_pdb_filename +$(patsubst %.dll,%.pdb,$(patsubst %.exe,%.pdb,$(patsubst %.bin,%.bin.pdb,$(patsubst %.pyd,%.pdb,$(1))))) +endef + +gb_LinkTarget_get_pdbfile_in = \ + $(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).objects.pdb + +gb_LinkTarget_get_pdbfile_out = \ + $(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1))) + +gb_LinkTarget_get_ilkfile = \ + $(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).ilk + +gb_LinkTarget_get_manifestfile = \ + $(WORKDIR)/LinkTarget/$(call gb_LinkTarget__get_workdir_linktargetname,$(1)).manifest + +gb_LinkTarget_get_linksearchpath_for_layer = \ + -LIBPATH:$(WORKDIR)/LinkTarget/StaticLibrary \ + -LIBPATH:$(INSTDIR)/$(SDKDIRNAME)/lib \ + $(if $(filter OXT,$(1)),\ + -LIBPATH:$(WORKDIR)/LinkTarget/ExtensionLibrary, \ + -LIBPATH:$(WORKDIR)/LinkTarget/Library) + +# avoid fatal error LNK1170 for Library_merged +define gb_LinkTarget_MergedResponseFile +cat $${RESPONSEFILE} | sed 's/ /\n/g' | grep -v '^$$' > $${RESPONSEFILE}.1 && \ +mv $${RESPONSEFILE}.1 $${RESPONSEFILE} && +endef + +MSC_SUBSYSTEM_VERSION=$(COMMA)6.01 + +# the sort on the libraries is used to filter out duplicates to keep commandline +# length in check - otherwise the dupes easily hit the limit when linking mergedlib +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(1) && \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100, \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(CXXCLROBJECTS),$(call gb_CxxClrObject_get_target,$(object))) \ + $(foreach object,$(GENCXXCLROBJECTS),$(call gb_GenCxxClrObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist))) \ + $(PCHOBJS) $(NATIVERES)) && \ + $(if $(filter $(call gb_Library__get_workdir_linktargetname,merged),$(2)),$(call gb_LinkTarget_MergedResponseFile)) \ + unset INCLUDE && \ + $(gb_LINK) \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(if $(filter StaticLibrary,$(TARGETTYPE)),-LIB) \ + $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ + $(if $(T_SYMBOLS),$(if $(filter Executable Library CppunitTest,$(TARGETTYPE)),$(gb_Windows_PE_TARGETTYPEFLAGS_DEBUGINFO)),) \ + $(if $(filter YES,$(TARGETGUI)), -SUBSYSTEM:WINDOWS$(MSC_SUBSYSTEM_VERSION), -SUBSYSTEM:CONSOLE$(MSC_SUBSYSTEM_VERSION)) \ + $(if $(filter YES,$(LIBRARY_X64)), -MACHINE:X64) \ + $(if $(filter YES,$(PE_X86)), -MACHINE:X86) \ + $(if $(filter YES,$(LIBRARY_X64)), \ + -LIBPATH:$(COMPATH)/lib/x64 \ + -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x64 \ + -LIBPATH:$(UCRTSDKDIR)lib/$(UCRTVERSION)/ucrt/x64 \ + $(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x64)) \ + $(if $(filter YES,$(PE_X86)), \ + -LIBPATH:$(COMPATH)/lib/x86 \ + -LIBPATH:$(WINDOWS_SDK_HOME)/lib/x86 \ + -LIBPATH:$(UCRTSDKDIR)lib/$(UCRTVERSION)/ucrt/x86 \ + $(if $(filter 80 81 10,$(WINDOWS_SDK_VERSION)),-LIBPATH:$(WINDOWS_SDK_HOME)/lib/$(WINDOWS_SDK_LIB_SUBDIR)/um/x86)) \ + $(T_LDFLAGS) \ + $(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),/NATVIS:$(SRCDIR)/solenv/vs/LibreOffice.natvis) \ + @$${RESPONSEFILE} \ + $(foreach lib,$(sort $(LINKED_LIBS)),$(call gb_Library_get_ilibfilename,$(lib))) \ + $(foreach lib,$(sort $(LINKED_STATIC_LIBS)),$(call gb_StaticLibrary_get_filename,$(lib))) \ + $(if $(filter-out StaticLibrary,$(TARGETTYPE)),\ + $(sort $(T_LIBS)) user32.lib \ + -manifestfile:$(WORKDIR)/LinkTarget/$(2).manifest \ + -pdb:$(call gb_LinkTarget__get_pdb_filename,$(WORKDIR)/LinkTarget/$(2))) \ + $(if $(ILIBTARGET),-out:$(1) -implib:$(ILIBTARGET),-out:$(1)) \ + | LC_ALL=C $(GBUILDDIR)/platform/filter-creatingLibrary.awk; RC=$${PIPESTATUS[0]}; rm $${RESPONSEFILE} \ + $(if $(filter Library,$(TARGETTYPE)),; if [ ! -f $(ILIBTARGET) ]; then rm -f $(1); exit 42; fi) \ + $(if $(filter Library,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;2 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest $(ILIBTARGET); fi) \ + $(if $(filter Executable,$(TARGETTYPE)),&& if [ -f $(WORKDIR)/LinkTarget/$(2).manifest ]; then mt.exe $(MTFLAGS) -nologo -manifest $(WORKDIR)/LinkTarget/$(2).manifest $(SRCDIR)/solenv/gbuild/platform/win_compatibility.manifest -outputresource:$(1)\;1 && touch -r $(1) $(WORKDIR)/LinkTarget/$(2).manifest; fi) \ + $(if $(filter Executable,$(TARGETTYPE)),&& mt.exe $(MTFLAGS) -nologo -manifest $(SRCDIR)/solenv/gbuild/platform/DeclareDPIAware.manifest -updateresource:$(1)\;1 ) \ + $(if $(filter Library,$(TARGETTYPE)),&& \ + echo $(notdir $(1)) > $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(gb_LINK) \ + -dump -exports $(ILIBTARGET) \ + >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp,$(WORKDIR)/LinkTarget/$(2).exports,$(1))) \ + ; \ + $(call gb_Trace_EndRange,$(2),LNK) $(if $(gb_TRACE),;) \ + exit $$RC) +endef + +define gb_MSVCRT_subst +$(if $(MSVC_USE_DEBUG_RUNTIME),$(subst msvcrt,msvcrtd,$(subst msvcprt,msvcprtd,$(subst libcmt,libcmtd,$(subst libvcruntime,libvcruntimed,$(subst libucrt,libucrtd,$(subst libcpmt,libcpmtd,$(subst msvcmrt,msvcmrtd,$(1)))))))),$(1)) +endef + +define gb_LinkTarget_use_system_win32_libs +$(call gb_LinkTarget_add_libs,$(1),$(foreach lib,$(2),$(call gb_MSVCRT_subst,$(lib)).lib)) +$(if $(call gb_LinkTarget__is_merged,$(1)),\ + $(call gb_LinkTarget_add_libs,$(call gb_Library_get_linktarget,merged),$(foreach lib,$(2),$(call gb_MSVCRT_subst,$(lib)).lib))) +endef + +# Flags common for PE executables (EXEs and DLLs). +# Enable incremental only when debugging to speed up relinking. +gb_Windows_PE_TARGETTYPEFLAGS := \ + -release \ + -opt:noref \ + $(if $(filter 0,$(gb_DEBUGLEVEL)), -incremental:no) \ + $(if $(filter NO,$(LIBRARY_X64)), -safeseh) \ + -nxcompat \ + -dynamicbase \ + -manifest + +# link.exe in -LIB mode doesn't understand -debug, use it only for EXEs and DLLs +gb_Windows_PE_TARGETTYPEFLAGS_DEBUGINFO := -debug + +ifeq ($(ENABLE_LTO),TRUE) +gb_Windows_PE_TARGETTYPEFLAGS += -LTCG +endif + +# Library class + + +gb_Library_DEFS := -D_DLL +gb_Library_TARGETTYPEFLAGS := \ + -DLL \ + $(gb_Windows_PE_TARGETTYPEFLAGS) + +gb_Library_get_rpath := + +gb_Library_SYSPRE := i +gb_Library_PLAINEXT := .lib + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):SHLXTHDL) \ + +gb_Library_ILIBFILENAMES :=\ + $(foreach lib,$(gb_Library_KNOWNLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + +gb_Library_DLLEXT := .dll +gb_Library_UDK_MAJORVER := 3 +gb_Library_RTEXT := MSC$(gb_Library_DLLEXT) +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_DLLEXT) +gb_Library_UNOEXT := .uno$(gb_Library_DLLEXT) +gb_Library_UNOVEREXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_DLLEXT) +gb_Library_RTVEREXT := $(gb_Library_UDK_MAJORVER)$(gb_Library_RTEXT) + +gb_Library_FILENAMES :=\ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_SHLXTHDL),$(lib):$(lib)$(gb_Library_DLLEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(lib)$(gb_Library_RTVEREXT)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(lib)$(gb_Library_UNOVEREXT)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + +# An assembly is a special kind of library for CLI +define gb_Library_Assembly +$(call gb_Library_Library,$(1)) +$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) : NATIVERES := + +endef + +define gb_Library_Library_platform +$(call gb_LinkTarget_set_ilibtarget,$(2),$(3)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.lib,%.exp,$(3)) \ + $(call gb_LinkTarget_get_manifestfile,$(2)) \ + $(call gb_LinkTarget_get_pdbfile_in,$(2)) \ + $(call gb_LinkTarget_get_pdbfile_out,$(2)) \ + $(call gb_LinkTarget_get_ilkfile,$(2)) \ +) + +$(call gb_Library_add_default_nativeres,$(1),$(1)/default) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile_in,$(2)) + +endef + +define gb_Library_add_default_nativeres +$(call gb_WinResTarget_WinResTarget_init,$(2)) +$(call gb_WinResTarget_set_rcfile,$(2),include/default) +$(call gb_WinResTarget_add_defs,$(2),\ + -DVERVARIANT="$(LIBO_VERSION_PATCH)" \ + -DRES_APP_VENDOR="$(OOO_VENDOR)" \ + -DORG_NAME="$(call gb_Library_get_filename,$(1))"\ + -DINTERNAL_NAME="$(subst $(gb_Library_DLLEXT),,$(call gb_Library_get_filename,$(1)))" \ + -DADDITIONAL_VERINFO1="" \ + -DADDITIONAL_VERINFO2="" \ + -DADDITIONAL_VERINFO3="" \ +) +$(call gb_Library_add_nativeres,$(1),$(2)) +$(call gb_Library_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(2)) + +endef + +define gb_Executable_add_default_nativeres +$(call gb_WinResTarget_WinResTarget_init,$(1)/default) +$(call gb_WinResTarget_set_rcfile,$(1)/default,include/default) +$(call gb_WinResTarget_add_defs,$(1)/default,\ + -DVERVARIANT="$(LIBO_VERSION_PATCH)" \ + -DRES_APP_VENDOR="$(OOO_VENDOR)" \ + -DORG_NAME="$(call gb_Executable_get_filename,$(1))"\ + -DINTERNAL_NAME="$(subst $(gb_Executable_EXT),,$(call gb_Executable_get_filename,$(1)))" \ + -DADDITIONAL_VERINFO1="$(if $(2),VALUE \"FileDescription\"$(COMMA) \"$(2)\\0\")" \ + -DADDITIONAL_VERINFO2="" \ + -DADDITIONAL_VERINFO3="" \ +) +$(call gb_Executable_add_nativeres,$(1),$(1)/default) +$(call gb_Executable_get_clean_target,$(1)) : $(call gb_WinResTarget_get_clean_target,$(1)/default) + +endef + +define gb_LinkTarget_add_nativeres +$(call gb_LinkTarget_get_target,$(1)) : $(call gb_WinResTarget_get_target,$(2)) +$(call gb_LinkTarget_get_target,$(1)) : NATIVERES += $(call gb_WinResTarget_get_target,$(2)) + +endef + +define gb_LinkTarget_set_nativeres +$(call gb_LinkTarget_get_target,$(1)) : $(call gb_WinResTarget_get_target,$(2)) +$(call gb_LinkTarget_get_target,$(1)) : NATIVERES := $(call gb_WinResTarget_get_target,$(2)) + +endef + +define gb_Library_get_ilibfilename +$(patsubst $(1):%,%,$(filter $(1):%,$(gb_Library_ILIBFILENAMES))) +endef + +gb_Library_get_sdk_link_dir = $(INSTDIR)/$(SDKDIRNAME)/lib + +gb_Library_get_sdk_link_lib = $(gb_Library_get_ilib_target) + +# StaticLibrary class + +gb_StaticLibrary_get_filename = $(1).lib +gb_StaticLibrary_PLAINEXT := .lib + +define gb_StaticLibrary_StaticLibrary_platform +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile_in,$(2)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(call gb_LinkTarget_get_pdbfile_in,$(2)) \ +) + +endef + +# Executable class + +gb_Executable_EXT := .exe +gb_Executable_EXT_for_build := .exe +gb_Executable_TARGETTYPEFLAGS := $(gb_Windows_PE_TARGETTYPEFLAGS) + +gb_Executable_get_rpath := + +# surprisingly some executables have exports so link.exe creates import lib +define gb_Executable_Executable_platform +$(call gb_LinkTarget_set_ilibtarget,$(2),$(3)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.lib,%.exp,$(3)) \ + $(call gb_LinkTarget_get_pdbfile_out,$(2)) \ + $(call gb_LinkTarget_get_pdbfile_in,$(2)) \ + $(call gb_LinkTarget_get_manifestfile,$(2)) \ +) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE := $(call gb_LinkTarget_get_pdbfile_in,$(2)) + +endef + +# CppunitTest class + +gb_CppunitTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-WNT.sh +gb_CppunitTest_PYTHONDEPS := $(call gb_Package_get_target,python3) +gb_CppunitTest_DEFS := -D_DLL +ifeq ($(GNUMAKE_WIN_NATIVE),TRUE) +gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell cygpath -w $(gb_Library_DLLDIR));$(shell cygpath -w $(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll))) +else +gb_CppunitTest_CPPTESTPRECOMMAND := $(call gb_Helper_prepend_ld_path,$(shell cygpath -u $(gb_Library_DLLDIR)):$(shell cygpath -u $(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/$(if $(MSVC_USE_DEBUG_RUNTIME),DebugDll,ReleaseDll))) +endif +gb_CppunitTest_get_filename = test_$(1).dll +gb_CppunitTest_get_ilibfilename = itest_$(1).lib + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_set_ilibtarget,$(2),$(3)) + +$(call gb_LinkTarget_add_auxtargets,$(2),\ + $(patsubst %.lib,%.exp,$(3)) \ + $(3) \ + $(call gb_LinkTarget_get_manifestfile,$(2)) \ + $(call gb_LinkTarget_get_pdbfile_out,$(2)) \ + $(call gb_LinkTarget_get_pdbfile_in,$(2)) \ + $(call gb_LinkTarget_get_ilkfile,$(2)) \ +) + +$(call gb_LinkTarget_get_target,$(2)) \ +$(call gb_LinkTarget_get_headers_target,$(2)) : PDBFILE = $(call gb_LinkTarget_get_pdbfile_in,$(2)) + +endef + +# JunitTest class + +ifneq ($(OOO_TEST_SOFFICE),) +gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE) +else +ifneq ($(gb_JunitTest_DEBUGRUN),) +gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) +else +gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice +endif +endif + + +define gb_JunitTest_JunitTest_platform +$(call gb_JunitTest_get_target,$(1)) : DEFS := \ + -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ + -Dorg.openoffice.test.arg.env=PATH="$$$$PATH" \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) + -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ + +endef + + +define gb_Module_DEBUGRUNCOMMAND +printf "\nAttach the debugger to soffice.bin\n\n" +OFFICESCRIPT=`mktemp` && \ +printf "$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.exe" > $${OFFICESCRIPT} && \ +printf " --norestore --nologo '--accept=pipe,name=$(USER);urp;'\n" >> $${OFFICESCRIPT} && \ +$(SHELL) $${OFFICESCRIPT} && \ +rm $${OFFICESCRIPT} +endef + + + + +# PythonTest class + +gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) +gb_PythonTest_DEPS = $(call gb_Package_get_target,python3) $(call gb_Executable_get_target,python) + +ifeq ($(strip $(CPPUNITTRACE)),TRUE) +gb_CppunitTest_GDBTRACE := '$(DEVENV)' /debugexe +endif + +# WinResTarget class + +gb_WinResTarget_POSTFIX :=.res + +define gb_WinResTarget__command +$(call gb_Output_announce,$(2),$(true),RC ,1) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + $(gb_RC) \ + $(DEFS) $(FLAGS) \ + $(INCLUDE) \ + -Fo$(1) \ + $(RCFILE) ) +endef + +$(eval $(call gb_Helper_make_dep_targets,\ + WinResTarget \ +)) + +ifeq ($(gb_FULLDEPS),$(true)) +# FIXME this is used before TargetLocations is read? +gb_WinResTarget__command_target = $(WORKDIR)/LinkTarget/Executable/makedepend.exe +define gb_WinResTarget__command_dep +$(call gb_Output_announce,RC:$(2),$(true),DEP,1) + $(call gb_Trace_StartRange,RC:$(2),DEP) +$(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + $(call gb_Executable_get_target,makedepend) \ + $(INCLUDE) \ + $(DEFS) \ + $(RCFILE) \ + -o .res \ + -p $(dir $(3)) \ + -f $(1)) + $(call gb_Trace_EndRange,RC:$(2),DEP) +endef +else +gb_WinResTarget__command_target = +gb_WinResTarget__command_dep = +endif + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=MSC \ +) + +endef + +# ExternalProject class + +# Use the gcc wrappers for an autoconf based project +# +# gb_ExternalProject_register_targets project state_target +define gb_ExternalProject_use_autoconf +$(call gb_ExternalProject_get_preparation_target,$(1)) : $(call gb_Executable_get_runtime_dependencies,gcc-wrapper) \ + $(call gb_Executable_get_runtime_dependencies,g++-wrapper) +$(call gb_ExternalProject_get_state_target,$(1),$(2)): WRAPPERS := $(gb_AUTOCONF_WRAPPERS) +endef + +# Set INCLUDE and LIB variables and unset MAKE/MAKEFLAGS when using nmake +# +# gb_ExternalProject_use_nmake project state_target +define gb_ExternalProject_use_nmake +$(call gb_ExternalProject_get_state_target,$(1),$(2)): NMAKE := $(gb_NMAKE_VARS) +endef + +# if ccache is enabled, then split it and use lastword as REAL_FOO +# /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe + +gb_AUTOCONF_WRAPPERS = \ + REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \ + REAL_CC_FLAGS="$(filter -%,$(CC))" \ + CC="$(call gb_Executable_get_target,gcc-wrapper)" \ + REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \ + REAL_CXX_FLAGS="$(filter -%,$(CXX))" \ + CXX="$(call gb_Executable_get_target,g++-wrapper)" \ + LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo" + +gb_ExternalProject_INCLUDE := \ + $(subst -I,,$(subst $(WHITESPACE),;,$(SOLARINC))) + +gb_NMAKE_VARS = \ + CC="$(shell cygpath -w $(filter-out -%,$(CC))) $(filter -%,$(CC))" \ + INCLUDE="$(gb_ExternalProject_INCLUDE)" \ + LIB="$(ILIB)" \ + MAKEFLAGS= \ + MAKE= + +# InstallScript class + +gb_InstallScript_EXT := .inf + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := $(gb_Library_DLLEXT) +gb_CliAssemblyTarget_get_dll = $(call gb_Library__get_dir_for_layer,NONE)/$(1)$(gb_CliAssemblyTarget_POLICYEXT) + +# Extension class + +gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/license.txt + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION)) + +# UnoApiHeadersTarget class + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# UIConfig class + +# use responsefile because cui has too many files for command line +define gb_UIConfig__command +$(call gb_Helper_abbreviate_dirs,\ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(if $(UI_IMAGELISTS),$(strip $(UI_IMAGELISTS)),/dev/null)) \ + && tr " " "\000" < $$RESPONSEFILE | tr -d "\r\n" > $$RESPONSEFILE.0 \ + && $(SORT) -u --files0-from=$$RESPONSEFILE.0 > $@ \ + && rm $$RESPONSEFILE $$RESPONSEFILE.0 \ +) + +endef + +# use file list file because swriter has too many files for command line +define gb_UIConfig__gla11y_command +$(call gb_ExternalExecutale__check_registration,python) +$(call gb_Helper_abbreviate_dirs,\ + FILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(UIFILES)) && \ + $(gb_UIConfig_LXML_PATH) $(if $(SYSTEM_LIBXML)$(SYSTEM_LIBXSLT),,$(gb_Helper_set_ld_path)) \ + $(call gb_ExternalExecutable_get_command,python) \ + $(gb_UIConfig_gla11y_SCRIPT) $(gb_UIConfig_gla11y_PARAMETERS) -o $@ -L $$FILES +) + +endef + +# UIMenubarTarget class + +define gb_UIMenubarTarget__command +$(call gb_Output_announce,$(2),$(true),UIM,1) +$(call gb_Trace_StartRange,$(2),UIM) +cp $(3) $(1) +$(call gb_Trace_EndRange,$(2),UIM) + +endef + +gb_UIMenubarTarget_UIMenubarTarget_platform := + +# Python +gb_Python_PRECOMMAND := PATH="$(shell cygpath -w $(INSTDIR)/program)" PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib;$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program" +gb_Python_INSTALLED_EXECUTABLE := $(INSTROOT)/$(LIBO_BIN_FOLDER)/python.exe + +gb_ICU_PRECOMMAND := PATH="$(shell cygpath -w $(WORKDIR_FOR_BUILD)/UnpackedTarball/icu/source/lib)" + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk new file mode 100644 index 000000000..7409cffa1 --- /dev/null +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -0,0 +1,373 @@ +# -*- 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/. +# +# 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 . +# + +# set tmpdir to some mixed case path, suitable for native tools +gb_TMPDIR:=$(if $(TMPDIR),$(shell cygpath -m $(TMPDIR)),$(shell cygpath -m /tmp)) + +# please make generic Windows modifications to windows.mk +include $(GBUILDDIR)/platform/windows.mk + +gb_CC := cl +gb_CXX := cl +gb_LINK := link +gb_AWK := awk +gb_CLASSPATHSEP := ; +gb_RC := rc + +# use CC/CXX if they are nondefaults +ifneq ($(origin CC),default) +gb_CC := $(CC) +gb_GCCP := $(CC) +endif +ifneq ($(origin CXX),default) +gb_CXX := $(CXX) +endif + +# _SCL_SECURE_NO_WARNINGS avoids deprecation warnings for STL algorithms +# like std::copy, std::transform (when MSVC_USE_DEBUG_RUNTIME is enabled) + +gb_COMPILERDEFS := \ + -DBOOST_ERROR_CODE_HEADER_ONLY \ + -DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE \ + -DBOOST_SYSTEM_NO_DEPRECATED \ + -D_HAS_AUTO_PTR_ETC \ + -D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING \ + -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING \ + -D_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING \ + -D_CRT_NON_CONFORMING_SWPRINTFS \ + -D_CRT_NONSTDC_NO_DEPRECATE \ + -D_CRT_SECURE_NO_DEPRECATE \ + -D_SCL_SECURE_NO_WARNINGS \ + -D_MT \ + -D_DLL \ + -DCPPU_ENV=$(gb_CPPU_ENV) \ + +ifeq ($(CPUNAME),INTEL) +gb_COMPILERDEFS += \ + -DBOOST_MEM_FN_ENABLE_CDECL \ + +endif + +gb_RCDEFS := \ + $(gb_WIN_VERSION_DEFS) \ + +gb_RCFLAGS := + +gb_AFLAGS := $(AFLAGS) + +# Do we really need to disable this many warnings? It seems to me that +# many of these warnings are for constructs that we have been actively +# cleaning away from the code, to avoid warnings when building with +# gcc or Clang and -Wall -Werror. + +# C4091: 'typedef ': ignored on left of '' when no variable is declared + +# C4100: 'identifier' : unreferenced formal parameter + +# C4127: conditional expression is constant + +# C4189: 'identifier' : local variable is initialized but not referenced + +# C4200: nonstandard extension used : zero-sized array in struct/union + +# C4201: nonstandard extension used : nameless struct/union + +# C4244: nonstandard extension used : formal parameter 'identifier' +# was previously defined as a type + +# C4250: 'class1' : inherits 'class2::member' via dominance + +# C4251: 'identifier' : class 'type' needs to have dll-interface to be +# used by clients of class 'type2' + +# C4267: conversion from 'size_t' to 'type', possible loss of data + +# C4275: non-DLL-interface classkey 'identifier' used as base for +# DLL-interface classkey 'identifier' + +# C4290: C++ exception specification ignored except to indicate a +# function is not __declspec(nothrow) + +# C4351: new behavior: elements of array 'array' will be default +# initialized +# (an issue with MSVC 2013 that appears to be gone with MSVC 2015) + +# C4373: '%$S': virtual function overrides '%$pS', previous versions +# of the compiler did not override when parameters only differed by +# const/volatile qualifiers. +# [translation: ancient compilers that don't actually support C++ do +# stupid things] + +# C4505: 'function' : unreferenced local function has been removed + +# C4510: 'class' : default constructor could not be generated + +# C4512: 'class' : assignment operator could not be generated +# (an issue with MSVC 2013 that appears to be gone with MSVC 2015) + +# C4610: 'class' can never be instantiated - user defined constructor required + +# C4611: interaction between 'function' and C++ object destruction is +# non-portable + +# C4702: unreachable code + +# C4706: assignment within conditional expression + +# C4800: 'type' : forcing value to bool 'true' or 'false' (performance +# warning) + +gb_CFLAGS := \ + -utf-8 \ + -Gd \ + -GR \ + -Gs \ + -GS \ + $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ + -nologo \ + -W4 \ + -wd4091 \ + $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \ + -wd4127 \ + $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \ + -wd4200 \ + -wd4244 \ + -wd4251 \ + -wd4505 \ + -wd4512 \ + -wd4706 \ + -wd4800 \ + -wd4267 \ + +gb_CXXFLAGS_DISABLE_WARNINGS = -w + +ifneq ($(COM_IS_CLANG),TRUE) + +# clang-cl doesn't support -Wv:18 for now +gb_CFLAGS += \ + -Wv:18 \ + +endif + +gb_CXXFLAGS := \ + -utf-8 \ + $(CXXFLAGS_CXX11) \ + -Gd \ + -GR \ + -Gs \ + -GS \ + -Gy \ + $(if $(MSVC_USE_DEBUG_RUNTIME),-MDd,-MD) \ + -nologo \ + -W4 \ + -wd4091 \ + $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4100) \ + -wd4127 \ + $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4189) \ + -wd4201 \ + -wd4244 \ + -wd4250 \ + -wd4251 \ + -wd4267 \ + -wd4275 \ + -wd4290 \ + -wd4351 \ + -wd4373 \ + -wd4505 \ + -wd4510 \ + -wd4512 \ + -wd4610 \ + -wd4611 \ + -wd4706 \ + -wd4800 \ + +ifeq ($(CPUNAME),INTEL) + +gb_CXXFLAGS += \ + -Zm500 \ + +gb_CFLAGS += \ + -Zm500 \ + +endif + +ifneq ($(COM_IS_CLANG),TRUE) + +# clang-cl doesn't support -Wv:18 for now +# Work around MSVC 2017 C4702 compiler bug with release builds +# http://document-foundation-mail-archive.969070.n3.nabble.com/Windows-32-bit-build-failure-unreachable-code-tp4243848.html +# http://document-foundation-mail-archive.969070.n3.nabble.com/64-bit-Windows-build-failure-after-MSVC-Update-tp4246816.html +gb_CXXFLAGS += \ + -Wv:18 \ + $(if $(filter 0,$(gb_DEBUGLEVEL)),-wd4702) \ + +endif + +# rc.exe does not support -nologo in 6.1.6723.1 that is in the Windows SDK 6.0A +gb_RCFLAGS += -nologo + +# C4005: 'identifier' : macro redefinition + +gb_PCHWARNINGS = \ + -we4650 \ + -we4651 \ + -we4652 \ + -we4653 \ + -we4005 \ + +gb_STDLIBS := \ + advapi32.lib \ + +gb_CFLAGS_WERROR = $(if $(ENABLE_WERROR),-WX) + +# there does not seem to be a way to force C++03 with MSVC +gb_CXX03FLAGS := + +gb_LinkTarget_EXCEPTIONFLAGS := \ + -DEXCEPTIONS_ON \ + -EHs \ + +gb_PrecompiledHeader_EXCEPTIONFLAGS := $(gb_LinkTarget_EXCEPTIONFLAGS) + +gb_LinkTarget_LDFLAGS := \ + $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-nologo,) \ + $(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \ + +# Prevent warning spamming +# Happens because of the way we link our unit tests with our libraries. +# LNK4049: locally defined symbol +gb_LinkTarget_LDFLAGS += \ + /ignore:4217 /ignore:4049 + + +gb_DEBUGINFO_FLAGS := \ + -FS \ + -Zi \ + +# See gb_Windows_PE_TARGETTYPEFLAGS_DEBUGINFO +gb_LINKER_DEBUGINFO_FLAGS := + +gb_COMPILEROPTFLAGS := -O2 -Oy- +gb_COMPILERNOOPTFLAGS := -Od +gb_COMPILERDEBUGOPTFLAGS := + +ifeq ($(gb_FULLDEPS),$(true)) +gb_COMPILERDEPFLAGS := -showIncludes +define gb_create_deps +| LC_ALL=C $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]} +endef +else +gb_COMPILERDEPFLAGS := +define gb_create_deps +| LC_ALL=C $(GBUILDDIR)/platform/filter-sourceName.awk; exit $${PIPESTATUS[0]} +endef +endif + +gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL) + +# When compiling for CLR, disable "warning C4339: use of undefined type detected +# in CLR meta-data - use of this type may lead to a runtime exception": +gb_CXXCLRFLAGS := \ + $(if $(COM_IS_CLANG), \ + $(patsubst -std=%,-std:c++17 -Zc:__cplusplus,$(gb_CXXFLAGS)), \ + $(gb_CXXFLAGS)) \ + $(gb_LinkTarget_EXCEPTIONFLAGS) \ + -AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \ + -EHa \ + -clr \ + -wd4339 \ + -Wv:18 \ + -wd4267 \ + +ifeq ($(COM_IS_CLANG),TRUE) + +gb_CFLAGS += \ + -Wdeclaration-after-statement \ + -Wendif-labels \ + -Wshadow \ + -Wstrict-prototypes \ + -Wundef \ + -Wunused-macros \ + +gb_CXXFLAGS += \ + -Wendif-labels \ + -Wimplicit-fallthrough \ + -Wno-missing-braces \ + -Wnon-virtual-dtor \ + -Woverloaded-virtual \ + -Wshadow \ + -Wundef \ + -Wunused-macros \ + +endif + +ifeq ($(COM_IS_CLANG),TRUE) +gb_COMPILER_TEST_FLAGS := -Xclang -plugin-arg-loplugin -Xclang --unit-test-mode +ifeq ($(COMPILER_PLUGIN_TOOL),) +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/clang/plugin.dll -Xclang -add-plugin -Xclang loplugin +ifneq ($(COMPILER_PLUGIN_WARNINGS_ONLY),) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang \ + --warnings-only='$(COMPILER_PLUGIN_WARNINGS_ONLY)' +endif +else +gb_COMPILER_PLUGINS := -Xclang -load -Xclang $(BUILDDIR)/compilerplugins/clang/plugin.dll -Xclang -plugin -Xclang loplugin $(foreach plugin,$(COMPILER_PLUGIN_TOOL), -Xclang -plugin-arg-loplugin -Xclang $(plugin)) +ifneq ($(UPDATE_FILES),) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --scope=$(UPDATE_FILES) +endif +endif +ifeq ($(COMPILER_PLUGINS_DEBUG),TRUE) +gb_COMPILER_PLUGINS += -Xclang -plugin-arg-loplugin -Xclang --debug +endif +gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \ + -Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors +else +gb_COMPILER_TEST_FLAGS := +gb_COMPILER_PLUGINS := +gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := +endif + +# Helper class + +ifeq ($(GNUMAKE_WIN_NATIVE),TRUE) +gb_Helper_set_ld_path := PATH="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$$PATH" + +define gb_Helper_prepend_ld_path +PATH="$(shell cygpath -w $(INSTDIR)/$(LIBO_URE_LIB_FOLDER));$(shell cygpath -w $(INSTDIR)/$(LIBO_BIN_FOLDER));$(1);$$PATH" +endef + +# $(1): one directory pathname to append to the ld path +define gb_Helper_extend_ld_path +$(gb_Helper_set_ld_path)';$(shell cygpath -w $(1))' +endef + +else +gb_Helper_set_ld_path := PATH="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$$PATH" + +define gb_Helper_prepend_ld_path +PATH="$(shell cygpath -u $(INSTDIR)/$(LIBO_URE_LIB_FOLDER)):$(shell cygpath -u $(INSTDIR)/$(LIBO_BIN_FOLDER)):$(1):$$PATH" +endef + +# $(1): one directory pathname to append to the ld path +define gb_Helper_extend_ld_path +$(gb_Helper_set_ld_path):$(shell cygpath -u $(1)) +endef + +endif + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/filter-creatingLibrary.awk b/solenv/gbuild/platform/filter-creatingLibrary.awk new file mode 100755 index 000000000..5b3335ce8 --- /dev/null +++ b/solenv/gbuild/platform/filter-creatingLibrary.awk @@ -0,0 +1,34 @@ +#!/usr/bin/gawk -f +# -*- 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/. +# + +# Filter out the "Creating library" message printed by link.exe, +# as there is no way to disable it. + +BEGIN { + creatinglibrary_prefix = ENVIRON["CREATINGLIBRARY_PREFIX"]; + if (!creatinglibrary_prefix) { + creatinglibrary_prefix = "\\.lib.*\\.exp" + } + firstline = 1 +} + +{ + if (firstline && match($0, creatinglibrary_prefix)) { + # ignore + } else { + # because MSVC stupidly prints errors on stdout, it's + # necessary to forward everything that isn't matched by the pattern + # so users get to see them. + print $0 > "/dev/stderr" + } + firstline = 0 +} + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/filter-showIncludes.awk b/solenv/gbuild/platform/filter-showIncludes.awk new file mode 100755 index 000000000..b8a1db052 --- /dev/null +++ b/solenv/gbuild/platform/filter-showIncludes.awk @@ -0,0 +1,99 @@ +#!/usr/bin/gawk -f +# -*- 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/. +# + +# Create dependency information from the output of cl.exe's showInclude. It +# needs additional information - the output name to which to write, objfile +# that depends on the includes, and the original file name. +# For best results all arguments should be absolute paths. +# +# It also consolidates the file names to a canonical form, and filters out +# duplicates. +# +# based on filter-showInclude.pl by Jan Holesovsky <kendy@suse.cz> + +BEGIN { + if (!depfile || !objectfile || !sourcefile) { + print "usage: filter-showIncludes.awk -vdepfile=depfile.d " \ + "-vobjectfile=objfile.o -vsourcefile=source.cxx" > "/dev/stderr" + exit 1 + } + tempfile = depfile ".tmp" + print objectfile " : \\\n " sourcefile " \\" > tempfile + + showincludes_prefix = ENVIRON["SHOWINCLUDES_PREFIX"]; + if (!showincludes_prefix) { + showincludes_prefix = "Note: including file:" + } + + # to match especially drive letters in whitelist case insensitive + IGNORECASE = 1 + whitelist = \ + "^(" ENVIRON["SRCDIR"] "|" ENVIRON["WORKDIR"] ")" + firstline = 1 +} + +{ + sub(/\r$/, "") + sub(/^ */, "") + if (index($0, showincludes_prefix) == 1) { + $0 = substr($0, length(showincludes_prefix) + 1) + sub(/^ */, "") + + # The output from MSVC may contain a carriage return character at the + # end of filenames, in which case the translation unit will depend on a + # non-existing header, resulting in constant rebuild of all files, + # prevent that. + sub(/
/, "") + + gsub(/\\/, "/") + gsub(/ /, "\\ ") + if ($0 ~ whitelist) { # filter out system headers + if (!($0 in incfiles)) { + incfiles[$0] + print " " $0 " \\" > tempfile + } + } + } else { + # because MSVC stupidly prints errors on stdout, it's + # necessary to forward everything that isn't matched by the pattern + # so users get to see them. + if (firstline) { # ignore the line that just prints name of sourcefile + firstline = 0 + } else { + print $0 > "/dev/stderr" + } + } +} + +END { + if (!tempfile) { + exit 1 + } + print "" > tempfile + + # fdo#40099 if header.h does not exist, it will simply be considered out of + # date and any targets that use it as a prerequisite will be updated, + # which avoid misery when the header is deliberately deleted and removed + # as an include + # see http://www.makelinux.net/make3/make3-CHP-8-SECT-3 + for (file in incfiles) { + print file " :\n" > tempfile + } + + close(tempfile) + movecmd = "mv " tempfile " " depfile + ret = system(movecmd) + if (ret) { + print "ERROR: " movecmd " FAILED with status " ret > "/dev/stderr" + exit ret + } +} + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/filter-sourceName.awk b/solenv/gbuild/platform/filter-sourceName.awk new file mode 100755 index 000000000..d55e2707d --- /dev/null +++ b/solenv/gbuild/platform/filter-sourceName.awk @@ -0,0 +1,32 @@ +#!/usr/bin/gawk -f +# -*- 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/. +# + +# Filter out the "sourcefile.cxx" message printed by cl.exe, +# as there is no way to disable it. This file is used +# in place of filter-showIncludes.awk (which does the same) +# when --disable-dependency-tracking is used. + +BEGIN { + firstline = 1 +} + +{ + if (firstline) { + # ignore + } else { + # because MSVC stupidly prints errors on stdout, it's + # necessary to forward everything that isn't matched by the pattern + # so users get to see them. + print $0 > "/dev/stderr" + } + firstline = 0 +} + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/iOS.mk b/solenv/gbuild/platform/iOS.mk new file mode 100644 index 000000000..dc7d2a8c2 --- /dev/null +++ b/solenv/gbuild/platform/iOS.mk @@ -0,0 +1,266 @@ +# -*- 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/. +# +# 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 . +# + +ifeq ($(CC),) +$(error You must set CC in the environment. See README.cross for example.) +endif +ifeq ($(CXX),) +$(error You must set CXX in the environment. See README.cross for example.) +endif + +gb_COMPILEROPTFLAGS := -Oz + +include $(GBUILDDIR)/platform/com_GCC_defs.mk + +# Use standard lldb debugger +gb_DEBUGINFO_FLAGS=-g +gb_LINKER_DEBUGINFO_FLAGS= + +# Darwin mktemp -t expects a prefix, not a pattern +gb_MKTEMP := /usr/bin/mktemp -t gbuild. + +gb_OSDEFS := \ + -DIOS \ + -D_PTHREADS \ + -DUNIX \ + -DUNX \ + -D_REENTRANT \ + -DNO_PTHREAD_PRIORITY \ + $(LFS_CFLAGS) \ + +gb_CFLAGS := \ + $(gb_CFLAGS_COMMON) \ + -Wshadow \ + -fno-strict-aliasing \ + +gb_CXXFLAGS := \ + $(gb_CXXFLAGS_COMMON) \ + -Wno-ctor-dtor-privacy \ + -fno-strict-aliasing \ + -fsigned-char \ + $(CXXFLAGS_CXX11) \ + +# These are to get the compiler to switch to Objective-C++ or Objective-C mode +gb_OBJCXXFLAGS := -x objective-c++ +gb_OBJCFLAGS := -x objective-c + +gb_COMPILERDEFS += \ + -DBOOST_DETAIL_NO_CONTAINER_FWD + +# LinkTarget class + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) + +define gb_LinkTarget__get_liblinkflags +$(patsubst lib%.a,-l%,$(foreach lib,$(1),$(call gb_Library_get_filename,$(lib)))) +endef + +define gb_LinkTarget__get_layer +$(if $(filter Executable,$(1)),\ + $$(call gb_Executable_get_layer,$(2)),\ + $$(call gb_Library_get_layer,$(2))) +endef + +# To not export anything: -Wl$(COMMA)-exported_symbols_list$(COMMA)/dev/null +# But for some reason that slows down ld significantly. + +define gb_LinkTarget__command_dynamiclink + $(if $(filter Library CppunitTest,$(TARGETTYPE)),@echo No dynamic libraries should be built for iOS && exit 1, \ + $(if $(CXXOBJECTS)$(OBJCXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ + $(gb_Executable_TARGETTYPEFLAGS) \ + $(subst \d,$$,$(RPATH)) \ + $(T_LDFLAGS) \ + -dead_strip \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \ + $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ + $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ + $(call gb_LinkTarget__get_liblinkflags,$(LINKED_LIBS)) \ + $(shell $(SRCDIR)/bin/lo-all-static-libs) \ + $(T_LIBS) \ + -o $(1)) +endef + +# parameters: 1-linktarget 2-cobjects 3-cxxobjects +define gb_LinkTarget__command_staticlink +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(1) && \ + $(gb_AR) -rsu $(1) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \ + $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ + $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) +endef + +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(if $(filter Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) +$(if $(filter CppunitTest Library StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) + $(call gb_Trace_EndRange,$(2),LNK) +endef + +define gb_LinkTarget_use_system_darwin_frameworks +$(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw))) +$(if $(call gb_LinkTarget__is_merged,$(1)),\ + $(call gb_LinkTarget_add_libs,$(call gb_Library_get_linktarget,merged),$(foreach fw,$(2),-framework $(fw)))) +endef + + +# Library class + +gb_Library_DEFS := +gb_Library_SYSPRE := lib +gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ +gb_Library_PLAINEXT := .a +gb_Library_DLLEXT := .a +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) + +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) +gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) + +gb_Library_FILENAMES := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):OOO) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +define gb_Library_Library_platform +$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1)) + +endef + +gb_Library__set_soversion_script_platform = + +gb_Library_get_sdk_link_dir = $(WORKDIR)/LinkTarget/Library + +# Executable class + +gb_Executable_EXT := +gb_Executable_TARGETTYPEFLAGS := + +gb_Executable_LAYER := \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \ + + +define gb_Executable_Executable_platform +$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1)) + +endef + + +# CppunitTest class + +gb_CppunitTest_CPPTESTPRECOMMAND := : +gb_CppunitTest_get_filename = libtest_(1).a +gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename) + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE + +endef + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=gcc3 \ + -D_gcc3 \ +) + +endef + +# InstallScript class + +gb_InstallScript_EXT := .ins + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := +gb_CliAssemblyTarget_get_dll := + +# Extension class + +gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION) + +# UnoApiHeadersTarget class + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# UIMenubarTarget class + +define gb_UIMenubarTarget__command +$(call gb_Output_announce,$(2),$(true),UIM,1) +$(call gb_Trace_StartRange,$(2),UIM) +cp $(3) $(1) +$(call gb_Trace_EndRange,$(2),UIM) + +endef + +gb_UIMenubarTarget_UIMenubarTarget_platform := + +# Python +gb_PYTHON_PRECOMMAND := + +include $(GBUILDDIR)/platform/com_GCC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/iOS_AARCH64_GCC.mk b/solenv/gbuild/platform/iOS_AARCH64_GCC.mk new file mode 100644 index 000000000..0d03fa027 --- /dev/null +++ b/solenv/gbuild/platform/iOS_AARCH64_GCC.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/. +# +# 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 . +# + +gb_CPUDEFS := -DARM64 + +include $(GBUILDDIR)/platform/iOS.mk diff --git a/solenv/gbuild/platform/iOS_X86_64_GCC.mk b/solenv/gbuild/platform/iOS_X86_64_GCC.mk new file mode 100644 index 000000000..008f54f2e --- /dev/null +++ b/solenv/gbuild/platform/iOS_X86_64_GCC.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/. +# +# 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 . +# + +gb_CPUDEFS := -DX86_64 + +include $(GBUILDDIR)/platform/iOS.mk diff --git a/solenv/gbuild/platform/linux.mk b/solenv/gbuild/platform/linux.mk new file mode 100644 index 000000000..ece7a88bd --- /dev/null +++ b/solenv/gbuild/platform/linux.mk @@ -0,0 +1,28 @@ +# -*- 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/. +# + +gb__LinkTarget_LDFLAGS_zdefs := -Wl,-z,defs +ifeq ($(COM_IS_CLANG),TRUE) +ifneq ($(filter -fsanitize=%,$(CC) $(LDFLAGS)),) +gb__LinkTarget_LDFLAGS_zdefs := +endif +endif +gb_LinkTarget_LDFLAGS += $(gb__LinkTarget_LDFLAGS_zdefs) + +include $(GBUILDDIR)/platform/unxgcc.mk + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_STDLIBS := -ldl +endif + +ifneq ($(ATOMIC_LIB),) +gb_STDLIBS_CXX := $(ATOMIC_LIB) +endif + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk new file mode 100644 index 000000000..c74351120 --- /dev/null +++ b/solenv/gbuild/platform/macosx.mk @@ -0,0 +1,376 @@ +# -*- 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/. +# +# 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 . +# + +gb_SDKDIR := $(MACOSX_SDK_PATH) + +include $(GBUILDDIR)/platform/com_GCC_defs.mk + +# Darwin mktemp -t expects a prefix, not a pattern +gb_MKTEMP ?= /usr/bin/mktemp -t gbuild + +gb_OSDEFS := \ + -D$(OS) \ + -D_PTHREADS \ + -DUNIX \ + -DUNX \ + -D_REENTRANT \ + -DNO_PTHREAD_PRIORITY \ + -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) \ + -DMAC_OS_X_VERSION_MAX_ALLOWED=$(MAC_OS_X_VERSION_MAX_ALLOWED) \ + $(LFS_CFLAGS) \ + + +gb_CFLAGS := \ + $(gb_CFLAGS_COMMON) \ + -fPIC \ + -fno-strict-aliasing \ + -Wshadow + +gb_CXXFLAGS := \ + $(gb_CXXFLAGS_COMMON) \ + -fPIC \ + -Woverloaded-virtual \ + -Wshadow \ + -Wno-ctor-dtor-privacy \ + -fno-strict-aliasing \ + -fsigned-char \ + $(CXXFLAGS_CXX11) + + #-fsigned-char \ might be removed? + +# these are to get g++ to switch to Objective-C++ mode +# (see toolkit module for a case where it is necessary to do it this way) +gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions + +gb_OBJCFLAGS := -x objective-c -fobjc-exceptions + +# LinkTarget class + +define gb_LinkTarget__get_rpath_for_layer +$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS))) +endef + +gb_LinkTarget__RPATHS := \ + URELIB:@__________________________________________________URELIB/ \ + UREBIN: \ + OOO:@__________________________________________________OOO/ \ + SDKBIN: \ + OXT: \ + NONE:@__________________________________________________NONE/ \ + +# $(call gb_LinkTarget__get_installname,libfilename,layerprefix) +define gb_LinkTarget__get_installname +$(if $(2),-install_name '$(2)$(1)') +endef + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) +gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) +gb_LinkTarget_OBJCFLAGS := $(gb_CFLAGS) $(gb_OBJCFLAGS) + +define gb_LinkTarget__get_layer +$(if $(filter Executable,$(1)),\ + $$(call gb_Executable_get_layer,$(2)),\ + $$(call gb_Library_get_layer,$(2))) +endef + +# We cannot sign executables early since Mojave/Catalina would treat them as +# restricted binary and ignore any DYLD_LIBRARY_PATH setting - So all +# signing is handled by the solenv/bin/macosx-codesign-app-bundle script. +# And the soffice executable needs to be signed last in +# macosx-codesign-app-bundle, as codesign would fail complaining that other +# parts of the app have not yet been signed: + +define gb_LinkTarget__command_dynamiclink +$(call gb_Helper_abbreviate_dirs,\ + FILELIST=$(call var2file,$(shell $(gb_MKTEMP)),100, \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \ + $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),$(shell cat $(extraobjectlist)))) && \ + cat $${FILELIST} | tr "[:space:]" "\n" | grep -v '^$$' > $${FILELIST}.1 && \ + mv $${FILELIST}.1 $${FILELIST} && \ + $(if $(CXXOBJECTS)$(OBJCXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ + $(if $(filter Executable,$(TARGETTYPE)),$(gb_Executable_TARGETTYPEFLAGS)) \ + $(if $(filter Bundle,$(TARGETTYPE)),$(gb_Bundle_TARGETTYPEFLAGS)) \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(subst \d,$$,$(RPATH)) \ + $(T_LDFLAGS) \ + $(patsubst lib%.dylib,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib))))) \ + -Wl$(COMMA)-filelist$(COMMA)$${FILELIST} \ + $(T_LIBS) \ + $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ + -o $(1) && \ + rm -f $${FILELIST} && \ + $(if $(SOVERSIONSCRIPT),ln -sf $(1) $(ILIBTARGET),:) && \ + $(if $(filter Executable,$(TARGETTYPE)), \ + $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl app $(LAYER) $(1) &&) \ + $(if $(filter Library Bundle CppunitTest,$(TARGETTYPE)),\ + $(PERL) $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl $(LAYER) $(1) &&) \ + $(if $(filter Library,$(TARGETTYPE)),\ + otool -l $(1) | grep -A 5 LC_ID_DYLIB \ + > $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(NM) -g -P $(1) | cut -d' ' -f1-2 | grep -v U$$ \ + >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \ + $(WORKDIR)/LinkTarget/$(2).exports,$(1)) &&) \ + :) +endef + +# parameters: 1-linktarget 2-cobjects 3-cxxobjects +define gb_LinkTarget__command_staticlink +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(1) && \ + $(gb_AR) -rsu $(1) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(OBJCOBJECTS),$(call gb_ObjCObject_get_target,$(object))) \ + $(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ + $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) +endef + +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(if $(filter Library Bundle CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) +$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) + $(call gb_Trace_EndRange,$(2),LNK) +endef + +define gb_LinkTarget_use_system_darwin_frameworks +$(call gb_LinkTarget_add_libs,$(1),$(foreach fw,$(2),-framework $(fw))) +$(if $(call gb_LinkTarget__is_merged,$(1)),\ + $(call gb_LinkTarget_add_libs,$(call gb_Library_get_linktarget,merged),$(foreach fw,$(2),-framework $(fw)))) +endef + + +# Library class + +gb_Library_DEFS := +gb_Library_TARGETTYPEFLAGS := -dynamiclib -single_module +gb_Bundle_TARGETTYPEFLAGS := -bundle +gb_Library_UDK_MAJORVER := 3 +gb_Library_SYSPRE := lib +gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ +gb_Library_PLAINEXT := .dylib +gb_Library_DLLEXT := .dylib +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) + +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) +gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) + +gb_Library_FILENAMES := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +define gb_Library_get_rpath +$(call gb_LinkTarget__get_installname,$(call gb_Library_get_filename,$(1)),$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))) +endef + +define gb_Library_Library_platform +$(call gb_LinkTarget_get_target,$(2)) : \ + RPATH := $(call gb_Library_get_rpath,$(1)) +$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Library_get_layer,$(1)) + +endef + +gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script) + +gb_Library_get_sdk_link_dir = $(WORKDIR)/LinkTarget/Library + +gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target) + +# bundle is a special kind of library that exists only on Darwin/OSX +# set the TARGETTYPE to Bundle, and clear install_name(RPATH) +define gb_Library_Bundle +$(call gb_Library_Library,$(1)) +$(call gb_LinkTarget_set_targettype,$(call gb_Library_get_linktarget,$(1)),Bundle) +$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(1))) : \ + RPATH := +endef + +# Executable class + +gb_Executable_EXT := +gb_Executable_TARGETTYPEFLAGS := -bind_at_load + +gb_Executable_LAYER := \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \ + + +gb_Executable_get_rpath := + +define gb_Executable_Executable_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := +$(call gb_LinkTarget_get_target,$(2)) : LAYER := $(call gb_Executable_get_layer,$(1)) + +endef + + +# CppunitTest class + +gb_CppunitTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-MACOSX.sh +gb_CppunitTest_PYTHONDEPS := $(call gb_Library_get_target,pyuno_wrapper) $(if $(SYSTEM_PYTHON),,$(call gb_GeneratedPackage_get_target,python3)) +gb_CppunitTest_CPPTESTPRECOMMAND := \ + $(call gb_Helper_extend_ld_path,$(gb_Library_DLLDIR):$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs) +gb_CppunitTest_get_filename = libtest_$(1).dylib +gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename) +gb_CppunitTest_malloc_check := MallocScribble=1 MallocPreScribble=1 + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := +$(call gb_LinkTarget_get_target,$(2)) : LAYER := NONE + +endef + +# JunitTest class + +ifneq ($(OOO_TEST_SOFFICE),) +gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE) +else +ifneq ($(gb_JunitTest_DEBUGRUN),) +gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) +else +gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice +endif +endif + +define gb_JunitTest_JunitTest_platform +$(call gb_JunitTest_get_target,$(1)) : DEFS := \ + -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ + -Dorg.openoffice.test.arg.env=DYLD_LIBRARY_PATH"$$$${DYLD_LIBRARY_PATH+=$$$$DYLD_LIBRARY_PATH}" \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ + -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ + +endef + +# PythonTest class + +gb_PythonTest_UNITTESTFAILED := $(GBUILDDIR)/platform/unittest-failed-MACOSX.sh +gb_PythonTest_DEPS := $(call gb_GeneratedPackage_get_target,python3) $(call gb_Package_get_target,python_shell) +gb_PythonTest_PRECOMMAND := $(gb_Helper_LIBRARY_PATH_VAR)=$${$(gb_Helper_LIBRARY_PATH_VAR):+$$$(gb_Helper_LIBRARY_PATH_VAR):}$(INSTROOT)/$(LIBO_URE_LIB_FOLDER) +ifneq ($(LIBO_LIB_FOLDER),$(LIBO_URE_LIB_FOLDER)) +gb_PythonTest_PRECOMMAND := $(gb_PythonTest_PRECOMMAND):$(INSTROOT)/$(LIBO_LIB_FOLDER) +endif +gb_PythonTest_PRECOMMAND := $(gb_PythonTest_PRECOMMAND):$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs + +# UITest class + +gb_UITest_DEPS := $(call gb_GeneratedPackage_get_target,python3) + +# Module class + +define gb_Module_DEBUGRUNCOMMAND +lldb -f $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice -- --norestore --nologo \ + '"--accept=pipe,name=$(USER)\;urp"' +endef + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=gcc3 \ + -D_gcc3 \ +) + +endef + +# InstallScript class + +gb_InstallScript_EXT := .ins + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := +gb_CliAssemblyTarget_get_dll := + +# Extension class + +gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/Resources/LICENSE + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION) + +# UnoApiHeadersTarget class + +ifneq ($(filter TRUE,$(DISABLE_DYNLOADING)),) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# UIMenubarTarget class + +define gb_UIMenubarTarget__command +$(call gb_Output_announce,$(2),$(true),UIM,1) +$(call gb_Trace_StartRange,$(2),UIM) +$(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $(1) $(UI_MENUBAR_XSLT) $(3) +$(call gb_Trace_EndRange,$(2),UIM) + +endef + +define gb_UIMenubarTarget_UIMenubarTarget_platform +$(call gb_UIMenubarTarget_get_target,$(1)) : UI_MENUBAR_XSLT := $(SRCDIR)/solenv/bin/macosx_menubar_modification.xsl +$(call gb_UIMenubarTarget_get_target,$(1)) : $(SRCDIR)/solenv/bin/macosx_menubar_modification.xsl +$(call gb_UIMenubarTarget_get_target,$(1)) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc) + +endef + +# Python +gb_Python_PRECOMMAND := PYTHONPATH="$$PYPATH" +gb_Python_INSTALLED_EXECUTABLE := $(INSTROOT)/$(LIBO_LIB_FOLDER)/LibreOfficePython.framework/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/Resources/Python.app/Contents/MacOS/LibreOfficePython +# this is passed to gdb as executable when running tests +gb_Python_INSTALLED_EXECUTABLE_GDB := $(gb_Python_INSTALLED_EXECUTABLE) + +include $(GBUILDDIR)/platform/com_GCC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk new file mode 100644 index 000000000..d1d068c8f --- /dev/null +++ b/solenv/gbuild/platform/solaris.mk @@ -0,0 +1,364 @@ +# -*- 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/. +# +# 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 . +# + +include $(GBUILDDIR)/platform/com_GCC_defs.mk + +gb_MKTEMP := mktemp -t gbuild.XXXXXX + +ifneq ($(origin AR),default) +gb_AR := $(AR) +endif + +# do not define SOLARIS - use #ifdef __sun instead +# -D$(OS) \ + +gb_OSDEFS := \ + -DSYSV \ + -DSUN \ + -DSUN4 \ + -D_REENTRANT \ + -D_POSIX_PTHREAD_SEMANTICS \ + -D_PTHREADS \ + -DUNIX \ + -DUNX \ + $(PTHREAD_CFLAGS) \ + $(LFS_CFLAGS) \ + +gb_CFLAGS := \ + $(gb_CFLAGS_COMMON) \ + -fPIC \ + -Wdeclaration-after-statement \ + -Wshadow \ + +gb_CXXFLAGS := \ + $(gb_CXXFLAGS_COMMON) \ + -fPIC \ + -Wshadow \ + -Woverloaded-virtual \ + $(CXXFLAGS_CXX11) \ + +# enable debug STL +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) +gb_COMPILERDEFS += \ + -D_GLIBCXX_DEBUG \ + +endif + +ifneq ($(strip $(SYSBASE)),) +gb_CXXFLAGS += --sysroot=$(SYSBASE) +gb_CFLAGS += --sysroot=$(SYSBASE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--sysroot=$(SYSBASE) +endif + +gb_LinkTarget_LDFLAGS += \ + -L$(SYSBASE)/lib \ + -L$(SYSBASE)/usr/lib \ + -Wl,-B,direct \ + -Wl,-z,defs \ + -Wl,-z,combreloc \ + +ifeq ($(HAVE_LD_HASH_STYLE),TRUE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE) \ + +endif + +ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),) +gb_LinkTarget_LDFLAGS += -Wl,-Bsymbolic-functions +endif + +# sun ld doesn't understand -O1 optimize flag +gb_LINKEROPTFLAGS := +gb_LINKERSTRIPDEBUGFLAGS := -Wl,-zredlocsym -Wl,-znoldynsym + +# LinkTarget class + +define gb_LinkTarget__get_rpath_for_layer +$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS))) +endef + +gb_LinkTarget__RPATHS := \ + URELIB:\dORIGIN \ + UREBIN:\dORIGIN \ + OOO:\dORIGIN \ + SDKBIN:\dORIGIN/../../program \ + OXT: \ + NONE:\dORIGIN/../Library \ + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CFLAGS_WERROR) + +# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 +# we want to use @$(extraobjectlist) in the long run +# link with C compiler if there are no C++ files (pyuno_wrapper depends on this) +define gb_LinkTarget__command_dynamiclink +$(call gb_Helper_abbreviate_dirs,\ + $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS),$(gb_CXX),$(gb_CC)) \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(gb_LTOFLAGS) \ + $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)-soname=$(notdir $(1)) \ + ) \ + $(subst \d,$$,$(RPATH)) \ + $(T_LDFLAGS) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ + -Wl$(COMMA)--start-group \ + $(foreach lib,$(LINKED_STATIC_LIBS),\ + $(call gb_StaticLibrary_get_target,$(lib))) \ + $(T_LIBS) \ + -Wl$(COMMA)--end-group \ + -Wl$(COMMA)-zrecord \ + $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \ + -o $(1) \ + $(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) $(ILIBTARGET))) + $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\ + $(READELF) -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \ + $(NM) --dynamic --extern-only --defined-only --format=posix $(1) \ + | cut -d' ' -f1-2 \ + >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \ + $(WORKDIR)/LinkTarget/$(2).exports,$(1)))) +endef + +define gb_LinkTarget__command_staticlink +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(1) && \ + $(gb_AR) -rsu $(1) \ + $(if $(LD_PLUGIN),--plugin $(LD_PLUGIN)) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ + $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) +endef + +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(if $(filter Library CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) +$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) + $(call gb_Trace_EndRange,$(2),LNK) +endef + + +# Library class + +gb_Library_DEFS := +gb_Library_TARGETTYPEFLAGS := -shared -Wl,-M/usr/lib/ld/map.noexstk -mimpure-text +gb_Library_UDK_MAJORVER := 3 +gb_Library_SYSPRE := lib +gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ +gb_Library_PLAINEXT := .so +gb_Library_DLLEXT := .so +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) + +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) +gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) + +gb_STDLIBS := \ + -lm \ + -lnsl \ + -lsocket \ + +gb_Library_FILENAMES := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +define gb_Library__get_rpath +$(if $(1),$(strip -Wl,-z,origin '-Wl,-rpath,$(1)' -L$(INSTDIR)/program)) +endef + +define gb_Library_get_rpath +$(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))) +endef + +define gb_Library_Library_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) + +endef + +gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script) + +gb_Library_get_sdk_link_dir = $(INSTDIR)/$(SDKDIRNAME)/lib + +gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target) + +# Executable class + +gb_Executable_EXT := + +gb_Executable_LAYER := \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \ + + +define gb_Executable__get_rpath +$(strip -Wl,-z,origin $(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') -L$(INSTDIR)/program) +endef + +define gb_Executable_get_rpath +$(call gb_Executable__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))) +endef + +define gb_Executable_Executable_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1)) + +endef + + +# CppunitTest class + +gb_CppunitTest_CPPTESTPRECOMMAND := \ + $(call gb_Helper_extend_ld_path,$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs) +gb_CppunitTest_get_filename = libtest_$(1).so +gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename) + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE)) + +endef + +define gb_CppunitTest_postprocess +$(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2) $(3) +endef + +# JunitTest class + +ifneq ($(OOO_TEST_SOFFICE),) +gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE) +else +ifneq ($(gb_JunitTest_DEBUGRUN),) +gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) +else +gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice +endif +endif + +define gb_JunitTest_JunitTest_platform +$(call gb_JunitTest_get_target,$(1)) : DEFS := \ + -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ + -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.postprocesscommand=$(SRCDIR)/solenv/bin/gdb-core-bt.sh \ + -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ + +endef + +# PythonTest class + +gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) + +# Module class + +define gb_Module_DEBUGRUNCOMMAND +OFFICESCRIPT=`mktemp` && \ +printf ". $(INSTROOT)/program/ooenv\\n" > $${OFFICESCRIPT} && \ +printf "gdb --tui $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \ +printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' \"" >> $${OFFICESCRIPT} && \ +printf " -ex \"r\"\\n" >> $${OFFICESCRIPT} && \ +$(SHELL) $${OFFICESCRIPT} && \ +rm $${OFFICESCRIPT} +endef + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=gcc3 \ + -D_gcc3 \ +) + +endef + +# InstallScript class + +gb_InstallScript_EXT := .ins + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := +gb_CliAssemblyTarget_get_dll := + +# Extension class + +gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION) + +# UnoApiHeadersTarget class + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# UIMenubarTarget class + +define gb_UIMenubarTarget__command +$(call gb_Output_announce,$(2),$(true),UIM,1) +$(call gb_Trace_StartRange,$(2),UIM) +cp $(3) $(1) +$(call gb_Trace_EndRange,$(2),UIM) + +endef + +gb_UIMenubarTarget_UIMenubarTarget_platform := + +# Python +gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload:$(INSTDIR)/program" +gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python +# this is passed to gdb as executable when running tests +gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin + +include $(GBUILDDIR)/platform/com_GCC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/unittest-failed-MACOSX.sh b/solenv/gbuild/platform/unittest-failed-MACOSX.sh new file mode 100755 index 000000000..049da92b4 --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-MACOSX.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# 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 . +cat << EOF + +Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE="lldb --" # for interactive debugging on macOS +make $1Test_$2 VALGRIND=memcheck # for memory checking + +You can limit the execution to just one particular test by: + +EOF + +case $1 in + Python) + cat << EOF +make $1Test_$2 PYTHON_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; + *) + cat << EOF +make $1Test_$2 CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; +esac + +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/platform/unittest-failed-WNT.sh b/solenv/gbuild/platform/unittest-failed-WNT.sh new file mode 100755 index 000000000..5ace1f0d1 --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-WNT.sh @@ -0,0 +1,47 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# 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 . +cat << EOF + +Error: a unit test failed, please do one of: +make $1Test_$2 CPPUNITTRACE=TRUE # which is a shortcut for the following line +make $1Test_$2 CPPUNITTRACE="'$DEVENV' /debugexe" # for interactive debugging in Visual Studio +make $1Test_$2 CPPUNITTRACE="drmemory -free_max_frames 20" # for memory checking (install Dr.Memory first, and put it to your PATH) + +You can limit the execution to just one particular test by: + +EOF + +case $1 in + Python) + cat << EOF +make $1Test_$2 PYTHON_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; + *) + cat << EOF +make $1Test_$2 CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; +esac + +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/platform/unittest-failed-default.sh b/solenv/gbuild/platform/unittest-failed-default.sh new file mode 100755 index 000000000..1e742fd7f --- /dev/null +++ b/solenv/gbuild/platform/unittest-failed-default.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# -*- Mode: sh; 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/. +# +# 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 . +cat << EOF + +Error: a unit test failed, please do one of: + +make $1Test_$2 CPPUNITTRACE="gdb --args" + # for interactive debugging on Linux +make $1Test_$2 VALGRIND=memcheck + # for memory checking +make $1Test_$2 DEBUGCPPUNIT=TRUE + # for exception catching + +You can limit the execution to just one particular test by: + +EOF + +case $1 in + Python) + cat << EOF +make PYTHON_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; + *) + cat << EOF +make CPPUNIT_TEST_NAME="testXYZ" ...above mentioned params... + +EOF + ;; +esac + +exit 1 + +# vim: set et sw=4: diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk new file mode 100644 index 000000000..6abfb75da --- /dev/null +++ b/solenv/gbuild/platform/unxgcc.mk @@ -0,0 +1,397 @@ +# -*- 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/. +# +# 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 . +# + +# to block heavy exception handling that try to acquire the solarmutex +export LO_LEAN_EXCEPTION=1 + +include $(GBUILDDIR)/platform/com_GCC_defs.mk + +gb_MKTEMP := mktemp -t gbuild.XXXXXX + +ifneq ($(origin AR),default) +gb_AR := $(AR) +endif + +gb_OSDEFS := \ + -D$(OS) \ + -D_PTHREADS \ + -DUNIX \ + -DUNX \ + $(PTHREAD_CFLAGS) \ + $(LFS_CFLAGS) \ + +gb_CFLAGS := \ + $(gb_CFLAGS_COMMON) \ + -fPIC \ + -Wdeclaration-after-statement \ + -Wshadow \ + +# At least libstdc++ (which is approximated here with !HAVE_LIBCXX) needs -pthread when including +# various C++ headers like <thread>, see <https://gcc.gnu.org/onlinedocs/gcc-8.3.0/libstdc++/manual/ +# manual/using.html#manual.intro.using.flags>: +ifeq ($(HAVE_LIBCXX),) +gb_CXX_LINKFLAGS := -pthread +endif + +gb_CXXFLAGS := \ + $(gb_CXXFLAGS_COMMON) \ + -fPIC \ + -Wshadow \ + -Woverloaded-virtual \ + $(CXXFLAGS_CXX11) \ + $(gb_CXX_LINKFLAGS) \ + + +# enable debug STL +ifeq ($(gb_ENABLE_DBGUTIL),$(true)) +gb_COMPILERDEFS += \ + -D_GLIBCXX_DEBUG \ + +endif + +ifneq ($(strip $(SYSBASE)),) +gb_CXXFLAGS += --sysroot=$(SYSBASE) +gb_CFLAGS += --sysroot=$(SYSBASE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--sysroot=$(SYSBASE) +endif + +gb_LinkTarget_LDFLAGS += \ + -Wl,-rpath-link,$(SYSBASE)/lib:$(SYSBASE)/usr/lib \ + -Wl,-z,combreloc \ + +ifeq ($(HAVE_LD_HASH_STYLE),TRUE) +gb_LinkTarget_LDFLAGS += \ + -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE) \ + +endif + +ifneq ($(HAVE_LD_BSYMBOLIC_FUNCTIONS),) +gb_LinkTarget_LDFLAGS += -Wl,-Bsymbolic-functions +endif + +gb_LINKEROPTFLAGS := -Wl,-O1 +gb_LINKERSTRIPDEBUGFLAGS := -Wl,-S + +# LinkTarget class + +define gb_LinkTarget__get_rpath_for_layer +$(patsubst $(1):%,%,$(filter $(1):%,$(gb_LinkTarget__RPATHS))) +endef + +gb_LinkTarget__RPATHS := \ + URELIB:\dORIGIN \ + UREBIN:\dORIGIN \ + OOO:\dORIGIN \ + SDKBIN:\dORIGIN/../../program \ + OXT: \ + NONE:\dORIGIN/../Library \ + +gb_LinkTarget_CFLAGS := $(gb_CFLAGS) +gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) + +# note that `cat $(extraobjectlist)` is needed to build with older gcc versions, e.g. 4.1.2 on SLED10 +# we want to use @$(extraobjectlist) in the long run +# link with C compiler if there are no C++ files (pyuno_wrapper depends on this) +# But always link with C++ compiler e.g. under -fsanitize=undefined, as sal uses +# __ubsan_handle_dynamic_type_cache_miss_abort and __ubsan_vptr_type_cache from +# libclang_rt.ubsan_cxx-x86_64.a, and oosplash links against sal but itself only +# contains .c sources: +define gb_LinkTarget__command_dynamiclink +$(call gb_Helper_abbreviate_dirs,\ + $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(gb_CXX) $(gb_CXX_LINKFLAGS),$(gb_CC)) \ + $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ + $(gb_LTOFLAGS) \ + $(if $(SOVERSIONSCRIPT),-Wl$(COMMA)--soname=$(notdir $(1)) \ + -Wl$(COMMA)--version-script=$(SOVERSIONSCRIPT)) \ + $(subst \d,$$,$(RPATH)) \ + $(T_LDFLAGS) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),`cat $(extraobjectlist)`) \ + $(if $(filter TRUE,$(DISABLE_DYNLOADING)), \ + -Wl$(COMMA)--start-group \ + $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \ + $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ + $(T_LIBS) \ + $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(T_STDLIBS_CXX)) \ + -Wl$(COMMA)--end-group \ + , \ + -Wl$(COMMA)--start-group \ + $(foreach lib,$(LINKED_STATIC_LIBS),$(call gb_StaticLibrary_get_target,$(lib))) \ + $(T_LIBS) \ + $(if $(CXXOBJECTS)$(GENCXXOBJECTS)$(EXTRAOBJECTLISTS)$(filter-out XTRUE,X$(ENABLE_RUNTIME_OPTIMIZATIONS)),$(T_STDLIBS_CXX)) \ + -Wl$(COMMA)--end-group \ + -Wl$(COMMA)--no-as-needed \ + $(patsubst lib%.a,-l%,$(patsubst lib%.so,-l%,$(patsubst %.$(gb_Library_UDK_MAJORVER),%,$(foreach lib,$(LINKED_LIBS),$(call gb_Library_get_filename,$(lib)))))) \ + ) \ + -o $(1) \ + $(if $(SOVERSIONSCRIPT),&& ln -sf ../../program/$(notdir $(1)) $(ILIBTARGET))) + $(if $(filter Library,$(TARGETTYPE)), $(call gb_Helper_abbreviate_dirs,\ + $(READELF) -d $(1) | grep SONAME > $(WORKDIR)/LinkTarget/$(2).exports.tmp; \ + $(NM) $(gb_LTOPLUGINFLAGS) --dynamic --extern-only --defined-only --format=posix $(1) \ + | cut -d' ' -f1-2 \ + >> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \ + $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \ + $(WORKDIR)/LinkTarget/$(2).exports,$(1)))) +endef + +define gb_LinkTarget__command_staticlink +$(call gb_Helper_abbreviate_dirs,\ + rm -f $(1) && \ + $(gb_AR) $(gb_LTOPLUGINFLAGS) -rsu $(1) \ + $(if $(LD_PLUGIN),--plugin $(LD_PLUGIN)) \ + $(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \ + $(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \ + $(foreach object,$(ASMOBJECTS),$(call gb_AsmObject_get_target,$(object))) \ + $(foreach object,$(GENCOBJECTS),$(call gb_GenCObject_get_target,$(object))) \ + $(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \ + $(foreach extraobjectlist,$(EXTRAOBJECTLISTS),@$(extraobjectlist)) \ + $(if $(findstring s,$(MAKEFLAGS)),2> /dev/null)) +endef + +define gb_LinkTarget__command +$(call gb_Output_announce,$(2),$(true),LNK,4) + $(call gb_Trace_StartRange,$(2),LNK) +$(if $(filter CppunitTest Executable,$(TARGETTYPE)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2))) +$(if $(filter Library,$(TARGETTYPE)),$(if $(filter TRUE,$(DISABLE_DYNLOADING)),$(call gb_LinkTarget__command_staticlink,$(1)),$(call gb_LinkTarget__command_dynamiclink,$(1),$(2)))) +$(if $(filter StaticLibrary,$(TARGETTYPE)),$(call gb_LinkTarget__command_staticlink,$(1))) + $(call gb_Trace_EndRange,$(2),LNK) +endef + + +# Library class + +gb_Library_DEFS := +gb_Library_SYSPRE := lib +gb_Library_UNOVERPRE := $(gb_Library_SYSPRE)uno_ + +ifeq ($(DISABLE_DYNLOADING),TRUE) + +gb_Library_PLAINEXT := .a +gb_Library_DLLEXT := .a + +else + +gb_Library_TARGETTYPEFLAGS := -shared -Wl,-z,noexecstack +gb_Library_UDK_MAJORVER := 3 +gb_Library_PLAINEXT := .so +gb_Library_DLLEXT := .so + +endif + +gb_Library_RTEXT := gcc3$(gb_Library_PLAINEXT) + +gb_Library_OOOEXT := $(gb_Library_DLLPOSTFIX)$(gb_Library_PLAINEXT) +gb_Library_UNOEXT := .uno$(gb_Library_PLAINEXT) + +gb_Library_FILENAMES := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_PLAINEXT)) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_OOOEXT)) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):$(lib)$(gb_Library_UNOEXT)) \ + +ifeq ($(DISABLE_DYNLOADING),TRUE) + +gb_Library_FILENAMES += \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT)) \ + +else + +gb_Library_FILENAMES += \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):$(gb_Library_SYSPRE)$(lib)$(gb_Library_RTEXT).$(gb_Library_UDK_MAJORVER)) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):$(gb_Library_UNOVERPRE)$(lib)$(gb_Library_PLAINEXT).$(gb_Library_UDK_MAJORVER)) \ + +endif + +gb_Library_LAYER := \ + $(foreach lib,$(gb_Library_OOOLIBS),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OOO),$(lib):OOO) \ + $(foreach lib,$(gb_Library_PLAINLIBS_OXT),$(lib):OXT) \ + $(foreach lib,$(gb_Library_PLAINLIBS_NONE),$(lib):NONE) \ + $(foreach lib,$(gb_Library_PRIVATELIBS_URE),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_RTVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \ + $(foreach lib,$(gb_Library_EXTENSIONLIBS),$(lib):OXT) \ + +define gb_Library__get_rpath +$(if $(1),$(strip -Wl,-z,origin '-Wl,-rpath,$(1)' -Wl,-rpath-link,$(INSTDIR)/program)) +endef + +define gb_Library_get_rpath +$(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Library_get_layer,$(1)))) +endef + +define gb_Library_Library_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library_get_rpath,$(1)) + +endef + +gb_Library__set_soversion_script_platform = $(gb_Library__set_soversion_script) + +gb_Library_get_sdk_link_dir = $(INSTDIR)/$(SDKDIRNAME)/lib + +gb_Library_get_sdk_link_lib = $(gb_Library_get_versionlink_target) + +# Executable class + +gb_Executable_EXT := + +gb_Executable_LAYER := \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \ + + +define gb_Executable__get_rpath +$(strip -Wl,-z,origin $(if $(1),'-Wl$(COMMA)-rpath$(COMMA)$(1)') -Wl,-rpath-link,$(INSTDIR)/program) +endef + +define gb_Executable_get_rpath +$(call gb_Executable__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,$(call gb_Executable_get_layer,$(1)))) +endef + +define gb_Executable_Executable_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Executable_get_rpath,$(1)) + +endef + + +# CppunitTest class + +gb_CppunitTest_CPPTESTPRECOMMAND := \ + $(call gb_Helper_extend_ld_path,$(WORKDIR)/UnpackedTarball/cppunit/src/cppunit/.libs) +gb_CppunitTest_get_filename = libtest_$(1).so +gb_CppunitTest_get_ilibfilename = $(gb_CppunitTest_get_filename) +gb_CppunitTest_malloc_check := MALLOC_CHECK_=2 MALLOC_PERTURB_=153 + +define gb_CppunitTest_CppunitTest_platform +$(call gb_LinkTarget_get_target,$(2)) : RPATH := $(call gb_Library__get_rpath,$(call gb_LinkTarget__get_rpath_for_layer,NONE)) + +endef + +define gb_CppunitTest_postprocess +$(SRCDIR)/solenv/bin/gdb-core-bt.sh $(1) $(2) $(3) +endef + +# JunitTest class + +ifneq ($(OOO_TEST_SOFFICE),) +gb_JunitTest_SOFFICEARG:=$(OOO_TEST_SOFFICE) +else +ifneq ($(gb_JunitTest_DEBUGRUN),) +gb_JunitTest_SOFFICEARG:=connect:pipe,name=$(USER) +else +gb_JunitTest_SOFFICEARG:=path:$(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice +endif +endif + +define gb_JunitTest_JunitTest_platform +$(call gb_JunitTest_get_target,$(1)) : DEFS := \ + -Dorg.openoffice.test.arg.env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \ + -Dorg.openoffice.test.arg.user=$(call gb_Helper_make_url,$(call gb_JunitTest_get_userdir,$(1))) \ + -Dorg.openoffice.test.arg.workdir=$(call gb_JunitTest_get_userdir,$(1)) \ + -Dorg.openoffice.test.arg.postprocesscommand=$(SRCDIR)/solenv/bin/gdb-core-bt.sh \ + -Dorg.openoffice.test.arg.soffice="$(gb_JunitTest_SOFFICEARG)" \ + +endef + +# PythonTest class + +gb_PythonTest_PRECOMMAND := $(gb_CppunitTest_CPPTESTPRECOMMAND) + +# Module class + +define gb_Module_DEBUGRUNCOMMAND +OFFICESCRIPT=`mktemp` && \ +printf 'if [ -e $(INSTROOT)/program/ooenv ]; then . $(INSTROOT)/program/ooenv; fi\n' > $${OFFICESCRIPT} && \ +printf "gdb $(INSTROOT)/$(LIBO_BIN_FOLDER)/soffice.bin" >> $${OFFICESCRIPT} && \ +printf " -ex \"set args --norestore --nologo '--accept=pipe,name=$(USER);urp;' %s\"" \ + "$(subst ","\\\"",$(value gb_DBGARGS))" >> $${OFFICESCRIPT} && \ +$(SHELL) $${OFFICESCRIPT} && \ +rm $${OFFICESCRIPT} +endef + +# InstallModuleTarget class + +define gb_InstallModuleTarget_InstallModuleTarget_platform +$(call gb_InstallModuleTarget_add_defs,$(1),\ + $(gb_CPUDEFS) \ + $(gb_OSDEFS) \ + -DCOMID=gcc3 \ + -D_gcc3 \ +) + +endef + +# InstallScript class + +gb_InstallScript_EXT := .ins + +# CliAssemblyTarget class + +gb_CliAssemblyTarget_POLICYEXT := +gb_CliAssemblyTarget_get_dll := + +# Extension class + +gb_Extension_LICENSEFILE_DEFAULT := $(INSTROOT)/LICENSE + +# UnpackedTarget class + +gb_UnpackedTarget_TARFILE_LOCATION := $(TARFILE_LOCATION) + +# UnoApiHeadersTarget class + +ifeq ($(DISABLE_DYNLOADING),TRUE) +gb_UnoApiHeadersTarget_select_variant = $(if $(filter udkapi,$(1)),comprehensive,$(2)) +else +gb_UnoApiHeadersTarget_select_variant = $(2) +endif + +# UIMenubarTarget class + +define gb_UIMenubarTarget__command +$(call gb_Output_announce,$(2),$(true),UIM,1) +$(call gb_Trace_StartRange,$(2),UIM) +cp $(3) $(1) +$(call gb_Trace_EndRange,$(2),UIM) + +endef + +gb_UIMenubarTarget_UIMenubarTarget_platform := + +# Python +gb_Python_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(INSTDIR)/program/python-core-$(PYTHON_VERSION)" PYTHONPATH="$${PYPATH:+$$PYPATH:}$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib:$(INSTDIR)/program/python-core-$(PYTHON_VERSION)/lib/lib-dynload" +gb_Python_INSTALLED_EXECUTABLE := /bin/sh $(INSTROOT)/program/python +# this is passed to gdb as executable when running tests +gb_Python_INSTALLED_EXECUTABLE_GDB := $(INSTROOT)/program/python.bin + +include $(GBUILDDIR)/platform/com_GCC_class.mk + +# vim: set noet sw=4: diff --git a/solenv/gbuild/platform/win_compatibility.manifest b/solenv/gbuild/platform/win_compatibility.manifest new file mode 100644 index 000000000..709f6f3c7 --- /dev/null +++ b/solenv/gbuild/platform/win_compatibility.manifest @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> + <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> + <application> + <!-- Windows 10 --> + <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> + <!-- Windows 8.1 --> + <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> + <!-- Windows 8 --> + <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> + <!-- Windows 7 --> + <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> + </application> + </compatibility> +</assembly> diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk new file mode 100644 index 000000000..b2de9e2a9 --- /dev/null +++ b/solenv/gbuild/platform/windows.mk @@ -0,0 +1,45 @@ +# -*- 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/. +# + +# to block heavy exception handling that try to acquire the solarmutex +export LO_LEAN_EXCEPTION=1 + +gb_LICENSE := license.txt +gb_README = readme_$(1).txt + +gb_Helper_get_rcfile = $(1).ini + +gb_Helper_LIBRARY_PATH_VAR := PATH + +gb_MKTEMP := mktemp --tmpdir=$(gb_TMPDIR) gbuild.XXXXXX + +# define _WIN32_WINNT and WINVER will be derived from it in sdkddkver.h +# current baseline is Windows 7 (NT 6.1) +# for _WIN32_IE, if _WIN32_WINNT >= 0x0600 the derived value from +# sdkddkver.h is sufficient +gb_WIN_VERSION_DEFS := \ + -D_WIN32_WINNT=0x0601 \ + -DWIN32 \ + -DWNT \ + +gb_OSDEFS := \ + $(gb_WIN_VERSION_DEFS) \ + -DNOMINMAX \ + $(LFS_CFLAGS) \ + +gb_Executable_LAYER := \ + $(foreach exe,$(gb_Executable_UREBIN),$(exe):UREBIN) \ + $(foreach exe,$(gb_Executable_SDK),$(exe):SDKBIN) \ + $(foreach exe,$(gb_Executable_OOO),$(exe):OOO) \ + $(foreach exe,$(gb_Executable_NONE),$(exe):NONE) \ + +# empty to avoid --warn-undefined-functions +gb_Library__set_soversion_script_platform = + +# vim:set noexpandtab: |