Commit ca8d8ca7 authored by Joerg Bruehe's avatar Joerg Bruehe

Merge ULN RPM stuff to main branch.

parents ffa4c37c 66f1e55b
...@@ -508,21 +508,28 @@ mkdir release ...@@ -508,21 +508,28 @@ mkdir release
# TODO / FIXME: Do we need "scriptstub"? # TODO / FIXME: Do we need "scriptstub"?
gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4} gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4}
# TODO / FIXME: "libmysqld.so" should have been produced above - WORK in PROGRESS # TODO / FIXME: "libmysqld.so" should have been produced above
# regular build will make libmysqld.a but not libmysqld.so :-( # regular build will make libmysqld.a but not libmysqld.so :-(
cd release cd release
mkdir libmysqld/work mkdir libmysqld/work
cd libmysqld/work cd libmysqld/work
ar -x ../libmysqld.a # "libmysqld" provides the same ABI as "libmysqlclient", but it implements the server:
rm rpl_utility.cc.o sql_binlog.cc.o # Try-and-Error: These modules cause unresolved references # The shared object is identified by the full version,
gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.0 -o libmysqld.so.0.0.1 \ # for linkage selection the first two levels are sufficient so that upgrades are possible
*.o \ # (see "man ld", option "-soname").
SO_FULL='%{mysql_version}'
SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'`
# These two modules should pull everything else which is needed:
ar -x ../libmysqld.a client.c.o signal_handler.cc.o
gcc $CFLAGS $LDFLAGS -shared -Wl,-soname,libmysqld.so.$SO_USE -o libmysqld.so.$SO_FULL \
*.o ../libmysqld.a \
-lpthread -lcrypt -laio -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc -lpthread -lcrypt -laio -lnsl -lssl -lcrypto -lz -lrt -lstdc++ -lm -lc
# this is to check that we built a complete library # this is to check that we built a complete library
cp %{SOURCE9} . cp %{SOURCE9} .
ln -s libmysqld.so.0.0.1 libmysqld.so.0 PROGNAME=`basename %{SOURCE9} .c`
gcc -I../../include -I../../../%{src_dir}/include $CFLAGS mysql-embedded-check.c libmysqld.so.0 ln -s libmysqld.so.$SO_FULL libmysqld.so.$SO_USE
LD_LIBRARY_PATH=. ldd ./a.out gcc -I../../include -I../../../%{src_dir}/include $CFLAGS -o $PROGNAME %{SOURCE9} libmysqld.so.$SO_USE
LD_LIBRARY_PATH=. ldd $PROGNAME
cd ../.. cd ../..
cd .. cd ..
...@@ -618,9 +625,11 @@ mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/my ...@@ -618,9 +625,11 @@ mv ${RPM_BUILD_ROOT}%{_bindir}/mysql_config ${RPM_BUILD_ROOT}%{_libdir}/mysql/my
install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config install -m 0755 scriptstub ${RPM_BUILD_ROOT}%{_bindir}/mysql_config
rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a rm -f ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.a
install -m 0755 release/libmysqld/work/libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0.0.1 SO_FULL='%{mysql_version}'
ln -s libmysqld.so.0.0.1 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.0 SO_USE=`echo $SO_FULL | sed -e 's/\([0-9]\.[0-9]\)\.[0-9]*/\1/'`
ln -s libmysqld.so.0 ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so install -m 0755 release/libmysqld/work/libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_FULL
ln -s libmysqld.so.$SO_FULL ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so.$SO_USE
ln -s libmysqld.so.$SO_USE ${RPM_BUILD_ROOT}%{_libdir}/mysql/libmysqld.so
rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err rm -f ${RPM_BUILD_ROOT}%{_bindir}/comp_err
rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1* rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/comp_err.1*
...@@ -964,6 +973,12 @@ fi ...@@ -964,6 +973,12 @@ fi
%{_mandir}/man1/mysql_client_test.1* %{_mandir}/man1/mysql_client_test.1*
%changelog %changelog
* Thu Dec 7 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Change the way in which "libmysqld.so" is created: Using all object modules
was wrong, gcc / ld can resolve the dependencies from "libmysqld.a".
Also, identify the ".so" version from the MySQL version, "0.0.1" was wrong.
Bug#15972480
* Tue Sep 18 2012 Joerg Bruehe <joerg.bruehe@oracle.com> * Tue Sep 18 2012 Joerg Bruehe <joerg.bruehe@oracle.com>
- Restrict the vendor check to Oracle: There is no history here - Restrict the vendor check to Oracle: There is no history here
which we have to allow for. which we have to allow for.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment