From c5f78f7f736824438fb2d4e39ec58898ebb91754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwenol=C3=A9=20Beauchesne?= Date: Mon, 24 Jan 2005 21:34:57 +0000 Subject: add check-multiarch-files --- check-multiarch-files | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100755 check-multiarch-files diff --git a/check-multiarch-files b/check-multiarch-files new file mode 100755 index 0000000..5b556fb --- /dev/null +++ b/check-multiarch-files @@ -0,0 +1,90 @@ +#!/usr/bin/perl +#--------------------------------------------------------------- +# Project : Mandrakelinux +# Module : multiarch-utils +# File : check-multiarch +# Version : $Id$ +# Author : Gwenole Beauchesne +# Created On : Mon Jan 24 18:02:21 CET 2005 +#--------------------------------------------------------------- + +use strict; +use MDK::Common; + +while () { + chomp; + + # File must be located in the usual development directories + -f $_ or next; + /\/usr(\/X11R6)?\/(bin|include)\// or next; + /\/multiarch-.*-linux\// and next; + /\/include\/asm/ and next; + + my $multiarch = 0; + my $multiarch_type; + + # Heuristics for binary files + if (/bin/) { + my $file_magic = `file $_`; + $multiarch_type = "binary"; + + # check for *-config script files + if (/.+-config/ && $file_magic =~ /shell script/) { + my $options; + foreach (cat_($_)) { + $options .= " --cflags" if /\[--cflags\]/; + $options .= " --libs" if /\[--libs\]/; + $options .= " --ldflags" if /\[--ldflags\]/; + $options .= " --cppflags" if /\[--cppflags\]/; + } + # run the script to find out any libdir dependent flags + if ($options) { + my $output = `$_ $options`; + $multiarch = 1 if ($output =~ /(?