On Di, 2008-11-25 at 13:12 +0100, Olav Sandstaa wrote:
> Hi Hakan,
>
> Thanks for reviewing the patch.
>
> See inline for response to your questions.
>
Ok to push!
> Hakan Kuecuekyilmaz wrote:
> > Olav,
> >
> > patch looks good. I have some questions; see inline.
> >
> > On So, 2008-11-23 at 22:02 +0000, Olav Sandstaa wrote:
> >
> >> === modified file 'storage/falcon/plug.in'
> >> --- a/storage/falcon/plug.in 2008-11-03 08:56:28 +0000
> >> +++ b/storage/falcon/plug.in 2008-11-23 22:02:22 +0000
> >> @@ -106,9 +106,6 @@
> >> )
> >> ])
> >>
> >> - CXXFLAGS=$ac_save_CXXFLAGS
> >> - AC_LANG_POP([C++])
> >> -
> >>
> >
> > * What is $ac_save_CXXFLAGS?
> > * What does AC_LANG_POP do?
> >
>
> When we enter Falcon's plug.in file we do the following two commands:
>
>
> AC_LANG_PUSH([C++])
> ac_save_CXXFLAGS="$CXXFLAGS"
>
> These are done in order to save away "the current language to be used by
> configure and replace this with C++" and for "saving the current value
> that teh CXXFLAGS variable has". The two commands you ask about above
> do the opposite. They restore the "current language to be used by
> configure" to whatever it was before and resets the value of CXXFLAGS to
> what it was before we started on Falcon's plug.in.
>
> >
> >> # Falcon uses exceptions and STL.
> >> CXXLDFLAGS="$CXXLDFLAGS $falcon_cxx_enable_stl"
> >> FALCON_CXXFLAGS="$falcon_cxx_no_invalid_offsetof
> $falcon_cxx_enable_implicit_templates $falcon_cxx_enable_exceptions"
> >> @@ -119,6 +116,34 @@
> >>
> >> AC_SUBST([FALCON_CXXFLAGS])
> >>
> >> + # Check that C++ exceptions works in an executable by actually running a
> >> + # compiled program and throwing and catching an exception
> >> + CXXFLAGS=$FALCON_CXXFLAGS
> >>
> >
> > What is the difference between $ac_save_CXXFLAGS and $FALCON_CXXFLAGS?
> >
> $ac_save_CXXFLAGS is the CXXFLAGS that configure used before reaching
> Falcon's plug.in. FALCON_CXXFLAGS are the extra C++ compiler flags that
> we want to use when compiling Falcon code.
>
> >
> >> + AC_CACHE_CHECK([if compiler and compiler options support C++ exceptions
> for Falcon],
> >> + falcon_supported_by_compiler,[
> >> + AC_TRY_RUN([
> >> + int main() {
> >> + try {
> >> + throw 1;
> >> + }
> >> + catch (int) {
> >> + return 0;
> >> + }
> >> + return -1;
> >> + }
> >> + ], falcon_supported_by_compiler="yes",
> >> + falcon_supported_by_compiler="no", )
> >> + ])
> >> +
> >> + if test "$falcon_supported_by_compiler" != "yes"; then
> >> + echo "Falcon must be compiled with support for C++ exceptions
> enabled."
> >> + echo "Please adjust your compiler flags or disable support for Falcon
> (--without-plugin-falcon)."
> >> + exit 1
> >> + fi
> >> +
> >> + CXXFLAGS=$ac_save_CXXFLAGS
> >> + AC_LANG_POP([C++])
> >>
> >
> > You moved the above two lines down. Does $ac_save_CXXFLAGS collects the
> > CXXFLAGS we need?
> No, it is the combination of CXXFLAGS and FALCON_CXXFLAGS that collects
> the C++ compiler flags we need for Falcon.
>
> The reason for moving these two lines down was that I needed to use
> CXXFLAGS and C++ when compiling the C++ code that I added to configure.
> And thus these two had to be restored to whatever values they had after
> my new code had been run.
>
> > I guess AC_LANG_POP() tells me that we are done with
> > [C++] tests?
> >
>
> Yes.
>
> Olav
>
--
Hakan Küçükyılmaz, Senior Software Engineer DBTG/MySQL +49 160
98953296
Sun Microsystems GmbH Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfang Engels, Dr. Roland Boemer
Vorsitz d. Aufs.rat.: Martin Haering HRB MUC 161028 49.011, 8.376