-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
199 lines (173 loc) · 7.72 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
187
188
189
190
191
192
193
194
195
196
197
198
199
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
dnl ---------------------------------------------
dnl May work with pre 2.67, but this is not tested
dnl ---------------------------------------------
AC_PREREQ([2.67])
dnl ---------------------------------------------
dnl Versioning
dnl ---------------------------------------------
# A number is attached to the name of the DLL that reflects its LibTool interface version number. The interface of a
# library is the set of global variables and global functions it exports. It is described by three integers:
#
# current: The most recent interface number that this library implements.
# revision: The implementation number of the current interface.
# age: The difference between the newest and oldest interfaces that this library implements.
# In other words, the library implements all the interface numbers in the range from number current - age to current.
#
# The LibTool version number is usually given in the form current:revision:age. This means that:
#
# If interfaces have been changed or added, but binary compatibility has been preserved, change to current+1:0:age+1
# If binary compatibility has been broken, e.g. due to removed or changed interfaces, change to current+1:0:0
# If the interface is the same as the previous version, change to current:revision+1:age
#AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_INIT(libdvdetect, 0.71.0, [email protected],, http://www.dvdetect.de)
AC_SUBST(LIBDVDETECT_VERSION_MAJOR, `echo $PACKAGE_VERSION | sed 's/\(.*\)\..*\..*/\1/g'`)
AC_SUBST(LIBDVDETECT_VERSION_MINOR, `echo $PACKAGE_VERSION | sed 's/.*\.\(.*\)\..*/\1/g'`)
AC_SUBST(LIBDVDETECT_VERSION_PATCH, `echo $PACKAGE_VERSION | sed 's/.*\..*\.\(.*\)/\1/g'`)
AC_SUBST(LIBDVDETECT_VERSION_NUMBER, `printf "0x%02x%02x%02x" $LIBDVDETECT_VERSION_MAJOR $LIBDVDETECT_VERSION_MINOR $LIBDVDETECT_VERSION_PATCH`)
AC_SUBST(libdvdetect_la_CURRENT, `echo $LIBDVDETECT_VERSION_MAJOR`)
AC_SUBST(libdvdetect_la_REVISION, `echo $LIBDVDETECT_VERSION_MINOR`)
AC_SUBST(libdvdetect_la_AGE, `echo $LIBDVDETECT_VERSION_PATCH`)
dnl ---------------------------------------------
dnl Makefile setup
dnl ---------------------------------------------
AC_CONFIG_SRCDIR(configure.ac)
#AC_CONFIG_SRCDIR(config.h.in)
AC_CONFIG_HEADERS(config.h)
dnl ---------------------------------------------
dnl See if system has md5 support. If not, use our code.
dnl ---------------------------------------------
AC_CHECK_LIB([crypto],[MD5_Init],,[AC_MSG_WARN([No md5 support on system. Fallback to using our own emulation.])])
AC_CHECK_LIB([crypto],[MD5_Init],[AC_SUBST([MD5AVAILABLE],[1])],[AC_SUBST([MD5AVAILABLE],[0])])
AM_CONDITIONAL([HAVE_MD5], [test "$MD5AVAILABLE" = "1"])
dnl ---------------------------------------------
dnl Checks for functions.
dnl ---------------------------------------------
AC_CHECK_FUNCS(strptime,,[AC_MSG_WARN([No strptime on system. Fallback to using our own emulation.])])
AC_CHECK_FUNCS(strptime,[AC_SUBST([STRPTIMEAVAILABLE],[1])],[AC_SUBST([STRPTIMEAVAILABLE],[0])])
AM_CONDITIONAL([HAVE_STRPTIME], [test "$STRPTIMEAVAILABLE" = "1"])
dnl ---------------------------------------------
dnl Distribution archive
dnl ---------------------------------------------
#AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
dnl ---------------------------------------------
dnl Check for cygwin
dnl ---------------------------------------------
AC_SUBST([OSTYPE])
AM_CONDITIONAL([HAVE_CYGWIN], [test "$OSTYPE" = "cygwin"])
dnl ---------------------------------------------
dnl windoze stuff
dnl ---------------------------------------------
AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h],
[have_windows=true],
[AC_MSG_NOTICE([Building for Windows target.])],
[[#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
]])
AM_CONDITIONAL([HAVE_WIN32], [test "$OS" = "Windows_NT"])
AM_CONDITIONAL([HAVE_WIN32], [test "x$have_windows" = "xtrue"])
dnl ---------------------------------------------
dnl Checks for programs.
dnl ---------------------------------------------
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
LT_INIT
AC_PROG_LIBTOOL
AC_CONFIG_MACRO_DIR([m4])
AC_LIBTOOL_WIN32_DLL
# Checks for libraries.
# FIXME: Replace `main' with a function in `-lQtCore':
#AC_CHECK_LIB([QtCore], [main])
# FIXME: Replace `main' with a function in `-lQtGui':
#AC_CHECK_LIB([QtGui], [main])
# FIXME: Replace `main' with a function in `-lcrypto':
#AC_CHECK_LIB([crypto], [main])
# FIXME: Replace `main' with a function in `-lpthread':
#AC_CHECK_LIB([pthread], [main])
# FIXME: Replace `main' with a function in `-ltinyxml':
#AC_CHECK_LIB([tinyxml], [main], [], [
# AC_MSG_ERROR([unable to find the cos() function])
#])
# FIXME: Replace `main' with a function in `-lws2_32':
#AC_CHECK_LIB([ws2_32], [main])
dnl ==================
dnl Checks for tinyxml
dnl ==================
AC_CHECK_LIB([tinyxml],
[main],
[have_tinyxml_library=true],
[AC_MSG_WARN([tinyxml library not found. Embedded tinyxml code will be built.])])
AC_LANG_PUSH([C++])
AC_CHECK_HEADER([tinyxml.h],
[have_tinyxml_header=true],
[AC_MSG_WARN([tinyxml library not found. Embedded tinyxml code will be built.])],
[])
AC_LANG_POP([C++])
if test "x$have_tinyxml_library" != "xtrue" -o "x$have_tinyxml_header" != "xtrue"
then
build_tinyxml=yes
else
build_tinyxml=no
AC_DEFINE([TIXML_USE_STL], [1], [Define to 1 to use STL string in TinyXML])
fi
AM_CONDITIONAL([BUILD_TINYXML], [test "x$build_tinyxml" = "xyes"])
dnl ---------------------------------------------
dnl Check if we are running on a big endian machine
dnl ---------------------------------------------
AC_C_BIGENDIAN
# Checks for header files.
AC_CHECK_HEADERS([limits.h stddef.h unistd.h sys/socket.h sys/types.h sys/stat.h netinet/in.h arpa/inet.h poll.h netdb.h stdint.h stdbool.h assert.h openssl/md5.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
#AC_FUNC_MALLOC
AC_FUNC_MKTIME
# http://rickfoosusa.blogspot.de/2011/11/howto-fix-undefined-reference-to.html
#AC_FUNC_REALLOC
AC_CHECK_FUNCS([memmove memset select setenv setlocale socket strchr strdup strerror strncasecmp strrchr strstr strtoul tzset])
AC_CONFIG_FILES([Makefile \
examples/Makefile \
examples/c/Makefile \
examples/c++/Makefile \
include/Makefile \
include/dvdetect/Makefile \
include/dvdetect/version.h \
lib/Makefile \
tests/Makefile])
dnl ---------------------------------------------
dnl Check for doxygen (dynamic documentation generator)
dnl ---------------------------------------------
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)
dnl ---------------------------------------------
dnl Check for g++
dnl ---------------------------------------------
AC_CHECK_PROG(BUILD_CXX, g++, g++)
if test -z "$BUILD_CXX"; then
AC_MSG_ERROR([g++ is required to build libdvdetect])
fi
dnl ---------------------------------------------
dnl Add define for static build
dnl ---------------------------------------------
AM_CONDITIONAL([BUILDING_STATIC], [test x"$enable_static" = xyes])
AC_OUTPUT