Skip to contentSkip to conversation

host-qemu: new package

PATCH Superseded Francois Perrad 5 participants 40 messages Sep 25, 2012 – Oct 8, 2012

v8 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/11 host-qemu: new package

only user mode for the current target architecture

---
 package/Config.in.host      |    1 +
 package/qemu/Config.in.host |   15 +++++++++++++++
 package/qemu/qemu.mk        |   43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 package/qemu/Config.in.host
 create mode 100644 package/qemu/qemu.mk
package/Config.in.host +1 -0
index 79050f2..bf95a10 100644
@@ -4,6 +4,7 @@ source "package/dfu-util/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
+source "package/qemu/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/uboot-tools/Config.in.host"
 
package/qemu/Config.in.host new file +15 -0
new file mode 100644
index 0000000..379507c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+	bool "host qemu"
+	help
+	  QEMU is a generic and open source machine emulator and virtualizer.
+
+	  In user mode emulation, QEMU runs single cross-compiled programs.
+	  Fast cross-compilation and cross-debugging are the main targets
+	  for user-mode emulation.
+
+	  In system mode emulation, QEMU emulates a full computer system,
+	  including peripherals, and handles the filesystem image generated
+	  by Buildroot.
+	  (Buildroot is shipped with many configs/qemu_*_defconfig files).
+
+	  http://qemu.org/
package/qemu/qemu.mk new file +43 -0

43 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v8 2/11 perl: new package

---
 package/Config.in                      |    1 +
 package/perl/Config.in                 |    9 +++
 package/perl/perl-configure-qemu.patch |   43 ++++++++++++++
 package/perl/perl-make-ext.patch       |   24 ++++++++
 package/perl/perl-mkppport.patch       |   37 ++++++++++++
 package/perl/perl.mk                   |   99 ++++++++++++++++++++++++++++++++
 6 files changed, 213 insertions(+)
 create mode 100644 package/perl/Config.in
 create mode 100644 package/perl/perl-configure-qemu.patch
 create mode 100644 package/perl/perl-make-ext.patch
 create mode 100644 package/perl/perl-mkppport.patch
 create mode 100644 package/perl/perl.mk
package/Config.in +1 -0
index f308de7..00a79ab 100644
@@ -262,6 +262,7 @@ source "package/wsapi/Config.in"
 source "package/xavante/Config.in"
 endmenu
 endif
+source "package/perl/Config.in"
 source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
package/perl/Config.in new file +9 -0
new file mode 100644
index 0000000..6b7a986
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PERL
+	bool "perl"
+	select BR2_PACKAGE_HOST_QEMU
+	help
+	  Larry Wall's Practical Extraction and Report Language
+	  An interpreted scripting language, known among some as "Unix's Swiss
+	  Army Chainsaw".
+
+	  http://www.perl.org/
package/perl/perl-configure-qemu.patch new file +43 -0

43 lines not on this page · raw message

package/perl/perl-make-ext.patch new file +24 -0
new file mode 100644
index 0000000..e0195e7
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/make_ext.pl
+===================================================================
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -458,11 +458,13 @@
+ 	# Give makefile an opportunity to rewrite itself.
+ 	# reassure users that life goes on...
+ 	my @args = ('config', @$pass_through);
+-	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++#	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++	system(@make, @args) and print "@make @args failed, continuing anyway...\n";
+     }
+     my @targ = ($target, @$pass_through);
+     print "Making $target in $ext_dir\n at run @make @targ\n";
+-    my $code = system(@run, @make, @targ);
++#    my $code = system(@run, @make, @targ);
++    my $code = system(@make, @targ);
+     die "Unsuccessful make($ext_dir): code=$code" if $code != 0;
+ 
+     chdir $return_dir || die "Cannot cd to $return_dir: $!";
package/perl/perl-mkppport.patch new file +37 -0
new file mode 100644
index 0000000..97f27a2
@@ -0,0 +1,37 @@
+Add RUN
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/mkppport
+===================================================================
+--- a/mkppport
++++ b/mkppport
+@@ -1,6 +1,7 @@
+ use strict;
+ use warnings;
+ 
++use Config;
+ use Getopt::Long;
+ use File::Spec;
+ use File::Compare qw( compare );
+@@ -136,14 +137,18 @@
+ #----------------------------------------------
+ sub run
+ {
++  my @run = $Config{run};
++  @run = () if not defined $run[0] or $run[0] eq '';
+   my @args = ("-I" . File::Spec->catdir((File::Spec->updir) x 2, 'lib'), @_);
+   my $run = $perl =~ m/\s/ ? qq("$perl") : $perl;
+   for (@args) {
+     $_ = qq("$_") if $^O eq 'VMS' && /^[^"]/;
+     $run .= " $_";
+   }
+-  print "running $run\n";
+-  system $run and die "$run failed: $?\n";
++#  print "running $run\n";
++#  system $run and die "$run failed: $?\n";
++  print "running ", join(' ', @run, $run), "\n";
++  system join(' ', @run, $run) and die "@run $run failed: $?\n";
+ }
+ 
+ __END__
package/perl/perl.mk new file +99 -0

99 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v8 2/11 perl: new package

Fran?ois,

package/perl/Config.in line 3

Quoted 9 lines · Francois Perrad
package/perl/Config.in new file +3 -0
new file mode 100644
index 0000000..6b7a986
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PERL
+	bool "perl"
+	select BR2_PACKAGE_HOST_QEMU

As per my suggestion on the host-qemu package, you can remove this select statement.

Quoted 61 lines
package/perl/Config.in new file +6 -0
+	help
+	  Larry Wall's Practical Extraction and Report Language
+	  An interpreted scripting language, known among some as "Unix's Swiss
+	  Army Chainsaw".
+
+	  http://www.perl.org/
package/perl/perl-configure-qemu.patch new file +43 -0
new file mode 100644
index 0000000..921ac0b
@@ -0,0 +1,43 @@
+Add qemu support
+
+see https://rt.perl.org/rt3//Public/Bug/Display.html?id=114798
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/Configure
+===================================================================
+--- a/Configure
++++ b/Configure
+@@ -2868,7 +2868,7 @@
+ 	case "$targetfrom" in
+ 	'') targetfrom=scp ;;
+ 	esac
+-    	run=$run-$targetrun
++    	run=$run-`basename $targetrun`
+     	to=$to-$targetto
+     	from=$from-$targetfrom
+ 	case "$targetdir" in
+@@ -2908,6 +2908,14 @@
+ $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+ EOF
+ 	    ;;
++	*qemu*)
++	    to=:
++	    from=:
++	    cat >$run <<EOF
++#!/bin/sh
++$targetrun -L $qemulib "\$@"
++EOF
++	    ;;
+ 	*)  echo "Unknown targetrun '$targetrun'" >&4
+ 	    exit 1
+ 	    ;;
+@@ -5048,7 +5056,7 @@
+ echo " ";
+ echo "Checking if your compiler accepts $flag" 2>&1;
+ echo "int main(void) { return 0; }" > gcctest.c;
+-if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
++if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
+     echo "Yes, it does." 2>&1;
+     if $test -s gcctest.out ; then
+         echo "But your platform does not like it:";
package/perl/perl-make-ext.patch new file +0 -0
new file mode 100644
index 0000000..e0195e7

package/perl/perl-make-ext.patch line 3

Quoted 3 lines
package/perl/perl-make-ext.patch new file +3 -0
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)
+
+Signed-off-by: Francois Perrad <[email protected]>

I would really to see a bit more details in the patch descriptions. This is probably enough for you to understand what's going on, but not for people reviewing your code, or people that will end up maintaining this if you move away from Buildroot :-)

Quoted 24 lines
package/perl/perl.mk new file +18 -0
new file mode 100644
index 0000000..7d60ca7
@@ -0,0 +1,99 @@
+#############################################################
+#
+# perl
+#
+#############################################################
+
+PERL_VERSION_MAJOR = 16
+PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1
+PERL_SITE = http://www.cpan.org/src/5.0
+PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
+PERL_LICENSE = Artistic
+PERL_LICENSE_FILES = Artistic
+PERL_INSTALL_STAGING = YES
+PERL_DEPENDENCIES = host-qemu
+
+ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
+    PERL_USE_DEVEL=-Dusedevel
+endif

package/perl/perl.mk line 28

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+
+ifneq ($(BR2_LARGEFILE),y)
+    PERL_NO_LARGEFILE=-Uuselargefiles
+endif
+
+PERL_ARCH=$(ARCH)
+ifeq ($(PERL_ARCH),i686)
+    PERL_ARCH=i386
+endif
+PERL_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(PERL_ARCH)

Same comments as the QEMU_ARCH definition. And it should clearly be shared with the host-qemu package.

Quoted 7 lines
package/perl/perl.mk new file +7 -0
+define PERL_CONFIGURE_CMDS
+	rm -f $(@D)/config.sh
+	(cd $(@D); ./Configure -des \
+		-Dusecrosscompile \
+		-Dtargetrun=$(PERL_QEMU_USER_MODE) \
+		-Dqemulib=$(STAGING_DIR) \
+		-Dtargethost=dummy \

package/perl/perl.mk line 46

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+		-Dar="$(TARGET_AR)" \
+		-Dcc="$(TARGET_CC)" \
+		-Dcpp="$(TARGET_CC)" \
+		-Dld="$(TARGET_LD)" \
+		-Dnm="$(TARGET_NM)" \
+		-Dranlib="$(TARGET_RANLIB)" \
+		-Dccflags="$(TARGET_CFLAGS)" \
+		-Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+		-Dlddlflags="-shared" \
+		-Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \

Doh, what is target host? Why aren't you simply using:

		-Dlibc="$(STAGING_DIR)/lib/libc.so" ?
Quoted 43 lines
package/perl/perl.mk new file +43 -0
+		-Duseshrplib \
+		-Dprefix=/usr \
+		-Uoptimize \
+		$(PERL_USE_DEVEL) \
+		$(PERL_NO_LARGEFILE))
+	echo "# patched values"                 >>$(@D)/config.sh
+	$(SED) '/^myarchname=/d' \
+		-e '/^mydomain=/d' \
+		-e '/^myhostname=/d' \
+		-e '/^myuname=/d' \
+		-e '/^osname=/d' \
+		-e '/^osvers=/d' \
+		-e '/^perladmin=/d' \
+		$(@D)/config.sh
+	echo "myarchname='$(GNU_TARGET_NAME)'"                  >>$(@D)/config.sh
+	echo "mydomain=''"                                      >>$(@D)/config.sh
+	echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'"      >>$(@D)/config.sh
+	echo "myuname='Buildroot $(BR2_VERSION_FULL)'"          >>$(@D)/config.sh
+	echo "osname='linux'"                                   >>$(@D)/config.sh
+	echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'"             >>$(@D)/config.sh
+	echo "perladmin='root'"                                 >>$(@D)/config.sh
+	(cd $(@D); ./Configure -S)
+	cp $(@D)/config.h $(@D)/xconfig.h
+	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
+endef
+
+define PERL_BUILD_CMDS
+	echo "#!/bin/sh"                                        > $(@D)/Cross/miniperl
+	echo "$(PERL_QEMU_USER_MODE) $(@D)/miniperl \"\$$@\""   >>$(@D)/Cross/miniperl
+	chmod +x $(@D)/Cross/miniperl
+	PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \
+	$(MAKE) -C $(@D) all
+endef
+
+define PERL_INSTALL_STAGING_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS= \
+		DESTDIR="$(STAGING_DIR)" \
+		-C $(@D) install.perl
+endef
+
+define PERL_INSTALL_TARGET_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \

package/perl/perl.mk line 99

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+		INSTALLFLAGS=-p \
+		DESTDIR="$(TARGET_DIR)" \
+		-C $(@D) install.perl
+endef
+
+define PERL_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))

That's all I have for now on this patch.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH v8 2/11 perl: new package

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 116 lines

Fran?ois,

package/perl/Config.in line 3

Quoted 9 lines · Francois Perrad
package/perl/Config.in new file +3 -0
new file mode 100644
index 0000000..6b7a986
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PERL
+     bool "perl"
+     select BR2_PACKAGE_HOST_QEMU

As per my suggestion on the host-qemu package, you can remove this select statement.

Quoted 61 lines
package/perl/Config.in new file +6 -0
+     help
+       Larry Wall's Practical Extraction and Report Language
+       An interpreted scripting language, known among some as "Unix's Swiss
+       Army Chainsaw".
+
+       http://www.perl.org/
package/perl/perl-configure-qemu.patch new file +43 -0
new file mode 100644
index 0000000..921ac0b
@@ -0,0 +1,43 @@
+Add qemu support
+
+see https://rt.perl.org/rt3//Public/Bug/Display.html?id=114798
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/Configure
+===================================================================
+--- a/Configure
++++ b/Configure
+@@ -2868,7 +2868,7 @@
+     case "$targetfrom" in
+     '') targetfrom=scp ;;
+     esac
+-            run=$run-$targetrun
++            run=$run-`basename $targetrun`
+             to=$to-$targetto
+             from=$from-$targetfrom
+     case "$targetdir" in
+@@ -2908,6 +2908,14 @@
+ $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+ EOF
+         ;;
++    *qemu*)
++        to=:
++        from=:
++        cat >$run <<EOF
++#!/bin/sh
++$targetrun -L $qemulib "\$@"
++EOF
++        ;;
+     *)  echo "Unknown targetrun '$targetrun'" >&4
+         exit 1
+         ;;
+@@ -5048,7 +5056,7 @@
+ echo " ";
+ echo "Checking if your compiler accepts $flag" 2>&1;
+ echo "int main(void) { return 0; }" > gcctest.c;
+-if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
++if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
+     echo "Yes, it does." 2>&1;
+     if $test -s gcctest.out ; then
+         echo "But your platform does not like it:";
package/perl/perl-make-ext.patch new file +0 -0
new file mode 100644
index 0000000..e0195e7

