VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/lib/gems/2.5.0/gems/em-udns-0.3.6/ext/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/lib/gems/2.5.0/gems/em-udns-0.3.6/ext/extconf.rb
require "mkmf"
require "rbconfig"
require "fileutils"


def sys(cmd)
  puts "system command:  #{cmd}"
  unless ret = xsystem(cmd)
    raise "system command `#{cmd}' failed, please report to https://github.com/ibc/em-udns/issues"
  end
  ret
end


here = File.expand_path(File.dirname(__FILE__))
udns_tarball = Dir.glob("#{here}/udns-*.tar.gz").first
udns_path = File.basename(udns_tarball, ".tar.gz")

Dir.chdir(here) do
  sys("tar zxf #{udns_tarball}")

  Dir.chdir(udns_path) do
    sys("./configure")

    case host_os = RbConfig::CONFIG["host_os"]
    
    # Linux.
    # Under Linux 64 bits udns must be compiled dynamically (also works for 32 bits):
    #   https://github.com/ibc/em-udns/issues#issue/1
    when /linux/i
      sys("make sharedlib")
      sys("ar r libudns.a *.lo")

    # BSD.
    # TODO: Not tested. Let's try same as under Linux.
    when /bsd/i
      sys("make sharedlib")
      sys("ar r libudns.a *.lo")

    # Solaris.
    # TODO: Not tested. Let's try same as under Linux.
    when /solaris/i
      sys("make sharedlib")
      sys("ar r libudns.a *.lo")
      
    # Mac OSX.
    # TODO: https://github.com/ibc/em-udns/issues#issue/1
    when /darwin|mac os/
      sys("make dylib")
      sys("ar r libudns.a *.lo")

    # Windows.
    # NOTE: udns doesn't work on Windows, but there is a port:
    #   http://network-research.org/udns.html
    when /mswin|msys|mingw32|windows/i
      raise "udns doesn't compile on Windows, you can try a Windows port: http://network-research.org/udns.html," \
            "report to https://github.com/ibc/em-udns/issues"
    
    # Other platforms. Error.
    else
      raise "unknown operating system: #{host_os.inspect}"
      
    end
      
    FileUtils.mv "libudns.a", "../"
    FileUtils.mv "udns.h", "../"
  end

  FileUtils.remove_dir(udns_path, force = true)
end

have_library("udns")  # == -ludns
create_makefile("em-udns/em_udns_ext")

VaKeR 2022