stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r1078388 - in /stdcxx/branches/4.2.x: ./ etc/config/ etc/config/src/
Date Sat, 05 Mar 2011 23:27:47 GMT
Author: sebor
Date: Sat Mar  5 23:27:46 2011
New Revision: 1078388

URL: http://svn.apache.org/viewvc?rev=1078388&view=rev
Log:
2011-03-05  Martin Sebor  <sebor@apache.org>

	STDCXX-1052
	* GNUmakefile (MAKEFILE_IN): Added LIBM.
	* etc/config/makefile.common (LDLIBS): Replaced -lm with $(LIBM).
	* etc/config/GNUmakefile.cfg (LDFLAGS): Same.
	(config): Added a descriptive message to the generated vars.sh.
	* etc/config/src/libc_decl.sh: Repaced lib with libname and libopt,
	used LIBM, and avoided hardcoding -lc and -lm.
	* etc/config/sunpro.config: Added LIBM.
	* etc/config/acc.config: Same.
	* etc/config/reliant_cds.config: Same.
	* etc/config/mipspro.config: Same.
	* etc/config/gcc.config: Same.
	* etc/config/como.config: Same.
	* etc/config/icc.config: Same.
	* etc/config/osf_cxx.config: Same.
	* etc/config/vacpp.config: Same.
	* etc/config/eccp.config: Same.

Modified:
    stdcxx/branches/4.2.x/GNUmakefile
    stdcxx/branches/4.2.x/etc/config/GNUmakefile.cfg
    stdcxx/branches/4.2.x/etc/config/acc.config
    stdcxx/branches/4.2.x/etc/config/como.config
    stdcxx/branches/4.2.x/etc/config/eccp.config
    stdcxx/branches/4.2.x/etc/config/gcc.config
    stdcxx/branches/4.2.x/etc/config/icc.config
    stdcxx/branches/4.2.x/etc/config/makefile.common
    stdcxx/branches/4.2.x/etc/config/mipspro.config
    stdcxx/branches/4.2.x/etc/config/osf_cxx.config
    stdcxx/branches/4.2.x/etc/config/reliant_cds.config
    stdcxx/branches/4.2.x/etc/config/src/libc_decl.sh
    stdcxx/branches/4.2.x/etc/config/sunpro.config
    stdcxx/branches/4.2.x/etc/config/vacpp.config

Modified: stdcxx/branches/4.2.x/GNUmakefile
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/GNUmakefile?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/GNUmakefile (original)
+++ stdcxx/branches/4.2.x/GNUmakefile Sat Mar  5 23:27:46 2011
@@ -121,6 +121,10 @@
 #
 #   DEPENDDIR - the subdirectory where dependency files will reside
 #
+#   LIBM      - the linker option to link with the math library
+#               (typically -lm, may be unnecessary or not even exist
+#               on some systems) 
+#
 #   LIBNAME   - full name of the library being built
 #
 #   LIBVER    - library version number in the <major>.<minor>.<micro> format
@@ -600,6 +604,11 @@ endef   # make-builddir
 
 
 # create $(MAKEFILE_IN)
