dnl Process this file with autoconf to produce a configure script. AC_INIT(libgphoto2_port/gphoto2-port.c) AM_CONFIG_HEADER(libgphoto2_port/config.h) LIBGPPORT_MAJOR_VERSION=0 LIBGPPORT_MINOR_VERSION=0 LIBGPPORT_MICRO_VERSION=4 LIBGPPORT_VERSION=$LIBGPPORT_MAJOR_VERSION.$LIBGPPORT_MINOR_VERSION.$LIBGPPORT_MICRO_VERSION LIBGPPORT_VERSION_INFO=`expr $LIBGPPORT_MAJOR_VERSION + $LIBGPPORT_MINOR_VERSION`:$LIBGPPORT_MICRO_VERSION:$LIBGPPORT_MINOR_VERSION AC_SUBST(LIBGPPORT_MAJOR_VERSION) AC_SUBST(LIBGPPORT_MINOR_VERSION) AC_SUBST(LIBGPPORT_MICRO_VERSION) AC_SUBST(LIBGPPORT_VERSION) AC_SUBST(LIBGPPORT_VERSION_INFO) VERSION=$LIBGPPORT_VERSION AM_INIT_AUTOMAKE(libgphoto2_port, $VERSION) AM_MAINTAINER_MODE AC_LIBTOOL_DLOPEN dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL dnl The following is a hack to get gphoto2 to build on gettext-0.10.35 dnl systems - BUILD_INCLUDED_LIBINTL is set only in gettext-0.10.37 which is dnl the gettext version provided with gphoto2. BUILD_INCLUDED_LIBINTL=no AC_SUBST(BUILD_INCLUDED_LIBINTL) dnl USE_INCLUDED_LIBINTL=no dnl AC_SUBST(USE_INCLUDED_LIBINTL) dnl --------------------------------------------------------------------------- dnl i18n support dnl --------------------------------------------------------------------------- ALL_LINGUAS="da de fr hu it ja no ru sl sv uk zh_CN" AM_GNU_GETTEXT dnl --------------------------------------------------------------------------- dnl Check for libtool: lt_dlforeachfile has been introduced in dnl libtool-1.4. However, there are still systems out dnl there running libtool-1.3. For those, we will need dnl dlopen. Note that on some systems (e.g. FreeBSD) dnl -ldl isn't needed. dnl --------------------------------------------------------------------------- dnl Commented out for now because lt_dlforeachfile will not do anything if it dnl has already been called before. dnl AC_PROG_LIBTOOL no_libtool=true dnl AC_CHECK_LIB(ltdl, lt_dlforeachfile, dnl AC_CHECK_HEADER(ltdl.h, dnl AC_DEFINE(HAVE_LTDL) dnl LTDL_LIBS="-lltdl" dnl no_libtool=false dnl ) dnl ) if $no_libtool; then AC_CHECK_FUNC(dlopen,, AC_CHECK_LIB(dl, dlopen, LTDL_LIBS="-ldl", AC_ERROR([ *** Could not determine how to handle *** shared libraries! ]))) fi AC_SUBST(LTDL_LIBS) AC_CHECK_FUNC(gettext, gettext_without_libintl=true) # same trick as with libdl in libgphoto2: # if gettext() doesn't require linking against libintl, # we don't have to check for gettext in libintl. Otherwise # we may even require libintl. dnl AC_CHECK_LIB(intl, gettext, [LIBS="$LIBS -lintl"]) if test "$gettext_without_libintl" != "true" -a "$USE_NLS" = "yes"; then AC_CHECK_LIB(intl, gettext, [INTLLIBS="$INTLLIBS -lintl"]) fi dnl Turn on debugging and catch GNU features incompatible with ANSI C. if test "$ac_cv_prog_gcc" = "yes"; then CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes" LDFLAGS="$LDFLAGS -g -Wall" fi dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(stdlib.h unistd.h stdio.h fcntl.h errno.h sys/time.h) AC_CHECK_HEADERS(sys/param.h termios.h sgetty.h ttold.h ioctl-types.h \ fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h unistd.h \ endian.h byteswap.h asm/io.h) dnl Checks for library functions. AC_CHECK_FUNCS(strerror snprintf vsnprintf) dnl Check if TIOCM_RTS is included in one of several possible files AC_TRY_COMPILE([#include ], [int foo = TIOCM_RTS;], AC_DEFINE(HAVE_RTS_IOCTL)) AC_TRY_COMPILE([#include ], [int foo = TIOCM_RTS;], AC_DEFINE(HAVE_RTS_IOCTL)) AC_TRY_COMPILE([#include ], [int foo = TIOCM_RTS;], AC_DEFINE(HAVE_RTS_IOCTL)) AC_TRY_COMPILE([#include ], [int foo = TIOCM_RTS;], AC_DEFINE(HAVE_RTS_IOCTL)) dnl ****** dnl serial dnl ****** serial_msg=yes have_serial=true baudboy_msg=no ttylock_msg=no lockdev_msg=no try_baudboy_msg=true try_ttylock=true try_lockdev=true AC_ARG_WITH(serial, [ --without-serial Don't compile in SERIAL support], if test x$withval = xno; then have_serial=false serial_msg=no try_baudboy=false try_ttylock=false try_lockdev=false fi ) if $have_serial; then IOLIB_SUBDIRS="$IOLIB_SUBDIRS serial" fi dnl ----------------------------------------- dnl Serial port locking: We try to use either dnl (1) baudboy.h dnl (2) ttylock.h dnl (3) lockdev.h dnl ----------------------------------------- AC_ARG_WITH(baudboy, [ --without-baudboy Don't use baudboy library], if test x$withval = xno; then try_baudboy=false fi ) AC_ARG_WITH(ttylock, [ --without-ttylock Don't use ttylock library], if test x$withval = xno; then try_ttylock=false fi ) AC_ARG_WITH(lockdev, [ --without-lockdev Don't use lockdev library], if test x$withval = xno; then try_lockdev=false fi ) if $try_baudboy; then AC_CHECK_HEADER(baudboy.h, baudboy_msg=yes try_ttylock=false try_lockdev=false AC_DEFINE(HAVE_BAUDBOY) ) fi if $try_ttylock; then AC_CHECK_HEADER(ttylock.h, AC_MSG_CHECKING(if ttylock needs lockdev) AC_TRY_LINK([#include ],[ttylocked ("/dev/foo");], AC_MSG_RESULT(no) AC_DEFINE(HAVE_TTYLOCK) ttylock_msg=yes try_lockdev=false, LDFLAGS="$LDFLAGS -llockdev" AC_TRY_LINK([#include ],[ttylocked ("/dev/foo");], AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TTYLOCK) ttylock_msg=yes try_lockdev=false SERIAL_LDFLAGS=-llockdev, AC_MSG_RESULT(unknown), AC_MSG_RESULT(unknown) ), AC_MSG_RESULT(unknown) ) ) fi if $try_lockdev; then AC_CHECK_LIB(lockdev, dev_lock, AC_CHECK_HEADER(lockdev.h, AC_DEFINE(HAVE_LOCKDEV) lockdev_msg=yes SERIAL_LDFLAGS=-llockdev ) ) fi AC_SUBST(SERIAL_LDFLAGS) dnl ****** dnl libusb dnl ****** usb_msg=no try_usb=true AC_ARG_WITH(usb, [ --without-usb Don't compile in USB support], if test x$withval = xno; then try_usb=false fi ) if $try_usb; then AC_PATH_PROG(LIBUSB_CONFIG,libusb-config) if test -n "${LIBUSB_CONFIG}"; then CPPFLAGS_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS `libusb-config --cflags`" AC_CHECK_HEADER(usb.h, usb_msg=yes IOLIB_SUBDIRS="$IOLIB_SUBDIRS usb" USB_LIBS="`libusb-config --libs`" USB_CFLAGS="`libusb-config --cflags`" LIBUSB_VER="`libusb-config --version`") CPPFLAGS="$CPPFLAGS_save" fi # This 'test' call uses non-standard syntax and will fail on most # systems, but it's just informational so any warning can be ignored. if test "$LIBUSB_VER" \< "0.1.5"; then AC_MSG_WARN([ *** You need at least version 0.1.5 of the libusb library for USB support *** http://libusb.sourceforge.net/ *** If you cannot find the appropriate version, try CVS ]) fi fi AC_SUBST(USB_CFLAGS) AC_SUBST(USB_LIBS) AC_SUBST(IOLIB_SUBDIRS) dnl ********** dnl GNU regex? dnl ********** AC_CHECK_FUNC(re_compile_pattern, AC_DEFINE(HAVE_GNU_REGEX)) dnl ****************************** dnl disable debugging if requested dnl ****************************** AC_ARG_ENABLE(debugging, [ --disable-debugging do not include debugging code], [if test "$enableval" = "no"; then AC_DEFINE(DISABLE_DEBUGGING) fi]) dnl ******** dnl gtk-doc? dnl ******** GP_CHECK_DOC_DIR()dnl GP_BUILD_DOCS()dnl AC_OUTPUT([ libgphoto2_port.spec Makefile libgphoto2_port/Makefile serial/Makefile usb/Makefile gphoto2-port-config intl/Makefile po/Makefile.in test/Makefile doc/Makefile m4/Makefile ]) echo " Configuration Source code location: ${srcdir} Compiler: ${CC} SERIAL support: $serial_msg Locking mechanism (for serial ports): Use baudboy: $baudboy_msg Use ttylock: $ttylock_msg Use lockdev: $lockdev_msg USB support: $usb_msg Build documenation: $gtkdoc_msg "