From 810450dd1d59b62d4a03cf201ddc201279a6f9a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Tue, 21 May 2024 19:23:40 +0200 Subject: [PATCH] build: move autotools/CMake-related files from project root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- .gitignore | 14 ++++++------ CMakeLists.txt | 6 ++--- Makefile.am | 22 +++++++++---------- Mk/Makefile.am | 12 ---------- autogen.sh | 4 ++-- {Mk => autotools/Mk}/CMakeLists.txt | 0 autotools/Mk/Makefile.am | 12 ++++++++++ {Mk => autotools/Mk}/find-top-builddir.sh | 0 {Mk => autotools/Mk}/lex-rules.am | 0 {Mk => autotools/Mk}/populate-makefiles.sh | 6 ++--- {Mk => autotools/Mk}/python-venv.am | 0 {Mk => autotools/Mk}/subdir.mk | 2 +- dist.conf.in => autotools/dist.conf.in | 0 {m4 => autotools/m4}/_ax_valgrind_check.m4 | 0 {m4 => autotools/m4}/ax_cflags_gcc_option.m4 | 0 {m4 => autotools/m4}/ax_require_defined.m4 | 0 {m4 => autotools/m4}/check_java_support.m4 | 0 {m4 => autotools/m4}/m4_esyscmd_s.m4 | 0 .../sub-configure.sh | 0 .../syslog-ng-native-connector.pc.in | 0 syslog-ng.pc.in => autotools/syslog-ng.pc.in | 0 .../syslog-ng-config.h.in | 0 .../syslog-ng-native-connector.pc.cmake | 0 .../syslog-ng.pc.cmake | 0 configure.ac | 12 +++++----- modules/native/CMakeLists.txt | 2 +- modules/native/Makefile.am | 2 +- tests/copyright/policy | 5 ++--- 28 files changed, 49 insertions(+), 50 deletions(-) delete mode 100644 Mk/Makefile.am rename {Mk => autotools/Mk}/CMakeLists.txt (100%) create mode 100644 autotools/Mk/Makefile.am rename {Mk => autotools/Mk}/find-top-builddir.sh (100%) rename {Mk => autotools/Mk}/lex-rules.am (100%) rename {Mk => autotools/Mk}/populate-makefiles.sh (70%) rename {Mk => autotools/Mk}/python-venv.am (100%) rename {Mk => autotools/Mk}/subdir.mk (96%) rename dist.conf.in => autotools/dist.conf.in (100%) rename {m4 => autotools/m4}/_ax_valgrind_check.m4 (100%) rename {m4 => autotools/m4}/ax_cflags_gcc_option.m4 (100%) rename {m4 => autotools/m4}/ax_require_defined.m4 (100%) rename {m4 => autotools/m4}/check_java_support.m4 (100%) rename {m4 => autotools/m4}/m4_esyscmd_s.m4 (100%) rename sub-configure.sh => autotools/sub-configure.sh (100%) rename syslog-ng-native-connector.pc.in => autotools/syslog-ng-native-connector.pc.in (100%) rename syslog-ng.pc.in => autotools/syslog-ng.pc.in (100%) rename syslog-ng-config.h.in => cmake/syslog-ng-config.h.in (100%) rename syslog-ng-native-connector.pc.cmake => cmake/syslog-ng-native-connector.pc.cmake (100%) rename syslog-ng.pc.cmake => cmake/syslog-ng.pc.cmake (100%) diff --git a/.gitignore b/.gitignore index ac79e6435e..d957706a41 100644 --- a/.gitignore +++ b/.gitignore @@ -28,13 +28,13 @@ ltmain.sh .cproject .settings Debug -m4/libtool.m4 -m4/lt~obsolete.m4 -m4/ltoptions.m4 -m4/ltsugar.m4 -m4/ltversion.m4 -m4/pkg.m4 -m4/ax*.m4 +autotools/m4/libtool.m4 +autotools/m4/lt~obsolete.m4 +autotools/m4/ltoptions.m4 +autotools/m4/ltsugar.m4 +autotools/m4/ltversion.m4 +autotools/m4/pkg.m4 +autotools/m4/ax*.m4 /compile .deps /lib/cfg-grammar.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 409a316f45..c8e14f5101 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -467,7 +467,7 @@ endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}) -add_subdirectory(Mk) +add_subdirectory(autotools/Mk) add_subdirectory(scl) add_subdirectory(lib) add_subdirectory(modules) @@ -478,7 +478,7 @@ add_subdirectory(persist-tool) add_subdirectory(tests) add_subdirectory(libtest) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/syslog-ng-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/syslog-ng-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-config.h) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng-config.h DESTINATION include/syslog-ng) @@ -500,7 +500,7 @@ set(PKG_CONFIG_INTERNAL_IVYKIS_CFLAGS ${IVYKIS_INCLUDE_DIRS}) set(libdir "\${libdir}") set(includedir "\${includedir}") -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/syslog-ng.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng.pc) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/syslog-ng.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng.pc) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/syslog-ng.pc DESTINATION lib/pkgconfig) include(print_config_summary) diff --git a/Makefile.am b/Makefile.am index 4c34f46681..1c465d51b5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,15 +31,15 @@ if ENABLE_SANITIZER LOG_COMPILER = $(top_srcdir)/scripts/test-grep.sh endif -ACLOCAL_AMFLAGS = -I m4 --install +ACLOCAL_AMFLAGS = -I autotools/m4 --install EXTRA_DIST = $(filter-out ${NODIST_BUILT_SOURCES},${BUILT_SOURCES}) VERSION.txt NEWS.md autogen.sh \ - dist.conf dist.conf.in syslog-ng.pc.in \ - syslog-ng-config.h.in \ + autotools/dist.conf autotools/dist.conf.in autotools/syslog-ng.pc.in \ + cmake/syslog-ng-config.h.in \ CONTRIBUTING.md \ - sub-configure.sh \ - syslog-ng.pc.cmake \ - syslog-ng-native-connector.pc.cmake \ + autotools/sub-configure.sh \ + cmake/syslog-ng.pc.cmake \ + cmake/syslog-ng-native-connector.pc.cmake \ syslog-ng-ctl/CMakeLists.txt \ requirements.txt \ dev-requirements.txt \ @@ -54,7 +54,7 @@ pkglibdir = $(libdir)/syslog-ng pkglibexecdir = $(libexecdir)/syslog-ng pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = syslog-ng.pc +pkgconfig_DATA = autotools/syslog-ng.pc AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/modules -I$(top_builddir)/lib -I$(top_builddir)/modules @@ -210,7 +210,7 @@ install-exec-hook: ${INSTALL_EXEC_HOOKS} uninstall-hook: ${UNINSTALL_HOOKS} populate-makefiles: - $(top_srcdir)/Mk/populate-makefiles.sh + $(top_srcdir)/autotools/Mk/populate-makefiles.sh style-check: $(top_srcdir)/scripts/style-checker.sh check $(top_srcdir) @@ -248,9 +248,9 @@ $(install_moduleLTLIBRARIES): install-libLTLIBRARIES install_loggenpluginLTLIBRARIES = install-loggenpluginLTLIBRARIES $(install_loggenpluginLTLIBRARIES): install-libLTLIBRARIES -include Mk/lex-rules.am -include Mk/python-venv.am -include Mk/Makefile.am +include autotools/Mk/lex-rules.am +include autotools/Mk/python-venv.am +include autotools/Mk/Makefile.am if ENABLE_TESTING include libtest/Makefile.am endif diff --git a/Mk/Makefile.am b/Mk/Makefile.am deleted file mode 100644 index 22bbc2b5f6..0000000000 --- a/Mk/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -EXTRA_DIST += Mk/lex-rules.am \ - Mk/find-top-builddir.sh \ - Mk/populate-makefiles.sh \ - Mk/subdir.mk \ - Mk/CMakeLists.txt - -tools_DATA = \ - Mk/lex-rules.am \ - lib/cfg-grammar.y - -tools_SCRIPTS = \ - lib/merge-grammar.py diff --git a/autogen.sh b/autogen.sh index 7b78333aef..380700035b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -78,7 +78,7 @@ autogen_submodules() CONFIGURE_OPTS="--disable-shared --enable-static --with-pic" - $SED -e "s/@__CONFIGURE_OPTS__@/${CONFIGURE_OPTS}/g" ${origdir}/sub-configure.sh >configure.gnu + $SED -e "s/@__CONFIGURE_OPTS__@/${CONFIGURE_OPTS}/g" ${origdir}/autotools/sub-configure.sh >configure.gnu cd "$origdir" done } @@ -94,7 +94,7 @@ case `uname -s` in esac $LIBTOOLIZE --force --copy -aclocal -I m4 --install +aclocal -I autotools/m4 --install $SED -i -e 's/PKG_PROG_PKG_CONFIG(\[0\.16\])/PKG_PROG_PKG_CONFIG([0.14])/g' aclocal.m4 include_automake_from_dir_if_exists debian diff --git a/Mk/CMakeLists.txt b/autotools/Mk/CMakeLists.txt similarity index 100% rename from Mk/CMakeLists.txt rename to autotools/Mk/CMakeLists.txt diff --git a/autotools/Mk/Makefile.am b/autotools/Mk/Makefile.am new file mode 100644 index 0000000000..96d77d7d0d --- /dev/null +++ b/autotools/Mk/Makefile.am @@ -0,0 +1,12 @@ +EXTRA_DIST += autotools/Mk/lex-rules.am \ + autotools/Mk/find-top-builddir.sh \ + autotools/Mk/populate-makefiles.sh \ + autotools/Mk/subdir.mk \ + autotools/Mk/CMakeLists.txt + +tools_DATA = \ + autotools/Mk/lex-rules.am \ + lib/cfg-grammar.y + +tools_SCRIPTS = \ + lib/merge-grammar.py diff --git a/Mk/find-top-builddir.sh b/autotools/Mk/find-top-builddir.sh similarity index 100% rename from Mk/find-top-builddir.sh rename to autotools/Mk/find-top-builddir.sh diff --git a/Mk/lex-rules.am b/autotools/Mk/lex-rules.am similarity index 100% rename from Mk/lex-rules.am rename to autotools/Mk/lex-rules.am diff --git a/Mk/populate-makefiles.sh b/autotools/Mk/populate-makefiles.sh similarity index 70% rename from Mk/populate-makefiles.sh rename to autotools/Mk/populate-makefiles.sh index 13f99fc364..40756813f0 100755 --- a/Mk/populate-makefiles.sh +++ b/autotools/Mk/populate-makefiles.sh @@ -1,13 +1,13 @@ #! /bin/sh -root=$(cd $(dirname $0) && cd .. && pwd) +root=$(cd $(dirname $0) && cd ../.. && pwd) populate() { mfam="$1" dir="$(dirname ${mfam})" if [ "${dir}" != "." ] && [ "${dir}" != "${root}" ] && [ -d "${dir}" ]; then - echo "${root}/Mk/subdir.mk" "=>" "${dir}/Makefile" - ln -sf "${root}/Mk/subdir.mk" "${dir}/Makefile" + echo "${root}/autotools/Mk/subdir.mk" "=>" "${dir}/Makefile" + ln -sf "${root}/autotools/Mk/subdir.mk" "${dir}/Makefile" fi if [ -e "${root}/${dir}/Makefile.am" ]; then incs=$(grep "^include" "${root}/${dir}/Makefile.am" | sed -e "s,^include ,,") diff --git a/Mk/python-venv.am b/autotools/Mk/python-venv.am similarity index 100% rename from Mk/python-venv.am rename to autotools/Mk/python-venv.am diff --git a/Mk/subdir.mk b/autotools/Mk/subdir.mk similarity index 96% rename from Mk/subdir.mk rename to autotools/Mk/subdir.mk index 41ba42e7c3..f1ae8d75ac 100644 --- a/Mk/subdir.mk +++ b/autotools/Mk/subdir.mk @@ -1,5 +1,5 @@ top_srcdir = $(dir $(shell readlink ${MAKEFILE_LIST}))../ -top_builddir = $(shell ${top_srcdir}/Mk/find-top-builddir.sh) +top_builddir = $(shell ${top_srcdir}/autotools/Mk/find-top-builddir.sh) self = $(subst ${top_builddir}/,,${CURDIR}) self_sub = $(subst -,_,$(subst /,_,${self})) diff --git a/dist.conf.in b/autotools/dist.conf.in similarity index 100% rename from dist.conf.in rename to autotools/dist.conf.in diff --git a/m4/_ax_valgrind_check.m4 b/autotools/m4/_ax_valgrind_check.m4 similarity index 100% rename from m4/_ax_valgrind_check.m4 rename to autotools/m4/_ax_valgrind_check.m4 diff --git a/m4/ax_cflags_gcc_option.m4 b/autotools/m4/ax_cflags_gcc_option.m4 similarity index 100% rename from m4/ax_cflags_gcc_option.m4 rename to autotools/m4/ax_cflags_gcc_option.m4 diff --git a/m4/ax_require_defined.m4 b/autotools/m4/ax_require_defined.m4 similarity index 100% rename from m4/ax_require_defined.m4 rename to autotools/m4/ax_require_defined.m4 diff --git a/m4/check_java_support.m4 b/autotools/m4/check_java_support.m4 similarity index 100% rename from m4/check_java_support.m4 rename to autotools/m4/check_java_support.m4 diff --git a/m4/m4_esyscmd_s.m4 b/autotools/m4/m4_esyscmd_s.m4 similarity index 100% rename from m4/m4_esyscmd_s.m4 rename to autotools/m4/m4_esyscmd_s.m4 diff --git a/sub-configure.sh b/autotools/sub-configure.sh similarity index 100% rename from sub-configure.sh rename to autotools/sub-configure.sh diff --git a/syslog-ng-native-connector.pc.in b/autotools/syslog-ng-native-connector.pc.in similarity index 100% rename from syslog-ng-native-connector.pc.in rename to autotools/syslog-ng-native-connector.pc.in diff --git a/syslog-ng.pc.in b/autotools/syslog-ng.pc.in similarity index 100% rename from syslog-ng.pc.in rename to autotools/syslog-ng.pc.in diff --git a/syslog-ng-config.h.in b/cmake/syslog-ng-config.h.in similarity index 100% rename from syslog-ng-config.h.in rename to cmake/syslog-ng-config.h.in diff --git a/syslog-ng-native-connector.pc.cmake b/cmake/syslog-ng-native-connector.pc.cmake similarity index 100% rename from syslog-ng-native-connector.pc.cmake rename to cmake/syslog-ng-native-connector.pc.cmake diff --git a/syslog-ng.pc.cmake b/cmake/syslog-ng.pc.cmake similarity index 100% rename from syslog-ng.pc.cmake rename to cmake/syslog-ng.pc.cmake diff --git a/configure.ac b/configure.ac index d235e7ee42..ca1ee34e50 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ dnl AC_INIT([axosyslog], m4_esyscmd_s([scripts/version.sh])) AC_CONFIG_SRCDIR([syslog-ng/main.c]) -AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_MACRO_DIR([autotools/m4]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl *************************************************************************** @@ -68,10 +68,10 @@ dnl Initial setup ostype=`uname -s` -if test -r $srcdir/dist.conf; then +if test -r $srcdir/autotools/dist.conf; then # read defaults, dist.conf does not change # values for parameters that are already set - . $srcdir/dist.conf + . $srcdir/autotools/dist.conf fi if test -z "$RELEASE_TAG"; then @@ -1709,7 +1709,7 @@ CFLAGS=$old_CFLAGS if test "x$enable_native" = "xyes" -o "x$enable_native" = "xauto"; then - AC_CONFIG_FILES([syslog-ng-native-connector.pc]) + AC_CONFIG_FILES([autotools/syslog-ng-native-connector.pc]) fi dnl *************************************************************************** @@ -2366,9 +2366,9 @@ AC_SUBST(XSL_STYLESHEET) AX_PREFIX_CONFIG_H(syslog-ng-config.h, "SYSLOG_NG") AX_VALGRIND_CHECK -AC_OUTPUT(dist.conf +AC_OUTPUT(autotools/dist.conf Makefile - syslog-ng.pc + autotools/syslog-ng.pc libtest/syslog-ng-test.pc scripts/update-patterndb scripts/syslog-ng-update-virtualenv diff --git a/modules/native/CMakeLists.txt b/modules/native/CMakeLists.txt index 9ee432a4c5..1014a3588a 100644 --- a/modules/native/CMakeLists.txt +++ b/modules/native/CMakeLists.txt @@ -28,7 +28,7 @@ if (ENABLE_NATIVE) set(PKG_CONFIG_LIBDIR "\${exec_prefix}/lib") set(PKG_CONFIG_LIBS "-L\${libdir} -lsyslog-ng-native-connector") - configure_file (${PROJECT_SOURCE_DIR}/syslog-ng-native-connector.pc.cmake ${PROJECT_BINARY_DIR}/syslog-ng-native-connector.pc) + configure_file (${PROJECT_SOURCE_DIR}/cmake/syslog-ng-native-connector.pc.cmake ${PROJECT_BINARY_DIR}/syslog-ng-native-connector.pc) install(FILES ${PROJECT_BINARY_DIR}/syslog-ng-native-connector.pc DESTINATION lib/pkgconfig COMPONENT native-connector) diff --git a/modules/native/Makefile.am b/modules/native/Makefile.am index 756fe60339..cadee33744 100644 --- a/modules/native/Makefile.am +++ b/modules/native/Makefile.am @@ -11,7 +11,7 @@ modules_native_libsyslog_ng_native_connector_a_SOURCES = \ modules/native/parser.c \ modules/native/parser.h -pkgconfig_DATA += syslog-ng-native-connector.pc +pkgconfig_DATA += autotools/syslog-ng-native-connector.pc modules_native_libsyslog_ng_native_connector_a_CPPFLAGS = \ $(AM_CPPFLAGS) -fPIC \ diff --git a/tests/copyright/policy b/tests/copyright/policy index b718f343ce..ccc6148240 100644 --- a/tests/copyright/policy +++ b/tests/copyright/policy @@ -30,8 +30,7 @@ tests/copyright/policy$ lib/cfg-lex\.[ch]$ tgz2build autom4te\.cache -m4 -Mk +autotools .*\.(a|bin|class|css|dirstamp|html|idx|jar|js|o|la|lai|lo|MF|persist|Plo|Po|pc|pyc|so|so\.0\.0\.0|soT|spec|trs)$ (.*/)?Makefile$ doc/man @@ -154,7 +153,7 @@ lib/tests/test_zone\.c ########################################################################### LGPLv2.1+_SSL autogen\.sh$ -sub-configure\.sh$ +autotools/sub-configure\.sh$ configure\.ac$ Makefile\.am$ lib/(compat|str-repr|timeutils|control|debugger|filter|logproto|multi-line|parser|rewrite|stats|template|tests|transport|logmsg|value-pairs|secret-storage|logthrdest|logthrsource|ack-tracker|signal-slot-connector|[^/]*$)