GNOME Bugzilla – Bug 316086
MinGW compilation: fileindexer depends on mmap
Last modified: 2006-01-13 13:44:14 UTC
gst/indexers/gstfileindex.c depends on mmap, it should be disabled on platforms which do not support this feature.
The code in gstreamer/plugins/indexers/Makefile.am: if GST_DISABLE_LOADSAVE GST_LOADSAVE_SRC = else GST_LOADSAVE_SRC = gstfileindex.c endif if HAVE_MMAP else GST_LOADSAVE_SRC = endif doesn't disable the compilation of gstfileindex.c correctly if working on system without mmap. It should be rather replaced by: if HAVE_MMAP if GST_DISABLE_LOADSAVE GST_LOADSAVE_SRC = else GST_LOADSAVE_SRC = gstfileindex.c endif else GST_LOADSAVE_SRC = endif This is the diff output of Makefile.in and Makefile (.bak is with corrected) $ diff -Nau Makefile.in Makefile.in.bak --- Makefile.in Mon Dec 12 16:28:35 2005 +++ Makefile.in.bak Mon Dec 12 16:28:41 2005 @@ -85,7 +85,7 @@ am__DEPENDENCIES_1 = am__libgstcoreindexers_la_SOURCES_DIST = gstindexers.c gstmemindex.c \ gstfileindex.c -@GST_DISABLE_LOADSAVE_FALSE@am__objects_1 = libgstcoreindexers_la- gstfileindex.lo +@GST_DISABLE_LOADSAVE_FALSE@@HAVE_MMAP_TRUE@am__objects_1 = libgstcoreindexers_la-gstfileindex.lo am_libgstcoreindexers_la_OBJECTS = \ libgstcoreindexers_la-gstindexers.lo \ libgstcoreindexers_la-gstmemindex.lo $(am__objects_1) @@ -382,9 +382,9 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ plugin_LTLIBRARIES = libgstcoreindexers.la -@GST_DISABLE_LOADSAVE_FALSE@GST_LOADSAVE_SRC = gstfileindex.c +@GST_DISABLE_LOADSAVE_FALSE@@HAVE_MMAP_TRUE@GST_LOADSAVE_SRC = gstfileindex.c # file index uses xml -@GST_DISABLE_LOADSAVE_TRUE@GST_LOADSAVE_SRC = +@GST_DISABLE_LOADSAVE_TRUE@@HAVE_MMAP_TRUE@GST_LOADSAVE_SRC = @HAVE_MMAP_FALSE@GST_LOADSAVE_SRC = libgstcoreindexers_la_DEPENDENCIES = $(top_builddir)/gst/libgstreamer- @GST_MAJORMINOR@.la libgstcoreindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC) $ diff -Nau Makefile Makefile.bak --- Makefile Mon Dec 12 16:29:19 2005 +++ Makefile.bak Mon Dec 12 16:28:30 2005 @@ -85,7 +85,7 @@ am__DEPENDENCIES_1 = am__libgstcoreindexers_la_SOURCES_DIST = gstindexers.c gstmemindex.c \ gstfileindex.c -am__objects_1 = libgstcoreindexers_la-gstfileindex.lo +#am__objects_1 = libgstcoreindexers_la-gstfileindex.lo am_libgstcoreindexers_la_OBJECTS = \ libgstcoreindexers_la-gstindexers.lo \ libgstcoreindexers_la-gstmemindex.lo $(am__objects_1) @@ -384,7 +384,7 @@ plugin_LTLIBRARIES = libgstcoreindexers.la GST_LOADSAVE_SRC = gstfileindex.c # file index uses xml -#GST_LOADSAVE_SRC = +##GST_LOADSAVE_SRC = GST_LOADSAVE_SRC = libgstcoreindexers_la_DEPENDENCIES = $(top_builddir)/gst/libgstreamer-0.10.la libgstcoreindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC) This is make output: gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../libs -I../.. -I../.. - I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include - I/usr/local/include/libxml2 -Wall -Werror -g -DGST_DISABLE_DEPRECATED -g -O2 - MT libgstcoreindexers_la-gstfileindex.lo -MD -MP - MF .deps/libgstcoreindexers_la-gstfileindex.Tpo -c gstfileindex.c - DDLL_EXPORT -DPIC -o .libs/libgstcoreindexers_la-gstfileindex.o gstfileindex.c:24:22: sys/mman.h: No such file or directory gstfileindex.c: In function `_file_index_id_free': gstfileindex.c:215: warning: implicit declaration of function `munmap' gstfileindex.c: In function `gst_file_index_load': gstfileindex.c:439: warning: implicit declaration of function `mmap' gstfileindex.c:439: error: `PROT_READ' undeclared (first use in this function) gstfileindex.c:439: error: (Each undeclared identifier is reported only once gstfileindex.c:439: error: for each function it appears in.) gstfileindex.c:439: error: `MAP_SHARED' undeclared (first use in this function) gstfileindex.c:440: warning: assignment makes pointer from integer without a cast gstfileindex.c:442: error: `MAP_FAILED' undeclared (first use in this function) gstfileindex.c: In function `gst_file_index_commit': gstfileindex.c:603: error: too many arguments to function `mkdir' make: *** [libgstcoreindexers_la-gstfileindex.lo] Error 1
This is the correct diff of bad ang good Makefile: $ diff -Nau Makefile Makefile.bak --- Makefile Mon Dec 12 16:29:19 2005 +++ Makefile.bak Mon Dec 12 16:42:34 2005 @@ -85,7 +85,7 @@ am__DEPENDENCIES_1 = am__libgstcoreindexers_la_SOURCES_DIST = gstindexers.c gstmemindex.c \ gstfileindex.c -am__objects_1 = libgstcoreindexers_la-gstfileindex.lo +#am__objects_1 = libgstcoreindexers_la-gstfileindex.lo am_libgstcoreindexers_la_OBJECTS = \ libgstcoreindexers_la-gstindexers.lo \ libgstcoreindexers_la-gstmemindex.lo $(am__objects_1) @@ -229,7 +229,7 @@ GST_VERSION_MICRO = 0 GST_VERSION_MINOR = 10 GST_VERSION_NANO = 1 -GST_VERSION_RELEASE = 0.20051212.162840 +GST_VERSION_RELEASE = 0.20051209.050248 GTK_DOC_USE_LIBTOOL_FALSE = # GTK_DOC_USE_LIBTOOL_TRUE = HAVE_CHECK_FALSE = @@ -382,9 +382,9 @@ sysconfdir = ${prefix}/etc target_alias = plugin_LTLIBRARIES = libgstcoreindexers.la -GST_LOADSAVE_SRC = gstfileindex.c +#GST_LOADSAVE_SRC = gstfileindex.c # file index uses xml -#GST_LOADSAVE_SRC = +##GST_LOADSAVE_SRC = GST_LOADSAVE_SRC = libgstcoreindexers_la_DEPENDENCIES = $(top_builddir)/gst/libgstreamer-0.10.la libgstcoreindexers_la_SOURCES = gstindexers.c gstmemindex.c $(GST_LOADSAVE_SRC)
fixed, thanks for the report. in the future, it's best if you supply patches to Makefile.am, not Makefile - since the first is the one that is actually the source.