~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to buildconf

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-04-02 23:35:45 UTC
  • mto: (1.2.1 upstream) (3.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090402233545-geixkwhe3izccjt7
Tags: upstream-7.19.4
ImportĀ upstreamĀ versionĀ 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#                            | (__| |_| |  _ <| |___
7
7
#                             \___|\___/|_| \_\_____|
8
8
#
9
 
# Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
 
9
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
#
11
11
# This software is licensed as described in the file COPYING, which
12
12
# you should have received as part of this distribution. The terms
19
19
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20
20
# KIND, either express or implied.
21
21
#
22
 
# $Id: buildconf,v 1.47 2006-10-27 03:47:57 yangtse Exp $
 
22
# $Id: buildconf,v 1.65 2009-02-13 06:25:35 yangtse Exp $
23
23
###########################################################################
24
24
 
25
25
die(){
27
27
        exit
28
28
}
29
29
 
30
 
# this works as 'which' but we use a different name to make it more obvious we
31
 
# aren't using 'which'! ;-)
 
30
#--------------------------------------------------------------------------
 
31
# findtool works as 'which' but we use a different name to make it more
 
32
# obvious we aren't using 'which'! ;-)
 
33
#
32
34
findtool(){
33
35
  file="$1"
34
36
 
35
 
  IFS=":"
 
37
  old_IFS=$IFS; IFS=':'
36
38
  for path in $PATH
37
39
  do
 
40
    IFS=$old_IFS
38
41
    # echo "checks for $file in $path" >&2
39
42
    if test -f "$path/$file"; then
40
43
      echo "$path/$file"
41
44
      return
42
45
    fi
43
46
  done
44
 
}
 
47
  IFS=$old_IFS
 
48
}
 
49
 
 
50
#--------------------------------------------------------------------------
 
51
# removethis() removes all files and subdirectories with the given name,
 
52
# inside and below the current subdirectory at invocation time.
 
53
#
 
54
removethis(){
 
55
  if test "$#" = "1"; then
 
56
    find . -depth -name $1 -print > buildconf.tmp.$$
 
57
    while read fdname
 
58
    do
 
59
      if test -f "$fdname"; then
 
60
        rm -f "$fdname"
 
61
      elif test -d "$fdname"; then
 
62
        rm -f -r "$fdname"
 
63
      fi
 
64
    done < buildconf.tmp.$$
 
65
    rm -f buildconf.tmp.$$
 
66
  fi
 
67
}
 
68
 
 
69
#--------------------------------------------------------------------------
 
70
# Ensure that buildconf runs from the subdirectory where configure.ac lives
 
71
#
 
72
if test ! -f configure.ac ||
 
73
  test ! -f src/main.c ||
 
74
  test ! -f lib/urldata.h ||
 
75
  test ! -f include/curl/curl.h; then
 
76
  echo "Can not run buildconf from outside of curl's source subdirectory!"
 
77
  echo "Change to the subdirectory where buildconf is found, and try again."
 
78
  exit 1
 
79
fi
45
80
 
46
81
#--------------------------------------------------------------------------
47
82
# autoconf 2.57 or newer
65
100
 
66
101
echo "buildconf: autoconf version $ac_version (ok)"
67
102
 
 
103
am4te_version=`${AUTOM4TE:-autom4te} --version 2>/dev/null|head -n 1| sed -e 's/autom4te\(.*\)/\1/' -e 's/^[^0-9]*//' -e 's/[a-z]* *$//'`
 
104
if test -z "$am4te_version"; then
 
105
  echo "buildconf: autom4te not found. Weird autoconf installation!"
 
106
  exit 1
 
107
fi
 
108
if test "$am4te_version" = "$ac_version"; then
 
109
  echo "buildconf: autom4te version $am4te_version (ok)"
 
110
else
 
111
  echo "buildconf: autom4te version $am4te_version (ERROR: does not match autoconf version)"
 
112
  exit 1
 
113
fi
 
114
 
