source: cfg_itronx+oil_gcc/configure@ 165

Last change on this file since 165 was 54, checked in by ertl-ishikawa, 10 years ago

cfg+oil対応コンフィギュレータを追加

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/sh
2
3makefile_config="Makefile.config"
4
5# コマンドライン引数の処理
6for arg in "$@"
7do
8 name=`echo $arg | cut -d "=" -f 1`
9 value=`echo $arg | cut -d "=" -f 2`
10
11 case $name in
12 --with-headers) include_path=$value ;;
13 --with-libraries) library_path=$value ;;
14 --help) echo "configure options:"
15 echo "--help"
16 echo " display this information"
17 echo "--with-headers=<dir>"
18 echo " specify the directory of Boost headers"
19 echo "--with-libraries=<dir>"
20 echo " specify the directory of Boost libraries"
21 exit
22 ;;
23 esac
24done
25
26# Boost C++ Librariesのヘッダファイルがあるディレクトリをサーチ
27for dir in $include_path "/usr/local/include" "/opt/local/include" "/opt/include" "/usr/include" "/mingw/include"
28do
29 ls $dir/boost* 2> /dev/null > /dev/null
30 if test $? -eq 0
31 then
32 boost_dir=`ls -d $dir/boost* | sort -r | head -1`
33 if test $boost_dir = $dir/boost
34 then
35 include_path=$dir
36 else
37 include_path=$boost_dir
38 fi
39 break
40 fi
41done
42
43# Boost C++ Librariesのライブラリファイルがあるディレクトリをサーチ
44for dir in $library_path "/usr/local/lib" "/opt/local/lib" "/opt/lib" "/usr/lib" "/lib" "/mingw/lib"
45do
46 ls $dir/libboost* 2> /dev/null > /dev/null
47 if test $? -eq 0
48 then
49 library_path=$dir
50 break
51 fi
52done
53
54##### 以下、Makefile.configを生成する #####
55
56rm Makefile.config 2> /dev/null
57
58# Boost C++ Librariesのバージョンを調べる
59boost_version=`echo "#include <boost/version.hpp>
60echo BOOST_VERSION" | g++ -E -I$include_path -L$library_path - | sh`
61
62boost_lib_version=`echo "#include <boost/version.hpp>
63echo BOOST_LIB_VERSION" | g++ -E -I$include_path -L$library_path - | sh`
64
65# ライブラリファイルの添字を調べる
66# 環境によって、-gcc-mt-s, -mt-s, -gcc42-mt-sなど、添字が異なるため
67libboost_regex_filename=`ls $library_path/libboost_regex*-s.* 2> /dev/null | head -1`
68if test -z $libboost_regex_filename
69then
70 libboost_regex_filename=`ls $library_path/libboost_regex*.* | head -1`
71fi
72libboost_suffix=`echo $libboost_regex_filename | sed -e s/.*libboost_regex//g -e s/\.[a-z]*$//g`
73echo "LIBBOOST_SUFFIX=$libboost_suffix" >> $makefile_config
74
75# 各種変数を出力
76echo BOOST_VERSION=$boost_lib_version >> $makefile_config
77echo BOOST_DIR=$include_path >> $makefile_config
78echo LIBBOOST_DIR=$library_path >> $makefile_config
79echo OPTIONS=$options >> $makefile_config
80
81# 生成結果を表示
82cat Makefile.config
83
84# 終わり
Note: See TracBrowser for help on using the repository browser.