Don't enable crashdumps by default. This build knob causes the build

to be done with debug symbols, which greatly increase the size of the
build, but this is all in vain because the executables and libraries
are subsequently stripped.

Build with debug symbols if WITH_DEBUG is set.

Build with -fstack-protector.

Only fetch unowinreg.dll when building the SDK.

Add three new options:

  CRASHDUMP - Enable crashdumps, requires WITH_DEBUG

  DBGUTIL   - Enable assertions, object counting, and other
              non-production runtime debugging.

  DEBUG     - Compile with -O0 for better debugability.  The ports
              framework also sets WITH_DEBUG.

Fold a couple long lines in the Makefile.
This commit is contained in:
Don Lewis 2018-01-26 18:33:08 +00:00
parent 7539806d7d
commit db161a2654
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=460047
3 changed files with 57 additions and 10 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= apache-openoffice
PORTVERSION= ${AOOVERSION}
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= editors java
MASTER_SITES= APACHE/openoffice/${PORTVERSION}/sources \
http://tools.openoffice.org/unowinreg_prebuild/680/:unoreg \
@ -14,7 +14,7 @@ PKGNAMEPREFIX= ${LANG_PKGNAME}-
.if defined(LANG_SUFFIX)
PKGNAMESUFFIX= -${LANG_SUFFIX}
.endif
DISTFILES= ${AOOSRC} unowinreg.dll:unoreg ${EXTSRC}:extsrc
DISTFILES= ${AOOSRC} ${EXTSRC}:extsrc
DIST_SUBDIR= openoffice
EXTRACT_ONLY= ${AOOSRC}
@ -138,17 +138,27 @@ WITHOUT_CPU_CFLAGS= true
CPE_PRODUCT= ${PORTNAME:S|apache-||}
CPE_VENDOR= apache
OPTIONS_DEFINE= CUPS GNOME GNOMEVFS MMEDIA SDK WIKI_PUBLISHER
OPTIONS_DEFINE= CRASHDUMP CUPS DBGUTIL DEBUG GNOME GNOMEVFS MMEDIA \
SDK WIKI_PUBLISHER
OPTIONS_DEFAULT= CUPS GNOME GNOMEVFS MMEDIA WIKI_PUBLISHER
CRASHDUMP_DESC= Enable crashdumps, requires WITH_DEBUG
DBGUTIL_DESC= Enable assertions, object counting. (non-production)
DEBUG_DESC= Compile with -O0, sets WITH_DEBUG
GNOME_DESC= GConf + screensaver presentation control via DBUS
GNOMEVFS_DESC= GNOME Virtual File System
MMEDIA_DESC= Multimedia backend for impress
SDK_DESC= Build and install software development kit
WIKI_PUBLISHER_DESC= Build and install Wiki Publisher extension
CRASHDUMP_CONFIGURE_ENABLE= crashdump
CUPS_CONFIGURE_ENABLE= cups
CUPS_LIB_DEPENDS= libcups.so:print/cups
DBGUTIL_CONFIGURE_ENABLE= dbgutil
DEBUG_CONFIGURE_ENABLE= debug
GNOME_CONFIGURE_ENABLE= dbus gconf lockdown
GNOME_LIB_DEPENDS= libdbus-1.so:devel/dbus \
libdbus-glib-1.so:devel/dbus-glib
@ -164,6 +174,7 @@ MMEDIA_LIB_DEPENDS= libgstreamer-0.10.so:multimedia/gstreamer
MMEDIA_USE= GSTREAMER=yes
SDK_CONFIGURE_ENABLE= odk
SDK_DISTFILES= unowinreg.dll:unoreg
WIKI_PUBLISHER_CONFIGURE_ENABLE= wiki-publisher
WIKI_PUBLISHER_CONFIGURE_WITH= \
@ -183,6 +194,14 @@ TARGET_ORDER_OVERRIDE= 710:gnome-post-icons
.include <bsd.port.pre.mk>
.if defined(WITH_DEBUG)
CONFIGURE_ARGS+= --enable-symbols
.else
.if ${PORT_OPTIONS:MCRASHDUMP}
BROKEN= CRASHDUMP option requires WITH_DEBUG
.endif
.endif
.include <${FILESDIR}/Makefile.localized>
.if ${COMPILER_TYPE} == clang
@ -230,7 +249,6 @@ CONFIGURE_ARGS+= \
--with-system-cairo --enable-cairo \
--with-system-coinmp \
--with-system-curl \
--enable-crashdump \
--with-system-dicts \
--with-epm=${LOCALBASE}/bin/epm \
--with-system-expat \
@ -299,11 +317,15 @@ pre-everything::
${TOUCH} ${BUILD_COOKIE}
.endif
do-extract-SDK-on:
${CP} ${DISTDIR}/${DIST_SUBDIR}/unowinreg.dll ${WRKSRC}/external/unowinreg/
post-extract:
${TAR} -C ${WRKSUBDIR} -xzf ${DISTDIR}/${DIST_SUBDIR}/${EXTSRC}
${CP} ${DISTDIR}/${DIST_SUBDIR}/unowinreg.dll ${WRKSRC}/external/unowinreg/
${CP} ${FILESDIR}/freebsd-aoo-intro.png ${WRKSRC}/default_images/introabout/intro.png
${CP} ${FILESDIR}/freebsd-aoo-about.png ${WRKSRC}/default_images/introabout/about.png
${CP} ${FILESDIR}/freebsd-aoo-intro.png \
${WRKSRC}/default_images/introabout/intro.png
${CP} ${FILESDIR}/freebsd-aoo-about.png \
${WRKSRC}/default_images/introabout/about.png
${RM} -r ${WRKSRC}/l10n
${LN} -sf ${UNZIP_CMD} ${WRKSRC}/solenv/bin/unzip
${SED} -e '\|^For main/vcl/unx/generic/fontmanager/parseAFM|,/^__/p' \
@ -410,7 +432,9 @@ do-build:
do-install:
@${MKDIR} ${STAGEDIR}${PRINSTALLATION_BASEDIR} \
${STAGEDIR}${PREFIX}/share/mime/packages
@cd ${WRKSRC}/instsetoo_native/unxfbsd*.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; \
@cd ${WRKSRC} ; \
. ${FREEBSD_ENV_SET} ; \
cd instsetoo_native/$${INPATH}/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; \
for i in *.tar.?z ; do \
${ECHO_CMD} "extracting $$i" ; \
${TAR} -s '|./[^/]*/||' -xz -f $$i \
@ -434,7 +458,9 @@ do-install:
done
@${ECHO_CMD} "adding desktop support"
@${LN} -sf ${XDGREL} ${STAGEDIR}${DESKTOPDIR}/${EXECBASE}
@cd ${WRKSRC}/sysui/unxfbsd*.pro/misc/openoffice ; \
@cd ${WRKSRC} ; \
. ${FREEBSD_ENV_SET} ; \
cd sysui/$${INPATH}/misc/openoffice ; \
DESTDIR=${STAGEDIR} \
GNOMEDIR=${PREFIX} \
ICON_PREFIX=openoffice${AOOVERSION1} \

