Author: John V. Belmonte <jbelmonte@debian.org>
Description: Add support for Debian package to makefiles.
--- /dev/null
+++ lua50-5.0.3/lua-config50
@@ -0,0 +1,165 @@
+#!/usr/bin/lua50
+-- -*- Lua -*-
+
+-- This file is under the terms of the MIT licence. Do as you will.
+
+-- Process the arg table
+function usage()
+   info();
+   io.stderr:write([[Usage: lua-config50 <options>
+
+  Valid options are:
+
+  --include      Outputs the -I switches needed to find <lua.h> etc.
+
+  --static       Outputs the full path to the static libraries
+
+  --libs         Outputs the -L and -l switches needed to find the library
+  --libs-only-L  Outputs only the -L switches
+  --libs-only-l  Outputs only the -l switches
+
+  --extralibs    Outputs the -l switches appropriate to the extra libs needed by lua
+
+  Note that --static is mututally exclusive with the --libs* options
+
+  Also, you can specify the following
+
+  --vmonly       Outputs only the switches for finding the VM libraries
+  --libonly      Outputs only the switches for finding the standard libraries
+  --both         Outputs the switches for both [The default]
+
+  Example:
+
+  gcc `lua-config50 --include` my_prog.c -o my_prog `lua-config50 --libs`
+
+]] );
+   os.exit(1);
+end
+
+function version()
+   io.stdout:write( [[5.0.0
+]] );
+   os.exit(0);
+end
+
+function info()
+   io.stdout:write( [[lua-config version 1.10 (c) Daniel Silverstone 2002
+
+lua-config was written for the Debian GNU/Linux project. This version
+of lua-config will provide switches appropriate to Lua 5.0
+
+]] );
+end
+
+if( table.getn(arg) == 0 ) then
+   usage()
+end
+
+output_vm      = 1
+output_lib     = 1
+
+output_static  = 0
+output_libs_l  = 0
+output_libs_L  = 0
+output_include = 0
+output_extras  = 0
+
+table.foreachi( arg,
+	 function(n,param)
+	    if( param == '--version' ) then
+	       version()
+	    end
+	    if( param == '--help' ) then
+	       usage()
+	    end
+	    if( param == '--include' ) then
+	       output_include = 1;
+	       return
+	    end
+	    if( param == '--libs' ) then
+	       output_libs_l = 1;
+	       output_libs_L = 1;
+	       return
+	    end
+	    if( param == '--libs-only-L' ) then
+	       output_libs_L = 1;
+	       return
+	    end
+	    if( param == '--libs-only-l' ) then
+	       output_libs_l = 1;
+	       return
+	    end
+	    if( param == '--extralibs' ) then
+	       output_extras = 1;
+	       return
+	    end
+	    if( param == '--static' ) then
+	       output_static = 1;
+	       return
+	    end
+	    if( param == '--vmonly' ) then
+	       output_vm = 1;
+	       output_lib = 0;
+	       return
+	    end
+	    if( param == '--libonly' ) then
+	       output_lib = 1;
+	       output_vm = 0;
+	       return
+	    end
+	    if( param == '--both' ) then
+	       output_lib = 1;
+	       output_vm = 1;
+	       return
+	    end
+	    io.stderr:write( "Unknown argument ", param );
+	    usage();
+	 end );
+
+if( (output_extras + output_libs_l + output_libs_L + output_include + output_static) == 0 ) then
+   usage()
+end
+
+if( (output_static + (output_libs_l or output_libs_L)) > 1 ) then
+   usage();
+end
+
+outargs = {}
+
+if( output_include == 1 ) then
+   table.insert( outargs, "-I/usr/include/lua50" );
+end
+
+if( output_libs_L == 1 ) then
+   table.insert( outargs, "-L/usr/include" );
+end
+
+if( output_libs_l == 1 ) then
+   if( output_lib == 1 ) then
+      table.insert( outargs, "-llualib50" );
+   end
+   if( output_vm == 1 ) then
+      table.insert( outargs, "-llua50" );
+   end
+end
+
+if( output_static == 1 ) then
+   if( output_lib == 1 ) then
+      table.insert( outargs, "/usr/lib/liblualib50.a" );
+   end
+   if( output_vm == 1 ) then
+      table.insert( outargs, "/usr/lib/liblua50.a" );
+   end
+end
+
+if( output_extras == 1 ) then
+   table.insert( outargs, "-lm" );
+end
+
+io.stdout:write( outargs[1] );
+
+for i=2,table.getn(outargs) do
+   io.stdout:write( " ", outargs[i] );
+end
+
+io.stdout:write( "\n" );
--- /dev/null
+++ lua50-5.0.3/lua-config50.1
@@ -0,0 +1,64 @@
+.\" Manual page for lua-config
+.\" Written by Daniel Silverstone <dsilvers@debian.org>
+.\" For the Debian GNU/Linux system
+
+.TH lua-config 1
+.SH NAME
+lua-config \- Lua configuration information
+.SH SYNOPSIS
+Basic usage
+.PP
+.B gcc
+`
+.B lua-config
+.I \-\-include
+`
+my_prog.c
+.B \-o
+my_prog
+`
+.B lua-config
+.I \-\-libs
+`
+
+.SH DESCRIPTION
+The lua-config script allows you to determine useful information
+about the chosen version of lua running on the Debian GNU/Linux
+system in use.
+More information can be found by running
+.B lua-config
+without any arguments.
+.SH CAVEATS
+This script is unique to Debian and as such you shouldn't rely
+on its presence on every system. Lua is an embedded language
+by default and different Linux distributions each take a different
+approach to making it possible to compile with Lua. The
+.B pkg-config
+system also provides a way to look for libraries and is more likely
+to be supported across different Linux distributions. Debian's
+.B pkg-config
+name for Lua 5.0 is
+.I lua50
+and the libraries are in
+.I lualib50.
+These
+.B pkg-config
+files can be found in the
+.I liblua50-dev
+and
+.I liblualib50-dev
+packages.
+.SH AUTHOR
+lua-config was written by
+.B Daniel Silverstone
+.BI <dsilvers@debian.org>.
+
+This manual page was written by
+.B Daniel Silverstone
+.BI <dsilvers@debian.org>.
+For the Debian project. It may be used without restriction in any
+other system.
+.SH "SEE ALSO"
+.IR lua (1)
+.IR pkg-config (1)
+
