Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from RoboTux/cond_ldl_inclusion.

Include libdl only if necessary
  • Loading branch information...
commit dedba6525f2f3b4cde13505a98beeebb619d72f0 2 parents 3637042 + 6b5bfc1
@hugosantos authored
Showing with 15 additions and 0 deletions.
  1. +2 −0  src/Makefile
  2. +13 −0 src/test_dl_inclusion_in_libc.cpp
View
2  src/Makefile
@@ -51,7 +51,9 @@ SOURCES = address.cpp address_set.cpp group.cpp icmp_inet6.cpp icmp.cpp \
parser.cpp rib.cpp router.cpp timers.cpp support/objpool.cpp \
support/ptree.cpp
+ifneq ($(shell $(CXX) -c test_dl_inclusion_in_libc.cpp 1>/dev/null 2>&1 ; echo $$? ; rm -f test_dl_inclusion_in_libc.o),0)
LDFLAGS += -ldl # mrd.cpp requires dl* functions
+endif
ifeq ($(PLATFORM),OS_LINUX)
SOURCES += linux/us_mfa.cpp linux/linux_icmp_raw.cpp \
View
13 src/test_dl_inclusion_in_libc.cpp
@@ -0,0 +1,13 @@
+int main(void)
+{
+ void *(*dlopen_fct)(const char *filename, int flag);
+ char *(*dlerror_fct)(void);
+ void *(*dlsym_fct)(void *handle, const char *symbol);
+ int (*dlclose_fct)(void *handle);
+
+ dlopen_fct = dlopen;
+ dlerror_fct = dlerror;
+ dlsym_fct = dlsym;
+ dlclose_fct = dlclose;
+ return 0;
+}
Please sign in to comment.
Something went wrong with that request. Please try again.