summaryrefslogtreecommitdiff
path: root/support-files/SCO/compile.sh
blob: 5281ccde02d650890b5f0365ae7cf1e7b2ff3eeb (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
#!/bin/sh
# GNU ncurses

# search & check GNU make
GMAKE="gmake"
$GMAKE --version || GMAKE="make"
$GMAKE --version || exit

MAKE=$GMAKE
export MAKE

CC=gcc
CFLAGS="-O6 -fomit-frame-pointer"
CXX=gcc
CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors  -fno-exceptions -fno-rtti"
# LDFLAGS="-static"
LD=gcc

export CC
export CXX
export LD
export CFLAGS
export CXXFLAGS
# export LDFLAGS
# Solaris don't have libpthread.a.

if [ "x$1" = "x" ]; then
  echo " please set character set"
  exit
fi

CHAR="$1"
case "$1" in
 [uU]*)
   CHAR=ujis
   ;;
 [sS]*)
   CHAR=sjis
   ;;
esac
 
#---------------
P=`pwd`

if [ -f Makefile ] ; then
    ${GMAKE} distclean
fi

for i in bin sbin include man share/doc/mysql mysql-data
do
  /usr/bin/mkdir -p PKG/tmp-${CHAR}/usr/local/${i}
done
/usr/bin/mkdir -p PKG/tmp-${CHAR}/etc/init.d

#----------------------------
./configure \
   --prefix=/usr/local \
   --libexecdir=/usr/local/sbin \
   --sbindir=/usr/local/sbin \
   --localstatedir=/usr/local/mysql-data \
   --with-charset=${CHAR} \
   --with-extra-charsets=all \
   --with-raid \
   --without-docs \
   --without-bench \
   --without-perl \
   --with-gcc \
   --with-mysqld-ldflags="-static" \
   --with-client-ldflags="-static" \
   --with-named-curses-libs=/usr/local/lib/libncurses.a \
   --with-mysqld-user=mysql

#   --with-berkeley-db-includes=/usr/local/include/db3 \
#   --with-berkeley-db-libs=/usr/local/lib/libdb3.a \
#   --with-low-memory

${GMAKE}
${GMAKE} install DESTDIR=${P}/PKG/tmp-${CHAR}

v=`grep '^SHARED_LIB_VERSION' configure.in | sed 's@SHARED_LIB_VERSION@@' | sed -e 's@=@@' -e 's@:@ @g' | awk '{print $1}'`
km="libmysqlclient.so.$v"
export km

(cd ${P}/PKG/tmp-${CHAR}/usr/local/lib/mysql/ ; \
  for i in libmysqlclient* ; do \
    if /usr/bin/test ! -L $i ; then \
        mv $i ../ ; ln -sf ../$i ; \
    fi ; \
  done ; \
  k=`ls libmysqlclient.so.*.*.*` ; \
  cd .. ; \
  if /usr/bin/test ! -z libmysqlclient.so ; then \
      ln -sf $k libmysqlclient.so ;
  fi ; \
  if /usr/bin/test ! -z $km ; then \
      ln -sf $k $km ;
  fi ; \
)

#
(cd ${P}/PKG/tmp-${CHAR}/usr/local/bin ; strip * )
(cd ${P}/PKG/tmp-${CHAR}/usr/local/sbin ; strip * )