[mingw-dlfcn] Added win64 support

Erik van Pienbroek epienbro at fedoraproject.org
Sat Apr 14 18:48:55 UTC 2012


commit d179d64f67592ec7af150407e09d76bae8df7f07
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sat Apr 14 20:48:51 2012 +0200

    Added win64 support

 mingw-dlfcn.spec |   69 +++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 55 insertions(+), 14 deletions(-)
---
diff --git a/mingw-dlfcn.spec b/mingw-dlfcn.spec
index 3fc3c10..43f97f7 100644
--- a/mingw-dlfcn.spec
+++ b/mingw-dlfcn.spec
@@ -1,6 +1,4 @@
-%global __strip %{mingw32_strip}
-%global __objdump %{mingw32_objdump}
-%define __debug_install_post %{mingw32_debug_install_post}
+%?mingw_package_header
 
 %global realname dlfcn-win32
 
@@ -8,7 +6,7 @@
 
 Name:          mingw-dlfcn
 Version:       0
-Release:       0.12.%{alphatag}%{?dist}
+Release:       0.13.%{alphatag}%{?dist}
 Summary:       Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
 
 License:       LGPLv2+
@@ -18,9 +16,14 @@ Source0:       http://dlfcn-win32.googlecode.com/files/%{realname}-%{alphatag}.t
 
 BuildArch:     noarch
 
-BuildRequires: mingw32-filesystem >= 68
+BuildRequires: mingw32-filesystem >= 95
 BuildRequires: mingw32-gcc
 BuildRequires: mingw32-binutils
+
+BuildRequires: mingw64-filesystem >= 95
+BuildRequires: mingw64-gcc
+BuildRequires: mingw64-binutils
+
 #BuildRequires: dos2unix
 
 Patch1:        dlfcn_configure.patch
@@ -33,6 +36,7 @@ This library implements a wrapper for dlfcn, as specified in POSIX and SUS,
 around the dynamic link library functions found in the Windows API.
 
 
+# Win32
 %package -n mingw32-dlfcn
 Summary:        Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
 
@@ -48,8 +52,24 @@ Group:          Development/Libraries
 %description -n mingw32-dlfcn-static
 Static version of the MinGW Windows dlfcn library.
 
+# Win64
+%package -n mingw64-dlfcn
+Summary:        Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
+
+%description -n mingw64-dlfcn
+This library implements a wrapper for dlfcn, as specified in POSIX and SUS,
+around the dynamic link library functions found in the Windows API.
+
+%package -n mingw64-dlfcn-static
+Summary:        Static version of the MinGW Windows dlfcn library
+Requires:       mingw64-dlfcn = %{version}-%{release}
+Group:          Development/Libraries
+
+%description -n mingw64-dlfcn-static
+Static version of the MinGW Windows dlfcn library.
+
 
-%{?mingw32_debug_package}
+%?mingw_debug_package
 
 
 %prep
@@ -65,19 +85,27 @@ Static version of the MinGW Windows dlfcn library.
 
 
 %build
-%{mingw32_configure} \
-  --incdir=%{mingw32_includedir} \
-  --cc=i686-w64-mingw32-gcc \
-  --enable-shared=yes \
-  --enable-static=yes \
-  --enable-strip=i686-w64-mingw32-strip
-make %{?_smp_mflags}
+export MINGW32_CONFIGURE_ARGS="--incdir=%{mingw32_includedir} --cc=%{mingw32_cc} --enable-strip=%{mingw32_strip}"
+export MINGW64_CONFIGURE_ARGS="--incdir=%{mingw64_includedir} --cc=%{mingw64_cc} --enable-strip=%{mingw64_strip}"
+%mingw_configure --enable-shared --enable-static
+
+# This package doesn't support out of source compilation by default
+# Fix this manually
+sed -i s@'dlfcn.c'@'../dlfcn.c'@ Makefile
+sed -i s@'dlfcn.h'@'../dlfcn.h'@ Makefile
+sed -i s@'test.c'@'../test.c'@ Makefile
+sed -i s@'testdll.c'@'../testdll.c'@ Makefile
+cp Makefile build_win32
+cp Makefile build_win64
+
+%mingw_make %{?_smp_mflags}
 
 
 %install
-make DESTDIR=$RPM_BUILD_ROOT install
+%mingw_make DESTDIR=$RPM_BUILD_ROOT install
 
 
+# Win32
 %files -n mingw32-dlfcn
 %doc README COPYING
 %{mingw32_bindir}/libdl.dll
@@ -87,8 +115,21 @@ make DESTDIR=$RPM_BUILD_ROOT install
 %files -n mingw32-dlfcn-static
 %{mingw32_libdir}/libdl.a
 
+# Win64
+%files -n mingw64-dlfcn
+%doc README COPYING
+%{mingw64_bindir}/libdl.dll
+%{mingw64_libdir}/libdl.dll.a
+%{mingw64_includedir}/dlfcn.h
+
+%files -n mingw64-dlfcn-static
+%{mingw64_libdir}/libdl.a
+
 
 %changelog
+* Sat Apr 14 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 0-0.13.r11
+- Added win64 support
+
 * Wed Mar 07 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 0-0.12.r11
 - Renamed the source package to mingw-dlfcn (RHBZ #800861)
 - Use mingw macros without leading underscore


More information about the scm-commits mailing list