source: scripts/target-scripts/target-procps.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: 2.6 KB
Line 
1#!/bin/bash
2
3# cross-lfs target procps build
4# -----------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG=procps-final.log
13
14set_libdirname
15setup_multiarch
16
17if [ "${USE_SYSROOT}" = "Y" ]; then
18 BUILD_PREFIX=/usr
19 INSTALL_OPTIONS="DESTDIR=${LFS}"
20else
21 BUILD_PREFIX="${TGT_TOOLS}"
22 INSTALL_OPTIONS="DESTDIR=${TGT_TOOLS}"
23fi
24
25unpack_tarball procps-${PROCPS_VER} &&
26cd ${PKGDIR}
27
28# Following sed implements the LFS procps patch
29# apply_patch procps-${PROCPS_VER}
30# (20030404: works for procps 3.1.5 - 3.1.8)
31# Not required for 3.2.x
32#test -f w.c-ORIG ||
33# cp w.c w.c-ORIG
34#sed 's@setlocale(LC_ALL, "")@setlocale(LC_NUMERIC, "C")@' w.c-ORIG \
35# > w.c
36
37# Mod Makefile, pass extra LDFLAGS from env
38# remove strip from install invocation, change install dirs to lib64 if biarch
39# and change hard coded ncurses include search path of /usr/include/ncurses
40# to look in ${TGT_TOOLS}/include
41
42test -f Makefile-ORIG ||
43 cp Makefile Makefile-ORIG
44
45LDFLAGS="-s"
46
47# modify install invocation to set --owner and --group to the
48# user running this script.
49# ( avoids issues during install if building as a non-root user )
50uid=`id -u`
51gid=`id -g`
52
53# TODO: need to check how lib64 is handled better in procps
54# This is here based upon x86_64 only...
55sed -e "s/LDFLAGS :=.*/& ${LDFLAGS}/" \
56 -e 's@--strip @@g' \
57 -e "s@^\(lib64.*:= \).*@\1${libdirname}@g" \
58 -e "s@/usr/include/ncurses@${BUILD_PREFIX}/include/ncurses@g" \
59 -e "/^install/s/--owner 0 --group 0/--owner ${uid} --group ${gid}/g" \
60 Makefile-ORIG > Makefile
61
62# same deal with --strip in proc/module.mk
63# also remove invocation of ldconfig
64test -f proc/module.mk-ORIG ||
65 mv proc/module.mk proc/module.mk-ORIG
66
67sed -e 's@--strip @@g' \
68 -e 's@$(ldconfig)@@g' \
69 -e "s@strip@${TARGET}-strip@g" \
70 proc/module.mk-ORIG > proc/module.mk
71
72# same deal with --strip in ps/module.mk
73test -f ps/module.mk-ORIG ||
74 mv ps/module.mk ps/module.mk-ORIG
75
76sed -e 's@--strip @@g' \
77 ps/module.mk-ORIG > ps/module.mk
78
79max_log_init Procps ${PROCPS_VER} "Final (shared)" ${BUILDLOGS} ${LOG}
80make CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
81 lib64=${libdirname} \
82 CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
83 >> ${LOGFILE} 2>&1 &&
84echo " o Build OK" &&
85
86# As per LFS CVS
87min_log_init ${INSTLOGS} &&
88make ${INSTALL_OPTIONS} \
89 lib64=${libdirname} \
90 CC="${TARGET}-gcc ${ARCH_CFLAGS}" install \
91 >> ${LOGFILE} 2>&1 &&
92echo " o ALL OK" || barf
93
94if [ ! "${USE_SYSROOT}" = "Y" ]; then
95 # if ${LFS}/bin does not exist, create it.
96 if [ ! -d ${LFS}/bin ]; then
97 mkdir ${LFS}/bin
98 fi
99
100 cd ${LFS}/bin
101 ln -sf ..${TGT_TOOLS}/bin/kill .
102fi
Note: See TracBrowser for help on using the repository browser.