scripts/build/libc/uClibc.sh
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Jul 22 20:06:27 2010 +0200 (2010-07-22)
changeset 2033 ffc1121618fa
parent 2009 7e19c1de65cd
child 2036 67e02b48b595
permissions -rw-r--r--
libc/uClibc: do not install cross-ldd

I was unable to make the cross-ldd from uClibc to work, and
it is not possible to build it on non-POSIX system.

Besides, we have a generic script that is in the starting-blocks
to replace it, that will work for any C library, and also will
work on non-POSIX systems. Bonus!
     1 # This file declares functions to install the uClibc C library
     2 # Copyright 2007 Yann E. MORIN
     3 # Licensed under the GPL v2. See COPYING in the root of this package
     4 
     5 # Download uClibc
     6 do_libc_get() {
     7     libc_src="http://www.uclibc.org/downloads
     8               http://www.uclibc.org/downloads/snapshots
     9               http://www.uclibc.org/downloads/old-releases"
    10     # For uClibc, we have almost every thing: releases, and snapshots
    11     # for the last month or so. We'll have to deal with svn revisions
    12     # later...
    13     CT_GetFile "uClibc-${CT_LIBC_VERSION}" ${libc_src}
    14     # uClibc locales
    15     if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
    16         CT_GetFile "uClibc-locale-030818" ${libc_src}
    17     fi
    18 
    19     return 0
    20 }
    21 
    22 libc_uclibc_src_dir() {
    23     if [    -z "${CT_LIBC_V_snapshot}"      \
    24          -a -z "${CT_LIBC_V_specific_date}" \
    25        ]; then
    26         echo "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}"
    27     else
    28         echo "${CT_SRC_DIR}/uClibc"
    29     fi
    30 }
    31 
    32 # Extract uClibc
    33 do_libc_extract() {
    34     CT_Extract "uClibc-${CT_LIBC_VERSION}"
    35     # Don't patch snapshots
    36     if [    -z "${CT_LIBC_V_snapshot}"      \
    37          -a -z "${CT_LIBC_V_specific_date}" \
    38        ]; then
    39         CT_Patch "uClibc" "${CT_LIBC_VERSION}"
    40     fi
    41 
    42     # uClibc locales
    43     if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ]; then
    44         CT_Pushd "$(libc_uclibc_src_dir)/extra/locale"
    45         CT_Extract nochdir "uClibc-locale-030818"
    46         CT_Patch nochdir "uClibc" "locale-030818"
    47         CT_Popd
    48     fi
    49 
    50     return 0
    51 }
    52 
    53 # Check that uClibc has been previously configured
    54 do_libc_check_config() {
    55     CT_DoStep INFO "Checking C library configuration"
    56 
    57     CT_TestOrAbort "You did not provide a uClibc config file!" -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" -a -f "${CT_LIBC_UCLIBC_CONFIG_FILE}"
    58 
    59     if grep -E '^KERNEL_SOURCE=' "${CT_LIBC_UCLIBC_CONFIG_FILE}" >/dev/null 2>&1; then
    60         CT_DoLog WARN "Your uClibc version refers to the kernel _sources_, which is bad."
    61         CT_DoLog WARN "I can't guarantee that our little hack will work. Please try to upgrade."
    62     fi
    63 
    64     CT_DoLog EXTRA "Munging uClibc configuration"
    65     mungeuClibcConfig "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_CONFIG_DIR}/uClibc.config"
    66 
    67     CT_EndStep
    68 }
    69 
    70 # This functions installs uClibc's headers
    71 do_libc_headers() {
    72     local install_rule
    73     local cross
    74 
    75     CT_DoStep INFO "Installing C library headers"
    76 
    77     # Simply copy files until uClibc has the ability to build out-of-tree
    78     CT_DoLog EXTRA "Copying sources to build dir"
    79     CT_DoExecLog ALL cp -av "$(libc_uclibc_src_dir)"            \
    80                             "${CT_BUILD_DIR}/build-libc-headers"
    81     cd "${CT_BUILD_DIR}/build-libc-headers"
    82 
    83     # Retrieve the config file
    84     CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config
    85 
    86     # uClibc uses the CROSS environment variable as a prefix to the
    87     # compiler tools to use.  Setting it to the empty string forces
    88     # use of the native build host tools, which we need at this
    89     # stage, as we don't have target tools yet.
    90     # BUT! With NPTL, we need a cross-compiler (and we have it)
    91     if [ "${CT_THREADS}" = "nptl" ]; then
    92         cross="${CT_TARGET}-"
    93     fi
    94 
    95     CT_DoLog EXTRA "Applying configuration"
    96     CT_DoYes "" |CT_DoExecLog ALL               \
    97                  make CROSS="${cross}"          \
    98                  PREFIX="${CT_SYSROOT_DIR}/"    \
    99                  oldconfig
   100 
   101     CT_DoLog EXTRA "Building headers"
   102     CT_DoExecLog ALL                    \
   103     make ${CT_LIBC_UCLIBC_VERBOSITY}    \
   104          CROSS="${cross}"               \
   105          PREFIX="${CT_SYSROOT_DIR}/"    \
   106          headers
   107 
   108     if [ "${CT_LIBC_UCLIBC_0_9_30_or_later}" = "y" ]; then
   109         install_rule=install_headers
   110     else
   111         install_rule=install_dev
   112     fi
   113 
   114     CT_DoLog EXTRA "Installing headers"
   115     CT_DoExecLog ALL                    \
   116     make ${CT_LIBC_UCLIBC_VERBOSITY}    \
   117          CROSS="${cross}"               \
   118          PREFIX="${CT_SYSROOT_DIR}/"    \
   119          ${install_rule}
   120 
   121     if [ "${CT_THREADS}" = "nptl" ]; then
   122         CT_DoLog EXTRA "Building start files"
   123         CT_DoExecLog ALL                                    \
   124         make ${CT_LIBC_UCLIBC_PARALLEL:+${PARALLELMFLAGS}}  \
   125              CROSS="${cross}"                               \
   126              PREFIX="${CT_SYSROOT_DIR}/"                    \
   127              STRIPTOOL=true                                 \
   128              ${CT_LIBC_UCLIBC_VERBOSITY}                    \
   129              lib/crt1.o lib/crti.o lib/crtn.o
   130 
   131         # From:  http://git.openembedded.org/cgit.cgi/openembedded/commit/?id=ad5668a7ac7e0436db92e55caaf3fdf782b6ba3b
   132         # libm.so is needed for ppc, as libgcc is linked against libm.so
   133         # No problem to create it for other archs.
   134         CT_DoLog EXTRA "Building dummy shared libs"
   135         CT_DoExecLog ALL "${cross}gcc" -nostdlib        \
   136                                        -nostartfiles    \
   137                                        -shared          \
   138                                        -x c /dev/null   \
   139                                        -o libdummy.so
   140 
   141         CT_DoLog EXTRA "Installing start files"
   142         CT_DoExecLog ALL install -m 0644 lib/crt1.o lib/crti.o lib/crtn.o   \
   143                                          "${CT_SYSROOT_DIR}/usr/lib"
   144 
   145         CT_DoLog EXTRA "Installing dummy shared libs"
   146         CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libc.so"
   147         CT_DoExecLog ALL install -m 0755 libdummy.so "${CT_SYSROOT_DIR}/usr/lib/libm.so"
   148     fi # CT_THREADS == nptl
   149 
   150     CT_EndStep
   151 }
   152 
   153 # Build and install start files
   154 do_libc_start_files() {
   155     :
   156 }
   157 
   158 # This function build and install the full uClibc
   159 do_libc() {
   160     CT_DoStep INFO "Installing C library"
   161 
   162     # Simply copy files until uClibc has the ability to build out-of-tree
   163     CT_DoLog EXTRA "Copying sources to build dir"
   164     CT_DoExecLog ALL cp -av "$(libc_uclibc_src_dir)"    \
   165                             "${CT_BUILD_DIR}/build-libc"
   166     cd "${CT_BUILD_DIR}/build-libc"
   167 
   168     # Retrieve the config file
   169     CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config
   170 
   171     # uClibc uses the CROSS environment variable as a prefix to the compiler
   172     # tools to use.  The newly built tools should be in our path, so we need
   173     # only give the correct name for them.
   174     # Note about CFLAGS: In uClibc, CFLAGS are generated by Rules.mak,
   175     # depending  on the configuration of the library. That is, they are tailored
   176     # to best fit the target. So it is useless and seems to be a bad thing to
   177     # use LIBC_EXTRA_CFLAGS here.
   178     CT_DoLog EXTRA "Applying configuration"
   179     CT_DoYes "" |CT_DoExecLog ALL               \
   180                  make CROSS=${CT_TARGET}-       \
   181                  PREFIX="${CT_SYSROOT_DIR}/"    \
   182                  oldconfig
   183 
   184     # We do _not_ want to strip anything for now, in case we specifically
   185     # asked for a debug toolchain, thus the STRIPTOOL= assignment
   186     # /Old/ versions can not build in //
   187     CT_DoLog EXTRA "Building C library"
   188     CT_DoExecLog ALL                                    \
   189     make -j1                                            \
   190          CROSS=${CT_TARGET}-                            \
   191          PREFIX="${CT_SYSROOT_DIR}/"                    \
   192          STRIPTOOL=true                                 \
   193          ${CT_LIBC_UCLIBC_VERBOSITY}                    \
   194          pregen
   195     CT_DoExecLog ALL                                    \
   196     make ${CT_LIBC_UCLIBC_PARALLEL:+${PARALLELMFLAGS}}  \
   197          CROSS=${CT_TARGET}-                            \
   198          PREFIX="${CT_SYSROOT_DIR}/"                    \
   199          STRIPTOOL=true                                 \
   200          ${CT_LIBC_UCLIBC_VERBOSITY}                    \
   201          all
   202 
   203     # YEM-FIXME:
   204     # - we want to install 'runtime' files, eg. lib*.{a,so*}, crti.o and
   205     #   such files, except the headers as they already are installed
   206     # - "make install_dev" installs the headers, the crti.o... and the
   207     #   static libs, but not the dynamic libs
   208     # - "make install_runtime" installs the dynamic libs only
   209     # - "make install" calls install_runtime and install_dev
   210     # - so we're left with re-installing the headers... Sigh...
   211     #
   212     # We do _not_ want to strip anything for now, in case we specifically
   213     # asked for a debug toolchain, hence the STRIPTOOL= assignment
   214     #
   215     # Note: PARALLELMFLAGS is not usefull for installation.
   216     #
   217     CT_DoLog EXTRA "Installing C library"
   218     CT_DoExecLog ALL                    \
   219     make CROSS=${CT_TARGET}-            \
   220          PREFIX="${CT_SYSROOT_DIR}/"    \
   221          STRIPTOOL=true                 \
   222          ${CT_LIBC_UCLIBC_VERBOSITY}    \
   223          install
   224 
   225     CT_EndStep
   226 }
   227 
   228 # This function is used to install those components needing the final C compiler
   229 do_libc_finish() {
   230     :
   231 }
   232 
   233 # Initialises the .config file to sensible values
   234 # $1: original file
   235 # $2: munged file
   236 mungeuClibcConfig() {
   237     src_config_file="$1"
   238     dst_config_file="$2"
   239     munge_file="${CT_BUILD_DIR}/munge-uClibc-config.sed"
   240 
   241     # Start with a fresh file
   242     rm -f "${munge_file}"
   243     touch "${munge_file}"
   244 
   245     # Do it all in a sub-shell, it's easier to redirect output
   246     (
   247 
   248     # Hack our target in the config file.
   249     case "${CT_ARCH}:${CT_ARCH_BITNESS}" in
   250         x86:32)      arch=i386;;
   251         x86:64)      arch=x86_64;;
   252         sh:32)       arch="sh";;
   253         sh:64)       arch="sh64";;
   254         blackfin:32) arch="bfin";;
   255         *)           arch="${CT_ARCH}";;
   256     esac
   257     # Also remove stripping: its the responsibility of the
   258     # firmware builder to strip or not.
   259     cat <<-ENDSED
   260 		s/^(TARGET_.*)=y$/# \\1 is not set/
   261 		s/^# TARGET_${arch} is not set/TARGET_${arch}=y/
   262 		s/^TARGET_ARCH=".*"/TARGET_ARCH="${arch}"/
   263 		s/.*(DOSTRIP).*/# \\1 is not set/
   264 		ENDSED
   265 
   266     # Ah. We may one day need architecture-specific handler here...
   267     if [ "${CT_ARCH}" = "arm" ]; then
   268         # Hack the ARM {E,O}ABI into the config file
   269         if [ "${CT_ARCH_ARM_EABI}" = "y" ]; then
   270             cat <<-ENDSED
   271 				s/.*(CONFIG_ARM_OABI).*/# \\1 is not set/
   272 				s/.*(CONFIG_ARM_EABI).*/\\1=y/
   273 				ENDSED
   274         else
   275             cat <<-ENDSED
   276 				s/.*(CONFIG_ARM_OABI).*/\\1=y/
   277 				s/.*(CONFIG_ARM_EABI).*/# \\1 is not set/
   278 				ENDSED
   279         fi
   280     fi
   281 
   282     # Accomodate for old and new uClibc versions, where the
   283     # way to select between big/little endian has changed
   284     case "${CT_ARCH_BE},${CT_ARCH_LE}" in
   285         y,) cat <<-ENDSED
   286 				s/.*(ARCH_LITTLE_ENDIAN).*/# \\1 is not set/
   287 				s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
   288 				s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/# \\1 is not set/
   289 				s/.*(ARCH_WANTS_BIG_ENDIAN).*/\\1=y/
   290 				ENDSED
   291         ;;
   292         ,y) cat <<-ENDSED
   293 				s/.*(ARCH_LITTLE_ENDIAN).*/\\1=y/
   294 				s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
   295 				s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/\\1=y/
   296 				s/.*(ARCH_WANTS_BIG_ENDIAN).*/# \\1 is not set/
   297 				ENDSED
   298         ;;
   299     esac
   300 
   301     # Accomodate for old and new uClibc version, where the
   302     # way to select between hard/soft float has changed
   303     case "${CT_ARCH_FLOAT_HW},${CT_ARCH_FLOAT_SW}" in
   304         y,) cat <<-ENDSED
   305 				s/^[^_]*(HAS_FPU).*/\\1=y/
   306 				s/.*(UCLIBC_HAS_FPU).*/\\1=y/
   307 				ENDSED
   308             ;;
   309         ,y) cat <<-ENDSED
   310 				s/^[^_]*(HAS_FPU).*/\\# \\1 is not set/
   311 				s/.*(UCLIBC_HAS_FPU).*/# \\1 is not set/
   312 				ENDSED
   313             ;;
   314     esac
   315 
   316     # Change paths to work with crosstool-NG
   317     # From http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=16846&view=rev
   318     #  " we just want the kernel headers, not the whole kernel source ...
   319     #  " so people may need to update their paths slightly
   320     quoted_kernel_source=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/include/?$,,; s,/,\\/,g;')
   321     quoted_headers_dir=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/,\\/,g;')
   322     # CROSS_COMPILER_PREFIX is left as is, as the CROSS parameter is forced on the command line
   323     # DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX, wich is the correct value of ${PREFIX}/${TARGET}
   324     # Some (old) versions of uClibc use KERNEL_SOURCE (which is _wrong_), and
   325     # newer versions use KERNEL_HEADERS (which is right).
   326     cat <<-ENDSED
   327 		s/^DEVEL_PREFIX=".*"/DEVEL_PREFIX="\\/usr\\/"/
   328 		s/^RUNTIME_PREFIX=".*"/RUNTIME_PREFIX="\\/"/
   329 		s/^SHARED_LIB_LOADER_PREFIX=.*/SHARED_LIB_LOADER_PREFIX="\\/lib\\/"/
   330 		s/^KERNEL_SOURCE=".*"/KERNEL_SOURCE="${quoted_kernel_source}"/
   331 		s/^KERNEL_HEADERS=".*"/KERNEL_HEADERS="${quoted_headers_dir}"/
   332 		s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/
   333 		ENDSED
   334 
   335     if [ "${CT_USE_PIPES}" = "y" ]; then
   336         if grep UCLIBC_EXTRA_CFLAGS extra/Configs/Config.in >/dev/null 2>&1; then
   337             # Good, there is special provision for such things as -pipe!
   338             cat <<-ENDSED
   339 				s/^(UCLIBC_EXTRA_CFLAGS=".*)"$/\\1 -pipe"/
   340 				ENDSED
   341         else
   342             # Hack our -pipe into WARNINGS, which will be internally incorporated to
   343             # CFLAGS. This a dirty hack, but yet needed
   344             cat <<-ENDSED
   345 				s/^(WARNINGS=".*)"$/\\1 -pipe"/
   346 				ENDSED
   347         fi
   348     fi
   349 
   350     # Locales support
   351     # Note that the two PREGEN_LOCALE and the XLOCALE lines may be missing
   352     # entirely if LOCALE is not set.  If LOCALE was already set, we'll
   353     # assume the user has already made all the appropriate generation
   354     # arrangements.  Note that having the uClibc Makefile download the
   355     # pregenerated locales is not compatible with crosstool; besides,
   356     # crosstool downloads them as part of getandpatch.sh.
   357     if [ "${CT_LIBC_UCLIBC_LOCALES}" = "y" ] ; then
   358         cat <<-ENDSED
   359 			s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
   360 			UCLIBC_PREGENERATED_LOCALE_DATA=y\\
   361 			# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
   362 			# UCLIBC_HAS_XLOCALE is not set/
   363 			ENDSED
   364     fi
   365 
   366     # WCHAR support
   367     if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ] ; then
   368         cat <<-ENDSED
   369 			s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=y/
   370 			ENDSED
   371     else
   372         cat <<-ENDSED
   373 			s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=n/
   374 			ENDSED
   375     fi
   376 
   377     # Force on options needed for C++ if we'll be making a C++ compiler.
   378     # I'm not sure locales are a requirement for doing C++... Are they?
   379     if [ "${CT_CC_LANG_CXX}" = "y" ]; then
   380         cat <<-ENDSED
   381 			s/^# DO_C99_MATH is not set/DO_C99_MATH=y/
   382 			s/^# UCLIBC_CTOR_DTOR is not set/UCLIBC_CTOR_DTOR=y/
   383 			s/^# UCLIBC_HAS_GNU_GETOPT is not set/UCLIBC_HAS_GNU_GETOPT=y/
   384 			ENDSED
   385     fi
   386 
   387     # Push the threading model
   388     # Note: we take into account all of the .28, .29, .30 and .31
   389     #       versions, here. Even snapshots with NPTL.
   390     case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in
   391         none:)
   392             cat <<-ENDSED
   393 				s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
   394 				s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
   395 				s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
   396 				s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
   397 				ENDSED
   398             ;;
   399         linuxthreads:old)
   400             cat <<-ENDSED
   401 				s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
   402 				s/^# LINUXTHREADS_OLD is not set/LINUXTHREADS_OLD=y/
   403 				s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
   404 				s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
   405 				ENDSED
   406             ;;
   407         linuxthreads:new)
   408             cat <<-ENDSED
   409 				s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
   410 				s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
   411 				s/^# LINUXTHREADS_NEW is not set/LINUXTHREADS_NEW=y/
   412 				s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
   413 				ENDSED
   414             ;;
   415         nptl:)
   416             cat <<-ENDSED
   417 				s/^HAS_NO_THREADS=y/# HAS_NO_THREADS is not set/
   418 				s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
   419 				s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
   420 				s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
   421 				s/^# UCLIBC_HAS_THREADS_NATIVE is not set/UCLIBC_HAS_THREADS_NATIVE=y/
   422 				ENDSED
   423             ;;
   424         *)
   425             CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREAD}' CT_LIBC_UCLIBC_LNXTHRD='${CT_LIBC_UCLIBC_LNXTHRD}'"
   426             ;;
   427     esac
   428 
   429     # Always build the libpthread_db
   430     cat <<-ENDSED
   431 		s/^# PTHREADS_DEBUG_SUPPORT is not set.*/PTHREADS_DEBUG_SUPPORT=y/
   432 		ENDSED
   433 
   434     # Force on debug options if asked for
   435     case "${CT_LIBC_UCLIBC_DEBUG_LEVEL}" in
   436       0)
   437         cat <<-ENDSED
   438 			s/^DODEBUG=y/# DODEBUG is not set/
   439 			s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
   440 			s/^DOASSERTS=y/# DOASSERTS is not set/
   441 			s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
   442 			s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
   443 			s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
   444 			ENDSED
   445         ;;
   446       1)
   447         cat <<-ENDSED
   448 			s/^# DODEBUG is not set.*/DODEBUG=y/
   449 			s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
   450 			s/^DOASSERTS=y/# DOASSERTS is not set/
   451 			s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
   452 			s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
   453 			s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
   454 			ENDSED
   455         ;;
   456       2)
   457         cat <<-ENDSED
   458 			s/^# DODEBUG is not set.*/DODEBUG=y/
   459 			s/^# DODEBUG_PT is not set.*/DODEBUG_PT=y/
   460 			s/^# DOASSERTS is not set.*/DOASSERTS=y/
   461 			s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
   462 			s/^# SUPPORT_LD_DEBUG_EARLY is not set.*/SUPPORT_LD_DEBUG_EARLY=y/
   463 			s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
   464 			ENDSED
   465         ;;
   466     esac
   467 
   468     # And now, this is the end
   469     ) >>"${munge_file}"
   470 
   471     sed -r -f "${munge_file}" "${src_config_file}" >"${dst_config_file}"
   472 }