]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
configure: manage libkmod.pc.in and version.py.in via AC_CONFIG_FILES
authorEmil Velikov <emil.velikov@collabora.com>
Tue, 21 Feb 2023 13:19:29 +0000 (13:19 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 22 Feb 2023 00:35:42 +0000 (16:35 -0800)
Replace the manual sed command, build rules and dist/clean for using
AC_CONFIG_FILES. It does the exact same thing, with an added bonus...

Currently we're missing version.py.in in the EXTRA_DIST. Thus a simple
"touch Makefile" should retrigger the regeneration of version.py. Which
would presumably fail, since the input file isn't in the distribution
tarball.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Makefile.am
configure.ac

index 61dbdf0ee76633413d241bbd0c8406ff8abbbe9d..8ba85c91a0f39376c5c9cd7cc7190fb3059cd6a6 100644 (file)
@@ -24,26 +24,6 @@ AM_CPPFLAGS = \
 AM_CFLAGS = $(OUR_CFLAGS)
 AM_LDFLAGS = $(OUR_LDFLAGS)
 
-SED_PROCESS = \
-       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
-       -e 's,@VERSION\@,$(VERSION),g' \
-       -e 's,@prefix\@,$(prefix),g' \
-       -e 's,@exec_prefix\@,$(exec_prefix),g' \
-       -e 's,@libdir\@,$(libdir),g' \
-       -e 's,@includedir\@,$(includedir),g' \
-       -e 's,@libzstd_CFLAGS\@,${libzstd_CFLAGS},g' \
-       -e 's,@libzstd_LIBS\@,${libzstd_LIBS},g' \
-       -e 's,@liblzma_CFLAGS\@,${liblzma_CFLAGS},g' \
-       -e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
-       -e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
-       -e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
-       -e 's,@libcrypto_CFLAGS\@,${libcrypto_CFLAGS},g' \
-       -e 's,@libcrypto_LIBS\@,${libcrypto_LIBS},g' \
-       < $< > $@ || rm $@
-
-%.pc: %.pc.in Makefile
-       $(SED_PROCESS)
-
 # Rules for libtool versioning (from https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html)
 # 1. Start with version information of ‘0:0:0’ for each libtool library.
 # 2. Update the version information only immediately before a public release of
@@ -116,8 +96,6 @@ libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD)
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libkmod/libkmod.pc
-EXTRA_DIST += libkmod/libkmod.pc.in
-CLEANFILES += libkmod/libkmod.pc
 
 bashcompletiondir=@bashcompletiondir@
 dist_bashcompletion_DATA = \
@@ -179,9 +157,6 @@ am__v_CYTHON_0 = @echo "  CYTHON " $@;
 .pyx.c:
        $(AM_V_CYTHON)$(CYTHON) -o $@ $<
 
-%.py: %.py.in Makefile
-       $(SED_PROCESS)
-
 # Remove some warnings for generated code
 PYTHON_NOWARN = -Wno-redundant-decls -Wno-shadow -Wno-strict-aliasing
 
index 892f5d9fbd1b650b12ce9b133b0e5e5250c9f855..65902d174862362ebbf08f78dd87701df2703de6 100644 (file)
@@ -292,6 +292,8 @@ AC_CONFIG_FILES([
        man/Makefile
        libkmod/docs/Makefile
        libkmod/docs/version.xml
+       libkmod/libkmod.pc
+       libkmod/python/kmod/version.py
 ])