Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 722 lines (607 sloc) 23.889 kb
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 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721

# RMagick configure.ac

AC_INIT(RMagick, MAJOR.MINOR.TEENY, rmagick@rubyforge.org, RMagick-MAJOR.MINOR.TEENY.tar.gz)
echo "Configuring ${PACKAGE_STRING}"

AC_CONFIG_HEADER([ext/RMagick/rmagick_config.h])

# Save caller's CFLAGS before configure changes it.
rm_saved_CFLAGS=${CFLAGS}

# Check for required programs
AC_PROG_CC
AC_PROG_CC_STDC
AC_PATH_PROG(RUBY, ruby,)
if test -z "$RUBY"; then
    AC_MSG_ERROR([Can't install RMagick. Ruby must be installed first.])
fi

# See if user prefers GraphicsMagick over ImageMagick
AC_ARG_WITH(graphics-magick,
    AS_HELP_STRING([--with-graphics-magick], [configure RMagick with GraphicsMagick]),
    [with_graphics_magick=$withval],
    [with_graphics_magick='no'])

if test "$with_graphics_magick" != 'no' ; then
    AC_CHECK_PROGS(MAGICKCONFIG, GraphicsMagick-config)
    if test -z "$MAGICKCONFIG"; then
        AC_MSG_ERROR([Can't install RMagick. Can't find GraphicsMagick-config program.])
    fi
    MAGICKNAME=GraphicsMagick
    MAGICKLIB=GraphicsMagick
    AC_DEFINE(GRAPHICSMAGICK,1)

# Otherwise see which one is installed
else
    AC_CHECK_PROGS(MAGICKCONFIG, [Magick-config GraphicsMagick-config])
    if test -z "$MAGICKCONFIG"; then
        AC_MSG_ERROR([Can't install RMagick. Can't find Magick-config or GraphicsMagick-config program.])
    else
        case "$MAGICKCONFIG" in
            Magick-config )
                MAGICKNAME=ImageMagick
                MAGICKLIB=Magick
                MAGICKVERS=`${MAGICKCONFIG} --version | tr -d .`
                if test $MAGICKVERS -lt 600; then
                   MAGICKVERS=`${MAGICKCONFIG} --version`
                   AC_MSG_ERROR([Can't install RMagick. You must have ImageMagick 6.0.0 or later installed. Your version of ImageMagick is ${MAGICKVERS}])
                fi
                ;;
            GraphicsMagick-config )
                MAGICKNAME=GraphicsMagick
                MAGICKLIB=GraphicsMagick
                AC_DEFINE(GRAPHICSMAGICK,1)
                ;;
        esac
    fi
fi

# Append ***Magick's lists of flags to the user's lists (if any)
LDFLAGS="${LDFLAGS} `${MAGICKCONFIG} --ldflags`"
CPPFLAGS="${CPPFLAGS} `${MAGICKCONFIG} --cppflags`"

AC_SUBST(LDFLAGS, ${LDFLAGS})
AC_SUBST(CFLAGS, ${rm_saved_CFLAGS})
AC_SUBST(CPPFLAGS, ${CPPFLAGS})
AC_SUBST(LOCAL_LIBS, `${MAGICKCONFIG} --libs`)

AC_CHECK_LIB($MAGICKLIB, InitializeMagick, [],
    [AC_MSG_ERROR([Can't install RMagick. Can't find lib${MAGICKLIB} or one of the dependent libraries.
                  Check the config.log file for more detailed information.])],
    [`${MAGICKCONFIG} --libs`])


AC_SUBST(MAGICKLIB)
AC_SUBST(MAGICKNAME)
AC_SUBST(MAGICKCONFIG)
AC_DEFINE_UNQUOTED(MAGICKNAME, $MAGICKNAME)

AC_CHECK_HEADER(magick/api.h, [],
    [AC_MSG_ERROR([Can't find magick/api.h])])

# What standard functions?
AC_CHECK_FUNCS([snprintf])

# Append ***Magick's lists of libs to the user's list (if any)
LIBS="${LIBS} `${MAGICKCONFIG} --libs`"

# What ImageMagick/GraphicsMagick functions?
AC_CHECK_FUNCS([AcquireMagickMemory])

# We need to be able to query this later in the configure script, so set a shell variable here
# as well as defining a symbol.
AC_CHECK_FUNC(AcquireStringInfo,
              rm_have_acquirestringinfo=yes,
              rm_have_acquirestringinfo=no)
if test "$rm_have_acquirestringinfo" = yes; then
   AC_DEFINE(HAVE_ACQUIRESTRINGINFO)
fi

AC_CHECK_FUNCS([AdaptiveThresholdImage AddDefinitions AddNoiseImageChannel BilevelImageChannel])
AC_CHECK_FUNCS([BlackThresholdImage BlurImageChannel CompareImageChannels CompareImageLayers])
AC_CHECK_FUNCS([ConvolveImageChannel EvaluateImageChannel ExportImagePixels FuzzyColorCompare])
AC_CHECK_FUNCS([GammaImageChannel GaussianBlurImageChannel])
AC_CHECK_FUNCS([GetColorHistogram GetColorInfoArray])

# We need to be able to query these symbols later in the configure script, so set a shell
# variable here as well as defining symbols.
AC_CHECK_FUNC(GetColorInfoList,
              rm_have_getcolorinfolist=yes,
              rm_have_getcolorinfolist=no)
if test "$rm_have_getcolorinfolist" = yes; then
   AC_DEFINE(HAVE_GETCOLORINFOLIST)
fi

AC_CHECK_FUNCS([GetImageChannelDepth GetImageChannelDistortion])
AC_CHECK_FUNCS([GetImageChannelExtrema GetImageChannelMean])
AC_CHECK_FUNCS([GetImageHistogram GetImageProfile])

# We need to be able to query this later in the configure script, so set a shell variable here
# as well as defining a symbol.
AC_CHECK_FUNC(GetImageQuantumDepth,
              rm_have_getimagequantumdepth=yes,
              rm_have_getimagequantumdepth=no)
if test "$rm_have_getimagequantumdepth" = yes; then
   AC_DEFINE(HAVE_GETIMAGEQUANTUMDEPTH)
fi

AC_CHECK_FUNCS([GetImageStatistics GetMagickInfoArray])

AC_CHECK_FUNC(GetMagickInfoList,
              rm_have_getmagickinfolist=yes,
              rm_have_getmagickinfolist=no)
if test "$rm_have_getmagickinfolist" = yes; then
   AC_DEFINE(HAVE_GETMAGICKINFOLIST)
fi

AC_CHECK_FUNCS([GetMultilineTypeMetrics GetNextImageAttribute GetNextImageProfile])

AC_CHECK_FUNC(GetTypeInfoList,
              rm_have_gettypeinfolist=yes,
              rm_have_gettypeinfolist=no)
if test "$rm_have_gettypeinfolist" = yes; then
   AC_DEFINE(HAVE_GETTYPEINFOLIST)
fi

AC_CHECK_FUNCS([GetMagickResourceLimit GrayscalePseudoClassImage ImagesToBlob ImportImagePixels])
AC_CHECK_FUNCS([InterpretImageAttributes IsColorSimilar NegateImageChannel])
AC_CHECK_FUNCS([NormalizeImageChannel ParseSizeGeometry PosterizeImage PreviewImage])
AC_CHECK_FUNCS([QuantumOperatorRegionImage RadialBlurImage RandomChannelThresholdImage])
AC_CHECK_FUNCS([RandomThresholdImageChannel SeparateImageChannel SepiaToneImage])
AC_CHECK_FUNCS([SetImageBackgroundColor SetImageChannelDepth SetImageColorspace SetImageOption])
AC_CHECK_FUNCS([SetImageProgressMonitor ShadowImage SharpenImageChannel])
AC_CHECK_FUNCS([SigmoidalContrastImageChannel SpliceImage StripImage])
AC_CHECK_FUNCS([ThresholdImageChannel TintImage])
AC_CHECK_FUNCS([UnsharpMaskImageChannel VignetteImage WhiteThresholdImage XImportImage])

# What typedefs?

# Need a separate test for this so we can set an env. variable to test below.
AC_CHECK_TYPE(MagickBooleanType,
              rm_have_magickbooleantype=yes,
              rm_have_magickbooleantype=no,
              [#include <stdio.h>
               #if HAVE_SYS_TYPES_H
               #include <sys/types.h>
               #endif
               #include "magick/api.h"])
if test "$rm_have_magickbooleantype" = yes; then
   AC_DEFINE(HAVE_MAGICKBOOLEANTYPE)
fi

AC_CHECK_TYPES([magick_int64_t,
                magick_uint64_t,
                ExtendedSignedIntegralType,
                ExtendedUnsignedIntegralType,
                MagickOffsetType,
                MagickSizeType],
                [], [],
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])


AC_CHECK_MEMBERS([ExceptionInfo.module],,,
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])


AC_CHECK_MEMBERS([Image.orientation],,,
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])

AC_CHECK_MEMBERS([ImageInfo.orientation],,,
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])

AC_CHECK_MEMBERS([Image.quality],,,
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])

AC_CHECK_MEMBERS([Image.ticks_per_second],,,
                [#include <stdio.h>
                 #if HAVE_SYS_TYPES_H
                 #include <sys/types.h>
                 #endif
                 #include "magick/api.h"])

# Don't use AC_CHECK_MEMBERS!
AC_CACHE_CHECK(for Image.extract_info, rm_cv_member_Image_extract_info,
  AC_TRY_COMPILE([
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <stdio.h>
#include "magick/api.h"],
    [Image i; i.extract_info.x = 0;],
    rm_cv_member_Image_extract_info=yes,
    rm_cv_member_Image_extract_info=no))
if test "$rm_cv_member_Image_extract_info" = yes; then
  AC_DEFINE(HAVE_IMAGE_EXTRACT_INFO)
fi

AC_CACHE_CHECK(for CineonLogRGBColorspace enum value, rm_cv_enum_cineonlogrgbcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = CineonLogRGBColorspace],
     rm_cv_enum_cineonlogrgbcolorspace='yes',
     rm_cv_enum_cineonlogrgbcolorspace='no')])

if test "$rm_cv_enum_cineonlogrgbcolorspace" = yes; then
  AC_DEFINE(HAVE_CINEONLOGRGBCOLORSPACE)
fi

AC_CACHE_CHECK(for HSBColorspace enum value, rm_cv_enum_hsbcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = HSBColorspace],
     rm_cv_enum_hsbcolorspace='yes',
     rm_cv_enum_hsbcolorspace='no')])

