From 1d6212e788a4ae3ef06dfd80cd73ff020c34a5cd Mon Sep 17 00:00:00 2001 From: giraffedata Date: Thu, 4 Dec 2008 17:45:56 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@779 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- buildtools/configure.pl | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'buildtools') diff --git a/buildtools/configure.pl b/buildtools/configure.pl index 32984b7d..98570ddd 100755 --- a/buildtools/configure.pl +++ b/buildtools/configure.pl @@ -1240,6 +1240,26 @@ sub gnuOptimizeOpt($) { +sub gnuCflags($) { + my ($gccCommandName) = @_; + + return("CFLAGS = " . gnuOptimizeOpt($gccCommandName) . " -ffast-math " . + " -pedantic -fno-common " . + "-Wall -Wno-uninitialized -Wmissing-declarations -Wimplicit " . + "-Wwrite-strings -Wmissing-prototypes -Wundef\n"); +} + + + +sub makeCompilerGcc($) { + my ($config_mkR) = @_; + my $compileCommand = 'gcc'; + push(@{$config_mkR}, "CC = $compileCommand\n"); + push(@{$config_mkR}, gnuCflags($compileCommand)); +} + + + sub findProcessManagement($) { my ($dontHaveProcessMgmtR) = @_; #----------------------------------------------------------------------------- @@ -1940,29 +1960,12 @@ if (-f("GNUmakefile")) { $defaultConfigInPath = "$srcdir/config.mk.in"; } -sub makeCompilerGcc($) { - my ($config_mkR) = @_; - my $compileCommand = 'gcc'; - push(@{$config_mkR}, "CC = $compileCommand\n"); - push(@{$config_mkR}, gnuCflags($compileCommand)); -} - - #****************************************************************************** # # BUILD config.mk # #***************************************************************************** -sub gnuCflags($) { - my ($gccCommandName) = @_; - - return("CFLAGS = " . gnuOptimizeOpt($gccCommandName) . " -ffast-math " . - " -pedantic -fno-common " . - "-Wall -Wno-uninitialized -Wmissing-declarations -Wimplicit " . - "-Wwrite-strings -Wmissing-prototypes -Wundef\n"); -} - my @config_mk; # This is the complete config.mk contents. We construct it here # and ultimately write the whole thing out as config.mk. @@ -2014,14 +2017,11 @@ if (defined($netpbmlib_runtime_path)) { } if ($platform eq "GNU") { - my $compileCommand; if (!commandExists("cc") && commandExists("gcc")) { - $compileCommand = "gcc"; - push(@config_mk, "CC = $compileCommand\n"); + makeCompilerGcc(\@config_mk); } else { - $compileCommand = "cc"; + push(@config_mk, gnuCflags('cc')); } - push(@config_mk, gnuCflags($compileCommand)); # The merged programs have a main_XXX subroutine instead of main(), # which would cause a warning with -Wmissing-declarations or # -Wmissing-prototypes. -- cgit 1.4.1