Add FL_EXPORT directives to support building shared libs with -no-undefined

This commit is contained in:
ManoloFLTK 2022-08-24 15:09:30 +02:00
parent 80ecf605ec
commit 51e9b28f39
4 changed files with 14 additions and 18 deletions

View File

@ -1406,21 +1406,17 @@ AS_IF([test -n "$GCC"], [
[AC_MSG_RESULT(no)])
CFLAGS="$OLDCFLAGS"
AS_IF([test x$enable_wayland = xyes],[
DSOFLAGS="$DSOFLAGS -Wl,--allow-shlib-undefined"
] , [
dnl Make sure that shared libraries don't have undefined references
# See if ld supports -no-undefined...
AC_MSG_CHECKING([if ld supports -no-undefined])
OLDLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-no-undefined"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[DSOFLAGS="$DSOFLAGS -Wl,-no-undefined"
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
LDFLAGS="$OLDLDFLAGS"
])
dnl Make sure that shared libraries don't have undefined references
# See if ld supports -no-undefined...
AC_MSG_CHECKING([if ld supports -no-undefined])
OLDLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-no-undefined"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[DSOFLAGS="$DSOFLAGS -Wl,-no-undefined"
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
LDFLAGS="$OLDLDFLAGS"
# See if ld supports -Bsymbolic-functions...
AC_MSG_CHECKING([if ld supports -Bsymbolic-functions])

View File

@ -71,7 +71,7 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
void Fl_Wayland_Gl_Window_Driver::init() {
EGLint major, minor;
if (!Fl_Wayland_Screen_Driver::wl_display) Fl::screen_driver()->open_display();
if (!Fl_Wayland_Screen_Driver::wl_display) fl_open_display();
egl_display = eglGetDisplay((EGLNativeDisplayType) Fl_Wayland_Screen_Driver::wl_display);
if (egl_display == EGL_NO_DISPLAY) {
Fl::fatal("Can't create egl display\n");

View File

@ -63,7 +63,7 @@ class Fl_Wayland_Screen_Driver : public Fl_Screen_Driver
static int insertion_point_height;
static bool insertion_point_location_is_valid;
public:
static struct wl_display *wl_display;
static FL_EXPORT struct wl_display *wl_display;
static void insertion_point_location(int x, int y, int height);
static bool insertion_point_location(int *px, int *py, int *pwidth, int *pheight);
int get_mouse_unscaled(int &xx, int &yy);

View File

@ -84,7 +84,7 @@ public:
struct xdg_toplevel *xdg_toplevel();
Fl_Wayland_Window_Driver(Fl_Window*);
virtual ~Fl_Wayland_Window_Driver();
static struct wld_window *wld_window;
static FL_EXPORT struct wld_window *wld_window;
static void redraw(struct wld_window *window);
static inline Fl_Wayland_Window_Driver* driver(const Fl_Window *w) {return (Fl_Wayland_Window_Driver*)Fl_Window_Driver::driver(w);}