comparison configure.ac @ 10571:2ceb8e013597

add configure test for glu
author Shai Ayal <shaiay@users.sourceforge.net>
date Mon, 26 Apr 2010 07:21:26 +0300
parents bcabc1c4f20c
children 43685a0541c4
comparison
equal deleted inserted replaced
10570:a61d7248627c 10571:2ceb8e013597
818 ## libraries needed for graphics 818 ## libraries needed for graphics
819 819
820 warn_freetype="" 820 warn_freetype=""
821 821
822 OCTAVE_OPENGL 822 OCTAVE_OPENGL
823 GRAPHICS_LIBS=
824 GRAPHICS_CFLAGS=
825
823 if test -n "$OPENGL_LIBS"; then 826 if test -n "$OPENGL_LIBS"; then
824 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available]) 827 AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available])
825 828
826 ## freetype 2 829 ## freetype 2
827 830
828 AC_CHECK_FT2([9.0.3], [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.]) 831 AC_CHECK_FT2([9.0.3], [AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.])
829 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], 832 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"],
830 [warn_freetype="FreeType library not found. Native renderer will not have on-screen text"]) 833 [warn_freetype="FreeType library not found. Native renderer will not have on-screen text"])
831 fi 834
832 835 ## fontconfig library
833 ## fontconfig library 836
834 837 warn_fontconfig=""
835 warn_fontconfig="" 838 if test -z "$warn_freetype"; then
836 if test -z "$warn_freetype"; then 839 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [
837 PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [ 840 have_fontconfig=yes
838 have_fontconfig=yes 841 OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS"
839 OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" 842 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS"
840 XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS" 843 AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])], [
841 AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])], [ 844 have_fontconfig=no
842 have_fontconfig=no 845 warn_fontconfig="Fontconfig not found. Native text rendering will use hard-coded font instead."])
843 warn_fontconfig="Fontconfig not found. Native text rendering will use hard-coded font instead."])
844 fi
845
846 GRAPHICS_LIBS=
847 GRAPHICS_CFLAGS=
848
849 ## fltk (www.fltk.org)
850 AC_ARG_WITH(fltk-prefix,
851 [ --with-fltk-prefix=PFX Prefix where FLTK is installed (optional)],
852 fltk_prefix="$withval",
853 fltk_prefix="")
854 AC_ARG_WITH(fltk-exec-prefix,
855 [ --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)],
856 fltk_exec_prefix="$withval",
857 fltk_exec_prefix="")
858
859 if test -n "$fltk_exec_prefix"; then
860 fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix"
861 if test "x${FLTK_CONFIG+set}" != xset ; then
862 FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config"
863 fi 846 fi
864 fi 847
865 848 ## fltk (www.fltk.org)
866 if test -n "$fltk_prefix"; then 849 AC_ARG_WITH(fltk-prefix,
867 fltk_args="$fltk_args --prefix=$fltk_prefix" 850 [ --with-fltk-prefix=PFX Prefix where FLTK is installed (optional)],
868 if test x${FLTK_CONFIG+set} != xset ; then 851 fltk_prefix="$withval",
869 FLTK_CONFIG="$fltk_prefix/bin/fltk-config" 852 fltk_prefix="")
853 AC_ARG_WITH(fltk-exec-prefix,
854 [ --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)],
855 fltk_exec_prefix="$withval",
856 fltk_exec_prefix="")
857
858 if test -n "$fltk_exec_prefix"; then
859 fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix"
860 if test "x${FLTK_CONFIG+set}" != xset ; then
861 FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config"
862 fi
870 fi 863 fi
871 fi 864
872 865 if test -n "$fltk_prefix"; then
873 AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) 866 fltk_args="$fltk_args --prefix=$fltk_prefix"
874 867 if test x${FLTK_CONFIG+set} != xset ; then
875 warn_fltk_config="" 868 FLTK_CONFIG="$fltk_prefix/bin/fltk-config"
876 warn_fltk_opengl="" 869 fi
877 870 fi
878 if test "$FLTK_CONFIG" = "no" ; then 871
879 warn_fltk_config="FLTK config script not found. Native graphics will be disabled." 872 AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
873
874 warn_fltk_config=""
875 warn_fltk_opengl=""
876
877 if test "$FLTK_CONFIG" = "no" ; then
878 warn_fltk_config="FLTK config script not found. Native graphics will be disabled."
879 else
880 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`"
881 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
882
883 case "$canonical_host_type" in
884 *-*-mingw*)
885 FLTK_LDFLAGS="`echo $FLTK_LDFLAGS | sed -e 's/-mwindows//g'`"
886 ;;
887 esac
888
889 AC_MSG_CHECKING([for OpenGL support in FLTK])
890 cat > conftest.cc <<EOF
891 #include <FL/gl.h>
892 int nothing=0;
893 EOF
894 $CXX $CXXFLAGS $FLTK_CFLAGS -c conftest.cc || \
895 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."
896
897 if test -z "$warn_fltk_opengl"; then
898 AC_MSG_RESULT(yes)
899 AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available])
900 GRAPHICS_CFLAGS="$FLTK_CFLAGS"
901 GRAPHICS_LIBS="$FLTK_LDFLAGS"
902 else
903 AC_MSG_RESULT(no)
904 fi
905 fi
880 else 906 else
881 FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`" 907 warn_fltk_opengl="OpenGL libs (GL and GLU) not found. Native graphics will be disabled."
882 FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
883
884 case "$canonical_host_type" in
885 *-*-mingw*)
886 FLTK_LDFLAGS="`echo $FLTK_LDFLAGS | sed -e 's/-mwindows//g'`"
887 ;;
888 esac
889
890 AC_MSG_CHECKING([for OpenGL support in FLTK])
891 cat > conftest.cc <<EOF
892 #include <FL/gl.h>
893 int nothing=0;
894 EOF
895 $CXX $CXXFLAGS $FLTK_CFLAGS -c conftest.cc || \
896 warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled."
897
898 if test -z "$warn_fltk_opengl"; then
899 AC_MSG_RESULT(yes)
900 AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available])
901 GRAPHICS_CFLAGS="$FLTK_CFLAGS"
902 GRAPHICS_LIBS="$FLTK_LDFLAGS"
903 else
904 AC_MSG_RESULT(no)
905 fi
906 fi 908 fi
907 909
908 AC_SUBST(GRAPHICS_CFLAGS) 910 AC_SUBST(GRAPHICS_CFLAGS)
909 AC_SUBST(GRAPHICS_LIBS) 911 AC_SUBST(GRAPHICS_LIBS)
910 912