aboutsummaryrefslogtreecommitdiffstats
path: root/tools/process-x11-fields.pl
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2015-06-06 22:24:33 -0400
committerPeter Wu <peter@lekensteyn.nl>2015-11-29 11:20:39 +0000
commit3749e981aa69d7598879d50b1f099181e0929d30 (patch)
tree40f6b3b692f7eca0d88bef902d07ab2b42b7b5ef /tools/process-x11-fields.pl
parent9b128181b9bdd8f621ba9db792cbda11c8f7d654 (diff)
Support building the X11 dissector outside the source tree.
Use relative path names for the script names and mesa/xcbproto directories so different paths (from different users) don't cause deltas. Also, with help from Peter Wu and Graham, get generation of the X11 dissector working from cmake. Change-Id: I95cd2a0f973dcbc67f457ff94c28e46a666afb74 Reviewed-on: https://code.wireshark.org/review/12213 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'tools/process-x11-fields.pl')
-rwxr-xr-xtools/process-x11-fields.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/process-x11-fields.pl b/tools/process-x11-fields.pl
index c3a9888274..aab1ab5ba3 100755
--- a/tools/process-x11-fields.pl
+++ b/tools/process-x11-fields.pl
@@ -16,26 +16,33 @@
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
-#
+#
# This program 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 General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
-open(DECL, ">x11-declarations.h") || die;
-open(REG, ">x11-register-info.h") || die;
+use File::Spec;
+
+my $srcdir = shift;
+die "'$srcdir' is not a directory" unless -d $srcdir;
+
+open(DECL, "> $srcdir/x11-declarations.h") || die;
+open(REG, "> $srcdir/x11-register-info.h") || die;
+
+my $script_name = File::Spec->abs2rel ($0, $srcdir);
sub add_generated_header {
my ($out) = @_;
print $out <<eot
/* Do not modify this file. */
-/* It was automatically generated by $0. */
+/* It was automatically generated by $script_name. */
eot
;