The R Project SVN R

Rev

Rev 72344 | Rev 79486 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 72344 Rev 74832
Line 18... Line 18...
18
### along with R; if not, a copy is available at
18
### along with R; if not, a copy is available at
19
### https://www.r-project.org/Licenses/
19
### https://www.r-project.org/Licenses/
20
 
20
 
21
 
21
 
22
AC_DEFUN([R_PANGO_CAIRO], [
22
AC_DEFUN([R_PANGO_CAIRO], [
23
if test "x${PKGCONF}" = "x"; then
23
if test "x${PKG_CONFIG}" = "x"; then
24
  AC_MSG_NOTICE([not checking for cairo as pkg-config is not present])
24
  AC_MSG_NOTICE([not checking for cairo as pkg-config is not present])
25
else
25
else
26
  save_CPPFLAGS=${CPPFLAGS}
26
  save_CPPFLAGS=${CPPFLAGS}
27
  save_LIBS=${LIBS}
27
  save_LIBS=${LIBS}
28
  AC_CACHE_CHECK([whether pkg-config knows about cairo and pango], 
28
  AC_CACHE_CHECK([whether pkg-config knows about cairo and pango], 
29
      [r_cv_has_pangocairo],
29
      [r_cv_has_pangocairo],
30
      [if "${PKGCONF}" --exists pangocairo; then
30
      [if "${PKG_CONFIG}" --exists pangocairo; then
31
         r_cv_has_pangocairo="yes"
31
         r_cv_has_pangocairo="yes"
32
       else
32
       else
33
         r_cv_has_pangocairo="no"
33
         r_cv_has_pangocairo="no"
34
       fi
34
       fi
35
  ])
35
  ])
36
  if test "x${r_cv_has_pangocairo}" = "xyes"; then
36
  if test "x${r_cv_has_pangocairo}" = "xyes"; then
37
    modlist="pangocairo"
37
    modlist="pangocairo"
38
    for module in cairo-png; do
38
    for module in cairo-png; do
39
      if "${PKGCONF}" --exists ${module}; then
39
      if "${PKG_CONFIG}" --exists ${module}; then
40
	modlist="${modlist} ${module}"
40
	modlist="${modlist} ${module}"
41
      fi
41
      fi
42
    done
42
    done
43
    if "${PKGCONF}" --exists cairo-pdf; then
43
    if "${PKG_CONFIG}" --exists cairo-pdf; then
44
       modlist="${modlist} cairo-pdf"
44
       modlist="${modlist} cairo-pdf"
45
       r_cairo_pdf=yes
45
       r_cairo_pdf=yes
46
    fi
46
    fi
47
    if "${PKGCONF}" --exists cairo-ps; then
47
    if "${PKG_CONFIG}" --exists cairo-ps; then
48
       modlist="${modlist} cairo-ps"
48
       modlist="${modlist} cairo-ps"
49
       r_cairo_ps=yes
49
       r_cairo_ps=yes
50
    fi
50
    fi
51
    if "${PKGCONF}" --exists cairo-svg; then
51
    if "${PKG_CONFIG}" --exists cairo-svg; then
52
       modlist="${modlist} cairo-svg"
52
       modlist="${modlist} cairo-svg"
53
       r_cairo_svg=yes
53
       r_cairo_svg=yes
54
    fi
54
    fi
55
      if "${PKGCONF}" --exists cairo-xlib; then
55
      if "${PKG_CONFIG}" --exists cairo-xlib; then
56
         xmodlist="${modlist} cairo-xlib"
56
         xmodlist="${modlist} cairo-xlib"
57
      else
57
      else
58
         xmodlist="${modlist}"
58
         xmodlist="${modlist}"
59
      fi
59
      fi
60
    CAIRO_CPPFLAGS=`"${PKGCONF}" --cflags ${modlist}`
60
    CAIRO_CPPFLAGS=`"${PKG_CONFIG}" --cflags ${modlist}`
61
    CAIROX11_CPPFLAGS=`"${PKGCONF}" --cflags ${xmodlist}`
61
    CAIROX11_CPPFLAGS=`"${PKG_CONFIG}" --cflags ${xmodlist}`
62
    CAIRO_LIBS=`"${PKGCONF}" --libs ${modlist}`
62
    CAIRO_LIBS=`"${PKG_CONFIG}" --libs ${modlist}`
63
    CAIROX11_LIBS=`"${PKGCONF}" --libs ${xmodlist}`
63
    CAIROX11_LIBS=`"${PKG_CONFIG}" --libs ${xmodlist}`
64
 
64
 
65
    CPPFLAGS="${CPPFLAGS} ${CAIRO_CPPFLAGS}"
65
    CPPFLAGS="${CPPFLAGS} ${CAIRO_CPPFLAGS}"
66
    LIBS="${LIBS} ${CAIRO_LIBS}"
66
    LIBS="${LIBS} ${CAIRO_LIBS}"
67
 
67
 
68
     AC_CACHE_CHECK([whether cairo including pango is >= 1.2 and works], 
68
     AC_CACHE_CHECK([whether cairo including pango is >= 1.2 and works], 
Line 87... Line 87...
87
        ])])
87
        ])])
88
    CPPFLAGS=${save_CPPFLAGS}
