Skip to contentSkip to conversation

autoconf/automake warnings

Openvpn-devel David Sommerseth 3 participants 10 messages Aug 11, 2016 – Aug 12, 2016

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Except of that, the patch removes the warnings on Fedora 23 [1] and causes no other issues on Scientific Linux 7.2 [2] or CentOS 5.11 [3].

And some comments to the patch.

* The subdir-objects option was needed to avoid a warning with automake-1.15.

* AM_PROG_CC_C_O is needed with automake-1.9.6 when the subdir-objects option is enabled.

* LT_INIT removes a warning on automake-1.15.

On a Fedora 23 setup without the attached patch you will see this:
- -------------------------------------------------------------------
libtoolize: Remember to add 'LT_INIT' to configure.ac. src/openvpnserv/Makefile.am:32: warning: source file '$(top_srcdir)/src/openvpn/block_dns.c' is in a subdirectory, src/openvpnserv/Makefile.am:32: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled. For now, the corresponding output
automake: object file(s) will be placed in the top-level directory. However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities. tests/unit_tests/plugins/auth-pam/Makefile.am:10: warning: source file '$(sut_sourcedir)/utils.c' is in a subdirectory, tests/unit_tests/plugins/auth-pam/Makefile.am:10: but option 'subdir-objects' is disabled

- -------------------------------------------------------------------

I can see that commit 2282b1be7968ef44accde70 (by Selva Nair) is adding cross subdir references in *_SOURCES, which requires subdir-objects + AM_PROG_CC_C_O.

Can we fix this in a better way?

Some version info:

[1] Fedora 23:

    automake-1.15-4.fc23.noarch
    autoconf-2.69-21.fc23.noarch
    libtool-2.4.6-8.fc23.x86_64

[2] Scientific Linux 7.2

    automake-1.13.4-3.el7.noarch
    autoconf-2.69-11.el7.noarch
    libtool-2.4.2-21.el7_2.x86_64

[3] CentOS 5.11

    automake-1.9.6-3.el5
    autoconf-2.59-12
    libtool-1.5.22-7.el5_4

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAlesyO4ACgkQDC186MBRfrp1WwCfUnb0VW1dsP2SB2lm480AG/TM m+QAnjHNyFJDmqOVTVBokroFx6AQ4SVw
=rRxR
-----END PGP SIGNATURE-----

configure.ac +3 -1
index 4f14ebd..82c14b6 100644
@@ -55,9 +55,11 @@ m4_define([serial_tests], [
                 awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
     ])
 ])
-AM_INIT_AUTOMAKE(foreign serial_tests) dnl NB: Do not [quote] this parameter.
+AM_INIT_AUTOMAKE(foreign serial_tests subdir-objects) dnl NB: Do not [quote] this parameter.
+AM_PROG_CC_C_O
 AC_CANONICAL_HOST
 AC_USE_SYSTEM_EXTENSIONS
