-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfigure.ac
169 lines (154 loc) · 4.48 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
AC_INIT([onvif-apps], [1.0.0-git], [[email protected]])
VERSION_MAJOR=1
VERSION_MINOR=0
VERSION_REVISION=0
VERSION_EXTRA=0
VERSION_DEV=git
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_PROG_CC_C99
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([
Makefile
contrib/Makefile
contrib/gsoap2/Makefile
contrib/onvif/Makefile
src/Makefile
])
LT_INIT([dlopen win32-dll shared disable-static])
LT_LANG([C++])
LT_LANG([Windows Resource])
dnl
dnl Check the operating system
dnl
HAVE_WIN64="0"
case "${host_os}" in
"")
SYS=unknown
;;
linux*)
SYS=linux
;;
*mingw32* | *cygwin* | *wince* | *mingwce*)
AC_CHECK_TOOL(WINDRES, windres, :)
AC_CHECK_TOOL(OBJCOPY, objcopy, :)
AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows XP SP2 APIs.])
AC_DEFINE([_WIN32_IE], 0x0600, [Define to '0x0600' for IE 6.0 (and shell) APIs.])
case "${host_os}" in
*wince* | *mingwce* | *mingw32ce*)
SYS=mingwce
dnl Sadly CeGCC still needs non-wince macros
;;
*mingw32*)
SYS=mingw32
;;
*cygwin*)
dnl Check if we are using the mno-cygwin mode in which case we are
dnl actually dealing with a mingw32 compiler.
AC_EGREP_CPP(yes,
[#ifdef WIN32
yes
#endif],
SYS=mingw32, AC_MSG_ERROR([ONVIF-APPS requires -mno-cygwin]))
;;
esac
if test "${SYS}" = "mingw32"; then
dnl ONVIF-APPS_ADD_LIBS([libonvifcore],[-lws2_32])
dnl ONVIF-APPS_ADD_LDFLAGS([],[-mwindows])
dnl
dnl NSIS Installer prefix and WIN64
dnl
case "${host}" in
amd64*|x86_64*)
HAVE_WIN64="1"
PROGRAMFILES="PROGRAMFILES64"
;;
*)
PROGRAMFILES="PROGRAMFILES"
;;
esac
AC_SUBST(PROGRAMFILES)
fi
;;
*)
SYS="${host_os}"
;;
esac
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
dnl
dnl Check for the contrib directory
dnl
AC_ARG_WITH(contrib,
[AS_HELP_STRING([--with-contrib[=DIR]],
[search for 3rd party libraries in DIR/include and DIR/lib])
])
AC_MSG_CHECKING([for 3rd party libraries path])
AS_IF([test -z "${with_contrib}" || test "${with_contrib}" = "yes"], [
CONTRIB_DIR="${srcdir}/contrib/${host}"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR="${srcdir}/contrib/`$CC -dumpmachine`"
AS_IF([test ! -d "${CONTRIB_DIR}"], [
echo "${CONTRIB_DIR} not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not found])
])
])
], [
AS_IF([test "${with_contrib}" != "no"], [
CONTRIB_DIR="${with_contrib}"
], [
CONTRIB_DIR=""
AC_MSG_RESULT([disabled])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AS_IF([test -d "${CONTRIB_DIR}/lib"],[
CONTRIB_DIR=`cd "${CONTRIB_DIR}" && pwd`
], [
echo "${CONTRIB_DIR}/lib not found" >&AS_MESSAGE_LOG_FD
CONTRIB_DIR=""
AC_MSG_RESULT([not usable])
])
])
AS_IF([test -n "${CONTRIB_DIR}"], [
AC_MSG_RESULT([${CONTRIB_DIR}])
export PATH=${CONTRIB_DIR}/bin:$PATH
CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
CFLAGS="${CFLAGS} -I${CONTRIB_DIR}/include"
CXXFLAGS="${CXXFLAGS} -I${CONTRIB_DIR}/include"
OBJCFLAGS="${OBJCFLAGS} -I${CONTRIB_DIR}/include"
AS_IF([test "$build" = "$host" -o "$PKG_CONFIG_LIBDIR"], [
export PKG_CONFIG_PATH="${CONTRIB_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
], [
export PKG_CONFIG_LIBDIR="${CONTRIB_DIR}/lib/pkgconfig"
])
LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
], [
AS_IF([test -n "${with_contrib}" && test "${with_contrib}" != "no"], [
AC_MSG_ERROR([Third party libraries not found!])
])
])
AC_SUBST(CONTRIB_DIR)
dnl
dnl Sadly autoconf does not think about testing foo.exe when ask to test
dnl for program foo on win32
case "${build_os}" in
cygwin|msys)
ac_executable_extensions=".exe"
;;
*)
;;
esac
AM_CONDITIONAL(HAVE_LINUX, test "${SYS}" = "linux")
AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
AC_ARG_ENABLE(ns-onvif1,
[ --enable-ns-onvif1 Namespace onvif1 support (default enabled)])
AC_ARG_ENABLE(ns-wsa,
[ --enable-ns-wsa Namespace wsa support (default enabled)])
AC_OUTPUT