Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#
# mkldexport
#   create an AIX exports file from an object file
#
# src/backend/port/aix/mkldexport.sh
#
# Usage:
#   mkldexport objectfile [location]
# where
#   objectfile is the current location of the object file.
#   location is the eventual (installed) location of the
#       object file (if different from the current
#       working directory).
#
# On AIX, executables do not automatically expose their symbols to shared
# modules. Extensions therefore cannot call functions in the main Postgres
# binary unless those symbols are explicitly exported. Unlike other platforms,
# AIX executables are not default symbol providers; each shared module must
# link against an export list that defines which symbols it can use.
#
# The mkldexport.sh script fixes AIX's symbol export issue by generating an
# explicit export list. It uses nm to gather all symbols from the Postgres
# object files, then writes them into the export file. When invoked with ".",
# it outputs #! ., which tells AIX the list applies to the main executable.
# This way, extension modules can link against that list and resolve their
# undefined symbols directly from the Postgres binary.
#
 
# Search for the nm command binary.
if [ -x /usr/ucb/nm ]
then NM=/usr/ucb/nm
elif [ -x /usr/bin/nm ]
then NM=/usr/bin/nm
elif [ -x /usr/ccs/bin/nm ]
then NM=/usr/ccs/bin/nm
elif [ -x /usr/usg/bin/nm ]
then NM=/usr/usg/bin/nm
else echo "Fatal error: cannot find `nm' ... please check your installation."
     exit 1
fi
 
# instruct nm to process 64-bit objects
export OBJECT_MODE=64
 
CMDNAME=`basename $0`
if [ -z "$1" ]; then
    echo "Usage: $CMDNAME object [location]"
    exit 1
fi
OBJNAME=`basename $1`
if [ "`basename $OBJNAME`" != "`basename $OBJNAME .o`" ]; then
    OBJNAME=`basename $OBJNAME .o`.so
fi
if [ -z "$2" ]; then
    echo '#!'
else
    if [ "$2" = "." ]; then
        # for the base executable (AIX 4.2 and up)
        echo '#! .'
    else
        echo '#!' $2
    fi
fi
$NM -BCg $1 | \
    grep ' [TDB] ' | \
    sed -e 's/.* //' | \
    grep -v '\$' | \
    sed -e 's/^[.]//' | \
    sort | \
    uniq