Re: [patch] mkinstalldirs used conditionally

2002-03-18 Thread Akim Demaille

 Tom == Tom Tromey [EMAIL PROTECTED] writes:

 Roger == Roger Leigh [EMAIL PROTECTED] writes:
Roger I sent a link to my patch a week ago, but I didn't see any
Roger reply.  Is there anything wrong with this patch?

Tom This is actually a tricky area.  For instance, how is the
Tom `installdirs' target going to work?  This target is sort of
Tom bogus, I think, but it is also in the standards.

From time to time, it is possible to change the standards.  If we can
understand why they're in, good.  In we manage to convince RMS to
remove this, better.  Shall we try?




Re: [patch] mkinstalldirs used conditionally

2002-03-18 Thread Akim Demaille

 Tom == Tom Tromey [EMAIL PROTECTED] writes:

Roger True.  It won't be compatible with a traditional BSD install
Roger though, AFAIK.

Too bad :P

Tom Yeah.  This is a problem because install-sh is slow.  I
Tom occasionally hear complaints about this.

Well, we could spare it the multiple launches:

## Funny invocation because Makefile variable can be empty, leading to
## a syntax error in sh.
@list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \
## A file can be in the source directory or the build directory.
  if test -f $$p; then d=; else d=$(srcdir)/; fi; \
## If the _%PRIMARY% variable has an entry like foo/bar, install it as
## $(destdir)/bar, not $(destdir)/foo/bar.  The user can make a
## new dir variable or use a nobase_ target for the latter case.
?BASE?f=`echo $$p | sed -e 's|^.*/||'`; \
?!BASE?   f=$$p; \
  echo  $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \
  $(%DIR%%PRIMARY%_INSTALL) $$d$$p $(DESTDIR)$(%NDIR%dir)/$$f; \
done

invokes it for each file.  Moving to the GNU Install-into-a-dir makes
this a single call, so we might actually recover some speed.





Re: [patch] mkinstalldirs used conditionally

2002-03-17 Thread Tom Tromey

 Roger == Roger Leigh [EMAIL PROTECTED] writes:

Akim IMHO, this is obfuscating the code.  The real means (again,
Akim IMHO) to address this issue should be to use an install-sh which
Akim creates the directories and their parents when needed.

[ ... ]

Roger True.  It won't be compatible with a traditional BSD install
Roger though, AFAIK.

Yeah.  This is a problem because install-sh is slow.  I occasionally
hear complaints about this.

We still need mkinstalldirs for the installdirs target (which won't
work perfectly with your change -- but nobody apparently uses this
anyway), and maybe dist or something like that (I don't recall, but
ISTR it is used elsewhere).

Tom




Re: [patch] mkinstalldirs used conditionally

2002-03-17 Thread Tom Tromey

 Roger == Roger Leigh [EMAIL PROTECTED] writes:

Roger I sent a link to my patch a week ago, but I didn't see any
Roger reply.  Is there anything wrong with this patch?

This is actually a tricky area.
For instance, how is the `installdirs' target going to work?
This target is sort of bogus, I think, but it is also in the standards.

Tom




Re: [patch] mkinstalldirs used conditionally

2002-03-14 Thread Roger Leigh

On Mon, Mar 11, 2002 at 03:34:56PM +0100, Akim Demaille wrote:
 
 IMHO, this is obfuscating the code.  The real means (again, IMHO) to
 address this issue should be to use an install-sh which creates the
 directories and their parents when needed.

That would be ideal.

 It simplifies the code, addresses your issue, and also guarantees that
 in the future, all such targets will behave as you suggest.

True.  It won't be compatible with a traditional BSD install though,
AFAIK.

 Would you contribute the AC_PROG_INSTALL macro and install-sh updates?

I will try to.

If install creates the directories, mkinstalldirs will have to be
removed from the automake rules.  This will necessitate autoconf/make
*only* using the install-sh included in the source, or else installdirs
will not be created.

Is this correct?
I can update install-sh to create installdirs, but what should I do
about other installs?  If we don't use install-sh, how do we create
directories?  Can this use install-sh as a wrapper to call other
installs?

-- 
Roger Leigh
** Registration Number: 151826, http://counter.li.org **
Need Epson Stylus Utilities? http://gimp-print.sourceforge.net/
GPG Public Key: 0x25BFB848 available on public keyservers




Re: [patch] mkinstalldirs used conditionally

2002-03-11 Thread Akim Demaille


IMHO, this is obfuscating the code.  The real means (again, IMHO) to
address this issue should be to use an install-sh which creates the
directories and their parents when needed.

It simplifies the code, addresses your issue, and also guarantees that
in the future, all such targets will behave as you suggest.

Would you contribute the AC_PROG_INSTALL macro and install-sh updates?




Re: [patch] mkinstalldirs used conditionally

2002-03-11 Thread Alexandre Duret-Lutz

 Akim == Akim Demaille [EMAIL PROTECTED] writes:
