xref: /aosp_15_r20/external/pcre/autogen.sh (revision 22dc650d8ae982c6770746019a6f94af92b0f024)
1#!/bin/sh
2
3# Running aclocal here first (as happened for a while) caused the macros that
4# libtoolize puts in the m4 directory to be newer than the aclocal.m4 file that
5# aclocal creates. This meant that the next "make" cause aclocal to be run
6# again. Moving aclocal to after libtoolize does not seem to cause any
7# problems, and it fixes this issue.
8
9# GNU libtool is named differently on some systems.  This code tries several
10# variants like glibtoolize (MacOSX) and libtoolize1x (FreeBSD)
11
12set +ex
13echo "Looking for a version of libtoolize (which can have different names)..."
14libtoolize=""
15for l in glibtoolize libtoolize15 libtoolize14 libtoolize ; do
16    $l --version > /dev/null 2>&1
17    if [ $? = 0 ]; then
18        libtoolize=$l
19        echo "Found $l"
20        break
21    fi
22    echo "Did not find $l"
23done
24
25if [ "x$libtoolize" = "x" ]; then
26    echo "Can't find libtoolize on your system"
27    exit 1
28fi
29
30set -ex
31$libtoolize -c -f
32rm -rf autom4te.cache Makefile.in aclocal.m4
33aclocal --force -I m4
34autoconf -f -W all,no-obsolete
35autoheader -f -W all
36
37# Added no-portability to suppress automake 1.12's warning about the use
38# of recursive variables.
39
40automake -a -c -f -W all,no-portability
41
42rm -rf autom4te.cache
43exit 0
44
45# end autogen.sh
46