config.lib
changeset 8657 6e9eee9ac980
parent 8643 3955107ec162
child 8740 90448f0ed4bd
equal deleted inserted replaced
8656:d5c5e805f5b4 8657:6e9eee9ac980
   827 
   827 
   828 	if [ "$with_threads" = "0" ]; then
   828 	if [ "$with_threads" = "0" ]; then
   829 		CFLAGS="$CFLAGS -DNO_THREADS"
   829 		CFLAGS="$CFLAGS -DNO_THREADS"
   830 	fi
   830 	fi
   831 
   831 
   832 	# Enable some things only for certain GCC versions
   832 	if [ `echo $cc_host | cut -c 1-3` = "icc" ]; then
   833 	cc_version=`$cc_host -dumpversion | cut -c 1,3`
   833 		# Enable some things only for certain ICC versions
   834 
   834 		cc_version=`$cc_host -dumpversion | cut -c 1-4`
   835 	if [ $cc_version -ge 29 ]; then
   835 
   836 		CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
   836 
   837 		CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
   837 		if [ "$cc_version" = "10.1" ]; then
   838 		CFLAGS="$CFLAGS -Wno-uninitialized"
   838 			CFLAGS="$CFLAGS -Wno-multichar"
   839 
   839 		fi
   840 		CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
   840 	else
   841 	fi
   841 		# Enable some things only for certain GCC versions
   842 
   842 		cc_version=`$cc_host -dumpversion | cut -c 1,3`
   843 	gcc295=""
   843 
   844 	if [ "$cc_version" = 29 ]; then
   844 		if [ $cc_version -ge 29 ]; then
   845 		# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
   845 			CFLAGS="$CFLAGS -Wall -Wno-multichar -Wsign-compare -Wundef"
   846 		#  need a lovely hack there to make it compile correctly.
   846 			CFLAGS="$CFLAGS -Wwrite-strings -Wpointer-arith"
   847 		gcc295="1"
   847 			CFLAGS="$CFLAGS -Wno-uninitialized"
   848 	fi
   848 
   849 
   849 			CC_CFLAGS="$CC_CFLAGS -Wstrict-prototypes"
   850 	if [ $cc_version -ge 30 ]; then
   850 		fi
   851 		CFLAGS="$CFLAGS -W -Wno-unused-parameter"
   851 
   852 	fi
   852 		gcc295=""
   853 
   853 		if [ "$cc_version" = 29 ]; then
   854 	if [ $cc_version -ge 34 ]; then
   854 			# Make sure we mark GCC 2.95 flag for Makefile.src.in, as we
   855 		CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
   855 			#  need a lovely hack there to make it compile correctly.
   856 	fi
   856 			gcc295="1"
   857 
   857 		fi
   858 	if [ "$os" = "CYGWIN" ]; then
   858 
   859 		CFLAGS="$CFLAGS -mwin32"
   859 		if [ $cc_version -ge 30 ]; then
   860 		LDFLAGS="$LDFLAGS -mwin32"
   860 			CFLAGS="$CFLAGS -W -Wno-unused-parameter"
   861 	fi
   861 		fi
   862 	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
   862 
   863 		CFLAGS="$CFLAGS -mno-cygwin"
   863 		if [ $cc_version -ge 34 ]; then
   864 		LDFLAGS="$LDFLAGS -mno-cygwin"
   864 			CC_CFLAGS="$CC_CFLAGS -Wdeclaration-after-statement -Wold-style-definition"
   865 	fi
   865 		fi
   866 
   866 
   867 	if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
   867 		if [ "$os" = "CYGWIN" ]; then
   868 		LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
   868 			CFLAGS="$CFLAGS -mwin32"
   869 		LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
   869 			LDFLAGS="$LDFLAGS -mwin32"
   870 	fi
   870 		fi
   871 
   871 		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
   872 	# GCC 4.0+ complains about that we break strict-aliasing.
   872 			CFLAGS="$CFLAGS -mno-cygwin"
   873 	#  On most places we don't see how to fix it, and it doesn't
   873 			LDFLAGS="$LDFLAGS -mno-cygwin"
   874 	#  break anything. So disable strict-aliasing to make the
   874 		fi
   875 	#  compiler all happy.
   875 
   876 	if [ $cc_version -ge 40 ]; then
   876 		if [ "$os" = "CYGWIN" ] || [ "$os" = "MINGW" ]; then
   877 		CFLAGS="$CFLAGS -fno-strict-aliasing"
   877 			LDFLAGS="$LDFLAGS -Wl,--subsystem,windows"
   878 	fi
   878 			LIBS="$LIBS -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32"
   879 
   879 		fi
   880 	# GCC 4.2+ automatically assumes that signed overflows do
   880 
   881 	# not occur in signed arithmetics, whereas we are not
   881 		# GCC 4.0+ complains about that we break strict-aliasing.
   882 	# sure that they will not happen. It furthermore complains
   882 		#  On most places we don't see how to fix it, and it doesn't
   883 	# about it's own optimized code in some places.
   883 		#  break anything. So disable strict-aliasing to make the
   884 	if [ $cc_version -ge 42 ]; then
   884 		#  compiler all happy.
   885 		CFLAGS="$CFLAGS -fno-strict-overflow"
   885 		if [ $cc_version -ge 40 ]; then
   886 	fi
   886 			CFLAGS="$CFLAGS -fno-strict-aliasing"
   887 
   887 		fi
   888 	# GCC 4.3+ gives a warning about empty body of
   888 
   889 	# loops and conditions
   889 		# GCC 4.2+ automatically assumes that signed overflows do
   890 	if [ $cc_version -ge 43 ]; then
   890 		# not occur in signed arithmetics, whereas we are not
   891 		CFLAGS="$CFLAGS -Wno-empty-body"
   891 		# sure that they will not happen. It furthermore complains
       
   892 		# about it's own optimized code in some places.
       
   893 		if [ $cc_version -ge 42 ]; then
       
   894 			CFLAGS="$CFLAGS -fno-strict-overflow"
       
   895 		fi
       
   896 
       
   897 		# GCC 4.3+ gives a warning about empty body of
       
   898 		# loops and conditions
       
   899 		if [ $cc_version -ge 43 ]; then
       
   900 			CFLAGS="$CFLAGS -Wno-empty-body"
       
   901 		fi
   892 	fi
   902 	fi
   893 
   903 
   894 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
   904 	if [ "$os" != "CYGWIN" ] && [ "$os" != "FREEBSD" ] && [ "$os" != "OPENBSD" ] && [ "$os" != "MINGW" ] && [ "$os" != "MORPHOS" ] && [ "$os" != "OSX" ] && [ "$os" != "WINCE" ] && [ "$os" != "PSP" ] && [ "$os" != "OS2" ]; then
   895 		LIBS="$LIBS -lpthread"
   905 		LIBS="$LIBS -lpthread"
   896 		LIBS="$LIBS -lrt"
   906 		LIBS="$LIBS -lrt"