Changeset 2683


Ignore:
Timestamp:
Mar 21, 2006, 4:28:58 AM (19 years ago)
Author:
bird
Message:

Aliases and _STD.

Location:
trunk/libc
Files:
1 added
1 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/libc/Makefile.kmk

    r2681 r2683  
    3636        arithchk
    3737
    38 LIBRARIES = \
     38xLIBRARIES = \
    3939        msun \
    4040        glibc \
     
    4949INSTALLS = \
    5050        headers \
    51         startupobjs
     51        startupobjs \
     52        libc_alias
    5253
    5354#
     
    6869        IN_INNOTEK_LIBC \
    6970        __IN_INNOTEK_LIBC__
    70 
    71 
     71       
    7272#
    7373# The source files making up the libc part.
     
    17161716        $(foreach hdr, $(wildcard include/sys/*.h), $(hdr)=>$(subst include/,,$(hdr))) \
    17171717
    1718 
     1718                                                       
     1719#
     1720# libc_alias - The alias lib is special, see alias.kmk.
     1721#
     1722libc_alias_TEMPLATE = usr.lib
     1723libc_alias_SOURCES = \
     1724        $(PATH_TARGET)/libc_alias/libc_alias.a
     1725
     1726                                                       
     1727# Let kBuild generate rules.
    17191728include $(PATH_KBUILD)/footer.kmk
    17201729
    1721 
    1722 #
    1723 # Generate the STD wrappers.
    1724 #
    1725 $(PATH_TARGET)/libc-std.h:
    1726         > $@
    17271730
    17281731#
     
    17381741        $< $@
    17391742
     1743#
     1744# Generate the STD wrappers.
     1745#
     1746_STD_SOURCE_EXTRAS := \
     1747        src/msun/std-complex.c \
     1748        src/msun/std-math.c
     1749_STD_SOURCE_VARS := \
     1750        libclibc_SOURCES \
     1751        libclibc_SOURCES.$(BUILD_TARGET) \
     1752        libclibc_SOURCES.$(BUILD_TARGET_ARCH) \
     1753        libclibc_SOURCES.$(BUILD_TARGET_CPU) \
     1754        \
     1755        fbsdlibc_SOURCES \
     1756        fbsdlibc_SOURCES.$(BUILD_TARGET) \
     1757        fbsdlibc_SOURCES.$(BUILD_TARGET_ARCH) \
     1758        fbsdlibc_SOURCES.$(BUILD_TARGET_CPU) \
     1759        \
     1760        glibc_SOURCES \
     1761        glibc_SOURCES.$(BUILD_TARGET) \
     1762        glibc_SOURCES.$(BUILD_TARGET_ARCH) \
     1763        glibc_SOURCES.$(BUILD_TARGET_CPU) \
     1764        \
     1765        msun_SOURCES \
     1766        \
     1767        b_knix_os2_SOURCES \
     1768        b_knix_os2_SOURCES.$(BUILD_TARGET) \
     1769        b_knix_os2_SOURCES.$(BUILD_TARGET_ARCH) \
     1770        b_knix_os2_SOURCES.$(BUILD_TARGET_CPU)
     1771## @todo the backend must be removed!
     1772# We're creating a timestamp file early on in the build process.
     1773# (std-update is a phony target for doing this.)
     1774$(PATH_TARGET)/libc-std.ts std-update: $(foreach var, $(_STD_SOURCE_VARS), $($(var))) $(_STD_SOURCE_EXTRAS)
     1775        $(RM) -f $(PATH_TARGET)/libc-std.ts $(PATH_TARGET)/libc-std.files $(PATH_TARGET)/libc-std.tmp.h
     1776        $(foreach src, $^\
     1777                ,$(NL)$(TAB)@$(APPEND) $(PATH_TARGET)/libc-std.files "$(src)")
     1778        gawk -f ./mkstd.awk @$(PATH_TARGET)/libc-std.files > $(PATH_TARGET)/libc-std.tmp.h
     1779        if diff $(PATH_TARGET)/libc-std.tmp.h $(PATH_TARGET)/libc-std.h > /dev/null 2> /dev/null; then \
     1780                cp $(PATH_TARGET)/libc-std.tmp.h $(PATH_TARGET)/libc-std.h; \
     1781                echo "* libc-std.h updated"; \
     1782        else \
     1783                echo "* libc-std.h unchanged"; \
     1784        fi
     1785        $(APPEND) $(PATH_TARGET)/libc-std.ts done
     1786
     1787#
     1788# Create non-existing libc-std.h.
     1789#
     1790$(PATH_TARGET)/libc-std.h:
     1791        $(MAKE) std-update
     1792
     1793#
     1794# Generate the aliases.
     1795#
     1796$(PATH_TARGET)/libc_alias.a: $(PATH_TARGET)/libc-std.h
     1797        $(MAKE) -f alias.kmk libraries
     1798
  • trunk/libc/aliasbsdfuncs.awk

    r2668 r2683  
    44#
    55# ARG1: path to libc-std.h
    6 # ARG2: "" or "_".
    76#
    87
    98BEGIN {
    10   fn = ARGV [1]"libc-std.h";
    11   want_underscore = (ARGV [2] == "_");
     9  fn = ARGV [1];
    1210
    1311  while ((getline < fn) > 0)
     
    2624         fun2 = substr(fun2, 1, par - 1);
    2725
    28        print fun " " fun2 " "
     26       print fun "=" fun2 " "
    2927    }
    3028
  • trunk/libc/aliasfuncs.awk

    r2668 r2683  
    88
    99BEGIN {
    10   fn = ARGV [1]"libc-std.h";
     10  fn = ARGV [1];
    1111  want_underscore = (ARGV [2] == "_");
    1212
     
    2222      has_underscore = (substr(fun, 1, 1) == "_");
    2323      if (has_underscore == want_underscore)
    24         print has_underscore ? substr(fun, 2) : fun;
     24      {
     25        if (has_underscore)
     26           fun = substr(fun, 2);
     27        if (want_underscore)
     28          print "_" fun "=_std_" fun;
     29        else
     30          print "" fun "=_std_" fun;
     31      }
    2532    }
    2633
  • trunk/libc/aliasgnufuncs.awk

    r2668 r2683  
    88
    99BEGIN {
    10   fn = ARGV [1]"libc-std.h";
     10  fn = ARGV [1];
    1111  want_underscore = (ARGV [2] == "_");
    1212
     
    2626         fun2 = substr(fun2, 1, par - 1);
    2727
    28        print fun " " fun2 " "
     28       print fun "=" fun2 " "
    2929    }
    3030
Note: See TracChangeset for help on using the changeset viewer.