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 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078
|
##############################################################################
# configure.ac
#
# Process this file with autoconf to produce the configure script.
#
# ---------------------------------------------------------------------------
# Persistence of Vision Ray Tracer ('POV-Ray') version 3.7.
# Copyright 1991-2013 Persistence of Vision Raytracer Pty. Ltd.
#
# POV-Ray is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# POV-Ray is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#---------------------------------------------------------------------------
# POV-Ray is based on the popular DKB raytracer version 2.12.
# DKBTrace was originally written by David K. Buck.
# DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
#---------------------------------------------------------------------------
# $File: //depot/public/povray/3.x/unix/configure.ac $
# $Revision: #1 $
# $Change: 6069 $
# $DateTime: 2013/11/06 11:59:40 $
# $Author: chrisc $
# $Log$
##############################################################################
# configure.ac for the source distribution of POV-Ray 3.7 for UNIX
# Written by Nicolas Calimet <nicolas.calimet@povray.org>
# Report bugs via http://bugs.povray.org/
# Based on configure.ac from POV-Ray 3.6
# Required autoconf version.
AC_PREREQ(2.59)
# Inits.
# The file VERSION must contain only the version string MAJOR.MINOR(.PATCHLEVEL)
AC_INIT([POV-Ray], m4_normalize(m4_include([VERSION])), [unix-bugreports-2011@povray.org], [povray])
# VERSION_BASE is then defined as MAJOR.MINOR
VERSION_BASE=`echo $PACKAGE_VERSION | sed 's,\([[0-9]]*.[[0-9]]*\).*,\1,g'`
AC_SUBST([VERSION_BASE])
AC_DEFINE_UNQUOTED([VERSION_BASE], ["$VERSION_BASE"], [Base version number of package.])
AC_CONFIG_AUX_DIR([unix/config])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([unix/disp_text.cpp])
# Additional autoconf macros.
m4_include([unix/config/acx_pthread.m4])
m4_include([unix/config/ax_arg_enable.m4])
m4_include([unix/config/ax_arg_with.m4])
m4_include([unix/config/ax_boost_base.m4])
m4_include([unix/config/ax_boost_thread.m4])
m4_include([unix/config/ax_test_compiler_flags.m4])
m4_include([unix/config/ax_check_lib.m4])
m4_include([unix/config/ax_check_libjpeg.m4])
m4_include([unix/config/ax_check_libsdl.m4])
m4_include([unix/config/ax_check_libtiff.m4])
m4_include([unix/config/ax_check_openexr.m4])
m4_include([unix/config/ax_compare_version.m4])
m4_include([unix/config/ax_compiler_vendor.m4])
m4_include([unix/config/ax_compiler_version.m4])
m4_include([unix/config/ax_fix_incorrect_path.m4])
m4_include([unix/config/ax_prog_ld_static.m4])
m4_include([unix/config/ax_x86_arch.m4])
# Required versions of the support libraries.
# Must be declared after AC_INIT.
required_libboost_version="1.37"
required_libz_version="1.2.1"
required_libpng_version="1.2.5"
required_libjpeg_version="6b"
required_libtiff_version="3.6.1"
required_libsdl_version="1.2"
required_openexr_version="1.2"
# Supported options.
AX_ARG_ENABLE([--enable-watch-cursor], [enable a watch cursor over the display while rendering (X Window only)])
AX_ARG_ENABLE([--enable-debug], [enable compiler debugging mode])
AX_ARG_ENABLE([--enable-profile], [enable program execution profiling])
AX_ARG_ENABLE([--enable-static], [enable the linker to create static executable (no run-time dependancy to external libraries, larger binary)])
AX_ARG_ENABLE([--disable-optimiz], [disable all compiler optimizations])
AX_ARG_ENABLE([--disable-optimiz-arch], [disable architecture-specific compiler optimizations])
AX_ARG_ENABLE([--disable-pipe], [disable usage of pipes during compilation (use temporary files instead)])
AX_ARG_ENABLE([--disable-strip], [disable stripping all symbols from the object files (larger binary)])
AX_ARG_ENABLE([--disable-shared], [disable linking with shared libraries (same as --enable-static)])
AX_ARG_ENABLE([--disable-io-restrictions], [disable POV-Ray's mechanism for control of I/O operations])
AX_ARG_WITH([--without-cygwin-dll], [], [don't link with the Cygwin DLL (MinGW required)])
AX_ARG_WITH([--with-zlib], [DIR], [use the ZLIB library (in directory DIR)])
AX_ARG_WITH([--with-libpng], [DIR], [use the PNG library (in directory DIR)])
AX_ARG_WITH([--with-libjpeg], [DIR], [use the JPEG library (in directory DIR)])
AX_ARG_WITH([--with-libtiff], [DIR], [use the TIFF library (in directory DIR)])
AX_ARG_WITH([--with-libsdl], [DIR], [use the SDL library (in directory DIR)])
AX_ARG_WITH([--with-libmkl], [DIR], [use the Intel(R) Math Kernel Library (in directory DIR)])
AX_ARG_WITH([--with-openexr], [DIR], [use the OpenEXR library (in directory DIR)])
AC_ARG_VAR([COMPILED_BY], [customize the "unofficial version" message (required argument)])
AC_ARG_VAR([NON_REDISTRIBUTABLE_BUILD], [see the installation documentation])
AC_ARG_VAR([C99_COMPATIBLE_RADIOSITY], [adapt radiosity code to non-IEEE 754 floating point, requires ISO C99 compiler and library (see octree.cpp for details)])
###############################################################################
# Remove povray.ini unconditionally.
rm -f ./povray.ini
# Instruction message.
if test x"$COMPILED_BY" = x""; then
echo "
Welcome to the $PACKAGE_NAME $PACKAGE_VERSION configure script.
This script will prepare the source distribution of $PACKAGE_NAME $PACKAGE_VERSION for Unix
for compilation on this machine. Compiling the program yourself means
that the POV-Ray Team(tm) is not responsible for supporting this
version, no matter if it is the unmodified official POV-Ray source code
or a customized version. Refer to the POV-Ray source license conditions
that come with this package.
In order to start configuration, you have to provide a valid contact
information that will be included in the executable and displayed
whenever POV-Ray (or a modified version of it) is started. In case
you intend to distribute this binary, this information will help users
to contact the appropriate maintainers. To start configuring $PACKAGE_NAME
type in the following command with your own contact information:
./configure COMPILED_BY=\"your name <email@address>\"
Please consult the INSTALL file for additional configuration and
installation instructions.
"
exit 1
fi
pov_no_distrib="${NON_REDISTRIBUTABLE_BUILD:-no}"
# Don't use 'echo' (not saved into config.log / doesn't honor --silent).
# Don't use AC_MSG_NOTICE which prints things first.
AC_MSG_RESULT([
===============================================================================
Configure $PACKAGE_NAME version $PACKAGE_VERSION
===============================================================================
This is an unofficial version compiled by:
$COMPILED_BY
The POV-Ray Team(tm) is not responsible for supporting this version.])
AC_DEFINE_UNQUOTED([DISTRIBUTION_MESSAGE_2], [" $COMPILED_BY"], [Who compiled this binary.])
###############################################################################
AC_MSG_RESULT([
Environment
-----------])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.9 dist-bzip2 subdir-objects])
AM_MAINTAINER_MODE
AX_FIX_INCORRECT_PATH(C_INCLUDE_PATH, ".", [pov_warn_path="$pov_warn_path C_INCLUDE_PATH"])
AX_FIX_INCORRECT_PATH(CPLUS_INCLUDE_PATH, ".", [pov_warn_path="$pov_warn_path CPLUS_INCLUDE_PATH"])
###############################################################################
AC_MSG_RESULT([
Programs
--------])
# Check for the C compiler (used in some library checks).
# Init compiler flags to avoid defaults such as '-g -O2'.
CFLAGS="$CFLAGS"
AC_PROG_CC
AC_PROG_CPP
# Force checking essential (ANSI-compliant) headers.
AC_CHECK_HEADERS([stdlib.h])
# Check for the C++ compiler and version.
# Init compiler flags to avoid defaults such as '-g -O2'.
AC_LANG([C++])
CXXFLAGS="$CXXFLAGS"
AC_PROG_CXX
AC_MSG_CHECKING([whether the $CXX compiler works])
AC_LINK_IFELSE([AC_LANG_PROGRAM],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_FAILURE([C++ compiler cannot create executables])
]
)
AC_PROG_CXXCPP
AX_COMPILER_VENDOR
AX_COMPILER_VERSION
pov_compiler=`echo $CXX | sed 's,.*/,,'` # equivalent to `basename $CXX`
pov_compiler_vendor="$ax_cv_cxx_compiler_vendor"
pov_compiler_version="$pov_compiler"
if test "$ax_compiler_version"; then
pov_compiler_version="$pov_compiler $ax_compiler_version"
fi
pov_built_for="$host" # default
AC_DEFINE_UNQUOTED([BUILD_ARCH], ["$build"], [Build architecture.])
AC_DEFINE_UNQUOTED([COMPILER_VENDOR], ["$pov_compiler_vendor"], [Compiler vendor.])
AC_DEFINE_UNQUOTED([COMPILER_VERSION], ["$pov_compiler_version"], [Compiler version.])
AC_DEFINE_UNQUOTED([COMPILER_VER], [" ($pov_compiler_version @ $build)"], [Compiler version (processed).])
# Not necessary when AM_MAINTAINER_MODE is called above.
###AC_PROG_MAKE_SET
AC_PROG_RANLIB
###############################################################################
AC_MSG_RESULT([
Libraries
---------])
# Link with or without the cygwin DLL.
AC_MSG_CHECKING([whether to link with cygwin DLL])
if test x"$with_cygwin_dll" = x"no"; then
AC_MSG_RESULT([no])
case "$build" in
*cygwin*)
pov_flags="-mno-cygwin"
pov_cygwin_save_cxxflags="$CXXFLAGS"
AX_TEST_COMPILER_FLAGS([$pov_flags],
[
AC_CHECK_LIB([mingw32], [main],
[
LDFLAGS="$LDFLAGS $pov_flags"
# -D__CYGWIN is required for tiffio.h (incl. in tiff_pov.cpp)
CPPFLAGS="$CPPFLAGS -D__CYGWIN $pov_flags"
],
[with_cygwin_dll="yes"]
)
],
[with_cygwin_dll="yes"]
)
if test x"$with_cygwin_dll" != x"no"; then
AC_MSG_WARN([Cannot link without Cygwin DLL])
CXXFLAGS="$pov_cygwin_save_cxxflags"
fi
;;
esac
else
case "$build" in
*cygwin*)
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac
fi
# Link with static library, update LDFLAGS.
if test x"$enable_static" = x"yes" && test x"$enable_shared" != x"yes"; then
enable_shared="no"
fi
AC_MSG_CHECKING([whether to enable static linking])
if test x"$enable_shared" = x"no"; then
AC_MSG_RESULT([yes])
AX_PROG_LD_STATIC
else
AC_MSG_RESULT([no])
fi
# Try to use the -v compiler flag for better debugging.
if test ! `$CXX -v < /dev/null 2> /dev/null`; then
pov_lib_save_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -v"
AC_LINK_IFELSE([AC_LANG_PROGRAM()])
CXXFLAGS="$pov_lib_save_cxxflags"
fi
# Posix threads
ACX_PTHREAD
CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # append
LIBS="$LIBS $PTHREAD_CFLAGS $PTHREAD_LIBS" # append
# Boost; required library
# the following macro stops with error when boost is not found
AX_BOOST_BASE([$required_libboost_version])
AX_BOOST_THREAD
if test x"$ax_cv_boost_thread" != x"yes"; then
AC_MSG_ERROR([cannot find a suitable boost thread library])
else
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" # append
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" # append
LIBS="$BOOST_THREAD_LIB $LIBS"
fi
AC_MSG_CHECKING([whether the boost thread library is usable])
SAVED_LIBS=$LIBS
boost_thread_links=0
for extralib in '' '-lboost_system -lboost_date_time'
do
LIBS=$SAVED_LIBS
LIBS="$LIBS $extralib"
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
#include <boost/thread/thread.hpp>
]],[[
boost::mutex m;
boost::defer_lock_t();
return 0;
]])
],[
AC_MSG_RESULT([yes])
BOOST_THREAD_LIB="$BOOST_THREAD_LIB $extralib"
boost_thread_links=1
],,[
AC_MSG_RESULT([cross-compiling]) # FIXME
])
if test $boost_thread_links = '1'; then
break
fi
done
if test $boost_thread_links != '1'; then
AC_MSG_RESULT([no])
AC_MSG_FAILURE([cannot link with the boost thread library])
fi
AC_DEFINE([USE_OFFICIAL_BOOST], [], [Use the official Boost libraries.])
# Intel Math Kernel library
pov_save_ldflags="$LDFLAGS"
test x"$with_libmkl" != x"" && test x"$with_libmkl" != x"no" && LDFLAGS="-L$with_libmkl $LDFLAGS"
AC_CHECK_LIB([mkl], [sin])
test x"$ac_cv_lib_mkl_sin" = x"no" && LDFLAGS="$pov_save_ldflags"
# libm
AC_CHECK_LIB([m], [sin])
# real-time clock
AC_CHECK_LIB([rt], [clock_gettime])
# libz; required library for distributable builds
AC_MSG_CHECKING([whether to use the ZLIB library])
if test x"$pov_no_distrib" = x"yes" && test x"$with_zlib" = x"no"; then
AC_MSG_RESULT([no (NON DISTRIBUTABLE BUILD)])
AC_MSG_WARN([all program features using the ZLIB library are disabled])
AC_DEFINE([LIBZ_MISSING], [], [Don't use libz.])
else
if test x"$with_zlib" = x"no"; then
AC_MSG_ERROR([disabling support for ZLIB requires NON_REDISTRIBUTABLE_BUILD=yes])
fi
AC_MSG_RESULT([yes])
AX_CHECK_LIB([z], [$required_libz_version], [z], [zlibVersion], [zlib.h], [zlibVersion()], [$with_zlib])
if test x"$ax_check_lib" != x"ok"; then
AC_MSG_ERROR([cannot find a suitable ZLIB library])
else
pov_libz=ok
fi
fi
# libpng; required library for distributable builds
AC_MSG_CHECKING([whether to use the PNG library])
if test x"$pov_no_distrib" = x"yes" && test x"$with_libpng" = x"no"; then
AC_MSG_RESULT([no (NON DISTRIBUTABLE BUILD)])
AC_MSG_WARN([all program features using the PNG library are disabled])
AC_DEFINE([LIBPNG_MISSING], [], [Don't use libpng.])
else
if test x"$with_libpng" = x"no"; then
AC_MSG_ERROR([disabling support for PNG requires NON_REDISTRIBUTABLE_BUILD=yes])
fi
AC_MSG_RESULT([yes])
AX_CHECK_LIB([png], [$required_libpng_version], [png14 png png12 png], [png_get_libpng_ver], [png.h], [png_get_libpng_ver(NULL)], [$with_libpng])
### FIXME: do not allow for 1.4.x
# This doesn't appear to be needed now that we're allowing 1.4 (jh)
# AC_MSG_CHECKING([for libpng version < 1.4 (not supported at the moment!)])
# AX_COMPARE_VERSION([$ax_check_lib_version], [ge], [1.4], [ax_check_lib="bad"], [ax_check_lib="ok"])
# AC_MSG_RESULT([$ax_check_lib])
###
if test x"$ax_check_lib" != x"ok"; then
AC_MSG_ERROR([cannot find a suitable PNG library])
else
pov_libpng=ok
fi
fi
# FIXME: what about cygwin?
# libjpeg; required library for distributable builds
AC_MSG_CHECKING([whether to use the JPEG library])
if test x"$pov_no_distrib" = x"yes" && test x"$with_libjpeg" = x"no"; then
AC_MSG_RESULT([no (NON DISTRIBUTABLE BUILD)])
AC_MSG_WARN([all program features using the JPEG library are disabled])
AC_DEFINE([LIBJPEG_MISSING], [], [Don't use libjpeg.])
else
if test x"$with_libjpeg" = x"no"; then
AC_MSG_ERROR([disabling support for JPEG requires NON_REDISTRIBUTABLE_BUILD=yes])
fi
AC_MSG_RESULT([yes])
AX_CHECK_LIBJPEG([$required_libjpeg_version], [$with_libjpeg])
if test x"$ax_check_libjpeg" != x"ok"; then
AC_MSG_ERROR([cannot find a suitable JPEG library])
else
# create jversion.h in builddir
test -d "./source" || mkdir ./source
echo "#define JVERSION \"${ax_check_libjpeg_version}\"" > ./source/jversion.h
pov_libjpeg=ok
fi
fi
# libtiff; required library for distributable builds
AC_MSG_CHECKING([whether to use the TIFF library])
if test x"$pov_no_distrib" = x"yes" && test x"$with_libtiff" = x"no"; then
AC_MSG_RESULT([no (NON DISTRIBUTABLE BUILD)])
AC_MSG_WARN([all program features using the TIFF library are disabled])
AC_DEFINE([LIBTIFF_MISSING], [], [Don't use libtiff.])
else
if test x"$with_libtiff" = x"no"; then
AC_MSG_ERROR([disabling support for TIFF requires NON_REDISTRIBUTABLE_BUILD=yes])
fi
AC_MSG_RESULT([yes])
AX_CHECK_LIBTIFF([$required_libtiff_version], [$with_libtiff])
if test x"$ax_check_libtiff" != x"ok"; then
AC_MSG_ERROR([cannot find a suitable TIFF library])
else
pov_libtiff=ok
fi
fi
# OpenEXR; optional library
AC_MSG_CHECKING([whether to use the OpenEXR library])
if test x"$with_openexr" = x"no"; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AX_CHECK_OPENEXR([$required_openexr_version])
if test x"$ax_check_openexr" = x"ok"; then
pov_libopenexr=ok
fi
fi
if test x"$pov_libopenexr" != x"ok"; then
AC_MSG_WARN([all program features using the OpenEXR library are disabled])
AC_DEFINE([OPENEXR_MISSING], [], [Don't use OpenEXR.])
fi
# Unix-specific display libraries.
if test x"$with_cygwin_dll" = x"no"; then
# disable preview displays under Cygwin/MinGW
AC_MSG_NOTICE([X Window display will be disabled])
AC_MSG_NOTICE([SVGAlib display will be disabled])
AC_DEFINE([X_DISPLAY_MISSING], [], [Don't use the X Window System.])
pov_xwin_msg="disabled"
else
# libX11
# first add default paths to help finding X11
test x"$x_includes" = x"NONE" && x_includes="/usr/include"
test x"$x_libraries" = x"NONE" && x_libraries="/usr/lib"
pov_xwin_msg="disabled"
AC_PATH_XTRA
if test x"$have_x" = x"yes"; then
AC_CHECK_HEADER([X11/Xlib.h],
[
AC_CHECK_LIB([X11], [XFlush],
[
# X_CFLAGS should actually be X_CPPFLAGS since it only adds -Idir
CPPFLAGS="$CPPFLAGS $X_CFLAGS" # append
LDFLAGS="$LDFLAGS $X_LIBS" # append
LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" # $PTHREAD_LIBS is already in $LIBS
pov_xwin_msg="enabled"
],
[
AC_MSG_NOTICE([X Window display will be disabled])
AC_DEFINE([X_DISPLAY_MISSING],[1])
],
[$X_PRE_LIBS $X_EXTRA_LIBS $PTHREAD_LIBS]
)
]
)
else
AC_MSG_NOTICE([X Window display will be disabled])
fi
# color icon (libXpm) and X Window cursor
if test x"$pov_xwin_msg" = x"enabled"; then
AC_CHECK_HEADER([X11/xpm.h], [AC_CHECK_LIB([Xpm], [XpmCreatePixmapFromData])])
AC_MSG_CHECKING([whether to enable the watch cursor])
if test x"$enable_watch_cursor" = x"yes"; then
AC_MSG_RESULT([yes])
AC_CHECK_HEADER([X11/cursorfont.h],
[
AC_CHECK_FUNC([XCreateFontCursor],
[AC_DEFINE([USE_CURSOR], [], [Use a watch cursor while rendering.])],
[AC_MSG_NOTICE([watch cursor will be disabled])]
)
]
)
else
AC_MSG_RESULT([no])
fi
fi
### Note from Warp <warp@tag.povray.org> :
# Using "-static" for static linking in Solaris causes a linkage error.
# For some reason the X libraries in Solaris are not designed for static
# linking. [...] So at least for Solaris the '-static' flag should
# definitely be turned off by default.
if test x"$ax_cv_prog_ld_static" != x"" && test x"$ac_cv_lib_X11_XFlush" = x"yes"; then
case "$build" in
sparc-*)
AC_MSG_WARN([Using $ax_cv_prog_ld_static might cause a linkage error])
;;
esac
fi
# libSDL
if test x"$pov_xwin_msg" = x"enabled"; then
AX_CHECK_LIBSDL([$required_libsdl_version])
if test x"$ax_check_libsdl" = x"ok"; then
pov_libsdl=ok
pov_xwin_msg="$pov_xwin_msg (using SDL)"
else
AC_MSG_WARN([the preview display is disabled])
pov_xwin_msg="disabled" # FIXME
fi
fi
fi # with_cygwin_dll
###############################################################################
AC_MSG_RESULT([
Language constructs and functions
---------------------------------])
# Compiling on the mingw32 platform (e.g. using MSYS) also requires
# the -D__CYGWIN flag for tiff_pov.cpp
case "$build" in
*mingw32*) CPPFLAGS="$CPPFLAGS -D__CYGWIN";;
esac
# Language constructs.
AC_HEADER_TIME
AC_CHECK_HEADERS([time.h limits.h sys/resource.h sys/time.h unistd.h])
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long int]) # check for 64 bit support
AC_CHECK_SIZEOF([size_t]) # check for 64 bit support
AC_CHECK_SIZEOF([float])
# Checks for functions.
# the test for memcmp does not work well with C++
AC_LANG_PUSH([C])
AC_FUNC_MEMCMP
AC_LANG_POP([C])
#AC_FUNC_STRFTIME # FIXME
#AC_FUNC_VPRINTF # FIXME
# vsnprintf <stdarg.h> (C99)
AC_CHECK_FUNC([vsnprintf],
[],
[AC_MSG_ERROR([
*** This system does not provide the C99 vsnprintf() function which
*** is required to compile $PACKAGE_NAME. You should consider updating
*** your C library as it is too old. Alternatively you might install
*** a specific library implementing the (v)snprintf family of functions.
*** Searching the web should give you appropriate pointers.
***
*** In case you want to try compiling $PACKAGE_NAME while your system lacks
*** this function (meaning that compilation *will* fail unless you provide
*** a replacement function), try the --disable-vsnprintf-check option.
])
]
)
# getcwd or its equivalent with getenv <unistd.h>
AC_LANG_PUSH([C])
AC_CHECK_FUNCS([getcwd],
[],
[
AC_MSG_CHECKING([for working getenv("PWD")])
AC_RUN_IFELSE(
[
AC_LANG_SOURCE(
[#include <stdlib.h>
int main(void) { return (getenv("PWD") == NULL); }]
)
],
[AC_MSG_RESULT([yes])],
[
AC_MSG_RESULT([no])
AC_MSG_NOTICE([I/O restriction code will be disabled])
enable_io_restrictions="no"
],
[
AC_MSG_RESULT([cross-compiling])
AC_MSG_NOTICE([I/O restriction code will be disabled])
enable_io_restrictions="no"
]
)
]
)
AC_LANG_POP([C])
# readlink <unistd.h>
if test x"$enable_io_restrictions" != x"no"; then
AC_CHECK_FUNCS([readlink],
[],
[
AC_MSG_NOTICE([I/O restriction code will be disabled])
enable_io_restrictions="no"
]
)
fi
# nanosleep <time.h>
AC_CHECK_FUNCS([nanosleep])
# clock_gettime <time.h>
AC_CHECK_FUNCS([clock_gettime])
# getrusage <sys/resource.h>
AC_CHECK_FUNCS([getrusage])
# gettimeofday <sys/time.h>
AC_CHECK_FUNCS([gettimeofday])
# asinh and friends (requires libm)
AC_CHECK_FUNCS([asinh],
[],
[AC_DEFINE([NEED_INVHYP], [], [Inverse hyperbolic functions.])]
)
# support for non-IEEE compilers (requires libm)
if test x"$C99_COMPATIBLE_RADIOSITY" != x"" || test x"$ac_cv_sizeof_int" != x"4" || test x"$ac_cv_sizeof_float" != x"4"; then
AC_CHECK_FUNCS([copysign],
[],
[AC_MSG_ERROR([
*** Cannot find the 'copysign' function required for non-ieee platform
])]
)
if test x"$C99_COMPATIBLE_RADIOSITY" = x""; then # auto-detection
AC_CHECK_FUNCS([ilogbf],
[AC_DEFINE([C99_COMPATIBLE_RADIOSITY], [2], [See source/octree.cpp for details.])],
[AC_CHECK_FUNCS([ilogb],
[AC_DEFINE([C99_COMPATIBLE_RADIOSITY], [4], [See source/octree.cpp for details.])],
[AC_CHECK_FUNCS([logbf],
[AC_DEFINE([C99_COMPATIBLE_RADIOSITY], [1], [See source/octree.cpp for details.])],
[AC_CHECK_FUNCS([logb],
[AC_DEFINE([C99_COMPATIBLE_RADIOSITY], [3], [See source/octree.cpp for details.])],
[AC_MSG_ERROR([
*** Cannot find a 'logb' or equivalent function required for non-ieee platform
])]
)]
)]
)]
)
else # check value of C99_COMPATIBLE_RADIOSITY and function presence
case "$C99_COMPATIBLE_RADIOSITY" in
1) AC_CHECK_FUNCS([logbf], [], [AC_MSG_ERROR([logbf not found])]) ;;
2) AC_CHECK_FUNCS([ilogbf], [], [AC_MSG_ERROR([ilogbf not found])]) ;;
3) AC_CHECK_FUNCS([logb], [], [AC_MSG_ERROR([logb not found])]) ;;
4) AC_CHECK_FUNCS([ilogb], [], [AC_MSG_ERROR([ilogb not found])]) ;;
*) AC_MSG_ERROR([Unsupported C99_COMPATIBLE_RADIOSITY value]) ;;
esac
AC_DEFINE_UNQUOTED([C99_COMPATIBLE_RADIOSITY],
[$C99_COMPATIBLE_RADIOSITY],
[See source/octree.cpp for details.]
)
fi
fi
###############################################################################
AC_MSG_RESULT([
Compiling
---------])
# Start with no flags at all, so back them up first.
pov_save_cxxflags="$CXXFLAGS"
CXXFLAGS=
# Use pipes for communication between compilation stages.
AC_MSG_CHECKING([whether to enable pipes for communications])
if test x"$enable_pipe" = x"no"; then
AC_MSG_RESULT([no])
else
AC_MSG_RESULT([yes])
AX_TEST_COMPILER_FLAGS([-pipe])
fi
# Language.
# don't use -ansi since it can make compilation fail (e.g. on cygwin).
#AX_TEST_COMPILER_FLAGS([-ansi], [], [AX_TEST_COMPILER_FLAGS([-Aa])])
# -w would prevent all warning messages, even if -W... is given later on.
# we don't want to clutter the compiling with lots of warnings.
#AX_TEST_COMPILER_FLAGS([-W])
#AX_TEST_COMPILER_FLAGS([-Wall], [], [AX_TEST_COMPILER_FLAGS([-fullwarn])])
AX_TEST_COMPILER_FLAGS([-Wno-multichar])
AX_TEST_COMPILER_FLAGS([-Wno-write-strings])
if test x"$pov_compiler_vendor" = x"gnu"; then
AX_TEST_COMPILER_FLAGS([-fno-enforce-eh-specs])
AX_TEST_COMPILER_FLAGS([-Wno-non-template-friend])
fi
# I/O restrictions.
AC_MSG_CHECKING([whether to enable I/O restrictions])
if test x"$enable_io_restrictions" = x"no"; then
AC_MSG_RESULT([no])
AC_DEFINE([IO_RESTRICTIONS_DISABLED], [1], [I/O restrictions.])
else
AC_MSG_RESULT([yes])
AC_DEFINE([IO_RESTRICTIONS_DISABLED], [0], [I/O restrictions.])
fi
# Compile with debugging code.
AC_MSG_CHECKING([whether to enable debugging])
if test x"$enable_debug" = x"yes"; then
AC_MSG_RESULT([yes])
AX_TEST_COMPILER_FLAGS([-g], [], [AC_MSG_WARN([Cannot set debugging mode])])
AC_DEFINE([UNIX_DEBUG], [], [Unix-specific debug messages.])
else
AC_MSG_RESULT([no])
fi
# Compile for profiling.
AC_MSG_CHECKING([whether to enable profiling])
if test x"$enable_profile" = x"yes"; then
AC_MSG_RESULT([yes])
if test x"$ax_cv_prog_cxx_flags_g" = x""; then
AX_TEST_COMPILER_FLAGS([-g], [], [AC_MSG_WARN([Cannot set debugging mode])])
fi
AX_TEST_COMPILER_FLAGS([-pg], [], [AC_MSG_WARN([Cannot set profiling mode])])
else
AC_MSG_RESULT([no])
fi
# Strip object files.
AC_MSG_CHECKING([whether to enable stripping])
if test x"$enable_strip" = x"no"; then
AC_MSG_RESULT([no])
else
if test x"$enable_debug" = x"yes" || test x"$enable_profile" = x"yes"; then
AC_MSG_RESULT([no, debugging/profiling mode is on])
else
AC_MSG_RESULT([yes])
AX_TEST_COMPILER_FLAGS([-s], [], [AC_MSG_WARN([Cannot set stripping mode])])
fi
fi
# Compile with optimizations.
AC_MSG_CHECKING([whether to enable optimizations])
if test x"$enable_optimiz" != x"no"; then
AC_MSG_RESULT([yes])
# don't try -fast (makes ICC fail when linking due to implied -ipo flag).
AX_TEST_COMPILER_FLAGS([-O3], [], [AX_TEST_COMPILER_FLAGS([-O2], [], [AX_TEST_COMPILER_FLAGS([-O])])])
# compiler-specific flags.
case "$pov_compiler_vendor" in
gnu)
if test x"$ax_cv_prog_cxx_flags_O" = x"yes"; then # -O was set
for pov_flags in "-fexpensive-optimizations" "-finline-functions" "-foptimize-sibling-calls"
do
AX_TEST_COMPILER_FLAGS([$pov_flags])
done
elif test x"$ax_cv_prog_cxx_flags_O2" = x"yes"; then # -O2 was set
AX_TEST_COMPILER_FLAGS([-finline-functions])
fi
AX_TEST_COMPILER_FLAGS([-ffast-math])
;;
intel)
AX_TEST_COMPILER_FLAGS([-ip])
;;
esac
# Arch-specific tuning, alphabetically ordered for conveniency.
# Perform checks only when not cross-compiling.
AC_MSG_CHECKING([whether to enable architecture-specific optimizations])
if test x"$cross_compiling" != x"no"; then
AC_MSG_RESULT([no, cross-compiling])
pov_built_for="$pov_built_for (cross-compiled)"
elif test x"$enable_optimiz_arch" != x"no"; then
AC_MSG_RESULT([yes])
case "$build" in
alphaev*6*)
### Suggested by Christopher Endsley <endsley@yokuts.csustan.edu>
for pov_flags in "-mcpu=ev56" "-mno-soft-float"
do
AX_TEST_COMPILER_FLAGS([$pov_flags])
done
case "$CXXFLAGS" in
*-mcpu=ev56*) pov_built_for="$pov_built_for | DEC Alpha EV5 with BWX extensions" ;;
esac
;;
i?86-* | k?-* | *86*64*)
case "$build" in
i?86-* | k?-*) AX_TEST_COMPILER_FLAGS([-malign-double]);;
esac
AX_TEST_COMPILER_FLAGS([-xHost], # ICC >= 11.0
[pov_built_for="$pov_built_for (using -xHost)"],
[AX_TEST_COMPILER_FLAGS([-march=native], # GCC >= 4.2
[pov_built_for="$pov_built_for (using -march=native)"],
[AC_MSG_CHECKING([processor type])
AX_X86_ARCH
AC_MSG_RESULT([$ax_x86_cpumodel_nofreq])
AC_MSG_CHECKING([whether SSE instruction sets are supported])
test x"$ax_x86_cpuflags_SSE_list" = x"" && ax_x86_cpuflags_SSE_list=no
AC_MSG_RESULT([$ax_x86_cpuflags_SSE_list])
if test x"$ax_x86_arch" != x"unknown"; then
if test x"$pov_compiler_vendor" = x"intel"; then
case "$ax_x86_arch" in
core2)
AX_TEST_COMPILER_FLAGS([-xT]) ;;
prescott|pentium4) # Prescott, Northwood, Willamette
AX_TEST_COMPILER_FLAGS([-xP], [], [AX_TEST_COMPILER_FLAGS([-xN], [], [AX_TEST_COMPILER_FLAGS([-xW])])]) ;;
#pentium-m) # Banias; option deprecated in ICC >= 10.0
# AX_TEST_COMPILER_FLAGS([-xB]) ;;
pentium3)
AX_TEST_COMPILER_FLAGS([-xK]) ;;
pentium2)
AX_TEST_COMPILER_FLAGS([-march=pentiumii]) ;;
esac
else
AX_TEST_COMPILER_FLAGS([-march=$ax_x86_arch],
[],
[
if test x"$ax_x86_arch_fallback" != x""; then
AX_TEST_COMPILER_FLAGS([-march=$ax_x86_arch_fallback], [ax_x86_arch=$ax_x86_arch_fallback], [ax_x86_arch=])
fi
]
)
if test x"$pov_compiler_vendor" = x"gnu"; then
for sse_flag in $ax_x86_cpuflags_SSE_list
do
sse_flag=`echo $sse_flag | tr A-Z a-z`
AX_TEST_COMPILER_FLAGS([-m$sse_flag])
done
case "$ax_x86_cpuflags_SSE_list" in
*SSE2*|*SSE3*|*SSSE3*|*SSE4*) AX_TEST_COMPILER_FLAGS([-mfpmath=sse]);; # -march or -msse required
esac
fi
fi
else
ax_x86_arch=
fi
if test x"$ax_x86_arch" != x""; then
pov_built_for="$pov_built_for | $ax_x86_cpumodel_nofreq"
fi
])])
;;
*irix*)
AX_TEST_COMPILER_FLAGS([-mips4],
[pov_built_for="$pov_built_for | MIPS 4"],
[AX_TEST_COMPILER_FLAGS([-mips2], [pov_built_for="$pov_built_for | MIPS 2"])]
)
;;
powerpc*)
### Suggested by Thorsten Froehlich <thorsten@trf.de> :
# Note that the different parameters for mcpu and mtune are intentional:
# The PPC 7450 processor has a much longer pipeline and thus scheduling
# for that pipeline always yields good results even on processors with
# a shorter pipeline. On the other hand, most PowerPC processors only
# support the instructions also found in the PPC 750 processor (aka G3).
# That is why it is selected in the mcpu parameter. Using 7450 (aka G4+)
# in mcpu would make the code incompatible with anything prior to the
# PPC 7400 (aka G4). To be precise, the vector instructions are new
# in the four digit model number PowerPC processors (aka G4), but gcc
# cannot (as of February 2003) use them automatically anyway! [trf]
#
# 2007-01-24 after gentoo patch for powerpc64 (http://bugs.gentoo.org/show_bug.cgi?id=118156)
if "$build" != powerpc64* ; then
for pov_flags in "-mpowerpc" "-mcpu=750 -mtune=7450"
do
AX_TEST_COMPILER_FLAGS([$pov_flags])
done
case "$CXXFLAGS" in
*-mcpu=750*) pov_built_for="$pov_built_for | PowerPC G3/G4" ;;
*) pov_built_for="$pov_built_for | PowerPC" ;;
esac
else
pov_built_for="$pov_built_for | PowerPC G5"
fi
for pov_flags in "-mmultiple" "-mstring" "-mfused-madd"
do
AX_TEST_COMPILER_FLAGS([$pov_flags])
done
;;
sparc-*)
# Commented out for now.
#AX_TEST_COMPILER_FLAGS([-march=ultrasparc])
#AX_TEST_COMPILER_FLAGS([-mvis])
;;
esac
AC_MSG_CHECKING([which architecture to optimize for])
AC_MSG_RESULT([$pov_built_for])
else
AC_MSG_RESULT([no]) # no arch-specific optimizations
fi
else
AC_MSG_RESULT([no]) # no optimizations
fi
AC_DEFINE_UNQUOTED([BUILT_FOR], ["$pov_built_for"], [Host platform.])
# Add flags specified at the command line.
CXXFLAGS=`echo $CXXFLAGS $pov_save_cxxflags`
AC_DEFINE_UNQUOTED([CXXFLAGS], ["$CXXFLAGS"], [Compiler flags.])
###############################################################################
AC_MSG_RESULT([
Makefiles
---------])
AC_CONFIG_FILES([\
Makefile \
source/Makefile \
vfe/Makefile \
unix/Makefile \
])
###############################################################################
if test x"$enable_io_restrictions" = x"no"; then
pov_io_msg="disabled"
else
pov_io_msg="enabled"
fi
# image format support
pov_img_fmt_builtin="gif tga iff ppm pgm hdr"
for format in png jpeg tiff openexr
do
eval fmt=\$pov_lib$format
if test x"$fmt" != x""; then
pov_img_fmt_enabled="$pov_img_fmt_enabled $format"
else
pov_img_fmt_disabled="$pov_img_fmt_disabled $format"
fi
done
pov_img_fmt_enabled=`echo $pov_img_fmt_enabled`
pov_img_fmt_disabled=`echo $pov_img_fmt_disabled`
test x"$pov_img_fmt_disabled" = x"" && pov_img_fmt_disabled="-"
AC_DEFINE_UNQUOTED([BUILTIN_IO_RESTRICTIONS], ["$pov_io_msg"], [I/O restrictions.])
AC_DEFINE_UNQUOTED([BUILTIN_XWIN_DISPLAY], ["$pov_xwin_msg"], [X Window display.])
AC_DEFINE_UNQUOTED([BUILTIN_IMG_FORMATS], ["$pov_img_fmt_builtin $pov_img_fmt_enabled"], [Supported image formats.])
AC_DEFINE_UNQUOTED([MISSING_IMG_FORMATS], ["$pov_img_fmt_disabled"], [Unsupported image formats.])
povowner=`stat --format=%u ${HOME} || stat -f %u ${HOME}`
povgroup=`stat --format=%g ${HOME} || stat -f %g ${HOME}`
AC_SUBST([povowner])
AC_SUBST([povgroup])
AC_OUTPUT
###############################################################################
# recursively expand the following variables for displaying
for i in bindir sysconfdir datadir mandir
do
eval povtemp=\$$i
while test x"$povtemp" != x"$oldpovtemp"
do
oldpovtemp=$povtemp
eval povtemp=$povtemp
done
eval pov$i=$povtemp
done
AC_MSG_RESULT([
===============================================================================
$PACKAGE_NAME $PACKAGE_VERSION has been configured.
])
if test x"$pov_no_distrib" = x"yes"; then
AC_MSG_WARN([the resulting binary is NOT REDISTRIBUTABLE.
])
fi
if test x"$pov_warn_path" != x""; then
AC_MSG_WARN(
[configure has detected that the list of search paths
specified by the following environment variable(s)
$pov_warn_path
erroneously contain the "." directory, which may cause a build failure.
In order to build POV-Ray successfully, the package has been configured
with all "." directory entries removed from the variables above. You're
strongly advised to correct your configuration accordingly.
])
fi
AC_MSG_RESULT([Built-in features:
I/O restrictions: ${pov_io_msg}
X Window display: ${pov_xwin_msg}
Supported image formats: $pov_img_fmt_builtin $pov_img_fmt_enabled
Unsupported image formats: $pov_img_fmt_disabled
Compilation settings:
Build architecture: $build
Built/Optimized for: $pov_built_for
Compiler vendor: $pov_compiler_vendor
Compiler version: $pov_compiler_version
Compiler flags: $CXXFLAGS
Type 'make check' to build the program and run a test render.
Type 'make install' to install $PACKAGE_NAME on your system.
The $PACKAGE_NAME components will be installed in the following directories:
Program (executable): ${povbindir}
System configuration files: ${povsysconfdir}/$PACKAGE/$VERSION_BASE
User configuration files: ${HOME}/.$PACKAGE/$VERSION_BASE
Standard include files: ${povdatadir}/$PACKAGE-$VERSION_BASE/include
Standard INI files: ${povdatadir}/$PACKAGE-$VERSION_BASE/ini
Standard demo scene files: ${povdatadir}/$PACKAGE-$VERSION_BASE/scenes
Documentation (text, HTML): ${povdatadir}/doc/$PACKAGE-$VERSION_BASE
Unix man page: ${povmandir}
===============================================================================
])
|