From 59498fa94e044604ace91a0f7dc06e8740e6cf9b Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 20 Oct 2013 20:00:51 +0000 Subject: Use interface for MMX SSE instrinsics instead of GCC-specific verisons git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2022 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- buildtools/configure.pl | 62 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'buildtools') diff --git a/buildtools/configure.pl b/buildtools/configure.pl index 2179454b..8f1c46ba 100755 --- a/buildtools/configure.pl +++ b/buildtools/configure.pl @@ -99,7 +99,7 @@ sub prompt($$) { sub promptYesNo($) { - my ($default) = $@; + my ($default) = @_; my $retval; @@ -947,6 +947,7 @@ sub getInttypes($) { } + sub getInt64($$) { my ($inttypes_h, $haveInt64R) = @_; @@ -982,6 +983,59 @@ sub getInt64($$) { +sub determineMmxCapability($) { + + my ($haveEmmintrinR) = @_; + + if (defined($testCc)) { + + print("(Doing test compiles to determine if your compiler has MMX " . + "intrinsics -- ignore errors)\n"); + + my $cflags = testCflags(); + + my $works; + + my @cSourceCode = ( + "#include \n", + ); + + testCompile($cflags, \@cSourceCode, \my $success); + + if ($success) { + print("It does.\n"); + $$haveEmmintrinR = 'Y'; + } else { + print("It does not. Programs will not exploit fast MMX " . + "instructions.\n"); + $$haveEmmintrinR = 'N'; + } + print("\n"); + } else { + $$haveEmmintrinR = "N"; + } +} + + + +sub getMmx($) { + + my ($wantMmxR) = @_; + + determineMmxCapability(\my $haveEmmintrin); + + my $gotit; + + print("Use MMX instructions?\n"); + print("\n"); + + my $default = $haveEmmintrin ? "y" : "n"; + + $$wantMmxR = promptYesNo($default); +} + + + # TODO: These should do test compiles to see if the headers are in the # default search path, both to create a default to offer and to issue a # warning after user has chosen. Also test links to test the link library. @@ -1959,6 +2013,8 @@ getInttypes(\my $inttypesHeaderFile); getInt64($inttypesHeaderFile, \my $haveInt64); +getMmx(\my $wantMmx); + findProcessManagement(\my $dontHaveProcessMgmt); #****************************************************************************** @@ -2385,6 +2441,10 @@ if ($haveInt64 ne 'Y') { push(@config_mk, "HAVE_INT64 = $haveInt64\n"); } +if ($wantMmx) { + push(@config_mk, "WANT_MMX = Y\n"); +} + if ($dontHaveProcessMgmt) { push(@config_mk, "DONT_HAVE_PROCESS_MGMT = Y\n"); } -- cgit 1.4.1