diff options
author | lloyd <[email protected]> | 2007-03-04 08:46:14 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-03-04 08:46:14 +0000 |
commit | 2c8dd4223a9fb5bcf8e68778137e3f40d1c5dd1d (patch) | |
tree | a6d54352525c61ed69c0cfcdc2ce9cf9dbb7f70d | |
parent | d6debeaec24f7e1002fd77392bc82d25611d933b (diff) |
Handle out of tree builds a little better.
-rwxr-xr-x | configure.pl | 25 | ||||
-rw-r--r-- | misc/config/cc/gcc | 2 | ||||
-rw-r--r-- | misc/config/makefile/unix.in | 6 | ||||
-rw-r--r-- | misc/config/makefile/unix_shr.in | 8 |
4 files changed, 28 insertions, 13 deletions
diff --git a/configure.pl b/configure.pl index 8b67d3751..64a8bb337 100755 --- a/configure.pl +++ b/configure.pl @@ -79,9 +79,22 @@ sub main { &$default_value_is('autoconfig', 1); &$default_value_is('debug', 0); &$default_value_is('shared', 'yes'); - &$default_value_is('build-dir', 'build'); &$default_value_is('local_config', ''); + if(defined($$config{'build-dir'})) { + $$config{'botan-config'} = File::Spec->catfile($$config{'build-dir'}, 'botan-config'); + $$config{'makefile'} = File::Spec->catfile($$config{'build-dir'}, 'Makefile'); + $$config{'check_prefix'} = $$config{'build-dir'}; + $$config{'lib_prefix'} = $$config{'build-dir'}; + } + else { # defaults + $$config{'build-dir'} = 'build'; + $$config{'botan-config'} = 'botan-config'; + $$config{'makefile'} = 'Makefile'; + $$config{'check_prefix'} = ''; + $$config{'lib_prefix'} = ''; + } + choose_target($config, $target); my $os = $$config{'os'}; @@ -404,7 +417,7 @@ sub get_options { 'prefix=s' => sub { &$save_option(@_); }, 'docdir=s' => sub { &$save_option(@_); }, 'libdir=s' => sub { &$save_option(@_); }, - 'build-dir=s' => sub { &$save_option('build', $_[0]); }, + 'build-dir=s' => sub { $$config{'build-dir'} = $_[1]; }, 'local-config=s' => sub { &$save_option('local_config', slurp_file($_[1])); }, @@ -1297,10 +1310,12 @@ sub write_pkg_config { $$config{'link_to'} = libs('-l', '', 'm', @{$$config{'mod_libs'}}); + my $botan_config = $$config{'botan-config'}; + process_template( File::Spec->catfile($$config{'config-dir'}, 'botan-config.in'), - 'botan-config', $config); - chmod 0755, 'botan-config'; + $botan_config, $config); + chmod 0755, $botan_config; delete $$config{'link_to'}; } @@ -1562,7 +1577,7 @@ sub generate_makefile { trace("'$make_style' -> '$template'"); - process_template($template, 'Makefile', $config); + process_template($template, $$config{'makefile'}, $config); } ################################################## diff --git a/misc/config/cc/gcc b/misc/config/cc/gcc index 0088f6758..1485037c2 100644 --- a/misc/config/cc/gcc +++ b/misc/config/cc/gcc @@ -34,7 +34,7 @@ beos -> "ld -shared -h $(SONAME)" <mach_opt> # Specializations first (they don't need to be, just clearer) -i386 -> "-mcpu=i686 -momit-leaf-frame-pointer" +i386 -> "-mtune=i686 -momit-leaf-frame-pointer" r10000 -> "-mips4" alpha-ev67 -> "-mcpu=ev6" # FIXME: GCC 3.1 and on has -march=ev67 alpha-ev68 -> "-mcpu=ev6" diff --git a/misc/config/makefile/unix.in b/misc/config/makefile/unix.in index a4342da00..60f2dc57c 100644 --- a/misc/config/makefile/unix.in +++ b/misc/config/makefile/unix.in @@ -31,7 +31,7 @@ DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) OWNER = @{var:install_user} GROUP = @{var:install_group} -CONFIG_SCRIPT = botan-config +CONFIG_SCRIPT = @{var:botan_config} ################################################## # Aliases for Common Programs # @@ -51,7 +51,7 @@ RM_R = @rm -rf ################################################## # File Lists # ################################################## -CHECK = check +CHECK = @{var:check_prefix}check DOCS = @{var:doc_files} @@ -66,7 +66,7 @@ CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS) LIBRARIES = $(STATIC_LIB) -LIBNAME = libbotan +LIBNAME = @{var:lib_prefix}libbotan STATIC_LIB = $(LIBNAME).a all: $(LIBRARIES) diff --git a/misc/config/makefile/unix_shr.in b/misc/config/makefile/unix_shr.in index fc85f4ad3..9d9b70a99 100644 --- a/misc/config/makefile/unix_shr.in +++ b/misc/config/makefile/unix_shr.in @@ -33,7 +33,7 @@ DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) OWNER = @{var:install_user} GROUP = @{var:install_group} -CONFIG_SCRIPT = botan-config +CONFIG_SCRIPT = @{var:botan-config} ################################################## # Aliases for Common Programs # @@ -53,7 +53,7 @@ RM_R = @rm -rf ################################################## # File Lists # ################################################## -CHECK = check +CHECK = @{var:check_prefix}check DOCS = @{var:doc_files} @@ -68,13 +68,13 @@ CHECK_FLAGS = $(CHECK_OPT) $(LANG_FLAGS) $(WARN_FLAGS) LIBRARIES = $(STATIC_LIB) $(SHARED_LIB) -LIBNAME = libbotan +LIBNAME = @{var:lib_prefix}libbotan STATIC_LIB = $(LIBNAME).a SHARED_LIB = $(LIBNAME)-$(MAJOR).$(MINOR).$(PATCH).@{var:so_suffix} SONAME = $(LIBNAME)-$(MAJOR).$(MINOR).$(PATCH).@{var:so_suffix} -SYMLINK = $(LIBNAME).@{var:so_suffix} +SYMLINK = libbotan.@{var:so_suffix} all: $(LIBRARIES) |