From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OrfJl-0007AO-Gv for garchives@archives.gentoo.org; Fri, 03 Sep 2010 23:05:09 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF0BDE0799 for ; Fri, 3 Sep 2010 23:05:08 +0000 (UTC) Received: from mail-iw0-f181.google.com (mail-iw0-f181.google.com [209.85.214.181]) by pigeon.gentoo.org (Postfix) with ESMTP id B40C3E08C1 for ; Fri, 3 Sep 2010 22:25:32 +0000 (UTC) Received: by iwn39 with SMTP id 39so2294900iwn.40 for ; Fri, 03 Sep 2010 15:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=WZAu3HvekV3N4DZPr4uHxR78CVB/pYCHlrqZsyDIqaY=; b=B2F3TPxF1PYJvnufRycO8uoRIEuz0v/TafuoaZzQcBu5T+R2odKDfmMmkJl3sVMlue Po49wa7607nJoAbhWS7QIDoTwZ2TzMp2D+4XF+Va4+1w9xUIyloKeo48wPby/xz5THR4 ocUE8HVADBDlDf7+NEWcrTK+pqUIa+8TeNZs8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ZEkb2AQ45yEaPP0EQgKg4LZi84EO5EfzLnN19hpSijVaiFxXzC43kfBqaX+oZPeIOF ymMJdm6KuxiFtc6oWF0F/2ZUCRUCWge6mJxJjipXoxHu1DMfS1mLUnUrKC/c6RQ1Rc2b SPtw8ne4nwa3PIE1wussNYIhyfJuhBVu88SYA= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.231.159.203 with SMTP id k11mr1553102ibx.115.1283552732170; Fri, 03 Sep 2010 15:25:32 -0700 (PDT) Received: by 10.231.37.138 with HTTP; Fri, 3 Sep 2010 15:25:32 -0700 (PDT) In-Reply-To: <20100903220429.4c949e46@scooter.muppet.show> References: <20100903220429.4c949e46@scooter.muppet.show> Date: Sat, 4 Sep 2010 00:25:32 +0200 Message-ID: Subject: Re: [gentoo-user] gawk and filefuncs From: Al To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: 702ccc1c-5417-48da-90f4-588fcf21d83a X-Archives-Hash: 69697fb83651ad67c3b7f51ea71f505a > > The gawk source distribution comes with a number of such extensions in the > (doh) extensions/ directory. filefuncs.c is such one extension, which > demonstrate how to add stat() and chdir() capabilities to awk. > The file is compiled into a .so file, which is then referenced from within > gawk to make the extended commands available. > > A vanilla build of gawk does not have any dynamic extension. > > > Now, the Gentoo devs at some point in the past (very early) took that file > (filefuncs.c) and extended it to implement new commands like "symlink", > "unlink", "mkdir", "rmdir" and "stat", so those are callable from within > awk, effectively extending the language. (you can see the Gentoo copyright > in the file, look > into /usr/portage/sys-apps/gawk/files/filefuncs/filefuncs.c) > > There are a number of Gentoo system scripts that use those awk extensions > (look into /lib/rcscripts and /lib/rcscripts/awk), which means that > compiling the expanded filefuncs.c (not the vanilla one) is mandatory on a > Gentoo system, because there are awk scripts that rely on the extended > functionaltiy provided by it. Hence Gentoo maintains the filefuncs.c file > independently, and the gawk ebuild, besides building gawk itself, also takes > care of building filefuncs.c containing the extensions. > > Thank you very much. That is the best explanation a read to this. It should be deliverd with the sources. Still the procedure is unusual. They could apply a patch to extensions/ filefuncs.c and exclude it for vanilla. I have a second issue. When compiling gawk on Cygwin, where is no windows kernel, the Gentoo version of filefuncs breaks. I have to disable it in the ebuild to get gawk compiled. filefuncs.o:filefuncs.c:(.text+0x1e): undefined reference to `_make_builtin' [... lots of this ... ] filefuncs.o:filefuncs.c:(.text+0x10f1): undefined reference to `_update_ERRNO' collect2: ld returned 1 exit status make: *** [filefuncs.so.0.0.1] Error 1 You say it is mandatory on a Gentoo system, because there are awk scripts that rely on. Do this functions break because of the missing kernel? What would be the workaround? Thanks Al