git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@916 67ed7778-7388-44ab-90cf-0a291f65f57c
128 lines
3.2 KiB
Plaintext
128 lines
3.2 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
PACKAGE=gphoto2
|
|
VERSION=0.1
|
|
libdir=${prefix}/lib/gphoto2
|
|
|
|
AC_INIT(include/gphoto2.h)
|
|
AM_CONFIG_HEADER(config.h)
|
|
AM_INIT_AUTOMAKE(gphoto2, 1.90)
|
|
AM_MAINTAINER_MODE
|
|
|
|
dnl Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_CPP
|
|
AM_PROG_LIBTOOL
|
|
|
|
dnl Solaris hack for grep and tr
|
|
if test -n "`echo $host_os | grep [sS]olaris`"; then
|
|
TR=/usr/xpg4/bin/tr
|
|
GREP=/usr/xpg4/bin/grep
|
|
else
|
|
TR=tr
|
|
GREP=grep
|
|
fi
|
|
|
|
dnl Checks for libraries.
|
|
dnl Replace `main' with a function in -ldl:
|
|
AC_CHECK_LIB(dl, main)
|
|
dnl Replace `main' with a function in -libs:
|
|
AC_CHECK_LIB(ibs, main)
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_DIRENT
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h)
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
AC_TYPE_SIZE_T
|
|
|
|
dnl Checks for library functions.
|
|
AC_CHECK_FUNCS(mkdir strdup)
|
|
|
|
AC_PATH_PROG(LIBGPIO_CONFIG,gpio-config)
|
|
if test -n "${LIBGPIO_CONFIG}"; then
|
|
CFLAGS="$CFLAGS `$LIBGPIO_CONFIG --cflags`"
|
|
LIBS="$LIBS `$LIBGPIO_CONFIG --libs`"
|
|
else
|
|
AC_MSG_ERROR([
|
|
***
|
|
*** libgpio is required
|
|
*** Available from gPhoto's SourceForge CVS, module 'libgpio'.
|
|
***])
|
|
exit 1
|
|
fi
|
|
|
|
LIBGPHOTO2_INCLUDEDIR='-I${includedir}'
|
|
LIBGPHOTO2_LIBDIR='-L${libdir}'
|
|
LIBGPHOTO2_LIBS="-lgphoto2"
|
|
LIBGPHOTO2_VERSION=$VERSION
|
|
|
|
AC_SUBST(LIBGPHOTO2_INCLUDEDIR)
|
|
AC_SUBST(LIBGPHOTO2_LIBDIR)
|
|
AC_SUBST(LIBGPHOTO2_LIBS)
|
|
AC_SUBST(LIBGPHOTO2_VERSION)
|
|
|
|
AC_SUBST(CFLAGS)
|
|
AC_SUBST(LIBS)
|
|
|
|
dnl Find out which drivers to compile
|
|
camlibs='barbie canon directory fujitsu konica panasonic digita sonydscf1'
|
|
AC_SUBST(SUBDIRS_CAMLIBS)
|
|
for i in $camlibs; do
|
|
d=`echo $i | $TR a-z A-Z`
|
|
eval "CONFIG_DRIVER_$d=n"
|
|
done
|
|
AC_MSG_CHECKING(which drivers to compile)
|
|
AC_ARG_WITH(drivers,
|
|
[ --with-drivers=<list> compile drivers in <list>; ]
|
|
[ drivers may be separated with commas; ]
|
|
[ 'all' compiles all drivers; ]
|
|
[ possible drivers are: ]
|
|
[ barbie, canon, digita, directory, ]
|
|
[ fujitsu, konica, panasonic, sonydscf1 ],
|
|
drivers="$withval", drivers="all")
|
|
if test "$drivers" = "all"; then
|
|
for i in $camlibs; do
|
|
d=`echo $i | $TR a-z A-Z`
|
|
eval "CONFIG_DRIVER_$d=y"
|
|
AC_DEFINE_UNQUOTED(CONFIG_DRIVER_$d)
|
|
SUBDIRS_CAMLIBS="$SUBDIRS_CAMLIBS $i"
|
|
done
|
|
|
|
AC_MSG_RESULT(all)
|
|
else
|
|
drivers=`echo $drivers | sed 's/,/ /g'`
|
|
for driver in $drivers; do
|
|
if test -n "`echo $camlibs | $GREP -E \"(^| )$driver( |\$)\"`"; then
|
|
d=`echo $driver | $TR a-z A-Z`
|
|
eval "CONFIG_DRIVER_$d=y"
|
|
AC_DEFINE_UNQUOTED(CONFIG_DRIVER_$d)
|
|
SUBDIRS_CAMLIBS="$SUBDIRS_CAMLIBS $driver"
|
|
else
|
|
echo "Unknown driver $driver, exiting!"
|
|
exit 1
|
|
fi
|
|
done
|
|
AC_MSG_RESULT($drivers)
|
|
fi
|
|
|
|
AC_OUTPUT(\
|
|
Makefile \
|
|
camlibs/Makefile \
|
|
camlibs/barbie/Makefile \
|
|
camlibs/fujitsu/Makefile \
|
|
camlibs/directory/Makefile \
|
|
camlibs/panasonic/Makefile \
|
|
camlibs/konica/Makefile \
|
|
camlibs/digita/Makefile \
|
|
camlibs/canon/Makefile \
|
|
camlibs/sonydscf1/Makefile \
|
|
frontends/Makefile \
|
|
frontends/command-line/Makefile \
|
|
frontends/libgphoto2_frontend/Makefile \
|
|
include/Makefile \
|
|
libgphoto2/Makefile \
|
|
gphoto2-config \
|
|
)
|