[Libreoffice-commits] .: 4 commits - solenv/bin solenv/gdb solenv/prj

David Tardon dtardon at kemper.freedesktop.org
Mon Sep 5 23:05:05 PDT 2011


 solenv/bin/install-gdb-printers |   87 ++++++++++++++++++++++++++++++++++------
 solenv/gdb/makefile.mk          |   41 ++++++++++++++++++
 solenv/prj/build.lst            |    1 
 solenv/prj/d.lst                |    2 
 4 files changed, 118 insertions(+), 13 deletions(-)

New commits:
commit 1d0ef7f9f4cda63803cc916906c9cf981736a07b
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Sep 6 07:59:52 2011 +0200

    replace existing file

diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers
index 16327f3..0a1c90d 100755
--- a/solenv/bin/install-gdb-printers
+++ b/solenv/bin/install-gdb-printers
@@ -49,6 +49,7 @@ make_autoload() {
         mkdir -p "${dir}" || die "cannot create dir '${dir}'"
     fi
 
+    [[ -f ${lib}-gdb.py ]] && rm -f "${lib}-gdb.py"
     if ${link}; then
         if [[ ! -f ${lib}-gdb.py ]]; then
             local gdbname="${lib##*/}-gdb.py"
commit 3e886b6bc6937d6d1a9e10a703a96b8944690ff4
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Sep 6 07:56:14 2011 +0200

    set defaults for use with dev-install

diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers
index 4a643e3..16327f3 100755
--- a/solenv/bin/install-gdb-printers
+++ b/solenv/bin/install-gdb-printers
@@ -28,6 +28,7 @@
 
 GDBDIR="${SOLARENV}/gdb"
 SOLVERLIBDIR="${SOLARVER}/${INPATH}/lib"
+INSTALLDIR="${SOLARVER}/${INPATH}/installation/opt"
 
 die() {
     echo "$1" >&2
@@ -91,7 +92,10 @@ while getopts :a:cfi:p:L opt; do
     esac
 done
 
-if [[ -n ${autoloaddir} && -z ${installdir} ]]; then
+if [[ -z ${autoloaddir} && -z ${installdir} ]]; then
+    autoloaddir="${INSTALLDIR}"
+    installdir="${INSTALLDIR}"
+elif [[ -n ${autoloaddir} && -z ${installdir} ]]; then
     installdir="${autoloaddir}"
 elif [[ -z ${autoloaddir} && -n ${installdir} ]]; then
     autoloaddir="${installdir}"
commit 21d1920ec0a2f274f9c6b0c0a86f3fc6865a963f
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Sep 6 07:50:12 2011 +0200

    add license blurb

diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers
index 05621bd..4a643e3 100755
--- a/solenv/bin/install-gdb-printers
+++ b/solenv/bin/install-gdb-printers
@@ -1,4 +1,30 @@
 #!/usr/bin/env bash
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#       David Tardon, Red Hat Inc. <dtardon at redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
 
 GDBDIR="${SOLARENV}/gdb"
 SOLVERLIBDIR="${SOLARVER}/${INPATH}/lib"
commit d7880811629cb08e7828482d6044d77ac40aef0a
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Sep 6 07:45:11 2011 +0200

    make pretty printers available during build already

diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers
index 10f7add..05621bd 100755
--- a/solenv/bin/install-gdb-printers
+++ b/solenv/bin/install-gdb-printers
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 
 GDBDIR="${SOLARENV}/gdb"
+SOLVERLIBDIR="${SOLARVER}/${INPATH}/lib"
 
 die() {
     echo "$1" >&2
@@ -8,41 +9,69 @@ die() {
 }
 
 make_autoload() {
-    local dir="${DESTDIR}${autoloaddir}/$2"
-    local gdbfile="${dir}/$3-gdb.py"
+    local dir="${DESTDIR}${autoloaddir}"
+    ${flat} || dir="${dir}/$2"
+    local lib="${dir}/$3"
+
+    if ! ${flat}; then
+        lib="$(readlink -f "${DESTDIR}${installdir}/$2/$3")"
+        dir="${lib%/*}"
+    fi
 
     if ${create}; then
         mkdir -p "${dir}" || die "cannot create dir '${dir}'"
-    elif ${follow}; then
-        gdbfile="$(readlink -f "${dir}/$3")-gdb.py"
     fi
-    sed -e "s!%PYTHONDIR%!${pythondir}!" -e "s!%MODULE%!libreoffice.$1!" \
-        "${GDBDIR}/autoload.template" > "${gdbfile}"
+
+    if ${link}; then
+        if [[ ! -f ${lib}-gdb.py ]]; then
+            local gdbname="${lib##*/}-gdb.py"
+            ln -s "${SOLVERLIBDIR}/${gdbname}" "${dir}/${gdbname}"
+        fi
+    else
+        sed -e "s!%PYTHONDIR%!${pythondir}!" -e "s!%MODULE%!libreoffice.$1!" \
+            "${GDBDIR}/autoload.template" > "${lib}-gdb.py"
+    fi
 }
 
 # dir where the autoloaders will be placed
 autoloaddir=
+# The installation dir. If only one of these is set, the other is set to
+# the same value.
+installdir=
 # dir where the pretty printers will be placed
 pythondir="${GDBDIR}"
 # Create autoload dir if it does not exist. This only makes sense when
 # installing into system gdb dir, so $autoloaddir must be absolute path.
 create=false
-# Follow links when looking up the path for the autoload file. This only
-# makes sense for dev-install.
-follow=false
+# Create symlinks to existing autoloaders in solver. This only makes
+# sense for dev-install.
+link=false
+# This option is only here to enable using the script during build of
+# solenv/gdb . We must (or, better, want to :) avoid using the
+# installation subpaths (like basis-link), because all libs in solver
+# are in the same dir.
+flat=false
 
-#  b defghijklmno qrstuvwxyzABCDEFGHIJK MNOPQRSTUVWXYZ0123456789
-while getopts :a:cp:L opt; do
+#  b de gh jklmno qrstuvwxyzABCDEFGHIJK MNOPQRSTUVWXYZ0123456789
+while getopts :a:cfi:p:L opt; do
     case ${opt} in
         a) autoloaddir="${OPTARG}" ;;
         c) create=true ;;
+        f) flat=true ;;
+        i) installdir="${OPTARG}" ;;
         p) pythondir="${OPTARG}" ;;
