Add to git.
[makeplus.git] / configure_start.sh
1 #!/bin/sh
2 #
3 # This is make+. Make+ is a set of scripts which enhance GNU make and
4 # let ou build RPMs, and other packages types with just one control
5 # file. Read more at http://www.annexia.org/freeware/makeplus/
6 #
7 # The original author is Richard W.M. Jones <rich@annexia.org>.
8 #
9 # This software has been explicitly placed in the PUBLIC DOMAIN.  You
10 # do not need any sort of license or agreement to use or copy this
11 # software. You may also copyright this software yourself, and/or
12 # relicense it under any terms you want, at any time and at no cost.
13 # This allows you (among other things) to include this software with
14 # other packages so that the user does not need to download and
15 # install make+ separately.
16
17 set -e
18
19 # Check the 'config.mk' file doesn't exist. If it does exist then this
20 # is a serious problem because it will override command line arguments
21 # (which, when doing a configure, we want). The user really ought to be
22 # running the ./configure shell script which removes this file.
23 if [ -f config.mk ]; then
24     echo "configure: config.mk: file found (which is an error)"
25     echo "configure: Before running 'make+ configure', you must remove this"
26     echo "configure: file, or the build directory. You could also do:"
27     echo "configure:   ./configure [--help]"
28     exit 1
29 fi
30
31 rm -f config.h config.log
32
33 cat > config.h <<EOF
34 /* Generated automatically by make+. */
35
36 #ifndef MP_CONFIG_H
37 #define MP_CONFIG_H
38
39 #define PACKAGE "$PACKAGE"
40 #define VERSION "$VERSION"
41 EOF
42
43 cat > config.mk <<EOF
44 prefix          = $prefix
45 bindir          = $bindir
46 sbindir         = $sbindir
47 libexecdir      = $libexecdir
48 datadir         = $datadir
49 sysconfdir      = $sysconfdir
50 sharedstatedir  = $sharedstatedir
51 localstatedir   = $localstatedir
52 libdir          = $libdir
53 infodir         = $infodir
54 includedir      = $includedir
55 pkgdatadir      = $pkgdatadir
56 docdir          = $docdir
57 pkgetcdir       = $pkgetcdir
58 pkglibdir       = $pkglibdir
59 pkgincludedir   = $pkgincludedir
60 manprefix       = $manprefix
61 mandir          = $mandir
62 man1dir         = $man1dir
63 man2dir         = $man2dir
64 man3dir         = $man3dir
65 man4dir         = $man4dir
66 man5dir         = $man5dir
67 man6dir         = $man6dir
68 man7dir         = $man7dir
69 man8dir         = $man8dir
70 manndir         = $manndir
71 manldir         = $manldir
72 EOF