Bug 377344 - Configure should check for PR_STATIC_ASSERT support when building with system NSPR. Patch by Mook <mook.moz+mozbz@gmail.com>, r=benjamin.
authorkherron@fmailbox.com
Sun, 17 Jun 2007 04:45:58 -0700
changeset 2496 ad7e532a4a9c07b36592aceee7432badc750236f
parent 2495 fb8f33bdeced5ab16099295a1533870ae8a1bd3e
child 2497 4e7f820cff5fd964a3e17dcd286800e3eb100352
push idunknown
push userunknown
push dateunknown
reviewersbenjamin
bugs377344
milestone1.9a6pre
Bug 377344 - Configure should check for PR_STATIC_ASSERT support when building with system NSPR. Patch by Mook <mook.moz+mozbz@gmail.com>, r=benjamin.
configure.in
--- a/configure.in
+++ b/configure.in
@@ -3827,17 +3827,27 @@ dnl ====================================
 MOZ_ARG_WITH_BOOL(system-nspr,
 [  --with-system-nspr      Use system installed NSPR],
     _USE_SYSTEM_NSPR=1 )
 
 if test -n "$_USE_SYSTEM_NSPR"; then
     AM_PATH_NSPR(4.0.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
 fi
 
-if test -z "$MOZ_NATIVE_NSPR"; then
+if test -n "$MOZ_NATIVE_NSPR"; then
+    _SAVE_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $NSPR_CFLAGS"
+    AC_TRY_COMPILE([#include "prlog.h"],
+                [#ifndef PR_STATIC_ASSERT
+                 #error PR_STATIC_ASSERT not defined
+                 #endif],
+                [MOZ_NATIVE_NSPR=1],
+                AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
+    CFLAGS=$_SAVE_CFLAGS
+else
     NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix=$(LIBXUL_DIST) --includedir=$(LIBXUL_DIST)/include/nspr --cflags`'
     # explicitly set libs for Visual Age C++ for OS/2
     if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
         NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '$_PTHREAD_LDFLAGS''
     elif test "$OS_ARCH" = "WINCE"; then
         NSPR_CFLAGS='-I$(LIBXUL_DIST)/include/nspr'
         NSPR_LIBS='$(LIBXUL_DIST)/lib/nspr'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plc'$NSPR_VERSION'.lib $(LIBXUL_DIST)/lib/plds'$NSPR_VERSION'.lib '
     elif test "$OS_ARCH" = "WINNT"; then