diff options
author | Alan Coopersmith <[email protected]> | 2008-06-20 17:58:53 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-06-21 10:19:45 -0600 |
commit | e1f9adc27445ea3381af1f71cfec0317298be5b1 (patch) | |
tree | 6a150eaf2acbe07729d341c7ee8268ca7c4542fd | |
parent | f30e4af73405aad3ec29b7337a3a0177e3fbe715 (diff) |
Solaris port of Mesa 7.1 with autoconf support
Signed-off-by: Brian Paul <[email protected]>
-rwxr-xr-x | bin/mklib | 18 | ||||
-rw-r--r-- | configs/autoconf.in | 3 | ||||
-rw-r--r-- | configure.ac | 60 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/common/xmlconfig.c | 6 | ||||
-rw-r--r-- | src/mesa/main/glheader.h | 45 | ||||
-rw-r--r-- | src/mesa/main/imports.h | 1 |
7 files changed, 116 insertions, 18 deletions
diff --git a/bin/mklib b/bin/mklib index 2fb215e7d7f..0dc3135d50f 100755 --- a/bin/mklib +++ b/bin/mklib @@ -61,7 +61,8 @@ do 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' @@ -107,6 +108,9 @@ do -L*) DEPS="$DEPS $1" ;; + -R*) + DEPS="$DEPS $1" + ;; -Wl*) DEPS="$DEPS $1" ;; @@ -336,7 +340,7 @@ case $ARCH in # 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 @@ -365,9 +369,11 @@ case $ARCH in # 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} @@ -379,7 +385,7 @@ case $ARCH in ${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}" diff --git a/configs/autoconf.in b/configs/autoconf.in index 9a70ec1fabb..ed44a0f1a68 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -98,3 +98,6 @@ DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@ # Where libGL will look for DRI hardware drivers DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR) + +# Additional per-platform configuration settings +@EXTRA_CONFIG_LINES@ diff --git a/configure.ac b/configure.ac index a054330e2fa..c4b65db4ea4 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,18 @@ AC_CHECK_PROGS([MAKE], [gmake make]) 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 @@ -75,6 +87,9 @@ 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++ @@ -325,6 +340,16 @@ if test "x$enable_selinux" = "xyes"; then 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. @@ -478,7 +503,7 @@ xlib) 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 @@ -522,11 +547,11 @@ dri) 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]) @@ -671,6 +696,13 @@ if test "$mesa_driver" = dri; then 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 @@ -750,7 +782,7 @@ AC_SUBST([OSMESA_LIB]) 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 @@ -761,7 +793,7 @@ osmesa) *) # 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 @@ -769,6 +801,9 @@ osmesa) 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]) @@ -812,6 +847,9 @@ if test "x$enable_glu" = xyes; then ;; 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]) @@ -841,6 +879,7 @@ if test "x$enable_glw" = xyes; then # 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="" @@ -888,7 +927,7 @@ if test "x$enable_glut" = xyes; then # 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 @@ -914,7 +953,14 @@ dnl Only libm is added here if necessary as the libraries should 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]) diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h index 203479e3267..f126d084064 100644 --- a/src/mesa/drivers/dri/common/dri_util.h +++ b/src/mesa/drivers/dri/common/dri_util.h @@ -53,6 +53,7 @@ #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" diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c index 8602d47cf97..f6ae75520c5 100644 --- a/src/mesa/drivers/dri/common/xmlconfig.c +++ b/src/mesa/drivers/dri/common/xmlconfig.c @@ -63,6 +63,12 @@ extern char *program_invocation_name, *program_invocation_short_name; #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) diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index c6f81fdd7e6..533e4a2bd8d 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -76,6 +76,30 @@ # 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 @@ -195,6 +219,12 @@ # 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 @@ -240,12 +270,17 @@ * 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 diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h index 7ee26b423cc..00a18d3f15d 100644 --- a/src/mesa/main/imports.h +++ b/src/mesa/main/imports.h @@ -165,6 +165,7 @@ typedef union { GLfloat f; GLint i; } fi_type; 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 |