View File

@ -8,3 +8,16 @@
-pipe
ifeq ($(COM),CLANG)
gb_CXXFLAGS += -DHAVE_STL_INCLUDE_PATH
@@ -142,6 +143,12 @@ gb_LinkTarget_LDFLAGS += \
-Wl,--dynamic-list-cpp-typeinfo \
-Wl,-Bsymbolic-functions \
+endif
+
+ifneq ($(filter $(CPUNAME),INTEL X86_64),)
+gb_CFLAGS += -fstack-protector
+gb_CXXFLAGS += -fstack-protector
+gb_LinkTarget_LDFLAGS += -fstack-protector
endif
ifeq ($(gb_DEBUGLEVEL),2)

View File

@ -1,6 +1,6 @@
--- solenv/inc/unxfbsd.mk.orig 2017-11-27 13:50:28 UTC
+++ solenv/inc/unxfbsd.mk
@@ -96,7 +96,7 @@ CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
@@ -96,10 +96,15 @@ CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
CFLAGS_NO_EXCEPTIONS=-fno-exceptions
# -fpermissive should be removed as soon as possible
@ -9,3 +9,11 @@
.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
CFLAGSCXX += -fvisibility-inlines-hidden
.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
+
+.IF "$(CPUNAME)" == "INTEL" || "$(CPUNAME)" == "X86_64"
+CFLAGSCC += -fstack-protector
+CFLAGSCXX += -fstack-protector
+.ENDIF
# Compiler flags for compiling static object in multi threaded environment with graphical user interface
CFLAGSOBJGUIMT=