Add --enable-codesign to gdb's configure

macOS requires that the gdb executable be signed in order to be able
to successfully use ptrace.  This must be done after each link.

This patch adds a new --enable-codesign configure option so that this
step can be automated.

gdb/ChangeLog
2018-06-28  Tom Tromey  <tom@tromey.com>

	* NEWS: Mention --enable-codesign.
	* silent-rules.mk (ECHO_SIGN): New variable.
	* configure.ac: Add --enable-codesign.
	* configure: Rebuild.
	* Makefile.in (CODESIGN, CODESIGN_CERT): New variables.
	(gdb$(EXEEXT)): Optionally invoke codesign.
This commit is contained in:
Tom Tromey
2018-06-28 10:32:13 -06:00
parent f2ffa92bbc
commit 44cee4fdf4
6 changed files with 42 additions and 0 deletions

11
gdb/configure vendored
View File

@@ -745,6 +745,7 @@ AWK
REPORT_BUGS_TEXI
REPORT_BUGS_TO
PKGVERSION
CODESIGN_CERT
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@@ -861,6 +862,7 @@ enable_gdbtk
with_libunwind_ia64
with_curses
enable_profiling
enable_codesign
with_pkgversion
with_bugurl
with_system_zlib
@@ -1550,6 +1552,7 @@ Optional Features:
--enable-tui enable full-screen terminal user interface (TUI)
--enable-gdbtk enable gdbtk graphical user interface (GUI)
--enable-profiling enable profiling of GDB
--enable-codesign=CERT sign gdb with 'codesign -s CERT'
--disable-rpath do not hardcode runtime library paths
--enable-libmcheck Try linking with -lmcheck if available
--enable-werror treat compile warnings as errors
@@ -7050,6 +7053,14 @@ $as_echo "$ac_cv_cc_supports_pg" >&6; }
CFLAGS="$OLD_CFLAGS"
fi
CODESIGN_CERT=
# Check whether --enable-codesign was given.
if test "${enable_codesign+set}" = set; then :
enableval=$enable_codesign; CODESIGN_CERT=$enableval
fi
# Check whether --with-pkgversion was given.