Skip to content

Commit

Permalink
scripts, lircmd.c, ir_remote_types.h: Darwin build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Andersen authored and leamas committed Apr 4, 2014
1 parent 671e819 commit 817815c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion autogen.sh
@@ -1,6 +1,6 @@
#! /bin/sh
rm -rf Makefile aclocal.m4 config.guess config.h.in* config.sub configure depcomp install-sh install.sh ltmain.sh missing autom4te.cache
find -name Makefile.in -exec rm {} \;
find . -name Makefile.in -exec rm {} \;
autoreconf -i -f

#depcom is not added to DIST_COMMON by the previous run of automake, strange
Expand Down
9 changes: 8 additions & 1 deletion daemons/input_map.sh
Expand Up @@ -3,7 +3,14 @@
TYPES="KEY BTN"
file=${1:-/usr/include/linux/input.h}

# Use gnu-sed on Macosx
if test `uname` == "Darwin"; then
SED=gsed
else
SED=sed
fi

for type in $TYPES; do
grep "^#define ${type}_" < $file|sort|sed -n --expression="s/^#define \([^ ]*\)[ ][ ]*\([0-9][0-9a-fA-FxX]*\).*/{\"\1\", \2},/p"
grep "^#define ${type}_" < $file|sort|$SED -n --expression="s/^#define \([^ ]*\)[ ][ ]*\([0-9][0-9a-fA-FxX]*\).*/{\"\1\", \2},/p"
done

13 changes: 13 additions & 0 deletions daemons/ir_remote_types.h
Expand Up @@ -14,7 +14,20 @@
#ifndef IR_REMOTE_TYPES_H
#define IR_REMOTE_TYPES_H

#if defined(__linux__)
#include <sys/types.h>
#else
#include <stdint.h>
typedef int8_t __s8;
typedef uint8_t __u8;
typedef int16_t __s16;
typedef uint16_t __u16;
typedef int32_t __s32;
typedef uint32_t __u32;
typedef int64_t __s64;
typedef uint64_t __u64;
#endif

#include <sys/time.h>
#include <unistd.h>
#include <string.h>
Expand Down
10 changes: 10 additions & 0 deletions daemons/lircmd.c
Expand Up @@ -35,6 +35,16 @@
#if defined(__linux__)
#include <linux/input.h>
#include <linux/uinput.h>
#else
#include <stdint.h>
typedef int8_t __s8;
typedef uint8_t __u8;
typedef int16_t __s16;
typedef uint16_t __u16;
typedef int32_t __s32;
typedef uint32_t __u32;
typedef int64_t __s64;
typedef uint64_t __u64;
#endif

#define CLICK_DELAY 50000 /* usecs */
Expand Down
13 changes: 10 additions & 3 deletions setup-functions.sh
@@ -1,3 +1,10 @@
# Use gnu-sed on Macosx
if test `uname` == "Darwin"; then
SED=gsed
else
SED=sed
fi

setup_seq_init() {
local INDEX=1
local N
Expand All @@ -24,7 +31,7 @@ query_setup_data() {
local INDEXES=""
local NAME
TEMP=$(mktemp /tmp/lirc.XXXXXXXXXX)
FULL_ENTRY=$(sed -n \
FULL_ENTRY=$($SED -n \
-e ': start' \
-e 's/\\[ ]*$//' \
-e 't more' \
Expand All @@ -37,7 +44,7 @@ query_setup_data() {
-e '/^[ ]*#/d' \
-e "/^$QUESTION:.* $DEVICE\>\([^-]\|$\)/,/^ *$/p" \
${SETUP_DATA})
HACKED_ENTRY=$(echo "$FULL_ENTRY" | sed \
HACKED_ENTRY=$(echo "$FULL_ENTRY" | $SED \
-e "/^$QUESTION:/d" \
-e '/^ *$/d' \
-e 's/^[ ]*//' \
Expand Down Expand Up @@ -142,7 +149,7 @@ EOF
fi
fi
echo -n 'LIRC_DRIVER='"${NAME}; "
if [ "$(expr length "$NAME")" -lt 8 ]; then
if [ ${#NAME} -lt 8 ]; then
echo -n " "
fi
echo 'DRIVER_PARAMETER='"$DEF_PARAM;" \
Expand Down

0 comments on commit 817815c

Please sign in to comment.