ports/devel/libfastcommon/files/patch-make.sh
John Marino eade84d0d7 devel/libfastcommon: fix misbuild, add DF, bump deps minus nginx-full
The fastcommon library is being built as 32-bit on amd64 due to the
misuse of uname (uname -p returns "amd64", not uname alone).

Additionally, the hardcoded install commands (added via patch) have been
updated to the BSD_INSTALL* macros to satisfy QA tests.

While here, fix building on DragonFly (sacrificing unused Darwin support
in the process).

Finally, bump all ports dependend on fault libfastcommon.so except
www/nginx-full which has no separate PORTREVISION setting.  I can't bump
it without bumping www/nginx too (bug??).

Approvd by:	just-fix-it
2017-01-28 14:22:53 +00:00

86 lines
1.8 KiB
Bash

--- make.sh.orig 2016-09-08 07:44:31 UTC
+++ make.sh
@@ -1,55 +1,15 @@
-tmp_src_filename=fast_check_bits.c
-cat <<EOF > $tmp_src_filename
-#include <stdio.h>
-#include <unistd.h>
-#include <fcntl.h>
-int main()
-{
- printf("%d\n", (int)sizeof(void*));
- printf("%d\n", (int)sizeof(off_t));
- return 0;
-}
-EOF
-
-gcc -D_FILE_OFFSET_BITS=64 -o a.out $tmp_src_filename
-output=`./a.out`
-
-if [ -f /bin/expr ]; then
- EXPR=/bin/expr
-else
- EXPR=/usr/bin/expr
-fi
-
-count=0
-int_bytes=4
-off_bytes=8
-LIB_VERSION=lib64
-
-for col in $output; do
- if [ $count -eq 0 ]; then
- int_bytes=$col
- else
- off_bytes=$col
- fi
-
- count=`$EXPR $count + 1`
-done
+unamep=$(/usr/bin/uname -p)
-/bin/rm -f a.out $tmp_src_filename
-if [ "$int_bytes" -eq 8 ]; then
+if [ "$unamep" = "amd64" -o "$unamep" = "x86_64" ]; then
OS_BITS=64
- LIB_VERSION=lib64
-else
- OS_BITS=32
- LIB_VERSION=lib
-fi
-
-if [ "$off_bytes" -eq 8 ]; then
OFF_BITS=64
else
+ OS_BITS=32
OFF_BITS=32
fi
+LIB_VERSION=lib
+
DEBUG_FLAG=0
CFLAGS='-Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE'
@@ -67,12 +27,9 @@ HAVE_USER_H=0
if [ "$uname" = "Linux" ]; then
OS_NAME=OS_LINUX
IOEVENT_USE=IOEVENT_USE_EPOLL
-elif [ "$uname" = "FreeBSD" ] || [ "$uname" = "Darwin" ]; then
+elif [ "$uname" = "FreeBSD" -o "$uname" = "DragonFly" ]; then
OS_NAME=OS_FREEBSD
IOEVENT_USE=IOEVENT_USE_KQUEUE
- if [ "$uname" = "Darwin" ]; then
- CFLAGS="$CFLAGS -DDARWIN"
- fi
if [ -f /usr/include/sys/vmmeter.h ]; then
HAVE_VMMETER_H=1
@@ -138,7 +95,7 @@ sed_replace()
{
sed_cmd=$1
filename=$2
- if [ "$uname" = "FreeBSD" ] || [ "$uname" = "Darwin" ]; then
+ if [ "$uname" = "FreeBSD" -o "$uname" = "DragonFly" ]; then
sed -i "" "$sed_cmd" $filename
else
sed -i "$sed_cmd" $filename