Added shared library support for Cygwin and MingW (STR #893)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4474 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-08-08 00:54:30 +00:00
parent c9f9b4faa0
commit 6585e234ae
3 changed files with 157 additions and 1 deletions

View File

@ -2,6 +2,8 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745, STR #942, STR #931)
- Added shared library support for Cygwin and MingW (STR
#893)
- Fl_File_Chooser did not implement the user_data()
methods (STR #970)
- Compilation could fail if a previous installation of

View File

@ -187,7 +187,19 @@ if test x$enable_shared = xyes; then
SHAREDSUFFIX="_s"
;;
CYGWIN* | MINGW*)
AC_MSG_WARN(Shared libraries are not supported under CygWin.)
PICFLAG=0
if test x$enable_cygwin != xyes; then
DSONAME="mgwfltknox-$FL_API_VERSION.dll"
FLDSONAME="mgwfltknox_forms-$FL_API_VERSION.dll"
GLDSONAME="mgwfltknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="mgwfltknox_images-$FL_API_VERSION.dll"
else
DSONAME="cygfltknox-$FL_API_VERSION.dll"
FLDSONAME="cygfltknox_forms-$FL_API_VERSION.dll"
GLDSONAME="cygfltknox_gl-$FL_API_VERSION.dll"
IMGDSONAME="cygfltknox_images-$FL_API_VERSION.dll"
fi
DSOCOMMAND="\$(CXX) -shared -Wl,--whole-archive -Wl,--export-all-symbols -Wl,--enable-auto-import -o \$@"
;;
*)
AC_MSG_WARN(Shared libraries may not be supported. Trying -shared option with compiler.)

View File

@ -338,6 +338,51 @@ libfltk_images_s.a: $(IMGOBJECTS)
$(LIBCOMMAND) libfltk_images_s.a libfltk_images_s.o
$(CHMOD) +x libfltk_images_s.a
cygfltknox-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk.a ...
$(DSOCOMMAND) ../lib/libfltk.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk.dll.a $(LDLIBS)
cygfltknox_forms-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_forms.a ...
$(DSOCOMMAND) ../lib/libfltk_forms.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_forms.dll.a \
-L../lib -lfltk $(LDLIBS)
cygfltknox_gl-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_gl.a ...
$(DSOCOMMAND) ../lib/libfltk_gl.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_gl.dll.a \
-L../lib -lfltk $(GLDLIBS)
cygfltknox_images-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_images ...
$(DSOCOMMAND) ../lib/libfltk_images.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_images.dll.a \
-L../lib -lfltk -ljpeg -lpng -lz $(LDLIBS)
mgwfltknox-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk.a ...
$(DSOCOMMAND) ../lib/libfltk.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk.dll.a $(LDLIBS)
mgwfltknox_forms-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_forms.a ...
$(DSOCOMMAND) ../lib/libfltk_forms.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_forms.dll.a \
-L../lib -lfltk $(LDLIBS)
mgwfltknox_gl-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_gl.a ...
$(DSOCOMMAND) ../lib/libfltk_gl.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_gl.dll.a \
-L../lib -lfltk $(GLDLIBS)
mgwfltknox_images-1.1.dll:
echo $(DSOCOMMAND) ../lib/libfltk_images ...
$(DSOCOMMAND) ../lib/libfltk_images.a -Wl,--no-whole-archive \
-Wl,--out-implib=libfltk_images.dll.a \
-L../lib -lfltk -ljpeg -lpng -lz $(LDLIBS)
clean:
-$(RM) *.o core.* *~ *.bck *.bck
@ -423,6 +468,7 @@ install: $(LIBNAME) $(DSONAME) \
$(IMGLIBNAME) $(IMGDSONAME)
echo "Installing libraries in $(DESTDIR)$(libdir)..."
-$(MKDIR) $(DESTDIR)$(libdir)
-$(MKDIR) $(DESTDIR)$(bindir)
$(RM) $(DESTDIR)$(libdir)/$(LIBNAME)
-$(CP) $(LIBNAME) $(FLLIBNAME) $(GLLIBNAME) $(IMGLIBNAME) $(DESTDIR)$(libdir)
$(RANLIB) $(DESTDIR)$(libdir)/$(LIBNAME)
@ -454,6 +500,22 @@ install: $(LIBNAME) $(DSONAME) \
$(CP) libfltk_s.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_s.a; \
fi
if test x$(DSONAME) = xcygfltknox-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME);\
$(CP) $(DSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
$(CP) libfltk.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk.dll.a; \
fi
if test x$(DSONAME) = xmgwfltknox-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME);\
$(CP) $(DSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
$(CP) libfltk.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk.dll.a; \
fi
if test x$(FLDSONAME) = xlibfltk_forms.so.1.1; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.so*;\
$(CP) libfltk_forms.so.1.1 $(DESTDIR)$(libdir); \
@ -477,6 +539,22 @@ install: $(LIBNAME) $(DSONAME) \
$(CP) libfltk_forms_s.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_forms.a; \
fi
if test x$(FLDSONAME) = xcygfltknox_forms-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(CP) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
$(CP) libfltk_forms.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_forms.dll.a; \
fi
if test x$(FLDSONAME) = xmgwfltknox_forms-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME);\
$(CP) $(FLDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
$(CP) libfltk_forms.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_forms.dll.a; \
fi
if test x$(GLDSONAME) = xlibfltk_gl.so.1.1; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.so*;\
$(CP) libfltk_gl.so.1.1 $(DESTDIR)$(libdir); \
@ -500,6 +578,22 @@ install: $(LIBNAME) $(DSONAME) \
$(CP) libfltk_gl_s.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_gl.a; \
fi
if test x$(GLDSONAME) = xcygfltknox_gl-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME);\
$(CP) $(GLDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
$(CP) libfltk_gl.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_gl.dll.a; \
fi
if test x$(GLDSONAME) = xmgwfltknox_gl-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME);\
$(CP) $(GLDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
$(CP) libfltk_gl.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_gl.dll.a; \
fi
if test x$(IMGDSONAME) = xlibfltk_images.so.1.1; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images.so*;\
$(CP) libfltk_images.so.1.1 $(DESTDIR)$(libdir); \
@ -523,6 +617,22 @@ install: $(LIBNAME) $(DSONAME) \
$(CP) libfltk_images_s.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_images.a; \
fi
if test x$(IMGDSONAME) = xcygfltknox_images-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(CP) $(IMGDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
$(CP) libfltk_images.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_images.dll.a; \
fi
if test x$(IMGDSONAME) = xmgwfltknox_images-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(CP) $(IMGDSONAME) $(DESTDIR)$(bindir); \
$(CHMOD) 755 $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
$(CP) libfltk_images.dll.a $(DESTDIR)$(libdir); \
$(CHMOD) 755 $(DESTDIR)$(libdir)/libfltk_images.dll.a; \
fi
uninstall:
echo "Uninstalling libraries..."
@ -539,6 +649,14 @@ uninstall:
if test x$(DSONAME) = xlibfltk_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_s.a;\
fi
if test x$(DSONAME) = xcygfltknox-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
fi
if test x$(DSONAME) = xmgwfltknox-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
fi
$(RM) $(DESTDIR)$(libdir)/$(FLLIBNAME);
if test x$(FLDSONAME) = xlibfltk_forms.so.1.1; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.so*;\
@ -552,6 +670,14 @@ uninstall:
if test x$(FLDSONAME) = xlibfltk_forms_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_forms_s.a;\
fi
if test x$(FLDSONAME) = xcygfltknox_forms-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
fi
if test x$(FLDSONAME) = xmgwfltknox_forms-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
fi
if test x$(GLLIBNAME) != x; then\
$(RM) $(DESTDIR)$(libdir)/$(GLLIBNAME);\
fi
@ -567,6 +693,14 @@ uninstall:
if test x$(GLDSONAME) = xlibfltk_gl_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_gl_s.a;\
fi
if test x$(GLDSONAME) = xcygfltknox_gl-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
fi
if test x$(GLDSONAME) = xmgwfltknox_gl-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
fi
if test x$(IMGLIBNAME) != x; then\
$(RM) $(DESTDIR)$(libdir)/$(IMGLIBNAME);\
fi
@ -582,6 +716,14 @@ uninstall:
if test x$(IMGDSONAME) = xlibfltk_images_s.a; then\
$(RM) $(DESTDIR)$(libdir)/libfltk_images_s.a;\
fi
if test x$(IMGDSONAME) = xcygfltknox_images-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
fi
if test x$(IMGDSONAME) = xmgwfltknox_images-1.1.dll; then\
$(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
$(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
fi
#