xemacs21 (21.4.22-3.1) 03_hppa_undefined_symbols

Summary

 configure.in        |    3 +++
 lib-src/gnuclient.c |    2 +-
 src/emacs.c         |    2 +-
 src/m/hp800.h       |   27 +++++++++++++++++----------
 src/sound.c         |    2 +-
 5 files changed, 23 insertions(+), 13 deletions(-)

    
download this patch

Patch contents

#! /bin/sh -e
## 03_hppa_undefined_symbols.dpatch by OHURA Makoto <ohura@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix FTBFS problem for hppa. See BTS #133682

if [ $# -lt 1 ]; then
    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"

case "$1" in
    -patch) patch -p1 ${patch_opts} < $0;;
    -unpatch) patch -R -p1 ${patch_opts} < $0;;
    *)
        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
        exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/mohura/debsrc/xemacs21-21.4.15/configure.in xemacs21-21.4.15/configure.in
--- /home/mohura/debsrc/xemacs21-21.4.15/configure.in	2004-07-25 17:37:11.000000000 +0900
+++ xemacs21-21.4.15/configure.in	2004-07-25 17:44:08.000000000 +0900
@@ -888,6 +888,9 @@
   sources may be found."])
     fi
   ;;
+  hppa*-*-linux-gnu* )
+    machine=hp800 opsys=gnu-linux
+  ;;
 
   dnl Otherwise, check if the directory they specified is okay.
   * )
diff -urNad /home/mohura/debsrc/xemacs21-21.4.15/lib-src/gnuclient.c xemacs21-21.4.15/lib-src/gnuclient.c
--- /home/mohura/debsrc/xemacs21-21.4.15/lib-src/gnuclient.c	2004-07-25 17:37:11.000000000 +0900
+++ xemacs21-21.4.15/lib-src/gnuclient.c	2004-07-25 17:44:08.000000000 +0900
@@ -597,7 +597,7 @@
 		strcpy (remotepath, ptr);
 	    }
 #if 0  /* This is really bogus... re-enable it if you must have it! */
-#if defined (hp9000s300) || defined (hp9000s800)
+#if defined (__hpux)
 	  else if (strcmp (thishost,hostarg))
 	    {	/* try /net/thishost */
 	      strcpy (remotepath, "/net/");		/* (this fails using internet
diff -urNad /home/mohura/debsrc/xemacs21-21.4.15/src/emacs.c xemacs21-21.4.15/src/emacs.c
--- /home/mohura/debsrc/xemacs21-21.4.15/src/emacs.c	2004-07-25 17:37:11.000000000 +0900
+++ xemacs21-21.4.15/src/emacs.c	2004-07-25 17:44:08.000000000 +0900
@@ -2368,7 +2368,7 @@
 #if defined (WIN32_NATIVE) || defined (CYGWIN)
   init_win32 ();
 #endif
-#if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800)
+#if defined (HAVE_NATIVE_SOUND) && defined (__hpux)
   init_hpplay ();
 #endif
 #ifdef HAVE_TTY
diff -urNad /home/mohura/debsrc/xemacs21-21.4.15/src/m/hp800.h xemacs21-21.4.15/src/m/hp800.h
--- /home/mohura/debsrc/xemacs21-21.4.15/src/m/hp800.h	2004-07-25 17:37:11.000000000 +0900
+++ xemacs21-21.4.15/src/m/hp800.h	2004-07-25 17:44:08.000000000 +0900
@@ -24,16 +24,8 @@
    operating system this machine is likely to run.
    USUAL-OPSYS="hpux"  */
 
-/* Now define a symbol for the cpu type, if your compiler
-   does not define it automatically:
-   Ones defined so far include vax, m68000, ns16000, pyramid,
-   orion, tahoe, APOLLO and many others */
-#ifndef hp9000s800
-#	define hp9000s800
-#endif
-
 
-#ifdef __hpux
+#if defined(__hpux) || defined(__linux__)
 /* Now define a symbol for the cpu type, if your compiler
    does not define it automatically:
    Ones defined so far include vax, m68000, ns16000, pyramid,
@@ -42,6 +34,15 @@
 #     define hp9000s800
 #endif
 
+#ifdef __linux__
+/* Data type of load average, as read out of kmem.  */
+
+#define LOAD_AVE_TYPE long
+
+/* Convert that into an integer that is 100 for a load average of 1.0  */
+
+#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+#else
 /* Data type of load average, as read out of kmem.  */
 
 #define LOAD_AVE_TYPE double
@@ -49,7 +50,7 @@
 /* Convert that into an integer that is 100 for a load average of 1.0  */
 
 #define LOAD_AVE_CVT(x) ((int) (x * 100.0))
-
+#endif
 
 /* Define CANNOT_DUMP on machines where unexec does not work.
    Then the function dump-emacs will not be defined
@@ -57,6 +58,7 @@
 
 #undef CANNOT_DUMP
 
+#ifdef __hpux
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
@@ -82,6 +84,9 @@
 
 #define DATA_START    0x40000000
 #define TEXT_START    0x00000000
+#else
+#define HAVE_ALLOCA
+#endif
 
 #define STACK_DIRECTION 1 
 
@@ -95,6 +100,7 @@
 /* This machine requires completely different unexec code
    which lives in a separate file.  Specify the file name.  */
 
+#ifdef __hpux
 #define UNEXEC "unexhp9k800.o"
 
 #define LIBS_MACHINE
@@ -124,3 +130,4 @@
 #endif
 
 #endif /* __hpux */
+#endif /* __hpux || __linux */
diff -urNad /home/mohura/debsrc/xemacs21-21.4.15/src/sound.c xemacs21-21.4.15/src/sound.c
--- /home/mohura/debsrc/xemacs21-21.4.15/src/sound.c	2004-07-25 17:37:11.000000000 +0900
+++ xemacs21-21.4.15/src/sound.c	2004-07-25 17:44:08.000000000 +0900
@@ -653,7 +653,7 @@
 */ );
   Vnative_sound_only_on_console = Qt;
 
-#if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800)
+#if defined (HAVE_NATIVE_SOUND) && defined (__hpux)
   {
     void vars_of_hpplay (void);
     vars_of_hpplay ();