Add pifmrds package
PATCH 1/2 Add pifmrds package
--- package/Config.in | 1 + package/pifmrds/Config.in | 9 +++++++++ package/pifmrds/pifmrds.mk | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 package/pifmrds/Config.in create mode 100644 package/pifmrds/pifmrds.mk
package/Config.in +1 -0
@@ -336,6 +336,7 @@ endif source "package/owl-linux/Config.in" source "package/parted/Config.in" source "package/pciutils/Config.in" + source "package/pifmrds/Config.in" source "package/picocom/Config.in" source "package/read-edid/Config.in" source "package/rng-tools/Config.in"
package/pifmrds/Config.in new file +9 -0
@@ -0,0 +1,9 @@ +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
package/pifmrds/pifmrds.mk new file +19 -0
@@ -0,0 +1,19 @@ +PIFMRDS_VERSION = c67306ea9b8d827f45e0d90279d367e97119bcb1 +PIFMRDS_SITE = $(call github,ChristopheJacquet,PiFmRds,$(PIFMRDS_VERSION)) +PIFMRDS_INSTALL_TARGET = YES +PIFMRDS_AUTORECONF = YES +PIFMRDS_DEPENDENCIES += libsndfile +PIFMRDS_LICENSE = GPLv3+ +PIFMRDS_LICENSE_FILES = LICENSE + +define PIFMRDS_BUILD_CMDS + $(MAKE) -C $(@D)/src CC=$(TARGET_CC) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS) -std=gnu99 -c" +endef + +define PIFMRDS_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/src/pi_fm_rds $(TARGET_DIR)/usr/bin/pi_fm_rds + $(INSTALL) -D -m 0755 $(@D)/src/rds_wav $(TARGET_DIR)/usr/bin/rds_wav + $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/pifmrds/ +endef + +$(eval $(generic-package))
Signature · 1 line
1.9.1
PATCH 2/2 Change Makefile into a crosscompile friendly version
--- ...ifmrds-000-Makefile-crosscompile-friendly.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +25 -0
@@ -0,0 +1,25 @@ +diff -purN PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile +--- PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-05-04 18:21:40.000000000 +0200 ++++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-06-19 21:21:14.220328601 +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 ++all: app rds_wav + + 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 +
Signature · 1 line
1.9.1
PATCH 2/2 Change Makefile into a crosscompile friendly version
Hi Eric,
If this patch fixes a build issue, then it should be squashed with the previous
patch. You can do that by doing 'git rebase -i origin/master' and then replacing the 'pick' of this patch with 'fixup'.
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch
Quoted 12 lines · Eric Limpens
Signed-off-by Eric Limpens <[email protected]>--- ...ifmrds-000-Makefile-crosscompile-friendly.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patchpackage/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +0
-0@@ -0,0 +1,25 @@
The patch should start with a description, like a normal commit message. This
description should also contain your Signed-off-by tag (its meaning is different because it implies publication under the upstream's GPLv3 license, not under buildroot's GPLv2 license).
Also, it would be good to upstream this patch.
Quoted 6 lines
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +6
-0+diff -purN PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile +--- PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-05-04 18:21:40.000000000 +0200 ++++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-06-19 21:21:14.220328601 +0200 +@@ -1,20 +1,8 @@ +-CC = gcc +-STD_CFLAGS = -Wall -std=gnu99 -c -g -O3
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch line 16
Quoted 10 lines
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +10
-0+- +-# 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 ++all: app rds_wav + + 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
Actually, moving this outside the condition and adding the 'all' target is all
that is really necessary to make cross-compilation possible. The rest maybe makes it nicer, but is not really necessary. It also won't be acceptable upstream because it makes native compilation more difficult.
Regards,
Arnout
Quoted 10 lines
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +9
-0+ +-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 +
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 2/2 Change Makefile into a crosscompile friendly version
Arnout, Eric, All,
On 2014-06-21 00:16 +0200, Arnout Vandecappelle spake thusly:
Quoted 3 lines
If this patch fixes a build issue, then it should be squashed with the previous
patch. You can do that by doing 'git rebase -i origin/master' and then replacing the 'pick' of this patch with 'fixup'.
Yep, Eric said on IRC he made a mistake when sending the patches.
Quoted 39 lines · Eric Limpens
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch
Quoted 12 lines
Signed-off-by Eric Limpens <[email protected]>--- ...ifmrds-000-Makefile-crosscompile-friendly.patch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patchpackage/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +0
-0@@ -0,0 +1,25 @@The patch should start with a description, like a normal commit message. This
description should also contain your Signed-off-by tag (its meaning is different because it implies publication under the upstream's GPLv3 license, not under buildroot's GPLv2 license).Also, it would be good to upstream this patch.
Quoted 6 lines
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +6
-0+diff -purN PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile +--- PiFmRds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-05-04 18:21:40.000000000 +0200 ++++ pifmrds-c67306ea9b8d827f45e0d90279d367e97119bcb1/src/Makefile 2014-06-19 21:21:14.220328601 +0200 +@@ -1,20 +1,8 @@ +-CC = gcc +-STD_CFLAGS = -Wall -std=gnu99 -c -g -O3package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch line 16
Quoted 10 lines
package/pifmrds/pifmrds-000-Makefile-crosscompile-friendly.patch new file +10
-0+- +-# 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 ++all: app rds_wav + + 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
Quoted 4 lines
Actually, moving this outside the condition and adding the 'all' target is all
that is really necessary to make cross-compilation possible. The rest maybe makes it nicer, but is not really necessary. It also won't be acceptable upstream because it makes native compilation more difficult.
I think we do not want the Makefile to override the CFLAGS. Buildroot already pases appropriate CFLAGS, and keeping the ones above would be only confusing, especially since it forces the float ABI and use of the VFP.
Maybe we should however carry the -ffast-math flag, however.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/2 Add pifmrds package
In reply to Eric LimpensHi Eric,
Thank you for your contribution. There are a few things that Yann missed in his
earlier review...
Quoted 14 lines · Eric Limpens
Signed-off-by Eric Limpens <[email protected]>--- package/Config.in | 1 + package/pifmrds/Config.in | 9 +++++++++ package/pifmrds/pifmrds.mk | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 package/pifmrds/Config.in create mode 100644 package/pifmrds/pifmrds.mkpackage/Config.in +0
-0
package/Config.in endif · line 340
Quoted 5 lines
package/Config.in +1
-0@@ -336,6 +336,7 @@ endif source "package/owl-linux/Config.in" source "package/parted/Config.in" source "package/pciutils/Config.in" + source "package/pifmrds/Config.in" source "package/picocom/Config.in"
We keep the Config.in entries alphabetical, so pifmrds should come after picocom.
Quoted 8 lines
package/Config.in +0
-0source "package/read-edid/Config.in" source "package/rng-tools/Config.in"package/pifmrds/Config.in new file +0
-0
package/pifmrds/Config.in line 9
Quoted 9 lines
package/pifmrds/Config.in new file +9
-0@@ -0,0 +1,9 @@ +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
When there is a toolchain dependency, there should also be a comment when the
dependency is not met:
comment "pifmrds needs a toolchain w/ largefile"
depends on !BR2_LARGEFILE
(cfr. http://buildroot.org/downloads/manual/manual.html#depends-on-vs-select )
package/pifmrds/pifmrds.mk line 3
Quoted 9 lines
package/pifmrds/pifmrds.mk new file +3
-0@@ -0,0 +1,19 @@ +PIFMRDS_VERSION = c67306ea9b8d827f45e0d90279d367e97119bcb1 +PIFMRDS_SITE = $(call github,ChristopheJacquet,PiFmRds,$(PIFMRDS_VERSION)) +PIFMRDS_INSTALL_TARGET = YES
This is the default so not necessary.
package/pifmrds/pifmrds.mk line 4
Quoted 1 line
package/pifmrds/pifmrds.mk new file +1
-0+PIFMRDS_AUTORECONF = YES
Since it's a generic package, not an autotools package, this is pointless.
package/pifmrds/pifmrds.mk line 5
Quoted 1 line
package/pifmrds/pifmrds.mk new file +1
-0+PIFMRDS_DEPENDENCIES += libsndfile
Minor: we usually don't use += here.
package/pifmrds/pifmrds.mk line 10
Quoted 5 lines
package/pifmrds/pifmrds.mk new file +5
-0+PIFMRDS_LICENSE = GPLv3+ +PIFMRDS_LICENSE_FILES = LICENSE + +define PIFMRDS_BUILD_CMDS + $(MAKE) -C $(@D)/src CC=$(TARGET_CC) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS) -std=gnu99 -c"
There should be quotes around $(TARGET_CC) because it may contain ccache.
The line is a bit too long, better split it.
package/pifmrds/pifmrds.mk line 16
Quoted 6 lines
package/pifmrds/pifmrds.mk new file +6
-0+endef + +define PIFMRDS_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/src/pi_fm_rds $(TARGET_DIR)/usr/bin/pi_fm_rds + $(INSTALL) -D -m 0755 $(@D)/src/rds_wav $(TARGET_DIR)/usr/bin/rds_wav + $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/pifmrds/
If you're not copying anything into that directory, why do you create it?
Regards,
Arnout
Quoted 4 lines
package/pifmrds/pifmrds.mk new file +3
-0+endef + +$(eval $(generic-package))
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F