cross compilation fixes
authorMiklos Szeredi <miklos@szeredi.hu>
Wed, 26 Dec 2001 18:08:09 +0000 (18:08 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Wed, 26 Dec 2001 18:08:09 +0000 (18:08 +0000)
configure.in
kernel/Makefile.am
lib/fuse.c
util/fusermount.c

index a6f94c8fdb9654673ff73c49715ddea1b6ed1fa9..98c88d238bbac7317ce2c4552ee983785995f66a 100644 (file)
@@ -5,6 +5,11 @@ AM_CONFIG_HEADER(include/config.h)
 AC_PROG_CC
 AC_PROG_RANLIB
 
+if test -z "$LD"; then
+       LD=ld
+fi
+AC_SUBST(LD)
+
 CFLAGS="-Wall -W -g -O2"
 
 AC_MSG_CHECKING([kernel source directory])
@@ -25,6 +30,14 @@ if test -z "$kernelsrc"; then
        fi
 fi
 AC_MSG_RESULT([$kernelsrc])
+
+oldcc=$CC
+oldcross_compiling=$cross_compiling
+if test "$cross_compiling" = yes; then
+       CC=gcc
+       cross_compiling=no
+fi
+
 AC_MSG_CHECKING([kernel source version])
 kernsrcver=`AC_TRY_RUN([
 #include "$kernelsrc/include/linux/version.h"
@@ -44,6 +57,9 @@ if test -z "$kernsrcver"; then
 fi
 AC_MSG_RESULT([$kernsrcver])
 
+CC=$oldcc
+cross_compiling=$oldcross_compiling
+
 KERNINCLUDE=$kernelsrc/include
 AC_SUBST(KERNINCLUDE)
 kmoduledir=/lib/modules/$kernsrcver
index 033c8cb3352e8af1e13874a6c735dd0c196d1c51..86d0e9fe8eed928e1f94d9a2c40c0a5143081976 100644 (file)
@@ -3,6 +3,7 @@
 EXTRA_DIST = dev.c dir.c file.c inode.c util.c fuse_i.h
 
 CC = @CC@
+LD = @LD@
 CFLAGS = -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -pipe
 CPPFAGS = -I@KERNINCLUDE@ -I../include -D__KERNEL__ -DMODULE -D_LOOSE_KERNEL_NAMES
 INSTALL = @INSTALL@
@@ -31,7 +32,7 @@ clean-local:
 fuse_objs = dev.o dir.o file.o inode.o util.o
 
 fuse.o: $(fuse_objs)
-       ld -r -o fuse.o $(fuse_objs)
+       $(LD) -r -o fuse.o $(fuse_objs)
 
 fuse_headers = fuse_i.h ../include/linux/fuse.h
 
index 541014f4ccb4706684bd760b93e1d96f2c74f384..45a0dc5a40dc5a6053d8b9a12cd4846342470177 100644 (file)
@@ -14,6 +14,7 @@
 #include <unistd.h>
 #include <limits.h>
 #include <errno.h>
+#include <sys/param.h>
 
 #define FUSE_MAX_PATH 4096
 
index 94f435fc33a81cd1f4641b341100a0a490e716f8..b3f46cfd407ef0d229f861fc37479454bc361e05 100644 (file)
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 #include <pwd.h>
 #include <mntent.h>
-#include <limits.h>
+#include <sys/param.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <sys/mount.h>