Files
harbour-core/harbour/bin/hb-mkslib.sh
Przemyslaw Czerpak c99ac3d297 2007-10-18 23:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-mkslib.sh
  * harbour/bin/pack_src.sh
    * updated for recent Viktor's modifications

  * harbour/source/rtl/oemansix.c
    ! added missing #include "hbpai.h"

  * harbour/include/Makefile
  + harbour/include/hbwince.h
  * harbour/include/hbrdddbf.h
  * harbour/include/hbrdddbt.h
  * harbour/include/hbdefs.h
  * harbour/include/hbsetup.h
  * harbour/include/hbrddcdx.h
  * harbour/include/hbrddfpt.h
  * harbour/contrib/xhb/hboutdbg.c
  * harbour/contrib/xhb/hbsyslog.c
  * harbour/contrib/xhb/xhbfunc.c
  * harbour/contrib/libct/ctnet.c
  * harbour/contrib/libct/files.c
  * harbour/contrib/libct/disk.c
  * harbour/contrib/libnf/getenvrn.c
  * harbour/contrib/win32/tprinter.c
  * harbour/contrib/win32/w32_ole.c
  * harbour/contrib/win32/w32_prn.c
  * harbour/contrib/odbc/odbc.c
  * harbour/source/pp/ppgen.c
  * harbour/source/rtl/diskspac.c
  * harbour/source/rtl/gtclip.c
  * harbour/source/rtl/fstemp.c
  * harbour/source/rtl/gtchrmap.c
  * harbour/source/rtl/oemansi.c
  * harbour/source/rtl/disksphb.c
  * harbour/source/rtl/fssize.c
  * harbour/source/rtl/hbffind.c
  * harbour/source/rtl/filesys.c
  * harbour/source/rtl/net.c
  * harbour/source/rtl/gtgui/gtdef.c
  * harbour/source/rtl/gtwvt/gtwvt.c
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/gtstd/gtstd.c
  * harbour/source/rtl/gtwin/gtwin.c
  * harbour/source/vm/Makefile
  * harbour/source/vm/mainwin.c
  * harbour/source/vm/dynlibhb.c
  + harbour/source/vm/mainwin/Makefile
  * harbour/source/common/Makefile
  * harbour/source/common/hbgete.c
  * harbour/source/common/hbver.c
  + harbour/source/common/hbwince.c
  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbdot/hbdot.prg
  * harbour/utils/hbver/hbverfix.c
    + added support for WinCE and PocketPC

  + harbour/make_xcemgw.sh
  + harbour/config/w32/cemgw.cf
  * harbour/bin/hb-mkslib.sh
  * harbour/bin/hb-func.sh
  * harbour/bin/postinst.sh
    + added support for CeGCC-MinGW32 port - those of you who want to
      create applications for WinCE on PockePC with ARM processors on
      Linux or MS-Windows can download from SF cegcc-mingw32ce port.
      User using RPM based Linux distribution for x86 CPUs can simply
      download cegcc-mingw32ce-0.50-1.i586.rpm and install it.
      The hb* scripts created by ./make_xcemgw.sh [tgz|gnu] are
      automatically updated to work with CeGCC-MinGW32 so later you
      can simply crate WinCE-ARM binaries using them as for native port.

     I'm waiting for users feedback. Please remember that I'm not Windows
     user and even this port was created without any Pocket machine.
     With Marek Paliwoda help I only tested that final applications are
     working using PocketPC emulator.
2007-10-18 21:55:39 +00:00

145 lines
3.9 KiB
Bash
Executable File

