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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
dnl Process this file with autoconf to produce a configure script.
dnl
dnl This file configure.in is part of the t1lib-package (V. 1.0).
dnl
dnl Author: Rainer Menzner (Rainer.Menzner@web.de)
dnl Date: 06/25/1997
dnl Last Modified: 2007-12-21
dnl
AC_REVISION([configure.in 1.00])
AC_INIT(lib/t1lib/t1base.c)
AC_CONFIG_HEADER(lib/t1lib/sysconf.h:lib/t1lib/sysconf.h.in)
AC_CONFIG_AUX_DIR(ac-tools)
dnl We set CFLAGS in order to have complete control over compiler
dnl switches during development
dnl CFLAGS="$CFLAGS -g -Wall"
dnl The following variables specify version information of the
dnl library. Starting with V. 1.0.0 the libtool scheme is used
dnl as intended by its authors.
dnl
dnl Note: The name of the shared library on Linux is build as
dnl libt1.so.$(T1LIB_LT_CURRENT)-$(T1LIB_LT_AGE).$(T1LIB_LT_AGE).$(T1LIB_LT_REVISION)
dnl Since I'm forgetful sometimes, I quote the libtool infopage here:
dnl
dnl 1. Start with version information of `0:0:0' for each libtool library.
dnl
dnl 2. Update the version information only immediately before a public
dnl release of your software. More frequent updates are unnecessary,
dnl and only guarantee that the current interface number gets larger
dnl faster.
dnl
dnl 3. If the library source code has changed at all since the last
dnl update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
dnl
dnl 4. If any interfaces have been added, removed, or changed since the
dnl last update, increment CURRENT, and set REVISION to 0.
dnl
dnl 5. If any interfaces have been added since the last public release,
dnl then increment AGE.
dnl
dnl 6. If any interfaces have been removed since the last public release,
dnl then set AGE to 0.
define( MACRO_T1LIB_LT_CURRENT, 6)
define( MACRO_T1LIB_LT_REVISION, 2)
define( MACRO_T1LIB_LT_AGE, 1)
dnl -----------------------------------------------------------
dnl -----------------------------------------------------------
dnl
dnl Do not change anything below this line!
dnl
dnl -----------------------------------------------------------
dnl -----------------------------------------------------------
dnl Build version string and setup stuff to be substituted in
dnl Makefile's and t1lib.h
define( MACRO_T1LIB_IDENTIFIER, "builtin(eval, MACRO_T1LIB_LT_CURRENT - MACRO_T1LIB_LT_AGE).builtin(eval, MACRO_T1LIB_LT_AGE).builtin(eval, MACRO_T1LIB_LT_REVISION)")
T1LIB_LT_CURRENT=builtin(eval, MACRO_T1LIB_LT_CURRENT)
T1LIB_LT_REVISION=builtin(eval, MACRO_T1LIB_LT_REVISION)
T1LIB_LT_AGE=builtin(eval, MACRO_T1LIB_LT_AGE)
T1LIB_IDENTIFIER=MACRO_T1LIB_IDENTIFIER
T1LIB_VERSION=builtin(eval, MACRO_T1LIB_LT_CURRENT - MACRO_T1LIB_LT_AGE)
T1LIB_REVISION=builtin(eval, MACRO_T1LIB_LT_AGE)
T1LIB_PATCHLEVEL=builtin(eval, MACRO_T1LIB_LT_REVISION)
T1LIB_VERSIONSTRING=\"MACRO_T1LIB_IDENTIFIER\"
dnl We use this file by Andreas Zeller to check for libXaw
builtin(include, ac-tools/ice_find_athena.m4)
builtin(include, ac-tools/aclocal.m4)
dnl We want these before the checks, so the checks can modify their values.
test -z "$LDLIBS" && LDLIBS=-lm AC_SUBST(LDLIBS)
test -z "$PROGEXT" && PROGEXT="" AC_SUBST(PROGEXT)
test -z "$CFLAGS" AC_SUBST(CFLAGS)
test -z "$LDFLAGS" AC_SUBST(LDFLAGS)
T1LIB_DATA_DIR="${datadir}/t1lib"
dnl The following variables should be used
AC_SUBST(T1LIB_LT_CURRENT)
AC_SUBST(T1LIB_LT_REVISION)
AC_SUBST(T1LIB_LT_AGE)
AC_SUBST(T1LIB_DATA_DIR)
AC_SUBST(T1LIB_IDENTIFIER)
AC_SUBST(MAIN_TARGET)
AC_SUBST(MAIN_HEADER)
AC_SUBST(OPTIONS)
AC_SUBST(no_x)
AC_SUBST(CC)
AC_SUBST(T1_AA_TYPE16)
AC_SUBST(T1_AA_TYPE32)
AC_SUBST(T1_AA_TYPE64)
AC_SUBST(T1_INT16)
AC_SUBST(T1_INT32)
AC_SUBST(XSUBDIRS)
AC_SUBST(T1LIBX_OBJS)
AC_SUBST(T1LIBX_SRCS)
AC_SUBST(T1LIBX_HEADERS)
AC_SUBST(XOBJS)
AC_SUBST(T1LIB_VERSION)
AC_SUBST(T1LIB_REVISION)
AC_SUBST(T1LIB_PATCHLEVEL)
AC_SUBST(T1LIB_VERSIONSTRING)
dnl **** Check for some programs and libraries ****
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CPP
AC_PATH_XTRA
ICE_FIND_ATHENA
AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl **** Check for some compiler/system characteristics
AC_C_CHAR_UNSIGNED
AC_CHECK_SIZEOF(char,0)
AC_CHECK_SIZEOF(short,0)
AC_CHECK_SIZEOF(int,0)
AC_CHECK_SIZEOF(long,0)
AC_CHECK_SIZEOF(long long,0)
AC_CHECK_SIZEOF(float,0)
AC_CHECK_SIZEOF(double,0)
AC_CHECK_SIZEOF(long double,0)
AC_CHECK_SIZEOF(void *,0)
dnl **** Check for gcc strength-reduce bug ****
if test "x${GCC}" = "xyes"
then
dnl We don'use
CFLAGS="$CFLAGS"
AC_CACHE_CHECK( "for gcc strength-reduce bug", ac_cv_c_gcc_strength_bug,
AC_TRY_RUN([
int main(void) {
static int Array[[3]];
unsigned int B = 3;
int i;
for(i=0; i<B; i++) Array[[i]] = i - 3;
exit( Array[[1]] != -2 );
}],
ac_cv_c_gcc_strength_bug="no",
ac_cv_c_gcc_strength_bug="yes",
ac_cv_c_gcc_strength_bug="yes") )
if test "$ac_cv_c_gcc_strength_bug" = "yes"
then
CFLAGS="$CFLAGS -fno-strength-reduce"
fi
fi
dnl **** Check for underscore on external symbols ****
AC_CACHE_CHECK("whether external symbols need an underscore prefix",
ac_cv_c_extern_prefix,
[saved_libs=$LIBS
LIBS="conftest_asm.s $LIBS"
cat > conftest_asm.s <<EOF
.globl _ac_test
_ac_test:
.long 0
EOF
AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
LIBS=$saved_libs])
if test "$ac_cv_c_extern_prefix" = "yes"
then
AC_DEFINE(NEED_UNDERSCORE_PREFIX)
fi
dnl **** Check which ANSI integer type is 16 bit
AC_CACHE_CHECK( "which ANSI integer type is 16 bit", ac_16bit_type,
AC_TRY_RUN([
int main(void) {
if (sizeof(short)==2)
return(0);
else if (sizeof(int)==2)
return(1);
else
return(2);
}], ac_16bit_type="short", ac_16bit_type="int", ac_16bit_type=))
if test "$ac_16bit_type" = "short"
then
T1_AA_TYPE16="-DT1_AA_TYPE16=short"
T1_INT16="short"
else
T1_AA_TYPE16="-DT1_AA_TYPE16=int"
T1_INT16="int"
fi
dnl **** Check which ANSI integer type is 32 bit
AC_CACHE_CHECK( "which ANSI integer type is 32 bit", ac_32bit_type,
AC_TRY_RUN([
int main(void) {
if (sizeof(int)==4)
return(0);
else if (sizeof(long)==4)
return(1);
else
return(2);
}], ac_32bit_type="int", ac_32bit_type="long", ac_32bit_type=))
if test "$ac_32bit_type" = "int"
then
T1_AA_TYPE32="-DT1_AA_TYPE32=int"
T1_INT32="int"
else
T1_AA_TYPE32="-DT1_AA_TYPE32=long"
T1_INT32="long"
fi
dnl **** Check which ANSI integer type is 64 bit
AC_CACHE_CHECK( "which ANSI integer type is 64 bit", ac_64bit_type,
AC_TRY_RUN([
int main(void) {
if (sizeof(long)==8)
return(0);
else
return(1);
}], ac_64bit_type="long", ac_64bit_type="<none>"))
if test "$ac_64bit_type" = "long"
then
T1_AA_TYPE64="-DT1_AA_TYPE64=long"
else
T1_AA_TYPE64=
fi
CFLAGS="${CFLAGS} -DT1LIB_IDENT=\"\\\"${T1LIB_IDENTIFIER}\\\"\" -DGLOBAL_CONFIG_DIR=\"\\\"${T1LIB_DATA_DIR}\\\"\""
dnl **** Check for functions and header files ****
AC_HEADER_STAT()
AC_C_CONST()
AC_TYPE_SIZE_T()
dnl **** with or without X11 ****
if test "$no_x" = "yes"
then
MAIN_TARGET="libt1.la"
MAIN_HEADER="t1lib.h"
XSUBDIRS=""
T1LIBX_OBJS=""
T1LIBX_SRCS=""
T1LIBX_HEADERS=""
XOBJS=""
else
MAIN_TARGET="libt1.la libt1x.la"
MAIN_HEADER="t1lib.h t1libx.h"
XSUBDIRS="xglyph"
T1LIBX_OBJS="t1lib/t1x11.lo"
T1LIBX_SRCS="t1lib/t1x11.c"
T1LIBX_HEADERS="t1lib/t1x11.h t1lib/t1libx.h"
XOBJS="t1x11.lo"
fi
dnl **** Generate output files ****
dnl Some new versions of autonconf do not seem to set
dnl -DX_DISPLAY_MISSING -> we do it by hand:
if test "$no_x" = "yes"
then
CFLAGS="${CFLAGS} -DT1LIB_NO_X11_SUPPORT"
MAKEFILES="Makefile \
lib/Makefile \
lib/type1/Makefile \
lib/t1lib/Makefile \
type1afm/Makefile \
examples/Makefile \
doc/Makefile"
else
MAKEFILES="Makefile \
lib/Makefile \
lib/type1/Makefile \
lib/t1lib/Makefile \
xglyph/Makefile \
type1afm/Makefile \
examples/Makefile \
doc/Makefile"
fi
AC_OUTPUT([
$MAKEFILES \
lib/t1lib/t1lib.h
])
echo
echo "Configure finished!"
echo " Do: 'make' to compile the t1lib-package."
echo " Do: 'make without_doc' to compile if you do not have LaTeX."
echo " Do: 'make install' to install the t1lib-package."
echo ""
dnl echo " Do: 'make t1python-all' to compile the t1python-package."
dnl echo ""
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "autoconf"
dnl End:
|