]> err.no Git - pkg-config/blob - autogen.sh
Print out \r\n on windows, not just \n
[pkg-config] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 srcdir=`dirname $0`
5 test -z "$srcdir" && srcdir=.
6
7 ORIGDIR=`pwd`
8 cd $srcdir
9
10 PROJECT=pkg-config
11 TEST_TYPE=-f
12 FILE=pkg.m4
13
14 DIE=0
15
16 AUTOCONF=autoconf2.50
17 AUTOHEADER=autoheader2.50
18
19 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
20         AUTOCONF=autoconf
21         AUTOHEADER=autoheader
22 }
23
24
25 ($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
26         echo
27         echo "You must have autoconf installed to compile $PROJECT."
28         echo "Download the appropriate package for your distribution,"
29         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
30         DIE=1
31 }
32
33 AUTOMAKE=automake-1.7
34 ACLOCAL=aclocal-1.7
35
36 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
37         AUTOMAKE=automake
38         ACLOCAL=aclocal
39 }
40
41 ($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
42         echo
43         echo "You must have automake installed to compile $PROJECT."
44         echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz"
45         echo "(or a newer version if it is available)"
46         DIE=1
47 }
48
49 if test "$DIE" -eq 1; then
50         exit 1
51 fi
52
53 test $TEST_TYPE $FILE || {
54         echo "You must run this script in the top-level $PROJECT directory"
55         exit 1
56 }
57
58 rm -r glib-1.2.10
59 gunzip --stdout glib-1.2.10.tar.gz | tar xf - || { 
60     echo "glib tarball not unpacked"
61     exit 1
62 }
63
64 chmod +w `find glib-1.2.10 -name Makefile.am`
65 perl -p -i.bak -e "s/lib_LTLIBRARIES/noinst_LTLIBRARIES/g" `find glib-1.2.10 -name Makefile.am`
66 perl -p -i.bak -e "s/bin_SCRIPTS/noinst_SCRIPTS/g" `find glib-1.2.10 -name Makefile.am`
67 perl -p -i.bak -e "s/include_HEADERS/noinst_HEADERS/g" `find glib-1.2.10 -name Makefile.am`
68 perl -p -i.bak -e "s/glibnoinst_HEADERS/noinst_HEADERS/g" `find glib-1.2.10 -name Makefile.am`
69 perl -p -i.bak -e 's/([a-zA-Z0-9]+)_DATA/noinst_DATA/g' `find glib-1.2.10 -name Makefile.am`
70 perl -p -i.bak -e "s/info_TEXINFOS/noinst_TEXINFOS/g" `find glib-1.2.10 -name Makefile.am`
71 perl -p -i.bak -e "s/man_MANS/noinst_MANS/g" `find glib-1.2.10 -name Makefile.am`
72
73 ## patch gslist.c to have stable sort
74 perl -p -w -i.bak -e 's/if \(compare_func\(l1->data,l2->data\) < 0\)/if \(compare_func\(l1->data,l2->data\) <= 0\)/g' glib-1.2.10/gslist.c
75
76 # Update random auto* files to actually have something which have a snowball's
77 # chance in a hot place of working with modern auto* tools.
78
79 (cd glib-1.2.10 && for p in ../glib-patches/*.diff; do echo $p; patch -p1 < $p || exit 1; done ) || exit 1
80
81 (cd glib-1.2.10 && libtoolize --copy --force && $ACLOCAL $ACLOCAL_FLAGS && $AUTOMAKE && $AUTOCONF) || exit 1
82
83 run_configure=yes
84 if test -z "$*"; then
85         echo "I am going to run ./configure with no arguments - if you wish "
86         echo "to pass any to it, please specify them on the $0 command line."
87 else
88     case "--no-configure" in
89         "*$") run_configure=no
90     esac
91 fi
92
93 libtoolize --copy --force
94
95 echo $ACLOCAL $ACLOCAL_FLAGS
96 $ACLOCAL $ACLOCAL_FLAGS
97
98 # optionally feature autoheader
99 ($AUTOHEADER --version)  < /dev/null > /dev/null 2>&1 && $AUTOHEADER
100
101 $AUTOMAKE -a $am_opt
102 $AUTOCONF
103
104 cd $ORIGDIR
105
106 if [ "$run_configure" = "yes" ]; then
107     export AUTOMAKE
108     export ACLOCAL
109     $srcdir/configure --enable-maintainer-mode --disable-shared --disable-threads "$@"
110     echo 
111     echo "Now type 'make' to compile $PROJECT."
112 else
113     echo "Now type './configure && make' to compile $PROJECT."
114 fi