bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch] ncurses 5.3: Fix cross-compilation nomenclature confusion


From: Maciej W. Rozycki
Subject: [patch] ncurses 5.3: Fix cross-compilation nomenclature confusion
Date: Tue, 29 Oct 2002 14:33:58 +0100 (MET)

Hello,

 The systems referred to by ncurses when doing a cross-build are named
incorrectly in the configure script and elsewhere.  It is assumed that the
system the binaries are built on is the host system and the system the
resulting binaries are to be run on is the target system.  This
contradicts what is specified by autoconf.  Autoconf defines the system a
build is performed as the build system and the system binaries are for the
host system.  The target system is defined only for software that may act
as cross-tools itself only, usually compilers, debuggers, etc. and is the
system the software can handle somehow.

 Here is an excerpt from autoconf's info pages (as of version 2.54):


`--build=BUILD-TYPE'
     the type of system on which the package is being configured and
     compiled.  It defaults to the result of running `config.guess'.

`--host=HOST-TYPE'
     the type of system on which the package will run.  By default it
     is the same as the build machine.  Specifying it enables the
     cross-compilation mode.

`--target=TARGET-TYPE'
     the type of system for which any compiler tools in the package will
     produce code (rarely needed).  By default, it is the same as host.


 Here is a patch that replaces all references to "host" with "build" and
ones to "target" with "host".  Also the check for a cross-compilation is
replaced with one that is specified by autoconf -- the "cross_compiling" 
variable.  Please apply. 

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: address@hidden, PGP key available        +

ncurses-5.3-host.patch
diff -up --recursive --new-file ncurses-5.3.macro/aclocal.m4 
ncurses-5.3/aclocal.m4
--- ncurses-5.3.macro/aclocal.m4        2002-09-21 23:59:01.000000000 +0000
+++ ncurses-5.3/aclocal.m4      2002-10-19 10:38:02.000000000 +0000
@@ -1128,7 +1128,7 @@ do
                                ldconfig="$LDCONFIG" \
                                overwrite=$WITH_OVERWRITE \
                                depend="$cf_depend" \
-                               target="$target" \
+                               host="$host" \
                                $srcdir/$cf_dir/modules >>$cf_dir/Makefile
                        for cf_subdir2 in $cf_subdirs lib
                        do
diff -up --recursive --new-file ncurses-5.3.macro/configure.in 
ncurses-5.3/configure.in
--- ncurses-5.3.macro/configure.in      2002-09-15 00:11:28.000000000 +0000
+++ ncurses-5.3/configure.in    2002-10-29 13:00:32.000000000 +0000
@@ -88,29 +88,29 @@ if test "$GCC" = yes ; then
 fi
 
 # If we're cross-compiling, allow the user to override the tools and their
-# options.  The configure script is oriented toward identifying the target
-# compiler, etc., but we need a host compiler to generate parts of the source.
+# options.  The configure script is oriented toward identifying the host
+# compiler, etc., but we need a build compiler to generate parts of the source.
 BUILD_CC='$(CC)'
 BUILD_CFLAGS='$(CFLAGS)'
 BUILD_CPPFLAGS='$(CPPFLAGS)'
 BUILD_LDFLAGS='$(LDFLAGS)'
 BUILD_LIBS='$(LIBS)'
-if test "$host_alias" != "$target_alias" ; then
+if test "$cross_compiling" = yes ; then
        AC_ARG_WITH(build-cc,
-               [  --with-build-cc=XXX     if cross-compiling, the host C 
compiler (\$BUILD_CC)],
+               [  --with-build-cc=XXX     if cross-compiling, the build C 
compiler (\$BUILD_CC)],
                [BUILD_CC="$withval"],
                [AC_CHECK_PROGS(BUILD_CC, $CC gcc cc)])
        AC_ARG_WITH(build-cflags,
-               [  --with-build-cflags=XXX if cross-compiling, the host C 
compiler-flags],
+               [  --with-build-cflags=XXX if cross-compiling, the build C 
compiler-flags],
                [BUILD_CFLAGS="$withval"])
        AC_ARG_WITH(build-cppflags,
-               [  --with-build-cppflags=XXX if cross-compiling, the host C 
preprocessor-flags],
+               [  --with-build-cppflags=XXX if cross-compiling, the build C 
preprocessor-flags],
                [BUILD_CPPFLAGS="$withval"])
        AC_ARG_WITH(build-ldflags,
-               [  --with-build-ldflags=XXX if cross-compiling, the host 
linker-flags],
+               [  --with-build-ldflags=XXX if cross-compiling, the build 
linker-flags],
                [BUILD_LDFLAGS="$withval"])
        AC_ARG_WITH(build-libs,
-               [  --with-build-libs=XXX   if cross-compiling, the host 
libraries],
+               [  --with-build-libs=XXX   if cross-compiling, the build 
libraries],
                [BUILD_LIBS="$withval"])
 fi
 AC_SUBST(BUILD_CC)
@@ -1329,7 +1329,7 @@ cf_cv_shlib_version="$cf_cv_shlib_versio
 cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
 cf_cv_system_name="$cf_cv_system_name"
 cf_with_cxx_binding="$cf_with_cxx_binding"
-target="$target"
+host="$host"
 
 ],cat)dnl
 ${MAKE-make} preinstall
diff -up --recursive --new-file ncurses-5.3.macro/mk-1st.awk 
ncurses-5.3/mk-1st.awk
--- ncurses-5.3.macro/mk-1st.awk        2002-04-20 17:32:47.000000000 +0000
+++ ncurses-5.3/mk-1st.awk      2002-10-19 10:37:53.000000000 +0000
@@ -38,7 +38,7 @@
 #      MODEL (e.g., "DEBUG", uppercase; toupper is not portable)
 #      depend (optional dependencies for all objects, e.g, ncurses_cfg.h)
 #      subset ("none", "base", "base+ext_funcs" or "termlib")
-#      target (cross-compile target, if any)
+#      host (cross-compile host, if any)
 #      ShlibVer ("rel", "abi" or "auto", to augment DoLinks variable)
 #      ShlibVerInfix ("yes" or "no", determines location of version #)
 #      DoLinks ("yes", "reverse" or "no", flag to add symbolic links)
@@ -297,7 +297,7 @@ END {
                                printf "../lib/%s : $(%s_OBJS)\n", lib_name, 
OBJS
                                printf "\t$(AR) $(AR_OPTS) $@ $?\n"
                                printf "\t$(RANLIB) address@hidden"
-                               if ( target == "vxworks" )
+                               if ( host == "vxworks" )
                                {
                                        printf "\t$(LD) $(LD_OPTS) $? -o 
$(@:.a=.o)\n"
                                }
@@ -314,7 +314,7 @@ END {
                                        printf "\t(cd $(DESTDIR)$(libdir) && 
$(LN_S) libncurses.a libcurses.a)\n"
                                }
                                printf "\t$(RANLIB) $(DESTDIR)$(libdir)/%s\n", 
lib_name
-                               if ( target == "vxworks" )
+                               if ( host == "vxworks" )
                                {
                                        printf "address@hidden installing 
../lib/lib%s.o as $(DESTDIR)$(libdir)/lib%s.o\n", name, name
                                        printf "\t$(INSTALL_DATA) 
../lib/lib%s.o $(DESTDIR)$(libdir)/lib%s.o\n", name, name
@@ -330,7 +330,7 @@ END {
                                        printf "address@hidden linking 
libcurses.a to libncurses.a\n"
                                        printf "address@hidden -f 
$(DESTDIR)$(libdir)/libcurses.a\n"
                                }
-                               if ( target == "vxworks" )
+                               if ( host == "vxworks" )
                                {
                                        printf "address@hidden uninstalling 
$(DESTDIR)$(libdir)/lib%s.o\n", name
                                        printf "address@hidden -f 
$(DESTDIR)$(libdir)/lib%s.o\n", name





reply via email to

[Prev in Thread] Current Thread [Next in Thread]