usertools: fix build with gcc

Message ID 1529573741-9606-2-git-send-email-choonho.son@gmail.com (mailing list archive)
State Rejected, archived
Delegated to: Thomas Monjalon
Headers
Series usertools: fix build with gcc |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Choonho Son June 21, 2018, 9:35 a.m. UTC
  dpdk-setup.sh fails to build with lack of environment variable

Build complete [x86_64-native-linuxapp-gcc]
Installation cannot run with T defined and DESTDIR undefined

Signed-off-by: Choonho Son <choonho.son@gmail.com>
---
 usertools/dpdk-setup.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson June 21, 2018, 9:55 a.m. UTC | #1
On Thu, Jun 21, 2018 at 09:35:41AM +0000, Choonho Son wrote:
> dpdk-setup.sh fails to build with lack of environment variable
> 
> Build complete [x86_64-native-linuxapp-gcc]
> Installation cannot run with T defined and DESTDIR undefined
> 
> Signed-off-by: Choonho Son <choonho.son@gmail.com>
> ---
>  usertools/dpdk-setup.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
> index 5eebbce..5248e7a 100755
> --- a/usertools/dpdk-setup.sh
> +++ b/usertools/dpdk-setup.sh
> @@ -65,6 +65,7 @@ setup_target()
>  {
>  	option=$1
>  	export RTE_TARGET=${TARGETS[option]}
> +	export DESTDIR=${DESTDIR:-install}
>  
>  	compiler=${RTE_TARGET##*-}
>  	if [ "$compiler" == "icc" ] ; then
> @@ -76,7 +77,7 @@ setup_target()
>  		fi
>  	fi
>  	if [ "$QUIT" == "0" ] ; then
> -		make install T=${RTE_TARGET}
> +		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}
>  	fi
>  	echo "------------------------------------------------------------------------------"
>  	echo " RTE_TARGET exported as $RTE_TARGET"

The message about no DESTDIR is not really an error, the build has
completed successfully. I don't think copying the build over to a new
directory is something we should always do as part of this script.

/Bruce
  
Thomas Monjalon June 27, 2018, 1:31 p.m. UTC | #2
21/06/2018 11:55, Bruce Richardson:
> On Thu, Jun 21, 2018 at 09:35:41AM +0000, Choonho Son wrote:
> > dpdk-setup.sh fails to build with lack of environment variable
> > 
> > Build complete [x86_64-native-linuxapp-gcc]
> > Installation cannot run with T defined and DESTDIR undefined
> > 
> > Signed-off-by: Choonho Son <choonho.son@gmail.com>
> > ---
[...]
> > -		make install T=${RTE_TARGET}
> > +		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}
> 
> The message about no DESTDIR is not really an error, the build has
> completed successfully. I don't think copying the build over to a new
> directory is something we should always do as part of this script.

Absolutely!

The syntax "make install T=" is old.
It should be replaced by "make config T=" + "make".
You can look at devtools/test-build.sh to see how compilation can be done.
It is also documented in various places like:
	doc/guides/linux_gsg/build_dpdk.rst
	doc/guides/prog_guide/dev_kit_root_make_help.rst

More options:
	- use meson build system in dpdk-setup.sh - maybe too early
	- remove dpdk-setup.sh - maybe used by real users
  

Patch

diff --git a/usertools/dpdk-setup.sh b/usertools/dpdk-setup.sh
index 5eebbce..5248e7a 100755
--- a/usertools/dpdk-setup.sh
+++ b/usertools/dpdk-setup.sh
@@ -65,6 +65,7 @@  setup_target()
 {
 	option=$1
 	export RTE_TARGET=${TARGETS[option]}
+	export DESTDIR=${DESTDIR:-install}
 
 	compiler=${RTE_TARGET##*-}
 	if [ "$compiler" == "icc" ] ; then
@@ -76,7 +77,7 @@  setup_target()
 		fi
 	fi
 	if [ "$QUIT" == "0" ] ; then
-		make install T=${RTE_TARGET}
+		make install T=${RTE_TARGET} DESTDIR=${DESTDIR}
 	fi
 	echo "------------------------------------------------------------------------------"
 	echo " RTE_TARGET exported as $RTE_TARGET"