Re: [Openvpn-devel] [PATCH 28/52] build: remove awk and non-standard autoconf output processing

2012-03-08 Thread Samuli Seppänen
This looks ok. If I understood it correctly, earlier the Makefile called 
configure_h.awk to parse config.h to generate configure.h. This configure.h 
file contained only two defines:

#define CONFIGURE_DEFINES " ENABLE_CLIENT_SERVER ENABLE_DEBUG ENABLE_EUREPHIA 
..."
#define CONFIGURE_CALL "  $ ./configure "

This patch removes configure_h.awk and thus phases out configure.h. After this 
change CONFIGURE_DEFINES is generated using this method:

CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"

This should be safe if running "set" does not produce output that would match 
the regexps without being related to the OpenVPN builds. Given that the regexps 
are very strictly defined, that doesn't sound likely.

I give this one an ACK. Please NACK if you disagree :).

-- 
Samuli Seppänen
Community Manager
OpenVPN Technologies, Inc

irc freenode net: mattock


> Replace with simpler environment solution.
>
> Signed-off-by: Alon Bar-Lev 
> ---
>  Makefile.am   |   12 ++--
>  configure.ac  |3 +++
>  configure_h.awk   |   39 ---
>  configure_log.awk |   33 -
>  options.c |4 
>  5 files changed, 5 insertions(+), 86 deletions(-)
>  delete mode 100644 configure_h.awk
>  delete mode 100644 configure_log.awk
>
> diff --git a/Makefile.am b/Makefile.am
> index 6c0b2b4..a8ff457 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -36,7 +36,7 @@ MAINTAINERCLEANFILES = \
>   $(srcdir)/depcomp $(srcdir)/aclocal.m4 \
>   $(srcdir)/config.guess $(srcdir)/config.sub \
>   $(srcdir)/openvpn.spec
> -CLEANFILES = openvpn.8.html configure.h
> +CLEANFILES = openvpn.8.html
>  
>  EXTRA_DIST = \
>   sample-config-files \
> @@ -57,8 +57,7 @@ dist_doc_DATA = \
>  
>  dist_noinst_SCRIPTS = \
>   $(TESTS) \
> - t_cltsrv-down.sh \
> - configure_h.awk configure_log.awk
> + t_cltsrv-down.sh
>  
>  dist_doc_DATA = \
>   COPYRIGHT.GPL \
> @@ -156,13 +155,6 @@ openvpn_SOURCES = \
>   win32.h win32.c \
>   cryptoapi.h cryptoapi.c
>  
> -nodist_openvpn_SOURCES = configure.h
> -options.$(OBJEXT): configure.h
> -
> -configure.h: Makefile
> - awk -f $(srcdir)/configure_h.awk config.h > $@
> - awk -f $(srcdir)/configure_log.awk config.log >> $@
> -
>  if WIN32
>  dist_noinst_DATA += openvpn.8
>  nodist_html_DATA = openvpn.8.html
> diff --git a/configure.ac b/configure.ac
> index 81bf933..0b70325 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -913,6 +913,9 @@ if test "${enable_strict}" = "yes"; then
>   CFLAGS="${CFLAGS} -Wall -Wno-unused-parameter -Wno-unused-function"
>  fi
>  
> +CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
> +AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], 
> [Configuration settings])
> +
>  TAP_WIN_COMPONENT_ID="PRODUCT_TAP_WIN_COMPONENT_ID"
>  TAP_WIN_MIN_MAJOR="PRODUCT_TAP_WIN_MIN_MAJOR"
>  TAP_WIN_MIN_MINOR="PRODUCT_TAP_WIN_MIN_MINOR"
> diff --git a/configure_h.awk b/configure_h.awk
> deleted file mode 100644
> index 672e745..000
> --- a/configure_h.awk
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -#
> -#  OpenVPN -- An application to securely tunnel IP networks
> -# over a single UDP port, with support for SSL/TLS-based
> -# session authentication and key exchange,
> -# packet encryption, packet authentication, and
> -# packet compression.
> -#
> -#  Copyright (C) 2010  David Sommerseth 
> -#
> -#  This program is free software; you can redistribute it and/or modify
> -#  it under the terms of the GNU General Public License version 2
> -#  as published by the Free Software Foundation.
> -#
> -#  This program is distributed in the hope that it will be useful,
> -#  but WITHOUT ANY WARRANTY; without even the implied warranty of
> -#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -#  GNU General Public License for more details.
> -#
> -#  You should have received a copy of the GNU General Public License
> -#  along with this program (see the file COPYING included with this
> -#  distribution); if not, write to the Free Software Foundation, Inc.,
> -#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> -#
> -#
> -#  This script will build up a line which can be included into a C program.
> -#  The line will contain all interesting #define statements from f.ex. 
> ./config.h
> -#
> -
> -BEGIN {
> - printf ("#define CONFIGURE_DEFINES \"")
> -}
> -
> -/^#define (ENABLE|DISABLE|DEPRECATED|USE)_/ {
> - printf (" %s", $2)
> -}
> -
> -END {
> - printf ("\"\n")
> -}
> diff --git a/configure_log.awk b/configure_log.awk
> deleted file mode 100644
> index 099e5c4..000
> --- a/configure_log.awk
> +++ /dev/null
> @@ -1,33 +0,0 @@
> -#
> -#  OpenVPN -- An application to securely tunnel IP networks
> -# over a single UDP port, with support for SSL/TLS-based
> -#

