do use an 'unknown' arch-specification in test
[ntk/apt.git] / buildlib / configure.mak
... / ...
CommitLineData
1# -*- make -*-
2
3# This make fragment is included by the toplevel make to handle configure
4# and setup. It defines a target called startup that when run will init
5# the build directory, generate configure from configure.ac, create aclocal
6# and has rules to run config.status should one of the .in files change.
7
8# Input
9# BUILDDIR - The build directory
10# CONVERTED - List of files output by configure $(BUILD) is prepended
11# The caller must provide depends for these files
12# It would be a fairly good idea to run this after a cvs checkout.
13BUILDDIR=build
14
15.PHONY: startup missing-config-files
16startup: configure $(BUILDDIR)/config.status $(addprefix $(BUILDDIR)/,$(CONVERTED))
17
18# use the files provided from the system instead of carry around
19# and use (most of the time outdated) copycats
20ifeq (file-okay,$(shell test -r buildlib/config.sub && echo 'file-okay'))
21buildlib/config.sub:
22else
23 ifeq (file-okay,$(shell test -r /usr/share/misc/config.sub && echo 'file-okay'))
24buildlib/config.sub:
25 ln -sf /usr/share/misc/config.sub buildlib/config.sub
26 else
27buildlib/config.sub: missing-config-files
28 endif
29endif
30
31ifeq (file-okay,$(shell test -r buildlib/config.guess && echo 'file-okay'))
32buildlib/config.guess:
33else
34 ifeq (file-okay,$(shell test -r /usr/share/misc/config.guess && echo 'file-okay'))
35buildlib/config.guess:
36 ln -sf /usr/share/misc/config.guess buildlib/config.guess
37 else
38buildlib/config.guess: missing-config-files
39 endif
40endif
41
42missing-config-files:
43 @echo "APT needs 'config.guess' and 'config.sub' in buildlib/ for configuration."
44 @echo "On Debian systems these are available in the 'autotools-dev' package."
45 @echo
46 @echo "The latest versions can be acquired from the upstream git repository:"
47 @echo "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
48 @echo "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
49 exit 100
50
51configure: aclocal.m4 configure.ac buildlib/config.guess buildlib/config.sub
52 autoconf
53
54aclocal.m4: $(wildcard buildlib/*.m4)
55 aclocal -I buildlib
56
57$(BUILDDIR)/config.status: configure
58 /usr/bin/test -e $(BUILDDIR) || mkdir $(BUILDDIR)
59 (HERE=`pwd`; cd $(BUILDDIR) && $$HERE/configure)
60
61$(addprefix $(BUILDDIR)/,$(CONVERTED)): $(BUILDDIR)/config.status