在SunOS 5.10上编译DBD :: mysql

时间:2012-09-06 12:46:36

标签: perl solaris perl-module dbd sunos

大家

我为这篇文章的篇幅很长道歉 我在SunOS上编译DBD :: mysql时遇到了一些问题。

# /usr/perl5/bin/perlgcc Makefile.PL

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/sfw/include/mysql -xstrconst -mt
  embedded      (mysql_config) = 
  ldflags       (mysql_config) = -R/usr/sfw/lib -R/usr/sfw/lib/mysql
  libs          (mysql_config) = -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  ssl           (guessed     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = 

Checking if your kit is complete...
Looks good
Using DBI 1.58 (for perl 5.008004 on sun4-solaris-64int) installed in /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI/
Writing Makefile for DBD::mysql

# /usr/sfw/bin/gmake
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
gcc -c  -I/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing   -DVERSION=\"4.022\" -DXS_VERSION=\"4.022\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   dbdimp.c
gcc: language strconst not recognized
gcc: dbdimp.c: linker input file unused because linking not done
/usr/perl5/5.8.4/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI/Driver.xst > mysql.xsi
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap  mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line 242
Warning: duplicate function definition 'rows' detected in mysql.xs, line 752
gcc -c  -I/usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int/auto/DBI -I/usr/sfw/include/mysql -xstrconst -mt -DDBD_MYSQL_INSERT_ID_IS_GOOD -g  -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing   -DVERSION=\"4.022\" -DXS_VERSION=\"4.022\" -fPIC "-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE"   mysql.c
gcc: language strconst not recognized
gcc: mysql.c: linker input file unused because linking not done
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/usr/sfw/lib:/usr/lib:/lib" /usr/perl5/5.8.4/bin/perl myld gcc  -G dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm   
gcc: dbdimp.o: No such file or directory
gcc: mysql.o: No such file or directory
gmake: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1

可能相关的信息:

mysql_config --cflags
-I/usr/sfw/include/mysql -xstrconst -mt

mysql_config --libs
-R/usr/sfw/lib -R/usr/sfw/lib/mysql -L/usr/sfw/lib -L/usr/sfw/lib/mysql -lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm

file `which perl`
/usr/bin/perl:  ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped

# perl --version
This is perl, v5.8.4 built for sun4-solaris-64int

ldd /usr/sfw/bin/mysql
    libcurses.so.1 =>        /lib/libcurses.so.1
    libmysqlclient.so.12 =>  /usr/sfw/lib/libmysqlclient.so.12
    libz.so.1 =>                     /usr/lib/libz.so.1
    librt.so.1 =>                    /lib/librt.so.1
    libcrypt_i.so.1 =>       /usr/lib/libcrypt_i.so.1
    libgen.so.1 =>                   /lib/libgen.so.1
    libsocket.so.1 =>        /lib/libsocket.so.1
    libnsl.so.1 =>                   /lib/libnsl.so.1
    libm.so.2 =>                     /lib/libm.so.2
    libCstd.so.1 =>                  /usr/lib/libCstd.so.1
    libCrun.so.1 =>                  /usr/lib/libCrun.so.1
    libw.so.1 =>                     /lib/libw.so.1
    libthread.so.1 =>        /lib/libthread.so.1
    libc.so.1 =>                     /lib/libc.so.1
    libaio.so.1 =>                   /lib/libaio.so.1
    libmd.so.1 =>                    /lib/libmd.so.1
    libmp.so.2 =>                    /lib/libmp.so.2
    libscf.so.1 =>                   /lib/libscf.so.1
    libdoor.so.1 =>                  /lib/libdoor.so.1
    libuutil.so.1 =>         /lib/libuutil.so.1
    /usr/lib/cpu/sparcv8plus/libCstd_isa.so.1
    /platform/SUNW,SPARC-Enterprise-T5120/lib/libc_psr.so.1
    /platform/SUNW,SPARC-Enterprise-T5120/lib/libmd_psr.so.1

# perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=solaris, osvers=2.10, archname=sun4-solaris-64int
    uname='sunos localhost 5.10 sun4u sparc SUNW,Ultra-2'
    config_args=''
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xarch=v8 -D_TS_ERRNO',
    optimize='-xO3 -xspace -xildoff',
    cppflags=''
    ccversion='Sun WorkShop', gccversion='', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc
    perllibs=-lsocket -lnsl -ldl -lm -lc
    libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE'
    cccdlflags='-KPIC', lddlflags='-G'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_64_BIT_INT USE_LARGE_FILES
  Locally applied patches:
        22667 The optree builder was looping when constructing the ops ...
        22715 Upgrade to FileCache 1.04
        22733 Missing copyright in the README.
        22746 fix a coredump caused by rv2gv not fully converting a PV ...
        22755 Fix 29149 - another UTF8 cache bug hit by substr.
        22774 [perl #28938] split could leave an array without ...
        22775 [perl #29127] scalar delete of empty slice returned garbage
        22776 [perl #28986] perl -e "open m" crashes Perl
        22777 add test for change #22776 ("open m" crashes Perl)
        22778 add test for change #22746 ([perl #29102] Crash on assign ...
        22781 [perl #29340] Bizarre copy of ARRAY make sure a pad op's ...
        22796 [perl #29346] Double warning for int(undef) and abs(undef) ...
        22818 BOM-marked and (BOMless) UTF-16 scripts not working
        22823 [perl #29581] glob() misses a lot of matches
        22827 Smoke [5.9.2] 22818 FAIL(F) MSWin32 WinXP/.Net SP1 (x86/1 cpu)
        22830 [perl #29637] Thread creation time is hypersensitive
        22831 improve hashing algorithm for ptr tables in perl_clone: ...
        22839 [perl #29790] Optimization busted: '@a = "b", sort @a' ...
        22850 [PATCH] 'perl -v' fails if local_patches contains code snippets
        22852 TEST needs to ignore SCM files
        22886 Pod::Find should ignore SCM files and dirs
        22888 Remove redundant %SIG assignments from FileCache
        23006 [perl #30509] use encoding and "eq" cause memory leak
        23074 Segfault using HTML::Entities
        23106 Numeric comparison operators mustn't compare addresses of ...
        23320 [perl #30066] Memory leak in nested shared data structures ...
        23321 [perl #31459] Bug in read()
        27722 perlio.c breaks on Solaris/gcc when > 256 FDs are available
        SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
        6663288 Upgrade to CGI.pm 3.33
        REGEXP0 - fix for UTF-8 recoding in regexps - CVE-2007-5116
        6758953 Perl Sys::Syslog can log messages with wrong severity
  Built under solaris
  Compiled at May 21 2009 03:59:02
  @INC:
    /usr/perl5/5.8.4/lib/sun4-solaris-64int
    /usr/perl5/5.8.4/lib
    /usr/perl5/site_perl/5.8.4/sun4-solaris-64int
    /usr/perl5/site_perl/5.8.4
    /usr/perl5/site_perl
    /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
    /usr/perl5/vendor_perl/5.8.4
    /usr/perl5/vendor_perl
    .

isainfo -v
64-bit sparcv9 applications
        asi_blk_init vis2 vis 
32-bit sparc applications
        asi_blk_init vis2 vis v8plus div32 mul32    

如果可能的话,我应该如何进行任何提示,如果可能的话,一步一步(对于傻瓜)的方式?

谢谢!

1 个答案:

答案 0 :(得分:1)

尝试使用Sun编译器,它可能编译了你的mysql。其他人有had this problem, too