# HG changeset patch
# User Philipp Kewisch <philipp@bugzilla.kewis.ch>
# Date 1521730439 -3600
# Node ID f44cfb13e72d37bbe96ea2b5f82514e34150f543
# Parent  5e1cd8191d43ee71693dc35cee3e1496f633f07e
Bug 1447907 - Port bug 1429875 to TB: re-write linkage logic in moz.build. rs=bustage-fix DONTBUILD CLOSED TREE

diff --git a/calendar/libical/src/libical/Makefile.in b/calendar/libical/src/libical/Makefile.in
--- a/calendar/libical/src/libical/Makefile.in
+++ b/calendar/libical/src/libical/Makefile.in
@@ -37,28 +37,16 @@
 
 DEFINES += -DHAVE_CONFIG_H
 DEFINES += -DHAVE_SNPRINTF
 
 ifneq (,$(filter BeOS Darwin OpenVMS NetBSD FreeBSD,$(OS_ARCH)))
 DEFINES	+= -D__USE_BSD=1
 endif
 
-INSTALL_TARGETS += ical
-ical_FILES := ical.h
-ical_DEST = $(DIST)/include
-ical_TARGET := export
-
-CSRCS += \
-	icalderivedparameter.c \
-	icalderivedproperty.c \
-	icalderivedvalue.c \
-	icalrestriction.c \
-	$(NULL)
-
 include $(moztopsrcdir)/config/rules.mk
 
 ######################################################################
 #
 # Generate files that are automatically generated (*.h.in and *.c.in)
 # and ical.h
 #
 
diff --git a/calendar/libical/src/libical/moz.build b/calendar/libical/src/libical/moz.build
--- a/calendar/libical/src/libical/moz.build
+++ b/calendar/libical/src/libical/moz.build
@@ -23,16 +23,38 @@ UNIFIED_SOURCES += [
     'icaltimezone.c',
     'icaltypes.c',
     'icalvalue.c',
     'pvl.c',
     'sspm.c',
     'vsnprintf.c',
 ]
 
+SOURCES += [
+    '!icalderivedparameter.c',
+    '!icalderivedproperty.c',
+    '!icalderivedvalue.c',
+    '!icalrestriction.c',
+]
+
+GENERATED_FILES += [
+    'ical.h',
+    'icalderivedparameter.c',
+    'icalderivedparameter.h',
+    'icalderivedproperty.c',
+    'icalderivedproperty.h',
+    'icalderivedvalue.c',
+    'icalderivedvalue.h',
+    'icalrestriction.c',
+]
+
+EXPORTS += [
+    '!ical.h'
+]
+
 # We allow warnings for third-party code that can be updated from upstream.
 AllowCompilerWarnings()
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '../..'
 ]

