Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions aconfigure
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,8 @@ enable_kqueue
enable_epoll
enable_shared
enable_pjsua2
with_upnp
enable_upnp
with_external_speex
with_external_gsm
with_external_srtp
Expand Down Expand Up @@ -1526,6 +1528,7 @@ Optional Features:
--enable-shared Build shared libraries
--disable-pjsua2 Exclude pjsua2 library and application from the
build
--disable-upnp Disable UPnP (default: not disabled)
--disable-resample Disable resampling implementations
--disable-sound Exclude sound (i.e. use null sound)
--disable-video Disable video feature
Expand Down Expand Up @@ -1575,6 +1578,7 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-upnp=DIR Specify alternate libupnp prefix
--with-external-speex Use external Speex development files, not the one in
"third_party" directory. When this option is set,
make sure that Speex is accessible to use (hint: use
Expand Down Expand Up @@ -6584,6 +6588,93 @@ case $target in
esac




# Check whether --with-upnp was given.
if test ${with_upnp+y}
then :
withval=$with_upnp;
else $as_nop
with_upnp=no

fi


if test "x$ac_cross_compile" != "x" -a "x$with_upnp" = "xno"; then
enable_upnp=no
fi

# Check whether --enable-upnp was given.
if test ${enable_upnp+y}
then :
enableval=$enable_upnp;
if test "$enable_upnp" = "no"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Checking if UPnP is disabled... yes" >&5
printf "%s\n" "Checking if UPnP is disabled... yes" >&6; }
fi

else $as_nop

if test "x$with_upnp" != "xno" -a "x$with_upnp" != "x"; then
UPNP_PREFIX=$with_upnp
UPNP_CFLAGS="-I$UPNP_PREFIX/upnp/inc -I$UPNP_PREFIX/ixml/inc"
UPNP_LDFLAGS="-L$UPNP_PREFIX/upnp/.libs -L$UPNP_PREFIX/imxl/.libs"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using UPnP prefix... $with_upnp" >&5
printf "%s\n" "Using UPnP prefix... $with_upnp" >&6; }
else
UPNP_CFLAGS=""
UPNP_LDFLAGS=""
fi

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking UPnP usability" >&5
printf %s "checking UPnP usability... " >&6; }

UPNP_LIBS="-lupnp -lixml"

SAVED_LIBS="$LIBS"
SAVED_LDFLAGS="$LDFLAGS"
SAVED_CFLAGS="$CFLAGS"

