Browse code

Fix dependency checking for configure.h (v2)

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.

This is an enhanced version of the one sent to the openvpn-devel mailing
list April 13, 2010 [1], after having received some feedback from Gert
Doering, cleaning up configure_log.awk further.

[1] <http://thread.gmane.org/gmane.network.openvpn.devel/3410/focus=3491>

Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Acked-by: Gert Doering <gert@greenie.muc.de>

David Sommerseth authored on 2010/04/23 06:01:31
Showing 3 changed files
... ...
@@ -66,7 +66,8 @@ dist_noinst_SCRIPTS = \
66 66
 	$(TESTS) \
67 67
 	doclean \
68 68
 	domake-win \
69
-	t_cltsrv-down.sh
69
+	t_cltsrv-down.sh \
70
+	configure_h.awk configure_log.awk
70 71
 
71 72
 dist_noinst_DATA = \
72 73
 	openvpn.spec \
... ...
@@ -142,9 +143,12 @@ openvpn_SOURCES = \
142 142
 	win32.h win32.c \
143 143
 	cryptoapi.h cryptoapi.c
144 144
 
145
+nodist_openvpn_SOURCES = configure.h
146
+options.$(OBJEXT): configure.h
147
+
145 148
 configure.h: Makefile
146
-	awk -f configure_h.awk config.h > $@
147
-	awk -f configure_log.awk config.log >> $@
149
+	awk -f $(srcdir)/configure_h.awk config.h > $@
150
+	awk -f $(srcdir)/configure_log.awk config.log >> $@
148 151
 
149 152
 clean-local:
150 153
 	-rm -f configure.h
... ...
@@ -27,10 +27,7 @@
27 27
 #  ./config.log.
28 28
 #
29 29
 
30
-BEGIN {
31
-	printf ("#define CONFIGURE_CALL \"")
32
-}
33
-/\$ .\/configure/ {
34
-	print $0,"\""
30
+/\$ (.*)\/configure/ {
31
+	printf ("#define CONFIGURE_CALL \"%s\"\n", $0)
35 32
 	exit 0
36 33
 }
... ...
@@ -2921,7 +2921,9 @@ usage_version (void)
2921 2921
   msg (M_INFO|M_NOPREFIX, "%s", title_string);
2922 2922
   msg (M_INFO|M_NOPREFIX, "Originally developed by James Yonan");
2923 2923
   msg (M_INFO|M_NOPREFIX, "Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>");
2924
+#ifdef CONFIGURE_CALL
2924 2925
   msg (M_INFO|M_NOPREFIX, "\n%s\n", CONFIGURE_CALL);
2926
+#endif
2925 2927
   msg (M_INFO|M_NOPREFIX, "Compile time defines: %s", CONFIGURE_DEFINES);
2926 2928
   openvpn_exit (OPENVPN_EXIT_STATUS_USAGE); /* exit point */
2927 2929
 }