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 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
|
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
AM_INIT_AUTOMAKE(imlib2, 1.3.0)
AM_CONFIG_HEADER(config.h)
AC_C_BIGENDIAN
AC_PROG_CC
case $host_os in
solaris*)
;;
*)
AC_MSG_CHECKING([if gcc supports __attribute__((visibility("hidden")))])
AC_COMPILE_IFELSE([
void __attribute__((visibility("hidden"))) func (void) {}
],
[AC_MSG_RESULT(yes)
AC_DEFINE(USE_HIDDEN_FUNCTION_ATTRIBUTE,1,
[Define this to 1 if `hidden' attribute for internal functions is used.])],
[AC_MSG_RESULT(no)])
esac
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
dnl Next four lines is a hack to prevent libtool checking for CXX/F77
m4_undefine([AC_PROG_CXX])
m4_defun([AC_PROG_CXX],[])
m4_undefine([AC_PROG_F77])
m4_defun([AC_PROG_F77],[])
AM_PROG_LIBTOOL
if test "x${bindir}" = 'x${exec_prefix}/bin'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
else
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
fi
fi
if test "x${libdir}" = 'x${exec_prefix}/lib'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
else
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", [Installation directory for user executables])
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Installation directory for user executables])
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Installation directory for user executables])
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", [Installation directory for libraries])
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Installation directory for libraries])
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Installation directory for libraries])
fi
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}", [Shared Data Directory])
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", [Shared Data Directory])
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source code directory])
mmx=no
amd64=no
case $host_cpu in
i*86) mmx="yes";;
x86_64) amd64="yes";;
amd64) amd64="yes";;
esac
case $host_os in
solaris*) mmx="no";;
esac
dnl
AC_ARG_ENABLE(mmx,
[ --enable-mmx attempt compiling using x86 mmx assembly @<:@default=auto@:>@],
[
if test x$enableval = xyes; then
mmx=yes
# Cannot compile with both options enabled
amd64=no
else
mmx=no
fi
]
)
AC_ARG_ENABLE(amd64,
[ --enable-amd64 attempt compiling using amd64 assembly @<:@default=auto@:>@],
[
if test x$enableval = xyes; then
amd64=yes
mmx=no
else
amd64=no
fi
]
)
AC_MSG_CHECKING(whether to enable x86 mmx support)
if test x$mmx = xyes; then
AC_DEFINE(DO_MMX_ASM, 1, [enabling MMX Assembly])
fi
AC_MSG_RESULT($mmx)
AM_CONDITIONAL(BUILD_MMX, test x$mmx = xyes)
AC_MSG_CHECKING(whether to enable amd64 asm support)
if test x$amd64 = xyes; then
AC_DEFINE(DO_AMD64_ASM, 1, [enabling AMD64 Assembly])
fi
AC_MSG_RESULT($amd64)
AM_CONDITIONAL(BUILD_AMD64, test x$amd64 = xyes)
# FIXME: fill in requirements for pc.in - but only ft2 has a pc file!
requirements="freetype2"
# check for freetype
AC_ARG_WITH(freetype-config, [ --with-freetype-config=FREETYPE_CONFIG use freetype-config specified ],
[ FREETYPE_CONFIG=$withval;
echo "using "$FREETYPE_CONFIG" for freetype-config"; ],
[ if test -z "$FREETYPE_CONFIG"; then
AC_PATH_PROG(FREETYPE_CONFIG, "freetype-config", "", $PATH)
fi
])
freetype_cflags=`$FREETYPE_CONFIG --cflags`
freetype_libs=`$FREETYPE_CONFIG --libs`
AC_CHECK_HEADER(X11/X.h,
[ have_x="yes" ],
[ have_x="no" ])
if test "x$have_x" = "xno"; then
# If --without-x was passed, this will be "disabled" instead of "no" --
# so always treat "no" as an error
AC_MSG_ERROR(
[no X support found. Use --x-includes and --x-libraries to specify the X
path on your system, or --without-x to disable X support.])
fi
if test "x$have_x" = "xyes"; then
AC_PATH_XTRA
x_dir=${x_dir:-/usr/X11R6}
x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
AM_CONDITIONAL(BUILD_X11, true)
AC_DEFINE(BUILD_X11, 1, [enabling X11 support])
else
x_cflags=""
x_libs=""
AM_CONDITIONAL(BUILD_X11, false)
fi
dlopen_libs=""
AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
my_includes=$freetype_cflags" "$x_cflags" "
my_libs=$freetype_libs" "$x_libs" "$dlopen_libs" -lm"
AC_SUBST(my_includes)
AC_SUBST(my_libs)
AC_MSG_CHECKING(whether to enable jpeg support)
AC_ARG_WITH(jpeg,
[AC_HELP_STRING([--without-jpeg],[Disable JPEG image loader])],
[
if test "$withval" = no ; then
jpeg_loader=no
else
jpeg_loader=yes
fi
],[ jpeg_loader=auto ]
)
AC_MSG_RESULT($jpeg_loader)
if test "$jpeg_loader" != no ; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
jpeg_ok=yes,
jpeg_ok=no,
)
if test "$jpeg_ok" = yes; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <jpeglib.h>],
jpeg_ok=yes,
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
JPEGLIBS="-ljpeg"
fi
fi
if test "$jpeg_ok" = no ; then
if test "$jpeg_loader" = yes ; then
AC_MSG_ERROR(JPEG support was requested but system does not support it)
else
AC_MSG_WARN(*** Native JPEG support will not be built (JPEG not found) ***)
fi
fi
else
jpeg_ok=no
fi
AM_CONDITIONAL(BUILD_JPEG_LOADER, test "$jpeg_ok" = yes)
AC_SUBST(JPEGLIBS)
AC_MSG_CHECKING(whether to enable png support)
AC_ARG_WITH(png,
[AC_HELP_STRING([--without-png],[Disable PNG image loader])],
[
if test "$withval" = no ; then
png_loader=no
else
png_loader=yes
fi
],[ png_loader=auto ]
)
AC_MSG_RESULT($png_loader)
if test "$png_loader" != no ; then
AC_CHECK_LIB(png, png_read_info,
png_ok=yes,
png_ok=no,
-lz -lm)
if test "$png_ok" = yes; then
AC_MSG_CHECKING([for png.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <png.h>],
png_ok=yes,
png_ok=no)
AC_MSG_RESULT($png_ok)
if test "$png_ok" = yes; then
PNGLIBS="-lpng -lz -lm"
fi
fi
if test "$png_ok" = no ; then
if test "$png_loader" = yes ; then
AC_MSG_ERROR(PNG support was requested but system does not support it)
else
AC_MSG_WARN(*** Native PNG support will not be built (PNG not found) ***)
fi
fi
else
png_ok=no
fi
AM_CONDITIONAL(BUILD_PNG_LOADER, test "$png_ok" = yes)
AC_SUBST(PNGLIBS)
AC_MSG_CHECKING(whether to enable tiff support)
AC_ARG_WITH(tiff,
[AC_HELP_STRING([--without-tiff],[Disable TIFF image loader])],
[
if test "$withval" = no ; then
tiff_loader=no
else
tiff_loader=yes
fi
],[ tiff_loader=auto ]
)
AC_MSG_RESULT($tiff_loader)
if test "$tiff_loader" != no ; then
AC_CHECK_LIB(tiff, TIFFReadScanline,
tiff_libs="-ltiff"
tiff_ok=yes,
AC_CHECK_LIB(tiff, TIFFReadScanline,
tiff_libs="-ltiff -ljpeg -lz -lm"
tiff_ok=yes,
AC_CHECK_LIB(tiff34, TIFFReadScanline,
tiff_libs="-ltiff34 -ljpeg -lz -lm"
tiff_ok=yes,
tiff_ok=no,
-ljpeg -lz -lm),
-ljpeg -lz -lm),
)
if test "$tiff_ok" = yes; then
AC_MSG_CHECKING([for tiffio.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <tiffio.h>],
tiff_ok=yes,
tiff_ok=no)
AC_MSG_RESULT($tiff_ok)
if test "$tiff_ok" = yes; then
TIFFLIBS=$tiff_libs
fi
fi
if test "$tiff_ok" = no ; then
if test "$tiff_loader" = yes ; then
AC_MSG_ERROR(TIFF support was requested but system does not support it)
else
AC_MSG_WARN(*** Native TIFF support will not be built (TIFF not found) ***)
fi
fi
else
tiff_ok=no
fi
AM_CONDITIONAL(BUILD_TIFF_LOADER, test "$tiff_ok" = yes)
AC_SUBST(TIFFLIBS)
AC_MSG_CHECKING(whether to enable gif support)
gif_lib=any
AC_ARG_WITH(gif,
[AC_HELP_STRING([--without-gif],[Disable GIF image loader])],
[
if test "$withval" = no ; then
gif_loader=no
else
gif_loader=yes
case "$withval" in
giflib) gif_lib=giflib;;
libungif) gif_lib=libungif;;
esac
fi
],[ gif_loader=auto ]
)
AC_MSG_RESULT($gif_loader)
if test "$gif_loader" != no ; then
AC_MSG_CHECKING(for preferred gif provider)
AC_MSG_RESULT($gif_lib)
if test "$gif_lib" != libungif ; then
AC_CHECK_LIB(gif, DGifOpenFileName,
gif_libs="-lgif"
gif_ok=yes,
gif_ok=no,
)
if test "$gif_ok" = yes; then
AC_MSG_CHECKING([for gif_lib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <gif_lib.h>],
gif_ok=yes,
gif_ok=no)
AC_MSG_RESULT($gif_ok)
if test "$gif_ok" = yes; then
GIFLIBS=$gif_libs
gif_lib=giflib
fi
fi
fi
if test "$gif_lib" != giflib ; then
AC_CHECK_LIB(ungif, DGifOpenFileName,
gif_libs="-lungif"
gif_ok=yes,
gif_ok=no,
)
if test "$gif_ok" = yes; then
AC_MSG_CHECKING([for gif_lib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <gif_lib.h>],
gif_ok=yes,
gif_ok=no)
AC_MSG_RESULT($gif_ok)
if test "$gif_ok" = yes; then
GIFLIBS=$gif_libs
gif_lib=libungif
fi
fi
fi
if test "$gif_ok" = no ; then
if test "$gif_loader" = yes ; then
AC_MSG_ERROR(GIF support was requested but system does not support it)
else
AC_MSG_WARN(*** Native GIF support will not be built (GIF not found) ***)
fi
fi
else
gif_ok=no
fi
AM_CONDITIONAL(BUILD_GIF_LOADER, test "$gif_ok" = yes)
AC_SUBST(GIFLIBS)
AC_MSG_CHECKING(whether to enable zlib support)
AC_ARG_WITH(zlib,
[AC_HELP_STRING([--without-zlib],[Disable ZLIB loader])],
[
if test "$withval" = no ; then
zlib_loader=no
else
zlib_loader=yes
fi
],[ zlib_loader=auto ]
)
AC_MSG_RESULT($zlib_loader)
if test "$zlib_loader" != no ; then
AC_CHECK_LIB(z, uncompress,
zlib_ok=yes,
zlib_ok=no,
)
if test "$zlib_ok" = yes; then
AC_MSG_CHECKING([for zlib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <zlib.h>],
zlib_ok=yes,
zlib_ok=no)
AC_MSG_RESULT($zlib_ok)
if test "$zlib_ok" = yes; then
ZLIBLIBS="-lz"
fi
fi
if test "$zlib_ok" = no ; then
if test "$zlib_loader" = yes ; then
AC_MSG_ERROR(ZLIB support was requested but system does not support it)
else
AC_MSG_WARN(*** Native zlib support will not be built (zlib not found) ***)
fi
fi
else
zlib_ok=no
fi
AM_CONDITIONAL(BUILD_ZLIB_LOADER, test "$zlib_ok" = yes)
AC_SUBST(ZLIBLIBS)
AC_MSG_CHECKING(whether to enable bzip2 support)
AC_ARG_WITH(bzip2,
[AC_HELP_STRING([--without-bzip2],[Disable BZIP2 loader])],
[
if test "$withval" = no ; then
bz2_loader=no
else
bz2_loader=yes
fi
],[ bz2_loader=auto ]
)
AC_MSG_RESULT($bz2_loader)
if test "$bz2_loader" != no ; then
AC_CHECK_LIB(bz2, BZ2_bzRead,
bz2_ok=yes,
bz2_ok=no,
)
if test "$bz2_ok" = yes; then
AC_MSG_CHECKING([for bzlib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <bzlib.h>],
bz2_ok=yes,
bz2_ok=no)
AC_MSG_RESULT($bz2_ok)
if test "$bz2_ok" = yes; then
BZ2LIBS="-lbz2"
fi
fi
if test "$bz2_ok" = no ; then
if test "$bz2_loader" = yes ; then
AC_MSG_ERROR(BZIP2 support was requested but system does not support it)
else
AC_MSG_WARN(*** Native bz2 support will not be built (bzip2 not found) ***)
fi
fi
else
bz2_ok=no
fi
AM_CONDITIONAL(BUILD_BZ2_LOADER, test "$bz2_ok" = yes)
AC_SUBST(BZ2LIBS)
AC_MSG_CHECKING(whether to enable id3 support)
AC_ARG_WITH(id3,
[AC_HELP_STRING([--without-id3],[Disable ID3 loader])],
[
if test "$withval" = no ; then
id3_loader=no
else
id3_loader=yes
fi
],[ id3_loader=auto ]
)
AC_MSG_RESULT($id3_loader)
if test "$id3_loader" != no ; then
AC_CHECK_LIB(id3tag, id3_file_open,
id3_libs="-lz -lid3tag"
id3_ok=yes,
id3_ok=no,
-lz)
if test "$id3_ok" = yes; then
AC_MSG_CHECKING([for id3tag.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#include <id3tag.h>],
id3_ok=yes,
id3_ok=no)
AC_MSG_RESULT($id3_ok)
if test "$id3_ok" = yes; then
ID3LIBS=$id3_libs
fi
fi
if test "$id3_ok" = no ; then
if test "$id3_loader" = yes ; then
AC_MSG_ERROR(ID3 support was requested but system does not support it)
else
AC_MSG_WARN(*** Native mp3 support will not be built (id3tag not found) ***)
fi
fi
else
id3_ok=no
fi
AM_CONDITIONAL(BUILD_ID3_LOADER, test "$id3_ok" = yes)
AC_SUBST(ID3LIBS)
AC_SUBST(requirements)
AC_OUTPUT([
Makefile
imlib2.pc
src/Makefile
src/lib/Makefile
src/bin/Makefile
src/modules/Makefile
src/modules/filters/Makefile
src/modules/loaders/Makefile
doc/Makefile
imlib2-config
README
imlib2.spec
],[
chmod +x imlib2-config
])
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo
echo "Image Loaders:"
echo " JPEG....................: $jpeg_ok"
echo " PNG.....................: $png_ok"
echo " TIFF....................: $tiff_ok"
echo " GIF.....................: $gif_ok"
echo " ZLIB....................: $zlib_ok"
echo " BZIP2...................: $bz2_ok"
echo " ID3.....................: $id3_ok"
echo
echo
echo "Use X86 MMX for speed.....: $mmx"
echo "Use AMD64 for speed.......: $amd64"
echo
echo
echo "Installation Path.........: $prefix"
echo
echo "Compilation...............: make"
echo "Installation..............: make install"
echo
|