-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
181 lines (145 loc) · 4.99 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
AC_PREREQ([2.58])
dnl PLEASE remove the nano when doing a release
AC_INIT(gst-streaming-server,0.10.0.1)
AS_NANO([GSS_UNRELEASED=no],[GSS_UNRELEASED=yes])
AC_CANONICAL_HOST([])
AM_INIT_AUTOMAKE(1.6)
GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
AC_CONFIG_HEADERS(config.h)
dnl CURRENT, REVISION, AGE
dnl - library source changed -> increment REVISION
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
GSS_LIBVERSION="0:0:0"
AC_SUBST(GSS_LIBVERSION)
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AM_PROG_AS
AC_PROG_CXX
AM_PROG_CC_C_O
AC_SYS_LARGEFILE
LT_PATH_NM
dnl allow for different autotools
AS_AUTOTOOLS_ALTERNATE
AC_CONFIG_SRCDIR([gst-streaming-server/gss-server.c])
AC_CONFIG_MACRO_DIR([m4])
ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
AC_SUBST(ACLOCAL_AMFLAGS)
dnl set up gettext
dnl the version check needs to stay here because autopoint greps for it
#AM_GNU_GETTEXT_VERSION([0.11.5])
#AM_GNU_GETTEXT([external])
AC_CHECK_LIBM
AC_SUBST(LIBM)
AS_COMPILER_FLAG(-Wall, GSS_CFLAGS="$GSS_CFLAGS -Wall")
if test "x$GSS_UNRELEASED" = "xyes"
then
AS_COMPILER_FLAG(-Werror, GSS_CFLAGS="$GSS_CFLAGS -Werror")
fi
#AS_COMPILER_FLAG(-O3, CFLAGS=`echo $CFLAGS | sed s/O2/O3/`)
#AS_COMPILER_FLAG(-O3, CXXFLAGS=`echo $CXXFLAGS | sed s/O2/O3/`)
# Enable severe pain
#AS_COMPILER_FLAGS(COMPANY_CFLAGS,"-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default")
#COMPANY_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default"
#GSS_CFLAGS="$GSS_CFLAGS $COMPANY_CFLAGS"
##################################################
# Check for gtk-doc.
##################################################
if test "x$cross_compiling" = "xyes" ; then
enable_gtk_doc=no
fi
GTK_DOC_CHECK([1.0])
########################
# GStreamer stuff
########################
PKG_PROG_PKG_CONFIG()
AC_ARG_WITH(gst-api-version,
AC_HELP_STRING([--with-gst-api-version],[0.10,1.0,auto (default auto)]),
[], [with_gst_api_version=auto])
case "${with_gst_api_version}" in
0.10|1.0)
GST_API_VERSION="${with_gst_api_version}"
;;
auto)
if ${PKG_CONFIG} --exists gstreamer-1.0 ; then
GST_API_VERSION=1.0
elif ${PKG_CONFIG} --exists gstreamer-0.10 ; then
GST_API_VERSION=0.10
else
GST_API_VERSION=1.0
fi
;;
*)
echo "Bad gst-api-version: $with_gst_api_version"
;;
esac
dnl *** check for arguments to configure ***
GLIB_REQ=2.26.0
PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQ, HAVE_GLIB=yes, HAVE_GLIB=no)
if test "$HAVE_GLIB" != yes ; then
echo "glib-2.0 >= $GLIB_REQ is required to build"
exit 1
fi
PKG_CHECK_MODULES(GST, gstreamer-$GST_API_VERSION gstreamer-base-$GST_API_VERSION gstreamer-video-$GST_API_VERSION gstreamer-audio-$GST_API_VERSION,
HAVE_GST=yes, HAVE_GST=no)
if test "$HAVE_GST" != yes ; then
echo GStreamer and gst-plugns-base are needed to build
exit 1
fi
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
PKG_CHECK_MODULES(GST_RTSP_SERVER, gst-rtsp-server-$GST_API_VERSION >= 0.10.1,
HAVE_GST_RTSP_SERVER=yes, HAVE_GST_RTSP_SERVER=no)
if test "$HAVE_GST_RTSP_SERVER" = yes ; then
AC_DEFINE(ENABLE_RTSP, 1, [Enable RTSP])
else
#echo gst-rtsp-server is needed to build
#exit 1
:
fi
AM_CONDITIONAL(ENABLE_RTSP, [test "$HAVE_GST_RTSP_SERVER" = yes])
AC_SUBST(GST_RTSP_SERVER_CFLAGS)
AC_SUBST(GST_RTSP_SERVER_LIBS)
LIBSOUP_REQ=2.38.0
PKG_CHECK_MODULES(SOUP, libsoup-2.4 > LIBSOUP_REQ, HAVE_SOUP=yes, HAVE_SOUP=no)
if test "$HAVE_SOUP" != yes ; then
echo libsoup is needed to build
exit 1
fi
AC_SUBST(SOUP_CFLAGS)
AC_SUBST(SOUP_LIBS)
JSON_GLIB_REQ=1.0
PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 > JSON_GLIB_REQ, HAVE_JSON_GLIB=yes, HAVE_JSON_GLIB=no)
if test "$HAVE_JSON_GLIB" != yes ; then
echo json-glib is needed to build
exit 1
fi
AC_SUBST(JSON_GLIB_CFLAGS)
AC_SUBST(JSON_GLIB_LIBS)
AM_CONDITIONAL(ENABLE_STATIC_LIB, [false])
GST_ALL_LDFLAGS="-no-undefined"
AC_SUBST(GST_ALL_LDFLAGS)
AM_CONDITIONAL(HAVE_FALSE, false)
GSS_CFLAGS="$GSS_CFLAGS -I\$(top_srcdir)"
AC_SUBST(GSS_CFLAGS)
GSS_LIBS="\$(top_builddir)/gst-streaming-server/libgss-$GST_API_VERSION.la"
AC_SUBST(GSS_LIBS)
AS_HOST_DEFINES()
AC_CONFIG_FILES([
Makefile
doc/Makefile
gst-streaming-server/Makefile
pkgconfig/Makefile
pkgconfig/gst-streaming-server-uninstalled.pc
pkgconfig/gst-streaming-server.pc
tools/Makefile
doc/version.entities
])
AC_OUTPUT
#case "$host_os" in
# mingw32*)
# sed 's/^deplibs_check_method=.*/deplibs_check_method="pass_all"/' libtool >libtool.tmp && mv libtool.tmp libtool
# ;;
#esac