forked from kidaa/xalan-c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
164 lines (129 loc) · 3.79 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script
AC_INIT(src/xalanc/PlatformSupport/PlatformSupportDefinitions.hpp)
dnl Checks for programs
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
dnl Check for gcc problems
if test "$CXX" = "g++" -o "$CXX" = "c++"; then
AC_MSG_CHECKING([whether -fno-elide-constructors works correctly])
old_cxxflags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -fno-elide-constructors"
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <vector>],
[],
[AC_MSG_RESULT([yes])],
CXXFLAGS=$old_cxxflags
[AC_MSG_RESULT([no])]);
fi
dnl
dnl Do not know how to use this macro, so comment it out.
dnl
dnl special pthread handling (AIX uses pthreads instead of pthread)
dnl AC_CHECK_LIB(pthread, pthread_create)
dnl if test $ac_cv_lib_pthread_pthread_create = no; then
dnl AC_CHECK_LIB(pthreads, pthread_create)
dnl fi
dnl
dnl Determine the host system and Makefile fragment
AC_CANONICAL_HOST
dnl Platform-specific Makefile setup
case "${host}" in
*-*-solaris*) platform=SOLARIS ;;
*-*-linux*) platform=LINUX ;;
*-*-k*bsd*) platform-LINUX;;
*-*-freebsd*) platform=FREEBSD ;;
*-*-netbsd*) platform=NETBSD ;;
*-*-openbsd*) platform=OPENBSD ;;
*-*-irix*) platform=IRIX ;;
*-*-aix*) platform=AIX ;;
ia64-hp*) platform=HPUX ; osver=HPUX11 ; osvariant=IA64;;
*-*-hp*) platform=HPUX ;
case "${host}" in
*-*-hpux11*) osver=HPUX11;;
*-*-hpux10*) osver=HPUX10;;
*) osver=HPUX11;;
esac;;
*-*-mvs*) platform=OS390 ;;
*-*-osf*) platform=TRU64 ;;
*-apple-darwin*) platform=MACOSX ;;
*-*-os400*) platform=OS400 ;;
*-*-OS400*) platform=OS400 ;;
*-*-cygwin*) platform=CYGWIN ;;
*-*-mingw*) platform=MINGW ;;
*) platform=UNKNOWN ;;
esac
dnl Checks for libraries
if test "$platform" != "OS400"; then
AC_CHECK_LIB(m, floor)
fi
dnl check if mbstowcs is available and can correctly count only
AC_HEADER_STDC
AC_CHECK_FUNCS([mbstowcs],,,)
if test x"$ac_cv_func_mbstowcs" = x"no"; then
WCSTOMBS="-DXALAN_USE_XERCES_LOCAL_CODEPAGE_TRANSCODERS"
else
AC_MSG_CHECKING(if mbstowcs can count only)
AC_TRY_RUN([
#if STDC_HEADERS
#include <stdlib.h>
#endif
int main(int argc, char *argv[])
{
wchar_t in[5] = { 0x74, 0x65, 0x73, 0x74, 0x00 };
if (wcstombs(0, in, 0) == -1) {
exit(1);
}
exit(0);
}], [AC_MSG_RESULT(yes)],
[WCSTOMBS="-DXALAN_USE_XERCES_LOCAL_CODEPAGE_TRANSCODERS";
AC_MSG_RESULT(no)],
[WCSTOMBS="-DXALAN_USE_XERCES_LOCAL_CODEPAGE_TRANSCODERS";
AC_MSG_RESULT(cross-compiling default)])
fi
AC_SUBST(platform)
cxx=${CXX}
AC_SUBST(cxx)
cc=${CC}
AC_SUBST(cc)
AC_SUBST(prefix)
dnl Not used:
AC_SUBST(osver)
AC_SUBST(osvariant)
cxxflags=${CXXFLAGS}
AC_SUBST(cxxflags)
dnl Not used:
cppflags=${CPPFLAGS}
AC_SUBST(cppflags)
cflags=${CFLAGS}
AC_SUBST(cflags)
ldflags=${LDFLAGS}
AC_SUBST(ldflags)
libs=${LIBS}
AC_SUBST(libs)
transcoder=${TRANSCODER}
AC_SUBST(transcoder)
xalan_locale_system=${XALAN_LOCALE_SYSTEM}
AC_SUBST(xalan_locale_system)
xalan_locale=${XALAN_LOCALE}
AC_SUBST(xalan_locale)
wcstombs=${WCSTOMBS}
AC_SUBST(wcstombs)
dnl Not used:
threads=${THREADS}
AC_SUBST(threads)
bitstobuild=${BITSTOBUILD}
AC_SUBST(bitstobuild)
dnl output the Makefiles
if test ! -d src; then
mkdir src
fi
AC_OUTPUT([Makefile.incl \
Makefile \
src/xalanc/Makefile \
src/xalanc/Utils/Makefile \
src/xalanc/Utils/MsgCreator/Makefile \
src/xalanc/Utils/XalanMsgLib/Makefile \
samples/Makefile \
Tests/Makefile])