Browse Source

Clifford Wolf:


			
			
				rocklinux
			
			
		
Clifford Wolf 20 years ago
parent
commit
9af6d34518
6 changed files with 104 additions and 3 deletions
  1. +1
    -0
      Documentation/Developers/PKG-BUILD-VARS
  2. +63
    -0
      misc/tools-source/so2a_wrapper.sh
  3. +3
    -0
      package/base/alsa/alsa.conf
  4. +3
    -0
      package/x11/xfree86/xfree86.conf
  5. +30
    -3
      scripts/Build-Pkg
  6. +4
    -0
      scripts/Build-Tools

+ 1
- 0
Documentation/Developers/PKG-BUILD-VARS

@ -66,6 +66,7 @@ taropt ........ tar options for extracting
createprefix .. '0' = skip creation for directory skeleton for $prefix
createdocs .... '0' = skip automatic copying of documentation files
autoso2a ...... '1' = automatically create *.a files for all *.so files
custmain ...... command to execute instead of 'configure, make, make install'
mainfunction .. alternate main function instead of build_this_package()

+ 63
- 0
misc/tools-source/so2a_wrapper.sh

@ -0,0 +1,63 @@
#!/bin/bash
# run the original command
"$@"; rc=$?
if [ -n "$AUTOSO2A_DIR" ] && \
[[ "$*" == *" -shared "* ]]
then
mkdir -p "$AUTOSO2A_DIR"
{
echo "--"; echo "$0 $*"; shift
arname="a.out"; objs=""; del=""
while [ "$#" -gt 0 ]
do
case "$1" in
-o)
arname="${2##*/}"; shift
;;
[^-]*.o|[^-]*.lo)
if [ -f $1 ]; then
echo "Add object: $1"
objs="$objs $1"
else
echo "$0: Don't know how to handle $1 .." >&2
echo "Don't know how to handle $1 .."
fi
;;
[^-]*.a|[^-]*.al)
if [ -f $1 ]; then
echo "Add archive: $1"
tmpdir=$( mktemp -d ); del="$del $tmpdir"
( cd $tmpdir; ar x /dev/fd/0; ) < $1
for x in $tmpdir/*; do
[ -f $x ] || continue
echo " - $x"; objs="$objs $x"
done
else
echo "$0: Don't know how to handle $1 .." >&2
echo "Don't know how to handle $1 .."
fi
;;
[^-]*)
echo "$0: Don't know how to handle $1 .." >&2
echo "Don't know how to handle $1 .."
;;
esac
shift
done
[[ "$arname" == *.so* ]] && arname="${arname%.so*}.a"
echo "Output file: $arname"
rm -f "$AUTOSO2A_DIR/$arname"
if ! $AUTOSO2A_AR q "$AUTOSO2A_DIR/$arname" $objs 2>&1; then
echo "$0: Got an error while running $AUTOSO2A_AR .." >&2
fi
$AUTOSO2A_RANLIB "$AUTOSO2A_DIR/$arname"
} >> "$AUTOSO2A_DIR/so2a_wrapper.log"
fi
exit $rc

+ 3
- 0
package/base/alsa/alsa.conf

@ -79,3 +79,6 @@ EOT
autoextract=0
custmain="pkg_alsa_main"
# auto-create missing *.a files
autoso2a=1

+ 3
- 0
package/x11/xfree86/xfree86.conf

@ -88,3 +88,6 @@ fi
# don't put the modules in a :dev package
splitreg 45 . '/lib/modules/'
# auto-create missing *.a files
autoso2a=1

+ 30
- 3
scripts/Build-Pkg

@ -525,7 +525,7 @@ taropt="--use-compress-program=bzip2 -xf"
mainfunction="build_this_package"
runconf=1 ; runxmkmf=1 ; runmkpl=1 ; runpysetup=1 ; autopatch=1
autoextract=1 ; chownsrcdir=1 ; nocvsinsrcdir=1; patchopt="-bfp1 -z .orig"
createprefix=1 ; createdocs="" ; rmemptydir=""
createprefix=1 ; createdocs="" ; rmemptydir="" ; autoso2a=0
check_shared=1
check_usrlocal=1
@ -692,6 +692,13 @@ elif [ "$ROCKCFG_FLIST" = "find" ] ; then
sleep 2
fi
if [ $stagelevel -gt 1 -a "$autoso2a" = 1 ]; then
export AUTOSO2A_DIR="$builddir/autoso2a"
export AUTOSO2A_AR="$AR" AUTOSO2A_RANLIB="$RANLIB"
var_insert CC_WRAPPER_OTHERS ":" "so2a_wrapper"
var_insert CXX_WRAPPER_OTHERS ":" "so2a_wrapper"
fi
hook_eval prepare
# define new abort function for errors while building
@ -843,13 +850,33 @@ abort() {
then : ; fi
fi
# evaluate flistdel (1/2)
egrep -v "^($flistdel|var/adm/.*)\$" $builddir/flist.txt | sort -u > $builddir/flist.txt.new
mv $builddir/flist.txt.new $builddir/flist.txt
# copy over missing *.a files
if [ "$autoso2a" = 1 ]; then
echo "Checking for missing .a files ..."
while read d s; do
grep -q "/${s%.so}.a$" $builddir/flist.txt && continue
[ "$d" = "lib" ] && d="usr/lib"
if [ -f "$AUTOSO2A_DIR/${s%.so}.a" ]; then
echo "Installing automatically created $d/${s%.so}.a."
cp "$AUTOSO2A_DIR/${s%.so}.a" "$root/$d/${s%.so}.a"
add_flist "$root/$d/${s%.so}.a"
else
echo "Not found: $AUTOSO2A_DIR/${s%.so}.a"
fi
done < <( egrep '(^|/)lib/[^/]*\.so$' $builddir/flist.txt | sed 's,\(.*\)/,\1 ,' )
fi
# merge flist of previous build
for x in var/adm/flists/$xpkg var/adm/flists/$xpkg:*; do
[ -f $x ] && cut -f2- -d' ' $x >> $builddir/flist.txt
done
# evaluate flistdel
egrep -v "^($flistdel|var/adm/.*)\$" $builddir/flist.txt > $builddir/flist.txt.new
# evaluate flistdel (2/2)
egrep -v "^($flistdel|var/adm/.*)\$" $builddir/flist.txt | sort -u > $builddir/flist.txt.new
mv $builddir/flist.txt.new $builddir/flist.txt
hook_eval postflist

+ 4
- 0
scripts/Build-Tools

@ -238,6 +238,10 @@ EOT
# Various small tools
#
echo_status "Building $toolsdir/bin/so2a_wrapper."
cp misc/tools-source/so2a_wrapper.sh build/$ROCKCFG_ID/ROCK/$toolsdir/bin/so2a_wrapper
chmod +x build/$ROCKCFG_ID/ROCK/$toolsdir/bin/so2a_wrapper
#
for x in getdu getfiles fl_wrparse fl_stparse descparser; do
echo_status "Building $toolsdir/bin/$x."
$BUILDCC -Wall -O2 misc/tools-source/$x.c \

Loading…
Cancel
Save