From e60835d4243baa2e9fd2953f164936daddd1546d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 16 Apr 2025 18:45:55 +0200 Subject: [PATCH] build: Use Automake in lib/. * autopull.sh: Copy also m4/init-package-version.m4. * autogen.sh: Mention the requirement for Automake. * Makefile.devel (lib/aclocal.m4, lib/config.h.in, lib/Makefile.in): New rules. (lib/configure): Use lib/aclocal.m4 instead of the top-level aclocal.m4. (src/config.h.in): Fix rule. (totally-clean): Remove the new generated files. * lib/configure.ac: Require Autoconf >= 2.70. Change AC_INIT invocation. Invoke AC_CONFIG_MACRO_DIRS, gl_INIT_PACKAGE_VERSION, AM_INIT_AUTOMAKE, AC_CONFIG_HEADERS. Don't invoke AC_MAKE_SET, AC_PROG_CPP, AC_PROG_CXXCPP, AC_PROG_INSTALL. * lib/Makefile.am: New file. * lib/Makefile.in: Remove file. * Makefile.in (IMPORTED_FILES): Remove lib/filename.h. --- ChangeLog | 18 ++++++ Makefile.devel | 21 +++++-- Makefile.in | 5 +- autogen.sh | 4 +- autopull.sh | 3 +- build-aux/.gitignore | 3 + lib/.gitignore | 3 + lib/Makefile.am | 28 +++++++++ lib/Makefile.in | 136 ------------------------------------------- lib/configure.ac | 18 +++--- m4/.gitignore | 3 + 11 files changed, 86 insertions(+), 156 deletions(-) create mode 100644 lib/Makefile.am delete mode 100644 lib/Makefile.in create mode 100644 m4/.gitignore diff --git a/ChangeLog b/ChangeLog index 32bb992..8af97a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2025-04-16 Bruno Haible + + build: Use Automake in lib/. + * autopull.sh: Copy also m4/init-package-version.m4. + * autogen.sh: Mention the requirement for Automake. + * Makefile.devel (lib/aclocal.m4, lib/config.h.in, lib/Makefile.in): New + rules. + (lib/configure): Use lib/aclocal.m4 instead of the top-level aclocal.m4. + (src/config.h.in): Fix rule. + (totally-clean): Remove the new generated files. + * lib/configure.ac: Require Autoconf >= 2.70. Change AC_INIT invocation. + Invoke AC_CONFIG_MACRO_DIRS, gl_INIT_PACKAGE_VERSION, AM_INIT_AUTOMAKE, + AC_CONFIG_HEADERS. Don't invoke AC_MAKE_SET, AC_PROG_CPP, + AC_PROG_CXXCPP, AC_PROG_INSTALL. + * lib/Makefile.am: New file. + * lib/Makefile.in: Remove file. + * Makefile.in (IMPORTED_FILES): Remove lib/filename.h. + 2025-04-13 Bruno Haible Release gperf-3.2.1. diff --git a/Makefile.devel b/Makefile.devel index da830b8..938bea9 100644 --- a/Makefile.devel +++ b/Makefile.devel @@ -4,7 +4,10 @@ SHELL = /bin/sh MAKE = make -all : configures src/config.h.in +all : lib/aclocal.m4 configures src/config.h.in lib/config.h.in lib/Makefile.in + +lib/aclocal.m4 : force + cd lib && aclocal -I ../m4 CONFIGURES = configure lib/configure src/configure tests/configure doc/configure @@ -13,8 +16,8 @@ configures : $(CONFIGURES) configure : configure.ac aclocal.m4 autoconf -I . && rm -rf autom4te.cache -lib/configure : lib/configure.ac aclocal.m4 - cd lib && autoconf -I .. && rm -rf autom4te.cache +lib/configure : lib/configure.ac lib/aclocal.m4 + cd lib && autoconf && rm -rf autom4te.cache src/configure : src/configure.ac aclocal.m4 cd src && autoconf -I .. && rm -rf autom4te.cache @@ -29,11 +32,21 @@ check-configures : $(CONFIGURES) set -e; for f in $(CONFIGURES); do bash -x -n $$f; done src/config.h.in : src/configure.ac aclocal.m4 - cd src && autoheader -I .. && rm -rf autom4te.cache + cd src && autoheader -I .. && touch config.h.in && rm -rf autom4te.cache + +lib/config.h.in : lib/configure.ac aclocal.m4 + cd lib && autoheader && touch config.h.in + +lib/Makefile.in : lib/Makefile.am lib/config.h.in lib/configure.ac aclocal.m4 + # Make sure we get new versions of files brought in by automake. + cd build-aux && rm -f depcomp missing + cd lib && automake --add-missing --copy && rm -rf autom4te.cache totally-clean : force + rm -f lib/aclocal.m4 rm -f $(CONFIGURES) rm -f src/config.h.in + rm -f lib/config.h.in lib/Makefile.in force : diff --git a/Makefile.in b/Makefile.in index bb2638d..74eb398 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Makefile for gperf -# Copyright (C) 1989, 1992-1993, 1998, 2012, 2016, 2018, 2020, 2022, 2024 Free Software Foundation, Inc. +# Copyright (C) 1989, 1992-1993, 1998, 2012, 2016, 2018, 2020, 2022, 2024-2025 Free Software Foundation, Inc. # Written by Douglas C. Schmidt # and Bruno Haible . # @@ -72,8 +72,7 @@ SOURCE_FILES = \ IMPORTED_FILES = \ COPYING INSTALL \ build-aux/install-sh build-aux/mkinstalldirs \ - build-aux/compile build-aux/ar-lib \ - lib/filename.h + build-aux/compile build-aux/ar-lib # List of distributed files generated by autotools or Makefile.devel. GENERATED_FILES = configure # List of distributed files generated by "make". diff --git a/autogen.sh b/autogen.sh index 9bc320b..48cab62 100755 --- a/autogen.sh +++ b/autogen.sh @@ -4,9 +4,9 @@ # also regenerates all config.h.in, configure files with new versions of # autoconf. # -# This script requires autoconf-2.64..2.72 in the PATH. +# This script requires autoconf-2.64..2.72 and automake-1.16.4..1.17 in the PATH. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2025 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/autopull.sh b/autopull.sh index ccaef8b..9c8e3a4 100755 --- a/autopull.sh +++ b/autopull.sh @@ -7,7 +7,7 @@ # in a gnulib checkout, or # - an internet connection. -# Copyright (C) 2003-2022 Free Software Foundation, Inc. +# Copyright (C) 2003-2025 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ GNULIB_REPO_URL="https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain; for file in build-aux/install-sh build-aux/mkinstalldirs \ build-aux/compile build-aux/ar-lib \ + m4/init-package-version.m4 \ lib/filename.h; do if test -n "$GNULIB_TOOL"; then $GNULIB_TOOL --copy-file $file $file diff --git a/build-aux/.gitignore b/build-aux/.gitignore index 0b7dfab..7fb1c0b 100644 --- a/build-aux/.gitignore +++ b/build-aux/.gitignore @@ -3,4 +3,7 @@ /mkinstalldirs /compile /ar-lib +# Files brought in by automake: +/depcomp +/missing diff --git a/lib/.gitignore b/lib/.gitignore index bf930a7..6006fb6 100644 --- a/lib/.gitignore +++ b/lib/.gitignore @@ -2,5 +2,8 @@ /filename.h # Files generated by the autotools: +/aclocal.m4 /configure +/config.h.in +/Makefile.in diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..81f482b --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,28 @@ +## Makefile for the lib subdirectory of GNU gperf. +## Copyright (C) 2025 Free Software Foundation, Inc. +## +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . + +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = 1.11 foreign + +noinst_LIBRARIES = libgp.a +libgp_a_SOURCES = \ + getopt.h getopt.c getopt1.c \ + getline.h getline.cc \ + hash.h hash.cc + +EXTRA_DIST = \ + filename.h diff --git a/lib/Makefile.in b/lib/Makefile.in deleted file mode 100644 index d89d84e..0000000 --- a/lib/Makefile.in +++ /dev/null @@ -1,136 +0,0 @@ -# Makefile for gperf/lib - -# Copyright (C) 1989, 1992-1993, 1998, 2002, 2006, 2009, 2012, 2016 Free Software Foundation, Inc. -# Written by Douglas C. Schmidt -# and Bruno Haible . -# -# This file is part of GNU GPERF. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -#### Start of system configuration section. #### - -# Directories used by "make": -srcdir = @srcdir@ - -# Directories used by "make install": -prefix = @prefix@ -local_prefix = /usr/local -exec_prefix = @exec_prefix@ - -# Programs used by "make": -# C compiler -CC = @CC@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -# C++ compiler -CXX = @CXX@ -CXXFLAGS = @CXXFLAGS@ -CXXCPP = @CXXCPP@ -# Both C and C++ compiler -OBJEXT = @OBJEXT@ -# Other -AR = @AR@ -AR_FLAGS = rc -RANLIB = @RANLIB@ -MV = mv -LN = ln -RM = rm -f -@SET_MAKE@ - -# Programs used by "make install": -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ - -#### End of system configuration section. #### - -SHELL = /bin/sh - -VPATH = $(srcdir) - -OBJECTS = getopt.$(OBJEXT) getopt1.$(OBJEXT) getline.$(OBJEXT) hash.$(OBJEXT) -CPPFLAGS = @CPPFLAGS@ -I$(srcdir) - -TARGETLIB = libgp.a - -all : $(TARGETLIB) - -$(TARGETLIB): $(OBJECTS) - $(RM) $@ - $(AR) $(AR_FLAGS) $@ $(OBJECTS) - $(RANLIB) $@ - -# Don't use implicit rules, since AIX "make" and OSF/1 "make" don't always -# expand $< correctly in this context. -# -#%.o : %.c -# $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -# -#%.o : %.cc -# $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< - -getopt.$(OBJEXT) : getopt.c getopt.h - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/getopt.c - -getopt1.$(OBJEXT) : getopt1.c getopt.h - $(CC) $(CFLAGS) $(CPPFLAGS) -c $(srcdir)/getopt1.c - -getline.$(OBJEXT) : getline.cc getline.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/getline.cc - -hash.$(OBJEXT) : hash.cc hash.h - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/hash.cc - -install : all - -installdirs : - -uninstall : - -check : all - -mostlyclean : clean - -clean : force - $(RM) *~ *.s *.$(OBJEXT) *.a $(TARGETLIB) core - -distclean : clean - $(RM) config.status config.log config.cache Makefile - -maintainer-clean : distclean - -# List of source files. -SOURCE_FILES = \ - configure.ac Makefile.in \ - getline.h getline.cc \ - hash.h hash.cc \ - getopt.h getopt.c getopt1.c -# List of distributed files imported from other packages. -IMPORTED_FILES = -# List of distributed files generated by autotools or Makefile.devel. -GENERATED_FILES = \ - configure -# List of distributed files generated by "make". -DISTRIBUTED_BUILT_FILES = -# List of distributed files. -DISTFILES = $(SOURCE_FILES) $(IMPORTED_FILES) $(GENERATED_FILES) $(DISTRIBUTED_BUILT_FILES) - -distdir : $(DISTFILES) - for file in $(DISTFILES); do \ - if test -f $$file; then dir='.'; else dir='$(srcdir)'; fi; \ - cp -p $$dir/$$file '$(distdir)'/$$file || exit 1; \ - done - -force : diff --git a/lib/configure.ac b/lib/configure.ac index 39e00d0..7d48226 100644 --- a/lib/configure.ac +++ b/lib/configure.ac @@ -1,6 +1,6 @@ dnl autoconf configuration for gperf/lib -dnl Copyright (C) 1998-2024 Free Software Foundation, Inc. +dnl Copyright (C) 1998-2025 Free Software Foundation, Inc. dnl Written by Douglas C. Schmidt dnl and Bruno Haible . dnl @@ -19,28 +19,26 @@ dnl dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . -AC_PREREQ([2.64]) -AC_INIT +AC_PREREQ([2.70]) +AC_INIT([gperf], [package]) AC_CONFIG_SRCDIR([hash.cc]) AC_CONFIG_AUX_DIR([../build-aux]) -AC_PROG_MAKE_SET +AC_CONFIG_MACRO_DIRS([../m4]) +VERSION_NUMBER=`sed -n -e 's/.*version_string = "\(.*\)".*/\1/p' < $srcdir/../src/version.cc` +gl_INIT_PACKAGE_VERSION([$VERSION_NUMBER]) +AM_INIT_AUTOMAKE +AC_CONFIG_HEADERS([config.h]) dnl dnl checks for programs dnl AC_PROG_CC dnl sets variable CC -AC_PROG_CPP - dnl sets variable CPP AC_PROG_CXX dnl sets variable CXX -AC_PROG_CXXCPP - dnl sets variable CXXCPP AC_CHECK_TOOL([AR], [ar]) dnl sets variable AR AC_PROG_RANLIB dnl sets variable RANLIB -AC_PROG_INSTALL - dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM dnl dnl That's it. dnl diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..9aa4127 --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,3 @@ +# Files brought in by gnulib-tool: +/init-package-version.m4 +