From 3273dd04785f2aed27c139ba4acc7ce1d3ed0a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=A2=D0=B0=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D0=BE=D0=B2?= Date: Sat, 7 Dec 2019 15:14:08 +0300 Subject: [PATCH] Ports: Add m4 port (#856) --- Ports/m4/package.sh | 5 +++++ Ports/m4/patches/configure.patch | 14 ++++++++++++++ Ports/m4/patches/wint_t.patch | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100755 Ports/m4/package.sh create mode 100644 Ports/m4/patches/configure.patch create mode 100644 Ports/m4/patches/wint_t.patch diff --git a/Ports/m4/package.sh b/Ports/m4/package.sh new file mode 100755 index 0000000000..3dd20f05d7 --- /dev/null +++ b/Ports/m4/package.sh @@ -0,0 +1,5 @@ +#!/bin/bash ../.port_include.sh +port=m4 +version=1.4.9 +useconfigure=true +files="http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz m4-1.4.9.tar.gz" diff --git a/Ports/m4/patches/configure.patch b/Ports/m4/patches/configure.patch new file mode 100644 index 0000000000..d99a9c9af0 --- /dev/null +++ b/Ports/m4/patches/configure.patch @@ -0,0 +1,14 @@ +diff --git a/config.sub b/config.sub +index 5defff6..040fb4b 100755 +--- a/config.sub ++++ b/config.sub +@@ -1222,7 +1222,8 @@ case $os in + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ +- | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) ++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* \ ++ | -serenity*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) diff --git a/Ports/m4/patches/wint_t.patch b/Ports/m4/patches/wint_t.patch new file mode 100644 index 0000000000..1292e77f7f --- /dev/null +++ b/Ports/m4/patches/wint_t.patch @@ -0,0 +1,29 @@ +diff --git a/lib/printf-args.c b/lib/printf-args.c +index 2259d53..5318bcc 100644 +--- a/lib/printf-args.c ++++ b/lib/printf-args.c +@@ -80,10 +80,7 @@ printf_fetchargs (va_list args, arguments *a) + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ +- ap->a.a_wide_char = +- (sizeof (wint_t) < sizeof (int) +- ? va_arg (args, int) +- : va_arg (args, wint_t)); ++ ap->a.a_wide_char = va_arg (args, int); + break; + #endif + case TYPE_STRING: +diff --git a/lib/printf-args.h b/lib/printf-args.h +index 74a18d9..acc37f5 100644 +--- a/lib/printf-args.h ++++ b/lib/printf-args.h +@@ -98,7 +98,7 @@ typedef struct + #endif + int a_char; + #if HAVE_WINT_T +- wint_t a_wide_char; ++ int a_wide_char; + #endif + const char* a_string; + #if HAVE_WCHAR_T