[sr-dev] [kamailio/kamailio] failed master build on centos 6 (Issue #2921)

sergey-safarov notifications at github.com
Wed Dec 8 16:17:22 CET 2021


Hi Daniel
Current master build log
```
LD (gcc) [kamailio]             kamailio                                                                                   
core/ut.o: In function `ksr_clock_gettime':                                                                                
/root/rpmbuild/BUILD/kamailio-5.6.0-dev2/src/core/ut.c:175: undefined reference to `clock_gettime'                         
collect2: ld returned 1 exit status                                                                                        
make[1]: *** [kamailio] Error 1                                                                                            
make[1]: Leaving directory `/root/rpmbuild/BUILD/kamailio-5.6.0-dev2/src'                                                  
make: *** [default] Error 2                                                                                                
error: Bad exit status from /var/tmp/rpm-tmp.1wyutm (%build)                                                               
    Bad exit status from /var/tmp/rpm-tmp.1wyutm (%build)
```

When executed `make cfg` i see error message
```
/bin/sh: line 0: [: -le: unary operator expected
```

Full log message
```
sh-4.1# make cfg
make -C src/ cfg 
target architecture <x86_64>, host architecture <x86_64>
/bin/sh: line 0: [: -le: unary operator expected
make[1]: Entering directory `/root/rpmbuild/BUILD/kamailio-5.6.0-dev2/src'
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory `/root/rpmbuild/BUILD/kamailio-5.6.0-dev2/src'
```

I made troubleshooting and found does not work the` aws` command inside Makefile.
I have updated Makefile to get working variable initialization.
```diff
diff --git a/src/Makefile.defs b/src/Makefile.defs
index 8fab3fd..57bccfe 100644
--- a/src/Makefile.defs
+++ b/src/Makefile.defs
@@ -1890,7 +1890,7 @@ ifeq ($(OS), linux)
        endif
        ifeq ($(CC_NAME), gcc)
                # link librt for glibc <= 2.17
-               GLIBCVER:=$(shell ldd --version | head -1 | awk '{ sub(/\./, "", $NF); print $NF }' )
+               GLIBCVER=$(shell ldd --version | head -1 | sed -e 's/^.* //' -e 's/\.//' )
                ifeq ($(shell [ $(GLIBCVER) -le 217 ] && echo librt), librt)
                        LIBS+=-lrt
                endif
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2921#issuecomment-988904855
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211208/70805197/attachment.htm>


More information about the sr-dev mailing list