Skip to content

Commit

Permalink
o Set -Wno-compound-token-split-by-macro needed to get things
Browse files Browse the repository at this point in the history
  building up with clang > 11.

o Unify common code in the perl modules to fix db_perlvdb
  as well with clang > 11.
  • Loading branch information
sobomax committed Oct 24, 2022
1 parent 04b2131 commit ee2d8bc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 49 deletions.
33 changes: 33 additions & 0 deletions lib/modules.mk/perl.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# define it (or export this) to the dir where xsubpp is on your system (if
# not on the default path.
#PERLBINDIR=

LIBS=

ifeq ($(CC_NAME), gcc)
DEFS+=-Wno-unused -Wno-redundant-decls
endif
ifeq ($(CC_NAME), clang)
DEFS+=-Wno-unused -Wno-redundant-decls $(shell test `${CC} -dumpversion | sed 's|[.].*||'` -gt 11 && echo -Wno-compound-token-split-by-macro)
endif

ifeq ($(PERLLDOPTS),)
LIBS+=$(shell perl -MExtUtils::Embed -e ldopts)
else
LIBS+=$(PERLLDOPTS)
endif

ifeq ($(PERLCCOPTS),)
DEFS+=$(shell perl -MExtUtils::Embed -e ccopts)
else
DEFS+=$(PERLCCOPTS)
endif

# if perl requires _FORTIFY_SOURCE, we need to enable optimizations
ifneq (,$(findstring -D_FORTIFY_SOURCE,$(DEFS)))
DEFS+=-O2
endif

auto_gen=

include ../../Makefile.modules
17 changes: 1 addition & 16 deletions modules/db_perlvdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,6 @@
# WARNING: do not run this directly, it should be run by the master Makefile

include ../../Makefile.defs
auto_gen=
NAME=db_perlvdb.so

ifeq ($(CC_NAME), gcc)
DEFS+=-Wno-unused -Wno-redundant-decls
endif


LIBS=$(shell perl -MExtUtils::Embed -e ldopts)
DEFS+=$(shell perl -MExtUtils::Embed -e ccopts)

# if perl requires _FORTIFY_SOURCE, we need to enable optimizations
ifneq (,$(findstring -D_FORTIFY_SOURCE,$(DEFS)))
DEFS+=-O2
endif


include ../../Makefile.modules
include ../../lib/modules.mk/perl.mk
34 changes: 1 addition & 33 deletions modules/perl/Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,12 @@
# $Id$
#
# perl module makefile
#
#
# WARNING: do not run this directly, it should be run by the master Makefile

include ../../Makefile.defs
auto_gen=
NAME=perl.so
LIBS=

# define it (or export this) to the dir where xsubpp is on your system (if
# not on the default path.
#PERLBINDIR=

ifeq ($(CC_NAME), gcc)
DEFS+=-Wno-unused -Wno-redundant-decls
endif
ifeq ($(CC_NAME), clang)
DEFS+=-Wno-unused -Wno-redundant-decls
endif

ifeq ($(PERLLDOPTS),)
LIBS+=$(shell perl -MExtUtils::Embed -e ldopts)
else
LIBS+=$(PERLLDOPTS)
endif

ifeq ($(PERLCCOPTS),)
DEFS+=$(shell perl -MExtUtils::Embed -e ccopts)
else
DEFS+=$(PERLCCOPTS)
endif

# if perl requires _FORTIFY_SOURCE, we need to enable optimizations
ifneq (,$(findstring -D_FORTIFY_SOURCE,$(DEFS)))
DEFS+=-O2
endif

include ../../Makefile.modules
include ../../lib/modules.mk/perl.mk

PODFILES=opensipsxs.xs
PODFILES+=$(shell find lib/perl -name *.pm)
Expand Down

0 comments on commit ee2d8bc

Please sign in to comment.