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
|
dnl allow for --program-suffix
AC_ARG_PROGRAM
sinclude(../kpathsea/withenable.ac)
sinclude(../../withenable.ac)
sinclude(kpathsea.ac)
if test "x$with_mktexpk_default" = "xno"; then
AC_MSG_WARN(Xdvik doesn't implement the --without-mktexpk-default option!)
fi
if test "x$with_mktexmf_default" = "xno"; then
AC_MSG_WARN(Xdvik doesn't implement the --without-mktexmf-default option!)
fi
if test "x$with_mktextfm_default" = "xno"; then
AC_MSG_WARN(Xdvik doesn't implement the --without-mktextfm-default option!)
fi
if test "x$with_mkocp_default" = "xno"; then
AC_MSG_WARN(Xdvik doesn't implement the --without-mkocp-default option!)
fi
if test "x$with_mkofm_default" = "xno"; then
AC_MSG_WARN(Xdvik doesn't implement the --without-mkofm-default option!)
fi
dnl ##########
dnl SU: added flags to turn on gcc warnings, taken from gnome/compiler-flags.m4 and put into aclocal.m4
COMPILER_WARNINGS
dnl ##########
cppflags_save=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADERS(X11/Intrinsic.h X11/Xosdefs.h X11/xpm.h Xm/XpmP.h)
CPPFLAGS=$cppflags_save
dnl For editres, we need to check both the header and define a linker option.
cppflags_save=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADERS(X11/Xmu/Editres.h X11/Xmu/Xmu.h, x_xmu_lib=-lXmu, x_xmu_lib=,
[
#ifdef HAVE_X11_INTRINSIC_H
# include <X11/Intrinsic.h>
#endif
])
AC_SUBST(x_xmu_lib)
CPPFLAGS=$cppflags_save
dnl For the bitmap size. -- I think this is in XDVI_C_BITMAP_TYPE now -janl
dnl AC_CHECK_SIZEOF(long)
sinclude(../kpathsea/xt.ac)
sinclude(withenable.ac)
sinclude(../../libs/t1lib/withenable.ac)
sinclude(../../libs/t1lib/t1lib.ac)
dnl check for Xaw version
XDVI_OLD_XAW
dnl nl_langinfo checks
AC_MSG_CHECKING(if nl_langinfo(CODESET) is working)
AC_TRY_LINK([#include <langinfo.h>], [char* cs = nl_langinfo(CODESET);],
[AC_DEFINE([HAVE_WORKING_NL_LANGINFO_CODESET], 1,
[Define if the CODESET argument to nl_langinfo works.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)]
)
dnl First, check for libXp and libXext:
if test -z "$x_ext_lib"; then # allow envvar override
if test -n "$x_libraries"; then
XLFLAG="-L$x_libraries"
else
XLFLAG=
fi
AC_CHECK_LIB(Xp, XpQueryVersion,
x_ext_lib="-lXp -lXext", :, -lXext -lX11 $X_EXTRA_LIBS $XLFLAG)
fi
dnl
dnl If libXp not found, try libXext only:
dnl
if test -z "$x_ext_lib"; then # previous test unsuccessful, or envvar override
if test -n "$x_libraries"; then
XLFLAG="-L$x_libraries"
else
XLFLAG=
fi
AC_CHECK_LIB(Xext, XextCreateExtension,
x_ext_lib=-lXext, :, -lX11 $X_EXTRA_LIBS $XLFLAG)
fi
AC_SUBST(x_ext_lib)
dnl For --with-x-toolkit. Must be Xaw at least. If no --with-x-toolkit is given,
dnl we try to check if Motif is available, and if yes, use it; else,
dnl we use Xaw (--with-x-toolkit=xaw can be used to override this default).
dnl Check whether -lXpm can be used
XDVI_FIND_XPM
dnl Check which X toolkit to use
prog_extension="xaw"
motif_include=
motif_libdir=
AC_ARG_WITH([motif-include],
[ --with-motif-include=DIR
Specify the location of Motif include files],
[motif_include="$withval"])
AC_ARG_WITH([motif-libdir],
[ --with-motif-libdir=DIR
Specify the location of Motif libraries],
[motif_libdir="$withval"])
if test "x$with_xdvi_x_toolkit" = xxaw3d; then
prog_extension="xaw3d"
x_tool_libs="-lXaw3d"
elif test "x$with_xdvi_x_toolkit" = xneXtaw; then
prog_extension="nextaw"
x_tool_libs="-lneXtaw"
elif test "x$with_xdvi_x_toolkit" = xmotif; then
dnl Motif with no fallback
dnl XDVI_FIND_MOTIF also defines $prog_extension, AC_DEFINE(toolkit) and $x_tool_libs
XDVI_FIND_MOTIF(none, "$motif_include", "$motif_libdir")
elif test "x$with_xdvi_x_toolkit" = xxaw; then
prog_extension="xaw"
AC_DEFINE([XAW], 1, [Define to use the Xaw toolkit.])
x_tool_libs="-lXaw"
else
dnl Motif with xaw as fallback
dnl XDVI_FIND_MOTIF also defines $prog_extension, AC_DEFINE(toolkit) and $x_tool_libs
XDVI_FIND_MOTIF(Xaw, "$motif_include", "$motif_libdir")
fi
AC_SUBST(x_tool_libs)
dnl ##########
dnl We try to perform the $program_transform_name replacement already
dnl here, and AC_SUBST the final names into the Makefile; this makes
dnl the compilation commands more readable and causes less problems with
dnl backtick magic inside other commands.
dnl
dnl For some reason, the doubling of $$ and \\ must be reverted here:
my_program_transform_name=`echo $program_transform_name | sed 's,\\$\\$,$,g' | sed 's,\\\\\\\\,\\\\,g'`
exec_name="xdvi-$prog_extension"
final_exec_name=`echo $exec_name | sed "$my_program_transform_name"`
dnl OBSOLETE?? exec_link=`echo xdvi.bin | sed "$my_program_transform_name"`
wrapper_script=`echo xdvi | sed "$my_program_transform_name"`
AC_SUBST(exec_name)
AC_SUBST(final_exec_name)
dnl OBSOLETE?? AC_SUBST(exec_link)
AC_SUBST(wrapper_script)
dnl
dnl Tests for different application setup features follow.
dnl
dnl For --with-ps.
test -z "$PS_DEF" && PS_DEF=-DPS_GS
test "$PS_DEF" = no && PS_DEF=
AC_SUBST(PS_DEF)dnl
dnl
dnl If we're on Solaris and we want DPS, then add the extra compilation stuff
dnl to get it.
if echo "$PS_DEF" | grep PS_DPS >/dev/null; then
if test "`(uname) 2>/dev/null`" = SunOS \
&& uname -r | grep '^5' >/dev/null; then
AC_MSG_RESULT(adding DPS includes and libraries for Solaris)
X_CFLAGS="$X_CFLAGS -I/usr/openwin/include/X11"
AC_CHECK_LIB(sunmath, isinf, ac_sunmath=-lsunmath, ac_sunmath="")
X_LIBS="$X_LIBS -R/usr/openwin/lib /usr/openwin/lib/libdps.so $ac_sunmath"
dnl We only need isinf and ieeefp.h to work around a Solaris bug in
dnl -ldps; see psdps.c. isinf is in -lsunmath.
AC_CHECK_FUNCS(isinf)
AC_CHECK_HEADERS(ieeefp.h)
else
dnl SunOS 4.x is simpler.
AC_MSG_RESULT(adding DPS includes and libraries for SunOS 4.x)
X_LIBS="$X_LIBS -ldps"
fi
elif echo "$PS_DEF" | grep PS_NEWS >/dev/null; then
AC_MSG_RESULT(adding NeWS libraries)
X_LIBS="$X_LIBS -lxview -lcps -lolgx -lxvps"
fi
dnl ##########
dnl ImageMagick support
PS_DEF="$PS_DEF $MAGICK_DEF"
if echo "$PS_DEF" | grep MAGICK >/dev/null; then
AC_MSG_RESULT(adding ImageMagick libraries)
X_EXTRA_LIBS="$X_EXTRA_LIBS `Magick-config --libs`"
fi
# If you're cross-compiling, these macros set up the variables in
# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc. These are
# near the end so people have some chance of seeing them.
KPSE_CROSS_BUILD_VAR(CC, cc)
KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))
KPSE_CONFIG_FILES([Makefile gui/Makefile tests/Makefile])
AC_CONFIG_FILES([xdvi-sh])
AC_OUTPUT
|