autogen.sh: untabify
[platform/core/system/libsystem.git] / autogen.sh
1 #!/bin/sh
2
3 set -e
4
5 opt="$1"
6
7 if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
8     # This part is allowed to fail
9     cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \
10         chmod +x .git/hooks/pre-commit && \
11         echo "Activated pre-commit hook." || :
12 fi
13
14 # README and INSTALL are required by automake, but may be deleted by
15 # clean up rules. to get automake to work, simply touch these here,
16 # they will be regenerated from their corresponding *.in files by
17 # ./configure anyway.
18 touch README INSTALL
19
20 # make sure m4 dir exist
21 mkdir -p m4
22
23 autoreconf --force --install --verbose || exit $?
24
25 if [ "x$opt" = "xc" ]; then
26     set -x
27     ./configure $args
28     make clean > /dev/null
29 elif [ "x$opt" = "xd" ]; then
30     set -x
31     ./configure CFLAGS='-g -O0 -ftrapv' $args
32     make clean > /dev/null
33 elif [ "x$opt" = "xg" ]; then
34     set -x
35     ./configure CFLAGS='-g -Og -ftrapv' $args
36     make clean > /dev/null
37 elif [ "x$opt" = "xl" ]; then
38     set -x
39     ./configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
40     make clean > /dev/null
41 elif [ "x$opt" = "xs" ]; then
42     set -x
43     scan-build ./configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
44     scan-build make
45 fi