From 933a23e742addac92542b7e7d7655e6d67a27e54 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 22 Mar 2013 10:03:19 -0700 Subject: [PATCH] Added support to find dlopen in either libdl or libdld since some platforms package it there. --- makefile | 12 ++++++++++++ sim_ether.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index 56723286..4bcaf8bc 100644 --- a/makefile +++ b/makefile @@ -156,6 +156,12 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) LDSEARCH :=$(shell ldconfig -r | grep 'search directories' | awk '{print $$3}' | sed 's/:/ /g') ifneq (,$(LDSEARCH)) LIBPATH := $(LDSEARCH) + else + $(info *** Warning ***) + $(info *** Warning *** The library search path on your $(OSTYPE) platform can't be) + $(info *** Warning *** determined. This should be resolved before you can expect) + $(info *** Warning *** to have fully working simulators.) + $(info *** Warning ***) endif ifeq (usrpkglib,$(shell if $(TEST) -d /usr/pkg/lib; then echo usrpkglib; fi)) LIBPATH += /usr/pkg/lib @@ -219,6 +225,12 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) ifeq (BSD,$(findstring BSD,$(OSTYPE))) OS_CCDEFS += -DHAVE_DLOPEN=so $(info using libdl: $(call find_include,dlfcn)) + else + ifneq (,$(call find_lib,dld)) + OS_CCDEFS += -DHAVE_DLOPEN=$(LIBEXT) + OS_LDFLAGS += -ldld + $(info using libdld: $(call find_lib,dld) $(call find_include,dlfcn)) + endif endif endif endif diff --git a/sim_ether.c b/sim_ether.c index 31d4c22e..082393e9 100644 --- a/sim_ether.c +++ b/sim_ether.c @@ -1202,7 +1202,7 @@ int pcap_setfilter(pcap_t* a, struct bpf_program* b) { return 0; } } -#endif +#endif /* defined(USE_SHARED) && (defined(_WIN32) || defined(HAVE_DLOPEN)) */ /* Some platforms have always had pcap_sendpacket */ #if defined(_WIN32) || defined(__VMS)