This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc-2.95.2 ignores --with-local-prefix


I configured gcc-2.95.2 with

    ./configure --prefix=/opt/gcc-2.95.2 --with-local-prefix=/opt

in the expectation that local header files installed in /opt/include
would then be used.
(That's what gcc-2.95.2/gcc/INSTALL promises.  On the other hand,
gcc-2.95.2/install lists --with-local-prefix as an one of the
"additional options [that] control where certain parts of the
distribution are installed", which is wrong, but that's obviously
just a documentation error.)

However, the Makefiles created are incorrect so that /opt/include is
not used.  Details:


The resulting file gcc-2.95.2/gcc/Makefile contains the following
definitions and the following rule:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
local_prefix = /opt
includedir = $(local_prefix)/include

cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \
           mbchar.h prefix.h Makefile.in
	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
	  -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
	  -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
	  -DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
	  -DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
	  -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
	  -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

So one would expect LOCAL_INCLUDE_DIR to be defined as intended,
and thus "/opt/include" to be in include_defaults_array in cccp.[co].
However "strings cccp.o" shows that this is not the case,
and the reason is that the top-level Makefile (gcc-2.95.2/Makefile)
uses a different definition for includedir:

     prefix = /opt/gcc-2.95.2
     includedir = ${prefix}/include

This differing includedir definition is passed to gcc-2.95.2/gcc/Makefile
via BASE_FLAGS_TO_PASS.  The sub-Makefiles are executed by statements
of the form

	    if (cd ./$$i; \
	        $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
			"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
			"RANLIB=$${RANLIB}" \
			"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
			$${target}); \
	    then true; else exit 1; fi; \

which means the definitions on the commandline (including
includedir=/opt/gcc-2.95.2/include) supersede the definitions
in the sub-Makefile (including includedir=/opt/include).


-- 
Bodo Möller <moeller@cdc.informatik.tu-darmstadt.de>
PGP http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/moeller/0x36d2c658.html
* TU Darmstadt, Theoretische Informatik, Alexanderstr. 10, D-64283 Darmstadt
* Tel. +49-6151-16-6628, Fax +49-6151-16-6036

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]