1 dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 dnl File : local_install.m4
24 dnl Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
28 dnl The purpose of below autoconf macro is to generate custom install script
29 dnl to be used instead of global /usr/bin/install one.
30 dnl The difference is that resulting install script does not install file passed
31 dnl as parameter if its target copy exists and the file is not changed, i.e
32 dnl source and target files are the identical.
33 dnl The check is performed by the diff command.
35 AC_DEFUN([AC_LOCAL_INSTALL],
37 GLOBAL_INSTALL=$INSTALL
39 INSTALL=${absdir}/local-install.sh
40 cat > ${INSTALL} << EOF
45 if test \$nb_args -gt 1 ; then
46 nb=\$(expr \$nb_args - 2)
49 if test -f \$target ; then
51 if test -f \$orig ; then
52 diff \$orig \$target > /dev/null 2>&1
53 if test \$[?] = 0 ; then
54 echo \$orig and \$target are identical
60 ${GLOBAL_INSTALL} \$args
64 AC_SUBST(GLOBAL_INSTALL)