@@ -291,6 +291,17 @@ options. (Note that you don't need to, and shouldn't, include the B<-l>
291
291
options that specify dependencies on libraries; aimake should figure those out
292
292
by itself.)
293
293
294
+ =item YFLAGS
295
+
296
+ Command-line arguments to pass to C<yacc>. The default is to pass no options
297
+ beyond the C<--defines=> that aimake always provides because it needs special
298
+ handling (to place the files in the right place).
299
+
300
+ =item LEXFLAGS
301
+
302
+ Command-line arguments to pass to C<lex>. The default is to pass C<--warn>,
303
+ which tells C<flex> (the default C<lex> implementation) to produce warnings.
304
+
294
305
=back
295
306
296
307
Note that this option is I<not> "sticky"; the value has to be given anew with
@@ -498,6 +509,17 @@ running; in these cases, you can specify C<--nonempty-directory> to suppress
498
509
the sanity check. Before using this option, make absolutely sure you are
499
510
running from the correct directory.
500
511
512
+ This option can also be used to permit installing to the source or build
513
+ directory, a combination that is typically disallowed because it makes no
514
+ sense and can lead to accidentally overwriting the source.
515
+
516
+ =item B<--no-sanity-checks>
517
+
518
+ Disables checks on permissions that are normally used to prevent yourself
519
+ accidentally creating a file that can't be deleted. The most common reason to
520
+ use this is if you're building as root because you're using a system or jail
521
+ that has no regular users.
522
+
501
523
=item B<--install-only>
502
524
503
525
Don't run any rules but install rules, even if they're marked using
@@ -4034,7 +4056,7 @@ my ($opt_verbose, $opt_install, $opt_prefix, $opt_dump, @opt_warnings,
4034
4056
$opt_install_only, $opt_elevate_permissions, $opt_specific_exit_status,
4035
4057
@opt_with, @opt_without, @opt_with_default, $opt_nonempty_directory,
4036
4058
%opt_directory_overrides, $opt_nocr, @opt_rebuild, $opt_documentation,
4037
- $opt_gen_installer, %opt_var, $opt_profile,
4059
+ $opt_gen_installer, %opt_var, $opt_profile, $opt_no_sanity_checks,
4038
4060
$opt_license, $opt_filelist, $opt_noperms, @opt_local_config); # options
4039
4061
my ($codeset, $text_layers, $binary_layers,
4040
4062
$utf8_layers, $ascii_layers); # encodings
@@ -5032,7 +5054,7 @@ sub calculate_installation_path {
5032
5054
# file in some cases. So when the file isn't an executable, we set the
5033
5055
# execute bit based on the read bit.
5034
5056
5035
- ($octal & 0700) >= 0600 or
5057
+ ($octal & 0700) >= 0600 or $opt_no_sanity_checks or
5036
5058
die "Refusing to deny read or write permission to Administrators";
5037
5059
my $otherread = ($octal & 0004) ? 'yes' : 'KEYDEL';
5038
5060
my $otherwrite = ($octal & 0002) ? 'yes' : 'KEYDEL';
@@ -5206,7 +5228,8 @@ sub calculate_installation_path {
5206
5228
}
5207
5229
5208
5230
my @pi = parse_aipath $instdir;
5209
- $pi[0] eq 'spath' or die "Installing to build or source dir";
5231
+ $pi[0] eq 'spath' or $opt_nonempty_directory or
5232
+ die "Installing to build or source dir";
5210
5233
5211
5234
$filelist_feature_seen{$feature}{$id} or
5212
5235
$filelist_features{$feature} .=
@@ -8098,6 +8121,7 @@ GetOptions('verbose|v:+' => \$opt_verbose,
8098
8121
'destdir=s' => \$opt_prefix,
8099
8122
'filelist=s' => \$opt_filelist,
8100
8123
'gen-installer=s' => \$opt_gen_installer,
8124
+ 'no-sanity-checks' => \$opt_no_sanity_checks,
8101
8125
'natural-permissions' => \$opt_noperms,
8102
8126
'profile' => \$opt_profile,
8103
8127
'dump-status:s' => \$opt_dump,
@@ -8386,7 +8410,8 @@ $opt_install and $ipath = ospath2aipath($opt_install);
8386
8410
# Check effective UID for this, so that root can run a setuid-something-else
8387
8411
# install program, and so that we complain if someone installs aimake suid root
8388
8412
# (note: do not install aimake suid root).
8389
- if ($os_parsed ne 'MSWin32' && $> == 0 && !$opt_install_only) {
8413
+ if ($os_parsed ne 'MSWin32' && $> == 0 && !$opt_install_only &&
8414
+ !$opt_no_sanity_checks) {
8390
8415
die ("Please do not run aimake as root.\n" .
8391
8416
"To install as root, use '-S su' or '-S sudo' as appropriate.");
8392
8417
}
@@ -8511,7 +8536,7 @@ if ($installing && !defined $opt_elevate_permissions &&
8511
8536
8512
8537
# Complain and exit if -S or --install-only were specified, but we're
8513
8538
# nonetheless failing to install.
8514
- if ((defined $opt_elevate_permissions || defined $opt_install_only) &&
8539
+ if ((defined $opt_elevate_permissions || $opt_install_only) &&
8515
8540
!$installing) {
8516
8541
die "Cannot obey the requested install options: -S and --install-only " .
8517
8542
"are useful only when installing, but the install path '" .
@@ -10773,6 +10798,46 @@ EOF
10773
10798
verb => 'determined',
10774
10799
},
10775
10800
10801
+ default_yflags => {
10802
+ output => 'optionset:YFLAGS',
10803
+ outdepends => [],
10804
+ verb => 'determined',
10805
+ low_message_priority => 1,
10806
+ command_line_override => 'YFLAGS',
10807
+ },
10808
+ default_am_yflags => {
10809
+ output => 'optionset:AM_YFLAGS',
10810
+ outdepends => [],
10811
+ verb => 'determined',
10812
+ low_message_priority => 1,
10813
+ command_line_override => 'AM_YFLAGS',
10814
+ },
10815
+ yflags_includes_am_yflags => {
10816
+ object => 'optionset:YFLAGS',
10817
+ depends => 'optionset:AM_YFLAGS',
10818
+ verb => 'determined',
10819
+ },
10820
+
10821
+ default_lexflags => {
10822
+ output => 'optionset:LEXFLAGS',
10823
+ outdepends => ['optstring:--warn'],
10824
+ verb => 'determined',
10825
+ low_message_priority => 1,
10826
+ command_line_override => 'LEXFLAGS',
10827
+ },
10828
+ default_am_lexflags => {
10829
+ output => 'optionset:AM_LEXFLAGS',
10830
+ outdepends => [],
10831
+ verb => 'determined',
10832
+ low_message_priority => 1,
10833
+ command_line_override => 'AM_LEXFLAGS',
10834
+ },
10835
+ lexflags_includes_am_lexflags => {
10836
+ object => 'optionset:LEXFLAGS',
10837
+ depends => 'optionset:AM_LEXFLAGS',
10838
+ verb => 'determined',
10839
+ },
10840
+
10776
10841
cflags_includes_cppflags => {
10777
10842
object => 'optionset:CFLAGS',
10778
10843
depends => 'optionset:CPPFLAGS',
@@ -11879,7 +11944,7 @@ EOF
11879
11944
# traditional lex's nasty habit of using hardcoded filenames.
11880
11945
lex_tool => {
11881
11946
output => 'tool:lex',
11882
- outdepends => ['cmd:flex'],
11947
+ outdepends => ['cmd:flex', 'optionset:LEXFLAGS' ],
11883
11948
verb => 'found',
11884
11949
},
11885
11950
compile_lex => {
@@ -11894,7 +11959,7 @@ EOF
11894
11959
11895
11960
yacc_tool => {
11896
11961
output => 'tool:yacc',
11897
- outdepends => ['cmd:bison'],
11962
+ outdepends => ['cmd:bison', 'optionset:YFLAGS' ],
11898
11963
verb => 'found',
11899
11964
},
11900
11965
compile_yacc => {
0 commit comments