def configure(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}

      configure = options.delete(:bin) || "./configure"
      configure_cmd = [configure]

      # Pass the host platform as well. Different versions of config.guess
      # arrive at differently terrible wild ass guesses for what MSYSTEM=MINGW64
      # means. This can be anything from x86_64-pc-mingw64 to i686-pc-mingw32
      # which doesn't even make any sense...
      if windows?
        platform = windows_arch_i386? ? "i686-w64-mingw32" : "x86_64-w64-mingw32"
        configure_cmd << "--build=#{platform}"
      end

      # Accept a prefix override if provided. Can be set to '' to suppress
      # this functionality.
      prefix = options.delete(:prefix) || "#{install_dir}/embedded"
      configure_cmd << "--prefix=#{prefix}" if prefix && prefix != ""

      configure_cmd.concat args
      configure_cmd = configure_cmd.join(" ").strip

      options[:in_msys_bash] = true
      command(configure_cmd, options)
    end
def configure(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}

      configure = options.delete(:bin) || "./configure"
      configure_cmd = [configure]

      # Pass the host platform as well. Different versions of config.guess
      # arrive at differently terrible wild ass guesses for what MSYSTEM=MINGW64
      # means. This can be anything from x86_64-pc-mingw64 to i686-pc-mingw32
      # which doesn't even make any sense...
      if windows?
        platform = windows_arch_i386? ? "i686-w64-mingw32" : "x86_64-w64-mingw32"
        configure_cmd << "--build=#{platform}"
      end

      # Accept a prefix override if provided. Can be set to '' to suppress
      # this functionality.
      prefix = options.delete(:prefix) || "#{install_dir}/embedded"
      configure_cmd << "--prefix=#{prefix}" if prefix && prefix != ""

      configure_cmd.concat args
      configure_cmd = configure_cmd.join(" ").strip

      options[:in_msys_bash] = true
      command(configure_cmd, options)
    end
Run a prexisting "./configure" script that was generated by autotools.
 On windows, this will run configure within an msys bash shell with
 the given arguments. --build is also set on your behalf based on
 windows_arch. A default prefix of "#{install_bin}/embedded" is
 appended. It is important to set --build rather than --host because
 by default, --build also sets --host but it doesn't trigger
 "cross-compilation" mode in most configure scripts. Triggering this mode
 can confuse certain software projects like Ruby which depend on the
 build platform in its mkmf scripts.

 @example With no arguments
   configure
 On POSIX systems, this results in:
   ./configure --prefix=/path/to/embedded
 On Windows 64-bit, this results in:
   ./configure --build=x86_64-w64-mingw32 --prefix=C:/path/to/embedded
 Note that the windows case uses a windows compabile path with forward
 slashes - not an msys path. Ensure that the final Makefile is happy
 with this and doesn't perform path gymnastics on it. Don't pass
 \\ paths unless you particularly enjoy discovering exactly how many
 times configure and the Makefile it generates sends your path back
 and forth through bash/sh, mingw32 native binaries and msys binaries
 and how many backslashes it takes for you to quit software development.

 @example With custom arguments
   configure '--enable-shared'

 @example With custom location of configure bin
   configure '--enable-shared', bin: '../foo/configure'
 The path to configure must be a "unix-y" path for both windows and posix
 as this path is run under an msys bash shell on windows. Prefer relative
 paths lest you incur the wrath of the msys path gods for they are not
 kind, just or benevolent.

 @param (see #command)
 @return (see #command)