gcc: limit postinst and postrm only with INCLUDE_STATIC_LINK_SPEC
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 11 Jan 2023 21:34:27 +0000 (22:34 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 11 Jan 2023 21:49:27 +0000 (22:49 +0100)
Limit postinst and postrm only with INCLUDE_STATIC_LINK_SPEC enabled
as it's only needed to install and remove the generated spec file.

Also remove extra tab from scripts.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
devel/gcc/Makefile

index 99f3fd6ebcafecf3062fbbafaf4af538b2ecbabd..934de788bdd05d6b3e9488bbd17b13cf157188e0 100644 (file)
@@ -234,14 +234,18 @@ define Package/gcc/install
        chmod +x $(1)/usr/bin/gcc_env.sh
 endef
 
+ifeq ($(CONFIG_INCLUDE_STATIC_LINK_SPEC),y)
 define Package/gcc/postinst
-       #!/bin/sh
-       $(INSTALL_STATIC_SPEC)
+#!/bin/sh
+
+$(INSTALL_STATIC_SPEC)
 endef
 
 define Package/gcc/postrm
-       #!/bin/sh
-       $(REMOVE_STATIC_SPEC)
+#!/bin/sh
+
+$(REMOVE_STATIC_SPEC)
 endef
+endif
 
 $(eval $(call BuildPackage,gcc))