[PATCH] udev/libsysfs cross compile fixes
I noticed that libsysfs doesn't inherently grab cross compilation arguments that are set in the top-level Makefile, so I've come up with the following patch to fix this. With the patch, I can succesfully cross compile for other architectures (such as sh) by doing 'make ARCH=sh CROSS=sh-linux-' in the top-level directory.
This commit is contained in:
parent
63dde9f8eb
commit
b137e367bb
2
Makefile
2
Makefile
|
@ -38,7 +38,9 @@ CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
|
||||||
CC = $(CROSS)gcc
|
CC = $(CROSS)gcc
|
||||||
AR = $(CROSS)ar
|
AR = $(CROSS)ar
|
||||||
STRIP = $(CROSS)strip
|
STRIP = $(CROSS)strip
|
||||||
|
RANLIB = $(CROSS)ranlib
|
||||||
|
|
||||||
|
export CROSS CC AR STRIP RANLIB
|
||||||
|
|
||||||
# code taken from uClibc to determine the current arch
|
# code taken from uClibc to determine the current arch
|
||||||
ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
|
ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
# Makefile for libsysfs.a
|
# Makefile for libsysfs.a
|
||||||
# Copyright (c) International Business Machines Corp., 2003
|
# Copyright (c) International Business Machines Corp., 2003
|
||||||
|
|
||||||
CC=gcc
|
|
||||||
|
|
||||||
H_INCLUDE=../include
|
H_INCLUDE=../include
|
||||||
LIB_INCLUDE=.
|
LIB_INCLUDE=.
|
||||||
OBJS=sysfs_bus.o sysfs_class.o sysfs_device.o sysfs_dir.o sysfs_driver.o \
|
OBJS=sysfs_bus.o sysfs_class.o sysfs_device.o sysfs_dir.o sysfs_driver.o \
|
||||||
|
@ -19,8 +17,8 @@ LIBSYSFS=libsysfs.a
|
||||||
RM=rm -f
|
RM=rm -f
|
||||||
|
|
||||||
libsysfs.a: $(OBJS)
|
libsysfs.a: $(OBJS)
|
||||||
ar cru $(LIBSYSFS) $(OBJS)
|
$(AR) cru $(LIBSYSFS) $(OBJS)
|
||||||
ranlib $(LIBSYSFS)
|
$(RANLIB) $(LIBSYSFS)
|
||||||
|
|
||||||
sysfs_bus.o: sysfs_bus.c
|
sysfs_bus.o: sysfs_bus.c
|
||||||
$(CC) -I$(H_INCLUDE) -I$(LIB_INCLUDE) $(CFLAGS) -c sysfs_bus.c
|
$(CC) -I$(H_INCLUDE) -I$(LIB_INCLUDE) $(CFLAGS) -c sysfs_bus.c
|
||||||
|
|
Loading…
Reference in New Issue