if test "$rm_cv_enum_hsbcolorspace" = yes; then
  AC_DEFINE(HAVE_HSBCOLORSPACE)
fi

AC_CACHE_CHECK(for LABColorspace enum value, rm_cv_enum_labcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = LABColorspace],
     rm_cv_enum_labcolorspace='yes',
     rm_cv_enum_labcolorspace='no')])

if test "$rm_cv_enum_labcolorspace" = yes; then
  AC_DEFINE(HAVE_LABCOLORSPACE)
fi

AC_CACHE_CHECK(for Rec601LumaColorspace enum value, rm_cv_enum_rec601lumacolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = Rec601LumaColorspace],
     rm_cv_enum_rec601lumacolorspace='yes',
     rm_cv_enum_rec601lumacolorspace='no')])

if test "$rm_cv_enum_rec601lumacolorspace" = yes; then
  AC_DEFINE(HAVE_REC601LUMACOLORSPACE)
fi

AC_CACHE_CHECK(for Rec601YCbCrColorspace enum value, rm_cv_enum_rec601ycbcrcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = Rec601YCbCrColorspace],
     rm_cv_enum_rec601ycbcrcolorspace='yes',
     rm_cv_enum_rec601ycbcrcolorspace='no')])

if test "$rm_cv_enum_rec601ycbcrcolorspace" = yes; then
  AC_DEFINE(HAVE_REC601YCBCRCOLORSPACE)
