-default_cflags = machine_args
-
-# specify -D_GNU_SOURCE unconditionally
-default_cflags += '-D_GNU_SOURCE'
+default_cflags = machine_args + ['-DALLOW_EXPERIMENTAL_API']
+default_ldflags = []
+if get_option('default_library') == 'static' and not is_windows
+ default_ldflags += ['-Wl,--export-dynamic']
+endif