summaryrefslogtreecommitdiff
path: root/lib/fingerprint.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-04-14 16:31:24 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-04-14 17:06:09 -0700
commit5c2f94a182a1154766154040eb5b4b39275fd3b6 (patch)
tree04ae030b12f1e993173fe33b34ea1975ec9340c7 /lib/fingerprint.c
parent661f44946d2bba21d16d718cf86372345c929a39 (diff)
downloademacs-5c2f94a182a1154766154040eb5b4b39275fd3b6.tar.gz
Replace executable’s fingerprint in place
* admin/merge-gnulib (GNULIB_MODULES): Add memmem-simple. (AVOIDED_MODULES): Add memchr. * configure.ac (HAVE_PDUMPER): AC_SUBST it, too, for use in makefiles. * lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o. * lib/fingerprint.c: New file. * lib/memmem.c, lib/str-two-way.h, m4/memmem.m4: New files, copied from Gnulib. * lib/fingerprint.h: Rename from src/fingerprint.h. * lib-src/make-fingerprint.c: Include limits.h, sys/stat.h, fingerprint.h, intprops.h, min-max.h. (SSIZE_MAX): New macro, if not already defined. (main): Without -r, Replace the fingerprint in the input file instead of generating a fingerprint.c. * lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * src/Makefile.in (HAVE_PDUMPER, MAKE_PDUMPER_FINGERPRINT): New macros. (temacs$(EXEEXT)): Use them to replace the fingerprint instead of precalculating it. (mostlyclean, ctagsfiles1): Do not worry about fingerprint.c.
Diffstat (limited to 'lib/fingerprint.c')
-rw-r--r--lib/fingerprint.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/lib/fingerprint.c b/lib/fingerprint.c
new file mode 100644
index 00000000000..e55de9c6da3
--- /dev/null
+++ b/lib/fingerprint.c
@@ -0,0 +1,66 @@
+/* Placeholder fingerprint for Emacs
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "fingerprint.h"
+
+/* This random fingerprint was generated by the shell command:
+
+ shuf -i 0-255 -n 32 -r | awk '{printf " 0x%.02X,\n", $0}'
+
+ In the final Emacs executable, this random fingerprint is replaced
+ by a fingerprint of the temporary Emacs executable that was built
+ along the way. */
+
+unsigned char const fingerprint[] =
+ {
+ 0xDE,
+ 0x86,
+ 0xBB,
+ 0x99,
+ 0xFF,
+ 0xF5,
+ 0x46,
+ 0x9A,
+ 0x9E,
+ 0x3F,
+ 0x9F,
+ 0x5D,
+ 0x9A,
+ 0xDF,
+ 0xF0,
+ 0x91,
+ 0xBD,
+ 0xCD,
+ 0xC1,
+ 0xE8,
+ 0x0C,
+ 0x16,
+ 0x1E,
+ 0xAF,
+ 0xB8,
+ 0x6C,
+ 0xE2,
+ 0x2B,
+ 0xB1,
+ 0x24,
+ 0xCE,
+ 0xB0,
+ };