Send kea-dev mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.isc.org/mailman/listinfo/kea-dev
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of kea-dev digest..."
Today's Topics:
1. Re: Makefile.am guideline (Stephen Morris)
----------------------------------------------------------------------
Message: 1
Date: Mon, 14 Sep 2015 12:48:09 +0100
From: Stephen Morris <[email protected]>
To: Francis Dupont <[email protected]>
Cc: [email protected]
Subject: Re: [kea-dev] Makefile.am guideline
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
On 03/09/2015 13:24, Francis Dupont wrote:
> This is a proposal for a new Makefile.am section of coding guidelines.
>
> First when there is a least a subdirectory the SUBDIRS entry, e.g.:
> SUBDIRS = . tests
Suggest a slight rephrasing of this:
+++
If there is are one or more subdirectories, the first line in the file
should be the SUBDIRS entry, e.g.
SUBDIRS = . test
If relevant (as is usually the case), the current directory should be
included in the list at the appropriate point in the list.
---
> Followed by AM_CPPFLAGS set to source and build tree at the second level
> and external dependency includes and CPPFLAGS, e.g.:
> AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
> AM_CPPFLAGS += $(BOOST_INCLUDES)
Again, a slight rephrasing is suggested:
+++
Next should be the setting of the AM_CPPFLAGS, which applies to every
module built with C++ in the Makefile.am, e.g.
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES)
This can be overriden on a per-module basis in the file by specifying
the variable module_CPPFLAGS. (Note that if the CPPFLAGS environment
variable is set, its flags are appended to the command line after
AM_CPPFLAGS.)
---
> Directory variables should be relative (i.e., no abs_top_builddir)
> for efficiency.
[Question: why is this?]
> Third (or more) levels should not be used, e.g.:
Suggest: "To make the files easier to understand, third (or more) levels
should not be used, e.g."
> NO += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
>
> AM_CXXFLAGS should be initialized to KEA_CXXFLAGS, e.g.:
> AM_CXXFLAGS = $(KEA_CXXFLAGS)
I would add a sentence explaining the difference between the "CPPFLAGS"
and "CXXFLAGS" variables, as both end up on the C++ command line.
> When executables are build, AM_LDFLAGS must be conditionally set
> to static, e.g.:
> if USE_STATIC_LINK
> AM_LDFLAGS = -static
> endif
OK
> At the exception of archives, (dynamic) libraries and executables should
s/At the exception/With the exception/
> be linked with all dependencies in the opposite order of src/lib/Makefile.am
> for shared libraries (so finishing by libkea-exceptions.la) followed
> y external dependencies. The idea is to not rely on libtool which has
> shown some problems handling dependencies.
>
> Dynamic Shared Objects built as modules to be dynamically loaded must have
> no dependency when static linking is enforced: their undefined symbols
> should be resolved using executables they are loaded into.
>
> PS: please comment/improve if you think this should not go as it is
> into coding guidelines.
It's a good start. Let's put it in the coding guidelines. We can
always add to it/modify it as needed.
Stephen
------------------------------
_______________________________________________
kea-dev mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-dev
End of kea-dev Digest, Vol 18, Issue 4
**************************************