diff options
author | wchang0222%aol.com <devnull@localhost> | 2004-07-20 00:29:27 +0000 |
---|---|---|
committer | wchang0222%aol.com <devnull@localhost> | 2004-07-20 00:29:27 +0000 |
commit | c099a7f8df00d4ab9ac5c94305d71738ed3ff6bb (patch) | |
tree | fcee9c848341367020460bac80b9bc4b2a654371 | |
parent | e294a02d82df2035234a985d67ea7d988b6b94ad (diff) | |
download | nspr-hg-AOL_NSPR_4_4_1_BRANCH.tar.gz |
Carried over the fixes for Bugzilla bug 242741 to AOL_NSPR_4_4_1_BRANCH soAOL_NSPR_4_4_1_BRANCH
we can build NSPR with MSVC 7.1 without warnings.
Modified Files: configure configure.in autoconf.mk.in rules.mk
-rw-r--r-- | config/autoconf.mk.in | 1 | ||||
-rw-r--r-- | config/rules.mk | 25 | ||||
-rwxr-xr-x | configure | 57 | ||||
-rw-r--r-- | configure.in | 12 |
4 files changed, 59 insertions, 36 deletions
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index a83ac501..92800154 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -56,6 +56,7 @@ CC = @CC@ CCC = @CXX@ NS_USE_GCC = @GNU_CC@ GCC_USE_GNU_LD = @GCC_USE_GNU_LD@ +MSC_VER = @MSC_VER@ AR = @AR@ AR_FLAGS = @AR_FLAGS@ LD = @LD@ diff --git a/config/rules.mk b/config/rules.mk index 6aad726e..0f28033d 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -109,10 +109,12 @@ ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET))) LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb else LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) +SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb endif else @@ -132,6 +134,13 @@ endif ifndef TARGETS ifeq (,$(filter-out WINNT OS2,$(OS_ARCH))) TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) +ifndef BUILD_OPT +ifdef MSC_VER +ifneq ($(MSC_VER),1200) +TARGETS += $(SHARED_LIB_PDB) +endif +endif +endif else TARGETS = $(LIBRARY) $(SHARED_LIBRARY) endif @@ -148,10 +157,6 @@ OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \ $(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX))) endif -ifeq ($(OS_ARCH), WINNT) -OBJS += $(RES) -endif - ifeq ($(MOZ_OS2_TOOLS),VACPP) EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS)) endif @@ -316,7 +321,7 @@ $(IMPORT_LIBRARY): $(MAPFILE) $(IMPLIB) $@ $(MAPFILE) endif -$(SHARED_LIBRARY): $(OBJS) $(MAPFILE) +$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE) @$(MAKE_OBJDIR) rm -f $@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) @@ -329,7 +334,7 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) else # AIX 4.1 ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) - $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) + $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES) else ifeq ($(MOZ_OS2_TOOLS),VACPP) $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE) @@ -342,7 +347,7 @@ ifeq ($(OS_TARGET), OpenVMS) fi; \ fi endif # OpenVMS - $(MKSHLIB) $(OBJS) $(EXTRA_LIBS) + $(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS) endif # OS2 vacpp endif # WINNT endif # AIX 4.1 @@ -350,19 +355,15 @@ ifdef ENABLE_STRIP $(STRIP) $@ endif -ifeq (,$(filter-out WINNT OS2,$(OS_ARCH))) +ifeq ($(OS_ARCH),WINNT) $(RES): $(RESNAME) @$(MAKE_OBJDIR) -ifeq ($(OS_TARGET),OS2) - $(RC) -DOS2 -r $< $@ -else # The resource compiler does not understand the -U option. ifdef NS_USE_GCC $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $< else $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $< endif # GCC -endif @echo $(RES) finished endif @@ -3772,6 +3772,12 @@ EOF OBJ_SUFFIX=obj LIB_SUFFIX=lib DLL_SUFFIX=dll + + # Determine compiler version + CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'` + _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'` + _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'` + MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION} CFLAGS="$CFLAGS -W3 -nologo -GF -Gy" @@ -3861,7 +3867,10 @@ EOF OBJDIR_SUFFIX=OBJD fi - OS_DLLFLAGS='-nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE' + OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS" + if test "$MSC_VER" = "1200"; then + OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE" + fi case "$OS_TARGET" in WINNT) @@ -4198,17 +4207,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4202: checking for machine/builtins.h" >&5 +echo "configure:4211: 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 4207 "configure" +#line 4216 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4221: \"$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* @@ -4727,7 +4736,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4731: checking for dlopen in -ldl" >&5 +echo "configure:4740: 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 @@ -4735,7 +4744,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4739 "configure" +#line 4748 "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 @@ -4746,7 +4755,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4759: \"$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 @@ -4763,17 +4772,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:4767: checking for dlfcn.h" >&5 +echo "configure:4776: checking for dlfcn.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 4772 "configure" +#line 4781 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4786: \"$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* @@ -4806,13 +4815,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:4810: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:4819: 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 4816 "configure" +#line 4825 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -4830,7 +4839,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 4834 "configure" +#line 4843 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -4854,12 +4863,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4858: checking for $ac_func" >&5 +echo "configure:4867: 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 4863 "configure" +#line 4872 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -4882,7 +4891,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4895: \"$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 @@ -4921,7 +4930,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:4925: checking for +Olit support" >&5 +echo "configure:4934: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4955,7 +4964,7 @@ esac echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:4959: checking for pthread_create in -lpthreads" >&5 +echo "configure:4968: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4977,7 +4986,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4981: checking for pthread_create in -lpthread" >&5 +echo "configure:4990: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -4999,7 +5008,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5003: checking for pthread_create in -lc_r" >&5 +echo "configure:5012: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5021,7 +5030,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5025: checking for pthread_create in -lc" >&5 +echo "configure:5034: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5173,7 +5182,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:5177: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5186: 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 @@ -5196,7 +5205,7 @@ echo "configure:5177: 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:5200: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5209: 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 @@ -5589,6 +5598,7 @@ esac + MAKEFILES=" Makefile config/Makefile @@ -5818,6 +5828,7 @@ s%@MOZILLA_CLIENT@%$MOZILLA_CLIENT%g s%@HOST_CFLAGS@%$HOST_CFLAGS%g s%@GNU_CC@%$GNU_CC%g s%@GCC_USE_GNU_LD@%$GCC_USE_GNU_LD%g +s%@MSC_VER@%$MSC_VER%g s%@CROSS_COMPILE@%$CROSS_COMPILE%g s%@MOZ_OPTIMIZE@%$MOZ_OPTIMIZE%g s%@USE_CPLUS@%$USE_CPLUS%g diff --git a/configure.in b/configure.in index 7128007b..cdd26888 100644 --- a/configure.in +++ b/configure.in @@ -1255,6 +1255,12 @@ case "$target" in OBJ_SUFFIX=obj LIB_SUFFIX=lib DLL_SUFFIX=dll + + # Determine compiler version + CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'` + _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'` + _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'` + MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION} CFLAGS="$CFLAGS -W3 -nologo -GF -Gy" @@ -1329,7 +1335,10 @@ case "$target" in OBJDIR_SUFFIX=OBJD fi - OS_DLLFLAGS='-nologo -DLL -SUBSYSTEM:WINDOWS -PDB:NONE' + OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS" + if test "$MSC_VER" = "1200"; then + OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE" + fi case "$OS_TARGET" in WINNT) @@ -2380,6 +2389,7 @@ AC_SUBST(HOST_CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(GNU_CC) AC_SUBST(GCC_USE_GNU_LD) +AC_SUBST(MSC_VER) AC_SUBST(CROSS_COMPILE) AC_SUBST(MOZ_OPTIMIZE) |