This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

[RFC] patch libffi autoconversion


Hi all,

hier my attempt to the conversion for autofriends in libffi.

I successfully tested it on solari9 (32/64-bit) ppc linux and darwin-6.8. Michael K. did also test it on x86.

I could not test any cross builds due to lack of time and knowledge.

To apply and test, the following commands should be run:


- aclocal - autoheader - autoconf - automake

I did the conversion on automake-1.8.2 and autoconf-2.59.

Any comments ?

Thanks

Andreas

P.S, even an approval? :)


2004-03-03 Andreas Tobler <a.tobler@schweiz.ch> Paolo Bonzini <bonzini@gnu.org>

	* Makefile.am (AUTOMAKE_OPTIONS): Set them.
	Remove VPATH. Remove rules for object files. Remove multilib
	support.
	(AM_CCASFLAGS): Add.
	* configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER.
	(AC_PREREQ): Bump version to 2.59.
	(AC_INIT): Fill with version info and bug address.
	(ORIGINAL_LD_FOR_MULTILIBS): Remove.
	(AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE.
	De-precious CC so that the right flags are passed down to
	multilibs.
	(AC_MSG_ERROR): Replace obsolete macro AC_ERROR.
	(AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES.
	(AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS.
	* configure: Rebuilt.
	* aclocal.m4: Likewise.
	* Makefile.in, include/Makefile.in, testsuite/Makefile.in:
	Likewise.
	* fficonfig.h.in: Likewise.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libffi/configure.in,v
retrieving revision 1.48
diff -r1.48 configure.in
2,29c2,11
< AC_PREREQ(2.13)
< AC_INIT(fficonfig.h.in)
< AM_CONFIG_HEADER(fficonfig.h)
< 
< # This works around the fact that libtool configuration may change LD
< # for this particular configuration, but some shells, instead of
< # keeping the changes in LD private, export them just because LD is
< # exported.
< ORIGINAL_LD_FOR_MULTILIBS=$LD
< 
< dnl Default to --enable-multilib
< AC_ARG_ENABLE(multilib,
< [  --enable-multilib       build many library versions (default)],
< [case "${enableval}" in
<   yes) multilib=yes ;;
<   no)  multilib=no ;;
<   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
<  esac], [multilib=yes])dnl
< 
< dnl We may get other options which we don't document:
< dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
< 
< if test "${srcdir}" = "."; then
<   if test "${with_target_subdir}" != "."; then
<     libffi_basedir="${with_multisrctop}../"
<   else
<     libffi_basedir="${with_multisrctop}"
<   fi
---
> 
> AC_PREREQ(2.59)
> 
> AC_INIT([libffi], [3.5], [http://gcc.gnu.org/bugzilla/])
> AC_CONFIG_HEADERS([fficonfig.h])
> 
> AM_ENABLE_MULTILIB(, ..)
> if test a = b; then
>    # This is for automake
>    AC_CONFIG_AUX_DIR([..])
31,34c13,15
<   libffi_basedir=
< fi
< AC_SUBST(libffi_basedir)
< AC_CONFIG_AUX_DIR(${libffi_basedir}..)
---
>    # and this is for autoconf
>    AC_CONFIG_AUX_DIRS(${multi_basedir})
>  fi
39,41c20
< AM_PROG_LIBTOOL
< 
< AM_INIT_AUTOMAKE(libffi,2.00-beta,no-define)
---
> AM_INIT_AUTOMAKE
43,44c22,25
< AC_EXEEXT
< AM_MAINTAINER_MODE
---
> # The same as in boehm-gc and libstdc++. Have to borrow it from there.
> # We must force CC to /not/ be precious variables; otherwise
> # the wrong, non-multilib-adjusted value will be used in multilibs.
> # As a side effect, we have to subst CFLAGS ourselves.
45a27,28
> m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
> m4_define([_AC_ARG_VAR_PRECIOUS],[])
46a30,32
> m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
> 
> AC_SUBST(CFLAGS)
47a34,35
> AM_PROG_AS
> AM_PROG_CC_C_O
49a38,39
> AM_MAINTAINER_MODE
> 
55d44
< 
93c82
<   AC_ERROR("libffi has not been ported to $host.")
---
>   AC_MSG_ERROR(["libffi has not been ported to $host."])
159,160c148,149
<                        [libffi_cv_as_register_pseudo_op=yes],
<                        [libffi_cv_as_register_pseudo_op=no])
---
> 		       [libffi_cv_as_register_pseudo_op=yes],
> 		       [libffi_cv_as_register_pseudo_op=no])
164c153
<                [Define if your assembler supports .register.])
---
> 	       [Define if your assembler supports .register.])
254,272c243,244
< AC_OUTPUT(include/Makefile testsuite/Makefile include/ffi.h Makefile,
< [
< if test -n "$CONFIG_FILES"; then
<    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
<    ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in
< fi
< ],
< srcdir=${srcdir}
< host=${host}
< target=${target}
< with_multisubdir=${with_multisubdir}
< ac_configure_args="${multilib_arg} ${ac_configure_args}"
< CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
< libffi_basedir=${libffi_basedir}
< CC="${CC}"
< DEFS="$DEFS"
< ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
< 
< # Make target subdirectories if required.
---
> AC_CONFIG_COMMANDS(include, [test -d include || mkdir include])
> AC_CONFIG_COMMANDS(src, [
274,275c246,251
< test -d src/${TARGETDIR} || mkdir src/${TARGETDIR}
< test -d include || mkdir include
---
> test -d src/$TARGETDIR || mkdir src/$TARGETDIR
> ], [TARGETDIR="$TARGETDIR"])
> 
> AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h)
> 
> AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile)
277,278c253
< AC_LINK_FILES(src/$TARGETDIR/ffitarget.h, include/ffitarget.h)
< )
---
> AC_OUTPUT
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libffi/Makefile.am,v
retrieving revision 1.30
diff -r1.30 Makefile.am
3c3
< AUTOMAKE_OPTIONS = cygnus
---
> AUTOMAKE_OPTIONS = foreign no-dependencies subdir-objects
27,29d26
< 
< VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@
< 
77c74
< # Multilib support variables.
---
> # Multilib support variables working around Automake bug.
87a85,86
> libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c \
> 		src/raw_api.c src/java_raw_api.c
88a88
> nodist_libffi_la_SOURCES =
90,110d89
< TARGET_SRC_MIPS_IRIX = src/mips/ffi.c src/mips/o32.S src/mips/n32.S
< TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S
< TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S
< TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S
< TARGET_SRC_SPARC = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
< TARGET_SRC_ALPHA = src/alpha/ffi.c src/alpha/osf.S
< TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S
< TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S
< TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
< TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
< TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
< TARGET_SRC_ARM =  src/arm/sysv.S src/arm/ffi.c
< TARGET_SRC_S390 =  src/s390/sysv.S src/s390/ffi.c
< TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
< TARGET_SRC_SH =  src/sh/sysv.S src/sh/ffi.c
< TARGET_SRC_SH64 =  src/sh64/sysv.S src/sh64/ffi.c
< 
< ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@)
< ## Work around automake deficiency
< libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \
< 		src/raw_api.c src/java_raw_api.c
112,113c91
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_IRIX)
---
> nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
116,117c94
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX)
---
> nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S
120,121c97
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86)
---
> nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S
124,125c100
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32)
---
> nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
128,129c103
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SPARC)
---
> nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
132,133c106
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ALPHA)
---
> nodist_libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S
136,137c109
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_IA64)
---
> nodist_libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S
140,141c112
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_M68K)
---
> nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
144,145c115
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC)
---
> nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
148,149c118
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX)
---
> nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
152,153c121
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN)
---
> nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
156,157c124
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM)
---
> nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
160,161c127
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390)
---
> nodist_libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c
164,165c130
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64)
---
> nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
168,169c133
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH)
---
> nodist_libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c
172,173c136
< libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
< libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
---
> nodist_libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c
175a139,141
> libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
> nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
> 
178c144
< libffi_la_LDFLAGS = -release $(VERSION) 
---
> libffi_la_LDFLAGS = -release $(VERSION)
182,240c148
< # Override these rules so that object files get put in the correct 
< # subdirectories. 
< .c.o:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< .s.o:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< .S.o:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< .c.lo:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< .s.lo:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< .S.lo:
< 	$(LTCOMPILE) -c -o $@ $<
< 
< # Multilib support.
< .PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
< 	maintainer-clean-multi
< 
< all-recursive: all-multi
< install-recursive: install-multi
< mostlyclean-recursive: mostlyclean-multi
< clean-recursive: clean-multi
< distclean-recursive: distclean-multi
< maintainer-clean-recursive: maintainer-clean-multi
< 
< all-multi:
< 	: $(MAKE) ; exec $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do
< install-multi:
< 	$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do
< mostlyclean-multi:
< 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean
< clean-multi:
< 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean
< distclean-multi:
< 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean
< maintainer-clean-multi:
< 	$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean
< 
< 
< ## ################################################################
< 
< # Our hacked automake doesn't clean subdirectories properly.
< mostlyclean-am: mostlyclean-sub
< mostlyclean-sub:
< 	-rm -f src/*.o src/*.lo
< 	-rm -f src/@TARGETDIR@/*.o src/@TARGETDIR@/*.lo
< 
< clean-am: clean-sub
< clean-sub:
< 	-rm -rf src/.libs src/_libs
< 	-rm -rf src/@TARGETDIR@/.libs src/@TARGETDIR@/_libs
< 
< 
---
> AM_CCASFLAGS = $(INCLUDES)

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