1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#!/usr/bin/perl
print "makeFMStyle - converts standard pcsc-lite package sources\n \
to Apple framework style for use with Project Builder\n\n";
$sedcommand = "sed 's^<wintypes.h>^<PCSC/wintypes.h>^g' | \
sed 's^<winscard.h>^<PCSC/winscard.h>^g' | sed 's^<pcsclite.h>^<PCSC/pcsclite.h>^g'";
$sedpcsclite = "sed 's^\#include \<wintypes.h\>^\#define PCSC_USE_WINTYPES FALSE^g'";
opendir(DIR, ".") || die "Cannot opendir .\n";
@dents = readdir(DIR);
closedir(DIR);
printf "Adding PCSC/ to winscard, wintypes, and pcsclite.h\n";
foreach $dent (@dents) {
if ( $dent ne "test.c" ) {
if ( $dent =~ /\.c/ ) {
system("cat $dent | $sedcommand > tmpfile");
system("mv tmpfile $dent");
print "$dent\n";
}
if ( $dent =~ /bundleparser\.l/ ) {
system("cat $dent | $sedcommand > tmpfile");
system("mv tmpfile $dent");
print "$dent\n";
}
if ( $dent =~ /winscard\.h/ ) {
system("cat $dent | $sedcommand > tmpfile");
system("mv tmpfile $dent");
print "$dent\n";
}
}
}
# Remove include <wintypes.h> from pcsclite.h
print "Removing wintypes.h from pcsclite.h\n\n";
system("cat pcsclite.h | $sedpcsclite > tmpfile");
system("mv tmpfile pcsclite.h");
print "$dent\n";
|