Attempt to fix libGL on FreeBSD, where the library was being built without any
authorEric Anholt <anholt@FreeBSD.org>
Tue, 18 Oct 2005 23:36:40 +0000 (23:36 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Tue, 18 Oct 2005 23:36:40 +0000 (23:36 +0000)
dependencies, breaking builds of third-party software.

bin/mklib
configs/freebsd-dri

index c754373e8334dca9ca4fea8bafc8e8e2e390f0ab..77698d363019d27c8edaab89b47bba8dc384069b 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -307,11 +307,23 @@ case $ARCH in
        ;;
 
     'FreeBSD')
+       # we assume gcc
+
+       if [ "x$LINK" = "x" ] ; then
+           # -linker was not specified so set default link command now
+            if [ $CPLUSPLUS = 1 ] ; then
+                LINK=g++
+            else
+                LINK=gcc
+            fi
+       fi
+
        if [ $NOPREFIX = 1 ] ; then
            # No "lib" or ".so" part
            echo "mklib: Making FreeBSD shared library: " ${LIBNAME}
+           OPTS="-shared"
            rm -f ${LIBNAME}
-           ld -Bshareable -o ${LIBNAME} ${OBJECTS}
+           ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
            FINAL_LIBS=${LIBNAME}
         elif [ $STATIC = 1 ] ; then
            STLIB="lib${LIBNAME}.a"
@@ -321,11 +333,11 @@ case $ARCH in
            ranlib ${STLIB}
            FINAL_LIBS=${STLIB}
        else
-           SHLIB="lib${LIBNAME}.so.${MAJOR}.${MINOR}"
+           SHLIB="lib${LIBNAME}.so.${MAJOR}"
+           OPTS="-shared -Wl,-soname,${SHLIB}"
            echo "mklib: Making FreeBSD shared library: " ${SHLIB}
            rm -f ${SHLIB}
-           ld -Bshareable -o ${SHLIB} ${OBJECTS}
-           # XXX make lib${LIBNAME}.so.${MAJOR} symlink?
+           ${LINK} ${OPTS} -o ${SHLIB} ${OBJECTS} ${DEPS}
            FINAL_LIBS=${SHLIB}
        fi
        ;;
index 2096fd070c68e36aa8f3130fbb57d903ae5ef708..c7d3659e9143a9021e9361124c442ec314cc8e5e 100644 (file)
@@ -24,7 +24,7 @@ ASM_SOURCES =
 # Library/program dependencies
 LIBDRM_LIB = `pkg-config --libs libdrm` -ldrm
 DRI_LIB_DEPS = -L/usr/local/lib -lm -lpthread -lexpat $(LIBDRM_LIB)
-GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread $(LIBDRM_LIB)
+GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lm -lpthread $(LIBDRM_LIB)
 
 GLUT_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGLU -lGL -lX11 -lXmu -lXt -lXi -lm
 GLW_LIB_DEPS = -L$(LIB_DIR) -L/usr/X11R6/lib -lGL -lXt -lXm -lX11