libsecret: Add secret_service_encode_dbus_secret() and opposite
[platform/upstream/libsecret.git] / 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 PROJECT=libsecret
10 TEST_TYPE=-f
11 FILE=libsecret/secret-value.c
12
13 DIE=0
14
15 have_libtool=false
16 if libtoolize --version < /dev/null > /dev/null 2>&1 ; then
17         libtool_version=`libtoolize --version |
18                          head -1 |
19                          sed -e 's/^\(.*\)([^)]*)\(.*\)$/\1\2/g' \
20                              -e 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
21         case $libtool_version in
22             2.2*)
23                 have_libtool=true
24                 ;;
25             2.4*)
26                 have_libtool=true
27                 ;;
28         esac
29 fi
30 if $have_libtool ; then : ; else
31         echo
32         echo "You must have libtool >= 2.2 installed to compile $PROJECT."
33         echo "Install the appropriate package for your distribution,"
34         echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/"
35         DIE=1
36 fi
37
38 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
39         echo
40         echo "You must have autoconf installed to compile $PROJECT."
41         echo "Install the appropriate package for your distribution,"
42         echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/"
43         DIE=1
44 }
45
46 AUTOMAKE_VERSIONS="1.14 1.13 1.12 1.11 1.10"
47 for version in $AUTOMAKE_VERSIONS; do
48         if automake-$version --version < /dev/null > /dev/null 2>&1 ; then
49                 AUTOMAKE=automake-$version
50                 ACLOCAL=aclocal-$version
51                 break
52         fi
53 done
54
55 if test -z "$AUTOMAKE"; then
56         echo
57         echo "You must have one of automake $AUTOMAKE_VERSIONS to compile $PROJECT."
58         echo "Install the appropriate package for your distribution,"
59         echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
60         DIE=1
61 fi
62
63 if test "$DIE" -eq 1; then
64         exit 1
65 fi
66
67 test $TEST_TYPE $FILE || {
68         echo "You must run this script in the top-level $PROJECT directory"
69         exit 1
70 }
71
72 # NOCONFIGURE is used by gnome-common; support both
73 if ! test -z "$AUTOGEN_SUBDIR_MODE"; then
74     NOCONFIGURE=1
75 fi
76
77 if test -z "$NOCONFIGURE"; then
78         if test -z "$*"; then
79                 echo "I am going to run ./configure with no arguments - if you wish "
80                 echo "to pass any to it, please specify them on the $0 command line."
81         fi
82 fi
83
84 rm -rf autom4te.cache
85
86 # README and INSTALL are required by automake, but may be deleted by clean
87 # up rules. to get automake to work, simply touch these here, they will be
88 # regenerated from their corresponding *.in files by ./configure anyway.
89 touch README INSTALL
90
91 $ACLOCAL -I build/m4 $ACLOCAL_FLAGS || exit $?
92
93 libtoolize --force || exit $?
94 intltoolize --force --copy || exit $?
95
96 gtkdocize || exit $?
97
98 autoheader || exit $?
99
100 $AUTOMAKE --add-missing || exit $?
101 autoconf || exit $?
102 cd $ORIGDIR || exit $?
103
104 if test -z "$NOCONFIGURE"; then
105         $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
106
107         echo 
108         echo "Now type 'make' to compile $PROJECT."
109 fi