source: scripts/target-scripts/target-e2fsprogs.sh@ 60454e2

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 60454e2 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 4.6 KB
Line 
1#!/bin/bash
2
3# cross-lfs target e2fsprogs build
4# --------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11# NOTE: This installs to the target root,
12# NOT to ${TGT_TOOLS}
13#
14# NOTE: also requires gettext built native on the build host
15
16
17cd ${SRC}
18LOG=e2fsprogs-target.log
19set_libdirname
20setup_multiarch
21
22if [ "${USE_SYSROOT}" = "Y" ]; then
23 BUILD_PREFIX=/usr
24 INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
25 INSTALL_OPTIONS="DESTDIR=${LFS}"
26 extra_conf="--with-root-prefix=\"\""
27else
28 BUILD_PREFIX=${TGT_TOOLS}
29 INSTALL_PREFIX="${TGT_TOOLS}"
30 INSTALL_OPTIONS=""
31fi
32
33unpack_tarball e2fsprogs-${E2FSPROGS_VER}
34
35cd ${PKGDIR}
36# Apply patch for HTREE problem posted by GS 3/19/2003
37#apply_patch e2fsprogs-${E2FSPROGS_VER}
38
39case ${KERNEL_VER} in
40 2.6* )
41 # patch util.c to remove SCSI_BLOCK_MAJOR references
42 # SCSI_DISK_MAJOR is no longer defined in linux/major.h for 2.6 kernel
43 # TODO: check future e2fsprogs versions to see if this is fixed
44 case ${E2FSPROGS_VER} in
45 1.34* )
46 # check if SCSI_DISK_MAJOR defined in linux/major.h
47 grep SCSI_DISK_MAJOR ${INSTALL_PREFIX}/include/linux/major.h > /dev/null 2>&1 ||
48 apply_patch e2fsprogs-${E2FSPROGS_VER}-2.6.0hdr-fix
49 ;;
50 esac
51 ;;
52esac
53
54
55case ${E2FSPROGS_VER} in
56 1.35 )
57 # Fix some permissions issues when building the e2fsprogs 1.35 tarball
58 # as a normal user. Need to check if previous versions are affected
59 chmod 755 configure
60 chmod 644 po/*
61 ;;
62 1.37 )
63 # Fix braindead error in e2p tests where include paths aren't
64 # being passed
65 if [ ! -f lib/e2p/Makefile.in-ORIG ]; then
66 mv lib/e2p/Makefile.in lib/e2p/Makefile.in-ORIG
67 fi
68
69 sed 's@-DTEST_PROGRAM@$(ALL_CFLAGS) &@g' \
70 lib/e2p/Makefile.in-ORIG > lib/e2p/Makefile.in
71 ;;
72esac
73
74# Edit configure so libdir and root_libdir point at */lib64 .
75# Also handles additional_libdir (used if--with-libiconv-prefix is set,
76# if we did set it (which we dont) we'd want the 64bit version anyway) ...
77chmod 755 configure
78test -f configure-ORIG ||
79 cp -p configure configure-ORIG
80
81sed "/libdir=.*\/lib/s@/lib@/${libdirname}@g" \
82 configure-ORIG > configure
83
84# We need to check if the build OS has a <getopt.h>.
85# If it doesn't, and HAVE_GETOPT_H is defined, util/subst.c will barf
86# (its compiled with BUILD_CC ie: the hosts cc). This is the case building
87# linux from solaris. Hack util/subst.c where necessary
88
89# TODO: actually try to compile something...
90if [ ! -f /usr/include/getopt.h ]; then
91 test -f util/subst.c-ORIG ||
92 mv util/subst.c util/subst.c-ORIG
93
94 # This will avoid the problem.
95 # Ideally the build-host would have a separate define than for
96 # the target, one day I may even patch it so it does...
97 sed 's@HAVE_GETOPT_H@HOST_&@g' \
98 util/subst.c-ORIG > util/subst.c
99fi
100
101cd ${SRC}
102test -d ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build &&
103 rm -rf ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build
104
105mkdir ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build &&
106cd ${SRC}/e2fsprogs-${E2FSPROGS_VER}-build
107
108# When cross-compiling configure cannot determine sizes and assumes
109# short=2, int=4, long=4, long long=8
110# This may not be correct for certain architectures, override here
111case ${TGT_ARCH} in
112 ppc64 | powerpc64 )
113 # TODO: what is size of long long on ppc64?
114 echo "ac_cv_sizeof_long_long=8" >> config.cache
115 echo "ac_cv_sizeof_long=8" >> config.cache
116 echo "ac_cv_sizeof_int=4" >> config.cache
117 echo "ac_cv_sizeof_short=2" >> config.cache
118 extra_conf="${extra_conf} --cache-file=config.cache"
119 ;;
120esac
121
122max_log_init E2fsprogs ${E2FSPROGS_VER} "Final (shared)" ${CONFLOGS} ${LOG}
123CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
124AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" \
125LD="${TARGET}-ld" STRIP="${TARGET}-strip" \
126CFLAGS="-O2 -pipe" ../${PKGDIR}/configure --prefix=${BUILD_PREFIX} \
127 --host=${TARGET} --enable-elf-shlibs ${extra_conf} \
128 >> ${LOGFILE} 2>&1 &&
129echo " o Configure OK" &&
130
131min_log_init ${BUILDLOGS} &&
132make CC="${TARGET}-gcc ${ARCH_CFLAGS}" LDFLAGS="-s" \
133 >> ${LOGFILE} 2>&1 &&
134echo " o Build OK" &&
135
136min_log_init ${INSTLOGS} &&
137make ${INSTALL_OPTIONS} install \
138 >> ${LOGFILE} 2>&1 &&
139make ${INSTALL_OPTIONS} install-libs \
140 >> ${LOGFILE} 2>&1 &&
141echo " o ALL OK" || barf
142
143if [ ! "${USE_SYSROOT}" = "Y" ]; then
144 # if ${LFS}/sbin doesn't exist, create it
145 set -x
146 if [ ! -d ${LFS}/sbin ]; then
147 mkdir -p ${LFS}/sbin
148 fi
149
150 # Install these for the benefit of init scripts.
151 # Should be overwritten in ch 6.
152 cd ${LFS}/sbin
153 ln -sf ..${TGT_TOOLS}/sbin/fsck.ext2 .
154 ln -sf ..${TGT_TOOLS}/sbin/fsck.ext3 .
155 ln -sf ..${TGT_TOOLS}/sbin/e2fsck .
156 set +x
157fi
Note: See TracBrowser for help on using the repository browser.