All of lore.kernel.org
 help / color / mirror / Atom feed
* Cross compiling reiserfsprogs-3.6.11
@ 2003-11-21 11:22 Pavel Bartusek
  2003-11-21 11:41 ` Vitaly Fertman
  2003-11-21 13:34 ` Carl-Daniel Hailfinger
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Bartusek @ 2003-11-21 11:22 UTC (permalink / raw)
  To: Reiserfs-List

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

Hi list,

I have downloaded and tried to crosscompile the reiserfsprogs-3.6.11. 
Unfortunatelly, in the config.in is used the macro AC_TRY_RUN which 
prevents it from cross compiling. The attached patch replaces the macro 
and the simple C program for transforming CREDITS file, with a simple 
AWK script.

NOTE: To recreate configure script run autoconf in the reiserfsprogs 
directory.

regards

Pavel Bartusek

pba@sysgo.com

[-- Attachment #2: configure.in.patch --]
[-- Type: text/plain, Size: 2490 bytes --]

--- reiserfsprogs-3.6.11/configure.in.ori	2003-08-01 17:49:31.000000000 +0200
+++ reiserfsprogs-3.6.11/configure.in	2003-11-21 11:39:14.000000000 +0100
@@ -18,7 +18,7 @@
 
 dnl Checks for programs.
 AC_PROG_RANLIB
-dnl AC_PROG_AWK
+AC_PROG_AWK
 dnl AC_PROG_INSTALL
 dnl AC_PROG_LN_S
 
@@ -50,78 +50,41 @@
   fi
 ])
 
