blob: 1989437a04164d866ee299939a904a404a1c8510 [file] [log] [blame]
Marc Slemkob09f5882006-08-23 22:03:34 +00001#!/bin/sh
2
David Reissea2cba82009-03-30 21:35:00 +00003#
4# Licensed to the Apache Software Foundation (ASF) under one
5# or more contributor license agreements. See the NOTICE file
6# distributed with this work for additional information
7# regarding copyright ownership. The ASF licenses this file
8# to you under the Apache License, Version 2.0 (the
9# "License"); you may not use this file except in compliance
10# with the License. You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing,
15# software distributed under the License is distributed on an
16# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17# KIND, either express or implied. See the License for the
18# specific language governing permissions and limitations
19# under the License.
20#
21
James E. King IIIb96c4382019-01-24 17:45:07 -050022echo -n "make distclean... "
23make -k distclean >/dev/null 2>&1
24echo "ok"
25
Bryan Duxburye61fef32011-01-26 23:38:54 +000026if test -d lib/php/src/ext/thrift_protocol ; then
27 if phpize -v >/dev/null 2>/dev/null ; then
28 (cd lib/php/src/ext/thrift_protocol && phpize)
29 fi
30fi
Marc Slemkob09f5882006-08-23 22:03:34 +000031
David Reiss618777d2010-08-31 16:51:10 +000032set -e
David Reiss832b2622007-12-28 18:25:33 +000033
David Reiss618777d2010-08-31 16:51:10 +000034# libtoolize is called "glibtoolize" on OSX.
David Reiss832b2622007-12-28 18:25:33 +000035if libtoolize --version 1 >/dev/null 2>/dev/null; then
David Reiss618777d2010-08-31 16:51:10 +000036 LIBTOOLIZE=libtoolize
David Reiss832b2622007-12-28 18:25:33 +000037elif glibtoolize --version 1 >/dev/null 2>/dev/null; then
David Reiss618777d2010-08-31 16:51:10 +000038 LIBTOOLIZE=glibtoolize
39else
40 echo >&2 "Couldn't find libtoolize!"
41 exit 1
David Reiss832b2622007-12-28 18:25:33 +000042fi
43
Jaume Marhuendae8bec232018-07-31 07:21:42 -070044format_version () {
45 printf "%03d%03d%03d%03d" $(echo $1 | tr '.' ' ');
46}
47
Jens Geyer4aa95df2015-04-03 12:37:03 +020048# we require automake 1.13 or later
49# check must happen externally due to use of newer macro
Jens Geyera4fc4402015-04-14 20:11:24 +020050AUTOMAKE_VERSION=`automake --version | grep automake | egrep -o '([0-9]{1,}\.)+[0-9]{1,}'`
Jaume Marhuendae8bec232018-07-31 07:21:42 -070051if [ $(format_version $AUTOMAKE_VERSION) -lt $(format_version 1.13) ]; then
Jens Geyer4aa95df2015-04-03 12:37:03 +020052 echo >&2 "automake version $AUTOMAKE_VERSION is too old (need 1.13 or later)"
53 exit 1
54fi
55
James E. King, III0ad20bd2017-09-30 15:44:16 -070056set -e
David Reiss618777d2010-08-31 16:51:10 +000057autoscan
58$LIBTOOLIZE --copy --automake
59aclocal -I ./aclocal
60autoheader
James E. King, III0ad20bd2017-09-30 15:44:16 -070061sed '/undef VERSION/d' config.hin > config.hin2
62mv config.hin2 config.hin
mvaradacharifbc91142008-01-01 04:51:24 +000063autoconf
David Reiss618777d2010-08-31 16:51:10 +000064automake --copy --add-missing --foreign