GNOME Bugzilla – Bug 541412
cross mingw32 gcc: making libgstrtp plugin compile
Last modified: 2008-07-03 19:27:38 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.
Created attachment 113931 [details] [review] fix the build of libgstrtp in -good for mingw32
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.