All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Bartusek <pba@sysgo.com>
To: Reiserfs-List@namesys.com
Subject: Cross compiling reiserfsprogs-3.6.11
Date: Fri, 21 Nov 2003 12:22:25 +0100	[thread overview]
Message-ID: <3FBDF571.5070100@sysgo.com> (raw)

[-- 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 

             reply	other threads:[~2003-11-21 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-21 11:22 Pavel Bartusek [this message]
2003-11-21 11:41 ` Cross compiling reiserfsprogs-3.6.11 Vitaly Fertman
2003-11-21 13:34 ` Carl-Daniel Hailfinger
2003-11-21 19:10   ` Vitaly Fertman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FBDF571.5070100@sysgo.com \
    --to=pba@sysgo.com \
    --cc=Reiserfs-List@namesys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.