-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·52 lines (44 loc) · 1.4 KB
/
configure
File metadata and controls
executable file
·52 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
function echoconf_mac {
cat << EOF
SRC+=src/osx-audio.c
CFLAGS+=`pkg-config --cflags libevent`
LDFLAGS+=-framework libspotify -levent -levent_pthreads -framework AudioToolbox
EOF
}
function echoconf_desktoplinux {
cat << EOF
SRC+=src/alsa-audio.c
CFLAGS+=`pkg-config --cflags libevent libevent_pthreads libspotify alsa`
LDFLAGS+=`pkg-config --libs libevent libevent_pthreads libspotify alsa`
EOF
}
function echoconf_beaglebone {
cat << EOF
SRC+=src/alsa-audio.c
CFLAGS+=`PKG_CONFIG_PATH=/usr/local/lib/ pkg-config --cflags libevent libevent_pthreads libspotify alsa`
LDFLAGS+=`PKG_CONFIG_PATH=/usr/local/lib/ pkg-config --libs libevent libevent_pthreads libspotify alsa`
EOF
}
function echoconf_chumby {
cat << EOF
SRC+=src/alsa-audio.c
CFLAGS=-I/home/pierre/work/perso/noisebox/chumby-buildroot/usr/local/include
LDFLAGS=-L/home/pierre/work/perso/noisebox/chumby-buildroot/usr/local/lib -lspotify -levent -levent_pthreads -lasound
EOF
}
function detect_platform {
while true ; do
UNAME="$(uname)"
[ "${UNAME}" = "Darwin" ] && { export PLATFORM=mac ; break ; }
PROC="$(uname -p)"
[ "${PROC}" = "x86_64" ] && { export PLATFORM=desktoplinux ; break ; }
HOSTNAME="$(uname -h)"
[ "${HOSTNAME}" = "beaglebone" ] && { export PLATFORM=beaglebone ; break ; }
PLATFORM=chumny
done
echo "Detected platform: " ${PLATFORM}
export PLATFORM
}
detect_platform || exit 1
echoconf_$PLATFORM > config.mk