Commit fca863b7fdafe0c319c852677e2cd7bc19011ac8

Authored by Jürgen Knödlseder
1 parent 15ebebe9

Don't check for swig and wrappers if Python bindings are disabled.

Showing 1 changed file with 67 additions and 66 deletions
configure.ac
... ... @@ -810,57 +810,58 @@ else
810 810  
811 811 fi
812 812  
813   -fi
814   -
815   -# Do we have swig?
816   -AC_PATH_PROG([SWIG], [swig])
817   -if test "$SWIG"; then
818   - has_swig="yes"
819   -fi
820   -AM_CONDITIONAL(HAVE_SWIG, test "x$has_swig" = "xyes")
  813 + # Do we have swig?
  814 + AC_PATH_PROG([SWIG], [swig])
  815 + if test "$SWIG"; then
  816 + has_swig="yes"
  817 + fi
821 818  
822   -# Do we have Python wrappers
823   -has_wrappers="yes"
824   -AC_CHECK_FILES([pyext/gammalib/app_wrap.cpp pyext/gammalib/app.py
825   - pyext/gammalib/fits_wrap.cpp pyext/gammalib/fits.py
826   - pyext/gammalib/linalg_wrap.cpp pyext/gammalib/linalg.py
827   - pyext/gammalib/model_wrap.cpp pyext/gammalib/model.py
828   - pyext/gammalib/mwl_wrap.cpp pyext/gammalib/mwl.py
829   - pyext/gammalib/numerics_wrap.cpp pyext/gammalib/numerics.py
830   - pyext/gammalib/obs_wrap.cpp pyext/gammalib/obs.py
831   - pyext/gammalib/opt_wrap.cpp pyext/gammalib/opt.py
832   - pyext/gammalib/sky_wrap.cpp pyext/gammalib/sky.py
833   - pyext/gammalib/support_wrap.cpp pyext/gammalib/support.py
834   - pyext/gammalib/test_wrap.cpp pyext/gammalib/test.py
835   - pyext/gammalib/xml_wrap.cpp pyext/gammalib/xml.py],,
836   - [has_wrappers="no"])
837   -if test "x$with_mwl" = "xyes"; then
838   - AC_CHECK_FILES([pyext/gammalib/mwl_wrap.cpp pyext/gammalib/mwl.py],,
  819 + # Do we have Python wrappers
  820 + has_wrappers="yes"
  821 + AC_CHECK_FILES([pyext/gammalib/app_wrap.cpp pyext/gammalib/app.py
  822 + pyext/gammalib/fits_wrap.cpp pyext/gammalib/fits.py
  823 + pyext/gammalib/linalg_wrap.cpp pyext/gammalib/linalg.py
  824 + pyext/gammalib/model_wrap.cpp pyext/gammalib/model.py
  825 + pyext/gammalib/mwl_wrap.cpp pyext/gammalib/mwl.py
  826 + pyext/gammalib/numerics_wrap.cpp pyext/gammalib/numerics.py
  827 + pyext/gammalib/obs_wrap.cpp pyext/gammalib/obs.py
  828 + pyext/gammalib/opt_wrap.cpp pyext/gammalib/opt.py
  829 + pyext/gammalib/sky_wrap.cpp pyext/gammalib/sky.py
  830 + pyext/gammalib/support_wrap.cpp pyext/gammalib/support.py
  831 + pyext/gammalib/test_wrap.cpp pyext/gammalib/test.py
  832 + pyext/gammalib/xml_wrap.cpp pyext/gammalib/xml.py],,
839 833 [has_wrappers="no"])
840   -fi
841   -if test "x$with_lat" = "xyes"; then
842   - AC_CHECK_FILES([pyext/gammalib/lat_wrap.cpp pyext/gammalib/lat.py],,
843   - [has_wrappers="no"])
844   -fi
845   -if test "x$with_cta" = "xyes"; then
846   - AC_CHECK_FILES([pyext/gammalib/cta_wrap.cpp pyext/gammalib/cta.py],,
847   - [has_wrappers="no"])
848   -fi
849   -if test "x$has_wrappers" = "xno"; then
850   - AC_MSG_WARN([Python wrapper(s) missing. Requires swig for wrapper generation.])
851   -fi
  834 + if test "x$with_mwl" = "xyes"; then
  835 + AC_CHECK_FILES([pyext/gammalib/mwl_wrap.cpp pyext/gammalib/mwl.py],,
  836 + [has_wrappers="no"])
  837 + fi
  838 + if test "x$with_lat" = "xyes"; then
  839 + AC_CHECK_FILES([pyext/gammalib/lat_wrap.cpp pyext/gammalib/lat.py],,
  840 + [has_wrappers="no"])
  841 + fi
  842 + if test "x$with_cta" = "xyes"; then
  843 + AC_CHECK_FILES([pyext/gammalib/cta_wrap.cpp pyext/gammalib/cta.py],,
  844 + [has_wrappers="no"])
  845 + fi
  846 + if test "x$has_wrappers" = "xno"; then
  847 + AC_MSG_WARN([Python wrapper(s) missing. Requires swig for wrapper generation.])
  848 + fi
852 849  
853   -# Do we have wrappers or can we created wrappers?
854   -can_wrappers="no"
855   -if [test "x$has_wrappers" = "xyes" -o "x$has_swig" = "xyes"]; then
856   - can_wrappers="yes"
857   -fi
  850 + # Do we have wrappers or can we created wrappers?
  851 + can_wrappers="no"
  852 + if [test "x$has_wrappers" = "xyes" -o "x$has_swig" = "xyes"]; then
  853 + can_wrappers="yes"
  854 + fi
  855 +
  856 + # Signal if Python is enabled
  857 + if [test "x$ac_enable_python_binding" = "xyes" -a "x$has_python" = "xyes" -a "x$has_python_h" = "xyes" -a "x$can_wrappers" = "xyes"]; then
  858 + enable_python="yes"
  859 + AC_DEFINE([HAVE_PYTHON], [1], [Define if Python bindings are built])
  860 + fi
  861 +
858 862  
859   -# Signal if Python is enabled
860   -if [test "x$ac_enable_python_binding" = "xyes" -a "x$has_python" = "xyes" -a "x$has_python_h" = "xyes" -a "x$can_wrappers" = "xyes"]; then
861   - enable_python="yes"
862   - AC_DEFINE([HAVE_PYTHON], [1], [Define if Python bindings are built])
863 863 fi
  864 +AM_CONDITIONAL(HAVE_SWIG, test "x$has_swig" = "xyes")
864 865 AM_CONDITIONAL(WITH_PYTHON, test "x$enable_python" = "xyes")
865 866  
866 867 # Set Python environment
... ... @@ -1240,26 +1241,6 @@ else
1240 1241 echo " - Readline support (no) no ncurses library found"
1241 1242 fi
1242 1243 fi
1243   -if test "x$has_python" = "xyes"; then
1244   - echo " * Python (yes)"
1245   -else
1246   - echo " - Python (no)"
1247   -fi
1248   -if test "x$has_python_h" = "xyes"; then
1249   - echo " * Python.h (yes)"
1250   -else
1251   - echo " - Python.h (no)"
1252   -fi
1253   -if test "x$has_wrappers" = "xyes"; then
1254   - echo " * Python wrappers (yes)"
1255   -else
1256   - echo " - Python wrappers (no)"
1257   -fi
1258   -if test "x$has_swig" = "xyes"; then
1259   - echo " * swig (yes)"
1260   -else
1261   - echo " - swig (no)"
1262   -fi
1263 1244  
1264 1245 # Dump Python bindings information
1265 1246 if test "x$ac_enable_python_binding" = "xyes"; then
... ... @@ -1284,6 +1265,26 @@ if test "x$ac_enable_python_binding" = "xyes"; then
1284 1265 else
1285 1266 echo " - Make Python binding (no) Python not installed"
1286 1267 fi
  1268 + if test "x$has_python" = "xyes"; then
  1269 + echo " * Python (yes)"
  1270 + else
  1271 + echo " - Python (no)"
  1272 + fi
  1273 + if test "x$has_python_h" = "xyes"; then
  1274 + echo " * Python.h (yes)"
  1275 + else
  1276 + echo " - Python.h (no)"
  1277 + fi
  1278 + if test "x$has_wrappers" = "xyes"; then
  1279 + echo " * Python wrappers (yes)"
  1280 + else
  1281 + echo " - Python wrappers (no)"
  1282 + fi
  1283 + if test "x$has_swig" = "xyes"; then
  1284 + echo " * swig (yes)"
  1285 + else
  1286 + echo " - swig (no)"
  1287 + fi
1287 1288 else
1288 1289 echo " - Make Python binding (no)"
1289 1290 fi
... ...