Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autotools install on Windows #12193

Merged
merged 4 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions conan/tools/gnu/autotools.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from conans.client.build import join_arguments
from conans.tools import args_to_string
from conan.tools.files import chdir
from conan.tools.microsoft import unix_path


class Autotools(object):
Expand Down Expand Up @@ -42,7 +43,8 @@ def configure(self, build_script_folder=None, args=None):

def make(self, target=None, args=None):
make_program = self._conanfile.conf.get("tools.gnu:make_program",
default="mingw32-make" if self._use_win_mingw() else "make")
default="mingw32-make" if self._use_win_mingw()
else "make")
str_args = self._make_args
str_extra_args = " ".join(args) if args is not None else ""
jobs = ""
Expand All @@ -54,7 +56,8 @@ def make(self, target=None, args=None):
self._conanfile.run(command)

def install(self, args=None):
args = args if args is not None else ["DESTDIR={}".format(self._conanfile.package_folder)]
args = args if args is not None else \
["DESTDIR={}".format(unix_path(self._conanfile, self._conanfile.package_folder))]
self.make(target="install", args=args)

def autoreconf(self, args=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import platform
import textwrap

Expand Down Expand Up @@ -47,6 +48,7 @@ def build(self):
autotools = Autotools(self)
autotools.configure()
autotools.make()
autotools.install()
""")

client.save({"conanfile.py": conanfile,
Expand All @@ -61,3 +63,6 @@ def build(self):
bat_contents = client.load("conanbuild.bat")
assert "conanvcvars.bat" in bat_contents

# To check that the ``autotools.install()`` has worked correctly
# FIXME IN CONAN 2.0 this will break, no local `package_folder`
assert os.path.exists(os.path.join(client.current_folder, "package", "bin", "main.exe"))