Commit 39ae2a31 authored by Eric Limpens's avatar Eric Limpens Committed by Thomas Petazzoni
Browse files

package/pifmrds: new package



We needs three little patches:
  - one to make the existing Makefile cross-compile friendly
  - one to pass the LDFLAGS at link time
  - one to add a missing include

[Thomas: add missing 'depends on BR2_arm' in comment, renumber patches
to start at 0001 and not 0000.]

Signed-off-by: default avatarEric Limpens <limpens@gmail.com>
[yann.morin.1998@free.fr: add .mk header; cleanup and split the
 Makefile patch, add missing include; add comments to all patches]
Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
parent a8139d54
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ endif
	source "package/parted/Config.in"
	source "package/pciutils/Config.in"
	source "package/picocom/Config.in"
	source "package/pifmrds/Config.in"
	source "package/read-edid/Config.in"
	source "package/rng-tools/Config.in"
	source "package/rpi-userland/Config.in"
+13 −0
Original line number Diff line number Diff line
config BR2_PACKAGE_PIFMRDS
	bool "pifmrds"
	depends on BR2_arm
	depends on BR2_LARGEFILE # libsndfile
	select BR2_PACKAGE_LIBSNDFILE
	help
	  pifmrds, FM-RDS transmitter using the Raspberry Pi's PWM

	  https://github.com/ChristopheJacquet/PiFmRds

comment "pifmrds needs a toolchain w/ largefile"
	depends on BR2_arm
	depends on !BR2_LARGEFILE
+37 −0
Original line number Diff line number Diff line
Makefile: make it cross-compile (and Buildroot) friendly.

The current Makefile makes heavy assumptions that it is doing native
compilation on the RPi, as it checks that `uname -m` is an ARM machine.

This is wrong in the cross-compilation case.

Remove the conditional altogether, and do not override the CFLAGS
as passed in the environment (Buildroot passes proper CFLAGS).

[intial patch by: Eric Limpens <limpens@gmail.com>]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

diff -durN pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile
--- pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile	2014-05-04 18:21:40.000000000 +0200
+++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile	2014-06-21 16:38:31.971804343 +0200
@@ -1,20 +1,8 @@
 CC = gcc
-STD_CFLAGS = -Wall -std=gnu99 -c -g -O3
 
-# Enable ARM-specific options only on ARM, and compilation of the app only on ARM
-UNAME := $(shell uname -m)
-
-ifeq ($(UNAME), armv6l)
-	CFLAGS = $(STD_CFLAGS) -march=armv6 -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math
-
 app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o
 	$(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile
 
-else
-	CFLAGS = $(STD_CFLAGS)
-endif
-
-
 rds_wav: rds.o waveforms.o rds_wav.o fm_mpx.o
 	$(CC) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile
 
+20 −0
Original line number Diff line number Diff line
Makefile: use LDFLAGS when linking

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

diff -durN pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile
--- pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/Makefile	2014-06-21 16:46:49.101118754 +0200
+++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile	2014-06-21 16:47:47.801745683 +0200
@@ -1,10 +1,10 @@
 CC = gcc
 
 app: rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o
-	$(CC) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile
+	$(CC) $(LDFLAGS) -o pi_fm_rds rds.o waveforms.o pi_fm_rds.o fm_mpx.o control_pipe.o -lm -lsndfile
 
 rds_wav: rds.o waveforms.o rds_wav.o fm_mpx.o
-	$(CC) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile
+	$(CC) $(LDFLAGS) -o rds_wav rds_wav.o rds.o waveforms.o fm_mpx.o -lm -lsndfile
 
 rds.o: rds.c waveforms.h
 	$(CC) $(CFLAGS) rds.c
+17 −0
Original line number Diff line number Diff line
rds_wav: add missign include for strcmp()

strcmp() is declared in string.h, so include it.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

diff -durN pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/rds_wav.c pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/rds_wav.c
--- pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1.orig/src/rds_wav.c	2014-05-04 18:21:40.000000000 +0200
+++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/rds_wav.c	2014-06-21 17:39:22.999128453 +0200
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <math.h>
 #include <sndfile.h>
+#include <string.h>
 
 #include "rds.h"
 #include "fm_mpx.h"
Loading