-AC_DEFUN(AC_PREPARE_CREDITS,
-[
-
-AC_MSG_CHECKING(for CREDITS)
-
-AC_TRY_RUN([
-#define _GNU_SOURSE
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-int main (void) {
-    FILE *fin, *fout;
-    char *line = NULL;
-    unsigned int len = 0;
-    int start, count;
-    
-    if ((fin = fopen("CREDITS", "r")) == NULL) {
-	fprintf(stderr, "Error occured while openning the file 'CREDITS': "
-	    "%s.\n", strerror(errno));
-
-	return 1;
-    }
-
-    if ((fout = fopen("include/credits.h", "w")) == NULL) {
-	fprintf(stderr, "Error occured while openning the file 'credits.h': "
-	    "%s.\n", strerror(errno));
-	
-	return 1;
-    }
-     
-    /* Replicate the header. */
-    while (getline(&line, &len, fin) != -1) {
-	fprintf(fout, line);
-	
-	if (!strcmp(line, "\n"))
-	    break;
-    }
-    
-    fprintf(fout, "char *credits[] = {\n");
-    
-    start = 2; count = 0;
-    
-    while (getline(&line, &len, fin) != -1) {
-	if (!strcmp(line, "\n") || strlen(line) < 1) {
-	    start = 1;
-	    count++;
+credits="./CREDITS"
+AC_MSG_CHECKING(for $credits)
+if test -r $credits ; then
+ AC_MSG_RESULT(yes)
+else 
+ AC_MSG_ERROR(Missing file $credits)
+fi 
+
+$AWK ['
+BEGIN	{in_header = 1; start = 2; count = 0}
+
+{
+	if (in_header) {
+		print $0
+		if ($0 == "") {
+			in_header = 0;
+			printf "char *credits[] = {\n"
+		}
 	} else {
-	    if (!start)
-		fprintf(fout, "\t\\\" "\n");
-	    else if (start == 1)
-		fprintf(fout, ",\n\n");
-	    
-	    line[strlen(line) - 1] = 0;
-	    fprintf(fout, "\t\"%s\\\n\"", line);
-	    start = 0;
-	}
-    }
-    
-    fprintf(fout, "\n};\n");
-    fprintf(fout, "#define CREDITS_COUNT %d\n", count);
-    
-    free(line);
-    fclose(fin);
-    fclose(fout);
-    
-    return 0;
+		if (($0 == "") || (length($0) < 1)) {
+			start = 1;
+			count++;
+		} else {
+			if (!start)
+				printf "\t\\\n"
+			else if (start == 1)
+				printf ",\n\n"
+			printf "\t\"" $0 "\\n\""
+			start = 0;
+		}
+	}	
 }
-], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) ; exit)
-])
 
-AC_PREPARE_CREDITS()
+END	{ print "\n};\n#define CREDITS_COUNT "  count }
+']  $credits > include/credits.h
 
 AC_OUTPUT(
     include/Makefile 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cross compiling reiserfsprogs-3.6.11
  2003-11-21 11:22 Cross compiling reiserfsprogs-3.6.11 Pavel Bartusek
@ 2003-11-21 11:41 ` Vitaly Fertman
  2003-11-21 13:34 ` Carl-Daniel Hailfinger
  1 sibling, 0 replies; 4+ messages in thread
From: Vitaly Fertman @ 2003-11-21 11:41 UTC (permalink / raw)
  To: Pavel Bartusek, Reiserfs-List

Hi Pavel, 

On Friday 21 November 2003 14:22, Pavel Bartusek wrote:
> Hi list,
>
> I have downloaded and tried to crosscompile the reiserfsprogs-3.6.11.
> Unfortunatelly, in the config.in is used the macro AC_TRY_RUN which
> prevents it from cross compiling. The attached patch replaces the macro
> and the simple C program for transforming CREDITS file, with a simple
> AWK script.
>
> NOTE: To recreate configure script run autoconf in the reiserfsprogs
> directory.
>
> regards
>
> Pavel Bartusek
>
> pba@sysgo.com

I will try the patch, thank you.
Vitaly Fertman

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cross compiling reiserfsprogs-3.6.11
  2003-11-21 11:22 Cross compiling reiserfsprogs-3.6.11 Pavel Bartusek
  2003-11-21 11:41 ` Vitaly Fertman
@ 2003-11-21 13:34 ` Carl-Daniel Hailfinger
  2003-11-21 19:10   ` Vitaly Fertman
  1 sibling, 1 reply; 4+ messages in thread
From: Carl-Daniel Hailfinger @ 2003-11-21 13:34 UTC (permalink / raw)
  To: Pavel Bartusek; +Cc: Reiserfs-List

Pavel Bartusek wrote:
> Hi list,
> 
> I have downloaded and tried to crosscompile the reiserfsprogs-3.6.11.
[...]
> -#define _GNU_SOURSE

Vitaly, are you aware that the above is a typo and will not work.


Regards,
Carl-Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Cross compiling reiserfsprogs-3.6.11
  2003-11-21 13:34 ` Carl-Daniel Hailfinger
@ 2003-11-21 19:10   ` Vitaly Fertman
  0 siblings, 0 replies; 4+ messages in thread
From: Vitaly Fertman @ 2003-11-21 19:10 UTC (permalink / raw)
  To: Carl-Daniel Hailfinger, Pavel Bartusek; +Cc: Reiserfs-List

On Friday 21 November 2003 16:34, Carl-Daniel Hailfinger wrote:
> Pavel Bartusek wrote:
> > Hi list,
> >
> > I have downloaded and tried to crosscompile the reiserfsprogs-3.6.11.
>
> [...]
>
> > -#define _GNU_SOURSE
>
> Vitaly, are you aware that the above is a typo and will not work.

Yes, it was already fixed in 3.6.12-pre1, but anyway thanks a lot.
Vitaly Fertman



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-21 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-21 11:22 Cross compiling reiserfsprogs-3.6.11 Pavel Bartusek
2003-11-21 11:41 ` Vitaly Fertman
2003-11-21 13:34 ` Carl-Daniel Hailfinger
2003-11-21 19:10   ` Vitaly Fertman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.