From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [1/1] civetweb: new package
Date: Tue, 27 Aug 2013 20:39:58 +0200 [thread overview]
Message-ID: <20130827203958.2de34c38@skate> (raw)
In-Reply-To: <CAG3-AMrakjHihP-_Zr7E4zX=BSs7Ym+Fc8HSVDbQbt11t4K0sQ@mail.gmail.com>
Dear Thomas Davis,
Thanks, this patch looks much better. Some comments below.
On Tue, 27 Aug 2013 13:57:01 -0400, Thomas Davis wrote:
> Submission attempt #2 with recommended changes.
>
> 1. Change make file ifdef's to ifeq.
> 2. Copyright lines removed to prevent confusion.
> 3. Put end of line in make file.
> 4. Submitted with git mail if it works, otherwise in plain text
> 5. Rebased, rebuilt and retested with buildroot.
>
> The explaination of BR2_TOOLCHAIN_BUILDROOT_UCLIBC check in
> Config.in was answered in a previous post. If that will
> always be included, I can remove the check.
>
> BTW: git --send-mail is not working for me. But I made sure this
> mail is in plain-text mode.
See
http://buildroot.org/downloads/manual/manual.html#_patch_revision_changelog
for details on how the commit log should be formatted. Essentially,
what you're missing is that the details of what changed between the
previous version should go below the "---" sign (or be part of a
separate cover letter). Everything that is before the "---" will be
part of the commit log for the eternity, and we don't want that. See
the documentation for details.
Also, you should use --subject-prefix="PATCHv2" when generating your
patches, so that the title of your patch makes it clear which version
we're looking at.
> diff --git a/package/civetweb/Config.in b/package/civetweb/Config.in
> new file mode 100644
> index 0000000..5285b09
> --- /dev/null
> +++ b/package/civetweb/Config.in
> @@ -0,0 +1,34 @@
> +config BR2_PACKAGE_CIVETWEB
> + bool "civetweb"
> + depends on BR2_TOOLCHAIN_BUILDROOT_UCLIBC && !BR2_PTHREADS_NONE
As Thomas said, this is not correct, as we don't want to prevent this
package from being built with an external toolchain, or a glibc
toolchain.
If what you want to express is that your package needs thread support,
then you should add a:
depends on BR2_TOOLCHAIN_HAS_THREADS
and that's it.
> + help
> + Full featured embedded web server with LUA support.
> +
> + https://sourceforge.net/projects/civetweb
> +
> +if BR2_PACKAGE_CIVETWEB
> +
> + config BR2_CIVETWEB_WITH_IPV6
> + bool "enable IPV6 support"
> + depends on BR2_INET_IPV6
We generally do not indent sub-configuration options.
I think this IPv6 option is not needed, the package should
automatically enable IPv6 support when BR2_INET_IPV6 is y.
> + config BR2_CIVETWEB_WITH_LUA
> + bool "enable LUA support"
> + depends on BR2_LARGEFILE # util-linux
Why are you adding this largefile dependency here? From where does the
reference to util-linux comes?
If this option needs the "lua" package to be built, then you need to
"select BR2_PACKAGE_LUA" in the Config.in file, and add "lua" to
CIVETWEB_DEPENDENCIES in your .mk file.
> + config BR2_CIVETWEB_WITH_SSL
> + bool "enable SSL support"
> + depends on BR2_PACKAGE_OPENSSL
We generally enable SSL support automatically when BR2_PACKAGE_OPENSSL
is enabled, so this option would not be necessary.
> +
> + comment "civetweb IPV6 support requires IPV6"
> + depends on !BR2_INET_IPV6
Not needed, as per the above.
> + comment "civetweb LUA support requires large file support"
> + depends on !BR2_LARGEFILE
Please answer the question above to decide what to do about this.
> + comment "civetweb SSL support requires OpenSSL"
> + depends on !BR2_PACKAGE_OPENSSL
Not needed, as per the above.
> +comment "civetweb requires a toolchain with PTHREAD support"
> + depends on !BR2_TOOLCHAIN_BUILDROOT_UCLIBC || BR2_PTHREADS_NONE
This should be:
comment "civetweb requires a toolchain with threads support"
depends on !BR2_TOOLCHAIN_HAS_THREADS
> diff --git a/package/civetweb/civetweb.mk b/package/civetweb/civetweb.mk
> new file mode 100644
> index 0000000..db14b2b
> --- /dev/null
> +++ b/package/civetweb/civetweb.mk
> @@ -0,0 +1,45 @@
> +################################################################################
> +#
> +# civetweb
> +#
> +################################################################################
> +
> +CIVETWEB_VERSION = 1.2
> +CIVETWEB_SOURCE = civetweb-$(CIVETWEB_VERSION).tar.gz
This line is not needed since this is the default.
> +CIVETWEB_SITE =
> http://github.com/sunsetbrew/civetweb/tarball/v$(CIVETWEB_VERSION)
You're not using git send-email: your patch has been line-wrapped by
your e-mail client, so it still cannot be applied as is.
> +CIVETWEB_LICENSE = MIT
> +CIVETWEB_LICENSE_FILES = LICENSE.md
> +
> +CIVETWEB_COPT = $(TARGET_CFLAGS)
> +CIVETWEB_MOPT = TARGET_OS=LINUX
We generally use something like CIVETWEB_CONF_OPT for the configuration
options.
> +CIVETWEB_LDFLAGS = $(TARGET_LDFLAGS)
> +
> +ifeq (BR2_PACKAGE_UTIL_LINUX_FALLOCATE,y)
Did you really test your package? This test is testing if the string
"BR2_PACKAGE_UTIL_LINUX_FALLOCATE" is equal to the string "y", so it
will always be false. Your tests should look like:
ifeq ($(BR2_....),y)
endif
see the thousands of examples available throughout the Buildroot source
code.
> + CIVETWEB_COPT += -DHAVE_POSIX_FALLOCATE=0
> +endif
However, this test is generally wrong. You're confusing the
availability of the 'fallocate' command line tool from the util-linux
package with the availability of the fallocate() system call.
I think you can pass -DHAVE_POSIX_FALLOCATE=1 in all cases: it's always
available in glibc/eglibc toolchain, and our default configuration for
uClibc enables fallocate() as well.
> +
> +ifeq (BR2_CIVETWEB_WITH_IPV6,y)
> + CIVETWEB_MOPT += WITH_IPV6=1
> +endif
This should be:
ifeq ($(BR2_INET_IPV6),y)
CIVETWEB_CONF_OPT += WITH_IPV6=1
endif
> +
> +ifeq (BR2_CIVETWEB_WITH_LUA,y)
> + CIVETWEB_MOPT += WITH_LUA=1
> +endif
Ditto. And it doesn't need the 'lua' package as a dependency?
> +ifeq (BR2_CIVETWEB_WITH_SSL,y)
> + CIVETWEB_COPT += -DNO_SSL_DL -lcrypt -lssl
> + CIVETWEB_DEPENDENCIES += openssl
> +else
> + CIVETWEB_COPT += -DNO_SSL
> +endif
Make this use BR2_PACKAGE_OPENSSL instead, as explained above.
> +
> +define CIVETWEB_BUILD_CMDS
> + $(MAKE) CC="$(TARGET_CC)" -C $(@D) all $(CIVETWEB_MOPT)
> COPT="$(CIVETWEB_COPT)"
> +endef
This is badly line-wrapped.
> +
> +define CIVETWEB_INSTALL_TARGET_CMDS
> + $(MAKE) CC="$(TARGET_CC)" -C $(@D) install
> DOCUMENT_ROOT=/usr/local/share/doc/civetweb
> PREFIX="$(TARGET_DIR)/usr/local" $(CIVETWEB_MOPT)
> COPT='$(CIVETWEB_COPT)'
> +endef
This is also badly line-wrapped. You should use $(TARGET_DIR)/usr as
the prefix, ditto for the documentation (and shouldn't DOCUMENT_ROOT
refer to $(TARGET_DIR) as well ?). Also, this line should be split:
define CIVETWEB_INSTALL_TARGET_CMDS
$(MAKE) CC="$(TARGET_CC)" -C $(@D) install \
DOCUMENT_ROOT=$(TARGET_DIR)/usr/share/doc/civetweb \
PREFIX=$(TARGET_DIR)/usr \
$(CIVETWEB_CONF_OPT) \
COPT="$(CIVETWEB_COPT)"
endef
> +
> +$(eval $(generic-package))
> +
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2013-08-27 18:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 17:57 [Buildroot] [1/1] civetweb: new package Thomas Davis
2013-08-27 18:39 ` Thomas Petazzoni [this message]
2013-08-27 18:54 ` Thomas Davis
2013-08-27 19:15 ` Thomas Petazzoni
2013-08-27 19:28 ` Thomas Davis
2013-08-27 20:50 ` Thomas Petazzoni
-- strict thread matches above, loose matches on Subject: below --
2013-08-27 13:32 Thomas Davis
2013-08-27 14:27 ` Thomas De Schampheleire
2013-08-27 14:29 ` Thomas Petazzoni
2013-08-27 14:56 ` Thomas Davis
[not found] ` <CAG3-AMraW=os9fWHuukfn_poxQvwPGJ7OGshb3y66TYdCgSVFA@mail.gmail.com>
2013-08-27 15:43 ` Thomas Petazzoni
2013-08-27 20:12 ` Thomas De Schampheleire
2013-08-27 20:51 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130827203958.2de34c38@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.