You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.7 KiB

  1. dnl Process this file with autoconf to produce a configure script
  2. AC_INIT([GLPK], [4.57], [bug-glpk@gnu.org])
  3. AC_CONFIG_SRCDIR([src/glpk.h])
  4. AC_CONFIG_MACRO_DIR([m4])
  5. AM_INIT_AUTOMAKE
  6. AC_CONFIG_HEADERS([config.h])
  7. AC_ARG_WITH(gmp,
  8. AC_HELP_STRING([--with-gmp],
  9. [use GNU MP bignum library [[default=no]]]),
  10. [case $withval in
  11. yes | no) ;;
  12. *) AC_MSG_ERROR([invalid value `$withval' for --with-gmp]);;
  13. esac],
  14. [with_gmp=no])
  15. AC_ARG_ENABLE(dl,
  16. AC_HELP_STRING([--enable-dl],
  17. [enable shared library support [[default=no]]]),
  18. [case $enableval in
  19. yes | ltdl | dlfcn | no) ;;
  20. *) AC_MSG_ERROR([invalid value `$enableval' for --enable-dl]);;
  21. esac],
  22. [enable_dl=no])
  23. AC_ARG_ENABLE(odbc,
  24. AC_HELP_STRING([--enable-odbc],
  25. [enable MathProg ODBC support [[default=no]]]),
  26. [case $enableval in
  27. yes | unix | no) ;;
  28. *) AC_MSG_ERROR([invalid value `$enableval' for --enable-odbc]);;
  29. esac],
  30. [enable_odbc=no])
  31. AC_ARG_ENABLE(mysql,
  32. AC_HELP_STRING([--enable-mysql],
  33. [enable MathProg MySQL support [[default=no]]]),
  34. [case $enableval in
  35. yes | no) ;;
  36. *) AC_MSG_ERROR([invalid value `$enableval' for --enable-mysql]);;
  37. esac],
  38. [enable_mysql=no])
  39. dnl Disable unnecessary libtool tests
  40. define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
  41. define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
  42. define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
  43. dnl Check for programs
  44. AC_PROG_CC
  45. AC_PROG_INSTALL
  46. AC_PROG_LIBTOOL
  47. dnl Check for math library
  48. AC_CHECK_LIB([m], [exp])
  49. dnl Check for <sys/time.h> header
  50. AC_CHECK_HEADER([sys/time.h],
  51. AC_DEFINE([HAVE_SYS_TIME_H], [1], [N/A]))
  52. dnl Check for gettimeofday function
  53. AC_CHECK_FUNC([gettimeofday],
  54. AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [N/A]))
  55. dnl Check for <gmp.h> header
  56. if test "$with_gmp" = "yes"; then
  57. AC_CHECK_HEADER([gmp.h], [],
  58. [AC_MSG_ERROR([gmp.h header not found])])
  59. fi
  60. AC_MSG_CHECKING([whether to use GNU MP bignum library])
  61. if test "$with_gmp" = "yes"; then
  62. AC_MSG_RESULT([yes])
  63. AC_DEFINE([HAVE_GMP], [1], [N/A])
  64. LIBS="-lgmp $LIBS"
  65. else
  66. AC_MSG_RESULT([no])
  67. fi
  68. AC_MSG_CHECKING([whether to enable shared library support])
  69. if test "$enable_dl" = "yes"; then
  70. AC_MSG_RESULT([ltdl])
  71. AC_DEFINE([HAVE_LTDL], [1], [N/A])
  72. LIBS="-lltdl $LIBS"
  73. elif test "$enable_dl" = "ltdl"; then
  74. AC_MSG_RESULT([ltdl])
  75. AC_DEFINE([HAVE_LTDL], [1], [N/A])
  76. LIBS="-lltdl $LIBS"
  77. elif test "$enable_dl" = "dlfcn"; then
  78. AC_MSG_RESULT([dlfcn])
  79. AC_DEFINE([HAVE_DLFCN], [1], [N/A])
  80. else
  81. AC_MSG_RESULT([no])
  82. fi
  83. case $host_os in
  84. darwin* | macosx*)
  85. LIBIODBC="libiodbc.dylib"
  86. LIBODBC="libodbc.dylib"
  87. LIBMYSQL="libmysqlclient.dylib"
  88. ;;
  89. *)
  90. LIBIODBC="libiodbc.so"
  91. LIBODBC="libodbc.so"
  92. LIBMYSQL="libmysqlclient.so"
  93. ;;
  94. esac
  95. AC_MSG_CHECKING([whether to enable MathProg ODBC support])
  96. if test "$enable_odbc" = "yes"; then
  97. if test "$enable_dl" = "no"; then
  98. AC_MSG_ERROR([--enable-odbc requires --enable-dl])
  99. fi
  100. AC_MSG_RESULT([yes])
  101. CFLAGS="$(iodbc-config --cflags) $CFLAGS"
  102. AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBIODBC"], [N/A])
  103. elif test "$enable_odbc" = "unix"; then
  104. if test "$enable_dl" = "no"; then
  105. AC_MSG_ERROR([--enable-odbc requires --enable-dl])
  106. fi
  107. AC_MSG_RESULT([unix])
  108. AC_DEFINE_UNQUOTED([ODBC_DLNAME], ["$LIBODBC"], [N/A])
  109. else
  110. AC_MSG_RESULT([no])
  111. fi
  112. AC_MSG_CHECKING([whether to enable MathProg MySQL support])
  113. if test "$enable_mysql" = "yes"; then
  114. if test "$enable_dl" = "no"; then
  115. AC_MSG_ERROR([--enable-mysql requires --enable-dl])
  116. fi
  117. AC_MSG_RESULT([yes])
  118. CPPFLAGS="-I/usr/include/mysql $CPPFLAGS"
  119. AC_DEFINE_UNQUOTED([MYSQL_DLNAME], ["$LIBMYSQL"], [N/A])
  120. else
  121. AC_MSG_RESULT([no])
  122. fi
  123. AC_CONFIG_FILES(
  124. [src/Makefile examples/Makefile Makefile])
  125. AC_OUTPUT
  126. dnl eof