1 | # |
---|
2 | # QEMU 1.x.x Version 1. |
---|
3 | # |
---|
4 | # This configuration file configure's, make's and install's QEMU. |
---|
5 | # |
---|
6 | |
---|
7 | %if %{release} == %{nil} |
---|
8 | %define release 1 |
---|
9 | %endif |
---|
10 | |
---|
11 | # |
---|
12 | # Select Snapshot Macro Maps |
---|
13 | # |
---|
14 | %select qemu-snapshot |
---|
15 | |
---|
16 | # |
---|
17 | # The description. |
---|
18 | # |
---|
19 | Name: qemu-%{qemu_version}-%{_host}-%{release} |
---|
20 | Summary: Qemu is a simulator of various processors. |
---|
21 | Version: %{qemu_version} |
---|
22 | Release: %{release} |
---|
23 | URL: http://www.qemu.org/ |
---|
24 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
25 | |
---|
26 | # |
---|
27 | # Source |
---|
28 | # |
---|
29 | %source set qemu http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2 |
---|
30 | |
---|
31 | |
---|
32 | # |
---|
33 | # QEMU Disable component list. |
---|
34 | # |
---|
35 | # We are not interested in the VM use case for qemu and most of that |
---|
36 | # functionality carries host platform baggage which complicates building on a |
---|
37 | # range of host platforms. |
---|
38 | # |
---|
39 | # You can specialise before including this config file. |
---|
40 | # |
---|
41 | # |
---|
42 | %define qemu_std_disables --disable-werror |
---|
43 | %define qemu_std_disables %{qemu_std_disables} --disable-smartcard-nss |
---|
44 | %define qemu_std_disables %{qemu_std_disables} --disable-tools |
---|
45 | %define qemu_std_disables %{qemu_std_disables} --disable-pie |
---|
46 | %define qemu_std_disables %{qemu_std_disables} --disable-vnc |
---|
47 | %define qemu_std_disables %{qemu_std_disables} --disable-sdl |
---|
48 | %define qemu_std_disables %{qemu_std_disables} --disable-gtk |
---|
49 | %define qemu_std_disables %{qemu_std_disables} --disable-opengl |
---|
50 | %define qemu_std_disables %{qemu_std_disables} --disable-netmap |
---|
51 | %ifn %{defined qemu_disables} |
---|
52 | %define qemu_disables %{nil} |
---|
53 | %endif |
---|
54 | %define qemu_disables %{qemu_std_disables} %{qemu_disables} |
---|
55 | |
---|
56 | # |
---|
57 | # QEMU Targets to build. |
---|
58 | # |
---|
59 | %if %{!defined qemu_archs} && %{!defined with_qemu_archs} |
---|
60 | %define qemu_target_list %{nil} |
---|
61 | %else |
---|
62 | %if %{defined with_qemu_archs} |
---|
63 | %define qemu_target_list --target-list=%{with_qemu_archs} |
---|
64 | %else |
---|
65 | %define qemu_target_list --target-list=%{qemu_archs} |
---|
66 | %endif |
---|
67 | %endif |
---|
68 | |
---|
69 | # |
---|
70 | # Prepare the source code. |
---|
71 | # |
---|
72 | %prep |
---|
73 | build_top=$(pwd) |
---|
74 | |
---|
75 | source_dir_qemu="qemu-%{qemu_version}" |
---|
76 | %source setup qemu -q -n qemu-%{qemu_version} |
---|
77 | %patch setup qemu -p1 |
---|
78 | |
---|
79 | cd ${build_top} |
---|
80 | |
---|
81 | %build |
---|
82 | build_top=$(pwd) |
---|
83 | |
---|
84 | %{build_directory} |
---|
85 | |
---|
86 | mkdir -p ${build_dir} |
---|
87 | cd ${build_dir} |
---|
88 | |
---|
89 | %if %{pkgconfig check vdeplug} |
---|
90 | VDE_CONFIG="--enable-vde" |
---|
91 | VDE_CFLAGS="%{pkgconfig cflags vdeplug}" |
---|
92 | VDE_LDFLAGS="%{pkgconfig ldflags vdeplug} %{pkgconfig libs vdeplug}" |
---|
93 | %endif |
---|
94 | |
---|
95 | %{host_build_flags} |
---|
96 | |
---|
97 | if test "%{_build}" != "%{_host}" ; then |
---|
98 | CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-" |
---|
99 | fi |
---|
100 | |
---|
101 | SYSROOT=$SB_TMPPREFIX |
---|
102 | |
---|
103 | # |
---|
104 | # The --extra-cflags and --extra-ldflags do not work as expected. |
---|
105 | # |
---|
106 | # Hack warning: MSYS2 does not seem to convert the path to |
---|
107 | # a shell path from Windows so we keep them |
---|
108 | # separate and handle it in the pkgconfig tool. |
---|
109 | # |
---|
110 | PKG_CONFIG_DEFAULT_PATH=${PKG_CONFIG_PATH} \ |
---|
111 | PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \ |
---|
112 | PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ |
---|
113 | %{_ld_library_path}=$SYSROOT/lib \ |
---|
114 | LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib -L$SYSROOT/lib ${VDE_LDFLAGS}" \ |
---|
115 | CFLAGS="${CFLAGS} ${VDE_CFLAGS}" \ |
---|
116 | ../${source_dir_qemu}/configure \ |
---|
117 | --prefix=%{_prefix} \ |
---|
118 | ${CROSS_PREFIX_OPTION} \ |
---|
119 | --make=%{__make} \ |
---|
120 | %{qemu_target_list} \ |
---|
121 | ${VDE_CONFIG} \ |
---|
122 | %{qemu_disables} |
---|
123 | |
---|
124 | %{_ld_library_path}=$SYSROOT/lib \ |
---|
125 | %{__make} %{?_smp_mflags} all |
---|
126 | |
---|
127 | cd ${build_top} |
---|
128 | |
---|
129 | %install |
---|
130 | build_top=$(pwd) |
---|
131 | |
---|
132 | %{__rmdir} $SB_BUILD_ROOT |
---|
133 | |
---|
134 | cd ${build_dir} |
---|
135 | %{_ld_library_path}=$SYSROOT/lib \ |
---|
136 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
137 | cd ${build_top} |
---|