echo ' -minor N specifies minor version number (default is 0)'
echo ' -patch N specifies patch version number (default is 0)'
echo ' -lLIBRARY specifies a dependency on LIBRARY'
- echo ' -LDIR search in DIR for library dependencies'
+ echo ' -LDIR search in DIR for library dependencies at build time'
+ echo ' -RDIR search in DIR for library dependencies at run time'
echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)'
echo ' Not observed on all systems at this time.'
echo ' -ldflags OPT specify any additional linker flags in OPT'
-L*)
DEPS="$DEPS $1"
;;
+ -R*)
+ DEPS="$DEPS $1"
+ ;;
-Wl*)
DEPS="$DEPS $1"
;;
# use g++
LINK="g++"
else
- echo "mklib: warning: can't find C++ comiler, trying CC."
+ echo "mklib: warning: can't find C++ compiler, trying CC."
LINK="CC"
fi
else
# Check if objects are SPARC v9
# file says: ELF 64-bit MSB relocatable SPARCV9 Version 1
set ${OBJECTS}
- SPARCV9=`file $1 | grep SPARCV9`
- if [ "${SPARCV9}" ] ; then
- OPTS="${OPTS} -xarch=v9"
+ if [ ${LINK} = "cc" -o ${LINK} = "CC" ] ; then
+ SPARCV9=`file $1 | grep SPARCV9`
+ if [ "${SPARCV9}" ] ; then
+ OPTS="${OPTS} -xarch=v9"
+ fi
fi
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
else
rm -f ${LIBNAME}.${MAJOR} ${LIBNAME}
- ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
+ ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME}.${MAJOR} -h ${LIBNAME}.${MAJOR} ${OBJECTS} ${DEPS}
ln -s ${LIBNAME}.${MAJOR} ${LIBNAME}
fi
FINAL_LIBS="${LIBNAME}.${MAJOR} ${LIBNAME}"
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
+
+# Additional per-platform configuration settings
+@EXTRA_CONFIG_LINES@
AC_PATH_PROG([MKDEP], [makedepend])
AC_PATH_PROG([SED], [sed])
+dnl Platform-specific program settings
+EXTRA_CONFIG_LINES=""
+AC_SUBST([EXTRA_CONFIG_LINES])
+case "$host_os" in
+solaris*)
+ # Solaris /bin/sh is too old/non-POSIX compliant
+ AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
+ EXTRA_CONFIG_LINES="SHELL=$POSIX_SHELL"
+ ;;
+esac
+
+
MKDEP_OPTIONS=-fdepend
dnl Ask gcc where it's keeping its secret headers
if test "x$GCC" = xyes; then
fi
DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN"
;;
+solaris*)
+ DEFINES="$DEFINES -DPTHREADS -DSVR4"
+ ;;
esac
dnl Add flags for gcc and g++
DEFINES="$DEFINES -DMESA_SELINUX"
fi
+dnl OS-specific libraries
+OS_LIBS=""
+case "$host_os" in
+solaris*)
+ OS_LIBS="-lc"
+ if test "x$GXX" != xyes; then
+ OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
+ fi
+ ;;
+esac
dnl
dnl Driver configuration. Options are xlib, dri and osmesa right now.
X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
fi
- GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
+ GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
# if static, move the external libraries to the programs
# and empty the libraries for libGL
fi
# need DRM libs, -lpthread, etc.
- GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
+ GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
;;
osmesa)
# No libGL for osmesa
- GL_LIB_DEPS=""
+ GL_LIB_DEPS="$OS_LIBS"
;;
esac
AC_SUBST([GL_LIB_DEPS])
unichrome savage sis swrast"
fi
;;
+ solaris*)
+ DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
+ DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
+ if test "x$driglx_direct" = xyes; then
+ DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
+ fi
+ ;;
esac
# default drivers
case "$mesa_driver" in
osmesa)
- # only link librararies with osmesa if shared
+ # only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
else
*)
# Link OSMesa to libGL otherwise
OSMESA_LIB_DEPS=""
- # only link librararies with osmesa if shared
+ # only link libraries with osmesa if shared
if test "$enable_static" = no; then
OSMESA_MESA_DEPS='-l$(GL_LIB)'
else
fi
;;
esac
+if test "$enable_static" = no; then
+ OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
+fi
AC_SUBST([OSMESA_LIB_DEPS])
AC_SUBST([OSMESA_MESA_DEPS])
;;
esac
fi
+if test "$enable_static" = no; then
+ GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
+fi
AC_SUBST([GLU_LIB_DEPS])
AC_SUBST([GLU_MESA_DEPS])
# If static, empty GLW_LIB_DEPS and add libs for programs to link
if test "$enable_static" = no; then
GLW_MESA_DEPS='-l$(GL_LIB)'
+ GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
else
APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
GLW_LIB_DEPS=""
# should check these...
GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
fi
- GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
+ GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
# If glut is available, we can build most programs
if test "$with_demos" = yes; then
dnl be pulled in by the linker
dnl
if test "x$APP_LIB_DEPS" = x; then
- APP_LIB_DEPS="-lm"
+ case "$host_os" in
+ solaris*)
+ APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
+ ;;
+ *)
+ APP_LIB_DEPS="-lm"
+ ;;
+ esac
fi
AC_SUBST([APP_LIB_DEPS])
AC_SUBST([PROGRAM_DIRS])
#include <drm.h>
#include <drm_sarea.h>
#include <xf86drm.h>
+#include "glheader.h"
#include "GL/internal/glcore.h"
#include "GL/internal/dri_interface.h"
#include "GL/internal/dri_sarea.h"
#elif defined(__NetBSD__) && defined(__NetBSD_Version) && (__NetBSD_Version >= 106000100)
# include <stdlib.h>
# define GET_PROGRAM_NAME() getprogname()
+#elif defined(__sun)
+/* Solaris has getexecname() which returns the full path - return just
+ the basename to match BSD getprogname() */
+# include <stdlib.h>
+# include <libgen.h>
+# define GET_PROGRAM_NAME() basename(getexecname())
#endif
#if !defined(GET_PROGRAM_NAME)
# include <inttypes.h>
#endif
+/* For platforms that have the C99 standard uint*_t,
+ but not the commonly used u_int*_t */
+#if defined(__sun)
+# define u_int8_t uint8_t
+# define u_int16_t uint16_t
+# define u_int32_t uint32_t
+# define u_int64_t uint64_t
+# define u_intptr_t uintptr_t
+#endif
+
+/* Sun compilers define __i386 instead of the gcc-style __i386__ */
+#ifdef __SUNPRO_C
+# if !defined(__i386__) && defined(__i386)
+# define __i386__
+# elif !defined(__amd64__) && defined(__amd64)
+# define __amd64__
+# elif !defined(__sparc__) && defined(__sparc)
+# define __sparc__
+# endif
+# if !defined(__volatile)
+# define __volatile volatile
+# endif
+#endif
+
#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP)
# define __WIN32__
# define finite _finite
# define INLINE inline
#elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
# define INLINE __inline
+#elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
+# define INLINE inline
+# define __inline inline
+# define __inline__ inline
+#elif (__STDC_VERSION__ >= 199901L) /* C99 */
+# define INLINE inline
#else
# define INLINE
#endif
* If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
* Don't define it if using a newer Windows compiler.
*/
-#if defined(__VMS)
-# define __FUNCTION__ "VMS$NL:"
-#elif __STDC_VERSION__ < 199901L
-# if ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
+#ifndef __FUNCTION__
+# if defined(__VMS)
+# define __FUNCTION__ "VMS$NL:"
+# elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
(!defined(_MSC_VER) || _MSC_VER < 1300)
-# define __FUNCTION__ "<unknown>"
+# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
+ (defined(__SUNPRO_C) && defined(__C99FEATURES__))
+# define __FUNCTION__ __func__
+# else
+# define __FUNCTION__ "<unknown>"
+# endif
# endif
#endif
defined(__mips) || defined(_MIPS_ARCH) || \
defined(__arm__) || \
defined(__sh__) || defined(__m32r__) || \
+ (defined(__sun) && defined(_IEEE_754)) || \
(defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
#define USE_IEEE
#define IEEE_ONE 0x3f800000