mirror of
https://https.git.savannah.gnu.org/git/gettext.git
synced 2026-01-26 15:39:11 +00:00
* gettext-tools/examples/hello-d/INSTALL: New file. * gettext-tools/examples/hello-d/autogen.sh: New file. * gettext-tools/examples/hello-d/autoclean.sh: New file. * gettext-tools/examples/hello-d/hello.d.in: New file. * gettext-tools/examples/hello-d/Makefile.am: New file. * gettext-tools/examples/hello-d/configure.ac: New file. * gettext-tools/examples/hello-d/m4/Makefile.am: New file. * gettext-tools/examples/hello-d/po/LINGUAS: New file. * gettext-tools/examples/hello-d/po/Makefile.am: New file. * gettext-tools/examples/installpaths.in: Define also includedir. * gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Add hello-d. * gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS): Update for hello-d. (hello-d.pot): New target. (SMALLPOFILES_FOR_lang): Update for hello-d. ($(srcdir)/../hello-d/po/$(LL).po): New rule. * gettext-tools/examples/check-examples (func_check_autoclean_all, func_check_distclean_all, func_check_maintainerclean_all, func_check_maintainerclean_vpath_all, func_check_dist_all, func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all, func_check_distcheck_all, func_check_all): Handle hello-d as well. * gettext-tools/examples/README: Mention hello-d. * gettext-tools/doc/lang-d.texi: Likewise. * NEWS: Likewise.
919 lines
29 KiB
Bash
Executable File
919 lines
29 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script that checks against build infrastructure mistakes in the examples.
|
|
|
|
# Copyright (C) 2018-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 <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
# func_init sample
|
|
# sets environment variables for building and running the given sample.
|
|
func_init ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep) . /usr/share/GNUstep/Makefiles/GNUstep.sh ;;
|
|
esac
|
|
}
|
|
|
|
|
|
# func_autogen sample
|
|
# adds generated build infrastructure files to the given sample.
|
|
func_autogen ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep)
|
|
(func_init "$1"; cd "$1" && ./autogen.sh)
|
|
;;
|
|
*)
|
|
(cd "$1" && ./autogen.sh)
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# func_autoclean sample
|
|
# removes generated build infrastructure files from the given sample.
|
|
func_autoclean ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep)
|
|
(func_init "$1"; cd "$1" && ./autoclean.sh)
|
|
;;
|
|
*)
|
|
(cd "$1" && ./autoclean.sh)
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# func_configure sample [builddir]
|
|
# runs configure for the given sample, optionally in a VPATH build.
|
|
func_configure ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
if test -n "$2"; then
|
|
(cd "$1"
|
|
mkdir "$2"
|
|
(cd "$2" && ../configure)
|
|
)
|
|
else
|
|
(cd "$1" && ./configure)
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# func_distclean sample [builddir]
|
|
# undoes the effects of func_configure sample [builddir].
|
|
func_distclean ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
if test -n "$2"; then
|
|
(cd "$1/$2" && make distclean)
|
|
else
|
|
(cd "$1" && make distclean)
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
# func_maintainerclean sample [builddir]
|
|
# also removes files that are expensive to rebuild.
|
|
func_maintainerclean ()
|
|
{
|
|
case "$1" in
|
|
hello-objc-gnustep)
|
|
(func_init "$1"; cd "$1" && make distclean)
|
|
;;
|
|
*)
|
|
if test -n "$2"; then
|
|
(cd "$1/$2" && make maintainer-clean)
|
|
else
|
|
(cd "$1" && make maintainer-clean)
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
|
|
# func_check_autoclean sample
|
|
# checks whether the autoclean.sh script is complete.
|
|
func_check_autoclean ()
|
|
{
|
|
sample="$1"
|
|
rm -rf "$sample.bak"
|
|
cp -a "$sample" "$sample.bak"
|
|
func_autogen "$sample"
|
|
func_autoclean "$sample"
|
|
LC_ALL=C diff -r -q "$sample.bak" "$sample" | sed -n -e 's/^Only in //p' | sed -e 's|: |/|' > "$sample.out"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
rm -rf "$sample.bak"
|
|
}
|
|
|
|
func_check_autoclean_all ()
|
|
{
|
|
rm -f hello-*.out
|
|
func_check_autoclean hello-c
|
|
func_check_autoclean hello-c-gnome2
|
|
func_check_autoclean hello-c-gnome3
|
|
func_check_autoclean hello-c-http
|
|
func_check_autoclean hello-c++
|
|
func_check_autoclean hello-c++20
|
|
func_check_autoclean hello-c++-qt
|
|
func_check_autoclean hello-c++-kde
|
|
func_check_autoclean hello-c++-gnome2
|
|
func_check_autoclean hello-c++-gnome3
|
|
func_check_autoclean hello-c++-wxwidgets
|
|
func_check_autoclean hello-objc
|
|
func_check_autoclean hello-objc-gnustep
|
|
func_check_autoclean hello-objc-gnome2
|
|
func_check_autoclean hello-python
|
|
func_check_autoclean hello-java
|
|
func_check_autoclean hello-java-awt
|
|
func_check_autoclean hello-java-swing
|
|
func_check_autoclean hello-java-qtjambi
|
|
func_check_autoclean hello-csharp
|
|
func_check_autoclean hello-csharp-forms
|
|
func_check_autoclean hello-guile
|
|
func_check_autoclean hello-clisp
|
|
func_check_autoclean hello-librep
|
|
func_check_autoclean hello-rust
|
|
func_check_autoclean hello-go
|
|
func_check_autoclean hello-go-http
|
|
func_check_autoclean hello-ruby
|
|
func_check_autoclean hello-sh
|
|
func_check_autoclean hello-gawk
|
|
func_check_autoclean hello-pascal
|
|
func_check_autoclean hello-d
|
|
func_check_autoclean hello-smalltalk
|
|
func_check_autoclean hello-tcl
|
|
func_check_autoclean hello-tcl-tk
|
|
func_check_autoclean hello-perl
|
|
func_check_autoclean hello-php
|
|
func_check_autoclean hello-ycp
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_autoclean error: Leftover files:"
|
|
cat hello-*.out
|
|
rm -f hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# Known configure failures:
|
|
# hello-c-gnome2: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install
|
|
# hello-c-gnome3: error: can't find gtk+-3.0 >= 3.10
|
|
# hello-c++-qt: error: cannot find correct Qt headers!
|
|
# hello-c++-kde: configure: error: Qt (>= Qt 3.1.0) (headers and libraries) not found. Please check your installation!
|
|
# hello-c++-gnome2: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install
|
|
# hello-objc-gnome2: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install
|
|
# hello-ycp: *** Essential program y2base not found
|
|
|
|
# func_check_distclean sample
|
|
# checks 'make distclean' directly after 'configure'.
|
|
func_check_distclean ()
|
|
{
|
|
sample="$1"
|
|
rm -rf "$sample.bak"
|
|
func_autogen "$sample"
|
|
cp -a "$sample" "$sample.bak"
|
|
if func_configure "$sample" > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
func_distclean "$sample"
|
|
LC_ALL=C diff -r -q "$sample.bak" "$sample" | sed -n -e 's/^Only in //p' | sed -e 's|: |/|' > "$sample.out"
|
|
fi
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
rm -rf "$sample.bak"
|
|
}
|
|
|
|
func_check_distclean_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
func_check_distclean hello-c
|
|
#func_check_distclean hello-c-gnome2
|
|
#func_check_distclean hello-c-gnome3
|
|
func_check_distclean hello-c-http
|
|
func_check_distclean hello-c++
|
|
func_check_distclean hello-c++20
|
|
#func_check_distclean hello-c++-qt
|
|
#func_check_distclean hello-c++-kde
|
|
#func_check_distclean hello-c++-gnome2
|
|
#func_check_distclean hello-c++-gnome3
|
|
func_check_distclean hello-c++-wxwidgets
|
|
func_check_distclean hello-objc
|
|
func_check_distclean hello-objc-gnustep
|
|
#func_check_distclean hello-objc-gnome2
|
|
func_check_distclean hello-python
|
|
func_check_distclean hello-java
|
|
func_check_distclean hello-java-awt
|
|
func_check_distclean hello-java-swing
|
|
func_check_distclean hello-java-qtjambi
|
|
func_check_distclean hello-csharp
|
|
func_check_distclean hello-csharp-forms
|
|
func_check_distclean hello-guile
|
|
func_check_distclean hello-clisp
|
|
func_check_distclean hello-librep
|
|
func_check_distclean hello-rust
|
|
func_check_distclean hello-go
|
|
func_check_distclean hello-go-http
|
|
func_check_distclean hello-ruby
|
|
func_check_distclean hello-sh
|
|
func_check_distclean hello-gawk
|
|
func_check_distclean hello-pascal
|
|
func_check_distclean hello-d
|
|
func_check_distclean hello-smalltalk
|
|
func_check_distclean hello-tcl
|
|
func_check_distclean hello-tcl-tk
|
|
func_check_distclean hello-perl
|
|
func_check_distclean hello-php
|
|
#func_check_distclean hello-ycp
|
|
if (shopt -s failglob; echo hello-*.log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_distclean error: 'configure' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_distclean error: incomplete 'make distclean'"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# Known make failures:
|
|
# hello-java-qtjambi: error: package com.trolltech.qt.core does not exist
|
|
|
|
# func_check_maintainerclean sample
|
|
# checks 'make distclean' after 'configure; make'.
|
|
func_check_maintainerclean ()
|
|
{
|
|
sample="$1"
|
|
rm -rf "$sample.bak"
|
|
func_autogen "$sample"
|
|
cp -a "$sample" "$sample.bak"
|
|
if func_configure "$sample"; then
|
|
if (func_init "$sample"; cd "$sample" && make) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
fi
|
|
fi
|
|
func_maintainerclean "$sample"
|
|
# TODO: Remove .pot files workaround after next release.
|
|
# TODO: Remove .po~ files workaround.
|
|
LC_ALL=C diff -r -q "$sample.bak" "$sample" | sed -n -e 's/^Only in //p' | sed -e 's|: |/|' | grep "^${sample}/" | { if test -f "$sample"/po/Makevars || test "$sample" = hello-objc-gnustep; then grep -v '\.pot$'; else cat; fi; } | grep -v '\.po~$' > "$sample.out"
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
rm -rf "$sample.bak"
|
|
}
|
|
|
|
func_check_maintainerclean_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
func_check_maintainerclean hello-c
|
|
#func_check_maintainerclean hello-c-gnome2
|
|
#func_check_maintainerclean hello-c-gnome3
|
|
func_check_maintainerclean hello-c-http
|
|
func_check_maintainerclean hello-c++
|
|
func_check_maintainerclean hello-c++20
|
|
#func_check_maintainerclean hello-c++-qt
|
|
#func_check_maintainerclean hello-c++-kde
|
|
#func_check_maintainerclean hello-c++-gnome2
|
|
#func_check_maintainerclean hello-c++-gnome3
|
|
func_check_maintainerclean hello-c++-wxwidgets
|
|
func_check_maintainerclean hello-objc
|
|
func_check_maintainerclean hello-objc-gnustep
|
|
#func_check_maintainerclean hello-objc-gnome2
|
|
func_check_maintainerclean hello-python
|
|
func_check_maintainerclean hello-java
|
|
func_check_maintainerclean hello-java-awt
|
|
func_check_maintainerclean hello-java-swing
|
|
#func_check_maintainerclean hello-java-qtjambi
|
|
func_check_maintainerclean hello-csharp
|
|
func_check_maintainerclean hello-csharp-forms
|
|
func_check_maintainerclean hello-guile
|
|
func_check_maintainerclean hello-clisp
|
|
func_check_maintainerclean hello-librep
|
|
func_check_maintainerclean hello-rust
|
|
func_check_maintainerclean hello-go
|
|
func_check_maintainerclean hello-go-http
|
|
func_check_maintainerclean hello-ruby
|
|
func_check_maintainerclean hello-sh
|
|
func_check_maintainerclean hello-gawk
|
|
func_check_maintainerclean hello-pascal
|
|
func_check_maintainerclean hello-d
|
|
func_check_maintainerclean hello-smalltalk
|
|
func_check_maintainerclean hello-tcl
|
|
func_check_maintainerclean hello-tcl-tk
|
|
func_check_maintainerclean hello-perl
|
|
func_check_maintainerclean hello-php
|
|
#func_check_maintainerclean hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_maintainerclean error: 'make' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_maintainerclean error: incomplete 'make maintainer-clean'"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# func_check_maintainerclean_vpath sample
|
|
# checks 'make distclean' after 'configure; make' with a VPATH build.
|
|
func_check_maintainerclean_vpath ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
rm -rf "$sample.bak"
|
|
func_autogen "$sample"
|
|
cp -a "$sample" "$sample.bak"
|
|
if func_configure "$sample" build; then
|
|
if (func_init "$sample"; cd "$sample"/build && make) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
fi
|
|
fi
|
|
func_maintainerclean "$sample" build
|
|
# TODO: Remove .pot files workaround after next release.
|
|
# TODO: Remove .po~ files workaround.
|
|
find "$sample"/build -type f | LC_ALL=C sort | { if test -f "$sample"/po/Makevars; then grep -v '\.pot$'; else cat; fi; } | grep -v '\.po~$' > "$sample.out"
|
|
rm -rf "$sample"/build
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
rm -rf "$sample.bak"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_maintainerclean_vpath_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
func_check_maintainerclean_vpath hello-c
|
|
#func_check_maintainerclean_vpath hello-c-gnome2
|
|
#func_check_maintainerclean_vpath hello-c-gnome3
|
|
func_check_maintainerclean_vpath hello-c-http
|
|
func_check_maintainerclean_vpath hello-c++
|
|
func_check_maintainerclean_vpath hello-c++20
|
|
#func_check_maintainerclean_vpath hello-c++-qt
|
|
#func_check_maintainerclean_vpath hello-c++-kde
|
|
#func_check_maintainerclean_vpath hello-c++-gnome2
|
|
#func_check_maintainerclean_vpath hello-c++-gnome3
|
|
func_check_maintainerclean_vpath hello-c++-wxwidgets
|
|
func_check_maintainerclean_vpath hello-objc
|
|
func_check_maintainerclean_vpath hello-objc-gnustep
|
|
#func_check_maintainerclean_vpath hello-objc-gnome2
|
|
func_check_maintainerclean_vpath hello-python
|
|
func_check_maintainerclean_vpath hello-java
|
|
func_check_maintainerclean_vpath hello-java-awt
|
|
func_check_maintainerclean_vpath hello-java-swing
|
|
#func_check_maintainerclean_vpath hello-java-qtjambi
|
|
func_check_maintainerclean_vpath hello-csharp
|
|
func_check_maintainerclean_vpath hello-csharp-forms
|
|
func_check_maintainerclean_vpath hello-guile
|
|
func_check_maintainerclean_vpath hello-clisp
|
|
func_check_maintainerclean_vpath hello-librep
|
|
func_check_maintainerclean_vpath hello-rust
|
|
func_check_maintainerclean_vpath hello-go
|
|
func_check_maintainerclean_vpath hello-go-http
|
|
func_check_maintainerclean_vpath hello-ruby
|
|
func_check_maintainerclean_vpath hello-sh
|
|
func_check_maintainerclean_vpath hello-gawk
|
|
func_check_maintainerclean_vpath hello-pascal
|
|
func_check_maintainerclean_vpath hello-d
|
|
func_check_maintainerclean_vpath hello-smalltalk
|
|
func_check_maintainerclean_vpath hello-tcl
|
|
func_check_maintainerclean_vpath hello-tcl-tk
|
|
func_check_maintainerclean_vpath hello-perl
|
|
func_check_maintainerclean_vpath hello-php
|
|
#func_check_maintainerclean_vpath hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_maintainerclean_vpath error: 'make' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_maintainerclean_vpath error: incomplete 'make maintainer-clean'"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# func_check_dist sample
|
|
# checks 'make dist' after 'configure; make'.
|
|
func_check_dist ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
func_autogen "$sample"
|
|
if func_configure "$sample"; then
|
|
if (func_init "$sample"; cd "$sample" && make); then
|
|
if (func_init "$sample"; cd "$sample" && make dist) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
(func_init "$sample"; cd "$sample" && make distclean)
|
|
rm -f `find "$sample" -name '*~'` `find "$sample" -name '*.orig'`
|
|
rm -rf "$sample/autom4te.cache"
|
|
if test -f "$sample/$sample-0.tar.gz"; then
|
|
(cd "$sample" && tar xfz "$sample-0.tar.gz")
|
|
LC_ALL=C diff -r -q "$sample" "$sample/$sample-0" | grep -v "^Only in $sample: $sample-0\$" | grep -v "^Only in $sample: $sample-0.tar.gz\$" | grep -v "^Only in $sample: BUGS\$" | grep -v "^Only in hello-rust: target\$" > "$sample.out"
|
|
else
|
|
echo "$sample-0.tar.gz was not created" > "$sample.out"
|
|
fi
|
|
fi
|
|
rm -rf "$sample/$sample-0"
|
|
rm -f "$sample/$sample-0.tar.gz"
|
|
fi
|
|
fi
|
|
func_configure "$sample"
|
|
func_maintainerclean "$sample"
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_dist_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
func_check_dist hello-c
|
|
#func_check_dist hello-c-gnome2
|
|
#func_check_dist hello-c-gnome3
|
|
func_check_dist hello-c-http
|
|
func_check_dist hello-c++
|
|
func_check_dist hello-c++20
|
|
#func_check_dist hello-c++-qt
|
|
#func_check_dist hello-c++-kde
|
|
#func_check_dist hello-c++-gnome2
|
|
#func_check_dist hello-c++-gnome3
|
|
func_check_dist hello-c++-wxwidgets
|
|
func_check_dist hello-objc
|
|
func_check_dist hello-objc-gnustep
|
|
#func_check_dist hello-objc-gnome2
|
|
func_check_dist hello-python
|
|
func_check_dist hello-java
|
|
func_check_dist hello-java-awt
|
|
func_check_dist hello-java-swing
|
|
#func_check_dist hello-java-qtjambi
|
|
func_check_dist hello-csharp
|
|
func_check_dist hello-csharp-forms
|
|
func_check_dist hello-guile
|
|
func_check_dist hello-clisp
|
|
func_check_dist hello-librep
|
|
func_check_dist hello-rust
|
|
func_check_dist hello-go
|
|
func_check_dist hello-go-http
|
|
func_check_dist hello-ruby
|
|
func_check_dist hello-sh
|
|
func_check_dist hello-gawk
|
|
func_check_dist hello-pascal
|
|
func_check_dist hello-d
|
|
func_check_dist hello-smalltalk
|
|
func_check_dist hello-tcl
|
|
func_check_dist hello-tcl-tk
|
|
func_check_dist hello-perl
|
|
func_check_dist hello-php
|
|
#func_check_dist hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_dist error: 'make dist' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_dist error: tarball created by 'make dist' does not contain the expected files"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# func_check_dist_vpath sample
|
|
# checks 'make dist' after 'configure; make' with a VPATH build
|
|
func_check_dist_vpath ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
func_autogen "$sample"
|
|
if func_configure "$sample" build; then
|
|
if (func_init "$sample"; cd "$sample"/build && make); then
|
|
if (func_init "$sample"; cd "$sample"/build && make dist) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
(func_init "$sample"; cd "$sample"/build && make distclean)
|
|
rm -f `find "$sample" -name '*~'` `find "$sample" -name '*.orig'`
|
|
rm -rf "$sample/autom4te.cache"
|
|
if test -f "$sample/build/$sample-0.tar.gz"; then
|
|
(cd "$sample"/build && tar xfz "$sample-0.tar.gz")
|
|
# TODO: Remove stamp-po workaround after next release.
|
|
LC_ALL=C diff -r -q "$sample" "$sample/build/$sample-0" | grep -v "^Only in $sample: build\$" | grep -v "^Only in $sample: BUGS\$" | grep -v "^Only in hello-rust: target\$" | { if test -f "$sample"/po/Makevars; then grep -v "^Only in $sample/build/$sample-0/po: stamp-po\$"; else cat; fi; } > "$sample.out"
|
|
else
|
|
echo "$sample-0.tar.gz was not created" > "$sample.out"
|
|
fi
|
|
fi
|
|
rm -rf "$sample/build/$sample-0"
|
|
rm -f "$sample/build/$sample-0.tar.gz"
|
|
fi
|
|
fi
|
|
rm -rf "$sample"/build
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_dist_vpath_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
func_check_dist_vpath hello-c
|
|
#func_check_dist_vpath hello-c-gnome2
|
|
#func_check_dist_vpath hello-c-gnome3
|
|
func_check_dist_vpath hello-c-http
|
|
func_check_dist_vpath hello-c++
|
|
func_check_dist_vpath hello-c++20
|
|
#func_check_dist_vpath hello-c++-qt
|
|
#func_check_dist_vpath hello-c++-kde
|
|
#func_check_dist_vpath hello-c++-gnome2
|
|
#func_check_dist_vpath hello-c++-gnome3
|
|
func_check_dist_vpath hello-c++-wxwidgets
|
|
func_check_dist_vpath hello-objc
|
|
func_check_dist_vpath hello-objc-gnustep
|
|
#func_check_dist_vpath hello-objc-gnome2
|
|
func_check_dist_vpath hello-python
|
|
func_check_dist_vpath hello-java
|
|
func_check_dist_vpath hello-java-awt
|
|
func_check_dist_vpath hello-java-swing
|
|
#func_check_dist_vpath hello-java-qtjambi
|
|
func_check_dist_vpath hello-csharp
|
|
func_check_dist_vpath hello-csharp-forms
|
|
func_check_dist_vpath hello-guile
|
|
func_check_dist_vpath hello-clisp
|
|
func_check_dist_vpath hello-librep
|
|
func_check_dist_vpath hello-rust
|
|
func_check_dist_vpath hello-go
|
|
func_check_dist_vpath hello-go-http
|
|
func_check_dist_vpath hello-ruby
|
|
func_check_dist_vpath hello-sh
|
|
func_check_dist_vpath hello-gawk
|
|
func_check_dist_vpath hello-pascal
|
|
func_check_dist_vpath hello-d
|
|
func_check_dist_vpath hello-smalltalk
|
|
func_check_dist_vpath hello-tcl
|
|
func_check_dist_vpath hello-tcl-tk
|
|
func_check_dist_vpath hello-perl
|
|
func_check_dist_vpath hello-php
|
|
#func_check_dist_vpath hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_dist_vpath error: 'make dist' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_dist_vpath error: tarball created by 'make dist' does not contain the expected files"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# Base installation directory for all samples.
|
|
instdir=/tmp/gtexinst
|
|
|
|
# func_check_install sample
|
|
# checks 'make install' after 'configure; make'.
|
|
# You need to check afterwards whether the installed binaries work.
|
|
func_check_install ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep)
|
|
# In this sample, you have to check the uninstalled binaries (see the INSTALL file).
|
|
;;
|
|
*)
|
|
func_autogen "$sample"
|
|
if (cd "$sample" && ./configure --prefix="$instdir/$sample"); then
|
|
if (func_init "$sample"; cd "$sample" && make); then
|
|
if (func_init "$sample"; cd "$sample" && make install) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
fi
|
|
fi
|
|
fi
|
|
func_maintainerclean "$sample"
|
|
func_autoclean "$sample"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_install_all ()
|
|
{
|
|
rm -f hello-*.log
|
|
rm -rf "$instdir/hello-*"
|
|
func_check_install hello-c
|
|
#func_check_install hello-c-gnome2
|
|
#func_check_install hello-c-gnome3
|
|
func_check_install hello-c-http
|
|
func_check_install hello-c++
|
|
func_check_install hello-c++20
|
|
#func_check_install hello-c++-qt
|
|
#func_check_install hello-c++-kde
|
|
#func_check_install hello-c++-gnome2
|
|
#func_check_install hello-c++-gnome3
|
|
func_check_install hello-c++-wxwidgets
|
|
func_check_install hello-objc
|
|
func_check_install hello-objc-gnustep
|
|
#func_check_install hello-objc-gnome2
|
|
func_check_install hello-python
|
|
func_check_install hello-java
|
|
func_check_install hello-java-awt
|
|
func_check_install hello-java-swing
|
|
#func_check_install hello-java-qtjambi
|
|
func_check_install hello-csharp
|
|
func_check_install hello-csharp-forms
|
|
func_check_install hello-guile
|
|
func_check_install hello-clisp
|
|
func_check_install hello-librep
|
|
func_check_install hello-rust
|
|
func_check_install hello-go
|
|
func_check_install hello-go-http
|
|
func_check_install hello-ruby
|
|
func_check_install hello-sh
|
|
func_check_install hello-gawk
|
|
func_check_install hello-pascal
|
|
func_check_install hello-d
|
|
func_check_install hello-smalltalk
|
|
func_check_install hello-tcl
|
|
func_check_install hello-tcl-tk
|
|
func_check_install hello-perl
|
|
func_check_install hello-php
|
|
#func_check_install hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_install error: 'make install' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# func_check_uninstall sample
|
|
# checks 'make uninstall' after 'configure; make; make install'.
|
|
func_check_uninstall ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep)
|
|
# In this sample, you have to check the uninstalled binaries (see the INSTALL file).
|
|
;;
|
|
*)
|
|
func_autogen "$sample"
|
|
if (cd "$sample" && ./configure --prefix="$instdir/$sample"); then
|
|
if (func_init "$sample"; cd "$sample" && make); then
|
|
if (func_init "$sample"; cd "$sample" && make install); then
|
|
if (func_init "$sample"; cd "$sample" && make uninstall) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
(cd "$instdir" && find "$sample" -type f | LC_ALL=C sort) > "$sample.out"
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|
|
func_maintainerclean "$sample"
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_uninstall_all ()
|
|
{
|
|
rm -f hello-*.log hello-*.out
|
|
rm -rf "$instdir/hello-*"
|
|
func_check_uninstall hello-c
|
|
#func_check_uninstall hello-c-gnome2
|
|
#func_check_uninstall hello-c-gnome3
|
|
func_check_uninstall hello-c-http
|
|
func_check_uninstall hello-c++
|
|
func_check_uninstall hello-c++20
|
|
#func_check_uninstall hello-c++-qt
|
|
#func_check_uninstall hello-c++-kde
|
|
#func_check_uninstall hello-c++-gnome2
|
|
#func_check_uninstall hello-c++-gnome3
|
|
func_check_uninstall hello-c++-wxwidgets
|
|
func_check_uninstall hello-objc
|
|
func_check_uninstall hello-objc-gnustep
|
|
#func_check_uninstall hello-objc-gnome2
|
|
func_check_uninstall hello-python
|
|
func_check_uninstall hello-java
|
|
func_check_uninstall hello-java-awt
|
|
func_check_uninstall hello-java-swing
|
|
#func_check_uninstall hello-java-qtjambi
|
|
func_check_uninstall hello-csharp
|
|
func_check_uninstall hello-csharp-forms
|
|
func_check_uninstall hello-guile
|
|
func_check_uninstall hello-clisp
|
|
func_check_uninstall hello-librep
|
|
func_check_uninstall hello-rust
|
|
func_check_uninstall hello-go
|
|
func_check_uninstall hello-go-http
|
|
func_check_uninstall hello-ruby
|
|
func_check_uninstall hello-sh
|
|
func_check_uninstall hello-gawk
|
|
func_check_uninstall hello-pascal
|
|
func_check_uninstall hello-d
|
|
func_check_uninstall hello-smalltalk
|
|
func_check_uninstall hello-tcl
|
|
func_check_uninstall hello-tcl-tk
|
|
func_check_uninstall hello-perl
|
|
func_check_uninstall hello-php
|
|
#func_check_uninstall hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_uninstall error: 'make uninstall' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
if (shopt -s failglob; echo hello-*.out) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_uninstall error: left-over files"
|
|
echo hello-*.out
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# func_check_distcheck sample
|
|
# checks 'make distcheck' after 'configure; make'.
|
|
func_check_distcheck ()
|
|
{
|
|
sample="$1"
|
|
case "$sample" in
|
|
hello-objc-gnustep) ;;
|
|
*)
|
|
func_autogen "$sample"
|
|
if func_configure "$sample"; then
|
|
if (func_init "$sample"; cd "$sample" && make); then
|
|
if (func_init "$sample"; cd "$sample" && make distcheck) > "$sample.log" 2>&1; then
|
|
rm -f "$sample.log"
|
|
fi
|
|
if test -d "$sample/$sample-0"; then chmod -R u+w "$sample/$sample-0"; fi
|
|
rm -rf "$sample/$sample-0"
|
|
rm -f "$sample/$sample-0.tar.gz"
|
|
fi
|
|
fi
|
|
func_maintainerclean "$sample"
|
|
func_autoclean "$sample"
|
|
if ! test -s "$sample.out"; then
|
|
rm -f "$sample.out"
|
|
fi
|
|
;;
|
|
esac
|
|
}
|
|
|
|
func_check_distcheck_all ()
|
|
{
|
|
rm -f hello-*.log
|
|
func_check_distcheck hello-c
|
|
#func_check_distcheck hello-c-gnome2
|
|
#func_check_distcheck hello-c-gnome3
|
|
func_check_distcheck hello-c-http
|
|
func_check_distcheck hello-c++
|
|
func_check_distcheck hello-c++20
|
|
#func_check_distcheck hello-c++-qt
|
|
#func_check_distcheck hello-c++-kde
|
|
#func_check_distcheck hello-c++-gnome2
|
|
#func_check_distcheck hello-c++-gnome3
|
|
func_check_distcheck hello-c++-wxwidgets
|
|
func_check_distcheck hello-objc
|
|
func_check_distcheck hello-objc-gnustep
|
|
#func_check_distcheck hello-objc-gnome2
|
|
func_check_distcheck hello-python
|
|
func_check_distcheck hello-java
|
|
func_check_distcheck hello-java-awt
|
|
func_check_distcheck hello-java-swing
|
|
#func_check_distcheck hello-java-qtjambi
|
|
func_check_distcheck hello-csharp
|
|
func_check_distcheck hello-csharp-forms
|
|
func_check_distcheck hello-guile
|
|
func_check_distcheck hello-clisp
|
|
func_check_distcheck hello-librep
|
|
func_check_distcheck hello-rust
|
|
func_check_distcheck hello-go
|
|
func_check_distcheck hello-go-http
|
|
func_check_distcheck hello-ruby
|
|
func_check_distcheck hello-sh
|
|
func_check_distcheck hello-gawk
|
|
func_check_distcheck hello-pascal
|
|
func_check_distcheck hello-d
|
|
func_check_distcheck hello-smalltalk
|
|
func_check_distcheck hello-tcl
|
|
func_check_distcheck hello-tcl-tk
|
|
func_check_distcheck hello-perl
|
|
func_check_distcheck hello-php
|
|
#func_check_distcheck hello-ycp
|
|
if (shopt -s failglob; echo hello-*log) >/dev/null 2>/dev/null; then
|
|
echo "*** func_check_distcheck error: 'make distcheck' failures"
|
|
echo hello-*.log
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
|
|
# If you want to extend this script:
|
|
|
|
# A check function for a single sample.
|
|
func_check ()
|
|
{
|
|
func_check_autoclean "$1"
|
|
func_check_distclean "$1"
|
|
func_check_maintainerclean "$1"
|
|
func_check_maintainerclean_vpath "$1"
|
|
func_check_dist "$1"
|
|
func_check_dist_vpath "$1"
|
|
func_check_install "$1"
|
|
func_check_uninstall "$1"
|
|
func_check_distcheck "$1"
|
|
}
|
|
|
|
# Complete list of samples.
|
|
func_check_all ()
|
|
{
|
|
func_check hello-c
|
|
func_check hello-c-gnome2
|
|
func_check hello-c-gnome3
|
|
func_check hello-c-http
|
|
func_check hello-c++
|
|
func_check hello-c++20
|
|
func_check hello-c++-qt
|
|
func_check hello-c++-kde
|
|
func_check hello-c++-gnome2
|
|
func_check hello-c++-gnome3
|
|
func_check hello-c++-wxwidgets
|
|
func_check hello-objc
|
|
func_check hello-objc-gnustep
|
|
func_check hello-objc-gnome2
|
|
func_check hello-python
|
|
func_check hello-java
|
|
func_check hello-java-awt
|
|
func_check hello-java-swing
|
|
func_check hello-java-qtjambi
|
|
func_check hello-csharp
|
|
func_check hello-csharp-forms
|
|
func_check hello-guile
|
|
func_check hello-clisp
|
|
func_check hello-librep
|
|
func_check hello-rust
|
|
func_check hello-go
|
|
func_check hello-go-http
|
|
func_check hello-ruby
|
|
func_check hello-sh
|
|
func_check hello-gawk
|
|
func_check hello-pascal
|
|
func_check hello-d
|
|
func_check hello-smalltalk
|
|
func_check hello-tcl
|
|
func_check hello-tcl-tk
|
|
func_check hello-perl
|
|
func_check hello-php
|
|
func_check hello-ycp
|
|
}
|
|
|
|
|
|
# Top-level code.
|
|
|
|
func_check_autoclean_all
|
|
func_check_distclean_all
|
|
func_check_maintainerclean_all
|
|
func_check_maintainerclean_vpath_all
|
|
func_check_dist_all
|
|
func_check_dist_vpath_all
|
|
func_check_install_all
|
|
func_check_uninstall_all
|
|
func_check_distcheck_all
|