#!/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-.+-\w+\// 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_($_)) { foreach my $opt (qw(cflags libs ldflags cppflags libdir libtool)) { $options .= " --$opt" if /(\[--$opt\]|--$opt\s+([\#\[]|display))/; } } # run the script to find out any libdir dependent flags if ($options) { my $output = `$_ $options`; $multiarch = 1 if ($output =~ /(?