aboutsummaryrefslogtreecommitdiffstats
path: root/main/vlc/uclibc-libcompat.patch
blob: e4008002f49d2b32c247115687ab5b6528c07f66 (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
commit c605c09bbc29d88619264c55c371c9dcbc839eda
Author: Natanael Copa <ncopa@alpinelinux.org>
Date:   Thu Jul 29 19:20:17 2010 +0000

    build: libcompat fix in case there are no functions to replace
    
    If the libc provides all the funcs in libcompat the libcompat.a will
    never be created due to LIBOBJS is empty (normally it contains whatever
    AC_REPLACE_FUNCS detects). This happens on uclibc.
    
    Since Makefile.am have a hardcoded LDADD to ../compat/libcompat.la things
    goes bad when there is no libcompat.a at all. We solve this by checking
    if LIBOBJS is set by AC_REPLACE_FUNCS and add libcompat via LTLIBCOMPAT.
    
    For alternative fixes see http://www.gnu.org/software/hello/manual/automake/LIBOBJS.html

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 92e6879..a941d99 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -60,5 +60,5 @@ vlc_win32_rc.$(OBJEXT): vlc_win32_rc.rc
 vlc_cache_gen_SOURCES = cachegen.c
 vlc_cache_gen_LDADD = \
 	$(GNUGETOPT_LIBS) \
-	../compat/libcompat.la \
+	$(LTLIBCOMPAT) \
 	../src/libvlc.la ../src/libvlccore.la
diff --git a/configure.ac b/configure.ac
index 52e4830..b385100 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,6 +547,14 @@ need_libc=false
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign openat posix_fadvise posix_madvise posix_memalign setenv setlocale stricmp strnicmp tdestroy uselocale])
 AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
+
+dnl Check that we actually need libcompat
+LTLIBCOMPAT=""
+if test "x${LIBOBJS}" != "x"; then
+	LTLIBCOMPAT="\$(top_builddir)/compat/libcompat.la"
+fi
+AC_SUBST(LTLIBCOMPAT)
+
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
diff --git a/modules/common.am b/modules/common.am
index 5e4d65f..9e2c739 100644
--- a/modules/common.am
+++ b/modules/common.am
@@ -24,7 +24,7 @@ AM_LDFLAGS = -rpath '$(libvlcdir)' \
 	-no-undefined \
 	 `$(VLC_CONFIG) --ldflags plugin $@`
 AM_LIBADD = `$(VLC_CONFIG) -libs plugin $@` \
-	$(LTLIBVLCCORE) $(top_builddir)/compat/libcompat.la
+	$(LTLIBVLCCORE) $(LTLIBCOMPAT)
 
 include $(srcdir)/Modules.am
 
diff --git a/src/Makefile.am b/src/Makefile.am
index f46a154..6aad884 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -201,7 +201,7 @@ libvlccore_la_LDFLAGS = `$(VLC_CONFIG) --ldflags libvlccore` $(AM_LDFLAGS) \
 	-export-symbols $(srcdir)/libvlccore.sym \
 	-version-info 5:0:0
 libvlccore_la_LIBADD = `$(VLC_CONFIG) -libs libvlccore` $(AM_LIBADD) \
-	$(LTLIBINTL) ../compat/libcompat.la
+	$(LTLIBINTL) $(LTLIBCOMPAT)
 libvlccore_la_DEPENDENCIES = libvlccore.sym
 if HAVE_WIN32
 libvlccore_la_DEPENDENCIES += libvlc_win32_rc.$(OBJEXT)
@@ -214,7 +214,7 @@ libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
 libvlc_la_SOURCES = $(SOURCES_libvlc_control)
 nodist_libvlc_la_SOURCES = revision.c
 libvlc_la_LIBADD = `$(VLC_CONFIG) -libs libvlc` \
-	libvlccore.la ../compat/libcompat.la
+	libvlccore.la $(LTLIBCOMPAT)
 libvlc_la_CFLAGS = `$(VLC_CONFIG) --cflags libvlc`
 libvlc_la_LDFLAGS = $(AM_LDFLAGS) `$(VLC_CONFIG) --ldflags libvlc` \
 	-version-info 6:0:1 \