+LT_INIT
 
 AC_ARG_ENABLE(
 	[lzo],
#1 lore raw

hi,

Quoted 6 lines · David Sommerseth

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Well, if the patch introduces errors instead of warnings, it can't be "the right fix" yet... but it's good to get started on this (thanks).

Quoted 1 line

* LT_INIT removes a warning on automake-1.15.

Can we avoid libtool for everything but plugins? Since we do not build a shared library, libtool tends to introduce much more hassles than being helpful about anything - especially on more weird platforms like AIX.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw
In reply to David Sommerseth

Hi,

You are right, it was me who introduced reference to sources in subdir to avoid duplication when block-dns support was added to the interactive service.

Quoted 9 lines · David Sommerseth

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Looks like a bug that was reported in automake 1.15 and fixed later. Does this
happen on later version of automake as well?

Quoted 5 lines

Except of that, the patch removes the warnings on Fedora 23 [1] and causes no other issues on Scientific Linux 7.2 [2] or CentOS 5.11 [3].

Quoted 9 lines

And some comments to the patch.

* The subdir-objects option was needed to avoid a warning with automake-1.15.

* AM_PROG_CC_C_O is needed with automake-1.9.6 when the subdir-objects option is enabled.

I thought AM_PROG_CC_C_O was deprecated a long time ago. When did it make a come back?

All my systems have automake older than 1.15 --- I will boot up a docker container and test this.

Selva

#4 lore raw
In reply to David Sommerseth
Quoted 10 lines · David Sommerseth

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

The patch is obviously useless as it breaks configuring.

Quoted 4 lines

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

It is indeed caused by a bug in automake (bug#13928) because of which variables in foo_SOURCES do not get expanded when subdir-objects is specfied. Thus $(top_srcdir) in $(top_srcdir)/src/openvpn/block_dns.c, for example, causes a folder literally named $(top_srcdir) created inside src/openvpnserv/. But make wont find any files there and leads to the missing file issues.

This has been fixed in automake 1.15a master tree in this commit :
http://git.savannah.gnu.org/cgit/automake.git/commit/?id=
6a675ef17edf7109da189f5ae70e2dc6b7665896

(I tested it works)

But that may not get into any distributions for a while and anyway we'll have to continue supporting various 1.x versions of automake for a long time.

We have two options:

(i) just ignore the subdir-objects warning until it really cannot be ignored (i.e when they make it the default).
OR
(ii) do not use any variables that need expansion in packagename_SOURCES lines in Makefile.am This is an easy fix that should just work.

Selva

#3 lore raw
In reply to Selva Nair

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 16 lines · Selva Nair

Hi,

You are right, it was me who introduced reference to sources in subdir to avoid duplication when block-dns support was added to the interactive service.

On Thu, Aug 11, 2016 at 2:50 PM, David Sommerseth
<[email protected]...
<mailto:[email protected]...>> wrote:

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

Quoted 6 lines

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Looks like a bug that was reported in automake 1.15 and fixed later. Does this happen on later version of automake as well?

My current tests was on an updated Fedora 23. I can grab a an updated F24 image and try building there.

Quoted 11 lines

Except of that, the patch removes the warnings on Fedora 23 [1] and causes no other issues on Scientific Linux 7.2 [2] or CentOS 5.11 [3].

And some comments to the patch.

* The subdir-objects option was needed to avoid a warning with automake-1.15.

Quoted 6 lines

* AM_PROG_CC_C_O is needed with automake-1.9.6 when the subdir-objects option is enabled.

I thought AM_PROG_CC_C_O was deprecated a long time ago. When did it make a come back?

I dunno if it's deprecated, but I remember reading yesterday it shouldn't be needed since 1.13 (IIRC). But as we need to ensure OpenVPN can be fully built on RHEL5 (which is the oldest supported
distribution we officially support). And RHEL5 ships with automake-1.9
.

A related discussion we of course can make is if we will change our build support policy slightly. Currently we support building from git on RHEL5 (hence autoreconf is needed to be run). But we could change our policy to only support building on RHEL5 using tarballs (greated by 'make dist' and related variants). In this case, autotools doesn't even need to be installed (with the exception of libtool, iirc) ... but that's a discussion outside this mail-thread, though.

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAletnZUACgkQDC186MBRfrqt3wCfT+fo+9haooMUHZ2MUxlekWeY ex8AnRcCNQey/fEbTakJSbrgUqzeULP2
=bN9r
-----END PGP SIGNATURE-----

#5 lore raw
In reply to Selva Nair

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 24 lines · Selva Nair

On Thu, Aug 11, 2016 at 2:50 PM, David Sommerseth
<[email protected]...
<mailto:[email protected]...>> wrote:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

The patch is obviously useless as it breaks configuring.

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Quoted 7 lines

It is indeed caused by a bug in automake (bug#13928) because of which variables in foo_SOURCES do not get expanded when subdir-objects is specfied. Thus $(top_srcdir) in $(top_srcdir)/src/openvpn/block_dns.c, for example, causes a folder literally named $(top_srcdir) created inside src/openvpnserv/. But make wont find any files there and leads to the missing file issues.

Just thinking a bit around this and avoiding code duplication. This might be a bit more hackish alternative, but bear with me :)

If the Makefile.am in src/openvpnsrv has a build-target for the block_dns.c file which would just copy the source file to the openvpnserv/ directory ... would that work?

Rough (not really tested) example is attached.

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAletpUcACgkQDC186MBRfrrUjACcCfCMTD3Xp8LlFRiLhaBGjVU1 PtMAoI2VL2nBzYzk5krtIQQ38Q3dZSqC
=hk2k
-----END PGP SIGNATURE-----

src/openvpnserv/Makefile.am +10 -1
index 3c757d6..04a0dd4 100644
@@ -29,11 +29,20 @@ openvpnserv_CFLAGS = \
 openvpnserv_LDADD = -ladvapi32 -luserenv -liphlpapi -lfwpuclnt -lrpcrt4 -lshlwapi -lnetapi32 -lws2_32
 endif
 
+CLEANFILES = block_dns.c block_dns.h
+.PHONY = block_dns.c block_dns.h
+BUILT_SOURCES = block_dns.c block_dns.h
+
+block_dns.c :
+	cp $(top_srcdir)/src/openvpn/block_dns.c .
+
+block_dns.h :
+	cp $(top_srcdir)/src/openvpn/block_dns.h .
+
 openvpnserv_SOURCES = \
         common.c \
 	automatic.c \
 	interactive.c \
 	service.c service.h \
 	validate.c validate.h \
-	$(top_srcdir)/src/openvpn/block_dns.c $(top_srcdir)/src/openvpn/block_dns.h \
 	openvpnserv_resources.rc
#6 lore raw
Quoted 33 lines · David Sommerseth
Quoted 24 lines · Selva Nair

On Thu, Aug 11, 2016 at 2:50 PM, David Sommerseth
<[email protected]...
<mailto:[email protected]...>> wrote:

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Hi,

I noticed a few errors today when building OpenVPN on Fedora 23. The attached patch resolves this. But it breaks 'make' when it reaches ./src/openvpnserv:

The patch is obviously useless as it breaks configuring.

Makefile:505: ../../src/openvpn/.deps/openvpnserv-block_dns.Po: No such file or directory

Quoted 7 lines

It is indeed caused by a bug in automake (bug#13928) because of which variables in foo_SOURCES do not get expanded when subdir-objects is specfied. Thus $(top_srcdir) in $(top_srcdir)/src/openvpn/block_dns.c, for example, causes a folder literally named $(top_srcdir) created inside src/openvpnserv/. But make wont find any files there and leads to the missing file issues.

Quoted 8 lines

Just thinking a bit around this and avoiding code duplication. This might be a bit more hackish alternative, but bear with me :)

If the Makefile.am in src/openvpnsrv has a build-target for the block_dns.c file which would just copy the source file to the openvpnserv/ directory ... would that work?

Rough (not really tested) example is attached.

This is incomplete but could be made to work with some changes. However, such a hackery is not needed in this particular case as one could simply replace
$(top_srcdir)/src/openvpn/block_dns.c $(top_srcdir)/src/openvpn/block_dns.h in Makefile.am by
../../src/openvpn/block_dns.c ../../src/openvpn/block_dns.h
and use the subdir-objects option without issues.

But the problem is that, its not just these two files, we now have subdir source references in places like tests/unit_tests/plugins/auth-pam/Makefile.am as
well. Replacing $(top_srcdir) by something like "../../../../..." in deeply nested directories would be error-prone and cumbersome. If/when more and more tests get added this is going to get only worse.

I would say ignore the subdir-objects warning for now and we can conditionally enable it when a version of automake that supports it without breaking use of variables in foo_SOURCES becomes widely available. In the mean time keep testing subdir-objects using a patched automake may be all that we can do.

Selva

#7 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 14 lines · Selva Nair

On Fri, Aug 12, 2016 at 6:30 AM, David Sommerseth
<[email protected]...
<mailto:[email protected]...>> wrote:

Quoted 4 lines · Selva Nair

On Thu, Aug 11, 2016 at 2:50 PM, David Sommerseth
<[email protected]...

<mailto:[email protected]...>

Quoted 1 line

<mailto:[email protected]...

Quoted 1 line · <mailto:[email protected]...>>> wrote:

[...snip....]

Quoted 14 lines

If the Makefile.am in src/openvpnsrv has a build-target for the block_dns.c file which would just copy the source file to the openvpnserv/ directory ... would that work?

Rough (not really tested) example is attached.

This is incomplete but could be made to work with some changes. However, such a hackery is not needed in this particular case as one could simply replace $(top_srcdir)/src/openvpn/block_dns.c $(top_srcdir)/src/openvpn/block_dns.h in Makefile.am by ../../src/openvpn/block_dns.c ../../src/openvpn/block_dns.h and use the subdir-objects option without issues.

Quoted 6 lines

But the problem is that, its not just these two files, we now have subdir source references in places like tests/unit_tests/plugins/auth-pam/Makefile.am as well. Replacing $(top_srcdir) by something like "../../../../..." in deeply nested directories would be error-prone and cumbersome. If/when more and more tests get added this is going to get only worse.

Agreed. And the nesting will be a hassle with time anyhow - suddenly someone tries to move a directory to a different subdir level, and all hell breaks loose again.

Quoted 5 lines

I would say ignore the subdir-objects warning for now and we can conditionally enable it when a version of automake that supports it without breaking use of variables in foo_SOURCES becomes widely available. In the mean time keep testing subdir-objects using a patched automake may be all that we can do.

I can live with that for now. But it would be good to have a solution before we get complaints from more bleeding edge distros (Fedora, Arch, Ubuntu, openSUSE etc) that 'automake doesn't work any more' due to our setup isn't modern enough.

I'll send a patch to ML fixing the LT_INIT stuff, that should work just fine regardless of the subdir-objects option.

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAleuF5AACgkQDC186MBRfrplnACfVvzPmHWhVTBLU42pqkMhIPIv u7QAnjmO6pU83/SV9GCYZRnnzYLvV8eZ
=eHDo
-----END PGP SIGNATURE-----

#8 lore raw
Quoted 10 lines · David Sommerseth
Quoted 5 lines

I would say ignore the subdir-objects warning for now and we can conditionally enable it when a version of automake that supports it without breaking use of variables in foo_SOURCES becomes widely available. In the mean time keep testing subdir-objects using a patched automake may be all that we can do.

I can live with that for now. But it would be good to have a solution before we get complaints from more bleeding edge distros (Fedora, Arch, Ubuntu, openSUSE etc) that 'automake doesn't work any more' due to our setup isn't modern enough.

When that happens we add a version check to define subdir_objects = "subdir-objects" and add that as we do for serial-objects. Its a bit premature to do that until next version of automake is out.

Selva

#9 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Selva Nair

When that happens we add a version check to define subdir_objects = "subdir-objects" and add that as we do for serial-objects. Its a bit premature to do that until next version of automake is out.

Aha! That makes perfect sense. Thanks a lot!

Btw ... really good to have someone active here who have deeper understanding how these bits works!

- --
kind regards,

David Sommerseth
OpenVPN Technologies, Inc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iEYEARECAAYFAleuJ1cACgkQDC186MBRfrpVGwCfc37jMJ0tATmaUe+yVr3a7l1B mLgAmwbjtMxtSJj2oMD/MyPWVPQC7DDy
=0wHM
-----END PGP SIGNATURE-----