fi

AC_CACHE_CHECK(for Rec709LumaColorspace enum value, rm_cv_enum_rec709lumacolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = Rec709LumaColorspace],
     rm_cv_enum_rec709lumacolorspace='yes',
     rm_cv_enum_rec709lumacolorspace='no')])

if test "$rm_cv_enum_rec709lumacolorspace" = yes; then
  AC_DEFINE(HAVE_REC709LUMACOLORSPACE)
fi

AC_CACHE_CHECK(for Rec709YCbCrColorspace enum value, rm_cv_enum_rec709ycbcrcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = Rec709YCbCrColorspace],
     rm_cv_enum_rec709ycbcrcolorspace='yes',
     rm_cv_enum_rec709ycbcrcolorspace='no')])

if test "$rm_cv_enum_rec709ycbcrcolorspace" = yes; then
  AC_DEFINE(HAVE_REC709YCBCRCOLORSPACE)
fi

AC_CACHE_CHECK(for LogColorspace enum value, rm_cv_enum_logcolorspace,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ColorspaceType x; x = LogColorspace],
     rm_cv_enum_logcolorspace='yes',
     rm_cv_enum_logcolorspace='no')])

if test "$rm_cv_enum_logcolorspace" = yes; then
  AC_DEFINE(HAVE_LOGCOLORSPACE)
