Use the proper flags when building with --enable-debug --enable-optimize.

Thanks to Wan-Teh Chang <wchang0222@aol.com> for the patch.
Bug #243079 r=cls
This commit is contained in:
cls%seawood.org 2004-05-20 20:21:33 +00:00
parent 2a6c0e1d79
commit 7a3c76a1bd
2 changed files with 55 additions and 63 deletions

View File

@ -3925,6 +3925,18 @@ EOF
DLL_SUFFIX=dll
CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
DLLFLAGS='-OUT:"$@"'
_DEBUG_FLAGS=-Z7
_OPTIMIZE_FLAGS=-O2
if test -z "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS -Od"
fi
if test -n "$USE_DEBUG_RTL"; then
CFLAGS="$CFLAGS -MDd"
else
CFLAGS="$CFLAGS -MD"
fi
if test -n "$MOZ_DEBUG"; then
cat >> confdefs.h <<\EOF
@ -3936,32 +3948,16 @@ EOF
fi
if test -n "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS -MD"
_OPTIMIZE_FLAGS=-O2
DLLFLAGS='-OUT:"$@"'
if test -n "$MOZ_PROFILE"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
fi
else
if test -n "$USE_DEBUG_RTL"; then
CFLAGS="$CFLAGS -MDd"
else
CFLAGS="$CFLAGS -MD"
fi
_DEBUG_FLAGS="-Od -Z7"
DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"'
if test -n "$GLOWCODE"; then
DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"'
DLL_LIBS='$(GLOWDIR)/glowcode.lib'
fi
LDFLAGS="-DEBUG -DEBUGTYPE:CV"
if test -n "$PROFILE"; then
LDFLAGS="$LDFLAGS -PROFILE -MAP"
DLLFLAGS="$DLLFLAGS -PROFILE -MAP"
fi
fi
if test -n "$MOZ_DEBUG"; then
DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
fi
if test "$OS_TARGET" = "WINNT"; then
@ -4428,17 +4424,17 @@ EOF
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
echo "configure:4432: checking for machine/builtins.h" >&5
echo "configure:4428: checking for machine/builtins.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4437 "configure"
#line 4433 "configure"
#include "confdefs.h"
#include <machine/builtins.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -4836,12 +4832,12 @@ esac
if test -z "$SKIP_LIBRARY_CHECKS"; then
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:4840: checking for dlopen" >&5
echo "configure:4836: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4845 "configure"
#line 4841 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@ -4864,7 +4860,7 @@ dlopen();
; return 0; }
EOF
if { (eval echo configure:4868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@ -4883,7 +4879,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:4887: checking for dlopen in -ldl" >&5
echo "configure:4883: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -4891,7 +4887,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4895 "configure"
#line 4891 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -4902,7 +4898,7 @@ int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:4906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -4930,13 +4926,13 @@ fi
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
echo "configure:4934: checking whether ${CC-cc} needs -traditional" >&5
echo "configure:4930: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
#line 4940 "configure"
#line 4936 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@ -4954,7 +4950,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
#line 4958 "configure"
#line 4954 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@ -4978,12 +4974,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4982: checking for $ac_func" >&5
echo "configure:4978: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4987 "configure"
#line 4983 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -5006,7 +5002,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:5010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:5006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -5044,7 +5040,7 @@ fi
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
echo "configure:5048: checking for pthread_create in -lpthreads" >&5
echo "configure:5044: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@ -5066,7 +5062,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
echo "configure:5070: checking for pthread_create in -lpthread" >&5
echo "configure:5066: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@ -5088,7 +5084,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
echo "configure:5092: checking for pthread_create in -lc_r" >&5
echo "configure:5088: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@ -5110,7 +5106,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
echo "configure:5114: checking for pthread_create in -lc" >&5
echo "configure:5110: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
@ -5260,7 +5256,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest*
ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
echo "configure:5264: checking whether ${CC-cc} accepts -pthread" >&5
echo "configure:5260: checking whether ${CC-cc} accepts -pthread" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
@ -5276,7 +5272,7 @@ echo "configure:5264: checking whether ${CC-cc} accepts -pthread" >&5
ac_cv_have_dash_pthreads=no
if test "$ac_cv_have_dash_pthread" = "no"; then
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
echo "configure:5280: checking whether ${CC-cc} accepts -pthreads" >&5
echo "configure:5276: checking whether ${CC-cc} accepts -pthreads" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then

View File

@ -1223,6 +1223,18 @@ case "$target" in
DLL_SUFFIX=dll
CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
DLLFLAGS='-OUT:"$@"'
_DEBUG_FLAGS=-Z7
_OPTIMIZE_FLAGS=-O2
if test -z "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS -Od"
fi
if test -n "$USE_DEBUG_RTL"; then
CFLAGS="$CFLAGS -MDd"
else
CFLAGS="$CFLAGS -MD"
fi
if test -n "$MOZ_DEBUG"; then
AC_DEFINE(_DEBUG)
@ -1231,32 +1243,16 @@ case "$target" in
fi
if test -n "$MOZ_OPTIMIZE"; then
CFLAGS="$CFLAGS -MD"
_OPTIMIZE_FLAGS=-O2
DLLFLAGS='-OUT:"$@"'
if test -n "$MOZ_PROFILE"; then
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
fi
else
if test -n "$USE_DEBUG_RTL"; then
CFLAGS="$CFLAGS -MDd"
else
CFLAGS="$CFLAGS -MD"
fi
_DEBUG_FLAGS="-Od -Z7"
DLLFLAGS='-DEBUG -DEBUGTYPE:CV -OUT:"$@"'
if test -n "$GLOWCODE"; then
DLLFLAGS='-DEBUG -DEBUGTYPE:both -INCLUDE:_GlowCode -OUT:"$@"'
DLL_LIBS='$(GLOWDIR)/glowcode.lib'
fi
LDFLAGS="-DEBUG -DEBUGTYPE:CV"
if test -n "$PROFILE"; then
LDFLAGS="$LDFLAGS -PROFILE -MAP"
DLLFLAGS="$DLLFLAGS -PROFILE -MAP"
fi
fi
if test -n "$MOZ_DEBUG"; then
DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
fi
if test "$OS_TARGET" = "WINNT"; then