[Ocfs2-users] Compiling ocfs2-tools-1.6.3 on slackware64-13.1

Sunil Mushran sunil.mushran at oracle.com
Tue Nov 30 21:43:09 PST 2010


On 11/30/2010 07:47 PM, pica pica wrote:
> Some progress: I added -lpthread my build script (see bellow) and I got past fsck.ocfs2, but now get stuck at o2image :(
> It seems that -lpthread was not used here, but I could see that it was everywhere else. Is this right?
>
> make[1]: Entering directory `/root/ocfs2/ocfs2-tools/ocfs2-tools/tmp/SBo/ocfs2-tools-1.6.3/o2image'
> gcc  -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes -Wmissing-declarations    -I../include -I. -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DVERSION=\"1.6.3\"  -MD -MP -MF ./.o2image.d -o o2image.o -c o2image.c
> gcc  -Wall -Wstrict-prototypes -Wno-format -Wmissing-prototypes -Wmissing-declarations  -o o2image o2image.o ../libocfs2/libocfs2.a -lglib-2.0   -L../libocfs2 -locfs2 -L/lib -lcom_err
> /lib/libcom_err.a(error_message.o): In function `et_list_unlock':
> error_message.c:(.text+0x1b0): undefined reference to `sem_post'
> /lib/libcom_err.a(error_message.o): In function `fini_et_lock':
> error_message.c:(.text+0x1ce): undefined reference to `sem_destroy'
> /lib/libcom_err.a(error_message.o): In function `setup_et_lock':
> error_message.c:(.text+0x1fe): undefined reference to `sem_init'
> /lib/libcom_err.a(error_message.o): In function `et_list_lock':
> error_message.c:(.text+0x22d): undefined reference to `sem_wait'
> collect2: ld returned 1 exit status
> make[1]: *** [o2image] Error 1
> make[1]: Leaving directory `/root/ocfs2/ocfs2-tools/ocfs2-tools/tmp/SBo/ocfs2-tools-1.6.3/o2image'
> make: *** [o2image] Error 2

Edit o2image/Makefile and change "CFLAGS = .." to "CFLAGS += ...".



>
> Here is my build script:
>
> #!/bin/sh
>
> # Slackware build script for ocfs2-tools
>
> # Copyright (c) 2010  Jose Leal<pica6667 at aeiou.pt>
> # All rights reserved.
> #
> # Redistribution and use in source and binary forms, with or without
> # modification, are permitted provided that the following conditions are
> # met:
> #
> # * Redistributions of source code must retain the above copyright
> #   notice, this list of conditions and the following disclaimer.
> # * Redistributions in binary form must reproduce the above
> #   copyright notice, this list of conditions and the following disclaimer
> #   in the documentation and/or other materials provided with the
> #   distribution.
> # * Neither the name of the {company} nor the names of its
> #   contributors may be used to endorse or promote products derived from
> #   this software without specific prior written permission.
> #
> # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>
> PRGNAM=ocfs2-tools
> VERSION=1.6.3
> BUILD=${BUILD:-1}
> TAG=${TAG:-_SBo}
>
> # Automatically determine the architecture we're building on:
> if [ -z "$ARCH" ]; then
>    case "$( uname -m )" in
>      i?86) ARCH=i486 ;;
>      arm*) ARCH=arm ;;
>      # Unless $ARCH is already set, use uname -m for all other archs:
>         *) ARCH=$( uname -m ) ;;
>    esac
> fi
>
> CWD=$(pwd)
> TMP=./tmp/SBo
> #TMP=${TMP:-/tmp/SBo}
> PKG=$TMP/package-$PRGNAM
> OUTPUT=${OUTPUT:-/tmp}
>
> if [ "$ARCH" = "i486" ]; then
>    SLKCFLAGS="-O2 -march=i486 -mtune=i686"
>    LIBDIRSUFFIX=""
> elif [ "$ARCH" = "i686" ]; then
>    SLKCFLAGS="-O2 -march=i686 -mtune=i686"
>    LIBDIRSUFFIX=""
> elif [ "$ARCH" = "x86_64" ]; then
>    SLKCFLAGS="-O2 -fPIC"
>    LIBDIRSUFFIX="64"
> else
>    SLKCFLAGS="-O2"
>    LIBDIRSUFFIX=""
> fi
>
> set -e
>
> rm -rf $PKG
> mkdir -p $TMP $PKG $OUTPUT
> cd $TMP
> rm -rf $TMP/$PRGNAM-$VERSION
> tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
> cd $PRGNAM-$VERSION
> chown -R root:root .
> find . \
>   \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
>   -exec chmod 755 {} \; -o \
>   \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
>   -exec chmod 644 {} \;
>
> CFLAGS="$SLKCFLAGS -lpthread" \
> CXXFLAGS="$SLKCFLAGS -lpthread" \
> ./configure \
>    --sbindir=/sbin \
>    --bin=/bin \
>    --libdir=/usr/lib${LIBDIRSUFFIX} \
>    --sysconfdir=/etc \
>    --datadir=/etc/ocfs2 \
>    --sharedstatedir=/var/ocfs2 \
>    --libexecdir=/usr/libexec \
>    --localstatedir=/var \
>    --mandir=/usr/man \
>    --build=$ARCH-slackware-linux
>
>
> make
> make install DESTDIR=$PKG
>
> find $PKG | xargs file | grep -e "executable" -e "shared object"| grep ELF | \
>    cut -f 1 -d : | xargs strip --strip-unneeded 2>  /dev/null || true
>
> ( cd $PKG/usr/man
>    find . -type f -exec gzip -9 {} \;
>    for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
> )
>
> mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
> cp -a COPYING CREDITS MAINTAINERS README README.O2CB $PKG/usr/doc/$PRGNAM-$VERSION
> cat $CWD/$PRGNAM.SlackBuild>  $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
>
> mkdir -p $PKG/install
> cat $CWD/slack-desc>  $PKG/install/slack-desc
>
> cd $PKG
> /sbin/makepkg -l y -c n $CWD/../$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}




More information about the Ocfs2-users mailing list