Autogenerated stuff
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 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133
diff --git a/unix/acinclude.m4 b/unix/acinclude.m4
index 6d3a67c..fd6f2ed 100644
--- a/unix/acinclude.m4
+++ b/unix/acinclude.m4
@@ -144,14 +144,63 @@ dnl Check for OpenGL development environment and GLU >= 1.2
dnl
AC_DEFUN([FTGL_CHECK_GL],
[dnl
-AC_CHECK_HEADER([GL/gl.h])
-AC_CHECK_LIB(GL, [glBegin], [],
- [AC_MSG_NOTICE([GL not found in the compiler's path, looking in the X11 tree])
- unset ac_cv_lib_GL_glBegin
- LDFLAGS="-L${x_libraries} $LDFLAGS"
- AC_CHECK_LIB(GL, [glBegin], [],
- [AC_MSG_ERROR([libGL is required to compile this library])])
- ])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PATH_X])
+AC_REQUIRE([AC_PATH_XTRA])
+
+AC_ARG_WITH([--with-gl-inc],
+ AC_HELP_STRING([--with-gl-inc=DIR],[Directory where GL/gl.h is installed]))
+AC_ARG_WITH([--with-gl-lib],
+ AC_HELP_STRING([--with-gl-lib=DIR],[Directory where OpenGL libraries are installed]))
+
+AC_LANG_SAVE
+AC_LANG_C
+
+GL_SAVE_CPPFLAGS="$CPPFLAGS"
+GL_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GL_CFLAGS="$X_CFLAGS"
+ GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_gl_inc" != "xnone" ; then
+ if test -d "$with_gl_inc" ; then
+ GL_CFLAGS="-I$with_gl_inc"
+ else
+ GL_CFLAGS="$with_gl_inc"
+ fi
+else
+ GL_CFLAGS=
+fi
+
+CPPFLAGS="$GL_CFLAGS"
+AC_CHECK_HEADER([GL/gl.h], [], [AC_MSG_ERROR(GL/gl.h is needed, please specify its location with --with-gl-inc. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.)])
+
+AC_MSG_CHECKING([for GL library])
+if test "x$with_gl_lib" != "x" ; then
+ if test -d "$with_gl_lib" ; then
+ LIBS="-L$with_gl_lib -lGL"
+ else
+ LIBS="$with_gl_lib"
+ fi
+else
+ LIBS="-lGL"
+fi
+AC_LINK_IFELSE([AC_LANG_CALL([],[glBegin])],[HAVE_GL=yes], [HAVE_GL=no])
+if test "x$HAVE_GL" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGL $GL_X_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[glBegin])],[HAVE_GL=yes], [HAVE_GL=no])
+ fi
+fi
+if test "x$HAVE_GL" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GL_LIBS=$LIBS
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([GL library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.])
+fi
AC_CHECK_HEADER([GL/glu.h])
AC_MSG_CHECKING([for GLU version >= 1.2])
@@ -164,31 +213,129 @@ AC_TRY_COMPILE([#include <GL/glu.h>], [
[AC_MSG_RESULT([no])
AC_MSG_ERROR([GLU >= 1.2 is needed to compile this library])
])
-AC_CHECK_LIB(GLU, [gluNewTess],
- [], [AC_MSG_ERROR([libGLU is required to compile this library])])
+
+AC_MSG_CHECKING([for GLU library])
+LIBS="-lGLU $GL_LIBS"
+AC_LINK_IFELSE([AC_LANG_CALL([],[gluNewTess])],[HAVE_GLU=yes], [HAVE_GLU=no])
+if test "x$HAVE_GLU" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGLU $GL_LIBS $GL_X_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[gluNewTess])],[HAVE_GLU=yes], [HAVE_GLU=no])
+ fi
+fi
+if test "x$HAVE_GLU" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GL_LIBS="$LIBS"
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([GLU library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.])
+fi
+
+AC_SUBST(GL_CFLAGS)
+AC_SUBST(GL_LIBS)
+
+CPPFLAGS="$GL_SAVE_CPPFLAGS"
+LIBS="$GL_SAVE_LIBS"
+AC_LANG_RESTORE
+GL_X_LIBS=""
])
dnl FTGL_CHECK_GLUT()
dnl Check for GLUT development environment
dnl
AC_DEFUN([FTGL_CHECK_GLUT],
[dnl
-AC_CHECK_HEADER([GL/glut.h])
-AC_CHECK_LIB(glut, [glutInit],
- [LIBGLUT=-lglut],
- [])
-
-# Work-arround for broken dynamic linkers and/or systems with non-broken
-# linkers but suffering from PEBKAC. The list of libraries is a bit
-# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
-
-if test -z "${LIBGLUT}" ; then
- echo "Couldn't find GLUT, trying again with extra linker flags"
- unset ac_cv_lib_glut_glutInit
- AC_CHECK_LIB(glut, [glutInit],
- [LIBGLUT=-lglut],
- AC_MSG_ERROR([libglut is required to compile this library]),
- [-lX11 -lXmu -lXi -lm])
- LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PATH_X])dnl
+AC_REQUIRE([AC_PATH_XTRA])dnl
+AC_REQUIRE([FTGL_CHECK_GL])dnl
+
+AC_ARG_WITH([--with-glut-inc],
+ AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)]))
+AC_ARG_WITH([--with-glut-lib],
+ AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)]))
+
+AC_LANG_SAVE
+AC_LANG_C
+
+GLUT_SAVE_CPPFLAGS="$CPPFLAGS"
+GLUT_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GLUT_CFLAGS="$X_CFLAGS"
+ GLUT_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_glut_inc" != "xnone" ; then
+ if test -d "$with_glut_inc" ; then
+ GLUT_CFLAGS="-I$with_glut_inc"
+ else
+ GLUT_CFLAGS="$with_glut_inc"
+ fi
+else
+ GLUT_CFLAGS=
fi
-AC_SUBST(LIBGLUT)
+
+CPPFLAGS="$GLUT_CFLAGS"
+AC_CHECK_HEADER([GL/glut.h], [HAVE_GLUT=yes], [HAVE_GLUT=no])
+
+if test "x$HAVE_GLUT" = xno ; then
+ AC_MSG_WARN([GLUT headers not availabe, example program won't be compiled.])
+else
+
+# Check for GLUT libraries
+
+ AC_MSG_CHECKING([for GLUT library])
+ if test "x$with_glut_lib" != "x" ; then
+ if test -d "$with_glut_lib" ; then
+ LIBS="-L$with_glut_lib -lglut"
+ else
+ LIBS="$with_glut_lib"
+ fi
+ else
+ LIBS="-lglut"
+ fi
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+
+ if test "x$HAVE_GLUT" = xno ; then
+ # Try again with the GL libs
+ LIBS="-lglut $GL_LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+ fi
+
+ if test "x$HAVE_GLUT" = xno && test "x$GLUT_X_LIBS" != x ; then
+ # Try again with the GL and X11 libs
+ LIBS="-lglut $GL_LIBS $GLUT_X_LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+ fi
+
+ if test "x$HAVE_GLUT" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GLUT_LIBS=$LIBS
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([GLUT libraries not availabe, example program won't be compiled.])
+ fi
+
+# End check for GLUT libraries
+
+fi
+
+AC_SUBST(HAVE_GLUT)
+AC_SUBST(GLUT_CFLAGS)
+AC_SUBST(GLUT_LIBS)
+AC_LANG_RESTORE
+
+CPPFLAGS="$GLUT_SAVE_CPPFLAGS"
+LIBS="$GLUT_SAVE_LIBS"
+GLUT_X_CFLAGS=
+GLUT_X_LIBS=
])
diff --git a/unix/aclocal.m4 b/unix/aclocal.m4
index 5be7bff..8a66b64 100644
--- a/unix/aclocal.m4
+++ b/unix/aclocal.m4
@@ -156,14 +156,63 @@ dnl Check for OpenGL development environment and GLU >= 1.2
dnl
AC_DEFUN([FTGL_CHECK_GL],
[dnl
-AC_CHECK_HEADER([GL/gl.h])
-AC_CHECK_LIB(GL, [glBegin], [],
- [AC_MSG_NOTICE([GL not found in the compiler's path, looking in the X11 tree])
- unset ac_cv_lib_GL_glBegin
- LDFLAGS="-L${x_libraries} $LDFLAGS"
- AC_CHECK_LIB(GL, [glBegin], [],
- [AC_MSG_ERROR([libGL is required to compile this library])])
- ])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PATH_X])
+AC_REQUIRE([AC_PATH_XTRA])
+
+AC_ARG_WITH([--with-gl-inc],
+ AC_HELP_STRING([--with-gl-inc=DIR],[Directory where GL/gl.h is installed]))
+AC_ARG_WITH([--with-gl-lib],
+ AC_HELP_STRING([--with-gl-lib=DIR],[Directory where OpenGL libraries are installed]))
+
+AC_LANG_SAVE
+AC_LANG_C
+
+GL_SAVE_CPPFLAGS="$CPPFLAGS"
+GL_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GL_CFLAGS="$X_CFLAGS"
+ GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_gl_inc" != "xnone" ; then
+ if test -d "$with_gl_inc" ; then
+ GL_CFLAGS="-I$with_gl_inc"
+ else
+ GL_CFLAGS="$with_gl_inc"
+ fi
+else
+ GL_CFLAGS=
+fi
+
+CPPFLAGS="$GL_CFLAGS"
+AC_CHECK_HEADER([GL/gl.h], [], [AC_MSG_ERROR(GL/gl.h is needed, please specify its location with --with-gl-inc. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.)])
+
+AC_MSG_CHECKING([for GL library])
+if test "x$with_gl_lib" != "x" ; then
+ if test -d "$with_gl_lib" ; then
+ LIBS="-L$with_gl_lib -lGL"
+ else
+ LIBS="$with_gl_lib"
+ fi
+else
+ LIBS="-lGL"
+fi
+AC_LINK_IFELSE([AC_LANG_CALL([],[glBegin])],[HAVE_GL=yes], [HAVE_GL=no])
+if test "x$HAVE_GL" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGL $GL_X_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[glBegin])],[HAVE_GL=yes], [HAVE_GL=no])
+ fi
+fi
+if test "x$HAVE_GL" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GL_LIBS=$LIBS
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([GL library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.])
+fi
AC_CHECK_HEADER([GL/glu.h])
AC_MSG_CHECKING([for GLU version >= 1.2])
@@ -176,33 +225,131 @@ AC_TRY_COMPILE([#include <GL/glu.h>], [
[AC_MSG_RESULT([no])
AC_MSG_ERROR([GLU >= 1.2 is needed to compile this library])
])
-AC_CHECK_LIB(GLU, [gluNewTess],
- [], [AC_MSG_ERROR([libGLU is required to compile this library])])
+
+AC_MSG_CHECKING([for GLU library])
+LIBS="-lGLU $GL_LIBS"
+AC_LINK_IFELSE([AC_LANG_CALL([],[gluNewTess])],[HAVE_GLU=yes], [HAVE_GLU=no])
+if test "x$HAVE_GLU" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGLU $GL_LIBS $GL_X_LIBS"
+ AC_LINK_IFELSE([AC_LANG_CALL([],[gluNewTess])],[HAVE_GLU=yes], [HAVE_GLU=no])
+ fi
+fi
+if test "x$HAVE_GLU" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GL_LIBS="$LIBS"
+else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([GLU library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind.])
+fi
+
+AC_SUBST(GL_CFLAGS)
+AC_SUBST(GL_LIBS)
+
+CPPFLAGS="$GL_SAVE_CPPFLAGS"
+LIBS="$GL_SAVE_LIBS"
+AC_LANG_RESTORE
+GL_X_LIBS=""
])
dnl FTGL_CHECK_GLUT()
dnl Check for GLUT development environment
dnl
AC_DEFUN([FTGL_CHECK_GLUT],
[dnl
-AC_CHECK_HEADER([GL/glut.h])
-AC_CHECK_LIB(glut, [glutInit],
- [LIBGLUT=-lglut],
- [])
-
-# Work-arround for broken dynamic linkers and/or systems with non-broken
-# linkers but suffering from PEBKAC. The list of libraries is a bit
-# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
-
-if test -z "${LIBGLUT}" ; then
- echo "Couldn't find GLUT, trying again with extra linker flags"
- unset ac_cv_lib_glut_glutInit
- AC_CHECK_LIB(glut, [glutInit],
- [LIBGLUT=-lglut],
- AC_MSG_ERROR([libglut is required to compile this library]),
- [-lX11 -lXmu -lXi -lm])
- LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PATH_X])dnl
+AC_REQUIRE([AC_PATH_XTRA])dnl
+AC_REQUIRE([FTGL_CHECK_GL])dnl
+
+AC_ARG_WITH([--with-glut-inc],
+ AC_HELP_STRING([--with-glut-inc=DIR],[Directory where GL/glut.h is installed (optional)]))
+AC_ARG_WITH([--with-glut-lib],
+ AC_HELP_STRING([--with-glut-lib=DIR],[Directory where GLUT libraries are installed (optional)]))
+
+AC_LANG_SAVE
+AC_LANG_C
+
+GLUT_SAVE_CPPFLAGS="$CPPFLAGS"
+GLUT_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GLUT_CFLAGS="$X_CFLAGS"
+ GLUT_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_glut_inc" != "xnone" ; then
+ if test -d "$with_glut_inc" ; then
+ GLUT_CFLAGS="-I$with_glut_inc"
+ else
+ GLUT_CFLAGS="$with_glut_inc"
+ fi
+else
+ GLUT_CFLAGS=
+fi
+
+CPPFLAGS="$GLUT_CFLAGS"
+AC_CHECK_HEADER([GL/glut.h], [HAVE_GLUT=yes], [HAVE_GLUT=no])
+
+if test "x$HAVE_GLUT" = xno ; then
+ AC_MSG_WARN([GLUT headers not availabe, example program won't be compiled.])
+else
+
+# Check for GLUT libraries
+
+ AC_MSG_CHECKING([for GLUT library])
+ if test "x$with_glut_lib" != "x" ; then
+ if test -d "$with_glut_lib" ; then
+ LIBS="-L$with_glut_lib -lglut"
+ else
+ LIBS="$with_glut_lib"
+ fi
+ else
+ LIBS="-lglut"
+ fi
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+
+ if test "x$HAVE_GLUT" = xno ; then
+ # Try again with the GL libs
+ LIBS="-lglut $GL_LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+ fi
+
+ if test "x$HAVE_GLUT" = xno && test "x$GLUT_X_LIBS" != x ; then
+ # Try again with the GL and X11 libs
+ LIBS="-lglut $GL_LIBS $GLUT_X_LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_CALL([],[glutInit])],
+ [HAVE_GLUT=yes],
+ [HAVE_GLUT=no])
+ fi
+
+ if test "x$HAVE_GLUT" = xyes ; then
+ AC_MSG_RESULT([yes])
+ GLUT_LIBS=$LIBS
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([GLUT libraries not availabe, example program won't be compiled.])
+ fi
+
+# End check for GLUT libraries
+
fi
-AC_SUBST(LIBGLUT)
+
+AC_SUBST(HAVE_GLUT)
+AC_SUBST(GLUT_CFLAGS)
+AC_SUBST(GLUT_LIBS)
+AC_LANG_RESTORE
+
+CPPFLAGS="$GLUT_SAVE_CPPFLAGS"
+LIBS="$GLUT_SAVE_LIBS"
+GLUT_X_CFLAGS=
+GLUT_X_LIBS=
])
# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
diff --git a/unix/configure b/unix/configure
index 1d8fc6a..6802112 100755
--- a/unix/configure
+++ b/unix/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57 for ftgl 1.4.
+# Generated by GNU Autoconf 2.57 for ftgl 2.0.5.
#
# Report bugs to <henryj@paradise.net.nz>.
#
@@ -427,8 +427,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='ftgl'
PACKAGE_TARNAME='ftgl'
-PACKAGE_VERSION='1.4'
-PACKAGE_STRING='ftgl 1.4'
+PACKAGE_VERSION='2.0.5'
+PACKAGE_STRING='ftgl 2.0.5'
PACKAGE_BUGREPORT='henryj@paradise.net.nz'
ac_unique_file="Make.conf.in"
@@ -469,7 +469,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP EGREP LIBTOOL FT2_CONFIG FT2_CFLAGS FT2_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LIBGLUT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOXYGEN LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT CC CFLAGS ac_ct_CC LN_S ECHO RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP CPP EGREP LIBTOOL FT2_CONFIG FT2_CFLAGS FT2_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS GL_CFLAGS GL_LIBS HAVE_GLUT GLUT_CFLAGS GLUT_LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA DOXYGEN LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -946,7 +946,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ftgl 1.4 to adapt to many kinds of systems.
+\`configure' configures ftgl 2.0.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1011,7 +1011,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ftgl 1.4:";;
+ short | recursive ) echo "Configuration of ftgl 2.0.5:";;
esac
cat <<\_ACEOF
@@ -1032,6 +1032,11 @@ Optional Packages:
--with-x use the X Window System
--with-ft-prefix=PFX Prefix where FreeType is installed (optional)
--with-ft-exec-prefix=PFX Exec prefix where FreeType is installed (optional)
+ --with-gl-inc=DIR Directory where GL/gl.h is installed
+ --with-gl-lib=DIR Directory where OpenGL libraries are installed
+ --with-glut-inc=DIR Directory where GL/glut.h is installed (optional)
+ --with-glut-lib=DIR Directory where GLUT libraries are installed
+ (optional)
Some influential environment variables:
CXX C++ compiler command
@@ -1110,7 +1115,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-ftgl configure 1.4
+ftgl configure 2.0.5
generated by GNU Autoconf 2.57
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
@@ -1125,7 +1130,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ftgl $as_me 1.4, which was
+It was created by ftgl $as_me 2.0.5, which was
generated by GNU Autoconf 2.57. Invocation command line was
$ $0 $@
@@ -4401,7 +4406,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4404 "configure"' > conftest.$ac_ext
+ echo '#line 4409 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4930,7 +4935,7 @@ chmod -w .
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
-if { (eval echo configure:4933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:4938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s out/conftest.err; then
@@ -6775,7 +6780,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6778 "configure"
+#line 6783 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -6873,7 +6878,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6876 "configure"
+#line 6881 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9291,6 +9296,51 @@ fi
fi
+
+
+
+
+
+# Check whether --with---with-gl-inc or --without---with-gl-inc was given.
+if test "${with___with_gl_inc+set}" = set; then
+ withval="$with___with_gl_inc"
+
+fi;
+
+# Check whether --with---with-gl-lib or --without---with-gl-lib was given.
+if test "${with___with_gl_lib+set}" = set; then
+ withval="$with___with_gl_lib"
+
+fi;
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+GL_SAVE_CPPFLAGS="$CPPFLAGS"
+GL_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GL_CFLAGS="$X_CFLAGS"
+ GL_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_gl_inc" != "xnone" ; then
+ if test -d "$with_gl_inc" ; then
+ GL_CFLAGS="-I$with_gl_inc"
+ else
+ GL_CFLAGS="$with_gl_inc"
+ fi
+else
+ GL_CFLAGS=
+fi
+
+CPPFLAGS="$GL_CFLAGS"
if test "${ac_cv_header_GL_gl_h+set}" = set; then
echo "$as_me:$LINENO: checking for GL/gl.h" >&5
echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6
@@ -9420,16 +9470,27 @@ echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5
echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6
fi
+if test $ac_cv_header_GL_gl_h = yes; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: GL/gl.h is needed" >&5
+echo "$as_me: error: GL/gl.h is needed" >&2;}
+ { (exit please specify its location with --with-gl-inc. If this still fails); exit please specify its location with --with-gl-inc. If this still fails; }; }
+fi
-echo "$as_me:$LINENO: checking for glBegin in -lGL" >&5
-echo $ECHO_N "checking for glBegin in -lGL... $ECHO_C" >&6
-if test "${ac_cv_lib_GL_glBegin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for GL library" >&5
+echo $ECHO_N "checking for GL library... $ECHO_C" >&6
+if test "x$with_gl_lib" != "x" ; then
+ if test -d "$with_gl_lib" ; then
+ LIBS="-L$with_gl_lib -lGL"
+ else
+ LIBS="$with_gl_lib"
+ fi
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL $LIBS"
+ LIBS="-lGL"
+fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
@@ -9465,39 +9526,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_GL_glBegin=yes
+ HAVE_GL=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_GL_glBegin=no
+HAVE_GL=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glBegin" >&5
-echo "${ECHO_T}$ac_cv_lib_GL_glBegin" >&6
-if test $ac_cv_lib_GL_glBegin = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGL 1
-_ACEOF
-
- LIBS="-lGL $LIBS"
-
-else
- { echo "$as_me:$LINENO: GL not found in the compiler's path, looking in the X11 tree" >&5
-echo "$as_me: GL not found in the compiler's path, looking in the X11 tree" >&6;}
- unset ac_cv_lib_GL_glBegin
- LDFLAGS="-L${x_libraries} $LDFLAGS"
-
-echo "$as_me:$LINENO: checking for glBegin in -lGL" >&5
-echo $ECHO_N "checking for glBegin in -lGL... $ECHO_C" >&6
-if test "${ac_cv_lib_GL_glBegin+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGL $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+if test "x$HAVE_GL" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGL $GL_X_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
@@ -9532,35 +9572,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_GL_glBegin=yes
+ HAVE_GL=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_GL_glBegin=no
+HAVE_GL=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glBegin" >&5
-echo "${ECHO_T}$ac_cv_lib_GL_glBegin" >&6
-if test $ac_cv_lib_GL_glBegin = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGL 1
-_ACEOF
-
- LIBS="-lGL $LIBS"
-
+if test "x$HAVE_GL" = xyes ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ GL_LIBS=$LIBS
else
- { { echo "$as_me:$LINENO: error: libGL is required to compile this library" >&5
-echo "$as_me: error: libGL is required to compile this library" >&2;}
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ { { echo "$as_me:$LINENO: error: GL library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind." >&5
+echo "$as_me: error: GL library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind." >&2;}
{ (exit 1); exit 1; }; }
fi
-
-fi
-
-
if test "${ac_cv_header_GL_glu_h+set}" = set; then
echo "$as_me:$LINENO: checking for GL/glu.h" >&5
echo $ECHO_N "checking for GL/glu.h... $ECHO_C" >&6
@@ -9741,13 +9774,9 @@ echo "$as_me: error: GLU >= 1.2 is needed to compile this library" >&2;}
fi
rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: checking for gluNewTess in -lGLU" >&5
-echo $ECHO_N "checking for gluNewTess in -lGLU... $ECHO_C" >&6
-if test "${ac_cv_lib_GLU_gluNewTess+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lGLU $LIBS"
+echo "$as_me:$LINENO: checking for GLU library" >&5
+echo $ECHO_N "checking for GLU library... $ECHO_C" >&6
+LIBS="-lGLU $GL_LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
@@ -9783,32 +9812,129 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_GLU_gluNewTess=yes
+ HAVE_GLU=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_GLU_gluNewTess=no
+HAVE_GLU=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_gluNewTess" >&5
-echo "${ECHO_T}$ac_cv_lib_GLU_gluNewTess" >&6
-if test $ac_cv_lib_GLU_gluNewTess = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGLU 1
+if test "x$HAVE_GLU" = xno ; then
+ if test "x$GL_X_LIBS" != x ; then
+ LIBS="-lGLU $GL_LIBS $GL_X_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- LIBS="-lGLU $LIBS"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gluNewTess ();
+int
+main ()
+{
+gluNewTess ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ HAVE_GLU=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+HAVE_GLU=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+fi
+if test "x$HAVE_GLU" = xyes ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ GL_LIBS="$LIBS"
else
- { { echo "$as_me:$LINENO: error: libGLU is required to compile this library" >&5
-echo "$as_me: error: libGLU is required to compile this library" >&2;}
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ { { echo "$as_me:$LINENO: error: GLU library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind." >&5
+echo "$as_me: error: GLU library could not be found, please specify its location with --with-gl-lib. If this still fails, please contact mmagallo@debian.org, include the string FTGL somewhere in the subject line and provide a copy of the config.log file that was left behind." >&2;}
{ (exit 1); exit 1; }; }
fi
+
+
+CPPFLAGS="$GL_SAVE_CPPFLAGS"
+LIBS="$GL_SAVE_LIBS"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+GL_X_LIBS=""
+
+
+
+# Check whether --with---with-glut-inc or --without---with-glut-inc was given.
+if test "${with___with_glut_inc+set}" = set; then
+ withval="$with___with_glut_inc"
+
+fi;
+
+# Check whether --with---with-glut-lib or --without---with-glut-lib was given.
+if test "${with___with_glut_lib+set}" = set; then
+ withval="$with___with_glut_lib"
+
+fi;
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+GLUT_SAVE_CPPFLAGS="$CPPFLAGS"
+GLUT_SAVE_LIBS="$LIBS"
+
+if test "x$no_x" != xyes ; then
+ GLUT_CFLAGS="$X_CFLAGS"
+ GLUT_X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext -lXmu $X_EXTRA_LIBS"
+fi
+
+if test "x$with_glut_inc" != "xnone" ; then
+ if test -d "$with_glut_inc" ; then
+ GLUT_CFLAGS="-I$with_glut_inc"
+ else
+ GLUT_CFLAGS="$with_glut_inc"
+ fi
+else
+ GLUT_CFLAGS=
+fi
+
+CPPFLAGS="$GLUT_CFLAGS"
if test "${ac_cv_header_GL_glut_h+set}" = set; then
echo "$as_me:$LINENO: checking for GL/glut.h" >&5
echo $ECHO_N "checking for GL/glut.h... $ECHO_C" >&6
@@ -9938,16 +10064,33 @@ echo "$as_me:$LINENO: result: $ac_cv_header_GL_glut_h" >&5
echo "${ECHO_T}$ac_cv_header_GL_glut_h" >&6
fi
+if test $ac_cv_header_GL_glut_h = yes; then
+ HAVE_GLUT=yes
+else
+ HAVE_GLUT=no
+fi
-echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5
-echo $ECHO_N "checking for glutInit in -lglut... $ECHO_C" >&6
-if test "${ac_cv_lib_glut_glutInit+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
+
+if test "x$HAVE_GLUT" = xno ; then
+ { echo "$as_me:$LINENO: WARNING: GLUT headers not availabe, example program won't be compiled." >&5
+echo "$as_me: WARNING: GLUT headers not availabe, example program won't be compiled." >&2;}
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lglut $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+
+# Check for GLUT libraries
+
+ echo "$as_me:$LINENO: checking for GLUT library" >&5
+echo $ECHO_N "checking for GLUT library... $ECHO_C" >&6
+ if test "x$with_glut_lib" != "x" ; then
+ if test -d "$with_glut_lib" ; then
+ LIBS="-L$with_glut_lib -lglut"
+ else
+ LIBS="$with_glut_lib"
+ fi
+ else
+ LIBS="-lglut"
+ fi
+ cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
@@ -9982,38 +10125,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_glut_glutInit=yes
+ HAVE_GLUT=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_glut_glutInit=no
+HAVE_GLUT=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5
-echo "${ECHO_T}$ac_cv_lib_glut_glutInit" >&6
-if test $ac_cv_lib_glut_glutInit = yes; then
- LIBGLUT=-lglut
-fi
-
-# Work-arround for broken dynamic linkers and/or systems with non-broken
-# linkers but suffering from PEBKAC. The list of libraries is a bit
-# over-generous, AFAIK -lXi is needed only on (some versions of?) SuSE
-
-if test -z "${LIBGLUT}" ; then
- echo "Couldn't find GLUT, trying again with extra linker flags"
- unset ac_cv_lib_glut_glutInit
- echo "$as_me:$LINENO: checking for glutInit in -lglut" >&5
-echo $ECHO_N "checking for glutInit in -lglut... $ECHO_C" >&6
-if test "${ac_cv_lib_glut_glutInit+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lglut -lX11 -lXmu -lXi -lm $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+ if test "x$HAVE_GLUT" = xno ; then
+ # Try again with the GL libs
+ LIBS="-lglut $GL_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
@@ -10048,31 +10172,95 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_lib_glut_glutInit=yes
+ HAVE_GLUT=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_lib_glut_glutInit=no
+HAVE_GLUT=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_glut_glutInit" >&5
-echo "${ECHO_T}$ac_cv_lib_glut_glutInit" >&6
-if test $ac_cv_lib_glut_glutInit = yes; then
- LIBGLUT=-lglut
+ fi
+
+ if test "x$HAVE_GLUT" = xno && test "x$GLUT_X_LIBS" != x ; then
+ # Try again with the GL and X11 libs
+ LIBS="-lglut $GL_LIBS $GLUT_X_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char glutInit ();
+int
+main ()
+{
+glutInit ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ HAVE_GLUT=yes
else
- { { echo "$as_me:$LINENO: error: libglut is required to compile this library" >&5
-echo "$as_me: error: libglut is required to compile this library" >&2;}
- { (exit 1); exit 1; }; }
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+HAVE_GLUT=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+
+ if test "x$HAVE_GLUT" = xyes ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ GLUT_LIBS=$LIBS
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: WARNING: GLUT libraries not availabe, example program won't be compiled." >&5
+echo "$as_me: WARNING: GLUT libraries not availabe, example program won't be compiled." >&2;}
+ fi
+
+# End check for GLUT libraries
- LIBGLUT="$LIBGLUT -lX11 -lXmu -lXi -lm"
fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+CPPFLAGS="$GLUT_SAVE_CPPFLAGS"
+LIBS="$GLUT_SAVE_LIBS"
+GLUT_X_CFLAGS=
+GLUT_X_LIBS=
+
+
# Checks for library functions
@@ -10672,7 +10860,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by ftgl $as_me 1.4, which was
+This file was extended by ftgl $as_me 2.0.5, which was
generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -10727,7 +10915,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-ftgl config.status 1.4
+ftgl config.status 2.0.5
configured by $0, generated by GNU Autoconf 2.57,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -10950,7 +11138,11 @@ s,@X_CFLAGS@,$X_CFLAGS,;t t
s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
s,@X_LIBS@,$X_LIBS,;t t
s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
-s,@LIBGLUT@,$LIBGLUT,;t t
+s,@GL_CFLAGS@,$GL_CFLAGS,;t t
+s,@GL_LIBS@,$GL_LIBS,;t t
+s,@HAVE_GLUT@,$HAVE_GLUT,;t t
+s,@GLUT_CFLAGS@,$GLUT_CFLAGS,;t t
+s,@GLUT_LIBS@,$GLUT_LIBS,;t t
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
s,@INSTALL_DATA@,$INSTALL_DATA,;t t