m4/lx_check_cplex.m4
changeset 1177 3c00344f49c9
parent 1176 cd72eae05bdf
parent 1175 6b79d93e812f
child 1178 e5af35e6c93f
     1.1 --- a/m4/lx_check_cplex.m4	Mon Jul 16 16:21:40 2018 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,81 +0,0 @@
     1.4 -AC_DEFUN([LX_CHECK_CPLEX],
     1.5 -[
     1.6 -  AC_ARG_WITH([cplex],
     1.7 -AS_HELP_STRING([--with-cplex@<:@=PREFIX@:>@], [search for CPLEX under PREFIX or under the default search paths if PREFIX is not given @<:@default@:>@])
     1.8 -AS_HELP_STRING([--without-cplex], [disable checking for CPLEX]),
     1.9 -              [], [with_cplex=yes])
    1.10 -
    1.11 -  AC_ARG_WITH([cplex-includedir],
    1.12 -AS_HELP_STRING([--with-cplex-includedir=DIR], [search for CPLEX headers in DIR]),
    1.13 -              [], [with_cplex_includedir=no])
    1.14 -
    1.15 -  AC_ARG_WITH([cplex-libdir],
    1.16 -AS_HELP_STRING([--with-cplex-libdir=DIR], [search for CPLEX libraries in DIR]),
    1.17 -              [], [with_cplex_libdir=no])
    1.18 -
    1.19 -  lx_cplex_found=no
    1.20 -  if test x"$with_cplex" != x"no"; then
    1.21 -    AC_MSG_CHECKING([for CPLEX])
    1.22 -
    1.23 -    if test x"$with_cplex_includedir" != x"no"; then
    1.24 -      CPLEX_CFLAGS="-I$with_cplex_includedir"
    1.25 -    elif test x"$with_cplex" != x"yes"; then
    1.26 -      CPLEX_CFLAGS="-I$with_cplex/include"
    1.27 -    elif test x"$CPLEX_INCLUDEDIR" != x; then
    1.28 -      CPLEX_CFLAGS="-I$CPLEX_INCLUDEDIR"
    1.29 -    fi
    1.30 -
    1.31 -    if test x"$with_cplex_libdir" != x"no"; then
    1.32 -      CPLEX_LDFLAGS="-L$with_cplex_libdir"
    1.33 -    elif test x"$with_cplex" != x"yes"; then
    1.34 -      CPLEX_LDFLAGS="-L$with_cplex/lib"
    1.35 -    elif test x"$CPLEX_LIBDIR" != x; then
    1.36 -      CPLEX_LDFLAGS="-L$CPLEX_LIBDIR"
    1.37 -    fi
    1.38 -    CPLEX_LIBS="-lcplex -lm -lpthread"
    1.39 -
    1.40 -    lx_save_cxxflags="$CXXFLAGS"
    1.41 -    lx_save_ldflags="$LDFLAGS"
    1.42 -    lx_save_libs="$LIBS"
    1.43 -    CXXFLAGS="$CPLEX_CFLAGS"
    1.44 -    LDFLAGS="$CPLEX_LDFLAGS"
    1.45 -    LIBS="$CPLEX_LIBS"
    1.46 -
    1.47 -    lx_cplex_test_prog='
    1.48 -      extern "C" {
    1.49 -      #include <ilcplex/cplex.h>
    1.50 -      }
    1.51 -
    1.52 -      int main(int argc, char** argv)
    1.53 -      {
    1.54 -        CPXENVptr env = NULL;
    1.55 -        return 0;
    1.56 -      }'
    1.57 -
    1.58 -    AC_LANG_PUSH(C++)
    1.59 -    AC_LINK_IFELSE([$lx_cplex_test_prog], [lx_cplex_found=yes], [lx_cplex_found=no])
    1.60 -    AC_LANG_POP(C++)
    1.61 -
    1.62 -    CXXFLAGS="$lx_save_cxxflags"
    1.63 -    LDFLAGS="$lx_save_ldflags"
    1.64 -    LIBS="$lx_save_libs"
    1.65 -
    1.66 -    if test x"$lx_cplex_found" = x"yes"; then
    1.67 -      AC_DEFINE([LEMON_HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.])
    1.68 -      lx_lp_found=yes
    1.69 -      AC_DEFINE([LEMON_HAVE_LP], [1], [Define to 1 if you have any LP solver.])
    1.70 -      lx_mip_found=yes
    1.71 -      AC_DEFINE([LEMON_HAVE_MIP], [1], [Define to 1 if you have any MIP solver.])
    1.72 -      AC_MSG_RESULT([yes])
    1.73 -    else
    1.74 -      CPLEX_CFLAGS=""
    1.75 -      CPLEX_LDFLAGS=""
    1.76 -      CPLEX_LIBS=""
    1.77 -      AC_MSG_RESULT([no])
    1.78 -    fi
    1.79 -  fi
    1.80 -  CPLEX_LIBS="$CPLEX_LDFLAGS $CPLEX_LIBS"
    1.81 -  AC_SUBST(CPLEX_CFLAGS)
    1.82 -  AC_SUBST(CPLEX_LIBS)
    1.83 -  AM_CONDITIONAL([HAVE_CPLEX], [test x"$lx_cplex_found" = x"yes"])
    1.84 -])