-        L) follow=true ;;
+        L) link=true ;;
         *) die "unknown option ${OPTARG}" ;;
     esac
 done
 
-${create} && ${follow} && die "-c and -L cannot be used together"
+if [[ -n ${autoloaddir} && -z ${installdir} ]]; then
+    installdir="${autoloaddir}"
+elif [[ -z ${autoloaddir} && -n ${installdir} ]]; then
+    autoloaddir="${installdir}"
+fi
+
+${create} && ${link} && die "-c and -L cannot be used together"
 if [[ -n ${DESTDIR} ]]; then
     [[ ${autoloaddir:0:1} = / ]] || die 'the arg to -a must be an absolute path'
     [[ ${pythondir:0:1} = / ]] || die 'the arg to -p must be an absolute path'
@@ -52,6 +81,7 @@ if ${create}; then
 else
     [[ ! -d ${DESTDIR}${autoloaddir} ]] && die "directory '${DESTDIR}${autoloaddir}' does not exist"
 fi
+[[ ! -d ${DESTDIR}${installdir} ]] && die "directory '${DESTDIR}${installdir}' does not exist"
 [[ ! -d ${GDBDIR} ]] && die "directory '${GDBDIR}' does not exist"
 
 if [[ ${DESTDIR}${pythondir} != ${GDBDIR} ]]; then
diff --git a/solenv/gdb/makefile.mk b/solenv/gdb/makefile.mk
new file mode 100644
index 0000000..da1afb7
--- /dev/null
+++ b/solenv/gdb/makefile.mk
@@ -0,0 +1,41 @@
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+#       David Tardon, Red Hat Inc. <dtardon at redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+PRJ=..
+PRJNAME=gdb
+TARGET=gdb
+
+.INCLUDE : settings.mk
+.INCLUDE : target.mk
+.INCLUDE : versionlist.mk
+
+ALLTAR : $(MISC)/autoloaders.flag
+
+$(MISC)/autoloaders.flag : autoload.template
+    install-gdb-printers -a $(MISC) -f
+
+# vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/solenv/prj/build.lst b/solenv/prj/build.lst
index d7a7f36..eb46b06 100644
--- a/solenv/prj/build.lst
+++ b/solenv/prj/build.lst
@@ -1,3 +1,4 @@
 sn  solenv : NULL
 sn	solenv									usr1	-	all	sn_mkout NULL
 sn	solenv									nmake	-	all	sn_init NULL
+sn	solenv\gdb									nmake	-	all	sn_gdb NULL
diff --git a/solenv/prj/d.lst b/solenv/prj/d.lst
index 9972651..1773c48 100755
--- a/solenv/prj/d.lst
+++ b/solenv/prj/d.lst
@@ -1,4 +1,6 @@
 mkdir: %_DEST%\bin
 mkdir: %_DEST%\inc
+mkdir: %_DEST%\lib
 ..\inc\version.lst %_DEST%\bin\version.lst
 ..\%__SRC%\inc\versionlist.hrc %_DEST%\inc\versionlist.hrc
+..\%__SRC%\misc\*-gdb.py %_DEST%\lib\*-gdb.py


More information about the Libreoffice-commits mailing list