[oe-commits] org.oe.dev helloworld: New! A statically compiled hello world.

likewise commit openembedded-commits at lists.openembedded.org
Sat May 19 11:33:41 UTC 2007


helloworld: New! A statically compiled hello world.

Author: likewise at openembedded.org
Branch: org.openembedded.dev
Revision: 82e2f4eee7879ba67e6a63e22fe6e172b6e35a4a
ViewMTN: http://monotone.openembedded.org/revision.psp?id=82e2f4eee7879ba67e6a63e22fe6e172b6e35a4a
Files:
1
packages/helloworld
packages/helloworld/helloworld_1.0.0.bb
Diffs:

#
# mt diff -r4fd4652036215e7837566a1c8ff43ee147dba7cd -r82e2f4eee7879ba67e6a63e22fe6e172b6e35a4a
#
# 
# 
# add_dir "packages/helloworld"
# 
# add_file "packages/helloworld/helloworld_1.0.0.bb"
#  content [492893ab2416dc2fd82d53b0d4050c585b9b06e3]
# 
============================================================
--- packages/helloworld/helloworld_1.0.0.bb	492893ab2416dc2fd82d53b0d4050c585b9b06e3
+++ packages/helloworld/helloworld_1.0.0.bb	492893ab2416dc2fd82d53b0d4050c585b9b06e3
@@ -0,0 +1,50 @@
+DESCRIPTION = "Minimal statically compiled Hello world!"
+LICENSE = "GPL"
+PR = "r0"
+
+S = "${WORKDIR}/${P}"
+
+do_fetch () {
+	mkdir -p ${WORKDIR}/${P}
+	cd ${WORKDIR}/${P}
+	echo -e "#include <stdio.h>\nint main(void)\n{\n\tprintf(\"Hello world!\\\n\");\twhile(1);\n\treturn 0;\n}\n" >helloworld.c
+}
+
+do_compile () {
+	${CC} -o helloworld helloworld.c -static
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 helloworld ${D}${bindir}/
+	# /bin/init is on purpose, it is tried after /sbin/init and /etc/init
+	# so if a sysvinit is installed, it will be used instead of helloworld
+	install -d ${D}${base_bindir}
+	ln -sf ${bindir}/helloworld ${D}${base_bindir}/init
+}
+
+DESCRIPTION = "Minimal statically compiled Hello world!"
+LICENSE = "GPL"
+PR = "r0"
+
+S = "${WORKDIR}/${P}"
+
+do_fetch () {
+	mkdir -p ${WORKDIR}/${P}
+	cd ${WORKDIR}/${P}
+	echo -e "#include <stdio.h>\nint main(void)\n{\n\tprintf(\"Hello world!\\\n\");\twhile(1);\n\treturn 0;\n}\n" >helloworld.c
+}
+
+do_compile () {
+	${CC} -o helloworld helloworld.c -static
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 helloworld ${D}${bindir}/
+	# /bin/init is on purpose, it is tried after /sbin/init and /etc/init
+	# so if a sysvinit is installed, it will be used instead of helloworld
+	install -d ${D}${base_bindir}
+	ln -sf ${bindir}/helloworld ${D}${base_bindir}/init
+}
+






More information about the Openembedded-commits mailing list