summaryrefslogtreecommitdiffstats
path: root/source-builder/config/qemu-1-1.cfg
blob: 8be7ea42138a9e5edc0170074fdbcd4f3b76cd37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#
# QEMU 1.x.x Version 1.
#
# This configuration file configure's, make's and install's QEMU.
#

%if %{release} == %{nil}
%define release 1
%endif

#
# Select Snapshot Macro Maps
#
%select qemu-snapshot

#
# The description.
#
Name:      qemu-%{qemu_version}-%{_host}-%{release}
Summary:   Qemu is a simulator of various processors.
Version:   %{qemu_version}
Release:   %{release}
URL: 	   http://www.qemu.org/
BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)

#
# Source
#
%source set qemu http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2

#
# Prepare the source code.
#
%prep
  build_top=$(pwd)

  source_dir_qemu="qemu-%{qemu_version}"
  %source setup qemu -q -n qemu-%{qemu_version}
  %patch setup qemu -p1

  cd ${build_top}

%build
  build_top=$(pwd)

  %{build_directory}

  mkdir -p ${build_dir}
  cd ${build_dir}

  %if %{pkgconfig check vdeplug}
    VDE_CONFIG="--enable-vde"
    VDE_CFLAGS="%{pkgconfig cflags vdeplug}"
    VDE_LDFLAGS="%{pkgconfig ldflags vdeplug} %{pkgconfig libs vdeplug}"
  %endif

  %{host_build_flags}

  if test "%{_build}" != "%{_host}" ; then
    CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-"
  fi

  SYSROOT=$SB_TMPPREFIX

  #
  # The --extra-cflags and --extra-ldflags do not work as expected.
  #
  PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \
  PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
  %{_ld_library_path}=$SYSROOT/lib \
  LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib ${VDE_LDFLAGS}" \
  CFLAGS="${CFLAGS} ${VDE_CFLAGS}" \
  ../${source_dir_qemu}/configure \
    --prefix=%{_prefix} \
    ${CROSS_PREFIX_OPTION} \
    --make=%{__make} \
    ${VDE_CONFIG} \
    --disable-smartcard-nss \
    --disable-werror \
    --disable-tools \
    --disable-pie \
    --disable-vnc \
    --disable-sdl \
    --disable-gtk \
    --disable-opengl \
    --disable-netmap

  %{_ld_library_path}=$SYSROOT/lib \
  %{__make} %{?_smp_mflags} all

  cd ${build_top}

%install
  build_top=$(pwd)

  %{__rmdir} $SB_BUILD_ROOT

  cd ${build_dir}
  %{_ld_library_path}=$SYSROOT/lib \
  %{__make} DESTDIR=$SB_BUILD_ROOT install
  cd ${build_top}