summaryrefslogtreecommitdiff
blob: ca48df389c498de704125f6fd33e5fdf09df94f9 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
--- xharbour-1.0.0-beta1/bin/hb-func.sh.orig	2007-02-13 22:02:23.000000000 +0300
+++ xharbour-1.0.0-beta1/bin/hb-func.sh	2009-03-05 11:33:06.000000000 +0300
@@ -324,13 +324,9 @@
 fi
 [ -n "\${HB_GPM_LIB}" ] && SYSTEM_LIBS="\${SYSTEM_LIBS} -l\${HB_GPM_LIB}"
 
-if [ "\${HB_STATIC}" = "full" ]; then
-    SYSTEM_LIBS="\${SYSTEM_LIBS} -ldl"
-    if [ "\${HB_ARCHITECTURE}" = "linux" ]; then
-        SYSTEM_LIBS="\${SYSTEM_LIBS} -lpthread"
-    fi
-    LN_OPT="\${LN_OPT} -static"
-    HB_STATIC="yes"
+
+if [ "\${HB_STATIC}" = "no" ]; then
+    SYSTEM_LIBS=""
 fi
 
 if [ "\${HB_XBGTK}" = "yes" ]; then
@@ -339,6 +335,14 @@
     SYSTEM_LIBS="\${SYSTEM_LIBS} \`pkg-config --libs gtk+-2.0 --libs libgnomeprint-2.2\`"
 fi
 
+if [ "\${HB_STATIC}" = "full" ]; then
+    if [ "\${HB_ARCHITECTURE}" = "linux" ]; then
+        SYSTEM_LIBS="\${SYSTEM_LIBS} -lpthread -ldl"
+    fi
+    LN_OPT="\${LN_OPT} -static"
+    HB_STATIC="yes"
+fi
+
 HB_LNK_REQ=""
 for gt in \${HB_GT_REQ}; do
     if [ "\${HB_STATIC}" = "yes" ] || [ "\${gt}" = "ALLEG" ]; then
@@ -534,7 +538,7 @@
 
 mk_hblibso()
 {
-    local LIBS LIBSMT l lm ll hb_rootdir hb_ver hb_libs full_lib_name full_lib_name_mt linker_options
+    local LIBS LIBSMT l lm ll hb_rootdir hb_ver hb_libs full_lib_name full_lib_name_mt linker_options linker_mtoptions gpm
 
     name=`get_solibname`
     hb_rootdir="${1-.}"
@@ -546,6 +550,32 @@
     (cd $HB_LIB_INSTALL
     LIBS=""
     LIBSMT=""
+    gpm="${HB_GPM_MOUSE}"
+    linker_options="-lm"
+    linker_mtoptions=""
+    if [ "${HB_COMPILER}" = "mingw32" ]; then
+        linker_options="${linker_options} -luser32 -lwinspool -lgdi32 -lcomctl32 -lcomdlg32 -lole32 -loleaut32 -luuid -lwsock32 -lws2_32"
+    elif [ "${HB_COMPILER}" = "mingwce" ]; then
+        linker_options="${linker_options} -lwininet -lws2 -lcommdlg -lcommctrl -luuid -lole32"
+    elif [ "${HB_COMPILER}" = "djgpp" ]; then
+        linker_options="${linker_options}"
+    elif [ "${HB_ARCHITECTURE}" = "linux" ]; then
+        linker_options="${linker_options} -ldl -lrt"
+        linker_mtoptions="${linker_mtoptions} -lpthread"
+    elif [ "${HB_ARCHITECTURE}" = "sunos" ]; then
+        linker_options="${linker_options} -lrt -lsocket -lnsl -lresolv"
+        linker_mtoptions="${linker_mtoptions} -lpthread"
+    elif [ "${HB_ARCHITECTURE}" = "hpux" ]; then
+        linker_options="${linker_options} -lrt"
+        linker_mtoptions="${linker_mtoptions} -lpthread"
+    elif [ "${HB_ARCHITECTURE}" = "bsd" ]; then
+        linker_options="$-L/usr/local/lib {linker_options}"
+        linker_mtoptions="${linker_mtoptions} -lpthread"
+    elif [ "${HB_ARCHITECTURE}" = "darwin" ]; then
+        linker_options="-L/sw/lib -L/opt/local/lib ${linker_options}"
+        linker_mtoptions="${linker_mtoptions} -lpthread"
+    fi
+
     for l in ${hb_libs}
     do
         case $l in
@@ -562,21 +592,34 @@
                    [ "${l#gt}" = "${l}" ] || \
                    [ "${l}" = "${HB_GT_LIB}" ]
                 then
-                    if [ -f $ls ]
-                    then
-                        LIBS="$LIBS $ls"
-                    fi
                     if [ -f $lm ]
                     then
                         LIBSMT="$LIBSMT $lm"
                     fi
-                    if [ "${HB_ARCHITECTURE}" = "darwin" ]; then
+                    if [ -f $ls ]
+                    then
+                        LIBS="$LIBS $ls"
                         if [ "${l}" = gtcrs ]; then
-                            linker_options="$linker_options -lncurses"
+                            if [ "${HB_ARCHITECTURE}" = "sunos" ]; then
+                                linker_options="$linker_options -lcurses"
+                            else
+                                linker_options="$linker_options -lncurses"
+                            fi
                         elif [ "${l}" = gtsln ]; then
                             if [ "${HB_WITHOUT_GTSLN}" != "yes" ]; then
                                 linker_options="$linker_options -lslang"
                             fi
+                        elif [ "${l}" = gtxwc ]; then
+                            [ -d "/usr/X11R6/lib" ] && \
+                                linker_options="$linker_options -L/usr/X11R6/lib"
+                            [ -d "/usr/X11R6/lib64" ] && \
+                                linker_options="$linker_options -L/usr/X11R6/lib64"
+                            linker_options="$linker_options -lX11"
+                        fi
+                        if [ "${gpm}" = yes ] && ( [ "${l}" = gtcrs ] || \
+                           [ "${l}" = gtsln ] || [ "${l}" = gttrm ] ); then
+                            linker_options="$linker_options -lgpm"
+                            gpm=""
                         fi
                     fi
                 fi
@@ -586,7 +629,6 @@
     if [ "${HB_ARCHITECTURE}" = "darwin" ]; then
         full_lib_name="lib${name}.${hb_ver}.dylib"
         full_lib_name_mt="lib${name}mt.${hb_ver}.dylib"
-        linker_options="-L/sw/lib -L/opt/local/lib $linker_options"
     elif [ "${HB_ARCHITECTURE}" = "w32" ]; then
         full_lib_name="${name}.dll"
         full_lib_name_mt="${name}mt.dll"
@@ -595,10 +637,10 @@
         full_lib_name_mt="lib${name}mt-${hb_ver}.so"
     fi
     echo "Making ${full_lib_name}..."
-    $HB_BIN_INSTALL/hb-mkslib ${full_lib_name} $LIBS ${linker_options}
+    $HB_BIN_INSTALL/hb-mkslib ${full_lib_name} ${LIBS} ${linker_options}
     if [ "$HB_MT" = "MT" ]; then
         echo "Making ${full_lib_name_mt}..."
-        $HB_BIN_INSTALL/hb-mkslib ${full_lib_name_mt} $LIBSMT ${linker_options}
+        $HB_BIN_INSTALL/hb-mkslib ${full_lib_name_mt} ${LIBSMT} ${linker_mtoptions} ${linker_options}
     fi
     for l in ${full_lib_name} ${full_lib_name_mt}
     do