Skip to content

Commit

Permalink
more fixes to the autoconf process added, and improvements to distcheck
Browse files Browse the repository at this point in the history
autoconf 2.70 and gettext makes it difficult to avoid adding version.
Had to settle on using autoconf 2.70 (or higher)
and using AM_GNU_GETTEXT_VERSION(0.21) in configure.ac

Also made some further improvements to autogen.sh since it was still
requesting/requiring intltools when it should now be using gettext.

Also added 3 m4 files which appeared to be requested by autogen.sh

Duplicated the SNIPPETs used in fix-ca to help 'make distcheck'
  • Loading branch information
JoesCat committed Oct 28, 2023
1 parent bec5853 commit a05c181
Show file tree
Hide file tree
Showing 12 changed files with 306 additions and 45 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install autoconf automake libtool gcc gettext libfftw3-dev libgimp2.0-dev libgsl-dev texlive-latex-base texlive-fonts-recommended
aclocal --force
autoconf -f
autoreconf -i
automake --add-missing
- name: Choose configure
run: ./configure ${{ matrix.choiceL }}
Expand All @@ -23,7 +22,6 @@ jobs:
- name: Test make strip
if: matrix.choiceL == '--disable-silent-rules'
run: make strip
# ignore: main.yml trouble processing this distcheck
# - name: Test make distcheck
# if: matrix.choiceL == '--disable-silent-rules'
# run: make distcheck
- name: Test make distcheck
if: matrix.choiceL == '--disable-silent-rules'
run: make distcheck
31 changes: 17 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@ EXTRA_DIST = \
Makefile.mingw \
config.h.win32 \
config.rpath \
m4/codeset.m4 \
m4/gettext.m4 \
m4/iconv.m4 \
m4/lib-ld.m4 \
m4/lib-prefix.m4 \
m4/po.m4 \
m4/glibc21.m4 \
m4/host-cpu-c-abi.m4 \
m4/iconv.m4 \
m4/intlmacosx.m4 \
m4/lcmessage.m4 \
m4/lib-ld.m4 \
m4/lib-link.m4 \
m4/lib-prefix.m4 \
m4/nls.m4 \
m4/po.m4 \
m4/progtest.m4 \
po/*.po po/*.gmo \
m4/host-cpu-c-abi.m4 \
po/de.po \
po/ru.po \
po/de.gmo \
po/ru.gmo \
po/boldquot.sed \
po/[email protected] \
po/[email protected] \
Expand All @@ -28,19 +35,15 @@ EXTRA_DIST = \
po/Makefile.in \
po/Makefile.in.in \
po/Makevars \
po/POTFILES* \
po/Makevars.template \
po/POTFILES \
po/POTFILES.in \
po/quot.sed \
po/remove-potcdate.sed \
po/remove-potcdate.sin \
po/Rules-quot \
rpm/gimp-plugin-astronomy.spec.in \
rpm/gimp-plugin-astronomy.spec \
scripts/background_gradient_batch.scm \
scripts/border_information.scm \
scripts/brightness_contrast_batch.scm \
scripts/dark_subtraction.scm \
scripts/flat_division.scm \
scripts/mode_batch.scm \
scripts/normalize_batch.scm
rpm/gimp-plugin-astronomy.spec

nodist_EXTRA_DATA = .git .github

Expand Down
33 changes: 15 additions & 18 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
# tools and you shouldn't use this script. Just call ./configure
# directly.

PROJECT="GIMP Plug-In Astronomy"
PROJECT="gimp-plugin-astronomy"
TEST_TYPE=-f
FILE=src/alignment.c

AUTOCONF_REQUIRED_VERSION=2.54
AUTOMAKE_REQUIRED_VERSION=1.10
GLIB_REQUIRED_VERSION=2.0.0
INTLTOOL_REQUIRED_VERSION=0.17
AUTOCONF_REQUIRED_VERSION=2.70
AUTOMAKE_REQUIRED_VERSION=1.16.3
GLIB_REQUIRED_VERSION=2.66.8
GETTEXT_REQUIRED_VERSION=0.21

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
Expand All @@ -34,7 +34,7 @@ check_version ()

echo
echo "I am testing that you have the required versions of autoconf,"
echo "automake, glib-gettextize and intltoolize..."
echo "automake, glib-gettextize and gettext..."
echo

DIE=0
Expand All @@ -58,7 +58,7 @@ if (automake --version) < /dev/null > /dev/null 2>&1; then
ACLOCAL=aclocal
else
echo
echo " You must have automake 1.6 or newer installed to compile $PROJECT."
echo " You must have automake 1.16.3 or newer installed to compile $PROJECT."
echo " Download the appropriate package for your distribution,"
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/"
DIE=1
Expand All @@ -83,16 +83,16 @@ else
DIE=1
fi

echo -n "checking for intltool >= $INTLTOOL_REQUIRED_VERSION ... "
if (intltoolize --version) < /dev/null > /dev/null 2>&1; then
VER=`intltoolize --version \
| grep intltoolize | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $INTLTOOL_REQUIRED_VERSION
echo -n "checking for gettext >= $GETTEXT_REQUIRED_VERSION ... "
if (gettext --version) < /dev/null > /dev/null 2>&1; then
VER=`gettext --version \
| grep gettext | sed "s/.* \([0-9.]*\)/\1/"`
check_version $VER $GETTEXT_REQUIRED_VERSION
else
echo
echo " You must have intltool installed to compile $PROJECT."
echo " You must have gettext installed to compile $PROJECT."
echo " Get the latest version from"
echo " ftp://ftp.gnome.org/pub/GNOME/sources/intltool/"
echo " ftp.gnu.org/gnu/gettext/"
DIE=1
fi

Expand Down Expand Up @@ -155,11 +155,8 @@ fi
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader || exit 1

autoreconf -i || exit 1
$AUTOMAKE --add-missing || exit 1
autoconf || exit 1

glib-gettextize --copy --force || exit 1
intltoolize --copy --force --automake || exit 1

cd $ORIGDIR

Expand Down
26 changes: 24 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
dnl Process this file with autoconf -f to produce a configure script.

AC_PREREQ([2.68])
AC_PREREQ([2.70])

dnl Name your plug-in here
m4_define([plugin_name], [gimp-plugin-astronomy])
Expand All @@ -24,7 +24,6 @@ AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AC_USE_SYSTEM_EXTENSIONS
AM_MAINTAINER_MODE([enable])
AM_GNU_GETTEXT_VERSION
AM_INIT_AUTOMAKE([foreign -Wall])

m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Expand Down Expand Up @@ -123,12 +122,35 @@ AC_DEFINE(PLUGIN_MINOR_VERSION, ["plugin_minor_version"], [Plug-In minor version
GETTEXT_PACKAGE=gimp-plugin-astronomy
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [The gettext translation domain.])
AM_GNU_GETTEXT_VERSION(0.21)
AM_GNU_GETTEXT([external])

AC_SUBST([PLUGIN_NAME],[plugin_name])
AC_SUBST([PLUGIN_PACKAGE_NAME],[plugin_package_name])
AC_SUBST([PLUGIN_VERSION],[plugin_version])

dnl Do this here since automake can't process 'if/else/endif in Makefile.am
SNIPPET1='
noinst_PROGRAMS =
ifeq ($(shell id -u),0)
bindir = $(GIMP_LIBDIR)/plug-ins/astronomy
else
noinst_PROGRAMS += $(bin_PROGRAMS)
endif
'
AC_SUBST([SNIPPET1])
AM_SUBST_NOTMAKE([SNIPPET1])
SNIPPET2='
noinst_SCRIPTS =
ifeq ($(shell id -u),0)
scmdir = $(GIMP_DATADIR)/scripts/astronomy
else
noinst_SCRIPTS += $(scm_SCRIPTS)
endif
'
AC_SUBST([SNIPPET2])
AM_SUBST_NOTMAKE([SNIPPET2])

AC_CONFIG_FILES([
Makefile
doc/Makefile
Expand Down
23 changes: 23 additions & 0 deletions m4/codeset.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# codeset.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl From Bruno Haible.

AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], [am_cv_langinfo_codeset],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <langinfo.h>]],
[[char* cs = nl_langinfo(CODESET); return !cs;]])],
[am_cv_langinfo_codeset=yes],
[am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
34 changes: 34 additions & 0 deletions m4/glibc21.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# glibc21.m4 serial 5
dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2014 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

# Test for the GNU C Library, version 2.1 or newer, or uClibc.
# From Bruno Haible.

AC_DEFUN([gl_GLIBC21],
[
AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
[ac_cv_gnu_library_2_1],
[AC_EGREP_CPP([Lucky],
[
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
Lucky GNU user
#endif
#endif
#ifdef __UCLIBC__
Lucky user
#endif
],
[ac_cv_gnu_library_2_1=yes],
[ac_cv_gnu_library_2_1=no])
]
)
AC_SUBST([GLIBC21])
GLIBC21="$ac_cv_gnu_library_2_1"
]
)
35 changes: 35 additions & 0 deletions m4/lcmessage.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# lcmessage.m4 serial 7 (gettext-0.18.2)
dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.

dnl Authors:
dnl Ulrich Drepper <[email protected]>, 1995.

# Check whether LC_MESSAGES is available in <locale.h>.

AC_DEFUN([gt_LC_MESSAGES],
[
AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <locale.h>]],
[[return LC_MESSAGES]])],
[gt_cv_val_LC_MESSAGES=yes],
[gt_cv_val_LC_MESSAGES=no])])
if test $gt_cv_val_LC_MESSAGES = yes; then
AC_DEFINE([HAVE_LC_MESSAGES], [1],
[Define if your <locale.h> file defines LC_MESSAGES.])
fi
])
4 changes: 2 additions & 2 deletions po/Makevars
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# unlimited permission to use, copy, distribute, and modify it.

# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
DOMAIN = $(PLUGIN_NAME)

# These two variables depend on the location of this directory.
subdir = po
Expand Down Expand Up @@ -79,4 +79,4 @@ PO_DEPENDS_ON_POT = yes
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes
DIST_DEPENDS_ON_UPDATE_PO = no
82 changes: 82 additions & 0 deletions po/Makevars.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Makefile variables for PO directory in any package using GNU gettext.
#
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation gives
# unlimited permission to use, copy, distribute, and modify it.

# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)

# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..

# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_

# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
# package. (Note that the msgstr strings, extracted from the package's
# sources, belong to the copyright holder of the package.) Translators are
# expected to transfer the copyright for their translations to this person
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER = Free Software Foundation, Inc.

# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU =

# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
# - Strings which are not entire sentences, see the maintainer guidelines
# in the GNU gettext documentation, section 'Preparing Strings'.
# - Strings which use unclear terms or require additional context to be
# understood.
# - Strings which make invalid assumptions about notation of date, time or
# money.
# - Pluralisation problems.
# - Incorrect English spelling.
# - Incorrect formatting.
# It can be your email address, or a mailing list address where translators
# can write to without being subscribed, or the URL of a web page through
# which the translators can contact you.
MSGID_BUGS_ADDRESS =

# This is the list of locale categories, beyond LC_MESSAGES, for which the
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =

# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no

# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS =

# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
MSGINIT_OPTIONS =

# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes

# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes
Loading

0 comments on commit a05c181

Please sign in to comment.