#!/usr/bin/perl -w
#
# @(#)$Id: esqlld,v 56.1 1997/06/17 17:54:59 johnl Exp $ 
#
# DBD::Informix for Perl Version 5
#
# Surrogate Linker for Informix ESQL/C versions 4.10.UC1 upwards
# -- Used to create shared libraries.
#
# Copyright (c) 1996,1997 Jonathan Leffler
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.

@ARGS = ();

for $arg (@ARGV)
{
	push @ARGS, $arg unless ($arg =~ /^-[DIU]/o);
}

# Sort out the real compiler.
# Note that if $ENV{ESQLLD} contains, for example, 'cc -G', then we
# need to split this into two words for the exec to work correctly.
$cmd = $ENV{ESQLLD};
$cmd = 'cc' unless ($cmd);
@cmd = split /\s+/, $cmd;

# print STDERR "@cmd @ARGS -lc\n";
exec @cmd, @ARGS, "-lc";
