Re: The annoyance of repeating Makefiles

2007-03-15 Thread Ken Murchison

Gary Mills wrote:

On Tue, Jan 23, 2007 at 09:50:32AM -0500, Ken Murchison wrote:

Gary Mills wrote:


This behavior is annoying because I build the Cyrus software on a
development server but then install it on other servers where there
is no compiler and the source tree is mounted read-only.  This breaks
`make install', which should only install things, not recompile them.
Can this be fixed, or am I condemned to hack Makefiles myself?
A 'make install' shouldn't compile anything if all of the generated 
files already exist.  I would consider this a bug and would gladly 
accept a patch which fixes this behavior.


I've attached a patch, against cyrus-imapd-2.3.8, that does just that.



I'm finally looking at this patch, but what if I just do 'make imapd'? 
If any of the source files has been updated, we won't get an update 
CYRUS_CVSDATE









--- imap/Makefile.Oin   Tue Jan  9 11:41:35 2007
+++ imap/Makefile.inSat Feb 10 09:50:27 2007
@@ -123,7 +123,7 @@
lmtpstats.c lmtpstats.h xversion.h mupdate_err.c mupdate_err.h \
nntp_err.c nntp_err.h
 
-all: $(BUILTSOURCES) $(PROGS) $(SUIDPROGS)

+all: xversion $(BUILTSOURCES) $(PROGS) $(SUIDPROGS)
 
 pure: imapd.pure lmtpd.pure mupdate.pure
 
@@ -151,11 +151,10 @@
 
 ### Built Source Files
 
-xversion:

-   rm -f version.o
+xversion xversion.h:
AWK=$(AWK) $(srcdir)/xversion.sh
 
-xversion.h: xversion

+version.o: xversion.h
 
 pushstats.c: pushstats.snmp $(srcdir)/../snmp/snmpgen

$(srcdir)/../snmp/snmpgen $(srcdir)/pushstats.snmp
@@ -199,7 +198,7 @@
 $(SERVICE) lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) \
 mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
 
-imapd: xversion $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)

+imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
$(CC) $(LDFLAGS) -o imapd \
 $(SERVICE) $(IMAPDOBJS) mutex_fake.o \
libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
--- imap/xversion.Osh   Wed Oct 22 13:03:00 2003
+++ imap/xversion.shSat Feb 10 08:04:31 2007
@@ -9,12 +9,13 @@
 AWK=awk
 fi
 
+TMPF=/tmp/xversion.$$

 DATEPAT=[1-2][0-9][0-9][0-9]/[0-1][0-9]/[0-3][0-9]
 TIMEPAT=[0-2][0-9]:[0-5][0-9]:[0-5][0-9]
 
-printf /* Generated automatically by xversion.sh */\n\n  xversion.h

+printf /* Generated automatically by xversion.sh */\n\n  $TMPF
 
-printf #define CYRUS_CVSDATE   xversion.h

+printf #define CYRUS_CVSDATE   $TMPF
 
 find .. -name '*.[chly]' -print | \

xargs egrep '\$Id: ' | \
@@ -22,4 +23,12 @@
match ($0, pattern) {
printf \%s\\n, substr($0, RSTART, RLENGTH)
}' pattern=$DATEPAT $TIMEPAT | \
-   sort | tail -1  xversion.h
+   sort | tail -1  $TMPF
+
+if [ -f xversion.h ]  cmp -s $TMPF xversion.h
+then
+rm $TMPF
+else
+mv $TMPF xversion.h
+fi
+
--- perl/Makefile.Oin   Wed Oct 22 13:50:17 2003
+++ perl/Makefile.inFri Feb  9 17:54:37 2007
@@ -77,7 +77,7 @@
@for d in  $(SUBDIRS); \
do \
(cd $$d; echo ### Making all in `pwd`;  \
-   if [ -f Makefile.PL ]; then \
+   if [ -f Makefile.PL -a ! -f Makefile ]; then \
   LIB_RT=$(LIB_RT) \
   BDB_LIB=$(BDB_LIB) BDB_INC=$(BDB_INC) \
   OPENSSL_LIB=$(OPENSSL_LIB) 
OPENSSL_INC=$(OPENSSL_INC) \
--- perl/sieve/Makefile.Oin Wed Oct 22 13:50:24 2003
+++ perl/sieve/Makefile.in  Fri Feb  9 18:02:16 2007
@@ -79,7 +79,7 @@
@for d in  $(SUBDIRS); \
do \
(cd $$d; echo ### Making all in `pwd`;  \
-   if [ -f Makefile.PL ]; then \
+   if [ -f Makefile.PL -a ! -f Makefile ]; then \
   LIB_RT=$(LIB_RT) \
   BDB_LIB=$(BDB_LIB) BDB_INC=$(BDB_INC) \
   OPENSSL_LIB=$(OPENSSL_LIB) 
OPENSSL_INC=$(OPENSSL_INC) \



--
Kenneth Murchison
Systems Programmer
Project Cyrus Developer/Maintainer
Carnegie Mellon University

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: The annoyance of repeating Makefiles

2007-02-10 Thread Gary Mills
On Tue, Jan 23, 2007 at 09:50:32AM -0500, Ken Murchison wrote:
 Gary Mills wrote:
 
 This behavior is annoying because I build the Cyrus software on a
 development server but then install it on other servers where there
 is no compiler and the source tree is mounted read-only.  This breaks
 `make install', which should only install things, not recompile them.
 Can this be fixed, or am I condemned to hack Makefiles myself?
 
 A 'make install' shouldn't compile anything if all of the generated 
 files already exist.  I would consider this a bug and would gladly 
 accept a patch which fixes this behavior.

