176 lines
7.0 KiB
Plaintext
176 lines
7.0 KiB
Plaintext
# RPM macros for Fedora MinGW.
|
|
|
|
%_mingw32_target i686-pc-mingw32
|
|
|
|
# Paths.
|
|
%_mingw32_sysroot %{_prefix}/%{_mingw32_target}/sys-root
|
|
%_mingw32_prefix %{_mingw32_sysroot}/mingw
|
|
%_mingw32_exec_prefix %{_mingw32_prefix}
|
|
%_mingw32_bindir %{_mingw32_exec_prefix}/bin
|
|
%_mingw32_sbindir %{_mingw32_exec_prefix}/sbin
|
|
%_mingw32_libexecdir %{_mingw32_exec_prefix}/libexec
|
|
%_mingw32_libdir %{_mingw32_exec_prefix}/lib
|
|
%_mingw32_datadir %{_mingw32_prefix}/share
|
|
%_mingw32_docdir %{_mingw32_prefix}/share/doc
|
|
%_mingw32_infodir %{_mingw32_prefix}/share/info
|
|
%_mingw32_mandir %{_mingw32_prefix}/share/man
|
|
%_mingw32_sysconfdir %{_mingw32_prefix}/etc
|
|
%_mingw32_sharedstatedir %{_mingw32_prefix}/com
|
|
%_mingw32_localstatedir %{_mingw32_prefix}/var
|
|
%_mingw32_includedir %{_mingw32_prefix}/include
|
|
|
|
# Build macros.
|
|
%_mingw32_host %{_mingw32_target}
|
|
|
|
%_mingw32_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
|
|
|
|
%_mingw32_cc %{_mingw32_target}-gcc
|
|
%_mingw32_cxx %{_mingw32_target}-g++
|
|
%_mingw32_cpp %{_mingw32_target}-gcc -E
|
|
%_mingw32_addr2line %{_mingw32_target}-addr2line
|
|
%_mingw32_ar %{_mingw32_target}-ar
|
|
%_mingw32_as %{_mingw32_target}-as
|
|
%_mingw32_c++ %{_mingw32_target}-c++
|
|
%_mingw32_c++filt %{_mingw32_target}-c++filt
|
|
%_mingw32_dlltool %{_mingw32_target}-dlltool
|
|
%_mingw32_dllwrap %{_mingw32_target}-dllwrap
|
|
%_mingw32_gcov %{_mingw32_target}-gcov
|
|
%_mingw32_gprof %{_mingw32_target}-gprof
|
|
%_mingw32_ld %{_mingw32_target}-ld
|
|
%_mingw32_nm %{_mingw32_target}-nm
|
|
%_mingw32_objcopy %{_mingw32_target}-objcopy
|
|
%_mingw32_objdump %{_mingw32_target}-objdump
|
|
%_mingw32_ranlib %{_mingw32_target}-ranlib
|
|
%_mingw32_readelf %{_mingw32_target}-readelf
|
|
%_mingw32_size %{_mingw32_target}-size
|
|
%_mingw32_strings %{_mingw32_target}-strings
|
|
%_mingw32_strip %{_mingw32_target}-strip
|
|
%_mingw32_windmc %{_mingw32_target}-windmc
|
|
%_mingw32_windres %{_mingw32_target}-windres
|
|
|
|
%_mingw32_cache mingw32-config.cache
|
|
|
|
%_mingw32_findprovides /usr/lib/rpm/mingw32-find-provides.sh
|
|
%_mingw32_findrequires /usr/lib/rpm/mingw32-find-requires.sh
|
|
%_mingw32_finddebuginfo /usr/lib/rpm/mingw32-find-debuginfo.sh
|
|
|
|
%_mingw32_debug_install_post \
|
|
/usr/lib/rpm/mingw32-find-debuginfo.sh %{_builddir}/%{?buildsubdir}\
|
|
%{nil}
|
|
|
|
# Template for debug sub-package.
|
|
%_mingw32_debug_package(n:) \
|
|
%package %{-n:-n %{-n*}-}debuginfo \
|
|
Summary: Debug information for package %{name} \
|
|
Group: Development/Debug \
|
|
%description %{-n:-n %{-n*}-}debuginfo \
|
|
This package provides debug information for package %{name}.\
|
|
Debug information is useful when developing applications that use this\
|
|
package or when debugging this package.\
|
|
%files debuginfo -f debugfiles.list\
|
|
%defattr(-,root,root,-)\
|
|
%{nil}
|
|
|
|
%_mingw32_env HOST_CC=gcc; export HOST_CC; \
|
|
PKG_CONFIG_LIBDIR="%{_mingw32_libdir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
|
|
unset PKG_CONFIG_PATH; \
|
|
_PREFIX="%{_bindir}/%{_mingw32_target}-"; \
|
|
for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
|
|
x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-" "A-ZX_"`; \
|
|
declare -x $x="$i" ; export $x; \
|
|
done; \
|
|
unset _PREFIX; \
|
|
CC="${MINGW32_CC:-%_mingw32_cc}"; export CC; \
|
|
CFLAGS="${MINGW32_CFLAGS:-%_mingw32_cflags}"; export CFLAGS; \
|
|
if [ -x "%{_bindir}/%{_mingw32_cxx}" ]; then \
|
|
CXX="${MINGW32_CXX:-%_mingw32_cxx}"; export CXX; \
|
|
CXXFLAGS="${MINGW32_CXXFLAGS:-%_mingw32_cflags}"; export CXXFLAGS; \
|
|
else \
|
|
CXX=; export CXX; \
|
|
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
|
|
CXXFLAGS=; export CXXFLAGS; \
|
|
fi; \
|
|
for i in `ls %{_mingw32_bindir}/*|grep -- "-config\$"` ; do \
|
|
x=`basename $i|tr "a-z+-" "A-ZX_"`; \
|
|
declare -x $x="$i" ; export $x; \
|
|
done; \
|
|
unset x i
|
|
|
|
%_mingw32_pkg_config \
|
|
PKG_CONFIG_LIBDIR="%{_mingw32_libdir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
|
|
unset PKG_CONFIG_PATH; \
|
|
pkg-config
|
|
|
|
%_mingw32_configure %{_mingw32_env} ; \
|
|
__mingw32_topdir=.; if ! test -x configure; then __mingw32_topdir=..; fi; \\\
|
|
$__mingw32_topdir/configure --cache-file=%{_mingw32_cache} \\\
|
|
--host=%{_mingw32_host} \\\
|
|
--build=%_build \\\
|
|
--target=%{_mingw32_target} \\\
|
|
--prefix=%{_mingw32_prefix} \\\
|
|
--exec-prefix=%{_mingw32_exec_prefix} \\\
|
|
--bindir=%{_mingw32_bindir} \\\
|
|
--sbindir=%{_mingw32_sbindir} \\\
|
|
--sysconfdir=%{_mingw32_sysconfdir} \\\
|
|
--datadir=%{_mingw32_datadir} \\\
|
|
--includedir=%{_mingw32_includedir} \\\
|
|
--libdir=%{_mingw32_libdir} \\\
|
|
--libexecdir=%{_mingw32_libexecdir} \\\
|
|
--localstatedir=%{_mingw32_localstatedir} \\\
|
|
--sharedstatedir=%{_mingw32_sharedstatedir} \\\
|
|
--mandir=%{_mingw32_mandir} \\\
|
|
--infodir=%{_mingw32_infodir}
|
|
|
|
%_mingw32_make %{_mingw32_env} ; \
|
|
make \\\
|
|
prefix=%{_mingw32_prefix} \\\
|
|
exec_prefix=%{_mingw32_exec_prefix} \\\
|
|
bindir=%{_mingw32_bindir} \\\
|
|
sbindir=%{_mingw32_sbindir} \\\
|
|
sysconfdir=%{_mingw32_sysconfdir} \\\
|
|
datadir=%{_mingw32_datadir} \\\
|
|
includedir=%{_mingw32_includedir} \\\
|
|
libdir=%{_mingw32_libdir} \\\
|
|
libexecdir=%{_mingw32_libexecdir} \\\
|
|
localstatedir=%{_mingw32_localstatedir} \\\
|
|
sharedstatedir=%{_mingw32_sharedstatedir} \\\
|
|
mandir=%{_mingw32_mandir} \\\
|
|
infodir=%{_mingw32_infodir}
|
|
|
|
%_mingw32_makeinstall %{_mingw32_env} ; \
|
|
make \\\
|
|
prefix=%{?buildroot:%{buildroot}}%{_mingw32_prefix} \\\
|
|
exec_prefix=%{?buildroot:%{buildroot}}%{_mingw32_exec_prefix} \\\
|
|
bindir=%{?buildroot:%{buildroot}}%{_mingw32_bindir} \\\
|
|
sbindir=%{?buildroot:%{buildroot}}%{_mingw32_sbindir} \\\
|
|
sysconfdir=%{?buildroot:%{buildroot}}%{_mingw32_sysconfdir} \\\
|
|
datadir=%{?buildroot:%{buildroot}}%{_mingw32_datadir} \\\
|
|
includedir=%{?buildroot:%{buildroot}}%{_mingw32_includedir} \\\
|
|
libdir=%{?buildroot:%{buildroot}}%{_mingw32_libdir} \\\
|
|
libexecdir=%{?buildroot:%{buildroot}}%{_mingw32_libexecdir} \\\
|
|
localstatedir=%{?buildroot:%{buildroot}}%{_mingw32_localstatedir} \\\
|
|
sharedstatedir=%{?buildroot:%{buildroot}}%{_mingw32_sharedstatedir} \\\
|
|
mandir=%{?buildroot:%{buildroot}}%{_mingw32_mandir} \\\
|
|
infodir=%{?buildroot:%{buildroot}}%{_mingw32_infodir} \\\
|
|
install
|
|
|
|
%_mingw32_cmake %{_mingw32_env} ; \
|
|
%__cmake \\\
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \\\
|
|
-DCMAKE_INSTALL_PREFIX:PATH=%{_mingw32_prefix} \\\
|
|
-DCMAKE_INSTALL_LIBDIR:PATH=%{_mingw32_libdir} \\\
|
|
-DINCLUDE_INSTALL_DIR:PATH=%{_mingw32_includedir} \\\
|
|
-DLIB_INSTALL_DIR:PATH=%{_mingw32_libdir} \\\
|
|
-DSYSCONF_INSTALL_DIR:PATH=%{_mingw32_sysconfdir} \\\
|
|
-DSHARE_INSTALL_PREFIX:PATH=%{_mingw32_datadir} \\\
|
|
%{?_cmake_skip_rpath} \\\
|
|
-DBUILD_SHARED_LIBS:BOOL=ON \\\
|
|
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw32/Toolchain-mingw32.cmake
|
|
|
|
%_mingw32_qmake_qt4 %{_mingw32_env} ; \
|
|
%_qt4_qmake -spec win32-g++-fedora-cross
|
|
|
|
%_mingw32_description This is the cross-compiled version of this library / tool.\
|
|
You should only install this package if you want to cross-compile programs for \
|
|
Win32 (32 bit Windows).
|