68
115
#--------------------------------------------------------------------------
69
116
# autoheader 2.50 or newer
70
117
#
108
155
 
109
156
echo "buildconf: automake version $am_version (ok)"
110
157
 
111
 
ac=`findtool ${ACLOCAL:-aclocal}`
112
 
if test -z "$ac"; then
 
158
acloc_version=`${ACLOCAL:-aclocal} --version 2>/dev/null|head -n 1| sed -e 's/^.* \([0-9]\)/\1/' -e 's/[a-z]* *$//' -e 's/\(.*\)\(-p.*\)/\1/'`
 
159
if test -z "$acloc_version"; then
113
160
  echo "buildconf: aclocal not found. Weird automake installation!"
114
161
  exit 1
 
162
fi
 
163
if test "$acloc_version" = "$am_version"; then
 
164
  echo "buildconf: aclocal version $acloc_version (ok)"
115
165
else
116
 
  echo "buildconf: aclocal found"
 
166
  echo "buildconf: aclocal version $acloc_version (ERROR: does not match automake version)"
 
167
  exit 1
117
168
fi
118
169
 
119
170
#--------------------------------------------------------------------------
140
191
  libtoolize=`findtool $LIBTOOLIZE`
141
192
fi
142
193
 
143
 
lt_pversion=`$libtool --version 2>/dev/null|head -n 2|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
 
194
lt_pversion=`$libtool --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//g' -e 's/[- ].*//'`
144
195
if test -z "$lt_pversion"; then
145
196
  echo "buildconf: libtool not found."
146
197
  echo "            You need libtool version $LIBTOOL_WANTED_VERSION or newer installed"
202
253
#
203
254
PERL=`findtool ${PERL:-perl}`
204
255
 
205
 
# ------------------------------------------------------------
 
256
#--------------------------------------------------------------------------
 
257
# Remove files generated on previous buildconf/configure run.
 
258
#
 
259
for fname in .deps \
 
260
    Makefile.in \
 
261
    aclocal.m4 \
 
262
    aclocal.m4.bak \
 
263
    autom4te.cache \
 
264
    compile \
 
265
    config.guess \
 
266
    config.h \
 
267
    config.h.in \
 
268
    config.log \
 
269
    config.status \
 
270
    config.sub \
 
271
    configure \
 
272
    curl-config \
 
273
    curlbuild.h \
 
274
    depcomp \
 
275
    libcares.pc \
 
276
    libcurl.pc \
 
277
    libtool \
 
278
    libtool.m4 \
 
279
    ltmain.sh \
 
280
    ltoptions.m4 \
 
281
    ltsugar.m4 \
 
282
    ltversion.m4 \
 
283
    lt~obsolete.m4 \
 
284
    stamp-h1 \
 
285
    stamp-h2 \
 
286
    stamp-h3 ; do
 
287
  removethis "$fname"
 
288
done
206
289
 
 
290
#--------------------------------------------------------------------------
207
291
# run the correct scripts now
 
292
#
208
293
 
209
294
echo "buildconf: running libtoolize"
210
295
$libtoolize --copy --automake --force || die "The libtoolize command failed"
 
296
 
211
297
echo "buildconf: running aclocal"
212
 
${ACLOCAL:-aclocal} $ACLOCAL_FLAGS || die "The aclocal command line failed"
 
298
${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed"
 
299
 
213
300
if test -n "$PERL"; then
214
301
  echo "buildconf: running aclocal hack to convert all mv to mv -f"
215
302
  $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
217
304
  echo "buildconf: perl not found"
218
305
  exit 1
219
306
fi
 
307
 
220
308
echo "buildconf: running autoheader"
221
309
${AUTOHEADER:-autoheader} || die "The autoheader command failed"
 
310
 
222
311
echo "buildconf: cp lib/config.h.in src/config.h.in"
223
312
cp lib/config.h.in src/config.h.in
 
313
 
224
314
echo "buildconf: running autoconf"
225
315
${AUTOCONF:-autoconf}     || die "The autoconf command failed"
226
316