# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/uclibc/parse-config-9 # Copyright (C) 2004 - 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- if [ "$SDECFG_LIBC" == "uclibc" ]; then pkg_uclibc_dir=$base/package/base/uclibc if [ $pkg != "gettext" ]; then var_append flistdel "|" "usr/share/locale/locale.alias" fi # the most tipical fix is to config.sub # uclibc_fix_configsub() { local x; for x; do echo "uclibc_fix_configsub: adding uclibc_arch_target support to $x" cp -f $x $x.orig sed -e 's,\([-]\?linux\)-gnu\*,\1-gnu\* | \1-uclibc\*,g' $x.orig > $x diff -u $x.orig $x || true done } uclibc_auto_fix_configsub() { local f for f in . ./config ./support; do if [ -e $f/config.sub ]; then if ! grep -q '\-uclibc' $f/config.sub; then uclibc_fix_configsub $f/config.sub fi fi done } uclibc_findall_fix_configsub() { local f for f in `find . -name config.sub`; do uclibc_fix_configsub $f done } # TODO: what makes uclibc_fix_addcases different than uclibc_fix_configsub? uclibc_fix_addcases() { local file; for file; do echo "uclibc_fix_addcases: adding *-linux-uclibc* support to $file" cp -f $file $file.orig sed -i -e 's,\([^ ]*\)linux-gnu\*\(.*\)\([\)\\]\),\1linux-gnu* | \1linux-uclibc*\2\3,g' $file diff -u $file.orig $file || true done } uclibc_fix_addcases2() { local file; for file; do echo "uclibc_fix_addcases2: adding *-linux-uclibc* support to $file" cp -f $file $file.orig sed -i -e 's,\( *.*\)linux-gnu\*)\(.*\)\;\;$,\1linux-uclibc*)\2;;\n\1linux-gnu*)\2;;,g' \ -e 's,\( *.*\)linux-gnu\*)\(.*[^;][^;]\)$,\1linux-uclibc* \| \\\n\1linux-gnu*)\2,g' \ $file diff -u $file.orig $file || true done } # fix tipical locations hook_add postpatch 5 'uclibc_auto_fix_configsub' # and some others case "$pkg" in gcc) var_append extraconfopt ' ' '--enable-decimal-float=no' # TODO: gcc often does not build, we need at least libstdc++ atstage cross && hook_add preconf 9 "runconf=0 runmake=0" export ac_cv_header_fenv_h=no if ! atstage toolchain; then [ $arch = avr32 ] && hook_add preconf 8 "gcc_build_module libstdc++-v3" || hook_add preconf 8 "gcc_build_module libatomic libstdc++-v3" fi ;; apache|minicom|nmap|expat|libiconv) hook_add postpatch 6 'uclibc_findall_fix_configsub' ;; lzo) hook_add postpatch 6 'uclibc_fix_configsub autoconf/config.sub' ;; binutils) hook_add postpatch 4 'uclibc_fix_addcases ./bfd/config.bfd ./bfd/configure \ ./ld/configure.tgt' hook_add postpatch 5 'uclibc_fix_addcases2 ./gas/configure' ;; gdb) hook_add postpatch 4 'uclibc_fix_addcases ./bfd/config.bfd ./bfd/configure' ;; bdb) hook_add postpatch 6 'uclibc_fix_configsub ./dist/config.sub' ;; bdb33) hook_add postpatch 6 'uclibc_fix_configsub ./dist/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./dist/configure' ;; a2ps) hook_add postpatch 6 'uclibc_fix_configsub ./auxdir/config.sub' ;; pidentd) hook_add postpatch 6 'uclibc_fix_configsub ./aux/config.sub' ;; apollon) hook_add postpatch 6 'uclibc_fix_configsub ./admin/config.sub' ;; openldap) hook_add postpatch 6 'uclibc_fix_configsub ./contrib/ldapc++/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./build/config.sub' ;; pkgconfig) hook_add postpatch 6 'uclibc_fix_configsub ./configure' ;; libsigc++12) hook_add postpatch 6 'uclibc_fix_configsub ./scripts/config.sub' ;; libsigc++1) hook_add postpatch 6 'uclibc_fix_configsub ./scripts/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./scripts/ltconfig' ;; jasper) # jasper is autoextract=0 so postpatch is never evaluated hook_add preconf 6 'uclibc_fix_configsub ./acaux/config.sub' hook_add preconf 6 'uclibc_fix_configsub ./configure' hook_add preconf 6 'uclibc_fix_configsub ./aclocal.m4' ;; gdbm) hook_add postpatch 6 'uclibc_fix_configsub ./configure' ;; mono) hook_add postpatch 6 'uclibc_fix_configsub ./libgc/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./libgc/configure' hook_add postpatch 6 'uclibc_fix_configsub ./libgc/libtool.m4' ;; gsmlib) hook_add postpatch 6 'uclibc_fix_configsub ./configure' hook_add postpatch 6 'uclibc_fix_configsub ./aclocal.m4' hook_add postpatch 6 'uclibc_fix_configsub ./scripts/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./scripts/ltconfig' ;; libxml1|librep) hook_add postpatch 6 'uclibc_fix_configsub ./configure' hook_add postpatch 6 'uclibc_fix_configsub ./aclocal.m4' ;; fribidi) hook_add postpatch 6 'uclibc_fix_configsub ./configure' ;; rpm) hook_add postpatch 6 'uclibc_fix_configsub ./*/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./*/configure' hook_add postpatch 6 'uclibc_fix_configsub ./*/aclocal.m4' hook_add postpatch 6 'uclibc_fix_configsub ./*/*/config.sub' hook_add postpatch 6 'uclibc_fix_configsub ./*/*/configure' ;; libgd) hook_add postpatch 6 'uclibc_fix_configsub ./configure' hook_add postpatch 6 'uclibc_fix_configsub ./aclocal.m4' hook_add postpatch 6 'uclibc_fix_configsub ./config/config.sub' ;; device-mapper|lvm2) hook_add postpatch 6 'uclibc_fix_configsub ./autoconf/config.sub' ;; libdvbpsi3|a52dec) hook_add postpatch 6 'uclibc_fix_configsub ./autotools/config.sub' ;; libdvdcss|libmpeg2) hook_add postpatch 6 'uclibc_fix_configsub ./.auto/config.sub' ;; apr|apr-util|mpg123) hook_add postpatch 6 'uclibc_fix_configsub ./build/config.sub' ;; quotatool) hook_add postpatch 6 'uclibc_fix_configsub ./tools/config.sub' ;; glib) var_append GCC_WRAPPER_REMOVE ' ' '-Werror=format-nonliteral -Werror=format=2' ;; sysvinit|smartmontools) var_append GCC_WRAPPER_REMOVE ' ' '-fstack-protector*' #-strong' ;; psmisc|dropbear) var_append GCC_WRAPPER_REMOVE ' ' '-fstack-protector*' ;; ntp) var_append GCC_WRAPPER_REMOVE ' ' '-fstack-protector*' #-all' ;; grep) # sany check and correct undetected stack direction hook_add premake 5 "sed -i 's/STACK_DIRECTION 0/STACK_DIRECTION -1/' config.h" ;; diffutils|m4) hook_add premake 5 "sed -i 's/STACK_DIRECTION 0/STACK_DIRECTION -1/' lib/config.h" ;; # we can't built this packages yet, but need them for bootstrap cmake) custmain=true ;; esac # libintl case $pkg in binutils|cracklib|libelf|mine|pam|procps|util-linux|sysstat|subversion|tar) # glib) var_append GCC_WRAPPER_APPEND ' ' '-c?:-lintl' ;; esac if ! atstage toolchain && [ "`echo $confdir/*.patch.uclibc`" != "$confdir/*.patch.uclibc" ]; then var_append patchfiles ' ' "`echo $confdir/*.patch.uclibc`" fi fi