package/perl/perl-make-ext.patch line 3

Quoted 3 lines
package/perl/perl-make-ext.patch new file +3 -0
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)
+
+Signed-off-by: Francois Perrad <[email protected]>

I would really to see a bit more details in the patch descriptions. This is probably enough for you to understand what's going on, but not for people reviewing your code, or people that will end up maintaining this if you move away from Buildroot :-)

Quoted 29 lines
package/perl/perl.mk new file +23 -0
new file mode 100644
index 0000000..7d60ca7
@@ -0,0 +1,99 @@
+#############################################################
+#
+# perl
+#
+#############################################################
+
+PERL_VERSION_MAJOR = 16
+PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1
+PERL_SITE = http://www.cpan.org/src/5.0
+PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
+PERL_LICENSE = Artistic
+PERL_LICENSE_FILES = Artistic
+PERL_INSTALL_STAGING = YES
+PERL_DEPENDENCIES = host-qemu
+
+ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
+    PERL_USE_DEVEL=-Dusedevel
+endif
+
+ifneq ($(BR2_LARGEFILE),y)
+    PERL_NO_LARGEFILE=-Uuselargefiles
+endif
+
Quoted 8 lines

package/perl/perl.mk line 28

Quoted 5 lines
package/perl/perl.mk new file +5 -0
+PERL_ARCH=$(ARCH)
+ifeq ($(PERL_ARCH),i686)
+    PERL_ARCH=i386
+endif
+PERL_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(PERL_ARCH)

Same comments as the QEMU_ARCH definition. And it should clearly be shared with the host-qemu package.

I agree with you.

Quoted 19 lines
Quoted 8 lines
package/perl/perl.mk new file +7 -0
+define PERL_CONFIGURE_CMDS
+     rm -f $(@D)/config.sh
+     (cd $(@D); ./Configure -des \
+             -Dusecrosscompile \
+             -Dtargetrun=$(PERL_QEMU_USER_MODE) \
+             -Dqemulib=$(STAGING_DIR) \
+             -Dtargethost=dummy \

package/perl/perl.mk line 46

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+             -Dar="$(TARGET_AR)" \
+             -Dcc="$(TARGET_CC)" \
+             -Dcpp="$(TARGET_CC)" \
+             -Dld="$(TARGET_LD)" \
+             -Dnm="$(TARGET_NM)" \
+             -Dranlib="$(TARGET_RANLIB)" \
+             -Dccflags="$(TARGET_CFLAGS)" \
+             -Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+             -Dlddlflags="-shared" \
+             -Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
Quoted 3 lines

Doh, what is target host? Why aren't you simply using:

                -Dlibc="$(STAGING_DIR)/lib/libc.so" ?

Ok, fixed.

Quoted 67 lines
Quoted 44 lines
package/perl/perl.mk new file +43 -0
+             -Duseshrplib \
+             -Dprefix=/usr \
+             -Uoptimize \
+             $(PERL_USE_DEVEL) \
+             $(PERL_NO_LARGEFILE))
+     echo "# patched values"                 >>$(@D)/config.sh
+     $(SED) '/^myarchname=/d' \
+             -e '/^mydomain=/d' \
+             -e '/^myhostname=/d' \
+             -e '/^myuname=/d' \
+             -e '/^osname=/d' \
+             -e '/^osvers=/d' \
+             -e '/^perladmin=/d' \
+             $(@D)/config.sh
+     echo "myarchname='$(GNU_TARGET_NAME)'"                  >>$(@D)/config.sh
+     echo "mydomain=''"                                      >>$(@D)/config.sh
+     echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'"      >>$(@D)/config.sh
+     echo "myuname='Buildroot $(BR2_VERSION_FULL)'"          >>$(@D)/config.sh
+     echo "osname='linux'"                                   >>$(@D)/config.sh
+     echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'"             >>$(@D)/config.sh
+     echo "perladmin='root'"                                 >>$(@D)/config.sh
+     (cd $(@D); ./Configure -S)
+     cp $(@D)/config.h $(@D)/xconfig.h
+     $(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
+endef
+
+define PERL_BUILD_CMDS
+     echo "#!/bin/sh"                                        > $(@D)/Cross/miniperl
+     echo "$(PERL_QEMU_USER_MODE) $(@D)/miniperl \"\$$@\""   >>$(@D)/Cross/miniperl
+     chmod +x $(@D)/Cross/miniperl
+     PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \
+     $(MAKE) -C $(@D) all
+endef
+
+define PERL_INSTALL_STAGING_CMDS
+     $(MAKE) INSTALL_DEPENDENCE= \
+             INSTALLFLAGS= \
+             DESTDIR="$(STAGING_DIR)" \
+             -C $(@D) install.perl
+endef
+
+define PERL_INSTALL_TARGET_CMDS
+     $(MAKE) INSTALL_DEPENDENCE= \

package/perl/perl.mk line 99

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+             INSTALLFLAGS=-p \
+             DESTDIR="$(TARGET_DIR)" \
+             -C $(@D) install.perl
+endef
+
+define PERL_CLEAN_CMDS
+     -$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))

That's all I have for now on this patch.

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#4 lore raw

PATCH v8 2/11 perl: new package

In reply to Francois Perrad

Fran?ois,

Review

Quoted 1 line · Francois Perrad
(quoted diff) +1 -0
+		-Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \

You should also apply the following patch:

package/perl/perl.mk +1 -1
index fbe7ba9..4e6f50b 100644
@@ -52,7 +52,7 @@ define PERL_CONFIGURE_CMDS
                -Dnm="$(TARGET_NM)" \
                -Dranlib="$(TARGET_RANLIB)" \
                -Dccflags="$(TARGET_CFLAGS)" \
-               -Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+               -Dldflags="$(TARGET_LDFLAGS) -l gcc_s -lm" \
                -Dlddlflags="-shared" \
                -Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
                -Duseshrplib \

Otherwise, the build fails with:

/home/thomas/projets/buildroot/output/host/usr/bin/arm-linux-gnueabihf-gcc -l gcc_s -fstack-protector -o miniperl \
perlmini.o opmini.o miniperlmain.o malloc.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
pp.o: In function `Perl_pp_pow':
pp.c:(.text+0x1b24): undefined reference to `pow'
pp.o: In function `Perl_pp_modulo':
pp.c:(.text+0x1f92): undefined reference to `floor'
pp.c:(.text+0x1fa0): undefined reference to `floor'
pp.c:(.text+0x1fbc): undefined reference to `fmod'
[...]

with certain toolchains.

Also, on the target there is a usr/bin/perl and a usr/bin/perl5.x.y files. One is a hardlink to the other, but it is always a bit disturbing to see two big files of the same size. Shouldn't we replace that by a symlink instead, which is more obvious?

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH v8 2/11 perl: new package

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 14 lines

Fran?ois,

Quoted 1 line · Francois Perrad

+ -Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \

You should also apply the following patch:

package/perl/perl.mk +0 -0
index fbe7ba9..4e6f50b 100644

package/perl/perl.mk define PERL_CONFIGURE_CMDS · line 58

Quoted 8 lines
package/perl/perl.mk +1 -1
@@ -52,7 +52,7 @@ define PERL_CONFIGURE_CMDS
                -Dnm="$(TARGET_NM)" \
                -Dranlib="$(TARGET_RANLIB)" \
                -Dccflags="$(TARGET_CFLAGS)" \
-               -Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+               -Dldflags="$(TARGET_LDFLAGS) -l gcc_s -lm" \
                -Dlddlflags="-shared" \
                -Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
                -Duseshrplib \

Ok, fixed.

Quoted 12 lines

Otherwise, the build fails with:

/home/thomas/projets/buildroot/output/host/usr/bin/arm-linux-gnueabihf-gcc -l gcc_s -fstack-protector -o miniperl \
perlmini.o opmini.o miniperlmain.o malloc.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
pp.o: In function `Perl_pp_pow':
pp.c:(.text+0x1b24): undefined reference to `pow'
pp.o: In function `Perl_pp_modulo':
pp.c:(.text+0x1f92): undefined reference to `floor'
pp.c:(.text+0x1fa0): undefined reference to `floor'
pp.c:(.text+0x1fbc): undefined reference to `fmod'
[...]

Quoted 6 lines

with certain toolchains.

Also, on the target there is a usr/bin/perl and a usr/bin/perl5.x.y files. One is a hardlink to the other, but it is always a bit disturbing to see two big files of the same size. Shouldn't we replace that by a symlink instead, which is more obvious?

libperl.so 1.2 MB
perl 4 KB (stripped)
perl5.16.1 4 KB
We speak about 4KB !

Quoted 13 lines

Thanks!

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#6 lore raw

PATCH v8 2/11 perl: new package

Quoted 9 lines · Fran?ois Perrad
Quoted 4 lines

Also, on the target there is a usr/bin/perl and a usr/bin/perl5.x.y files. One is a hardlink to the other, but it is always a bit disturbing to see two big files of the same size. Shouldn't we replace that by a symlink instead, which is more obvious?

libperl.so 1.2 MB
perl 4 KB (stripped)
perl5.16.1 4 KB
We speak about 4KB !

Here:

$ ls -l output/target/usr/bin/perl*
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl5.16.1
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlbug
-rwxr-xr-x 1 thomas thomas     224 oct.   4 22:59 output/target/usr/bin/perldoc
-rwxr-xr-x 1 thomas thomas   10766 oct.   4 22:59 output/target/usr/bin/perlivp
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlthanks

So it's not exactly 4 KB :)

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH v8 2/11 perl: new package

2012/10/6 Thomas Petazzoni <[email protected]>:

Quoted 23 lines · Fran?ois Perrad
Quoted 10 lines
Quoted 5 lines

Also, on the target there is a usr/bin/perl and a usr/bin/perl5.x.y files. One is a hardlink to the other, but it is always a bit disturbing to see two big files of the same size. Shouldn't we replace that by a symlink instead, which is more obvious?

libperl.so 1.2 MB
perl 4 KB (stripped)
perl5.16.1 4 KB
We speak about 4KB !

Here:

$ ls -l output/target/usr/bin/perl*
(quoted diff) +0 -6
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl5.16.1
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlbug
-rwxr-xr-x 1 thomas thomas     224 oct.   4 22:59 output/target/usr/bin/perldoc
-rwxr-xr-x 1 thomas thomas   10766 oct.   4 22:59 output/target/usr/bin/perlivp
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlthanks
Quoted 2 lines

So it's not exactly 4 KB :)

do you have a shared library libperl.so, in output/target/usr/lib/perl5/5.16.1/-your-arch-/CORE/libperl.so ? or in output/build/perl-5.16.1/libperl.so ?

looks like a static linked build
the use of shared lib is forced at configure time by the option : -Duseshrplib

I need to see the ouput of :
on your target :

     # perl -V
or on your host :
     $ output/host/usr/bin/qemu-your-arch output/build/perl-5.16.1/perl -Ilib -V

Fran?ois

Quoted 6 lines

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

#8 lore raw

PATCH v8 2/11 perl: new package

2012/10/6 Fran?ois Perrad <[email protected]>:

Quoted 24 lines

2012/10/6 Thomas Petazzoni <[email protected]>:

Quoted 23 lines · Fran?ois Perrad
Quoted 10 lines
Quoted 5 lines

Also, on the target there is a usr/bin/perl and a usr/bin/perl5.x.y files. One is a hardlink to the other, but it is always a bit disturbing to see two big files of the same size. Shouldn't we replace that by a symlink instead, which is more obvious?

libperl.so 1.2 MB
perl 4 KB (stripped)
perl5.16.1 4 KB
We speak about 4KB !

Here:

$ ls -l output/target/usr/bin/perl*
(quoted diff) +0 -6
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl
-rwxr-xr-x 2 thomas thomas 4558484 oct.   4 23:12 output/target/usr/bin/perl5.16.1
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlbug
-rwxr-xr-x 1 thomas thomas     224 oct.   4 22:59 output/target/usr/bin/perldoc
-rwxr-xr-x 1 thomas thomas   10766 oct.   4 22:59 output/target/usr/bin/perlivp
-rwxr-xr-x 2 thomas thomas   41693 oct.   4 22:59 output/target/usr/bin/perlthanks
Quoted 2 lines
Quoted 2 lines

So it's not exactly 4 KB :)

ping.
do you still have this problem ?

Quoted 22 lines

do you have a shared library libperl.so, in output/target/usr/lib/perl5/5.16.1/-your-arch-/CORE/libperl.so ? or in output/build/perl-5.16.1/libperl.so ?

looks like a static linked build
the use of shared lib is forced at configure time by the option : -Duseshrplib

I need to see the ouput of :
on your target :

     # perl -V
or on your host :
     $ output/host/usr/bin/qemu-your-arch output/build/perl-5.16.1/perl -Ilib -V

Fran?ois

Quoted 6 lines

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

#9 lore raw

PATCH v8 2/11 perl: new package

In reply to Francois Perrad
Quoted 1 line · Francois Perrad

Perl build system is way beyond my understanding, so here are just some generic
comments.

It may still take a while before your patches make it into the
repository, so please hang on!

[snip]

package/perl/perl-make-ext.patch line 1

Quoted 7 lines
package/perl/perl-make-ext.patch new file +1 -0
new file mode 100644
index 0000000..e0195e7
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)

As Thomas wrote, this patch description is not enough to understand it.
In particular, describe why a patch is needed in the first place.

Quoted 4 lines
package/perl/perl-make-ext.patch new file +4 -0
+
+Signed-off-by: Francois Perrad<[email protected]>
+
+Index: b/make_ext.pl

