dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone
5975ab
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5975ab
From: Daniel Axtens <dja@axtens.net>
5975ab
Date: Fri, 5 Jun 2020 17:47:25 +1000
5975ab
Subject: [PATCH] libtasn1: compile into asn1 module
5975ab
5975ab
Create a wrapper file that specifies the module license.
5975ab
Set up the makefile so it is built.
5975ab
5975ab
Signed-off-by: Daniel Axtens <dja@axtens.net>
5975ab
---
5975ab
 grub-core/Makefile.core.def        | 15 +++++++++++++++
5975ab
 grub-core/lib/libtasn1_wrap/wrap.c | 26 ++++++++++++++++++++++++++
5975ab
 2 files changed, 41 insertions(+)
5975ab
 create mode 100644 grub-core/lib/libtasn1_wrap/wrap.c
5975ab
5975ab
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
5975ab
index 99615c07b94..c2d922e6d48 100644
5975ab
--- a/grub-core/Makefile.core.def
5975ab
+++ b/grub-core/Makefile.core.def
5975ab
@@ -2436,3 +2436,18 @@ module = {
5975ab
   common = loader/i386/xen_file64.c;
5975ab
   extra_dist = loader/i386/xen_fileXX.c;
5975ab
 };
5975ab
+
5975ab
+module = {
5975ab
+  name = asn1;
5975ab
+  common = lib/libtasn1/lib/decoding.c;
5975ab
+  common = lib/libtasn1/lib/coding.c;
5975ab
+  common = lib/libtasn1/lib/element.c;
5975ab
+  common = lib/libtasn1/lib/structure.c;
5975ab
+  common = lib/libtasn1/lib/parser_aux.c;
5975ab
+  common = lib/libtasn1/lib/gstr.c;
5975ab
+  common = lib/libtasn1/lib/errors.c;
5975ab
+  common = lib/libtasn1_wrap/wrap.c;
5975ab
+  cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
5975ab
+  // -Wno-type-limits comes from libtasn1's configure.ac
5975ab
+  cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB) -I$(srcdir)/lib/libtasn1/lib -Wno-type-limits';
5975ab
+};
5975ab
diff --git a/grub-core/lib/libtasn1_wrap/wrap.c b/grub-core/lib/libtasn1_wrap/wrap.c
5975ab
new file mode 100644
5975ab
index 00000000000..622ba942e33
5975ab
--- /dev/null
5975ab
+++ b/grub-core/lib/libtasn1_wrap/wrap.c
5975ab
@@ -0,0 +1,26 @@
5975ab
+/*
5975ab
+ *  GRUB  --  GRand Unified Bootloader
5975ab
+ *  Copyright (C) 2020 IBM Corporation
5975ab
+ *
5975ab
+ *  GRUB is free software: you can redistribute it and/or modify
5975ab
+ *  it under the terms of the GNU General Public License as published by
5975ab
+ *  the Free Software Foundation, either version 3 of the License, or
5975ab
+ *  (at your option) any later version.
5975ab
+ *
5975ab
+ *  GRUB is distributed in the hope that it will be useful,
5975ab
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
5975ab
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5975ab
+ *  GNU General Public License for more details.
5975ab
+ *
5975ab
+ *  You should have received a copy of the GNU General Public License
5975ab
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
5975ab
+ */
5975ab
+
5975ab
+#include <grub/dl.h>
5975ab
+
5975ab
+/*
5975ab
+ * libtasn1 is provided under LGPL2.1+, which is compatible
5975ab
+ * with GPL3+. As Grub as a whole is under GPL3+, this module
5975ab
+ * is therefore under GPL3+ also.
5975ab
+ */
5975ab
+GRUB_MOD_LICENSE ("GPLv3+");