2002-05-05 15:56:15 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
#-- Name: distrib/mac/shared-ld-sh
|
|
|
|
#-- Purpose: Link a mach-o dynamic shared library for Darwin / Mac OS X
|
|
|
|
#-- Author: Gilles Depeyrot
|
|
|
|
#-- Modified by:
|
|
|
|
#-- Created: 05.05.2002
|
|
|
|
#-- RCS-ID: $Id$
|
|
|
|
#-- Copyright: (c) 2002 Gilles Depeyrot
|
|
|
|
#-- Licence: wxWindows licence
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
verbose=0
|
|
|
|
args=""
|
|
|
|
objects=""
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
|
|
|
case $1 in
|
|
|
|
|
|
|
|
-v)
|
|
|
|
verbose=1
|
|
|
|
;;
|
|
|
|
|
2002-05-08 13:13:13 -04:00
|
|
|
-o|-compatibility_version|-current_version|-framework|-undefined)
|
2002-05-05 15:56:15 -04:00
|
|
|
# collect these options and values
|
|
|
|
args="$args $1 $2"
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2002-05-08 13:13:13 -04:00
|
|
|
-l*|-L*|-flat_namespace)
|
2002-05-05 15:56:15 -04:00
|
|
|
# collect these options
|
|
|
|
args="$args $1"
|
|
|
|
;;
|
|
|
|
|
|
|
|
-dynamiclib)
|
|
|
|
# skip these options
|
|
|
|
;;
|
|
|
|
|
|
|
|
-*)
|
|
|
|
echo "shared-ld: unhandled option '$1'"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
*.o)
|
|
|
|
# collect object files
|
|
|
|
objects="$objects $1"
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "shared-ld: unhandled argument '$1'"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# Link one module containing all the others
|
|
|
|
#
|
|
|
|
if test $verbose = 1; then
|
|
|
|
echo "c++ -r -keep_private_externs -nostdlib $objects -o master.$$.o"
|
|
|
|
fi
|
|
|
|
c++ -r -keep_private_externs -nostdlib $objects -o master.$$.o
|
|
|
|
status=$?
|
|
|
|
if test $status != 0; then
|
|
|
|
exit $status
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Link the shared library from the single module created
|
|
|
|
#
|
|
|
|
if test $verbose = 1; then
|
|
|
|
echo "cc -dynamiclib master.$$.o $args"
|
|
|
|
fi
|
|
|
|
c++ -dynamiclib master.$$.o $args
|
|
|
|
status=$?
|
|
|
|
if test $status != 0; then
|
|
|
|
exit $status
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Remove intermediate module
|
|
|
|
#
|
|
|
|
rm -f master.$$.o
|
|
|
|
|
2002-05-08 13:13:13 -04:00
|
|
|
exit 0
|