Dmitry Eremin-Solenikov(lumag) replied on github web page:

.travis.yml
line 53
@@ -258,11 +271,17 @@ script:
         - pushd $HOME
         - echo "Dynamic link.."
         - ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o 
odp_hello_inst_dynamic 
`PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} 
pkg-config --cflags --libs libodp-linux`
-        - echo "Static link.."
-        - ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o 
odp_hello_inst_static 
`PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} 
pkg-config --cflags --libs libodp-linux --static` -static
         - if [ -z "$CROSS_ARCH" ] ; then
-          LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" 
./odp_hello_inst_dynamic ;
-          ./odp_hello_inst_static ;
+            LD_LIBRARY_PATH="${HOME}/odp-install/lib:$LD_LIBRARY_PATH" 
./odp_hello_inst_dynamic ;
+          fi
+        - echo "Static link.."
+        - |
+          # it is not possible to do static linking if we only have shared 
DPDK library. Compiler complains about missing -ldpdk
+          if [ -z "$TARGET" -o -z "$DPDK_SHARED" ] ; then
+            ${CC} ${CFLAGS} ${OLDPWD}/example/hello/odp_hello.c -o 
odp_hello_inst_static 
`PKG_CONFIG_PATH=${HOME}/odp-install/lib/pkgconfig:${PKG_CONFIG_PATH} 
pkg-config --cflags --libs libodp-linux --static` -static || exit 1
+            if [ -z "$CROSS_ARCH" ] ; then
+            ./odp_hello_inst_static || exit 1;


Comment:
Generally first `exit 1` is necessary, otherwise `if` will return the status of 
last command, not the first failed one.

> Dmitry Eremin-Solenikov(lumag) wrote:
> Hmm. Maybe it's not that necessary.


>> Dmitry Eremin-Solenikov(lumag) wrote:
>> exit 1 is needed, to actually return the error code out of if.


>>> Dmitry Eremin-Solenikov(lumag) wrote:
>>> Hmm. I can try doing that.


>>>> muvarov wrote
>>>> same here.


>>>>> muvarov wrote
>>>>> why exit 1 is needed? Travis should stop on error return code on the 
>>>>> command. exit 1 should not be needed.


>>>>>> muvarov wrote
>>>>>> In general that is not right solution. I think we need to cache 2 dpdk 
>>>>>> builds. Shared and non shared and force dpdk recompilation only on 
>>>>>> version change.


>>>>>>> muvarov wrote
>>>>>>> maybe simple  
>>>>>>> `if [  -a ! -f "dpdk/${TARGET}/lib/libdpdk.a" ] ; then`
>>>>>>> instead of 2 checks?


https://github.com/Linaro/odp/pull/416#discussion_r163354295
updated_at 2018-01-23 19:39:23

Reply via email to