Salome HOME
c49ce1db655d31eb5e69d369522819bd3bf79994
[samples/pylight.git] / configure.ac
1 # Copyright (C) 2009-2013  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.ac file
24 #  Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)
25 #  Date   : 13/04/2009
26 #
27 AC_INIT([Salome2 Project PYLIGHT module], [7.1.0], [webmaster.salome@opencascade.com], [SalomePYLIGHT])
28 AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
29 AC_CANONICAL_HOST
30 AC_CANONICAL_TARGET
31 AM_INIT_AUTOMAKE([-Wno-portability])
32
33 XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
34 AC_SUBST(XVERSION)
35
36 # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
37 MODULE_NAME=pylight
38 AC_SUBST(MODULE_NAME)
39 VERSION_DEV=1
40 AC_SUBST(VERSION_DEV)
41
42 dnl
43 dnl Initialize source and build root directories
44 dnl
45
46 ROOT_BUILDDIR=`pwd`
47 ROOT_SRCDIR=`echo $0 | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
48 cd $ROOT_SRCDIR
49 ROOT_SRCDIR=`pwd`
50 cd $ROOT_BUILDDIR
51
52 AC_SUBST(ROOT_SRCDIR)
53 AC_SUBST(ROOT_BUILDDIR)
54
55 echo
56 echo Source root directory : $ROOT_SRCDIR
57 echo Build  root directory : $ROOT_BUILDDIR
58 echo
59 echo
60
61 AC_CHECK_PROG(SHELL,sh)
62 AC_SUBST(SHELL)
63
64 if test -z "$AR"; then
65    AC_CHECK_PROGS(AR,ar xar,:,$PATH)
66 fi
67 AC_SUBST(AR)
68
69 dnl Export the AR macro so that it will be placed in the libtool file
70 dnl correctly.
71 export AR
72
73 echo
74 echo ---------------------------------------------
75 echo testing make
76 echo ---------------------------------------------
77 echo
78
79 AC_PROG_MAKE_SET
80 AC_PROG_INSTALL
81 AC_LOCAL_INSTALL
82 dnl 
83 dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries
84
85 AC_ENABLE_DEBUG(yes)
86 AC_DISABLE_PRODUCTION
87
88 echo ---------------------------------------------
89 echo testing libtool
90 echo ---------------------------------------------
91
92 dnl first, we set static to no!
93 dnl if we want it, use --enable-static
94 AC_ENABLE_STATIC(no)
95
96 AC_LIBTOOL_DLOPEN
97 AC_PROG_LIBTOOL
98
99 dnl Fix up the INSTALL macro if it s a relative path. We want the
100 dnl full-path to the binary instead.
101 case "$INSTALL" in
102    *install-sh*)
103       INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh
104       ;;
105 esac
106
107 echo
108 echo ---------------------------------------------
109 echo testing python
110 echo ---------------------------------------------
111 echo
112
113 CHECK_PYTHON
114
115 AM_PATH_PYTHON(2.3)
116
117 echo
118 echo ---------------------------------------------
119 echo testing QT
120 echo ---------------------------------------------
121 echo
122
123 CHECK_QT
124
125 echo
126 echo ---------------------------------------------
127 echo Testing Kernel
128 echo ---------------------------------------------
129 echo
130
131 CHECK_KERNEL
132
133 echo
134 echo ---------------------------------------------
135 echo Testing GUI
136 echo ---------------------------------------------
137 echo
138
139 CHECK_SALOME_GUI
140
141 echo
142 echo ---------------------------------------------
143 echo Summary
144 echo ---------------------------------------------
145 echo
146
147
148 echo
149 echo ---------------------------------------------
150 echo testing VTK
151 echo ---------------------------------------------
152 echo
153
154 CHECK_VTK
155
156 echo
157 echo ---------------------------------------------
158 echo Testing pyqt
159 echo ---------------------------------------------
160 echo
161
162 CHECK_PYQT
163
164
165 echo Configure
166 variables="python_ok qt_ok pyqt_ok vtk_ok Kernel_ok"
167
168 for var in $variables
169 do
170    printf "   %10s : " `echo \$var | sed -e "s,_ok,,"`
171    eval echo \$$var
172 done
173
174 dnl We don t need to say when we re entering directories if we re using
175 dnl GNU make becuase make does it for us.
176 if test "X$GMAKE" = "Xyes"; then
177    AC_SUBST(SETX) SETX=":"
178 else
179    AC_SUBST(SETX) SETX="set -x"
180 fi
181 echo
182 echo ---------------------------------------------
183 echo generating Makefiles and configure files
184 echo ---------------------------------------------
185 echo
186
187 AC_OUTPUT_COMMANDS([ \
188       chmod +x ./bin/*; \
189 ])
190
191 AC_HACK_LIBTOOL
192 AC_CONFIG_COMMANDS([hack_libtool],[
193 sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\
194   $(pwd)/hack_libtool \1 \"\$[@]\" \n\
195 }\n\
196 CC=\"hack_libtool\"%g" libtool
197 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
198 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
199 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
200 ],[])
201
202 # This list is initiated using autoscan and must be updated manually
203 # when adding a new file <filename>.in to manage. When you execute
204 # autoscan, the Makefile list is generated in the output file configure.scan.
205 # This could be helpfull to update de configuration.
206 AC_OUTPUT([ \
207   adm_local/Makefile \
208   adm_local/unix/Makefile \
209   adm_local/unix/config_files/Makefile \
210   bin/VERSION \
211   bin/Makefile \
212   src/Makefile \
213   src/PYLIGHTGUI/Makefile \
214   resources/Makefile \
215   resources/SalomeApp.xml \
216   Makefile \
217 ])