From fb2149fc2dc1d5f4936b2af31be7c7bd02f83324 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 9 Aug 2020 11:53:11 +0100 Subject: [PATCH] aclocal.glob, m4/: Split the monster into separate `aclocal'-ish files. Now these can be linked into a project's `m4/' directory in the usual way. Much better! This has just redistributed the existing content: none of the code is changed. --- aclocal.glob | 207 ----------------------------------------- m4/mdw-auto-version.m4 | 24 +++++ m4/mdw-decl-environ.m4 | 29 ++++++ m4/mdw-define-paths.m4 | 46 +++++++++ m4/mdw-dir-texmf.m4 | 30 ++++++ m4/mdw-libtool-version-info.m4 | 21 +++++ m4/mdw-manext.m4 | 17 ++++ m4/mdw-silent-rules.m4 | 19 ++++ 8 files changed, 186 insertions(+), 207 deletions(-) delete mode 100644 aclocal.glob create mode 100644 m4/mdw-auto-version.m4 create mode 100644 m4/mdw-decl-environ.m4 create mode 100644 m4/mdw-define-paths.m4 create mode 100644 m4/mdw-dir-texmf.m4 create mode 100644 m4/mdw-libtool-version-info.m4 create mode 100644 m4/mdw-manext.m4 create mode 100644 m4/mdw-silent-rules.m4 diff --git a/aclocal.glob b/aclocal.glob deleted file mode 100644 index 8aa3fcc..0000000 --- a/aclocal.glob +++ /dev/null @@ -1,207 +0,0 @@ -dnl -*-autoconf-*- *@--GLOB-HEADER--@* -dnl -dnl Common library of autoconf macros -dnl -dnl (c) 1997 Mark Wooding, except for macros and documentation where noted. -dnl - -dnl----- Licensing notice --------------------------------------------------- -dnl -dnl This file is part of the Common Files Distribution (`common') -dnl -dnl `Common' is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl `Common' is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with `common'; if not, write to the Free Software Foundation, -dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -dnl *@--NOTICE--@* Common File Distribution - -dnl --- *@-mdw_AUTO_VERSION-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_AUTO_VERSION -dnl -dnl Arguments: --- -dnl -dnl Use: Defines an m4 macro AUTO_VERSION which contains the current -dnl version number, worked out in some clever way. - -AC_DEFUN([mdw_AUTO_VERSION], [nobody cares...]) -m4_define([mdw_AUTO_VERSION], [m4_define([AUTO_VERSION], m4_esyscmd([ - ver=UNKNOWN - for pre in ./ config/; do - for post in "" .in; do - try=${pre}auto-version${post} - if test -x $try; then ver=$("$try"); break; fi - done - done - echo -n "$ver" -]))]) - -dnl --- *@-mdw_LIBTOOL_VERSION_INFO-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_LIBTOOL_VERSION -dnl -dnl Arguments: --- -dnl -dnl Use: Decodes the PACKAGE_VERSION variable as a libtool -dnl version-info string. Strictly speaking, this is very -dnl naughty. - -AC_DEFUN([mdw_LIBTOOL_VERSION_INFO], [ - set -- $(echo $PACKAGE_VERSION | - sed 's:[^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$]:\1 \2 \3:' - ) - LIBTOOL_VERSION_INFO="$(expr $[]1 + $[]2):$[]3:$[]2" - AC_SUBST([LIBTOOL_VERSION_INFO]) -]) - -dnl --- *@-mdw_SILENT_RULES-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_SILENT_RULES -dnl -dnl Arguments: --- -dnl -dnl Use: Enables the Automake `silent-rules' feature, if available. - -AC_DEFUN([mdw_SILENT_RULES], [ - m4_ifdef([AM_SILENT_RULES], [ - AM_SILENT_RULES([yes]) - ], [ - AC_SUBST([AM_DEFAULT_VERBOSITY], [1]) - ]) -]) - -dnl --- *@-mdw_DECL_ENVIRON-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_DECL_ENVIRON -dnl -dnl Arguments: --- -dnl -dnl Use: Searches for a declaration of the global `environ' variable. -dnl If one is found in one of the `usual' places, DECL_ENVIRON -dnl is defined as a preprocessor symbol. - -AC_DEFUN([mdw_DECL_ENVIRON], -[AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ, -[AC_EGREP_CPP([\], -[#include -#if HAVE_UNISTD_H -#include -#endif -#if STDC_HEADERS -#include -#include -#endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])]) -if test $mdw_cv_environ = yes; then - AC_DEFINE([DECL_ENVIRON], [1], - [Define if you have the `environ' vector of environment variables.]) -fi]) - -dnl --- *@-mdw_DEFINE_PATHS-@* -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_DEFINE_PATHS(CODE) -dnl -dnl Arguments: CODE = shell script code to execute -dnl -dnl Use: Fixes up various variables so that pathname defines can be -dnl defined. Within CODE, you may use the following macros: -dnl -dnl mdw_PROG(NAME) Transformed program name -dnl -dnl mdw_PATH(PATH) Expanded path (may contain variables) -dnl -dnl mdw_DEFINE_PROG(SYMBOL, PROG) -dnl Define a symbol as a transformed -dnl program name. -dnl -dnl mdw_DEFINE_PATH(SYMBOL, NAME) -dnl Define a symbol as an expanded path - -AC_DEFUN([mdw_DEFINE_PATHS], -[mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix -mdw_transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'` -test "$prefix" = "NONE" && prefix=$ac_default_prefix -test "$exec_prefix" = "NONE" && exec_prefix=$prefix -$1 -prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix]) - -AC_DEFUN([mdw_PROG], [`echo "$1"|sed "$mdw_transform"`]) -AC_DEFUN([mdw_PATH], [dnl -`t="$1"; dnl -while :; do dnl -case "$t" in dnl -*\\$[]*) t=\`eval echo "$t"\`;; dnl -*) break;; dnl -esac; done; dnl -echo "$t"`]) -AC_DEFUN([mdw_DEFINE_PROG], - [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"], - [Program name for $2.])]) -AC_DEFUN([mdw_DEFINE_PATH], [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"], - [Pathname for $2.])]) - -dnl --- *@-mdw_MANEXT-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_MANEXT -dnl -dnl Arguments: --- -dnl -dnl Use: Sets the substitution `manext' for man page extensions. - -AC_DEFUN([mdw_MANEXT], [ -AC_ARG_WITH([man-ext], -[ --with-man-ext=EXT give manpages the EXT extension (e.g., foo.3EXT)], -[manext=$withval], [manext=mLib]) -AC_SUBST(manext)]) - -dnl --- *@-mdw_DIR_TEXMF-@* --- -dnl -dnl Author: Mark Wooding -dnl -dnl Synopsis: mdw_DIR_TEXMF -dnl -dnl Arguments: --- -dnl -dnl Use: Sets the substitution `texmfdir' as a sensible TeX install -dnl tree. - -AC_DEFUN([mdw_DIR_TEXMF], [ -AC_ARG_WITH([texmfdir], -[ --with-texmfdir=DIR set the TeX install directory to DIR], -[texmfdir=$withval], -[AC_MSG_CHECKING([where to put installed TeX files]) -mdw_DEFINE_PATHS([ -texmfdir='${datadir}/texmf' -for d in \ - '${datadir}/texmf' '${prefix}/lib/texmf' \ - '${prefix}/texmf' '${libdir}/lib/texmf'; do - if test -d "mdw_PATH([$d])"; then - texmfdir=$d - break - fi -done -AC_MSG_RESULT([$texmfdir])])]) -AC_SUBST(texmfdir)]) - -dnl----- That's all, folks --------------------------------- *@--GLOB-END--@* diff --git a/m4/mdw-auto-version.m4 b/m4/mdw-auto-version.m4 new file mode 100644 index 0000000..bdc48cf --- /dev/null +++ b/m4/mdw-auto-version.m4 @@ -0,0 +1,24 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_AUTO_VERSION-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_AUTO_VERSION +dnl +dnl Arguments: --- +dnl +dnl Use: Defines an m4 macro AUTO_VERSION which contains the current +dnl version number, worked out in some clever way. + +AC_DEFUN([mdw_AUTO_VERSION], [nobody cares...]) +m4_define([mdw_AUTO_VERSION], [m4_define([AUTO_VERSION], m4_esyscmd([ + ver=UNKNOWN + for pre in ./ config/; do + for post in "" .in; do + try=${pre}auto-version${post} + if test -x $try; then ver=$("$try"); break; fi + done + done + echo -n "$ver" +]))]) diff --git a/m4/mdw-decl-environ.m4 b/m4/mdw-decl-environ.m4 new file mode 100644 index 0000000..880e499 --- /dev/null +++ b/m4/mdw-decl-environ.m4 @@ -0,0 +1,29 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_DECL_ENVIRON-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_DECL_ENVIRON +dnl +dnl Arguments: --- +dnl +dnl Use: Searches for a declaration of the global `environ' variable. +dnl If one is found in one of the `usual' places, DECL_ENVIRON +dnl is defined as a preprocessor symbol. + +AC_DEFUN([mdw_DECL_ENVIRON], +[AC_CACHE_CHECK([for declaration of \`environ'], mdw_cv_environ, +[AC_EGREP_CPP([\], +[#include +#if HAVE_UNISTD_H +#include +#endif +#if STDC_HEADERS +#include +#include +#endif], [mdw_cv_environ=yes], [mdw_cv_environ=no])]) +if test $mdw_cv_environ = yes; then + AC_DEFINE([DECL_ENVIRON], [1], + [Define if you have the `environ' vector of environment variables.]) +fi]) diff --git a/m4/mdw-define-paths.m4 b/m4/mdw-define-paths.m4 new file mode 100644 index 0000000..d3089e6 --- /dev/null +++ b/m4/mdw-define-paths.m4 @@ -0,0 +1,46 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_DEFINE_PATHS-@* +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_DEFINE_PATHS(CODE) +dnl +dnl Arguments: CODE = shell script code to execute +dnl +dnl Use: Fixes up various variables so that pathname defines can be +dnl defined. Within CODE, you may use the following macros: +dnl +dnl mdw_PROG(NAME) Transformed program name +dnl +dnl mdw_PATH(PATH) Expanded path (may contain variables) +dnl +dnl mdw_DEFINE_PROG(SYMBOL, PROG) +dnl Define a symbol as a transformed +dnl program name. +dnl +dnl mdw_DEFINE_PATH(SYMBOL, NAME) +dnl Define a symbol as an expanded path + +AC_DEFUN([mdw_DEFINE_PATHS], +[mdw_prefix=$prefix mdw_exec_prefix=$exec_prefix +mdw_transform=`echo "$program_transform_name"|sed 's,\\\\\\\\,\\\\,g; s,\\$\\$,$,g'` +test "$prefix" = "NONE" && prefix=$ac_default_prefix +test "$exec_prefix" = "NONE" && exec_prefix=$prefix +$1 +prefix=$mdw_prefix exec_prefix=$mdw_exec_prefix]) + +AC_DEFUN([mdw_PROG], [`echo "$1"|sed "$mdw_transform"`]) +AC_DEFUN([mdw_PATH], [dnl +`t="$1"; dnl +while :; do dnl +case "$t" in dnl +*\\$[]*) t=\`eval echo "$t"\`;; dnl +*) break;; dnl +esac; done; dnl +echo "$t"`]) +AC_DEFUN([mdw_DEFINE_PROG], + [AC_DEFINE_UNQUOTED([$1], ["mdw_PROG([$2])"], + [Program name for $2.])]) +AC_DEFUN([mdw_DEFINE_PATH], [AC_DEFINE_UNQUOTED([$1], ["mdw_PATH([$2])"], + [Pathname for $2.])]) diff --git a/m4/mdw-dir-texmf.m4 b/m4/mdw-dir-texmf.m4 new file mode 100644 index 0000000..6e1c0ee --- /dev/null +++ b/m4/mdw-dir-texmf.m4 @@ -0,0 +1,30 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_DIR_TEXMF-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_DIR_TEXMF +dnl +dnl Arguments: --- +dnl +dnl Use: Sets the substitution `texmfdir' as a sensible TeX install +dnl tree. + +AC_DEFUN([mdw_DIR_TEXMF], [ +AC_ARG_WITH([texmfdir], +[ --with-texmfdir=DIR set the TeX install directory to DIR], +[texmfdir=$withval], +[AC_MSG_CHECKING([where to put installed TeX files]) +mdw_DEFINE_PATHS([ +texmfdir='${datadir}/texmf' +for d in \ + '${datadir}/texmf' '${prefix}/lib/texmf' \ + '${prefix}/texmf' '${libdir}/lib/texmf'; do + if test -d "mdw_PATH([$d])"; then + texmfdir=$d + break + fi +done +AC_MSG_RESULT([$texmfdir])])]) +AC_SUBST(texmfdir)]) diff --git a/m4/mdw-libtool-version-info.m4 b/m4/mdw-libtool-version-info.m4 new file mode 100644 index 0000000..2f19157 --- /dev/null +++ b/m4/mdw-libtool-version-info.m4 @@ -0,0 +1,21 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_LIBTOOL_VERSION_INFO-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_LIBTOOL_VERSION +dnl +dnl Arguments: --- +dnl +dnl Use: Decodes the PACKAGE_VERSION variable as a libtool +dnl version-info string. Strictly speaking, this is very +dnl naughty. + +AC_DEFUN([mdw_LIBTOOL_VERSION_INFO], [ + set -- $(echo $PACKAGE_VERSION | + sed 's:[^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$]:\1 \2 \3:' + ) + LIBTOOL_VERSION_INFO="$(expr $[]1 + $[]2):$[]3:$[]2" + AC_SUBST([LIBTOOL_VERSION_INFO]) +]) diff --git a/m4/mdw-manext.m4 b/m4/mdw-manext.m4 new file mode 100644 index 0000000..5b35426 --- /dev/null +++ b/m4/mdw-manext.m4 @@ -0,0 +1,17 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_MANEXT-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_MANEXT +dnl +dnl Arguments: --- +dnl +dnl Use: Sets the substitution `manext' for man page extensions. + +AC_DEFUN([mdw_MANEXT], [ +AC_ARG_WITH([man-ext], +[ --with-man-ext=EXT give manpages the EXT extension (e.g., foo.3EXT)], +[manext=$withval], [manext=mLib]) +AC_SUBST(manext)]) diff --git a/m4/mdw-silent-rules.m4 b/m4/mdw-silent-rules.m4 new file mode 100644 index 0000000..dbc877e --- /dev/null +++ b/m4/mdw-silent-rules.m4 @@ -0,0 +1,19 @@ +dnl -*-autoconf-*- + +dnl --- *@-mdw_SILENT_RULES-@* --- +dnl +dnl Author: Mark Wooding +dnl +dnl Synopsis: mdw_SILENT_RULES +dnl +dnl Arguments: --- +dnl +dnl Use: Enables the Automake `silent-rules' feature, if available. + +AC_DEFUN([mdw_SILENT_RULES], [ + m4_ifdef([AM_SILENT_RULES], [ + AM_SILENT_RULES([yes]) + ], [ + AC_SUBST([AM_DEFAULT_VERBOSITY], [1]) + ]) +]) -- 2.11.0