]> SALOME platform Git repositories - plugins/ghs3dplugin.git/blob - build_configure
Salome HOME
Remove wrong check of GUI_ROOT_DIR in "without-gui" mode
[plugins/ghs3dplugin.git] / build_configure
1 #!/bin/bash
2
3 #
4 # Tool for updating list of .in file for the SALOME project 
5 # and regenerating configure script
6 #
7 # Author : Marc Tajchman - CEA
8 # Date : 10/10/2002
9 # $Header$
10 #
11
12 ORIG_DIR=`pwd`
13 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
14 GHS3DPLUGIN_WITH_GUI="yes"
15
16 for option
17 do
18   case $option in
19       -with-gui | --with-gui)
20           GHS3DPLUGIN_WITH_GUI="yes"
21           break;;
22       -without-gui | --without-gui | -with-gui=no | --with-gui=no)
23           GHS3DPLUGIN_WITH_GUI="no"
24           break;;
25   esac
26 done
27
28 ########################################################################
29 # Test if the KERNEL_ROOT_DIR is set correctly
30
31 if test ! -d "${KERNEL_ROOT_DIR}"; then
32     echo "failed : KERNEL_ROOT_DIR variable is not correct !"
33     exit
34 fi
35
36 # Test if the KERNEL_SRC is set correctly
37
38 #if test ! -d "${KERNEL_SRC}"; then
39 #    echo "failed : KERNEL_SRC variable is not correct !"
40 #    exit
41 #fi
42
43 ########################################################################
44 # Test if the GUI_ROOT_DIR is set correctly
45
46 if test ${GHS3DPLUGIN_WITH_GUI} = yes; then
47     if test ! -d "${GUI_ROOT_DIR}"; then
48         echo "failed : GUI_ROOT_DIR variable is not correct !"
49         exit
50     fi
51 fi
52
53 ########################################################################
54 # Test if the GEOM_ROOT_DIR is set correctly
55
56 if test ! -d "${GEOM_ROOT_DIR}"; then
57     echo "failed : GEOM_ROOT_DIR variable is not correct !"
58     exit
59 fi
60
61 ########################################################################
62 # Test if the MED_ROOT_DIR is set correctly
63
64 if test ! -d "${MED_ROOT_DIR}"; then
65     echo "failed : MED_ROOT_DIR variable is not correct !"
66     exit
67 fi
68
69 ########################################################################
70 # Test if the SMESH_ROOT_DIR is set correctly
71
72 if test ! -d "${SMESH_ROOT_DIR}"; then
73     echo "failed : SMESH_ROOT_DIR variable is not correct !"
74     exit
75 fi
76
77 cd ${CONF_DIR}
78 ABS_CONF_DIR=`pwd`
79
80 #######################################################################
81 # Update configure.ac script: to set GHS3DPLUGIN_WITH_GUI variable
82 sed -e s/GHS3DPLUGIN_WITH_GUI=[a-z]*/GHS3DPLUGIN_WITH_GUI=${GHS3DPLUGIN_WITH_GUI}/g configure.ac > configure.tmp
83 mv -f configure.tmp configure.ac
84
85 mkdir -p salome_adm/unix/config_files
86 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
87 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
88
89 cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
90
91 #cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
92 #cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
93 #cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
94 #cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
95
96 # remove KERNEL deprecated configure files
97 #for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
98 #    check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
99 #    check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
100 #    do
101 #       rm -f salome_adm/unix/config_files/${deprecated}
102 #    done
103                       
104
105 # ____________________________________________________________________
106 # aclocal creates the aclocal.m4 file from the standard macro and the
107 # custom macro embedded in the directory salome_adm/unix/config_files
108 # and KERNEL config_files directory.
109 # output:
110 #   aclocal.m4
111 #   autom4te.cache (directory)
112 echo "====================================================== aclocal"
113
114 if test ${GHS3DPLUGIN_WITH_GUI} = yes; then
115   aclocal -I adm_local/unix/config_files \
116           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
117           -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
118           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
119           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
120           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
121 else
122   aclocal -I adm_local/unix/config_files \
123           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
124           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
125           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
126           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
127 fi
128
129 # ____________________________________________________________________
130 # libtoolize creates some configuration files (ltmain.sh,
131 # config.guess and config.sub). It only depends on the libtool
132 # version. The files are created in the directory specified with the
133 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
134 # output:
135 #   salome_adm/unix/config_files/config.guess
136 #   salome_adm/unix/config_files/config.sub
137 #   salome_adm/unix/config_files/ltmain.sh
138 #echo "====================================================== libtoolize"
139
140 libtoolize --force --copy --automake || exit 1
141
142 # ____________________________________________________________________
143 # autoconf creates the configure script from the file configure.ac (or
144 # configure.in if configure.ac doesn't exist)
145 # output:
146 #   configure
147 echo "====================================================== autoconf"
148
149 autoconf
150
151 # ____________________________________________________________________
152 # automake creates some scripts used in building process
153 # (install-sh, missing, ...). It only depends on the automake
154 # version. The files are created in the directory specified with the
155 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
156 # creates the Makefile.in files from the Makefile.am files.
157 # output:
158 #   salome_adm/unix/config_files/compile
159 #   salome_adm/unix/config_files/depcomp
160 #   salome_adm/unix/config_files/install-sh
161 #   salome_adm/unix/config_files/missing
162 #   salome_adm/unix/config_files/py-compile
163 #   Makefile.in (from Makefile.am)
164 echo "====================================================== automake"
165
166 automake --copy --gnu --add-missing