package/perl/perl-make-ext.patch line 15

Quoted 10 lines
package/perl/perl-make-ext.patch new file +10 -0
+===================================================================
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -458,11 +458,13 @@
+ 	# Give makefile an opportunity to rewrite itself.
+ 	# reassure users that life goes on...
+ 	my @args = ('config', @$pass_through);
+-	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++#	system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n";
++	system(@make, @args) and print "@make @args failed, continuing anyway...\n";

Since any future maintenance will be based on the patch itself, it's
not necessary to keep the original statement around in a comment - it's already there in the patch itself.

[snip]

Quoted 14 lines
package/perl/perl.mk new file +8 -0
new file mode 100644
index 0000000..7d60ca7
@@ -0,0 +1,99 @@
+#############################################################
+#
+# perl
+#
+#############################################################
+
+PERL_VERSION_MAJOR = 16
+PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1

package/perl/perl.mk line 18

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+PERL_SITE = http://www.cpan.org/src/5.0
+PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
+PERL_LICENSE = Artistic
+PERL_LICENSE_FILES = Artistic
+PERL_INSTALL_STAGING = YES
+PERL_DEPENDENCIES = host-qemu
+
+ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
+    PERL_USE_DEVEL=-Dusedevel
+endif

This one certainly deserves some explanation...

Quoted 21 lines
package/perl/perl.mk new file +21 -0
+
+ifneq ($(BR2_LARGEFILE),y)
+    PERL_NO_LARGEFILE=-Uuselargefiles
+endif
+
+PERL_ARCH=$(ARCH)
+ifeq ($(PERL_ARCH),i686)
+    PERL_ARCH=i386
+endif
+PERL_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(PERL_ARCH)
+
+define PERL_CONFIGURE_CMDS
+	rm -f $(@D)/config.sh
+	(cd $(@D); ./Configure -des \
+		-Dusecrosscompile \
+		-Dtargetrun=$(PERL_QEMU_USER_MODE) \
+		-Dqemulib=$(STAGING_DIR) \
+		-Dtargethost=dummy \
+		-Dar="$(TARGET_AR)" \
+		-Dcc="$(TARGET_CC)" \
+		-Dcpp="$(TARGET_CC)" \

package/perl/perl.mk line 49

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+		-Dld="$(TARGET_LD)" \
+		-Dnm="$(TARGET_NM)" \
+		-Dranlib="$(TARGET_RANLIB)" \
+		-Dccflags="$(TARGET_CFLAGS)" \
+		-Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+		-Dlddlflags="-shared" \
+		-Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
+		-Duseshrplib \
+		-Dprefix=/usr \
+		-Uoptimize \

It would be nicer to define a variable PERL_CONF_OPT that contains
all these configure options. Then you can also use += to extended it instead of defining PERL_USE_DEVEL etc.

Quoted 17 lines
package/perl/perl.mk new file +17 -0
+		$(PERL_USE_DEVEL) \
+		$(PERL_NO_LARGEFILE))
+	echo "# patched values">>$(@D)/config.sh
+	$(SED) '/^myarchname=/d' \
+		-e '/^mydomain=/d' \
+		-e '/^myhostname=/d' \
+		-e '/^myuname=/d' \
+		-e '/^osname=/d' \
+		-e '/^osvers=/d' \
+		-e '/^perladmin=/d' \
+		$(@D)/config.sh
+	echo "myarchname='$(GNU_TARGET_NAME)'">>$(@D)/config.sh
+	echo "mydomain=''">>$(@D)/config.sh
+	echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'">>$(@D)/config.sh
+	echo "myuname='Buildroot $(BR2_VERSION_FULL)'">>$(@D)/config.sh
+	echo "osname='linux'">>$(@D)/config.sh
+	echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'">>$(@D)/config.sh

package/perl/perl.mk line 76

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+	echo "perladmin='root'">>$(@D)/config.sh
+	(cd $(@D); ./Configure -S)
+	cp $(@D)/config.h $(@D)/xconfig.h
+	$(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h
+endef
+
+define PERL_BUILD_CMDS
+	echo "#!/bin/sh">  $(@D)/Cross/miniperl
+	echo "$(PERL_QEMU_USER_MODE) $(@D)/miniperl \"\$$@\"">>$(@D)/Cross/miniperl
+	chmod +x $(@D)/Cross/miniperl

Wouldn't it make more sense to create miniperl as part of the configure step?
I mean, when you rebuild perl, there's no need to recreate miniperl, right?

package/perl/perl.mk line 78

Quoted 2 lines
package/perl/perl.mk new file +2 -0
+	PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \
+	$(MAKE) -C $(@D) all

Minor nit: I prefer to see indentation if you continue a line like this.

Quoted 11 lines
package/perl/perl.mk new file +11 -0
+endef
+
+define PERL_INSTALL_STAGING_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \
+		INSTALLFLAGS= \
+		DESTDIR="$(STAGING_DIR)" \
+		-C $(@D) install.perl
+endef
+
+define PERL_INSTALL_TARGET_CMDS
+	$(MAKE) INSTALL_DEPENDENCE= \

package/perl/perl.mk line 99

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+		INSTALLFLAGS=-p \
+		DESTDIR="$(TARGET_DIR)" \
+		-C $(@D) install.perl
+endef
+
+define PERL_CLEAN_CMDS
+	-$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))

All in all, looks pretty good! Not tested, though.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH v8 2/11 perl: new package

2012/10/6 Arnout Vandecappelle <[email protected]>:

Quoted 112 lines · Francois Perrad
Quoted 2 lines

Perl build system is way beyond my understanding, so here are just some
generic
comments.

It may still take a while before your patches make it into the
repository, so please hang on!

[snip]

package/perl/perl-make-ext.patch line 1

Quoted 8 lines
package/perl/perl-make-ext.patch new file +1 -0
new file mode 100644
index 0000000..e0195e7
@@ -0,0 +1,24 @@
+Don't use RUN with make (only for perl)

As Thomas wrote, this patch description is not enough to understand it.
In particular, describe why a patch is needed in the first place.

Quoted 12 lines
package/perl/perl-make-ext.patch new file +12 -0
+
+Signed-off-by: Francois Perrad<[email protected]>
+
+Index: b/make_ext.pl
+===================================================================
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -458,11 +458,13 @@
+       # Give makefile an opportunity to rewrite itself.
+       # reassure users that life goes on...
+       my @args = ('config', @$pass_through);
+-      system(@run, @make, @args) and print "@run @make @args failed,
Quoted 5 lines

continuing anyway...\n";
++# system(@run, @make, @args) and print "@run @make @args failed,
continuing anyway...\n";
++ system(@make, @args) and print "@make @args failed, continuing
anyway...\n";

Since any future maintenance will be based on the patch itself, it's
not necessary to keep the original statement around in a comment - it's already there in the patch itself.

[snip]

Quoted 14 lines
package/perl/perl.mk new file +8 -0
new file mode 100644
index 0000000..7d60ca7
@@ -0,0 +1,99 @@
+#############################################################
+#
+# perl
+#
+#############################################################
+
+PERL_VERSION_MAJOR = 16
+PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1

package/perl/perl.mk line 18

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+PERL_SITE = http://www.cpan.org/src/5.0
+PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
+PERL_LICENSE = Artistic
+PERL_LICENSE_FILES = Artistic
+PERL_INSTALL_STAGING = YES
+PERL_DEPENDENCIES = host-qemu
+
+ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
+    PERL_USE_DEVEL=-Dusedevel
+endif

This one certainly deserves some explanation...

Quoted 29 lines
package/perl/perl.mk new file +28 -1
+
+ifneq ($(BR2_LARGEFILE),y)
+    PERL_NO_LARGEFILE=-Uuselargefiles
+endif
+
+PERL_ARCH=$(ARCH)
+ifeq ($(PERL_ARCH),i686)
+    PERL_ARCH=i386
+endif
+PERL_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(PERL_ARCH)
+
+define PERL_CONFIGURE_CMDS
+       rm -f $(@D)/config.sh
+       (cd $(@D); ./Configure -des \
+               -Dusecrosscompile \
+               -Dtargetrun=$(PERL_QEMU_USER_MODE) \
+               -Dqemulib=$(STAGING_DIR) \
+               -Dtargethost=dummy \
+               -Dar="$(TARGET_AR)" \
+               -Dcc="$(TARGET_CC)" \
+               -Dcpp="$(TARGET_CC)" \
+               -Dld="$(TARGET_LD)" \
+               -Dnm="$(TARGET_NM)" \
+               -Dranlib="$(TARGET_RANLIB)" \
+               -Dccflags="$(TARGET_CFLAGS)" \
+               -Dldflags="$(TARGET_LDFLAGS) -l gcc_s" \
+               -Dlddlflags="-shared" \
+
-Dlibc=$(TARGET_HOST)/usr/$(GNU_TARGET_NAME)/sysroot/lib/libc.so \
Quoted 9 lines

package/perl/perl.mk line 49

Quoted 3 lines
package/perl/perl.mk new file +3 -0
+               -Duseshrplib \
+               -Dprefix=/usr \
+               -Uoptimize \

It would be nicer to define a variable PERL_CONF_OPT that contains
all these configure options. Then you can also use += to extended it instead of defining PERL_USE_DEVEL etc.

PERL_CONF_OPT is a good idea.

Quoted 38 lines
Quoted 29 lines
package/perl/perl.mk new file +14 -0
+               $(PERL_USE_DEVEL) \
+               $(PERL_NO_LARGEFILE))
+       echo "# patched values">>$(@D)/config.sh
+       $(SED) '/^myarchname=/d' \
+               -e '/^mydomain=/d' \
+               -e '/^myhostname=/d' \
+               -e '/^myuname=/d' \
+               -e '/^osname=/d' \
+               -e '/^osvers=/d' \
+               -e '/^perladmin=/d' \
+               $(@D)/config.sh
+       echo "myarchname='$(GNU_TARGET_NAME)'">>$(@D)/config.sh
+       echo "mydomain=''">>$(@D)/config.sh
+       echo

"myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'">>$(@D)/config.sh

package/perl/perl.mk new file +7 -0
+       echo "myuname='Buildroot $(BR2_VERSION_FULL)'">>$(@D)/config.sh
+       echo "osname='linux'">>$(@D)/config.sh
+       echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'">>$(@D)/config.sh
+       echo "perladmin='root'">>$(@D)/config.sh
+       (cd $(@D); ./Configure -S)
+       cp $(@D)/config.h $(@D)/xconfig.h
+       $(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /'

$(@D)/patchlevel.h

package/perl/perl.mk new file +5 -0
+endef
+
+define PERL_BUILD_CMDS
+       echo "#!/bin/sh">  $(@D)/Cross/miniperl
+       echo "$(PERL_QEMU_USER_MODE) $(@D)/miniperl
Quoted 2 lines

\"\$$@\"">>$(@D)/Cross/miniperl
+ chmod +x $(@D)/Cross/miniperl

Wouldn't it make more sense to create miniperl as part of the configure
step?
I mean, when you rebuild perl, there's no need to recreate miniperl, right?

Quoted 6 lines

package/perl/perl.mk line 78

Quoted 2 lines
package/perl/perl.mk new file +2 -0
+       PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \
+       $(MAKE) -C $(@D) all

Minor nit: I prefer to see indentation if you continue a line like this.

Ok

Quoted 41 lines
Quoted 12 lines
package/perl/perl.mk new file +11 -0
+endef
+
+define PERL_INSTALL_STAGING_CMDS
+       $(MAKE) INSTALL_DEPENDENCE= \
+               INSTALLFLAGS= \
+               DESTDIR="$(STAGING_DIR)" \
+               -C $(@D) install.perl
+endef
+
+define PERL_INSTALL_TARGET_CMDS
+       $(MAKE) INSTALL_DEPENDENCE= \

package/perl/perl.mk line 99

Quoted 10 lines
package/perl/perl.mk new file +10 -0
+               INSTALLFLAGS=-p \
+               DESTDIR="$(TARGET_DIR)" \
+               -C $(@D) install.perl
+endef
+
+define PERL_CLEAN_CMDS
+       -$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(generic-package))

All in all, looks pretty good! Not tested, though.

Regards,
Arnout

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#11 lore raw

PATCH v8 3/11 perl: add an option for miniperl

In reply to Francois Perrad
---
 package/perl/Config.in                   |   10 +++
 package/perl/perl-install-miniperl.patch |  129 ++++++++++++++++++++++++++++++
 package/perl/perl.mk                     |    6 +-
 3 files changed, 144 insertions(+), 1 deletion(-)
 create mode 100644 package/perl/perl-install-miniperl.patch
package/perl/Config.in +10 -0
index 6b7a986..3e11574 100644
@@ -7,3 +7,13 @@ config BR2_PACKAGE_PERL
 	  Army Chainsaw".
 
 	  http://www.perl.org/
+
+if BR2_PACKAGE_PERL
+
+config BR2_PACKAGE_PERL_ONLY_MINIPERL
+	bool "only miniperl"
+	help
+	  Install only miniperl (without dynamic module loader)
+	  Usually used to bootstrap a full Perl (@INC contains only .).
+
+endif
package/perl/perl-install-miniperl.patch new file +129 -0

129 lines not on this page · raw message

package/perl/perl.mk +5 -1
index 7d60ca7..8f7ba15 100644
@@ -21,6 +21,10 @@ ifneq ($(BR2_LARGEFILE),y)
     PERL_NO_LARGEFILE=-Uuselargefiles
 endif
 
