Salome HOME
Set dev tag back to 1
[samples/randomizer.git] / configure.ac
1 # Copyright (C) 2005-2012  OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 #  PLEASE DO NOT MODIFY configure.in FILE
21 #  ALL CHANGES WILL BE DISCARDED BY THE NEXT
22 #  build_configure COMMAND
23 #  CHANGES MUST BE MADE IN configure.in.base FILE
24 # Author : Marc Tajchman (CEA)
25 # Date : 28/06/2001
26 # Modified by : Patrick GOLDBRONN (CEA)
27 # Modified by : Marc Tajchman (CEA)
28 # Created from configure.in.base
29 #
30 AC_INIT([Salome2 Project RANDOMIZER module],[7.1.0], [webmaster.salome@opencascade.com], [SalomeRANDOMIZER])
31 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
32 AC_CANONICAL_HOST
33 AC_CANONICAL_TARGET
34 AM_INIT_AUTOMAKE([-Wno-portability])
35
36 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
37 AC_SUBST(XVERSION)
38 VERSION_DEV=1
39 AC_SUBST(VERSION_DEV)
40
41 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
42 MODULE_NAME=randomizer
43 AC_SUBST(MODULE_NAME)
44
45 dnl
46 dnl Initialize source and build root directories
47 dnl
48
49 ROOT_BUILDDIR=`pwd`
50 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
51 cd $ROOT_SRCDIR
52 ROOT_SRCDIR=`pwd`
53 cd $ROOT_BUILDDIR
54
55 AC_SUBST(ROOT_SRCDIR)
56 AC_SUBST(ROOT_BUILDDIR)
57
58 echo
59 echo Source root directory : $ROOT_SRCDIR
60 echo Build  root directory : $ROOT_BUILDDIR
61 echo
62 echo
63
64 AC_CHECK_PROG(SHELL,sh)
65 AC_SUBST(SHELL)
66
67 if test -z "$AR"; then
68    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
69 fi
70 AC_SUBST(AR)
71
72 dnl Export the AR macro so that it will be placed in the libtool file
73 dnl correctly.
74 export AR
75
76 echo
77 echo ---------------------------------------------
78 echo testing make
79 echo ---------------------------------------------
80 echo
81
82 AC_PROG_MAKE_SET
83 AC_PROG_INSTALL
84 AC_LOCAL_INSTALL
85 dnl 
86 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairies dynamiques !
87
88 AC_ENABLE_DEBUG(yes)
89 AC_DISABLE_PRODUCTION
90
91 echo ---------------------------------------------
92 echo testing libtool
93 echo ---------------------------------------------
94
95 dnl first, we set static to no!
96 dnl if we want it, use --enable-static
97 AC_ENABLE_STATIC(no)
98
99 AC_LIBTOOL_DLOPEN
100 AC_PROG_LIBTOOL
101
102 dnl Fix up the INSTALL macro if it s a relative path. We want the
103 dnl full-path to the binary instead.
104 case "$INSTALL" in
105    *install-sh*)
106       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
107       ;;
108 esac
109
110 echo ---------------------------------------------
111 echo testing C/C++
112 echo ---------------------------------------------
113 echo
114
115 cc_ok=no
116 dnl inutil car libtool
117 dnl AC_PROG_CC
118 AC_PROG_CXX
119 AC_CXX_WARNINGS
120 AC_CXX_TEMPLATE_OPTIONS
121 AC_DEPEND_FLAG
122 # AC_CC_WARNINGS([ansi])
123 cc_ok=yes
124
125 dnl Library libdl :
126 AC_CHECK_LIB(dl,dlopen)
127
128 dnl Library librt : for alpha/osf
129 AC_CHECK_LIB(rt,nanosleep)
130
131 dnl add library libm :
132 AC_CHECK_LIB(m,ceil)
133
134 AC_CXX_USE_STD_IOSTREAM
135 AC_CXX_HAVE_SSTREAM
136
137 dnl
138 dnl ---------------------------------------------
139 dnl testing linker
140 dnl ---------------------------------------------
141 dnl
142
143 AC_LINKER_OPTIONS
144
145 echo
146 echo ---------------------------------------------
147 echo testing threads
148 echo ---------------------------------------------
149 echo
150
151 ENABLE_PTHREADS
152
153 echo
154 echo ---------------------------------------------
155 echo testing Python
156 echo ---------------------------------------------
157 echo
158
159 CHECK_PYTHON
160
161 AM_PATH_PYTHON(2.3)
162
163 echo
164 echo ---------------------------------------------
165 echo testing omniORB
166 echo ---------------------------------------------
167 echo
168
169 CHECK_OMNIORB
170
171 echo
172 echo ---------------------------------------------
173 echo default ORB : omniORB
174 echo ---------------------------------------------
175 echo
176
177 DEFAULT_ORB=omniORB
178 CHECK_CORBA
179
180 AC_SUBST_FILE(CORBA)
181 corba=make_$ORB
182 CORBA=adm_local/unix/$corba
183
184 echo
185 echo ---------------------------------------------
186 echo Testing html generators
187 echo ---------------------------------------------
188 echo
189
190 CHECK_HTML_GENERATORS
191
192 echo
193 echo ---------------------------------------------
194 echo Testing GUI
195 echo ---------------------------------------------
196 echo
197
198 CHECK_SALOME_GUI
199
200 echo
201 echo ---------------------------------------------
202 echo Testing full GUI
203 echo ---------------------------------------------
204 echo
205
206 CHECK_CORBA_IN_GUI
207 if test "x${CORBA_IN_GUI}" != "xyes"; then
208   echo "failed : For configure CALCULATOR module necessary full GUI !"
209   exit
210 fi
211
212 echo
213 echo ---------------------------------------------
214 echo Testing Kernel
215 echo ---------------------------------------------
216 echo
217
218 CHECK_KERNEL
219
220 echo
221 echo ---------------------------------------------
222 echo Summary
223 echo ---------------------------------------------
224 echo
225
226 echo Configure
227 variables="python_ok omniORB_ok doxygen_ok graphviz_ok Kernel_ok"
228
229 for var in $variables
230 do
231    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
232    eval echo \$$var
233 done
234
235 echo
236 echo "Default ORB   : $DEFAULT_ORB"
237 echo
238
239 dnl We don t need to say when we re entering directories if we re using
240 dnl GNU make becuase make does it for us.
241 if test "X$GMAKE" = "Xyes"; then
242    AC_SUBST(SETX) SETX=":"
243 else
244    AC_SUBST(SETX) SETX="set -x"
245 fi
246 echo
247 echo ---------------------------------------------
248 echo generating Makefiles and configure files
249 echo ---------------------------------------------
250 echo
251
252 AC_OUTPUT_COMMANDS([ \
253       chmod +x ./bin/*; \
254 ])
255
256 AC_HACK_LIBTOOL
257 AC_CONFIG_COMMANDS([hack_libtool],[
258 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
259   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
260 }\n\
261 CC=\"hack_libtool\"%g" libtool
262 sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool
263 sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool
264 sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1  if ! test -d \$sss; then continue; fi\n\1  ssss=\$(cd \$sss; pwd)\n\1  if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1    case \$ssss in\n\1      /usr/lib | /usr/lib64 ) ;;\n\1      * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1    esac\n\1  fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool
265 ],[])
266
267 # This list is initiated using autoscan and must be updated manually
268 # when adding a new file <filename>.in to manage. When you execute
269 # autoscan, the Makefile list is generated in the output file configure.scan.
270 # This could be helpfull to update de configuration.
271 AC_OUTPUT([ \
272   adm_local/Makefile \
273   adm_local/unix/Makefile \
274   adm_local/unix/config_files/Makefile \
275   bin/VERSION \
276   bin/Makefile \
277   src/Makefile \
278   src/Randomizer/Makefile \
279   resources/Makefile \
280   resources/RANDOMIZERCatalog.xml \
281   resources/SalomeApp.xml \
282   idl/Makefile \
283   Makefile \
284 ])