Message ID | 1352967920-3164-2-git-send-email-gregory.hermant@calao-systems.com |
---|---|
State | Superseded |
Headers | show |
On 15/11/12 09:25, Gregory Hermant wrote: > > Signed-off-by: Gregory Hermant<gregory.hermant@calao-systems.com> [snip] > + > +define SNOWBALL_HDMISERVICE_BUILD_CMDS > + $(MAKE) CC="$(TARGET_CC)" -C $(@D) > +endef I may have asked this before, but is there a reason to not pass buildroot's CFLAGS and LDFLAGS? We usually pass $(TARGET_CONFIGURE_OPTS) to sub-makes. [snip] Regards, Arnout
Arnout, Le 21/11/2012 07:51, Arnout Vandecappelle a écrit : > On 15/11/12 09:25, Gregory Hermant wrote: >> >> Signed-off-by: Gregory Hermant<gregory.hermant@calao-systems.com> > [snip] >> + >> +define SNOWBALL_HDMISERVICE_BUILD_CMDS >> + $(MAKE) CC="$(TARGET_CC)" -C $(@D) >> +endef > > I may have asked this before, but is there a reason to not pass buildroot's > CFLAGS and LDFLAGS? We usually pass $(TARGET_CONFIGURE_OPTS) to sub-makes. > > [snip] > The build of the hdmiservice.so fails if i pass the buildroot's LDFLAGS. > Regards, > Arnout > BR, gregory
On 22/11/12 13:35, Grégory Hermant wrote: > Arnout, > Le 21/11/2012 07:51, Arnout Vandecappelle a écrit : >> On 15/11/12 09:25, Gregory Hermant wrote: >>> >>> Signed-off-by: Gregory Hermant<gregory.hermant@calao-systems.com> >> [snip] >>> + >>> +define SNOWBALL_HDMISERVICE_BUILD_CMDS >>> + $(MAKE) CC="$(TARGET_CC)" -C $(@D) >>> +endef >> >> I may have asked this before, but is there a reason to not pass buildroot's >> CFLAGS and LDFLAGS? We usually pass $(TARGET_CONFIGURE_OPTS) to sub-makes. >> >> [snip] >> > The build of the hdmiservice.so fails if i pass the buildroot's LDFLAGS. It should be passed in the environment, not in the make argument list. Otherwise it will override the definition in the Makefile itself. A good Makefile appends to LDFLAGS passed in from the environment, but this is not always the case... Anyway the worst that can happen is that the LDFLAGS are just ignored. Regards, Arnout
Le 22/11/2012 15:00, Arnout Vandecappelle a écrit : > It should be passed in the environment, not in the make argument list. > Otherwise it will override the definition in the Makefile itself. > > A good Makefile appends to LDFLAGS passed in from the environment, but this > is not always the case... Anyway the worst that can happen is that the LDFLAGS > are just ignored. You mean that way: SNOWBALL_HDMISERVICE_MAKE_ENV = CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CCFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" $(SNOWBALL_HDMISERVICE_MAKE_ENV) $(MAKE) -C $(@D) BR, gregory
Dear Grégory Hermant, On Thu, 22 Nov 2012 18:33:05 +0100, Grégory Hermant wrote: > Le 22/11/2012 15:00, Arnout Vandecappelle a écrit : > > It should be passed in the environment, not in the make argument list. > > Otherwise it will override the definition in the Makefile itself. > > > > A good Makefile appends to LDFLAGS passed in from the environment, but this > > is not always the case... Anyway the worst that can happen is that the LDFLAGS > > are just ignored. > You mean that way: > > SNOWBALL_HDMISERVICE_MAKE_ENV = CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CCFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" > > $(SNOWBALL_HDMISERVICE_MAKE_ENV) $(MAKE) -C $(@D) No, just: $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) Thomas
Le 22/11/2012 18:45, Thomas Petazzoni a écrit : > Dear Grégory Hermant, > > On Thu, 22 Nov 2012 18:33:05 +0100, Grégory Hermant wrote: >> Le 22/11/2012 15:00, Arnout Vandecappelle a écrit : >>> It should be passed in the environment, not in the make argument list. >>> Otherwise it will override the definition in the Makefile itself. >>> >>> A good Makefile appends to LDFLAGS passed in from the environment, but this >>> is not always the case... Anyway the worst that can happen is that the LDFLAGS >>> are just ignored. >> You mean that way: >> >> SNOWBALL_HDMISERVICE_MAKE_ENV = CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CCFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" >> >> $(SNOWBALL_HDMISERVICE_MAKE_ENV) $(MAKE) -C $(@D) > No, just: > > $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) > > Thomas It doesn't work with this Makefile. Indeed if i use $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D), CC is set to the host gcc compiler. gregory
On 23/11/12 08:54, Grégory Hermant wrote: > Le 22/11/2012 18:45, Thomas Petazzoni a écrit : >> Dear Grégory Hermant, >> >> On Thu, 22 Nov 2012 18:33:05 +0100, Grégory Hermant wrote: >>> Le 22/11/2012 15:00, Arnout Vandecappelle a écrit : >>>> It should be passed in the environment, not in the make argument list. >>>> Otherwise it will override the definition in the Makefile itself. >>>> >>>> A good Makefile appends to LDFLAGS passed in from the environment, but this >>>> is not always the case... Anyway the worst that can happen is that the LDFLAGS >>>> are just ignored. >>> You mean that way: >>> >>> SNOWBALL_HDMISERVICE_MAKE_ENV = CC="$(TARGET_CC)" CCFLAGS="$(TARGET_CCFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" >>> >>> $(SNOWBALL_HDMISERVICE_MAKE_ENV) $(MAKE) -C $(@D) >> No, just: >> >> $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) >> >> Thomas > > It doesn't work with this Makefile. > > Indeed if i use $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D), CC is set to the host gcc compiler. Silly Makefile... You can do either: $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) CC="$(TARGET_CC)" or fix the Makefile in a patch. But if the Makefile overrides CC, it will most likely also override all the other stuff so passing TARGET_CONFIGURE_OPTS in the environment doesn't help much. What should be our philosophy for bad Makefiles? Fix the Makefile and try to upstream the patch, or just work around it in a package-specific way? We can actually work around it generically, using: $(MAKE) -C $(@D) CC="$(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" but I don't like forcing flags into the CC command. Regards, Arnout
diff --git a/package/Config.in b/package/Config.in index 074e9df..e9fd4a9 100644 --- a/package/Config.in +++ b/package/Config.in @@ -250,6 +250,7 @@ source "package/sane-backends/Config.in" source "package/sdparm/Config.in" source "package/setserial/Config.in" source "package/smartmontools/Config.in" +source "package/snowball-hdmiservice/Config.in" source "package/sredird/Config.in" source "package/statserial/Config.in" source "package/sysstat/Config.in" diff --git a/package/snowball-hdmiservice/Config.in b/package/snowball-hdmiservice/Config.in new file mode 100644 index 0000000..0ea7c81 --- /dev/null +++ b/package/snowball-hdmiservice/Config.in @@ -0,0 +1,10 @@ +config BR2_PACKAGE_SNOWBALL_HDMISERVICE + bool "snowball-hdmiservice" + depends on BR2_TOOLCHAIN_HAS_THREADS + help + HDMI userspace control daemon + + This package contains the HDMI userspace control daemon for the + snowball board + + http://www.igloocommunity.org diff --git a/package/snowball-hdmiservice/snowball-hdmiservice.mk b/package/snowball-hdmiservice/snowball-hdmiservice.mk new file mode 100644 index 0000000..fefa95d --- /dev/null +++ b/package/snowball-hdmiservice/snowball-hdmiservice.mk @@ -0,0 +1,41 @@ +############################################################# +# +# snowball-hdmiservice +# +############################################################# +SNOWBALL_HDMISERVICE_VERSION = f75c99d1c52707240a78b4ba78e41d20d3aa3b08 +SNOWBALL_HDMISERVICE_SITE = git://igloocommunity.org/git/bsp/hdmiservice.git +SNOWBALL_HDMISERVICE_LICENSE = MIT +SNOWBALL_HDMISERVICE_LICENSE_FILES = debian/copyright +SNOWBALL_HDMISERVICE_INSTALL_STAGING = YES + +define SNOWBALL_HDMISERVICE_BUILD_CMDS + $(MAKE) CC="$(TARGET_CC)" -C $(@D) +endef + +define SNOWBALL_HDMISERVICE_INSTALL_STAGING_CMDS + $(MAKE) CC="$(TARGET_CC)" -C $(@D) DESTDIR=$(STAGING_DIR) install +endef + +define SNOWBALL_HDMISERVICE_INSTALL_TARGET_CMDS + $(MAKE) CC="$(TARGET_CC)" -C $(@D) DESTDIR=$(TARGET_DIR) install +endef + +define SNOWBALL_HDMISERVICE_UNINSTALL_STAGING_CMDS + rm -f $(STAGING_DIR)/usr/lib/hdmiservice.so + rm -f $(STAGING_DIR)/usr/bin/hdmistart + rm -f $(STAGING_DIR)/usr/include/hdmi_service_api.h + rm -f $(STAGING_DIR)/usr/include/hdmi_service_local.h +endef + +define SNOWBALL_HDMISERVICE_UNINSTALL_TARGET_CMDS + rm -f $(TARGET_DIR)/usr/lib/hdmiservice.so + rm -f $(TARGET_DIR)/usr/bin/hdmistart +endef + +define SNOWBALL_HDMISERVICE_CLEAN_CMDS + $(MAKE) -C $(@D) clean +endef + + +$(eval $(generic-package))
Signed-off-by: Gregory Hermant <gregory.hermant@calao-systems.com> --- package/Config.in | 1 + package/snowball-hdmiservice/Config.in | 10 +++++ .../snowball-hdmiservice/snowball-hdmiservice.mk | 41 ++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 package/snowball-hdmiservice/Config.in create mode 100644 package/snowball-hdmiservice/snowball-hdmiservice.mk