[MacPorts] #43204: Change BZIP2 variable name for configure script

MacPorts noreply at macports.org
Mon Apr 21 16:57:09 PDT 2014


#43204: Change BZIP2 variable name for configure script
-------------------------+--------------------------------
  Reporter:  eborisch@…  |      Owner:  macports-tickets@…
      Type:  defect      |     Status:  reopened
  Priority:  Normal      |  Milestone:
 Component:  base        |    Version:  2.2.1
Resolution:              |   Keywords:
      Port:              |
-------------------------+--------------------------------

Comment (by eborisch@…):

 Going through it, I think I prefer the configure arguments for paths. I'm
 not convinced that 17 extra arguments is any more or less complex than 17
 environment variables. Given that the ENVs get exported to anything
 running underneath, the pure arguments are in a sense less complex.

 Here's a patch that will (after running through ./regen.sh) update
 configure to have --with-tool=path arguments. This fixes the exported
 BZIP2 variable tripping up bzip2 issue, as well.

 This patch also backs-out r118736; this could be done separately for
 tracking, of course. (Or not at all, either works, I was just trying to
 minimize total changes vs -r ''old'' for this ticket.)

 '''Note that anyone performing {{{TOOL=PATH ./configure}}} will still get
 (essentially) the previous behavior''' -- so this shouldn't break anyone's
 custom build that was relying on setting the tool paths in environment
 variables. This occurs because $with_tool will be unset, and
 AC_PATH_PROG(TOOL, ...) will be overridden if the variable TOOL is set.
 (They may not now be marked as precious, but that's another level of
 autoconf grokking that I'm not at...)

 {{{#!diff
 Index: aclocal.m4
 ===================================================================
 --- aclocal.m4  (revision 119259)
 +++ aclocal.m4  (working copy)
 @@ -96,6 +96,16 @@
         $1=$(AS_ECHO([$2]) | sed -E 's/^--?([[^=]]+)=.*$/\1/')dnl
  ])

 +dnl Similar to AC_ARG_VAR, but implemented with --with-pkg=PATH for PKG.
 +dnl
 +dnl Parameters: Similar to AC_ARG_VAR ($2 gets some boiler plate around
 it)
 +AC_DEFUN([MP_TOOL_PATH], [dnl
 +       AC_ARG_WITH([m4_tolower($1)], [AS_HELP_STRING([--with-
 m4_tolower($1)=PATH],
 +                       [Path to alternate $2 command])],dnl
 +               [$1=$withval],dnl
 +               [])dnl
 +])
 +
  dnl Configure a project contained in a .tar.gz, .tgz or .tar.bz2 tarball,
  dnl extracting it previously, if necessary. Different from
 AC_CONFIG_SUBDIRS
  dnl (on which this macro is based), you can pass parameters to the
 @@ -138,7 +148,7 @@
                                 AC_MSG_ERROR([Don't know how to extract
 tarball $mp_tarball])
                                 ;;
                 esac
 -               (cd "$mp_tarball_vendordir"; "$mp_tarball_extract_cmd" -dc
 "$ac_abs_confdir/$mp_tarball" | tar xf - || AC_MSG_ERROR([failed to
 extract $mp_tarball]))
 +               (cd "$mp_tarball_vendordir"; "$mp_tarball_extract_cmd" -d
 < "$ac_abs_confdir/$mp_tarball" | tar xf - || AC_MSG_ERROR([failed to
 extract $mp_tarball]))
         fi
         if ! test -d "$ac_dir"; then
                 AC_MSG_ERROR([tarball $mp_tarball did not extract to
 $ac_dir])
 Index: configure.ac
 ===================================================================
 --- configure.ac        (revision 119259)
 +++ configure.ac        (working copy)
 @@ -101,6 +101,26 @@
  AC_PROG_MAKE_SET
  AC_PROG_OBJC([clang cc gcc])

 +# Check for user-supplied paths before searching
 +MP_TOOL_PATH(BSDMAKE, [bsdmake/pmake])
 +MP_TOOL_PATH(BZIP2, [bzip2])
 +MP_TOOL_PATH(CVS, [cvs])
 +MP_TOOL_PATH(GNUMAKE, [gnumake])
 +MP_TOOL_PATH(GNUTAR, [gnutar])
 +MP_TOOL_PATH(LZMA, [lzma])
 +MP_TOOL_PATH(MAKE, [make])
 +MP_TOOL_PATH(MTREE, [mtree])
 +MP_TOOL_PATH(OPEN, [open])
 +MP_TOOL_PATH(OPENSSL, [openssl])
 +MP_TOOL_PATH(RSYNC, [rsync])
 +MP_TOOL_PATH(SED, [sed])
 +MP_TOOL_PATH(SVN, [svn])
 +MP_TOOL_PATH(SWIG, [swig])
 +MP_TOOL_PATH(TAR, [tar])
 +MP_TOOL_PATH(XAR, [xar])
 +MP_TOOL_PATH(XZ, [xz])
 +
 +# Search for tool paths. Any set above (via --with-pkg=PATH) are retained
  AC_PATH_PROGS(BSDMAKE, [bsdmake pmake], [])
  AC_PATH_PROG(BZIP2, [bzip2], [])
  AC_PATH_PROG(BZR, [bzr], [])
 @@ -149,24 +169,6 @@

  AC_CHECK_PROG(HAVE_LAUNCHD, [launchd], [yes], [], [/sbin])

 -# Define some precious variables allowing user to override PATH for some
 programs
 -AC_ARG_VAR(BSDMAKE, [path to bsdmake/pmake command])
 -AC_ARG_VAR(BZIP2, [path to bzip2 command])
 -AC_ARG_VAR(CVS, [path to cvs command])
 -AC_ARG_VAR(GNUMAKE, [path to gnumake command])
 -AC_ARG_VAR(GNUTAR, [path to gnutar command])
 -AC_ARG_VAR(LZMA, [path to lzma command])
 -AC_ARG_VAR(MAKE, [path to make command])
 -AC_ARG_VAR(MTREE, [path to mtree command])
 -AC_ARG_VAR(OPEN, [path to open command])
 -AC_ARG_VAR(OPENSSL, [path to openssl command])
 -AC_ARG_VAR(RSYNC, [path to rsync command])
 -AC_ARG_VAR(SED, [path to sed command])
 -AC_ARG_VAR(SVN, [path to svn command])
 -AC_ARG_VAR(SWIG, [path to swig command])
 -AC_ARG_VAR(TAR, [path to tar command])
 -AC_ARG_VAR(XAR, [path to xar command])
 -AC_ARG_VAR(XZ, [path to xz command])

  if test "x$MTREE" = "x"; then
      AC_MSG_ERROR([mtree not found])
 }}}

 Snippet of {{{./configure --help}}} output now:
 {{{
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-bsdmake=PATH     Path to alternate bsdmake/pmake command
   --with-bzip2=PATH       Path to alternate bzip2 command
   --with-cvs=PATH         Path to alternate cvs command
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/43204#comment:12>
MacPorts <http://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list