On Tue, Jan 23, 2007 at 11:40:19AM +0000, Thorsten Glaser wrote:
> We already have
> | ifeq ($(FWRT_PACKAGE_$(1)),y)
> in the template, but this is seemingly not used at the moment.
> This did what could fix this "mess", and I know how to reactivate
> it, but then, nobody could build packages manually without going
> through a menuconfig -> split cycle any more.

Yes, I saw this dependency. And I intentionally left it out of this
discussion.

> Now I could reactivate that, and we change every Makefile:
> -$(eval $(call PKG_template,MKSH,mksh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
> +$(eval $(call PKG_template,y,mksh,${PKG_VERSION}-${PKG_RELEASE},${ARCH}))
> and set FWRT_PACKAGE_y=y, and in your asterisk case, you would have
> | $(eval $(call 
> PKG_template,y,asterisk,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
> | $(eval $(call 
> PKG_template,ASTERISK_PGSQL,asterisk-pgsql,$(PKG_VERSION)-$(PKG_RELEASE),
> | $(eval $(call 
> PKG_template,ASTERISK_SQLITE,asterisk-sqlite,$(PKG_VERSION)-$(PKG_RELEASE
> | [???]
> i.e. the 'y' only for the first package.

You're sure this is how the dependency mentioned above ought to be used?
Doesn't it rather decide whether a package should be installed into the
rootfs image?
Rewriting all calls to PKG_template is not acceptable. This is why I
suggested a solution where only the template has to be changed, and only
internally.

> An alternative solution:
> - ifeq ($(FWRT_PACKAGE_$(1)),y)
> + ifneq (${FWRT_PACKAGE_$(1)}${DEVELOPER},)

This is about what I want to have, but best defined as make function, so
one doesn't have to type so much, and it's easy to remember.

Please note that the problem is merely missing control over what
sub-packages are build when using 'package=foobar', but rather that it
doesn't fit together. If I do sub-package specific stuff in the
makefile, I have to rely on the corresponding PKG_template to not shoot
me in the foot. Or in other words, if according to config symbols
asterisk is built without PostgreSQL support, the asterisk-pgsql package
must not be created.

This is the jumping point (taken from mk/package.mk):
| ifneq ($(FWRT_PACKAGE_$(1)),)
| compile-targets: $$(IPKG_$(1))
| endif
| ifneq ($(DEVELOPER),)
| compile-targets: $$(IPKG_$(1))
| endif
| ifeq ($(FWRT_PACKAGE_$(1)),y)
| install-targets: $$(INFO_$(1))
| endif

after having read it so many times, seems like I finally understood what
it does. Basically, this is what I want to have in the package makefile.
I.e. say, there is some sort of critical section, like installation of
files into a sub-package installdir. Then by defining a block around it
like the statements above, the package will be built when either:
* $(FWRT_PACKAGE_$(1)) is defined (i.e., the package config symbol (e.g.
  FWRT_PACKAGE_ASTERISK_CODEC_GSM) is "m" _or_ "y")
* $(DEVELOPER) is non-empty (this is set when one uses 'package=foobar'
  to build something (could also be used for snapshot-builds))
or both, of course.

BTW: I had my problems with asterisk also when using just 'make', so
it's not a problem of building with 'package=asterisk'!

Greetings, Phil

_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to