]> git.ipfire.org Git - thirdparty/lldpd.git/blob - autogen.sh
build: on OSX, use glibtoolize by default
[thirdparty/lldpd.git] / autogen.sh
1 #!/bin/sh
2
3 set -e
4
5 [ ! -d .gitmodules ] || {
6 echo "autogen.sh: updating git submodules"
7 git submodule init
8 git submodule update
9 }
10
11 case "$(uname)" in
12 Darwin)
13 LIBTOOLIZE=${LIBTOOLIZE:-glibtoolize}
14 ;;
15 *)
16 LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
17 ;;
18 esac
19 AUTORECONF=${AUTORECONF:-autoreconf}
20 ACLOCAL=${ACLOCAL:-aclocal}
21 AUTOCONF=${AUTOCONF:-autoconf}
22 AUTOHEADER=${AUTOHEADER:-autoheader}
23 AUTOMAKE=${AUTOMAKE:-automake}
24
25 echo "autogen.sh: start libtoolize to get ltmain.sh"
26 ${LIBTOOLIZE} --copy --force
27 echo "autogen.sh: reconfigure with autoreconf"
28 ${AUTORECONF} -vif -I m4 || {
29 echo "autogen.sh: autoreconf has failed ($?), let's do it manually"
30 for dir in $PWD *; do
31 [ -d "$dir" ] || continue
32 [ -f "$dir"/configure.ac ] || [ -f "$dir"/configure.in ] || continue
33 echo "autogen.sh: configure `basename $dir`"
34 (cd "$dir" && ${ACLOCAL} -I m4)
35 (cd "$dir" && ${LIBTOOLIZE} --automake --copy --force)
36 (cd "$dir" && ${ACLOCAL} -I m4)
37 (cd "$dir" && ${AUTOCONF} --force)
38 (cd "$dir" && ${AUTOHEADER})
39 (cd "$dir" && ${AUTOMAKE} --add-missing --copy --force-missing)
40 done
41 }
42
43 echo "autogen.sh: for the next step, run ./configure"
44
45 exit 0