Subject: -std=gnu99 in compiler wrappers
To: None <,>
From: Raymond Meyer <>
List: pkgsrc-users
Date: 02/10/2007 03:49:38
When building devel/glib2 on SPARC Solaris with native GCC, I get the following

In file included from /usr/include/sys/types.h:18,
                 from giounix.c:38:
/opt/gcc4/lib/gcc/sparc-sun-solaris2.10/4.1.1/include/sys/feature_tests.h:341:2: error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"

[] note: The real command line, after the pkgsrc wrapper, was:
/opt/pkg.obj/devel/glib2/work.e450/.gcc/bin/gcc -DHAVE_CONFIG_H -I. -I.. "-DG_LOG_DOMAIN=\"GLib\"" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION "-DPREFIX=\"/opt/pkg\"" "-DPKGLOCALEDIR=\"lib\"" "-DPKG_SYSCONFDIR=\"/opt/pkg/etc\"" -I/opt/pkg.obj/devel/glib2/work.e450/.buildlink/include -D_REENTRANT -D_PTHREADS -O -Wall -MT giounix.lo -MD -MP -MF .deps/giounix.Tpo -c giounix.c -fPIC -DPIC -o .libs/giounix.o -std=gnu99 -L/opt/pkg.obj/devel/glib2/work.e450/.buildlink/lib 

I believe the above error is related to -std=gnu99 compiler flag.
None of the Makefiles in package source specify -std=gnu99, however looking


I see the following lines

case $append_extra_args in
        $debug_log $wrapperlog "    ( append args: -std=gnu99 -I/opt/pkg.obj/devel/glib2/work.e450/.buildlink/include -L/opt/pkg.obj/devel/glib2/work.e450/.buildlink/lib"
        set -- "$@" -std=gnu99 -I/opt/pkg.obj/devel/glib2/work.e450/.buildlink/include -L/opt/pkg.obj/devel/glib2/work.e450/.buildlink/lib

My question is, why do pkgsrc wrappers append -std=gnu99?? Clearly this is
causing problems, it seems like pkgsrc wrappers are trying to be too clever
for their own good.