Hi,
  did someone manage to compile mysql on OSF1 4.0[D-F] series using
Digital's cc and cxx compilers? Please Cc: me in reply, thanks.

CC=cc CXX=cxx CFLAGS='-non_shared -O3 -tune-host' CXXFLAGS='-non_shared
-O3 -tune-host' ./configure --with-libwrap
--with-mysqld-ldflags=-all-static --enable-assembler
--prefix=/usr/local/mysql-3.23.46 --with-charset=latin1 --enable-thread-safe-client 
--disable-shared

  I have problems linking against -lpthread. There's /usr/shlib/libpthread.so

Configure thinks DEC threads are installed, so it bumps at the libm.a, but
in real again because of missing -lpthread (which it should realize
already some steps sooner).

checking for crypt in -lcrypt... no
checking for crypt... yes
checking if libz with compress... no
checking for tcpd.h... no
checking for int8... no
checking LinuxThreads... Not found
checking DEC threads... yes
checking named thread libs:... -lpthread -lmach -lexc
checking for strtok_r in -lpthread... no
checking for strtok_r in -lc_r... no
checking for strtok_r... no
checking for pthread_init... no
checking for dlopen in -ldl... no
checking for restartable system calls... no
checking need of special linking flags... none
checking for working const... yes
checking for inline... __inline
checking for off_t... yes
checking for st_rdev in struct stat... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking size of char... 0
configure: error: No size for char type.
A likely cause for this could be that there isn't any
static libraries installed. You can verify this by checking if you have libm.a
in /lib, /usr/lib or some other standard place.  If this is the problem,
install the static libraries and try again.  If this isn't the problem,
examine config.log for possible errors.  If you want to report this, use
'scripts/mysqlbug' and include at least the last 20 rows from config.log!
mmokrejs@prfdec$ ls -la /usr/lib/libm.a
lrwxrwxrwx   1 root     system        17 Feb 23  1998 /usr/lib/libm.a -> 
../ccs/lib/libm.a
mmokrejs@prfdec$ ls -la /usr/ccs/lib/libm.a
-rw-r--r--   1 bin      bin       666208 Jan  5  1998 /usr/ccs/lib/libm.a
mmokrejs@prfdec$

from the config.log:
configure:5503: checking DEC threads
configure:5780: checking named thread libs:
configure:5904: checking for strtok_r in -lpthread
configure:5923: cc -std1 -o conftest -non_shared -O3 -tune-host    conftest.c 
-lpthread  -lpthread -lmach -lexc
-lm  -lpthread -lmach -lexc 1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 5912 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char strtok_r();

int main() {
strtok_r()
; return 0; }
configure:5955: checking for strtok_r in -lc_r
configure:5974: cc -std1 -o conftest -non_shared -O3 -tune-host    conftest.c -lc_r  
-lpthread -lmach -lexc -lm
 -lpthread -lmach -lexc 1>&5
ld:
Can't locate file for: -lpthread
configure: failed program was:
#line 5963 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char strtok_r();

int main() {
strtok_r()
; return 0; }
configure:6008: checking for strtok_r



BTW: from the configure script:

   5412   *netbsd*)
   5413     echo "Adding flag -Dunix"
   5414     CFLAGS="$CFLAGS -Dunix"
   5415     CXXFLAGS="$CXXFLAGS -Dunix"
   5416 OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a"
   5417     ;;

How does the "netbsd" relate to -Dunix ?



I found that I can compile using "cxx -lpthread" or just "cc" without
using -lpthread. I compiled in such way the example from
http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V40F_HTML/AQ2DPDTK/DOCU_008.HTM#c_example
The libpthread is only shared library, there's no static binary
available (at least I cannot find it). How can I create static binary in
such case?


I've solved part of my problems:
 1.  removing the -lpthread string occurencies from configure where
relates to OSF1, so only -lmach -lexc are retained (they're present as
static libs).


 2.  I've changed mysql-3.23.46/libtool this way:

- hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
+ hardcode_libdir_flag_spec=""

  It looks to me it's designed for gcc, but not for cc.




  Next problem I faced is that config.status contains:
s%@AWK@%gawk%g
s%@CC@%cc -std1%g
s%@CXX@%cxx%g

  Note that I did not use -std1 CFLAGS at all while calling configure.
This option makes cc more strict and thus exit. Removing -std1 helps in
many cases, but here's one example:

Making all in libmysql_r
make[2]: Entering directory `/scratch/mmokrejs/mysql-3.23.46/libmysql_r'
/bin/sh ../libtool --mode=compile cc -std1 
-DDEFAULT_CHARSET_HOME="\"/usr/local/mysql-3.23.46\""                        
-DDATADIR="\"/usr/local/mysql-3.23.46/var\""                    
-DSHAREDIR="\"/usr/local/mysql-3.23.46/share/mysql\"" -DDONT_USE_RAID  -I./../include 
-I../include              -I./.. -I.. -I..    -O -DDBUG_OFF -non_shared -O3 -tune-host 
 -c libmysql.c
cc -std1 -DDEFAULT_CHARSET_HOME=\"/usr/local/mysql-3.23.46\" 
-DDATADIR=\"/usr/local/mysql-3.23.46/var\" 
-DSHAREDIR=\"/usr/local/mysql-3.23.46/share/mysql\" -DDONT_USE_RAID -I./../include 
-I../include -I./.. -I.. -I.. -O -DDBUG_OFF -non_shared -O3 -tune-host -c libmysql.c 
-o libmysql.o
cc: Warning: ./../include/my_pthread.h, line 317: In this declaration, parameter 1 has 
a different type than specified in an earlier declaration of this function.
int sigwait(sigset_t *setp, int *sigp);         /* Use our implemention */
----^
cc: Error: ./../include/my_pthread.h, line 317: In this declaration, the type of 
"sigwait" is not compatible with the type of a previous declaration of "sigwait" at 
line number 481 in file /usr/include/signal.h.
int sigwait(sigset_t *setp, int *sigp);         /* Use our implemention */
----^
cc: Warning: ./../include/mysql.h, line 111: In this declaration, type "unsigned long 
long" is a language extension.
typedef unsigned long long my_ulonglong;
--------^
make[2]: *** [libmysql.lo] Error 1
make[2]: Leaving directory `/scratch/mmokrejs/mysql-3.23.46/libmysql_r'


I got through all problems, but I cannot link mysqld without
-lpthread. But cxx complains that it cannot find -lpthread. Resetting
LD_LIBRARY_PATH to point to /usr/shlib or adding -L/usr/shlib did not help
at all.


Any ideas? Does someone have static binaries for DigitalUnix 4.0?, NOT
5.1? ;)
-- 
Martin Mokrejs - PGP5.0i key is at http://www.natur.cuni.cz/~mmokrejs
MIPS / Institute for Bioinformatics <http://mips.gsf.de>
GSF - National Research Center for Environment and Health
Ingolstaedter Landstrasse 1, D-85764 Neuherberg, Germany
tel.: +49-89-3187 3616 , fax: +49-89-3187 3585






---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to