summaryrefslogtreecommitdiffstats
path: root/ksvg/configure.in.in
blob: 7a19195b703a4456b22eacacbca605522234acbf (plain)
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
# Check for libart
KDE_FIND_PATH(libart2-config, LIBART_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin],)

if test -n "$LIBART_CONFIG"; then
  vers=`$LIBART_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$vers" && test "$vers" -ge 2003008
  then
     LIBART_LIBS="`$LIBART_CONFIG --libs`"
     LIBART_RPATH=
     for args in $LIBART_LIBS; do
	  case $args in
	    -L*)
  	       LIBART_RPATH="$LIBART_RPATH $args"
 	       ;;
          esac
     done
     LIBART_RPATH=`echo $LIBART_RPATH | sed -e "s/-L/-R/g"`
     LIBART_CFLAGS="`$LIBART_CONFIG --cflags`"

     AC_DEFINE_UNQUOTED(HAVE_LIBART, 1, [Defines if your system has the libart library])
  fi
fi

AC_SUBST(LIBART_LIBS)
AC_SUBST(LIBART_CFLAGS)
AC_SUBST(LIBART_RPATH)

if test -z "$LIBART_LIBS"; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg"
fi

# Check for fontconfig
KDE_FIND_PATH(fontconfig-config, FONTCONFIG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin], [
  KDE_FIND_PATH( pkg-config, PKG_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin /usr/bin],)
  if test -n "$PKG_CONFIG"; then
	if ! $PKG_CONFIG --exists fontconfig; then
		unset PKG_CONFIG
	fi
  fi
])
if test -n "$FONTCONFIG_CONFIG" -o -n "$PKG_CONFIG"; then
	if test -n "$FONTCONFIG_CONFIG"; then
		fontconfigvers="`$FONTCONFIG_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`"
		fontconfiglibs="`$FONTCONFIG_CONFIG --libs`"
		fontconfigcflags="`$FONTCONFIG_CONFIG --cflags`"
	else
		fontconfigvers=`$PKG_CONFIG --modversion fontconfig 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3; }'`
		fontconfiglibs=`$PKG_CONFIG --libs fontconfig`
		fontconfigcflags="`$PKG_CONFIG --cflags fontconfig`"
	fi
	if test -n "$vers" && test "$vers" -ge 2002000
	then
		FONTCONFIG_LIBS=$fontconfiglibs
		FONTCONFIG_RPATH=
			for args in $FONTCONFIG_LIBS; do
				case $args in
					-L*)
						FONTCONFIG_RPATH="$FONTCONFIG_RPATH $args"
						;;
				esac
			done
		FONTCONFIG_RPATH=`echo $FONTCONFIG_RPATH | sed -e "s/-L/-R/g"`
		FONTCONFIG_CFLAGS=$fontconfigcflags

		AC_DEFINE_UNQUOTED(HAVE_FONTCONFIG, 1, [Defines if your system has the fontconfig library])
	fi
fi

AC_SUBST(FONTCONFIG_LIBS)
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_RPATH)

if test -z "$FONTCONFIG_LIBS"; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg"
fi

# Check for freetype2
KDE_FIND_PATH(freetype-config, FREETYPE_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin],)

if test -n "$FREETYPE_CONFIG"; then
  vers=`$FREETYPE_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$vers" && test "$vers" -ge 8000002
  then
     FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
     FREETYPE_RPATH=
     for args in $FREETYPE_LIBS; do
	  case $args in
	    -L*)
  	       FREETYPE_RPATH="$FREETYPE_RPATH $args"
 	       ;;
          esac
     done
     FREETYPE_RPATH=`echo $FREETYPE_RPATH | sed -e "s/-L/-R/g"`
     FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"

     AC_DEFINE_UNQUOTED(HAVE_FREETYPE, 1, [Defines if your system has the freetype library])

     ftvers=`$FREETYPE_CONFIG --ftversion 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
     if test -n "$ftvers" && test "$ftvers" -ge 2002000
     then
        AC_DEFINE_UNQUOTED(HAVE_FREETYPE_2_2_x, 1, [Defines if your system has the 2.2.x freetype library])
     fi
  fi
