This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding configure flag

On 21 October 2015 at 20:37, Aurelio Remonda wrote:
> Hi, im trying to add a configure flag to the libstdc++ for a feature
> I'm testing. This flag, if enabled, would define a C macro that I'd be
> using in
> I was doing some research and i believe i need to edit
> and acinclude.m4 on the libstdc++-v3 directory. Is this correct?
> I also need to run autoconf to regenerate the libstdc++-v3 configure
> script, right?

Yes. I use autoreconf to ensure all relevant files are regenerated
(using autoreconf doesn't work for all of GCC, but it does for

> Do i need to make changes on the file in the top gcc
> directory? Or can i create the flag and do the configure and make on
> the libstdc++-v3 directory so it's ready for when I compile all of
> gcc?

Just in libstdc++-v3

> On a related subject: right now, I've added the following line to the
> libstdc++v3's
> Also, I added the following to libstdc++v3's acinclude.m4:
>   GLIBCXX_ENABLE(new-opnt-if,$1,,[enable if on new_opnt instead of while])
>   if test $enable_new_opnt_if = yes; then
>         [Define is new_opnt will be used instead of while.])
>   fi
>   AC_MSG_CHECKING([for enabled if])

This message isn't very helpful.

>   AC_MSG_RESULT([$enable_new_opnt_if])
> ])
> And on gcc top directory
> [AS_HELP_STRING([--enable-new-opnt-if],
>     [enable if on new_opnt instead of while])],
> [], [enable_new_opnt_if=yes])
> AC_SUBST(enable_multilib)

That shouldn't be there.

That description of the option is useless to end users anyway. Instead
it should be documented in libstdc++-v3/doc/xml/manual/configure.xml

> As you can see, I've hardcoded this option as "yes" to test it.
> However, I can't seem to make it work: in, I still can't
> see the macro defined. Am I doing something wrong?

It looks like you've hardcoded it to no, in libstdc++-v3/

Try using autoreconf, to make sure is regenerated
(although I think autoconf should do that anyway).

Try either changing the default in libstdc++-v3/ or using
--enable-new-opnt-if explicitly.

I hope if you're planning to propose this for inclusion in upstream
GCC you'll give the option a more descriptive name.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]