+#
+# NOTE: adding a new variable here that is used by the configuration
+#       machinery requires replacing $BUILDDIR/$(MAKEFILE_IN) as well
+#       as $BUILDDIR/include/vars.sh generated from this file and
+#       used by the libc_decl.sh script
 $(MAKEFILE_IN): $(configpath)
 	@(   $(make-builddir);                                              \
              echo "generating $(MAKEFILE_IN) from $(configpath)"            \
@@ -625,6 +634,7 @@ $(MAKEFILE_IN): $(configpath)
           && echo "LDFLAGS    = $(LDFLAGS)"              >> $(MAKEFILE_IN)
 \
           && echo "LDLIBS     = $(LDLIBS)"               >> $(MAKEFILE_IN)
 \
           && echo "LDSOFLAGS  = $(LDSOFLAGS)"            >> $(MAKEFILE_IN)
 \
+          && echo "LIBM       = $(LIBM)"                 >> $(MAKEFILE_IN)
 \
           && echo "MAPFLAGS   = $(MAPFLAGS)"             >> $(MAKEFILE_IN)
 \
           && echo "RPATH      = $(RPATH)"                >> $(MAKEFILE_IN)
 \
           && [ "$(MAPFILE)" = "" ]                                          \
@@ -652,7 +662,7 @@ $(MAKEFILE_IN): $(configpath)
           && echo "CADVISEFLAGS = $(CADVISEFLAGS)"       >> $(MAKEFILE_IN)
 \
           && echo "WITH_PURIFY = $(WITH_PURIFY)"         >> $(MAKEFILE_IN)
 \
           && echo "PURIFYFLAGS = $(PURIFYFLAGS)"         >> $(MAKEFILE_IN)
 \
-          && echo "CXX_REPOSITORY = $(CXX_REPOSITORY)"	 >> $(MAKEFILE_IN));
+          && echo "CXX_REPOSITORY = $(CXX_REPOSITORY)"   >> $(MAKEFILE_IN));
 
 # creates the build directory tree and generates makefile.in
 builddir: $(MAKEFILE_IN)

Modified: stdcxx/branches/4.2.x/etc/config/GNUmakefile.cfg
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/GNUmakefile.cfg?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/GNUmakefile.cfg (original)
+++ stdcxx/branches/4.2.x/etc/config/GNUmakefile.cfg Sat Mar  5 23:27:46 2011
@@ -87,7 +87,7 @@ endif
 
 # append $(LDLIBS) last, after $(LDOPTS), since the latter may depend
 # on the former being after it on the link line
-LDFLAGS     += -lm $(LDLIBS)
+LDFLAGS     += $(LIBM) $(LDLIBS)
 
 # CXXPRELINK - command for compilers that use template
 #              instantiation models that require a prelink stage
@@ -186,11 +186,13 @@ config: clean sane 
                   targets="$$file$(LIBSUFFIX)" ;                            \
               elif [ `echo $$file | grep "\.sh"` ] ; then                   \
                   if [ ! -f vars.sh ] ; then                                \
-                      cat ../makefile.in                                    \
+                      echo "# generated from makefile.in on `date` " >      \
+                          vars.sh                                           \
+                      &&  cat ../makefile.in                                \
                       | sed -e "s/= *\([^ ][^ ]* .*\)/=\"\1\"/"             \
                             -e "s/^\( *[^=]*\.[^=]*=.*\)/# \1/"             \
                             -e "s/^\([^ ]*\) *= *\(.*\)/\1=\2 ; export \1/" \
-                            -e 's/$$(\([^)]*\))/${\1}/g' >vars.sh ;         \
+                            -e 's/$$(\([^)]*\))/${\1}/g' >>vars.sh ;        \
                   fi ;                                                      \
                   $(SRCDIR)/$$file config.h $(LOGFILE) ;                    \
                   echo ;                                                    \

Modified: stdcxx/branches/4.2.x/etc/config/acc.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/acc.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/acc.config (original)
+++ stdcxx/branches/4.2.x/etc/config/acc.config Sat Mar  5 23:27:46 2011
@@ -148,6 +148,9 @@ endif
 # The flag(s) to use to embed a library search path into generated executables.
 RPATH = -Wl,+b
 
+# math library to link with
+LIBM = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g +d
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/como.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/como.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/como.config (original)
+++ stdcxx/branches/4.2.x/etc/config/como.config Sat Mar  5 23:27:46 2011
@@ -49,6 +49,9 @@ PRELINKFLAGS    = --prelink_objects
 # Appropriate flag(s) (if available) not determined at this time.
 RPATH =
 
+# math library to link with
+LIBM = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/eccp.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/eccp.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/eccp.config (original)
+++ stdcxx/branches/4.2.x/etc/config/eccp.config Sat Mar  5 23:27:46 2011
@@ -76,6 +76,9 @@ AS_EXT = .
 # Appropriate flag(s) (if available) not determined at this time.
 RPATH =
 
