diff --git a/Makefile b/Makefile index a7c3268d4..4d9d6255f 100644 --- a/Makefile +++ b/Makefile @@ -24,17 +24,14 @@ ${NAME}: ${BUILD-DIR} .PHONY: clean clean: -ifneq ("$(wildcard ${BUILD-DIR})","") - meson compile --clean -C ${BUILD-DIR} -endif - -.PHONY: purge -purge: ifneq ("$(wildcard ${BUILD-DIR})","") rm -rf ${BUILD-DIR} meson subprojects purge --confirm endif +.PHONY: purge +purge: clean + .PHONY: install install: ${NAME} meson install -C ${BUILD-DIR} --skip-subprojects diff --git a/meson.build b/meson.build index 1ba07f1ad..4eeb2c0d2 100644 --- a/meson.build +++ b/meson.build @@ -216,9 +216,10 @@ conf.set10( description: 'Is linux/mctp.h include-able?' ) -conf.set( - 'HAVE_NETDB', - cc.links( +is_static = get_option('default_library') == 'static' +have_netdb = false +if not is_static + have_netdb = cc.links( '''#include #include #include @@ -228,9 +229,15 @@ conf.set( } ''', name: 'netdb', - ), + ) +endif + +conf.set( + 'HAVE_NETDB', + have_netdb, description: 'Is network address and service translation available' ) + dl_dep = dependency('dl', required: false) conf.set( 'HAVE_LIBC_DLSYM',