Imported Upstream version 0.72.3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Bash based configure - library of test functions
|
||||
# Copyright (C) 2004-2010 Carsten Gn<47>rlich
|
||||
# Copyright (C) 2004-2009 Carsten Gn<47>rlich
|
||||
#
|
||||
# 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
|
||||
@@ -56,15 +56,13 @@
|
||||
# EXECUTE_PROGRAM Invoke a command to see if a certain program is available
|
||||
#
|
||||
# CHECK_ENDIAN Test whether system is little or big endian
|
||||
# CHECK_BITNESS Test whether system is 32bit or 64bit
|
||||
# CHECK_SSE2 Test whether when can compile for SSE2 extensions
|
||||
# CHECK_ALTIVEC Test whether when can compile for AltiVec extensions
|
||||
# FINALIZE_HELP Finish --help output (optional, but user friendly)
|
||||
#
|
||||
# WITH_OPTION name default adds -DWITH_OPTION_VALUE for -with-option=value args
|
||||
# to CFG_WITH_OPTIONS,
|
||||
|
||||
CONFIGURE_VERSION="0.56"
|
||||
CONFIGURE_VERSION="0.55"
|
||||
|
||||
echo "Bash based configure V$CONFIGURE_VERSION"
|
||||
echo
|
||||
@@ -142,6 +140,19 @@ case "$cfg_uname" in
|
||||
}
|
||||
;;
|
||||
|
||||
SunOS*) cfg_system=solaris
|
||||
CFG_SYS_OPTIONS="-DSYS_SOLARIS"
|
||||
CFG_EXE_SUFFIX=""
|
||||
# Even a Sparc V9 is a tight fit for us...
|
||||
if test `uname -m` == "sun4u"; then
|
||||
CFG_SYS_CFLAGS="-mcpu=v9"
|
||||
fi
|
||||
|
||||
function add_linker_flags()
|
||||
{ lflags_return="-L$1 $2"
|
||||
}
|
||||
;;
|
||||
|
||||
*) cfg_system=unknown-system
|
||||
CFG_SYS_OPTIONS="-DSYS_UNKNOWN"
|
||||
CFG_EXE_SUFFIX=""
|
||||
@@ -654,12 +665,6 @@ function try_compile()
|
||||
{ (eval "$CC $CFG_CFLAGS conftest.c $CFG_LDFLAGS $CFG_LIBS -lm -o conftest") 2>>$LOGFILE; } && test -s conftest
|
||||
}
|
||||
|
||||
function try_preprocess()
|
||||
{ echo "$CC $CFG_CFLAGS -E conftest.c -o conftest.out" >>$LOGFILE
|
||||
cat conftest.c >>$LOGFILE
|
||||
{ (eval "$CC $CFG_CFLAGS -E conftest.c -o conftest.out") 2>>$LOGFILE; } && test -s conftest.out
|
||||
}
|
||||
|
||||
# Try to compile a main() with a given function
|
||||
|
||||
function try_function()
|
||||
@@ -688,7 +693,8 @@ function try_common_library_locations
|
||||
/usr/XFree86/lib/X11 \
|
||||
/usr/lib \
|
||||
/usr/local/lib \
|
||||
/usr/pkg/lib \
|
||||
/usr/openwin/lib \
|
||||
/usr/openwin/share/lib \
|
||||
; \
|
||||
do
|
||||
if test -r "$test_dir/$lib_a" || test -r "$test_dir/$lib_so"; then
|
||||
@@ -791,7 +797,8 @@ function try_common_header_locations()
|
||||
/usr/XFree86/include/X11 \
|
||||
/usr/include \
|
||||
/usr/local/include \
|
||||
/usr/pkg/include \
|
||||
/usr/openwin/include \
|
||||
/usr/openwin/share/include \
|
||||
; \
|
||||
do
|
||||
test_header=$test_dir/$header
|
||||
@@ -1364,7 +1371,18 @@ function REQUIRE_GTK2()
|
||||
|
||||
echo -n " pkg-config... "
|
||||
if pkg-config --cflags gtk+-2.0 >>config.tmp 2>&1 && pkg-config $threads --libs gtk+-2.0 >>config.tmp 2>&1 ; then
|
||||
echo "works"
|
||||
if test $cfg_system == "solaris"; then
|
||||
CFG_GTK2_LIBS=`pkg-config $threads --libs gtk+-2.0`
|
||||
if (echo $CFG_GTK2_LIBS | grep "mt") > /dev/null 2>&1; then
|
||||
echo "broken, Solaris fix will be applied"
|
||||
broken_solaris="yes"
|
||||
else
|
||||
broken_solaris="no"
|
||||
echo "works"
|
||||
fi
|
||||
else
|
||||
echo "works"
|
||||
fi
|
||||
rm config.tmp
|
||||
else
|
||||
echo "failed"
|
||||
@@ -1396,6 +1414,10 @@ EOF
|
||||
CFG_GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
|
||||
CFG_GTK2_LIBS=`pkg-config $threads --libs gtk+-2.0`
|
||||
|
||||
if test "$broken_solaris" == "yes"; then
|
||||
CFG_GTK2_LIBS=`echo $CFG_GTK2_LIBS | sed -e 's/-mt//'`
|
||||
fi
|
||||
|
||||
CFG_GTK2_BINDIR=`which pkg-config`
|
||||
CFG_GTK2_BINDIR=`echo $CFG_GTK2_BINDIR | sed -e 's/.exe//' | sed -e 's/\/pkg-config//'`
|
||||
|
||||
@@ -1403,18 +1425,21 @@ EOF
|
||||
CFG_LIBS="$CFG_LIBS $CFG_GTK2_LIBS"
|
||||
|
||||
cat >conftest.c <<EOF
|
||||
#include <gtk/gtkversion.h>
|
||||
|
||||
CPPABUSE GTK_MAJOR_VERSION.GTK_MINOR_VERSION.GTK_MICRO_VERSION
|
||||
#include <gtk/gtk.h>
|
||||
int main(int argc, char *argv[])
|
||||
{ GtkWidget *window;
|
||||
|
||||
printf("%d.%d.%d\n",GTK_MAJOR_VERSION,GTK_MINOR_VERSION,GTK_MICRO_VERSION);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
echo -n " test preprocessing... "
|
||||
echo -n " test compile... "
|
||||
|
||||
if try_preprocess; then
|
||||
if try_compile; then
|
||||
echo "works"
|
||||
rm -f conftest.c
|
||||
found_version=$(grep CPPABUSE ./conftest.out | tr -d "CPABUSE ()")
|
||||
rm -f conftest.out
|
||||
found_version=`./conftest`
|
||||
if ! check_version "GTK+" "$want_major" "$want_minor" "$want_micro" "$found_version"; then
|
||||
echo -e "\n Did not find a suitable version of GTK+."
|
||||
exit 1
|
||||
@@ -1564,11 +1589,11 @@ int main(){
|
||||
#ifdef $symb_name
|
||||
return 0; }
|
||||
#else
|
||||
#error no symbol }
|
||||
return 1; }
|
||||
#endif
|
||||
EOF
|
||||
|
||||
if try_compile ; then
|
||||
if try_compile && ./conftest; then
|
||||
answer="yes"
|
||||
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_$symb_upcase"
|
||||
echo " $symb_name in $incl_name: $answer"
|
||||
@@ -1701,70 +1726,7 @@ EOF
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Figure out bitness of system
|
||||
#
|
||||
|
||||
function CHECK_BITNESS()
|
||||
{
|
||||
if test -n "$cfg_help_mode"; then
|
||||
echo " --with-bitness=[32 | 64]"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo -e "\n/* *** CHECK_BITNESS */\n" >>$LOGFILE
|
||||
echo -n "Checking bitness..."
|
||||
|
||||
# See if user wants to override our test
|
||||
|
||||
if test -n "$cfg_with_bitness"; then
|
||||
case "$cfg_with_bitness" in
|
||||
32) echo " 32bit (user supplied)"
|
||||
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_32BIT"
|
||||
;;
|
||||
64) echo " 64bit (user supplied)"
|
||||
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_64BIT"
|
||||
;;
|
||||
*) echo -e " $cfg_with_bitness (illegal value)\n"
|
||||
echo "Please use one of the following values:"
|
||||
echo "--with-bitness=[32 | 64]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Try automatic detection
|
||||
|
||||
cat > conftest.c <<EOF
|
||||
int main()
|
||||
{ switch(sizeof(char*))
|
||||
{ case 4: printf("32\n"); break;
|
||||
case 8: printf("64\n"); break;
|
||||
default: printf("failure\n"); break;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
if try_compile; then
|
||||
bitness=`./conftest`
|
||||
case "$bitness" in
|
||||
32) echo " 32bit"
|
||||
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_32BIT"
|
||||
;;
|
||||
64) echo " 64bit"
|
||||
CFG_HAVE_OPTIONS="$CFG_HAVE_OPTIONS -DHAVE_64BIT"
|
||||
;;
|
||||
*) echo -e " error\n"
|
||||
echo "System bitness could not be determined."
|
||||
echo "Please specify one using the following option:"
|
||||
echo "--with-bitness=[32|64]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
@@ -1824,64 +1786,6 @@ EOF
|
||||
CFG_CFLAGS=$cflags_save
|
||||
}
|
||||
|
||||
#
|
||||
# Check for AltiVec.
|
||||
#
|
||||
|
||||
function CHECK_ALTIVEC()
|
||||
{
|
||||
if test -n "$cfg_help_mode"; then
|
||||
echo " --with-altivec=[yes | no]"
|
||||
return 0
|
||||
fi
|
||||
|
||||
CHECK_ALTIVEC_INVOKED=1
|
||||
|
||||
echo -e "\n/* *** CHECK_ALTIVEC */\n" >>$LOGFILE
|
||||
echo -n "Checking for AltiVec..."
|
||||
|
||||
# See if user wants to override our test
|
||||
|
||||
if test -n "$cfg_with_altivec"; then
|
||||
case "$cfg_with_altivec" in
|
||||
no) echo " no (user supplied)"
|
||||
;;
|
||||
yes) echo " yes (user supplied)"
|
||||
CFG_ALTIVEC_OPTIONS="-maltivec -DHAVE_ALTIVEC"
|
||||
;;
|
||||
*) echo -e " $cfg_with_altivec (illegal value)\n"
|
||||
echo "Please use one of the following values:"
|
||||
echo "--with-altivec=[yes | no]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Do automatic detection
|
||||
|
||||
cat > conftest.c <<EOF
|
||||
#include <altivec.h>
|
||||
|
||||
int main()
|
||||
{ vector unsigned char a, b, c;
|
||||
|
||||
c = vec_or(a, b);
|
||||
}
|
||||
EOF
|
||||
|
||||
local cflags_save=$CFG_CFLAGS
|
||||
CFG_CFLAGS="-maltivec $CFG_CFLAGS"
|
||||
if try_compile; then
|
||||
echo " yes"
|
||||
CFG_ALTIVEC_OPTIONS="-maltivec -DHAVE_ALTIVEC"
|
||||
else
|
||||
echo " no"
|
||||
fi
|
||||
CFG_CFLAGS=$cflags_save
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Check whether a certain program is there and executable.
|
||||
#
|
||||
@@ -1926,9 +1830,6 @@ function CREATE_MAKEFILES()
|
||||
if test -n "$CHECK_SSE2_INVOKED"; then
|
||||
echo "CFG_SSE2_OPTIONS = $CFG_SSE2_OPTIONS" >> Makefile.config
|
||||
fi
|
||||
if test -n "$CHECK_ALTIVEC_INVOKED"; then
|
||||
echo "CFG_ALTIVEC_OPTIONS = $CFG_ALTIVEC_OPTIONS" >> Makefile.config
|
||||
fi
|
||||
echo >> Makefile.config
|
||||
|
||||
for i in $@; do
|
||||
|
||||
Reference in New Issue
Block a user