fi

AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_RPATH)

if test -z "$FREETYPE_LIBS"; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg"
fi

# Check for lcms
have_lcms_header='no'
KDE_CHECK_HEADER(lcms2.h,have_lcms2_header='yes',,)
if test "$have_lcms2_header" = 'yes'; then
    AC_DEFINE(LCMS_HEADER, <lcms2.h>, [LCMS header])
else
    KDE_CHECK_HEADER(lcms.h,have_lcms_header='yes',,)
    if test "$have_lcms_header" = 'yes'; then
        AC_DEFINE(LCMS_HEADER, <lcms.h>, [LCMS header])                                            else                                                                                               KDE_CHECK_HEADER(lcms/lcms.h,have_lcms_header='yes',,)
        if test "$have_lcms_header" = 'yes'; then
            AC_DEFINE(LCMS_HEADER, <lcms/lcms.h>, [LCMS header])
        fi
    fi
fi

LCMS_LIBS=''
have_lcms='no'
saved_libs=$LIBS
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
CFLAGS="$CFLAGS $all_includes -I/usr/include/tqt"
LDFLAGS="$LDFLAGS $all_libraries"
if test "$have_lcms2_header" = 'yes'; then
    LIBS="$LIBS -llcms2"
    AC_TRY_LINK([
#define inline __inline /* gcc is in ansi mode */
#include LCMS_HEADER
#if LCMS_VERSION < 112
choke!
#endif
], [
cmsOpenProfileFromFile("foo", "r");
],
        [LCMS_LIBS='-llcms2'; have_lcms='yes'])
else
    if test "$have_lcms_header" = 'yes'; then
        LIBS="$LIBS -llcms"
        AC_TRY_LINK([
#define inline __inline /* gcc is in ansi mode */
#include LCMS_HEADER
#if LCMS_VERSION < 112
choke!
#endif
], [
cmsOpenProfileFromFile("foo", "r");
],
        [LCMS_LIBS='-llcms'; have_lcms='yes'])
    fi
fi
LIBS=$saved_libs
CFLAGS=$saved_cflags
LDFLAGS=$saved_ldflags

if test -z "$LCMS_LIBS"; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg"
fi

AC_SUBST(LCMS_LIBS)

# Check for fribidi
KDE_FIND_PATH(fribidi-config, FRIBIDI_CONFIG, [${prefix}/bin ${exec_prefix}/bin /usr/local/bin /opt/local/bin],)

if test -n "$FRIBIDI_CONFIG"; then
  vers=`$FRIBIDI_CONFIG --version 2>/dev/null | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
  if test -n "$vers" && test "$vers" -ge 10004
  then
     FRIBIDI_LIBS="`$FRIBIDI_CONFIG --libs`"
     FRIBIDI_RPATH=
     for args in $FIBIDI_LIBS; do
	  case $args in
	    -L*)
  	       FRIBIDI_RPATH="$FRIBIDI_CONFIG $args"
 	       ;;
          esac
     done
     FRIBIDI_RPATH=`echo $FRIBIDI_RPATH | sed -e "s/-L/-R/g"`
     FRIBIDI_CFLAGS="`$FRIBIDI_CONFIG --cflags`"

     AC_DEFINE_UNQUOTED(HAVE_FRIBIDI, 1, [Defines if your system has the fribidi library])
  fi
else
  FRIBIDI_LIBS=`$PKG_CONFIG --libs fribidi`
  FRIBIDI_CFLAGS="`$PKG_CONFIG --cflags fribidi`"
fi

AC_SUBST(FRIBIDI_LIBS)
AC_SUBST(FRIBIDI_CFLAGS)
AC_SUBST(FRIBIDI_RPATH)

if test -z "$FRIBIDI_LIBS"; then
	DO_NOT_COMPILE="$DO_NOT_COMPILE ksvg"
fi

AC_LANG_SAVE
AC_LANG_CPLUSPLUS
KDE_CHECK_HEADERS(sstream)
AC_LANG_RESTORE