On 10/04/10 09:35, Alon Bar-Lev wrote:
> Also there is no proper dependency for configure.h in Makefile.am so
> it won't be built.
> Proper way to do so is like I done for OpenSC [1], look for OPENSC_FEATURES.
> 
> [1] http://www.opensc-project.org/opensc/browser/trunk/configure.ac#L613

Thank you for catching this one.  I've obviously been too sloppy with
'make distcheck', which would have detected this one.

Even though I see you build up a string in configure.ac with enabled
features in your example [1], I personally feel that approach is less
flexible.  When this feature was implemented I considered that approach
as well, but I found it would require much more changes to configure.ac.
 It would also make it possible to skip listing enabled features, just
by forgetting to add the feature to the feature list.

The awk approach has the advantage of dynamically building up a list of
features found in ./config.h.  And in addition, the current
implementation also show which arguments was used with ./configure.

I've attached three patches, which cleans up this feature further.


kind regards,

David Sommerseth


> On Sat, Apr 10, 2010 at 10:05 AM, Alon Bar-Lev <alon.bar...@gmail.com> wrote:
>> Highly none standard autotools usage.
>> Also requires awk which may not be available.
>> Please REVERT.
>>
>> On Thu, Apr 8, 2010 at 10:44 PM, David Sommerseth
>> <openvpn.l...@topphemmelig.net> wrote:
> On 30/03/10 14:12, David Sommerseth wrote:
>>>>> This patch will create ./configure.h which will contain two new #define
>>>>> strings.  CONFIGURE_DEFINES will contain all USE, ENABLED, DISABLED and
>>>>> DEPRECATED defines from ./config.h.  CONFIGURE_CALL will contain the
>>>>> complete ./configure line which was used when configuring the package
>>>>> for building.
>>>>>
>>>>> Signed-off-by: David Sommerseth <d...@users.sourceforge.net>
>>>>> ---
>>>>>  Makefile.am       |    7 +++++++
>>>>>  configure_h.awk   |   39 +++++++++++++++++++++++++++++++++++++++
>>>>>  configure_log.awk |   36 ++++++++++++++++++++++++++++++++++++
>>>>>  options.c         |    3 +++
>>>>>  4 files changed, 85 insertions(+), 0 deletions(-)
>>>>>  create mode 100644 configure_h.awk
>>>>>  create mode 100644 configure_log.awk
> 
> Applied to the openvpn-testing.git feat_misc branch.  To be merged into
> allmerged soon.
> Commit f27bf509315a48b0070294c3993a718df0c2626c
> 
> 
> kind regards,
> 
> David Sommerseth
>>>
------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
>>>
>>

From c8b840a50a64dfd03bec3a7ed3beb486c3a55f90 Mon Sep 17 00:00:00 2001
From: David Sommerseth <d...@users.sourceforge.net>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Tue, 13 Apr 2010 15:07:51 +0200
Subject: [PATCH 1/3] Fix dependency checking for configure.h

Alon Bar-Lev indicated commit f27bf509315a48b0070294c3993a718df0c2626c
was missing proper dependency checking.  This patch corrects this and
fixes an issue when creating configure.h via make distcheck.

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>
---
 Makefile.am       |   10 +++++++---
 configure_log.awk |    8 ++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 20453d0..f509a4b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,7 +66,8 @@ dist_noinst_SCRIPTS = \
 	$(TESTS) \
 	doclean \
 	domake-win \
-	t_cltsrv-down.sh
+	t_cltsrv-down.sh \
+	configure_h.awk configure_log.awk
 
 dist_noinst_DATA = \
 	openvpn.spec \
@@ -141,9 +142,12 @@ openvpn_SOURCES = \
 	win32.h win32.c \
 	cryptoapi.h cryptoapi.c
 
+nodist_openvpn_SOURCES = configure.h
+options.$(OBJEXT): configure.h
+
 configure.h: Makefile
-	awk -f configure_h.awk config.h > $@
-	awk -f configure_log.awk config.log >> $@
+	awk -f $(srcdir)/configure_h.awk config.h > $@
+	awk -f $(srcdir)/configure_log.awk config.log >> $@
 
 clean-local:
 	-rm -f configure.h
diff --git a/configure_log.awk b/configure_log.awk
index b305f71..6245168 100644
--- a/configure_log.awk
+++ b/configure_log.awk
@@ -30,7 +30,11 @@
 BEGIN {
 	printf ("#define CONFIGURE_CALL \"")
 }
-/\$ .\/configure/ {
-	print $0,"\""
+/\$ (.).\/configure/ {
+	printf ("%s", $0)
 	exit 0
 }
+
+END {
+	printf ("\"\n")
+}
-- 
1.6.6.1

From a260aa387846e6f12db58d120e1d61ce4732b30e Mon Sep 17 00:00:00 2001
From: David Sommerseth <d...@users.sourceforge.net>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Tue, 13 Apr 2010 15:12:27 +0200
Subject: [PATCH 2/3] Make use of automake CLEANFILES variable instead of clean-local rule

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>
---
 Makefile.am |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f509a4b..76573d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,7 +38,7 @@ MAINTAINERCLEANFILES = \
 	$(srcdir)/depcomp $(srcdir)/aclocal.m4 \
 	$(srcdir)/config.guess $(srcdir)/config.sub \
 	$(srcdir)/config-win32.h $(srcdir)/openvpn.spec
-CLEANFILES = openvpn.8.html
+CLEANFILES = openvpn.8.html configure.h
 
 EXTRA_DIST = \
 	easy-rsa \
@@ -149,9 +149,6 @@ configure.h: Makefile
 	awk -f $(srcdir)/configure_h.awk config.h > $@
 	awk -f $(srcdir)/configure_log.awk config.log >> $@
 
-clean-local:
-	-rm -f configure.h
-
 dist-hook:
 	cd $(distdir) && for i in $(EXTRA_DIST) $(SUBDIRS) ; do find $$i -name .svn -type d -prune -exec rm -rf '{}' ';' ; rm -f `find $$i -type f | grep -E '(^|\/)\.?\#|\~$$|\.s?o$$'` ; done
 
-- 
1.6.6.1

From d940d655fd489ae1ec37ed7d4eabbdafb69fd6ca Mon Sep 17 00:00:00 2001
From: David Sommerseth <d...@users.sourceforge.net>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Tue, 13 Apr 2010 15:20:56 +0200
Subject: [PATCH 3/3] Don't add compile time information if --enable-small is used

This is to satisfy those wanting to build openvpn for embedded devices
where every bytes matters.

Signed-off-by: David Sommerseth <d...@users.sourceforge.net>
---
 options.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/options.c b/options.c
index 25936d1..1cfa11a 100644
--- a/options.c
+++ b/options.c
@@ -2752,8 +2752,10 @@ usage_version (void)
   msg (M_INFO|M_NOPREFIX, "%s", title_string);
   msg (M_INFO|M_NOPREFIX, "Originally developed by James Yonan");
   msg (M_INFO|M_NOPREFIX, "Copyright (C) 2002-2009 OpenVPN Technologies, Inc. <sa...@openvpn.net>");
+#ifndef ENABLE_SMALL
   msg (M_INFO|M_NOPREFIX, "\n%s\n", CONFIGURE_CALL);
   msg (M_INFO|M_NOPREFIX, "Compile time defines: %s", CONFIGURE_DEFINES);
+#endif
   openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
 }
 
-- 
1.6.6.1

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to