diff options
author | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-09-13 11:30:30 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-09-29 14:40:15 +0100 |
commit | 8dd8fbdbdf940258ff6b5ce616534bf8f8fd356a (patch) | |
tree | 727acfe49b25e85184af64981699931fdecc5ce0 /build | |
parent | 27aebb5c9d4a39e3f8e252b40cbf664d9981bbeb (diff) | |
download | clutter-8dd8fbdbdf940258ff6b5ce616534bf8f8fd356a.tar.gz |
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
Diffstat (limited to 'build')
-rw-r--r-- | build/Makefile.am | 2 | ||||
-rw-r--r-- | build/stringify.sh | 94 |
2 files changed, 95 insertions, 1 deletions
diff --git a/build/Makefile.am b/build/Makefile.am index d8669fd29..7ec16fcfc 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -1,3 +1,3 @@ SUBDIRS = autotools mingw -EXTRA_DIST = gen-gcov.pl +EXTRA_DIST = gen-gcov.pl stringify.sh diff --git a/build/stringify.sh b/build/stringify.sh new file mode 100644 index 000000000..721528a88 --- /dev/null +++ b/build/stringify.sh @@ -0,0 +1,94 @@ +#! /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 |