Skip to content

Commit

Permalink
pkg/relic: fix for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
smlng committed Nov 11, 2016
1 parent 742387a commit 386db3a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/relic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion pkg/relic/fix-old-style-definitions.sh
Original file line number Diff line number Diff line change
@@ -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) {/' {} +
8 changes: 7 additions & 1 deletion pkg/relic/fix-util_print_wo_args.sh
Original file line number Diff line number Diff line change
@@ -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' {} +

0 comments on commit 386db3a

Please sign in to comment.