Permalink
Browse files

Use mkinstalldirs, because "mkdir -p" is not portable.

  • Loading branch information...
1 parent 8aa7592 commit 6ff9669aa7088ccec3acb0429e7a66a51e414c29 @bhaible bhaible committed Aug 20, 2000
Showing with 61 additions and 18 deletions.
  1. +7 −0 ChangeLog
  2. +11 −16 doc/Makefile.in
  3. +40 −0 mkinstalldirs
  4. +3 −2 src/Makefile.in
View
@@ -1,5 +1,12 @@
2000-08-20 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
+ * mkinstalldirs: New file, from automake-1.4, grep-2.4.1, guile-1.4,
+ libtool-1.3.3, make-3.79.1, tar-1.13.
+ * srcdir/Makefile.in (MKINSTALLDIRS): New variable.
+ (install, installdirs): Use it instead of mkdir.
+ * docdir/Makefile.in (MKINSTALLDIRS): New variable.
+ (install, installdirs): Use it instead of mkdir.
+
* INSTALL: Update.
2000-08-19 Bruno Haible <bruno@linuix.math.u-bordeaux.fr>
View
@@ -51,6 +51,7 @@ TEXI2HTML = texi2html
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = $(SHELL) $(srcdir)/../mkinstalldirs
#### End of system configuration section. ####
@@ -92,29 +93,23 @@ gperf_toc.html : $(srcdir)/gperf.texi $(srcdir)/gpl.texinfo
install : all force
- if [ ! -d $(DESTDIR)$(infodir) ] ; then mkdir $(DESTDIR)$(infodir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(infodir)
$(INSTALL_DATA) $(srcdir)/gperf.info $(DESTDIR)$(infodir)/gperf.info
- if [ ! -d $(DESTDIR)$(mandir) ] ; then mkdir $(DESTDIR)$(mandir) ; fi
- if [ ! -d $(DESTDIR)$(man1dir) ] ; then mkdir $(DESTDIR)$(man1dir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(srcdir)/gperf.1 $(DESTDIR)$(man1dir)/gperf.1
- if [ ! -d $(DESTDIR)$(datadir)/doc ] ; then mkdir $(DESTDIR)$(datadir)/doc ; fi
- if [ ! -d $(DESTDIR)$(docdir) ] ; then mkdir $(DESTDIR)$(docdir) ; fi
-# if [ ! -d $(DESTDIR)$(dvidir) ] ; then mkdir $(DESTDIR)$(dvidir) ; fi
+# $(MKINSTALLDIRS) $(DESTDIR)$(dvidir)
# $(INSTALL_DATA) $(srcdir)/gperf.dvi $(DESTDIR)$(dvidir)/gperf.dvi
-# if [ ! -d $(DESTDIR)$(psdir) ] ; then mkdir $(DESTDIR)$(psdir) ; fi
+# $(MKINSTALLDIRS) $(DESTDIR)$(psdir)
# $(INSTALL_DATA) $(srcdir)/gperf.ps $(DESTDIR)$(dvidir)/gperf.ps
- if [ ! -d $(DESTDIR)$(htmldir) ] ; then mkdir $(DESTDIR)$(htmldir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(htmldir)
$(INSTALL_DATA) $(srcdir)/gperf.html $(DESTDIR)$(htmldir)/gperf.html
installdirs : force
- if [ ! -d $(DESTDIR)$(infodir) ] ; then mkdir $(DESTDIR)$(infodir) ; fi
- if [ ! -d $(DESTDIR)$(mandir) ] ; then mkdir $(DESTDIR)$(mandir) ; fi
- if [ ! -d $(DESTDIR)$(man1dir) ] ; then mkdir $(DESTDIR)$(man1dir) ; fi
- if [ ! -d $(DESTDIR)$(datadir)/doc ] ; then mkdir $(DESTDIR)$(datadir)/doc ; fi
- if [ ! -d $(DESTDIR)$(docdir) ] ; then mkdir $(DESTDIR)$(docdir) ; fi
-# if [ ! -d $(DESTDIR)$(dvidir) ] ; then mkdir $(DESTDIR)$(dvidir) ; fi
-# if [ ! -d $(DESTDIR)$(psdir) ] ; then mkdir $(DESTDIR)$(psdir) ; fi
- if [ ! -d $(DESTDIR)$(htmldir) ] ; then mkdir $(DESTDIR)$(htmldir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(infodir)
+ $(MKINSTALLDIRS) $(DESTDIR)$(man1dir)
+# $(MKINSTALLDIRS) $(DESTDIR)$(dvidir)
+# $(MKINSTALLDIRS) $(DESTDIR)$(psdir)
+ $(MKINSTALLDIRS) $(DESTDIR)$(htmldir)
uninstall : force
$(RM) $(DESTDIR)$(infodir)/gperf.info
View
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id$
+
+errstatus=0
+
+for file
+do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d
+ do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ fi
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
View
@@ -51,6 +51,7 @@ RM = rm -f
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = $(SHELL) $(srcdir)/../mkinstalldirs
#### End of system configuration section. ####
@@ -121,11 +122,11 @@ version.o : version.cc $(VERSION_H)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(srcdir)/version.cc
install : all force
- if [ ! -d $(DESTDIR)$(bindir) ] ; then mkdir $(DESTDIR)$(bindir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(TARGETPROG) $(DESTDIR)$(bindir)/$(TARGETPROG)
installdirs : force
- if [ ! -d $(DESTDIR)$(bindir) ] ; then mkdir $(DESTDIR)$(bindir) ; fi
+ $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
uninstall : force
$(RM) $(DESTDIR)$(bindir)/$(TARGETPROG)

0 comments on commit 6ff9669

Please sign in to comment.