Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[plugins/netgenplugin.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 # 13/03/2007: Alexander BORODIN - OCN
10 # Reorganization for usage of autotools
11 # $Header$
12 #
13
14 ORIG_DIR=`pwd`
15 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
16 NETGENPLUGIN_WITH_GUI="yes"
17
18 ########################################################################
19 # Test if the KERNEL_ROOT_DIR is 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
26 # Test if the KERNEL_SRC is set correctly
27
28 #if test ! -d "${KERNEL_SRC}"; then
29 #    echo "failed : KERNEL_SRC variable is not correct !"
30 #    exit
31 #fi
32 for option
33 do
34   case $option in
35       -with-ihm | --with-ihm)
36           NETGENPLUGIN_WITH_GUI="yes"
37           break;;
38       -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
39           NETGENPLUGIN_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 ${NETGENPLUGIN_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 # Test if the SMESH_ROOT_DIR is set correctly
72
73 if test ! -d "${SMESH_ROOT_DIR}"; then
74     echo "failed : SMESH_ROOT_DIR variable is not correct !"
75     exit
76 fi
77
78 cd ${CONF_DIR}
79 ABS_CONF_DIR=`pwd`
80
81 #######################################################################
82 # Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
83 sed -e s/NETGENPLUGIN_WITH_GUI=[a-z]*/NETGENPLUGIN_WITH_GUI=${NETGENPLUGIN_WITH_GUI}/g configure.ac > configure.tmp
84 mv -f configure.tmp configure.ac
85
86 mkdir -p salome_adm/unix/config_files
87 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
88 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
89
90 cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
91
92 #cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
93 #cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
94 #cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
95 #cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
96
97 # remove KERNEL deprecated configure files
98 #for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
99 #    check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
100 #    check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
101 #    do
102 #       rm -f salome_adm/unix/config_files/${deprecated}
103 #    done
104                       
105
106 # ____________________________________________________________________
107 # aclocal creates the aclocal.m4 file from the standard macro and the
108 # custom macro embedded in the directory salome_adm/unix/config_files
109 # and KERNEL config_files directory.
110 # output:
111 #   aclocal.m4
112 #   autom4te.cache (directory)
113 echo "====================================================== aclocal"
114
115 if test ${NETGENPLUGIN_WITH_GUI} = yes; then
116   aclocal -I adm_local/unix/config_files \
117           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
118           -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
119           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
120           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
121           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
122 else
123   aclocal -I adm_local/unix/config_files \
124           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
125           -I ${MED_ROOT_DIR}/adm_local/unix/config_files \
126           -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
127           -I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
128 fi
129
130 # ____________________________________________________________________
131 # libtoolize creates some configuration files (ltmain.sh,
132 # config.guess and config.sub). It only depends on the libtool
133 # version. The files are created in the directory specified with the
134 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
135 # output:
136 #   salome_adm/unix/config_files/config.guess
137 #   salome_adm/unix/config_files/config.sub
138 #   salome_adm/unix/config_files/ltmain.sh
139 #echo "====================================================== libtoolize"
140
141 libtoolize --force --copy --automake || exit 1
142
143 # ____________________________________________________________________
144 # autoconf creates the configure script from the file configure.ac (or
145 # configure.in if configure.ac doesn't exist)
146 # output:
147 #   configure
148 echo "====================================================== autoconf"
149
150 autoconf
151
152 # ____________________________________________________________________
153 # automake creates some scripts used in building process
154 # (install-sh, missing, ...). It only depends on the automake
155 # version. The files are created in the directory specified with the
156 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
157 # creates the Makefile.in files from the Makefile.am files.
158 # output:
159 #   salome_adm/unix/config_files/compile
160 #   salome_adm/unix/config_files/depcomp
161 #   salome_adm/unix/config_files/install-sh
162 #   salome_adm/unix/config_files/missing
163 #   salome_adm/unix/config_files/py-compile
164 #   Makefile.in (from Makefile.am)
165 echo "====================================================== automake"
166
167 automake --copy --gnu --add-missing