2012-06-22 13:22:16 -04:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
2012-06-22 16:15:59 -04:00
AC_PREREQ(2.59)
2012-07-18 12:37:06 -04:00
AC_INIT(libcvautomation, 1.3, bspeice@uncc.edu)
2012-07-11 15:06:57 -04:00
#AC_CONFIG_HEADERS([config.h])
2012-06-22 13:22:16 -04:00
AM_INIT_AUTOMAKE
2012-06-26 16:36:13 -04:00
#path intelc110 /opt/coe/intelc110
2012-06-22 13:22:16 -04:00
# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL
# Checks for libraries.
#AC_CHECK_LIB(cv, cvMatchTemplate)
#AC_CHECK_LIB(cv, cvMinMaxLoc)
#AC_CHECK_LIB(X11, XGetImage)
# Checks for header files.
AC_PATH_X
#Headers needed for libcvautomation
#AC_CHECK_HEADER(stdio.h)
#AC_CHECK_HEADER(opencv/cv.h)
#AC_CHECK_HEADER(opencv/highgui.h)
#AC_CHECK_HEADER(X11/Xlib.h)
#AC_CHECK_HEADER(X11/Xutil.h)
2012-06-22 20:06:28 -04:00
#Configure OpenCV - version 2+ breaks a lot of things
PKG_CHECK_MODULES([OpenCV], [opencv >= 2.0.0], [use_opencv2=true], [use_opencv1=true])
2012-06-22 23:36:21 -04:00
AM_CONDITIONAL(USEOPENCV2, [test "$use_opencv2" != ""])
2012-07-11 14:34:26 -04:00
#Let doxygen know where our headers are at
2012-07-18 13:29:52 -04:00
AC_SUBST(DOXYGEN_CV_VERSION, "opencv2")
2012-06-22 20:06:28 -04:00
if test "$use_opencv1" != ""; then
echo "could not find OpenCV version 2.0.0 or higher, checking for 1.0.0 or higher..."
PKG_CHECK_MODULES([OpenCV], [opencv >= 1.0.0])
2012-07-11 14:34:26 -04:00
#Update doxygen on where our headers are at
2012-07-18 13:29:52 -04:00
AC_SUBST(DOXYGEN_CV_VERSION, "opencv1")
2012-06-22 20:06:28 -04:00
fi
2012-06-22 13:22:16 -04:00
PKG_CHECK_MODULES([X11], [x11 >= 1.0.3])
2012-06-26 16:36:13 -04:00
PKG_CHECK_MODULES([XTest], [xtst >= 0.21])
2012-06-22 13:22:16 -04:00
2012-07-11 14:34:26 -04:00
AC_ARG_WITH(examples, [ --with-examples build example programs @<:@default=yes@:>@])
2012-06-22 13:22:16 -04:00
AM_CONDITIONAL(BUILD_EXAMPLES, [test "$with_examples" != "no"])
if test "$with_examples" != "no"; then
#Headers needed for cva-match
2012-06-25 16:35:50 -04:00
AC_CHECK_HEADERS([limits.h stdlib.h unistd.h])
2012-06-22 13:22:16 -04:00
fi
2012-07-11 14:34:26 -04:00
# Check for doxygen
2012-07-19 13:27:50 -04:00
AC_ARG_WITH(docs, [ --with-docs build documentation for libcvautomation @<:@default=no@:>@])
AC_ARG_ENABLE(man, [ --enable-man enable building the 'man' pages for libcvautomation - only works if --with-docs is enabled @<:@default=enable@:>@])
AC_ARG_ENABLE(tex, [ --enable-tex enable building the 'latex' pages for libcvautomation - only works if --with-docs is enabled @<:@default=enable@:>@])
2012-07-19 12:36:26 -04:00
2012-07-19 13:27:50 -04:00
if test "$with_docs" == "yes"; then
AC_CHECK_PROGS([Doxygen], [doxygen], [missing])
2012-07-19 12:36:26 -04:00
2012-07-19 12:24:01 -04:00
if test "$Doxygen" == "missing"; then
2012-07-11 14:34:26 -04:00
AC_MSG_WARN([Doxygen not found - continuing without building documentation.])
2012-07-19 13:27:50 -04:00
AM_CONDITIONAL(BUILD_DOXYGEN, [test "$Doxygen" != "missing"]) #false
2012-07-19 12:24:01 -04:00
enable_man="no"
enable_tex="no"
2012-07-12 10:06:08 -04:00
else
2012-07-19 13:27:50 -04:00
AM_CONDITIONAL(BUILD_DOXYGEN, [test "$with_docs" == "yes"])
2012-07-12 10:06:08 -04:00
AC_CONFIG_FILES([docs/Doxyfile])
2012-07-11 14:34:26 -04:00
fi
2012-07-19 12:36:26 -04:00
else
2012-07-19 13:27:50 -04:00
AM_CONDITIONAL(BUILD_DOXYGEN, [test "$with_docs" == "yes"])
2012-07-19 12:36:26 -04:00
enable_man="no"
enable_tex="no"
fi
2012-07-11 14:34:26 -04:00
2012-07-19 12:36:26 -04:00
#Check if we should generate man pages
if test "$enable_man" != "no"; then
AC_SUBST(ENABLE_MAN, YES)
AM_CONDITIONAL(BUILD_MAN, [test "$enable_man" != "no"])
else
AC_SUBST(ENABLE_MAN, NO)
AM_CONDITIONAL(BUILD_MAN, [test "$enable_man" != "no"])
fi
2012-07-11 14:34:26 -04:00
2012-07-19 12:36:26 -04:00
#Check if we should build Tex pages
if test "$enable_tex" != "no"; then
AC_SUBST(ENABLE_TEX, YES)
AM_CONDITIONAL(BUILD_TEX, [test "$enable_tex" != "no"])
else
AC_SUBST(ENABLE_TEX, NO)
AM_CONDITIONAL(BUILD_TEX, [test "$enable_tex" != "no"])
2012-07-11 14:34:26 -04:00
fi
2012-06-22 13:22:16 -04:00
# Checks for library functions.
AC_FUNC_MALLOC
2012-07-11 14:34:26 -04:00
AC_OUTPUT([Makefile] [libcvautomation/Makefile] [examples/Makefile] [docs/Makefile])