Salome HOME
0307b0e4dd4898773e75c8d807e4ba5b72293060
[plugins/blsurfplugin.git] / build_configure
1 #!/bin/bash
2 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D
3 #
4 #  This library is free software; you can redistribute it and/or
5 #  modify it under the terms of the GNU Lesser General Public
6 #  License as published by the Free Software Foundation; either
7 #  version 2.1 of the License.
8 #
9 #  This library is distributed in the hope that it will be useful,
10 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 #  Lesser General Public License for more details.
13 #
14 #  You should have received a copy of the GNU Lesser General Public
15 #  License along with this library; if not, write to the Free Software
16 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # ---
21 # File   : build_configure
22 # Author : Vadim SANDLER, Open CASCADE S.A.S (vadim.sandler@opencascade.com)
23 # ---
24 #
25 ORIG_DIR=`pwd`
26 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
27 BLSURFPLUGIN_WITH_GUI="yes"
28
29 ########################################################################
30 # Test if the KERNEL_ROOT_DIR is set correctly
31
32 if test ! -d "${KERNEL_ROOT_DIR}"; then
33     echo "failed : KERNEL_ROOT_DIR variable is not correct !"
34     exit
35 fi
36
37 # Test if the KERNEL_SRC is set correctly
38
39 #if test ! -d "${KERNEL_SRC}"; then
40 #    echo "failed : KERNEL_SRC variable is not correct !"
41 #    exit
42 #fi
43
44 for option
45 do
46   case $option in
47       -with-gui | --with-gui)
48           BLSURFPLUGIN_WITH_GUI="yes"
49           break;;
50       -without-gui | --without-gui | -with-gui=no | --with-gui=no)
51           BLSURFPLUGIN_WITH_GUI="no"
52           break;;
53   esac
54 done
55
56 ########################################################################
57 # Test if the GUI_ROOT_DIR is set correctly
58
59 if test ${BLSURFPLUGIN_WITH_GUI} = yes; then
60     if test ! -d "${GUI_ROOT_DIR}"; then
61         echo "failed : GUI_ROOT_DIR variable is not correct !"
62         exit
63     fi
64 fi
65
66 ########################################################################
67 # Test if the MED_ROOT_DIR is set correctly
68
69 if test ! -d "${MED_ROOT_DIR}"; then
70     echo "failed : MED_ROOT_DIR variable is not correct !"
71     exit
72 fi
73
74 ########################################################################
75 # Test if the GEOM_ROOT_DIR is set correctly
76
77 if test ! -d "${GEOM_ROOT_DIR}"; then
78     echo "failed : GEOM_ROOT_DIR variable is not correct !"
79     exit
80 fi
81
82 ########################################################################
83 # Test if the SMESH_ROOT_DIR is set correctly
84
85 if test ! -d "${SMESH_ROOT_DIR}"; then
86     echo "failed : SMESH_ROOT_DIR variable is not correct !"
87     exit
88 fi
89
90 cd ${CONF_DIR}
91 ABS_CONF_DIR=`pwd`
92
93 #######################################################################
94 # Update configure.ac script: to set BLSURFPLUGIN_WITH_GUI variable
95 sed -e s/BLSURFPLUGIN_WITH_GUI=[a-z]*/BLSURFPLUGIN_WITH_GUI=${BLSURFPLUGIN_WITH_GUI}/g configure.ac > configure.tmp
96 mv -f configure.tmp configure.ac
97
98 mkdir -p salome_adm/unix/config_files
99 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
100 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
101
102 cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
103
104 #cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
105 #cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
106 #cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
107 #cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
108
109 # remove KERNEL deprecated configure files
110 #for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
111 #    check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
112 #    check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
113 #    do
114 #       rm -f salome_adm/unix/config_files/${deprecated}
115 #    done
116                       
117
118 # ____________________________________________________________________
119 # aclocal creates the aclocal.m4 file from the standard macro and the
120 # custom macro embedded in the directory salome_adm/unix/config_files
121 # and KERNEL config_files directory.
122 # output:
123 #   aclocal.m4
124 #   autom4te.cache (directory)
125 echo "====================================================== aclocal"
126
127 if test ${BLSURFPLUGIN_WITH_GUI} = yes; then
128   aclocal -I adm_local/unix/config_files \
129           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
130           -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
131           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
132           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
133           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
134 else
135   aclocal -I adm_local/unix/config_files \
136           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
137           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
138           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
139           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
140 fi
141
142 # ____________________________________________________________________
143 # libtoolize creates some configuration files (ltmain.sh,
144 # config.guess and config.sub). It only depends on the libtool
145 # version. The files are created in the directory specified with the
146 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
147 # output:
148 #   salome_adm/unix/config_files/config.guess
149 #   salome_adm/unix/config_files/config.sub
150 #   salome_adm/unix/config_files/ltmain.sh
151 #echo "====================================================== libtoolize"
152
153 libtoolize --force --copy --automake || exit 1
154
155 # ____________________________________________________________________
156 # autoconf creates the configure script from the file configure.ac (or
157 # configure.in if configure.ac doesn't exist)
158 # output:
159 #   configure
160 echo "====================================================== autoconf"
161
162 autoconf
163
164 # ____________________________________________________________________
165 # automake creates some scripts used in building process
166 # (install-sh, missing, ...). It only depends on the automake
167 # version. The files are created in the directory specified with the
168 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
169 # creates the Makefile.in files from the Makefile.am files.
170 # output:
171 #   salome_adm/unix/config_files/compile
172 #   salome_adm/unix/config_files/depcomp
173 #   salome_adm/unix/config_files/install-sh
174 #   salome_adm/unix/config_files/missing
175 #   salome_adm/unix/config_files/py-compile
176 #   Makefile.in (from Makefile.am)
177 echo "====================================================== automake"
178
179 automake --copy --gnu --add-missing