Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
configure 41.20 KiB
#!/usr/bin/env perl
use strict;
#
# configuration script for the binary_c/nucsyn code
# This is version 2, a more modular, flexible script (I hope)
# without all the dirty hacks, just some of them! :)
#
# useage:
# 
# Normal use, auto-detected CPU optimization:
# ./configure
#
# Debugging (-g):
# ./confgure debug
#
# Debugging with -O3:
# ./configure optdebug
#
# Accurate (try to prevent floating point issues)
# ./configure accurate
#
# For DUMA (http://en.wikipedia.org/wiki/Duma_%28software%29)
# ./configure duma
#
# Generic build, e.g. for condor support (http://en.wikipedia.org/wiki/Condor_High-Throughput_Computing_System)
# ./configure generic
#
# For automatic building with profiling (for gcc or icc):
# ./configure profile

use vars qw($acmlflags $auto_opt $binary $bits @c_files $cc $cflags $generic $coptflags $cpu %cpuinfo $Dcflags $debug $accurate $duma $extrainc $extralibdirs $extralibs $features $hostname %icc_opts $ld $ldflags $ldpath $lib $make $makefilename $nolic $nprocessors $opt $os $owd $optdebug $src_dir $static %suncc_opts $tbse_test $v $vb $use_precomp $precomp_file $precomp_build_flags $precomp_use_flags $global_warn $compiler_version $sanitize $standard $soname $depsubflags @dataobjects);

print "Configuration for binary_c/nucsyn\n";

checks();
defaults();
parse_args();
features();
secondary_variables();
make_dataobjects();
create_master_makefile('Makefile');
checkpath();
make_symlink();
make_version_numbers();

print "Configuration for binary_c/nucsyn complete\nNow run ./make to build binary_c/nucsyn\n",$global_warn;
exit;

#££££££££££££££££££££££££££££££££££££££££££££££££££££££££££££

sub make_symlink
{
    symlink 'src/binary_c','binary_c';  # make symlink
}

sub checkpath
{
    # check that . is in the current path, if not there might be problems
    my @path=split(':',$ENV{PATH});
    my %path;
    map{$path{$_}=1}@path;
    print "Warning: . is not in your PATH environment variable.\n" if(!defined($path{'.'}));
}

sub checks
{
    # 1 check that we have basic tools
    map
    {
	#print "Check $_\n";