summaryrefslogtreecommitdiff
path: root/volk/config/gcc_version_workaround.m4
blob: b3ba0b6f3fa3780ce1a23e349ee463759f96da6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
AC_DEFUN([LV_GCC_VERSION_WORKAROUND], 
[
	AC_REQUIRE([LF_CONFIGURE_CXX])
	
	cxx_version=`$CXX --version`

	cxx_major_version=`echo $cxx_version | sed 's/[[^)]]*) \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
	cxx_minor_version=`echo $cxx_version | sed 's/g++ [[^)]]*) \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
	cxx_micro_version=`echo $cxx_version | sed 's/g++ [[^)]]*) \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
    	
	if test ["$cxx_minor_version" -lt "3"] -o ["$cxx_major_version" -lt "4"]; then
		cxx_proper_version="$cxx_major_version.$cxx_minor_version.$cxx_micro_version"
		

		my_arch=`uname -m`

		if test "${my_arch}" = i686; then
		   my_arch="${my_arch} i586 i486 i386"
		fi
		if test "${my_arch}" = i586; then
		   my_arch = "${my_arch} i686 i386 i486"
		fi
		if test "${my_arch}" = i486; then
		   my_arch = "${my_arch} i686 i386 i586"
		fi
		if test "${my_arch}" = i386; then
		   my_arch = "${my_arch} i686 i586 i486"
		fi
		
		for i in $my_arch
		do
		  if test -n "`ls /usr/include/c++/$cxx_proper_version | grep $i`"; then
                    mystery_dir=`ls /usr/include/c++/$cxx_proper_version | grep $i`
		    echo `ls /usr/include/c++/$cxx_proper_version | grep $i`
		  fi
		done
		echo "${mystery_dir}"
		
		LV_CXXFLAGS="${LV_CXXFLAGS} -nostdinc++ -I/usr/include/c++/$cxx_proper_version -I/usr/include/c++/$cxx_proper_version/$mystery_dir"
		
		CXXFLAGS="${CXXFLAGS} -nostdinc++ -I/usr/include/c++/$cxx_proper_version -I/usr/include/c++/$cxx_proper_version/$mystery_dir"
		

	
	fi
    	
	

	])