"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/instdir-no-empty.sh" (19 Nov 2020, 3036 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "instdir-no-empty.sh": 1.16.2_vs_1.16.3.

    1 #! /bin/sh
    2 # Copyright (C) 2012-2020 Free Software Foundation, Inc.
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2, or (at your option)
    7 # any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License
   15 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 # An empty "foo_PRIMARY" declaration should *not* cause "make install"
   18 # to create directory $(foodir).  See automake bug#10997 and bug#11030.
   19 
   20 required='makeinfo tex texi2dvi dvips'
   21 . test-init.sh
   22 
   23 cat >> configure.ac <<'END'
   24 AC_SUBST([CC], [whatever])
   25 AC_SUBST([JAVAC], [whatever])
   26 AM_PATH_PYTHON(,,:)
   27 AC_OUTPUT
   28 END
   29 
   30 cat > Makefile.am << 'END'
   31 AUTOMAKE_OPTIONS = no-dependencies
   32 mydir = $(prefix)/my
   33 myexecdir = $(prefix)/myexec
   34 javadir = $(prefix)/java
   35 END
   36 
   37 # Write Makefile.am.
   38 {
   39 
   40   for dir in sbin bin libexec pkglibexec myexec; do
   41     for dst in '' dist_ nodist_; do
   42       echo "${dst}${dir}_SCRIPTS ="
   43     done
   44     echo "${dir}_PROGRAMS ="
   45   done
   46 
   47   for dir in lib pkglib myexec my; do
   48     echo "${dir}_LIBRARIES ="
   49     echo "${dir}_LTLIBRARIES ="
   50   done
   51 
   52   for p1 in '' notrans_; do
   53     for p2 in '' dist_ nodist_; do
   54       for s in '' 1 2 3 4 5 6 7 8 9; do
   55         echo "${p1}${p2}man${s}_MANS ="
   56       done
   57     done
   58   done
   59 
   60   for dst in '' dist_ nodist_; do
   61     for dir in dataroot data pkgdata doc lisp my; do
   62       echo "${dst}${dir}_DATA ="
   63     done
   64     for dir in include pkginclude oldinclude my; do
   65       echo "${dst}${dir}_HEADERS ="
   66     done
   67     for dir in python my; do
   68       echo "${dst}${dir}_PYTHON ="
   69     done
   70     for dir in info my; do
   71       echo "${dst}${dir}_TEXINFOS ="
   72     done
   73     for dir in java my; do
   74       echo "${dst}${dir}_JAVA ="
   75     done
   76     for dir in lisp my; do
   77       echo "${dst}${dir}_LISP ="
   78     done
   79   done
   80 
   81 } > t
   82 
   83 cat t >> Makefile.am
   84 sed 's/^/nobase_/' t >> Makefile.am
   85 rm -f t
   86 
   87 cat Makefile.am # For debugging.
   88 
   89 # Sanity check.
   90 grep '^oldinclude_HEADERS =' Makefile.am \
   91   && grep '^nodist_my_PYTHON =' Makefile.am \
   92   && grep '^notrans_dist_man5_MANS =' Makefile.am \
   93   || fatal_ "creating Makefile.am"
   94 
   95 $ACLOCAL
   96 $AUTOCONF
   97 $AUTOMAKE -a
   98 
   99 cwd=$(pwd) || fatal_ "getting current working directory"
  100 
  101 doinst ()
  102 {
  103   run_make install install-pdf install-ps install-dvi ${1+"$@"}
  104 }
  105 
  106 : > foo.sh
  107 
  108 ./configure --prefix="$cwd/inst"
  109 doinst
  110 test ! -e inst || { find inst; exit 1; }
  111 $MAKE uninstall
  112 doinst bin_SCRIPTS=foo.sh
  113 test -f inst/bin/foo.sh
  114 
  115 # Explicitly pass prefix to avoid spurious influences from
  116 # global config.site scripts.
  117 ./configure --prefix="/usr/local"
  118 test ! -e dest || { find dest; exit 1; }
  119 $MAKE uninstall
  120 doinst DESTDIR="$cwd/dest" bin_SCRIPTS=foo.sh
  121 test -f dest/usr/local/bin/foo.sh
  122 
  123 :