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