DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Building Expat.xs On Solaris

12.02.2009
| 2331 views |
  • submit to reddit
        (For yum)
#!/bin/bash

rm -r XML-Parser-2.36
gzcat XML-Parser-2.36.tar.gz | tar xvf -
cd XML-Parser-2.36
export PATH="/opt/yum/libs/common/bin:/usr/local/bin:/usr/sfw/bin:$PATH:/usr/ccs/bin"
unset LANG LC_MONETARY LC_TIME LC_MESSAGES LC_CTYPE LC_COLLATE LC_NUMERIC
perl Makefile.PL PREFIX=/opt/yum/libs/perl EXPATLIBPATH=/opt/yum/libs/common/lib EXPATINCPATH=/opt/yum/libs/common/include

patch Makefile <<EOT
30,31c30,31
< CC = cc
< CCCDLFLAGS = -KPIC
---
> CC = gcc
> CCCDLFLAGS = -fPIC
35c35
< LD = cc
---
> LD = gcc
342c342
< OPTIMIZE = -xO3 -xspace -xildoff
---
> OPTIMIZE =
EOT

patch Expat/Makefile <<EOT
31,32c31,32
< CC = cc
< CCCDLFLAGS = -KPIC
---
> CC = gcc
> CCCDLFLAGS = -fPIC
36c36
< LD = cc
---
> LD = gcc
247c247
< OPTIMIZE = -xO3 -xspace -xildoff
---
> OPTIMIZE =
EOT

patch Expat/Expat.c <<EOT
22a23,24
> #define PERL_POLLUTE
>
129c131
< #if PATCHLEVEL < 5 && SUBVERSION < 5
---
> #if PATCHLEVEL < 0 && SUBVERSION < 5
EOT

patch Expat/Expat.xs <<EOT
13a14,15
> #define PERL_POLLUTE
>
120c122
< #if PATCHLEVEL < 5 && SUBVERSION < 5
---
> #if PATCHLEVEL < 0 && SUBVERSION < 5
EOT
make