mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-27 17:58:59 +01:00
lib, ruby: make use of -Wl,--no-undefined configurable
In particular this is supposed to help build on systems (presumably using a non-gnu ld) where this flag is not available.
This commit is contained in:
parent
4e79903449
commit
53035dafe0
4 changed files with 20 additions and 4 deletions
|
@ -5,7 +5,9 @@ dir := bindings
|
||||||
# force the shared library to be built
|
# force the shared library to be built
|
||||||
ruby-bindings: lib/libnotmuch.so
|
ruby-bindings: lib/libnotmuch.so
|
||||||
ifeq ($(HAVE_RUBY_DEV),1)
|
ifeq ($(HAVE_RUBY_DEV),1)
|
||||||
cd $(dir)/ruby && ruby extconf.rb --vendor
|
cd $(dir)/ruby && \
|
||||||
|
EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
|
||||||
|
ruby extconf.rb --vendor
|
||||||
$(MAKE) -C $(dir)/ruby
|
$(MAKE) -C $(dir)/ruby
|
||||||
else
|
else
|
||||||
@echo Missing dependency, skipping ruby bindings
|
@echo Missing dependency, skipping ruby bindings
|
||||||
|
|
|
@ -10,8 +10,9 @@ dir = File.join('..', '..', 'lib')
|
||||||
# includes
|
# includes
|
||||||
$INCFLAGS = "-I#{dir} #{$INCFLAGS}"
|
$INCFLAGS = "-I#{dir} #{$INCFLAGS}"
|
||||||
|
|
||||||
# make sure there are no undefined symbols
|
if ENV['EXTRA_LDFLAGS']
|
||||||
$LDFLAGS += ' -Wl,--no-undefined'
|
$LDFLAGS += " " + ENV['EXTRA_LDFLAGS']
|
||||||
|
end
|
||||||
|
|
||||||
def have_local_library(lib, path, func, headers = nil)
|
def have_local_library(lib, path, func, headers = nil)
|
||||||
checking_for checking_message(func, lib) do
|
checking_for checking_message(func, lib) do
|
||||||
|
|
13
configure
vendored
13
configure
vendored
|
@ -751,6 +751,16 @@ else
|
||||||
as_needed_ldflags=""
|
as_needed_ldflags=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
printf "Checking for -Wl,--no-undefined... "
|
||||||
|
if ${CC} -Wl,--no-undefined -o minimal minimal.c >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
printf "Yes.\n"
|
||||||
|
no_undefined_ldflags="-Wl,--no-undefined"
|
||||||
|
else
|
||||||
|
printf "No (nothing to worry about).\n"
|
||||||
|
no_undefined_ldflags=""
|
||||||
|
fi
|
||||||
|
|
||||||
WARN_CXXFLAGS=""
|
WARN_CXXFLAGS=""
|
||||||
printf "Checking for available C++ compiler warning flags... "
|
printf "Checking for available C++ compiler warning flags... "
|
||||||
for flag in -Wall -Wextra -Wwrite-strings; do
|
for flag in -Wall -Wextra -Wwrite-strings; do
|
||||||
|
@ -955,6 +965,9 @@ RPATH_LDFLAGS = ${rpath_ldflags}
|
||||||
# Flags needed to have linker link only to necessary libraries
|
# Flags needed to have linker link only to necessary libraries
|
||||||
AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
|
AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
|
||||||
|
|
||||||
|
# Flags to have the linker flag undefined symbols in object files
|
||||||
|
NO_UNDEFINED_LDFLAGS = ${no_undefined_ldflags}
|
||||||
|
|
||||||
# Whether valgrind header files are available
|
# Whether valgrind header files are available
|
||||||
HAVE_VALGRIND = ${have_valgrind}
|
HAVE_VALGRIND = ${have_valgrind}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ LIBRARY_SUFFIX = so
|
||||||
LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
|
LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
|
||||||
SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
|
SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
|
||||||
LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
|
LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
|
||||||
LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
|
LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) $(NO_UNDEFINED_LDFLAGS)
|
||||||
ifeq ($(PLATFORM),OPENBSD)
|
ifeq ($(PLATFORM),OPENBSD)
|
||||||
LIBRARY_LINK_FLAG += -lc
|
LIBRARY_LINK_FLAG += -lc
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue