Sun, 03 Apr 2011 13:34:55 +0200
Correct and improve several packaging aspects including...
Correct datadir path for python modules, correct jar(1) path for
building libgcj classes, strip libexecdir path of version numbers,
improve name of oblbld build path, clean whitespace from as(1) and
ld(1) GNU detection, remove seemingly discarded '--with-local-prefix'
configure argument, and correct hardcoded lto plugin libtool archive
dependency information.
Most importantly, correct IA32 architecture detection logic in
config.gcc to correctly emit SSE2 instructions conditionally, leading
to the removal of all '-march' bootstrap options and replacement with
unconditional (for IA32/AMD64) '-mtune=native' options. Comments and
buildtime warnings are corrected appropriately. In theory these changes
cause a more portable, orthoganal, and optimal bootstrap to be built.
1 Index: RRDTool-OO-0.24/Makefile.PL
2 --- RRDTool-OO-0.24/Makefile.PL.orig 2008-01-24 04:29:54 +0100
3 +++ RRDTool-OO-0.24/Makefile.PL 2008-12-16 08:35:38 +0100
4 @@ -2,55 +2,12 @@
5 use ExtUtils::MakeMaker;
6 use File::Basename;
8 -# Check if RRDs is installed
9 -my $v = rrdtool_version();
10 -#print "v=$v\n";
11 -
12 -eval { require RRDs; };
13 -
14 - # (1) libcgi is missing on most Linux/FreeBSD systems, and we
15 - # don't need it anyway.
16 - # (2) as of rrdtool-1.2.11, tcl libs didn't compile, so let's
17 - # leave them out.
18 -my $CONFIGURE_OPTS = "--enable-perl-site-install --prefix=/usr --disable-tcl --disable-rrdcgi";
19 -
20 -my $DIST_URL =
21 -"http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz";
22 -
23 -if($@ or !$v or $v < 1.002011) {
24 - print <<EOT;
25 -This module requires rrdtool 1.2.x and the RRDs module to be
26 -installed. They are available in the rrdtool distribution:
27 - $DIST_URL
28 -EOT
29 -
30 - $| = 1;
31 - print "Do you want me to install it for you right now ([y]/n)?";
32 - my $in = <>;
33 - chomp $in;
34 - if($in =~ /^\s*$/ or $in =~ /y/i) {
35 - if($> != 0) {
36 - die "\nYou need to be root to do this.\n";
37 - }
38 - eval { install_RRDs() };
39 - if($@) {
40 - print $@;
41 - note();
42 - exit 0;
43 - }
44 - } else {
45 - note();
46 - exit 0;
47 - }
48 -}
49 -
50 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
51 # the contents of the Makefile that is written.
52 WriteMakefile(
53 NAME => 'RRDTool::OO',
54 VERSION_FROM => 'lib/RRDTool/OO.pm', # finds $VERSION
55 PREREQ_PM => {
56 - Log::Log4perl => '0.40',
57 RRDs => 0,
58 }, # e.g., Module::Name => 1.1
59 ($] >= 5.005 ? ## Add these new keywords supported since 5.005
60 Index: RRDTool-OO-0.24/lib/RRDTool/OO.pm
61 --- RRDTool-OO-0.24/lib/RRDTool/OO.pm.orig 2008-05-20 11:17:57 +0200
62 +++ RRDTool-OO-0.24/lib/RRDTool/OO.pm 2008-12-16 08:35:38 +0100
63 @@ -5,7 +5,6 @@
64 use warnings;
65 use Carp;
66 use RRDs;
67 -use Log::Log4perl qw(:easy);
69 our $VERSION = '0.22';
71 @@ -183,7 +182,7 @@
72 # Check if we got all mandatory parameters
73 for(@{$ref->{mandatory}}) {
74 if(! exists $options_hash{$_}) {
75 - Log::Log4perl->get_logger("")->logcroak(
76 + croak(
77 "Mandatory parameter '$_' not set " .
78 "in $method() (@{[%mandatory]}) (@$options)");
79 }
80 @@ -195,7 +194,7 @@
81 for(keys %options_hash) {
82 if(! exists $optional{$_} and
83 ! exists $mandatory{$_}) {
84 - Log::Log4perl->get_logger("")->logcroak(
85 + croak(
86 "Illegal parameter '$_' in $method()");
87 }
88 }
89 Index: bindings/perl-shared/Makefile.PL
90 --- bindings/perl-shared/Makefile.PL.orig 2008-12-05 16:39:55 +0100
91 +++ bindings/perl-shared/Makefile.PL 2008-12-16 08:37:40 +0100
92 @@ -1,36 +1,7 @@
93 use ExtUtils::MakeMaker;
94 use Config;
95 -# See lib/ExtUtils/MakeMaker.pm for details of how to influence
96 -# the contents of the Makefile that is written.
98 -# if the last argument when calling Makefile.PL is RPATH=/... and ... is the
99 -# path to librrd.so then the Makefile will be written such that RRDs.so knows
100 -# where to find librrd.so later on ...
101 -my $R="";
102 -if ($ARGV[-1] =~ /RPATH=(\S+)/){
103 - pop @ARGV;
104 - my $rp = $1;
105 - for ($^O){
106 - /linux/ && do{ $R = "-Wl,--rpath -Wl,$rp"};
107 - /hpux/ && do{ $R = "+b$rp"};
108 - /solaris/ && do{ $R = "-R$rp"};
109 - /bsd/ && do{ $R = "-R$rp"};
110 - /aix/ && do{ $R = "-Wl,-blibpath:$rp"};
111 - }
112 -}
113 -
114 -# darwin works without this because librrd contains its
115 -# install_name which will includes the final location of the
116 -# library after it is installed. This install_name gets transfered
117 -# to the perl shared object.
118 -
119 -my $librrd;
120 -if ($^O eq 'darwin'){
121 - $librrd = '-lrrd';
122 -}
123 -else {
124 - $librrd = "-L../../src/.libs/ $R -lrrd";
125 -}
126 +my $librrd = "-L../../src/.libs/ -lrrd -L$Config{prefix}/lib -lxml2 -lz -liconv -lm -lsocket -lnsl -lpangocairo -lpango -lcairo -lpangoft2 -lglib2 -lintl -lgobject2 -lgmodule2 -lpcre -lpixman-1 -lfontconfig -lexpat -lfreetype -lpng -lz -lpango -lm -lfontconfig -lexpat -lgobject2 -lgmodule2 -lglib2 -lintl -liconv -lpcre -lfreetype -lart_lgpl";
128 WriteMakefile(
129 'NAME' => 'RRDs',
130 Index: bindings/python/setup.py
131 --- bindings/python/setup.py.orig 2008-03-15 11:39:48 +0100
132 +++ bindings/python/setup.py 2008-12-16 08:35:38 +0100
133 @@ -47,7 +47,7 @@
134 Extension(
135 "rrdtoolmodule",
136 ["rrdtoolmodule.c"],
137 - libraries=['rrd'],
138 + libraries=['rrd', 'freetype', 'art_lgpl', 'png', 'z'],
139 library_dirs=[library_dir],
140 include_dirs=[include_dir],
141 )
142 Index: configure
143 --- configure.orig 2008-12-15 23:06:39 +0100
144 +++ configure 2008-12-16 08:35:38 +0100
145 @@ -30827,7 +30827,7 @@
146 echo $ECHO_N "(cached) $ECHO_C" >&6
147 else
148 ac_check_lib_save_LIBS=$LIBS
149 -LIBS="-lpango-1.0 $LIBS"
150 +LIBS="-lpango $LIBS"
151 cat >conftest.$ac_ext <<_ACEOF
152 /* confdefs.h. */
153 _ACEOF
154 @@ -31010,7 +31010,7 @@
156 fi
157 if test $ac_cv_header_pango_pango_h = yes; then
158 - LIBS="-lpango-1.0 ${LIBS}";EX_CHECK_STATE=YES
159 + LIBS="-lpango ${LIBS}";EX_CHECK_STATE=YES
160 fi
163 @@ -31066,14 +31066,14 @@
164 LDFLAGS=${LDFLAGS}" "`$PKGCONFIG --libs-only-L pangocairo`
165 LDFLAGS=${LDFLAGS}" "`$PKGCONFIG --libs-only-other pangocairo`
166 LIBS=${LIBS}" "`$PKGCONFIG --libs-only-l pangocairo`
167 - unset ac_cv_lib_`echo pango-1.0 | sed 's/[^_a-zA-Z0-9]/_/g;s/^[0-9]/_/'`_pango_cairo_context_set_font_options
168 + unset ac_cv_lib_`echo pango | sed 's/[^_a-zA-Z0-9]/_/g;s/^[0-9]/_/'`_pango_cairo_context_set_font_options
169 { echo "$as_me:$LINENO: checking for pango_cairo_context_set_font_options in -lpango-1.0" >&5
170 echo $ECHO_N "checking for pango_cairo_context_set_font_options in -lpango-1.0... $ECHO_C" >&6; }
171 if test "${ac_cv_lib_pango_1_0_pango_cairo_context_set_font_options+set}" = set; then
172 echo $ECHO_N "(cached) $ECHO_C" >&6
173 else
174 ac_check_lib_save_LIBS=$LIBS
175 -LIBS="-lpango-1.0 $LIBS"
176 +LIBS="-lpango $LIBS"
177 cat >conftest.$ac_ext <<_ACEOF
178 /* confdefs.h. */
179 _ACEOF
180 @@ -32551,9 +32551,9 @@
181 echo $ECHO_N "checking for headers required to compile python extensions... $ECHO_C" >&6; }
182 py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
183 py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
184 -PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
185 +PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION} -I${py_prefix}/include/python"
186 if test "$py_prefix" != "$py_exec_prefix"; then
187 - PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
188 + PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION} -I${py_exec_prefix}/include/python"
189 fi
191 save_CPPFLAGS="$CPPFLAGS"
192 Index: src/rrd_open.c
193 --- src/rrd_open.c.orig 2008-12-15 23:06:22 +0100
194 +++ src/rrd_open.c 2008-12-16 08:35:38 +0100
195 @@ -218,7 +218,7 @@
196 #endif
197 if (rdwr & RRD_CREAT)
198 goto out_done;
199 -#ifdef USE_MADVISE
200 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED) && defined(MADV_SEQUENTIAL) && defined(MADV_RANDOM)
201 if (rdwr & RRD_COPY) {
202 /* We will read everything in a moment (copying) */
203 madvise(data, rrd_file->file_len, MADV_WILLNEED | MADV_SEQUENTIAL);
204 @@ -251,7 +251,7 @@
205 rrd->stat_head->version);
206 goto out_nullify_head;
207 }
208 -#if defined USE_MADVISE
209 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
210 /* the ds_def will be needed soonish, so hint accordingly */
211 madvise(data + PAGE_START(offset),
212 sizeof(ds_def_t) * rrd->stat_head->ds_cnt, MADV_WILLNEED);
213 @@ -259,7 +259,7 @@
214 __rrd_read(rrd->ds_def, ds_def_t,
215 rrd->stat_head->ds_cnt);
217 -#if defined USE_MADVISE
218 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
219 /* the rra_def will be needed soonish, so hint accordingly */
220 madvise(data + PAGE_START(offset),
221 sizeof(rra_def_t) * rrd->stat_head->rra_cnt, MADV_WILLNEED);
222 @@ -274,7 +274,7 @@
223 rrd_set_error("live_head_t malloc");
224 goto out_close;
225 }
226 -#if defined USE_MADVISE
227 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
228 /* the live_head will be needed soonish, so hint accordingly */
229 madvise(data + PAGE_START(offset), sizeof(time_t), MADV_WILLNEED);
230 #endif
231 @@ -284,7 +284,7 @@
232 rrd->live_head->last_up = *rrd->legacy_last_up;
233 rrd->live_head->last_up_usec = 0;
234 } else {
235 -#if defined USE_MADVISE
236 +#if defined(USE_MADVISE) && defined(MADV_WILLNEED)
237 /* the live_head will be needed soonish, so hint accordingly */
238 madvise(data + PAGE_START(offset),
239 sizeof(live_head_t), MADV_WILLNEED);
240 @@ -414,7 +414,7 @@
241 + rrd->rra_ptr[i].cur_row
242 * rrd->stat_head->ds_cnt * sizeof(rrd_value_t));
243 if (active_block > dontneed_start) {
244 -#ifdef USE_MADVISE
245 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
246 madvise(rrd_file->file_start + dontneed_start,
247 active_block - dontneed_start - 1, MADV_DONTNEED);
248 #endif
249 @@ -439,7 +439,7 @@
250 }
252 if (dontneed_start < rrd_file->file_len) {
253 -#ifdef USE_MADVISE
254 +#if defined(USE_MADVISE) && defined(MADV_DONTNEED)
255 madvise(rrd_file->file_start + dontneed_start,
256 rrd_file->file_len - dontneed_start, MADV_DONTNEED);
257 #endif