Tk Source Code

View Ticket
Login
Ticket UUID: 439320
Title: distclean target doesn't always work
Type: Bug Version: obsolete: 8.3.3
Submitter: lloydlim Created on: 2001-07-07 17:56:14
Subsystem: 84. Unix Build Assigned To: mdejong
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-09-18 11:32:00
Resolution: Wont Fix Closed By: mdejong
    Closed on: 2001-09-18 04:32:00
Description:
Example:  Put Tk source in directory foo/tk8.3.3.  
Configure and compile.  Move Tk directory by doing 'mv 
foo bar'.  Try 'make distclean'.  It says:

make: *** No rule to make target `/n/bmrca/users/lim/
src/foo/tk8.3/unix/Makefile.in', needed by `Makefile'.  
Stop.

This problem does not happen with the Tcl makefile.

My guess is that there is some kind of target problem.  
The distclean target does not reference any fully 
specified paths, so some other target must be getting 
invoked unnecessarily.
User Comments: mdejong added on 2001-09-18 11:31:59:
Logged In: YES 
user_id=90858

I think the problem has to do with running configure
scripts in sub directories. See this note in Makefile.in:

# Must be absolute because of the cd dltest
$(DLTEST_DIR)/configure below.
DLTEST_DIR              = @TCL_SRC_DIR@/unix/dltest

I think the problems shows up when you run make
test and it tries to build the shared lib tests
in the dltest subdir.

lloydlim added on 2001-08-27 01:21:41:
Logged In: YES 
user_id=99220

I consider this a bug because I can't remember the last time I used a Makefile that had similar fully qualified 
paths and where "make distclean" didn't work.  I don't expect the Makefile to work after moving the source 
around, but I think the desired behavior should be that "make distclean" always work.

Since you mentioned building in a different directory, I just tried the following:

cd /tmp/test/tcl
~/src/mash-code/tcl8.3/unix/configure
make -s
cd /tmp/test/tk
~/src/mash-code/tk8.3/unix/configure --with-tcl=../tcl
make -s
make -s test

This is with Tcl/Tk 8.3.3 with the Tk patched as below to remove line fully qualifying srcdir.

Tcl compiled just fine.  Tk compiled just fine.  make test in the Tk directory forced tcltest to be made, as 
desired.

I still don't see any justification for fully qualifying srcdir.  Give me an example where the patch doesn't work 
and I'll close this report myself.

mdejong added on 2001-08-25 09:24:52:
Logged In: YES 
user_id=90858

I don't see why you think this is a bug. You can't move
the srcdir after running configure and expect the
generated Makefile to work. Your patch would break
the build when srcdir != builddir. I don't even see
how the existing Tcl Makefile would work in this
situation since the rule is as follows:

Makefile: $(UNIX_DIR)/Makefile.in
        $(SHELL) config.status


I would rather just close this as not a bug.
Comments?

lloydlim added on 2001-08-02 01:34:02:
Logged In: YES 
user_id=99220

I've looked into bug #220688 (formerly bug #4237).  I commented out the line that fully qualifies srcdir.  
Then I tried the following sequence:

cd tcl8.3.3/unix
make -s distclean
configure
make -s
cd tk8.3.3/unix
make -s distclean
configure
make -s
make runtest

I tried both "make runtest" and "make test" at the end.  I tried it on Linux (Red Hat 6.2 & 7.0), FreeBSD 
(2.2.5, 3.3, 4.1), and Solaris (7).  It successfully made tcltest without needing the fully qualified srcdir.

I can't see any reason for having this line, so I recommend the following patch to take it out:

--- configure.in.old    Wed Aug  1 11:30:24 2001
+++ configure.in        Wed Aug  1 11:31:33 2001
@@ -17,8 +17,6 @@
 if test "${exec_prefix}" = "NONE"; then
     exec_prefix=$prefix
 fi
-# Make sure srcdir is fully qualified!
-srcdir=`cd $srcdir ; pwd`
 TK_SRC_DIR=`cd $srcdir/..; pwd`

 AC_PROG_RANLIB

dgp added on 2001-07-12 02:08:49:
Logged In: YES 
user_id=80530


Bug 4237 (the Scriptics numbering system) is now
Bug 220688 (SourceForge numbering system).

lloydlim added on 2001-07-11 03:51:06:
Logged In: YES 
user_id=99220

I've looked into this problem.  It wants to make Makefile.in
because UNIX_DIR is a fully qualified path (which no longer
exists after you move it).

The problem can be fixed by removing the line:
srcdir=`cd $srcdir ; pwd`
However, this line was apparently added to fix Bug 4237. 
Without being able to look at the bug report, I can't
evaluate the merit of this line.  I think this patch is
questionable though because it breaks make clean and make
distclean, which should always work.