~brianaker/libmemcached/gear-clean

« back to all changes in this revision

Viewing changes to bootstrap.sh

  • Committer: Brian Aker
  • Date: 2012-09-24 01:36:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1072.
  • Revision ID: brian@tangent.org-20120924013601-4f0zeykol10ka6so
Updates from ddm4

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
32
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
33
 
34
 
if test -n $MAKE; then 
 
34
die() { echo "$@"; exit 1; }
 
35
 
 
36
run() {
 
37
  echo "\`$@' $ARGS"
 
38
  $@ $ARGS
 
39
 
40
 
 
41
if [ -d .git ]
 
42
then
 
43
  AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
 
44
elif [ -d .bzr ]
 
45
then
 
46
  AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
 
47
elif [ -d .svn ]
 
48
then
 
49
  AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
 
50
elif [ -d .hg ]
 
51
then
 
52
  AUTORECONF_FLAGS="--install --force --verbose -Wall -Werror"
 
53
else
 
54
  AUTORECONF_FLAGS="--install --force --verbose -Wall"
 
55
fi
 
56
 
 
57
LIBTOOLIZE_FLAGS="--force --verbose"
 
58
 
 
59
if [ $(uname) = "Darwin" ]
 
60
then
 
61
  LIBTOOLIZE=glibtoolize
 
62
elif [ -z "$LIBTOOLIZE" ]
 
63
then 
 
64
  LIBTOOLIZE=libtoolize
 
65
fi
 
66
 
 
67
AUTORECONF=autoreconf
 
68
 
 
69
# Set ENV DEBUG in order to enable debugging
 
70
if [ -n "$DEBUG" ]
 
71
then 
 
72
  DEBUG="--enable-debug"
 
73
fi
 
74
 
 
75
# Set ENV ASSERT in order to enable assert
 
76
if [ -n "$ASSERT" ]
 
77
then 
 
78
  ASSERT="--enable-assert"
 
79
fi
 
80
 
 
81
# Set ENV MAKE in order to override "make"
 
82
if [ -z "$MAKE" ]
 
83
then 
35
84
  MAKE="make"
36
85
fi
37
86
 
38
 
if test -n $MAKE_J; then 
 
87
# Set ENV MAKE_J in order to override "-j2"
 
88
if [ -z "$MAKE_J" ]
 
89
then
39
90
  MAKE_J="-j2"
40
91
fi
41
92
 
42
 
if test -f configure; then $MAKE $MAKE_J clean; $MAKE $MAKE_J merge-clean; $MAKE $MAKE_J distclean; fi;
43
 
 
44
 
rm -r -f autom4te.cache/ config.h config.log config.status configure
45
 
./config/autorun.sh
46
 
if [ $(uname) = "Darwin" ];
47
 
then
48
 
  ./configure CC=clang CXX=clang++ --enable-assert
 
93
# Set ENV PREFIX in order to set --prefix for ./configure
 
94
if [ -n "$PREFIX" ]
 
95
then 
 
96
  PREFIX="--prefix=$PREFIX"
 
97
fi
 
98
 
 
99
if [ -f Makefile ]
 
100
then
 
101
  $MAKE $MAKE_J distclean
 
102
fi
 
103
 
 
104
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute $LIBTOOLIZE"
 
105
run $AUTORECONF $AUTORECONF_FLAGS || die "Can't execute $AUTORECONF"
 
106
 
 
107
# If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
 
108
if [ $(uname) = "Darwin" ]
 
109
then
 
110
  CC=clang CXX=clang++ ./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
49
111
else
50
 
  ./configure --enable-assert
51
 
fi
52
 
 
53
 
if test -z $JENKINS_URL; then 
54
 
$MAKE $MAKE_J
55
 
fi
 
112
  ./configure $DEBUG $ASSERT $PREFIX || die "configure failed to run"
 
113
fi
 
114
 
 
115
# Set ENV MAKE_TARGET in order to override default of "all"
 
116
if [ -z "$MAKE_TARGET" ]
 
117
then 
 
118
  MAKE_TARGET="all"
 
119
fi
 
120
 
 
121
run $MAKE $MAKE_J $MAKE_TARGET || die "Can't execute make"