From 233b7c8a350fc6de2eea18a37ece8b7f32ba7e57 Mon Sep 17 00:00:00 2001 From: tweenk Date: Fri, 13 Feb 2009 01:47:46 +0000 Subject: [PATCH] Remove last remnants of ancient plugin support. Tidy up acinclude.m4. --- acinclude.m4 | 134 +---------------------------------- configure.ac | 28 +------- m4/Makefile.am | 13 +++- m4/ac_define_dir.m4 | 49 +++++++++++++ src/extension/dependency.cpp | 15 ---- src/extension/dependency.h | 1 - src/io/resource.cpp | 2 - src/io/resource.h | 1 - src/path-prefix.h | 4 -- 9 files changed, 65 insertions(+), 182 deletions(-) create mode 100644 m4/ac_define_dir.m4 diff --git a/acinclude.m4 b/acinclude.m4 index b730d0d60..13d49c51f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,131 +1,3 @@ -dnl Usage: RELAYTOOL(LIBRARY_NAME, LIBS, CFLAGS, ACTION-IF-WEAK-LINK-IS-POSSIBLE) - -dnl Example: -dnl RELAYTOOL("gtkspell", GTKSPELL_LIBS, GTKSPELL_CFLAGS, gtkspell_weak=yes) -dnl Will modify GTKSPELL_LIBS to include a call to relaytool if available -dnl or if not, will modify GTKSPELL_CFLAGS to include -D switches to define -dnl libgtkspell_is_present=1 and libgtkspell_symbol_is_present=1 - -AC_DEFUN([RELAYTOOL], [ - if test -z "$RELAYTOOL_PROG"; then - AC_PATH_PROG(RELAYTOOL_PROG, relaytool, no) - fi - - AC_MSG_CHECKING(whether we can weak link $1) - - _RELAYTOOL_PROCESSED_NAME=`echo "$1" | sed 's/-/_/g;s/\./_/g;'` - _RELAYTOOL_UPPER_NAME=`echo $_RELAYTOOL_PROCESSED_NAME | tr '[[:lower:]]' '[[:upper:]]'` - - if test "$RELAYTOOL_PROG" = "no"; then - AC_MSG_RESULT(no) - $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='static const int lib${_RELAYTOOL_PROCESSED_NAME}_is_present = 1; static int __attribute__((unused)) lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *m) { return 1; }' $$3" - else - AC_MSG_RESULT(yes) - $2=`echo $$2|sed 's/\`/\\\\\`/g;'` - $2="-Wl,--gc-sections \`relaytool --relay $1 $$2\`" - $3="-DRELAYTOOL_${_RELAYTOOL_UPPER_NAME}='extern int lib${_RELAYTOOL_PROCESSED_NAME}_is_present; extern int lib${_RELAYTOOL_PROCESSED_NAME}_symbol_is_present(char *s);' $$3" - $4 - fi -]) - -# =========================================================================== -# http://autoconf-archive.cryp.to/ax_openmp.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro tries to find out how to compile programs that use OpenMP a -# standard API and set of compiler directives for parallel programming -# (see http://www-unix.mcs/) -# -# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS -# output variable to the flag (e.g. -omp) used both to compile *and* link -# OpenMP programs in the current language. -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. -# -# If you want to compile everything with OpenMP, you should set: -# -# CFLAGS="$CFLAGS $OPENMP_CFLAGS" -# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" -# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" -# -# (depending on the selected language). -# -# The user can override the default choice by setting the corresponding -# environment variable (e.g. OPENMP_CFLAGS). -# -# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is -# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is -# not found. If ACTION-IF-FOUND is not specified, the default action will -# define HAVE_OPENMP. -# -# LAST MODIFICATION -# -# 2008-04-12 -# -# COPYLEFT -# -# Copyright (c) 2008 Steven G. Johnson -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([AX_OPENMP], [ -AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX - -AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS -ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown -# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), -# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none -ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" -if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then - ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" -fi -for ax_openmp_flag in $ax_openmp_flags; do - case $ax_openmp_flag in - none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; - *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; - esac - AC_TRY_LINK_FUNC(omp_set_num_threads, - [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) -done -[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS -]) -if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then - m4_default([$2],:) -else - if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then - OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp - fi - m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) -fi -])dnl AX_OPENMP +m4_include([m4/ac_define_dir.m4]) +m4_include([m4/ax_openmp.m4]) +m4_include([m4/relaytool.m4]) diff --git a/configure.ac b/configure.ac index 26bc11c73..c5c9952c1 100644 --- a/configure.ac +++ b/configure.ac @@ -910,33 +910,9 @@ fi AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes) -dnl Figure out where the datadir actually is -dnl http://autoconf-archive.cryp.to/ac_define_dir.html -prefix_NONE= -exec_prefix_NONE= -test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix -test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix -dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn -dnl refers to ${prefix}. Thus we have to use `eval' twice. -eval runtime_datadir="${datadir}" -eval runtime_datadir="${runtime_datadir}" -test "$prefix_NONE" && prefix=NONE -test "$exec_prefix_NONE" && exec_prefix=NONE - -inkscape_sharedir="${runtime_datadir}/${PACKAGE_NAME}" - dnl Define our data paths for config.h -AC_SUBST(INKSCAPE_DATADIR) -AC_DEFINE_UNQUOTED([INKSCAPE_DATADIR], "${runtime_datadir}", - [Base data directory -- only path-prefix.h should use it!]) -AC_SUBST(PACKAGE_LOCALE_DIR) -AC_DEFINE_UNQUOTED([PACKAGE_LOCALE_DIR], "${runtime_datadir}/locale", - [Localization directory]) -AC_SUBST(INKSCAPE_LIBDIR) -AC_DEFINE_UNQUOTED([INKSCAPE_LIBDIR], "${prefix}/lib", - [Base library directory -- only path-prefix.h should use it!]) - -dnl Have to add module makefiles (lauris) +AC_DEFINE_DIR([INKSCAPE_DATADIR], [datadir], [Base data directory]) +AC_DEFINE_DIR([PACKAGE_LOCALE_DIR], [localedir], [Locatization directory]) AC_CONFIG_FILES([ Makefile diff --git a/m4/Makefile.am b/m4/Makefile.am index 3343be6c5..6817876cb 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,3 +1,12 @@ -EXTRA_DIST=codeset.m4 glibc21.m4 isc-posix.m4 progtest.m4 gettext.m4 \ - iconv.m4 lcmessage.m4 relaytool.m4 +EXTRA_DIST = \ + ac_define_dir.m4 \ + ax_openmp.m4 \ + codeset.m4 \ + gettext.m4 \ + glibc21.m4 \ + iconv.m4 \ + isc-posix.m4 \ + lcmessage.m4 \ + progtest.m4 \ + relaytool.m4 diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4 new file mode 100644 index 000000000..db42d3eb0 --- /dev/null +++ b/m4/ac_define_dir.m4 @@ -0,0 +1,49 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ac_define_dir.html +# =========================================================================== +# +# SYNOPSIS +# +# AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +# +# DESCRIPTION +# +# This macro sets VARNAME to the expansion of the DIR variable, taking +# care of fixing up ${prefix} and such. +# +# VARNAME is then offered as both an output variable and a C preprocessor +# symbol. +# +# Example: +# +# AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Stepan Kasal +# Copyright (c) 2008 Andreas Schwab +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2008 Alexandre Oliva +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) diff --git a/src/extension/dependency.cpp b/src/extension/dependency.cpp index de656201c..a83cac88d 100644 --- a/src/extension/dependency.cpp +++ b/src/extension/dependency.cpp @@ -26,7 +26,6 @@ gchar const * Dependency::_type_str[] = { "executable", "file", "extension", - "plugin", }; // These strings are for XML attribute comparisons and should not be translated @@ -101,10 +100,6 @@ Dependency::~Dependency (void) looked up in the database. If the extension is found, and it is not deactivated, the dependency passes. - If the type is \c TYPE_PLUGIN then the path for the plugin is found - using the Glib::Module routines. When the path is found, then there - is a check to see if the file exists using the \c file_test function. - If the type is \c TYPE_EXECUTABLE or \c TYPE_FILE things are getting even more interesting because now the \c _location variable is also taken into account. First, the difference between the two is that @@ -138,16 +133,6 @@ Dependency::check (void) const if (myext->deactivated()) return FALSE; break; } - case TYPE_PLUGIN: { - if (!Glib::Module::get_supported()) { - return FALSE; - } - - std::string path = Glib::Module::build_path(INKSCAPE_PLUGINDIR, _string); - if (!Glib::file_test(path, Glib::FILE_TEST_EXISTS)) - return FALSE; - break; - } case TYPE_EXECUTABLE: case TYPE_FILE: { Glib::FileTest filetest = Glib::FILE_TEST_EXISTS; diff --git a/src/extension/dependency.h b/src/extension/dependency.h index b76e30407..829912dc3 100644 --- a/src/extension/dependency.h +++ b/src/extension/dependency.h @@ -32,7 +32,6 @@ class Dependency { TYPE_EXECUTABLE, /**< Look for an executable */ TYPE_FILE, /**< Look to make sure a file exists */ TYPE_EXTENSION, /**< Make sure a specific extension is loaded and functional */ - TYPE_PLUGIN, /**< Look for a library to be loaded as a plugin */ TYPE_CNT /**< Number of types */ }; /** \brief Storing the type of this particular dependency. */ diff --git a/src/io/resource.cpp b/src/io/resource.cpp index f7542855e..1f6f8459c 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -45,7 +45,6 @@ Util::ptr_shared get_path(Domain domain, Type type, char const *filename) case MARKERS: temp = INKSCAPE_MARKERSDIR; break; case PALETTES: temp = INKSCAPE_PALETTESDIR; break; case PATTERNS: temp = INKSCAPE_PATTERNSDIR; break; - case PLUGINS: temp = INKSCAPE_PLUGINDIR; break; case SCREENS: temp = INKSCAPE_SCREENSDIR; break; case TEMPLATES: temp = INKSCAPE_TEMPLATESDIR; break; case TUTORIALS: temp = INKSCAPE_TUTORIALSDIR; break; @@ -74,7 +73,6 @@ Util::ptr_shared get_path(Domain domain, Type type, char const *filename) case MARKERS: name = "markers"; break; case PALETTES: name = "palettes"; break; case PATTERNS: name = "patterns"; break; - case PLUGINS: name = "plugins"; break; case TEMPLATES: name = "templates"; break; default: return get_path(SYSTEM, type, filename); } diff --git a/src/io/resource.h b/src/io/resource.h index 0be8ab8e6..a5269899f 100644 --- a/src/io/resource.h +++ b/src/io/resource.h @@ -32,7 +32,6 @@ enum Type { MARKERS, PALETTES, PATTERNS, - PLUGINS, SCREENS, TEMPLATES, TUTORIALS, diff --git a/src/path-prefix.h b/src/path-prefix.h index 447ddcf85..b2ff6ff88 100644 --- a/src/path-prefix.h +++ b/src/path-prefix.h @@ -34,7 +34,6 @@ extern "C" { # define INKSCAPE_PATTERNSDIR BR_DATADIR( "/inkscape/patterns" ) # define INKSCAPE_SCREENSDIR BR_DATADIR( "/inkscape/screens" ) # define INKSCAPE_TUTORIALSDIR BR_DATADIR( "/inkscape/tutorials" ) -# define INKSCAPE_PLUGINDIR BR_LIBDIR( "/inkscape/plugins" ) # define INKSCAPE_TEMPLATESDIR BR_DATADIR( "/inkscape/templates" ) # define INKSCAPE_UIDIR BR_DATADIR( "/inkscape/ui" ) //CREATE V0.1 support @@ -56,7 +55,6 @@ extern "C" { # define INKSCAPE_PATTERNSDIR WIN32_DATADIR("share\\patterns") # define INKSCAPE_SCREENSDIR WIN32_DATADIR("share\\screens") # define INKSCAPE_TUTORIALSDIR WIN32_DATADIR("share\\tutorials") -# define INKSCAPE_PLUGINDIR WIN32_DATADIR("plugins") # define INKSCAPE_TEMPLATESDIR WIN32_DATADIR("share\\templates") # define INKSCAPE_UIDIR WIN32_DATADIR("share\\ui") //CREATE V0.1 WIN32 support @@ -77,7 +75,6 @@ extern "C" { # define INKSCAPE_PATTERNSDIR "Contents/Resources/patterns" # define INKSCAPE_SCREENSDIR "Contents/Resources/screens" # define INKSCAPE_TUTORIALSDIR "Contents/Resources/tutorials" -# define INKSCAPE_PLUGINDIR "Contents/Resources/plugins" # define INKSCAPE_TEMPLATESDIR "Contents/Resources/templates" # define INKSCAPE_UIDIR "Contents/Resources/ui" //CREATE V0.1 support @@ -98,7 +95,6 @@ extern "C" { # define INKSCAPE_PATTERNSDIR INKSCAPE_DATADIR "/inkscape/patterns" # define INKSCAPE_SCREENSDIR INKSCAPE_DATADIR "/inkscape/screens" # define INKSCAPE_TUTORIALSDIR INKSCAPE_DATADIR "/inkscape/tutorials" -# define INKSCAPE_PLUGINDIR INKSCAPE_LIBDIR "/inkscape/plugins" # define INKSCAPE_TEMPLATESDIR INKSCAPE_DATADIR "/inkscape/templates" # define INKSCAPE_UIDIR INKSCAPE_DATADIR "/inkscape/ui" //CREATE V0.1 support -- 2.30.2