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-5-runtime runtime/perl"
  38 
  39 # Use old gcc4 standards level for this.
  40 export CFLAGS="$CFLAGS -std=gnu89"
  41 
  42 CONFIGURE_OPTS="--disable-fam --disable-dtrace --with-threads=posix"
  43 
  44 save_function configure32 configure32_orig
  45 save_function configure64 configure64_orig
  46 configure32() {
  47     LIBFFI_CFLAGS=-I/usr/lib/libffi-$FFIVERS/include
  48     export LIBFFI_CFLAGS
  49     LIBFFI_LIBS=-lffi
  50     export LIBFFI_LIBS
  51     configure32_orig
  52 
  53     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib -lc#g;' libtool ||
  54         logerr "libtool patch failed"
  55     # one file here requires c99 compilation and most others prohibit it
  56     # it is a test, so no runtime issues will be present
  57     pushd glib/tests > /dev/null
  58     logmsg " one off strfuncs.o c99 compile"
  59     logcmd make CFLAGS="-std=c99" strfuncs.o
  60     popd > /dev/null
  61 }
  62 configure64() {
  63     LIBFFI_CFLAGS=-I/usr/lib/amd64/libffi-$FFIVERS/include
  64     export LIBFFI_CFLAGS
  65     LIBFFI_LIBS=-lffi
  66     export LIBFFI_LIBS
  67     configure64_orig
  68 
  69     logcmd perl -pi -e 's#(\$CC.*\$compiler_flags)#$1 -nostdlib -lc#g;' libtool ||
  70         logerr "libtool patch failed"
  71     # one file here requires c99 compilation and most others prohibit it
  72     # it is a test, so no runtime issues will be present
  73     pushd glib/tests > /dev/null
  74     logmsg " one off strfuncs.o c99 compile"
  75     logcmd make CFLAGS="-m64 -std=c99" strfuncs.o
  76     popd > /dev/null
  77 }
  78 
  79 init
  80 download_source $PROG $PROG $VER
  81 patch_source
  82 prep_build
  83 build
  84 make_isa_stub
  85 make_package
  86 clean_up