Custom application cannot be compiled

Ronny Nilsson rln-nard at arbetsmyra.dyndns.org
Mon Nov 16 12:04:02 CET 2015


I'm glad you got it working!

/Ronny


------------------------------------------
> Hi Ronny,
>
> Finally got Python 3 running...
>
> Here my commit based on git tag v0.03:
>
> commit c3262a74125e5c17f9eb654212245cc4bf5bdace
> Author: Manuel Faux <manuel.faux at frequentis.com>
> Date:   Thu Nov 12 18:38:11 2015 +0100
>
>     Added Python 3.5.0 to apps
>
> diff --git a/apps/Python/Makefile b/apps/Python/Makefile
> new file mode 100644
> index 0000000..150a0a7
> --- /dev/null
> +++ b/apps/Python/Makefile
> @@ -0,0 +1,64 @@
> +
> +# Nard Linux SDK
> +# http://www.arbetsmyra.dyndns.org/nard
> +# Copyright (C) 2014 Ronny Nilsson
> +#
> +# Python3 app by Manuel Faux
> +
> +
> +include ../../Rules.mk															# Common used stuff
> +
> +
> +#-----------------------------													# Standard targets
> +.PHONY: all $(PKG_VER)
> +all: $(PATH_FS)/.nard-$(PKG_NAME)
> +$(PKG_VER): $(PATH_FS)/.nard-$(PKG_NAME)
> +
> +
> +.PHONY: install
> +install: $(PATH_FS)/.nard-$(PKG_NAME)
> +$(PATH_FS)/.nard-$(PKG_NAME): $(PKG_VER)/.nard-build
> +	$(MAKE) -C "$(PKG_VER)" DESTDIR="$(PATH_FS)" commoninstall bininstall
> +	touch "$@"
> +
> +
> +$(PKG_VER)/.nard-prebuild: $(std-deps)
> +	$(MAKE) -C "$(PKG_VER)" distclean || true
> +	cd $(dir $@) && ./configure
> +	$(MAKE) -C "$(PKG_VER)" python Parser/pgen Programs/_freeze_importlib
> +	cp "$(dir $@)/python" "$(dir $@)/python_host"
> +	cp "$(dir $@)/Parser/pgen" "$(dir $@)/Parser/pgen_host"
> +	cp "$(dir $@)/Programs/_freeze_importlib" "$(dir
> $@)/Programs/_freeze_importlib_host" +	touch "$@"
> +
> +
> +$(PKG_VER)/.nard-build: $(PKG_VER)/.nard-prebuild $(std-deps)
> +	#tar xzf "$(PKG_VER).tar.gz" -C "$(PKG_VER)" --strip-components=1 --
> $(PKG_VER)/configure $(PKG_VER)/Makefile.pre.in +	cd $(dir $@) && patch -N
> -p1 < ../$(PKG_VER).patch || true
> +	$(MAKE) -C "$(PKG_VER)" distclean
> +	cd $(dir $@) && ./configure \
> +		CFLAGS="$(CROSS_CFLAGS)" \
> +		CPPFLAGS="$(CROSS_CFLAGS)" \
> +		--prefix=/ \
> +		--host=$(CROSS_TUPLE) \
> +		--build=x86_64-linux-gnu \
> +		--disable-ipv6 \
> +		ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no
> ac_cv_have_long_long_format=yes +	$(MAKE) -C "$(PKG_VER)" -j $(CPUS)
> +	touch "$@"
> +
> +
> +$(PKG_VER)/.nard-extract: $(PKG_VER).tar.*
> +	$(std-extract)
> +
> +
> +
> +#----------------------------													# Cleaning
> +.PHONY: clean
> +clean:
> +	$(std-clean)
> +
> +.PHONY: distclean
> +distclean:
> +	$(std-distclean)
> +
> diff --git a/apps/Python/Python-3.5.0.patch
> b/apps/Python/Python-3.5.0.patch new file mode 100644
> index 0000000..aa367f4
> --- /dev/null
> +++ b/apps/Python/Python-3.5.0.patch
> @@ -0,0 +1,81 @@
> +--- Python-3.5.0/Makefile.pre.in	2015-09-13 13:41:23.000000000 +0200
> ++++ Python-3.5.0_test/Makefile.pre.in	2015-11-12 16:32:42.871870307 +0100
> +@@ -272,6 +272,7 @@
> +
> ##########################################################################
> + # Parser
> + PGEN=		Parser/pgen$(EXE)
> ++PGEN_FOR_BUILD=	Parser/pgen_host
> +
> + PSRCS=		\
> + 		Parser/acceler.c \
> +@@ -582,6 +583,7 @@
> + 	esac; \
> + 	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
> + 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
> ++		PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
> + 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
> +
> + # Build static library
> +@@ -697,11 +699,11 @@
> + 	$(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o
> $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) +
> + Python/importlib_external.h:
> $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
> +-	./Programs/_freeze_importlib \
> ++	./Programs/_freeze_importlib_host \
> + 		$(srcdir)/Lib/importlib/_bootstrap_external.py
> Python/importlib_external.h +
> + Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py
> Programs/_freeze_importlib +-	./Programs/_freeze_importlib \
> ++	./Programs/_freeze_importlib_host \
> + 		$(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
> +
> +
> +@@ -764,7 +766,7 @@
> +
> + $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGEN)
> + 		@$(MKDIR_P) Include
> +-		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
> ++		$(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
> + $(GRAMMAR_C): $(GRAMMAR_H)
> + 		touch $(GRAMMAR_C)
> +
> +@@ -1401,10 +1403,11 @@
> + # This goes into $(exec_prefix)
> + sharedinstall: sharedmods
> + 	$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
> ++		--skip-build \
> + 	   	--prefix=$(prefix) \
> +-		--install-scripts=$(BINDIR) \
> +-		--install-platlib=$(DESTSHARED) \
> +-		--root=$(DESTDIR)/
> ++		--install-scripts=$(DESTDIR)$(BINDIR) \
> ++		--install-platlib=$(DESTDIR)$(DESTSHARED) \
> ++		--root=/
> + 	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py
> + 	-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
> +
> +--- Python-3.5.0/configure	2015-09-13 13:41:26.000000000 +0200
> ++++ Python-3.5.0_test/configure	2015-11-12 12:59:51.181964531 +0100
> +@@ -2972,21 +2972,7 @@
> + if test "$cross_compiling" = yes; then
> +     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python
> interpreter for cross build" >&5 + $as_echo_n "checking for python
> interpreter for cross build... " >&6; } +-    if test -z
> "$PYTHON_FOR_BUILD"; then
> +-        for interp in python$PACKAGE_VERSION python3 python; do
> +-	    which $interp >/dev/null 2>&1 || continue
> +-	    if $interp -c 'import sys;sys.exit(not sys.version_info[:2] >=
> (3,3))'; then +-	        break
> +-	    fi
> +-            interp=
> +-	done
> +-        if test x$interp = x; then
> +-	    as_fn_error $? "python$PACKAGE_VERSION interpreter not found"
> "$LINENO" 5 +-	fi
> +-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
> +-$as_echo "$interp" >&6; }
> +-	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir)
> _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f
> pybuilddir.txt && echo $(abs_builddir)/`cat
> pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp +-    fi
> ++    PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir)
> _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f
> pybuilddir.txt && echo $(abs_builddir)/`cat
> pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR)
> $(srcdir)/$(BUILDPYTHON)_host' + elif test "$cross_compiling" = maybe; then
> +     as_fn_error $? "Cross compiling required --host=HOST-TUPLE and
> --build=ARCH" "$LINENO" 5 + else
> diff --git a/apps/Python/Python-3.5.0.tar.gz
> b/apps/Python/Python-3.5.0.tar.gz new file mode 100644
> index 0000000..5872c26
> Binary files /dev/null and b/apps/Python/Python-3.5.0.tar.gz differ
>
> BR,
> Manuel
>
> -----Original Message-----
> From: nard-bounces at arbetsmyra.dyndns.org
> [mailto:nard-bounces at arbetsmyra.dyndns.org] On Behalf Of Ronny Nilsson
> Sent: Mittwoch, 11. November 2015 20:10
> To: Nard SDK mailing list
> Subject: Re: Custom application cannot be compiled
>
> Hi Manuel
> You are correct, the tarfile should have the same name as the directory. In
> your case it would be /apps/python3/python3-3.5.0.tar.gz where
> 	PKG_VER = python3-3.5.0
> 	PKG_NAME = python3
> By using a common scheme all Makefiles can share large parts (which are in
> the top Rules.mk as a lib).
>
> I hope you get it to work. However, should you not I can reveal that there
> is help on the way. I've created a Raspbian compatibility layer which
> enables to pull in small pieces from Raspbian Wheezy and put it "on top" of
> Nard. It will act as a complement if one need something specific which is
> not yet available in Nard. I'm doing testing of it now and hope to release
> it in a few weeks. Python 2.7 is tested and works, haven't tried Python 3
> yet though.
>
> BR
> /Ronny
>
>
>
> ---------------------------------------------------
>
> > Hi,
> >
> > After struggling very much time, I found the error: the tar.* file
> > containing the sources is required to contain the *complete* name of the
> > application directory. I created a directory called "ptyhon3" and the
> > tar.* file was called Python-3.5.0.tar.gz.
> >
> > What's actually the content of $(PKG_VER)?
> >
> > BR,
> > Manuel
> >
> > -----Original Message-----
> > From: nard-bounces at arbetsmyra.dyndns.org
> > [mailto:nard-bounces at arbetsmyra.dyndns.org] On Behalf Of FAUX Manuel
> > Sent: Mittwoch, 11. November 2015 16:57
> > To: nard at arbetsmyra.dyndns.org
> > Subject: Custom application cannot be compiled
> >
> > Hi,
> >
> > I'm trying to add a customized application to nard, but my Makefile
> > always fails with "No rule to make taget Python-3.5.0", even I've defined
> > the target as mentioned in the example on the nard webpage:
> >
> > .PHONY: all $(PKG_VER)
> > all: $(PATH_FS)/usr/sbin/$(PKG_NAME)
> > $(PKG_VER): $(PATH_FS)/usr/sbin/$(PKG_NAME)
> >
> >
> > .PHONY: install
> > install: $(PATH_FS)/usr/sbin/$(PKG_NAME)
> > $(PATH_FS)/usr/sbin/$(PKG_NAME): $(PKG_VER)/.nard-build
> >         install -m 0755 -d "$(dir $@)"
> >         $(CP) -uavf "$(PKG_VER)/$(PKG_NAME)" "$@"
> >
> >
> > $(PKG_VER)/.nard-build: $(std-deps)
> >         cd $(dir $@) && ./configure CFLAGS="$(CROSS_CFLAGS)" \
> >                 --prefix=/usr --host=$(CROSS_TUPLE)
> >         $(MAKE) -C "$(PKG_VER)"
> >         touch "$@"
> >
> > Without diving too deep into the Rules.mk provided by nard, I guess
> > $(PKG_VER) is being set to the second part of PKGS_APPS after the slash;
> > so I've set
> > PKGS_APPS += python3/Python-3.5.0 and so there should be a rule for
> > $(PKG_VER), which is some lines below...
> >
> > What am I missing?
> >
> >
> > Thanks,
> > Manuel




More information about the Nard mailing list