diff options
author | lloyd <[email protected]> | 2006-09-08 17:14:14 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-08 17:14:14 +0000 |
commit | 6b09407615e9bf9a0a719dedcff84019cf54202a (patch) | |
tree | 92762b94e007eea9f89c8334d1ba39d91faf3108 | |
parent | f66360f7abe1831cec58802adfb0900ba4333be9 (diff) |
Some minor simplifications for installation logic.
Inline print_unix_makefile and print_nmake_makefile into generate_makefile
-rwxr-xr-x | configure.pl | 95 | ||||
-rw-r--r-- | misc/config/makefile/nmake.in | 4 | ||||
-rw-r--r-- | misc/config/makefile/unix.in | 2 | ||||
-rw-r--r-- | misc/config/makefile/unix_shr.in | 2 | ||||
-rw-r--r-- | misc/config/os/defaults | 3 | ||||
-rw-r--r-- | misc/config/os/solaris | 3 | ||||
-rw-r--r-- | misc/config/os/windows | 6 |
7 files changed, 47 insertions, 68 deletions
diff --git a/configure.pl b/configure.pl index 855d2ba56..aeb641700 100755 --- a/configure.pl +++ b/configure.pl @@ -436,6 +436,8 @@ sub os_info_for { $result = $OPERATING_SYSTEM{'defaults'}{$what}; } + error("os_info_for: No info for $what on $os") unless defined $result; + return $result; } @@ -1038,7 +1040,8 @@ sub get_os_info { set_if_any(\&set_if, $_, \%info, 'os_type:obj_suffix:so_suffix:static_suffix:' . 'install_root:header_dir:lib_dir:doc_dir:' . - 'install_user:install_group:install_cmd:ar_needs_ranlib'); + 'install_user:install_group:ar_needs_ranlib:' . + 'install_cmd_data:install_cmd_exec'); read_hash($_, $reader, 'aliases', list_push(\@{$info{'aliases'}})); read_hash($_, $reader, 'arch', list_push(\@{$info{'arch'}})); @@ -1367,7 +1370,7 @@ sub print_pkg_config { return if($$config{'os'} eq 'generic' or $$config{'os'} eq 'windows'); - $$config{'link_to'} = libs('-l', '', 'm', @{$$config{'extra_libs'}}); + $$config{'link_to'} = libs('-l', '', 'm', @{$$config{'mod_libs'}}); process_template(File::Spec->catfile('misc', 'config', 'botan-config.in'), 'botan-config', $config); @@ -1489,6 +1492,11 @@ sub generate_makefile { 'so_suffix' => os_info_for($os, 'so_suffix'), 'obj_suffix' => os_info_for($os, 'obj_suffix'), + 'install_cmd_exec' => os_install_info($os, 'install_cmd_exec'), + 'install_cmd_data' => os_install_info($os, 'install_cmd_data'), + 'install_user' => os_install_info($os, 'install_user'), + 'install_group' => os_install_info($os, 'install_group'), + 'doc_files' => $docs, 'include_files' => $includes }); @@ -1515,24 +1523,40 @@ sub generate_makefile { }); my $template_dir = File::Spec->catdir('misc', 'config', 'makefile'); + my $template = undef; my $make_style = $$config{'make_style'}; + if($make_style eq 'unix') { - $$config{'makefile'} = File::Spec->catfile($template_dir, 'unix.in'); + $template = File::Spec->catfile($template_dir, 'unix.in'); - $$config{'makefile'} = File::Spec->catfile($template_dir, 'unix_shr.in') + $template = File::Spec->catfile($template_dir, 'unix_shr.in') if($make_shared); - print_unix_makefile($config); + $$config{'install_cmd_exec'} =~ s/(OWNER|GROUP)/\$($1)/g; + $$config{'install_cmd_data'} =~ s/(OWNER|GROUP)/\$($1)/g; + + add_to($config, { + 'link_to' => libs('-l', '', 'm', @{$$config{'mod_libs'}}), + }); } elsif($make_style eq 'nmake') { - $$config{'makefile'} = File::Spec->catfile($template_dir, 'nmake.in'); - print_nmake_makefile($config); - } - else { - error("This configure script does not know how to make ", - "a makefile for makefile style \"$make_style\""); + $template = File::Spec->catfile($template_dir, 'nmake.in'); + + add_to($config, { + 'shared' => 'no', + 'link_to' => libs('', '.'.$$config{'static_suffix'}, + @{$$config{'mod_libs'}}), + }); + + process_template($$config{'makefile'}, 'Makefile', $config); } + + error("This configure script does not know how to make ", + "a makefile for makefile style \"$make_style\"") + unless(defined($template)); + + process_template($template, 'Makefile', $config); } ################################################## @@ -1609,52 +1633,3 @@ sub build_cmds { chomp($output); return $output; } - -################################################## -# Print a Unix style makefile # -################################################## -sub print_unix_makefile { - my ($config) = @_; - - my $os = $$config{'os'}; - my $install_cmd_exec = os_install_info($os, 'install_cmd'); - $install_cmd_exec =~ s/OWNER/\$(OWNER)/; - $install_cmd_exec =~ s/GROUP/\$(GROUP)/; - $install_cmd_exec =~ s/MODE/\$(EXEC_MODE)/; - - my $install_cmd_data = os_install_info($os, 'install_cmd'); - $install_cmd_data =~ s/OWNER/\$(OWNER)/; - $install_cmd_data =~ s/GROUP/\$(GROUP)/; - $install_cmd_data =~ s/MODE/\$(DATA_MODE)/; - - unshift @{$$config{'mod_libs'}}, "m"; - - add_to($config, { - 'link_to' => libs('-l', '', @{$$config{'mod_libs'}}), - 'install_user' => os_install_info($os, 'install_user'), - 'install_group' => os_install_info($os, 'install_group'), - 'install_cmd_exec' => $install_cmd_exec, - 'install_cmd_data' => $install_cmd_data, - }); - - process_template($$config{'makefile'}, 'Makefile', $config); -} - -################################################## -# Print a NMAKE-style makefile # -################################################## -sub print_nmake_makefile { - my ($config) = @_; - - my $static_lib_suffix = $$config{'static_suffix'}; - add_to($config, { - 'shared' => 'no', - 'link_to' => libs('', ".$static_lib_suffix", @{$$config{'mod_libs'}}), - 'install_user' => '', - 'install_group' => '', - 'install_cmd_exec' => '', - 'install_cmd_data' => '', - }); - - process_template($$config{'makefile'}, 'Makefile', $config); -} diff --git a/misc/config/makefile/nmake.in b/misc/config/makefile/nmake.in index 236d42784..01d1fd07a 100644 --- a/misc/config/makefile/nmake.in +++ b/misc/config/makefile/nmake.in @@ -33,8 +33,8 @@ DOCDIR = $(INSTALLROOT)\@{var:docdir}\Botan-$(VERSION) AR = @{var:ar_command} CD = @cd ECHO = @echo -INSTALL = copy -INSTALL_CMD = $(INSTALL) +INSTALL = @{var:install_cmd_exec} +INSTALL_CMD = @{var:install_cmd_exec} MKDIR = @md MKDIR_INSTALL = @md RM = @del /Q diff --git a/misc/config/makefile/unix.in b/misc/config/makefile/unix.in index 9f83c0970..f5d83c81a 100644 --- a/misc/config/makefile/unix.in +++ b/misc/config/makefile/unix.in @@ -30,8 +30,6 @@ DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) OWNER = @{var:install_user} GROUP = @{var:install_group} -DATA_MODE = 644 -EXEC_MODE = 755 CONFIG_SCRIPT = botan-config diff --git a/misc/config/makefile/unix_shr.in b/misc/config/makefile/unix_shr.in index 30cf70538..24a77707e 100644 --- a/misc/config/makefile/unix_shr.in +++ b/misc/config/makefile/unix_shr.in @@ -32,8 +32,6 @@ DOCDIR = $(INSTALLROOT)/@{var:docdir}/Botan-$(VERSION) OWNER = @{var:install_user} GROUP = @{var:install_group} -DATA_MODE = 644 -EXEC_MODE = 755 CONFIG_SCRIPT = botan-config diff --git a/misc/config/os/defaults b/misc/config/os/defaults index 0fb27967a..a22821e56 100644 --- a/misc/config/os/defaults +++ b/misc/config/os/defaults @@ -17,4 +17,5 @@ doc_dir share/doc install_user root install_group root -install_cmd install -o OWNER -g GROUP -m MODE +install_cmd_data install -o OWNER -g GROUP -m 644 +install_cmd_exec install -o OWNER -g GROUP -m 755 diff --git a/misc/config/os/solaris b/misc/config/os/solaris index e0af2abbf..078019584 100644 --- a/misc/config/os/solaris +++ b/misc/config/os/solaris @@ -2,7 +2,8 @@ realname "Solaris" os_type unix -install_cmd install -u OWNER -g GROUP -m MODE +install_cmd_data install -u OWNER -g GROUP -m 644 +install_cmd_exec install -u OWNER -g GROUP -m 755 <supports_shared> all diff --git a/misc/config/os/windows b/misc/config/os/windows index 460c1361e..44b2a102b 100644 --- a/misc/config/os/windows +++ b/misc/config/os/windows @@ -9,6 +9,12 @@ static_suffix lib install_root c:\Botan doc_dir docs +install_cmd_data copy +install_cmd_exec copy + +install_user <nil> +install_group <nil> + <supports_shared> #all </supports_shared> |