From 6daeaa0e56d74bc342e1183d77e434d400fd17ad Mon Sep 17 00:00:00 2001 From: tigro Date: Mon, 15 Jan 2024 10:43:21 +0300 Subject: [PATCH] import mingw-libgpg-error-1.36-7.el9 --- .gitignore | 1 + .mingw-libgpg-error.metadata | 1 + SOURCES/libgpg-error-1.29-multilib.patch | 122 ++ SOURCES/libgpg-error-1.36.tar.bz2.sig | Bin 0 -> 620 bytes .../libgpg-error-prepare-for-gawk-5.0.patch | 1178 +++++++++++++++++ SPECS/mingw-libgpg-error.spec | 282 ++++ 6 files changed, 1584 insertions(+) create mode 100644 .gitignore create mode 100644 .mingw-libgpg-error.metadata create mode 100644 SOURCES/libgpg-error-1.29-multilib.patch create mode 100644 SOURCES/libgpg-error-1.36.tar.bz2.sig create mode 100644 SOURCES/libgpg-error-prepare-for-gawk-5.0.patch create mode 100644 SPECS/mingw-libgpg-error.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..909f1c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libgpg-error-1.36.tar.bz2 diff --git a/.mingw-libgpg-error.metadata b/.mingw-libgpg-error.metadata new file mode 100644 index 0000000..dcaccc5 --- /dev/null +++ b/.mingw-libgpg-error.metadata @@ -0,0 +1 @@ +5245ce38b198cecd57775fb3c7b7328ec1a2a615 SOURCES/libgpg-error-1.36.tar.bz2 diff --git a/SOURCES/libgpg-error-1.29-multilib.patch b/SOURCES/libgpg-error-1.29-multilib.patch new file mode 100644 index 0000000..b59178d --- /dev/null +++ b/SOURCES/libgpg-error-1.29-multilib.patch @@ -0,0 +1,122 @@ +diff -up libgpg-error-1.29/configure.ac.multilib libgpg-error-1.29/configure.ac +--- libgpg-error-1.29/configure.ac.multilib 2018-04-11 14:41:10.479019981 +0200 ++++ libgpg-error-1.29/configure.ac 2018-04-11 14:43:31.288394113 +0200 +@@ -215,13 +215,13 @@ GNUPG_FUNC_MKDIR_TAKES_ONE_ARG + + + # Find a 64 bit integer type to be used instead of off_t. We prefer +-# the standard integer types over int64_t and finally try long long. +-if test "$ac_cv_sizeof_int" = "8"; then ++# int64_t and finally try long long. ++if test "$ac_cv_header_stdint_h" = yes; then ++ replacement_for_off_t="int64_t" ++elif test "$ac_cv_sizeof_int" = "8"; then + replacement_for_off_t="int" + elif test "$ac_cv_sizeof_long" = "8"; then + replacement_for_off_t="long" +-elif test "$ac_cv_header_stdint_h" = yes; then +- replacement_for_off_t="int64_t" + elif test "$ac_cv_sizeof_long_long" = "8"; then + replacement_for_off_t="long long" + else +diff -up libgpg-error-1.29/configure.multilib libgpg-error-1.29/configure +--- libgpg-error-1.29/configure.multilib 2018-04-11 09:34:30.000000000 +0200 ++++ libgpg-error-1.29/configure 2018-04-11 14:41:10.481020028 +0200 +@@ -11301,7 +11301,7 @@ shlibpath_var= + shlibpath_overrides_runpath=unknown + version_type=none + dynamic_linker="$host_os ld.so" +-sys_lib_dlsearch_path_spec="/lib /usr/lib" ++sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64" + need_lib_prefix=unknown + hardcode_into_libs=no + +@@ -11775,7 +11775,7 @@ fi + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64 /usr/lib64 $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +@@ -15879,12 +15879,12 @@ fi + + # Find a 64 bit integer type to be used instead of off_t. We prefer + # the standard integer types over int64_t and finally try long long. +-if test "$ac_cv_sizeof_int" = "8"; then ++if test "$ac_cv_header_stdint_h" = yes; then ++ replacement_for_off_t="int64_t" ++elif test "$ac_cv_sizeof_int" = "8"; then + replacement_for_off_t="int" + elif test "$ac_cv_sizeof_long" = "8"; then + replacement_for_off_t="long" +-elif test "$ac_cv_header_stdint_h" = yes; then +- replacement_for_off_t="int64_t" + elif test "$ac_cv_sizeof_long_long" = "8"; then + replacement_for_off_t="long long" + else +diff -up libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib libgpg-error-1.29/src/gen-posix-lock-obj.c +--- libgpg-error-1.29/src/gen-posix-lock-obj.c.multilib 2016-11-16 13:22:03.000000000 +0100 ++++ libgpg-error-1.29/src/gen-posix-lock-obj.c 2018-04-11 14:41:10.481020028 +0200 +@@ -72,6 +72,7 @@ main (void) + #ifdef USE_POSIX_THREADS + unsigned char *p; + int i; ++ int initidx = 0; + #endif + struct { + long vers; +@@ -111,11 +112,12 @@ main (void) + + /* To force a probably suitable alignment of the structure we use a + union and include a long and a pointer to a long. */ +- printf ("typedef struct\n" ++ printf ("#include \n" ++ "typedef struct\n" + "{\n" + " long _vers;\n" + " union {\n" +- " volatile char _priv[%d];\n" ++ " volatile char _priv[sizeof(pthread_mutex_t)];\n" + "%s" + " long _x_align;\n" + " long *_xp_align;\n" +@@ -123,7 +125,6 @@ main (void) + "} gpgrt_lock_t;\n" + "\n" + "#define GPGRT_LOCK_INITIALIZER {%d,{{", +- SIZEOF_PTHREAD_MUTEX_T, + # if USE_16BYTE_ALIGNMENT + " int _x16_align __attribute__ ((aligned (16)));\n", + # elif USE_DOUBLE_FOR_ALIGNMENT +@@ -137,10 +138,16 @@ main (void) + p = (unsigned char *)&mtx; + for (i=0; i < sizeof mtx; i++) + { ++ if (p[i] != 0) ++ initidx = i; ++ } ++ ++ for (i=0; i <= initidx; i++) ++ { + if (i && !(i % 8)) + printf (" \\\n%*s", 36, ""); + printf ("%u", p[i]); +- if (i < sizeof mtx - 1) ++ if (i < initidx) + putchar (','); + } + fputs ("}}}\n", stdout); +diff -up libgpg-error-1.29/src/gpg-error.h.in.multilib libgpg-error-1.29/src/gpg-error.h.in +--- libgpg-error-1.29/src/gpg-error.h.in.multilib 2018-04-11 14:41:10.481020028 +0200 ++++ libgpg-error-1.29/src/gpg-error.h.in 2018-04-11 14:45:28.184203566 +0200 +@@ -17,7 +17,7 @@ + * License along with this program; if not, see . + * SPDX-License-Identifier: LGPL-2.1+ + * +- * @configure_input@ ++ * Do not edit. Generated from gpg-error.h.in. + */ + + /* The GnuPG project consists of many components. Error codes are diff --git a/SOURCES/libgpg-error-1.36.tar.bz2.sig b/SOURCES/libgpg-error-1.36.tar.bz2.sig new file mode 100644 index 0000000000000000000000000000000000000000..55c467651b94b6dc6d3c6592f5dcab0a3a969630 GIT binary patch literal 620 zcmV-y0+aoT0W$;u0SEvc79j-KX(1!T23_i24?49Zn>o@?CF8aQ0$h-`qW}sC5G0#9 z(oZGhwzVV(0EAAnb=d)YN~i%@0$?v+_Q?GYL8F}mAD9|=jQ#>M-r1pUbeaP9rwQBZGW<9vsc?9uRqxb`k)WoumVYbd@kJZud(@NVY zqaK`nvYI=DV>50#f=PI05Ym&nrJ=OQ#tOC{>q}y$z-*UC_i(GqU*;J4KZ5!fQrcE0 z7AJ|Y|1oE3vsS5aX-5?hYQc2K_&nc;W@KDv5=Cs>!aH?X8Ek1OZgs zg;7gD{fPlH1ONdD038+~1OpzzQ*Kxdj-rOC@*r`riZi`G1_c6Ks?#U{3JDM(aj=Rr zy*~zoSqJ_yBE`q+a%;6g@tY{G2yP$thV4DiO4NVtO zwA5nGl>qC$_JImQVUV3BegG9~;_~tH!T?k>_+ioywDBeG`HT!kcUhTKuhYfU(izr! z34)OrMN68yEe{v~7QW zgQqU_QfB26wp>qE2bs+Yg`}UdnhqTTo4A{mwN&T)dZmQQGwS)ILUKV~CJctDvrc!K z%6K3hVIyINIOfCcYJ`R8}zNhwgKjSt}n6thf G`=8#_lpPNM literal 0 HcmV?d00001 diff --git a/SOURCES/libgpg-error-prepare-for-gawk-5.0.patch b/SOURCES/libgpg-error-prepare-for-gawk-5.0.patch new file mode 100644 index 0000000..14c2738 --- /dev/null +++ b/SOURCES/libgpg-error-prepare-for-gawk-5.0.patch @@ -0,0 +1,1178 @@ +diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk +index ae29043..9a1fc18 100644 +--- a/lang/cl/mkerrcodes.awk ++++ b/lang/cl/mkerrcodes.awk +@@ -1,154 +1,154 @@ + # mkerrcodes.awk + # Copyright (C) 2004, 2005, 2006 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the lisp source files that are the output + # of mkerrcodes.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkerrcodes.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkerrcodes.awk program. + # + # Certain portions of the mkerrcodes.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkerrcodes.awk. We call these the "data" portions. The rest of the + # mkerrcodes.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkerrcodes.awk never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkerrcodes.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkerrcodes.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # The input file is in the following format: + # [CODE SYMBOL...] + # @errnos@ + # [CODE SYMBOL...] + # + # The difference between the sections is how symbol is transformed. + # The second section gets GPG_ERR_ prepended before processing. + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. + + BEGIN { + FS="[ \t]+"; + print ";;;; Output of mkerrcodes.awk. DO NOT EDIT."; + print ""; + print ";;; Copyright (C) 2006 g10 Code GmbH"; + print ";;;"; + print ";;; This file is part of libgpg-error."; + print ";;;"; + print ";;; libgpg-error is free software; you can redistribute it and/or"; + print ";;; modify it under the terms of the GNU Lesser General Public License"; + print ";;; as published by the Free Software Foundation; either version 2.1 of"; + print ";;; the License, or (at your option) any later version."; + print ";;;"; + print ";;; libgpg-error is distributed in the hope that it will be useful, but"; + print ";;; WITHOUT ANY WARRANTY; without even the implied warranty of"; + print ";;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU"; + print ";;; Lesser General Public License for more details."; + print ";;;"; + print ";;; You should have received a copy of the GNU Lesser General Public"; + print ";;; License along with libgpg-error; if not, write to the Free"; + print ";;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA"; + print ";;; 02111-1307, USA."; + print ""; + + header = 1; + errnos = 0; + } + + /^#/ { next; } + + header { + if (errnos) + { + if ($1 ~ /^[0123456789]+$/) + { + header = 0; + + print ""; + print " ;; The following error codes map system errors."; + } + } + else + { + if ($1 ~ /^[0123456789]+$/) + { + header = 0; + + print "(in-package :gpg-error)"; + print ""; + print ";;; The error code type gpg-err-code-t."; + print ""; + print ";;; This is used for system error codes."; + print "(defconstant +gpg-err-system-error+ (ash 1 15))"; + print ""; + print ";;; This is one more than the largest allowed entry."; + print "(defconstant +gpg-err-code-dim+ 65536)"; + print ""; + print ";;; A helper macro to have the keyword values evaluated."; + print "(defmacro defcenum-eval (type doc &rest vals)"; + print " `(defcenum ,type ,doc"; + print " ,@(loop for v in vals"; + print " collect `(,(first v) ,(eval (second v))))))"; + print ""; + print "(defcenum-eval gpg-err-code-t"; + print " \"The GPG error code type.\""; + } + } + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + # The following can happen for GPG_ERR_CODE_DIM. + if ($1 == "") + next; + + if (/^@errnos@$/) + { + header = 1; + errnos = 1; + next; + } + + $2 = tolower($2); + gsub ("_", "-", $2); + + if (errnos) + print " (:gpg-err-" $2 " (logior +gpg-err-system-error+ " $1 "))"; + else + print " (:" $2 " " $1 ")"; + } + + END { + # I am very sorry to break lisp coding style here. + print ")"; + } +diff --git a/src/Makefile.am b/src/Makefile.am +index ce1b882..f2590cb 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -1,356 +1,356 @@ + # Makefile.am for libgpg-error. + # Copyright (C) 2003, 2004, 2014 g10 Code GmbH + # + # This file is part of libgpg-error. + # + # libgpg-error is free software; you can redistribute it and/or modify + # it under the terms of the GNU Lesser General Public License as + # published by the Free Software Foundation; either version 2.1 of the + # License, or (at your option) any later version. + # + # libgpg-error 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 Lesser General Public License for more details. + # + # You should have received a copy of the GNU Lesser General Public + # License along with this program; if not, see . + # SPDX-License-Identifier: LGPL-2.1+ + + + # + # We distribute the generated sources err-sources.h and err-codes.h, + # because they are needed to build the po directory, and they don't + # depend on the configuration anyway. + # + + if HAVE_W32CE_SYSTEM + gpg_extra_headers = gpg-extra/errno.h + extra_cppflags = -idirafter gpg-extra + else + gpg_extra_headers = + extra_cppflags = + endif + + localedir = $(datadir)/locale + + bin_PROGRAMS = gpg-error + + if HAVE_W32_SYSTEM + noinst_PROGRAMS = gen-w32-lock-obj + else + noinst_PROGRAMS = gen-posix-lock-obj + endif + + # Distributed lock object definitions for cross compilation. + lock_obj_pub = \ + syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.aarch64-unknown-linux-gnu_ilp32.h \ + syscfg/lock-obj-pub.aarch64-apple-darwin.h \ + syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \ + syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h \ + syscfg/lock-obj-pub.arm-apple-darwin.h \ + syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.i386-apple-darwin.h \ + syscfg/lock-obj-pub.i686-unknown-gnu.h \ + syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h \ + syscfg/lock-obj-pub.i686-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.mips-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \ + syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h \ + syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.riscv32-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.x86_64-apple-darwin.h \ + syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h \ + syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h \ + syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h \ + syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h \ + syscfg/lock-obj-pub.mingw32.h + + + lib_LTLIBRARIES = libgpg-error.la + nodist_include_HEADERS = gpg-error.h gpgrt.h + dist_bin_SCRIPTS = gpgrt-config + bin_SCRIPTS = gpg-error-config + m4datadir = $(datadir)/aclocal + m4data_DATA = gpg-error.m4 gpgrt.m4 + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = gpg-error.pc + + EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ + mkerrnos.awk errnos.in README \ + mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \ + mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \ + err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 gpgrt.m4 \ + gpg-error.vers gpg-error.def.in \ + versioninfo.rc.in gpg-error.w32-manifest.in \ + gpg-error-config-test.sh gpg-error.pc.in \ + $(lock_obj_pub) + + BUILT_SOURCES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h \ + code-to-errno.h code-from-errno.h \ + err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h gpgrt.h \ + gpg-error.def mkw32errmap.map.c + + tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c + + CLEANFILES = code-to-errno.h code-from-errno.h \ + gpg-error.h gpgrt.h \ + mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \ + mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ + gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \ + gpg-error-config gpg-error-config-test.log \ + $(tmp_files) lock-obj-pub.native.h + + MAINTAINERCLEANFILES = $(srcdir)/err-sources.h $(srcdir)/err-codes.h + + TESTS = gpg-error-config-test.sh + + # + # {{{ Begin Windows part + # + if HAVE_W32_SYSTEM + arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \ + w32-iconv.c w32-estream.c w32-reg.c spawn-w32.c + RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS) + LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) + + SUFFIXES = .rc .lo + + .rc.lo: + $(LTRCCOMPILE) -i "$<" -o "$@" + + gpg_error_res = versioninfo.lo + no_undefined = -no-undefined + export_symbols = -export-symbols gpg-error.def + # i686-w64-mingw32.gcc version 4.9.1 takes the long long helper + # functions from libgcc_s_sjlj-1.dll and not from a static libgcc. As + # a plain C program we do not use exception handler and thus there is + # no need to use this DLL. Thus we force gcc to link that statically. + extra_ltoptions = -XCClinker -static-libgcc + + versioninfo.lo : gpg-error.w32-manifest + + install-def-file: gpg-error.def + -$(INSTALL) -d $(DESTDIR)$(libdir) + $(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpg-error.def + + uninstall-def-file: + -rm $(DESTDIR)$(libdir)/gpg-error.def + + libgpg_error_la_DEPENDENCIES = $(gpg_error_res) gpg-error.def + intllibs = + socklibs = -lws2_32 + + # + # }}} End Windows part + # + else + # + # {{{ Begin Unix part + # + arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c spawn-posix.c + gpg_error_res = + no_undefined = + export_symbols = + extra_ltoptions = + + install-def-file: + uninstall-def-file: + + intllibs = @LTLIBINTL@ + socklibs = + + endif + # + # }}} End Unix part + # + + if HAVE_LD_VERSION_SCRIPT + libgpg_error_vers_opt = -Wl,--version-script=$(srcdir)/gpg-error.vers + else + libgpg_error_vers_opt = + endif + + libgpg_error_la_LDFLAGS = \ + $(no_undefined) $(export_symbols) $(libgpg_error_vers_opt) \ + $(extra_ltoptions) -version-info \ + @LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@ + + libgpg_error_la_SOURCES = gettext.h $(arch_sources) \ + gpgrt-int.h init.c init.h version.c lock.h thread.h \ + estream.c estream-printf.c estream-printf.h \ + strsource.c strerror.c code-to-errno.c code-from-errno.c \ + visibility.c visibility.h \ + sysutils.c \ + syscall-clamp.c \ + logging.c \ + b64dec.c b64enc.c \ + argparse.c + + + nodist_libgpg_error_la_SOURCES = gpg-error.h + + # libgpg_error_la_DEPENDENCIES = \ + # $(srcdir)/gpg-error.vers + + # Note that RCCOMPILE needs the same defines as ..._la_CPPFLAGS but + # without the extra_cppflags because they may include am -idirafter + # which is not supported by the RC compiler. + libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) + libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(socklibs) $(LIBTHREAD) + + gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c + gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \ + -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) + gpg_error_LDADD = libgpg-error.la $(LTLIBINTL) + + # We build err-sources.h and err-codes.h in the source directory. + # This is needed because gettext does only look into the source + # directory to find the files listed in po/POTFILE.in. To make these + # rules work we also need to depend on Makefile.am and not on the + # generated files Makefile.in or Makefile. + $(srcdir)/err-sources.h: Makefile.am mkstrtable.awk err-sources.h.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 \ + $(srcdir)/err-sources.h.in >$@ + + err-sources-sym.h: Makefile mkstrtable.awk err-sources.h.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ + $(srcdir)/err-sources.h.in >$@ + + $(srcdir)/err-codes.h: Makefile.am mkstrtable.awk err-codes.h.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 \ + $(srcdir)/err-codes.h.in >$@ + + err-codes-sym.h: Makefile mkstrtable.awk err-codes.h.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ + $(srcdir)/err-codes.h.in >$@ + + code-to-errno.h: Makefile mkerrnos.awk errnos.in + $(AWK) -f $(srcdir)/mkerrnos.awk $(srcdir)/errnos.in >$@ + + # It is correct to use $(CPP). We want the host's idea of the error codes. + mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers) + $(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@ + $(CPP) $(CPPFLAGS) $(extra_cppflags) -P _$@ | grep GPG_ERR_ | \ + $(AWK) -f $(srcdir)/mkerrcodes.awk >$@ + -rm _$@ + + if HAVE_W32CE_SYSTEM + # It is correct to use $(CPP). We want the host's idea of the error codes. + mkw32errmap.tab.h: Makefile mkw32errmap.c + $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \ + grep '{&mkw32errmap_marker' >$@ + mkw32errmap.map.c: mkw32errmap$(EXEEXT_FOR_BUILD) + ./mkw32errmap$(EXEEXT_FOR_BUILD) --map > $@ + gpg-extra/errno.h: mkw32errmap$(EXEEXT_FOR_BUILD) + -$(MKDIR_P) gpg-extra + ./mkw32errmap$(EXEEXT_FOR_BUILD) > $@ + else + mkw32errmap.map.c: + echo "/*dummy*/" > $@ + endif + + # We use CC proper for preprocessing thus we have to convince it that + # the data is really to be preprocessed. + gpg-error.def: Makefile gpg-error.def.in + cat $(srcdir)/gpg-error.def.in >_$@.h + $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) $(extra_cppflags) _$@.h | \ + grep -v '^#' >$@ + -rm _$@.h + + # It is correct to use $(CC_FOR_BUILD) here. We want to run the + # program at build time. + mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile + $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c + + if HAVE_W32CE_SYSTEM + # It is correct to use $(CC_FOR_BUILD) here. We want to run the + # program at build time. + mkw32errmap$(EXEEXT_FOR_BUILD): mkw32errmap.c mkw32errmap.tab.h Makefile + $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c + endif + + code-from-errno.h: mkerrcodes$(EXEEXT_FOR_BUILD) Makefile + ./mkerrcodes$(EXEEXT_FOR_BUILD) | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@ + + errnos-sym.h: Makefile mkstrtable.awk errnos.in + $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \ +- -v prefix=GPG_ERR_ -v namespace=errnos_ \ ++ -v prefix=GPG_ERR_ -v pkg_namespace=errnos_ \ + $(srcdir)/errnos.in >$@ + + + mkheader$(EXEEXT_FOR_BUILD): mkheader.c Makefile + $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c + + parts_of_gpg_error_h = \ + gpg-error.h.in \ + err-sources.h.in \ + err-codes.h.in \ + errnos.in \ + w32-add.h \ + w32ce-add.h \ + $(lock_obj_pub) + + # If we are cross-compiling or building on Windows we better make sure + # that no stale native lock include file will be found by mkheader. + if FORCE_USE_SYSCFG + pre_mkheader_cmds = if test -f lock-obj-pub.native.h; \ + then rm lock-obj-pub.native.h; fi + mkheader_opts = --cross + else + pre_mkheader_cmds = : + mkheader_opts = + parts_of_gpg_error_h += ./lock-obj-pub.native.h + + ./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h + ./gen-posix-lock-obj >$@ + endif + + # We also depend on versioninfo.rc because that is build by + # config.status and thus has up-to-date version numbers. + gpg-error.h: Makefile mkheader$(EXEEXT_FOR_BUILD) $(parts_of_gpg_error_h) \ + versioninfo.rc ../config.h + $(pre_mkheader_cmds) + ./mkheader$(EXEEXT_FOR_BUILD) $(mkheader_opts) \ + $(host_triplet) $(srcdir)/gpg-error.h.in \ + ../config.h $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@ + + gpgrt.h: gpg-error.h + cp gpg-error.h gpgrt.h + + gpg-error-config: gpgrt-config gpg-error-config-old + @echo $(ECHO_N) "Confirm gpg-error-config works... $(ECHO_C)" + @if $(srcdir)/gpg-error-config-test.sh --old-new; then \ + echo "good"; \ + else \ + echo "no"; \ + echo "*** Please report to with gpg-error-config-test.log"; \ + fi + cp gpg-error-config-old $@ + + install-data-local: + if HAVE_W32CE_SYSTEM + -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra" + $(INSTALL_DATA) gpg-extra/errno.h \ + "$(DESTDIR)$(includedir)/gpg-extra/errno.h" + else + : + endif +diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk +index 46d436c..e9c857c 100644 +--- a/src/mkerrcodes.awk ++++ b/src/mkerrcodes.awk +@@ -1,99 +1,99 @@ + # mkerrcodes.awk + # Copyright (C) 2004, 2005 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the C source files that are the output + # of mkerrcodes.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkerrcodes.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkerrcodes.awk program. + # + # Certain portions of the mkerrcodes.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkerrcodes.awk. We call these the "data" portions. The rest of the + # mkerrcodes.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkerrcodes.h never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkerrcodes.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkerrcodes.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # This script outputs an intermediate file that contains the following output: + # static struct + # { + # int err; + # const char *err_sym; + # } err_table[] = + # { + # { 7, "GPG_ERR_E2BIG" }, + # [...] + # }; + # + # The input file is a list of possible system errors, followed by a GPG_ERR_* name: + # + # 7 GPG_ERR_E2BIG + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. + + BEGIN { + FS="[ \t]+GPG_ERR_"; + print "/* Output of mkerrcodes.awk. DO NOT EDIT. */"; + print ""; + header = 1; + } + + /^#/ { next; } + + header { + if (! /^[ \t]*$/) + { + header = 0; + + print "static struct"; + print " {"; + print " int err;"; + print " const char *err_sym;"; + print " } err_table[] = "; + print "{"; + } + else + print; + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + print " { " $1 ", \"GPG_ERR_" $2 "\" },"; + } + + END { + print "};"; + } +diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk +index a771a73..4578e29 100644 +--- a/src/mkerrcodes1.awk ++++ b/src/mkerrcodes1.awk +@@ -1,96 +1,96 @@ + # mkerrcodes.awk + # Copyright (C) 2003, 2004 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the C source files that are the output + # of mkerrcodes.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkerrcodes.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkerrcodes.awk program. + # + # Certain portions of the mkerrcodes.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkerrcodes.awk. We call these the "data" portions. The rest of the + # mkerrcodes.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkerrcodes.h never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkerrcodes.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkerrcodes.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # This script outputs an intermediate file that contains the following block + # for each error value symbol in the input file (example for EINVAL): + # + # #ifdef EINVAL + # EINVAL GPG_ERR_EINVAL + # #endif + # + # The input file is a list of possible system errors in the column errnoidx + # (defaults to 2). + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. + + BEGIN { + FS="[\t]+"; + header = 1; + if (errnoidx == 0) + errnoidx = 2; + + print "/* Output of mkerrcodes.awk. DO NOT EDIT. */"; + print ""; + } + + /^#/ { next; } + + header { + if ($1 ~ /^[0-9]/) + { + print "#include "; + print "#ifdef _WIN32"; + print "#include "; + print "#endif"; + print ""; + header = 0; + } + else + print; + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + print "#ifdef " $errnoidx; + print $errnoidx "\tGPG_ERR_" $errnoidx; + print "#endif"; + print "#ifdef WSA" $errnoidx; + print "WSA" $errnoidx "\tGPG_ERR_" $errnoidx; + print "#endif"; + } +diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk +index ea58503..188f7a4 100644 +--- a/src/mkerrcodes2.awk ++++ b/src/mkerrcodes2.awk +@@ -1,134 +1,134 @@ + # mkstrtable.awk + # Copyright (C) 2003 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the C source files that are the output + # of mkerrcodes2.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkerrcodes2.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkerrcodes2.awk program. + # + # Certain portions of the mkerrcodes2.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkerrcodes2.awk. We call these the "data" portions. The rest of the + # mkerrcodes2.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkstrtable.h never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkerrcodes2.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkerrcodes2.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # This script outputs a source file that does define the following + # symbols: + # + # static const char msgstr[]; + # A string containing all messages in the list. + # + # static const int msgidx[]; + # A list of index numbers, one for each message, that points to the + # beginning of the string in msgstr. + # + # msgidxof (code); + # A macro that maps code numbers to idx numbers. If a DEFAULT MESSAGE + # is provided (see below), its index will be returned for unknown codes. + # Otherwise -1 is returned for codes that do not appear in the list. + # You can lookup the message with code CODE with: + # msgstr + msgidx[msgidxof (code)]. + # + # The input file has the following format: + # CODE1 MESSAGE1 (Code number, , message string) + # CODE2 MESSAGE2 (Code number, , message string) + # ... + # CODEn MESSAGEn (Code number, , message string) + # DEFAULT MESSAGE (, fall-back message string) + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. The last line is optional; if no DEFAULT + # MESSAGE is given, msgidxof will return the number -1 for unknown + # index numbers. + + BEGIN { + # msg holds the number of messages. + msg = 0; + print "/* Output of mkerrcodes2.awk. DO NOT EDIT. */"; + print ""; + header = 1; + } + + /^#/ { next; } + + header { + if ($1 ~ /^[0123456789]+$/) + { + print "static const int err_code_from_index[] = {"; + header = 0; + } + else + print; + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + # Print the string msgstr line by line. We delay output by one line to be able + # to treat the last line differently (see END). + print " " $2 ","; + + # Remember the error value and index of each error code. + code[msg] = $1; + pos[msg] = $2; + msg++; + } + END { + print "};"; + print ""; + print "#define errno_to_idx(code) (0 ? -1 \\"; + + # Gather the ranges. + skip = code[0]; + start = code[0]; + stop = code[0]; + for (i = 1; i < msg; i++) + { + if (code[i] == stop + 1) + stop++; + else + { + print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \ + skip ") \\"; + skip += code[i] - stop - 1; + start = code[i]; + stop = code[i]; + } + } + print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \ + skip ") \\"; + print " : -1)"; + } +diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk +index f79df66..15b1aad 100644 +--- a/src/mkerrnos.awk ++++ b/src/mkerrnos.awk +@@ -1,104 +1,104 @@ + # mkerrnos.awk + # Copyright (C) 2003, 2004 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the C source files that are the output + # of mkerrnos.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkerrnos.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkerrnos.awk program. + # + # Certain portions of the mkerrnos.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkerrnos.awk. We call these the "data" portions. The rest of the + # mkerrnos.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkerrnos.h never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkerrnos.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkerrnos.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # This script outputs a source file that does define the following + # symbols: + # + # static const int err_code_to_errno[]; + # A mapping of gpg_err_code_t numbers to system errno. The index of an + # error code in the table can be obtained after removing the system error + # code indication bit. + # + # The input file is a list of possible system errors in the column errnoidx + # (defaults to 2). + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. + + BEGIN { + FS="[\t]+"; + header = 1; + if (errnoidx == 0) + errnoidx = 2; + + print "/* Output of mkerrnos.awk. DO NOT EDIT. */"; + print ""; + } + + /^#/ { next; } + + header { + if ($1 ~ /^[0-9]/) + { + print "#include "; + print "#ifdef _WIN32"; + print "#include "; + print "#endif"; + print ""; + print "static const int err_code_to_errno [] = {"; + header = 0; + } + else + print; + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + print "#ifdef " $errnoidx; + print " " $errnoidx ","; + print "#else"; + print "#ifdef WSA" $errnoidx; + print " WSA" $errnoidx ","; + print "#else"; + print " 0,"; + print "#endif"; + print "#endif"; + } + END { + print "};"; + } +diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk +index c9de9c1..285e45f 100644 +--- a/src/mkstrtable.awk ++++ b/src/mkstrtable.awk +@@ -1,189 +1,189 @@ + # mkstrtable.awk + # Copyright (C) 2003, 2004, 2008 g10 Code GmbH + # + # This program 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 2 of + # the License, or (at your option) any later version. + # + # This program 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 this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + # + # As a special exception, g10 Code GmbH gives unlimited permission to + # copy, distribute and modify the C source files that are the output + # of mkstrtable.awk. You need not follow the terms of the GNU General + # Public License when using or distributing such scripts, even though + # portions of the text of mkstrtable.awk appear in them. The GNU + # General Public License (GPL) does govern all other use of the material + # that constitutes the mkstrtable.awk program. + # + # Certain portions of the mkstrtable.awk source text are designed to be + # copied (in certain cases, depending on the input) into the output of + # mkstrtable.awk. We call these the "data" portions. The rest of the + # mkstrtable.awk source text consists of comments plus executable code + # that decides which of the data portions to output in any given case. + # We call these comments and executable code the "non-data" portions. + # mkstrtable.h never copies any of the non-data portions into its output. + # + # This special exception to the GPL applies to versions of mkstrtable.awk + # released by g10 Code GmbH. When you make and distribute a modified version + # of mkstrtable.awk, you may extend this special exception to the GPL to + # apply to your modified version as well, *unless* your modified version + # has the potential to copy into its output some of the text that was the + # non-data portion of the version that you started with. (In other words, + # unless your change moves or copies text from the non-data portions to the + # data portions.) If your modification has such potential, you must delete + # any notice of this special exception to the GPL from your modified version. + + # This script outputs a source file that does define the following + # symbols: + # + # static const char msgstr[]; + # A string containing all messages in the list. + # + # static const int msgidx[]; + # A list of index numbers, one for each message, that points to the + # beginning of the string in msgstr. + # + # msgidxof (code); + # A macro that maps code numbers to idx numbers. If a DEFAULT MESSAGE + # is provided (see below), its index will be returned for unknown codes. + # Otherwise -1 is returned for codes that do not appear in the list. + # You can lookup the message with code CODE with: + # msgstr + msgidx[msgidxof (code)]. + # + # The input file has the following format: + # CODE1 ... MESSAGE1 (code nr, , something, , msg) + # CODE2 ... MESSAGE2 (code nr, , something, , msg) + # ... + # CODEn ... MESSAGEn (code nr, , something, , msg) + # ... DEFAULT-MESSAGE (, something, , fall-back msg) + # + # Comments (starting with # and ending at the end of the line) are removed, + # as is trailing whitespace. The last line is optional; if no DEFAULT + # MESSAGE is given, msgidxof will return the number -1 for unknown + # index numbers. + # + # The field to be used is specified with the variable "textidx" on + # the command line. It defaults to 2. + # + # The variable nogettext can be set to 1 to suppress gettext markers. + # + # The variable prefix can be used to prepend a string to each message. + # +-# The variable namespace can be used to prepend a string to each ++# The variable pkg_namespace can be used to prepend a string to each + # variable and macro name. + + BEGIN { + FS = "[\t]+"; + # cpos holds the current position in the message string. + cpos = 0; + # msg holds the number of messages. + msg = 0; + print "/* Output of mkstrtable.awk. DO NOT EDIT. */"; + print ""; + header = 1; + if (textidx == 0) + textidx = 2; + # nogettext can be set to 1 to suppress gettext noop markers. + } + + /^#/ { next; } + + header { + if ($1 ~ /^[0123456789]+$/) + { + print "/* The purpose of this complex string table is to produce"; + print " optimal code with a minimum of relocations. */"; + print ""; +- print "static const char " namespace "msgstr[] = "; ++ print "static const char " pkg_namespace "msgstr[] = "; + header = 0; + } + else + print; + } + + !header { +- sub (/\#.+/, ""); ++ sub (/#.+/, ""); + sub (/[ ]+$/, ""); # Strip trailing space and tab characters. + + if (/^$/) + next; + + # Print the string msgstr line by line. We delay output by one line to be able + # to treat the last line differently (see END). + if (last_msgstr) + { + if (nogettext) + print " \"" last_msgstr "\" \"\\0\""; + else + print " gettext_noop (\"" last_msgstr "\") \"\\0\""; + } + last_msgstr = prefix $textidx; + + # Remember the error code and msgidx of each error message. + code[msg] = $1; + pos[msg] = cpos; + cpos += length (last_msgstr) + 1; + msg++; + + if ($1 == "") + { + has_default = 1; + exit; + } + } + END { + if (has_default) + coded_msgs = msg - 1; + else + coded_msgs = msg; + + if (nogettext) + print " \"" last_msgstr "\";"; + else + print " gettext_noop (\"" last_msgstr "\");"; + print ""; +- print "static const int " namespace "msgidx[] ="; ++ print "static const int " pkg_namespace "msgidx[] ="; + print " {"; + for (i = 0; i < coded_msgs; i++) + print " " pos[i] ","; + print " " pos[coded_msgs]; + print " };"; + print ""; + print "static GPG_ERR_INLINE int"; +- print namespace "msgidxof (int code)"; ++ print pkg_namespace "msgidxof (int code)"; + print "{"; + print " return (0 ? 0"; + + # Gather the ranges. + skip = code[0]; + start = code[0]; + stop = code[0]; + for (i = 1; i < coded_msgs; i++) + { + if (code[i] == stop + 1) + stop++; + else + { + print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \ + skip ")"; + skip += code[i] - stop - 1; + start = code[i]; + stop = code[i]; + } + } + print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \ + skip ")"; + if (has_default) + print " : " stop + 1 " - " skip ");"; + else + print " : -1);"; + print "}"; + } diff --git a/SPECS/mingw-libgpg-error.spec b/SPECS/mingw-libgpg-error.spec new file mode 100644 index 0000000..4043fce --- /dev/null +++ b/SPECS/mingw-libgpg-error.spec @@ -0,0 +1,282 @@ +%?mingw_package_header + +Name: mingw-libgpg-error +Version: 1.36 +Release: 7%{?dist} +Summary: MinGW Windows GnuPGP error library + +License: LGPLv2+ +URL: ftp://ftp.gnupg.org/gcrypt/libgpg-error/ +Source0: ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-%{version}.tar.bz2 +Source1: ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-%{version}.tar.bz2.sig +Patch1: libgpg-error-1.29-multilib.patch +Patch2: libgpg-error-prepare-for-gawk-5.0.patch +BuildArch: noarch + +BuildRequires: make +BuildRequires: mingw32-filesystem >= 95 +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: mingw32-win-iconv +BuildRequires: mingw32-gettext + +BuildRequires: mingw64-filesystem >= 95 +BuildRequires: mingw64-gcc +BuildRequires: mingw64-binutils +BuildRequires: mingw64-win-iconv +BuildRequires: mingw64-gettext + +BuildRequires: gettext + +# See comment in %%prep for details +BuildRequires: libtool autoconf automake gettext-devel + + +%description +MinGW Windows GnuPGP error library. + + +%package -n mingw32-libgpg-error +Summary: MinGW Windows libgpg-error compression library for the win32 target + +%description -n mingw32-libgpg-error +MinGW Windows GnuPGP error library. + +%package -n mingw32-libgpg-error-static +Summary: Static library for mingw32-libgpg-error development +Requires: mingw32-libgpg-error = %{version}-%{release} + +%description -n mingw32-libgpg-error-static +Static library for mingw32-libgpg-error development. + +%package -n mingw64-libgpg-error +Summary: MinGW Windows libgpg-error compression library for the win64 target + +%description -n mingw64-libgpg-error +MinGW Windows GnuPGP error library. + +%package -n mingw64-libgpg-error-static +Summary: Static library for mingw64-libgpg-error development +Requires: mingw64-libgpg-error = %{version}-%{release} + +%description -n mingw64-libgpg-error-static +Static library for mingw64-libgpg-error development. + + +%?mingw_debug_package + + +%prep +%setup -q -n libgpg-error-%{version} +%patch1 -p1 -b .multilib +%patch2 -p1 -b .gawk-5.0 + +# Upstream has applied a libtool hack in libgpg-error 1.12 +# which automatically gives the libgpg-error library a +# different filename for the win64 target so that +# the libgpg-error DLL's for both the win32 and win64 +# targets can be installed in the same folder. +# +# As installing both win32 and win64 libraries in the same +# folder is bad practice and breaks earlier behavior undo +# this libtool hack here by re-running libtoolize +autoreconf -i --force + + +%build +%mingw_configure --enable-shared --enable-static +%mingw_make %{?_smp_mflags} + + +%install +%mingw_make_install DESTDIR=$RPM_BUILD_ROOT + +# Drop all .la files +find $RPM_BUILD_ROOT -name "*.la" -delete + +# Drop info and man pages as they're already provided by the native package +rm -rf $RPM_BUILD_ROOT%{mingw32_infodir} $RPM_BUILD_ROOT%{mingw32_mandir} +rm -rf $RPM_BUILD_ROOT%{mingw64_infodir} $RPM_BUILD_ROOT%{mingw64_mandir} + +%mingw_find_lang libgpg-error + + +%files -n mingw32-libgpg-error -f mingw32-libgpg-error.lang +%{mingw32_bindir}/gpg-error-config +%{mingw32_bindir}/gpgrt-config +%{mingw32_bindir}/gpg-error.exe +%{mingw32_bindir}/yat2m.exe +%{mingw32_bindir}/libgpg-error-0.dll +%{mingw32_libdir}/libgpg-error.dll.a +%{mingw32_libdir}/pkgconfig/gpg-error.pc +%{mingw32_includedir}/gpg-error.h +%{mingw32_includedir}/gpgrt.h +%{mingw32_datadir}/aclocal/gpg-error.m4 +%{mingw32_datadir}/aclocal/gpgrt.m4 +%{mingw32_datadir}/common-lisp/source/gpg-error/* +%{mingw32_datadir}/libgpg-error + +%files -n mingw32-libgpg-error-static +%{mingw32_libdir}/libgpg-error.a + +%files -n mingw64-libgpg-error -f mingw64-libgpg-error.lang +%{mingw64_bindir}/gpg-error-config +%{mingw64_bindir}/gpgrt-config +%{mingw64_bindir}/gpg-error.exe +%{mingw64_bindir}/yat2m.exe +%{mingw64_bindir}/libgpg-error-0.dll +%{mingw64_libdir}/libgpg-error.dll.a +%{mingw64_libdir}/pkgconfig/gpg-error.pc +%{mingw64_includedir}/gpg-error.h +%{mingw64_includedir}/gpgrt.h +%{mingw64_datadir}/aclocal/gpg-error.m4 +%{mingw64_datadir}/aclocal/gpgrt.m4 +%{mingw64_datadir}/common-lisp/source/gpg-error/* +%{mingw64_datadir}/libgpg-error + +%files -n mingw64-libgpg-error-static +%{mingw64_libdir}/libgpg-error.a + + +%changelog +* Mon Jan 15 2024 Arkady L. Shane - 1.36-7 +- Rebuilt for MSVSphere 9.3 + +* Thu Jan 20 2022 Fedora Release Engineering - 1.36-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 1.36-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 1.36-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 1.36-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 1.36-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Sep 23 2019 Fabiano FidĂȘncio - 1.36-2 +- Fix FTBFS errors due to new gawk, rhbz#1734862 + +* Tue Aug 13 2019 Fabiano FidĂȘncio - 1.36-1 +- Update the sources accordingly to its native counter part, rhbz#1740717 + +* Thu Jul 25 2019 Fedora Release Engineering - 1.31-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 1.31-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Aug 27 2018 Christophe Fergeau - 1.31-1 +- Update to 1.31 + +* Fri Jul 13 2018 Fedora Release Engineering - 1.22-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Feb 08 2018 Fedora Release Engineering - 1.22-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.22-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Sat May 07 2016 Erik van Pienbroek - 1.22-1 +- Update to 1.22 +- Fixes FTBFS + +* Thu Feb 04 2016 Fedora Release Engineering - 1.12-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.12-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Nov 20 2013 Erik van Pienbroek - 1.12-1 +- Update to 1.12 + +* Sat Aug 03 2013 Fedora Release Engineering - 1.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sun Jun 16 2013 Erik van Pienbroek - 1.11-1 +- Update to 1.11 +- Minor cleanups + +* Thu Feb 14 2013 Fedora Release Engineering - 1.10-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sun Oct 21 2012 Yaakov Selkowitz - 1.10-3 +- Add static libraries. + +* Fri Jul 20 2012 Fedora Release Engineering - 1.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Mar 10 2012 Erik van Pienbroek - 1.10-1 +- Update to 1.10 +- Added win64 support + +* Wed Mar 07 2012 Erik van Pienbroek - 1.6-17 +- Renamed the source package to mingw-libgpg-error (RHBZ #800913) +- Use mingw macros without leading underscore +- Dropped unneeded RPM tags +- Dropped .la files + +* Mon Feb 27 2012 Erik van Pienbroek - 1.6-16 +- Rebuild against the mingw-w64 toolchain +- Use correct .def file + +* Fri Jan 13 2012 Fedora Release Engineering - 1.6-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 1.6-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Oct 9 2009 Erik van Pienbroek - 1.6-13 +- Use %%global instead of %%define +- Automatically generate debuginfo subpackage + +* Sat Jul 25 2009 Fedora Release Engineering - 1.6-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 1.6-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 20 2009 Richard W.M. Jones - 1.6-10 +- Rebuild for mingw32-gcc 4.4 + +* Thu Jan 22 2009 Richard W.M. Jones - 1.6-9 +- Verify that we are still matching current native package. +- Use auto-buildrequires to identify more accurate list of BRs: + + BR gettext (for /usr/bin/msgfmt etc) + + BR mingw32-dlfcn + + BR mingw32-iconv +- Use _smp_mflags. +- Use find_lang. + +* Mon Sep 22 2008 Richard W.M. Jones - 1.6-8 +- Rename mingw -> mingw32. +- Depends on mingw-filesystem 27. + +* Mon Sep 22 2008 Daniel P. Berrange - 1.6-6 +- Added signature source file & correct URLs + +* Wed Sep 10 2008 Richard W.M. Jones - 1.6-5 +- Remove static libraries. + +* Fri Sep 5 2008 Daniel P. Berrange - 1.6-4 +- Add gettext support + +* Thu Sep 4 2008 Richard W.M. Jones - 1.6-3 +- Use mingw-filesystem RPM macros. +- BuildArch is noarch. + +* Tue Sep 2 2008 Daniel P. Berrange - 1.6-2 +- List files explicitly and use custom CFLAGS + +* Mon Jul 7 2008 Richard W.M. Jones - 1.6-1 +- Initial RPM release, largely based on earlier work from several sources.