Guido van Rossum | b4ae6a3 | 1996-08-08 19:05:09 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # ======================================================================== |
| 4 | # FILE: ld_so_aix |
| 5 | # TYPE: executable, uses makexp_aix |
| 6 | # SYSTEM: AIX |
| 7 | # |
| 8 | # DESCRIPTION: Creates a shareable .o from a pre-compiled (unshared) |
| 9 | # .o file |
| 10 | # |
| 11 | # ARGUMENTS: Same as for "ld". The -bM, -bE, -bI, -H, -T, and -lc |
| 12 | # arguments of "ld" will be supplied by this script. |
| 13 | # |
| 14 | # NOTES: 1. Currently specific to the building of Python |
| 15 | # interpreter shared objects, in that the entry |
| 16 | # point name is hardcoded based on the object file |
| 17 | # name (the "mathmodule.o" file will expect an |
| 18 | # entry point of "initmath"). This could be remedied |
| 19 | # by the support (or simple expectation) of a "-e" |
| 20 | # argument. |
| 21 | # 2. The resulting shared object file is left in the |
| 22 | # current directory with the extension .so |
| 23 | # 3. Uncommenting the "echo" lines gives detailed output |
| 24 | # about the commands executed in the script. |
| 25 | # |
| 26 | # HISTORY: Jul-1-1996 -- Make sure to use /usr/ccs/bin/ld -- |
| 27 | # -- Use makexp_aix for the export list. -- |
| 28 | # Vladimir Marangozov (Vladimir.Marangozov@imag.fr) |
| 29 | # |
| 30 | # Manus Hand (mhand@csn.net) -- Initial code -- 6/24/96 |
| 31 | # ======================================================================== |
| 32 | # |
| 33 | |
| 34 | # Variables |
| 35 | objfile=$1 |
| 36 | shift |
| 37 | filename=`echo $objfile | sed -e "s:.*/\([^/]*\)$:\1:" -e "s/\..*$//"` |
| 38 | entry=init`echo $filename | sed "s/module.*//"` |
| 39 | ldopts="-e$entry -bE:$filename.exp -bI:python.exp -bM:SRE -T512 -H512 -lc" |
| 40 | ldargs="$objfile $*" |
| 41 | |
| 42 | # Export list generation |
| 43 | makexp_aix $filename.exp "$objfile" $objfile |
| 44 | |
| 45 | # Perform the link. |
| 46 | #echo "ld $ldopts $ldargs" |
| 47 | /usr/ccs/bin/ld $ldopts $ldargs |
| 48 | |
| 49 | # Delete the module's export list file. |
| 50 | # Comment this line if you need it. |
| 51 | rm -f $filename.exp |
| 52 | |
| 53 | # Remove the exec rights on the shared module. |
| 54 | #echo chmod -x `echo $objfile | sed "s/\.o$/.so/"` |
| 55 | chmod -x `echo $objfile | sed "s/\.o$/.so/"` |
| 56 | |
| 57 | |
| 58 | |