Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/configure @ 66

Last change on this file since 66 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

  • Property svn:executable set to *
File size: 9.3 KB
Line 
1#!/bin/sh
2# Copyright (C) 2005, 2006 Douglas Gregor.
3# Copyright (C) 2006 The Trustees of Indiana University
4#
5# Distributed under the Boost Software License, Version 1.0.
6# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7
8# boostinspect:notab - Tabs are required for the Makefile.
9
10BJAM=""
11TOOLSET=""
12BJAM_CONFIG=""
13BUILD=""
14PREFIX=/usr/local
15EPREFIX=
16LIBDIR=
17INCLUDEDIR=
18LIBS=""
19PYTHON=python
20PYTHON_VERSION=
21PYTHON_ROOT=
22ICU_ROOT=
23
24# Internal flags
25flag_no_python=
26flag_icu=
27flag_show_libraries=
28
29for option
30do
31    case $option in
32
33    -help | --help | -h)
34      want_help=yes ;;
35
36    -prefix=* | --prefix=*)
37      PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"`
38      ;;
39
40    -exec-prefix=* | --exec-prefix=*)
41      EPREFIX=`expr "x$option" : "x-*exec-prefix=\(.*\)"`
42      ;;
43
44    -libdir=* | --libdir=*)
45      LIBDIR=`expr "x$option" : "x-*libdir=\(.*\)"`
46      ;;
47
48    -includedir=* | --includedir=*)
49      INCLUDEDIR=`expr "x$option" : "x-*includedir=\(.*\)"`
50      ;;
51
52    -show-libraries | --show-libraries )
53      flag_show_libraries=yes
54      ;;
55
56    -with-bjam=* | --with-bjam=* )
57      BJAM=`expr "x$option" : "x-*with-bjam=\(.*\)"`
58      ;;
59
60    -with-icu | --with-icu )
61      flag_icu=yes
62      ;;
63
64    -with-icu=* | --with-icu=* )
65      flag_icu=yes
66      ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"`
67      ;;
68
69    -without-icu | --without-icu )
70      flag_icu=no
71      ;;
72
73    -with-libraries=* | --with-libraries=* )
74      library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"`
75      if test "$library_list" != "all"; then
76          old_IFS=$IFS
77          IFS=,
78          for library in $library_list
79          do
80              LIBS="$LIBS --with-$library"
81
82              if test $library = python; then
83                  requested_python=yes
84              fi
85          done
86          IFS=$old_IFS
87
88          if test "x$requested_python" != xyes; then
89              flag_no_python=yes
90          fi
91      fi
92      ;;
93
94    -without-libraries=* | --without-libraries=* )
95      library_list=`expr "x$option" : "x-*without-libraries=\(.*\)"`
96      old_IFS=$IFS
97      IFS=,
98      for library in $library_list
99      do
100          LIBS="$LIBS --without-$library"
101
102          if test $library = python; then
103              flag_no_python=yes
104          fi
105      done
106      IFS=$old_IFS
107      ;;
108
109    -with-python=* | --with-python=* )
110      PYTHON=`expr "x$option" : "x-*with-python=\(.*\)"`
111      ;;
112
113    -with-python-root=* | --with-python-root=* )
114      PYTHON_ROOT=`expr "x$option" : "x-*with-python-root=\(.*\)"`
115      ;;
116
117    -with-python-version=* | --with-python-version=* )
118      PYTHON_VERSION=`expr "x$option" : "x-*with-python-version=\(.*\)"`
119      ;;
120
121    -with-toolset=* | --with-toolset=* )
122      TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"`
123      ;;
124
125    -*)
126      { echo "error: unrecognized option: $option
127Try \`$0 --help' for more information." >&2
128      { (exit 1); exit 1; }; }
129      ;; 
130
131    esac
132done
133
134if test "x$want_help" = xyes; then
135  cat <<EOF
136\`configure' configures Boost to adapt to a few kinds of systems.
137
138Usage: $0 [OPTION]...
139
140Defaults for the options are specified in brackets.
141
142Configuration:
143  -h, --help                display this help and exit
144  --with-bjam=BJAM          use existing Boost.Jam executable (bjam)
145                            [automatically built]
146  --with-toolset=TOOLSET    use specific Boost.Build toolset
147                            [automatically detected]
148  --show-libraries          show the set of libraries that require build
149                            and installation steps (i.e., those libraries
150                            that can be used with --with-libraries or
151                            --without-libraries), then exit
152  --with-libraries=list     build only a particular set of libraries,
153                            describing using either a comma-separated list of
154                            library names or "all"
155                            [all]
156  --without-libraries=list  build all libraries except the ones listed []
157  --with-icu                enable Unicode/ICU support in Regex
158                            [automatically detected]
159  --without-icu             disable Unicode/ICU support in Regex
160  --with-icu=DIR            specify the root of the ICU library installation
161                            and enable Unicode/ICU support in Regex
162                            [automatically detected]
163  --with-python=PYTHON      specify the Python executable [python]
164  --with-python-root=DIR    specify the root of the Python installation
165                            [automatically detected]
166  --with-python-version=X.Y specify the Python version as X.Y
167                            [automatically detected]
168
169Installation directories:
170  --prefix=PREFIX           install Boost into the given PREFIX
171                            [/usr/local]
172  --exec-prefix=EPREFIX     install Boost binaries into the given EPREFIX
173                            [PREFIX]
174
175More precise control over installation directories:
176  --libdir=DIR              install libraries here [EPREFIX/lib]
177  --includedir=DIR          install headers here [PREFIX/include]
178
179EOF
180fi
181test -n "$want_help" && exit 0
182
183# TBD: Determine where the script is located
184my_dir="."
185
186# Determine the toolset, if not already decided
187if test "x$TOOLSET" = x; then
188  TOOLSET=`$my_dir/tools/jam/src/build.sh --guess-toolset`
189fi
190
191rm -f config.log
192
193# Build bjam
194if test "x$BJAM" = x; then
195  echo -n "Building Boost.Jam with toolset $TOOLSET... "
196  pwd=`pwd`
197  cd "$my_dir/tools/jam/src" && ./build.sh "$TOOLSET" > config.log 2>&1
198  cd $pwd
199  arch=`cd $my_dir/tools/jam/src && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
200  BJAM="$my_dir/tools/jam/src/$arch/bjam"
201  echo "tools/jam/src/$arch/bjam"
202fi
203
204# TBD: Turn BJAM into an absolute path
205
206# If there is a list of libraries
207if test "x$flag_show_libraries" = xyes; then
208  libraries=`$BJAM -d0 --show-libraries`
209  cat <<EOF
210
211The following Boost libraries have portions that require a separate build
212and installation step. Any library not listed here can be used by including
213the headers only.
214
215The Boost libraries requiring separate building and installation are:
216EOF
217  for lib in $libraries
218  do
219    echo "         $lib"
220  done
221  exit 0
222fi
223
224# Setup paths
225if test "x$EPREFIX" = x; then
226  EPREFIX=$PREFIX
227fi
228
229if test "x$LIBDIR" = x; then
230  LIBDIR="$EPREFIX/lib"
231fi
232
233if test "x$INCLUDEDIR" = x; then
234  INCLUDEDIR="$PREFIX/include"
235fi
236
237# Find Python
238if test "x$flag_no_python" = x; then
239  result=`$PYTHON -c "exit" > /dev/null 2>&1`
240  if [ "$?" -ne "0" ]; then
241    flag_no_python=yes
242  fi
243fi
244
245if test "x$flag_no_python" = x; then
246    if test "x$PYTHON_VERSION" = x; then
247        echo -n "Detecting Python version... "
248        PYTHON_VERSION=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
249        echo $PYTHON_VERSION
250    fi
251
252    if test "x$PYTHON_ROOT" = x; then
253        echo -n "Detecting Python root... "
254        PYTHON_ROOT=`$PYTHON -c "import sys; print sys.prefix"`
255        echo $PYTHON_ROOT
256    fi   
257fi
258
259# Configure ICU
260echo -n "Unicode/ICU support for Boost.Regex?... "
261if test "x$flag_icu" != xno; then
262  if test "x$ICU_ROOT" = x; then
263    COMMON_ICU_PATHS="/usr /usr/local /sw"
264    for p in $COMMON_ICU_PATHS; do
265      if test -r $p/include/unicode/utypes.h; then
266        ICU_ROOT=$p
267      fi
268    done
269 
270    if test "x$ICU_ROOT" = x; then
271      echo "not found."
272    else     
273      BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
274      echo "$ICU_ROOT"
275    fi
276  else
277    BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
278    echo "$ICU_ROOT"
279  fi
280else
281  echo "disabled."
282fi
283
284# Backup the user's existing user-config.jam
285JAM_CONFIG_OUT="user-config.jam"
286if test -r "user-config.jam"; then
287  counter=1
288 
289  while test -r "user-config.jam.$counter"; do
290    counter=`expr $counter + 1`
291  done
292
293  echo "Backing up existing Boost.Build configuration in user-config.jam.$counter"
294  mv "user-config.jam" "user-config.jam.$counter"
295fi
296
297# Generate user-config.jam
298echo "Generating Boost.Build configuration in user-config.jam..."
299cat > user-config.jam <<EOF
300# Boost.Build Configuration
301# Automatically generated by Boost configure
302
303# Compiler configuration
304using $TOOLSET ;
305EOF
306
307#  - Python configuration
308if test "x$flag_no_python" = x; then
309  cat >> user-config.jam <<EOF
310
311# Python configuration
312using python : $PYTHON_VERSION : $PYTHON_ROOT ;
313EOF
314fi
315
316# Generate the Makefile
317echo "Generating Makefile..."
318cat > Makefile <<EOF
319BJAM=$BJAM
320BJAM_CONFIG=$BJAM_CONFIG
321PREFIX=$PREFIX
322EPREFIX=$EPREFIX
323LIBDIR=$LIBDIR
324INCLUDEDIR=$INCLUDEDIR
325LIBS=$LIBS
326
327all: .dummy
328        @echo "\$(BJAM) \$(BJAM_CONFIG) --user-config=user-config.jam \$(LIBS)"
329        @\$(BJAM) \$(BJAM_CONFIG) --user-config=user-config.jam \$(LIBS) || \\
330        echo "Not all Boost libraries built properly."
331
332clean: .dummy
333        rm -rf bin.v2
334
335distclean: clean
336        rm -rf Makefile config.log
337
338check: .dummy
339        @cd status && ../\$(BJAM) \$(BJAM_CONFIG) --user-config=../user-config.jam || echo "Some Boost regression tests failed. This is normal for many compilers."
340
341install: .dummy
342        @echo "\$(BJAM) \$(BJAM_CONFIG) --user-config=user-config.jam --prefix=\$(PREFIX) --exec-prefix=\$(EPREFIX) --libdir=\$(LIBDIR) --includedir=\$(INCLUDEDIR) \$(LIBS) install"
343        @\$(BJAM) \$(BJAM_CONFIG) --user-config=user-config.jam --prefix=\$(PREFIX) --exec-prefix=\$(EPREFIX) --libdir=\$(LIBDIR) --includedir=\$(INCLUDEDIR) \$(LIBS) install || echo "Not all Boost libraries built properly."
344
345.dummy:
346
347EOF
Note: See TracBrowser for help on using the repository browser.