Merge from trunk, pending.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/battleAI@14776 178a84e3-b1eb-0310-8ba1-8eac791a3b58
10
Makefile.am
@@ -1,10 +0,0 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = $(BULLETTREE) $(ENETTREE) src doc data tools
|
||||
|
||||
pkgdatadir=$(datadir)/doc/$(PACKAGE)
|
||||
dist_pkgdata_DATA=AUTHORS ChangeLog COPYING README
|
||||
EXTRA_DIST=autogen.sh m4 CMakeLists.txt
|
||||
|
||||
# NEWS only contains "see changelog"
|
||||
# CHANGES only contains "see NEW"
|
||||
@@ -1,8 +0,0 @@
|
||||
AC_DEFUN([MY_EXPAND_DIR], [
|
||||
$1=$2
|
||||
$1=`(
|
||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
|
||||
eval echo \""[$]$1"\"
|
||||
)`
|
||||
])
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
# [Re]generate autoconf files.
|
||||
|
||||
autoreconf --install "$@"
|
||||
666
config.rpath
@@ -1,666 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2007 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
darwin*)
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mingw* | cygwin* | pw32* | os2*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
case $cc_basename in
|
||||
icc* | ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
pgcc | pgf77 | pgf90)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we cannot use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | k*bsd*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if test "$GCC" = yes ; then
|
||||
:
|
||||
else
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
*)
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux* | k*bsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
461
configure.ac
@@ -1,461 +0,0 @@
|
||||
# Process this file with autogen.sh to produce a configure script.
|
||||
|
||||
AC_INIT(supertuxkart,SVN)
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
|
||||
# ================================================
|
||||
# Initialize the automake stuff
|
||||
# set the $host variable based on local machine/os
|
||||
# ================================================
|
||||
AC_CANONICAL_HOST
|
||||
AM_INIT_AUTOMAKE([foreign tar-ustar])
|
||||
|
||||
|
||||
# =====================================================
|
||||
# Set the default CFLAGS/CXXFLAGS
|
||||
# If these were not set, the AC_PROG_CC and AC_PROG_CXX
|
||||
# scripts set them to "-g -O2".
|
||||
# =====================================================
|
||||
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes"
|
||||
CXXFLAGS="$CXXFLAGS -Wall"
|
||||
|
||||
# ===================
|
||||
# Check for compilers
|
||||
# ===================
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CXX
|
||||
|
||||
# This macro defines WORDS_BIGENDIAN if building for a big endian machine.
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
|
||||
AC_LANG(C++)
|
||||
|
||||
|
||||
# ===========================
|
||||
# Check for `configure' flags
|
||||
# ===========================
|
||||
SUMMARY="\nSummary of optional components:\n==============================="
|
||||
|
||||
AC_ARG_ENABLE(debug, [AS_HELP_STRING(--enable-debug,
|
||||
[enable debugging info])])
|
||||
if test x$enable_debug = xyes; then
|
||||
AC_DEFINE([DEBUG], [], [enable debugging cheats and shortcuts])
|
||||
CFLAGS="$CFLAGS -g -pg"
|
||||
CXXFLAGS="$CXXFLAGS -g -pg"
|
||||
SUMMARY="$SUMMARY\nEnabled debugging, please disable for a release!!"
|
||||
else
|
||||
CFLAGS="$CFLAGS -DNDEBUG"
|
||||
CXXFLAGS="$CXXFLAGS -DNDEBUG"
|
||||
SUMMARY="$SUMMARY\nDisabled debugging, asserts have been turned off"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(optimization, [AS_HELP_STRING(--disable-optimization,
|
||||
[disable compiler optimizations])],,
|
||||
enable_optimization=yes)
|
||||
if test x$enable_optimization = xyes; then
|
||||
CFLAGS="$CFLAGS -O2"
|
||||
CXXFLAGS="$CXXFLAGS -O2"
|
||||
else
|
||||
SUMMARY="$SUMMARY\nDisabled compiler optimizations."
|
||||
fi
|
||||
|
||||
# ===================
|
||||
# Checks for programs.
|
||||
# ===================
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
|
||||
# ===============================
|
||||
# Check for MS Windows environment
|
||||
# ================================
|
||||
AC_CHECK_HEADER(windows.h)
|
||||
|
||||
# ==================================
|
||||
# check for OpenGL related libraries
|
||||
# ==================================
|
||||
case "${host}" in
|
||||
*darwin*|*macosx*)
|
||||
opengl_LIBS="$LIBS -framework Carbon -framework OpenGL -framework IOKit -framework AGL"
|
||||
;;
|
||||
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
# CygWin under Windoze.
|
||||
|
||||
echo Win32 specific hacks...
|
||||
AC_DEFINE([WIN32], 1, [Define for Win32 platforms])
|
||||
AC_DEFINE([NOMINMAX], 1, [Define for Win32 platforms])
|
||||
|
||||
opengl_LIBS="-lopengl32 -luser32 -lgdi32 -lm -lwinmm"
|
||||
joystick_LIBS="$joystick_LIBS -lwinmm"
|
||||
LDFLAGS="$LDFLAGS -mwindows"
|
||||
|
||||
echo "Will link apps with $LIBS"
|
||||
;;
|
||||
|
||||
*)
|
||||
# X-Windows based machines
|
||||
|
||||
save_LIBS=$LIBS
|
||||
AC_SEARCH_LIBS(glNewList, [ GL GLcore MesaGL ])
|
||||
opengl_LIBS="$LIBS"
|
||||
LIBS=$save_LIBS
|
||||
if test "x$ac_cv_search_glNewList" = "x-lGLcore"; then
|
||||
# if GLcore found, then also check for GL
|
||||
AC_SEARCH_LIBS(glXCreateContext, GL)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# ========================================
|
||||
# check for OpenAL libraries
|
||||
# ========================================
|
||||
save_LIBS=$LIBS
|
||||
|
||||
case "${host}" in
|
||||
*darwin*|*macosx*)
|
||||
# search for OpenAL installed in a UNIX way first. This is necessary since OS X 10.4
|
||||
# comes with an OpenAL framework that's too old, so to retain 10.4 support we need to
|
||||
# build OpenAL from source, and can't use Apple's framework.
|
||||
AC_SEARCH_LIBS(alGenBuffers, [openal alut], have_al_lib=yes)
|
||||
|
||||
# We couldn't find OpenAL installed the UNIX way, so fall back to using frameworks
|
||||
if test x$have_al_lib != xyes; then
|
||||
LIBS="-framework OpenAL $LIBS"
|
||||
have_al_lib=yes
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
AC_SEARCH_LIBS(alGenBuffers, [openal alut], have_al_lib=yes)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x$have_al_lib = xyes; then
|
||||
# Apple has the headers in OpenAL/al.h instead of AL/al.h
|
||||
AC_CHECK_HEADERS([AL/al.h OpenAL/al.h], have_al_hdr=yes)
|
||||
fi
|
||||
|
||||
if test x$have_al_hdr != xyes; then
|
||||
AC_MSG_ERROR([[cannot find useable OpenAL installation. You need to install OpenAL.]])
|
||||
fi
|
||||
|
||||
openal_LIBS="$LIBS"
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
# ====================
|
||||
# check for Ogg Vorbis
|
||||
# ====================
|
||||
|
||||
save_LIBS=$LIBS
|
||||
|
||||
# also check in /usr/local
|
||||
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
|
||||
# search for the libraries needed to use ogg vorbis
|
||||
AC_SEARCH_LIBS(ov_open, [vorbisfile], have_vorbisfile_lib=yes, have_vorbisfile_lib=no, [-lvorbis])
|
||||
|
||||
if test x$have_vorbisfile_lib = xyes; then
|
||||
# check for the headers needed by ogg vorbis
|
||||
AC_CHECK_HEADER(vorbis/vorbisfile.h, have_vorbisfile_hdr=yes)
|
||||
AC_CHECK_HEADER(ogg/ogg.h, have_ogg_hdr=yes)
|
||||
fi
|
||||
SUMMARY="$SUMMARY\n"
|
||||
|
||||
if test x$have_vorbisfile_hdr = xyes -a x$have_ogg_hdr = xyes; then
|
||||
AC_DEFINE([HAVE_OGGVORBIS], 1, [Defined when Ogg Vorbis is available])
|
||||
SUMMARY="$SUMMARY\nWe have Ogg Vorbis support."
|
||||
else
|
||||
AC_MSG_ERROR([[cannot find useable Ogg Vorbis installation. You need to install libogg and libvorbis.]])
|
||||
#SUMMARY="$SUMMARY\nNo Ogg Vorbis support - the game will play with sound effects, but without music."
|
||||
#SUMMARY="$SUMMARY\nPlease install ogg vorbis!"
|
||||
fi
|
||||
|
||||
oggvorbis_LIBS="$LIBS"
|
||||
LIBS=$save_LIBS
|
||||
|
||||
# The following are C++ items that need to be tested for with the c++
|
||||
# compiler
|
||||
AC_LANG_PUSH(C++)
|
||||
|
||||
|
||||
# ==================
|
||||
# Check for irrlicht
|
||||
# ==================
|
||||
AC_ARG_WITH(irrlicht, [AS_HELP_STRING(--with-irrlicht=PREFIX,
|
||||
[specify the prefix path to irrlicht])])
|
||||
if test "x$with_irrlicht" != "x" ; then
|
||||
CPPFLAGS="${CPPFLAGS} -I $with_irrlicht/include -I $with_irrlicht/include/irrlicht"
|
||||
AC_CHECK_HEADER(irrlicht.h, have_irrlicht_hdr=yes)
|
||||
if test x$have_irrlicht_hdr != xyes; then
|
||||
AC_MSG_ERROR([Can not find irrlicht in $with_irrlicht.])
|
||||
fi
|
||||
else
|
||||
CPPFLAGS_Save=$CPPFLAGS
|
||||
|
||||
# check in /usr
|
||||
echo " in /usr/ : "
|
||||
|
||||
CPPFLAGS="${CPPFLAGS_Save} -I/usr/include/irrlicht"
|
||||
AC_CHECK_HEADER(irrlicht.h, irrlicht_found_in_usr=yes, irrlicht_found_in_usr=no)
|
||||
|
||||
# if it's not found there, try /usr/local instead
|
||||
if test x$irrlicht_found_in_usr == xyes; then
|
||||
with_irrlicht="/usr"
|
||||
else
|
||||
|
||||
# I'd like to fall back to check /usr/local second, but stupid autotools does not support
|
||||
# checking for a header in 2 directories because it caches results
|
||||
#AC_MSG_ERROR([Can't find irrlicht installation in /usr, use --with-irrlicht...])
|
||||
|
||||
# erase cached result
|
||||
unset ac_cv_header_irrlicht_h
|
||||
|
||||
echo " in /usr/local/ : "
|
||||
CPPFLAGS="${CPPFLAGS_Save} -I/usr/local/include/irrlicht"
|
||||
AC_CHECK_HEADER(irrlicht.h, irrlicht_found_in_usr_local=yes, irrlicht_found_in_usr_local=no)
|
||||
|
||||
if test x$irrlicht_found_in_usr_local == xyes; then
|
||||
with_irrlicht="/usr/local"
|
||||
else
|
||||
AC_MSG_ERROR([Can not find irrlicht installation in standard prefixes, use --with-irrlicht...])
|
||||
fi
|
||||
fi
|
||||
|
||||
CPPFLAGS="${CPPFLAGS_Save} -I ${with_irrlicht}/include/irrlicht"
|
||||
|
||||
fi
|
||||
|
||||
case "${host}" in
|
||||
*-*-linux* )
|
||||
irrlicht_LIBS="-L/$with_irrlicht/lib/Linux -L/$with_irrlicht/lib -lIrrlicht -lX11 -lpthread"
|
||||
;;
|
||||
*darwin*|*macosx*)
|
||||
irrlicht_LIBS="-L/$with_irrlicht/lib/ -lIrrlicht -framework Cocoa"
|
||||
;;
|
||||
*freebsd*)
|
||||
irrlicht_LIBS="-L/$with_irrlicht/lib/ -lIrrlicht -lpthread"
|
||||
esac
|
||||
|
||||
# ---- Check these flags do work by building a small irrLicht sample
|
||||
echo "checking for irrlicht libraries..."
|
||||
save_LIBS=$LIBS
|
||||
LIBS="$LIBS $irrlicht_LIBS $opengl_LIBS"
|
||||
|
||||
irrlicht_sample_built_fine="false"
|
||||
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
# include "irrlicht.h"
|
||||
int main() {
|
||||
irr::createDevice(irr::video::EDT_NULL);
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
irrlicht_sample_built_fine="true",
|
||||
irrlicht_sample_built_fine="false"
|
||||
)
|
||||
|
||||
case "${host}" in
|
||||
*-*-linux* )
|
||||
# If base irrLicht flags failed, try again with Xxf86vm
|
||||
# FIXME: this program when run prints out two lines (version numbers) to stdout
|
||||
if test x$irrlicht_sample_built_fine = xfalse; then
|
||||
LIBS="$LIBS -lXxf86vm"
|
||||
works_with_Xxf86vm="false"
|
||||
AC_TRY_RUN([
|
||||
# include "irrlicht.h"
|
||||
int main() {
|
||||
irr::createDevice(irr::video::EDT_NULL);
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
works_with_Xxf86vm="true",
|
||||
)
|
||||
|
||||
if test x$works_with_Xxf86vm = xtrue; then
|
||||
irrlicht_LIBS="$irrlicht_LIBS -lXxf86vm"
|
||||
irrlicht_sample_built_fine="true"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test x$irrlicht_sample_built_fine = xfalse; then
|
||||
AC_MSG_ERROR([Cann not build test irrLicht program. Check config.log to see the errors])
|
||||
fi
|
||||
|
||||
# ---- Check we have the minimum required irrLicht version
|
||||
echo -n "checking irrlicht version is recent enough... "
|
||||
|
||||
irrlicht_min_version_met="false"
|
||||
|
||||
# Note that irrlicht 1.8 potentially needs additional flags (-lXcursor, or
|
||||
# undefine _IRR_LINUX_XCURSOR_ # in IrrCompileConfig.h). Since there might
|
||||
# be other changes, for now I remove support for irrlicht trunk/1.8
|
||||
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
# include "irrlicht.h"
|
||||
int main() {
|
||||
#if (IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR == 7)
|
||||
#error "STK needs irrlicht 1.8* to work properly (which might be only available"
|
||||
#error "as svn trunk atm"
|
||||
#else
|
||||
// ok
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
],
|
||||
irrlicht_min_version_met="true",
|
||||
irrlicht_min_version_met="false"
|
||||
)
|
||||
|
||||
if test x$irrlicht_min_version_met = xfalse; then
|
||||
AC_MSG_ERROR([Your irrLicht is too old, please update irrLicht.
|
||||
You need irrlicht 1.8.
|
||||
While irrlicht 1.8 is not released, we recommend using version 3995 from irrlicht SVN trunk.])
|
||||
else
|
||||
echo "yes"
|
||||
fi
|
||||
|
||||
LIBS=$save_LIBS
|
||||
|
||||
# ==================
|
||||
# Check for Fribidi
|
||||
# ==================
|
||||
|
||||
save_LIBS=$LIBS
|
||||
|
||||
# also check in /usr/local
|
||||
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib"
|
||||
|
||||
# search for the libraries needed to use ogg vorbis
|
||||
AC_SEARCH_LIBS(fribidi_log2vis, [fribidi], have_fribidi=yes, have_fribidi=no)
|
||||
|
||||
if test x$have_fribidi = xyes; then
|
||||
AC_CHECK_HEADER(fribidi/fribidi.h, have_fribidi_hdr=yes)
|
||||
fi
|
||||
SUMMARY="$SUMMARY\n"
|
||||
|
||||
if test x$have_fribidi = xyes -a x$have_fribidi_hdr = xyes; then
|
||||
AC_DEFINE([ENABLE_BIDI], 1, [Defined when Fribidi is available])
|
||||
SUMMARY="$SUMMARY\nFribidi (RTL languages support) support enabled."
|
||||
fribidi_LIBS="$LIBS"
|
||||
else
|
||||
SUMMARY="$SUMMARY\nFribidi (RTL languages support) support disabled."
|
||||
fribidi_LIBS=""
|
||||
fi
|
||||
|
||||
LIBS=$save_LIBS
|
||||
|
||||
# Libcurl is needed in all build modes
|
||||
PKG_CHECK_MODULES(LIBCURL, libcurl >= 0.1)
|
||||
|
||||
# ======================================================
|
||||
# Try to supply the SVN revision number for the compiler
|
||||
# ======================================================
|
||||
AC_CHECK_PROGS(have_svnversion,[svnversion],"no")
|
||||
if test x$have_svnversion != xno; then
|
||||
SVNVERSION="`svnversion $srcdir`"
|
||||
AC_DEFINE_UNQUOTED([SVNVERSION],"$SVNVERSION",["SVN revision number"])
|
||||
fi
|
||||
|
||||
# ==============
|
||||
# Bullet physics
|
||||
# ==============
|
||||
AC_DEFINE([BT_NO_PROFILE], [], [Disable bullet internal profiling])
|
||||
BULLETTREE="lib/bullet"
|
||||
bullet_LIBS="-L../lib/bullet/src -lbulletdynamics -lbulletcollision -lbulletmath"
|
||||
|
||||
|
||||
# ====
|
||||
# enet
|
||||
# ====
|
||||
AC_CHECK_FUNC(gethostbyaddr_r, [AC_DEFINE(HAS_GETHOSTBYADDR_R)])
|
||||
AC_CHECK_FUNC(gethostbyname_r, [AC_DEFINE(HAS_GETHOSTBYNAME_R)])
|
||||
AC_CHECK_FUNC(poll, [AC_DEFINE(HAS_POLL)])
|
||||
AC_CHECK_FUNC(fcntl, [AC_DEFINE(HAS_FCNTL)])
|
||||
AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAS_INET_PTON)])
|
||||
AC_CHECK_FUNC(inet_ntop, [AC_DEFINE(HAS_INET_NTOP)])
|
||||
|
||||
AC_CHECK_MEMBER(struct msghdr.msg_flags, [AC_DEFINE(HAS_MSGHDR_FLAGS)], , [#include <sys/socket.h>])
|
||||
|
||||
AC_CHECK_TYPE(socklen_t, [AC_DEFINE(HAS_SOCKLEN_T)], ,
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
)
|
||||
|
||||
AC_EGREP_HEADER(MSG_MAXIOVLEN, /usr/include/sys/socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
|
||||
AC_EGREP_HEADER(MSG_MAXIOVLEN, socket.h, AC_DEFINE(ENET_BUFFER_MAXIMUM, [MSG_MAXIOVLEN]))
|
||||
|
||||
case "${host}" in
|
||||
*-*-cygwin* | *-*-mingw32*)
|
||||
enet_LIBS="-Lenet -lenet -lws2_32"
|
||||
;;
|
||||
*)
|
||||
enet_LIBS="-L../lib/enet -lenet"
|
||||
;;
|
||||
esac
|
||||
ENETTREE="lib/enet"
|
||||
|
||||
# ==========================================
|
||||
# Check for a known compiler bug, details in
|
||||
# src/bullet/src/Makefile.am
|
||||
# ==========================================
|
||||
ORIGCXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -fno-elide-constructors"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
|
||||
AC_MSG_RESULT(yes); NOELIDE=-fno-elide-constructors,
|
||||
AC_MSG_RESULT(no); NOELIDE="")
|
||||
CXXFLAGS="$ORIGCXXFLAGS"
|
||||
AC_SUBST(NOELIDE)
|
||||
|
||||
# =========================
|
||||
# subst bars in Makefile.am
|
||||
# =========================
|
||||
|
||||
AC_SUBST(irrlicht_LIBS)
|
||||
AC_SUBST(fribidi_LIBS)
|
||||
AC_SUBST(bullet_LIBS)
|
||||
AC_SUBST(enet_LIBS)
|
||||
AC_SUBST(opengl_LIBS)
|
||||
AC_SUBST(openal_LIBS)
|
||||
AC_SUBST(oggvorbis_LIBS)
|
||||
AC_SUBST(BULLETTREE)
|
||||
AC_SUBST(ENETTREE)
|
||||
|
||||
# ================
|
||||
# Create makefiles
|
||||
# ================
|
||||
AC_CONFIG_FILES([ \
|
||||
Makefile \
|
||||
data/Makefile \
|
||||
data/challenges/Makefile \
|
||||
data/fonts/Makefile \
|
||||
data/gfx/Makefile \
|
||||
data/grandprix/Makefile \
|
||||
data/gui/Makefile \
|
||||
data/karts/Makefile \
|
||||
data/models/Makefile \
|
||||
data/music/Makefile \
|
||||
data/po/Makefile \
|
||||
data/shaders/Makefile \
|
||||
data/sfx/Makefile \
|
||||
data/textures/Makefile \
|
||||
data/tracks/Makefile \
|
||||
doc/Makefile \
|
||||
src/Makefile \
|
||||
src/ide/Makefile \
|
||||
lib/bullet/Makefile \
|
||||
lib/bullet/src/Makefile \
|
||||
lib/enet/Makefile \
|
||||
tools/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
echo -e $SUMMARY
|
||||
@@ -1,25 +0,0 @@
|
||||
# data/
|
||||
|
||||
SUBDIRS = challenges fonts gfx gui karts models music po sfx textures tracks \
|
||||
grandprix shaders
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
$(shell find $(srcdir) -maxdepth 1 -name "*.challenge") \
|
||||
stk_config.xml powerup.xml items.xml \
|
||||
CREDITS run_me.sh
|
||||
|
||||
desktopdir = $(prefix)/share/applications
|
||||
desktop_DATA = supertuxkart.desktop
|
||||
|
||||
icondir = $(prefix)/share/pixmaps
|
||||
dist_icon_DATA = supertuxkart_32.png supertuxkart_128.png
|
||||
|
||||
|
||||
# The desktop file needs the absolute path to the binary
|
||||
# since e.g. /usr/games might not be in the standard path
|
||||
EXTRA_DIST = supertuxkart_desktop.template
|
||||
CLEANFILES = supertuxkart.desktop
|
||||
supertuxkart.desktop: Makefile supertuxkart_desktop.template
|
||||
sed 's#@PREFIX@#$(prefix)#' '$(srcdir)/supertuxkart_desktop.template' >supertuxkart.desktop
|
||||
@@ -1,5 +0,0 @@
|
||||
# challenges/
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/challenges
|
||||
|
||||
nobase_dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.challenge")
|
||||
@@ -1,6 +0,0 @@
|
||||
# data/fonts/
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/fonts
|
||||
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.png") \
|
||||
$(shell find $(srcdir) -name "*.xml")
|
||||
@@ -1,5 +0,0 @@
|
||||
#data/gfx
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/gfx
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.xml")
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# data/music
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/grandprix
|
||||
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.grandprix") \
|
||||
$(shell find $(srcdir) -name "*.challenge") \
|
||||
$(shell find $(srcdir) -name "*.tutorial" )
|
||||
@@ -1,12 +0,0 @@
|
||||
# data/gui/
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/gui
|
||||
|
||||
nobase_dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.png" ) \
|
||||
$(shell find $(srcdir) -name "*.jpg" ) \
|
||||
$(shell find $(srcdir) -name "*.stkgui" ) \
|
||||
$(shell find $(srcdir) -name "*.xml" ) \
|
||||
$(shell find $(srcdir) -name "License.txt") \
|
||||
$(shell find $(srcdir) -name "*.stkskin" )
|
||||
|
||||
EXTRA_DIST = $(nobase_pkgdata_DATA)
|
||||
@@ -1,10 +0,0 @@
|
||||
# data/models/
|
||||
|
||||
pkgdatadir = $(datadir)/games/$(PACKAGE)/data/models
|
||||
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.b3d") \
|
||||
$(shell find $(srcdir) -name "*.png") \
|
||||
$(shell find $(srcdir) -name "*.jpg") \
|
||||
$(shell find $(srcdir) -name "*.xml") \
|
||||
License.txt
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# data/po/
|
||||
|
||||
pkgdatadir = $(datadir)/games/@PACKAGE@/data/po
|
||||
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.po") \
|
||||
supertuxkart.pot
|
||||
|
||||
EXTRA_DIST = update_pot.sh
|
||||
@@ -1,7 +0,0 @@
|
||||
# data/shaders/
|
||||
|
||||
pkgdatadir = $(datadir)/games/@PACKAGE@/data/shaders
|
||||
|
||||
dist_pkgdata_DATA = $(shell find $(srcdir) -name "*.frag") \
|
||||
$(shell find $(srcdir) -name "*.vert")
|
||||
|
||||
@@ -23,7 +23,7 @@ varying vec2 uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
|
||||
float delta_x = cos(time*3.0) * sin( 4.0 * gl_TexCoord[0].st.s * 6.28318531 );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
void main() {
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex).xyww;
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/*--- GENERIC HEADER -----------------------------------------------------------------------------*/
|
||||
#version 130
|
||||
|
||||
varying vec3 nor;
|
||||
uniform float far;
|
||||
uniform float objectid;
|
||||
uniform sampler2D tex;
|
||||
|
||||
noperspective in vec3 nor;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
@@ -13,28 +15,16 @@ vec4 encdepth(float v) {
|
||||
return enc;
|
||||
}
|
||||
|
||||
/*--- END OF GENERIC HEADER ----------------------------------------------------------------------*/
|
||||
|
||||
|
||||
uniform sampler2D tex;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture2D(tex, gl_TexCoord[0].st);
|
||||
|
||||
|
||||
|
||||
|
||||
/*--- GENERIC FOOTER -----------------------------------------------------------------------------*/
|
||||
|
||||
float linear_z = (2.0 * near) / (far + near - gl_FragCoord.z * (far - near));
|
||||
// Tune for better inside range without losing outdoors
|
||||
linear_z *= 2.0;
|
||||
|
||||
|
||||
gl_FragData[0] = color;
|
||||
gl_FragData[1] = vec4(nor, linear_z);
|
||||
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, linear_z);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
|
||||
|
||||
/*--- END OF GENERIC FOOTER ----------------------------------------------------------------------*/
|
||||
}
|
||||
|
||||
@@ -1,25 +1,15 @@
|
||||
/*--- GENERIC HEADER ---*/
|
||||
|
||||
varying vec3 nor;
|
||||
uniform mat4 invtworldm;
|
||||
|
||||
|
||||
/*--- END OF GENERIC HEADER --*/
|
||||
|
||||
#version 130
|
||||
uniform vec3 windDir;
|
||||
|
||||
noperspective out vec3 nor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
vec4 vertexPosition = gl_Vertex;
|
||||
vertexPosition.xyz += windDir * gl_Color.r;
|
||||
|
||||
nor = (invtworldm * vec4(gl_Normal, 0.0)).xyz;
|
||||
nor = normalize(nor);
|
||||
nor = nor * 0.5 + 0.5;
|
||||
|
||||
nor = gl_NormalMatrix * gl_Normal;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vertexPosition;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ varying vec3 normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
vec4 viewp = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
eyeVec = normalize(-viewp).xyz;
|
||||
|
||||
@@ -1,36 +1,33 @@
|
||||
// Shader based on work by Fabien Sanglard
|
||||
// Released under the terms of CC-BY 3.0
|
||||
#version 130
|
||||
uniform sampler2D texture; //The texture
|
||||
uniform sampler2D normalMap; //The bump-map
|
||||
|
||||
uniform sampler2D BumpTex; //The bump-map
|
||||
uniform sampler2D DecalTex; //The texture
|
||||
uniform sampler2D LightMapTex;
|
||||
uniform int HasLightMap;
|
||||
|
||||
// New bumpmapping
|
||||
varying vec3 lightVec;
|
||||
varying vec3 halfVec;
|
||||
varying vec3 eyeVec;
|
||||
noperspective in vec3 tangent;
|
||||
noperspective in vec3 bitangent;
|
||||
noperspective in vec3 normal;
|
||||
|
||||
vec4 encdepth(float v) {
|
||||
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
|
||||
enc = fract(enc);
|
||||
enc -= enc.yzww * vec4(1.0/255.0, 1.0/255.0, 1.0/255.0, 0.0);
|
||||
return enc;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
// lookup normal from normal map, move from [0,1] to [-1, 1] range, normalize
|
||||
vec3 normal = 2.0 * texture2D (BumpTex, gl_TexCoord[0].st).rgb - 1.0;
|
||||
normal = normalize (normal);
|
||||
// normal in Tangent Space
|
||||
vec3 TS_normal = 2.0 * texture2D (normalMap, gl_TexCoord[0].st).rgb - 1.0;
|
||||
// Because of interpolation, we need to renormalize
|
||||
vec3 Frag_tangent = normalize(tangent);
|
||||
vec3 Frag_bitangent = normalize(cross(normal, tangent));
|
||||
vec3 Frag_normal = cross(Frag_tangent, Frag_bitangent);
|
||||
|
||||
// compute diffuse lighting
|
||||
float lamberFactor = max (dot (lightVec, normal), 0.0);
|
||||
vec4 diffuseMaterial;
|
||||
|
||||
diffuseMaterial = texture2D (DecalTex, gl_TexCoord[0].st);
|
||||
vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent + TS_normal.z * Frag_normal;
|
||||
FragmentNormal = normalize(FragmentNormal);
|
||||
|
||||
|
||||
if (HasLightMap < 1)
|
||||
{
|
||||
// 0.5 is the ambient light
|
||||
gl_FragColor = diffuseMaterial * (0.5 + lamberFactor*0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_FragColor = diffuseMaterial * (0.5 + lamberFactor*0.5) * texture2D(LightMapTex, gl_TexCoord[0].st);
|
||||
}
|
||||
gl_FragData[0] = texture2D (texture, gl_TexCoord[0].st);
|
||||
gl_FragData[1] = vec4(0.5 * FragmentNormal + 0.5, 1.0);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, 0.0);
|
||||
}
|
||||
|
||||
@@ -1,54 +1,14 @@
|
||||
// Shader based on work by Fabien Sanglard
|
||||
// Released under the terms of CC-BY 3.0
|
||||
|
||||
varying vec3 lightVec;
|
||||
varying vec3 halfVec;
|
||||
varying vec3 eyeVec;
|
||||
|
||||
uniform vec3 lightdir;
|
||||
#version 130
|
||||
noperspective out vec3 tangent;
|
||||
noperspective out vec3 bitangent;
|
||||
noperspective out vec3 normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
// Building the matrix Eye Space -> Tangent Space
|
||||
vec3 n = normalize (gl_NormalMatrix * gl_Normal);
|
||||
vec3 t = normalize (gl_NormalMatrix * gl_MultiTexCoord1.xyz); // tangent
|
||||
vec3 b = cross (n, t);
|
||||
|
||||
vec3 vertexPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||
|
||||
// transform light and half angle vectors by tangent basis
|
||||
vec3 v;
|
||||
v.x = dot (lightdir, t);
|
||||
v.y = dot (lightdir, b);
|
||||
v.z = dot (lightdir, n);
|
||||
lightVec = normalize (v);
|
||||
|
||||
|
||||
v.x = dot (vertexPosition, t);
|
||||
v.y = dot (vertexPosition, b);
|
||||
v.z = dot (vertexPosition, n);
|
||||
eyeVec = normalize (v);
|
||||
|
||||
|
||||
vertexPosition = normalize(vertexPosition);
|
||||
|
||||
// Normalize the halfVector to pass it to the fragment shader
|
||||
|
||||
// No need to divide by two, the result is normalized anyway.
|
||||
// vec3 halfVector = normalize((vertexPosition + lightDir) / 2.0);
|
||||
vec3 halfVector = normalize(vertexPosition + lightdir);
|
||||
v.x = dot (halfVector, t);
|
||||
v.y = dot (halfVector, b);
|
||||
v.z = dot (halfVector, n);
|
||||
|
||||
// No need to normalize, t,b,n and halfVector are normal vectors.
|
||||
//normalize (v);
|
||||
halfVec = v ;
|
||||
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
tangent = gl_NormalMatrix * gl_MultiTexCoord1.xyz;
|
||||
bitangent = gl_NormalMatrix * gl_MultiTexCoord2.xyz;
|
||||
gl_Position = ftransform();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
varying vec3 nor;
|
||||
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D lighttex;
|
||||
uniform float far;
|
||||
@@ -7,6 +6,8 @@ uniform int hastex;
|
||||
uniform int haslightmap;
|
||||
uniform float objectid;
|
||||
|
||||
noperspective in vec3 nor;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
vec4 encdepth(float v) {
|
||||
@@ -34,7 +35,7 @@ void main() {
|
||||
else
|
||||
gl_FragData[0] = gl_Color;
|
||||
|
||||
gl_FragData[1] = vec4(nor, linear_z);
|
||||
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, linear_z);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
varying vec3 nor;
|
||||
uniform mat4 invtworldm;
|
||||
#version 130
|
||||
|
||||
noperspective out vec3 nor;
|
||||
|
||||
void main() {
|
||||
|
||||
nor = (invtworldm * vec4(gl_Normal, 0.0)).xyz;
|
||||
nor = normalize(nor);
|
||||
nor = nor * 0.5 + 0.5;
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
nor = gl_NormalMatrix * gl_Normal;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
gl_Position = ftransform();
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
varying vec3 nor;
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform float far;
|
||||
uniform int hastex;
|
||||
uniform float objectid;
|
||||
|
||||
noperspective in vec3 nor;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
vec4 encdepth(float v) {
|
||||
@@ -20,18 +22,18 @@ void main() {
|
||||
// Tune for better inside range without losing outdoors
|
||||
linear_z *= 2.0;
|
||||
|
||||
if (hastex != 0) {
|
||||
//if (hastex != 0) {
|
||||
vec4 col = texture2D(tex, gl_TexCoord[0].xy);
|
||||
|
||||
if (col.a < 0.5)
|
||||
discard;
|
||||
|
||||
gl_FragData[0] = col;
|
||||
} else {
|
||||
gl_FragData[0] = gl_Color;
|
||||
}
|
||||
//} else {
|
||||
// gl_FragData[0] = gl_Color;
|
||||
//}
|
||||
|
||||
gl_FragData[1] = vec4(nor, linear_z);
|
||||
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, linear_z);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
varying vec3 nor;
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform float far;
|
||||
uniform int hastex;
|
||||
uniform float objectid;
|
||||
|
||||
varying vec3 eyenor;
|
||||
varying vec3 viewpos;
|
||||
noperspective in vec3 nor;
|
||||
noperspective in vec3 eyenor;
|
||||
noperspective in vec3 viewpos;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
@@ -39,7 +40,7 @@ void main() {
|
||||
gl_FragData[0] = gl_Color + vec4(vec3(rim), 0.0);
|
||||
}
|
||||
|
||||
gl_FragData[1] = vec4(nor, linear_z);
|
||||
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, linear_z);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
varying vec3 nor;
|
||||
uniform mat4 invtworldm;
|
||||
#version 130
|
||||
|
||||
varying vec3 eyenor;
|
||||
varying vec3 viewpos;
|
||||
noperspective out vec3 nor;
|
||||
noperspective out vec3 eyenor;
|
||||
noperspective out vec3 viewpos;
|
||||
|
||||
void main() {
|
||||
|
||||
nor = (invtworldm * vec4(gl_Normal, 0.0)).xyz;
|
||||
nor = normalize(nor);
|
||||
nor = nor * 0.5 + 0.5;
|
||||
|
||||
nor = gl_NormalMatrix * gl_Normal;
|
||||
eyenor = gl_NormalMatrix * gl_Normal;
|
||||
viewpos = -normalize((gl_ModelViewMatrix * gl_Vertex).xyz);
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
varying vec3 nor;
|
||||
#version 130
|
||||
uniform sampler2D tex;
|
||||
uniform float far;
|
||||
uniform float objectid;
|
||||
|
||||
varying vec3 eyenor;
|
||||
varying vec3 viewpos;
|
||||
noperspective in vec3 eyenor;
|
||||
noperspective in vec3 viewpos;
|
||||
noperspective in vec3 nor;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
void main() {
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
gl_Position = ftransform();
|
||||
gl_FrontColor = gl_Color;
|
||||
}
|
||||
|
||||
@@ -3,48 +3,39 @@ uniform sampler2D dtex;
|
||||
|
||||
uniform vec3 center;
|
||||
uniform vec3 col;
|
||||
uniform vec3 campos;
|
||||
uniform float r;
|
||||
uniform float spec;
|
||||
uniform vec2 screen;
|
||||
uniform mat4 invprojview;
|
||||
uniform mat4 invproj;
|
||||
|
||||
float decdepth(vec4 rgba) {
|
||||
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
vec2 texc = gl_FragCoord.xy / screen;
|
||||
float z = decdepth(vec4(texture2D(dtex, texc).xyz, 0.0));
|
||||
|
||||
if (z < 0.03) discard;
|
||||
|
||||
vec3 tmp = vec3(texc, z);
|
||||
tmp = tmp * 2.0 - 1.0;
|
||||
|
||||
vec4 xpos = vec4(tmp, 1.0);
|
||||
xpos = invprojview * xpos;
|
||||
xpos.xyz /= xpos.w;
|
||||
vec4 xpos = 2.0 * vec4(texc, z, 1.0) - 1.0f;
|
||||
xpos = invproj * xpos;
|
||||
xpos /= xpos.w;
|
||||
|
||||
float d = distance(center, xpos.xyz);
|
||||
if (d > r) discard;
|
||||
|
||||
float att = 1.0 - smoothstep(0.0, r, d);
|
||||
|
||||
vec3 norm = texture2D(ntex, texc).xyz;
|
||||
norm = (norm - 0.5) * 2.0;
|
||||
|
||||
vec3 camdir = normalize(campos - xpos.xyz);
|
||||
// Light Direction
|
||||
vec3 L = normalize(xpos.xyz - center);
|
||||
vec3 eyedir = normalize(xpos.xyz);
|
||||
vec3 H = normalize(-L + eyedir);
|
||||
|
||||
vec3 L = normalize(center - xpos.xyz);
|
||||
vec3 H = normalize(L + camdir);
|
||||
|
||||
float NdotL = max(0.0, dot(norm, L)) * att;
|
||||
if (NdotL < 0.01) discard;
|
||||
float NdotL = max(0.0, dot(norm, -L)) * att;
|
||||
float NdotH = max(0.0, dot(norm, H));
|
||||
NdotH = pow(NdotH, spec);
|
||||
NdotH += 0.05; // offset so that the alpha test doesn't kill us
|
||||
|
||||
gl_FragColor = NdotL * vec4(col, NdotH);
|
||||
gl_FragColor = NdotL * vec4(NdotL * col, NdotH);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ void main()
|
||||
gl_PointSize = screenw * projCorner.x / projCorner.w;
|
||||
gl_Position = gl_ProjectionMatrix * eyepos;
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ void main()
|
||||
ModelTransform *= vertTran;
|
||||
|
||||
gl_Position = ModelTransform * gl_Vertex;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
|
||||
/*
|
||||
// Reflections.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
@@ -24,7 +24,7 @@ uniform vec3 lightdir;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
vertex_color = gl_Color;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
varying vec3 nor;
|
||||
#version 130
|
||||
uniform float far;
|
||||
uniform float objectid;
|
||||
|
||||
@@ -9,6 +9,8 @@ uniform sampler2D tex_detail2;
|
||||
uniform sampler2D tex_detail3;
|
||||
//uniform sampler2D tex_detail4;
|
||||
|
||||
noperspective in vec3 nor;
|
||||
|
||||
const float near = 1.0;
|
||||
|
||||
vec4 encdepth(float v) {
|
||||
@@ -43,6 +45,6 @@ void main() {
|
||||
|
||||
gl_FragData[0] = splatted;
|
||||
|
||||
gl_FragData[1] = vec4(nor, linear_z);
|
||||
gl_FragData[1] = vec4(normalize(nor) * 0.5 + 0.5, linear_z);
|
||||
gl_FragData[2] = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
|
||||
}
|
||||
|
||||
@@ -15,20 +15,16 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
varying vec3 normal;
|
||||
varying vec4 vertex_color;
|
||||
varying vec3 lightdir2;
|
||||
#version 130
|
||||
uniform vec3 lightdir;
|
||||
|
||||
noperspective out vec3 normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
gl_Position = ftransform();
|
||||
vertex_color = gl_Color;
|
||||
|
||||
//normal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
normal = normalize(gl_Normal);
|
||||
lightdir2 = normalize(lightdir);
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
}
|
||||
|
||||
@@ -1,78 +1,59 @@
|
||||
#version 120
|
||||
|
||||
uniform sampler2D tex;
|
||||
uniform sampler2D oldtex;
|
||||
uniform sampler2D normals_and_depth;
|
||||
uniform sampler2D depth;
|
||||
uniform mat4 invprojm;
|
||||
uniform mat4 projm;
|
||||
uniform vec4 samplePoints[16];
|
||||
|
||||
const float totStrength = 2.38;
|
||||
const float strength = 0.07;
|
||||
const float falloff = 0.000002;
|
||||
const float strengh = 1.;
|
||||
const float radius = 0.1f;
|
||||
const float threshold = 0.1;
|
||||
|
||||
#define SAMPLES 16
|
||||
|
||||
const float invSamples = 1.0 / SAMPLES;
|
||||
const float invSamples = strengh / SAMPLES;
|
||||
|
||||
float decdepth(vec4 rgba) {
|
||||
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// A set of Random(tm) vec2's. 8 1s, 6 0.7s, 2 0.4
|
||||
// Again not using const because of broken Intel Windows drivers
|
||||
vec2 vecs[16] = vec2[](vec2(0.43589, -0.9), vec2(-0.9, 0.43589),
|
||||
vec2(-0.8, -0.6), vec2(0.6, 0.8),
|
||||
vec2(0.866025, -0.5), vec2(-0.5, 0.866025),
|
||||
vec2(-0.3, -0.953939), vec2(0.953939, 0.3),
|
||||
vec2(0.3, -0.781025), vec2(-0.781025, 0.3),
|
||||
vec2(-0.56, -0.621611), vec2(0.621611, 0.56),
|
||||
vec2(0.734847, -0.4), vec2(-0.4, 0.734847),
|
||||
vec2(-0.2, -0.6), vec2(0.6, 0.2));
|
||||
|
||||
|
||||
vec2 uv = gl_TexCoord[0].xy;
|
||||
|
||||
vec4 cur = texture2D(tex, uv);
|
||||
float curdepth = cur.a;
|
||||
|
||||
// Will we skip this pixel? (if it's the sky)
|
||||
float len = dot(vec3(1.0), abs(cur.xyz));
|
||||
if (len < 0.2 || curdepth > 0.8) discard;
|
||||
|
||||
float mytotstrength = 3.0 * totStrength * curdepth * (1.0 - curdepth);
|
||||
vec4 cur = texture2D(normals_and_depth, uv);
|
||||
float curdepth = decdepth(vec4(texture2D(depth, uv).xyz, 0.0));
|
||||
vec4 FragPos = invprojm * (2.0f * vec4(uv, curdepth, 1.0f) - 1.0f);
|
||||
FragPos /= FragPos.w;
|
||||
|
||||
// get the normal of current fragment
|
||||
vec3 norm = normalize(cur.xyz * vec3(2.0) - vec3(1.0));
|
||||
if (curdepth > 0.99) discard;
|
||||
vec3 tangent = normalize(cross(norm, norm.yzx));
|
||||
vec3 bitangent = cross(norm, tangent);
|
||||
|
||||
float bl = 0.0;
|
||||
|
||||
// adjust for the depth, 0.1 close, 0.01 far
|
||||
float radD = 0.10 - 0.09 * smoothstep(0.0, 0.2, curdepth);
|
||||
|
||||
for(int i = 0; i < SAMPLES; ++i) {
|
||||
|
||||
vec2 ray = uv + radD * vecs[i];
|
||||
vec3 sampleDir = samplePoints[i].x * tangent + samplePoints[i].y * bitangent + samplePoints[i].z * norm;
|
||||
vec4 samplePos = FragPos + radius * vec4(sampleDir, 0.0);
|
||||
vec4 sampleProj = projm * samplePos;
|
||||
sampleProj /= sampleProj.w;
|
||||
|
||||
// get the depth of the occluder fragment
|
||||
vec4 occluderFragment = texture2D(tex, ray);
|
||||
float normAcceptable = step(0.2, dot(vec3(1.0), abs(occluderFragment.xyz)));
|
||||
float occluderFragmentDepth = decdepth(vec4(texture2D(depth, (sampleProj.xy * 0.5) + 0.5).xyz, 0.0));
|
||||
|
||||
// get the normal of the occluder fragment
|
||||
vec3 occNorm = normalize(occluderFragment.xyz * vec3(2.0) - vec3(1.0));
|
||||
|
||||
// if depthDifference is negative = occluder is behind current fragment
|
||||
float depthDifference = curdepth - occluderFragment.a;
|
||||
|
||||
// calculate the difference between the normals as a weight
|
||||
float normDiff = 1.0 - max(dot(occNorm, norm), 0.0);
|
||||
normDiff = smoothstep(0.1, 0.3, normDiff);
|
||||
|
||||
// the falloff equation, starts at falloff and is kind of 1/x^2 falling
|
||||
bl += step(falloff, depthDifference) * normDiff * normAcceptable *
|
||||
(1.0 - smoothstep(falloff, strength, depthDifference));
|
||||
float depthDifference = sampleProj.z - (2. * occluderFragmentDepth - 1.0);
|
||||
bl += (abs(depthDifference) < threshold) ? step(0., depthDifference) : 0.0;
|
||||
}
|
||||
|
||||
// output the result
|
||||
float ao = 1.0 - mytotstrength * bl * invSamples;
|
||||
|
||||
// Mix with old result to avoid flicker
|
||||
float oldao = texture2D(oldtex, uv).x;
|
||||
|
||||
ao = mix(ao, oldao, 0.3);
|
||||
float ao = 1.0 - bl * invSamples;
|
||||
|
||||
gl_FragColor = vec4(vec3(ao), curdepth);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ uniform sampler2D cloudtex;
|
||||
uniform vec3 center;
|
||||
uniform vec3 col;
|
||||
uniform vec2 screen;
|
||||
uniform mat4 invprojview;
|
||||
uniform mat4 invproj;
|
||||
uniform int hasclouds;
|
||||
uniform vec2 wind;
|
||||
|
||||
@@ -33,7 +33,6 @@ void main() {
|
||||
vec3 L = center;
|
||||
|
||||
float NdotL = max(0.0, dot(norm, L));
|
||||
if (NdotL < 0.01) discard;
|
||||
|
||||
vec3 outcol = NdotL * col;
|
||||
|
||||
@@ -43,7 +42,7 @@ void main() {
|
||||
tmp = tmp * 2.0 - 1.0;
|
||||
|
||||
vec4 xpos = vec4(tmp, 1.0);
|
||||
xpos = invprojview * xpos;
|
||||
xpos = invproj * xpos;
|
||||
xpos.xyz /= xpos.w;
|
||||
|
||||
vec2 cloudcoord = (xpos.xz * 0.00833333) + wind;
|
||||
|
||||
@@ -50,6 +50,6 @@ void main()
|
||||
halfVec = v ;
|
||||
|
||||
gl_Position = gl_ModelViewProjectionMatrix * pos;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_MultiTexCoord1;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 990 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 935 B After Width: | Height: | Size: 935 B |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |