aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2005-11-09 18:37:07 -0400
committerTheodore Ts'o <tytso@mit.edu>2005-11-09 18:37:07 -0400
commitdd947da232d2442f86c2f4d595cf7d3b76604e49 (patch)
treef19e5e1651356dfc257a1aa4ba08ac748d996361
parent8dceb92407f751d1a8aecd4bfb36d1fe2dc3cf9a (diff)
downloade2fsprogs-dd947da232d2442f86c2f4d595cf7d3b76604e49.tar.gz
e2fsprogs-dd947da232d2442f86c2f4d595cf7d3b76604e49.tar.xz
e2fsprogs-dd947da232d2442f86c2f4d595cf7d3b76604e49.zip
Fix cross-compilation problems when CFLAGS contain target-specific options
Use BUILD_CCFLAGS and BUILD_LDFLAGS instead of CCFLAGS and LDFLAGS in the build system when building files in the util directory which are needed during the build process. This avoids potential problems when cross-compiling some of the options are not recognized as valid by the host compiler. (Addresses Sourceforge Bug #1261547) Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--ChangeLog8
-rw-r--r--MCONFIG.in2
-rwxr-xr-xconfigure13
-rw-r--r--configure.in12
-rw-r--r--util/ChangeLog8
-rw-r--r--util/Makefile.in6
6 files changed, 45 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 550a662f..ce963a6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-26 Theodore Ts'o <tytso@mit.edu>
+
+ * MCONFIG.in, configure.in: Use BUILD_CCFLAGS and BUILD_LDFLAGS
+ instead of CCFLAGS and LDFLAGS when to avoid potential
+ problems when cross-compiling some of the options are not
+ recognized as valid by the host compiler. (Addresses
+ Sourceforge Bug #1261547)
+
2006-06-30 Theodore Ts'o <tytso@mit.edu>
* Release of E2fsprogs 1.38
diff --git a/MCONFIG.in b/MCONFIG.in
index ce6329f7..991aaa0d 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -40,6 +40,8 @@ ALL_CFLAGS = $(CPPFLAGS) $(DEFS) $(USE_WFLAGS) $(CFLAGS) $(XTRA_CFLAGS) \
$(INTL_FLAGS) $(LINUX_INCLUDE)
LDFLAGS = @LDFLAGS@
ALL_LDFLAGS = $(LDFLAGS)
+BUILD_CFLAGS = @BUILD_CFLAGS@
+BUILD_LDFLAGS = @BUILD_LDFLAGS@
RM = @RM@
LN = @LN@
LN_S = @LN_S@
diff --git a/configure b/configure
index b22a2013..e9d719b5 100755
--- a/configure
+++ b/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS E2FSPROGS_YEAR E2FSPROGS_MONTH E2FSPROGS_DAY E2FSPROGS_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LD CPP EGREP LINUX_INCLUDE MAINTAINER_CMT HTREE_CMT ELF_CMT BSDLIB_CMT PROFILE_CMT CHECKER_CMT LIB_EXT STATIC_LIB_EXT PROFILED_LIB_EXT SWAPFS_CMT DEBUGFS_CMT IMAGER_CMT RESIZER_CMT E2FSCK_TYPE FSCK_PROG FSCK_MAN E2INITRD_PROG E2INITRD_MAN GETTEXT_PACKAGE PACKAGE VERSION SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE RANLIB ac_ct_RANLIB ALLOCA GLIBC21 HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB BINARY_TYPE LN LN_S MV CP RM CHMOD AWK SED PERL LDCONFIG AR ac_ct_AR STRIP ac_ct_STRIP BUILD_CC SIZEOF_SHORT SIZEOF_INT SIZEOF_LONG SIZEOF_LONG_LONG SOCKET_LIB DLOPEN_LIB LINUX_CMT CYGWIN_CMT UNIX_CMT root_prefix root_bindir root_sbindir root_libdir root_sysconfdir LDFLAG_STATIC SS_DIR ET_DIR DO_TEST_SUITE INTL_FLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS E2FSPROGS_YEAR E2FSPROGS_MONTH E2FSPROGS_DAY E2FSPROGS_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LD CPP EGREP LINUX_INCLUDE MAINTAINER_CMT HTREE_CMT ELF_CMT BSDLIB_CMT PROFILE_CMT CHECKER_CMT LIB_EXT STATIC_LIB_EXT PROFILED_LIB_EXT SWAPFS_CMT DEBUGFS_CMT IMAGER_CMT RESIZER_CMT E2FSCK_TYPE FSCK_PROG FSCK_MAN E2INITRD_PROG E2INITRD_MAN GETTEXT_PACKAGE PACKAGE VERSION SET_MAKE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE RANLIB ac_ct_RANLIB ALLOCA GLIBC21 HAVE_POSIX_PRINTF HAVE_ASPRINTF HAVE_SNPRINTF HAVE_WPRINTF LIBICONV LTLIBICONV INTLBISON BUILD_INCLUDED_LIBINTL USE_INCLUDED_LIBINTL CATOBJEXT DATADIRNAME INSTOBJEXT GENCAT INTLOBJS INTL_LIBTOOL_SUFFIX_PREFIX INTLLIBS LIBINTL LTLIBINTL POSUB BINARY_TYPE LN LN_S MV CP RM CHMOD AWK SED PERL LDCONFIG AR ac_ct_AR STRIP ac_ct_STRIP BUILD_CC SIZEOF_SHORT SIZEOF_INT SIZEOF_LONG SIZEOF_LONG_LONG SOCKET_LIB DLOPEN_LIB LINUX_CMT CYGWIN_CMT UNIX_CMT root_prefix root_bindir root_sbindir root_libdir root_sysconfdir LDFLAG_STATIC SS_DIR ET_DIR DO_TEST_SUITE INTL_FLAGS BUILD_CFLAGS BUILD_LDFLAGS LIBOBJS LTLIBOBJS'
ac_subst_files='MCONFIG MAKEFILE_ELF MAKEFILE_BSDLIB MAKEFILE_PROFILE MAKEFILE_CHECKER MAKEFILE_LIBRARY'
# Initialize some variables set by options.
@@ -14247,6 +14247,15 @@ if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
fi
+if test $cross_compiling = no; then
+ BUILD_CFLAGS="$CFLAGS"
+ BUILD_LDFLAGS="$LDFLAGS"
+else
+ BUILD_CFLAGS=
+ BUILD_LDFLAGS=
+fi
+
+
test -d lib || mkdir lib
test -d include || mkdir include
test -d include/linux || mkdir include/linux
@@ -15031,6 +15040,8 @@ s,@SS_DIR@,$SS_DIR,;t t
s,@ET_DIR@,$ET_DIR,;t t
s,@DO_TEST_SUITE@,$DO_TEST_SUITE,;t t
s,@INTL_FLAGS@,$INTL_FLAGS,;t t
+s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
+s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
/@MCONFIG@/r $MCONFIG
diff --git a/configure.in b/configure.in
index 1c1351ad..44166b39 100644
--- a/configure.in
+++ b/configure.in
@@ -791,6 +791,18 @@ if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
fi
AC_SUBST(INTL_FLAGS)
dnl
+dnl Build CFLAGS
+dnl
+if test $cross_compiling = no; then
+ BUILD_CFLAGS="$CFLAGS"
+ BUILD_LDFLAGS="$LDFLAGS"
+else
+ BUILD_CFLAGS=
+ BUILD_LDFLAGS=
+fi
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(BUILD_LDFLAGS)
+dnl
dnl Make our output files, being sure that we create the some miscellaneous
dnl directories
dnl
diff --git a/util/ChangeLog b/util/ChangeLog
index df1a439d..d345c902 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,11 @@
+2005-10-26 Theodore Ts'o <tytso@mit.edu>
+
+ * Makefile.in: Use BUILD_CCFLAGS and BUILD_LDFLAGS instead of
+ CCFLAGS and LDFLAGS when to avoid potential problems when
+ cross-compiling some of the options are not recognized as
+ valid by the host compiler. (Addresses Sourceforge Bug
+ #1261547)
+
2005-07-19 Theodore Ts'o <tytso@mit.edu>
* all.exclude, subset.exclude: Remove BitKeeper and add
diff --git a/util/Makefile.in b/util/Makefile.in
index 8ec00c90..4c3d07ce 100644
--- a/util/Makefile.in
+++ b/util/Makefile.in
@@ -15,7 +15,7 @@ SRCS = $(srcdir)/subst.c
.c.o:
@echo " CC $<"
- @$(BUILD_CC) -c $(ALL_CFLAGS) $< -o $@
+ @$(BUILD_CC) -c $(BUILD_CFLAGS) $< -o $@
PROGS= subst
@@ -23,11 +23,11 @@ all:: $(PROGS) gen-tarball
subst: subst.o
@echo " LD $@"
- @$(BUILD_CC) $(ALL_LDFLAGS) -o subst subst.o
+ @$(BUILD_CC) $(BUILD_LDFLAGS) -o subst subst.o
copy_sparse: copy_sparse.o
@echo " LD $@"
- @$(BUILD_CC) $(ALL_LDFLAGS) -o copy_sparse copy_sparse.o
+ @$(BUILD_CC) $(BUILD_LDFLAGS) -o copy_sparse copy_sparse.o
gen-tarball: $(srcdir)/gen-tarball.in $(top_builddir)/config.status
@echo " CONFIG.STATUS $@"