I've attached a patch, against cyrus-imapd-2.3.8, that does just that.

-- 
-Gary Mills--Unix Support--U of M Academic Computing and Networking-
--- imap/Makefile.Oin   Tue Jan  9 11:41:35 2007
+++ imap/Makefile.inSat Feb 10 09:50:27 2007
@@ -123,7 +123,7 @@
lmtpstats.c lmtpstats.h xversion.h mupdate_err.c mupdate_err.h \
nntp_err.c nntp_err.h
 
-all: $(BUILTSOURCES) $(PROGS) $(SUIDPROGS)
+all: xversion $(BUILTSOURCES) $(PROGS) $(SUIDPROGS)
 
 pure: imapd.pure lmtpd.pure mupdate.pure
 
@@ -151,11 +151,10 @@
 
 ### Built Source Files
 
-xversion:
-   rm -f version.o
+xversion xversion.h:
AWK=$(AWK) $(srcdir)/xversion.sh
 
-xversion.h: xversion
+version.o: xversion.h
 
 pushstats.c: pushstats.snmp $(srcdir)/../snmp/snmpgen
$(srcdir)/../snmp/snmpgen $(srcdir)/pushstats.snmp
@@ -199,7 +198,7 @@
 $(SERVICE) lmtpd.o proxy.o $(LMTPOBJS) $(SIEVE_OBJS) \
 mutex_fake.o libimap.a $(SIEVE_LIBS) $(DEPLIBS) $(LIBS) $(LIB_WRAP)
 
-imapd: xversion $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
+imapd: $(IMAPDOBJS) mutex_fake.o libimap.a $(DEPLIBS) $(SERVICE)
$(CC) $(LDFLAGS) -o imapd \
 $(SERVICE) $(IMAPDOBJS) mutex_fake.o \
libimap.a $(DEPLIBS) $(LIBS) $(LIB_WRAP)
--- imap/xversion.Osh   Wed Oct 22 13:03:00 2003
+++ imap/xversion.shSat Feb 10 08:04:31 2007
@@ -9,12 +9,13 @@
 AWK=awk
 fi
 
+TMPF=/tmp/xversion.$$
 DATEPAT=[1-2][0-9][0-9][0-9]/[0-1][0-9]/[0-3][0-9]
 TIMEPAT=[0-2][0-9]:[0-5][0-9]:[0-5][0-9]
 
