Magellan Linux

Diff of /trunk/include/mozilla.sminc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by niro, Fri Oct 10 13:29:42 2008 UTC revision 2861 by niro, Sun Jul 12 16:33:09 2009 UTC
# Line 1  Line 1 
1  # $Header: /magellan-cvs/smage/include/mozilla.sminc,v 1.2 2006/06/12 21:16:04 niro Exp $  # $Id$
2  # mozilla global smage2 functions  # mozilla global smage2 functions
3    
4  mozconf_add()  mozconf_add()
# Line 19  rebuild_extension_list() Line 19  rebuild_extension_list()
19    
20  mozilla_remove_cflags()  mozilla_remove_cflags()
21  {  {
22   # This removes extraneous CFLAGS from the Makefiles to reduce RAM   # this removes extraneous CFLAGS from the Makefiles to reduce RAM
23   # requirements while compiling (gentoo)   # requirements while compiling (gentoo)
24   export CFLAGS="${CFLAGS} -Wno-return-type -w"   export CFLAGS="${CFLAGS} -Wno-return-type -w"
25   export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"   export CXXFLAGS="${CXXFLAGS} -Wno-return-type -w"
# Line 35  mozilla_remove_cflags() Line 35  mozilla_remove_cflags()
35   -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}   -e 's:-pedantic::g' ${MAKEFILE}.old > ${MAKEFILE}
36   rm -f ${MAKEFILE}.old   rm -f ${MAKEFILE}.old
37   done   done
38   # Mozilla use .mk includes   # mozilla use .mk includes
39   find . -name '*.mk' | while read MAKEFILE   find . -name '*.mk' | while read MAKEFILE
40   do   do
41   cp ${MAKEFILE} ${MAKEFILE}.old   cp ${MAKEFILE} ${MAKEFILE}.old
# Line 47  mozilla_remove_cflags() Line 47  mozilla_remove_cflags()
47  }  }
48    
49  # simulate the csh makemake script (gentoo)  # simulate the csh makemake script (gentoo)
50  makemake() {  makemake()
51    {
52   typeset m topdir   typeset m topdir
53   for m in $(find . -name Makefile.in); do   for m in $(find . -name Makefile.in); do
54   topdir=$(echo "$m" | sed -r 's:[^/]+:..:g')   topdir=$(echo "$m" | sed -r 's:[^/]+:..:g')
# Line 56  makemake() { Line 57  makemake() {
57   done   done
58  }  }
59    
60  makemake2() {  makemake2()
61    {
62   typeset m topdir   typeset m topdir
63   for m in $(find ../ -name Makefile.in); do   for m in $(find ../ -name Makefile.in); do
64   topdir=$(echo "$m" | sed -r 's:[^/]+:..:g')   topdir=$(echo "$m" | sed -r 's:[^/]+:..:g')
# Line 64  makemake2() { Line 66  makemake2() {
66   < ${m} > ${m%.in} || die "sed ${m} failed"   < ${m} > ${m%.in} || die "sed ${m} failed"
67   done   done
68  }  }
69    
70    msetpref()
71    {
72     : ${MOZILLA_PREF_CONFIG="magellan.js"}
73     : ${MOZILLA_PREF_PATH="/usr/$(mlibdir)/mozilla-firefox/defaults/pref"}
74     local pref
75     local value
76    
77     [[ -z ${pref} ]] && die "msetpref(): no \$pref given"
78    
79     if [[ ${pref} = --init ]]
80     then
81     # only create an empty config
82     :> ${BINDIR}/${MOZILLA_PREF_PATH}/${MOZILLA_PREF_CONFIG} || die
83     else
84     # write a pref value
85     [[ -z ${value} ]] && die "msetpref(): no \$value given"
86    
87     # handle escaped strings:
88     # check if value is an integer -> no escaping
89     if printf "%d" ${value} > /dev/null 2>&1
90     then
91     value="${value}"
92    
93     # check for "false" or "true" -> no escaping
94     elif [[ ${value} = false ]] || [[ ${value} = true ]]
95     value="${value}"
96    
97     # all other values needs escaping
98     else
99     value="\"${value}\""
100     fi
101    
102     # eg:
103     # pref("general.useragent.vendor","Magellan-Linux");
104     echo "pref(\"${pref}\",${value});" >> ${BINDIR}/${MOZILLA_PREF_PATH}/${MOZILLA_PREF_CONFIG} || die
105     fi
106    }

Legend:
Removed from v.2  
changed lines
  Added in v.2861