2 # Merge pkg-config macros into Emacs sources.
5 # admin/merge-pkg-config
7 # Copyright 2014-2015 Free Software Foundation, Inc.
9 # This file is part of GNU Emacs.
11 # GNU Emacs is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # GNU Emacs is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24 # written by Paul Eggert
27 # Maybe ACLOCAL_PATH is already set-up.
30 for dir
in $ACLOCAL_PATH ''; do
31 test -n "$dir" && test -r "$dir/pkg.m4" && break
37 # Use the pkg.m4 installed where aclocal knows about it.
38 # Maybe we are running our own aclocal, which doesn't know where
39 # the standard pkg.m4 is installed, so try running all the
40 # aclocal programs in our PATH.
43 for dir
in $PATH ''; do
44 if test -n "$dir" && test -x "$dir/aclocal"; then
45 dir
=$
("$dir/aclocal" --print-ac-dir) && test -r "$dir/pkg.m4" && break
52 printf >&2 '%s\n' "$0: cannot find pkg.m4"
57 printf >&2 '%s\n' "$0: please run this command in the main source directory"
61 printf >&2 '%s\n' "$0: copying $dir/pkg.m4 to m4/pkg.m4"