p7zip: assorted fixes
[oi-userland.git] / components / developer / gdb / Makefile
blobf5df651c18d0d1c455dfb418f4f4551161779bcf
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2017, 2021 Gary Mills
25 # Copyright 2019 Andreas Wacknitz
26 # Copyright 2023 Carsten Grzemba
29 # There are a large number of macros in the GDB code written
30 # specifically for GCC's preprocessor. Studio does not expand
31 # these macros the same way GCC does, and the resulting gdb is
32 # not usable. Building gdb with a GCC >= 4.7.2 produces very
33 # good results, even on SPARC.
34 include ../../../make-rules/shared-macros.mk
36 COMPONENT_NAME= gdb
37 COMPONENT_VERSION= 14.2
38 COMPONENT_REVISION= 0
39 COMPONENT_SUMMARY= GDB: The GNU Project Debugger
40 COMPONENT_CLASSIFICATION=Development/System
41 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
42 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
43 COMPONENT_ARCHIVE_HASH= \
44 sha256:2de5174762e959a5e529e20c20d88a04735469d8fffd98f61664e70b341dc47c
45 COMPONENT_ARCHIVE_URL= https://ftp.gnu.org/gnu/gdb/$(COMPONENT_ARCHIVE)
46 COMPONENT_PROJECT_URL= https://www.gnu.org/software/gdb/
47 COMPONENT_FMRI= developer/debug/gdb
49 CONFIGURE_DEFAULT_DIRS=no
51 include $(WS_MAKE_RULES)/common.mk
53 # The traditional output from gmake test omits some
54 # test results information that is contained in the
55 # build/<arch>/gdb/testsuite/gdb.sum file, so use that file instead
56 # for test results comparison.
57 COMPONENT_POST_TEST_ACTION += \
58 ( $(MV) $(COMPONENT_TEST_OUTPUT) $(COMPONENT_TEST_OUTPUT)-orig ; \
59 $(CP) $(BUILD_DIR_64)/gdb/testsuite/gdb.sum $(COMPONENT_TEST_OUTPUT) )
61 # Results output is different on Intel vs. SPARC.
62 # Note that comparisons against master results
63 # are not clean since results will still vary.
64 COMPONENT_TEST_MASTER = \
65 $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH)-$(BITS).master
67 # Test transforms retain only relevant results output.
68 COMPONENT_TEST_TRANSFORMS += \
69 '-n ' \
70 '-e "/^FAIL/p" ' \
71 '-e "/^KFAIL/p" ' \
72 '-e "/^PASS/p" ' \
73 '-e "/^UNRESOLVED/p" ' \
74 '-e "/^UNSUPPORTED/p" ' \
75 '-e "/^UNTESTED/p" ' \
76 '-e "/^XFAIL/p" ' \
77 '-e "/^\# of /p" '
79 # Test results vary from run to run and machine to machine,
80 # so master test results will not match, and are not
81 # appropriate for a full Userland test run
83 PATH = $(PATH.gnu)
85 CFLAGS_sparc = -g -O2 -mcpu=ultrasparc -mtune=ultrasparc
86 CFLAGS_sparc += -mno-unaligned-doubles
87 CFLAGS_sparc += -mapp-regs -mhard-float
88 CFLAGS_i386 = -g -O2 -march=opteron -mtune=opteron
89 CFLAGS_EXTRA = -Wall -Wno-long-long -Wcast-align -fno-omit-frame-pointer
91 CFLAGS = $(CC_BITS) $(CFLAGS_EXTRA) $(CFLAGS_$(MACH))
92 CXXFLAGS = $(CC_BITS) $(CFLAGS_EXTRA) $(CFLAGS_$(MACH))
93 CPPFLAGS = -D_REENTRANT -I$(USRINCDIR)/ncurses
95 LDFLAGS += -L/usr/gnu/lib/$(MACH64) -R/usr/gnu/lib/$(MACH64)
97 # `echo $(CFLAGS)` and `echo $(LDFLAGS)` used to
98 # work around problem with extra blank characters
99 # inserted into configrue option strings during
100 # nested configure invocations within the gdb build.
102 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
103 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)"
104 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
105 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)"
107 CONFIGURE_DEFAULT_DIRS=no
108 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
109 CONFIGURE_OPTIONS += --bindir=$(CONFIGURE_BINDIR.$(BITS))
110 CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))
111 CONFIGURE_OPTIONS += --sbindir=$(CONFIGURE_SBINDIR.$(BITS))
113 CONFIGURE_OPTIONS += --with-x=no
114 CONFIGURE_OPTIONS += --with-curses
115 CONFIGURE_OPTIONS += --disable-werror
116 CONFIGURE_OPTIONS += --enable-plugins
117 CONFIGURE_OPTIONS += --enable-tui
118 CONFIGURE_OPTIONS += --without-auto-load-safe-path
119 CONFIGURE_OPTIONS += --with-python=$(PYTHON)
120 CONFIGURE_OPTIONS += --with-libexpat-prefix=/usr/lib
121 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
122 CONFIGURE_OPTIONS += --with-system-zlib
123 CONFIGURE_OPTIONS += --without-guile
125 COMPONENT_BUILD_ENV += $(CONFIGURE_ENV)
127 # Generate illumos data files describing system calls and structures
128 # found in core files.
129 COMPONENT_POST_UNPACK_ACTION = \
130 GCC_VERSION=$(GCC_VERSION) COMPONENT_DIR=$(COMPONENT_DIR) \
131 SOURCE_DIR=$(SOURCE_DIR) \
132 $(COMPONENT_DIR)/Solaris/gen_syscall_table.sh
134 # Generate the newly added Solaris instruction and
135 # register tables which weren't there by default.
136 COMPONENT_PRE_CONFIGURE_ACTION += \
137 +( cd $(SOURCE_DIR)/gdb/features ; \
138 $(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) all; )
140 # build the manpages
141 COMPONENT_POST_BUILD_ACTION = \
142 +( cd $(BUILD_DIR_64)/gdb/doc ; \
143 $(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) man; )
145 # Two tests hangs up the test run, so skip them.
146 COMPONENT_PRE_TEST_ACTION += \
147 ( cd $(SOURCE_DIR)/gdb/testsuite; \
148 for F in gdb.mi/mi-exec-run.exp gdb.base/annota3.exp; \
149 do \
150 if test -e $$F; \
151 then \
152 $(MV) $$F $$F-save; \
153 fi; \
154 done )
156 COMPONENT_POST_INSTALL_ACTION = \
157 ( cd $(PROTOUSRDIR)/share/gdb/python/gdb ; \
158 $(PYTHON) -m compileall . ; \
159 cd $(PROTOUSRDIR)/share/gdb/python/gdb/command ; \
160 $(PYTHON) -m compileall . ; \
161 cd $(PROTOUSRDIR)/share/gdb/python/gdb/function ; \
162 $(PYTHON) -m compileall . ; \
163 cd $(PROTOUSRBINDIR)/ ; \
164 /usr/bin/strip -x gdb ; \
165 cd $(COMPONENT_DIR) ; \
166 $(INSTALL) -m 0755 $(COMPONENT_DIR)/Solaris/gdbtui \
167 $(PROTOUSRBINDIR)/ ; \
168 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info \
169 $(PROTOUSRSHAREDIR)/info/ ; \
170 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-1 \
171 $(PROTOUSRSHAREDIR)/info/ ; \
172 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-2 \
173 $(PROTOUSRSHAREDIR)/info/ ; \
174 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-3 \
175 $(PROTOUSRSHAREDIR)/info/ ; \
176 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-4 \
177 $(PROTOUSRSHAREDIR)/info/ ; \
178 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-5 \
179 $(PROTOUSRSHAREDIR)/info/ ; \
180 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-6 \
181 $(PROTOUSRSHAREDIR)/info/ ; \
182 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-7 \
183 $(PROTOUSRSHAREDIR)/info/ ; \
184 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/gdb.info-8 \
185 $(PROTOUSRSHAREDIR)/info/ ; \
186 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/annotate.info \
187 $(PROTOUSRSHAREDIR)/info/ ; \
188 $(INSTALL) -m 0644 $(SOURCE_DIR)/gdb/doc/stabs.info \
189 $(PROTOUSRSHAREDIR)/info/ ; \
192 # Disable ASLR: it's a debugger and we do not want to risk
193 # altering the results of the debugging experiment.
194 ASLR_MODE=$(ASLR_DISABLE)
196 # Testing needs to find C/C++ compiler
197 COMPONENT_TEST_ENV += PATH="$(GCC_BINDIR):$(PATH)"
199 GENERATE_EXTRA_CMD += | $(GNU_GREP) -v -E '/.*\.pyc$$'
201 # Auto-generated dependencies
202 PYTHON_REQUIRED_PACKAGES += runtime/python
203 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
204 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
205 REQUIRED_PACKAGES += compress/xz
206 REQUIRED_PACKAGES += compress/zstd
207 REQUIRED_PACKAGES += developer/babeltrace
208 REQUIRED_PACKAGES += library/expat
209 REQUIRED_PACKAGES += library/gmp
210 REQUIRED_PACKAGES += library/libxxhash
211 REQUIRED_PACKAGES += library/mpfr
212 REQUIRED_PACKAGES += library/ncurses
213 REQUIRED_PACKAGES += library/zlib
214 REQUIRED_PACKAGES += shell/ksh93
215 REQUIRED_PACKAGES += system/library
216 REQUIRED_PACKAGES += system/library/math