[omniORB-dev] Patch for supporting CFLAGS & Co env vars at configure time

Floris Bruynooghe floris.bruynooghe at gmail.com
Tue Dec 2 18:10:17 GMT 2008


Hi

A long while ago I was put off by the fact that when I try to use one
of the standard environment variables advertised by `configure -h' it
didn'tt work.  Since then I've seen more people on the list ask for
this too.  The current answer seems to be "edit CDEBUGFLAGS,
CXXDEBUGFLAGS in mk/beforeauto.mk.in, or use the CC/CXX env var".

However recently I discovered that making the default environment
variables work is actually really trivial.  This patch does so, it
only misses CXXCPP since the build system doesn't seem to have that
separate currently.  I've tried this patch with gcc builds on a
variety of Solaris, Debian and RHEL machines and so far haven't seen
any problems with it.

The reason the patch clears out the CDEBUGFLAGS and CXXDEBUGFLAGS is
because @CFLAGS@ and @CXXFLAGS@ seem to contain "-g -O2" by default
(but as soon as you supply a CFLAGS yourself that one overwrites the
default as you would expect).  If you think this will be a problem I'm
happy to look if this can be changed.


--- mk/beforeauto.mk.in	(revision 4243)
+++ mk/beforeauto.mk.in	(revision 4244)
@@ -85,11 +85,11 @@
                    -I$(TOP)/include -I$(BASE_OMNI_TREE)/include \
                    -D__OSVERSION__=@OSVERSION@

-CPPFLAGS = $(DIR_CPPFLAGS) $(IMPORT_CPPFLAGS)
+CPPFLAGS = @CPPFLAGS@ $(DIR_CPPFLAGS) $(IMPORT_CPPFLAGS)

-CFLAGS = $(CDEBUGFLAGS) $(COPTIONS) $(CPPFLAGS)
+CFLAGS = @CFLAGS@ $(CDEBUGFLAGS) $(COPTIONS) $(CPPFLAGS)

-CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(CPPFLAGS)
+CXXFLAGS = @CXXFLAGS@ $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(CPPFLAGS)


 #############################################################################
@@ -723,12 +723,12 @@
 #
 # Default compiler rules
 #
-CDEBUGFLAGS     = -O
+CDEBUGFLAGS     =
 CLINK           = $(CC)
-CLINKOPTIONS    = $(CDEBUGFLAGS) $(COPTIONS)
-CXXDEBUGFLAGS   = -O2
+CLINKOPTIONS    = @LDFLAGS@ $(CDEBUGFLAGS) $(COPTIONS)
+CXXDEBUGFLAGS   =
 CXXLINK         = $(CXX)
-CXXLINKOPTIONS  = $(CXXDEBUGFLAGS) $(CXXOPTIONS)
+CXXLINKOPTIONS  = @LDFLAGS@ $(CXXDEBUGFLAGS) $(CXXOPTIONS)


 ###########################################################################


Hope this is useful
Floris

-- 
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org



More information about the omniORB-dev mailing list