f1439a63 |
1 | #! /bin/sh |
2 | # This script makes the autoconf mechanism for the Unix port work. |
3 | # It's separate from mkfiles.pl because it won't work (and isn't needed) |
4 | # on a non-Unix system. |
5 | |
9f77212d |
6 | # Persuade automake to give us a copy of its install-sh. This is a |
7 | # pain because I don't actually want to have to _use_ automake. |
8 | # Instead, I construct a trivial unrelated automake project in a |
9 | # temporary subdirectory, run automake so that it'll copy |
10 | # install-sh into that directory, then copy it back out again. |
11 | # Hideous, but it should work. |
12 | |
13 | mkdir automake-grievous-hack |
14 | cat > automake-grievous-hack/hello.c << EOF |
15 | #include <stdio.h> |
16 | int main(int argc, char **argv) |
17 | { |
18 | printf("hello, world\n"); |
19 | return 0; |
20 | } |
21 | EOF |
22 | cat > automake-grievous-hack/Makefile.am << EOF |
23 | bin_PROGRAMS = hello |
24 | hello_SOURCES = hello.c |
25 | EOF |
26 | cat > automake-grievous-hack/configure.ac << EOF |
27 | AC_INIT |
28 | AM_INIT_AUTOMAKE(hello, 1.0) |
29 | AC_CONFIG_FILES([Makefile]) |
30 | AC_PROG_CC |
31 | AC_OUTPUT |
32 | EOF |
33 | echo Some news > automake-grievous-hack/NEWS |
34 | echo Some text > automake-grievous-hack/README |
35 | echo Some people > automake-grievous-hack/AUTHORS |
36 | echo Some changes > automake-grievous-hack/ChangeLog |
37 | rm -f install-sh # this won't work if we accidentally have one _here_ |
38 | (cd automake-grievous-hack && autoreconf -i && \ |
39 | cp install-sh ../unix/install-sh) |
40 | rm -rf automake-grievous-hack |
41 | |
42 | # That was the hard bit. Now run autoconf on our real configure.in. |
43 | (cd unix && autoreconf && rm -rf aclocal.m4 autom4te.cache) |