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]

Re: [plugins] RFA: Merge plugins into mainline [4/5 - configury]


Diego Novillo <dnovillo@google.com> writes:

> 2009-04-02  Le-Chun Wu  <lcwu@google.com>
>
> 	* configure.ac: Add --enalbe-plugin support. Set pluginlibs only for
> 	ELF targets.
> 	* configure: Regenerate.
> 	* Makefile.tpl: Define and export PLUGINLIBS.
> 	* Makefile.in: Regenerate.
>
> gcc/ChangeLog
>
> 2009-04-02  Le-Chun Wu  <lcwu@google.com>
>
> 	* configure.ac: Add PLUGINLIBS variable.
> 	* configure: Regenerate.
> 	* Makefile.in: Add PLUGINLIBS to link command. Add/modify dependencies
> 	for plugin.o and files including plugin.h.
>
> gcc/cp/ChangeLog
>
> 2009-04-02  Le-Chun Wu  <lcwu@google.com>
>
> 	* Make-lang.in: Modify dependencies of files including plugin.h.


> Index: gcc/configure.ac
> ===================================================================
> --- gcc/configure.ac	(.../trunk)	(revision 145344)
> +++ gcc/configure.ac	(.../branches/plugins)	(revision 145453)
> @@ -780,7 +780,7 @@ esac],
>  [onestep=""])
>  AC_SUBST(onestep)
>  
> -ACX_PKGVERSION([GCC])
> +ACX_PKGVERSION([plugins merged with rev 145344])

Incorrect change.

> -    vec.h $(TARGET_H) $(CGRAPH_H)
> +    vec.h $(TARGET_H) $(CGRAPH_H) plugin.h

It seems to me that plugin.h includes gcc-plugin.h, so you need to
introduce a PLUGIN_H make variable and use it in the dependencies.


> +AC_ARG_ENABLE(plugin,
> +[  --enable-plugin         enable plugin support],
> +ENABLE_PLUGIN=$enableval,
> +ENABLE_PLUGIN=yes)
> +
> +pluginlibs=
> +if test "${ENABLE_PLUGIN}" = "yes"; then
> +  # Check for ELF target.
> +  is_elf=no
> +  case "${target}" in
> +    *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
> +    | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
> +    | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-solaris2*)
> +      case "${target}" in
> +        *-*-linux*aout* | *-*-linux*oldld*)
> +          ;;
> +        *)
> +          is_elf=yes
> +          ;;
> +      esac
> +  esac
> +
> +  # Currently plugins are only supported in ELF.
> +  if test "$is_elf" = "yes"; then
> +    pluginlibs="-rdynamic -ldl"
> +  fi
> +fi
> +
> +# Flag needed for plugin support
> +AC_SUBST(pluginlibs)

The configure script should give an error if somebody uses an explicit
--enable-plugin on a system which does not support plugins.

Testing ${target} here is wrong.  It should test ${host}.

It's not clear to me that we should be testing for ELF hosts, although
that may suffice for now.  As far as I can see, all the plugin support
requires is dlopen and dlsym.  We could have the configure script test
for those, rather than use a list of hosts.

Ian


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