1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 03_freetype-build.dpatch by <hamish@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Use pkg-config to locate FreeType build information
8
diff -urNad --exclude=CVS --exclude=.svn ./configure.in /tmp/dpep-work.9fnwEh/xpdf-3.01/configure.in
9
--- ./configure.in 2005-08-19 17:06:04.000000000 +1000
10
+++ /tmp/dpep-work.9fnwEh/xpdf-3.01/configure.in 2005-08-19 17:12:11.000000000 +1000
14
dnl ##### Check for FreeType 2.x.
15
-dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
16
-dnl ##### the reason that Xpdf requires 2.0.5+.)
17
-smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+],
18
- FT_Get_Name_Index, ft2build.h, -lm)
19
+PKG_CHECK_MODULES(freetype2, freetype2 >= 9.5.3, smr_have_freetype2_library="yes",
20
+ smr_have_freetype2_library="no")
21
AC_SUBST(freetype2_LIBS)
22
AC_SUBST(freetype2_CFLAGS)
23
if test "x$smr_have_freetype2_library" = xyes; then
24
diff -urNad --exclude=CVS --exclude=.svn ./smr.m4 /tmp/dpep-work.9fnwEh/xpdf-3.01/smr.m4
25
--- ./smr.m4 1970-01-01 10:00:00.000000000 +1000
26
+++ /tmp/dpep-work.9fnwEh/xpdf-3.01/smr.m4 2005-08-19 17:12:05.000000000 +1000
28
+# <<< smr.m4 from smr_macros 0.2.4 >>>
30
+dnl ####################### -*- Mode: M4 -*- ###########################
33
+dnl Copyright (C) 1999 Matthew D. Langston <langston at SLAC.Stanford.EDU>
34
+dnl Copyright (C) 1998 Steve Robbins <stever at cs.mcgill.ca>
36
+dnl This file is free software; you can redistribute it and/or modify it
37
+dnl under the terms of the GNU General Public License as published by
38
+dnl the Free Software Foundation; either version 2 of the License, or
39
+dnl (at your option) any later version.
41
+dnl This file is distributed in the hope that it will be useful, but
42
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
43
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44
+dnl General Public License for more details.
46
+dnl You should have received a copy of the GNU General Public License
47
+dnl along with this file; if not, write to:
49
+dnl Free Software Foundation, Inc.
52
+dnl Boston, MA 02111-1307, USA.
53
+dnl ####################################################################
56
+dnl NOTE: The macros in this file are extensively documented in the
57
+dnl accompanying `smr_macros.texi' Texinfo file. Please see the
58
+dnl Texinfo documentation for the definitive specification of how
59
+dnl these macros are supposed to work. If the macros work
60
+dnl differently than the Texinfo documentation says they should,
61
+dnl then the macros (and not the Texinfo documentation) has the
64
+dnl This is a convenient macro which translates illegal characters for
65
+dnl bourne shell variables into legal characters. It has the same
66
+dnl functionality as sed 'y%./+-:%__p__%'.
67
+AC_DEFUN([smr_safe_translation], [patsubst(patsubst([$1], [+], [p]), [./-:], [_])])
71
+ dnl Define convenient aliases for the arguments since there are so
72
+ dnl many of them and I keep confusing myself whenever I have to edit
74
+ pushdef([smr_name], $1)
75
+ pushdef([smr_help_string], $2)
76
+ pushdef([smr_default], $3)
77
+ pushdef([smr_yes_define], $4)
78
+ pushdef([smr_no_define], $5)
80
+ dnl Do some sanity checking of the arguments.
81
+ ifelse([regexp(smr_default, [^\(yes\|no\)$])], -1, [AC_MSG_ERROR($0: third arg must be either yes or no)])
83
+ dnl Create the help string
84
+ pushdef([smr_lhs], [--ifelse(smr_default, yes, disable, enable)-smr_name])dnl
85
+ pushdef([smr_rhs], [ifelse(smr_default, yes, disable, enable) smr_help_string (default is smr_default)])dnl
87
+ dnl Add the option to `configure --help'. We don't need to supply the
88
+ dnl 4th argument to AC_ARG_ENABLE (i.e. the code to set the default
89
+ dnl value) because that is done below by AC_CACHE_CHECK.
90
+ AC_ARG_ENABLE([smr_name],
91
+ AC_HELP_STRING([smr_lhs], [smr_rhs]),
92
+ smr_cv_enable_[]smr_name=$enableval)
94
+ dnl We cache the result so that the user doesn't have to remember
95
+ dnl which flags they passed to `configure'.
96
+ AC_CACHE_CHECK([whether to enable smr_help_string],
97
+ smr_cv_enable_[]smr_name,
98
+ smr_cv_enable_[]smr_name=smr_default)
100
+ ifelse(smr_yes_define, , , test x"[$]smr_cv_enable_[]smr_name" = xyes && AC_DEFINE(smr_yes_define))
101
+ ifelse(smr_no_define, , , test x"[$]smr_cv_enable_[]smr_name" = xno && AC_DEFINE(smr_no_define))
103
+ dnl Sanity check the value assigned to smr_cv_enable_$1 to force it to
104
+ dnl be either `yes' or `no'.
105
+ if test ! x"[$]smr_cv_enable_[]smr_name" = xyes; then
106
+ if test ! x"[$]smr_cv_enable_[]smr_name" = xno; then
107
+ AC_MSG_ERROR([smr_lhs must be either yes or no])
112
+ popdef([smr_help_string])
113
+ popdef([smr_default])
114
+ popdef([smr_yes_define])
115
+ popdef([smr_no_define])
121
+AC_DEFUN(smr_ARG_WITHLIB,
123
+ dnl Define convenient aliases for the arguments since there are so
124
+ dnl many of them and I keep confusing myself whenever I have to edit
126
+ pushdef([smr_name], $1)
127
+ pushdef([smr_libname], ifelse($2, , smr_name, $2))
128
+ pushdef([smr_help_string], $3)
129
+ pushdef([smr_safe_name], smr_safe_translation(smr_name))
131
+ dnl Add the option to `configure --help'. We don't need to supply the
132
+ dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
133
+ dnl value) because that is done below by AC_CACHE_CHECK.
134
+ AC_ARG_WITH(smr_safe_name-library,
135
+ AC_HELP_STRING([--with-smr_safe_name-library[[=PATH]]],
136
+ [use smr_name library ifelse(smr_help_string, , , (smr_help_string))]),
137
+ smr_cv_with_[]smr_safe_name[]_library=$withval)
139
+ dnl We cache the result so that the user doesn't have to remember
140
+ dnl which flags they passed to `configure'.
141
+ AC_CACHE_CHECK([whether to use smr_name library],
142
+ smr_cv_with_[]smr_safe_name[]_library,
143
+ smr_cv_with_[]smr_safe_name[]_library=maybe)
146
+ case x"[$]smr_cv_with_[]smr_safe_name[]_library" in
148
+ smr_safe_name[]_LIBS="-l[]smr_libname"
149
+ with_[]smr_safe_name=[$]smr_cv_with_[]smr_safe_name[]_library
152
+ smr_safe_name[]_LIBS=
153
+ with_[]smr_safe_name=no
156
+ if test -f "[$]smr_cv_with_[]smr_safe_name[]_library"; then
157
+ smr_safe_name[]_LIBS=[$]smr_cv_with_[]smr_safe_name[]_library
158
+ elif test -d "[$]smr_cv_with_[]smr_safe_name[]_library"; then
159
+ smr_safe_name[]_LIBS="-L[$]smr_cv_with_[]smr_safe_name[]_library -l[]smr_libname"
161
+ AC_MSG_ERROR([argument must be boolean, file, or directory])
163
+ with_[]smr_safe_name=yes
168
+ popdef([smr_libname])
169
+ popdef([smr_help_string])
170
+ popdef([smr_safe_name])
174
+AC_DEFUN(smr_ARG_WITHINCLUDES,
176
+ dnl Define convenient aliases for the arguments since there are so
177
+ dnl many of them and I keep confusing myself whenever I have to edit
179
+ pushdef([smr_name], $1)
180
+ pushdef([smr_header], $2)
181
+ pushdef([smr_extra_flags], $3)
182
+ pushdef([smr_safe_name], smr_safe_translation(smr_name))
184
+ dnl Add the option to `configure --help'. We don't need to supply the
185
+ dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
186
+ dnl value) because that is done below by AC_CACHE_CHECK.
187
+ AC_ARG_WITH(smr_safe_name-includes,
188
+ AC_HELP_STRING([--with-smr_safe_name-includes[[=DIR]]],
189
+ [set directory for smr_name headers]),
190
+ smr_cv_with_[]smr_safe_name[]_includes=$withval)
192
+ dnl We cache the result so that the user doesn't have to remember
193
+ dnl which flags they passed to `configure'.
194
+ AC_CACHE_CHECK([where to find the smr_name header files],
195
+ smr_cv_with_[]smr_safe_name[]_includes,
196
+ smr_cv_with_[]smr_safe_name[]_includes=)
198
+ if test ! x"[$]smr_cv_with_[]smr_safe_name[]_includes" = x; then
199
+ if test -d "[$]smr_cv_with_[]smr_safe_name[]_includes"; then
200
+ smr_safe_name[]_CFLAGS="-I[$]smr_cv_with_[]smr_safe_name[]_includes"
202
+ AC_MSG_ERROR([argument must be a directory])
205
+ smr_safe_name[]_CFLAGS=
208
+ dnl This bit of logic comes from the autoconf AC_PROG_CC macro. We
209
+ dnl need to put the given include directory into CPPFLAGS temporarily,
210
+ dnl but then restore CPPFLAGS to its old value.
211
+ smr_test_CPPFLAGS="${CPPFLAGS+set}"
212
+ smr_save_CPPFLAGS="$CPPFLAGS"
213
+ CPPFLAGS="$CPPFLAGS [$]smr_safe_name[]_CFLAGS smr_extra_flags"
215
+ dnl If the header file smr_header exists, then define
216
+ dnl HAVE_[]smr_header (in all capitals).
217
+ AC_CHECK_HEADERS([smr_header],
218
+ smr_have_[]smr_safe_name[]_header=yes,
219
+ smr_have_[]smr_safe_name[]_header=no)
221
+ if test x"$smr_test_CPPFLAGS" = xset; then
222
+ CPPFLAGS=$smr_save_CPPFLAGS
228
+ popdef([smr_header])
229
+ popdef([smr_extra_flags])
230
+ popdef([smr_safe_name])
234
+AC_DEFUN(smr_CHECK_LIB,
236
+ dnl Define convenient aliases for the arguments since there are so
237
+ dnl many of them and I keep confusing myself whenever I have to edit
239
+ pushdef([smr_name], $1)
240
+ pushdef([smr_libname], ifelse($2, , smr_name, $2))
241
+ pushdef([smr_help_string], $3)
242
+ pushdef([smr_function], $4)
243
+ pushdef([smr_header], $5)
244
+ pushdef([smr_extra_libs], $6)
245
+ pushdef([smr_extra_flags], $7)
246
+ pushdef([smr_prototype], $8)
247
+ pushdef([smr_safe_name], smr_safe_translation(smr_name))
249
+ dnl Give the user (via "configure --help") an interface to specify
250
+ dnl whether we should use the library or not, and possibly where we
251
+ dnl should find it.
252
+ smr_ARG_WITHLIB([smr_name], [smr_libname], [smr_help_string])
254
+ if test ! x"$with_[]smr_safe_name" = xno; then
256
+ # If we got this far, then the user didn't explicitly ask not to use
259
+ dnl If the caller of smr_CHECK_LIB specified a header file for this
260
+ dnl library, then give the user (via "configure --help") an
261
+ dnl interface to specify where this header file can be found (if it
262
+ dnl isn't found by the compiler by default).
263
+ ifelse(smr_header, , , [smr_ARG_WITHINCLUDES(smr_name, smr_header, smr_extra_flags)])
265
+ # We need only look for the library if the header has been found
266
+ # (or no header is needed).
267
+ if test [$]smr_have_[]smr_safe_name[]_header != no; then
269
+ AC_CHECK_LIB(smr_libname,
271
+ smr_have_[]smr_safe_name[]_library=yes,
272
+ smr_have_[]smr_safe_name[]_library=no,
273
+ [$]smr_safe_name[]_CFLAGS [smr_extra_flags] [$]smr_safe_name[]_LIBS [smr_extra_libs],
274
+ [ifelse(smr_prototype, , , [[#]include <smr_header>])],
278
+ if test x"[$]smr_have_[]smr_safe_name[]_library" = xyes; then
279
+ AC_MSG_RESULT([using smr_name library])
281
+ smr_safe_name[]_LIBS=
282
+ smr_safe_name[]_CFLAGS=
284
+ if test x"$with_[]smr_safe_name" = xmaybe; then
285
+ AC_MSG_RESULT([not using smr_name library])
287
+ AC_MSG_WARN([requested smr_name library not found!])
293
+ popdef([smr_libname])
294
+ popdef([smr_help_string])
295
+ popdef([smr_function])
296
+ popdef([smr_header])
297
+ popdef([smr_extra_libs])
298
+ popdef([smr_extra_flags])
299
+ popdef([smr_prototype])
300
+ popdef([smr_safe_name])