source: scripts/native-scripts/native-nettools.sh @ 617118d

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 617118d was 617118d, checked in by Jim Gifford <clfs@…>, 18 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.9 KB
Line 
1#!/bin/bash
2
3# cross-lfs native net-tools build
4# --------------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11#set -x
12cd ${SRC}
13LOG=net-tools-native.log
14
15set_libdirname
16setup_multiarch
17
18unpack_tarball net-tools-${NETTOOLS_VER}
19cd ${PKGDIR}
20
21# TODO: get gcc version from gcc itself...
22case ${GCC_VER} in
23   3.4* | 4.* )
24      # Fix some syntax so gcc-3.4 is kept happy
25      # NOTE: this patch contains the miitool.c fix
26      apply_patch net-tools-1.60-gcc34-3
27   ;;
28   * )
29      # change string in miitool.c to something gcc-3.3 likes...
30      # TODO: wrap some logic around this...
31      apply_patch net-tools-1.60-miitool-gcc33-1
32   ;;
33esac
34
35
36# If we are building with 2.6 headers we need to adjust the x25
37# code in X25_setroute to use  the size of "struct x25_address"
38# in the memcpy instead of "x25_address" ( x25_address is no longer
39# a typedef in <linux/x25.h> )
40case "${KERNEL_VER}" in
41   2.6* )
42      test -f lib/x25_sr.c-ORIG ||
43         mv lib/x25_sr.c lib/x25_sr.c-ORIG
44
45      sed 's@\(sizeof(\)\(x25_address)\)@\1struct \2@g' \
46         lib/x25_sr.c-ORIG > lib/x25_sr.c
47   ;;
48esac
49
50# Have noticed an issue with x86_64 biarch and linux-libc-headers-2.6.5.1
51# iptunnel.c barfs out on redefinitions of 3 structs in <linux/if.h>
52# ( ifmap, ifreq and ifconf )  which are also available in <net/if.h>.
53# Removal of reference to <net/if.h> solved the issue...
54# TODO: look into this
55
56
57# Check for previously created configuration files for target.
58# TODO: this really should go somewhere other than ${TARBALLS},
59#       need a separate configs dir for the scripts for this and
60#       kernel config...
61
62test -f ${TARBALLS}/net-tools-${NETTOOLS_VER}-config-${TARGET}.tar.bz2 &&
63{
64   # Previously installed config files
65   bzcat ${TARBALLS}/net-tools-${NETTOOLS_VER}-config-${TARGET}.tar.bz2 | \
66      tar xvf -
67} || {
68   # Will have to do it interactively, save config for reuse
69   make config
70
71   tar -cvf ${TARBALLS}/net-tools-${NETTOOLS_VER}-config-${TARGET}.tar config.h config.make config.status
72   bzip2 ${TARBALLS}/net-tools-${NETTOOLS_VER}-config-${TARGET}.tar
73}
74
75# Fix hostname.c for decnet (pulls in <netdnet/dn.h>, should use <linux/dn.h>
76# NOTE: this doesn't fix it... cant be bothered looking into it,
77#       just don't bother with decnet...
78test -f hostname.c-ORIG ||
79   mv hostname.c hostname.c-ORIG
80sed 's@netdnet/dn.h@linux/dn.h@g' hostname.c-ORIG > hostname.c
81
82
83# Have to pass SHELL="bash" to make so that we use bash's "test" as
84# /usr/bin/test under solaris (used when /bin/sh is invoked as it has no
85# builtin) doesn't understand -nt (newer than)
86
87max_log_init Net-tools ${NETTOOLS_VER} "native (shared)" ${BUILDLOGS} ${LOG}
88make SHELL="bash" \
89     CC="${CC-gcc} ${ARCH_CFLAGS}" \
90     COPTS="-D_GNU_SOURCE -O2 -Wall -pipe ${TGT_CFLAGS}" \
91     LOPTS="-s" \
92   >> ${LOGFILE} 2>&1 &&
93echo " o Build OK" &&
94
95min_log_init ${INSTLOGS} &&
96make update \
97   >> ${LOGFILE} 2>&1 &&
98echo " o ALL OK" || barf
99
Note: See TracBrowser for help on using the repository browser.