From c3b3907298166ea00acbbe29fdbf5d05365c7e32 Mon Sep 17 00:00:00 2001 From: Manpreet Singh Date: Fri, 5 Oct 2012 19:51:05 -0700 Subject: [PATCH] FreeBSD/*BSD build fixes for wiggle attached and a bug To build wiggle on FreeBSD/*BSD/Mac a) endian.h must be included from machine/endian.h. b) A small fix to dotest is needed to avoid an infinite loop. c) bash may not always be at /usr/bin/bash Signed-off-by: NeilBrown --- config.h | 2 +- dotest | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.h b/config.h index c574f5f..ecf3411 100644 --- a/config.h +++ b/config.h @@ -2,7 +2,7 @@ /* Includes and defines for ccan files */ #if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) - #ifdef __APPLE__ + #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #include #else #include diff --git a/dotest b/dotest index 18fdf05..62ba094 100755 --- a/dotest +++ b/dotest @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Redirect for non-GNU time systems if [ "xx$TIME_CMD" = "xx" ] @@ -12,11 +12,11 @@ dir=$PWD while [ ! -f $dir/wiggle ] do - case $dir in - / ) echo >&2 Cannot find wiggle program : $WIGGLE - exit 1;; - * ) dir=${dir%/*} - esac + if [ -z "$dir" ]; then + echo >&2 Cannot find wiggle program : $WIGGLE + exit 1 + fi + dir=${dir%/*} done export WIGGLE=$dir/wiggle -- 2.39.5