Salome HOME
passage du template c++ a salome9 et c++11
[tools/sat.git] / data / templates / CppSalome8 / build_configure
1 #! /bin/bash
2
3 run() {
4     local logfile=$ORIG_DIR/build_configure.log
5     printf "%-50s" "$1 ... "
6     eval $1 > $logfile 2>&1
7     if test $? != 0 ; then
8         echo "[FAILED]"
9         echo "see file build_configure.log ..."
10         exit 1
11     fi
12     echo "[  OK  ]"
13 }
14
15 # --
16 ORIG_DIR=`pwd`
17
18 ########################################################################
19 # Test if the KERNEL_ROOT_DIR and MEDCOUPLING_ROOT_DIR are set correctly
20
21 if test ! -d "${KERNEL_ROOT_DIR}"; then
22         echo "failed : KERNEL_ROOT_DIR variable is not correct !"
23         exit
24 fi
25 if test ! -d "${MEDCOUPLING_ROOT_DIR}"; then
26         echo "failed : MEDCOUPLING_ROOT_DIR variable is not correct !"
27         exit
28 fi
29
30 # --
31 # -- goto build_configure dir
32 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
33 cd ${CONF_DIR}
34 # --
35 # -- list all Makefile.am in Makefile.am.list
36 ./rfind . Makefile.am > Makefile.am.list
37 # --
38 # -- configure.in construction
39 cp configure.in.base configure.in
40 chmod +w configure.in
41 echo "AC_OUTPUT([ \\" >> configure.in
42 sed -e 's,\.am, \\,' -e 's,\.\/,,' Makefile.am.list >> configure.in
43 echo  "])" >> configure.in
44
45 # --
46 run "libtoolize"
47 run "aclocal -I adm/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files -I ${MEDCOUPLING_ROOT_DIR}/adm_local/unix/config_files"
48 run "autoconf"
49 run "automake --add-missing --copy"
50