blob: 677fdcb0bfe78d11ad4fff8009b52dfe53ce6b8b [file] [log] [blame]
Reid Spencerb195d9d2006-03-23 23:21:29 +00001#!@PERL@
Chris Lattner584073a2006-06-02 18:58:21 +00002##===- tools/llvm-config ---------------------------------------*- perl -*-===##
3#
4# The LLVM Compiler Infrastructure
Reid Spencerf2722ca2006-03-22 15:59:55 +00005#
Chris Lattner234d5292007-12-29 22:59:10 +00006# This file is distributed under the University of Illinois Open Source
7# License. See LICENSE.TXT for details.
Chris Lattner584073a2006-06-02 18:58:21 +00008#
9##===----------------------------------------------------------------------===##
Reid Spencerf2722ca2006-03-22 15:59:55 +000010#
11# Synopsis: Prints out compiler options needed to build against an installed
12# copy of LLVM.
13#
Chris Lattner7f71e212006-04-13 04:21:31 +000014# Syntax: llvm-config OPTIONS... [COMPONENTS...]
Chris Lattner584073a2006-06-02 18:58:21 +000015#
16##===----------------------------------------------------------------------===##
Reid Spencerf2722ca2006-03-22 15:59:55 +000017
Reid Spencerb195d9d2006-03-23 23:21:29 +000018use 5.006;
Reid Spencerf2722ca2006-03-22 15:59:55 +000019use strict;
20use warnings;
Nick Lewyckyc40b75b2008-11-04 08:05:21 +000021use Cwd;
Reid Spencerf2722ca2006-03-22 15:59:55 +000022
23#---- begin autoconf values ----
Reid Spencer2d2c2f22006-06-02 18:31:41 +000024my $PACKAGE_NAME = q{@PACKAGE_NAME@};
Reid Spencerf2722ca2006-03-22 15:59:55 +000025my $VERSION = q{@PACKAGE_VERSION@};
26my $PREFIX = q{@LLVM_PREFIX@};
Reid Spencer2d2c2f22006-06-02 18:31:41 +000027my $LLVM_CONFIGTIME = q{@LLVM_CONFIGTIME@};
28my $LLVM_SRC_ROOT = q{@abs_top_srcdir@};
29my $LLVM_OBJ_ROOT = q{@abs_top_builddir@};
30my $LLVM_ON_WIN32 = q{@LLVM_ON_WIN32@};
31my $LLVM_ON_UNIX = q{@LLVM_ON_UNIX@};
32my $LLVMGCCDIR = q{@LLVMGCCDIR@};
33my $LLVMGCC = q{@LLVMGCC@};
34my $LLVMGXX = q{@LLVMGXX@};
35my $LLVMGCC_VERSION = q{@LLVMGCC_VERSION@};
36my $LLVMGCC_MAJVERS = q{@LLVMGCC_MAJVERS@};
37my $ENDIAN = q{@ENDIAN@};
38my $SHLIBEXT = q{@SHLIBEXT@};
39my $EXEEXT = q{@EXEEXT@};
40my $OS = q{@OS@};
Reid Spencerf2722ca2006-03-22 15:59:55 +000041my $ARCH = lc(q{@ARCH@});
Reid Spencer2d2c2f22006-06-02 18:31:41 +000042my $TARGET_TRIPLE = q{@target@};
43my $TARGETS_TO_BUILD = q{@TARGETS_TO_BUILD@};
Reid Spencerb195d9d2006-03-23 23:21:29 +000044my $TARGET_HAS_JIT = q{@TARGET_HAS_JIT@};
Reid Spencerf2722ca2006-03-22 15:59:55 +000045my @TARGETS_BUILT = map { lc($_) } qw{@TARGETS_TO_BUILD@};
46#---- end autoconf values ----
47
Jeff Cohen02c91ef2007-03-28 04:45:02 +000048# Must pretend x86_64 architecture is really x86, otherwise the native backend
49# won't get linked in.
50$ARCH = "x86" if $ARCH eq "x86_64";
51
Reid Spencerf2722ca2006-03-22 15:59:55 +000052#---- begin Makefile values ----
David Greenea696d242007-06-28 19:36:08 +000053my $CPPFLAGS = q{@LLVM_CPPFLAGS@};
Reid Spencerf72538e2007-01-06 02:48:03 +000054my $CFLAGS = q{@LLVM_CFLAGS@};
Reid Spencerf2722ca2006-03-22 15:59:55 +000055my $CXXFLAGS = q{@LLVM_CXXFLAGS@};
56my $LDFLAGS = q{@LLVM_LDFLAGS@};
Reid Spencer1bc68642006-07-27 23:00:30 +000057my $SYSTEM_LIBS = q{@LIBS@};
Chris Lattnerabdbae72006-06-02 19:13:29 +000058my $LLVM_BUILDMODE = q{@LLVM_BUILDMODE@};
Reid Spencerf2722ca2006-03-22 15:59:55 +000059#---- end Makefile values ----
60
Chris Lattner16ad6182006-06-02 21:48:10 +000061# Figure out where llvm-config is being run from. Primarily, we care if it has
62# been installed, or is running from the build directory, which changes the
63# locations of some files.
64
Chris Lattnere02b97b2006-06-02 01:23:18 +000065# Convert the current executable name into its directory (e.g. ".").
Chris Lattner16ad6182006-06-02 21:48:10 +000066my ($RUN_DIR) = ($0 =~ /^(.*)\/.*$/);
67
68# Turn the directory into an absolute directory on the file system, also pop up
69# from "bin" into the build or prefix dir.
Nick Lewyckyc40b75b2008-11-04 08:05:21 +000070my $ABS_RUN_DIR = Cwd::realpath("$RUN_DIR/..");
Chris Lattner16ad6182006-06-02 21:48:10 +000071
72# Compute the absolute object directory build, e.g. "foo/llvm/Debug".
Chris Lattner3e347f22006-06-06 23:54:15 +000073my $ABS_OBJ_ROOT = "$LLVM_OBJ_ROOT/$LLVM_BUILDMODE";
Nick Lewyckyc40b75b2008-11-04 08:05:21 +000074$ABS_OBJ_ROOT = Cwd::realpath($ABS_OBJ_ROOT) if (-d $ABS_OBJ_ROOT);
Chris Lattner16ad6182006-06-02 21:48:10 +000075
Chris Lattner0cd059e2006-06-02 22:03:50 +000076my $INCLUDEDIR = "$ABS_RUN_DIR/include";
77my $LIBDIR = "$ABS_RUN_DIR/lib";
78my $BINDIR = "$ABS_RUN_DIR/bin";
Chris Lattner16ad6182006-06-02 21:48:10 +000079if ($ABS_RUN_DIR eq $ABS_OBJ_ROOT) {
80 # If we are running out of the build directory, the include dir is in the
81 # srcdir.
82 $INCLUDEDIR = "$LLVM_SRC_ROOT/include";
83} else {
Chris Lattner0cd059e2006-06-02 22:03:50 +000084 # If installed, ignore the prefix the tree was configured with, use the
85 # current prefix.
86 $PREFIX = $ABS_RUN_DIR;
Chris Lattner16ad6182006-06-02 21:48:10 +000087}
Chris Lattnere02b97b2006-06-02 01:23:18 +000088
Reid Spencerf2722ca2006-03-22 15:59:55 +000089sub usage;
90sub fix_library_names (@);
Chris Lattnerd179de52006-06-06 22:38:29 +000091sub fix_library_files (@);
Reid Spencerd8c20a92006-08-03 21:45:35 +000092sub expand_dependencies (@);
Reid Spencerf2722ca2006-03-22 15:59:55 +000093sub name_map_entries;
94
95# Parse our command-line arguments.
96usage if @ARGV == 0;
97my @components;
98my $has_opt = 0;
99my $want_libs = 0;
100my $want_libnames = 0;
Chris Lattnerd179de52006-06-06 22:38:29 +0000101my $want_libfiles = 0;
Reid Spencerf2722ca2006-03-22 15:59:55 +0000102my $want_components = 0;
103foreach my $arg (@ARGV) {
104 if ($arg =~ /^-/) {
105 if ($arg eq "--version") {
106 $has_opt = 1; print "$VERSION\n";
107 } elsif ($arg eq "--prefix") {
108 $has_opt = 1; print "$PREFIX\n";
109 } elsif ($arg eq "--bindir") {
Chris Lattner16ad6182006-06-02 21:48:10 +0000110 $has_opt = 1; print "$BINDIR\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000111 } elsif ($arg eq "--includedir") {
Chris Lattner16ad6182006-06-02 21:48:10 +0000112 $has_opt = 1; print "$INCLUDEDIR\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000113 } elsif ($arg eq "--libdir") {
Chris Lattner16ad6182006-06-02 21:48:10 +0000114 $has_opt = 1; print "$LIBDIR\n";
David Greenea696d242007-06-28 19:36:08 +0000115 } elsif ($arg eq "--cppflags") {
Reid Spencer087d90e2007-07-10 07:48:09 +0000116 $has_opt = 1; print "-I$INCLUDEDIR $CPPFLAGS\n";
Reid Spencerf72538e2007-01-06 02:48:03 +0000117 } elsif ($arg eq "--cflags") {
Reid Spencer087d90e2007-07-10 07:48:09 +0000118 $has_opt = 1; print "-I$INCLUDEDIR $CFLAGS\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000119 } elsif ($arg eq "--cxxflags") {
Reid Spencer087d90e2007-07-10 07:48:09 +0000120 $has_opt = 1; print "-I$INCLUDEDIR $CXXFLAGS\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000121 } elsif ($arg eq "--ldflags") {
Reid Spencer1bc68642006-07-27 23:00:30 +0000122 $has_opt = 1; print "-L$LIBDIR $LDFLAGS $SYSTEM_LIBS\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000123 } elsif ($arg eq "--libs") {
124 $has_opt = 1; $want_libs = 1;
125 } elsif ($arg eq "--libnames") {
126 $has_opt = 1; $want_libnames = 1;
Chris Lattnerd179de52006-06-06 22:38:29 +0000127 } elsif ($arg eq "--libfiles") {
128 $has_opt = 1; $want_libfiles = 1;
Reid Spencerf2722ca2006-03-22 15:59:55 +0000129 } elsif ($arg eq "--components") {
130 $has_opt = 1; print join(' ', name_map_entries), "\n";
131 } elsif ($arg eq "--targets-built") {
132 $has_opt = 1; print join(' ', @TARGETS_BUILT), "\n";
Reid Spencer3b87d6a2007-04-22 05:05:36 +0000133 } elsif ($arg eq "--host-target") {
134 $has_opt = 1; print "$TARGET_TRIPLE\n";
Chris Lattner0cd059e2006-06-02 22:03:50 +0000135 } elsif ($arg eq "--build-mode") {
136 $has_opt = 1; print "$LLVM_BUILDMODE\n";
137 } elsif ($arg eq "--obj-root") {
Nick Lewyckyc40b75b2008-11-04 08:05:21 +0000138 $has_opt = 1; print Cwd::realpath($LLVM_OBJ_ROOT), "\n";
Chris Lattner0cd059e2006-06-02 22:03:50 +0000139 } elsif ($arg eq "--src-root") {
Nick Lewyckyc40b75b2008-11-04 08:05:21 +0000140 $has_opt = 1; print Cwd::realpath($LLVM_SRC_ROOT), "\n";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000141 } else {
142 usage();
143 }
144 } else {
145 push @components, $arg;
146 }
147}
148
149# If no options were specified, fail.
150usage unless $has_opt;
151
152# If no components were specified, default to 'all'.
153if (@components == 0) {
154 push @components, 'all';
155}
156
Chris Lattner54eae9e2006-09-04 05:35:23 +0000157# Force component names to lower case.
158@components = map lc, @components;
159
Reid Spencerf2722ca2006-03-22 15:59:55 +0000160# Handle any arguments which require building our dependency graph.
Chris Lattnerd179de52006-06-06 22:38:29 +0000161if ($want_libs || $want_libnames || $want_libfiles) {
Reid Spencerd8c20a92006-08-03 21:45:35 +0000162 my @libs = expand_dependencies(@components);
Chris Lattnerd179de52006-06-06 22:38:29 +0000163 print join(' ', fix_library_names(@libs)), "\n" if ($want_libs);
164 print join(' ', @libs), "\n" if ($want_libnames);
165 print join(' ', fix_library_files(@libs)), "\n" if ($want_libfiles);
Reid Spencerf2722ca2006-03-22 15:59:55 +0000166}
167
168exit 0;
169
170#==========================================================================
171# Support Routines
172#==========================================================================
173
174sub usage {
175 print STDERR <<__EOD__;
176Usage: llvm-config <OPTION>... [<COMPONENT>...]
177
178Get various configuration information needed to compile programs which use
179LLVM. Typically called from 'configure' scripts. Examples:
180 llvm-config --cxxflags
181 llvm-config --ldflags
Reid Spencerb195d9d2006-03-23 23:21:29 +0000182 llvm-config --libs engine bcreader scalaropts
Reid Spencerf2722ca2006-03-22 15:59:55 +0000183
184Options:
Reid Spencer087d90e2007-07-10 07:48:09 +0000185 --version Print LLVM version.
186 --prefix Print the installation prefix.
187 --src-root Print the source root LLVM was built from.
188 --obj-root Print the object root used to build LLVM.
189 --bindir Directory containing LLVM executables.
190 --includedir Directory containing LLVM headers.
191 --libdir Directory containing LLVM libraries.
192 --cppflags C preprocessor flags for files that include LLVM headers.
193 --cflags C compiler flags for files that include LLVM headers.
194 --cxxflags C++ compiler flags for files that include LLVM headers.
195 --ldflags Print Linker flags.
196 --libs Libraries needed to link against LLVM components.
197 --libnames Bare library names for in-tree builds.
198 --libfiles Fully qualified library filenames for makefile depends.
199 --components List of all possible components.
200 --targets-built List of all targets currently built.
201 --host-target Target triple used to configure LLVM.
202 --build-mode Print build mode of LLVM tree (e.g. Debug or Release).
Reid Spencerf2722ca2006-03-22 15:59:55 +0000203Typical components:
Reid Spencer087d90e2007-07-10 07:48:09 +0000204 all All LLVM libraries (default).
205 backend Either a native backend or the C backend.
206 engine Either a native JIT or a bytecode interpreter.
Reid Spencerf2722ca2006-03-22 15:59:55 +0000207__EOD__
208 exit(1);
209}
210
211# Use -lfoo instead of libfoo.a whenever possible, and add directories to
212# files which can't be found using -L.
213sub fix_library_names (@) {
214 my @libs = @_;
215 my @result;
216 foreach my $lib (@libs) {
217 # Transform the bare library name appropriately.
218 my ($basename) = ($lib =~ /^lib([^.]*)\.a/);
219 if (defined $basename) {
220 push @result, "-l$basename";
221 } else {
Chris Lattner16ad6182006-06-02 21:48:10 +0000222 push @result, "$LIBDIR/$lib";
Reid Spencerf2722ca2006-03-22 15:59:55 +0000223 }
224 }
225 return @result;
226}
227
Chris Lattnerd179de52006-06-06 22:38:29 +0000228# Turn the list of libraries into a list of files.
229sub fix_library_files(@) {
230 my @libs = @_;
231 my @result;
232 foreach my $lib (@libs) {
233 # Transform the bare library name into a filename.
234 push @result, "$LIBDIR/$lib";
235 }
236 return @result;
237}
Reid Spencerf2722ca2006-03-22 15:59:55 +0000238
239#==========================================================================
240# Library Dependency Analysis
241#==========================================================================
242# Given a few human-readable library names, find all their dependencies
243# and sort them into an order which the linker will like. If we packed
244# our libraries into fewer archives, we could make the linker do much
245# of this work for us.
246#
247# Libraries have two different types of names in this code: Human-friendly
248# "component" names entered on the command-line, and the raw file names
249# we use internally (and ultimately pass to the linker).
250#
251# To understand this code, you'll need a working knowledge of Perl 5,
252# and possibly some quality time with 'man perlref'.
253
254sub load_dependencies;
255sub build_name_map;
Reid Spencerb195d9d2006-03-23 23:21:29 +0000256sub have_native_backend;
257sub find_best_engine;
Reid Spencerf2722ca2006-03-22 15:59:55 +0000258sub expand_names (@);
259sub find_all_required_sets (@);
260sub find_all_required_sets_helper ($$@);
Reid Spencerf2722ca2006-03-22 15:59:55 +0000261
262# Each "set" contains one or more libraries which must be included as a
263# group (due to cyclic dependencies). Sets are represented as a Perl array
264# reference pointing to a list of internal library names.
265my @SETS;
266
267# Various mapping tables.
268my %LIB_TO_SET_MAP; # Maps internal library names to their sets.
269my %SET_DEPS; # Maps sets to a list of libraries they depend on.
270my %NAME_MAP; # Maps human-entered names to internal names.
271
272# Have our dependencies been loaded yet?
273my $DEPENDENCIES_LOADED = 0;
274
275# Given a list of human-friendly component names, translate them into a
276# complete set of linker arguments.
Reid Spencerd8c20a92006-08-03 21:45:35 +0000277sub expand_dependencies (@) {
Reid Spencerf2722ca2006-03-22 15:59:55 +0000278 my @libs = @_;
279 load_dependencies;
280 my @required_sets = find_all_required_sets(expand_names(@libs));
281 my @sorted_sets = topologically_sort_sets(@required_sets);
282
Chris Lattner06e752e2006-06-02 00:56:15 +0000283 # Expand the library sets into libraries.
Reid Spencerf2722ca2006-03-22 15:59:55 +0000284 my @result;
285 foreach my $set (@sorted_sets) { push @result, @{$set}; }
Chris Lattner06e752e2006-06-02 00:56:15 +0000286 return @result;
Reid Spencerf2722ca2006-03-22 15:59:55 +0000287}
288
289# Load in the raw dependency data stored at the end of this file.
290sub load_dependencies {
291 return if $DEPENDENCIES_LOADED;
292 $DEPENDENCIES_LOADED = 1;
293 while (<DATA>) {
294 # Parse our line.
Anton Korobeynikovde9c02b2006-08-04 21:52:23 +0000295 my ($libs, $deps) = /^\s*([^:]+):\s*(.*)\s*$/;
Reid Spencerf2722ca2006-03-22 15:59:55 +0000296 die "Malformed dependency data" unless defined $deps;
297 my @libs = split(' ', $libs);
298 my @deps = split(' ', $deps);
299
300 # Record our dependency data.
301 my $set = \@libs;
302 push @SETS, $set;
303 foreach my $lib (@libs) { $LIB_TO_SET_MAP{$lib} = $set; }
304 $SET_DEPS{$set} = \@deps;
305 }
306 build_name_map;
307}
308
309# Build a map converting human-friendly component names into internal
310# library names.
311sub build_name_map {
312 # Add entries for all the actual libraries.
313 foreach my $set (@SETS) {
314 foreach my $lib (sort @$set) {
315 my $short_name = $lib;
316 $short_name =~ s/^(lib)?LLVM([^.]*)\..*$/$2/;
317 $short_name =~ tr/A-Z/a-z/;
318 $NAME_MAP{$short_name} = [$lib];
319 }
320 }
321
Anton Korobeynikov3c3bc482008-08-17 13:53:59 +0000322 # Add target-specific entries
323 foreach my $target (@TARGETS_BUILT) {
324 # FIXME: Temporary, until we don't switch all targets
325 if (defined $NAME_MAP{$target.'asmprinter'}) {
326 $NAME_MAP{$target} = [$target.'asmprinter', $target.'codegen']
327 }
328 }
329
Reid Spencerf2722ca2006-03-22 15:59:55 +0000330 # Add virtual entries.
Reid Spencerb195d9d2006-03-23 23:21:29 +0000331 $NAME_MAP{'native'} = have_native_backend() ? [$ARCH] : [];
Anton Korobeynikov3c3bc482008-08-17 13:53:59 +0000332 $NAME_MAP{'nativecodegen'} = have_native_backend() ? [$ARCH.'codegen'] : [];
Reid Spencerb195d9d2006-03-23 23:21:29 +0000333 $NAME_MAP{'backend'} = have_native_backend() ? ['native'] : ['cbackend'];
334 $NAME_MAP{'engine'} = find_best_engine;
335 $NAME_MAP{'all'} = [name_map_entries]; # Must be last.
Reid Spencerf2722ca2006-03-22 15:59:55 +0000336}
337
Reid Spencerb195d9d2006-03-23 23:21:29 +0000338# Return true if we have a native backend to use.
339sub have_native_backend {
Reid Spencerf2722ca2006-03-22 15:59:55 +0000340 my %BUILT;
341 foreach my $target (@TARGETS_BUILT) { $BUILT{$target} = 1; }
Reid Spencerb195d9d2006-03-23 23:21:29 +0000342 return defined $NAME_MAP{$ARCH} && defined $BUILT{$ARCH};
343}
344
345# Find a working subclass of ExecutionEngine for this platform.
346sub find_best_engine {
347 if (have_native_backend && $TARGET_HAS_JIT) {
Reid Spencer1c070fc2006-03-24 01:10:39 +0000348 return ['jit', 'native'];
Reid Spencerf2722ca2006-03-22 15:59:55 +0000349 } else {
Reid Spencerb195d9d2006-03-23 23:21:29 +0000350 return ['interpreter'];
Reid Spencerf2722ca2006-03-22 15:59:55 +0000351 }
352}
353
354# Get all the human-friendly component names.
355sub name_map_entries {
356 load_dependencies;
357 return sort keys %NAME_MAP;
358}
359
360# Map human-readable names to internal library names.
361sub expand_names (@) {
362 my @names = @_;
363 my @result;
364 foreach my $name (@names) {
365 if (defined $LIB_TO_SET_MAP{$name}) {
366 # We've hit bottom: An actual library name.
367 push @result, $name;
368 } elsif (defined $NAME_MAP{$name}) {
369 # We've found a short name to expand.
370 push @result, expand_names(@{$NAME_MAP{$name}});
371 } else {
372 print STDERR "llvm-config: unknown component name: $name\n";
373 exit(1);
374 }
375 }
376 return @result;
377}
378
379# Given a list of internal library names, return all sets of libraries which
380# will need to be included by the linker (in no particular order).
381sub find_all_required_sets (@) {
382 my @libs = @_;
383 my %sets_added;
384 my @result;
385 find_all_required_sets_helper(\%sets_added, \@result, @libs);
386 return @result;
387}
388
389# Recursive closures are pretty broken in Perl, so we're going to separate
390# this function from find_all_required_sets and pass in the state we need
391# manually, as references. Yes, this is fairly unpleasant.
392sub find_all_required_sets_helper ($$@) {
393 my ($sets_added, $result, @libs) = @_;
394 foreach my $lib (@libs) {
395 my $set = $LIB_TO_SET_MAP{$lib};
396 next if defined $$sets_added{$set};
397 $$sets_added{$set} = 1;
398 push @$result, $set;
399 find_all_required_sets_helper($sets_added, $result, @{$SET_DEPS{$set}});
400 }
401}
402
403# Print a list of sets, with a label. Used for debugging.
404sub print_sets ($@) {
405 my ($label, @sets) = @_;
406 my @output;
407 foreach my $set (@sets) { push @output, join(',', @$set); }
408 print "$label: ", join(';', @output), "\n";
409}
410
411# Returns true if $lib is a key in $added.
412sub has_lib_been_added ($$) {
413 my ($added, $lib) = @_;
414 return defined $$added{$LIB_TO_SET_MAP{$lib}};
415}
416
417# Returns true if all the dependencies of $set appear in $added.
418sub have_all_deps_been_added ($$) {
419 my ($added, $set) = @_;
420 #print_sets(" Checking", $set);
421 #print_sets(" Wants", $SET_DEPS{$set});
422 foreach my $lib (@{$SET_DEPS{$set}}) {
423 return 0 unless has_lib_been_added($added, $lib);
424 }
425 return 1;
426}
427
428# Given a list of sets, topologically sort them using dependencies.
429sub topologically_sort_sets (@) {
430 my @sets = @_;
431 my %added;
432 my @result;
433 SCAN: while (@sets) { # We'll delete items from @sets as we go.
434 #print_sets("So far", reverse(@result));
435 #print_sets("Remaining", @sets);
436 for (my $i = 0; $i < @sets; ++$i) {
437 my $set = $sets[$i];
438 if (have_all_deps_been_added(\%added, $set)) {
439 push @result, $set;
440 $added{$set} = 1;
441 #print "Removing $i.\n";
442 splice(@sets, $i, 1);
443 next SCAN; # Restart our scan.
444 }
445 }
446 die "Can't find a library with no dependencies";
447 }
448 return reverse(@result);
449}
450
Reid Spencerf2722ca2006-03-22 15:59:55 +0000451# Our library dependency data will be added after the '__END__' token, and will
452# be read through the magic <DATA> filehandle.
453__END__