From 4391f98f7f7d0e3c659959386cc5660fb5c5e4d8 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 11 May 2026 18:07:57 +0200 Subject: [PATCH] gitcompile: extensions for gettext and error handling The gettextize script tends to suggest some solutions, but we are using them already. Signed-off-by: Jaroslav Kysela --- gitcompile | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/gitcompile b/gitcompile index ed5a73b..9081fb5 100755 --- a/gitcompile +++ b/gitcompile @@ -1,22 +1,37 @@ #!/bin/bash +error() { + echo "$@" + exit 1 +} + +GETTEXTIZE=$(which gettextize) + +if test -z "$GETTEXTIZE"; then + echo "gettextize not found" + exit 1 +fi if test -d ../alsa-lib/utils && ! test -r `aclocal --print-ac-dir`/alsa.m4; then ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ../alsa-lib/utils" fi # save original files to avoid stupid modifications by gettextize -cp Makefile.am Makefile.am.ok -cp configure.ac configure.ac.ok -gettextize -c -f --no-changelog +cp Makefile.am Makefile.am.ok || error "cp Makefile.am" +cp configure.ac configure.ac.ok || error "cp configure.ac" +# modify gettexize to not wait for Enter +grep -v -E "(/dev/tty|Press Return)" "$GETTEXTIZE" > gettextize || error "grep $GETTEXTIZE" +chmod 755 gettextize || error "chmod 755 gettexize" +./gettextize -c -f --no-changelog || error "gettexize" +rm ./gettextize echo "EXTRA_DIST = gettext.m4" > m4/Makefile.am cp Makefile.am.ok Makefile.am cp configure.ac.ok configure.ac touch ltconfig -libtoolize --force --copy --automake -aclocal $ACLOCAL_FLAGS -Im4 -autoheader -automake --foreign --copy --add-missing +libtoolize --force --copy --automake || error "libtoolize" +aclocal $ACLOCAL_FLAGS -Im4 || error "aclocal" +autoheader || error "autoheader" +automake --foreign --copy --add-missing || error "automake" touch depcomp # for older automake -autoconf +autoconf || error "autoconf" export CFLAGS='-O2 -Wall -W -Wunused-const-variable=0 -pipe -g' echo "CFLAGS=$CFLAGS" echo "./configure $@" -- 2.52.0