#1911 prefix not honoured on make install

obsolete: 8.4a4

I called

make install prefix=/usr/local/stow/tcl8.4a4

and got

unix# ll `which tclsh8.4`
-rwxr-xr-x 1 root staff 6207 Jun 24 22:15

I guess the wrong prefix comes from the --prefix given
to configure.
All other files are installed where requested.

The different prefixes used during configure/make and
'make install' are
necessary when using stow
(http://www.gnu.org/software/stow/) or when
packing distributions.

Harald Kirsch


  • Mo DeJong

    Mo DeJong - 2002-06-24

    Logged In: YES

    Tcl does not support setting the prefix variable
    at make time. I doubt it ever will. If you want to
    set the prefix it should be done at configure time.
    A handy patch might be to detect if the user changed
    the prefix variable on the command line an generate
    an error that tells them not too. It might have
    been useful to set the prefix like that in the old
    days of static libs, but these days there are far
    too many compiled in paths to even think about
    supporting this.

  • Harald Kirsch

    Harald Kirsch - 2002-06-26

    Logged In: YES

    It seems like we have a different understanding of how a prefix
    given to 'make install' should be handled. You write:

    but these days there are far
    too many compiled in paths to even think about
    supporting this.

    You seem to mean that the prefix for 'make install' must be
    fiddled into
    the software to tell it its own location. On the contrary
    'make install'
    MUST NOT touch any compiled-in prefix anymore. It should
    only copy the
    files into the destination directory structure and maybe set

    This is necessary for stow as well as for package builders
    like dpkg or rpm:
    The software is intended to work e.g. in /usr/local but for
    packing (rpm) or
    other managing (stow) it is necessary to have it in a single
    directory hierarchy, i.e. in particular not in /usr/local.
    This is what the prefix
    given to 'make install' should be used for.

    That said you may find that supporting this is really trivial.

    Harald Kirsch

  • Don Porter

    Don Porter - 2002-06-26

    Logged In: YES

    Note that this issue is similar to the one
    raised in Tcl Bug 489370. You might
    want to read comments there for

    I also liked the ability to re-direct installs
    with a single redefine, but Mo insists it's
    not correct. You can still achieve the
    redirection, but you'll need to redefine
    all of prefix, exec_prefix, and libdir now.

  • Don Porter

    Don Porter - 2002-06-26

    Logged In: YES

    rmax, I think you look after the tcl.spec file and
    packaging of Tcl/Tk into RPMs. Does this
    issues affect those things?

  • Don Porter

    Don Porter - 2002-06-26
    • assigned_to: mdejong --> rmax
  • Reinhard Max

    Reinhard Max - 2002-07-15

    Logged In: YES

    Harald, I think what you need is INSTALL_ROOT

    ./configure --prefix=/usr ...
    make INSTALL_ROOT=/var/tmp/tcl-root install

    This creates a Tcl installation that is configured to work when
    installed under /usr, but prepends /var/tmp/tcl-root to any
    path during installation.

  • Harald Kirsch

    Harald Kirsch - 2002-08-31

    Logged In: YES

    First, I would like to stress that I want to change prefix
    *only* to redirect installation, i.e. where files are
    copied. Of course it
    makes no sense to configure for /X and compile for /Y.

    mdejong says:

    > Tcl does not support setting the prefix variable
    > at make time.

    Looking into configure.in, the main reason seems to be that
    libdir is expanded
    at configure time instead of when make is run. The comment in
    configure.in around line 26 is:

    # libdir must be a fully qualified path and (not

    What is the reason for this?

    P.S.: No, INSTALL_ROOT is not suitable for use with stow.

  • Stephen P. Hill

    Stephen P. Hill - 2003-02-24

    Logged In: YES

    This is a fairly common need - you configure for location X,
    you install under a stow tree, then you generate packages (
    or whatever ) from the stow tree and they will be installed
    and run from location X on other machines.

    The eval that expands libdir is incorrect, since it affects
    every use of libdir. The fix should have only affected the
    one buggy use of libdir that was causing a ${exec_prefix} to
    show up in the generated tclConfig.sh file.

    For my use I commented out the eval and we don't care about
    the bad line we get in the tclConfig.sh since we don't use it.

  • Mo DeJong

    Mo DeJong - 2003-02-24

    Logged In: YES

    I don't see how we can subst one value of libdir into the
    and another value into the Makefile. Could you work around this
    issue by running:

    make prefix=/some/path libdir='$(exec_prefix)/lib` install

    This would likely "fix" things for you, but if a --libdir option
    were to be passed to the configure script then things would
    be broken again.

  • Don Porter

    Don Porter - 2003-02-26

    Logged In: YES

    Note this excerpt from unix/README:

    (f) Type "make install" to install Tcl binaries and script
    files in
    standard places. You'll need write permission on the
    directories to do this. The installation directories are
    determined by the "configure" script and may be
    specified with
    the --prefix and --exec-prefix options to "configure".
    See the
    Makefile for information on what directories were
    chosen; you
    can override these choices by modifying the "prefix" and
    "exec_prefix" variables in the Makefile.

    Is seems that the final sentence is no longer correct, because
    'make install' has been modified so one cannot redirect the
    location of an install by simply redefining "prefix".

    Whatever the final resolution of this, the Makefile should
    be checked to be correct.

    There's a similar claim in the unix/Makefile for Tk.

  • Don Porter

    Don Porter - 2003-02-26

    Logged In: YES

    shouldn't type so late at night.

    When I type "Makefile", I meant "README".


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks