Rename the library subdirectory to libsecret
[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 if automake-1.11 --version < /dev/null > /dev/null 2>&1 ; then
47     AUTOMAKE=automake-1.11
48     ACLOCAL=aclocal-1.11
49 else if automake-1.10 --version < /dev/null > /dev/null 2>&1 ; then
50     AUTOMAKE=automake-1.10
51     ACLOCAL=aclocal-1.10
52 else
53         echo
54         echo "You must have automake 1.10.x or 1.11.x installed to compile $PROJECT."
55         echo "Install the appropriate package for your distribution,"
56         echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
57         DIE=1
58 fi
59 fi
60
61 if test "$DIE" -eq 1; then
62         exit 1
63 fi
64
65 test $TEST_TYPE $FILE || {
66         echo "You must run this script in the top-level $PROJECT directory"
67         exit 1
68 }
69
70 # NOCONFIGURE is used by gnome-common; support both
71 if ! test -z "$AUTOGEN_SUBDIR_MODE"; then
72     NOCONFIGURE=1
73 fi
74
75 if test -z "$NOCONFIGURE"; then
76         if test -z "$*"; then
77                 echo "I am going to run ./configure with no arguments - if you wish "
78                 echo "to pass any to it, please specify them on the $0 command line."
79         fi
80 fi
81
82 rm -rf autom4te.cache
83
84 # README and INSTALL are required by automake, but may be deleted by clean
85 # up rules. to get automake to work, simply touch these here, they will be
86 # regenerated from their corresponding *.in files by ./configure anyway.
87 touch README INSTALL
88
89 $ACLOCAL -I build/m4 $ACLOCAL_FLAGS || exit $?
90
91 libtoolize --force || exit $?
92 intltoolize --force --copy || exit $?
93
94 gtkdocize || exit $?
95
96 autoheader || exit $?
97
98 $AUTOMAKE --add-missing || exit $?
99 autoconf || exit $?
100 cd $ORIGDIR || exit $?
101
102 if test -z "$NOCONFIGURE"; then
103         $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $?
104
105         echo 
106         echo "Now type 'make' to compile $PROJECT."
107 fi