+# math library to link with
+LIBM = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/gcc.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/gcc.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/gcc.config (original)
+++ stdcxx/branches/4.2.x/etc/config/gcc.config Sat Mar  5 23:27:46 2011
@@ -212,6 +212,9 @@ ifeq ($(OSNAME),Darwin)
     endif
 endif
 
+# math library to link with
+LIBM = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/icc.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/icc.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/icc.config (original)
+++ stdcxx/branches/4.2.x/etc/config/icc.config Sat Mar  5 23:27:46 2011
@@ -68,6 +68,9 @@ endif
 # The flag(s) to use to embed a library search path into generated executables.
 RPATH           = -Wl,-R
 
+# math library to link with
+LIBM            = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/makefile.common
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/makefile.common?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/makefile.common (original)
+++ stdcxx/branches/4.2.x/etc/config/makefile.common Sat Mar  5 23:27:46 2011
@@ -151,7 +151,7 @@ ifeq ($(findstring $(LIBNAME),$(TARGET))
   # set the GNU make variable LDLIBS to the names of the libraries
   # to link with (make puts $(LDLIBS) last on the link line in
   # implicit rules)
-  LDLIBS  := -l$(LIBBASE) $(LDLIBS) -lm
+  LDLIBS  := -l$(LIBBASE) $(LDLIBS) $(LIBM)
 endif  # ifneq ($(LIBNAME),$findstring ($(LIBNAME),$(TARGET)))
 
 

Modified: stdcxx/branches/4.2.x/etc/config/mipspro.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/mipspro.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/mipspro.config (original)
+++ stdcxx/branches/4.2.x/etc/config/mipspro.config Sat Mar  5 23:27:46 2011
@@ -67,6 +67,9 @@ AS_EXT = .s
 # The flag(s) to use to embed a library search path into generated executables.
 RPATH = -Wl,-rpath,
 
+# math library to link with
+LIBM            = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =

Modified: stdcxx/branches/4.2.x/etc/config/osf_cxx.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/osf_cxx.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/osf_cxx.config (original)
+++ stdcxx/branches/4.2.x/etc/config/osf_cxx.config Sat Mar  5 23:27:46 2011
@@ -48,7 +48,10 @@ CXX_REPOSITORY  = -ptr
 # The flag(s) to use to embed a library search path into generated executables.
 RPATH = -rpath 
 
-# debug/optimization options
+# math library to link with
+LIBM            = -lm
+
+# # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =
 

Modified: stdcxx/branches/4.2.x/etc/config/reliant_cds.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/reliant_cds.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/reliant_cds.config (original)
+++ stdcxx/branches/4.2.x/etc/config/reliant_cds.config Sat Mar  5 23:27:46 2011
@@ -37,7 +37,10 @@ LDFLAGS         =
 
 # The flag(s) to use to embed a library search path into generated executables.
 # Appropriate flag(s) (if available) not determined at this time.
-RPATH =
+RPATH           =
+
+# math library to link with
+LIBM            = -lm
 
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g

Modified: stdcxx/branches/4.2.x/etc/config/src/libc_decl.sh
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/src/libc_decl.sh?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/src/libc_decl.sh (original)
+++ stdcxx/branches/4.2.x/etc/config/src/libc_decl.sh Sat Mar  5 23:27:46 2011
@@ -68,7 +68,8 @@ fi
 
 [ -r vars.sh ] && . ./vars.sh
 
-# include headers.inc file
+# include headers.inc file with names of functions to test for
+# and the headers they are declared in
 . $TOPDIR/etc/config/src/headers.inc
 
 if [ ! -z "$4" ]; then
@@ -291,9 +292,18 @@ for h in $hdrs ; do
     fi
 
     if [ "$hdr_base" = "math" ] ; then
-        lib=m
+        # the name of the library as it should appear in script
+        # output/log and (after capitalization) in config macros
+        # (such as _RWSTD_NO_ACOS_IN_LIBM)
+        libname=libm
+        # the option to pass to the linker to link with the library
+        # (when necessary)
+        libopt=$LIBM
     else
-        lib=c
+        # libc is invariably implicitly specified by the compiler
+        # driver, there's no reason to specify it explicitly
+        libname=libc
+        unset libopt
     fi
 
     # float and long double versions of <math.h> functions
@@ -349,7 +359,7 @@ for h in $hdrs ; do
              "-DHDRNAME=\"<$hdrname>\" -DFUNNAME=$funname " \
              "-DFUN=$f -DTAKE_ADDR=$take_addr "             \
              "$tmpsrc -o $tmpobj"                           \
-             "&& $LD $tmpobj $LDFLAGS -l$lib" >>$logfile 2>&1
+             "&& $LD $tmpobj $LDFLAGS $libopt" >>$logfile 2>&1
 
         # spell out all arguments just like above, being careful
         # about quoting HDRNAME
@@ -357,7 +367,7 @@ for h in $hdrs ; do
                 -DHDRNAME="<$hdrname>" -DFUNNAME=$funname  \
                 -DFUN=$f -DTAKE_ADDR=$take_addr            \
              $tmpsrc -o $tmpobj >>$logfile 2>&1            \
-        && $LD $tmpobj $LDFLAGS -l$lib >>$logfile 2>&1
+        && $LD $tmpobj $LDFLAGS $libopt >>$logfile 2>&1
 
         if [ $? -eq 0 ] ; then
             echo "ok"
@@ -369,18 +379,18 @@ for h in $hdrs ; do
             echo "no ($sym)"
             echo "#define $sym" >>$output
 
-            sym="`echo ${sym}_IN_LIB$lib | $capitalize`"
+            sym="`echo ${sym}_IN_$libname | $capitalize`"
             
-            printf "%-50.50s " "checking for extern \"C\" $funname() in lib$lib"
+            printf "%-50.50s " "checking for extern \"C\" $funname() in $libname"
 
             # define cxxflags for convenience
             cxxflags="$CXXFLAGS $WARNFLAGS -DFUNNAME=$funname"
 
             echo "$CXX -c $cxxflags $tmpsrc -o $tmpobj \
-                 && $LD $tmpobj $LDFLAGS -l$lib" >>$logfile
+                 && $LD $tmpobj $LDFLAGS $libopt" >>$logfile
 
             $CXX -c $cxxflags $tmpsrc -o $tmpobj >>$logfile 2>&1 \
-            && $LD $tmpobj $LDFLAGS -l$lib >>$logfile 2>&1
+            && $LD $tmpobj $LDFLAGS $libopt >>$logfile 2>&1
 
             if [ $? -eq 0 ] ; then
                 echo "ok"

Modified: stdcxx/branches/4.2.x/etc/config/sunpro.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/sunpro.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/sunpro.config (original)
+++ stdcxx/branches/4.2.x/etc/config/sunpro.config Sat Mar  5 23:27:46 2011
@@ -71,7 +71,10 @@ AR              = CC
 ARFLAGS         = -xar -o
 
 # The flag(s) to use to embed a library search path into generated executables.
-RPATH = -R
+RPATH           = -R
+
+# math library to link with
+LIBM            = -lm
 
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g

Modified: stdcxx/branches/4.2.x/etc/config/vacpp.config
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/etc/config/vacpp.config?rev=1078388&r1=1078387&r2=1078388&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/etc/config/vacpp.config (original)
+++ stdcxx/branches/4.2.x/etc/config/vacpp.config Sat Mar  5 23:27:46 2011
@@ -170,6 +170,9 @@ else   # assume Linux
    RPATH = -Wl,-R
 endif
 
+# math library to link with
+LIBM            = -lm
+
 # debug/optimization options
 DEBUG_CXXFLAGS  = -g
 DEBUG_CPPFLAGS  =



Mime
View raw message