summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 3190a98597605bdf80d7aeefb5fdf2dc69dfee8d (plain)
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
AC_PREREQ([2.58])
dnl PLEASE remove the nano when doing a release
AC_INIT(gst-rtmp,0.1.0.1)

AS_NANO([GST_RTMP_UNRELEASED=no],[GST_RTMP_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
GST_RTMP_LIBVERSION="0:0:0"
AC_SUBST(GST_RTMP_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([rtmp/rtmpserver.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, GST_RTMP_CFLAGS="$GST_RTMP_CFLAGS -Wall")
if test "x$GST_RTMP_UNRELEASED" = "xyes"
then
  AS_COMPILER_FLAG(-Werror, GST_RTMP_CFLAGS="$GST_RTMP_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"
#GST_RTMP_CFLAGS="$GST_RTMP_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 gio-2.0,
    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)

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)

GST_ALL_LDFLAGS="-no-undefined"
AC_SUBST(GST_ALL_LDFLAGS)

AM_CONDITIONAL(HAVE_FALSE, false)

GST_RTMP_CFLAGS="$GST_RTMP_CFLAGS -I\$(top_srcdir)"
AC_SUBST(GST_RTMP_CFLAGS)

GST_RTMP_LIBS="\$(top_builddir)/rtmp/libgstrtmp-$GST_API_VERSION.la"
AC_SUBST(GST_RTMP_LIBS)


AS_HOST_DEFINES()

AC_CONFIG_FILES([
Makefile 
doc/Makefile
rtmp/Makefile
pkgconfig/Makefile
pkgconfig/gst-rtmp-uninstalled.pc
pkgconfig/gst-rtmp.pc
plugins/Makefile
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