Commit faa5fc67 authored by Urs Fleisch's avatar Urs Fleisch
Browse files

new KDE development files (from Debian lenny kapptemplate)

parent be7c45c4
......@@ -72,11 +72,11 @@ uninstall-local: uninstall-apidox
uninstall-apidox:
@if test "$(subdir)" != "."; then \
if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); then \
rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
rm -rf $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs/$(subdir); \
fi \
else \
if test -d $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; then \
rm -rfv $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
rm -rf $(DESTDIR)$(kde_htmldir)/en/$(PACKAGE)-apidocs; \
fi \
fi
......
......@@ -983,7 +983,7 @@ if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
X_INCLUDES="-I$x_includes"
fi
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
X_LDFLAGS=""
x_libraries="/usr/lib"; dnl better than nothing :-
else
......@@ -1226,7 +1226,15 @@ if test $kde_qtver = 4; then
kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
fi
if test $kde_qtver = 3; then
kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3 /usr/lib${kdelibsuff}/qt-3.3"
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" != "no" ; then
if $PKG_CONFIG --exists qt-mt ; then
kde_qt_dirs="$kde_qt_dirs `$PKG_CONFIG --variable=prefix qt-mt`"
fi
fi
fi
if test $kde_qtver = 2; then
kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
......@@ -1443,6 +1451,14 @@ qt_incdirs=""
for dir in $kde_qt_dirs; do
qt_incdirs="$qt_incdirs $dir/include $dir"
done
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" != "no" ; then
if $PKG_CONFIG --exists qt-mt ; then
qt_incdirs="$qt_incdirs `$PKG_CONFIG --variable=includedir qt-mt`"
fi
fi
qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
if test ! "$ac_qt_includes" = "NO"; then
qt_incdirs="$ac_qt_includes $qt_incdirs"
......@@ -1459,8 +1475,16 @@ ac_qt_includes="$qt_incdir"
qt_libdirs=""
for dir in $kde_qt_dirs; do
qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir/lib $dir"
done
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" != "no" ; then
if $PKG_CONFIG --exists qt-mt ; then
qt_libdirs="$qt_incdirs `$PKG_CONFIG --variable=libdir qt-mt`"
fi
fi
qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
if test ! "$ac_qt_libraries" = "NO"; then
qt_libdir=$ac_qt_libraries
......@@ -2619,6 +2643,7 @@ CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK(dnl
[
#include<zlib.h>
#include<string.h>
],
[
char buf[42];
......@@ -2626,7 +2651,7 @@ AC_TRY_LINK(dnl
/* this would segfault.. but we only link, don't run */
(void) gzgets(f, buf, sizeof(buf));
return (zlibVersion() == ZLIB_VERSION);
return (strcmp(zlibVersion(), ZLIB_VERSION) == 0);
],
eval "ac_cv_lib_z='-lz'",
eval "ac_cv_lib_z=no")
......@@ -2726,11 +2751,11 @@ AC_CACHE_VAL(ac_cv_libexr,
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
if !(`$PKG_CONFIG --exists OpenEXR`) ; then
if ! $PKG_CONFIG --exists OpenEXR ; then
AC_MSG_RESULT(no)
EXRSTATUS=no
else
if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
if ! $PKG_CONFIG --atleast-version="1.1.1" OpenEXR ; then
AC_MSG_RESULT(no)
EXRSTATUS=old
else
......@@ -3186,7 +3211,7 @@ AC_DEFUN([AC_CHECK_COMPILERS],
case $host in
*-*-linux-gnu)
CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts $CXXFLAGS"
CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
;;
......@@ -5203,9 +5228,10 @@ else
for dir in $javadirs; do
dnl Check for the java executable
if test -x "$dir/java"; then
sane_path=$(cd $dir; /bin/pwd)
dnl And also check for a libjvm.so somewhere under there
dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
if test "$dir" != "/usr/bin"; then
if test "$sane_path" != "/usr/bin"; then
libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
if test ! -f $libjvmdir/libjvm.so; then continue; fi
jredirs="$jredirs $dir"
......
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2006-07-02'
timestamp='2008-01-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
......@@ -56,8 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -161,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
......@@ -329,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:*)
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
......@@ -531,7 +532,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[45])
*:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
......@@ -780,7 +781,7 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
i*:MINGW*:*)
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
......@@ -790,12 +791,18 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[3456]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
*:Interix*:[3456]*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T | authenticamd)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
......@@ -829,7 +836,14 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
......@@ -950,6 +964,9 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
......@@ -1208,6 +1225,15 @@ EOF
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
......@@ -1458,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
......
This diff is collapsed.
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
timestamp='2006-09-20'
timestamp='2008-01-16'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
......@@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
......@@ -245,12 +245,12 @@ case $basic_machine in
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore \
| maxq | mb | microblaze | mcore | mep \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
......@@ -324,7 +324,7 @@ case $basic_machine in
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
......@@ -369,10 +369,14 @@ case $basic_machine in
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
| xstormy16-* | xtensa-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
......@@ -443,6 +447,14 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
c90)
basic_machine=c90-cray
os=-unicos
......@@ -475,8 +487,8 @@ case $basic_machine in
basic_machine=craynv-cray
os=-unicosmp
;;
cr16c)
basic_machine=cr16c-unknown
cr16)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
......@@ -668,6 +680,14 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
......@@ -683,6 +703,10 @@ case $basic_machine in
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
......@@ -809,6 +833,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
......@@ -925,6 +957,9 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
......@@ -1014,6 +1049,10 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
tile*)
basic_machine=tile-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
......@@ -1219,7 +1258,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
......@@ -1414,6 +1453,9 @@ case $basic_machine in
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
......
This diff is collapsed.
......@@ -316,7 +316,7 @@ if test -f configure.in.in; then
fi
fi
if test -z "$VERSION" || test "$VERSION" = "@VERSION@"; then
VERSION="\"3.5.6\""
VERSION="\"3.5.9\""
fi
if test -z "$modulename" || test "$modulename" = "@MODULENAME@"; then
modulename=`pwd`;
......@@ -537,8 +537,6 @@ if test -z "$EXTRACTRC"; then EXTRACTRC=extractrc ; fi
if test -z "$PREPARETIPS"; then PREPARETIPS=preparetips ; fi
export EXTRACTRC PREPARETIPS
kdepotpath=/usr/include/kde/kde.pot
for subdir in $dirs; do
test -z "$VERBOSE" || echo "Making messages in $subdir"
(cd $subdir
......@@ -556,10 +554,10 @@ for subdir in $dirs; do
fi
perl -e '$mes=0; while (<STDIN>) { next if (/^(if\s|else\s|endif)/); if (/^messages:/) { $mes=1; print $_; next; } if ($mes) { if (/$\\(XGETTEXT\)/ && / -o/) { s/ -o \$\(podir\)/ _translatorinfo.cpp -o \$\(podir\)/ } print $_; } else { print $_; } }' < Makefile.am | egrep -v '^include ' > _transMakefile
# kdepotpath=${includedir:-`kde-config --expandvars --install include`}/kde.pot
# if ! test -f $kdepotpath; then
# kdepotpath=`kde-config --expandvars --prefix`/include/kde.pot
# fi
kdepotpath=${includedir:-`kde-config --expandvars --install include`}/kde.pot
if ! test -f $kdepotpath; then
kdepotpath=`kde-config --expandvars --prefix`/include/kde.pot
fi
$MAKE -s -f _transMakefile podir=$podir EXTRACTRC="$EXTRACTRC" PREPARETIPS="$PREPARETIPS" srcdir=. \
XGETTEXT="${XGETTEXT:-xgettext} --foreign-user -C -ci18n -ki18n -ktr2i18n -kI18N_NOOP -kI18N_NOOP2 -kaliasLocale -x $kdepotpath" messages
......
......@@ -21,6 +21,73 @@ sub which
return "";
}
# Subroutine to lexicographically compare two version strings, a and b.
# If a > b, 1 is returned.
# If a == b, 0 is returned.
# If a < b, -1 is returned.
#
# If the strings are of uneven number length then the shorter string is
# prepended by enough zeroes to make the two string lengths equal in order to
# allow an accurate comparison. Note that the zero-padding only occurs in
# between version separators (i.e. 1.6 and 1.10, results in 1.06 vs. 1.10).
# Parts of the version ending in -foo (or any other text) are not considered
# when doing the compare. (i.e. 2.53a vs 2.53 doesn't end up in 2.53a vs.
# 2.053)
sub compareVersions
{
my ($a, $b) = @_;
# Split the strings up by '.' (version separator) and start comparing digit
# length.
my @aParts = split(/\./, $a);
my @bParts = split(/\./, $b);
# Make the arrays equal in length by adding missing zeroes to the end of the
# version.
push @aParts, '0' while scalar @aParts < scalar @bParts;
push @bParts, '0' while scalar @bParts < scalar @aParts;
# Now compare each individual portion.
for (my $i = 0; $i < scalar @aParts; ++$i)
{
# Make sure that any portion that has numbers is contiguous. I'm sure
# there's a technique for saving stuff like 2.52a2 but I don't feel
# like implementing it.
if ($aParts[$i] !~ /^[^\d]*\d+[^\d]*$/ or
$bParts[$i] !~ /^[^\d]*\d+[^\d]*$/)
{
die "Not able to compare $a to $b!\n";
}
my ($aDigits) = ($aParts[$i] =~ /(\d+)/);
my ($bDigits) = ($bParts[$i] =~ /(\d+)/);
# Perl is $MODERATELY_INSULTING_TERM, don't remove the parentheses in
# the delta calculation below.
my $delta = (length $aDigits) - (length $bDigits);
if ($delta < 0) # b is longer
{
my $replacement = ('0' x (-$delta)) . $aDigits;
$aParts[$i] =~ s/$aDigits/$replacement/;
}
elsif ($delta > 0) # a is longer
{
my $replacement = ('0' x $delta) . $bDigits;
$bParts[$i] =~ s/$bDigits/$replacement/;
}
}
# Arrays now have standardized version components, let's re-merge them
# to strings to do the compare.
my $newA = join('.', @aParts);
my $newB = join('.', @bParts);
return 1 if ($newA gt $newB);
return -1 if ($newA lt $newB);
return 0;
}
# Subroutine to determine the highest installed version of the given program,
# searching from the given paths.
sub findBest
......@@ -29,9 +96,10 @@ sub findBest
my $best_version_found = '0'; # Deliberately a string.
my %versions;
my %minimumVersions = (
'autoconf' => '2.5',
'autoconf' => '2.5',
'automake' => '1.6',
);
my $sgn; # Used for compareVersions results.
# Allow user to use environment variable to override search.
return $ENV{uc $program} if $ENV{uc $program};
......@@ -45,7 +113,11 @@ sub findBest
next unless -x $file;
($version) = $file =~ /$prefix\/$program-?(.*)$/;
$version =~ s/-|\.//g;
# Don't check the -wrapper ones (or any other non program one).
# The real deal should start with a version number, or have no
# suffix at all.
next if $version =~ /^[^\d]/;
# Special case some programs to make sure it has a minimum version.
if (not $version and exists $minimumVersions{$program})
......@@ -54,15 +126,20 @@ sub findBest
my $versionOutput = `$program --version 2>/dev/null | head -n 1`;
# If we can't run the script to get the version it likely won't work later.
next unless $versionOutput;
next unless $versionOutput;
# Use number.number for version (we don't need the excess in general).
($versionOutput) = ($versionOutput =~ /(\d\.\d)/);
($versionOutput) = ($versionOutput =~ /(\d+\.\d+)/);
# Use lt to do lexicographical comparison of strings (which should be
# equivalent and doesn't involve issues with floating point conversions).
if (not $versionOutput or $versionOutput lt $min_version)
{
# compareVersions returns -1 if the left argument is less than
# the right argument. It can also die for invalid input so
# wrap with eval.
eval {
$sgn = compareVersions($versionOutput, $min_version);
};
# $@ would be set if an error was encountered.
if ($@ or not $versionOutput or $sgn == -1) {
next;
}
}
......@@ -78,7 +155,12 @@ sub findBest
$versions{$version} = $file;
# Use string comparison so that e.g. 253a will be > 253 but < 254.
if ($version gt $best_version_found)
# See above about the need for eval.
eval {
$sgn = compareVersions($version, $best_version_found);
};
if (not $@ and $sgn == 1)
{
$best_version_found = $version;
}
......@@ -138,12 +220,12 @@ $unsermake = which('unsermake') if ($ENV{'UNSERMAKE'} ne 'no');
($automake_suffix) = $automake =~ /.*automake(.*)$/;
# Use unsermake if we found it.
$automake = "$unsermake -c" if $unsermake;
# Find matching automake companions.
$aclocal = findProgram('aclocal', $automake_suffix);
# Use unsermake if we found it.
$automake = "$unsermake -c" if ($unsermake and $aclocal);
$which = findWhich();
# Make sure we have all of the needed programs.
......@@ -151,8 +233,7 @@ for $i (qw'autoconf autoheader autom4te automake aclocal')
{
unless(${$i})
{
print "# Unable to find $i!!\n";
exit 1;
print STDERR "# Unable to find $i!!\n";
}
}
......@@ -171,3 +252,5 @@ export AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE ACLOCAL WHICH
EOF
exit 0;
# vim: set noet ts=8 sw=4:
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2005-05-14.22
scriptversion=2005-11-07.23
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
......@@ -58,7 +58,21 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"