LIBS="$UPNP_LIBS $LIBS"
LDFLAGS="$UPNP_LDFLAGS $LDFLAGS"
CFLAGS="$UPNP_CFLAGS $CFLAGS"

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <upnp/upnp.h>
int
main (void)
{
UpnpInit2(NULL, 0);

;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
CFLAGS="$CFLAGS -DPJLIB_UTIL_HAS_UPNP=1 $UPNP_CFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS $UPNP_LIBS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

else $as_nop

LIBS="$SAVED_LIBS"
LDFLAGS="$SAVED_LDFLAGS"
CFLAGS="$SAVED_CFLAGS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }

fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext


fi



ac_external_speex=0


Expand Down
66 changes: 66 additions & 0 deletions aconfigure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,72 @@ case $target in
;;
esac

dnl ##########################################
dnl # PJLIB-UTIL
dnl #


dnl # UPnP alt prefix
AC_ARG_WITH(upnp,
AS_HELP_STRING([--with-upnp=DIR],
[Specify alternate libupnp prefix]),
[],
[with_upnp=no]
)

dnl # Do not use default libupnp installation if we are cross-compiling
if test "x$ac_cross_compile" != "x" -a "x$with_upnp" = "xno"; then
enable_upnp=no
fi

dnl # UPnP
AC_ARG_ENABLE(upnp,
AS_HELP_STRING([--disable-upnp],
[Disable UPnP (default: not disabled)]),
[
if test "$enable_upnp" = "no"; then
AC_MSG_RESULT([Checking if UPnP is disabled... yes])
fi
],
[
if test "x$with_upnp" != "xno" -a "x$with_upnp" != "x"; then
UPNP_PREFIX=$with_upnp
UPNP_CFLAGS="-I$UPNP_PREFIX/upnp/inc -I$UPNP_PREFIX/ixml/inc"
UPNP_LDFLAGS="-L$UPNP_PREFIX/upnp/.libs -L$UPNP_PREFIX/imxl/.libs"
AC_MSG_RESULT([Using UPnP prefix... $with_upnp])
else
UPNP_CFLAGS=""
UPNP_LDFLAGS=""
fi

AC_MSG_CHECKING([UPnP usability])

UPNP_LIBS="-lupnp -lixml"

SAVED_LIBS="$LIBS"
SAVED_LDFLAGS="$LDFLAGS"
SAVED_CFLAGS="$CFLAGS"

LIBS="$UPNP_LIBS $LIBS"
LDFLAGS="$UPNP_LDFLAGS $LDFLAGS"
CFLAGS="$UPNP_CFLAGS $CFLAGS"

AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <upnp/upnp.h>]],
[UpnpInit2(NULL, 0);]
)],
[ CFLAGS="$CFLAGS -DPJLIB_UTIL_HAS_UPNP=1 $UPNP_CFLAGS"
LDFLAGS="$LDFLAGS $UPNP_LDFLAGS $UPNP_LIBS"
AC_MSG_RESULT(yes)
],
[
LIBS="$SAVED_LIBS"
LDFLAGS="$SAVED_LDFLAGS"
CFLAGS="$SAVED_CFLAGS"
AC_MSG_RESULT(no)
])

])

dnl ##########################################
dnl #
dnl # PJMEDIA
Expand Down
2 changes: 1 addition & 1 deletion pjlib-util/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export PJLIB_UTIL_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \
dns_dump.o dns_server.o getopt.o hmac_md5.o hmac_sha1.o \
http_client.o json.o md5.o pcap.o resolver.o scanner.o sha1.o \
srv_resolver.o string.o stun_simple.o \
stun_simple_client.o xml.o
stun_simple_client.o upnp.o xml.o
export PJLIB_UTIL_CFLAGS += $(_CFLAGS)
export PJLIB_UTIL_CXXFLAGS += $(_CXXFLAGS)
export PJLIB_UTIL_LDFLAGS += $(PJLIB_LDLIB) $(_LDFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions pjlib-util/build/pjlib_util.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@
<ClCompile Include="..\src\pjlib-util\stun_simple.c" />
<ClCompile Include="..\src\pjlib-util\stun_simple_client.c" />
<ClCompile Include="..\src\pjlib-util\symbols.c" />
<ClCompile Include="..\src\pjlib-util\upnp.c" />
<ClCompile Include="..\src\pjlib-util\xml.c" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -780,6 +781,7 @@
<ClInclude Include="..\include\pjlib-util\string.h" />
<ClInclude Include="..\include\pjlib-util\stun_simple.h" />
<ClInclude Include="..\include\pjlib-util\types.h" />
<ClInclude Include="..\include\pjlib-util\upnp.h" />
<ClInclude Include="..\include\pjlib-util\xml.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
6 changes: 6 additions & 0 deletions pjlib-util/build/pjlib_util.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
<ClCompile Include="..\src\pjlib-util\xml.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\pjlib-util\upnp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\pjlib-util\base64.h">
Expand Down Expand Up @@ -178,5 +181,8 @@
<ClInclude Include="..\include\pjlib-util\xml.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\pjlib-util\upnp.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
3 changes: 3 additions & 0 deletions pjlib-util/include/pjlib-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
/* Old STUN */
#include <pjlib-util/stun_simple.h>

/* UPnP */
#include <pjlib-util/upnp.h>

/* PCAP */
#include <pjlib-util/pcap.h>

Expand Down
Loading