$NetBSD: patch-ae,v 1.1 1999/10/27 13:47:30 tron Exp $

--- src/asm_386.S.orig	Wed Jul  8 22:50:13 1998
+++ src/asm_386.S	Tue Oct 26 00:46:37 1999
@@ -57,13 +57,17 @@
  * Change this to .data if your system doesn't have .rodata
  */
 #ifndef RODATA
-#if defined(FREEBSD) || defined(__EMX__)
+#if defined(FREEBSD) || defined(__EMX__) || (defined(__NetBSD__) && !defined(__ELF__))
 #define RODATA .data
 #else
 #define RODATA 	.section .rodata
 #endif
 #endif
 
+#if defined(FREEBSD) || (defined(__NetBSD__) && !defined(__ELF__))
+#define PREPEND_UNDERSCORE
+#endif
+
 #ifndef DATA
 #define DATA 	.data
 #endif
@@ -81,7 +85,7 @@
  * void asm_transform_points3_general( GLuint n, GLfloat d[][4],
  *                                     GLfloat m[16], GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points3_general)
 ALIGN
 _asm_transform_points3_general:
@@ -218,7 +222,7 @@
  * void asm_transform_points3_identity( GLuint n, GLfloat d[][4],
  *                                      GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points3_identity)
 ALIGN
 _asm_transform_points3_identity:
@@ -264,7 +268,7 @@
  * void asm_transform_points3_2d( GLuint n, GLfloat d[][4], GLfloat m[16],
  *                                GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points3_2d)
 ALIGN
 _asm_transform_points3_2d:
@@ -404,7 +408,7 @@
  *                                       GLfloat m[16], GLfloat s[][4] );
  *
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points3_2d_no_rot)
 ALIGN
 _asm_transform_points3_2d_no_rot:
@@ -459,7 +463,7 @@
  * void asm_transform_points3_3d( GLuint n, GLfloat d[][4], GLfloat m[16],
  *                                GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points3_3d)
 ALIGN
 _asm_transform_points3_3d:
@@ -572,7 +576,7 @@
  * void asm_transform_points4_general( GLuint n, GLfloat d[][4],
  *                                     GLfloat m[16], GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_general)
 ALIGN
 _asm_transform_points4_general:
@@ -728,7 +732,7 @@
  * void asm_transform_points4_identity( GLuint n, GLfloat d[][4],
  *                                      GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_identity)
 ALIGN
 _asm_transform_points4_identity:
@@ -758,7 +762,7 @@
  * void asm_transform_points4_2d( GLuint n, GLfloat d[][4], GLfloat m[16],
  *                                GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_2d)
 ALIGN
 _asm_transform_points4_2d:
@@ -829,7 +833,7 @@
  * void asm_transform_points4_2d_no_rot( GLuint n, GLfloat d[][4],
  *                                       GLfloat m[16], GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_2d_no_rot)
 ALIGN
 _asm_transform_points4_2d_no_rot:
@@ -883,7 +887,7 @@
  * void asm_transform_points4_3d( GLuint n, GLfloat d[][4], GLfloat m[16],
  *                                GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_3d)
 ALIGN
 _asm_transform_points4_3d:
@@ -1015,7 +1019,7 @@
  * void asm_transform_points4_ortho( GLuint n, GLfloat d[][4],
  *                                   GLfloat m[16], GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_ortho)
 ALIGN
 _asm_transform_points4_ortho:
@@ -1073,7 +1077,7 @@
  * void asm_transform_points4_perspective( GLuint n, GLfloat d[][4],
  *                                         GLfloat m[16], GLfloat s[][4] );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_transform_points4_perspective)
 ALIGN
 _asm_transform_points4_perspective:
@@ -1313,7 +1317,7 @@
  *                                        GLfloat s[][4], GLubyte clipmask[],
  *                                        GLubyte *ormask, GLubyte *andmask );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_project_and_cliptest_general)
 ALIGN
 _asm_project_and_cliptest_general:
@@ -1333,7 +1337,7 @@
 	pushl %edx
 	pushl %edi
 	pushl %ecx
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 	call _asm_transform_points4_general
 #else
 	call asm_transform_points4_general
@@ -1366,7 +1370,7 @@
  *                                         GLfloat s[][4], GLubyte clipmask[],
  *                                         GLubyte *ormask, GLubyte *andmask );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_project_and_cliptest_identity)
 ALIGN
 _asm_project_and_cliptest_identity:
@@ -1384,7 +1388,7 @@
 	pushl %esi
 	pushl %edi
 	pushl %ecx
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 	call _asm_transform_points4_identity
 #else
 	call asm_transform_points4_identity
@@ -1416,7 +1420,7 @@
  *                                      GLfloat s[][4], GLubyte clipmask[],
  *                                      GLubyte *ormask, GLubyte *andmask );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_project_and_cliptest_ortho)
 ALIGN
 _asm_project_and_cliptest_ortho:
@@ -1436,7 +1440,7 @@
 	pushl %edx
 	pushl %edi
 	pushl %ecx
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 	call _asm_transform_points4_ortho
 #else
 	call asm_transform_points4_ortho
@@ -1468,7 +1472,7 @@
  *                                            GLfloat s[][4], GLubyte clipmask[],
  *                                            GLubyte *ormask, GLubyte *andmask );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_asm_project_and_cliptest_perspective)
 ALIGN
 _asm_project_and_cliptest_perspective:
@@ -1488,7 +1492,7 @@
 	pushl %edx
 	pushl %edi
 	pushl %ecx
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 	call _asm_transform_points4_perspective
 #else
 	call asm_transform_points4_perspective
@@ -1575,7 +1579,7 @@
  *                            GLfloat s[][4], GLboolean normalize,
  *                            GLboolean rescale );
  */
-#ifdef FREEBSD
+#ifdef PREPEND_UNDERSCORE
 GLOBAL(_gl_xform_normals_3fv)
 ALIGN
 _gl_xform_normals_3fv:
