1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
7 %define debug_package %{nil}
9 # Running the tests requires Wine.
15 Summary: FlexDLL Windows DLL plugin API which is like dlopen
18 Group: Development/Libraries
20 URL: http://alain.frisch.fr/flexdll.html
21 Source0: http://alain.frisch.fr/flexdll/flexdll-%{version}.tar.gz
25 Patch1000: mingw32-flexdll-0.11-mingw-cross.patch
26 Patch1001: mingw32-flexdll-0.11-no-cygpath.patch
27 Patch1002: mingw32-flexdll-0.11-no-directory.patch
29 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
31 BuildRequires: mingw32-filesystem >= 35
32 BuildRequires: mingw32-gcc
33 BuildRequires: mingw32-binutils
35 BuildRequires: dos2unix
39 Under Windows, DLL (Dynamically-Linked Libraries) are generally used
40 to improve code modularity and sharing. A DLL can be loaded
41 automatically when the program is loaded (if it requires the DLL). The
42 program can also explicitly request Windows to load a DLL at any
43 moment during runtime, using the LoadLibrary function from the Win32
46 This naturally suggests to use DLLs as a plugin mechanism. For
47 instance, a web server could load extensions modules stored in DLLs at
48 runtime. But Windows does not really make it easy to implement plugins
49 that way. The reason is that when you try to create a DLL from a set
50 of object files, the linker needs to resolve all the symbols, which
51 leads to the very problem solved by FlexDLL:
53 Windows DLL cannot refer to symbols defined in the main application or
54 in previously loaded DLLs.
56 Some usual solutions exist, but they are not very flexible. A notable
57 exception is the edll library (its homepage also describes the usual
58 solutions), which follows a rather drastic approach; indeed, edll
59 implements a new dynamic linker which can directly load object files
60 (without creating a Windows DLL).
62 FlexDLL is another solution to the same problem. Contrary to edll, it
63 relies on the native static and dynamic linkers. Also, it works both
64 with the Microsoft environment (MS linker, Visual Studio compilers)
65 and with Cygwin (GNU linker and compilers, in Cygwin or MinGW
66 mode). Actually, FlexDLL implements mostly the usual dlopen POSIX API,
67 without trying to be fully conformant though (e.g. it does not respect
68 the official priority ordering for symbol resolution). This should
69 make it easy to port applications developed for Unix.
79 for f in CHANGES LICENSE README; do
86 make TOOLCHAIN=mingw MINCC=%{_mingw32_cc} CC=%{_mingw32_cc} \
87 flexlink.exe build_mingw
94 make -C test CC=%{_mingw32_cc} O=o CHAIN=mingw
99 rm -rf $RPM_BUILD_ROOT
101 mkdir -p $RPM_BUILD_ROOT%{_bindir}
102 mkdir -p $RPM_BUILD_ROOT%{_libdir}/flexdll
104 # Install everything in a libdir directory. Some of the files
105 # have execute permissions which we can remove.
107 flexdll.h flexdll.c flexdll_initer.c default.manifest flexdll_*.o \
108 $RPM_BUILD_ROOT%{_libdir}/flexdll
109 install -m 0755 flexlink.exe \
110 $RPM_BUILD_ROOT%{_libdir}/flexdll
112 # Provide a wrapper script which sets FLEXDIR to point to the
113 # libdir directory. Some programs call 'flexlink' and some call
114 # 'flexlink.exe' so provide both.
115 sed 's,@libdir@,%{_libdir},g' \
116 < %{SOURCE1} > $RPM_BUILD_ROOT%{_bindir}/flexlink.exe
117 chmod 0755 $RPM_BUILD_ROOT%{_bindir}/flexlink.exe
118 (cd $RPM_BUILD_ROOT%{_bindir} && ln flexlink.exe flexlink)
122 rm -rf $RPM_BUILD_ROOT
126 %defattr(-,root,root)
127 %doc LICENSE README CHANGES
129 %{_bindir}/flexlink.exe
134 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.11-7
135 - Apply no-directory patch.
137 * Sun Nov 16 2008 Richard W.M. Jones <rjones@redhat.com> - 0.11-6
138 - Permanently disable cygpath (avoids 'NUL' file being created).
140 * Fri Nov 14 2008 Richard W.M. Jones <rjones@redhat.com> - 0.11-4
141 - Initial RPM release.