Exemplo n.º 1
0
 def _configure_autotools(self):
     autotools = AutoToolsBuildEnvironment(
         self, win_bash=tools.os_info.is_windows)
     autotools.libs = []
     autotools.link_flags.extend([
         "-L{}".format(l.replace("\\", "/"))
         for l in autotools.library_paths
     ])
     autotools.library_paths = []
     if is_msvc(self):
         autotools.cxx_flags.append("-EHsc")
         if self.settings.compiler == "Visual Studio":
             vs_ide_version = self.settings.compiler.version
         else:
             vs_ide_version = msvc_version_to_vs_ide_version(
                 self.settings.compiler.version)
         if tools.Version(vs_ide_version) >= "12":
             autotools.flags.append("-FS")
     conf_args = [
         "--datarootdir={}".format(self._datarootdir.replace("\\", "/")),
         "--disable-documentation",
     ]
     if self.options.shared:
         conf_args.extend(["--enable-shared", "--disable-static"])
     else:
         conf_args.extend(["--disable-shared", "--enable-static"])
     autotools.configure(args=conf_args,
                         configure_dir=self._source_subfolder)
     return autotools
Exemplo n.º 2
0
    def _configure_autotools(self):
        autotools = AutoToolsBuildEnvironment(
            self, win_bash=tools.os_info.is_windows)
        deps_libpaths = autotools.library_paths
        deps_libs = autotools.libs
        deps_defines = autotools.defines
        if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio":
            autotools.link_flags.append("-static")

        libargs = list("-L\"{}\"".format(p)
                       for p in deps_libpaths) + list("-l\"{}\"".format(l)
                                                      for l in deps_libs)
        args = [
            "PCRE_LIBS={}".format(" ".join(libargs)),
            "PCRE_CPPFLAGS={}".format(" ".join("-D{}".format(define)
                                               for define in deps_defines)),
            "--host={}".format(self.settings.arch),
            "--with-swiglibdir={}".format(self._swiglibdir),
        ]
        if self.settings.compiler == 'gcc':
            args.append("LIBS=-ldl")

        host, build = None, None

        if self.settings.compiler == "Visual Studio":
            self.output.warn(
                "Visual Studio compiler cannot create ccache-swig. Disabling ccache-swig."
            )
            args.append("--disable-ccache")
            autotools.flags.append("-FS")
            # MSVC canonical names aren't understood
            host, build = False, False

        if self.settings.os == "Macos" and self.settings.arch == "armv8":
            # FIXME: Apple ARM should be handled by build helpers
            autotools.flags.append("-arch arm64")
            autotools.link_flags.append("-arch arm64")

        autotools.libs = []
        autotools.library_paths = []

        if self.settings.os == "Windows" and self.settings.compiler != "Visual Studio":
            autotools.libs.extend(["mingwex", "ssp"])

        autotools.configure(args=args,
                            configure_dir=self._source_subfolder,
                            host=host,
                            build=build)
        return autotools