From e39c513fece8e766701f0884070bc2f01525f6d0 Mon Sep 17 00:00:00 2001 From: Alexander Malmberg Date: Sat, 15 Jun 2002 14:29:17 +0000 Subject: [PATCH] Use libart2-config and freetype-config in configure. Set alpha before calling -setColor:state:. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@13891 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 7 ++ Source/gsc/GSGState.m | 2 +- configure | 238 +++++++++++++++++++++++++++++++++++++++++- configure.ac | 20 +++- 4 files changed, 260 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa59084..8854065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-06-15 Alexander Malmberg + + * configure.ac, configure: Use libart2-config and freetype-config + to get libs and cflags for libart and freetype. Updated configure. + * Source/gsc/GSGState.m (-DPSinitgraphics): Set alpha _before_ + calling -setColor:state:. + 2002-06-10 Adam Fedor * Version 0.7.8 diff --git a/Source/gsc/GSGState.m b/Source/gsc/GSGState.m index 94f7ee5..1d9a783 100644 --- a/Source/gsc/GSGState.m +++ b/Source/gsc/GSGState.m @@ -458,9 +458,9 @@ /* Initialize colors. By default the same color is used for filling and stroking unless fill and/or stroke color is set explicitly */ fillColor = gsMakeColor(gray_colorspace, 0, 0, 0, 0); - [self setColor: fillColor state: COLOR_BOTH]; fillColor.field[AINDEX] = 1.0; strokeColor.field[AINDEX] = 1.0; + [self setColor: fillColor state: COLOR_BOTH]; charSpacing = 0; textMode = GSTextFill; diff --git a/configure b/configure index fd5c546..d93810c 100755 --- a/configure +++ b/configure @@ -5132,7 +5132,13 @@ save_header=${CPPFLAGS} save_libs=${LIBS} CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" LIBS="${GRAPHIC_LIBS} ${LIBS}" -LIBART_LIBS= + +LIBART_LIBS="`libart2-config --libs` `freetype-config --libs`" +LIBART_CFLAGS="`libart2-config --cflags` `freetype-config --cflags`" + +CPPFLAGS="${CPPFLAGS} ${LIBART_CFLAGS}" +LIBS="${LIBS} ${LIBART_LIBS}" + echo "$as_me:$LINENO: checking for main in -lart_lgpl_2" >&5 echo $ECHO_N "checking for main in -lart_lgpl_2... $ECHO_C" >&6 if test "${ac_cv_lib_art_lgpl_2_main+set}" = set; then @@ -5189,7 +5195,114 @@ else fi if test "$have_libart_lgpl_2" = yes; then - LIBART_LIBS="$LIBART_LIBS -lart_lgpl_2" + if test "${ac_cv_header_libart_lgpl_libart_h+set}" = set; then + echo "$as_me:$LINENO: checking for libart_lgpl/libart.h" >&5 +echo $ECHO_N "checking for libart_lgpl/libart.h... $ECHO_C" >&6 +if test "${ac_cv_header_libart_lgpl_libart_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libart_lgpl_libart_h" >&5 +echo "${ECHO_T}$ac_cv_header_libart_lgpl_libart_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking libart_lgpl/libart.h usability" >&5 +echo $ECHO_N "checking libart_lgpl/libart.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (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 + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking libart_lgpl/libart.h presence" >&5 +echo $ECHO_N "checking libart_lgpl/libart.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: libart_lgpl/libart.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: libart_lgpl/libart.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: libart_lgpl/libart.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libart_lgpl/libart.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: libart_lgpl/libart.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: libart_lgpl/libart.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: libart_lgpl/libart.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: libart_lgpl/libart.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: libart_lgpl/libart.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libart_lgpl/libart.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for libart_lgpl/libart.h" >&5 +echo $ECHO_N "checking for libart_lgpl/libart.h... $ECHO_C" >&6 +if test "${ac_cv_header_libart_lgpl_libart_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_libart_lgpl_libart_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libart_lgpl_libart_h" >&5 +echo "${ECHO_T}$ac_cv_header_libart_lgpl_libart_h" >&6 + +fi +if test $ac_cv_header_libart_lgpl_libart_h = yes; then + have_libart_lgpl_2=yes +else + have_libart_lgpl_2=no +fi + + fi echo "$as_me:$LINENO: checking for main in -lfreetype" >&5 echo $ECHO_N "checking for main in -lfreetype... $ECHO_C" >&6 @@ -5247,7 +5360,114 @@ else fi if test "$have_freetype" = yes; then - LIBART_LIBS="$LIBART_LIBS -lfreetype" + if test "${ac_cv_header_ft2build_h+set}" = set; then + echo "$as_me:$LINENO: checking for ft2build.h" >&5 +echo $ECHO_N "checking for ft2build.h... $ECHO_C" >&6 +if test "${ac_cv_header_ft2build_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_ft2build_h" >&5 +echo "${ECHO_T}$ac_cv_header_ft2build_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking ft2build.h usability" >&5 +echo $ECHO_N "checking ft2build.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (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 + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking ft2build.h presence" >&5 +echo $ECHO_N "checking ft2build.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: ft2build.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: ft2build.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: ft2build.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ft2build.h: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: ft2build.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: ft2build.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: ft2build.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: ft2build.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: ft2build.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: ft2build.h: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for ft2build.h" >&5 +echo $ECHO_N "checking for ft2build.h... $ECHO_C" >&6 +if test "${ac_cv_header_ft2build_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_ft2build_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_ft2build_h" >&5 +echo "${ECHO_T}$ac_cv_header_ft2build_h" >&6 + +fi +if test $ac_cv_header_ft2build_h = yes; then + have_freetype=yes +else + have_freetype=no +fi + + fi CPPFLAGS="${save_header}" LIBS="${save_libs}" @@ -5323,6 +5543,18 @@ if test x"$BUILD_GRAPHICS" = "xxdps"; then elif test x"$BUILD_GRAPHICS" = "xart"; then BUILD_ART=yes GRAPHIC_LIBS="$LIBART_LIBS $GRAPHIC_LIBS" + GRAPHIC_CFLAGS="$LIBART_CFLAGS $GRAPHIC_CFLAGS" + + if test "$have_freetype" = no; then + { { echo "$as_me:$LINENO: error: can't find freetype, required for graphics=art!" >&5 +echo "$as_me: error: can't find freetype, required for graphics=art!" >&2;} + { (exit 1); exit 1; }; } + fi + if test "$have_libart_lgpl_2" = no; then + { { echo "$as_me:$LINENO: error: can't find libart, required for graphics=art!" >&5 +echo "$as_me: error: can't find libart, required for graphics=art!" >&2;} + { (exit 1); exit 1; }; } + fi fi diff --git a/configure.ac b/configure.ac index c675435..f260874 100644 --- a/configure.ac +++ b/configure.ac @@ -361,14 +361,20 @@ save_header=${CPPFLAGS} save_libs=${LIBS} CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" LIBS="${GRAPHIC_LIBS} ${LIBS}" -LIBART_LIBS= + +LIBART_LIBS="`libart2-config --libs` `freetype-config --libs`" +LIBART_CFLAGS="`libart2-config --cflags` `freetype-config --cflags`" + +CPPFLAGS="${CPPFLAGS} ${LIBART_CFLAGS}" +LIBS="${LIBS} ${LIBART_LIBS}" + AC_CHECK_LIB(art_lgpl_2, main, have_libart_lgpl_2=yes, have_libart_lgpl_2=no) if test "$have_libart_lgpl_2" = yes; then - LIBART_LIBS="$LIBART_LIBS -lart_lgpl_2" + AC_CHECK_HEADER(libart_lgpl/libart.h,have_libart_lgpl_2=yes, have_libart_lgpl_2=no) fi AC_CHECK_LIB(freetype, main, have_freetype=yes, have_freetype=no) if test "$have_freetype" = yes; then - LIBART_LIBS="$LIBART_LIBS -lfreetype" + AC_CHECK_HEADER(ft2build.h,have_freetype=yes, have_freetype=no) fi CPPFLAGS="${save_header}" LIBS="${save_libs}" @@ -422,6 +428,14 @@ if test x"$BUILD_GRAPHICS" = "xxdps"; then elif test x"$BUILD_GRAPHICS" = "xart"; then BUILD_ART=yes GRAPHIC_LIBS="$LIBART_LIBS $GRAPHIC_LIBS" + GRAPHIC_CFLAGS="$LIBART_CFLAGS $GRAPHIC_CFLAGS" + + if test "$have_freetype" = no; then + AC_MSG_ERROR([can't find freetype, required for graphics=art!]) + fi + if test "$have_libart_lgpl_2" = no; then + AC_MSG_ERROR([can't find libart, required for graphics=art!]) + fi fi AH_TOP([