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