[klibc] Detecting KLIBC from userspace

Martin Schlemmer azarah at nosferatu.za.org
Mon Mar 7 11:46:29 PST 2005


On Mon, 2005-03-07 at 10:18 -0800, H. Peter Anvin wrote:
> Martin Schlemmer wrote:
> > 
> > Basically klcc is currently too 'basic' in what flags it supports to
> > work with autotools scripts, etc.  I guess going my suggested way above
> > might be the backwards approach for
> > flags, etc.
> > 
> > But, includedir, libdir, etc might still be interesting to get - for
> > example I want to install the header and lib from device-mapper into
> > klibc's include/lib dirs for multi arch building on one machine, etc.
> > 
> 
> Okay, that stuff should be in 0.215 as "-print-klibc-libdir" etc.
> 

Thanks, appreciated!

Although it does look like you did get my two bounced mails (with the
-l/-L and -M* stuff included), -M, -MM, etc (they do not take arguments
like the other -M?) and --version, -dump* and -print* do not work (-M*
is used by some newer autotools stuff, as well as --version, and here
and there something uses -dump*/print*).

This is sorda what I need, although in no way the best solution :)

-----
--- 1/klcc.in   2005-03-07 21:36:21.000000000 +0200
+++ 2/klcc.in   2005-03-07 21:40:54.000000000 +0200
@@ -118,6 +118,22 @@
     } elsif ( $a =~ /^-Wl,(.*)$/ ) {
        # -Wl used to pass options to the linker
        push(@ldopt, split(/,/, $1));
+    } elsif ( $a =~ /^-print-klibc-(.*)$/ ) {
+        # Options to get info for klibc variables - should be
+       # before below '-(dump|print)' stuff else they take
+       # preference
+       if ( defined($conf{$1}) ) {
+           print ${$conf{$1}}, "\n";
+           exit 0;
+       } else {
+           die "$0: unknown option: $a\n";
+       }
+    } elsif ( $a =~ /^-(dump|print)(.+)$/ ) {
+       # Options to get info from gcc (gcc usually quit after
+       # printing info for the first one) - should be before
+       # next line or the 'd' in '[fmwWQdO]' catches the -dump*
+       push(@ccopt, $a);
+       $operation = 'c' if ( $operation eq '' );
     } elsif ( $a =~ /^-([fmwWQdO]|std=|ansi|pedantic)/ ) {
        # Options to gcc
        push(@ccopt, $a);
@@ -157,14 +173,7 @@
        # Libraries
        push(@libs, $a);
        push(@libs, shift(@ARGV)) if ( $2 eq '' );
-    } elsif ( $a =~ /^-print-klibc-(.*)$/ ) {
-       if ( defined($conf{$1}) ) {
-           print ${$conf{$1}}, "\n";
-           exit 0;
-       } else {
-           die "$0: unknown option: $a\n";
-       }
-    } elsif ( $a =~ /^(-print|-dump|--help)/ ) {
+    } elsif ( $a =~ /^(-print|-dump|--help|--version|-M|-M[MGPD])/ ) {
        # Pseudo-operations; just pass to gcc and don't do anything else
        push(@ccopt, $a);
        $operation = 'c' if ( $operation eq '' );
-----


Thanks,
-- 
Martin Schlemmer



-- 
---------------------[ Ciphire Signature ]----------------------
From: azarah at nosferatu.za.org signed email body (1971 characters)
Date: on 07 March 2005 at 19:43:30 UTC
To:   hpa at zytor.com, klibc at zytor.com
----------------------------------------------------------------
: Ciphire has secured this email against identity theft.
: Free download at www.ciphire.com. The garbled lines
: below are the sender's verifiable digital signature.
----------------------------------------------------------------
00fAAAAAEAAADirixCswcAADUDAAIAAgACACAjYe/qeWoHRrdDE3mOifT0WPgp92
kbkclxgX1lQsV9VwEAJOQiG+Djg3e7Ai63e8AMF0Hl/gle8q4Ud88Lecx5fcVDFb
OrvH8/HC8FhSmT5vDq5iL7KHoOslvlO9Y0OWjgEQ==
------------------[ End Ciphire Signed Message ]----------------



More information about the klibc mailing list