automake: src/mesa/drivers/osmesa
[mesa.git] / configure.ac
index 507cfff768059bdb36b61cf6e96fccce83115f3a..948179877130a713b8e37c3cb2a51d51f8bfe246 100644 (file)
@@ -97,13 +97,13 @@ AC_COMPILE_IFELSE(
        not clang
 #endif
 ]])],
-[CLANG=yes], [CLANG=no])
+[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
 
-AC_MSG_RESULT([$CLANG])
+AC_MSG_RESULT([$acv_mesa_CLANG])
 
 dnl If we're using GCC, make sure that it is at least version 3.3.0.  Older
 dnl versions are explictly not supported.
-if test "x$GCC" = xyes -a "x$CLANG" = xno; then
+if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
     AC_MSG_CHECKING([whether gcc version is sufficient])
     major=0
     minor=0
@@ -176,7 +176,20 @@ esac
 
 dnl Add flags for gcc and g++
 if test "x$GCC" = xyes; then
-    CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
+    CFLAGS="$CFLAGS -Wall -std=c99"
+
+    # Enable -Werror=implicit-function-declaration and
+    # -Werror=missing-prototypes, if available, or otherwise, just
+    # -Wmissing-prototypes.  This is particularly useful to avoid
+    # generating a loadable driver module that has undefined symbols.
+    save_CFLAGS="$CFLAGS"
+    AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
+    CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
+    CFLAGS="$CFLAGS -Werror=missing-prototypes"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM()],
+                  AC_MSG_RESULT([yes]),
+                  [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
+                   AC_MSG_RESULT([no])]);
 
     # Enable -fvisibility=hidden if using a gcc that supports it
     save_CFLAGS="$CFLAGS"
@@ -286,6 +299,8 @@ xnono )
     enable_static=yes
     ;;
 esac
+AM_CONDITIONAL(BUILD_STATIC, test "x$enable_static" = xyes)
+AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
 
 dnl
 dnl mklib options
@@ -1318,6 +1333,9 @@ x16|x32)
     AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
     ;;
 esac
+AM_CONDITIONAL(HAVE_OSMESA8, test "x$osmesa_bits" = x8)
+AM_CONDITIONAL(HAVE_OSMESA16, test "x$osmesa_bits" = x16)
+AM_CONDITIONAL(HAVE_OSMESA32, test "x$osmesa_bits" = x32)
 
 if test "x$enable_osmesa" = xyes; then
     # only link libraries with osmesa if shared
@@ -1326,12 +1344,9 @@ if test "x$enable_osmesa" = xyes; then
     else
         OSMESA_LIB_DEPS=""
     fi
-    OSMESA_MESA_DEPS=""
     OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
 fi
 AC_SUBST([OSMESA_LIB_DEPS])
-AC_SUBST([OSMESA_MESA_DEPS])
-AC_SUBST([OSMESA_PC_REQ])
 AC_SUBST([OSMESA_PC_LIB_PRIV])
 
 dnl
@@ -1747,7 +1762,7 @@ if test "x$enable_gallium_llvm" = xyes; then
     if test "x$LLVM_CONFIG" != xno; then
        LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
        LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g'`
-       LLVM_LIBS="`$LLVM_CONFIG --libs`"
+       LLVM_LIBS="`$LLVM_CONFIG --libs engine bitwriter`"
 
        LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
        DEFINES="$DEFINES -D__STDC_CONSTANT_MACROS"
@@ -1916,6 +1931,8 @@ AC_CONFIG_FILES([configs/autoconf
                src/mesa/drivers/dri/r200/Makefile
                src/mesa/drivers/dri/radeon/Makefile
                src/mesa/drivers/dri/swrast/Makefile
+               src/mesa/drivers/osmesa/osmesa.pc
+               src/mesa/drivers/osmesa/Makefile
                tests/Makefile
                tests/glx/Makefile])