1 #!/usr/bin/bash
2 #
3 # CDDL HEADER START
4 #
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
8 # with the License.
9 #
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
14 #
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 #
21 # CDDL HEADER END
22 #
23 #
24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27 # Load support functions
28 . ../../lib/functions.sh
29
30 PROG=glib
31 VER=2.34.1
32 PKG=library/glib2
33 SUMMARY="$PROG - GNOME GLib utility library"
34 DESC="$SUMMARY"
35
36 DEPENDS_IPS="SUNWcs library/libffi@$FFIVERS library/zlib system/library
37 system/library/gcc-4-runtime runtime/perl"
38
39 CONFIGURE_OPTS="--disable-fam --disable-dtrace"
40
41 save_function configure32 configure32_orig
42 save_function configure64 configure64_orig
43 configure32() {
44 LIBFFI_CFLAGS=-I/usr/lib/libffi-$FFIVERS/include
45 export LIBFFI_CFLAGS
46 LIBFFI_LIBS=-lffi
47 export LIBFFI_LIBS
48 configure32_orig
49
50 logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib -lc#g;' libtool ||
51 logerr "libtool patch failed"
52 # one file here requires c99 compilation and most others prohibit it
53 # it is a test, so no runtime issues will be present
54 pushd glib/tests > /dev/null
55 logmsg " one off strfuncs.o c99 compile"
56 logcmd make CFLAGS="-std=c99" strfuncs.o
57 popd > /dev/null
58 }
59 configure64() {
60 LIBFFI_CFLAGS=-I/usr/lib/amd64/libffi-$FFIVERS/include
61 export LIBFFI_CFLAGS
62 LIBFFI_LIBS=-lffi
63 export LIBFFI_LIBS
64 configure64_orig
65
66 logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib -lc#g;' libtool ||
67 logerr "libtool patch failed"
68 # one file here requires c99 compilation and most others prohibit it
69 # it is a test, so no runtime issues will be present
70 pushd glib/tests > /dev/null
71 logmsg " one off strfuncs.o c99 compile"
72 logcmd make CFLAGS="-m64 -std=c99" strfuncs.o
73 popd > /dev/null
74 }
75
76 init
77 download_source $PROG $PROG $VER
78 patch_source
79 prep_build
80 build
81 make_isa_stub
82 make_package
83 clean_up