#!/bin/sh olib=/usr/lib nlib=/usr/lib/aout fixlib() { dir=$1 shift crt=$1 shift if [ ! -f $olib/$crt ]; then if [ ! -f $nlib/$crt ]; then echo "Warning: Can't find $crt" >&2 else for i in "$@" do sed "s:$olib/$crt:$nlib/$crt:" $dir/$i >$dir/$i.tmp && mv -f $dir/$i.tmp $dir/$i || exit 1 done fi fi } # # Create tcc aout environment. # mkdir $WRKSRC/src/lib/env/freebsd/aout mkdir $WRKSRC/src/lib/env/freebsd/aout/80x86 # Create $WRKSRC/src/lib/env/freebsd/aout/80x86/K-P5 cat >$WRKSRC/src/lib/env/freebsd/aout/80x86/K-P5 <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-aout <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-PIC <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-frame <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-i386 <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-i486 <$WRKSRC/src/lib/env/freebsd/aout/80x86/K-noframe <$WRKSRC/src/lib/env/freebsd/aout/80x86/Z-p <$WRKSRC/src/lib/env/freebsd/aout/80x86/Z-p1 <$WRKSRC/src/lib/env/freebsd/aout/80x86/Z-p2 <$WRKSRC/src/lib/env/freebsd/aout/80x86/Z-p4 <$WRKSRC/src/lib/env/freebsd/aout/80x86/default.extra <$WRKSRC/src/lib/env/freebsd/aout/80x86/tcc_diag <SYS_LIB "-static -lg" EOF # Create $WRKSRC/src/lib/env/freebsd/aout/80x86/tcc_prof cat >$WRKSRC/src/lib/env/freebsd/aout/80x86/tcc_prof <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-P5 <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-aout <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-frame <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-i386 <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-i486 <$WRKSRC/src/lib/env/freebsd/elf/80x86/K-noframe <$WRKSRC/src/lib/env/freebsd/elf/80x86/Z-p <$WRKSRC/src/lib/env/freebsd/elf/80x86/Z-p1 <$WRKSRC/src/lib/env/freebsd/elf/80x86/Z-p2 <$WRKSRC/src/lib/env/freebsd/elf/80x86/Z-p4 <$WRKSRC/src/lib/env/freebsd/elf/80x86/default.extra <$WRKSRC/src/lib/env/freebsd/elf/80x86/system <$WRKSRC/src/lib/env/freebsd/elf/80x86/system+ <INCL "-Nsystem1:-MACHDIR-/include -Nsystem:/usr/include" +FLAG "-D__FREEBSD_USE_ELF" +FLAG "-f-MACHDIR-/startup/system.h" +FLAG "-Y32bit" +FLAG_TRANS "-B0" >API_NAME "-Asystem1 -Asystem" >INFO "System@Headers" EOF # Create $WRKSRC/src/lib/env/freebsd/elf/80x86/tcc_diag cat >$WRKSRC/src/lib/env/freebsd/elf/80x86/tcc_diag <SYS_LIB "-static -g" EOF # Create $WRKSRC/src/lib/env/freebsd/elf/80x86/tcc_prof cat >$WRKSRC/src/lib/env/freebsd/elf/80x86/tcc_prof <$WRKSRC/src/lib/env/freebsd/elf/80x86/tdf_ext <INFO "XANDF@Preliminary@Specification@(DRA-005@proposal)" EOF # # Fix aout environment for /usr/lib or /usr/lib/aout. # fixlib $WRKSRC/src/lib/env/freebsd/aout/80x86 crt0.o default.extra tcc_diag fixlib $WRKSRC/src/lib/env/freebsd/aout/80x86 gcrt0.o tcc_prof