fi

AC_CACHE_CHECK(for CopyCyanCompositeOp enum value, rm_cv_enum_copycyancompositeop,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [CompositeOperator x; x = CopyCyanCompositeOp],
     rm_cv_enum_copycyancompositeop='yes',
     rm_cv_enum_copycyancompositeop='no')])

if test "$rm_cv_enum_copycyancompositeop" = yes; then
  AC_DEFINE(HAVE_COPYCYANCOMPOSITEOP)
fi

AC_CACHE_CHECK(for ReplaceCompositeOp enum value, rm_cv_enum_replacecompositeop,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [CompositeOperator x; x = ReplaceCompositeOp],
     rm_cv_enum_replacecompositeop='yes',
     rm_cv_enum_replacecompositeop='no')])

if test "$rm_cv_enum_replacecompositeop" = yes; then
  AC_DEFINE(HAVE_REPLACECOMPOSITEOP)
fi

AC_CACHE_CHECK(for DstCompositeOp enum value, rm_cv_enum_dstcompositeop,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [CompositeOperator x; x = DstCompositeOp],
     rm_cv_enum_dstcompositeop='yes',
     rm_cv_enum_dstcompositeop='no')])

if test "$rm_cv_enum_dstcompositeop" = yes; then
  AC_DEFINE(HAVE_DSTCOMPOSITEOP)
fi

AC_CACHE_CHECK(for ColorDodgeCompositeOp enum value, rm_cv_enum_ColorDodgeCompositeOp,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [CompositeOperator x; x = ColorDodgeCompositeOp],
     rm_cv_enum_ColorDodgeCompositeOp='yes',
     rm_cv_enum_ColorDodgeCompositeOp='no')])

if test "$rm_cv_enum_ColorDodgeCompositeOp" = yes; then
  AC_DEFINE(HAVE_COLORDODGECOMPOSITEOP)
fi


