After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 541412 - cross mingw32 gcc: making libgstrtp plugin compile
cross mingw32 gcc: making libgstrtp plugin compile
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-07-03 16:13 UTC by Damien Lespiau
Modified: 2008-07-03 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix the build of libgstrtp in -good for mingw32 (430 bytes, patch)
2008-07-03 16:14 UTC, Damien Lespiau
committed Details | Review

Description Damien Lespiau 2008-07-03 16:13:04 UTC
Symptom: when cross-compiling with mingw32 from a linux box, it stops with:

/home/damien/src/build-gst-plugins-good-0.10.8/gst/rtp/../../../gst-plugins-good-0.10.8/gst/rtp/gstasteriskh263.c:207: undefined reference to `_htonl@4'
/home/damien/src/build-gst-plugins-good-0.10.8/gst/rtp/../../../gst-plugins-good-0.10.8/gst/rtp/gstasteriskh263.c:208: undefined reference to `_htons@4'

because htonl and htons are defined in ws2_32.dll.

If you look at the makefile WINSOCK2_LIBS should be set correctly:

if HAVE_WINSOCK2_H
WINSOCK2_LIBS = -lws2_32
else
WINSOCK2_LIBS =
endif

but it's not: (gst/rtp/Makefile)

WINSOCK2_LIBS = 
#WINSOCK2_LIBS = -lws2_32

This is because of a wrong use of the pair AC_CHECK_HEADERS/AM_CONDITIONAL
AC_CHECK_HEADERS([winsock2.h])
AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")

(the AC_CHECK_HEADERS lacks the script part that set HAVE_WINSOCK2_H)

-------

The proposed patch adds a HAVE_WINSOCK2_H=yes in the above AC_CHECK_HEADERS but one could prefer relying on WIN32_LIBS defined later in the configure.ac file.
Comment 1 Damien Lespiau 2008-07-03 16:14:39 UTC
Created attachment 113931 [details] [review]
fix the build of libgstrtp in -good for mingw32
Comment 2 Sebastian Dröge (slomo) 2008-07-03 19:27:38 UTC
2008-07-03  Sebastian Dröge  <sebastian.droege@collabora.co.uk>

        Patch by: Damien Lespiau <damien dot lespiau at gmail dot com>

        * configure.ac:
        Fix build of the RTP plugin with mingw32 by linking to ws2_32
        for htons() and htonl(). Fixes bug #541412.