[Openvpn-devel] [PATCH 28/52] build: remove awk and non-standard autoconf output processing

2012-02-29 Thread Alon Bar-Lev
Replace with simpler environment solution.

Signed-off-by: Alon Bar-Lev 
---
 Makefile.am   |   12 ++--
 configure.ac  |3 +++
 configure_h.awk   |   39 ---
 configure_log.awk |   33 -
 options.c |4 
 5 files changed, 5 insertions(+), 86 deletions(-)
 delete mode 100644 configure_h.awk
 delete mode 100644 configure_log.awk

diff --git a/Makefile.am b/Makefile.am
index 6c0b2b4..a8ff457 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -36,7 +36,7 @@ MAINTAINERCLEANFILES = \
$(srcdir)/depcomp $(srcdir)/aclocal.m4 \
$(srcdir)/config.guess $(srcdir)/config.sub \
$(srcdir)/openvpn.spec
-CLEANFILES = openvpn.8.html configure.h
+CLEANFILES = openvpn.8.html

 EXTRA_DIST = \
sample-config-files \
@@ -57,8 +57,7 @@ dist_doc_DATA = \

 dist_noinst_SCRIPTS = \
$(TESTS) \
-   t_cltsrv-down.sh \
-   configure_h.awk configure_log.awk
+   t_cltsrv-down.sh

 dist_doc_DATA = \
COPYRIGHT.GPL \
@@ -156,13 +155,6 @@ openvpn_SOURCES = \
win32.h win32.c \
cryptoapi.h cryptoapi.c

-nodist_openvpn_SOURCES = configure.h
-options.$(OBJEXT): configure.h
-
-configure.h: Makefile
-   awk -f $(srcdir)/configure_h.awk config.h > $@
-   awk -f $(srcdir)/configure_log.awk config.log >> $@
-
 if WIN32
 dist_noinst_DATA += openvpn.8
 nodist_html_DATA = openvpn.8.html
diff --git a/configure.ac b/configure.ac
index 81bf933..0b70325 100644
--- a/configure.ac
+++ b/configure.ac
@@ -913,6 +913,9 @@ if test "${enable_strict}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -Wno-unused-parameter -Wno-unused-function"
 fi

+CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
+AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], 
[Configuration settings])
+
 TAP_WIN_COMPONENT_ID="PRODUCT_TAP_WIN_COMPONENT_ID"
 TAP_WIN_MIN_MAJOR="PRODUCT_TAP_WIN_MIN_MAJOR"
 TAP_WIN_MIN_MINOR="PRODUCT_TAP_WIN_MIN_MINOR"
diff --git a/configure_h.awk b/configure_h.awk
deleted file mode 100644
index 672e745..000
--- a/configure_h.awk
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-#  OpenVPN -- An application to securely tunnel IP networks
-# over a single UDP port, with support for SSL/TLS-based
-# session authentication and key exchange,
-# packet encryption, packet authentication, and
-# packet compression.
-#
-#  Copyright (C) 2010  David Sommerseth 
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License version 2
-#  as published by the Free Software Foundation.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program (see the file COPYING included with this
-#  distribution); if not, write to the Free Software Foundation, Inc.,
-#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#
-#  This script will build up a line which can be included into a C program.
-#  The line will contain all interesting #define statements from f.ex. 
./config.h
-#
-
-BEGIN {
-   printf ("#define CONFIGURE_DEFINES \"")
-}
-
-/^#define (ENABLE|DISABLE|DEPRECATED|USE)_/ {
-   printf (" %s", $2)
-}
-
-END {
-   printf ("\"\n")
-}
diff --git a/configure_log.awk b/configure_log.awk
deleted file mode 100644
index 099e5c4..000
--- a/configure_log.awk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-#  OpenVPN -- An application to securely tunnel IP networks
-# over a single UDP port, with support for SSL/TLS-based
-# session authentication and key exchange,
-# packet encryption, packet authentication, and
-# packet compression.
-#
-#  Copyright (C) 2010  David Sommerseth 
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License version 2
-#  as published by the Free Software Foundation.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program (see the file COPYING included with this
-#  distribution); if not, write to the Free Software Foundation, Inc.,
-#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#
-#  This script will build up a line which can be included into a C program.
-#  The line will only contain the first entry of the ./configure line from