Commit 458cadf4 authored by Milan Broz's avatar Milan Broz

Simplify build system, use autopoint and clean gettext processing.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@142 36d66b0a-2a48-0410-832c-cd162a569da5
parent c3064c94
......@@ -3,6 +3,7 @@
* Fix status call to fail when running as non-root user.
* Check in configure if selinux libraries are required in static version.
* Add temporary debug code to find processes locking internal device.
* Simplify build system, use autopoint and clean gettext processing.
2009-09-30 Milan Broz <mbroz@redhat.com>
* Fix exported symbols and versions in libcryptsetup.
......
......@@ -2,13 +2,21 @@
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="the package."
PKG_NAME="cryptsetup"
DIE=0
(autopoint --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have autopoint installed."
echo "Download the appropriate package for your distribution,"
echo "or see http://www.gnu.org/software/gettext"
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "**Error**: You must have autoconf installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
......@@ -17,7 +25,7 @@ DIE=0
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "**Error**: You must have libtool installed."
echo "Get ftp://ftp.gnu.org/pub/gnu/"
echo "(or a newer version if it is available)"
DIE=1
......@@ -26,7 +34,7 @@ DIE=0
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "**Error**: You must have automake installed."
echo "Get ftp://ftp.gnu.org/pub/gnu/"
echo "(or a newer version if it is available)"
DIE=1
......@@ -37,7 +45,7 @@ DIE=0
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "**Error**: Missing aclocal. The version of automake"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/"
echo "(or a newer version if it is available)"
......@@ -49,73 +57,29 @@ if test "$DIE" -eq 1; then
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
echo "**Warning**: I am going to run 'configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \'$0\'" command line."
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
echo
echo "Generate build-system by:"
echo " autopoint: $(autopoint --version | head -1)"
echo " aclocal: $(aclocal --version | head -1)"
echo " autoconf: $(autoconf --version | head -1)"
echo " automake: $(automake --version | head -1)"
echo " libtoolize: $(libtoolize --version | head -1)"
echo
for coin in `find $srcdir -name configure.in -a \( ! -regex '.*/\..*' \) -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
if grep "sed.*POTFILES" configure.in >/dev/null; then
: do nothing -- we still have an old unmodified configure.in
else
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
./setup-gettext
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
fi
if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
./setup-gettext
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt
echo "Running autoconf ..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
set -e
autopoint --force $AP_OPTS
libtoolize --force --copy
aclocal -I m4 $AL_OPTS
autoheader $AH_OPTS
automake --add-missing --gnu $AM_OPTS
autoconf $AC_OPTS
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
......
2006-11-28 gettextize <bug-gnu-gettext@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.15.
2006-09-26 gettextize <bug-gnu-gettext@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.14.4.
* Rules-quot: Upgrade to gettext-0.14.4.
# Makefile variables for PO directory in any package using GNU gettext.
# 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 =
# 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 = dm-crypt@saout.de
# 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 =
#!/bin/sh
#
# setup-gettext - Provides compatibility with versions of gettext
# from the 0.10.x series and 0.11.x.
#
# Copyright (C) 2002 Christian Hammond.
#
# 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 2 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, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
VERSION=0.1.3
VERBOSE=1
parse_gettext_version() {
GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1.\2.\3/p'`
GETTEXT_MAJOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^\([0-9]\+\).*/\1/p'`
GETTEXT_MINOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.\([0-9]\+\).*/\1/p'`
GETTEXT_MICRO_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/p'`
}
find_gettext() {
GETTEXT_TOOL=autopoint
(autopoint --version) < /dev/null > /dev/null 2>&1 || {
GETTEXT_TOOL=gettextize
(gettextize --version) < /dev/null > /dev/null 2>&1 || {
GETTEXT_TOOL=
}
}
}
install() {
[ -f configure.in ] && {
cp configure.in .tmp-configure.in
sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.in > configure.in
rm .tmp-configure.in
}
[ -f configure.ac ] && {
cp configure.ac .tmp-configure.ac
sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.ac > configure.ac
rm .tmp-configure.ac
}
[ -f autogen.sh ] && {
cp autogen.sh .tmp-autogen.sh
sed -e 's/\(gettextize\|autopoint\) --version/.\/setup-gettext --gettext-tool/1' -e 's/^\(echo.*|[\t ]*\)\?\(gettextize\|autopoint\) -.*$/.\/setup-gettext/1' < .tmp-autogen.sh > autogen.sh
rm .tmp-autogen.sh
}
echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> acinclude.m4
}
backup_m4() {
[ -d m4 ] && mv m4 m4~
}
restore_m4() {
[ -d m4~ ] && {
rm -rf m4
mv m4~ m4
}
}
restore_files() {
[ -f configure.in~ ] && mv -f configure.in~ configure.in
[ -f configure.ac~ ] && mv -f configure.ac~ configure.ac
[ -f Makefile.am~ ] && mv -f Makefile.am~ Makefile.am
}
abort() {
restore_files
restore_m4
exit 1
}
# Main code
find_gettext
# See if a version of gettext and its tools are installed.
if [ x$GETTEXT_TOOL = x ]; then
echo
echo "You do not have a version of gettext installed."
echo "Please download one from your local package repository or"
echo "from ftp://ftp.gnu.org/pub/gnu/gettext/"
echo
exit 1
fi
parse_gettext_version
NUMVAR=$#
if [ $NUMVAR -gt 0 ]; then
if [ $NUMVAR -gt 1 ]; then
echo "Only one option at a time!"
exit 1
elif [ $1 = "--gettext-tool" ]; then
echo $GETTEXT_TOOL
exit 0
elif [ $1 = "--help" ]; then
echo "setup-gettext v$VERSION"
echo "Usage:"
echo " --gettext-tool Returns gettextize or autopoint, depending"
echo " on the version of gettext installed."
echo " --gettext-version Returns the version of gettext installed."
echo " --gettext-major-version Returns the major version of gettext installed."
echo " --gettext-minor-version Returns the minor version of gettext installed."
echo " --gettext-micro-version Returns the micro version of gettext installed."
echo " --help Displays this help screen."
echo
exit 0
elif [ $1 = "--version" ]; then
echo $VERSION
exit 0
elif [ $1 = "--gettext-version" ]; then
echo $GETTEXT_VERSION
exit 0
elif [ $1 = "--gettext-major-version" ]; then
echo $GETTEXT_MAJOR_VERSION
exit 0
elif [ $1 = "--gettext-minor-version" ]; then
echo $GETTEXT_MINOR_VERSION
exit 0
elif [ $1 = "--gettext-micro-version" ]; then
echo $GETTEXT_MICRO_VERSION
exit 0
elif [ $1 = "--install" ]; then
install
echo "setup-gettext installed."
exit 0
elif [ $1 = "--happy-url" ]; then
echo http://gaim.sf.net/forkgettext.jpg
exit 0
elif [ $1 = "--verbose" ]; then
VERBOSE=1
else
echo "Invalid option '$1'"
exit 1
fi
fi
# Okay, run the main stuff
if [ "$GETTEXT_TOOL" = "autopoint" ]; then
backup_m4
[ $VERBOSE -eq 1 ] && echo " autopoint --force"
echo n | autopoint --force || abort
restore_m4
[ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars
else
if [ $GETTEXT_MINOR_VERSION -eq 11 ]; then
backup_m4
# Gettext is pure evil. It DEMANDS that we press Return no matter
# what. This gets rid of their happy "feature" of doom.
[ $VERBOSE -eq 1 ] && \
echo " gettextize --copy --force --intl --no-changelog"
sed 's:read .*< /dev/tty::' `which gettextize` > .temp-gettextize
chmod +x .temp-gettextize
echo n | ./.temp-gettextize --copy --force --intl --no-changelog || abort
rm .temp-gettextize
restore_files
restore_m4
[ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars
else
[ $VERBOSE -eq 1 ] && echo " gettextize --copy --force"
echo n | gettextize --copy --force || exit;
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment