Change ' to " in configure call to fix build
[platform/upstream/libatasmart.git] / autogen.sh
1 #!/bin/bash
2
3 # This file is part of libatasmart.
4 #
5 # Copyright 2008-2011 Lennart Poettering
6 #
7 # libatasmart is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation, either version 2.1 of the
10 # License, or (at your option) any later version.
11 #
12 # libatasmart is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with libatasmart; If not, see
19 # <http://www.gnu.org/licenses/>.
20
21 if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
22         cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
23         chmod +x .git/hooks/pre-commit && \
24         echo "Activated pre-commit hook."
25 fi
26
27 autoreconf --force --install --symlink
28
29 libdir() {
30         echo $(cd $1/$(gcc -print-multi-os-directory); pwd)
31 }
32
33 args="\
34 --sysconfdir=/etc \
35 --localstatedir=/var \
36 --libdir=$(libdir /usr/lib) \
37 --libexecdir=/usr/lib"
38
39 if [ "x$1" == "xc" ]; then
40         ./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args
41         make clean
42 else
43         echo
44         echo "----------------------------------------------------------------"
45         echo "Initialized build system. For a common configuration please run:"
46         echo "----------------------------------------------------------------"
47         echo
48         echo "./configure CFLAGS='-g -O0 -Wp,-U_FORTIFY_SOURCE' $args"
49         echo
50 fi