482 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], 483 [ 484 485 ############################################################################### 486 # 487 # Check for the jpeg library 488 # 489 490 USE_EXTERNAL_LIBJPEG=true 491 AC_CHECK_LIB(jpeg, main, [], 492 [ USE_EXTERNAL_LIBJPEG=false 493 AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) 494 ]) 495 AC_SUBST(USE_EXTERNAL_LIBJPEG) 496 497 ############################################################################### 498 # 499 # Check for the gif library 500 # 501 502 USE_EXTERNAL_LIBJPEG=true 503 AC_CHECK_LIB(gif, main, [], 504 [ USE_EXTERNAL_LIBGIF=false 505 AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source]) 506 ]) 507 AC_SUBST(USE_EXTERNAL_LIBGIF) 508 509 ############################################################################### 510 # 511 # Check for the zlib library 512 # 513 514 AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], 515 [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) 516 517 AC_CHECK_LIB(z, compress, 518 [ ZLIB_FOUND=yes ], 519 [ ZLIB_FOUND=no ]) 520 521 AC_MSG_CHECKING([for which zlib to use]) 522 523 DEFAULT_ZLIB=bundled 524 if test "x$OPENJDK_TARGET_OS" = xmacosx; then 525 # 526 # On macosx default is system...on others default is | 482 AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS], 483 [ 484 485 ############################################################################### 486 # 487 # Check for the jpeg library 488 # 489 490 USE_EXTERNAL_LIBJPEG=true 491 AC_CHECK_LIB(jpeg, main, [], 492 [ USE_EXTERNAL_LIBJPEG=false 493 AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source]) 494 ]) 495 AC_SUBST(USE_EXTERNAL_LIBJPEG) 496 497 ############################################################################### 498 # 499 # Check for the gif library 500 # 501 502 AC_ARG_WITH(giflib, [AS_HELP_STRING([--with-giflib], 503 [use giflib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) 504 505 AC_CHECK_LIB(gif, DGifGetCode, 506 [ GIFLIB_FOUND=yes ], 507 [ GIFLIB_FOUND=no ]) 508 509 AC_MSG_CHECKING([for which giflib to use]) 510 511 # default is bundled 512 DEFAULT_GIFLIB=bundled 513 514 # 515 # if user didn't specify, use DEFAULT_GIFLIB 516 # 517 if test "x${with_giflib}" = "x"; then 518 with_giflib=${DEFAULT_GIFLIB} 519 fi 520 521 522 if test "x${with_giflib}" = "xbundled"; then 523 USE_EXTERNAL_LIBGIF=false 524 AC_MSG_RESULT([bundled]) 525 elif test "x${with_giflib}" = "xsystem"; then 526 if test "x${GIFLIB_FOUND}" = "xyes"; then 527 USE_EXTERNAL_LIBGIF=true 528 AC_MSG_RESULT([system]) 529 else 530 AC_MSG_RESULT([system not found]) 531 AC_MSG_ERROR([--with-giflib=system specified, but no giflib found!]) 532 fi 533 else 534 AC_MSG_ERROR([Invalid value of --with-giflib: ${with_giflib}, use 'system' or 'bundled']) 535 fi 536 AC_SUBST(USE_EXTERNAL_LIBGIF) 537 538 ############################################################################### 539 # 540 # Check for the zlib library 541 # 542 543 AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib], 544 [use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])]) 545 546 AC_CHECK_LIB(z, compress, 547 [ ZLIB_FOUND=yes ], 548 [ ZLIB_FOUND=no ]) 549 550 AC_MSG_CHECKING([for which zlib to use]) 551 552 DEFAULT_ZLIB=bundled 553 if test "x$OPENJDK_TARGET_OS" = xmacosx; then 554 # 555 # On macosx default is system...on others default is |