@@ -80,6 +80,13 @@ Options:
80
80
Assume the answer to all prompts is 'yes, please continue'. Intended for
81
81
automated usage, such as buildbots.
82
82
83
+ -a, --additional-nginx-configure-arguments
84
+ When running ./configure for nginx, you may want to specify additional
85
+ arguments, such as --with-http_ssl_module. By default this script will
86
+ pause and prompt you for them, but this option lets you pass them in. For
87
+ example, you might do:
88
+ -a '--with-http_ssl_module --with-cc-opt=\" -I /usr/local/include\" '
89
+
83
90
-d, --dryrun
84
91
Don't make any changes to the system, just print what changes you
85
92
would have made.
@@ -302,10 +309,10 @@ function build_ngx_pagespeed() {
302
309
fail " Your version of getopt is too old. Exiting with no changes made."
303
310
fi
304
311
305
- opts=$( getopt -o v:n:mb:pslt:ydh \
312
+ opts=$( getopt -o v:n:mb:pslt:ya:dh \
306
313
--longoptions ngx-pagespeed-version:,nginx-version:,dynamic-module \
307
314
--longoptions buildir:,no-deps-check,psol-from-source,devel,build-type: \
308
- --longoptions assume-yes,dryrun,help \
315
+ --longoptions assume-yes,additional-nginx-configure-arguments:, dryrun,help \
309
316
-n " $( basename " $0 " ) " -- " $@ " )
310
317
if [ $? != 0 ]; then
311
318
usage
@@ -356,6 +363,10 @@ function build_ngx_pagespeed() {
356
363
-y | --assume-yes) shift
357
364
ASSUME_YES=" true"
358
365
;;
366
+ -a | --additional-nginx-configure-arguments) shift
367
+ ADDITIONAL_NGINX_CONFIGURE_ARGUMENTS=" $1 "
368
+ shift
369
+ ;;
359
370
-d | --dryrun) shift
360
371
DRYRUN=" true"
361
372
;;
@@ -721,19 +732,26 @@ Not deleting $directory; name is suspiciously short. Something is wrong."
721
732
run cd " $nginx_dir "
722
733
723
734
configure=(" $configure_location /configure" " ${configure_args[@]} " )
724
- if ! " $ASSUME_YES " ; then
725
- echo " About to build nginx. Do you have any additional ./configure"
726
- echo " arguments you would like to set? For example, if you would like"
727
- echo " to build nginx with https support give --with-http_ssl_module"
728
- echo " If you don't have any, just press enter."
729
- read -p " > " additional_configure_args
730
- if [ -n " $additional_configure_args " ]; then
731
- # Split additional_configure_args respecting any internal quotation.
732
- # Otherwise things like --with-cc-opt='-foo -bar' won't work.
733
- eval additional_configure_args=(" $additional_configure_args " )
734
- configure=(" ${configure[@]} " " ${additional_configure_args[@]} " )
735
+ additional_configure_args=" "
736
+ if [ -z " ${ADDITIONAL_NGINX_CONFIGURE_ARGUMENTS+x} " ]; then
737
+ if ! " $ASSUME_YES " ; then
738
+ echo " About to build nginx. Do you have any additional ./configure"
739
+ echo " arguments you would like to set? For example, if you would like"
740
+ echo " to build nginx with https support give --with-http_ssl_module"
741
+ echo " If you don't have any, just press enter."
742
+ read -p " > " additional_configure_args
735
743
fi
744
+ else
745
+ additional_configure_args=" $ADDITIONAL_NGINX_CONFIGURE_ARGUMENTS "
736
746
fi
747
+
748
+ if [ -n " $additional_configure_args " ]; then
749
+ # Split additional_configure_args respecting any internal quotation.
750
+ # Otherwise things like --with-cc-opt='-foo -bar' won't work.
751
+ eval additional_configure_args=(" $additional_configure_args " )
752
+ configure=(" ${configure[@]} " " ${additional_configure_args[@]} " )
753
+ fi
754
+
737
755
echo " About to configure nginx with:"
738
756
echo " $( quote_arguments " ${configure[@]} " ) "
739
757
continue_or_exit " Does this look right?"
0 commit comments