#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# 
# Filename: package/.../linux-header/linux-header.conf
# Copyright (C) 2006 - 2007 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
# 
# 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 as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---

# we overwrite lx_cpu here, since the headers are older than the linux26
# packages and do not have the combined powerpc arch for both 32/64bit ...
# lx_cpu=`echo $arch | arch2uname | sed -e s/mips64/mips/`

. $base/package/*/*/linux-conf.in

autopatch=0
createdocs=0

if atstage toolchain; then
	root="$sysroot"
fi

# patch
hook_add premake 2 "lx_patch"

# WARNING: HACK ALERT!
# change the timestamp of the headers to be newer than the currently installed
# ones to really install them
hook_add premake 8 "find include -type f -exec touch '{}' \;"

# and disable `make all` at the last-minute
hook_add premake 9 "export makeopt="

makeinstopt="$makeopt"
var_append makeinstopt ' ' "INSTALL_HDR_PATH=$root/$prefix"

# WARNING: preventing the removal of existing header files
# if we do not set those variables empty _all_ header files in /usr/include 
# are kindly removed!
var_append makeinstopt ' ' "oldheaders= unwanted="

var_append makeinstopt ' ' "headers_install"