AC_CACHE_CHECK(for IndexChannel enum value, rm_cv_enum_indexchannel,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ChannelType x; x = IndexChannel],
     rm_cv_enum_indexchannel='yes',
     rm_cv_enum_indexchannel='no')])

if test "$rm_cv_enum_indexchannel" = yes; then
  AC_DEFINE(HAVE_INDEXCHANNEL)
fi

AC_CACHE_CHECK(for GrayChannel enum value, rm_cv_enum_graychannel,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ChannelType x; x = GrayChannel],
     rm_cv_enum_graychannel='yes',
     rm_cv_enum_graychannel='no')])

if test "$rm_cv_enum_graychannel" = yes; then
  AC_DEFINE(HAVE_GRAYCHANNEL)
fi

AC_CACHE_CHECK(for AllChannels enum value, rm_cv_enum_allchannels,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [ChannelType x; x = AllChannels],
     rm_cv_enum_allchannels='yes',
     rm_cv_enum_allchannels='no')])

if test "$rm_cv_enum_allchannels" = yes; then
  AC_DEFINE(HAVE_ALLCHANNELS)
fi

AC_CACHE_CHECK(for JPEG2000Compression enum value, rm_cv_enum_jpeg2000compression,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [CompressionType x; x = JPEG2000Compression],
     rm_cv_enum_jpeg2000compression='yes',
     rm_cv_enum_jpeg2000compression='no')])

if test "$rm_cv_enum_jpeg2000compression" = yes; then
  AC_DEFINE(HAVE_JPEG2000COMPRESSION)
fi

AC_CACHE_CHECK(for UndefinedGravity enum value, rm_cv_enum_undefinedgravity,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [GravityType x; x = UndefinedGravity],
     rm_cv_enum_undefinedgravity='yes',
     rm_cv_enum_undefinedgravity='no')])

if test "$rm_cv_enum_undefinedgravity" = yes; then
  AC_DEFINE(HAVE_UNDEFINEDGRAVITY)
fi

AC_CACHE_CHECK(for QuantumPixel enum value, rm_cv_enum_quantumpixel,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [StorageType x; x = QuantumPixel],
     rm_cv_enum_quantumpixel='yes',
     rm_cv_enum_quantumpixel='no')])
if test "$rm_cv_enum_quantumpixel" = yes; then
  AC_DEFINE(HAVE_QUANTUMPIXEL)
fi

AC_CACHE_CHECK(for TransparentVirtualPixelMethod enum value, rm_cv_enum_transparentvirtualpixelmethod,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [VirtualPixelMethod x; x = TransparentVirtualPixelMethod],
     rm_cv_enum_transparentvirtualpixelmethod='yes',
     rm_cv_enum_transparentvirtualpixelmethod='no')])

if test "$rm_cv_enum_transparentvirtualpixelmethod" = yes; then
  AC_DEFINE(HAVE_TRANSPARENTVIRTUALPIXELMETHOD)
fi

