-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
144 lines (114 loc) · 3.22 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT([Universal Encoding Detector], [0.1.0], [[email protected]])
AC_PREREQ(2.52)
AC_REVISION([Revision 0.1])
AC_CONFIG_AUX_DIR([build])
# Universal Encoding Detector Version control for include/universal_encoding_detector_version.h
UED_MAJOR_VERSION=0
UED_MINOR_VERSION=1
UED_MICRO_VERSION=0
UED_INTERFACE_AGE=0
UED_BINARY_AGE=0
UED_VERSION=$UED_MAJOR_VERSION.$UED_MINOR_VERSION.$UED_MICRO_VERSION
AC_SUBST(UED_MAJOR_VERSION)
AC_SUBST(UED_MINOR_VERSION)
AC_SUBST(UED_MICRO_VERSION)
AC_SUBST(UED_INTERFACE_AGE)
AC_SUBST(UED_BINARY_AGE)
AC_SUBST(UED_VERSION)
# Future user of modules and plugins version control
BINARY_VERSION=$UED_MAJOR_VERSION.$UED_MINOR_VERSION
# Define VERSION
VERSION=$UED_VERSION
PACKAGE="UniversalEncodingDetector"
ADDRESS="[email protected]"
AC_DEFINE_UNQUOTED(UED_VERSION,"$UED_VERSION",[The Universal Encoding Dectctor version])
# libtool versioning
LT_RELEASE=$UED_MAJOR_VERSION.$UED_MINOR_VERSION
LT_CURRENT=`expr $UED_MICRO_VERSION - $UED_INTERFACE_AGE`
LT_REVISION=$UED_INTERFACE_AGE
LT_AGE=`expr $UED_BINARY_AGE - $UED_INTERFACE_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, $ADDRESS)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_DISABLE_STATIC
need_libdl=yes
case x"$target" in
xNONE | x)
target_or_host="$host" ;;
*)
target_or_host="$target" ;;
esac
case "$target_or_host" in
*-cygwin)
dnl AC_ENABLE_STATIC
dnl AC_DISABLE_SHARED
;;
esac
AC_PROG_CC
AM_PROG_LIBTOOL
AM_CTAGSFLAGS="-f tags"
AC_CHECK_HEADER(stdbool.h, BUILD_UED_STDBOOL=1, BUILD_UED_STDBOOL=0)
AC_SUBST(BUILD_UED_STDBOOL)
AC_ARG_WITH(tests,
[ --with-tests build test programs[[default=no]]],
with_tests="$withval", with_tests=yes)
if test "$with_tests" = "yes"; then
with_tests=yes
CONF_BUILD_TESTS=1
fi
AC_SUBST(CONF_BUILD_TESTS)
AC_ARG_ENABLE(debug,
[ --enable-debug enable debugging [[default=no]]],enable_debug="$withval", enable_debug=no)
if test "$enable_debug" = "yes"; then
enable_debug=yes
CONF_BUILD_UED_DEBUG=1
CFLAGS="$CFLAGS -g3 -fno-inline"
else
CONF_BUILD_UED_DEBUG=0
fi
AC_SUBST(CONF_BUILD_UED_DEBUG)
AM_CONDITIONAL(BUILD_SHARED, test "$enable_shared" = "yes")
AM_CONDITIONAL(BUILD_STATIC, test "$enable_static" = "yes")
AM_CONDITIONAL(BUILD_UED_DEBUG, test "$enable_debug" = "yes")
AM_CONDITIONAL(BUILD_TESTS, test "$with_tests" = "yes")
MODULEDIRNAME=ued-$BINARY_VERSION
MODULEDIR=$libdir/$MODULEDIRNAME
DATADIR=$datadir/ued-$VERSION
INCLUDEDIR=$includedir/ued
SOPATH=$libdir/libued-$LT_RELEASE.so.$LT_CURRENT
dnl Dynamic Linker
DYNLIB=""
if test "$need_libdl" = "yes"; then
if test "$enable_shared" = "yes"; then
AC_CHECK_LIB(dl, dlopen, ,
AC_MSG_ERROR([
*** UED requires libdl.]))
DYNLIB="-ldl"
fi
fi
AC_SUBST(DYNLIB)
AC_SUBST(MODULEDIR)
AC_SUBST(MODULEDIRNAME)
AC_SUBST(DATADIR)
AC_SUBST(INCLUDEDIR)
AC_SUBST(SOPATH)
AC_CONFIG_FILES([
spec/universal_encoding_detector.pc
Makefile
include/universal_encoding_detector_version.h
include/Makefile
lib/build.h
lib/Makefile
src/Makefile
test/Makefile
detectors/Makefile
detectors/unicode/Makefile
detectors/ascii/Makefile
detectors/multibyte/Makefile
])
AC_OUTPUT