File: propagate-ccflags.patch

package info (click to toggle)
ocsinventory-agent 2%3A2.10.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,424 kB
  • sloc: perl: 26,492; xml: 773; objc: 528; sh: 386; ansic: 333; makefile: 12
file content (22 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Propagate CPPFLAGS, CCFLAGS and LDFLAGS for ipdiscover compilation
 ipdiscover is built during "configure" step (perl Makefile.PL). Makefile.PL
 ignores CC flags for this binary compilation. Bug reported upstream.
Bug: https://github.com/OCSInventory-NG/UnixAgent/issues/140
Forwarded: https://github.com/OCSInventory-NG/UnixAgent/issues/140
Author: Xavier Guimard <x.guimard@free.fr>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2023-01-29

--- a/Makefile.PL
+++ b/Makefile.PL
@@ -86,8 +86,8 @@
 #Ugly hack to include ipdiscover binary compilation and install for Linux systems
 if ($^O =~ /^linux$/i && can_cc()) {
     my $cc=$Config::Config{cc};
-    my $ld=$Config::Config{ldflags};
-    my $cf=$Config::Config{ccflags};
+    my $ld="$Config::Config{ldflags} $ENV{LDFLAGS}";
+    my $cf="$Config::Config{ccflags} $ENV{CFLAGS} $ENV{CPPFLAGS}";
     my $op=$Config::Config{optimize};
     system("$cc $cf $ld $op resources/ipdiscover/ipdiscover.c -o ipdiscover");
     if (-f 'ipdiscover') {