+ifeq ($(BR2_PACKAGE_PERL_ONLY_MINIPERL),y)
+    PERL_INSTALL_ONLY_MINIPERL = -miniperl
+endif
+
 PERL_ARCH=$(ARCH)
 ifeq ($(PERL_ARCH),i686)
     PERL_ARCH=i386
@@ -87,7 +91,7 @@ endef
 
 define PERL_INSTALL_TARGET_CMDS
 	$(MAKE) INSTALL_DEPENDENCE= \
-		INSTALLFLAGS=-p \
+		INSTALLFLAGS="-p $(PERL_INSTALL_ONLY_MINIPERL)"\
 		DESTDIR="$(TARGET_DIR)" \
 		-C $(@D) install.perl
 endef
Signature · 1 line
1.7.9.5
#12 lore raw

PATCH v8 3/11 perl: add an option for miniperl

Fran?ois,

package/perl/perl-install-miniperl.patch line 3

Quoted 9 lines · Francois Perrad
package/perl/perl-install-miniperl.patch new file +3 -0
new file mode 100644
index 0000000..7e6f8e6
@@ -0,0 +1,129 @@
+Add an option -miniperl
+
+Signed-off-by: Francois Perrad <[email protected]>

Does this (fairly long) patch has a chance of being merged upstream? If not, then I'd prefer if we simply didn't support miniperl.

Otherwise, it looks ok.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#13 lore raw

PATCH v8 3/11 perl: add an option for miniperl

Quoted 4 lines · Thomas Petazzoni

Fran?ois,

On Tue, 25 Sep 2012 19:18:19 +0200, Francois Perrad wrote:

Quoted 12 lines

package/perl/perl-install-miniperl.patch line 3

Quoted 9 lines
package/perl/perl-install-miniperl.patch new file +3 -0
new file mode 100644
index 0000000..7e6f8e6
@@ -0,0 +1,129 @@
+Add an option -miniperl
+
+Signed-off-by: Francois Perrad<[email protected]>

Does this (fairly long) patch has a chance of being merged upstream? If not, then I'd prefer if we simply didn't support miniperl.

I don't agree. There is definitely a need for a non-bloated perl in buildroot.
So if microperl is on its way out, this patch is needed even if upstream doesn't accept it.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#14 lore raw

PATCH v8 3/11 perl: add an option for miniperl

2012/10/6 Arnout Vandecappelle <[email protected]>:

Quoted 22 lines · Thomas Petazzoni
Quoted 5 lines

Fran?ois,

On Tue, 25 Sep 2012 19:18:19 +0200, Francois Perrad wrote:

Quoted 14 lines

package/perl/perl-install-miniperl.patch line 3

Quoted 10 lines
package/perl/perl-install-miniperl.patch new file +3 -0
new file mode 100644
index 0000000..7e6f8e6
@@ -0,0 +1,129 @@
+Add an option -miniperl
+
+Signed-off-by: Francois Perrad<[email protected]>

Does this (fairly long) patch has a chance of being merged upstream? If not, then I'd prefer if we simply didn't support miniperl.

Quoted 6 lines

I don't agree. There is definitely a need for a non-bloated perl in
buildroot.
So if microperl is on its way out, this patch is needed even if upstream doesn't
accept it.

miniperl is not a non-bloated perl.
a custom install allows a small footprint, see patch 08/11.

Quoted 14 lines

Regards,
Arnout
--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#15 lore raw

PATCH v8 3/11 perl: add an option for miniperl

Quoted 30 lines · Fran?ois Perrad

2012/10/6 Arnout Vandecappelle<[email protected]>:

Quoted 22 lines · Thomas Petazzoni
Quoted 5 lines

Fran?ois,

On Tue, 25 Sep 2012 19:18:19 +0200, Francois Perrad wrote:

Quoted 14 lines

package/perl/perl-install-miniperl.patch line 3

Quoted 10 lines
package/perl/perl-install-miniperl.patch new file +3 -0
new file mode 100644
index 0000000..7e6f8e6
@@ -0,0 +1,129 @@
+Add an option -miniperl
+
+Signed-off-by: Francois Perrad<[email protected]>

Does this (fairly long) patch has a chance of being merged upstream? If not, then I'd prefer if we simply didn't support miniperl.

Quoted 6 lines

I don't agree. There is definitely a need for a non-bloated perl in
buildroot.
So if microperl is on its way out, this patch is needed even if upstream doesn't
accept it.

Quoted 2 lines

miniperl is not a non-bloated perl.
a custom install allows a small footprint, see patch 08/11.

Ah, in that case, I also don't see much point of having miniperl in the
target, is there?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#16 lore raw

PATCH v8 3/11 perl: add an option for miniperl

In reply to Francois Perrad
Quoted 1 line · Francois Perrad

Looks good, but I don't dare to ack without testing...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#17 lore raw

PATCH v8 4/11 perl: add DB_File

In reply to Francois Perrad
---
 package/perl/Config.in |   10 ++++++++++
 package/perl/perl.mk   |    4 ++++
 2 files changed, 14 insertions(+)
package/perl/Config.in +10 -0
index 3e11574..e0dbbdf 100644
@@ -17,3 +17,13 @@ config BR2_PACKAGE_PERL_ONLY_MINIPERL
 	  Usually used to bootstrap a full Perl (@INC contains only .).
 
 endif
+
+if BR2_PACKAGE_PERL && !BR2_PACKAGE_PERL_ONLY_MINIPERL
+
+config BR2_PACKAGE_PERL_DB_FILE
+	bool "DB_File"
+	select BR2_PACKAGE_BERKELEYDB
+	help
+	  Build the DB_File module.
+
+endif
package/perl/perl.mk +4 -0
index 8f7ba15..0c69e0b 100644
@@ -11,7 +11,11 @@ PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
 PERL_LICENSE = Artistic
 PERL_LICENSE_FILES = Artistic
 PERL_INSTALL_STAGING = YES
+
 PERL_DEPENDENCIES = host-qemu
+ifeq ($(BR2_PACKAGE_PERL_DB_FILE),y)
+    PERL_DEPENDENCIES += berkeleydb
+endif
 
 ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
     PERL_USE_DEVEL=-Dusedevel
Signature · 1 line
1.7.9.5
#18 lore raw

PATCH v8 4/11 perl: add DB_File

Quoted 11 lines · Francois Perrad
---
  package/perl/Config.in |   10 ++++++++++
  package/perl/perl.mk   |    4 ++++
  2 files changed, 14 insertions(+)
package/perl/Config.in +0 -0
index 3e11574..e0dbbdf 100644

package/perl/Config.in config BR2_PACKAGE_PERL_ONLY_MINIPERL · line 21

Quoted 5 lines
package/perl/Config.in +2 -0
@@ -17,3 +17,13 @@ config BR2_PACKAGE_PERL_ONLY_MINIPERL
  	  Usually used to bootstrap a full Perl (@INC contains only .).
 
  endif
+
+if BR2_PACKAGE_PERL&&  !BR2_PACKAGE_PERL_ONLY_MINIPERL

You can reuse the preceding if BR2_PACKAGE_PERL, so all the perl options
will be wrapped into two condition levels.

Quoted 13 lines
package/perl/Config.in +8 -0
+
+config BR2_PACKAGE_PERL_DB_FILE
+	bool "DB_File"
+	select BR2_PACKAGE_BERKELEYDB
+	help
+	  Build the DB_File module.
+
+endif
package/perl/perl.mk +0 -0
index 8f7ba15..0c69e0b 100644

package/perl/perl.mk PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2 · line 18

Quoted 8 lines
package/perl/perl.mk +4 -0
@@ -11,7 +11,11 @@ PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
  PERL_LICENSE = Artistic
  PERL_LICENSE_FILES = Artistic
  PERL_INSTALL_STAGING = YES
+
  PERL_DEPENDENCIES = host-qemu
+ifeq ($(BR2_PACKAGE_PERL_DB_FILE),y)
+    PERL_DEPENDENCIES += berkeleydb
+endif

We want reproducible builds, so whether DB_File is built shouldn't depend
on whether berkeleydb happens to have been built before. If you don't select the PERL_DB_FILE option, DB_File still might be built depending on the order of compilation. There are two options to resolve this.

- Add something to PERL_CONF_OPT to explicitly disable and enable DB_FILE.

- Remove the configure option, and instead write
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)

	PERL_DEPENDENCIES += berkeleydb

endif

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#19 lore raw

PATCH v8 4/11 perl: add DB_File

2012/10/6 Arnout Vandecappelle <[email protected]>:

Quoted 53 lines · Francois Perrad
Quoted 12 lines
---
  package/perl/Config.in |   10 ++++++++++
  package/perl/perl.mk   |    4 ++++
  2 files changed, 14 insertions(+)
package/perl/Config.in +0 -0
index 3e11574..e0dbbdf 100644

package/perl/Config.in config BR2_PACKAGE_PERL_ONLY_MINIPERL · line 21

Quoted 5 lines
package/perl/Config.in +2 -0
@@ -17,3 +17,13 @@ config BR2_PACKAGE_PERL_ONLY_MINIPERL
          Usually used to bootstrap a full Perl (@INC contains only .).
 
  endif
+
+if BR2_PACKAGE_PERL&&  !BR2_PACKAGE_PERL_ONLY_MINIPERL

You can reuse the preceding if BR2_PACKAGE_PERL, so all the perl options
will be wrapped into two condition levels.

Quoted 13 lines
package/perl/Config.in +8 -0
+
+config BR2_PACKAGE_PERL_DB_FILE
+       bool "DB_File"
+       select BR2_PACKAGE_BERKELEYDB
+       help
+         Build the DB_File module.
+
+endif
package/perl/perl.mk +0 -0
index 8f7ba15..0c69e0b 100644

package/perl/perl.mk PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2 · line 18

Quoted 8 lines
package/perl/perl.mk +4 -0
@@ -11,7 +11,11 @@ PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2
  PERL_LICENSE = Artistic
  PERL_LICENSE_FILES = Artistic
  PERL_INSTALL_STAGING = YES
+
  PERL_DEPENDENCIES = host-qemu
+ifeq ($(BR2_PACKAGE_PERL_DB_FILE),y)
+    PERL_DEPENDENCIES += berkeleydb
+endif

We want reproducible builds, so whether DB_File is built shouldn't depend
on whether berkeleydb happens to have been built before. If you don't select
the PERL_DB_FILE option, DB_File still might be built depending on the order of compilation. There are two options to resolve this.

Quoted 6 lines

- Add something to PERL_CONF_OPT to explicitly disable and enable DB_FILE.

- Remove the configure option, and instead write
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)

        PERL_DEPENDENCIES += berkeleydb

endif

Done.

Quoted 15 lines

Regards,
Arnout
--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#20 lore raw

PATCH v8 5/11 gdbm: new package

In reply to Francois Perrad
---
 package/Config.in      |    1 +
 package/gdbm/Config.in |    8 ++++++++
 package/gdbm/gdbm.mk   |   12 ++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/gdbm/Config.in
 create mode 100644 package/gdbm/gdbm.mk
package/Config.in +1 -0
index 00a79ab..d9cadf9 100644
@@ -324,6 +324,7 @@ endmenu
 
 menu "Database"
 source "package/berkeleydb/Config.in"
+source "package/gdbm/Config.in"
 source "package/mysql_client/Config.in"
 source "package/sqlcipher/Config.in"
 source "package/sqlite/Config.in"
package/gdbm/Config.in new file +8 -0
new file mode 100644
index 0000000..d5aae83
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_GDBM
+	bool "gdbm"
+	help
+	  GNU dbm is a set of database routines that use extensible hashing.
+	  It works similar to the standard UNIX dbm routines.
+
+	  http://www.gnu.org/software/gdbm/gdbm.html
+
package/gdbm/gdbm.mk new file +12 -0
new file mode 100644
index 0000000..4971b12
@@ -0,0 +1,12 @@
+#############################################################
+#
+# gdbm
+#
+#############################################################
+GDBM_VERSION = 1.10
+GDBM_SITE = $(BR2_GNU_MIRROR)/gdbm
+GDBM_LICENSE = GPLv3
+GDBM_LICENSE_FILES = COPYING
+GDBM_INSTALL_STAGING = YES
+
+$(eval $(autotools-package))
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH v8 6/11 perl: add GDBM_File

In reply to Francois Perrad
---
 package/perl/Config.in |    6 ++++++
 package/perl/perl.mk   |    3 +++
 2 files changed, 9 insertions(+)
package/perl/Config.in +6 -0
index e0dbbdf..8d8430d 100644
@@ -26,4 +26,10 @@ config BR2_PACKAGE_PERL_DB_FILE
 	help
 	  Build the DB_File module.
 
+config BR2_PACKAGE_PERL_GDBM_FILE
+	bool "GDBM_File"
+	select BR2_PACKAGE_GDBM
+	help
+	  Build the GDBM_File module.
+
 endif
package/perl/perl.mk +3 -0
index 0c69e0b..71762e1 100644
@@ -16,6 +16,9 @@ PERL_DEPENDENCIES = host-qemu
 ifeq ($(BR2_PACKAGE_PERL_DB_FILE),y)
     PERL_DEPENDENCIES += berkeleydb
 endif
+ifeq ($(BR2_PACKAGE_PERL_GDBM_FILE),y)
+    PERL_DEPENDENCIES += gdbm
+endif
 
 ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1)
     PERL_USE_DEVEL=-Dusedevel
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH v8 7/11 cpanminus: new package

In reply to Francois Perrad
---
 package/Config.in                        |    5 ++++
 package/cpanminus/Config.in              |   34 +++++++++++++++++++++++
 package/cpanminus/cpanminus.mk           |   44 ++++++++++++++++++++++++++++++
 package/perl/perl-fix-Module-Build.patch |   16 +++++++++++
 4 files changed, 99 insertions(+)
 create mode 100644 package/cpanminus/Config.in
 create mode 100644 package/cpanminus/cpanminus.mk
 create mode 100644 package/perl/perl-fix-Module-Build.patch
