merge in trunk updates, fixup pci code, and fix texus2 code pointers.

This commit is contained in:
alanh
2000-11-14 14:11:20 +00:00
parent bc03716156
commit 08ef754384
24 changed files with 522 additions and 686 deletions

View File

@@ -1,13 +1,13 @@
#!/bin/sh -f
function do_nothing() {
do_nothing() {
return 0;
}
function device () {
device () {
df -k $1 | grep -v '^Filesystem' | awk '{print $1;}'
}
function inumber () {
inumber () {
ls -id "$1" | awk '{print $1;}'
}
@@ -18,7 +18,7 @@ function inumber () {
# 101 if either of the parameters does not name a directory
# 102 if both parameters name different directories.
#
function files_are_equal() {
files_are_equal() {
local inode1 inode2 dev1 dev2
if [ -z "$1" ] || [ -z "$2" ] ; then
return 100;

View File

@@ -119,7 +119,7 @@ AC_ARG_ENABLE([fx-texlib],
--enable-fx-tex=dir Enable enhanced texture utilities library
texus - original library
texus2 - library for compressed textures
[default=texus]],
[default=texus2]],
[case ${enableval} in
texus|texus2)
TEXTURE_UTILITIES_DIR=${enableval}

View File

@@ -129,7 +129,7 @@ xtexdl_3dnow.o xtexdl_3dnow.lo: xtexdl.s fxgasm.h
$(CP) $*.o $*.lo
$(RM) -f $*.tmp.s
cpudtect.o cpudtct.lo: cpudtect.s
cpudtect.o cpudtect.lo: cpudtect.s
$(PREPROCESSOR) -DUSE_PACKET_FIFO=1 $< > $*.tmp.s
$(CC) $(AFLAGS) -c -o $*.o $*.tmp.s
$(CP) $*.o $*.lo

View File

@@ -19,6 +19,13 @@
**
** $Header$
** $Log$
**
** Revision 1.2 2000/10/27 07:54:51 alanh
** fix readPtr0/1 -> depth0/1 check
**
** Revision 1.1.1.1.2.1 2000/08/30 08:47:03 alanh
** Changes for Voodoo3 for 64bit architectures
**
** Revision 1.1.1.1 1999/11/24 21:45:01 joseph
** Initial checkin for SourceForge
**

View File

@@ -22,6 +22,15 @@
/* $Header$ */
/* $Revision$ */
/* $Log$
/* Revision 1.3 2000/10/20 19:07:00 billwhite
/* 1.) Added changes for AMD 3DNow instructions in h5/glide3 and
/* h3/glide3.
/* 2.) Fixed a typographical error in configure.in. The default
/* texture utility library is texus2, not texus.
/*
/* Revision 1.2 2000/02/15 22:35:59 joseph
/* Changes to support FreeBSD (patch submitted by Doug Rabson)
/*
/* Revision 1.1.1.1 1999/11/24 21:44:58 joseph
/* Initial checkin for SourceForge
/* */
@@ -99,7 +108,7 @@
push %esi /* save caller's register variable */
push %ebx /* save caller's register variable */
mov _gc(%esp), gc
mov _gc-4(%esp) , gc
mov _vb-4(%esp) , fb /* get base address of vertex B */
push %ebp /* save frame pointer */

View File

@@ -90,15 +90,13 @@ _grDrawTriangles_3DNow:
#define dlpStart edx /* Pointer to start of offset list */
push %edi /* save caller's register variable */
movl (0x18) , %eax /* get thread local storage base pointer */
push %esi /* save caller's register variable */
mov (_GlideRoot+tlsOffset) , %edx /* offset of GC into tls */
push %ebx /* save caller's register variable */
mov _count-4(%esp) , %vertexCount /* number of vertices in triangles */
mov (%eax,%edx) , %gc /* get GC for current thread */
movl (threadValueLinux) , %gc
mov _pointers-4(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
push %ebp /* save frame pointer */
@@ -1118,20 +1116,18 @@ _grDrawTriangles_3DNow:
_grDrawVertexList_3DNow_Window:
/* 132 : { */
movl (0x18) , %edx /* get thread local storage base pointer */
push %edi /* save caller's register variable */
push %esi /* save caller's register variable */
mov _count-8(%esp) , %vertexCount /* number of vertices in strip/fan */
push %ebp /* save frame pointer */
mov (_GlideRoot+tlsOffset) , %ebp /* GC position relative to tls base */
push %ebx /* save caller's register variable */
mov _pointers(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
/* get current vertex (non-deref mode) */
mov (%edx,%ebp) , %gc /* get current graphics context from tls */
movl (threadValueLinux) , %gc
test %vertexCount , %vertexCount /* number of vertices <= 0 ? */
nop /* filler */
@@ -1709,20 +1705,18 @@ _grDrawVertexList_3DNow_Clip:
.align 32
movl (0x18) , %edx /* get thread local storage base pointer */
push %edi /* save caller's register variable */
push %esi /* save caller's register variable */
mov _count-8(%esp) , %vertexCount /* number of vertices in strip/fan */
push %ebp /* save frame pointer */
mov (_GlideRoot+tlsOffset) , %ebp /* GC position relative to tls base */
push %ebx /* save caller's register variable */
mov _pointers(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
/* get current vertex (non-deref mode) */
mov (%edx,%ebp) , %gc /* get current graphics context from tls */
movl (threadValueLinux) , %gc
test %vertexCount , %vertexCount /* number of vertices <= 0 ? */
jle .L_grDrawVertexList_3DNow_Clip_strip_done /* yup, the strip/fan is done */
@@ -2271,7 +2265,7 @@ _drawvertexlist:
push %esi
push %edi
push %ebx
movl (threadValueLinux), %gc
movl (threadValueLinux) , %gc
#endif
/* GR_DCL_GC */
@@ -2476,14 +2470,12 @@ _drawvertexlist:
.type _vpdrawvertexlist,@function
_vpdrawvertexlist:
movl (0x18) , %eax /* tls base pointer */
push %esi
mov (_GlideRoot+tlsOffset) , %esi /* gc position relative to tls base */
push %edi
push %ebx
mov (%eax,%esi) , %gc
movl (threadValueLinux) , %gc
push %ebp
movl _mode(%esp) , %ecx

View File

@@ -199,12 +199,12 @@ endif
# Library definitions.
#
if FX_GLIDE_CTRISETUP
FX_GLIDE_CTRISETUP_SRC = gxdraw.c xtexdl_def.c
FX_GLIDE_CTRISETUP_SRC = gxdraw.c
else
if GL_AMD3D
FX_GLIDE_CTRISETUP_SRC = xtexdl_3dnow.s xdraw2_3dnow.s xdraw3_3dnow.s
FX_GLIDE_CTRISETUP_SRC = xdraw2_3dnow.s xdraw3_3dnow.s
else
FX_GLIDE_CTRISETUP_SRC = xtexdl_def.s xdraw2_def.s xdraw3_def.s
FX_GLIDE_CTRISETUP_SRC = xdraw2_def.s xdraw3_def.s
endif
endif
@@ -237,7 +237,7 @@ libglide3_la_SOURCES = fxinline.h fxgasm.h \
gbanner.c gerror.c gaa.c gdraw.c \
gglide.c distate.c gstrip.c distrip.c \
diget.c glfb.c gsst.c gtex.c gtexdl.c \
fifo.c cpudtect.s $(VGLIDE_SRC)
fifo.c $(CPUSOURCES) xtexdl_def.c $(VGLIDE_SRC)
libglide3_la_LDFLAGS = -version-info 13:0:10
libglide3_la_LIBADD = $(WHOLE_LIBS) $(LINK_LIBS)

View File

@@ -23,6 +23,16 @@
/* $Header$ *
/* $Revision$ *
/* $Log$
/* Revision 1.3 2000/10/20 19:07:00 billwhite
/* 1.) Added changes for AMD 3DNow instructions in h5/glide3 and
/* h3/glide3.
/* 2.) Fixed a typographical error in configure.in. The default
/* texture utility library is texus2, not texus.
/*
/* Revision 1.2 2000/06/27 19:59:34 joseph
/* Previous checkin of asm files were already preprocessed.
/* Fixed build rules for 3DNow optimized assembly.
/*
/* Revision 1.1 2000/06/15 00:27:43 joseph
/* Initial checkin into SourceForge.
/
@@ -143,7 +153,7 @@
push %esi /* save caller's register variable */
push %ebx /* save caller's register variable */
mov _gc(%esp), gc
mov _gc-4(%esp) , gc
mov _vb-4(%esp) , fb /* get base address of vertex B */
push %ebp /* save frame pointer */

View File

@@ -90,15 +90,13 @@ _grDrawTriangles_3DNow:
#define dlpStart edx /* Pointer to start of offset list */
push %edi /* save caller's register variable */
movl (0x18) , %eax /* get thread local storage base pointer */
push %esi /* save caller's register variable */
mov (_GlideRoot+tlsOffset) , %edx /* offset of GC into tls */
push %ebx /* save caller's register variable */
mov _count-4(%esp) , %vertexCount /* number of vertices in triangles */
mov (%eax,%edx) , %gc /* get GC for current thread */
movl (threadValueLinux) , %gc /* get GC for current thread */
mov _pointers-4(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
push %ebp /* save frame pointer */
@@ -1130,20 +1128,18 @@ _grDrawTriangles_3DNow:
_grDrawVertexList_3DNow_Window:
/* 132 : { */
movl (0x18) , %edx /* get thread local storage base pointer */
push %edi /* save caller's register variable */
push %esi /* save caller's register variable */
mov _count-8(%esp) , %vertexCount /* number of vertices in strip/fan */
push %ebp /* save frame pointer */
mov (_GlideRoot+tlsOffset) , %ebp /* GC position relative to tls base */
push %ebx /* save caller's register variable */
mov _pointers(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
/* get current vertex (non-deref mode) */
mov (%edx,%ebp) , %gc /* get current graphics context from tls */
movl (threadValueLinux) , %gc /* get current graphics context from tls */
test %vertexCount , %vertexCount /* number of vertices <= 0 ? */
nop /* filler */
@@ -1721,20 +1717,18 @@ _grDrawVertexList_3DNow_Clip:
.align 32
movl (0x18) , %edx /* get thread local storage base pointer */
push %edi /* save caller's register variable */
push %esi /* save caller's register variable */
mov _count-8(%esp) , %vertexCount /* number of vertices in strip/fan */
push %ebp /* save frame pointer */
mov (_GlideRoot+tlsOffset) , %ebp /* GC position relative to tls base */
push %ebx /* save caller's register variable */
mov _pointers(%esp) , %vertexPtr /* get current vertex pointer (deref mode) */
/* get current vertex (non-deref mode) */
mov (%edx,%ebp) , %gc /* get current graphics context from tls */
movl (threadValueLinux) , %gc /* get current graphics context from tls */
test %vertexCount , %vertexCount /* number of vertices <= 0 ? */
jle .L_grDrawVertexList_3DNow_Clip_strip_done /* yup, the strip/fan is done */
@@ -2283,7 +2277,7 @@ _drawvertexlist:
push %esi
push %edi
push %ebx
movl (threadValueLinux), %gc
movl (threadValueLinux) , %gc
#endif
/* GR_DCL_GC */
@@ -2488,14 +2482,12 @@ _drawvertexlist:
.type _vpdrawvertexlist,@function
_vpdrawvertexlist:
movl (0x18) , %eax /* tls base pointer */
push %esi
mov (_GlideRoot+tlsOffset) , %esi /* gc position relative to tls base */
push %edi
push %ebx
mov (%eax,%esi) , %gc
movl (threadValueLinux) , %gc
push %ebp
movl _mode(%esp) , %ecx

View File

@@ -53,7 +53,7 @@ fi
# Find the correct PATH separator. Usually this is `:', but
# DJGPP uses `;' like DOS.
if test "X${PATH_SEPARATOR+set}" != "Xset"; then
if test "X${PATH_SEPARATOR+set}" != Xset; then
UNAME=${UNAME-`uname 2>/dev/null`}
case X$UNAME in
*-DOS) PATH_SEPARATOR=';' ;;
@@ -63,9 +63,9 @@ fi
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
if test "X${echo_test_string+set}" != "Xset"; then
if test "X${echo_test_string+set}" != Xset; then
# find a string as large as possible, as long as the shell can cope with it
for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
# expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
@@ -169,10 +169,10 @@ progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
VERSION=1.3.3
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
VERSION=1.3.5
TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
rm="rm -f"
help="Try \`$progname --help' for more information."
@@ -369,8 +369,8 @@ exec 5>>./config.log
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi
if test -n "$cache_file" && test -r "$cache_file"; then
echo "loading cache $cache_file within ltconfig"
@@ -462,7 +462,7 @@ aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -663,7 +663,7 @@ if test "$with_gcc" = yes; then
link_static_flag='-static'
case "$host_os" in
beos* | irix5* | irix6* | osf3* | osf4*)
beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
aix*)
@@ -718,7 +718,7 @@ else
# We can build DLLs from non-PIC.
;;
osf3* | osf4*)
osf3* | osf4* | osf5*)
# All OSF/1 code is PIC.
wl='-Wl,'
link_static_flag='-non_shared'
@@ -1164,15 +1164,21 @@ EOF
# Extract the symbol export list from an `--export-all' def file,
# then regenerate the def file from the symbol export list, so that
# the compiled dll only exports the symbol export list.
# Be careful not to strip the DATA tag left by newer dlltools.
export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~
$DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols'
# If DATA tags from a recent dlltool are present, honour them!
archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
_lt_hint=1;
for symbol in `cat $export_symbols`; do
echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
cat $export_symbols | while read symbol; do
set dummy \$symbol;
case \$# in
2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;;
*) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;;
esac;
_lt_hint=`expr 1 + \$_lt_hint`;
done~
test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
@@ -1187,7 +1193,7 @@ EOF
;;
netbsd*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
@@ -1196,7 +1202,7 @@ EOF
fi
;;
solaris*)
solaris* | sysv5*)
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<EOF 1>&2
@@ -1244,7 +1250,12 @@ EOF
whole_archive_flag_spec=
;;
*)
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
whole_archive_flag_spec=
fi
;;
esac
fi
@@ -1405,7 +1416,7 @@ else
old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
;;
osf3* | osf4*)
osf3*)
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
@@ -1417,6 +1428,24 @@ else
hardcode_libdir_separator=:
;;
osf4* | osf5*) # As osf3* with the addition of the -msym flag
if test "$with_gcc" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
fi
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
rhapsody*)
archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flags_spec='-L$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
sco3.2v5*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no
@@ -1449,7 +1478,13 @@ else
;;
sysv4)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts'
else
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
fi
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
@@ -1461,6 +1496,18 @@ else
export_dynamic_flag_spec='-Bexport'
;;
sysv5*)
no_undefined_flag=' -z text'
# $CC -shared without GNU ld will not create a library from C++
# object files and a static libstdc++, better avoid it by now
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
hardcode_libdir_flag_spec=
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
;;
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_libdir_flag_spec='-L$libdir'
@@ -1474,16 +1521,30 @@ else
;;
sysv4*MP*)
if test -d /usr/nec ;then
# archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
if test -d /usr/nec; then
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
fi
;;
sysv4.2uw2*)
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
hardcode_direct=yes
hardcode_minus_L=no
hardcode_shlibpath_var=no
hardcode_runpath_var=yes
runpath_var=LD_RUN_PATH
;;
unixware7*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
*)
ld_shlibs=no
;;
@@ -1589,11 +1650,11 @@ void nm_test_func(){}
main(){nm_test_var='a';nm_test_func();return(0);}
EOF
echo "$progname:1592: checking if global_symbol_pipe works" >&5
if { (eval echo $progname:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
echo "$progname:1653: checking if global_symbol_pipe works" >&5
if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
# Now try to grab the symbols.
nlist=conftest.nm
if { echo "$progname:1596: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
@@ -1645,7 +1706,7 @@ EOF
save_CFLAGS="$CFLAGS"
LIBS="conftstm.$objext"
CFLAGS="$CFLAGS$no_builtin_flag"
if { (eval echo $progname:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
pipe_works=yes
else
echo "$progname: failed program was:" >&5
@@ -1787,8 +1848,9 @@ beos*)
bsdi4*)
version_type=linux
library_names_spec='${libname}.so$major ${libname}.so'
soname_spec='${libname}.so'
need_version=no
library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
soname_spec='${libname}${release}.so$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
@@ -1796,6 +1858,7 @@ bsdi4*)
file_magic_test_file=/shlib/libc.so
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
export_dynamic_flag_spec=-rdynamic
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
@@ -1841,10 +1904,9 @@ freebsd*)
need_version=yes
;;
esac
finish_cmds='PATH="\$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
case "$host_os" in
freebsd2* | freebsd3.[01]*)
freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
;;
*) # from 3.2 on
@@ -1875,6 +1937,14 @@ hpux9* | hpux10* | hpux11*)
soname_spec='${libname}${release}.sl$major'
# HP-UX runs *really* slowly unless shared libraries are mode 555.
postinstall_cmds='chmod 555 $lib'
case "$host_os" in
hpux10.20*)
# TODO: Does this work for hpux-11 too?
deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
file_magic_cmd=/usr/bin/file
file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
irix5* | irix6*)
@@ -1896,8 +1966,6 @@ irix5* | irix6*)
*-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
# this will be overridden with pass_all, but let us keep it just in case
deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
@@ -1924,9 +1992,7 @@ linux-gnu*)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
file_magic_cmd=/usr/bin/file
file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
deplibs_check_method=pass_all
if test -f /lib/ld.so.1; then
dynamic_linker='GNU ld.so'
@@ -1972,7 +2038,7 @@ os2*)
shlibpath_var=LIBPATH
;;
osf3* | osf4*)
osf3* | osf4* | osf5*)
version_type=osf
need_version=no
soname_spec='${libname}${release}.so'
@@ -1987,6 +2053,14 @@ osf3* | osf4*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
rhapsody*)
version_type=sunos
library_names_spec='${libname}.so'
soname_spec='${libname}.so'
shlibpath_var=DYLD_LIBRARY_PATH
deplibs_check_method=pass_all
;;
sco3.2v5*)
version_type=osf
soname_spec='${libname}${release}.so$major'
@@ -2027,6 +2101,10 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
soname_spec='${libname}${release}.so$major'
shlibpath_var=LD_LIBRARY_PATH
case "$host_vendor" in
sequent)
file_magic_cmd='/bin/file'
deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
;;
ncr)
deplibs_check_method='pass_all'
;;
@@ -2167,7 +2245,7 @@ else
if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
lt_cv_dlopen=no lt_cv_dlopen_libs=
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "$progname:2170: checking for dlopen in -ldl" >&5
echo "$progname:2248: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2175,17 +2253,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2178 "ltconfig"
#line 2256 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen();
int main() {
dlopen()
; return 0; }
EOF
if { (eval echo $progname:2188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2204,18 +2285,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "$progname:2207: checking for dlopen" >&5
echo "$progname:2288: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2212 "ltconfig"
#line 2293 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen();
int main() {
@@ -2231,7 +2315,7 @@ dlopen();
; return 0; }
EOF
if { (eval echo $progname:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -2248,7 +2332,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
echo "$progname:2251: checking for dld_link in -ldld" >&5
echo "$progname:2335: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2256,17 +2340,20 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2259 "ltconfig"
#line 2343 "ltconfig"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dld_link();
int main() {
dld_link()
; return 0; }
EOF
if { (eval echo $progname:2269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2285,18 +2372,21 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load""... $ac_c" 1>&6
echo "$progname:2288: checking for shl_load" >&5
echo "$progname:2375: checking for shl_load" >&5
if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2293 "ltconfig"
#line 2380 "ltconfig"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shl_load(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load();
int main() {
@@ -2312,7 +2402,7 @@ shl_load();
; return 0; }
EOF
if { (eval echo $progname:2315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shl_load=yes"
else
@@ -2330,7 +2420,7 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
echo "$progname:2333: checking for shl_load in -ldld" >&5
echo "$progname:2423: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2338,18 +2428,21 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2341 "ltconfig"
#line 2431 "ltconfig"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load();
int main() {
shl_load()
; return 0; }
EOF
if { (eval echo $progname:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo $progname:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2392,17 +2485,17 @@ fi
for ac_hdr in dlfcn.h; do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "$progname:2395: checking for $ac_hdr" >&5
echo "$progname:2488: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2400 "ltconfig"
#line 2493 "ltconfig"
#include <$ac_hdr>
int fnord = 0;
EOF
ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo $progname:2405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_try="$ac_compile >/dev/null 2>conftest.out"
{ (eval echo $progname:2498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2430,7 +2523,7 @@ done
LIBS="$lt_cv_dlopen_libs $LIBS"
echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
echo "$progname:2433: checking whether a program can dlopen itself" >&5
echo "$progname:2526: checking whether a program can dlopen itself" >&5
if test "${lt_cv_dlopen_self+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2438,7 +2531,7 @@ else
lt_cv_dlopen_self=cross
else
cat > conftest.c <<EOF
#line 2441 "ltconfig"
#line 2534 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2484,7 +2577,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
if { (eval echo $progname:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self=yes
else
@@ -2503,7 +2596,7 @@ echo "$ac_t""$lt_cv_dlopen_self" 1>&6
if test "$lt_cv_dlopen_self" = yes; then
LDFLAGS="$LDFLAGS $link_static_flag"
echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
echo "$progname:2506: checking whether a statically linked program can dlopen itself" >&5
echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5
if test "${lt_cv_dlopen_self_static+set}" = set; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2511,7 +2604,7 @@ else
lt_cv_dlopen_self_static=cross
else
cat > conftest.c <<EOF
#line 2514 "ltconfig"
#line 2607 "ltconfig"
#if HAVE_DLFCN_H
#include <dlfcn.h>
@@ -2557,7 +2650,7 @@ main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); }
EOF
if { (eval echo $progname:2560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
lt_cv_dlopen_self_static=yes
else
@@ -2649,7 +2742,7 @@ case "$ltmain" in
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
#
# Copyright (C) 1996-1999 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# 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
@@ -2675,7 +2768,7 @@ Xsed="sed -e s/^X//"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
### BEGIN LIBTOOL CONFIG
EOF
@@ -2938,7 +3031,7 @@ case "$ltmain" in
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "${COLLECT_NAMES+set}" != set; then
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -2948,6 +3041,10 @@ EOF
# Append the ltmain.sh script.
sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
chmod +x "$ofile"
;;

View File

@@ -54,8 +54,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.3.3
TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
VERSION=1.3.5
TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -435,7 +435,7 @@ compiler."
fbsd_hideous_sh_bug=$base_compile
# All platforms use -DPIC, to notify preprocessed assembler code.
command="$base_compile $pic_flag -DPIC $srcfile"
command="$base_compile $srcfile $pic_flag -DPIC"
if test "$build_old_libs" = yes; then
lo_libobj="$libobj"
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
@@ -521,9 +521,17 @@ compiler."
exit $error
fi
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
# Now arrange that obj and lo_libobj become the same file
$show "$LN_S $obj $lo_libobj"
if $run $LN_S $obj $lo_libobj; then
$show "(cd $xdir && $LN_S $baseobj $libobj)"
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
exit 0
else
error=$?
@@ -613,8 +621,6 @@ compiler."
# libtool link mode
link)
modename="$modename: link"
C_compiler="$CC" # save it, to compile generated C sources
CC="$nonopt"
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2*)
# It is impossible to link a dll without this setting, and
@@ -802,8 +808,8 @@ compiler."
allow_undefined=yes
;;
esac
compile_command="$CC"
finalize_command="$CC"
compile_command="$nonopt"
finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
@@ -1789,6 +1795,10 @@ compiler."
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody*)
# rhapsody is a little odd...
deplibs="$deplibs -framework System"
;;
*)
# Add libc to deplibs on all other systems.
deplibs="$deplibs -lc"
@@ -1851,7 +1861,7 @@ compiler."
int main() { return 0; }
EOF
$rm conftest
$C_compiler -o conftest conftest.c $deplibs
$CC -o conftest conftest.c $deplibs
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
@@ -1884,7 +1894,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" ; then
$rm conftest
$C_compiler -o conftest conftest.c $i
$CC -o conftest conftest.c $i
# Did it work?
if test $? -eq 0 ; then
ldd_output=`ldd conftest`
@@ -2047,12 +2057,19 @@ EOF
done
# Ensure that we have .o objects for linkers which dislike .lo
# (e.g. aix) incase we are running --disable-static
# (e.g. aix) in case we are running --disable-static
for obj in $libobjs; do
oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
if test ! -f $oldobj; then
$show "${LN_S} $obj $oldobj"
$run ${LN_S} $obj $oldobj || exit $?
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
if test ! -f $xdir/$oldobj; then
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
fi
done
@@ -2311,8 +2328,16 @@ EOF
# Just create a symlink.
$show $rm $libobj
$run $rm $libobj
$show "$LN_S $obj $libobj"
$run $LN_S $obj $libobj || exit $?
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$libobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
$show "(cd $xdir && $LN_S $oldobj $baseobj)"
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi
if test -n "$gentop"; then
@@ -2598,16 +2623,21 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*)
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DPIC";;
esac
esac
# Now compile the dynamic symbol file.
$show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
$show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@@ -2776,7 +2806,7 @@ sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
@@ -2865,7 +2895,7 @@ else
fi"
else
echo >> $output "\
program='$outputname$exeext'
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
@@ -2901,13 +2931,21 @@ else
# Run the actual program with our arguments.
"
case $host in
*-*-cygwin* | *-*-mingw | *-*-os2*)
# win32 systems need to use the prog path for dll
# lookup to work
*-*-cygwin*)
$echo >> $output "\
exec \$progdir/\$program \${1+\"\$@\"}
"
;;
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*)
$echo >> $output "\
exec \$progdir\\\\\$program \${1+\"\$@\"}
"
;;
*)
$echo >> $output "\
# Export the path to the program.
@@ -2995,14 +3033,21 @@ fi\
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
# Ensure that we have .o objects in place incase we decided
# Ensure that we have .o objects in place in case we decided
# not to build a shared library, and have fallen back to building
# static libs even though --disable-static was passed!
for oldobj in $oldobjs; do
if test ! -f $oldobj; then
obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
$show "${LN_S} $obj $oldobj"
$run ${LN_S} $obj $oldobj || exit $?
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$oldobj"; then
xdir="."
else
xdir="$xdir"
fi
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
$show "(cd $xdir && ${LN_S} $obj $baseobj)"
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
fi
done
@@ -3288,8 +3333,8 @@ libdir='$install_libdir'\
shift
# Install the shared library and build the symlinks.
$show "$install_prog$stripme $dir/$realname $destdir/$realname"
$run eval "$install_prog$stripme $dir/$realname $destdir/$realname" || exit $?
$show "$install_prog $dir/$realname $destdir/$realname"
$run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
if test $# -gt 0; then
# Delete the old symlinks, and create new ones.
@@ -3672,8 +3717,10 @@ libdir='$install_libdir'\
done
if test -z "$run"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved enviroment variables
if test "${save_LC_ALL+set}" = set; then
@@ -3690,8 +3737,10 @@ libdir='$install_libdir'\
exit 1
else
# Display what would be done.
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args"
exit 0
fi

View File

@@ -197,7 +197,7 @@ FxBool _imgGuessType( FILE *stream, ImgType *type )
case 0xDA01:
*type = IMG_RGT;
break;
case (('E'<<8) | 'L'):
case (('E' << 8) | 'L'):
cookie = 0;
if ( ( c = fgetc( stream ) ) == EOF )
{
@@ -211,7 +211,7 @@ FxBool _imgGuessType( FILE *stream, ImgType *type )
return FXFALSE;
}
cookie = (cookie << 8) | c;
if (cookie == (('R'<<8) | 'S'))
if (cookie == (('R' << 8) | 'S'))
*type = IMG_SRLE;
break;
default: // Might Be TGA
@@ -1409,7 +1409,7 @@ FxBool _imgReadSRLEData( FILE *stream, const SrleInfo *info, ImgData *data )
{
int numPixels;
FxU16 color;
FxU8 r,g,b,a;
FxU8 r = 0, g = 0, b = 0, a = 0;
FxU8 ctl, repeat, run;
FxBool flag;
@@ -1487,11 +1487,11 @@ FxBool _imgWriteSbiHeader( FILE *stream, const SbiInfo *info )
imgErrorString = "Image write error.";
if ( 0 > fprintf( stream, "P9\n" ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "Y%c\n", info->yOrigin? '+' : '-' ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "%d ", info->width ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "%d\n", info->height ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "R %d ", info->redBits ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "G %d ", info->greenBits ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "B %d\n", info->blueBits ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "%ld ", info->width ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "%ld\n", info->height ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "R %ld ", info->redBits ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "G %ld ", info->greenBits ) ) return FXFALSE;
if ( 0 > !fprintf( stream, "B %ld\n", info->blueBits ) ) return FXFALSE;
imgErrorString = "No Error.";
return FXTRUE;
}
@@ -1952,7 +1952,7 @@ FxBool imgReadFile(const char *filename, ImgInfo *info)
fprintf(stderr,buf);
fprintf(stderr,"/");
}
fprintf (stderr,"%s (%dx%d) ...", filename, info->any.width,info->any.height);
fprintf (stderr,"%s (%ldx%ld) ...", filename, info->any.width,info->any.height);
fflush(stderr);
if ( imgReadData( file, info ) == FXFALSE ) {
@@ -1981,7 +1981,7 @@ FxBool imgWriteFile(const char *filename, const ImgInfo *info, const ImgType typ
exit(2);
}
tempInfo.any.type = type; // set the new type
fprintf(stderr,"Storing %s image file %s (%dx%d) ...",
fprintf(stderr,"Storing %s image file %s (%ldx%ld) ...",
imgTypeName(&tempInfo), filename, info->any.width,info->any.height);
fflush(stderr);

View File

@@ -343,6 +343,21 @@ JUNK = __junk__
$(THISDIR)clobber: $(THISDIR)clean $(THISDIR)rmtargets
$(RM) -f $(MKDEPFILE) $(JUNK) $(TAGS)
ifdef INSTALL_DESTINATION
ifdef HEADERS
$(INSTALL) -d $(INSTALL_DESTINATION)/include
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/include/, $(HEADERS))
endif
ifdef LIBRARIES
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(LIBRARIES))
endif
ifneq "$(SHARED_LIBRARY)" ""
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/lib/, $(SHARED_LIBRARY) $(SONAME) $(BASENAME))
endif
ifneq ($(strip $(INSTALL_TARGETS)),)
$(RM) -f $(addprefix $(INSTALL_DESTINATION)/bin/, $(INSTALL_TARGETS))
endif
endif
$(THISDIR)clean: $(THISDIR)neat
$(RM) -f $(OBJECTS) $(JUNK)

View File

@@ -32,9 +32,9 @@
#include <fxmemmap.h>
#include "fxpci.h"
#include "pcilib.h"
#ifdef __linux__
#ifdef __linux__
#include "fxlinux.h"
#endif /* defined(__linux__) */
#endif
/* PRIVATE DATA (within the library) */
FxU32 pciVxdVer = 0;
@@ -44,32 +44,21 @@ PciHwcCallbacks pciHwcCallbacks = { 1 };
const FxPlatformIOProcs* gCurPlatformIO = NULL;
/*
* A singly linked list keeps track of
* the pci devices
/*
* linear Address Map List
*
* This is the new way we keep track of boards which are already mapped
*/
typedef struct _pciDeviceNode
{
FxU32 bus;
FxU32 slot;
FxU32 function;
FxU32 vendorID;
FxU32 deviceID;
struct
{
FxBool mapped;
AnyPtr virtualAddress;
} addresses[MAX_PCI_BASEADDRESSES];
struct _pciDeviceNode *next;
} pciDeviceNode;
static pciDeviceNode *pciDeviceList=NULL;
static pciDeviceNode* pciDeviceListAppend(pciDeviceNode **list, FxU32 bus,
FxU32 slot, FxU32 function,
FxU32 vendorID, FxU32 deviceID);
static void printDeviceList(pciDeviceNode *head);
static struct {
FxU32
device_bus_func_number;
struct {
FxBool
mapped;
AnyPtr
addr;
} addrList[MAX_PCI_BASEADDRESSES];
} linearAddressMapList[MAX_PCI_DEVICES];
typedef struct _PCIErr {
FxU32 code;
@@ -172,95 +161,13 @@ pioOutLong ( unsigned short port, FxU32 data )
}
static PciRegister baseAddresses[MAX_PCI_BASEADDRESSES];
static FxU32 vendorIDs[MAX_PCI_DEVICES];
static FxU32 configMechanism = 0;
static FxBool busDetected = FXFALSE;
static FxBool deviceExists[MAX_PCI_DEVICES];
/* PRIVATE FUNCTIONS */
static pciDeviceNode* pciDeviceListAppend(pciDeviceNode **list, FxU32 bus,
FxU32 slot, FxU32 function,
FxU32 vendorID, FxU32 deviceID)
{
pciDeviceNode **next;
int i;
assert(list);
assert(bus < 256);
assert(slot < 32);
assert(function < 8);
if(*list == NULL)
next = list;
else
{
/* Walk to the end of the list*/
pciDeviceNode *current = *list;
assert(current);
while(current->next)
current = current->next;
next = &((*current).next);
}
//Build the new pci device node
assert(next);
*next = (pciDeviceNode *)malloc(sizeof(pciDeviceNode));
assert(*next);
(*next)->bus = bus;
(*next)->slot = slot;
(*next)->function = function;
(*next)->vendorID = vendorID;
(*next)->deviceID = deviceID;
(*next)->next = NULL;
for(i=0; i<MAX_PCI_BASEADDRESSES; i++)
{
(*next)->addresses[i].mapped = FXFALSE;
(*next)->addresses[i].virtualAddress = 0;
}
return(*next);
}
FX_EXPORT void FX_CSTYLE pciPrintDeviceList(void)
{
if (!pciOpen())
{
printf("Couldn't open the pci bus\n");
printf("Please smash computer with luxury SUV\n");
}
printDeviceList(pciDeviceList);
}
static void printDeviceList(pciDeviceNode *head)
{
int index;
static char *baseName[] = {"baseAddress0",
"baseAddress1",
"ioBase",
"romBase"};
while(head)
{
printf("bus %d slot %d function %d vendorID 0x%x deviceID 0x%x\n",
head->bus, head->slot, head->function, head->vendorID,
head->deviceID);
for(index=0; index<MAX_PCI_BASEADDRESSES; index++)
{
if(head->addresses[index].mapped)
printf(" %s virtual address: 0x%lx\n", baseName[index],
head->addresses[index].virtualAddress);
}
head = head->next;
}
}
FxU32
static FxU32
_pciCreateConfigAddress( FxU32 bus_number, FxU32 device_number,
FxU32 function_number, FxU32 register_offset )
{
@@ -275,7 +182,7 @@ _pciCreateConfigAddress( FxU32 bus_number, FxU32 device_number,
FxU16
static FxU16
_pciCreateConfigSpaceMapping( FxU32 device_number, FxU32
register_offset )
{
@@ -289,7 +196,7 @@ _pciCreateConfigSpaceMapping( FxU32 device_number, FxU32
FX_ENTRY FxU32 FX_CALL
static FX_ENTRY FxU32 FX_CALL
_pciFetchRegister( FxU32 offset, FxU32 size_in_bytes,
FxU32 device_number, FxU32 config_mechanism )
{
@@ -327,7 +234,7 @@ _pciFetchRegister( FxU32 offset, FxU32 size_in_bytes,
FX_ENTRY void FX_CALL
static FX_ENTRY void FX_CALL
_pciUpdateRegister( FxU32 offset, FxU32 data, FxU32 size_in_bytes,
FxU32 device_number, FxU32 config_mechanism )
{
@@ -375,32 +282,18 @@ _pciUpdateRegister( FxU32 offset, FxU32 data, FxU32 size_in_bytes,
static AnyPtr
find_mapped_address(FxU32 device_bus_func_number, FxU32 addrNum)
{
AnyPtr retVal = 0x00UL;
FxU32
i;
AnyPtr
retVal = 0x00UL;
FxU32 bus, slot, function;
pciDeviceNode *current = pciDeviceList;
for(i = 0; i < MAX_PCI_DEVICES; i++) {
if (linearAddressMapList[i].device_bus_func_number == device_bus_func_number) {
retVal = linearAddressMapList[i].addrList[addrNum].addr;
assert(addrNum < MAX_PCI_BASEADDRESSES);
bus = (device_bus_func_number >> 5) & 0xFF;
slot = device_bus_func_number & 0x1F;
function = (device_bus_func_number >> 13) & 0x7;
//Scan through pci devices for a match
while(current)
{
if(current->bus == bus &&
current->slot == slot &&
current->function == function)
{
if(current->addresses[addrNum].mapped)
retVal = current->addresses[addrNum].virtualAddress;
break;
}
current = current->next;
break;
}
}
return retVal;
}
@@ -408,30 +301,35 @@ find_mapped_address(FxU32 device_bus_func_number, FxU32 addrNum)
static void
set_mapped_address(FxU32 device_bus_func_number, FxU32 addrNum, AnyPtr value)
{
FxU32 bus, slot, function;
pciDeviceNode *current = pciDeviceList;
FxU32 i;
for(i = 0; i < MAX_PCI_DEVICES; i++) {
if (linearAddressMapList[i].device_bus_func_number == device_bus_func_number) {
FxU32 j;
assert(addrNum < MAX_PCI_BASEADDRESSES);
linearAddressMapList[i].addrList[addrNum].mapped = (value != 0x00UL);
linearAddressMapList[i].addrList[addrNum].addr = value;
bus = (device_bus_func_number >> 5) & 0xFF;
slot = device_bus_func_number & 0x1F;
function = (device_bus_func_number >> 13) & 0x7;
for(j = 0; j < MAX_PCI_BASEADDRESSES; j++) {
if (linearAddressMapList[i].addrList[j].mapped) break;
}
if (j == MAX_PCI_BASEADDRESSES) linearAddressMapList[i].device_bus_func_number = 0x00UL;
//Scan through pci devices for a match
while(current)
{
if(current->bus == bus &&
current->slot == slot &&
current->function == function)
{
current->addresses[addrNum].mapped = (value != 0);
current->addresses[addrNum].virtualAddress = value;
break;
}
current = current->next;
break;
}
}
if (i != MAX_PCI_DEVICES) return;
for(i = 0; i < MAX_PCI_DEVICES; i++) {
if (linearAddressMapList[i].device_bus_func_number == 0) {
linearAddressMapList[i].device_bus_func_number = device_bus_func_number;
linearAddressMapList[i].addrList[addrNum].mapped = (value != 0x00UL);
linearAddressMapList[i].addrList[addrNum].addr = value;
break;
}
}
}
/* PUBLIC DATA */
@@ -479,7 +377,7 @@ pciGetErrorString( void )
{
static char vxdErrString[120];
if (pciErrorCode == PCI_ERR_WRONGVXD) {
sprintf(vxdErrString, "Expected VXD version V%d.%d, got V%d.%d\n",
sprintf(vxdErrString, "Expected VXD version V%d.%d, got V%ld.%ld\n",
FX_MAJOR_VER, FX_MINOR_VER,
BYTE1(pciVxdVer), BYTE0(pciVxdVer));
return vxdErrString;
@@ -516,47 +414,44 @@ sampleVendorID(int deviceNumber, int configMode)
deviceNumber, configMode );
regVal &= 0xFFFF;
if ( regVal != 0xFFFF )
if ( regVal != 0xFFFF ) {
busDetected = FXTRUE;
vendorIDs[deviceNumber] = regVal;
} else {
vendorIDs[deviceNumber] = 0;
}
}
#if defined(__linux__) && 0
#ifdef __linux__
FxBool
pciOpenLinux(void)
{
int numDevices, deviceNumber;
FxU32 regVal, vendorID, deviceID;
FxU32 slot;
FxU32 bus;
FxU32 functions;
FxU32 headerType; //PCI config register that determines multi-functioness (a new word)
//Determine if there is a PCI device here
numDevices=getNumDevicesLinux();
for (deviceNumber=0; deviceNumber < MAX_PCI_DEVICES; deviceNumber++) {
if (deviceNumber<numDevices) {
busDetected=FXTRUE;
configMechanism=1;
deviceExists[deviceNumber] = FXTRUE;
vendorIDs[deviceNumber] = 0x121a;
}
else deviceExists[deviceNumber] = FXFALSE;
int numDevices, deviceNumber;
numDevices=getNumDevicesLinux();
for (deviceNumber=0; deviceNumber < MAX_PCI_DEVICES; deviceNumber++) {
if (deviceNumber<numDevices) {
busDetected=FXTRUE;
configMechanism=1;
deviceExists[deviceNumber] = FXTRUE;
vendorIDs[deviceNumber] = 0x121a;
}
if (numDevices) {
pciLibraryInitialized=FXTRUE;
} else {
pciLibraryInitialized=FXFALSE;
}
return pciLibraryInitialized;
else deviceExists[deviceNumber] = FXFALSE;
}
if (numDevices) {
pciLibraryInitialized=FXTRUE;
} else {
pciLibraryInitialized=FXFALSE;
}
return pciLibraryInitialized;
}
#endif /* defined(__linux__) */
#endif /* defined(__linux__) */
FX_EXPORT FxBool FX_CSTYLE
pciOpen( void )
{
int deviceNumber;
if ( pciLibraryInitialized ) return FXTRUE;
baseAddresses[0] = PCI_BASE_ADDRESS_0;
@@ -570,65 +465,38 @@ pciOpen( void )
(gCurPlatformIO == NULL) ||
!pciInitializeDDio()) return FXFALSE;
}
/*
** Scan All PCI device numbers
*/
#if defined(__linux__) && 00
*/
#ifdef __linux__
if (hasDev3DfxLinux) return pciOpenLinux();
#endif /* defined(__linux__) */
#endif /* defined(__linux__) */
for ( deviceNumber = 0; deviceNumber < MAX_PCI_DEVICES; deviceNumber++ ) {
FxU32 regVal, vendorID, deviceID;
FxU32 regVal;
FxU32 slot;
FxU32 bus;
FxU32 functions;
FxU32 headerType; //PCI config register that determines multi-functioness (a new word)
sampleVendorID(deviceNumber,1);
bus = (deviceNumber >> 5) & 0xFF;
slot = (deviceNumber & 0x1f);
//Determine if there is a PCI device here
pioOutLong( CONFIG_ADDRESS_PORT,
_pciCreateConfigAddress( bus, slot, 0x0, 0x0 ) );
_pciCreateConfigAddress( bus, slot, 0x0, 0x0 ) );
regVal = pioInLong( CONFIG_DATA_PORT );
vendorID = regVal & 0xFFFF;
deviceID = regVal >> 16;
if(vendorID != 0xFFFF)
{
busDetected = FXTRUE;
configMechanism = 1;
//Add this device to the list of pci devices
pciDeviceListAppend(&pciDeviceList, bus, slot, 0,
vendorID, deviceID);
}
else
continue;
//Determine if this device is multi-function
//The information about this stuff is in the PCI spec 2.1
//on page 188
pioOutLong(CONFIG_ADDRESS_PORT,
_pciCreateConfigAddress(bus, slot, 0x0, 0xC));
headerType = (pioInLong(CONFIG_DATA_PORT) >> 16) & 0xFF;
//If not a multi-function device then skip function scan
if((headerType & (1<<7)) == 0)
continue;
//Determine which functions this device implements
for (functions = 1; functions < MAX_DEVICES_FUNCTIONS; functions++) {
pioOutLong( CONFIG_ADDRESS_PORT,
_pciCreateConfigAddress( bus, slot, functions, 0x0 ) );
regVal = pioInLong( CONFIG_DATA_PORT );
vendorID = regVal & 0xFFFF;
//If this function exists, add this device function to the list of pci devices
if(vendorID != 0xFFFF)
pciDeviceListAppend(&pciDeviceList, bus, slot, functions,
vendorID, deviceID);
if ( ( regVal & 0xFFFF ) != 0xFFFF ) {
busDetected = FXTRUE;
configMechanism = 1;
deviceExists[deviceNumber] = FXTRUE;
vendorIDs[deviceNumber] = regVal & 0xffff;
} else {
deviceExists[deviceNumber] = FXFALSE;
}
}
if ( !busDetected ) {
@@ -649,64 +517,31 @@ pciOpen( void )
pciErrorCode = PCI_ERR_NO_BUS;
return FXFALSE;
}
return FXTRUE;
} /* pciOpen */
FX_EXPORT FxBool FX_CSTYLE
pciClose( void )
{
pciDeviceNode *current, *next;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN2;
return FXFALSE;
}
pciLibraryInitialized = FXFALSE;
//Delete the linked list of PCI devices
current = pciDeviceList;
while(current)
{
next = current->next;
free(current);
current = next;
}
pciDeviceList=NULL;
if (gCurPlatformIO)
return pciCloseDDio();
return FXTRUE;
return pciCloseDDio();
}
FX_EXPORT FxBool FX_CSTYLE
pciDeviceExists( FxU32 device_number ) {
FxU32 bus, slot, function;
pciDeviceNode *current = pciDeviceList;
bus = (device_number >> 5) & 0xFF;
slot = device_number & 0x1F;
function = (device_number >> 13) & 0x7;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN;
return FXFALSE;
}
//Scan through pci devices for a match
while(current)
{
if(current->bus == bus &&
current->slot == slot &&
current->function == function)
return(current->vendorID);
current = current->next;
}
return(FXFALSE);
if ( device_number >= MAX_PCI_DEVICES ) return FXFALSE;
return vendorIDs[device_number];
} /* pciDeviceExists */
@@ -715,13 +550,6 @@ FX_EXPORT FxBool FX_CSTYLE
pciGetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data )
{
int device_number = (device_bus_func_number) & 0xFFF;
FxU32 bus, slot, function;
pciDeviceNode *current = pciDeviceList;
bus = (device_bus_func_number >> 5) & 0xFF;
slot = device_bus_func_number & 0x1F;
function = (device_bus_func_number >> 13) & 0x7;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN3;
@@ -731,29 +559,17 @@ pciGetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data )
pciErrorCode = PCI_ERR_OUTOFRANGE;
return FXFALSE;
}
//Scan through pci devices for a match
while(current)
{
if(current->bus == bus &&
current->slot == slot &&
current->function == function)
break;
current = current->next;
}
if(current == NULL)
{
pciErrorCode = PCI_ERR_NODEV;
return FXFALSE;
}
if ( !vendorIDs[device_number] ) {
pciErrorCode = PCI_ERR_NODEV;
return FXFALSE;
}
if ( reg.rwFlag == WRITE_ONLY ) {
pciErrorCode = PCI_ERR_WRITEONLY;
return FXFALSE;
}
#ifdef __linux__
if (hasDev3DfxLinux()) {
*data = pciFetchRegisterLinux(reg.regAddress, reg.sizeInBytes,
@@ -761,43 +577,18 @@ pciGetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data )
return FXTRUE;
}
#endif
*data = _pciFetchRegister( reg.regAddress, reg.sizeInBytes,
device_bus_func_number, configMechanism );
return FXTRUE;
} /* pciGetConfigData */
FX_EXPORT FxBool FX_CSTYLE
pciGetConfigDataRaw( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data ) {
int device_number = (device_bus_func_number) & 0xFFF;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN3;
return FXFALSE;
}
if ( device_number > MAX_PCI_DEVICES ) {
pciErrorCode = PCI_ERR_OUTOFRANGE;
return FXFALSE;
}
*data = _pciFetchRegister( reg.regAddress, reg.sizeInBytes,
device_bus_func_number, configMechanism );
return FXTRUE;
} /* pciGetConfigData32 */
FX_EXPORT FxBool FX_CSTYLE
pciSetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data )
{
int device_number = (device_bus_func_number) & 0xFFF;
FxU32 bus, slot, function;
pciDeviceNode *current = pciDeviceList;
bus = (device_bus_func_number >> 5) & 0xFF;
slot = device_bus_func_number & 0x1F;
function = (device_bus_func_number >> 13) & 0x7;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN3;
@@ -807,140 +598,89 @@ pciSetConfigData( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data )
pciErrorCode = PCI_ERR_OUTOFRANGE;
return FXFALSE;
}
//Scan through pci devices for a match
while(current)
{
if(current->bus == bus &&
current->slot == slot &&
current->function == function)
break;
current = current->next;
}
if(current == NULL)
{
pciErrorCode = PCI_ERR_NODEV;
return FXFALSE;
}
if ( !vendorIDs[device_number] ) {
pciErrorCode = PCI_ERR_NODEV2;
return FXFALSE;
}
if ( reg.rwFlag == READ_ONLY ) {
pciErrorCode = PCI_ERR_READONLY;
return FXFALSE;
}
#ifdef __linux__
if (hasDev3DfxLinux()) {
return pciUpdateRegisterLinux(reg.regAddress, *data, reg.sizeInBytes,
device_bus_func_number);
}
#endif /* defined(__linux__) */
#endif
_pciUpdateRegister( reg.regAddress, *data, reg.sizeInBytes,
device_bus_func_number, configMechanism );
return FXTRUE;
} /* pciSetConfigData */
FX_EXPORT FxBool FX_CSTYLE
pciSetConfigDataRaw( PciRegister reg, FxU32 device_bus_func_number, FxU32 *data ) {
int device_number = (device_bus_func_number) & 0xFFF;
if ( !pciLibraryInitialized ) {
pciErrorCode = PCI_ERR_NOTOPEN3;
return FXFALSE;
}
if ( device_number > MAX_PCI_DEVICES ) {
pciErrorCode = PCI_ERR_OUTOFRANGE;
return FXFALSE;
}
_pciUpdateRegister( reg.regAddress, *data, reg.sizeInBytes,
device_bus_func_number, configMechanism );
return FXTRUE;
} /* pciSetConfigData32 */
FX_EXPORT FxBool FX_CSTYLE
pciFindCardMulti(FxU32 vendorID, FxU32 deviceID,
FxU32 *devNum, FxU32 cardNum)
{
pciDeviceNode *current;
FxU32 deviceNumber;
/* 1) open the PCI bus and scan it for devices */
if (!pciOpen()) return FXFALSE;
/* 2) scan the existing devices for a match */
current = pciDeviceList;
while(current)
{
//Check if this device matches the deviceID and vendorID
//Accept any deviceID if the desired deviceID is 0xFFFF
//Only accept function 0 becayse this function goes card
//by card and not function by function
if(((current->deviceID == deviceID) || (deviceID == 0xFFFF)) &&
(current->vendorID == vendorID) &&
(current->function == 0))
{
if(cardNum == 0)
{
//The function is always 0 here so it isn't included
*devNum = ((current->bus & 0xFF) << 5) | (current->slot & 0x1F);
return(FXTRUE);
}
cardNum--;
}
current = current->next;
}
return FXFALSE; /* didn't find the card, return false */
} /* pciFindCardMulti */
//This mo' freaka finds the Nth (N = functionIndex) pci function.
//functionIndex == 0 => Returns the first function
FX_EXPORT FxBool FX_CSTYLE
pciFindCardMultiFunc(FxU32 vendorID, FxU32 deviceID,
FxU32 *devNum, FxU32 *funcNum, FxU32 functionIndex)
{
pciDeviceNode *current;
/* 1) open the PCI bus and scan it for devices */
/* 1) open the PCI device and scan it for devices */
if (!pciOpen()) return FXFALSE;
/* 2) scan the existing devices for a match */
current = pciDeviceList;
while(current)
{
//Check if this device matches the deviceID and vendorID
//Accept any deviceID if the desired deviceID is 0xFFFF
if(((current->deviceID == deviceID) || (deviceID == 0xFFFF)) &&
(current->vendorID == vendorID))
{
if(functionIndex == 0)
{
*devNum = ((current->bus & 0xFF) << 5) | (current->slot & 0x1F)
| ((current->function & 0x7) << 13);
*funcNum = current->function;
return(FXTRUE);
}
for ( deviceNumber = 0; deviceNumber < MAX_PCI_DEVICES; deviceNumber++ ) {
if (pciDeviceExists(deviceNumber)) {
FxU32
vID, dID;
FxBool
matchP = FXFALSE;
functionIndex--;
}
current = current->next;
pciGetConfigData( PCI_VENDOR_ID, deviceNumber, &vID );
pciGetConfigData( PCI_DEVICE_ID, deviceNumber, &dID );
// Quick optimization, if there is no device or vendor ID...
if ((!dID) && (!dID))
continue;
if (deviceID == 0xFFFF) /* if special value */
dID = deviceID; /* then force a match */
matchP = ((vID == vendorID) && (dID == deviceID));
if (matchP) {
if (cardNum == 0) {
*devNum = deviceNumber;
return FXTRUE;
}
}
/* single board SLI hack! - jeske */
if ((vID == _3DFX_PCI_ID) && (dID == 0x0002)) {
pciGetConfigData( PCI_VENDOR_ID, deviceNumber | (1 << 13), &vID);
pciGetConfigData( PCI_DEVICE_ID, deviceNumber | (1 << 13), &dID);
if ((vID == vendorID) && (dID == deviceID)) {
matchP = FXTRUE;
if (cardNum == 0) {
*devNum = deviceNumber | (1 << 13); /* stuff in function 1 */
return FXTRUE;
}
}
}
/* end of single board SLI hack! - jeske */
if (matchP) cardNum--;
}
}
return FXFALSE; /* didn't find the card, return false */
} /* pciFindCardMulti */
FX_EXPORT FxBool FX_CSTYLE
pciFindCard(FxU32 vendorID, FxU32 deviceID, FxU32 *devNum) {
return pciFindCardMulti(vendorID, deviceID, devNum, 0);
@@ -1004,79 +744,7 @@ pciMapCardMulti(FxU32 vendorID, FxU32 deviceID,
* device_number[13:15] = function
*/
if (!pciMapPhysicalDeviceToLinear(&virtAddress,
((*devNum >> 5UL) & 0xFFUL), physAddress,
(FxU32*) &length)) {
virtAddress = 0x00UL;
}
set_mapped_address(*devNum, addressNum, virtAddress);
}
return (FxU32*)virtAddress;
} /* pciMapCardMulti */
/*----------------------------------------------------------------------
find and map a PCI card into virtual memory using the following 4
steps:
1) open the PCI device and scan it for devices
2) scan the existing devices for a vendorId, deviceId, cardNum match
3) find the current physcial address of the card
4) map the physical memory to virtual memory
----------------------------------------------------------------------*/
FX_EXPORT FxU32 * FX_CSTYLE
pciMapCardMultiFunc(FxU32 vendorID, FxU32 deviceID,
FxI32 length,
FxU32 *devNum,
FxU32 cardNum, FxU32 addressNum)
{
FxU32
physAddress;
AnyPtr
virtAddress;
FxU32 functionNumber;
/*This differs from pciMapCardMulti in that it goes function by
function instead of card by card*/
/* 1) open the PCI device and scan it for devices
* 2) scan the existing devices for a match
*/
if (!pciFindCardMultiFunc(vendorID, deviceID, devNum, &functionNumber, cardNum)) return NULL;
if (addressNum > MAX_PCI_BASEADDRESSES) return NULL;
/* 3) find the current physcial address of the card */
pciGetConfigData( baseAddresses[addressNum], *devNum, &physAddress );
if (length <= 0) return (FxU32*)(long)length;
/* Mask the memory type information bits off.
* [0]: Memory type indicator (0 memory/1 i/o)
* [12]: Type
* 00: 32 bits wide and mapable anywhere
* 01: 32 bits wide, mapped < 1meg
* 10: 64 bits wide and mappable anywhere
* 11: reserved
* [3]: Prefetcable
*/
physAddress &= ~0xF;
/* 4) have we mapped this device before? */
virtAddress = find_mapped_address(*devNum, addressNum);
if (virtAddress == 0x00UL) {
/* 5) map the physical memory to virtual memory
*
* NB: Some systems (notably nt) require a bus # in addition to the
* physical address in order to map a device. pciMapPhysicalToLinear
* has an implicit bus0 which works most of the time, but fails
* across pci bridges and to agp devices. Anyway, recall that the
* deviceNumber is a tuple w/ the following internal structure:
*
* device_number[0:4] = slot
* device_number[5:12] = bus
* device_number[13:15] = function
*/
if (!pciMapPhysicalDeviceToLinear(&virtAddress,
((*devNum >> 5UL) & 0xFFUL), physAddress,
((*devNum >> 5UL) & 0xFFUL), physAddress,
(FxU32*) &length)) {
virtAddress = 0x00UL;
@@ -1116,26 +784,20 @@ pciMapPhysicalDeviceToLinear(AnyPtr *linear_addr,
FX_EXPORT void FX_CSTYLE
pciUnmapPhysical( AnyPtr linear_addr, FxU32 length )
{
int baseAddressIndex;
pciDeviceNode *current = pciDeviceList;
int i,j;
for (i = 0; i < MAX_PCI_DEVICES; i++) {
for (j = 0; j < MAX_PCI_BASEADDRESSES; j++) {
if(linearAddressMapList[i].addrList[j].addr == linear_addr) {
linearAddressMapList[i].addrList[j].addr = 0x00UL;
linearAddressMapList[i].addrList[j].mapped = FXFALSE;
while(current)
{
for(baseAddressIndex=0; baseAddressIndex<MAX_PCI_BASEADDRESSES; baseAddressIndex++)
{
if(current->addresses[baseAddressIndex].virtualAddress == linear_addr)
{
assert(current->addresses[baseAddressIndex].mapped);
current->addresses[baseAddressIndex].virtualAddress = 0;
current->addresses[baseAddressIndex].mapped = FXFALSE;
pciUnmapLinearDD(linear_addr, length);
return; //Only unmap one at a time; this matches the old operation
}
}
current = current->next;
break;
}
}
}
if (i != MAX_PCI_DEVICES) pciUnmapLinearDD(linear_addr, length);
}
FX_EXPORT FxBool FX_CSTYLE

View File

@@ -29,10 +29,10 @@
#include "texusint.h"
static int
dithmat[4][4] = { { 0, 8, 2, 10, },
{ 12, 4, 14, 6 },
{ 3, 11, 1, 9 },
{ 15, 7, 13, 5 } };
dithmat[4][4] = { { 0, 8, 2, 10 },
{ 12, 4, 14, 6 },
{ 3, 11, 1, 9 },
{ 15, 7, 13, 5 }};
static struct {
int yhist[256], ihist[256], qhist[256];

View File

@@ -412,7 +412,7 @@ txMipNccNNet(TxMip *pxMip, TxMip *txMip, int format, FxU32 dither, FxU32 comp)
txMapPal256toYAB((FxU32 *)yabTable, (FxU8 *)map, ncolors, (FxU32 *)pxMip->pal);
if( txVerbose )
{
printf("eMax=(%3d%3d%3d)...eAvg=(%3d%3d%3d)\n",
printf("eMax=(%3ld%3ld%3ld)...eAvg=(%3ld%3ld%3ld)\n",
errG, errR, errB,
totG/ncolors, totR/ncolors, totB/ncolors
);

View File

@@ -52,9 +52,12 @@
unsigned char inverse_pal[1<<INVERSE_PAL_TOTAL_BITS];
#endif
/* At least the GNU libc declares these.. */
#ifndef __GNUC__
typedef unsigned long ulong;
typedef unsigned char uchar;
typedef unsigned short ushort;
#endif
typedef unsigned char uchar;
#ifdef HUGE
#undef HUGE

View File

@@ -30,10 +30,10 @@
#include "texusint.h"
static int
dithmat[4][4] = { { 0, 8, 2, 10, },
{ 12, 4, 14, 6 },
{ 3, 11, 1, 9 },
{ 15, 7, 13, 5 } };
dithmat[4][4] = { { 0, 8, 2, 10 },
{ 12, 4, 14, 6 },
{ 3, 11, 1, 9 },
{ 15, 7, 13, 5 }};
// for error diffusion.
static int errR[MAX_TEXWIDTH], errG[MAX_TEXWIDTH], errB[MAX_TEXWIDTH];
@@ -498,7 +498,7 @@ _txPixQuantize_AI88( unsigned int argb, int x, int y, int w)
static void
_txImgQuantize(char *dst, char *src, int w, int h, FxU32 format, FxU32 dither)
{
int (*quantizer)(unsigned int argb, int x, int y, int w);
int (*quantizer)(unsigned int argb, int x, int y, int w) = NULL;
int x, y;
dither &= TX_DITHER_MASK;

View File

@@ -43,7 +43,7 @@ _txReadHeader( FILE *stream, TxMip *info )
FxU32 cookie;
int c;
int fformat; // format of the image file.
int status;
int status = 0;
if ( stream == NULL ) {
txError("Bad file handle.");

View File

@@ -286,7 +286,7 @@ eigenSpace(int n, float *data, float mean[3], float evectors[3][3], float evalue
float cov[3][3];
covariance(n, (float (*)[3]) data, mean, cov);
eigenVectors(cov, evectors, evalues);
eigenVectors((const float (*)[3])cov, evectors, evalues);
}
/*

View File

@@ -35,7 +35,7 @@ static struct {
int yhist[256], ihist[256], qhist[256];
int ymin, ymax, imin, imax, qmin, qmax;
int npixels;
int y[16], a[3*4], b[3*4]; // please leave these contiguous
FxU32 y[16], a[3*4], b[3*4]; // please leave these contiguous
} ncc;
static int

View File

@@ -268,7 +268,7 @@ txMapPal256toYAB(FxU32 *YAB, FxU8 *map, int nsamples, FxU32 *samples)
int bstR, bstG, bstB, bstMax;
int iterations; // track how many inputs have been fed to NN
int drySpells; // how many inputs since last best case.
int yab2pal[256];
FxU32 yab2pal[256];
_nn_initTables();
/*
@@ -385,7 +385,7 @@ txMipNccNNet(TxMip *pxMip, TxMip *txMip, int format, FxU32 dither, FxU32 comp)
int i, w, h;
int ncolors;
int pixsize = (pxMip->format == GR_TEXFMT_YIQ_422) ? 1 : 2;
int yabTable[16+12+12];
FxU32 yabTable[16+12+12];
FxU8 map[256];

View File

@@ -73,7 +73,7 @@ int txGCD(int a, int b);
int txAspectRatio(int w, int h);
void txPanic(char *);
void txError(char *);
void txYABtoPal256(int *palette, const int* yabTable);
void txYABtoPal256(FxU32 *palette, const FxU32* yabTable);
void txRectCopy(FxU8 *dst, int dstStride, const FxU8 *src, int srcStride,
int width, int height);
FxBool txMipAlloc(TxMip *txMip);

View File

@@ -156,14 +156,14 @@ txGCD(int a, int b)
}
void
txYABtoPal256(int *palette, const int* yabTable)
txYABtoPal256(FxU32 *palette, const FxU32* yabTable)
{
// Convert YAB table to a 256 color palette
// Assume yabTable[] has first 16Y's, 12 A's, 12 B's
const int *Y = yabTable;
const int *A = yabTable + 16;
const int *B = yabTable + 16 + 12;
const FxU32 *Y = yabTable;
const FxU32 *A = yabTable + 16;
const FxU32 *B = yabTable + 16 + 12;
int i;
for (i=0; i<256; i++) {