This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Adding configure flag
- From: Aurelio Remonda <aurelio dot remonda at tallertechnologies dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 21 Oct 2015 20:21:22 -0300
- Subject: Re: Adding configure flag
- Authentication-results: sourceware.org; auth=none
- References: <CANLsssspTRnapDeq7c0gcW+X=qbO9=zTxA5G+vZDzv07akiy9Q at mail dot gmail dot com> <CAH6eHdR+8mN3TB_MRN29nLdbP9JtHBofrpZs2eXYbOo6Q1P-9w at mail dot gmail dot com>
First of all, thank you so much for the quick reply! I still have some
questions if you don't mind! :)
On Wed, Oct 21, 2015 at 5:25 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> 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 new-opnt.cc.
>>
>> I was doing some research and i believe i need to edit configure.ac
>> 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
> libstdc++).
>> Do i need to make changes on the configure.ac 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
Ok but, that means that i will have to do configure and make on libstdc++
and then compile gcc? or just make the changes, the autoreconf and then
when i compile gcc the libstdc++ will be compiled with my changes?
>> On a related subject: right now, I've added the following line to the
>> libstdc++v3's configure.ac:
>>
>> GLIBCXX_ENABLE_NEW_OPNT_IF([no])
>>
>> Also, I added the following to libstdc++v3's acinclude.m4:
>>
>> AC_DEFUN([GLIBCXX_ENABLE_NEW_OPNT_IF], [
>> GLIBCXX_ENABLE(new-opnt-if,$1,,[enable if on new_opnt instead of while])
>> if test $enable_new_opnt_if = yes; then
>> AC_DEFINE(_GLIBCXX_NEW_OPNT_IF, 1,
>> [Define is new_opnt will be used instead of while.])
>> fi
>> AC_MSG_CHECKING([for enabled if])
>
> This message isn't very helpful.
This is just a test, the message is just for me for now.
>> AC_MSG_RESULT([$enable_new_opnt_if])
>> ])
>>
>> And on gcc top directory configure.ac:
>> [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 new-opnt.cc, 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/configure.ac
>
> Try using autoreconf, to make sure config.h.in is regenerated
> (although I think autoconf should do that anyway).
>
> Try either changing the default in libstdc++-v3/configure.ac or using
> --enable-new-opnt-if explicitly.
I did try it with --enable-new-opnt-if when i configure gcc, that should replace
the harcored "no" right?
> I hope if you're planning to propose this for inclusion in upstream
> GCC you'll give the option a more descriptive name.
--
Aurelio Remonda
Software Engineer
San Lorenzo 47, 3rd Floor, Office 5
CÃrdoba, Argentina
Phone: +54-351-4217888 / 4218211