-printf /* Generated automatically by xversion.sh */\n\n  xversion.h
+printf /* Generated automatically by xversion.sh */\n\n  $TMPF
 
-printf #define CYRUS_CVSDATE   xversion.h
+printf #define CYRUS_CVSDATE   $TMPF
 
 find .. -name '*.[chly]' -print | \
xargs egrep '\$Id: ' | \
@@ -22,4 +23,12 @@
match ($0, pattern) {
printf \%s\\n, substr($0, RSTART, RLENGTH)
}' pattern=$DATEPAT $TIMEPAT | \
-   sort | tail -1  xversion.h
+   sort | tail -1  $TMPF
+
+if [ -f xversion.h ]  cmp -s $TMPF xversion.h
+then
+rm $TMPF
+else
+mv $TMPF xversion.h
+fi
+
--- perl/Makefile.Oin   Wed Oct 22 13:50:17 2003
+++ perl/Makefile.inFri Feb  9 17:54:37 2007
@@ -77,7 +77,7 @@
@for d in  $(SUBDIRS); \
do \
(cd $$d; echo ### Making all in `pwd`;  \
-   if [ -f Makefile.PL ]; then \
+   if [ -f Makefile.PL -a ! -f Makefile ]; then \
   LIB_RT=$(LIB_RT) \
   BDB_LIB=$(BDB_LIB) BDB_INC=$(BDB_INC) \
   OPENSSL_LIB=$(OPENSSL_LIB) 
OPENSSL_INC=$(OPENSSL_INC) \
--- perl/sieve/Makefile.Oin Wed Oct 22 13:50:24 2003
+++ perl/sieve/Makefile.in  Fri Feb  9 18:02:16 2007
@@ -79,7 +79,7 @@
@for d in  $(SUBDIRS); \
do \
(cd $$d; echo ### Making all in `pwd`;  \
-   if [ -f Makefile.PL ]; then \
+   if [ -f Makefile.PL -a ! -f Makefile ]; then \
   LIB_RT=$(LIB_RT) \
   BDB_LIB=$(BDB_LIB) BDB_INC=$(BDB_INC) \
   OPENSSL_LIB=$(OPENSSL_LIB) 
OPENSSL_INC=$(OPENSSL_INC) \

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Re: The annoyance of repeating Makefiles

2007-01-23 Thread Ken Murchison

Gary Mills wrote:

I've noticed for some time that whenever I type `make' in the Cyrus
source tree, it always recompiles something.  A repeated make should
evenually stop compiling but this one never does.  The worst offenders
are the various perl Makefiles which rebuild Makefile from Makefile.PL
every time, instead of only doing it when it's out of date.  This


I'm not a Perl guy, so I don't know if this is necessary or not.


causes the perl modules to be recompiled.  As well, imap/Makefile
recreates xversion.h each time, resulting in more recompiles.


We recreate xversion.h (and imapd as a result) so we get an accurate CVS 
timestamp in imapd for version reporting.




This behavior is annoying because I build the Cyrus software on a
development server but then install it on other servers where there
is no compiler and the source tree is mounted read-only.  This breaks
`make install', which should only install things, not recompile them.
Can this be fixed, or am I condemned to hack Makefiles myself?


A 'make install' shouldn't compile anything if all of the generated 
files already exist.  I would consider this a bug and would gladly 
accept a patch which fixes this behavior.


--
Kenneth Murchison
Project Cyrus Developer/Maintainer
Carnegie Mellon University

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: The annoyance of repeating Makefiles

2007-01-23 Thread Gary Mills
On Tue, Jan 23, 2007 at 09:50:32AM -0500, Ken Murchison wrote:
 Gary Mills wrote:
 I've noticed for some time that whenever I type `make' in the Cyrus
 source tree, it always recompiles something.  A repeated make should
 evenually stop compiling but this one never does.  The worst offenders
 are the various perl Makefiles which rebuild Makefile from Makefile.PL
 every time, instead of only doing it when it's out of date.  This
 
 I'm not a Perl guy, so I don't know if this is necessary or not.

The problem is that Makefile.PL is not really a Makefile.  It's run
by perl to create the Makefile.  I suppose that that should be done
by the configure step, not by the compile step.

 causes the perl modules to be recompiled.  As well, imap/Makefile
 recreates xversion.h each time, resulting in more recompiles.
 
 We recreate xversion.h (and imapd as a result) so we get an accurate CVS 
 timestamp in imapd for version reporting.

I'm not a CVS guy, but there must be a better way to accomplish this
without causing a recompile.

 This behavior is annoying because I build the Cyrus software on a
 development server but then install it on other servers where there
 is no compiler and the source tree is mounted read-only.  This breaks
 `make install', which should only install things, not recompile them.
 Can this be fixed, or am I condemned to hack Makefiles myself?
 
 A 'make install' shouldn't compile anything if all of the generated 
 files already exist.  I would consider this a bug and would gladly 
 accept a patch which fixes this behavior.

Is there a release coming soon, perhaps to fix the core dump that
we heard about?  If so, I'll use that distribution to work on a patch.

-- 
-Gary Mills--Unix Support--U of M Academic Computing and Networking-

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


Re: The annoyance of repeating Makefiles

2007-01-23 Thread Ken Murchison

Gary Mills wrote:

On Tue, Jan 23, 2007 at 09:50:32AM -0500, Ken Murchison wrote:

Gary Mills wrote:

I've noticed for some time that whenever I type `make' in the Cyrus
source tree, it always recompiles something.  A repeated make should
evenually stop compiling but this one never does.  The worst offenders
are the various perl Makefiles which rebuild Makefile from Makefile.PL
every time, instead of only doing it when it's out of date.  This

I'm not a Perl guy, so I don't know if this is necessary or not.


The problem is that Makefile.PL is not really a Makefile.  It's run
by perl to create the Makefile.  I suppose that that should be done
by the configure step, not by the compile step.


Sounds reasonable to me.



causes the perl modules to be recompiled.  As well, imap/Makefile
recreates xversion.h each time, resulting in more recompiles.
We recreate xversion.h (and imapd as a result) so we get an accurate CVS 
timestamp in imapd for version reporting.


I'm not a CVS guy, but there must be a better way to accomplish this
without causing a recompile.


If there is, I'd love for somebody to tell me.  We look at the CVS 
timestamp of ALL of the source files and then put that into xversion.h




This behavior is annoying because I build the Cyrus software on a
development server but then install it on other servers where there
is no compiler and the source tree is mounted read-only.  This breaks
`make install', which should only install things, not recompile them.
Can this be fixed, or am I condemned to hack Makefiles myself?
A 'make install' shouldn't compile anything if all of the generated 
files already exist.  I would consider this a bug and would gladly 
accept a patch which fixes this behavior.


Is there a release coming soon, perhaps to fix the core dump that
we heard about?  If so, I'll use that distribution to work on a patch.


There will be a release as soon as I track down and fix the bug that 
causes mupdate to randomly spin in 2.3.



--
Kenneth Murchison
Project Cyrus Developer/Maintainer
Carnegie Mellon University

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html


The annoyance of repeating Makefiles

2007-01-18 Thread Gary Mills
I've noticed for some time that whenever I type `make' in the Cyrus
source tree, it always recompiles something.  A repeated make should
evenually stop compiling but this one never does.  The worst offenders
are the various perl Makefiles which rebuild Makefile from Makefile.PL
every time, instead of only doing it when it's out of date.  This
causes the perl modules to be recompiled.  As well, imap/Makefile
recreates xversion.h each time, resulting in more recompiles.

This behavior is annoying because I build the Cyrus software on a
development server but then install it on other servers where there
is no compiler and the source tree is mounted read-only.  This breaks
`make install', which should only install things, not recompile them.
Can this be fixed, or am I condemned to hack Makefiles myself?

-- 
-Gary Mills--Unix Support--U of M Academic Computing and Networking-

Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html