]> Dogcows Code - chaz/yoink/blobdiff - configure
improved build tools
[chaz/yoink] / configure
index d4435162569e366a992f552e31ac3cdaff3added..7a4adbf4997b3d1258e56bd068ef429e011d4859 100755 (executable)
--- a/configure
+++ b/configure
@@ -51,7 +51,7 @@ Basic configuration:
       --mandir=DIR        directory to install manual pages
 
       --disable-dependency-tracking  speed up one-time builds
-      --enable-link-sh    decrease the number of direct dependencies
+      --enable-asneeded   decrease the number of direct dependencies
 
 Program options:
       --enable-debug      include debugging symbols and code paths
@@ -71,8 +71,8 @@ end
 -- Setup a temporary file to collect error messages.
 --
 
-error_log = "config.log"
-os.remove(error_log)
+config_log = "config.log"
+os.remove(config_log)
 
 
 --
@@ -80,19 +80,19 @@ os.remove(error_log)
 --
 
 -- Return true if a file exists, false otherwise.
-function file_exists(file)
-       return os.execute("test -f "..file) == 0
+function file_exists(path)
+       return os.execute(string.format("test -f %q", path)) == 0
 end
 
 -- Print an error message and exit with an error.
 function die(...)
-       for _,value in ipairs(arg) do
+       for i,value in ipairs(arg) do
                print("fatal: "..tostring(value))
        end
-       if file_exists(error_log) then
+       if file_exists(config_log) then
                print()
                print("Look through the file `config.log' for more information:\n")
-               os.execute("tail "..error_log)
+               os.execute("tail "..config_log)
        end
        os.exit(1)
 end
@@ -100,7 +100,8 @@ end
 -- Execute a command and return its output or nil if the command failed to
 -- run.
 function backtick_run(command)
-       local fd = io.popen(command.." 2>>"..error_log)
+       os.execute("echo '# "..command.."' >>"..config_log)
+       local fd = io.popen(command.." 2>>"..config_log)
        if fd then
                local stdout = fd:read("*l")
                fd:close()
@@ -112,7 +113,8 @@ end
 -- Try to execute a command and return true if the command finished
 -- successfully (with an exit code of zero).
 function try_run(command)
-       return os.execute(command.." >/dev/null 2>>"..error_log) == 0
+       os.execute("echo '# "..command.."' >>"..config_log)
+       return os.execute(command.." >/dev/null 2>>"..config_log) == 0
 end
 
 -- Remove the whitespace surrounding a string.
@@ -181,7 +183,7 @@ end
 -- code zero) given some arguments.  Returns nil if none were successful.
 function find_command(commands, args)
        if not args then args = "" end
-       for _,command in ipairs(commands) do
+       for i,command in ipairs(commands) do
                if try_run(command.." "..args) then return command end
        end
        return nil
@@ -295,7 +297,7 @@ do
                print("warning: unknown or incomplete argument "..arg)
        end
 
-       for _,arg in ipairs(arg) do
+       for i,arg in ipairs(arg) do
                parse_arg(arg)
        end
 
@@ -388,7 +390,7 @@ else
 end
 
 -- Check for CXX.
-tmpname                        = os.tmpname()..".c"
+tmpname                        = os.tmpname()..".cpp"
 tmpfile, err   = io.open(tmpname, "w")
 if tmpfile then
        tmpfile:write([[
@@ -470,8 +472,8 @@ config.USE_HOTLOADING               = get_feature("hotloading")
 config.USE_THREADS                     = get_feature("threads")
 config.PROFILING_ENABLED       = get_feature("profile") and add_cflag("-pg")
 
-if get_feature("link-sh") then
-       -- TODO
+if get_feature("asneeded") then
+       define.AS_NEEDED = true
 end
 
 if get_package("gtk") then
This page took 0.025102 seconds and 4 git commands to generate.