No Description
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.

configure.ac 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.59)
  4. AC_INIT(libcvautomation, 2.1, bspeice@uncc.edu)
  5. AC_SUBST(PATCHLEVEL, 1)
  6. AC_SUBST(LIBTOOL_VERSION, 2:1)
  7. #AC_CONFIG_HEADERS([config.h])
  8. AM_INIT_AUTOMAKE
  9. # Checks for programs.
  10. AC_PROG_CC
  11. AC_PROG_LIBTOOL
  12. AM_PROG_LIBTOOL
  13. # Checks for libraries.
  14. #AC_CHECK_LIB(cv, cvMatchTemplate)
  15. #AC_CHECK_LIB(cv, cvMinMaxLoc)
  16. #AC_CHECK_LIB(X11, XGetImage)
  17. # Checks for header files.
  18. AC_PATH_X
  19. #Headers needed for libcvautomation
  20. #AC_CHECK_HEADER(stdio.h)
  21. #AC_CHECK_HEADER(opencv/cv.h)
  22. #AC_CHECK_HEADER(opencv/highgui.h)
  23. #AC_CHECK_HEADER(X11/Xlib.h)
  24. #AC_CHECK_HEADER(X11/Xutil.h)
  25. #Configure OpenCV - version 2+ breaks a lot of things
  26. PKG_CHECK_MODULES([OpenCV], [opencv >= 2.0.0], [use_opencv2=true], [use_opencv1=true])
  27. AC_SUBST_FILE([cv_headers])
  28. if test "$use_opencv2" == "true"; then
  29. #Let doxygen know where our headers are at
  30. AC_SUBST(CV_VERSION, "opencv2")
  31. cv_headers=$srcdir/include/opencv2_includes
  32. AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
  33. AC_SUBST(CV_LIBS, ["-lopencv_core -lopencv_imgproc -lopencv_highgui"])
  34. else
  35. echo "could not find OpenCV version 2.0.0 or higher, checking for 1.0.0 or higher..."
  36. PKG_CHECK_MODULES([OpenCV], [opencv >= 1.0.0])
  37. #Update doxygen on where our headers are at
  38. AC_SUBST(CV_VERSION, "opencv1")
  39. cv_headers=$srcdir/include/opencv1_includes
  40. AC_SUBST(CV_CFLAGS, [`pkg-config --cflags opencv`])
  41. AC_SUBST(CV_LIBS, [`pkg-config --libs opencv`])
  42. fi
  43. PKG_CHECK_MODULES([X11], [x11 >= 1.0.3])
  44. AC_SUBST(X11_CFLAGS, [`pkg-config --cflags x11`])
  45. AC_SUBST(X11_LIBS, [`pkg-config --libs x11`])
  46. PKG_CHECK_MODULES([XTest], [xtst >= 0.21])
  47. AC_SUBST(XTEST_CFLAGS, [`pkg-config --cflags xtst`])
  48. AC_SUBST(XTEST_LIBS, [`pkg-config --libs xtst`])
  49. AC_ARG_WITH(examples, [ --with-examples build example programs @<:@default=yes@:>@])
  50. AM_CONDITIONAL(BUILD_EXAMPLES, [test "$with_examples" != "no"])
  51. if test "$with_examples" != "no"; then
  52. #Headers needed for cva-match
  53. AC_CHECK_HEADERS([limits.h stdlib.h unistd.h])
  54. fi
  55. # Check for doxygen
  56. AC_ARG_WITH(docs, [ --with-docs build documentation for libcvautomation @<:@default=yes@:>@])
  57. AC_ARG_ENABLE(man, [ --enable-man enable building the 'man' pages for libcvautomation
  58. only works if --with-docs is enabled @<:@default=enable@:>@])
  59. AC_ARG_ENABLE(tex, [ --enable-tex enable building the 'latex' pages for libcvautomation
  60. only works if --with-docs is enabled @<:@default=disable@:>@])
  61. if test "$with_docs" != "no"; then
  62. AC_CHECK_PROGS([Doxygen], [doxygen], [missing])
  63. if test "$Doxygen" == "missing"; then
  64. AC_MSG_WARN([Doxygen not found - continuing without building documentation.])
  65. AM_CONDITIONAL(BUILD_DOXYGEN, [test "$Doxygen" != "missing"]) #false
  66. enable_man="no"
  67. enable_tex="no"
  68. else
  69. AM_CONDITIONAL(BUILD_DOXYGEN, [test "$with_docs" != "no"])
  70. AC_CONFIG_FILES([docs/Doxyfile_library] [docs/Doxyfile_example] [docs/Makefile])
  71. fi
  72. else
  73. AM_CONDITIONAL(BUILD_DOXYGEN, [test "$with_docs" != "no"]) #false
  74. enable_man="no"
  75. enable_tex="no"
  76. fi
  77. #Check if we should generate man pages
  78. if test "$enable_man" != "no"; then
  79. AC_SUBST(ENABLE_MAN, YES)
  80. AM_CONDITIONAL(BUILD_MAN, [test "$enable_man" != "no"])
  81. else
  82. AC_SUBST(ENABLE_MAN, NO)
  83. AM_CONDITIONAL(BUILD_MAN, [test "$enable_man" != "no"]) #false
  84. fi
  85. #Check if we should build Tex pages
  86. if test "$enable_tex" == "yes"; then
  87. AC_SUBST(ENABLE_TEX, YES)
  88. AM_CONDITIONAL(BUILD_TEX, [test "$enable_tex" == "yes"])
  89. else
  90. AC_SUBST(ENABLE_TEX, NO)
  91. AM_CONDITIONAL(BUILD_TEX, [test "$enable_tex" == "yes"]) #false
  92. fi
  93. AC_ARG_WITH(python, [ --with-python Install python support for libcvautomation])
  94. #Check if we should distribute Python
  95. if test "$with_python" != "no"; then
  96. AC_CHECK_PROGS([Python], [python], [missing])
  97. AC_CHECK_PROGS([Swig], [swig], [missing])
  98. AM_PATH_PYTHON([2.4])
  99. m4_include([m4/m4_ax_python_devel.m4])
  100. AX_PYTHON_DEVEL([>= '2.4'])
  101. fi
  102. if test "$Python" == "missing"; then
  103. echo "Could not find a suitable Python program. Disabling building python support..."
  104. with_python="no"
  105. fi
  106. if test "$Swig" == "missing"; then
  107. echo "Could not find a suitable SWIG program. Disabling building python support..."
  108. with_python="no"
  109. fi
  110. AM_CONDITIONAL(BUILD_PYTHON, [test "$with_python" != "no"]) #true unless --without-python
  111. if test "$with_python" != "no"; then
  112. #Only generate the config if both python and swig are available
  113. AC_CONFIG_FILES([python/Makefile])
  114. fi
  115. # Checks for library functions.
  116. AC_FUNC_MALLOC
  117. AC_SUBST_FILE(rpm_changelog)
  118. rpm_changelog=$srcdir/ChangeLog
  119. AC_SUBST_FILE(deb_changelog)
  120. deb_changelog=$srcdir/ChangeLog
  121. AC_SUBST_FILE(deb_copyright)
  122. deb_copyright=$srcdir/COPYING
  123. AC_OUTPUT(
  124. [Makefile]
  125. [libcvautomation/Makefile]
  126. [examples/Makefile]
  127. [libcvautomation.pc]
  128. [include/libcvautomation/libcvautomation.h]
  129. [rpm/libcvautomation.spec]
  130. [debian/copyright]
  131. [debian/changelog]
  132. )