configure.ac 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #
  2. # Copyright (C) 2012 by egnite GmbH
  3. # Copyright (C) 2005 by egnite Software GmbH
  4. #
  5. # All rights reserved.
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions
  9. # are met:
  10. #
  11. # 1. Redistributions of source code must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. # 2. Redistributions in binary form must reproduce the above copyright
  14. # notice, this list of conditions and the following disclaimer in the
  15. # documentation and/or other materials provided with the distribution.
  16. # 3. Neither the name of the copyright holders nor the names of
  17. # contributors may be used to endorse or promote products derived
  18. # from this software without specific prior written permission.
  19. #
  20. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  23. # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  24. # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  25. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  26. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  27. # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  28. # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  29. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  30. # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. # SUCH DAMAGE.
  32. #
  33. # For additional information see http://www.ethernut.de/
  34. #
  35. # $Id$
  36. #
  37. AC_INIT(nutdisc, 3.0.0)
  38. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  39. AC_CONFIG_MACRO_DIR([m4])
  40. AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
  41. AC_CONFIG_HEADERS([config.h])
  42. AM_MAINTAINER_MODE
  43. AC_PROG_CC
  44. AC_ARG_ENABLE(nutdisc,
  45. AS_HELP_STRING([--disable-nutdisc],[disable NutOs Discoverer]),
  46. [],
  47. [enable_nutdisc=yes]
  48. )
  49. AC_ARG_ENABLE(wxpropgrid,
  50. AS_HELP_STRING([--disable-wxpropgrid],[disable xwProperty Grid]),
  51. [],
  52. [enable_wxpropgrid=yes]
  53. )
  54. # Path to wx-config by default or from command line.
  55. WXCONFIG=wx-config
  56. AC_ARG_WITH(wx-config,
  57. [[ --with-wx-config=FILE
  58. Use the given path to wx-config when determining
  59. wxWidgets configuration; defaults to "wx-config"]],
  60. [
  61. if test "$withval" != "yes" -a "$withval" != ""; then
  62. WXCONFIG=$withval
  63. fi
  64. ])
  65. # Check wxWidgets' version.
  66. AC_MSG_CHECKING([wxWidgets version])
  67. if wxversion=`$WXCONFIG --version`; then
  68. AC_MSG_RESULT([$wxversion])
  69. wxwidgets_ok=yes
  70. else
  71. AC_MSG_RESULT([not found])
  72. AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
  73. wxwidgets_ok=no
  74. fi
  75. # Check property grid path, may be either /usr/ or /usr/local/.
  76. if test "x$wxwidgets_ok" = "xyes"; then
  77. AC_MSG_NOTICE([checking for propgrid])
  78. if test "x$enable_wxpropgrid" = "xyes" ; then
  79. AC_MSG_NOTICE([wxpropgrid enabled])
  80. AC_MSG_NOTICE([checking for wxpropgrid])
  81. propgridpath1=/usr/include/wx-`wx-config --release`/wx/propgrid
  82. propgridpath2=/usr/local/include/wx-`wx-config --release`/wx/propgrid
  83. AC_CHECK_FILE($propgridpath1/propgrid.h,[propgrid_ok="yes"],[propgrid_ok="no"])
  84. if test "x$propgrid_ok" = "xno"; then
  85. AC_CHECK_FILE($propgridpath2/propgrid.h,[propgrid_ok="yes"],[propgrid_ok="no"])
  86. fi
  87. if test "x$propgrid_ok" = "xno"; then
  88. AC_MSG_WARN(wxpropgrid not found)
  89. else
  90. AC_MSG_NOTICE(wxpropgrid enabled)
  91. fi
  92. else
  93. propgrid_ok=no
  94. AC_MSG_WARN([wxpropgrid disabled])
  95. fi
  96. fi
  97. # Check requirements and enable or disable nutdisc build.
  98. if test "x$wxwidgets_ok" = "xyes"; then
  99. AC_MSG_NOTICE([checking for nutdisc])
  100. if test "x$enable_nutdisc" = "xno"; then
  101. AC_MSG_NOTICE([nutdisc disabled])
  102. nutdisc_ok=no
  103. else
  104. if test "x$propgrid_ok" = "xno"; then
  105. AC_MSG_NOTICE([nutdisc requires propgrid])
  106. nutdisc_ok=no
  107. else
  108. AC_MSG_NOTICE([nutdisc enabled])
  109. nutdisc_ok=yes
  110. fi
  111. fi
  112. fi
  113. WX_CPPFLAGS="`$WXCONFIG --cppflags`"
  114. WX_CXXFLAGS="`$WXCONFIG --cxxflags`"
  115. WX_LIBS="`$WXCONFIG --libs`"
  116. WX_PROPGRID="`$WXCONFIG --optional-libs propgrid`"
  117. AC_SUBST(WX_CPPFLAGS)
  118. AC_SUBST(WX_CXXFLAGS)
  119. AC_SUBST(WX_LIBS)
  120. AC_SUBST(WX_PROPGRID)
  121. AC_PROG_CPP
  122. AC_PROG_CXX
  123. AM_PROG_LIBTOOL
  124. # Propagate our conditionals.
  125. AM_CONDITIONAL(BUILD_NUTDISC, test x$nutdisc_ok = xyes)
  126. AC_OUTPUT([
  127. Makefile
  128. src/Makefile
  129. ])