#!/bin/sh
[ "$BASH" ] || exec bash `which $0` ${1+"$@"}
#
# $Id$
#
# ---------------------------------------------------------------
# Copyright 2003 Przemyslaw Czerpak <druzus@polbox.com>
# simple script to build shared libraries from static ones and
# object files
#
# See doc/license.txt for licensing terms.
# ---------------------------------------------------------------
if [ -n "${HB_ARCHITECTURE}" ]
then
hb_arch="${HB_ARCHITECTURE}"
else
hb_arch=`uname -s | tr -d "[-]" | tr '[A-Z]' '[a-z]' 2>/dev/null`
fi
case "$hb_arch" in
*windows*|*mingw32*) hb_arch="w32" ;;
*dos) hb_arch="dos" ;;
*bsd) hb_arch="bsd" ;;
esac
case "$hb_arch" in
darwin) SLIB_EXT=".dylib" ;;
w32) SLIB_EXT=".dll" ;;
*) SLIB_EXT=".so" ;;
esac
NAME="${1%${SLIB_EXT}}"
LIB_NAME="${NAME##*/}"
DSTDIR="${NAME%${LIB_NAME}}"
[ -n "${DSTDIR}" ] || DSTDIR="./"
if [ $# -lt 2 ] || [ -z "${LIB_NAME}" ]
then
echo "usage: `basename $0` <target[${SLIB_EXT}]> [link options] src1.a .. srcN.a [obj1.o .. objN.o]"
exit 1
fi
shift
BASE=`echo ${LIB_NAME} | sed "s/\([^.-]*\)[.-][0-9.]*/\1/g"`
VERSION="${LIB_NAME#${BASE}}"
VERSION="${VERSION#[.-]}"
REVIS="${VERSION}"
MAJOR="${REVIS%%.*}"
REVIS="${REVIS#${MAJOR}}"
REVIS="${REVIS#.}"
MINOR="${REVIS%%.*}"
REVIS="${REVIS#${MINOR}}"
REVIS="${REVIS#.}"
REVIS="${REVIS%%.*}"
[ -n "${MAJOR}" ] || MAJOR=0
[ -n "${MINOR}" ] || MINOR=1
[ -n "${REVIS}" ] || REVIS=0
VERSION="${MAJOR}.${MINOR}.${REVIS}"
OTMPDIR="/tmp/hb-mkslib-$$"
dir=`pwd`
cleanup()
{
rm -fR "${OTMPDIR}"
}
trap cleanup EXIT &>/dev/null
rm -fR "${OTMPDIR}"
mkdir -p "${OTMPDIR}"
cd "${OTMPDIR}"
for f in $*
do
case "${f}" in
*.o)
if [ ! -r "${dir}/${f}" ]
then
echo "cannot read file: ${f}"
exit 1
fi
cp "${dir}/${f}" "${OTMPDIR}" || exit 1
;;
*.a)
if [ ! -r "${dir}/${f}" ]
then
echo "cannot read file: ${f}"
exit 1
fi
d="${f%.a}"
d="${f##*/}"
mkdir $d
cd $d
${CCPREFIX}ar -x "${dir}/${f}" || exit 1
cd ..
;;
*)
linker_options="${linker_options} ${f}"
;;
esac
done
OBJLST=`find . -name \*.o`
cd "${OTMPDIR}"
if [ "${SLIB_EXT}" = ".dylib" ]; then
FULLNAME="${BASE}.${VERSION}${SLIB_EXT}"
ld -r -o "${FULLNAME}.o" $OBJLST && \
${CCPREFIX}gcc -dynamiclib -install_name "${BASE}.${MAJOR}${SLIB_EXT}" \
-compatibility_version ${MAJOR}.${MINOR} -current_version ${VERSION} \
-flat_namespace -undefined warning -multiply_defined suppress -single_module \
-o "${FULLNAME}" "${FULLNAME}.o" ${linker_options} && \
cd "${dir}" && \
mv -f "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${FULLNAME}" && \
ln -sf "${FULLNAME}" "${DSTDIR}${BASE}.${MAJOR}${SLIB_EXT}" && \
ln -sf "${FULLNAME}" "${DSTDIR}${BASE}${SLIB_EXT}"
elif [ "${SLIB_EXT}" = ".dll" ]; then
FULLNAME="${LIB_NAME}${SLIB_EXT}"
if [ "$HB_COMPILER" = "cemgw" ]; then
SYSLIBS=" -lwininet -lws2"
else
SYSLIBS="-luser32 -lwinspool -lgdi32 -lcomctl32 -lcomdlg32 -lole32"
SYSLIBS="${SYSLIBS} -loleaut32 -luuid -lmpr -lwsock32 -lws2_32 -lmapi32"
fi
${CCPREFIX}gcc -shared -o "${FULLNAME}" $OBJLST ${linker_options} ${SYSLIBS} ${HB_DLLIBS} && \
cd "${dir}" && \
rm -f "${DSTDIR}${FULLNAME}" && \
mv -f "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${FULLNAME}"
else
#FULLNAME="${BASE}-${VERSION}${SLIB_EXT}"
#FULLNAME="${BASE}{SLIB_EXT}.${VERSION}"
FULLNAME="${LIB_NAME}${SLIB_EXT}"
${CCPREFIX}gcc -shared -o "${FULLNAME}" $OBJLST ${linker_options} ${L_USR} && \
cd "${dir}" && \
mv -f "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${FULLNAME}"
fi
stat="$?"
[ $stat != 0 ] && cd "${dir}" && rm -f "${DSTDIR}${FULLNAME}"
cleanup
exit "${stat}"