commit 5a18195401eced4b3b7b2d0960e57669c2743ff2
parent c9e91a50539e407e77f0ee91db1a3229dc8ec095
Author: ukai <ukai>
Date: Fri, 21 Dec 2001 21:37:12 +0000
[w3m-dev 02692] w3m on linux/ia64
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
5 files changed, 65 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,17 @@
+2001-12-22 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 02692] w3m on linux/ia64
+ * mktable.c: #include "config.h"
+ * mktable.c: #include "stdint.h" or uintptr_t typedef
+ * mktable.c: use uintptr_t instead of unsigned int
+ * configure: check pthread on linux
+ * configure: add gc_cflags for linux/ia64,alpha,s390
+ * configure: check stdint.h
+ * configure (config.h): add $pthreadlib to GCLIB
+ * configure (config.h): add $def_have_stdint_h
+ * config.h.dist (HAVE_STDINT_H): added
+ * Str.c: add #include <stdlib.h> for exit() on some platform (ia64)
+
2001-12-22 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02690] RC_DIR in scripts
diff --git a/Str.c b/Str.c
@@ -14,6 +14,7 @@
* results obtained from use of this software.
*/
#include <stdio.h>
+#include <stdlib.h>
#include <gc.h>
#include <stdarg.h>
#include <string.h>
diff --git a/config.h.dist b/config.h.dist
@@ -174,6 +174,7 @@ MODEL=Linux.i686-monster-ja
#define JMP_BUF sigjmp_buf
#define HAVE_FLOAT_H
#define HAVE_SYS_SELECT_H
+#undef HAVE_STDINT_H
typedef void MySignalHandler;
#define SIGNAL_ARG int _dummy
diff --git a/configure b/configure
@@ -945,6 +945,22 @@ else
inflate=
fi
+## Search pthread, Linux requires this (at least ia64,alpha,s390?).
+## Other platform?
+pthreadlib=
+case $sysname in
+Linux|linux|LINUX)
+ for tlibdir in /lib /usr/lib
+ do
+ if [ -f $tlibdir/libpthread.a -o -f $tlibdir/libpthread.$so_ext ]; then
+ echo "$tlibdir/libpthread found"
+ pthreadlib="-L$tlibdir -lpthread"
+ break
+ fi
+ done
+ ;;
+esac
+
gclib=''
gcinclude=''
gctarget=''
@@ -1045,19 +1061,22 @@ if [ -z "$gclib" -o -z "$gcinclude" ]; then
gctarget="$gclib"
fi
-# Apply patch.
+# arch specific flags for libgc
gc_cflags=''
-if [ "$gclib" = "gc/gc.a" -a ! -f patch_done ]; then
+if [ "$gclib" = "gc/gc.a" ]; then
patchfile=""
case "$platform:$sysname" in
+ ia64:Linux|alpha:Linux|s390*:Linux)
+ gc_cflags="-DGC_LINUX_THREADS -D_REENTRANT"
+ ;;
R3000:*System_V*|R4000:UNIX_SYSV|R*000:UNIX_SV)
# EWS-4800
# patchfile=Patches/ews4800
gc_cflags=-Dmips
;;
esac
-
- if [ -n "$patchfile" -a -f "$patchfile" ]; then
+ # Apply patch.
+ if [ ! -f patch_done -a -n "$patchfile" -a -f "$patchfile" ]; then
patch -lp0 < $patchfile
echo "dpatch='$patch'" >> config.param
touch patch_done
@@ -1682,6 +1701,22 @@ else
def_have_sys_select_h='#undef HAVE_SYS_SELECT_H'
fi
+####### check for stdint.h
+cat > _zmachdep.c <<EOF
+#include <stdint.h>
+main()
+{
+ ;
+}
+EOF
+if $cc $cflags -c _zmachdep.c > /dev/null 2>&1
+then
+ echo "You have stdint.h."
+ def_have_stdint_h='#define HAVE_STDINT_H'
+else
+ def_have_stdint_h='#undef HAVE_STDINT_H'
+fi
+
####### setpgrp(pid, pgrp) or setpgrp() ?
cat > _zmachdep.c << EOF
#include <unistd.h>
@@ -1965,7 +2000,7 @@ Z_CFLAGS=$z_cflags
ZLIB=$zlib
EXT_TARGETS=\$(BOOKMARKER) \$(HELPER) $inflate
GC_CFLAGS=$gc_cflags
-GCLIB=$gclib
+GCLIB=$gclib $pthreadlib
GCTARGET=$gctarget
RANLIB=$ranlib_cmd
MKDIR=$MKDIR
@@ -2056,6 +2091,7 @@ $def_longjmp
$def_jmpbuf
$def_have_float_h
$def_have_sys_select_h
+$def_have_stdint_h
$def_sighandler
$def_sig_arg
diff --git a/mktable.c b/mktable.c
@@ -1,7 +1,13 @@
/* $Id$ */
+#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#ifdef HAVE_STDINT_H
+#include "stdint.h"
+#else
+typedef unsigned int uintptr_t;
+#endif
#include "hash.h"
#include "Str.h"
#include <gc.h>
@@ -10,9 +16,9 @@
defhash(HashItem_ss *, int, hss_i)
#define keycomp(x,y) ((x)==(y))
- static unsigned int hashfunc(HashItem_ss * x)
+ static uintptr_t hashfunc(HashItem_ss * x)
{
- return (unsigned int)x;
+ return (uintptr_t)x;
}
defhashfunc(HashItem_ss *, int, hss_i)