|
|
#!/bin/sh # # This is the script that will build the executables and DLLs of Pliant # for Linux using a libc6 based distribution (Debian 2 or RedHat 5) # Copyright (C) 1983 - 1999 Hubert Tonneau hubert.tonneau@pliant.cx # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # version 2 along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
linkage="$1" model="_32BITS_" indian="_LOW_INDIAN_"
if [ "$1" = "root" ]; then pliant="$2" linkage="$3" elif [ -d $HOME/pliant/ ]; then pliant=$HOME/pliant/ elif [ -d /pliant/ ]; then pliant=/pliant/ elif [ -d /usr/share/pliant/ ]; then pliant=/usr/share/pliant/ elif [ -d /usr/local/pliant/ ]; then pliant=/usr/local/pliant/ else echo Could not find Pliant directory. exit 1 fi
binary_path="${pliant}binary/" compiler="gcc" linker="gcc" include_options="" compiler_options="-O2 -m486" debug0_options="-D_NOCHECK_ -fomit-frame-pointer -D_LISTING_" debug1_options="-D_NOCHECK_ -D_LISTING_" debug2_options="-D_CHECK_" link_options="-s" exe_options="-D_EXE_" dll_compile_options="-fPIC -D_DLL_" dll_link_options="-shared" context_options="-D_BYTECODE_ -D${model} -D${indian} -D_POSIX_API_ -D_GCC_" extra_options=""
os_kernel=`uname -s` if [ "${os_kernel}" = "FreeBSD" ]; then echo "You seem to be running FreeBSD." api_options="-D_FreeBSD_" compiler_options="-pthread -O2 -m486" elif [ "${os_kernel}" = "Linux" ]; then echo "You seem to be running Linux. Using make-linux-i386-gcc is recommended." api_options="-D_LINUX_" link_options="-ldl" elif [ "${os_kernel}" = "OpenBSD" ]; then echo "You seem to be running OpenBSD." linker="ld" api_options="-D_OpenBSD_" compiler_options="-pthread -O2 -m486" dll_link_options="-Bshareable" else echo "You seem to be running an unknown Posix compliant system." echo "Pliant will probably not work right out of the box on your system." api_options="-D_POSIX_" link_options="-lc" fi
if [ ! -d ${binary_path} ]; then mkdir -p $binary_path fi rm ${binary_path}/* 2>/dev/null
if [ "$linkage" = "dll" ]; then
echo "compiling Pliant loaders" $compiler $include_options $compiler_options $debug0_options -Dc_debugging_level=0 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug0.exe ${pliant}pliant/language/startup/loader.c $compiler $include_options $compiler_options $debug1_options -Dc_debugging_level=1 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug1.exe ${pliant}pliant/language/startup/loader.c $compiler $include_options $compiler_options $debug2_options -Dc_debugging_level=2 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug2.exe ${pliant}pliant/language/startup/loader.c echo "compiling Pliant DLL (debugging level 0)" $compiler $include_options $compiler_options $dll_compile_options $debug0_options -Dc_debugging_level=0 $context_options $api_options $extra_options -c -o ${binary_path}pliant-debug0.o ${pliant}pliant/install/pliant.c $linker $dll_link_options -o ${binary_path}pliant-debug0.so ${binary_path}pliant-debug0.o echo "compiling Pliant DLL (debugging level 1)" $compiler $include_options $compiler_options $dll_compile_options $debug1_options -Dc_debugging_level=1 $context_options $api_options $extra_options -c -o ${binary_path}pliant-debug1.o ${pliant}pliant/install/pliant.c $linker $dll_link_options -o ${binary_path}pliant-debug1.so ${binary_path}pliant-debug1.o echo "compiling Pliant DLL (debugging level 2)" $compiler $include_options $compiler_options $dll_compile_options $debug2_options -Dc_debugging_level=2 $context_options $api_options $extra_options -c -o ${binary_path}pliant-debug2.o ${pliant}pliant/install/pliant.c $linker $dll_link_options -o ${binary_path}pliant-debug2.so ${binary_path}pliant-debug2.o
else
# echo "compiling Pliant executable (debugging level 0)" # $compiler $include_options $compiler_options $debug0_options -Dc_debugging_level=0 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug0.exe ${pliant}pliant/install/pliant.c echo "compiling Pliant executable (debugging level 1)" $compiler $include_options $compiler_options $debug1_options -Dc_debugging_level=1 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug1.exe ${pliant}pliant/install/pliant.c # echo "compiling Pliant executable (debugging level 2)" # $compiler $include_options $compiler_options $debug2_options -Dc_debugging_level=2 $link_options $exe_options $context_options $api_options $extra_options -o ${binary_path}pliant-debug2.exe ${pliant}pliant/install/pliant.c
fi rm ${binary_path}*.o 2>/dev/null
|
|