AC_CACHE_CHECK(for CoalesceLayer enum value, rm_cv_enum_coalescelayer,
  [AC_TRY_COMPILE(
[#include <stdio.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "magick/api.h"],
     [MagickLayerMethod x; x = CoalesceLayer],
     rm_cv_enum_coalescelayer='yes',
     rm_cv_enum_coalescelayer='no')])

if test "$rm_cv_enum_coalescelayer" = yes; then
  AC_DEFINE(HAVE_COALESCELAYER)
fi

if test "$rm_have_getimagequantumdepth" = yes; then
   # IM 6.0.5 changed the number of arguments to GetImageQuantumDepth.
   AC_CACHE_CHECK(if GetImageQuantumDepth has only 1 argument, rm_cv_args_get_image_quantum_depth,
     [AC_TRY_COMPILE(
   [#include <stdio.h>
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   #include "magick/api.h"],
        [Image *image; (void)GetImageQuantumDepth(image)],
        rm_cv_args_get_image_quantum_depth='yes',
        rm_cv_args_get_image_quantum_depth='no')])

   if test "$rm_cv_args_get_image_quantum_depth" = yes; then
      AC_DEFINE(HAVE_OLD_GETIMAGEQUANTUMDEPTH)
   fi
fi

if test "$rm_have_getcolorinfolist" = yes; then
   # IM 6.1.3 changed the number of arguments to GetColorInfoList
   AC_CACHE_CHECK(if GetColorInfoList has only 2 arguments, rm_cv_args_get_color_info_list,
     [AC_TRY_COMPILE(
   [#include <stdio.h>
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   #include "magick/api.h"],
        [const char *pattern; unsigned long ncolors; (void)GetColorInfoList(pattern, &ncolors)],
        rm_cv_args_get_color_info_list='yes',
        rm_cv_args_get_color_info_list='no')])

   if test "$rm_cv_args_get_color_info_list" = yes; then
      AC_DEFINE(HAVE_OLD_GETCOLORINFOLIST)
   fi
fi

if test "$rm_have_gettypeinfolist" = yes; then
   # IM 6.1.3 changed the number of arguments to GetTypeInfoList
   AC_CACHE_CHECK(if GetTypeInfoList has only 2 arguments, rm_cv_args_get_type_info_list,
     [AC_TRY_COMPILE(
   [#include <stdio.h>
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   #include "magick/api.h"],
        [const char *pattern; unsigned long ncolors; (void)GetTypeInfoList(pattern, &ncolors)],
        rm_cv_args_get_type_info_list='yes',
        rm_cv_args_get_type_info_list='no')])

   if test "$rm_cv_args_get_type_info_list" = yes; then
      AC_DEFINE(HAVE_OLD_GETTYPEINFOLIST)
   fi
fi

if test "$rm_have_getmagickinfolist" = yes; then
   # IM 6.1.3 changed the number of arguments to GetMagickInfoList
   AC_CACHE_CHECK(if GetMagickInfoList has only 2 arguments, rm_cv_args_get_magick_info_list,
     [AC_TRY_COMPILE(
   [#include <stdio.h>
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   #include "magick/api.h"],
        [const char *pattern; unsigned long ncolors; (void)GetMagickInfoList(pattern, &ncolors)],
        rm_cv_args_get_magick_info_list='yes',
        rm_cv_args_get_magick_info_list='no')])

   if test "$rm_cv_args_get_magick_info_list" = yes; then
      AC_DEFINE(HAVE_OLD_GETMAGICKINFOLIST)
   fi
fi

# IM 6.2.1 changed the return value from RemoveImageProfile from StringInfo * to
# MagickBooleanType. The presence of StringInfo implies RemoveImageProfile.
if test "$rm_have_acquirestringinfo" = yes -a "$rm_have_magickbooleantype" = yes; then
   AC_CACHE_CHECK(if RemoveImageProfile returns MagickBooleanType, rv_cv_args_remove_image_profile,
     [AC_TRY_COMPILE(
   [#include <stdio.h>
   #if HAVE_SYS_TYPES_H
   #include <sys/types.h>
   #endif
   #include "magick/api.h"],
        [MagickBooleanType bool; Image *image; bool=RemoveImageProfile(image, "icc")],
        rv_cv_args_remove_image_profile='yes',
        rv_cv_args_remove_image_profile='no')])

   if test "$rv_cv_args_remove_image_profile" = yes; then
      AC_DEFINE(HAVE_NEW_REMOVEIMAGEPROFILE)
   fi
fi



# Where is ****Magick installed?
MAGICKPREFIX=`${MAGICKCONFIG} --prefix`

# Options to pass to ruby config step

RUBY_CONFIG_OPTS=''

if test "x$prefix" != xNONE; then
  RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --prefix=$prefix"
fi
if test `eval echo $bindir` != NONE/bin; then
  RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --bin-dir=`eval echo $bindir`"
fi
if test `eval echo $datadir` != ${prefix}/share; then
  RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --data-dir=`eval echo $datadir`"
fi

AC_ARG_WITH(ruby-prog,
    AS_HELP_STRING([--with-ruby-prog=NAME], [the ruby program used for installation [[PREFIX/bin/ruby]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --ruby-prog=$withval"
     RUBY=$withval], )

AC_ARG_WITH(rbconfig,
    AS_HELP_STRING([--with-rbconfig=PATH], [your rbconfig to load [[ruby's]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --rbconfig=$withval"], )

AC_ARG_WITH(doc-dir,
    AS_HELP_STRING([--with-doc-dir=DIR], [RMagick documentation directory [[PREFIX/share/RMagick]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --doc-dir=$withval"], )

AC_ARG_WITH(std-ruby,
    AS_HELP_STRING([--with-std-ruby=DIR], [the directory for standard ruby libraries [[PREFIX/lib/ruby/1.x]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --std-ruby=$withval"], )

AC_ARG_WITH(site-ruby,
    AS_HELP_STRING([--with-site-ruby=DIR], [the directory for non-standard ruby libraries [[PREFIX/lib/ruby/site_ruby/1.x]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --site-ruby=$withval"], )

AC_ARG_WITH(site-ruby-common,
    AS_HELP_STRING([--with-site-ruby-common=DIR], [the directory for version-independent non-standard ruby libraries [[PREFIX/lib/ruby/site_ruby]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --site-ruby-common=$withval"], )

AC_ARG_WITH(rb-dir,
    AS_HELP_STRING([--with-rb-dir=DIR], [the directory for ruby scripts [[PREFIX/lib/ruby/site_ruby/1.x]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --rb-dir=$withval"], )

AC_ARG_WITH(so-dir,
    AS_HELP_STRING([--with-so-dir=DIR], [the directory for ruby extensions]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --so-dir=$withval"], )

AC_ARG_WITH(ruby-path,
    AS_HELP_STRING([--with-ruby-path=DIR], [path to set to #! line [PREFIX/bin/ruby]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --ruby-path=$withval"], )

AC_ARG_WITH(make-prog,
    AS_HELP_STRING([--with-make-prog=NAME], [the make program to compile ruby extensions [[make]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --make-prog=$withval"], )

AC_ARG_ENABLE(without-ext,
    AS_HELP_STRING([--enable-without-ext], [does not compile/install ruby extensions [[--disable-without-ext]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --without-ext"], )

AC_ARG_ENABLE(no-harm,
    AS_HELP_STRING([--enable-no-harm], [only display what to do if given [[--disable-no-harm]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --no-harm"], )

AC_ARG_ENABLE(allow-example-errors,
    AS_HELP_STRING([--enable-allow-example-errors], [allow installation to proceed even if a lot of examples fail [[--disable-allow-example-errors]]]),
    [RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --allow-example-errors"], )

AC_ARG_ENABLE(htmldoc,
    AS_HELP_STRING([--disable-htmldoc], [skip creating the HTML documentation and examples [[--enable-htmldoc]]]),
    [if test "$enable_htmldoc" = no; then
        RUBY_CONFIG_OPTS="$RUBY_CONFIG_OPTS --disable-htmldoc"
     fi], )


RUBY_VERSION_STRING=`$RUBY --version`
AC_DEFINE_UNQUOTED(RUBY_VERSION_STRING, "$RUBY_VERSION_STRING")
AC_SUBST(RUBY)
AC_SUBST(RUBY_CONFIG_OPTS)

AC_CONFIG_FILES(Makefile ext/RMagick/extconf.rb metaconfig)
AC_OUTPUT

echo ""
echo ""
echo "This installation of $PACKAGE_STRING is configured for"
echo "$RUBY_VERSION_STRING and $MAGICKNAME `$MAGICKCONFIG --version`."


Something went wrong with that request. Please try again.