mutter/build/stringify.sh
Emmanuele Bassi 8dd8fbdbdf build: Start moving to a non-recursive layout
*** WARNING: THIS COMMIT CHANGES THE BUILD ***

Do not recurse into the backend directories to build private, internal
libraries.

We only recurse from clutter/ into the cogl sub-directory; from there,
we don't recurse any further. All the backend-specific code in Cogl and
Clutter is compiled conditionally depending on the macros defined by the
configure script.

We still recurse from the top-level directory into doc, clutter and
tests, because gtk-doc and tests do not deal nicely with non-recursive
layouts.

This change makes Clutter compile slightly faster, and cleans up the
build system, especially when dealing with introspection data.

Ideally, we also want to make Cogl part of the top-level build, so that
we can finally drop the sed trick to change the shared library from the
GIR before compiling it.

Currently disabled:

  ‣ OSX backend
  ‣ Fruity backend

Currently enabled but untested:

  ‣ EGL backend
  ‣ Windows backend
2010-09-29 14:40:15 +01:00

95 lines
2.6 KiB
Bash

#! /bin/sh
# Cogl
#
# An object oriented GL/GLES Abstraction/Utility Layer
#
# Copyright (C) 2008,2009 Intel Corporation.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
output_copyright ()
{
cat <<EOF
/*
* Cogl
*
* An object oriented GL/GLES Abstraction/Utility Layer
*
* Copyright (C) 2008,2009 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
EOF
}
# If two arguments are given then generate the header file instead
if test "$#" = 2; then
bfname="${2%.glsl}"
bname=`basename "$bfname"`
varname=`echo -n "${bname}" | tr -c a-z _`
guardname=`echo -n "${varname}" | tr a-z A-Z`
guardname="__${guardname}_H"
output_copyright
echo
echo "#ifndef ${guardname}"
echo "#define ${guardname}"
echo
sed -n \
-e 's/^ *\/\*\*\* \([a-zA-Z0-9_]*\) \*\*\*\//extern const char \1[];/p' \
< "$2"
echo
echo "#endif /* ${guardname} */"
else
bfname="${1%.glsl}";
bname=`basename "${bfname}"`;
varname=`echo -n "${bname}" | tr -c a-z _`;
output_copyright
echo
sed -n \
-e h \
-e 's/^ *\/\*\*\* \([a-zA-Z0-9_]*\) \*\*\*\// ;\nconst char \1[] =/' \
-e 't got' \
-e g \
-e 's/"/\\"/' \
-e 's/^/ "/' \
-e 's/$/\\n"/' \
-e ': got' \
-e p \
< "$1"
echo " ;"
fi