[pacman-dev] makepkg misses to export variables

Dan McGee dpmcgee at gmail.com
Wed May 16 21:16:22 EDT 2007


On 5/16/07, Mateusz Jedrasik <m.jedrasik at gmail.com> wrote:
> Wednesday 16 of May 2007 19:12:22 Dan McGee napisał(a):
> > On 5/16/07, Andreas Radke <a.radke at arcor.de> wrote:
> > > Am Wed, 16 May 2007 12:03:29 -0400
> > >
> > > schrieb "Dan McGee" <dpmcgee at gmail.com>:
> > > > Export is ONLY needed if a new process is started with the callers
> > > > environment. This occurs during calls to ./configure and make, but NOT
> > > > within the PKGBUILD.
> > >
> > > therefore we need to export the MAKEFLAGS and DISTCC_HOST. anything
> > > else should be safe without an export call. i could confirm that both
> > > variables are not working properly. -j4 falls back to -j1 and distcc is
> > > not working without.
> > >
> > > would you prefer to export them in the makepkg.conf or
> > > in /usr/bin/makepkg ?
> >
> > Seriously? Anyway, here is a patch. We wouldn't export half the
> > variables in one place and half elsewhere:
> >
> > Index: scripts/makepkg
> > ===================================================================
> > RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v
> > retrieving revision 1.72
> > diff -u -r1.72 makepkg
> > --- scripts/makepkg   28 Apr 2007 08:26:37 -0000      1.72
> > +++ scripts/makepkg   16 May 2007 17:10:36 -0000
> > @@ -862,9 +862,10 @@
> >       # use distcc if it is requested (check buildenv and PKGBUILD opts)
> >       if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" !=
> > "n" ]; then
> >               [ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH
> > +             export DISTCC_HOSTS
> >       elif [ "$(check_option distcc)" = "n" ]; then
> >               # if it is not wanted, clear the makeflags too
> > -             export MAKEFLAGS=""
> > +             MAKEFLAGS=""
> >       fi
> >
> >       # use ccache if it is requested (check buildenv and PKGBUILD opts)
> > @@ -874,7 +875,7 @@
> >
> >       # clear user-specified makeflags if requested
> >       if [ "$(check_option makeflags)" = "n" ]; then
> > -             export MAKEFLAGS=""
> > +             MAKEFLAGS=""
> >       fi
> >
> >       # build
> > @@ -884,9 +885,8 @@
> >       unset LC_ALL LC_MESSAGES LANG
> >       umask 0022
> >
> > -     # ensure CFLAGS and CXXFLAGS are used
> > -     export CFLAGS
> > -     export CXXFLAGS
> > +     # ensure all necessary build variables are exported
> > +     export CFLAGS CXXFLAGS MAKEFLAGS
> >
> >       #check for "exit on syntax error" shell option
> >       echo $SHELLOPTS | grep errexit 2>&1 >/dev/null
> >
> > _______________________________________________
> > pacman-dev mailing list
> > pacman-dev at archlinux.org
> > http://archlinux.org/mailman/listinfo/pacman-dev
>
> I concur with the threads severity, on my system I neither get my
> CFLAGS/CPPFLAGS nor MAKEFLAGS (-j3) exported.

Ummmm, CFLAGS would be a different issue, as they were already
exported by makepkg before we addresed the MAKEFLAGS not being
exported. I can verify on my builds that CFLAGS are respected. In
addition, CXXFLAGS is the variable used for C++ by makepkg.

-Dan


More information about the pacman-dev mailing list