Salome HOME
Fix make problems
[modules/med.git] / build_configure
1 #!/bin/sh
2 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 # Tool for updating list of .in file for the SALOME project 
25 # and regenerating configure script
26 # It may be called with --with-kernel[=yes,no] or --without-kernel
27 # option, default is --with-kernel=yes
28 # Author : Marc Tajchman - CEA
29 # Date : 10/10/2002
30 # $Header$
31 # 14/03/2007: Mikhail PONIKAROV - OCN
32 # Reorganization for uage of autotools
33 #
34 ORIG_DIR=`pwd`
35 CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
36
37 ########################################################################
38 # Check --with-kernel option
39
40 MED_WITH_KERNEL="yes"
41
42 for option
43 do
44   case $option in
45       -with-kernel | --with-kernel)
46           MED_WITH_KERNEL="yes"
47           break;;
48       -without-kernel | --without-kernel | -with-kernel=no | --with-kernel=no)
49           MED_WITH_KERNEL="no"
50           break;;
51   esac
52 done
53
54 ########################################################################
55 # Test if the KERNEL_ROOT_DIR is set correctly if KERNEL required
56
57 if test ${MED_WITH_KERNEL} = yes; then
58     if test ! -d "${KERNEL_ROOT_DIR}"; then
59         echo "failed : KERNEL_ROOT_DIR variable is not correct !"
60         exit
61     fi
62 fi
63 ########################################################################
64
65 cd ${CONF_DIR}
66 ABS_CONF_DIR=`pwd`
67
68 #######################################################################
69 # Update configure.ac script: to set MED_WITH_KERNEL variable
70 chmod +w configure.ac
71 sed -e s/MED_WITH_KERNEL=[a-z]*/MED_WITH_KERNEL=${MED_WITH_KERNEL}/g configure.ac > configure.tmp
72 mv -f configure.tmp configure.ac
73
74 # copy configure files
75 CONFIGURE_SOURCE_DIR=${KERNEL_ROOT_DIR}/salome_adm
76 if test ${MED_WITH_KERNEL} = no; then
77   CONFIGURE_SOURCE_DIR=${ABS_CONF_DIR}/adm_local_without_kernel
78 fi
79
80 #######################################################################
81
82 # ____________________________________________________________________
83 # aclocal creates the aclocal.m4 file from the standard macro and the
84 # custom macro embedded in the directory adm_local/unix/config_files
85 # and KERNEL salome_adm/unix/config_files directory.
86 # output:
87 #   aclocal.m4
88 #   autom4te.cache (directory)
89 echo "======================================================= aclocal"
90
91 if test -d "${GUI_ROOT_DIR}"; then
92   aclocal -I adm_local/unix/config_files \
93           -I ${CONFIGURE_SOURCE_DIR}/unix/config_files \
94           -I ${GUI_ROOT_DIR}/adm_local/unix/config_files || exit 1
95 else
96   aclocal -I adm_local/unix/config_files \
97           -I ${CONFIGURE_SOURCE_DIR}/unix/config_files || exit 1
98 fi
99
100 # ____________________________________________________________________
101 # libtoolize creates some configuration files (ltmain.sh,
102 # config.guess and config.sub). It only depends on the libtool
103 # version. The files are created in the directory specified with the
104 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
105 # output:
106 #   adm_local/unix/config_files/config.guess
107 #   adm_local/unix/config_files/config.sub
108 #   adm_local/unix/config_files/ltmain.sh
109 echo "==================================================== libtoolize"
110
111 libtoolize --force --copy --automake || exit 1
112
113 # ____________________________________________________________________
114 # autoconf creates the configure script from the file configure.ac (or
115 # configure.in if configure.ac doesn't exist)
116 # output:
117 #   configure
118 echo "====================================================== autoconf"
119
120 autoconf
121
122 # ____________________________________________________________________
123 # automake creates some scripts used in building process
124 # (install-sh, missing, ...). It only depends on the automake
125 # version. The files are created in the directory specified with the
126 # AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
127 # creates the Makefile.in files from the Makefile.am files.
128 # output:
129 #   adm_local/unix/config_files/compile
130 #   adm_local/unix/config_files/depcomp
131 #   adm_local/unix/config_files/install-sh
132 #   adm_local/unix/config_files/missing
133 #   adm_local/unix/config_files/py-compile
134 #   Makefile.in (from Makefile.am)
135 echo "====================================================== automake"
136
137 automake --copy --gnu --add-missing --warnings=no-portability