package/Config.in +5 -0
index d9cadf9..06050f2 100644
@@ -263,6 +263,11 @@ source "package/xavante/Config.in"
 endmenu
 endif
 source "package/perl/Config.in"
+if BR2_PACKAGE_PERL
+menu "Perl libraries/modules"
+source "package/cpanminus/Config.in"
+endmenu
+endif
 source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
package/cpanminus/Config.in new file +34 -0
new file mode 100644
index 0000000..3b57ffd
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_CPANMINUS
+	bool "cpanminus"
+	help
+	  cpanminus is a script to get, unpack, build and install Perl modules
+	  from CPAN.
+
+	  Why? It's dependency free, requires zero configuration, and stands
+	  alone. When running, it requires only 10MB of RAM.
+
+	  http://github.com/miyagawa/cpanminus
+
+if BR2_PACKAGE_CPANMINUS
+
+config BR2_PACKAGE_CPANMINUS_MIRROR
+	string "mirror"
+	help
+	  Specifies the base URL for the CPAN mirror to use,
+	  such as http://cpan.cpantesters.org/.
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+	string "Perl modules from CPAN"
+	help
+	  List of space-separated Perl modules to install from CPAN.
+
+	  Examples: Try::Tiny Dancer YAML Moo
+
+	  Install the listed modules and their dependencies.
+
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+	string "native dependencies"
+	help
+	  Some XS modules require native libraries.
+
+endif
package/cpanminus/cpanminus.mk new file +44 -0

44 lines not on this page · raw message

package/perl/perl-fix-Module-Build.patch new file +16 -0
new file mode 100644
index 0000000..26b15e4
@@ -0,0 +1,16 @@
+
+Signed-off-by: Francois Perrad <[email protected]>
+
+Index: b/cpan/Module-Build/lib/Module/Build/Base.pm
+===================================================================
+--- a/cpan/Module-Build/lib/Module/Build/Base.pm
++++ b/cpan/Module-Build/lib/Module/Build/Base.pm
+@@ -456,7 +456,7 @@
+   my $proto = shift;
+   my $c     = ref($proto) ? $proto->{config} : 'Module::Build::Config';
+ 
+-  my $perl  = $^X;
++  my $perl  = $ENV{RUN_PERL} || $^X;
+   my $perl_basename = File::Basename::basename($perl);
+ 
+   my @potential_perls;
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH v8 7/11 cpanminus: new package

Fran?ois,

Quoted 11 lines · Francois Perrad
package/cpanminus/cpanminus.mk new file +5 -0
new file mode 100644
index 0000000..1b2857a
@@ -0,0 +1,44 @@
+#############################################################
+#
+# cpanminus
+#
+#############################################################

package/cpanminus/cpanminus.mk line 15

Quoted 10 lines
package/cpanminus/cpanminus.mk new file +10 -0
+
+CPANMINUS_VERSION = 1.5018
+CPANMINUS_SOURCE = miyagawa-cpanminus-$(CPANMINUS_VERSION)-0-gee6cd30.tar.gz
+CPANMINUS_SITE = https://github.com/miyagawa/cpanminus/tarball/$(CPANMINUS_VERSION)
+CPANMINUS_DEPENDENCIES = perl $(call qstrip,$(BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES))
+
+CPANMINUS_ARCH=$(ARCH)
+ifeq ($(CPANMINUS_ARCH),i686)
+    CPANMINUS_ARCH=i386
+endif

Same comment: not complete, and please share all those Qemu definitions in the host-qemu package. It should probably define TARGET_QEMU_USER to $(HOST_DIR)/usr/bin/qemu-$(QEMU_ARCH). Unless of course they are not related to Qemu.

package/cpanminus/cpanminus.mk line 20

Quoted 5 lines
package/cpanminus/cpanminus.mk new file +5 -0
+CPANMINUS_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(CPANMINUS_ARCH)
+CPANMINUS_RUN_PERL=$(CPANMINUS_QEMU_USER_MODE) $(STAGING_DIR)/usr/bin/perl
+CPANMINUS_ARCHNAME=$(shell $(CPANMINUS_RUN_PERL) -MConfig -e "print Config->{archname}")
+CPANMINUS_PERL_LIB=$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)
+CPANMINUS_PERL_ARCHLIB=$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME)

CPANMINUS_PERL_ARCHLIB = $(CPANMINUS_PERL_LIB)/$(CPANMINUS_ARCHNAME)

package/cpanminus/cpanminus.mk line 22

Quoted 2 lines
package/cpanminus/cpanminus.mk new file +2 -0
+CPANMINUS_PERL_SITELIB=$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)
+CPANMINUS_PERL_SITEARCH=$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME)

CPANMINUS_PERL_SITEARCH = $(CPANMINUS_PERL_SITELIB)/$(CPANMINUS_ARCHNAME)

package/cpanminus/cpanminus.mk line 26

Quoted 6 lines
package/cpanminus/cpanminus.mk new file +4 -0
+CPANMINUS_PERL5LIB=$(CPANMINUS_PERL_SITEARCH):$(CPANMINUS_PERL_SITELIB):$(CPANMINUS_PERL_ARCHLIB):$(CPANMINUS_PERL_LIB)
 
 
+ifneq ($(BR2_PACKAGE_CPANMINUS_MIRROR),"")
+    CPANMINUS_MIRROR=--mirror $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MIRROR)) --mirror-only
+endif

CPANMINUS_MIRROR = $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MIRROR) ifneq ($(CPANMINUS_MIRROR),y)

	CPANMINUS_CONF_OPT += --mirror $(CPANMINUS_MIRROR) --mirror-only

endif

And also, put space before and after equal sign when defining make variables.

Quoted 23 lines
package/cpanminus/cpanminus.mk new file +17 -0
+define CPANMINUS_INSTALL_TARGET_CMDS
+	echo "#!/bin/sh"                                                        > $(@D)/run_perl
+	echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\""    >>$(@D)/run_perl
+	chmod +x $(@D)/run_perl
+	PERL5LIB=$(CPANMINUS_PERL5LIB) \
+	PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+	PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+	RUN_PERL="$(@D)/run_perl" \
+	$(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+		--perl=$(@D)/run_perl \
+		--notest \
+		--no-man-pages \
+		$(CPANMINUS_MIRROR) \
+		$(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef
+
+$(eval $(generic-package))
package/perl/perl-fix-Module-Build.patch new file +0 -0
new file mode 100644
index 0000000..26b15e4

package/perl/perl-fix-Module-Build.patch line 2

Quoted 2 lines
package/perl/perl-fix-Module-Build.patch new file +2 -0
@@ -0,0 +1,16 @@
+
+Signed-off-by: Francois Perrad <[email protected]>

Patch description please.

Quoted 4 lines
package/perl/perl-fix-Module-Build.patch new file +4 -0
+
+Index: b/cpan/Module-Build/lib/Module/Build/Base.pm
+===================================================================
+--- a/cpan/Module-Build/lib/Module/Build/Base.pm

package/perl/perl-fix-Module-Build.patch line 16

Quoted 10 lines
package/perl/perl-fix-Module-Build.patch new file +10 -0
++++ b/cpan/Module-Build/lib/Module/Build/Base.pm
+@@ -456,7 +456,7 @@
+   my $proto = shift;
+   my $c     = ref($proto) ? $proto->{config} : 'Module::Build::Config';
+ 
+-  my $perl  = $^X;
++  my $perl  = $ENV{RUN_PERL} || $^X;
+   my $perl_basename = File::Basename::basename($perl);
+ 
+   my @potential_perls;

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#24 lore raw

PATCH v8 7/11 cpanminus: new package

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 21 lines

Fran?ois,

Quoted 18 lines · Francois Perrad
package/cpanminus/cpanminus.mk new file +12 -0
new file mode 100644
index 0000000..1b2857a
@@ -0,0 +1,44 @@
+#############################################################
+#
+# cpanminus
+#
+#############################################################
+
+CPANMINUS_VERSION = 1.5018
+CPANMINUS_SOURCE = miyagawa-cpanminus-$(CPANMINUS_VERSION)-0-gee6cd30.tar.gz
+CPANMINUS_SITE = https://github.com/miyagawa/cpanminus/tarball/$(CPANMINUS_VERSION)
+CPANMINUS_DEPENDENCIES = perl $(call qstrip,$(BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES))
+
+CPANMINUS_ARCH=$(ARCH)
Quoted 8 lines

package/cpanminus/cpanminus.mk line 15

Quoted 3 lines
package/cpanminus/cpanminus.mk new file +3 -0
+ifeq ($(CPANMINUS_ARCH),i686)
+    CPANMINUS_ARCH=i386
+endif

Same comment: not complete, and please share all those Qemu definitions in the host-qemu package. It should probably define TARGET_QEMU_USER to $(HOST_DIR)/usr/bin/qemu-$(QEMU_ARCH). Unless of course they are not related to Qemu.

Ok.

Quoted 8 lines

package/cpanminus/cpanminus.mk line 20

Quoted 6 lines
package/cpanminus/cpanminus.mk new file +5 -0
+CPANMINUS_QEMU_USER_MODE=$(HOST_DIR)/usr/bin/qemu-$(CPANMINUS_ARCH)
+CPANMINUS_RUN_PERL=$(CPANMINUS_QEMU_USER_MODE) $(STAGING_DIR)/usr/bin/perl
+CPANMINUS_ARCHNAME=$(shell $(CPANMINUS_RUN_PERL) -MConfig -e "print Config->{archname}")
+CPANMINUS_PERL_LIB=$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)
+CPANMINUS_PERL_ARCHLIB=$(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME)

CPANMINUS_PERL_ARCHLIB = $(CPANMINUS_PERL_LIB)/$(CPANMINUS_ARCHNAME)

Ok

Quoted 5 lines

package/cpanminus/cpanminus.mk line 22

Quoted 3 lines
package/cpanminus/cpanminus.mk new file +2 -0
+CPANMINUS_PERL_SITELIB=$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)
+CPANMINUS_PERL_SITEARCH=$(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)/$(CPANMINUS_ARCHNAME)

CPANMINUS_PERL_SITEARCH = $(CPANMINUS_PERL_SITELIB)/$(CPANMINUS_ARCHNAME)

Ok

Quoted 10 lines

package/cpanminus/cpanminus.mk line 26

Quoted 7 lines
package/cpanminus/cpanminus.mk new file +4 -0
+CPANMINUS_PERL5LIB=$(CPANMINUS_PERL_SITEARCH):$(CPANMINUS_PERL_SITELIB):$(CPANMINUS_PERL_ARCHLIB):$(CPANMINUS_PERL_LIB)
 
 
+ifneq ($(BR2_PACKAGE_CPANMINUS_MIRROR),"")
+    CPANMINUS_MIRROR=--mirror $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MIRROR)) --mirror-only
+endif

CPANMINUS_MIRROR = $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MIRROR) ifneq ($(CPANMINUS_MIRROR),y)

Quoted 4 lines
        CPANMINUS_CONF_OPT += --mirror $(CPANMINUS_MIRROR) --mirror-only

endif

And also, put space before and after equal sign when defining make variables.

Ok.

