#! /bin/bash # # $Id$ # Relink already built package fully statically. # Copyright (C) 2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; exactly version 2 of June 1991 is required # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # It is not possible to just redefine Makefile variables as there are pushed # various threading libraries etc. all the time. # Designed+tested only for Fedora Core 4 (+updates). The list of libraries will # definitely need to be changed for other distributions. # Required precompiled static libraries .a and some .c stubs: STATIC_PATH=/usr/local/staticbuild set -e -o pipefail if test "$1" != link;then set -x ./autogen.pl --dist (set -x;CFLAGS="-O2" CPPFLAGS="-I$STATIC_PATH/include/gnome-vfs-module-2.0" \ ./configure --enable-maintainer-mode --disable-shared --enable-static --enable-install-pkg \ --enable-standalone \ --enable-standalone-fonts=/usr/local/share/captive/fonts \ --disable-standalone-yum \ ) 2>&1|tee errs1 # --enable-standalone-yum=/etc/yum.repos.d make clean make 2>&1|tee errs2 set +x fi targets=" src/client/fuse/mount.captive src/client/fuse/captive-fusermount src/client/sandbox-server/captive-sandbox-server src/client/cmdline/captive-cmdline src/install/acquire/captive-install-acquire src/install/fstab/captive-install-fstab " # FIXME: Make all the other relinks also properly conditional. if grep -q 's,@ENABLE_BUG_REPLAY_TRUE@,,' config.status;then targets="$targets src/client/bug-replay/captive-bug-replay " fi (for target in $targets;do dir=`dirname $target` base=`basename $target` rm -f $target # If you want to be really bad: s/-n// and s/_OBJ/OBJ/ objects="$(make -s -C $dir -f Makefile -f - print_objects <&1|tee errs2 echo OK ls -l $targets