Skip to content

Commit

Permalink
Use clang for arm/x86 with static binary and zig cc for mips #1107
Browse files Browse the repository at this point in the history
  • Loading branch information
Catalin Toda committed Jun 20, 2023
1 parent a9bbd6d commit 03a7a2f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 33 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Binaries
on:
push:
branches: [ master ]
branches: [ master, next ]
pull_request:
branches: [ master ]
branches: [ master, next ]

jobs:
build:
Expand All @@ -16,14 +16,14 @@ jobs:
fetch-depth: '0'
- name: Build x64
run: |
./configure --enable-static
./configure --enable-static CC="clang"
make DDCI=1
zip -9 -r /minisatip_x64.zip minisatip html
- name: Build ARM
run: |
make clean
./configure --enable-static --host=arm-linux-gnueabihf
./configure --enable-static --host=arm-linux-gnueabihf CC="clang -target arm-linux-gnueabihf"
make
zip -9 -r /minisatip_arm.zip minisatip html
Expand All @@ -37,8 +37,8 @@ jobs:
- name: Build MIPS
run: |
make clean
./configure --enable-static --host=mipsel-tuxbox-linux-gnu
make
./configure --enable-static --host=mipsel-linux-gnu CC="zig cc -target mipsel-linux-gnueabihf.2.34"
make EXTRA_CFLAGS="-I/sysroot/mipsel/include -L/sysroot/mipsel/lib"
zip -9 -r /minisatip_mips.zip minisatip html
Expand Down
17 changes: 2 additions & 15 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ enable_linuxdvb
enable_dvbca
enable_dvbcsa
enable_netcv
with_mcli
with_xml2
enable_satipc
enable_static
Expand Down Expand Up @@ -1371,8 +1370,6 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-mcli specify vdr-mcli-plugin directory
default=../../vdr-mcli-plugin
--with-xml2 specify libxml2 directory
default=/usr/include/libxml2
Expand Down Expand Up @@ -4463,27 +4460,17 @@ then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: == Checking NETCVCLIENT == " >&5
printf "%s\n" "$as_me: == Checking NETCVCLIENT == " >&6;}

mcli_dir="../../vdr-mcli-plugin"
xml2_dir="/usr/include/libxml2"


# Check whether --with-mcli was given.
if test ${with_mcli+y}
then :
withval=$with_mcli; mcli_dir=$with_mcli
fi



# Check whether --with-xml2 was given.
if test ${with_xml2+y}
then :
withval=$with_xml2; xml2_dir=$with_xml2
fi


CFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"
CPPFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"
CFLAGS="-I$xml2_dir"

cd src
for ac_header in netceiver.h
Expand Down Expand Up @@ -4620,7 +4607,7 @@ then :
fi

ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fsanitize=bounds -fsanitize-undefined-trap-on-error"
CFLAGS="$CFLAGS -fsanitize=bounds -fsanitize-trap=all"

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Expand Down
9 changes: 1 addition & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,14 @@ AC_ARG_ENABLE([netcv],
AS_IF([test "x$enable_netcv" != "xno"], [
AC_MSG_NOTICE([ == Checking NETCVCLIENT == ])
mcli_dir="../../vdr-mcli-plugin"
xml2_dir="/usr/include/libxml2"
AC_ARG_WITH([mcli],
[AS_HELP_STRING([--with-mcli],
[specify vdr-mcli-plugin directory default=../../vdr-mcli-plugin])],
[mcli_dir=$with_mcli])
AC_ARG_WITH([xml2],
[AS_HELP_STRING([--with-xml2],
[specify libxml2 directory default=/usr/include/libxml2])],
[xml2_dir=$with_xml2])
CFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"
CPPFLAGS="-I. -I$mcli_dir/mcast/client -I$mcli_dir/mcast/common -L$mcli_dir/mcast/client -I$xml2_dir"
CFLAGS="-I$xml2_dir"
cd src
AC_CHECK_HEADERS([netceiver.h],[NETCVCLIENT=1],[NETCVCLIENT=0])
Expand Down
7 changes: 4 additions & 3 deletions src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ endif

ifeq ($(NETCVCLIENT),1)
SOURCES+=netceiver.c
LDFLAGS+=-lmcli -lxml2
LDFLAGS+=-lnetceiver -lxml2
else
CFLAGS+=-DDISABLE_NETCVCLIENT
endif
Expand Down Expand Up @@ -138,9 +138,10 @@ CFLAGS-$(DEBUG) += -fsanitize=address -fno-omit-frame-pointer -fsanitize=leak -f


ifeq ($(STATIC),1)
LDFLAGS+=$(addsuffix .a,$(addprefix -l:lib,$(LIBS)))
CFLAGS+=-static
LDFLAGS+=$(addsuffix .a,$(addprefix -l:lib,$(LIBS)))
else
LDFLAGS+=$(addprefix -l,$(LIBS))
LDFLAGS+=$(addprefix -l,$(LIBS))
endif

SOURCES+=$(SOURCES-1)
Expand Down
1 change: 1 addition & 0 deletions src/netceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "utils/alloc.h"

#define DEFAULT_LOG LOG_NETCEIVER

Expand Down
2 changes: 1 addition & 1 deletion src/netceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define API_SOCK
#ifndef DISABLE_LINUXDVB
#undef AOT_CA_PMT
#include "headers.h"
#include "libnetceiver/netcv/headers.h"
#else
#include "netceiver_mcli_defs.h"
#endif
Expand Down

0 comments on commit 03a7a2f

Please sign in to comment.