Ticket #9069: configure-non-gcc-compilers.patch
File configure-non-gcc-compilers.patch, 7.6 KB (added by , 16 years ago) |
---|
-
configure
946 946 947 947 cxx_version=`( $CXX -dumpversion ) 2>&1` 948 948 if test "$?" -gt 0; then 949 cxx_version="not found" 949 # TODO: Big scary warning about unsupported Compilers 950 cxx_version=`( $CXX -version ) 2>&1` 951 if test "$?" -eq 0; then 952 cxx_version="`echo "${cxx_version}" | sed -ne 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/gp'`" 953 if test -z "${cxx_version}"; then 954 cxx_version="not found" 955 cxx_verc_fail=yes 956 fi 957 echo non-gcc compiler version ${cxx_version} 958 else 959 cxx_version="not found" 960 cxx_verc_fail=yes 961 echo fooo non-gcc compiler version ${cxx_version} 962 fi 963 else 964 add_line_to_config_mk 'HAVE_GCC = 1' 965 HAVE_GCC=1 950 966 fi 951 967 952 case $cxx_version in 953 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*) 954 _cxx_major=`echo $cxx_version | cut -d '.' -f 1` 955 _cxx_minor=`echo $cxx_version | cut -d '.' -f 2` 956 cxx_version="$cxx_version, ok" 957 cxx_verc_fail=no 958 ;; 959 # whacky beos version strings 960 2.9-beos-991026*|2.9-beos-000224*) 961 _cxx_major=2 962 _cxx_minor=95 963 cxx_version="$cxx_version, ok" 964 cxx_verc_fail=no 965 ;; 966 3_4) 967 _cxx_major=3 968 _cxx_minor=4 969 ;; 970 'not found') 971 cxx_verc_fail=yes 972 ;; 973 *) 974 cxx_version="$cxx_version, bad" 975 cxx_verc_fail=yes 976 ;; 977 esac 968 if test "$HAVE_GCC" -eq 1; then 969 case $cxx_version in 970 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9]|3.[0-9].[0-9][-.]*|4.[0-9]|4.[0-9].[0-9]|4.[0-9].[0-9][-.]*) 971 _cxx_major=`echo $cxx_version | cut -d '.' -f 1` 972 _cxx_minor=`echo $cxx_version | cut -d '.' -f 2` 973 cxx_version="$cxx_version, ok" 974 cxx_verc_fail=no 975 ;; 976 # whacky beos version strings 977 2.9-beos-991026*|2.9-beos-000224*) 978 _cxx_major=2 979 _cxx_minor=95 980 cxx_version="$cxx_version, ok" 981 cxx_verc_fail=no 982 ;; 983 3_4) 984 _cxx_major=3 985 _cxx_minor=4 986 ;; 987 'not found') 988 cxx_verc_fail=yes 989 ;; 990 *) 991 cxx_version="$cxx_version, bad" 992 cxx_verc_fail=yes 993 ;; 994 esac 995 else 996 case $_host_os in 997 irix*) 998 case $cxx_version in 999 7.4.4*) 1000 _cxx_major=7 1001 _cxx_minor=4 1002 ;; 1003 *) 1004 cxx_version="$cxx_version, bad" 1005 cxx_verc_fail=yes 1006 ;; 1007 esac 1008 ;; 1009 *) 1010 cxx_version="$cxx_version, bad" 1011 cxx_verc_fail=yes 1012 ;; 1013 esac 978 1014 1015 fi 1016 979 1017 echo "$cxx_version" 980 1018 981 1019 if test "$cxx_verc_fail" = yes ; then … … 1110 1148 ;; 1111 1149 irix*) 1112 1150 DEFINES="$DEFINES -DUNIX -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE" 1113 LIBS="$LIBS -lmd " 1151 LIBS="$LIBS -lmd -lfastm -lm" 1152 if test "$HAVE_GCC" -ne 1 ; then 1153 add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MDupdate' 1154 fi 1114 1155 _ranlib=: 1115 1156 ;; 1116 1157 darwin*) … … 2000 2041 # 2001 2042 # Do CXXFLAGS now we know the compiler version 2002 2043 # 2003 if test "$_cxx_major" -ge "3" ; then 2004 case $_host_os in 2005 # newlib-based system include files suppress non-C89 function 2006 # declarations under __STRICT_ANSI__ 2007 mingw* | dreamcast | wii | gamecube | psp | wince | amigaos*) 2008 CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter" 2009 ;; 2010 *) 2011 CXXFLAGS="$CXXFLAGS -ansi -W -Wno-unused-parameter" 2012 ;; 2013 esac 2014 add_line_to_config_mk 'HAVE_GCC3 = 1' 2015 fi; 2044 if test "$HAVE_GCC" -eq 1 ; then 2045 if test "$_cxx_major" -ge "3" ; then 2046 case $_host_os in 2047 # newlib-based system include files suppress non-C89 function 2048 # declarations under __STRICT_ANSI__ 2049 mingw* | dreamcast | wii | gamecube | psp | wince | amigaos*) 2050 CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter" 2051 ;; 2052 *) 2053 CXXFLAGS="$CXXFLAGS -ansi -W -Wno-unused-parameter" 2054 ;; 2055 esac 2056 add_line_to_config_mk 'HAVE_GCC3 = 1' 2057 fi; 2016 2058 2017 if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then 2018 CXXFLAGS="$CXXFLAGS -Wno-empty-body" 2019 else 2020 CXXFLAGS="$CXXFLAGS -Wconversion" 2059 if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then 2060 CXXFLAGS="$CXXFLAGS -Wno-empty-body" 2061 else 2062 CXXFLAGS="$CXXFLAGS -Wconversion" 2063 fi; 2021 2064 fi; 2022 2065 2023 2066 # Some platforms use certain GNU extensions in header files -
Makefile.common
73 73 $(RM_REC) $(DEPDIRS) 74 74 $(RM) $(OBJS) $(EXECUTABLE) 75 75 76 ifndef HAVE_GCC 77 INCS = config.h 78 ifdef CXX_UPDATE_DEP_FLAG 79 %.o: %.cpp 80 $(MKDIR) $(*D)/$(DEPDIR) 81 $(CXX) $(CXX_UPDATE_DEP_FLAG) "$(*D)/$(DEPDIR)/$(*F).d" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o 82 else 76 83 # Old (dumb) compile & dependcy rules 77 #INCS = scumm/scumm.h common/scummsys.h 78 #.cpp.o: 79 # $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o 80 #$(OBJS): $(INCS) 84 .cpp.o: 85 $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o 81 86 87 $(OBJS): $(INCS) 88 endif 89 endif 90 91 ifdef HAVE_GCC 82 92 ifndef HAVE_GCC3 83 # If you use GCC, disable the above and enable this for intelligent 84 # dependency tracking. 93 # If you use GCC, enable this for intelligent # dependency tracking. 85 94 %.o: %.cpp 86 95 $(MKDIR) $(*D)/$(DEPDIR) 87 96 $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o … … 100 109 $(MKDIR) $(*D)/$(DEPDIR) 101 110 $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o 102 111 endif 112 endif 103 113 104 114 ifdef HAVE_NASM 105 115 %.o: %.asm -
Makefile
19 19 20 20 # Load the make rules generated by configure 21 21 -include config.mk 22 -include Makedepend 22 23 23 CXXFLAGS:= -Wall $(CXXFLAGS) 24 # Turn off some annoying and not-so-useful warnings 25 CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder 26 # Enable even more warnings... 27 CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wcast-align 28 CXXFLAGS+= -Wshadow -Wimplicit -Wnon-virtual-dtor -Wwrite-strings 24 ifeq "$(HAVE_GCC)" "1" 25 CXXFLAGS:= -Wall $(CXXFLAGS) 26 # Turn off some annoying and not-so-useful warnings 27 CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder 28 # Enable even more warnings... 29 CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wcast-align 30 CXXFLAGS+= -Wshadow -Wimplicit -Wnon-virtual-dtor -Wwrite-strings 29 31 30 # Currently we disable this gcc flag, since it will also warn in cases,31 # where using GCC_PRINTF (means: __attribute__((format(printf, x, y))))32 # is not possible, thus it would fail compiliation with -Werror without33 # being helpful.34 #CXXFLAGS+= -Wmissing-format-attribute32 # Currently we disable this gcc flag, since it will also warn in cases, 33 # where using GCC_PRINTF (means: __attribute__((format(printf, x, y)))) 34 # is not possible, thus it would fail compiliation with -Werror without 35 # being helpful. 36 #CXXFLAGS+= -Wmissing-format-attribute 35 37 36 # Disable RTTI and exceptions, and enabled checking of pointers returned by "new"37 CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new38 # Disable RTTI and exceptions, and enabled checking of pointers returned by "new" 39 CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new 38 40 39 # There is a nice extra warning that flags variables that are potentially 40 # used before being initialized. Very handy to catch a certain kind of 41 # bugs. Unfortunately, it only works when optimizations are turned on, 42 # which is why we normally don't use it. 43 #CXXFLAGS+= -O -Wuninitialized 41 # There is a nice extra warning that flags variables that are potentially 42 # used before being initialized. Very handy to catch a certain kind of 43 # bugs. Unfortunately, it only works when optimizations are turned on, 44 # which is why we normally don't use it. 45 #CXXFLAGS+= -O -Wuninitialized 46 endif 44 47 45 48 ####################################################################### 46 49 # Default commands - put the necessary replacements in config.mk #