1 #############################################################
5 #############################################################
7 SED_SOURCE
:=sed-
$(SED_VER
).
tar.gz
8 SED_SITE
:=ftp
://ftp.gnu.org
/gnu
/sed
10 SED_DIR1
:=$(TOOL_BUILD_DIR
)/sed-
$(SED_VER
)
11 SED_DIR2
:=$(BUILD_DIR
)/sed-
$(SED_VER
)
13 SED_TARGET_BINARY
:=bin
/sed
14 ifeq ($(strip $(BUILD_WITH_LARGEFILE
)),true
)
15 SED_CPPFLAGS
=-D_FILE_OFFSET_BITS
=64
17 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
18 HOST_SED_TARGET
=$(shell package
/sed
/sedcheck.sh
)
20 $(DL_DIR
)/$(SED_SOURCE
):
22 $(WGET
) -P
$(DL_DIR
) $(SED_SITE
)/$(SED_SOURCE
)
24 sed-source
: $(DL_DIR
)/$(SED_SOURCE
)
27 #############################################################
29 # build sed for use on the host system
31 #############################################################
32 $(SED_DIR1
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
33 mkdir
-p
$(TOOL_BUILD_DIR
)
34 mkdir
-p
$(STAGING_DIR
)/bin
;
35 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
36 touch
$(SED_DIR1
)/.unpacked
38 $(SED_DIR1
)/.configured
: $(SED_DIR1
)/.unpacked
39 (cd
$(SED_DIR1
); rm -rf config.cache
; \
41 --prefix=$(STAGING_DIR
) \
44 touch
$(SED_DIR1
)/.configured
46 $(SED_DIR1
)/$(SED_BINARY
): $(SED_DIR1
)/.configured
47 $(MAKE
) -C
$(SED_DIR1
)
49 # This stuff is needed to work around GNU make deficiencies
50 build-sed-host-binary
: $(SED_DIR1
)/$(SED_BINARY
)
51 @if
[ -L
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) ] ; then \
52 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); fi
;
53 @if
[ ! -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) -o
$(STAGING_DIR
)/$(SED_TARGET_BINARY
) \
54 -ot
$(SED_DIR1
)/$(SED_BINARY
) ] ; then \
56 mkdir
-p
$(STAGING_DIR
)/bin
; \
57 $(MAKE
) DESTDIR
=$(STAGING_DIR
) -C
$(SED_DIR1
) install; \
58 mv
$(STAGING_DIR
)/usr
/bin
/sed
$(STAGING_DIR
)/bin
/; \
59 rm -rf
$(STAGING_DIR
)/share
/locale
$(STAGING_DIR
)/usr
/info \
60 $(STAGING_DIR
)/usr
/man
$(STAGING_DIR
)/usr
/share
/doc
; fi
63 @if
[ -x
/usr
/bin
/sed
]; then SED
="/usr/bin/sed"; else \
64 if
[ -x
/bin
/sed
]; then SED
="/bin/sed"; fi
; fi
; \
65 mkdir
-p
$(STAGING_DIR
)/bin
; \
66 rm -f
$(STAGING_DIR
)/$(SED_TARGET_BINARY
); \
67 ln
-s
$$SED $(STAGING_DIR
)/$(SED_TARGET_BINARY
)
69 host-sed
: $(HOST_SED_TARGET
)
72 -$(MAKE
) -C
$(SED_DIR1
) clean
78 #############################################################
80 # build sed for use on the target system
82 #############################################################
83 $(SED_DIR2
)/.unpacked
: $(DL_DIR
)/$(SED_SOURCE
)
84 $(SED_CAT
) $(DL_DIR
)/$(SED_SOURCE
) |
tar -C
$(BUILD_DIR
) $(TAR_OPTIONS
) -
85 touch
$(SED_DIR2
)/.unpacked
87 $(SED_DIR2
)/.configured
: $(SED_DIR2
)/.unpacked
88 (cd
$(SED_DIR2
); rm -rf config.cache
; \
89 $(TARGET_CONFIGURE_OPTS
) \
90 CFLAGS
="$(TARGET_CFLAGS)" \
91 CPPFLAGS
="$(SED_CFLAGS)" \
93 --target
=$(GNU_TARGET_NAME
) \
94 --host
=$(GNU_TARGET_NAME
) \
95 --build
=$(GNU_HOST_NAME
) \
100 --libexecdir
=/usr
/lib \
102 --datadir=/usr
/share \
103 --localstatedir
=/var \
105 --infodir=/usr
/info \
108 touch
$(SED_DIR2
)/.configured
110 $(SED_DIR2
)/$(SED_BINARY
): $(SED_DIR2
)/.configured
111 $(MAKE
) CC
=$(TARGET_CC
) -C
$(SED_DIR2
)
113 # This stuff is needed to work around GNU make deficiencies
114 sed-target_binary
: $(SED_DIR2
)/$(SED_BINARY
)
115 @if
[ -L
$(TARGET_DIR
)/$(SED_TARGET_BINARY
) ] ; then \
116 rm -f
$(TARGET_DIR
)/$(SED_TARGET_BINARY
); fi
;
118 @if
[ ! -f
$(SED_DIR2
)/$(SED_BINARY
) -o
$(TARGET_DIR
)/$(SED_TARGET_BINARY
) \
119 -ot
$(SED_DIR2
)/$(SED_BINARY
) ] ; then \
121 $(MAKE
) DESTDIR
=$(TARGET_DIR
) CC
=$(TARGET_CC
) -C
$(SED_DIR2
) install; \
122 mv
$(TARGET_DIR
)/usr
/bin
/sed
$(TARGET_DIR
)/bin
/; \
123 rm -rf
$(TARGET_DIR
)/share
/locale
$(TARGET_DIR
)/usr
/info \
124 $(TARGET_DIR
)/usr
/man
$(TARGET_DIR
)/usr
/share
/doc
; fi
126 sed
: uclibc sed-target_binary
129 -$(MAKE
) -C
$(SED_DIR2
) clean
134 ifeq ($(strip $(BR2_PACKAGE_SED
)),y
)
This page took 0.049813 seconds and 5 git commands to generate.