Files
libgphoto2/configure.in
Hans Ulrich Niedermann efe3cc5cfc 2001-11-29 Hans Ulrich Niedermann <hun@n-dimensional.de>
* Makefile.am: enable RPM and CVS rules only when useful
	* configure.in: init RPM packaging
	* libgphoto2_port/m4/packaging.m4: added packaging macro


git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3274 67ed7778-7388-44ab-90cf-0a291f65f57c
2001-11-29 01:39:49 +00:00

308 lines
7.5 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_INIT(libgphoto2/gphoto2.h)
AM_CONFIG_HEADER(libgphoto2/config.h)
AM_INIT_AUTOMAKE(gphoto2, 2.0beta4dev2)
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LIBTOOL
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 Languages
ALL_LINGUAS="de"
AM_GNU_GETTEXT
AC_CHECK_FUNC(gettext, gettext_without_libintl=true)
# same trick as with libdl:
# 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"; then
AC_CHECK_LIB(intl, gettext)
fi
dnl Turn on debugging and all warnings
CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
LDFLAGS="$LDFLAGS -g -Wall"
dnl Solaris hack for grep and tr
changequote(, )dnl
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
changequote([, ])dnl
dnl Hack to handle .libs subdirectories with old libtool
if test "X$objdir" = "X.libs"; then
echo ".libs subdirectory detected : \$dotlibs not defined"
dotlibs=""
else
echo ".libs subdirectory not detected : \$dotlibs=.libs"
dotlibs=".libs"
fi
dnl
dnl Checks for libraries.
dnl
AC_CHECK_FUNC(dlopen, dlopen_without_libdl=true)
# if dlopen doesn't require linking against libdl (e.g. FreeBSD)
# we don't have to check for dlopen in libdl any more
if test "$dlopen_without_libdl" != "true"; then
AC_CHECK_LIB(dl, dlopen)
fi
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 stdio.h string.h stdlib.h mcheck.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
dnl Checks for library functions.
AC_CHECK_FUNCS(mkdir strdup strncpy strcpy snprintf sprintf vsnprintf)
echo "Using the bundled gphoto2_port library"
LIBGPHOTO2_PORT_DIR="libgphoto2_port"
CFLAGS="$CFLAGS -I`pwd` -I`pwd`/libgphoto2_port/libgphoto2_port";
LIBS="$LIBS -L`pwd`/libgphoto2_port/libgphoto2_port/@dotlibs@ -lgphoto2_port";
LIBGPHOTO2_INCLUDEDIR='-I${includedir}'
LIBGPHOTO2_LIBDIR='-L${libdir}'
LIBGPHOTO2_LIBS="-lgphoto2 -lm"
LIBGPHOTO2_VERSION=$VERSION
AC_SUBST(LIBGPHOTO2_PORT_DIR)
AC_SUBST(LIBGPHOTO2_INCLUDEDIR)
AC_SUBST(LIBGPHOTO2_LIBDIR)
AC_SUBST(LIBGPHOTO2_LIBS)
AC_SUBST(LIBGPHOTO2_VERSION)
AC_SUBST(CFLAGS)
AC_SUBST(LIBS)
AC_SUBST(dotlibs)
dnl Find out which drivers to compile
camlibs='agfa barbie canon casio digita dimera directory jamcam jd11 kodak konica minolta panasonic polaroid ptp samsung sierra stv0680 sonydscf1 sonydscf55'
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: ]
[ agfa, barbie, canon, casio, digita, dimera,]
[ directory, jamcam, jd11, kodak, konica,]
[ minolta, panasonic, polaroid, ptp, samsung,]
[ sierra, sonydscf1, sonydscf55, stv0680 ],
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
dnl ************************************************************
dnl find out where to install documentation files
dnl ************************************************************
GP_CHECK_DOC_DIR()dnl
dnl ********
dnl build docs?
dnl ********
GP_BUILD_DOCS()dnl
dnl ************************************************************
dnl initialize packaging RPMs
dnl ************************************************************
PKG_CHECK_RPM()dnl
dnl *************************
dnl Configure libgphoto2-port
dnl *************************
AC_CONFIG_SUBDIRS(libgphoto2_port)
dnl ***
dnl CDK
dnl ***
cdk_msg=no
try_cdk=true
have_cdk=false
AC_ARG_WITH(cdk, [ --without-cdk Don't use cdk],
if test x$withval = xno; then
try_cdk=false
fi
)
if $try_cdk; then
AC_CHECK_HEADER(cdk/cdk.h,
have_cdk=true
cdk_msg=yes
AC_DEFINE(HAVE_CDK)
CDK_LIBS="-lcdk -lncurses"
)
fi
AM_CONDITIONAL(HAVE_CDK, $have_cdk)
AC_SUBST(CDK_LIBS)
dnl ****
dnl jpeg
dnl ****
jpeg_msg=no
try_jpeg=true
have_jpeg=false
AC_ARG_WITH(jpeg, [ --without-jpeg Don't use jpeg],
if test x$withval = xno; then
try_jpeg=false
fi
)
if $try_jpeg; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP([
#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDDEF_H
#undef HAVE_STDLIB_H
#include <jpeglib.h>],
jpeg_msg=yes,
jpeg_msg=no)
AC_MSG_RESULT($jpeg_msg)
if test "$jpeg_msg" = yes; then
have_jpeg=true
AC_DEFINE(HAVE_JPEG)
JPEG_LIBS="-ljpeg"
fi
fi
AM_CONDITIONAL(HAVE_JPEG, $have_jpeg)
AC_SUBST(JPEG_LIBS)
dnl *****
dnl aalib
dnl *****
aa_msg=no
try_aa=true
have_aa=false
AC_ARG_WITH(aalib, [ --without-aalib Don't use aalib],
if test x$withval = xno; then
try_aa=false
fi
)
if $try_aa; then
AC_CHECK_HEADER(aalib.h,
have_aa=true
aa_msg=yes
AC_DEFINE(HAVE_AA)
AA_CFLAGS="`aalib-config --cflags`"
AA_LIBS="`aalib-config --libs || echo ' -laa'`"
)
fi
AM_CONDITIONAL(HAVE_AA, $have_aa)
AC_SUBST(AA_LIBS)
AC_SUBST(AA_CFLAGS)
AC_OUTPUT([
Makefile
camlibs/Makefile
camlibs/agfa/Makefile
camlibs/barbie/Makefile
camlibs/canon/Makefile
camlibs/canon/doc/Makefile
camlibs/casio/Makefile
camlibs/digita/Makefile
camlibs/dimera/Makefile
camlibs/directory/Makefile
camlibs/jamcam/Makefile
camlibs/jd11/Makefile
camlibs/kodak/Makefile
camlibs/kodak/dc120/Makefile
camlibs/kodak/dc240/Makefile
camlibs/kodak/dc3200/Makefile
camlibs/konica/Makefile
camlibs/konica/localization/Makefile
camlibs/minolta/Makefile
camlibs/minolta/dimagev/Makefile
camlibs/panasonic/Makefile
camlibs/panasonic/l859/Makefile
camlibs/panasonic/coolshot/Makefile
camlibs/polaroid/Makefile
camlibs/ptp/Makefile
camlibs/samsung/Makefile
camlibs/sierra/Makefile
camlibs/sonydscf1/Makefile
camlibs/sonydscf55/Makefile
camlibs/stv0680/Makefile
frontends/Makefile
frontends/command-line/Makefile
tests/Makefile
libgphoto2/Makefile
libgphoto2/libgphoto2.pc
gphoto2-config
intl/Makefile
packaging/Makefile
packaging/rpm/Makefile
packaging/rpm/package.spec
po/Makefile.in
doc/Makefile
doc/api/Makefile
doc/figures/Makefile
])
echo "
Configuration (libgphoto2):
Source code location: ${srcdir}
Compiler: ${CC}
Build documenation: $enable_gtk_doc
Config. support (gphoto2): $cdk_msg
Preview support (gphoto2): $aa_msg
JPEG support: $jpeg_msg
"