summaryrefslogtreecommitdiff
path: root/moz-normalize-mozconfig
diff options
context:
space:
mode:
Diffstat (limited to 'moz-normalize-mozconfig')
-rwxr-xr-xmoz-normalize-mozconfig49
1 files changed, 30 insertions, 19 deletions
diff --git a/moz-normalize-mozconfig b/moz-normalize-mozconfig
index 62cce3f..92a848d 100755
--- a/moz-normalize-mozconfig
+++ b/moz-normalize-mozconfig
@@ -16,6 +16,7 @@ classify-lines() {
ac_add_options\ --enable-application=*) class=setapp;;
.\ *mozconfig) class=setapp;;
+ *profile-guided-optimization*|*pgo*) class=pgo;;
*optimiz*) class=vendor;;
ac_add_options\ --*-dirs) class=vendor;;
@@ -24,8 +25,9 @@ classify-lines() {
ac_add_options\ --prefix=*) class=vendor;;
*OFFICIAL*) class=vendor;;
- ac_add_options\ --with-*=*) class=appsetting;;
- *MOZ_PHOENIX*) class=appsetting;;
+ ac_add_options\ --with-*=*) class=application;;
+ ac_add_options\ --*branding*) class=application;;
+ *MOZ_PHOENIX*) class=application;;
ac_add_options\ --*-system-*) class=system;;
ac_add_options\ --with-pthreads) class=system;;
@@ -36,6 +38,7 @@ classify-lines() {
ac_add_options\ --*=*) class=other;;
ac_add_options\ --enable-toolkit-*) class=other;;
+ ac_add_options\ --disable-toolkit-*) class=other;;
ac_add_options\ --enable-*) class=feature;;
ac_add_options\ --disable-*) class=feature;;
@@ -53,13 +56,14 @@ classify-lines() {
class_id=''
case "$class" in
- setapp) class_id=0;;
- system) class_id=1;;
- feature) class_id=2;;
- vendor) class_id=3;;
- platform) class_id=4;;
- appsetting) class_id=5;;
- other) class_id=6;;
+ setapp) class_id=0;;
+ system) class_id=1;;
+ feature) class_id=2;;
+ vendor) class_id=3;;
+ platform) class_id=4;;
+ application) class_id=5;;
+ other) class_id=6;;
+ pgo) class_id=7;;
*) libremessages error "INVALID CLASS: $class"; exit 1;;
esac
printf '%s:%s\n' "$class_id" "$line"
@@ -75,13 +79,14 @@ format-classes() (
if [[ "$class_id" != "$prev_id" ]]; then
echo ''
case "$class_id" in
- 0) echo '# Set the application';;
+ 0) :;;
1) echo '# System libraries';;
2) echo '# Features';;
3) echo '# Vendor settings';;
4) echo '# Platform settings';;
5) echo '# Application settings';;
6) echo '# Other';;
+ 7) echo '# PGO';;
esac
fi
printf '%s\n' "$line"
@@ -91,6 +96,20 @@ format-classes() (
echo '# Build-generated'
)
+clean() {
+ sed -r \
+ -e '/#\s*(System libraries|Features|Other|PGO)/d' \
+ -e '/#\s*(Vendor|Platform|Application) settings/d' \
+ -e '/#\s*Build-generated/d'
+}
+hack() {
+ sed -r \
+ -e '/^\s*$/d' \
+ -e '/#\s*(IceCat|Iceweasel)/d' \
+ -e '/#\s*(ConnochaetOS|Parabola)/d' \
+ -e 's/# (ac_add_options)/#\1/'
+}
+
add-comments() {
while read line; do
file="$tempdir/comments-$(urlencode "$line")"
@@ -105,17 +124,9 @@ add-comments() {
fi
}
-hack() {
- sed -r \
- -e '/^\s*$/d' \
- -e '/#\s*(System libraries|Features|Optimization|Build-generated)/d' \
- -e '/#\s*(Icecat|IceWeasel)/d' \
- -e '/#\s*(ConnochaetOS|Parabola)/d' \
- -e 's/# (ac_add_options)/#\1/'
-}
-
main() {
cat \
+ | clean \
| hack \
| classify-lines "$file" \
| sort \