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