Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/geom.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/03/2007: Alexander BORODIN - OCN
13 # Reorganization for usage of autotools
14
15 ORIG_DIR=`pwd`
16 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
17 GEOM_WITH_GUI="yes"
18
19 ########################################################################
20 # Test if the KERNEL_ROOT_DIR is set correctly
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
33 for option
34 do
35   case $option in
36       -with-ihm | --with-ihm)
37           GEOM_WITH_GUI="yes"
38           break;;
39       -without-ihm | --without-ihm | -with-ihm=no | --with-ihm=no)
40           GEOM_WITH_GUI="no"
41           break;;
42   esac
43 done
44
45 ########################################################################
46 # Test if the GUI_ROOT_DIR is set correctly
47 if test ${GEOM_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 cd ${CONF_DIR}
55 ABS_CONF_DIR=`pwd`
56
57 #######################################################################
58 # Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
59 sed -e s/GEOM_WITH_GUI=[a-z]*/GEOM_WITH_GUI=${GEOM_WITH_GUI}/g configure.ac > configure.tmp
60 mv -f configure.tmp configure.ac
61
62 mkdir -p salome_adm/unix/config_files
63 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
64 #cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
65
66 cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
67
68 #cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
69
70 # remove KERNEL deprecated configure files
71 #for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
72 #  check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
73 #    check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
74 #    do
75 #      rm -f salome_adm/unix/config_files/${deprecated}
76 #      done
77              
78
79 # ____________________________________________________________________
80 # aclocal creates the aclocal.m4 file from the standard macro and the
81 # custom macro embedded in the directory salome_adm/unix/config_files
82 # and KERNEL config_files directory.
83 # output:
84 #   aclocal.m4
85 #   autom4te.cache (directory)
86 echo "====================================================== aclocal"
87
88 if test ${GEOM_WITH_GUI} = yes; then
89   aclocal -I adm_local/unix/config_files \
90           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
91           -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
92 else
93   aclocal -I adm_local/unix/config_files \
94           -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files || exit 1
95 fi
96
97 # ____________________________________________________________________
98 # libtoolize creates some configuration files (ltmain.sh,
99 # config.guess and config.sub). It only depends on the libtool
100 # version. The files are created in the directory specified with the
101 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
102 # output:
103 #   salome_adm/unix/config_files/config.guess
104 #   salome_adm/unix/config_files/config.sub
105 #   salome_adm/unix/config_files/ltmain.sh
106 #echo "====================================================== libtoolize"
107
108 libtoolize --force --copy --automake || exit 1
109
110 # ____________________________________________________________________
111 # autoconf creates the configure script from the file configure.ac (or
112 # configure.in if configure.ac doesn't exist)
113 # output:
114 #   configure
115 echo "====================================================== autoconf"
116
117 autoconf
118
119 # ____________________________________________________________________
120 # automake creates some scripts used in building process
121 # (install-sh, missing, ...). It only depends on the automake
122 # version. The files are created in the directory specified with the
123 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
124 # creates the Makefile.in files from the Makefile.am files.
125 # output:
126 #   salome_adm/unix/config_files/compile
127 #   salome_adm/unix/config_files/depcomp
128 #   salome_adm/unix/config_files/install-sh
129 #   salome_adm/unix/config_files/missing
130 #   salome_adm/unix/config_files/py-compile
131 #   Makefile.in (from Makefile.am)
132 echo "====================================================== automake"
133
134 automake --copy --gnu --add-missing