From e840c2383394182b626c646115d7859b042a4158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 3 Apr 2019 13:44:23 +0200 Subject: Add argp-standalone --- argp-standalone/Makefile | 32 +++++++++ argp-standalone/patches/001-throw-in-funcdef.patch | 79 ++++++++++++++++++++++ argp-standalone/patches/002-gnu89-inline.patch | 22 ++++++ 3 files changed, 133 insertions(+) create mode 100644 argp-standalone/Makefile create mode 100644 argp-standalone/patches/001-throw-in-funcdef.patch create mode 100644 argp-standalone/patches/002-gnu89-inline.patch diff --git a/argp-standalone/Makefile b/argp-standalone/Makefile new file mode 100644 index 0000000..3fa7e52 --- /dev/null +++ b/argp-standalone/Makefile @@ -0,0 +1,32 @@ +# +## Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# # +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=argp-standalone +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=argp-standalone-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://www.lysator.liu.se/~nisse/misc +PKG_HASH:=dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be +PKG_BUILD_DIR:=$(BUILD_DIR)/argp-standalone-$(PKG_VERSION) +PKG_MAINTAINER:=CZ.NIC + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libargp.a $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/argp.h $(1)/usr/include/ +endef + +$(eval $(call Build/DefaultTargets)) diff --git a/argp-standalone/patches/001-throw-in-funcdef.patch b/argp-standalone/patches/001-throw-in-funcdef.patch new file mode 100644 index 0000000..4a90751 --- /dev/null +++ b/argp-standalone/patches/001-throw-in-funcdef.patch @@ -0,0 +1,79 @@ +# --- T2-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone +# Copyright (C) 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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. +# --- T2-COPYRIGHT-NOTE-END --- + + +No __THROW in function implementation. + --jsaw + +--- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 ++++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 +@@ -560,17 +560,17 @@ + # endif + + # ifndef ARGP_EI +-# define ARGP_EI extern __inline__ ++# define ARGP_EI extern inline + # endif + + ARGP_EI void +-__argp_usage (__const struct argp_state *__state) __THROW ++__argp_usage (__const struct argp_state *__state) + { + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); + } + + ARGP_EI int +-__option_is_short (__const struct argp_option *__opt) __THROW ++__option_is_short (__const struct argp_option *__opt) + { + if (__opt->flags & OPTION_DOC) + return 0; +@@ -582,7 +582,7 @@ + } + + ARGP_EI int +-__option_is_end (__const struct argp_option *__opt) __THROW ++__option_is_end (__const struct argp_option *__opt) + { + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; + } +--- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 ++++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 +@@ -1290,13 +1290,13 @@ + /* Defined here, in case a user is not inlining the definitions in + * argp.h */ + void +-__argp_usage (__const struct argp_state *__state) __THROW ++__argp_usage (__const struct argp_state *__state) + { + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); + } + + int +-__option_is_short (__const struct argp_option *__opt) __THROW ++__option_is_short (__const struct argp_option *__opt) + { + if (__opt->flags & OPTION_DOC) + return 0; +@@ -1310,7 +1310,7 @@ + } + + int +-__option_is_end (__const struct argp_option *__opt) __THROW ++__option_is_end (__const struct argp_option *__opt) + { + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; + } diff --git a/argp-standalone/patches/002-gnu89-inline.patch b/argp-standalone/patches/002-gnu89-inline.patch new file mode 100644 index 0000000..71978eb --- /dev/null +++ b/argp-standalone/patches/002-gnu89-inline.patch @@ -0,0 +1,22 @@ +diff --git a/configure.ac b/configure.ac +index 4658839..09f0267 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -79,16 +79,10 @@ AC_CHECK_DECLS([program_invocation_name, program_invocation_short_name], + + # Set these flags *last*, or else the test programs won't compile + if test x$GCC = xyes ; then +- # Using -ggdb3 makes (some versions of) Redhat's gcc-2.96 dump core +- if "$CC" --version | grep '^2\.96$' 1>/dev/null 2>&1; then +- true +- else +- CFLAGS="$CFLAGS -ggdb3" +- fi + CFLAGS="$CFLAGS -Wall -W \ + -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \ + -Waggregate-return \ +- -Wpointer-arith -Wbad-function-cast -Wnested-externs" ++ -Wpointer-arith -Wbad-function-cast -Wnested-externs -fgnu89-inline" + fi + + CPPFLAGS="$CPPFLAGS -I$srcdir" -- cgit v1.2.3