D
 Akim IMHO, this is obfuscating the code.  The real means (again, IMHO) to
 Akim address this issue should be to use an install-sh which creates the
 Akim directories and their parents when needed.

 Akim It simplifies the code, addresses your issue, and also guarantees that
 Akim in the future, all such targets will behave as you suggest.

 Akim Would you contribute the AC_PROG_INSTALL macro and install-sh updates?

AFAICT install-sh already does this.  This is why we use it to
install nobase_ files.

-- 
Alexandre Duret-Lutz





[patch] mkinstalldirs used conditionally

2002-03-08 Thread Roger Leigh

I sent a link to my patch a week ago, but I didn't see any reply.  Is
there anything wrong with this patch?

Regards,
Roger

diff -urN automake/lib/am/data.am automake-new/lib/am/data.am
--- automake/lib/am/data.am Fri Nov  9 16:25:03 2001
+++ automake-new/lib/am/data.am Fri Mar  1 23:26:36 2002
 -28,7 +28,9 
 ?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
 install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
+   if test -n '$(%DIR%_%PRIMARY%)'; then \
+ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+   fi
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \
diff -urN automake/lib/am/java.am automake-new/lib/am/java.am
--- automake/lib/am/java.am Wed May 30 03:02:50 2001
+++ automake-new/lib/am/java.am Sat Mar  2 00:39:10 2002
 -42,7 +42,9 
 ?!EXEC?.PHONY install-data-am: install-%DIR%JAVA
 install-%DIR%JAVA: class%DIR%.stamp
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
+   if test -n '$(%DIR%_JAVA)'; then \
+ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+   fi
 ## A single .java file can be compiled into multiple .class files.  So
 ## we just install all the .class files that got built into this
 ## directory.  This is not optimal, but will have to do for now.
diff -urN automake/lib/am/libs.am automake-new/lib/am/libs.am
--- automake/lib/am/libs.am Thu Jun 28 16:06:50 2001
+++ automake-new/lib/am/libs.am Fri Mar  1 23:26:36 2002
 -37,7 +37,9 
 ?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
 install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
+   if test -n '$(%DIR%_LIBRARIES)'; then \
+ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+   fi
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
list='$(%DIR%_LIBRARIES)'; for p in $$list; do \
diff -urN automake/lib/am/lisp.am automake-new/lib/am/lisp.am
--- automake/lib/am/lisp.am Fri Nov  9 16:25:03 2001
+++ automake-new/lib/am/lisp.am Fri Mar  1 23:26:36 2002
 -44,7 +44,9 
$(NORMAL_INSTALL)
 ## lispdir might not be defined.
if test -n $(lispdir); then \
- $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+ if test -n '$(%DIR%_LISP)'; then \
+   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+ fi; \
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
  list='$(%DIR%_LISP)'; for p in $$list; do \
diff -urN automake/lib/am/ltlib.am automake-new/lib/am/ltlib.am
--- automake/lib/am/ltlib.amMon Apr  9 10:50:33 2001
+++ automake-new/lib/am/ltlib.amFri Mar  1 23:26:36 2002
 -27,7 +27,9 
 ?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
 install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
+   if test -n '$(%DIR%_LTLIBRARIES)'; then \
+ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+   fi
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
diff -urN automake/lib/am/mans.am automake-new/lib/am/mans.am
--- automake/lib/am/mans.am Sun May  6 06:40:47 2001
+++ automake-new/lib/am/mans.am Sat Mar  2 00:43:25 2002
 -31,7 +31,6 
 .PHONY install-man: install-man%SECTION%
 install-man%SECTION%: $(man%SECTION%_MANS) $(man_MANS)
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(man%SECTION%dir)
list='$(man%SECTION%_MANS) $(dist_man%SECTION%_MANS) 
$(nodist_man%SECTION%_MANS)'; \
 ## Extract all items from man_MANS that should go in this section.
 ## This must be done dynamically to support conditionals.
 -42,6 +41,10 
*.%SECTION%*) list=$$list $$i ;; \
  esac; \
done; \
+## Make the installation directory if there are MANS to install
+   if test -n `echo $$list | sed -e 's/ //g'`; then \
+ $(mkinstalldirs) $(DESTDIR)$(man%SECTION%dir); \
+   fi; \
for i in $$list; do \
 ## Find the file.
  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
diff -urN automake/lib/am/progs.am automake-new/lib/am/progs.am
--- automake/lib/am/progs.amSun Jul 22 22:50:18 2001
+++ automake-new/lib/am/progs.amFri Mar  1 23:26:36 2002
 -28,7 +28,9 
 ?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
 install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
$(NORMAL_INSTALL)
-   $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir)
+   if test -n '$(%DIR%_PROGRAMS)'; then \
+ $(mkinstalldirs) $(DESTDIR)$(%NDIR%dir); \
+   fi
 ## Funny invocation because Makefile variable can be empty, leading to
 ## a syntax error in sh.
list='$(%DIR%_PROGRAMS)'; for p in $$list; do \
diff -urN automake/lib/am/python.am