Ejemplo n.º 1
0
    def environment_append_test(self):
        settings = MockSettings({
            "build_type": "Debug",
            "arch": "x86_64",
            "compiler": "gcc",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        env_vars = {
            "CFLAGS": "-additionalcflag",
            "CXXFLAGS": "-additionalcxxflag",
            "LDFLAGS": "-additionalldflag",
            "LIBS": "-additionallibs",
            "CPPFLAGS": "-additionalcppflag"
        }

        with (tools.environment_append(env_vars)):
            be = AutoToolsBuildEnvironment(conanfile)
            expected = {
                'CPPFLAGS':
                '-Ipath/includes -Iother/include/path -Donedefinition -'
                'Dtwodefinition -D_GLIBCXX_USE_CXX11_ABI=0 -additionalcppflag',
                'CXXFLAGS':
                'a_c_flag -m64 -g --sysroot=/path/to/folder a_cpp_flag -additionalcxxflag',
                'LIBS':
                '-lonelib -ltwolib -additionallibs',
                'LDFLAGS':
                'shared_link_flag exe_link_flag -m64 '
                '--sysroot=/path/to/folder -Lone/lib/path -additionalldflag',
                'CFLAGS':
                'a_c_flag -m64 -g --sysroot=/path/to/folder -additionalcflag'
            }
            self.assertEquals(be.vars, expected)
Ejemplo n.º 2
0
    def modify_values_test(self):
        settings = MockSettings({
            "build_type": "Debug",
            "arch": "x86_64",
            "compiler": "gcc",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        be = AutoToolsBuildEnvironment(conanfile)

        # Alter some things
        be.defines.append("OtherDefinition=23")
        be.link_flags = ["-inventedflag"]
        be.cxx_flags.append("-onlycxx")
        be.fpic = True
        be.flags.append("cucucu")

        expected = {
            'CFLAGS':
            'a_c_flag -m64 -g --sysroot=/path/to/folder cucucu -fPIC',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
            ' -D_GLIBCXX_USE_CXX11_ABI=0 -DOtherDefinition=23',
            'CXXFLAGS':
            'a_c_flag -m64 -g --sysroot=/path/to/folder cucucu -fPIC a_cpp_flag -onlycxx',
            'LDFLAGS':
            '-inventedflag -Lone/lib/path',
            'LIBS':
            '-lonelib -ltwolib'
        }
        self.assertEquals(be.vars, expected)
Ejemplo n.º 3
0
    def autotools_configure_vars_test(self):
        from mock import patch

        runner = RunnerMock()
        settings = MockSettings({"build_type": "Debug",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings, None, runner)
        conanfile.settings = settings
        self._set_deps_info(conanfile)

        def custom_configure(obj, configure_dir=None, args=None, build=None, host=None, target=None,
                             pkg_config_paths=None, vars=None):  # @UnusedVariable
            self.assertNotEqual(obj.vars, vars)
            return vars or obj.vars

        with patch.object(AutoToolsBuildEnvironment, 'configure', new=custom_configure):
            be = AutoToolsBuildEnvironment(conanfile)

            # Get vars and modify them
            my_vars = be.vars
            my_vars["fake_var"] = "fake"
            my_vars["super_fake_var"] = "fakefake"

            # TEST with default vars
            mocked_result = be.configure()
            self.assertEqual(mocked_result, be.vars)

            # TEST with custom vars
            mocked_result = be.configure(vars=my_vars)
            self.assertEqual(mocked_result, my_vars)
Ejemplo n.º 4
0
 def rpath_optin_test(self):
     settings = MockSettings({
         "os_build": "Linux",
         "build_type": "Release",
         "arch": "x86_64",
         "compiler": "gcc",
         "compiler.libcxx": "libstdc++11"
     })
     conanfile = MockConanfile(settings)
     conanfile.settings = settings
     self._set_deps_info(conanfile)
     expected = {
         'CFLAGS':
         'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder',
         'CPPFLAGS':
         '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
         '-D_GLIBCXX_USE_CXX11_ABI=1',
         'CXXFLAGS':
         'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
         'LDFLAGS':
         'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder '
         '-Wl,-rpath="one/lib/path" -Lone/lib/path',
         'LIBS':
         '-lonelib -ltwolib'
     }
     be = AutoToolsBuildEnvironment(conanfile, include_rpath_flags=True)
     self.assertEquals(be.vars, expected)
Ejemplo n.º 5
0
    def autotools_configure_vars_test(self):
        from mock import patch

        runner = RunnerMock()
        settings = MockSettings({"build_type": "Debug",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings, None, runner)
        conanfile.settings = settings
        self._set_deps_info(conanfile)

        def custom_configure(obj, configure_dir=None, args=None, build=None, host=None, target=None,
                             pkg_config_paths=None, vars=None):  # @UnusedVariable
            self.assertNotEqual(obj.vars, vars)
            return vars or obj.vars

        with patch.object(AutoToolsBuildEnvironment, 'configure', new=custom_configure):
            be = AutoToolsBuildEnvironment(conanfile)

            # Get vars and modify them
            my_vars = be.vars
            my_vars["fake_var"] = "fake"
            my_vars["super_fake_var"] = "fakefake"

            # TEST with default vars
            mocked_result = be.configure()
            self.assertEqual(mocked_result, be.vars)

            # TEST with custom vars
            mocked_result = be.configure(vars=my_vars)
            self.assertEqual(mocked_result, my_vars)
Ejemplo n.º 6
0
 def get_values(this_os, this_arch, setting_os, setting_arch):
     settings = MockSettings({"arch": setting_arch,
                              "os": setting_os})
     conanfile = MockConanfile(settings)
     conanfile.settings = settings
     be = AutoToolsBuildEnvironment(conanfile)
     return be._get_host_build_target_flags(this_arch, this_os)
Ejemplo n.º 7
0
 def rpath_optin_test(self):
     settings = MockSettings({"os_build": "Linux",
                              "build_type": "Release",
                              "arch": "x86_64",
                              "compiler": "gcc",
                              "compiler.libcxx": "libstdc++11"})
     conanfile = MockConanfile(settings)
     conanfile.settings = settings
     self._set_deps_info(conanfile)
     expected = {'CFLAGS': 'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder',
                 'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
                             '-D_GLIBCXX_USE_CXX11_ABI=1',
                 'CXXFLAGS': 'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
                 'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder '
                            '-Wl,-rpath="one/lib/path" -Lone/lib/path',
                 'LIBS': '-lonelib -ltwolib'}
     be = AutoToolsBuildEnvironment(conanfile, include_rpath_flags=True)
     self.assertEquals(be.vars, expected)
Ejemplo n.º 8
0
    def modify_values_test(self):
        settings = MockSettings({"build_type": "Debug",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        be = AutoToolsBuildEnvironment(conanfile)

        # Alter some things
        be.defines.append("OtherDefinition=23")
        be.link_flags = ["-inventedflag"]
        be.cxx_flags.append("-onlycxx")
        be.fpic = True
        be.flags.append("cucucu")

        expected = {'CFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder cucucu -fPIC',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
                                ' -D_GLIBCXX_USE_CXX11_ABI=0 -DOtherDefinition=23',
                    'CXXFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder cucucu -fPIC a_cpp_flag -onlycxx',
                    'LDFLAGS': '-inventedflag -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        self.assertEquals(be.vars, expected)
Ejemplo n.º 9
0
    def environment_append_test(self):
        settings = MockSettings({"build_type": "Debug",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        env_vars = {"CFLAGS": "-additionalcflag",
                    "CXXFLAGS": "-additionalcxxflag",
                    "LDFLAGS": "-additionalldflag",
                    "LIBS": "-additionallibs",
                    "CPPFLAGS": "-additionalcppflag"}

        with(tools.environment_append(env_vars)):
            be = AutoToolsBuildEnvironment(conanfile)
            expected = {'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -'
                                    'Dtwodefinition -D_GLIBCXX_USE_CXX11_ABI=0 -additionalcppflag',
                        'CXXFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder a_cpp_flag -additionalcxxflag',
                        'LIBS': '-lonelib -ltwolib -additionallibs',
                        'LDFLAGS': 'shared_link_flag exe_link_flag -m64 '
                                   '--sysroot=/path/to/folder -Lone/lib/path -additionalldflag',
                        'CFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder -additionalcflag'}
            self.assertEquals(be.vars, expected)
Ejemplo n.º 10
0
    def test_variables(self):
        # Visual Studio
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86",
            "compiler": "Visual Studio",
            "compiler.version": "14",
            "compiler.runtime": "MD"
        })
        conanfile = MockConanfile(settings)
        self._set_deps_info(conanfile)

        be = AutoToolsBuildEnvironment(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -O2 -Ob2',
            'CPPFLAGS':
            '-Ipath\\includes -Iother\\include\\path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS': 'a_c_flag -O2 -Ob2 a_cpp_flag',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -LIBPATH:one\\lib\\path',
            'LIBS': 'onelib.lib twolib.lib'
        }

        self.assertEquals(be.vars, expected)
        # GCC 32
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86",
            "compiler": "gcc",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        self._set_deps_info(conanfile)

        be = AutoToolsBuildEnvironment(conanfile)
        expected = {
            'CFLAGS':
            'a_c_flag -m32 -O3 -s --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
            '-D_GLIBCXX_USE_CXX11_ABI=0',
            'CXXFLAGS':
            'a_c_flag -m32 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m32 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS':
            '-lonelib -ltwolib'
        }

        self.assertEquals(be.vars, expected)

        # GCC 64
        settings = MockSettings({
            "build_type": "Debug",
            "arch": "x86_64",
            "compiler": "gcc",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS':
            'a_c_flag -m64 -g --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
            ' -D_GLIBCXX_USE_CXX11_ABI=0',
            'CXXFLAGS':
            'a_c_flag -m64 -g --sysroot=/path/to/folder a_cpp_flag',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS':
            '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # With clang, we define _GLIBCXX_USE_CXX11_ABI
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "clang",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS':
            'a_c_flag -m64 -O3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
            ' -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=0',
            'CXXFLAGS':
            'a_c_flag -m64 -O3 --sysroot=/path/to/folder a_cpp_flag -stdlib=libstdc++',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS':
            '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # Change libcxx
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "clang",
            "compiler.libcxx": "libc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -m64 -O3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS':
            'a_c_flag -m64 -O3 --sysroot=/path/to/folder a_cpp_flag -stdlib=libc++',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS': '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # gcc libcxx
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "gcc",
            "compiler.libcxx": "libstdc++11"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS':
            'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
            '-D_GLIBCXX_USE_CXX11_ABI=1',
            'CXXFLAGS':
            'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS':
            '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # Sun CC libCstd
        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "sun-cc",
            "compiler.libcxx": "libCstd"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS':
            'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=Cstd',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS': '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "sun-cc",
            "compiler.libcxx": "libstdcxx"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS':
            'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stdcxx4',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS': '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "sun-cc",
            "compiler.libcxx": "libstlport"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS':
            'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stlport4',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS': '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({
            "build_type": "Release",
            "arch": "x86_64",
            "compiler": "sun-cc",
            "compiler.libcxx": "libstdc++"
        })
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {
            'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
            'CPPFLAGS':
            '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
            'CXXFLAGS':
            'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stdcpp',
            'LDFLAGS':
            'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
            'LIBS': '-lonelib -ltwolib'
        }
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)
Ejemplo n.º 11
0
    def test_variables(self):
        # Visual Studio
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86",
                                 "compiler": "Visual Studio",
                                 "compiler.version": "14",
                                 "compiler.runtime": "MD"})
        conanfile = MockConanfile(settings)
        self._set_deps_info(conanfile)

        be = AutoToolsBuildEnvironment(conanfile)
        expected = {'CFLAGS': 'a_c_flag -O2 -Ob2',
                    'CPPFLAGS': '-Ipath\\includes -Iother\\include\\path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -O2 -Ob2 a_cpp_flag',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -LIBPATH:one\\lib\\path',
                    'LIBS': 'onelib.lib twolib.lib'}

        self.assertEquals(be.vars, expected)
        # GCC 32
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        self._set_deps_info(conanfile)

        be = AutoToolsBuildEnvironment(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m32 -O3 -s --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
                                '-D_GLIBCXX_USE_CXX11_ABI=0',
                    'CXXFLAGS': 'a_c_flag -m32 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m32 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}

        self.assertEquals(be.vars, expected)

        # GCC 64
        settings = MockSettings({"build_type": "Debug",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
                                ' -D_GLIBCXX_USE_CXX11_ABI=0',
                    'CXXFLAGS': 'a_c_flag -m64 -g --sysroot=/path/to/folder a_cpp_flag',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # With clang, we define _GLIBCXX_USE_CXX11_ABI
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "clang",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -O3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition'
                                ' -DNDEBUG -D_GLIBCXX_USE_CXX11_ABI=0',
                    'CXXFLAGS': 'a_c_flag -m64 -O3 --sysroot=/path/to/folder a_cpp_flag -stdlib=libstdc++',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # Change libcxx
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "clang",
                                 "compiler.libcxx": "libc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -O3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -m64 -O3 --sysroot=/path/to/folder a_cpp_flag -stdlib=libc++',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # gcc libcxx
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "gcc",
                                 "compiler.libcxx": "libstdc++11"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG '
                                '-D_GLIBCXX_USE_CXX11_ABI=1',
                    'CXXFLAGS': 'a_c_flag -m64 -O3 -s --sysroot=/path/to/folder a_cpp_flag',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        # Sun CC libCstd
        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "sun-cc",
                                 "compiler.libcxx": "libCstd"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=Cstd',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "sun-cc",
                                 "compiler.libcxx": "libstdcxx"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stdcxx4',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "sun-cc",
                                 "compiler.libcxx": "libstlport"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stlport4',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)

        settings = MockSettings({"build_type": "Release",
                                 "arch": "x86_64",
                                 "compiler": "sun-cc",
                                 "compiler.libcxx": "libstdc++"})
        conanfile = MockConanfile(settings)
        conanfile.settings = settings
        self._set_deps_info(conanfile)
        expected = {'CFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder',
                    'CPPFLAGS': '-Ipath/includes -Iother/include/path -Donedefinition -Dtwodefinition -DNDEBUG',
                    'CXXFLAGS': 'a_c_flag -m64 -xO3 --sysroot=/path/to/folder a_cpp_flag -library=stdcpp',
                    'LDFLAGS': 'shared_link_flag exe_link_flag -m64 --sysroot=/path/to/folder -Lone/lib/path',
                    'LIBS': '-lonelib -ltwolib'}
        be = AutoToolsBuildEnvironment(conanfile)
        self.assertEquals(be.vars, expected)