[4861d2e] | 1 | # |
---|
| 2 | # GDB 7.xx Version 1. |
---|
| 3 | # |
---|
| 4 | # This configuration file configure's, make's and install's gdb. |
---|
| 5 | # |
---|
| 6 | |
---|
[aaa015e] | 7 | # |
---|
| 8 | # See if the simulator has been disabled for Windows. |
---|
| 9 | # |
---|
[46ec6b5] | 10 | %if %{_host_os} == win32 |
---|
[aaa015e] | 11 | %if %{defined win32-gdb-disable-sim} |
---|
| 12 | %define gdb-disable-sim 1 |
---|
| 13 | %endif |
---|
| 14 | %endif |
---|
| 15 | |
---|
[46506f1] | 16 | # |
---|
| 17 | # Default to building simulators. |
---|
| 18 | # |
---|
| 19 | %ifn %{defined gdb-disable-sim} |
---|
[aaa015e] | 20 | %define gdb-disable-sim 0 |
---|
[257d1e4] | 21 | %else |
---|
| 22 | %undefine gdb-sim-options |
---|
[3a0e561] | 23 | %endif |
---|
| 24 | |
---|
[4861d2e] | 25 | %include %{_configdir}/checks.cfg |
---|
| 26 | |
---|
[c65b9eb] | 27 | # |
---|
| 28 | # Select Snapshot Macro Maps |
---|
| 29 | # |
---|
| 30 | %select gdb-snapshot |
---|
| 31 | %select expat-snapshot |
---|
| 32 | |
---|
| 33 | # |
---|
| 34 | # The description. |
---|
| 35 | # |
---|
[8197b8e] | 36 | Name: %{_target}-gdb-%{gdb_version}-%{_host}-%{release} |
---|
[4861d2e] | 37 | Summary: GDB v%{gdb_version} for target %{_target} on host %{_host} |
---|
| 38 | Version: %{gdb_version} |
---|
| 39 | Release: %{release} |
---|
| 40 | URL: http://www.gnu.org/software/gdb/ |
---|
| 41 | BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) |
---|
| 42 | |
---|
[81ccf41] | 43 | # |
---|
| 44 | # GDB has changed it default extension. |
---|
| 45 | # |
---|
| 46 | %ifn %{defined gdb_src_ext} |
---|
| 47 | %define gdb_src_ext gz |
---|
| 48 | %endif |
---|
| 49 | |
---|
[4861d2e] | 50 | # |
---|
| 51 | # Source |
---|
| 52 | # |
---|
[81ccf41] | 53 | %source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.%{gdb_src_ext} |
---|
[4861d2e] | 54 | |
---|
[4f26bdb] | 55 | # |
---|
| 56 | # Disable Python on Cxc builds for now. |
---|
| 57 | # |
---|
| 58 | %if "%{_build}" != "%{_host}" |
---|
| 59 | %define without_python |
---|
| 60 | %endif |
---|
| 61 | |
---|
[7309d94] | 62 | # |
---|
| 63 | # The --with-python option is either the default which is auto or the path to |
---|
| 64 | # the specific python to be used. |
---|
| 65 | # |
---|
| 66 | %if %{defined with_python_path} |
---|
| 67 | %define with_python_option --with-python=%{with_python_path} |
---|
| 68 | %else |
---|
| 69 | %define with_python_option --with-python |
---|
| 70 | %endif |
---|
| 71 | |
---|
[4f26bdb] | 72 | # |
---|
[4861d2e] | 73 | # |
---|
| 74 | # Prepare the source code. |
---|
| 75 | # |
---|
| 76 | %prep |
---|
[b8b0f44] | 77 | build_top=$(pwd) |
---|
| 78 | |
---|
[d758ab9] | 79 | gdb_source=%{?gdb_external:%{gdb_expand_name}}%{!?gdb_external:"gdb-%{gdb_version}"} |
---|
| 80 | |
---|
| 81 | source_dir_gdb=${gdb_source} |
---|
| 82 | %source setup gdb -q -n ${gdb_source} |
---|
[9a15c40] | 83 | %patch setup gdb -p1 |
---|
[b8b0f44] | 84 | |
---|
| 85 | cd ${build_top} |
---|
[4861d2e] | 86 | |
---|
| 87 | %build |
---|
[b8b0f44] | 88 | build_top=$(pwd) |
---|
| 89 | |
---|
[db65c6a] | 90 | %{build_directory} |
---|
| 91 | |
---|
[4f26bdb] | 92 | mkdir -p ${build_dir} |
---|
| 93 | cd ${build_dir} |
---|
[db65c6a] | 94 | |
---|
| 95 | %{host_build_flags} |
---|
| 96 | |
---|
[4f26bdb] | 97 | if test "%{_build}" != "%{_host}" ; then |
---|
[db65c6a] | 98 | GDB_LIBS_STATIC="-lexpat" |
---|
| 99 | else |
---|
| 100 | GDB_LIBS_STATIC="-lexpat" |
---|
| 101 | GDB_LIBS="%{_forced_static}" |
---|
[4f26bdb] | 102 | fi |
---|
[db65c6a] | 103 | |
---|
| 104 | LIBS_STATIC=${GDB_LIBS_STATIC} \ |
---|
| 105 | LIBS=${GDB_LIBS} \ |
---|
[9a15c40] | 106 | ../${source_dir_gdb}/configure \ |
---|
[4861d2e] | 107 | --build=%{_build} --host=%{_host} \ |
---|
| 108 | --target=%{_target} \ |
---|
| 109 | --verbose --disable-nls \ |
---|
| 110 | --without-included-gettext \ |
---|
| 111 | --disable-win32-registry \ |
---|
| 112 | --disable-werror \ |
---|
[3a0e561] | 113 | %{!?gdb-disable-sim:--enable-sim}%{?gdb-disable-sim:--disable-sim} \ |
---|
[257d1e4] | 114 | %{?gdb-sim-options:%{gdb-sim-options}} \ |
---|
[b77019a] | 115 | --without-zlib \ |
---|
[4861d2e] | 116 | --with-expat \ |
---|
[7309d94] | 117 | %{!?without_python:%{with_python_option}} \ |
---|
[4861d2e] | 118 | --prefix=%{_prefix} --bindir=%{_bindir} \ |
---|
| 119 | --exec-prefix=%{_exec_prefix} \ |
---|
| 120 | --includedir=%{_includedir} --libdir=%{_libdir} \ |
---|
| 121 | --mandir=%{_mandir} --infodir=%{_infodir} |
---|
| 122 | |
---|
| 123 | %{__make} %{?_smp_mflags} all |
---|
[b8b0f44] | 124 | |
---|
| 125 | cd ${build_top} |
---|
[4861d2e] | 126 | |
---|
| 127 | %install |
---|
[b8b0f44] | 128 | build_top=$(pwd) |
---|
| 129 | |
---|
[4f26bdb] | 130 | %{__rmdir} $SB_BUILD_ROOT |
---|
[4861d2e] | 131 | |
---|
[4f26bdb] | 132 | cd ${build_dir} |
---|
[a77f784] | 133 | %{__make} DESTDIR=$SB_BUILD_ROOT install |
---|
[4861d2e] | 134 | |
---|
| 135 | # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. |
---|
[4f26bdb] | 136 | %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info* |
---|
[4861d2e] | 137 | |
---|
[4f26bdb] | 138 | %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir |
---|
[a77f784] | 139 | touch $SB_BUILD_ROOT%{_infodir}/dir |
---|
[4861d2e] | 140 | |
---|
[b8b0f44] | 141 | cd ${build_top} |
---|