Issue 98688 - configure.in munges CFLAGS and LDFLAGS
Summary: configure.in munges CFLAGS and LDFLAGS
Status: UNCONFIRMED
Alias: None
Product: Build Tools
Classification: Code
Component: configure (show other issues)
Version: OOo 3.0
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: https://www.pooryorick.com/secure/wik...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 20:58 UTC by pooryorick
Modified: 2017-05-20 11:27 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description pooryorick 2009-01-31 20:58:48 UTC
in configure.in, LDFLAGS and CFLAGS are not properly reset after test for X
libraries.  Here's a patch:


*************************************************
--- configure.in        2009-01-31 15:27:50 -05:00
+++ configure.in.new    2009-01-31 15:34:02 -05:00
@@ -4298,11 +4298,15 @@
    if test -z "$x_includes"; then
       AC_MSG_ERROR([No X includes found]) # Exit
    fi
+   x_cflags_save="$CFLAGS"
+   x_ldflags_save="$LDFLAGS"
    CFLAGS=$X_CFLAGS
    LDFLAGS="$X_LDFLAGS $X_LIBS"
    AC_CHECK_LIB(X11, XOpenDisplay, x_libs="-lX11 $X_EXTRA_LIBS",
[AC_MSG_ERROR([X Development libraries not found])])
    dnl Check if the XauDisposeAuth symbol is provided by libXau.
    AC_CHECK_LIB(Xau, XauDisposeAuth, XAU_LIBS="-lXau", [])
+   CFLAGS="$x_cflags_save"
+   LDFLAGS="$x_ldflags_save"
 else
    x_includes="no_x_includes"
    x_libraries="no_x_libraries"
*************************************************
Comment 1 rene 2009-02-02 07:30:14 UTC
This actually can be considered to be a feature. :)

See e.g. http://www.openoffice.org/issues/show_bug.cgi?id=98498.
It now works at the new place because the stuff for unusual/ancient X lib places
is already defined.
Comment 2 pooryorick 2009-02-02 10:19:07 UTC
Is it then a feature that later tests like openssl, hunspell, etc. fail because
user-supplied LDFLAGS have now been replaced by X_LDFLAGS?
Comment 3 rene 2009-02-02 18:36:43 UTC
no, but apparently no one saw that yet because no one needed user-LDFLAGS. What I
just was saying is that your patch as-is breaks configure for people with
ancient systems using /usr/X11R6/lib.

And the checks do work when the libs are in /usr/lib or somewhere else in lds
search path :)

Of course, one can argue that those system are no longer relevant, but...
Comment 4 pooryorick 2009-02-07 14:57:16 UTC
Rene, what have you been smoking? The correct response to this report is, "oh my
gosh, what a bonehead mistake!  We'll fix it right away!"
Comment 5 nstange 2010-01-24 15:50:23 UTC
It is even worse:
configure --help documents (among others) the environment variables 
CFLAGS, LDFLAGS, LIBS, CPPFLAGS, CXXFLAGS

Apart from the fact that they don't make into set_soenv.sh via AC_SUBST's, these
variables either aren't used at all (LIBS, CPPFLAGS, CXXFLAGS) by the dmake
makefiles or get overwritten here and there (CFLAGS, LDFLAGS).

This behaviour makes it very painful do build ooffice on a system with
non-standadrd locations, e.g. on solaris.
Comment 6 Stephan Bergmann 2010-01-25 08:22:27 UTC
It bugs me too (typically when trying to integrate external modules into the OOo
build system) that the OOo build system does not follow established conventions
for those environment/configure variables.
Comment 7 Martin Hollmichel 2010-03-08 15:29:46 UTC
gentlemen, what's the status of the patch ? Is it a valid on we can apply ?
Comment 8 Rob Weir 2013-03-11 14:59:16 UTC
I'm adding this comment to all open issues with Issue Type == PATCH.  We have 220 such issues, many of them quite old.  I apologize for that.  

We need your help in prioritizing which patches should be integrated into our next release, Apache OpenOffice 4.0.

If you have submitted a patch and think it is applicable for AOO 4.0, please respond with a comment to let us know.

On the other hand, if the patch is no longer relevant, please let us know that as well.

If you have any general questions or want to discuss this further, please send a note to our dev mailing list:  dev@openoffice.apache.org

Thanks!

-Rob
Comment 9 Marcus 2017-05-20 11:27:43 UTC
Reset assigne to the default "issues@openoffice.apache.org".