88
    CPPFLAGS=${save_CPPFLAGS}
89
    LIBS=${save_LIBS}
89
    LIBS=${save_LIBS}
90
  else  ## no pangocairo, check for just cairo
90
  else  ## no pangocairo, check for just cairo
91
    AC_CACHE_CHECK([whether pkg-config knows about cairo], [r_cv_has_cairo],
91
    AC_CACHE_CHECK([whether pkg-config knows about cairo], [r_cv_has_cairo],
92
	[if "${PKGCONF}" --exists cairo; then
92
	[if "${PKG_CONFIG}" --exists cairo; then
93
	   r_cv_has_cairo="yes"
93
	   r_cv_has_cairo="yes"
94
	 else
94
	 else
95
	   r_cv_has_cairo="no"
95
	   r_cv_has_cairo="no"
96
	 fi
96
	 fi
97
    ])
97
    ])
98
    if test "x${r_cv_has_cairo}" = "xyes"; then
98
    if test "x${r_cv_has_cairo}" = "xyes"; then
99
      modlist="cairo"
99
      modlist="cairo"
100
      ## on Linux, cairo-ft brings in header paths <cairo-ft.h>:
100
      ## on Linux, cairo-ft brings in header paths <cairo-ft.h>:
101
      ## the code which needs this is currently conditionalized
101
      ## the code which needs this is currently conditionalized
102
      for module in cairo-png cairo-ft; do
102
      for module in cairo-png cairo-ft; do
103
	if "${PKGCONF}" --exists ${module}; then
103
	if "${PKG_CONFIG}" --exists ${module}; then
104
	  modlist="${modlist} ${module}"
104
	  modlist="${modlist} ${module}"
105
	fi
105
	fi
106
      done
106
      done
107
      if "${PKGCONF}" --exists cairo-pdf; then
107
      if "${PKG_CONFIG}" --exists cairo-pdf; then
108
         modlist="${modlist} cairo-pdf"
108
         modlist="${modlist} cairo-pdf"
109
         r_cairo_pdf=yes
109
         r_cairo_pdf=yes
110
      fi
110
      fi
111
      if "${PKGCONF}" --exists cairo-ps; then
111
      if "${PKG_CONFIG}" --exists cairo-ps; then
112
         modlist="${modlist} cairo-ps"
112
         modlist="${modlist} cairo-ps"
113
         r_cairo_ps=yes
113
         r_cairo_ps=yes
114
      fi
114
      fi
115
      if "${PKGCONF}" --exists cairo-svg; then
115
      if "${PKG_CONFIG}" --exists cairo-svg; then
116
         modlist="${modlist} cairo-svg"
116
         modlist="${modlist} cairo-svg"
117
         r_cairo_svg=yes
117
         r_cairo_svg=yes
118
      fi
118
      fi
119
      if "${PKGCONF}" --exists cairo-xlib; then
119
      if "${PKG_CONFIG}" --exists cairo-xlib; then
120
         xmodlist="${modlist} cairo-xlib"
120
         xmodlist="${modlist} cairo-xlib"
121
      else
121
      else
122
         xmodlist="${modlist}"
122
         xmodlist="${modlist}"
123
      fi
123
      fi
124
      CAIRO_CPPFLAGS=`"${PKGCONF}" --cflags ${modlist}`
124
      CAIRO_CPPFLAGS=`"${PKG_CONFIG}" --cflags ${modlist}`
125
      CAIROX11_CPPFLAGS=`"${PKGCONF}" --cflags ${xmodlist}`
125
      CAIROX11_CPPFLAGS=`"${PKG_CONFIG}" --cflags ${xmodlist}`
126
      case "${host_os}" in
126
      case "${host_os}" in
127
        darwin*)
127
        darwin*)
128
          ## This is for static macOS build
128
          ## This is for static macOS build
129
	  ## FIXME: doing that unconditionally is really not a good idea
129
	  ## FIXME: doing that unconditionally is really not a good idea
130
          CAIRO_LIBS=`"${PKGCONF}" --static --libs ${modlist}`
130
          CAIRO_LIBS=`"${PKG_CONFIG}" --static --libs ${modlist}`
131
          CAIROX11_LIBS=`"${PKGCONF}" --static --libs ${xmodlist}`
131
          CAIROX11_LIBS=`"${PKG_CONFIG}" --static --libs ${xmodlist}`
132
          ;;
132
          ;;
133
        *)
133
        *)
134
          CAIRO_LIBS=`"${PKGCONF}" --libs ${modlist}`
134
          CAIRO_LIBS=`"${PKG_CONFIG}" --libs ${modlist}`
135
          CAIROX11_LIBS=`"${PKGCONF}" --libs ${xmodlist}`
135
          CAIROX11_LIBS=`"${PKG_CONFIG}" --libs ${xmodlist}`
136
          ;;
136
          ;;
137
      esac
137
      esac
138
 
138
 
139
      CPPFLAGS="${CPPFLAGS} ${CAIRO_CPPFLAGS}"
139
      CPPFLAGS="${CPPFLAGS} ${CAIRO_CPPFLAGS}"
140
      LIBS="${LIBS} ${CAIRO_LIBS}"
140
      LIBS="${LIBS} ${CAIRO_LIBS}"