Salome HOME
updated copyright message
[modules/yacs.git] / adm / unix / config_files / ac_pkg_swig.m4
old mode 100755 (executable)
new mode 100644 (file)
index 625a012..37e8b31
@@ -1,26 +1,39 @@
-dnl @synopsis AC_PROG_SWIG([major.minor.micro])
+dnl Copyright (C) 2006-2023  CEA/DEN, EDF R&D
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 dnl
+dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+dnl
+
+dnl @synopsis AC_PROG_SWIG([major.minor.micro])
 dnl This macro searches for a SWIG installation on your system. If found you
 dnl should) SWIG via $(SWIG).  You can use the optional first argument to check
 dnl if the version of the available SWIG is greater than or equal to the
 dnl value of the argument.  It should have the format: N[.N[.N]] (N is a
 dnl number between 0 and 999.  Only the first N is mandatory.)
-dnl
 dnl If the version argument is given (e.g. 1.3.17), AC_PROG_SWIG checks that the
 dnl swig package is this version number or higher.
-dnl
 dnl In configure.in, use as:
-dnl
 dnl            AC_PROG_SWIG(1.3.17)
 dnl            SWIG_ENABLE_CXX
 dnl            SWIG_MULTI_MODULE_SUPPORT
 dnl            SWIG_PYTHON
-dnl
 dnl @authors Sebastian Huber <address@hidden>, Alan W. Irwin
 dnl <address@hidden>, Rafael Laboissiere <address@hidden> and
 dnl Andrew Collier <address@hidden>.
 dnl
-dnl
 AC_DEFUN([AC_PROG_SWIG],[
   swig_ok=no
        AC_PATH_PROG([SWIG],[swig])
@@ -64,17 +77,35 @@ AC_DEFUN([AC_PROG_SWIG],[
                        if test -z "$available_patch" ; then
                                [available_patch=0]
                        fi
-                       if test $available_major -ne $required_major \
-                               -o $available_minor -ne $required_minor \
-                               -o $available_patch -lt $required_patch ; then
-                               AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version.  You should look at http://www.swig.org])
-                               SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
-                       else
-                               AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+      if test $available_major -lt $required_major ; then
+        AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version (major version too low).  You should look at http://www.swig.org])
+        SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+      elif test $available_major -eq $required_major; then
+        if test $available_minor -lt $required_minor ; then
+          AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version (minor version too low).  You should look at http://www.swig.org])
+          SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+        elif test $available_minor -eq $required_minor ;then
+          if test $available_patch -lt $required_patch; then
+            AC_MSG_WARN([SWIG version >= $1 is required.  You have $swig_version (maintenance version too low).  You should look at http://www.swig.org])
+            SWIG='echo "Error: SWIG version >= $1 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+          else
+            AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+            swig_ok=yes
+            SWIG_LIB=`$SWIG -swiglib`
+            AC_MSG_NOTICE([SWIG runtime library directory is '$SWIG_LIB'])
+          fi
+        else
+          AC_MSG_NOTICE([SWIG executable is '$SWIG'])
+          swig_ok=yes
+          SWIG_LIB=`$SWIG -swiglib`
+          AC_MSG_NOTICE([SWIG runtime library directory is '$SWIG_LIB'])
+        fi
+      else
+        AC_MSG_NOTICE([SWIG executable is '$SWIG'])
         swig_ok=yes
-                               SWIG_LIB=`$SWIG -swiglib`
-                               AC_MSG_NOTICE([SWIG runtime library directory is '$SWIG_LIB'])
-                       fi
+        SWIG_LIB=`$SWIG -swiglib`
+        AC_MSG_NOTICE([SWIG runtime library directory is '$SWIG_LIB'])
+      fi
                else
                        AC_MSG_WARN([cannot determine SWIG version])
                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'