1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
|
AC_PREREQ(2.50)
AC_INIT(gphoto2/main.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gphoto2, 2.1.5)
AM_MAINTAINER_MODE
dnl ---------------------------------------------------------------------------
dnl Some programs we need
dnl ---------------------------------------------------------------------------
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_DEFINE_UNQUOTED(HAVE_CC,"$CC",[The C compiler we're using])
dnl ---------------------------------------------------------------------------
dnl i18n support
dnl ---------------------------------------------------------------------------
ALL_LINGUAS="az cs da de en_GB es fi fr hu it ja nl no pt_BR ro ru sk sl sr sv uk zh_CN"
# EVIL HACKS
AC_MSG_CHECKING([for po/Makevars requiring evil hack])
if test -f po/Makevars.template
then
sed \
-e "s/^MSGID_BUGS_ADDRESS.*/MSGID_BUGS_ADDRESS = ${MAIL_GPHOTO_TRANSLATION}/" \
< po/Makevars.template > po/Makevars
AC_MSG_RESULT([yes. done.])
else
AC_MSG_RESULT([no])
fi
AM_GNU_GETTEXT
dnl ---------------------------------------------------------------------------
dnl Check for libgphoto2
dnl ---------------------------------------------------------------------------
PKG_CHECK_MODULES(GP, libgphoto2 >= 2.1.2)
AC_CHECK_LIB(gphoto2, gp_library_version, [], [
AC_MSG_ERROR([Sorry, you need at least release 2.1.2 of libgphoto2])
], [$GP_LIBS])
AC_SUBST(GP_LIBS)
AC_SUBST(GP_CFLAGS)
libgphoto2_version=`pkg-config --modversion libgphoto2`
libgphoto2_prefix=`pkg-config --variable=prefix libgphoto2`
AC_MSG_CHECKING([libgphoto2 used])
AC_MSG_RESULT([version $libgphoto2_version from $libgphoto2_prefix])
dnl ---------------------------------------------------------------------------
dnl pthread: The gphoto2 shell (--shell) keeps up a connection to the
dnl camera. Some cameras need to be sent keep-alive-messages
dnl in order to prevent a shut-down. This is what we need
dnl pthread for.
dnl ---------------------------------------------------------------------------
pthread_msg=no
try_pthread=true
AC_ARG_WITH(pthread, [ --without-pthread Don't use pthread],
if test x$withval = xno; then
try_pthread=false
fi)
if $try_pthread; then
AC_CHECK_HEADER(pthread.h, [
AC_CHECK_LIB(pthread, pthread_exit, [
AC_DEFINE(HAVE_PTHREAD,1,[Define if we use pthread.h.])
pthread_msg="yes (-lpthread)"
PTHREAD_LIBS="-lpthread"],[
AC_CHECK_LIB(c_r, pthread_create, [
AC_DEFINE(HAVE_PTHREAD,1,[Define if we use pthread.h.])
pthread_msg="yes (-pthread)"
PTHREAD_LIBS="-pthread"
])
])
])
fi
AC_SUBST(PTHREAD_LIBS)
dnl ---------------------------------------------------------------------------
dnl Turn on debugging and all warnings when using gcc
dnl ---------------------------------------------------------------------------
if test "$ac_cv_prog_gcc" = "yes"; then
CFLAGS="$CFLAGS -g -Wall -Wmissing-declarations -Wmissing-prototypes"
LDFLAGS="$LDFLAGS -g -Wall"
fi
dnl ---------------------------------------------------------------------------
dnl CDK: If you would like to access the camera's configuration using
dnl gphoto2, the command-line frontend, you need this. Old versions
dnl of CDK don't include fscale, therefore check for it here.
dnl ---------------------------------------------------------------------------
cdk_msg="no (http://dickey.his.com/cdk/cdk.html)"
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
cdk_msg="no (not requested)"
fi
)
cdk_prefix=$ac_default_prefix
AC_ARG_WITH(cdk-prefix, [ --with-cdk-prefix=PREFIX Location of cdk], [
cdk_prefix="$withval"])
if $try_cdk; then
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="-I$cdk_prefix/include $CPPFLAGS"
AC_CHECK_HEADER(cdk/cdk.h, [
have_cdk=true
CDK_CFLAGS="-I$cdk_prefix/include"
CDK_LIBS="-L$cdk_prefix/lib -lcdk -lncurses"
AC_DEFINE(HAVE_CDK,1,[whether we have CDK])
LDFLAGS_save="$LDFLAGS"
LDFLAGS="$CDK_LIBS"
AC_CHECK_LIB(cdk, newCDKFScale, [cdk_msg="yes"], [
AC_DEFINE(HAVE_CDK_20010421,1,[whether we have old CDK])
cdk_msg="yes (but without fscale)"]
)
LDFLAGS="$LDFLAGS_save"]
)
CPPFLAGS="$CPPFLAGS_save"
fi
AM_CONDITIONAL(HAVE_CDK, $have_cdk)
AC_SUBST(CDK_CFLAGS)
AC_SUBST(CDK_LIBS)
dnl ---------------------------------------------------------------------------
dnl libjpeg: Right now, libjpeg is only used to interpret JPEG previews in
dnl order to feed them to aalib (see below).
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
jpeg_msg="no (not requested)"
fi
)
jpeg_prefix=$ac_default_prefix
AC_ARG_WITH(jpeg-prefix, [ --with-jpeg-prefix=PREFIX Location of jpeg], [
jpeg_prefix="$withval"])
if $try_jpeg; then
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="-I$jpeg_prefix/include"
AC_CHECK_HEADER(jpeglib.h, [
AC_CHECK_LIB(jpeg, jpeg_read_scanlines, [
have_jpeg=true
jpeg_msg="yes"
AC_DEFINE(HAVE_JPEG,1,[whether we use libjpeg])
JPEG_LIBS="-ljpeg"
JPEG_CFLAGS=$CPPFLAGS
], [
LDFLAGS_save="$LDFLAGS"
LDFLAGS="-L$jpeg_prefix/lib"
AC_CHECK_LIB(jpeg, jpeg_stdio_src, [
have_jpeg=true
jpeg_msg="yes (in '$jpeg_prefix')"
AC_DEFINE(HAVE_JPEG,1,[whether we use libjpeg])
JPEG_LIBS="-L$jpeg_prefix/lib -ljpeg"
JPEG_CFLAGS=$CPPFLAGS
], [jpeg_msg="no (could not link)"])
LDFLAGS=$LDFLAGS_save
])
])
CPPFLAGS=$CPPFLAGS_save
fi
AM_CONDITIONAL(HAVE_JPEG, $have_jpeg)
AC_SUBST(JPEG_LIBS)
AC_SUBST(JPEG_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl pkg-config: pkg-config is a tool to simplify checks for libraries and
dnl versions. I really think this is a good thing and therefore
dnl use it here. However, if pkg-config is not installed,
dnl we offer alternative checks, too.
dnl ---------------------------------------------------------------------------
pkgconfig_msg="no (http://www.freedesktop.org/software/pkgconfig)"
try_pkgconfig=true
have_pkgconfig=false
AC_ARG_WITH(pkgconfig, [ --without-pkgconfig Don't use pkg-config],[
if test x$withval = xno; then
try_pkgconfig=false
pkgconfig_msg="no (not requested)"
fi])
if $try_pkgconfig; then
AC_PATH_PROG(PKG_CONFIG,pkg-config)
if test -n "${PKG_CONFIG}"; then
have_pkgconfig=true
pkgconfig_msg="yes"
fi
fi
dnl ---------------------------------------------------------------------------
dnl libexif: The CameraFilesystem can use libexif for extracting thumbnails
dnl out of EXIF data. Similarly, it can extract the mtime of
dnl a file.
dnl libexif is available from
dnl http://www.sourceforge.net/projects/libexif
dnl ---------------------------------------------------------------------------
exif_msg="no (http://www.sourceforge.net/projects/libexif)"
try_exif=true
have_exif=false
AC_ARG_WITH(exif, [ --without-exif Don't use libexif],[
if test x$withval = xno; then
try_exif=false
exif_msg="no (not requested)"
fi])
if test "x$prefix" = xNONE; then
exif_prefix=$ac_default_prefix
else
exif_prefix=$prefix
fi
AC_ARG_WITH(exif-prefix, [ --with-exif-prefix=PREFIX Location of libexif],[
exif_prefix="$withval"])
if $try_exif; then
if $have_pkgconfig; then
AC_MSG_CHECKING([for libexif using pkg-config])
if ${PKG_CONFIG} --exists libexif > /dev/null 2>&1; then
EXIF_CFLAGS=`$PKG_CONFIG --cflags libexif`
EXIF_LIBS=`$PKG_CONFIG --libs libexif`
have_exif=true
libexif_version=`${PKG_CONFIG} --modversion libexif`
libexif_prefix=`${PKG_CONFIG} --variable=prefix libexif`
exif_msg="yes (version ${libexif_version} from ${libexif_prefix})"
AC_DEFINE(HAVE_EXIF,1,[whether we use libexif])
fi
AC_MSG_RESULT($exif_msg)
else
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS="-I$exif_prefix/include/libexif -I$exif_prefix/include $CPPFLAGS"
AC_CHECK_HEADER(exif-data.h, [
EXIF_CFLAGS="-I$exif_prefix/include -I$exif_prefix/include/libexif"
EXIF_LIBS="-L$exif_prefix/lib -lexif"
have_exif=true
exif_msg="yes (unknown version from standard location)"
AC_DEFINE(HAVE_EXIF,1,[whether we use libexif])])
fi
if $have_exif; then
CPPFLAGS_save="$CPPFLAGS"
CPPFLAGS=$EXIF_CFLAGS
AC_CHECK_HEADER([exif-log.h], [
exif_msg="${exif_msg}, (>= 0.6.9)"
AC_DEFINE(HAVE_EXIF_0_6_9,1,[whether we use a version of libexif equal or greater than 0.6.9])])
AC_CHECK_HEADER([exif-ifd.h], [
exif_msg="${exif_msg}, (>= 0.5.4)"
AC_DEFINE(HAVE_EXIF_0_5_4,1,[whether we use a version of libexif greater than 0.5.3])])
CPPFLAGS="$CPPFLAGS_save"
fi
fi
AM_CONDITIONAL(HAVE_EXIF, $have_exif)
AC_SUBST(EXIF_CFLAGS)
AC_SUBST(EXIF_LIBS)
dnl ---------------------------------------------------------------------------
dnl aalib: gphoto2 (the frontend) has been designed as a command-line tool.
dnl However, life previews make only sense when you can actually
dnl see the preview. This is where aalib fits in - it gives you the
dnl possibility to view life-previews on any console.
dnl ---------------------------------------------------------------------------
aa_msg="no (http://www.sourceforge.net/projects/aa-project)"
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,1,[whether we use aalib])
AC_PATH_PROG(AALIB_CONFIG,aalib-config)
if test -n "${AALIB_CONFIG}"; then
AA_CFLAGS=`$AALIB_CONFIG --cflags`
AA_LIBS=`$AALIB_CONFIG --libs`
else
AA_LIBS="-laa"
fi])
else
aa_msg="no (not requested)"
fi
AM_CONDITIONAL(HAVE_AA, $have_aa)
AC_SUBST(AA_LIBS)
AC_SUBST(AA_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl popt.h: Simplifies handling of command-line options enormously.
dnl ---------------------------------------------------------------------------
popt_msg="no (Note that popt will be mandatory in the future!)"
try_popt=true
have_popt=false
AC_ARG_WITH(popt, [ --without-popt Don't use popt.h],
if test "x${withval}" = "xno"; then
try_popt=false
popt_msg="no (not requested)"
fi
)
if $try_popt; then
AC_CHECK_HEADER(popt.h, [
POPT_CFLAGS=""
POPT_LIBS="-lpopt"
have_popt=true
popt_msg=yes
AC_DEFINE(HAVE_POPT,1,[whether we use popt])],
[rl_msg="no (couldn't link against it or version too old)"])
fi
AM_CONDITIONAL(HAVE_POPT, $have_popt)
AC_SUBST(POPT_LIBS)
AC_SUBST(POPT_CFLAGS)
dnl ---------------------------------------------------------------------------
dnl readline: Readline is pretty cool - it allows you to use <tab> to complete
dnl commands in the gphoto2 shell or to use <up> or <down> to
dnl navigate through the history.
dnl ---------------------------------------------------------------------------
rl_msg="no (http://cnswww.cns.cwru.edu/~chet/readline/rltop.html)"
try_readline=true
have_readline=false
AC_ARG_WITH(readline, [ --without-readline Don't use readline],
if test "x${withval}" = "xno"; then
try_readline=false
rl_msg="no (not requested)"
fi
)
if $try_readline; then
AC_CHECK_HEADER(readline/readline.h, [
AC_CHECK_LIB(readline, rl_completion_append_character, [
AC_CHECK_LIB(readline, rl_completion_matches, [
have_readline=true
rl_msg="yes (doesn't require explicit -lncurses)"
RL_LIBS="-lreadline"
RL_CFLAGS=""
AC_DEFINE(HAVE_RL,1,[whether we use readline])
], [rl_msg="no (available version too old)"])
], [
LDFLAGS_save="$LDFLAGS"
LDFLAGS="-lncurses"
AC_CHECK_LIB(readline, rl_completion_matches, [
have_readline=true
rl_msg="yes (requires explicit -lncurses)"
RL_LIBS="-lreadline -lncurses"
RL_CFLAGS=""
AC_DEFINE(HAVE_RL,1,[whether we use readline])
], [rl_msg="no (couldn't link against it or version too old)"])
LDFLAGS="$LDFLAGS_save"
])
])
fi
AM_CONDITIONAL(HAVE_RL, $have_readline)
AC_SUBST(RL_LIBS)
AC_SUBST(RL_CFLAGS)
AC_OUTPUT([ intl/Makefile po/Makefile.in m4/Makefile
Makefile
gphoto2/Makefile
doc/Makefile
packaging/Makefile
packaging/rpm/Makefile
packaging/rpm/package.spec
])
cat<<EOF
Configuration (gphoto2):
Source code location: $srcdir
Compiler: $CC
Configuration support: $cdk_msg
Preview support: $aa_msg
JPEG support: $jpeg_msg
pkg-config: $pkgconfig_msg
EXIF support: $exif_msg
readline support: $rl_msg
pthread support: $pthread_msg
popt support: $popt_msg
EOF
|