Solaris linker throws error if a mapfile references an undefined
symbol, such as is found when building glu with both mangled and
unmangled names in exports table but only one set of symbol names
defined in objects.

Signed-off-by: Alan Coopersmith <[email protected]>
---
 src/glu/sgi/Makefile       |    7 ++-
 src/glu/sgi/glu.exports    |  118 --------------------------------------------
 src/glu/sgi/glu.exports.in |   63 +++++++++++++++++++++++
 3 files changed, 69 insertions(+), 119 deletions(-)
 delete mode 100644 src/glu/sgi/glu.exports
 create mode 100644 src/glu/sgi/glu.exports.in

diff --git a/src/glu/sgi/Makefile b/src/glu/sgi/Makefile
index 20c3bed..a14e795 100644
--- a/src/glu/sgi/Makefile
+++ b/src/glu/sgi/Makefile
@@ -134,8 +134,13 @@ default:
 $(TOP)/$(LIB_DIR):
        -mkdir $(TOP)/$(LIB_DIR)
 
+# Make the exports file with the mangled or unmangled names per $CFLAGS
+glu.exports: glu.exports.in
+       $(CC) -E -I $(TOP)/include/GL $(CFLAGS) $< | \
+               awk '/^[^#]+/ {print}' > $@
+
 # Make the library:
-$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS)
+$(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME): $(OBJECTS) glu.exports
        $(MKLIB) -o $(GLU_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
                -major $(GLU_MAJOR) -minor $(GLU_MINOR) -patch $(GLU_TINY) \
                -cplusplus $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
diff --git a/src/glu/sgi/glu.exports b/src/glu/sgi/glu.exports
deleted file mode 100644
index aeb7272..0000000
--- a/src/glu/sgi/glu.exports
+++ /dev/null
@@ -1,118 +0,0 @@
-       gluBeginCurve
-       gluBeginPolygon
-       gluBeginSurface
-       gluBeginTrim
-       gluBuild1DMipmapLevels
-       gluBuild1DMipmaps
-       gluBuild2DMipmapLevels
-       gluBuild2DMipmaps
-       gluBuild3DMipmapLevels
-       gluBuild3DMipmaps
-       gluCheckExtension
-       gluCylinder
-       gluDeleteNurbsRenderer
-       gluDeleteQuadric
-       gluDeleteTess
-       gluDisk
-       gluEndCurve
-       gluEndPolygon
-       gluEndSurface
-       gluEndTrim
-       gluErrorString
-       gluGetNurbsProperty
-       gluGetString
-       gluGetTessProperty
-       gluLoadSamplingMatrices
-       gluLookAt
-       gluNewNurbsRenderer
-       gluNewQuadric
-       gluNewTess
-       gluNextContour
-       gluNurbsCallback
-       gluNurbsCallbackData
-       gluNurbsCallbackDataEXT
-       gluNurbsCurve
-       gluNurbsProperty
-       gluNurbsSurface
-       gluOrtho2D
-       gluPartialDisk
-       gluPerspective
-       gluPickMatrix
-       gluProject
-       gluPwlCurve
-       gluQuadricCallback
-       gluQuadricDrawStyle
-       gluQuadricNormals
-       gluQuadricOrientation
-       gluQuadricTexture
-       gluScaleImage
-       gluSphere
-       gluTessBeginContour
-       gluTessBeginPolygon
-       gluTessCallback
-       gluTessEndContour
-       gluTessEndPolygon
-       gluTessNormal
-       gluTessProperty
-       gluTessVertex
-       gluUnProject
-       gluUnProject4
-       mgluBeginCurve
-       mgluBeginPolygon
-       mgluBeginSurface
-       mgluBeginTrim
-       mgluBuild1DMipmapLevels
-       mgluBuild1DMipmaps
-       mgluBuild2DMipmapLevels
-       mgluBuild2DMipmaps
-       mgluBuild3DMipmapLevels
-       mgluBuild3DMipmaps
-       mgluCheckExtension
-       mgluCylinder
-       mgluDeleteNurbsRenderer
-       mgluDeleteQuadric
-       mgluDeleteTess
-       mgluDisk
-       mgluEndCurve
-       mgluEndPolygon
-       mgluEndSurface
-       mgluEndTrim
-       mgluErrorString
-       mgluGetNurbsProperty
-       mgluGetString
-       mgluGetTessProperty
-       mgluLoadSamplingMatrices
-       mgluLookAt
-       mgluNewNurbsRenderer
-       mgluNewQuadric
-       mgluNewTess
-       mgluNextContour
-       mgluNurbsCallback
-       mgluNurbsCallbackData
-       mgluNurbsCallbackDataEXT
-       mgluNurbsCurve
-       mgluNurbsProperty
-       mgluNurbsSurface
-       mgluOrtho2D
-       mgluPartialDisk
-       mgluPerspective
-       mgluPickMatrix
-       mgluProject
-       mgluPwlCurve
-       mgluQuadricCallback
-       mgluQuadricDrawStyle
-       mgluQuadricNormals
-       mgluQuadricOrientation
-       mgluQuadricTexture
-       mgluScaleImage
-       mgluSphere
-       mgluTessBeginContour
-       mgluTessBeginPolygon
-       mgluTessCallback
-       mgluTessEndContour
-       mgluTessEndPolygon
-       mgluTessNormal
-       mgluTessProperty
-       mgluTessVertex
-       mgluUnProject
-       mgluUnProject4
diff --git a/src/glu/sgi/glu.exports.in b/src/glu/sgi/glu.exports.in
new file mode 100644
index 0000000..3e2661e
--- /dev/null
+++ b/src/glu/sgi/glu.exports.in
@@ -0,0 +1,63 @@
+#if defined(USE_MGL_NAMESPACE)
+# include "glu_mangle.h" /* mangle function names if needed */
+#endif
+
+       gluBeginCurve
+       gluBeginPolygon
+       gluBeginSurface
+       gluBeginTrim
+       gluBuild1DMipmapLevels
+       gluBuild1DMipmaps
+       gluBuild2DMipmapLevels
+       gluBuild2DMipmaps
+       gluBuild3DMipmapLevels
+       gluBuild3DMipmaps
+       gluCheckExtension
+       gluCylinder
+       gluDeleteNurbsRenderer
+       gluDeleteQuadric
+       gluDeleteTess
+       gluDisk
+       gluEndCurve
+       gluEndPolygon
+       gluEndSurface
+       gluEndTrim
+       gluErrorString
+       gluGetNurbsProperty
+       gluGetString
+       gluGetTessProperty
+       gluLoadSamplingMatrices
+       gluLookAt
+       gluNewNurbsRenderer
+       gluNewQuadric
+       gluNewTess
+       gluNextContour
+       gluNurbsCallback
+       gluNurbsCallbackData
+       gluNurbsCallbackDataEXT
+       gluNurbsCurve
+       gluNurbsProperty
+       gluNurbsSurface
+       gluOrtho2D
+       gluPartialDisk
+       gluPerspective
+       gluPickMatrix
+       gluProject
+       gluPwlCurve
+       gluQuadricCallback
+       gluQuadricDrawStyle
+       gluQuadricNormals
+       gluQuadricOrientation
+       gluQuadricTexture
+       gluScaleImage
+       gluSphere
+       gluTessBeginContour
+       gluTessBeginPolygon
+       gluTessCallback
+       gluTessEndContour
+       gluTessEndPolygon
+       gluTessNormal
+       gluTessProperty
+       gluTessVertex
+       gluUnProject
+       gluUnProject4
-- 
1.5.6.5


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to