#!/usr/bin/awk -f

{
	if (match(VERSION, "2023_Lx5")) {
	    if (/BR2_TOOLCHAIN_EXTERNAL=/) {
	        print("BR2_TOOLCHAIN_BUILDROOT_CXX=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM=/) {
	        print("BR2_PACKAGE_HOST_GDB=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_PATH=/) {
	        print("BR2_PACKAGE_HOST_GDB_TUI=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GCC_8=/) {
	        print("BR2_PACKAGE_HOST_GDB_SIM=y\nBR2_GDB_VERSION_10=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_10=/) {
	        print("BR2_KERNEL_HEADERS_5_10=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=/) {
	        print("");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CXX=/) {
	        print("BR2_GCC_VERSION_10_X=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=/) {
	        print("");
	    }
	    else {
	        print($0);
	    }
	}
	else if (match(VERSION, "2023")) {
	    if (/BR2_TOOLCHAIN_EXTERNAL=/) {
	        print("BR2_TOOLCHAIN_BUILDROOT_CXX=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM=/) {
	        print("BR2_PACKAGE_HOST_GDB=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_PATH=/) {
	        print("BR2_PACKAGE_HOST_GDB_TUI=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GCC_8=/) {
	        print("BR2_PACKAGE_HOST_GDB_SIM=y\nBR2_GDB_VERSION_10=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=/) {
	        print("BR2_KERNEL_HEADERS_4_19=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=/) {
	        print("");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CXX=/) {
	        print("BR2_GCC_VERSION_10_X=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=/) {
	        print("");
	    }
	    else {
	        print($0);
	    }
	}
	else {
	    if (/BR2_TOOLCHAIN_EXTERNAL=/) {
	        print("BR2_TOOLCHAIN_BUILDROOT_GLIBC=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM=/) {
	        print("BR2_KERNEL_HEADERS_4_19=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_PATH=/) {
	        print("BR2_TOOLCHAIN_BUILDROOT_CXX=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GCC_8=/) {
	        print("BR2_PACKAGE_HOST_GDB=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_19=/) {
	        print("BR2_PACKAGE_HOST_GDB_TUI=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CUSTOM_GLIBC=/) {
	        print("BR2_PACKAGE_HOST_GDB_PYTHON=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_CXX=/) {
	        print("BR2_PACKAGE_HOST_GDB_SIM=y");
	    }
	    else if (/BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=/) {
	        print("");
	    }
	    else {
	        print($0);
	    }
	}
}