src/utils/na-gconf2key.sh.in: fix permissions when creating the configuration directory
[nautilus-actions.git] / run-autogen.sh
blob77f25d7098e4fe3ff02a8c348172a162b7efb3aa
1 #!/bin/sh
3 # pwi 2011-11-28 goal is to have a single source tree, being able to easily
4 # build it in several virtual guests which all have a read
5 # access to this source tree
6 # -> run-distcheck.sh and run-autogen.sh are only executed on the development
7 # boxes, while run-configure is meant to build from anywhere
8 # -> on the development box, _build and _install are subdirectories of the
9 # source tree
10 # -> on the virtual guests, _build and _install are subdirectories of the
11 # current working directory
13 target=${target:-normal}
14 srcdir=$(cd ${0%/*}; pwd)
16 # a nautilus-actions-x.y may remain after an aborted make distcheck
17 # such a directory breaks gnome-autogen.sh generation
18 # so clean it here
19 for d in $(find ${srcdir} -maxdepth 1 -type d -name 'nautilus-actions-*'); do
20 chmod -R u+w $d
21 rm -fr $d
22 done
24 conf_args=""
26 if [ "${target}" = "normal" ]; then
27 conf_args="${conf_args} --disable-deprecated"
28 conf_args="${conf_args} --disable-gtk-doc"
29 conf_args="${conf_args} --disable-html-manuals"
30 conf_args="${conf_args} --disable-pdf-manuals"
32 # 'doc' mode: enable deprecated, manuals and gtk-doc
33 elif [ "${target}" = "doc" ]; then
34 conf_args="${conf_args} --enable-deprecated"
35 conf_args="${conf_args} --enable-gtk-doc"
36 conf_args="${conf_args} --enable-gtk-doc-html"
37 conf_args="${conf_args} --enable-gtk-doc-pdf"
38 conf_args="${conf_args} --enable-html-manuals"
39 conf_args="${conf_args} --enable-pdf-manuals"
42 # Build with Gtk+ 3 (actually a 2.97.x unstable version)
43 # installed in ~/.local/jhbuild
45 # Note that building with Gtk 3.0 not only requires that we have a
46 # Gtk+ 3 available library, but also that all our required libraries
47 # only depend of Gtk+ 3.0. In our case, we have:
48 # $ grep gtk+-2.0 /usr/lib/pkgconfig/*
49 # libnautilus-extension.pc:Requires: glib-2.0 gio-2.0 gtk+-2.0
50 # unique-1.0.pc:Requires: gtk+-2.0
52 #[ "${target}" = "jhbuild" ] &&
53 # export autogen_prefix=${HOME}/data/jhbuild/run &&
54 # PKG_CONFIG_PATH=${autogen_prefix}/lib/pkgconfig \
55 # LD_LIBRARY_PATH=${autogen_prefix}/lib \
56 # exec ./autogen.sh \
57 # --prefix=${autogen_prefix} \
58 # --sysconfdir=/etc \
59 # --disable-schemas-install \
60 # $*
62 NOCONFIGURE=1 ${srcdir}/autogen.sh
64 runconf=${srcdir}/run-configure.sh
65 echo "
66 Generating ${runconf}"
68 cat <<EOF >${runconf}
69 #!/bin/sh
71 # srcdir here is the root of the source directory
72 target=\${target:-normal}
73 srcdir=\$(cd \${0%/*}; pwd)
75 # heredir is the root of the _build/_install directories
76 heredir=\$(pwd)
78 mkdir -p \${heredir}/_build
79 cd \${heredir}/_build
81 conf_cmd="\${srcdir}/configure"
82 conf_args="${conf_args}"
83 conf_args="\${conf_args} --prefix=\${heredir}/_install"
84 conf_args="\${conf_args} --sysconfdir=/etc"
85 conf_args="\${conf_args} --with-nautilus-extdir=\${heredir}/_install/lib/nautilus"
86 conf_args="\${conf_args} --disable-schemas-install"
87 conf_args="\${conf_args} --disable-scrollkeeper"
88 conf_args="\${conf_args} --enable-maintainer-mode"
89 conf_args="\${conf_args} \$*"
91 tput bold
92 echo "\${conf_cmd} \${conf_args}
94 tput sgr0
96 \${conf_cmd} \${conf_args}
97 EOF
99 echo "Executing ${runconf}
101 chmod a+x ${runconf}
102 ${runconf} &&
103 make -C _build &&
104 make -C _build install