Apple: Pulled in changes from Apple's patchset to allow mesa to build on darwin again
authorJeremy Huddleston <jeremy@tifa.local>
Tue, 19 Feb 2008 08:54:35 +0000 (00:54 -0800)
committerJeremy Huddleston <jeremy@tifa.local>
Tue, 19 Feb 2008 08:55:11 +0000 (00:55 -0800)
(cherry picked from commit e70609b7b877dc0d8e67c958c453305e78f831df)

bin/mklib
configs/darwin

index b21658797a016b9256ce43ffff58a3dbb919846f..90bf834b4354976d8bb41d8c7a98a7deec06b224 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -624,19 +624,33 @@ case $ARCH in
                LIBSUFFIX="dylib"
                 OPTS="${ARCHOPT} -dynamiclib -multiply_defined suppress -current_version ${MAJOR}.${MINOR}.0 -compatibility_version ${MAJOR}.${MINOR}.0 -install_name lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
             fi
-            LINKNAME="lib${LIBNAME}.${LIBSUFFIX}"
-            LIBNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
+
+            if [ ${EXPORTS} ] ; then
+                OPTS="${OPTS} -exported_symbols_list ${EXPORTS}"
+            fi 
+
+            LINKNAME="lib${LIBNAME}.${MAJOR}.${LIBSUFFIX}"
+            LINKNAME2="lib${LIBNAME}.${LIBSUFFIX}"
+            LIBNAME="lib${LIBNAME}.${MAJOR}.${MINOR}.${LIBSUFFIX}"
 
            # examine first object to determine ABI
            set ${OBJECTS}
-           ABI_PPC=`file $1 | grep 'object ppc'`
-           ABI_I386=`file $1 | grep 'object i386'`
-           if [ "${ABI_PPC}" ] ; then
-               OPTS="${OPTS} -arch ppc"
-           fi
-           if [ "${ABI_I386}" ] ; then
-               OPTS="${OPTS} -arch i386"
-           fi
+            ABI_PPC=`file $1 | grep ' ppc'`
+            ABI_I386=`file $1 | grep ' i386'`
+            ABI_PPC64=`file $1 | grep ' ppc64'`
+            ABI_X86_64=`file $1 | grep ' x86_64'`
+            if [ "${ABI_PPC}" ] ; then
+                OPTS="${OPTS} -arch ppc"
+            fi
+            if [ "${ABI_I386}" ] ; then
+                OPTS="${OPTS} -arch i386"
+            fi
+            if [ "${ABI_PPC64}" ] ; then
+                OPTS="${OPTS} -arch ppc64"
+            fi
+            if [ "${ABI_X86_64}" ] ; then
+                OPTS="${OPTS} -arch x86_64"
+            fi
 
             if [ "${ALTOPTS}" ] ; then
                 OPTS=${ALTOPTS}
@@ -653,9 +667,11 @@ case $ARCH in
            fi
 
             echo "mklib: Making Darwin shared library: " ${LIBNAME}
+
             ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
             ln -s ${LIBNAME} ${LINKNAME}
-            FINAL_LIBS="${LIBNAME} ${LINKNAME}"
+            ln -s ${LIBNAME} ${LINKNAME2}
+            FINAL_LIBS="${LIBNAME} ${LINKNAME} ${LINKNAME2}"
         fi
         ;;
 
index 76f3f74d4e61a5f4598ba936f306b142a9e9a8e5..438abd94c1ce697ede068029604b7232bf16e42b 100644 (file)
@@ -4,11 +4,19 @@ include $(TOP)/configs/default
 
 CONFIG_NAME = darwin
 
+DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
+         -D_BSD_SOURCE -D_GNU_SOURCE \
+         -DGLX_INDIRECT_RENDERING \
+         -DPTHREADS -DGLX_ALIAS_UNSUPPORTED -DHAVE_POSIX_MEMALIGN
+
 # Compiler and flags
-CC = cc
-CXX = cc
-CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
-CXXFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin
+CC = gcc
+CXX = gcc
+CFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
+CXXFLAGS = -I/usr/X11/include -O3 -fPIC -fno-common -ffast-math -funroll-loops -fexpensive-optimizations -no-cpp-precomp -dynamic -Ddarwin $(DEFINES)
+
+CFLAGS += $(RC_CFLAGS)
+CXXFLAGS += $(RC_CFLAGS)
 
 # Work around aliasing bugs - developers should comment this out
 CFLAGS += -fno-strict-aliasing
@@ -21,13 +29,12 @@ GLUT_LIB_NAME = libglut.dylib
 GLW_LIB_NAME = libGLw.dylib
 OSMESA_LIB_NAME = libOSMesa.dylib
 
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread
+GL_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lm -lpthread
 OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
 GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL
 GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -lGL -lGLU -L/usr/X11R6/lib -lX11 -lXmu -lXi -lXext
 GLW_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXt $(TOP)/lib/GL.dylib
-APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm
+APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L/usr/X11/lib -lX11 -lXmu -lXt -lXi -lm
 
 # omit glw lib for now:
-SRC_DIRS = mesa glu glut/glx
-
+SRC_DIRS = glx/x11 glu glut/glx