Include libglnx-config.h instead of config.h

This avoids colliding with a config.h generated by a parent Meson
project.

In the Meson build system, we generate libglnx-config.h by doing our
own checks, so we want to avoid it colliding.

In the Autotools build system, we assume that the parent project will
generate its own config.h that contains the results of LIBGLNX_CONFIGURE,
and create a forwarding header libglnx-config.h in the $(top_builddir)
(so that it is next to config.h).

Note that after updating libglnx in an Autotools non-recursive-Make
project (libostree, flatpak, flatpak-builder) it will be necessary to
re-run autogen.sh.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2021-04-06 18:08:55 +01:00
parent 1f02e4313a
commit c306703c6f
19 changed files with 24 additions and 18 deletions

2
.gitignore vendored
View File

@@ -2,6 +2,8 @@
# subdir-objects
Makefile-libglnx.am.inc
libglnx-config.h
# Some standard bits
.deps
.libs

View File

@@ -21,6 +21,10 @@ EXTRA_DIST += \
$(libglnx_srcpath)/libglnx.m4 \
$(NULL)
BUILT_SOURCES += $(top_builddir)/libglnx-config.h
$(top_builddir)/libglnx-config.h: Makefile.am
echo '#include "config.h"' > $@
libglnx_la_SOURCES = \
$(libglnx_srcpath)/glnx-macros.h \
$(libglnx_srcpath)/glnx-backport-autocleanups.h \
@@ -49,7 +53,7 @@ libglnx_la_SOURCES = \
$(libglnx_srcpath)/tests/libglnx-testlib.h \
$(NULL)
libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags)
libglnx_la_CFLAGS = $(AM_CFLAGS) $(libglnx_cflags) -I$(builddir)
libglnx_la_LDFLAGS = -avoid-version -Bsymbolic-functions -export-symbols-regex "^glnx_" -no-undefined -export-dynamic
libglnx_la_LIBADD = $(libglnx_libs)

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "glnx-backports.h"

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "glnx-console.h"

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include <string.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include <glnx-backport-autocleanups.h>
#include <glnx-errors.h>

View File

@@ -21,7 +21,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include <string.h>
#include <stdio.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "glnx-local-alloc.h"

View File

@@ -22,7 +22,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include "config.h"
#include "libglnx-config.h"
#include <stdlib.h>
#include <stdbool.h>

View File

@@ -30,7 +30,7 @@
Add abstraction model for BPF programs
*/
#include "config.h"
#include "libglnx-config.h"
#if !HAVE_DECL_RENAMEAT2
# ifndef __NR_renameat2

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include <string.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include <string.h>
#include <stdio.h>

View File

@@ -35,7 +35,7 @@ foreach check_function : check_functions
conf.set10('HAVE_DECL_' + check_function.underscorify().to_upper(), have_it)
endforeach
config_h = configure_file(
output : 'config.h',
output : 'libglnx-config.h',
configuration : conf,
)

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx-testlib.h"
#include <errno.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>

View File

@@ -18,7 +18,7 @@
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include "libglnx-config.h"
#include "libglnx.h"
#include <glib.h>
#include <stdlib.h>