index af287d95d50bba19ba9f130fcf00ad95ee7fd416..8b98cb2290c7c370ea65a318b22d1ee17cba86f1 100755 (executable)
--- a/make.sh
+++ b/make.sh
_useposix=false
_useposix=false
+export CPCFLAGS="$CPCFLAGS"
+export CPLFLAGS="$CPLFLAGS"
+
###^^^^^^^^^^^###
### Functions ###
###___________###
###^^^^^^^^^^^###
### Functions ###
###___________###
echo "Environment variables:"
echo " CC C compiler binary"
echo " CFLAGS C compiler options"
echo "Environment variables:"
echo " CC C compiler binary"
echo " CFLAGS C compiler options"
+ echo " CPCFLAGS CPC compiler options"
+ echo " CPLFLAGS CPL linker options"
exit 2
}
exit 2
}
}
native_compile() {
}
native_compile() {
- "$_compiler" -legacy "$@"
+ "$_compiler" $CPCFLAGS -legacy "$@"
}
native_link() {
}
native_link() {
_outsystem="win32"
fi
shift
_outsystem="win32"
fi
shift
- "$_linker" -os "$_outsystem" -kernel Kernel -main Kernel -legacycodedir . -o "$_outexe" "$@"
+ "$_linker" $CPLFALGS -os "$_outsystem" -kernel Kernel -main Kernel -legacycodedir . -o "$_outexe" "$@"
fi
}
fi
}
}
cpfront_compile() {
}
cpfront_compile() {
- "$_compiler" -outcode CodeC -outsym SymC "$@"
+ "$_compiler" $CPCFLAGS -outcode CodeC -outsym SymC "$@"
}
cpfront_link() {
local _main="$1"
if $_docompile; then
cpfront_main_module "$@" > "${_main}.cp"
}
cpfront_link() {
local _main="$1"
if $_docompile; then
cpfront_main_module "$@" > "${_main}.cp"
- "$_compiler" -outcode CodeC -outsym SymC -main "${_main}.cp"
+ "$_compiler" $CPCFLAGS -outcode CodeC -outsym SymC -main "${_main}.cp"
fi
shift
if $_dolink; then
fi
shift
if $_dolink; then
done
local _cc_cflags=
case "$CC" in
done
local _cc_cflags=
case "$CC" in
- *gcc) _cc_cflags="-g -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-implicit-function-declaration" ;;
+ *gcc) _cc_cflags="-std=c89 -Wno-int-conversion -Wno-int-to-pointer-cast -Wno-incompatible-pointer-types -Wno-implicit-function-declaration" ;;
+ clang|clang-*) _cc_cflags="-std=c89 -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-logical-op-parentheses -Wno-bitwise-op-parentheses -Wno-pointer-sign -Wno-unused-value -Wno-return-type" ;;
+ *tcc) _cc_cflags="-std=c89 -w -fsigned-char" ;;
*) _cc_cflags="" ;;
esac
local _cpu_cflags=
*) _cc_cflags="" ;;
esac
local _cpu_cflags=
cygwin) _system_cflags="-liconv" ;;
*) _system_cflags="" ;;
esac
cygwin) _system_cflags="-liconv" ;;
*) _system_cflags="" ;;
esac
- "$CC" $_cc_cflags $_cpu_cflags $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list -lm -ldl -lffi $_system_cflags
+ "$CC" -g -D_XOPEN_SOURCE=700 $_cc_cflags $_cpu_cflags $CFLAGS -o "${_main}" -I "$_this/C" "$_this/C/SYSTEM.c" $_list -lm -ldl -lffi $_system_cflags
fi
}
fi
}