From 6908f1707eb8fcabfd2352dbd17ecf3f43b84be8 Mon Sep 17 00:00:00 2001 From: smlng Date: Thu, 10 Nov 2016 16:21:01 +0100 Subject: [PATCH] pkg/relic: fix for macOS --- pkg/relic/Makefile | 2 ++ pkg/relic/fix-old-style-definitions.sh | 8 +++++++- pkg/relic/fix-util_print_wo_args.sh | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pkg/relic/Makefile b/pkg/relic/Makefile index 5e866958a7bab..32a4a89d0c0cd 100644 --- a/pkg/relic/Makefile +++ b/pkg/relic/Makefile @@ -19,6 +19,8 @@ $(PKG_BUILDDIR)/comp-options.cmake: fix_source $(PKG_BUILDDIR)/Makefile: $(PKG_BUILDDIR)/comp-options.cmake cd "$(PKG_BUILDDIR)" && COMP="$(filter-out -Werror=old-style-definition -Werror=strict-prototypes, $(CFLAGS) ) " cmake -DCMAKE_TOOLCHAIN_FILE=comp-options.cmake -DCHECK=off -DTESTS=0 -DBENCH=0 -DSHLIB=off -Wno-dev $(RELIC_CONFIG_FLAGS) . +CFLAGS += -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-function + fix_source: git-download ./fix-util_print_wo_args.sh $(PKG_BUILDDIR) ./fix-old-style-definitions.sh $(PKG_BUILDDIR) diff --git a/pkg/relic/fix-old-style-definitions.sh b/pkg/relic/fix-old-style-definitions.sh index 36d9f1494cb40..a68760f26bff8 100755 --- a/pkg/relic/fix-old-style-definitions.sh +++ b/pkg/relic/fix-old-style-definitions.sh @@ -1,2 +1,8 @@ #!/bin/sh -find ${1} -name "*.[ch]" | xargs sed -i 's/() {/(void) {/' +OSNAME=`uname -s` +SEDCMD="sed -i" +if [ "${OSNAME}" = "Darwin" ] ; then + SEDCMD="sed -i ''" + LANG=C +fi +find ${1} -name "*.[ch]" -exec $SEDCMD 's/() {/(void) {/' {} + diff --git a/pkg/relic/fix-util_print_wo_args.sh b/pkg/relic/fix-util_print_wo_args.sh index 91a5b4c6ef25e..319316d49fb6f 100755 --- a/pkg/relic/fix-util_print_wo_args.sh +++ b/pkg/relic/fix-util_print_wo_args.sh @@ -1,2 +1,8 @@ #!/bin/sh -find ${1} -name "*.[ch]" | xargs sed -i 's/util_print("\(.*\)")/util_print("\1", NULL)/g' +OSNAME=`uname -s` +SEDCMD="sed -i" +if [ "${OSNAME}" = "Darwin" ] ; then + SEDCMD="sed -i ''" + LANG=C +fi +find ${1} -type f -name "*.[ch]" -exec $SEDCMD 's/util_print("\(.*\)")/util_print("\1", NULL)/g' {} +