Mercurial > ecos-v3_0-branch
annotate packages/io/framebuf/current/src/gen_framebufs.tcl @ 2863:7d8c61e6225c default tip
* Added execute permissions to files missed in conversion from CVS
| author | alexs |
|---|---|
| date | Thu, 26 Mar 2009 20:39:18 +0000 |
| parents | 74dbf4c3f2e1 |
| children |
| rev | line source |
|---|---|
| 2711 | 1 #!/usr/bin/env tclsh |
| 2565 | 2 |
| 3 #=============================================================================== | |
| 4 # | |
| 5 # gen_framebufs.tcl | |
| 6 # | |
| 7 # Amalgamate the various framebuffers available on a given platform | |
| 8 # | |
| 9 #=============================================================================== | |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
10 # ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
11 # ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
12 # This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
13 # Copyright (C) 2008 Free Software Foundation, Inc. |
| 2565 | 14 # |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
15 # eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
16 # the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
17 # Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
18 # version. |
| 2565 | 19 # |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
20 # eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
21 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
22 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
23 # for more details. |
| 2565 | 24 # |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
25 # You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
26 # along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
27 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 2565 | 28 # |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
29 # As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
30 # macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
31 # and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
32 # this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
33 # the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
34 # must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
35 # General Public License v2. |
| 2565 | 36 # |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
37 # This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
38 # on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
39 # ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2711
diff
changeset
|
40 # ####ECOSGPLCOPYRIGHTEND#### |
| 2565 | 41 #=============================================================================== |
| 42 ######DESCRIPTIONBEGIN#### | |
| 43 # | |
| 44 # Author(s): bartv | |
| 45 # Date: 2005-03-29 | |
| 46 # | |
| 47 # This script is invoked via a custom make rule to generate a file | |
| 48 # <cyg/io/framebufs/framebufs.h> | |
| 49 # | |
| 50 #####DESCRIPTIONEND#### | |
| 51 #=============================================================================== | |
| 52 | |
| 53 proc do_it { dir } { | |
| 54 | |
| 55 # dir should be set to <prefix>/install/include/cyg/io/framebufs | |
| 56 if { ! [file exists $dir] } { | |
| 57 file mkdir $dir | |
| 58 } | |
| 59 if { ! [file isdirectory $dir] } { | |
| 60 puts stderr "gen_framebufs.tcl: strange build tree, $dir should be a directory" | |
| 61 exit 1 | |
| 62 } | |
| 63 | |
| 64 set framebufs_file [file join $dir "framebufs.h"] | |
| 65 set current_data "" | |
| 66 if { [file exists $framebufs_file] } { | |
| 67 set fd [open $framebufs_file "r"] | |
| 68 set current_data [read $fd] | |
| 69 close $fd | |
| 70 } | |
| 71 | |
| 72 set headers [lsort [glob -nocomplain [file join $dir "*.h*"]]] | |
| 73 | |
| 74 set new_data \ | |
| 75 "\#ifndef CYGONCE_IO_FRAMEBUFS_FRAMEBUFS_H | |
| 76 # define CYGONCE_IO_FRAMEBUFS_FRAMEBUFS_H | |
| 77 | |
| 78 /* This is a generated file - do not edit! */ | |
| 79 /* <cyg/io/framebufs/framebufs.h> should not be #include'd */ | |
| 80 /* directly, instead use <cyg/io/framebuf.h> */ | |
| 81 " | |
| 82 | |
| 83 foreach header $headers { | |
| 84 set header [file tail $header] | |
| 85 if { [string equal "framebufs.h" $header] } { | |
| 86 continue | |
| 87 } | |
| 88 append new_data "#include <cyg/io/framebufs/[set header]>\n" | |
| 89 } | |
| 90 | |
| 91 # Next, work out the default test device. We need to read pkgconf/io_framebuf.h, | |
| 92 # look for CYGDAT_IO_FRAMEBUF_DEVICES, and extract the first entry. | |
| 93 set pkgconf_file [file join $dir "../../../pkgconf/io_framebuf.h"] | |
| 94 if { ! [file exists $pkgconf_file] || ! [file readable $pkgconf_file] } { | |
| 95 puts stderr "gen_framebufs.tcl: strange build tree, no access to $pkgconf_file" | |
| 96 exit 1 | |
| 97 } | |
| 98 set fd [open $pkgconf_file "r"] | |
| 99 while { ! [eof $fd] } { | |
| 100 set line [gets $fd] | |
| 101 if { [regexp {^#define\s*CYGDAT_IO_FRAMEBUF_DEVICES\s*(\S*)\s+.*$} $line junk fb] } { | |
| 102 append new_data "#define CYGDAT_IO_FRAMEBUF_DEFAULT_TEST_DEVICE $fb\n" | |
| 103 break | |
| 104 } | |
| 105 } | |
| 106 | |
| 107 # Close the #ifndef CYGONCE_ | |
| 108 append new_data "#endif\n" | |
| 109 | |
| 110 if { ! [string equal $current_data $new_data] } { | |
| 111 set fd [open $framebufs_file "w"] | |
| 112 puts -nonewline $fd $new_data | |
| 113 close $fd | |
| 114 } | |
| 115 } | |
| 116 | |
| 117 if { 0 == $::argc } { | |
| 118 puts stderr "gen_framebufs.tcl: missing argument for install directory" | |
| 119 exit 1 | |
| 120 } | |
| 121 | |
| 122 if { [catch { do_it [lindex $::argv 0] } msg] } { | |
| 123 puts stderr "gen_framebufs.tcl: internal error" | |
| 124 puts stderr " $msg" | |
| 125 exit 1 | |
| 126 } | |
| 127 exit 0 |