Quoted 54 lines
Quoted 24 lines
package/cpanminus/cpanminus.mk new file +17 -0
+define CPANMINUS_INSTALL_TARGET_CMDS
+     echo "#!/bin/sh"                                                        > $(@D)/run_perl
+     echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\""    >>$(@D)/run_perl
+     chmod +x $(@D)/run_perl
+     PERL5LIB=$(CPANMINUS_PERL5LIB) \
+     PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+     PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+     RUN_PERL="$(@D)/run_perl" \
+     $(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+             --perl=$(@D)/run_perl \
+             --notest \
+             --no-man-pages \
+             $(CPANMINUS_MIRROR) \
+             $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef
+
+$(eval $(generic-package))
package/perl/perl-fix-Module-Build.patch new file +0 -0
new file mode 100644
index 0000000..26b15e4

package/perl/perl-fix-Module-Build.patch line 2

Quoted 2 lines
package/perl/perl-fix-Module-Build.patch new file +2 -0
@@ -0,0 +1,16 @@
+
+Signed-off-by: Francois Perrad <[email protected]>

Patch description please.

Quoted 4 lines
package/perl/perl-fix-Module-Build.patch new file +4 -0
+
+Index: b/cpan/Module-Build/lib/Module/Build/Base.pm
+===================================================================
+--- a/cpan/Module-Build/lib/Module/Build/Base.pm

package/perl/perl-fix-Module-Build.patch line 16

Quoted 10 lines
package/perl/perl-fix-Module-Build.patch new file +10 -0
++++ b/cpan/Module-Build/lib/Module/Build/Base.pm
+@@ -456,7 +456,7 @@
+   my $proto = shift;
+   my $c     = ref($proto) ? $proto->{config} : 'Module::Build::Config';
+
+-  my $perl  = $^X;
++  my $perl  = $ENV{RUN_PERL} || $^X;
+   my $perl_basename = File::Basename::basename($perl);
+
+   my @potential_perls;

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#25 lore raw

PATCH v8 7/11 cpanminus: new package

In reply to Francois Perrad

Fran?ois,

Some other questions...

Quoted 11 lines · Francois Perrad
package/cpanminus/Config.in new file +11 -0
+if BR2_PACKAGE_CPANMINUS
+
+config BR2_PACKAGE_CPANMINUS_MIRROR
+	string "mirror"
+	help
+	  Specifies the base URL for the CPAN mirror to use,
+	  such as http://cpan.cpantesters.org/.
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+	string "Perl modules from CPAN"
+	help

package/cpanminus/Config.in line 32

Quoted 10 lines
package/cpanminus/Config.in new file +10 -0
+	  List of space-separated Perl modules to install from CPAN.
+
+	  Examples: Try::Tiny Dancer YAML Moo
+
+	  Install the listed modules and their dependencies.
+
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+	string "native dependencies"
+	help
+	  Some XS modules require native libraries.

I'm wondering if those options shouldn't have some default values, at least for BR2_PACKAGE_CPANMINUS_MODULES and BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES, so that when our autobuilders will enable this package, it will actually build something. Of course, we can't test all possibilities, but at least testing a basic module that has a native dependency would be a good test.

Quoted 5 lines
package/cpanminus/cpanminus.mk new file +5 -0
+define CPANMINUS_INSTALL_TARGET_CMDS
+	echo "#!/bin/sh"                                                        > $(@D)/run_perl
+	echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\""    >>$(@D)/run_perl
+	chmod +x $(@D)/run_perl
+	PERL5LIB=$(CPANMINUS_PERL5LIB) \

package/cpanminus/cpanminus.mk line 42

Quoted 10 lines
package/cpanminus/cpanminus.mk new file +10 -0
+	PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+	PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+	RUN_PERL="$(@D)/run_perl" \
+	$(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+		--perl=$(@D)/run_perl \
+		--notest \
+		--no-man-pages \
+		$(CPANMINUS_MIRROR) \
+		$(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef

Will this work if $(BR2_PACKAGE_CPANMINUS_MODULES) is empty?

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#26 lore raw

PATCH v8 7/11 cpanminus: new package

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 28 lines

Fran?ois,

Some other questions...

Quoted 11 lines · Francois Perrad
package/cpanminus/Config.in new file +11 -0
+if BR2_PACKAGE_CPANMINUS
+
+config BR2_PACKAGE_CPANMINUS_MIRROR
+     string "mirror"
+     help
+       Specifies the base URL for the CPAN mirror to use,
+       such as http://cpan.cpantesters.org/.
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+     string "Perl modules from CPAN"
+     help

package/cpanminus/Config.in line 32

Quoted 10 lines
package/cpanminus/Config.in new file +10 -0
+       List of space-separated Perl modules to install from CPAN.
+
+       Examples: Try::Tiny Dancer YAML Moo
+
+       Install the listed modules and their dependencies.
+
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+     string "native dependencies"
+     help
+       Some XS modules require native libraries.
Quoted 8 lines

I'm wondering if those options shouldn't have some default values, at least for BR2_PACKAGE_CPANMINUS_MODULES and BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES, so that when our autobuilders will enable this package, it will actually build something. Of course, we can't test all possibilities, but at least testing a basic module that has a native dependency would be a good test.

I suggest these values for autobuilder
BR2_PACKAGE_CPANMINUS_MODULES = Curses::UI BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES = ncurses

Thomas, could you test them ?

Quoted 30 lines
Quoted 5 lines
package/cpanminus/cpanminus.mk new file +5 -0
+define CPANMINUS_INSTALL_TARGET_CMDS
+     echo "#!/bin/sh"                                                        > $(@D)/run_perl
+     echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\""    >>$(@D)/run_perl
+     chmod +x $(@D)/run_perl
+     PERL5LIB=$(CPANMINUS_PERL5LIB) \

package/cpanminus/cpanminus.mk line 42

Quoted 10 lines
package/cpanminus/cpanminus.mk new file +10 -0
+     PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+     PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+     RUN_PERL="$(@D)/run_perl" \
+     $(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+             --perl=$(@D)/run_perl \
+             --notest \
+             --no-man-pages \
+             $(CPANMINUS_MIRROR) \
+             $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef

Will this work if $(BR2_PACKAGE_CPANMINUS_MODULES) is empty?

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#27 lore raw

PATCH v8 7/11 cpanminus: new package

In reply to Thomas Petazzoni

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 45 lines

Fran?ois,

Some other questions...

Quoted 11 lines · Francois Perrad
package/cpanminus/Config.in new file +11 -0
+if BR2_PACKAGE_CPANMINUS
+
+config BR2_PACKAGE_CPANMINUS_MIRROR
+     string "mirror"
+     help
+       Specifies the base URL for the CPAN mirror to use,
+       such as http://cpan.cpantesters.org/.
+
+config BR2_PACKAGE_CPANMINUS_MODULES
+     string "Perl modules from CPAN"
+     help

package/cpanminus/Config.in line 32

Quoted 10 lines
package/cpanminus/Config.in new file +10 -0
+       List of space-separated Perl modules to install from CPAN.
+
+       Examples: Try::Tiny Dancer YAML Moo
+
+       Install the listed modules and their dependencies.
+
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+     string "native dependencies"
+     help
+       Some XS modules require native libraries.

I'm wondering if those options shouldn't have some default values, at least for BR2_PACKAGE_CPANMINUS_MODULES and BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES, so that when our autobuilders will enable this package, it will actually build something. Of course, we can't test all possibilities, but at least testing a basic module that has a native dependency would be a good test.

Quoted 9 lines
package/cpanminus/cpanminus.mk new file +9 -0
+define CPANMINUS_INSTALL_TARGET_CMDS
+     echo "#!/bin/sh"                                                        > $(@D)/run_perl
+     echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\""    >>$(@D)/run_perl
+     chmod +x $(@D)/run_perl
+     PERL5LIB=$(CPANMINUS_PERL5LIB) \
+     PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+     PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+     RUN_PERL="$(@D)/run_perl" \
+     $(CPANMINUS_RUN_PERL) $(@D)/cpanm \
Quoted 8 lines

package/cpanminus/cpanminus.mk line 42

Quoted 6 lines
package/cpanminus/cpanminus.mk new file +6 -0
+             --perl=$(@D)/run_perl \
+             --notest \
+             --no-man-pages \
+             $(CPANMINUS_MIRROR) \
+             $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+endef

Will this work if $(BR2_PACKAGE_CPANMINUS_MODULES) is empty?

Now, fixed.

Quoted 13 lines

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#28 lore raw

PATCH v8 7/11 cpanminus: new package

In reply to Francois Perrad

Didn't have time to look at the patch in detail; however:

package/cpanminus/Config.in line 33

Quoted 5 lines · Francois Perrad
package/cpanminus/Config.in new file +5 -0
+config BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES
+	string "native dependencies"
+	help
+	  Some XS modules require native libraries.
+

This one certainly deserves a better explanation. How about:

Some XS modules require native libraries. Give a list here of buildroot packages that are required for the CPAN modules selected above.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#29 lore raw

PATCH v8 8/11 perl: add option "custom install"

In reply to Francois Perrad

allows same behaviour (and footprint) as microperl

---
 package/cpanminus/Config.in |    4 ++++
 package/perl/Config.in      |   16 +++++++++++++++
 package/perl/perl.mk        |   47 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+)
package/cpanminus/Config.in +4 -0
index 3b57ffd..d6ada47 100644
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_CPANMINUS
 	bool "cpanminus"
+	depends on !BR2_PACKAGE_PERL_CUSTOM_INSTALL
 	help
 	  cpanminus is a script to get, unpack, build and install Perl modules
 	  from CPAN.
@@ -9,6 +10,9 @@ config BR2_PACKAGE_CPANMINUS
 
 	  http://github.com/miyagawa/cpanminus
 
+comment "cpanminus requires a fully installed perl"
+	depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL
+
 if BR2_PACKAGE_CPANMINUS
 
 config BR2_PACKAGE_CPANMINUS_MIRROR
package/perl/Config.in +16 -0
index 8d8430d..ec0c60d 100644
@@ -16,6 +16,22 @@ config BR2_PACKAGE_PERL_ONLY_MINIPERL
 	  Install only miniperl (without dynamic module loader)
 	  Usually used to bootstrap a full Perl (@INC contains only .).
 
+config BR2_PACKAGE_PERL_CUSTOM_INSTALL
+	bool "custom install"
+	help
+	  Don't use the full install target
+	  Install only a selection of modules (like microperl).
+
+config BR2_PACKAGE_PERL_MODULES
+	string "additional modules"
+	depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL
+	help
+	  List of space-separated perl modules to copy to the rootfs.
+
+	  Examples: constant.pm Getopt/Std.pm Time/Local.pm
+
+	  Module dependencies are not automatic so check your needs.
+
 endif
 
 if BR2_PACKAGE_PERL && !BR2_PACKAGE_PERL_ONLY_MINIPERL
package/perl/perl.mk +47 -0

59 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#30 lore raw

PATCH v8 9/11 perl: relax microperl dependencies

In reply to Francois Perrad
---
 package/autoconf/Config.in   |    2 +-
 package/autoconf/autoconf.mk |    7 ++++++-
 package/automake/Config.in   |    2 +-
 package/automake/automake.mk |    7 ++++++-
 package/ntp/Config.in        |    4 ++--
 package/samba/Config.in      |    4 ++--
 6 files changed, 18 insertions(+), 8 deletions(-)
package/autoconf/Config.in +1 -1
index 00b3e2c..41866ad 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_AUTOCONF
 	bool "autoconf"
-	select BR2_PACKAGE_MICROPERL
+	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
 	help
 	  Extensible program for developing configure scripts.  These
 	  scripts handle all the mundane system/feature detection.
package/autoconf/autoconf.mk +6 -1
index 3f84e3e..13a474e 100644
@@ -10,7 +10,12 @@ AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf
 AUTOCONF_CONF_ENV = EMACS="no" ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 		    ac_cv_prog_gnu_m4_gnu=no
 
-AUTOCONF_DEPENDENCIES = microperl host-m4
+AUTOCONF_DEPENDENCIES = host-m4
+ifeq ($(BR2_PACKAGE_PERL),y)
+    AUTOCONF_DEPENDENCIES += perl
+else
+    AUTOCONF_DEPENDENCIES += microperl
+endif
 
 HOST_AUTOCONF_CONF_ENV = ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 			ac_cv_prog_gnu_m4_gnu=no
package/automake/Config.in +1 -1
index 935f1f1..c0b29d1 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_AUTOMAKE
 	bool "automake"
 	select BR2_PACKAGE_AUTOCONF
-	select BR2_PACKAGE_MICROPERL
+	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
 	help
 	  Tool for automatically generating Makefile's for input to
 	  configure scripts (made by autoconf).
package/automake/automake.mk +6 -1
index 3c19085..0766111 100644
@@ -7,7 +7,12 @@
 AUTOMAKE_VERSION = 1.11.5
 AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake
 
-AUTOMAKE_DEPENDENCIES = host-autoconf autoconf microperl
+AUTOMAKE_DEPENDENCIES = host-autoconf autoconf
+ifeq ($(BR2_PACKAGE_PERL),y)
+    AUTOMAKE_DEPENDENCIES += perl
+else
+    AUTOMAKE_DEPENDENCIES += microperl
+endif
 
 HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
 
package/ntp/Config.in +2 -2
index 5996596..434cd2d 100644
@@ -20,7 +20,7 @@ config BR2_PACKAGE_NTP_NTP_KEYGEN
 
 config BR2_PACKAGE_NTP_NTP_WAIT
 	bool "ntp-wait"
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  ntp-wait waits until the locally running ntpd is in state 4
 	  (synchronized). This could be useful at boot time, to delay the
@@ -59,7 +59,7 @@ config BR2_PACKAGE_NTP_NTPSNMPD
 
 config BR2_PACKAGE_NTP_NTPTRACE
 	bool "ntptrace"
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  ntptrace is a perl script that uses the ntpq utility program to
 	  follow the chain of NTP servers from a given host back to the
package/samba/Config.in +2 -2
index e88b360..ee3244f 100644
@@ -36,12 +36,12 @@ config BR2_PACKAGE_SAMBA_FINDSMB
 	default y
 	depends on BR2_PACKAGE_SAMBA_SMBCLIENT
 	depends on BR2_PACKAGE_SAMBA_NMBLOOKUP
-	depends on BR2_PACKAGE_MICROPERL
+	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
 	help
 	  Script to browse network
 
 comment "findsmb       - disabled (requires nmblookup, smbclient and perl)"
-	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !BR2_PACKAGE_MICROPERL
+	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !(BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL)
 
 config BR2_PACKAGE_SAMBA_NET
 	bool "net"
Signature · 1 line
1.7.9.5
#31 lore raw

PATCH v8 10/11 microperl: mark as DEPRECATED

In reply to Francois Perrad
---
 package/microperl/Config.in |    1 +
 1 file changed, 1 insertion(+)
package/microperl/Config.in +1 -0
index 66bbedd..19d104a 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_MICROPERL
 	bool "microperl"
 	# needs fork()
 	depends on BR2_USE_MMU
+	depends on BR2_DEPRECATED
 	help
 	  Perl without operating-specific functions such as readdir.
 
Signature · 1 line
1.7.9.5
#32 lore raw

PATCH v8 11/11 microperl: remove it

In reply to Francois Perrad

replaced by perl
use BR2_PACKAGE_PERL_CUSTOM_INSTALL if you want a small footprint

---
 package/Config.in                                  |    1 -
 package/autoconf/Config.in                         |    2 +-
 package/autoconf/autoconf.mk                       |    7 +-
 package/automake/Config.in                         |    2 +-
 package/automake/automake.mk                       |    7 +-
 package/libxml-parser-perl/libxml-parser-perl.mk   |    6 -
 package/microperl/Config.in                        |   30 ----
 .../microperl/microperl-no-signal-handlers.patch   |   22 ---
 package/microperl/microperl-uudmap.patch           |   47 ------
 package/microperl/microperl.mk                     |  156 --------------------
 package/ntp/Config.in                              |    4 +-
 package/samba/Config.in                            |    4 +-
 12 files changed, 8 insertions(+), 280 deletions(-)
 delete mode 100644 package/microperl/Config.in
 delete mode 100644 package/microperl/microperl-no-signal-handlers.patch
 delete mode 100644 package/microperl/microperl-uudmap.patch
 delete mode 100644 package/microperl/microperl.mk
package/Config.in +0 -1
index 06050f2..987d1d1 100644
@@ -268,7 +268,6 @@ menu "Perl libraries/modules"
 source "package/cpanminus/Config.in"
 endmenu
 endif
-source "package/microperl/Config.in"
 source "package/php/Config.in"
 source "package/python/Config.in"
 if BR2_PACKAGE_PYTHON
package/autoconf/Config.in +1 -1
index 41866ad..5f2f148 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_AUTOCONF
 	bool "autoconf"
-	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
+	select BR2_PACKAGE_PERL
 	help
 	  Extensible program for developing configure scripts.  These
 	  scripts handle all the mundane system/feature detection.
package/autoconf/autoconf.mk +1 -6
index 13a474e..0cb50db 100644
@@ -10,12 +10,7 @@ AUTOCONF_SITE = $(BR2_GNU_MIRROR)/autoconf
 AUTOCONF_CONF_ENV = EMACS="no" ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 		    ac_cv_prog_gnu_m4_gnu=no
 
-AUTOCONF_DEPENDENCIES = host-m4
-ifeq ($(BR2_PACKAGE_PERL),y)
-    AUTOCONF_DEPENDENCIES += perl
-else
-    AUTOCONF_DEPENDENCIES += microperl
-endif
+AUTOCONF_DEPENDENCIES = host-m4 perl
 
 HOST_AUTOCONF_CONF_ENV = ac_cv_path_M4=$(HOST_DIR)/usr/bin/m4 \
 			ac_cv_prog_gnu_m4_gnu=no
package/automake/Config.in +1 -1
index c0b29d1..9a9673a 100644
@@ -1,7 +1,7 @@
 config BR2_PACKAGE_AUTOMAKE
 	bool "automake"
 	select BR2_PACKAGE_AUTOCONF
-	select BR2_PACKAGE_MICROPERL if !BR2_PACKAGE_PERL
+	select BR2_PACKAGE_PERL
 	help
 	  Tool for automatically generating Makefile's for input to
 	  configure scripts (made by autoconf).
package/automake/automake.mk +1 -6
index 0766111..8be56c3 100644
@@ -7,12 +7,7 @@
 AUTOMAKE_VERSION = 1.11.5
 AUTOMAKE_SITE = $(BR2_GNU_MIRROR)/automake
 
-AUTOMAKE_DEPENDENCIES = host-autoconf autoconf
-ifeq ($(BR2_PACKAGE_PERL),y)
-    AUTOMAKE_DEPENDENCIES += perl
-else
-    AUTOMAKE_DEPENDENCIES += microperl
-endif
+AUTOMAKE_DEPENDENCIES = host-autoconf autoconf perl
 
 HOST_AUTOMAKE_DEPENDENCIES = host-autoconf
 
package/libxml-parser-perl/libxml-parser-perl.mk +0 -6
index a6f8ae9..8e2f899 100644
@@ -9,12 +9,6 @@ LIBXML_PARSER_PERL_SITE:=http://www.cpan.org/modules/by-module/XML/
 
 LIBXML_PARSER_PERL_DEPENDENCIES = expat
 
-ifeq ($(BR2_PACKAGE_MICROPERL),y)
-# microperl builds host-microperl, so ensure we build after that to build
-# against host-microperl instead of the system perl
-LIBXML_PARSER_PERL_DEPENDENCIES += microperl
-endif
-
 define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
  (cd $(@D) ; \
    $(HOST_CONFIGURE_OPTS) perl Makefile.PL \
package/microperl/Config.in deleted +0 -30
deleted file mode 100644
index 19d104a..0000000
@@ -1,30 +0,0 @@
-config BR2_PACKAGE_MICROPERL
-	bool "microperl"
-	# needs fork()
-	depends on BR2_USE_MMU
-	depends on BR2_DEPRECATED
-	help
-	  Perl without operating-specific functions such as readdir.
-
-if BR2_PACKAGE_MICROPERL
-
-config BR2_PACKAGE_MICROPERL_MODULES
-	string "additional modules"
-	help
-	  List of space-separated microperl modules to copy to the rootfs.
-
-	  Examples: warnings.pm Getopt/Std.pm Time::Local
-
-	  Module dependencies are not automatic so check your needs.
-	  You can't use XS modules like IO.
-
-menu "module bundles"
-
-config BR2_PACKAGE_MICROPERL_BUNDLE_CGI
-	bool "CGI"
-	help
-	  Copy required modules to do CGI scripting.
-
-endmenu
-
-endif
package/microperl/microperl-no-signal-handlers.patch deleted +0 -22
deleted file mode 100644
index 3c9aa41..0000000
@@ -1,22 +0,0 @@
-Backport of http://perl5.git.perl.org/perl.git/commitdiff/01d65469392dfc0a?hp=a82b5f080d91ffe184d8ac4795ac71e72e612c2f
-
-Signed-off-by: Gustavo Zacarias <[email protected]>
-
-diff -Nura perl-5.12.3/miniperlmain.c perl-5.12.3-nosig/miniperlmain.c
---- perl-5.12.3/miniperlmain.c	2011-01-09 17:20:57.000000000 -0300
-+++ perl-5.12.3-nosig/miniperlmain.c	2011-04-14 10:16:53.564639438 -0300
-@@ -116,12 +116,14 @@
-     if (!exitstatus)
-         perl_run(my_perl);
- 
-+#ifndef PERL_MICRO
-     /* Unregister our signal handler before destroying my_perl */
-     for (i = 0; PL_sig_name[i]; i++) {
- 	if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) {
- 	    rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL);
- 	}
-     }
-+#endif
- 
-     exitstatus = perl_destruct(my_perl);
- 
package/microperl/microperl-uudmap.patch deleted +0 -47

47 lines not on this page · raw message

package/microperl/microperl.mk deleted +0 -156

156 lines not on this page · raw message

package/ntp/Config.in +2 -2
index 434cd2d..ec5dbbb 100644
@@ -20,7 +20,7 @@ config BR2_PACKAGE_NTP_NTP_KEYGEN
 
 config BR2_PACKAGE_NTP_NTP_WAIT
 	bool "ntp-wait"
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  ntp-wait waits until the locally running ntpd is in state 4
 	  (synchronized). This could be useful at boot time, to delay the
@@ -59,7 +59,7 @@ config BR2_PACKAGE_NTP_NTPSNMPD
 
 config BR2_PACKAGE_NTP_NTPTRACE
 	bool "ntptrace"
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  ntptrace is a perl script that uses the ntpq utility program to
 	  follow the chain of NTP servers from a given host back to the
package/samba/Config.in +2 -2
index ee3244f..92714d7 100644
@@ -36,12 +36,12 @@ config BR2_PACKAGE_SAMBA_FINDSMB
 	default y
 	depends on BR2_PACKAGE_SAMBA_SMBCLIENT
 	depends on BR2_PACKAGE_SAMBA_NMBLOOKUP
-	depends on BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL
+	depends on BR2_PACKAGE_PERL
 	help
 	  Script to browse network
 
 comment "findsmb       - disabled (requires nmblookup, smbclient and perl)"
-	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !(BR2_PACKAGE_MICROPERL || BR2_PACKAGE_PERL)
+	depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !BR2_PACKAGE_PERL
 
 config BR2_PACKAGE_SAMBA_NET
 	bool "net"
Signature · 1 line
1.7.9.5
#33 lore raw

PATCH v8 1/11 host-qemu: new package

In reply to Francois Perrad
Quoted 3 lines · Francois Perrad

only user mode for the current target architecture

[snip]

Quoted 9 lines
package/qemu/Config.in.host new file +3 -0
new file mode 100644
index 0000000..379507c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+	bool "host qemu"
+	help

package/qemu/Config.in.host line 13

Quoted 10 lines
package/qemu/Config.in.host new file +10 -0
+	  QEMU is a generic and open source machine emulator and virtualizer.
+
+	  In user mode emulation, QEMU runs single cross-compiled programs.
+	  Fast cross-compilation and cross-debugging are the main targets
+	  for user-mode emulation.
+
+	  In system mode emulation, QEMU emulates a full computer system,
+	  including peripherals, and handles the filesystem image generated
+	  by Buildroot.
+	  (Buildroot is shipped with many configs/qemu_*_defconfig files).

If only user mode is supported, that should be documented in the help text.

Quoted 9 lines
package/qemu/Config.in.host new file +2 -0
+
+	  http://qemu.org/
package/qemu/qemu.mk new file +1 -0
new file mode 100644
index 0000000..d727f49
@@ -0,0 +1,43 @@
+#############################################################

package/qemu/qemu.mk line 11

Quoted 10 lines
package/qemu/qemu.mk new file +10 -0
+#
+# qemu
+#
+#############################################################
+
+QEMU_VERSION = 1.2.0
+QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
+QEMU_SITE = http://wiki.qemu.org/download
+
+HOST_QEMU_DEPENDENCIES =

This can be removed.

package/qemu/qemu.mk line 17

Quoted 6 lines
package/qemu/qemu.mk new file +6 -0
+
+QEMU_ARCH=$(ARCH)
+ifeq ($(QEMU_ARCH),i686)
+    QEMU_ARCH=i386
+endif
+HOST_QEMU_TARGETS=$(QEMU_ARCH)-linux-user

We normally put spaces before and after =

Quoted 16 lines
package/qemu/qemu.mk new file +16 -0
+
+define HOST_QEMU_CONFIGURE_CMDS
+	(cd $(@D); ./configure                          \
+		--target-list="$(HOST_QEMU_TARGETS)"    \
+		--prefix="$(HOST_DIR)/usr"              \
+		--interp-prefix=$(STAGING_DIR)          \
+		--cc="$(HOSTCC)"                        \
+		--host-cc="$(HOSTCC)"                   \
+		--extra-cflags="$(HOST_CFLAGS)"         \
+		--extra-ldflags="$(HOST_LDFLAGS)"       \
+	)
+endef
+
+define HOST_QEMU_BUILD_CMDS
+	$(MAKE) -C $(@D) all
+endef

package/qemu/qemu.mk line 43

Quoted 10 lines
package/qemu/qemu.mk new file +10 -0
+
+define HOST_QEMU_INSTALL_CMDS
+	$(MAKE) -C $(@D) install
+endef
+
+define HOST_QEMU_CLEAN_CMDS
+	$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(host-generic-package))

This looks very much like a $(host-autotools-package). Even if the
configure is not a proper autoconf script and barfs on all the unknown options that buildroot adds, you can still override the CONFIGURE_CMDS. But I expect that just setting HOST_QEMU_CONF_OPT will be enough.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#34 lore raw

PATCH v8 1/11 host-qemu: new package

Dear Arnout Vandecappelle,

Quoted 5 lines · Arnout Vandecappelle

This looks very much like a $(host-autotools-package). Even if the
configure is not a proper autoconf script and barfs on all the unknown options that buildroot adds, you can still override the CONFIGURE_CMDS. But I expect that just setting HOST_QEMU_CONF_OPT will be enough.

Still, the package doesn't use the autotools, so we shouldn't use the autotools-package infrastructure for it. While it may work at current time t, it may easily break at time t+1 if we make changes to the autotools-package infrastructure that are relevant for autotools packages, but that break the subtle assumptions that non-autotools packages are making in their use of the autotools-package infrastructure.

So no, let's make things explicit: Qemu doesn't not use the autotools, they have a custom configure script, custom Makefiles, so we have to use the generic-package infrastructure here.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#35 lore raw

PATCH v8 1/11 host-qemu: new package

In reply to Francois Perrad

Fran?ois,

Thanks for keeping up the good work on this.

Quoted 34 lines · Francois Perrad

only user mode for the current target architecture

---
 package/Config.in.host      |    1 +
 package/qemu/Config.in.host |   15 +++++++++++++++
 package/qemu/qemu.mk        |   43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 package/qemu/Config.in.host
 create mode 100644 package/qemu/qemu.mk
package/Config.in.host +1 -0
index 79050f2..bf95a10 100644
@@ -4,6 +4,7 @@ source "package/dfu-util/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
+source "package/qemu/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/uboot-tools/Config.in.host"
 
package/qemu/Config.in.host new file +5 -0
new file mode 100644
index 0000000..379507c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+	bool "host qemu"
+	help
+	  QEMU is a generic and open source machine emulator and virtualizer.
+

package/qemu/Config.in.host line 15

Quoted 10 lines
package/qemu/Config.in.host new file +10 -0
+	  In user mode emulation, QEMU runs single cross-compiled programs.
+	  Fast cross-compilation and cross-debugging are the main targets
+	  for user-mode emulation.
+
+	  In system mode emulation, QEMU emulates a full computer system,
+	  including peripherals, and handles the filesystem image generated
+	  by Buildroot.
+	  (Buildroot is shipped with many configs/qemu_*_defconfig files).
+
+	  http://qemu.org/

I think you should not add a Kconfig option for the host-qemu package for now. Until it supports the system emulation, it is kind of useless to have it listed in the host tools. For the perl stuff, you only need the user emulation, so let's add support for the user emulation only at the moment.

Quoted 7 lines
package/qemu/qemu.mk new file +1 -0
new file mode 100644
index 0000000..d727f49
@@ -0,0 +1,43 @@
+#############################################################

package/qemu/qemu.mk line 11

Quoted 10 lines
package/qemu/qemu.mk new file +10 -0
+#
+# qemu
+#
+#############################################################
+
+QEMU_VERSION = 1.2.0
+QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
+QEMU_SITE = http://wiki.qemu.org/download
+
+HOST_QEMU_DEPENDENCIES =

I think this is not needed.

package/qemu/qemu.mk line 17

Quoted 6 lines
package/qemu/qemu.mk new file +6 -0
+
+QEMU_ARCH=$(ARCH)
+ifeq ($(QEMU_ARCH),i686)
+    QEMU_ARCH=i386
+endif
+HOST_QEMU_TARGETS=$(QEMU_ARCH)-linux-user

This will not work for a number of architectures.

See the definition of BR2_ARCH in target/Config.in.arch. The list of architectures you have to handle is:

	arm	-> no change
	armeb	-> no change
	avr32	-> not supported (so the perl package should depends on !BR2_avr32)
	bfin	-> not supported (so the perl package should depends on !BR2_bfin)
	i386	-> no change
	i486	-> change to i386
	i586	-> change to i386
	i686	-> change to i386
	x86_64	-> no change
	microblaze -> we probably have an issue here in
			target/Config.in.arch as we don't
			make the distinction between
			little endian and big endian
	mips		-> no change
	mipsel		-> no change
	mips64el	-> not sure what to do
	mips64		-> not sure what to do
	powerpc		-> change to ppc
	sh2		-> not supported (so perl should depends on !BR2_sh2)
	sh2a		-> ditto
	sh3		-> ditto
	sh4		-> no change
	sh4eb		-> no change
	sh4aeb		-> not sure, maybe sh4eb would work, but I don't know
	sh4a		-> not sure, same reason
	sh64		-> not supported (so perl should depends on !BR2_sh64)
	sparc		-> no change

So the definition of QEMU_ARCH needs to be made a bit more complicated.
Note: I wouldn't mind if you decide to exclude certain architectures even if they might potentially work. We have to limit the development work for a first version, otherwise we'll never get those patches merged. So you could decide to support only i386, arm and maybe powerpc for now, I would be fine with this.

Quoted 15 lines
package/qemu/qemu.mk new file +15 -0
+define HOST_QEMU_CONFIGURE_CMDS
+	(cd $(@D); ./configure                          \
+		--target-list="$(HOST_QEMU_TARGETS)"    \
+		--prefix="$(HOST_DIR)/usr"              \
+		--interp-prefix=$(STAGING_DIR)          \
+		--cc="$(HOSTCC)"                        \
+		--host-cc="$(HOSTCC)"                   \
+		--extra-cflags="$(HOST_CFLAGS)"         \
+		--extra-ldflags="$(HOST_LDFLAGS)"       \
+	)
+endef
+
+define HOST_QEMU_BUILD_CMDS
+	$(MAKE) -C $(@D) all
+endef

package/qemu/qemu.mk line 43

Quoted 10 lines
package/qemu/qemu.mk new file +10 -0
+
+define HOST_QEMU_INSTALL_CMDS
+	$(MAKE) -C $(@D) install
+endef
+
+define HOST_QEMU_CLEAN_CMDS
+	$(MAKE) -C $(@D) clean
+endef
+
+$(eval $(host-generic-package))

The rest sounds ok to me. Shouldn't you pass a bunch of --disable-xxx options in order to make sure that the Qemu ./configure script doesn't pick up certain host libraries (SDL, etc.) ?

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#36 lore raw

PATCH v8 1/11 host-qemu: new package

Quoted 47 lines · Thomas Petazzoni

Fran?ois,

Thanks for keeping up the good work on this.

Quoted 42 lines · Francois Perrad

only user mode for the current target architecture

---
 package/Config.in.host      |    1 +
 package/qemu/Config.in.host |   15 +++++++++++++++
 package/qemu/qemu.mk        |   43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 package/qemu/Config.in.host
 create mode 100644 package/qemu/qemu.mk
package/Config.in.host +1 -0
index 79050f2..bf95a10 100644
@@ -4,6 +4,7 @@ source "package/dfu-util/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
+source "package/qemu/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/uboot-tools/Config.in.host"
 
package/qemu/Config.in.host new file +13 -0
new file mode 100644
index 0000000..379507c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+     bool "host qemu"
+     help
+       QEMU is a generic and open source machine emulator and virtualizer.
+
+       In user mode emulation, QEMU runs single cross-compiled programs.
+       Fast cross-compilation and cross-debugging are the main targets
+       for user-mode emulation.
+
+       In system mode emulation, QEMU emulates a full computer system,
+       including peripherals, and handles the filesystem image generated
+       by Buildroot.
+       (Buildroot is shipped with many configs/qemu_*_defconfig files).
Quoted 8 lines

package/qemu/Config.in.host line 15

Quoted 2 lines
package/qemu/Config.in.host new file +2 -0
+
+       http://qemu.org/

I think you should not add a Kconfig option for the host-qemu package for now. Until it supports the system emulation, it is kind of useless to have it listed in the host tools. For the perl stuff, you only need the user emulation, so let's add support for the user emulation only at the moment.

Forgive me if I'm misunderstanding, but I think that listing qemu in Kconfig may be desirable to me even if only user emulation is supported. I currently run a set of regression tests as a post-build step. I use qemu user emulation mode for this. Right now, I use a system-installed version of qemu-arm but would prefer to use a buildroot version.

I'm glad to see these patches come in. Thanks for adding them.

Frank

#37 lore raw

PATCH v8 1/11 host-qemu: new package

Frank,

Quoted 25 lines · Frank Hunleth
Quoted 16 lines
Quoted 16 lines
package/qemu/Config.in.host new file +13 -0
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+     bool "host qemu"
+     help
+       QEMU is a generic and open source machine emulator and virtualizer.
+
+       In user mode emulation, QEMU runs single cross-compiled programs.
+       Fast cross-compilation and cross-debugging are the main targets
+       for user-mode emulation.
+
+       In system mode emulation, QEMU emulates a full computer system,
+       including peripherals, and handles the filesystem image generated
+       by Buildroot.
+       (Buildroot is shipped with many configs/qemu_*_defconfig files).
Quoted 8 lines

package/qemu/Config.in.host line 15

Quoted 2 lines
package/qemu/Config.in.host new file +2 -0
+
+       http://qemu.org/

I think you should not add a Kconfig option for the host-qemu package for now. Until it supports the system emulation, it is kind of useless to have it listed in the host tools. For the perl stuff, you only need the user emulation, so let's add support for the user emulation only at the moment.

Quoted 6 lines

Forgive me if I'm misunderstanding, but I think that listing qemu in Kconfig may be desirable to me even if only user emulation is supported. I currently run a set of regression tests as a post-build step. I use qemu user emulation mode for this. Right now, I use a system-installed version of qemu-arm but would prefer to use a buildroot version.

Sure. But for example the Kconfig help text was mentioning system mode emulation, even though the current package didn't support it. My point
was: for the sake of building Perl, we don't need to have host-qemu in Kconfig, so let's not do this, and keep the focus of the patch set.

Fran?ois has already done 8 versions of this patch set, and I am pretty sure he wants to see it merged. And the best way to see a patch set merged is to remain absolutely focused on the problem you're trying to solve, and not to solve a gazillions of other unrelated problems at the same time.

We will definitely welcome further patches improving the host-qemu package.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#38 lore raw

PATCH v8 1/11 host-qemu: new package

Quoted 10 lines · Thomas Petazzoni

Sure. But for example the Kconfig help text was mentioning system mode emulation, even though the current package didn't support it. My point
was: for the sake of building Perl, we don't need to have host-qemu in Kconfig, so let's not do this, and keep the focus of the patch set.

Fran?ois has already done 8 versions of this patch set, and I am pretty sure he wants to see it merged. And the best way to see a patch set merged is to remain absolutely focused on the problem you're trying to solve, and not to solve a gazillions of other unrelated problems at the same time.

I don't think having the Kconfig there will stop qemu being included.
There's just one more sentence needed: "Buildroot currently doesn't support building qemu for system mode emulation".

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#39 lore raw

PATCH v8 1/11 host-qemu: new package

In reply to Thomas Petazzoni

2012/10/4 Thomas Petazzoni <[email protected]>:

Quoted 116 lines

Fran?ois,

Thanks for keeping up the good work on this.

Quoted 34 lines · Francois Perrad

only user mode for the current target architecture

---
 package/Config.in.host      |    1 +
 package/qemu/Config.in.host |   15 +++++++++++++++
 package/qemu/qemu.mk        |   43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 package/qemu/Config.in.host
 create mode 100644 package/qemu/qemu.mk
package/Config.in.host +1 -0
index 79050f2..bf95a10 100644
@@ -4,6 +4,7 @@ source "package/dfu-util/Config.in.host"
 source "package/lpc3250loader/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
+source "package/qemu/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/uboot-tools/Config.in.host"
 
package/qemu/Config.in.host new file +5 -0
new file mode 100644
index 0000000..379507c
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_HOST_QEMU
+     bool "host qemu"
+     help
+       QEMU is a generic and open source machine emulator and virtualizer.
+

package/qemu/Config.in.host line 15

Quoted 10 lines
package/qemu/Config.in.host new file +10 -0
+       In user mode emulation, QEMU runs single cross-compiled programs.
+       Fast cross-compilation and cross-debugging are the main targets
+       for user-mode emulation.
+
+       In system mode emulation, QEMU emulates a full computer system,
+       including peripherals, and handles the filesystem image generated
+       by Buildroot.
+       (Buildroot is shipped with many configs/qemu_*_defconfig files).
+
+       http://qemu.org/

I think you should not add a Kconfig option for the host-qemu package for now. Until it supports the system emulation, it is kind of useless to have it listed in the host tools. For the perl stuff, you only need the user emulation, so let's add support for the user emulation only at the moment.

Quoted 7 lines
package/qemu/qemu.mk new file +1 -0
new file mode 100644
index 0000000..d727f49
@@ -0,0 +1,43 @@
+#############################################################

package/qemu/qemu.mk line 11

Quoted 10 lines
package/qemu/qemu.mk new file +10 -0
+#
+# qemu
+#
+#############################################################
+
+QEMU_VERSION = 1.2.0
+QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.bz2
+QEMU_SITE = http://wiki.qemu.org/download
+
+HOST_QEMU_DEPENDENCIES =

I think this is not needed.

package/qemu/qemu.mk line 17

Quoted 6 lines
package/qemu/qemu.mk new file +6 -0
+
+QEMU_ARCH=$(ARCH)
+ifeq ($(QEMU_ARCH),i686)
+    QEMU_ARCH=i386
+endif
+HOST_QEMU_TARGETS=$(QEMU_ARCH)-linux-user

This will not work for a number of architectures.

See the definition of BR2_ARCH in target/Config.in.arch. The list of architectures you have to handle is:

        arm     -> no change
        armeb   -> no change
        avr32   -> not supported (so the perl package should depends on !BR2_avr32)
        bfin    -> not supported (so the perl package should depends on !BR2_bfin)
        i386    -> no change
        i486    -> change to i386
        i586    -> change to i386
        i686    -> change to i386
        x86_64  -> no change
        microblaze -> we probably have an issue here in
                        target/Config.in.arch as we don't
                        make the distinction between
                        little endian and big endian
        mips            -> no change
        mipsel          -> no change
        mips64el        -> not sure what to do
        mips64          -> not sure what to do
        powerpc         -> change to ppc
        sh2             -> not supported (so perl should depends on !BR2_sh2)
        sh2a            -> ditto
        sh3             -> ditto
        sh4             -> no change
        sh4eb           -> no change
        sh4aeb          -> not sure, maybe sh4eb would work, but I don't know
        sh4a            -> not sure, same reason
        sh64            -> not supported (so perl should depends on !BR2_sh64)
        sparc           -> no change
Quoted 6 lines

So the definition of QEMU_ARCH needs to be made a bit more complicated.
Note: I wouldn't mind if you decide to exclude certain architectures even if they might potentially work. We have to limit the development work for a first version, otherwise we'll never get those patches merged. So you could decide to support only i386, arm and maybe powerpc for now, I would be fine with this.

Ok.

Quoted 22 lines
Quoted 22 lines
package/qemu/qemu.mk new file +21 -0
+define HOST_QEMU_CONFIGURE_CMDS
+     (cd $(@D); ./configure                          \
+             --target-list="$(HOST_QEMU_TARGETS)"    \
+             --prefix="$(HOST_DIR)/usr"              \
+             --interp-prefix=$(STAGING_DIR)          \
+             --cc="$(HOSTCC)"                        \
+             --host-cc="$(HOSTCC)"                   \
+             --extra-cflags="$(HOST_CFLAGS)"         \
+             --extra-ldflags="$(HOST_LDFLAGS)"       \
+     )
+endef
+
+define HOST_QEMU_BUILD_CMDS
+     $(MAKE) -C $(@D) all
+endef
+
+define HOST_QEMU_INSTALL_CMDS
+     $(MAKE) -C $(@D) install
+endef
+
+define HOST_QEMU_CLEAN_CMDS
Quoted 8 lines

package/qemu/qemu.mk line 43

Quoted 4 lines
package/qemu/qemu.mk new file +4 -0
+     $(MAKE) -C $(@D) clean
+endef
+
+$(eval $(host-generic-package))

The rest sounds ok to me. Shouldn't you pass a bunch of --disable-xxx options in order to make sure that the Qemu ./configure script doesn't pick up certain host libraries (SDL, etc.) ?

Useless. The configure script detects many optional libraries for qemu system mode, but anyway, qemu user mode uses none of them.

Quoted 13 lines

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot