After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 574705 - [BABL] These patches are required for successful vendor compiles on non-linux machines
[BABL] These patches are required for successful vendor compiles on non-linux...
Status: RESOLVED OBSOLETE
Product: GEGL
Classification: Other
Component: babl
git master
Other All
: High normal
: Future
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2009-03-10 02:50 UTC by The Written Word
Modified: 2014-02-05 10:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quilt series file (383 bytes, text/plain)
2009-03-10 03:04 UTC, The Written Word
  Details
config.h needs to be included at the top of every .c file in an autoconf project (618 bytes, patch)
2009-03-10 03:08 UTC, The Written Word
committed Details | Review
older aix and irix compilers choke on trailing commas in enum decls (270 bytes, patch)
2009-03-10 03:09 UTC, The Written Word
committed Details | Review
enum values must be less than INT_MAX (sign bit is illegal) (468 bytes, patch)
2009-03-10 03:11 UTC, The Written Word
committed Details | Review
some vendor C compilers choke on C++ comments (2.82 KB, patch)
2009-03-10 03:12 UTC, The Written Word
committed Details | Review
some vendor compilers can't compile non-constant elements of compound struct initializers (730 bytes, patch)
2009-03-10 03:14 UTC, The Written Word
committed Details | Review
variadic macros are non-portable, use a glib like configure-time scheme falling back to variadic functions (4.73 KB, patch)
2009-03-10 03:15 UTC, The Written Word
committed Details | Review
null-statements caused by trailing semicolons are non-portable (2.30 KB, patch)
2009-03-10 03:16 UTC, The Written Word
committed Details | Review
support hpux use of shl_load/unload and dsos with .sl prefixes (5.08 KB, patch)
2009-03-10 03:19 UTC, The Written Word
none Details | Review
the Makefile.ams shouldn't use deprecated automake features, or redundant declarations (2.69 KB, patch)
2009-03-10 03:21 UTC, The Written Word
committed Details | Review
rewrite xml-insert.sh in portable bourne-shell (4.23 KB, patch)
2009-03-10 03:24 UTC, The Written Word
committed Details | Review
don't try to pass gcc flags to vendor compilers (611 bytes, patch)
2009-03-10 03:26 UTC, The Written Word
none Details | Review
don't try to pass gcc flags to vendor compilers (611 bytes, patch)
2009-03-10 03:27 UTC, The Written Word
none Details | Review
changes to Makefile.am and configure.ac to support gnulib modules in the next patch (3.19 KB, patch)
2009-03-10 03:27 UTC, The Written Word
none Details | Review
for completeness only, you should probably ignore this (2.03 KB, patch)
2009-03-10 03:29 UTC, The Written Word
none Details | Review
gnulib modules required for portable compilation (94.67 KB, patch)
2009-03-10 03:34 UTC, The Written Word
none Details | Review
files generated by modern autotools (253.40 KB, application/octet-stream)
2009-03-10 03:39 UTC, The Written Word
  Details
revised quilt series file (403 bytes, text/plain)
2009-03-25 01:42 UTC, The Written Word
  Details
avoid the need for CPPFLAGS='-D__func__="unknown"' on some vendor compilers (4.33 KB, patch)
2009-03-25 01:44 UTC, The Written Word
none Details | Review
support hpux use of shl load/unload and dsos with .sl suffixes (5.13 KB, patch)
2009-03-29 23:58 UTC, The Written Word
committed Details | Review
don't try to pass gcc flags to vendor compilers (595 bytes, patch)
2009-03-30 00:00 UTC, The Written Word
committed Details | Review
avoid the need for CPPFLAGS='-D__func__="unknown"' on some vendor compilers (4.26 KB, patch)
2009-03-30 00:00 UTC, The Written Word
committed Details | Review
changes to Makefile.am and configure.ac to support gnulib modules in the next patch (3.37 KB, patch)
2009-03-30 00:01 UTC, The Written Word
reviewed Details | Review
for completeness only, you should probably ignore this (1.93 KB, patch)
2009-03-30 00:06 UTC, The Written Word
none Details | Review
for completeness only, you should probably ignore this (1.93 KB, patch)
2009-03-30 00:07 UTC, The Written Word
reviewed Details | Review
gnulib modules required for portable compilation (97.10 KB, patch)
2009-03-30 00:09 UTC, The Written Word
reviewed Details | Review
files generated by modern autotools (202.52 KB, application/octet-stream)
2009-03-30 00:10 UTC, The Written Word
  Details
Patch to fetch gnulib from git (32.30 KB, patch)
2010-07-26 13:56 UTC, geert jordaens
none Details | Review

Description The Written Word 2009-03-10 02:50:52 UTC
Please describe the problem:
It is very difficult to compile babl-0.0.22 unless you are
using gcc and gmake with the GNU coreutils and ruby, on a
linux host.
  
With the attached patches I was able to successfully build
everything with the vendor compilers, and pass all but one
test (failure output below) on these 30 architectures:
  
  SuSE SLES 10 (x86_64 and i686);
  Redhat RHEL3, RHEL4 and RHEL5 (x86_64 and i686);
  Redhat 7.1, 9 and RHEL 2.1 (i686);
  Solaris 10 (x86 and sparc);
  Solaris 2.6, 7, 8 and 9 (sparc);
  AIX 4.3.3, 5.1, 5.2, 5.3 and 6.1 (powerpc);
  HPUX 11.31 (ia64);
  HPUX 11.23 (pa-risc and ia64);
  HPUX 10.20, 11.0 and 11.11 (pa-risc);
  IRIX 6.5 (mips);
  Tru64 Unix 5.1 (ev5).
  
Here is a list of some of the problems solved by the
attached patches, which would otherwise prevent
proper compilation by one or more vendor C compilers:

 * build the extensions with libtool
 * support '.sl' shared library ext on HPUX
 * use correct includedir entry in babl.pc
 * use gnulib stdint.h for systems that don't have one
 * support shl_load -ldl library loader on HPUX
 * remove extraneous trailing commas from *CONVERSION mcros
 * automake INCLUDES is deprecated, use AM_CPPFLAGS
 * support srcdir != builddir builds
 * use automake source file inference in tests/
 * pregenerate changelog.rss (ruby is not commonly installed)
 * don't double #include <math.h>
 * variadic macros are not portable
 * don't use non-constant struct initializers
 * don't use the MSB of a signed integer type in an enum
 * don't use C++ comments
 * rewrite xml_instert.sh not to rely on GNU coreutils
 * for gnulib and autoconf to work properly, every .c file
   needs to #include <config.h> before anything else!



Steps to reproduce:
1. go to a non-linux machine
2. try to compile git master babl with the vendor compiler



Actual results:
compilation fails in most cases, or else if babl does compile, all the tests fail catastrophically

Expected results:
everything works the same as with gcc on linux

Does this happen every time?
yes

Other information:
Comment 1 The Written Word 2009-03-10 03:04:31 UTC
Created attachment 130363 [details]
quilt series file

put this file and all other attachments into a patches directory, and apply with 'quilt push all'

alternatively, apply each patch manually in the order shown in the series file
Comment 2 The Written Word 2009-03-10 03:08:44 UTC
Created attachment 130364 [details] [review]
config.h needs to be included at the top of every .c file in an autoconf project

you missed a couple of files in your recent patch
Comment 3 The Written Word 2009-03-10 03:09:45 UTC
Created attachment 130365 [details] [review]
older aix and irix compilers choke on trailing commas in enum decls
Comment 4 The Written Word 2009-03-10 03:11:43 UTC
Created attachment 130366 [details] [review]
enum values must be less than INT_MAX (sign bit is illegal)
Comment 5 The Written Word 2009-03-10 03:12:31 UTC
Created attachment 130367 [details] [review]
some vendor C compilers choke on C++ comments
Comment 6 The Written Word 2009-03-10 03:14:13 UTC
Created attachment 130368 [details] [review]
some vendor compilers can't compile non-constant elements of compound struct initializers
Comment 7 The Written Word 2009-03-10 03:15:33 UTC
Created attachment 130369 [details] [review]
variadic macros are non-portable, use a glib like configure-time scheme falling back to variadic functions
Comment 8 The Written Word 2009-03-10 03:16:35 UTC
Created attachment 130370 [details] [review]
null-statements caused by trailing semicolons are non-portable
Comment 9 The Written Word 2009-03-10 03:19:29 UTC
Created attachment 130371 [details] [review]
support hpux use of shl_load/unload and dsos with .sl prefixes

using gmodule might be cleaner than using a home-brew macro substitution

this patch also converts to libtool module compilation to abstract away most of the details
Comment 10 The Written Word 2009-03-10 03:21:33 UTC
Created attachment 130373 [details] [review]
the Makefile.ams shouldn't use deprecated automake features, or redundant declarations

This patch removes most of the warnings and errors thrown by automake-1.10.1, and the smaller Makefile.ams are easier to read
Comment 11 The Written Word 2009-03-10 03:24:59 UTC
Created attachment 130374 [details] [review]
rewrite xml-insert.sh in portable bourne-shell

also fixed the Makefile.am to call xml-insert.sh properly with an explicit shell, and to discard errors from which correctly
Comment 12 The Written Word 2009-03-10 03:26:45 UTC
Created attachment 130375 [details] [review]
don't try to pass gcc flags to vendor compilers

some vendor compilers warn about unknown flags but otherwise compile (noisily, with a warning for every unknown flag on every compilation unit)

since we know these are gcc flags, only see whether they work when we're compiling with gcc
Comment 13 The Written Word 2009-03-10 03:27:04 UTC
Created attachment 130376 [details] [review]
don't try to pass gcc flags to vendor compilers

some vendor compilers warn about unknown flags but otherwise compile (noisily, with a warning for every unknown flag on every compilation unit)

since we know these are gcc flags, only see whether they work when we're compiling with gcc
Comment 14 The Written Word 2009-03-10 03:27:40 UTC
Created attachment 130377 [details] [review]
changes to Makefile.am and configure.ac to support gnulib modules in the next patch
Comment 15 The Written Word 2009-03-10 03:29:56 UTC
Created attachment 130378 [details] [review]
for completeness only, you should probably ignore this

these changes are for our in-house packaging system, and require a patched libtool... but maybe useful if subsequent patches don't apply correctly with this one missing.

mostly useless :)
Comment 16 The Written Word 2009-03-10 03:34:18 UTC
Created attachment 130379 [details] [review]
gnulib modules required for portable compilation

likely you only need gnulib-cache.m4 from here to see which modules I needed, the patch was with our own slightly patched gnulib.  I've attached this for completeness, since it is part of my working, ported and tested babl tarball.

Most likely, you should fetch your own gnulib from git and:

    gnulib-tool --import extensions fpieee stdint
Comment 17 The Written Word 2009-03-10 03:39:58 UTC
Created attachment 130380 [details]
files generated by modern autotools

gzip compressed patch file

again, just for completeness to show you what my working aclocal.m4, config.h.in etc look like using stock autoconf-2.63 and automake-1.10.1 with our own lightly patched libtool-1.5.x

You should probably 'autoreconf -fvi' with the latest/blessed versions of those tools yourself rather than apply this patch
Comment 18 The Written Word 2009-03-25 01:42:32 UTC
Created attachment 131318 [details]
revised quilt series file

added a new patch

put this file and all other attachments it names into a patches directory, and apply with 'quilt push all'

alternatively, apply each patch manually in the order shown in the series file
Comment 19 The Written Word 2009-03-25 01:44:24 UTC
Created attachment 131319 [details] [review]
avoid the need for CPPFLAGS='-D__func__="unknown"' on some vendor compilers
Comment 20 Martin Nordholts 2009-03-25 19:04:18 UTC
(In reply to comment #9)
> Created an attachment (id=130371) [edit]
> support hpux use of shl_load/unload and dsos with .sl prefixes
> 
> using gmodule might be cleaner than using a home-brew macro substitution
> 
> this patch also converts to libtool module compilation to abstract away most of
> the details
> 

Everything works fine until I get to this patch, then I get errors like this:

extensions/Makefile.am:14: `ext_LTLIBRARIES' is used but `extdir' is undefined

Could you look into that before I continue please? I have commited all patches up until this patch.
Comment 21 The Written Word 2009-03-29 23:55:55 UTC
(In reply to comment #20)
> (In reply to comment #9)
> > Created an attachment (id=130371) [edit]
> > support hpux use of shl_load/unload and dsos with .sl prefixes
> > 
> > using gmodule might be cleaner than using a home-brew macro substitution
> > 
> > this patch also converts to libtool module compilation to abstract away most of
> > the details
> > 
> 
> Everything works fine until I get to this patch, then I get errors like this:
> 
> extensions/Makefile.am:14: `ext_LTLIBRARIES' is used but `extdir' is undefined
> 
> Could you look into that before I continue please? I have commited all patches
> up until this patch.

Sorry, I should've tested tested that, but the line is edited again later in the series for our bespoke tww.patch changeset, so I didn't notice the typo:

s/ext_dir/extdir/

I'm reattaching all patch sets I've had to update due to changes in the tree after a fresh 'git pull'...  the latest series file at comment #18 still lists the correct order to apply everything.

Comment 22 The Written Word 2009-03-29 23:58:58 UTC
Created attachment 131655 [details] [review]
support hpux use of shl load/unload and dsos with .sl suffixes
Comment 23 The Written Word 2009-03-30 00:00:10 UTC
Created attachment 131656 [details] [review]
don't try to pass gcc flags to vendor compilers
Comment 24 The Written Word 2009-03-30 00:00:53 UTC
Created attachment 131657 [details] [review]
avoid the need for CPPFLAGS='-D__func__="unknown"' on some vendor compilers
Comment 25 The Written Word 2009-03-30 00:01:39 UTC
Created attachment 131658 [details] [review]
changes to Makefile.am and configure.ac to support gnulib modules in the next patch
Comment 26 The Written Word 2009-03-30 00:06:42 UTC
Created attachment 131659 [details] [review]
for completeness only, you should probably ignore this

these changes are for our in-house packaging system, and require a patched
libtool... but maybe useful if subsequent patches don't apply correctly with
this one missing.

mostly useless :)
Comment 27 The Written Word 2009-03-30 00:07:02 UTC
Created attachment 131660 [details] [review]
for completeness only, you should probably ignore this

these changes are for our in-house packaging system, and require a patched
libtool... but maybe useful if subsequent patches don't apply correctly with
this one missing.

mostly useless :)
Comment 28 The Written Word 2009-03-30 00:09:00 UTC
Created attachment 131661 [details] [review]
gnulib modules required for portable compilation

likely you only need gnulib-cache.m4 from here to see which modules I needed,
the patch was with our own slightly patched gnulib.  I've attached this for
completeness, since it is part of my working, ported and tested gegl tarball.

Most likely, you should fetch your own gnulib from git and:

    gnulib-tool --import extensions fpieee stdint
Comment 29 The Written Word 2009-03-30 00:10:56 UTC
Created attachment 131662 [details]
files generated by modern autotools

bzip2 compressed patch file

again, just for completeness to show you what my working aclocal.m4,
config.h.in etc look like using stock autoconf-2.63 and automake-1.10.1 with
our own lightly patched libtool-1.5.x

You should probably 'autoreconf -fvi' with the latest/blessed versions of those
tools yourself rather than apply this patch
Comment 30 Martin Nordholts 2009-03-31 17:20:03 UTC
(In reply to comment #25)
> Created an attachment (id=131658) [edit]
> changes to Makefile.am and configure.ac to support gnulib modules in the next
> patch
> 

Now everything goes smooth until this patch. If I apply this and build I get this error:

checking whether build environment is sane... configure.ac:388: required file `lib/Makefile.in' not found
Makefile.am:5: required directory ./lib does not exist

Could you look into that please? Did you forgot to add lib/Makefile.am to the patch perhaps?

Everything else before that is commited
Comment 31 The Written Word 2009-04-01 23:54:48 UTC
(In reply to comment #30)
> (In reply to comment #25)
> > Created an attachment (id=131658) [edit]
> > changes to Makefile.am and configure.ac to support gnulib modules in the next
> > patch
> > 
> 
> Now everything goes smooth until this patch. If I apply this and build I get
> this error:
> 
> checking whether build environment is sane... configure.ac:388: required file
> `lib/Makefile.in' not found
> Makefile.am:5: required directory ./lib does not exist
> 
> Could you look into that please? Did you forgot to add lib/Makefile.am to the
> patch perhaps?
> 
> Everything else before that is commited

This patch needs to be applied at the same time as gnulib.patch... I kept them separate because gnulib-prep.patch are the edits that I made to babl files manually, and gnulib.patch itself is the files that are automatically generated by gnulib-tool.  Depending on your commit policy, you may or may not keep automatically generated files under version control.  Normally, projects that use gnulib for portability commit m4/gnulib-cache.m4 only... this allows people to run 'gnulib-tool' on a freshly checked out tree and autogenerate sources and Makefile.am for the right modules.

Remember also that my attached gnulib.patch contains the automatically generated files from our lightly patched in-house gnulib, so rather than applying that directly, I would recommend pulling the current git master of gnulib onto your dev-machine, and running gnulib-tool from there:

  $ cd $HOME/Devo
  $ git clone git://git.savannah.gnu.org/gnulib.git gnulib--master--0
  $ PATH=$HOME/Devo/gnulib--master--0:$PATH
  $ cd $HOME/Devo/babl--master--0
  $ patch -p0 < patches/gnulib-prep.patch
  $ gnulib-tool --import extensions fpieee stdint

At this point everything will build again after an autoreconf (as before, I attached a patch that contains the generated files from our lightly patched in-house autoconf,automake and libtool incase you want to compare to your own output if things aren't behaving as you'd expect).

Thanks again Martin for wading through these for me!
Comment 32 Martin Nordholts 2009-04-04 10:10:42 UTC
The only thing I can see missing now is taking care of invoking gnulib-tool --update properly in autogen.sh and provide a helpful message why this fails, if it fails.

Is there any de facto standard way of doing this?
Comment 33 Martin Nordholts 2009-05-19 05:16:43 UTC
It looks like Gary currently is busy doing other things so I am afraid we'll have to postpone this until after the 0.1.0 release.

What remains to be done is to use the gnulib library in the same way M4 does it, see:
http://www.mail-archive.com/gegl-developer@lists.xcf.berkeley.edu/msg00582.html

and the messages before that.
Comment 34 geert jordaens 2010-07-26 13:56:37 UTC
Created attachment 166584 [details] [review]
Patch to fetch gnulib from git

To test :

save patch in work directory and create a fresh git clone of babl in work directory:

  git clone git://git.gnome.org/babl
  cd babl
  patch -p1 <../gnulib.patch
  ./autogen.sh --force
  make
Comment 35 André Klapper 2012-02-14 09:25:46 UTC
[Setting QA Contact to 'bugs at gegl.org' so people interested in following GEGL bug reports' changes can still follow if the assignee changes to a real person.]
Comment 36 Daniel Sabo 2013-10-08 08:55:45 UTC
There are still some patches in here, are they still necessary?
Comment 37 Dagobert Michelsen 2014-02-05 10:43:28 UTC
Why has the status been changed to "RESOLVED OBSOLETE" ?
Comment 38 Daniel Sabo 2014-02-05 10:56:18 UTC
Because it's been NEEDINFO for 4 months after asking if these patches were still necessary. The configure scripts have changed a lot since this bug was filed so it seems likely that the issues were addressed outside of the bug.