-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
186 lines (140 loc) · 4.61 KB
/
configure.ac
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
### Version
m4_define([v_maj], [0])
m4_define([v_min], [0])
m4_define([v_mic], [1])
m4_define([libdvi_version], [v_maj.v_min.v_mic])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
AC_INIT([libdvi], [libdvi_version], [vincent dot torri at gmail dot com])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
# AC_PROG_C** defines CFLAGS to -g -O2 if CFLAGS is empty. Let's use our CFLAGS
AC_MSG_CHECKING([whether CFLAGS is empty])
if test "x$CFLAGS" = "x" ; then
no_cflags="yes"
else
no_cflags="no"
fi
AC_MSG_RESULT([${no_cflags}])
CFLAGS_SHELL=${CFLAGS}
CFLAGS=""
AC_USE_SYSTEM_EXTENSIONS
### If the host is ceGCC, we exit
AC_CANONICAL_HOST
have_win32="no"
case "$host_os" in
cegcc* | mingw32ce*)
AC_MSG_ERROR([Windows CE is not supported. Exiting...])
;;
mingw*)
have_win32="yes"
;;
esac
AM_INIT_AUTOMAKE([1.11 dist-xz subdir-objects])
AM_SILENT_RULES([yes])
LT_PREREQ([2.4])
LT_INIT([win32-dll disable-static])
VMAJ=v_maj
AC_SUBST([VMAJ])
version_info="lt_cur:lt_rev:lt_age"
AC_SUBST([version_info])
### configure options
AC_ARG_WITH([kpathsea-dll-path],
[AS_HELP_STRING([--with-kpathsea-dll-path], [set path to kpathsea DLL on Windows @<:@default=auto@:>@])],
[kpathsea_dll=$with_kpathsea_dll_path
],
[kpathsea_dll="auto"])
if ! test "x${kpathsea_dll}" = "xauto" && test "x${have_win32}" = "xyes" ; then
AC_DEFINE_UNQUOTED([KPATHSEA_DLL], ["${kpathsea_dll}"], [Define to the given value of the kpathsea DLL on Windows])
fi
AC_ARG_ENABLE([release],
[AS_HELP_STRING([--enable-release], [set release mode @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_release="yes"
else
enable_release="no"
fi
],
[enable_release="no"])
if test "x${enable_release}" = "xyes" ; then
AC_DEFINE([NDEBUG], [1], [Define to 1 if release mode is wanted])
else
AC_DEFINE([_DEBUG], [1], [Define to 1 if debug mode is wanted])
fi
### Needed information
### Checks for programs
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_EXEEXT
AC_ARG_VAR([KPSEWHICH], ["kpsewhich tool"])
AC_CHECK_PROG([KPSEWHICH], [kpsewhich${EXEEXT}], [kpsewhich${EXEEXT}], ["none"])
if ! test "x${KPSEWHICH}" = "xnone" ; then
AC_DEFINE_UNQUOTED([KPSEWHICH], ["${KPSEWHICH}"], ["Define to the value of the kpsewhich binary"])
fi
### Checks for libraries
AC_SEARCH_LIBS([kpathsea_new], [kpathsea], [have_kpathsea_lib="yes"], [have_kpathsea_lib="no"])
if test "x${have_kpathsea_lib}" = "xyes" ; then
AC_DEFINE([HAVE_KPATHSEA_LIB], [1], [Define to 1 if kpathsea library is found])
fi
### Checks for header files
AC_CHECK_HEADERS([kpathsea.h], [have_kpathsea_header="yes"], [have_kpathsea_header="no"])
if test "x${have_kpathsea_header}" = "xno" ; then
AC_CHECK_HEADERS([kpathsea/kpathsea.h], [have_kpathsea_header="yes"], [have_kpathsea_header="no"])
fi
if test "x${have_kpathsea_header}" = "xyes" ; then
AC_DEFINE([HAVE_KPATHSEA_HEADER], [1], [Define to 1 if kpathsea header is found])
fi
### Checks for types
### Checks for structures
### Checks for compiler characteristics
DVI_ATTRIBUTE_UNUSED
if test "x${no_cflags}" = "xyes" ; then
DVI_CFLAGS="-pedantic -Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wpointer-arith -Wno-variadic-macros -Wno-missing-field-initializers -Winline -Wwrite-strings"
if test "x${have_win32}" = "xyes" ; then
DVI_CFLAGS="${DVI_CFLAGS} -Wno-pedantic-ms-format"
fi
if test "x${enable_release}" = "xno" ; then
DVI_CFLAGS="${DVI_CFLAGS} -g3 -ggdb3 -O2"
fi
fi
AC_SUBST([DVI_CFLAGS])
### Checks for linker characteristics
### Checks for library functions
### Checks for system services
AC_SYS_LARGEFILE
AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT
echo
echo "$PACKAGE $VERSION"
echo
echo "Configuration Options Summary:"
echo
echo " OS...................: ${host_os}"
echo
echo " Release mode.........: ${enable_release}"
echo
if ! test "x${KPSEWHICH}" = "xnone" ; then
echo " kpsewhich............: ${KPSEWHICH}"
else
echo " kpsewhich............: no"
fi
echo " kpathsea library.....: ${have_kpathsea_lib}"
echo " kpathsea header......: ${have_kpathsea_header}"
echo
echo "Compilation............: make (or gmake)"
echo " Environment flags....:"
echo " CPPFLAGS...........: $CPPFLAGS"
echo " CFLAGS.............: $CFLAGS"
echo " LDFLAGS............: $LDFLAGS"
echo " libdvi flags.........:"
echo " DVI_CFLAGS.........: ${DVI_CFLAGS}"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............: $prefix"
echo