+# Building HsLibs libraries.
+#
+# Inputs:
+# $(PACKAGE) is the name of the library to build
+# $(IS_CBITS_LIB) should be "YES" for a "cbits" library
+#
+# Outputs:
+# $(LIBRARY) the name of the library.a
+# $(GHIC_LIBRARY) the name of the library.o (for GHCi)
+# $(LIBOBJS) objects to put in library
+# $(STUBOBJS) more objects to put in library
+#
+# $(LIBOBJS) is set to $(HS_OBJS) or $(C_OBJS) depending
+# on whether or not it's a "cbits" library. But you can
+# override this by setting $(LIBOBJS) yourself
+
+ifneq "$(PACKAGE)" ""
+
+# add syslib dependencies and current package name
+SRC_HC_OPTS += -package-name $(PACKAGE)
+SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS))