summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/dvisvgm/Makefile.am16
-rw-r--r--Build/source/texk/dvisvgm/Makefile.in10
-rw-r--r--Build/source/texk/dvisvgm/config.h.in2
-rwxr-xr-xBuild/source/texk/dvisvgm/configure15
-rw-r--r--Build/source/texk/dvisvgm/configure.ac12
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/ChangeLog3
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/patch-06-libdvisvgm-HAVE_LIBGS134
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.cpp24
-rw-r--r--Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.h4
-rw-r--r--Build/source/texk/kpathsea/ChangeLog6
-rw-r--r--Build/source/texk/kpathsea/tex-file.c18
11 files changed, 199 insertions, 45 deletions
diff --git a/Build/source/texk/dvisvgm/Makefile.am b/Build/source/texk/dvisvgm/Makefile.am
index 96d153afd71..74933b16304 100644
--- a/Build/source/texk/dvisvgm/Makefile.am
+++ b/Build/source/texk/dvisvgm/Makefile.am
@@ -45,13 +45,7 @@ nodist_dvisvgm_SOURCES = \
dvisvgm_dependencies = $(KPATHSEA_DEPEND) $(ZLIB_DEPEND) $(FREETYPE2_DEPEND)
-$(dvisvgm_OBJECTS): config.force
-
-config.force: $(dvisvgm_dependencies)
- echo timestamp >config.force
- $(SHELL) ./config.status --recheck
-
-DISTCLEANFILES = config.force
+$(dvisvgm_OBJECTS): libdvisvgm.a
LDADD = $(noinst_LIBRARIES) $(KPATHSEA_LIBS) $(FREETYPE2_LIBS)
LDADD += $(ZLIB_LIBS) $(LIBGS_LIBS)
@@ -122,6 +116,14 @@ nodist_libpotrace_a_SOURCES = \
$(DVISVGM_TREE)/potracelib/potracelib.c \
$(DVISVGM_TREE)/potracelib/trace.c
+$(libpotrace_a_OBJECTS): config.force
+
+config.force: $(dvisvgm_dependencies)
+ echo timestamp >config.force
+ $(SHELL) ./config.status --recheck
+
+DISTCLEANFILES = config.force
+
## Rebuild libkpathsea
@KPATHSEA_RULE@
## Rebuild libfreetype
diff --git a/Build/source/texk/dvisvgm/Makefile.in b/Build/source/texk/dvisvgm/Makefile.in
index fa7d272c629..9a177bba7f9 100644
--- a/Build/source/texk/dvisvgm/Makefile.in
+++ b/Build/source/texk/dvisvgm/Makefile.in
@@ -335,7 +335,6 @@ nodist_dvisvgm_SOURCES = \
$(DVISVGM_TREE)/src/gzstream.cpp
dvisvgm_dependencies = $(KPATHSEA_DEPEND) $(ZLIB_DEPEND) $(FREETYPE2_DEPEND)
-DISTCLEANFILES = config.force
LDADD = $(noinst_LIBRARIES) $(KPATHSEA_LIBS) $(FREETYPE2_LIBS) \
$(ZLIB_LIBS) $(LIBGS_LIBS)
noinst_LIBRARIES = libdvisvgm.a libpotrace.a
@@ -392,6 +391,7 @@ nodist_libpotrace_a_SOURCES = \
$(DVISVGM_TREE)/potracelib/potracelib.c \
$(DVISVGM_TREE)/potracelib/trace.c
+DISTCLEANFILES = config.force
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -1792,14 +1792,16 @@ uninstall-man: uninstall-man1
dist-hook:
rm -rf `find $(distdir) -name .svn`
-$(dvisvgm_OBJECTS): config.force
+$(dvisvgm_OBJECTS): libdvisvgm.a
+
+$(libdvisvgm_a_OBJECTS): libpotrace.a
+
+$(libpotrace_a_OBJECTS): config.force
config.force: $(dvisvgm_dependencies)
echo timestamp >config.force
$(SHELL) ./config.status --recheck
-$(libdvisvgm_a_OBJECTS): libpotrace.a
-
@KPATHSEA_RULE@
@FREETYPE2_RULE@
@ZLIB_RULE@
diff --git a/Build/source/texk/dvisvgm/config.h.in b/Build/source/texk/dvisvgm/config.h.in
index fd209743bf1..62889b0aaaa 100644
--- a/Build/source/texk/dvisvgm/config.h.in
+++ b/Build/source/texk/dvisvgm/config.h.in
@@ -49,7 +49,7 @@
/* Define to 1 if you have the `freetype2' library (-lfreetype). */
#undef HAVE_LIBFREETYPE
-/* Define to 1 if you have the `gs' library (-lgs), and to 0 otherwise. */
+/* Define to 1 if you have the `gs' library (-lgs). */
#undef HAVE_LIBGS
/* Define to 1 if you have the `kpathsea' library (-lkpathsea). */
diff --git a/Build/source/texk/dvisvgm/configure b/Build/source/texk/dvisvgm/configure
index 710d5d4e57e..6caabe52475 100755
--- a/Build/source/texk/dvisvgm/configure
+++ b/Build/source/texk/dvisvgm/configure
@@ -17577,7 +17577,7 @@ kpse_save_LIBS=$LIBS
if test "x$with_system_libgs" = xyes; then
- HAVE_LIBGS=1
+ libgs_mode=link
case $with_libgs_includes in #(
"" | yes | no) :
LIBGS_INCLUDES= ;; #(
@@ -17635,8 +17635,11 @@ $as_echo "$kpse_cv_new_gsapi" >&6; }
if test "x$kpse_cv_new_gsapi" != xyes; then
as_fn_error "dvisvgm requires Ghostscript version 8.31 or later" "$LINENO" 5
fi
+
+$as_echo "#define HAVE_LIBGS 1" >>confdefs.h
+
else
- HAVE_LIBGS=0
+ libgs_mode=load
LIBGS_INCLUDES=
LIBGS_LIBS=-ldl
eval CPPFLAGS=\"$LIBGS_INCLUDES \$CPPFLAGS\"
@@ -17654,6 +17657,7 @@ if test "x$ac_cv_func_dlopen" = x""yes; then :
fi
if test "x$ac_cv_header_dlfcn_h:$ac_cv_func_dlopen" != xyes:yes; then
+ libgs_mode=no
CPPFLAGS=$kpse_save_CPPFLAGS
LIBS=$kpse_save_LIBS
@@ -17665,12 +17669,7 @@ $as_echo "#define DISABLE_GS 1" >>confdefs.h
fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBGS $HAVE_LIBGS
-_ACEOF
-
- if test "x$HAVE_LIBGS" = x0 && test -n "$LIBGS_LIBS"; then
+ if test "x$libgs_mode" = xload; then
dlloader_TRUE=
dlloader_FALSE='#'
else
diff --git a/Build/source/texk/dvisvgm/configure.ac b/Build/source/texk/dvisvgm/configure.ac
index 10970810280..96567bb17a0 100644
--- a/Build/source/texk/dvisvgm/configure.ac
+++ b/Build/source/texk/dvisvgm/configure.ac
@@ -44,7 +44,7 @@ KPSE_FREETYPE2_FLAGS
KPSE_SAVE_FLAGS
if test "x$with_system_libgs" = xyes; then
- HAVE_LIBGS=1
+ libgs_mode=link
AS_CASE([$with_libgs_includes],
["" | yes | no], [LIBGS_INCLUDES=],
[LIBGS_INCLUDES="-I$with_libgs_includes"])
@@ -66,14 +66,17 @@ if test "x$with_system_libgs" = xyes; then
if test "x$kpse_cv_new_gsapi" != xyes; then
AC_MSG_ERROR([dvisvgm requires Ghostscript version 8.31 or later])
fi
+ AC_DEFINE([HAVE_LIBGS], 1,
+ [Define to 1 if you have the `gs' library (-lgs).])
else
- HAVE_LIBGS=0
+ libgs_mode=load
LIBGS_INCLUDES=
LIBGS_LIBS=-ldl
KPSE_ADD_FLAGS([libgs])
AC_CHECK_HEADER([dlfcn.h])
AC_CHECK_FUNC([dlopen])
if test "x$ac_cv_header_dlfcn_h:$ac_cv_func_dlopen" != xyes:yes; then
+ libgs_mode=no
KPSE_RESTORE_FLAGS
AC_DEFINE([DISABLE_GS], 1,
[Set to 1 if PostScript support should be disabled.])
@@ -82,10 +85,7 @@ else
fi
AC_SUBST([LIBGS_INCLUDES])
AC_SUBST([LIBGS_LIBS])
-AC_DEFINE_UNQUOTED([HAVE_LIBGS], [$HAVE_LIBGS],
- [Define to 1 if you have the `gs' library (-lgs),
- and to 0 otherwise.])
-AM_CONDITIONAL([dlloader], [test "x$HAVE_LIBGS" = x0 && test -n "$LIBGS_LIBS"])
+AM_CONDITIONAL([dlloader], [test "x$libgs_mode" = xload])
if test "x$enable_build" != xno || test -f config.force; then
diff --git a/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/ChangeLog b/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/ChangeLog
index 11f554bd776..1508a5650ad 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/ChangeLog
+++ b/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/ChangeLog
@@ -5,6 +5,9 @@
* src/DVIToSVG.cpp, src/Ghostscript.{cpp,h}:
Use defined(DISABLE_GS) instead of DISABLE_GS.
+ Added patch-06-libdvisvgm-HAVE_LIBGS.
+ * src/Ghostscript.{cpp,h}: Use defined(HAVE_LIBGS).
+
2009-11-14 Peter Breitenlohner <peb@mppmu.mpg.de>
Added patch-03-libdvisvgm-uninitialized.
diff --git a/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/patch-06-libdvisvgm-HAVE_LIBGS b/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/patch-06-libdvisvgm-HAVE_LIBGS
new file mode 100644
index 00000000000..5f29442d43c
--- /dev/null
+++ b/Build/source/texk/dvisvgm/dvisvgm-0.8.7-PATCHES/patch-06-libdvisvgm-HAVE_LIBGS
@@ -0,0 +1,134 @@
+ Replace '#if HAVE_LIBGS' by '#if defined(HAVE_LIBGS)'.
+
+diff -ur dvisvgm-0.8.7.orig/src/Ghostscript.cpp dvisvgm-0.8.7/src/Ghostscript.cpp
+--- dvisvgm-0.8.7.orig/src/Ghostscript.cpp 2009-11-18 00:30:50.000000000 +0100
++++ dvisvgm-0.8.7/src/Ghostscript.cpp 2009-11-18 14:28:08.000000000 +0100
+@@ -36,7 +36,7 @@
+ /** Loads the Ghostscript library but does not create an instance. This
+ * constructor should only be used to call available() and revision(). */
+ Ghostscript::Ghostscript ()
+-#if !HAVE_LIBGS
++#if !defined(HAVE_LIBGS)
+ : DLLoader(GS_DL_NAME)
+ #endif
+ {
+@@ -49,7 +49,7 @@
+ * @param[in] argv parameters passed to Ghostscript
+ * @param[in] caller this parameter is passed to all callback functions */
+ Ghostscript::Ghostscript (int argc, const char **argv, void *caller)
+-#if !HAVE_LIBGS
++#if !defined(HAVE_LIBGS)
+ : DLLoader(GS_DL_NAME)
+ #endif
+ {
+@@ -73,7 +73,7 @@
+
+ /** Returns true if Ghostscript library was found and can be loaded. */
+ bool Ghostscript::available () {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return true;
+ #else
+ return loaded();
+@@ -85,7 +85,7 @@
+ * @param[out] r takes the revision information (see GS API documentation for further details)
+ * @return true on success */
+ bool Ghostscript::revision (gsapi_revision_t *r) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return (gsapi_revision(r, sizeof(gsapi_revision_t)) == 0);
+ #else
+ if (PFN_gsapi_revision fn = (PFN_gsapi_revision)loadFunction("gsapi_revision"))
+@@ -111,7 +111,7 @@
+ * @param[out] psinst handle of newly created instance (or 0 on error)
+ * @param[in] caller pointer forwarded to callback functions */
+ int Ghostscript::new_instance (void **psinst, void *caller) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_new_instance(psinst, caller);
+ #else
+ if (PFN_gsapi_new_instance fn = (PFN_gsapi_new_instance)loadFunction("gsapi_new_instance"))
+@@ -125,7 +125,7 @@
+ /** Destroys the current instance of Ghostscript. This method is called by the destructor
+ * and should not be used elsewhere. */
+ void Ghostscript::delete_instance () {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ gsapi_delete_instance(_inst);
+ #else
+ if (PFN_gsapi_delete_instance fn = (PFN_gsapi_delete_instance)loadFunction("gsapi_delete_instance"))
+@@ -136,7 +136,7 @@
+
+ /** Exits the interpreter. Must be called before destroying the GS instance. */
+ int Ghostscript::exit () {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_exit(_inst);
+ #else
+ if (PFN_gsapi_exit fn = (PFN_gsapi_exit)loadFunction("gsapi_exit"))
+@@ -151,7 +151,7 @@
+ * @param[in] out pointer to stdout handler
+ * @param[in] err pointer to stderr handler */
+ int Ghostscript::set_stdio (Stdin in, Stdout out, Stderr err) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_set_stdio(_inst, in, out, err);
+ #else
+ if (PFN_gsapi_set_stdio fn = (PFN_gsapi_set_stdio)loadFunction("gsapi_set_stdio"))
+@@ -166,7 +166,7 @@
+ * @param[in] argc number of paramters
+ * @param[in] argv parameters passed to Ghostscript */
+ int Ghostscript::init_with_args (int argc, char **argv) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_init_with_args(_inst, argc, argv);
+ #else
+ if (PFN_gsapi_init_with_args fn = (PFN_gsapi_init_with_args)loadFunction("gsapi_init_with_args"))
+@@ -178,7 +178,7 @@
+
+ /** Tells Ghostscript that several calls of run_string_continue will follow. */
+ int Ghostscript::run_string_begin (int user_errors, int *pexit_code) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_run_string_begin(_inst, user_errors, pexit_code);
+ #else
+ if (PFN_gsapi_run_string_begin fn = (PFN_gsapi_run_string_begin)loadFunction("gsapi_run_string_begin"))
+@@ -197,7 +197,7 @@
+ * @param[in] user_errors if non-negative, the default PS error values will be generated, otherwise this value is returned
+ * @param[out] pexit_code takes the PS error code */
+ int Ghostscript::run_string_continue (const char *str, unsigned length, int user_errors, int *pexit_code) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_run_string_continue(_inst, str, length, user_errors, pexit_code);
+ #else
+ if (PFN_gsapi_run_string_continue fn = (PFN_gsapi_run_string_continue)loadFunction("gsapi_run_string_continue"))
+@@ -210,7 +210,7 @@
+
+ /** Terminates the successive code feeding. Must be called after the last call of run_string_continue. */
+ int Ghostscript::run_string_end (int user_errors, int *pexit_code) {
+-#if HAVE_LIBGS
++#if defined(HAVE_LIBGS)
+ return gsapi_run_string_end(_inst, user_errors, pexit_code);
+ #else
+ if (PFN_gsapi_run_string_end fn = (PFN_gsapi_run_string_end)loadFunction("gsapi_run_string_end"))
+diff -ur dvisvgm-0.8.7.orig/src/Ghostscript.h dvisvgm-0.8.7/src/Ghostscript.h
+--- dvisvgm-0.8.7.orig/src/Ghostscript.h 2009-11-18 00:33:30.000000000 +0100
++++ dvisvgm-0.8.7/src/Ghostscript.h 2009-11-18 14:28:02.000000000 +0100
+@@ -28,7 +28,7 @@
+ #include <string>
+ #if defined(DISABLE_GS)
+ #include "iapi.h"
+-#elif HAVE_LIBGS
++#elif defined(HAVE_LIBGS)
+ #include <ghostscript/iapi.h>
+ #else
+ #include "DLLoader.h"
+@@ -62,7 +62,7 @@
+
+ /** Wrapper class of (a subset of) the Ghostscript API. */
+ class Ghostscript
+-#if !HAVE_LIBGS
++#if !defined(HAVE_LIBGS)
+ : public DLLoader
+ #endif
+ {
diff --git a/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.cpp b/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.cpp
index cfa244a652c..149661730cb 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.cpp
+++ b/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.cpp
@@ -36,7 +36,7 @@ using namespace std;
/** Loads the Ghostscript library but does not create an instance. This
* constructor should only be used to call available() and revision(). */
Ghostscript::Ghostscript ()
-#if !HAVE_LIBGS
+#if !defined(HAVE_LIBGS)
: DLLoader(GS_DL_NAME)
#endif
{
@@ -49,7 +49,7 @@ Ghostscript::Ghostscript ()
* @param[in] argv parameters passed to Ghostscript
* @param[in] caller this parameter is passed to all callback functions */
Ghostscript::Ghostscript (int argc, const char **argv, void *caller)
-#if !HAVE_LIBGS
+#if !defined(HAVE_LIBGS)
: DLLoader(GS_DL_NAME)
#endif
{
@@ -73,7 +73,7 @@ Ghostscript::~Ghostscript () {
/** Returns true if Ghostscript library was found and can be loaded. */
bool Ghostscript::available () {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return true;
#else
return loaded();
@@ -85,7 +85,7 @@ bool Ghostscript::available () {
* @param[out] r takes the revision information (see GS API documentation for further details)
* @return true on success */
bool Ghostscript::revision (gsapi_revision_t *r) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return (gsapi_revision(r, sizeof(gsapi_revision_t)) == 0);
#else
if (PFN_gsapi_revision fn = (PFN_gsapi_revision)loadFunction("gsapi_revision"))
@@ -111,7 +111,7 @@ string Ghostscript::revision () {
* @param[out] psinst handle of newly created instance (or 0 on error)
* @param[in] caller pointer forwarded to callback functions */
int Ghostscript::new_instance (void **psinst, void *caller) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_new_instance(psinst, caller);
#else
if (PFN_gsapi_new_instance fn = (PFN_gsapi_new_instance)loadFunction("gsapi_new_instance"))
@@ -125,7 +125,7 @@ int Ghostscript::new_instance (void **psinst, void *caller) {
/** Destroys the current instance of Ghostscript. This method is called by the destructor
* and should not be used elsewhere. */
void Ghostscript::delete_instance () {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
gsapi_delete_instance(_inst);
#else
if (PFN_gsapi_delete_instance fn = (PFN_gsapi_delete_instance)loadFunction("gsapi_delete_instance"))
@@ -136,7 +136,7 @@ void Ghostscript::delete_instance () {
/** Exits the interpreter. Must be called before destroying the GS instance. */
int Ghostscript::exit () {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_exit(_inst);
#else
if (PFN_gsapi_exit fn = (PFN_gsapi_exit)loadFunction("gsapi_exit"))
@@ -151,7 +151,7 @@ int Ghostscript::exit () {
* @param[in] out pointer to stdout handler
* @param[in] err pointer to stderr handler */
int Ghostscript::set_stdio (Stdin in, Stdout out, Stderr err) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_set_stdio(_inst, in, out, err);
#else
if (PFN_gsapi_set_stdio fn = (PFN_gsapi_set_stdio)loadFunction("gsapi_set_stdio"))
@@ -166,7 +166,7 @@ int Ghostscript::set_stdio (Stdin in, Stdout out, Stderr err) {
* @param[in] argc number of paramters
* @param[in] argv parameters passed to Ghostscript */
int Ghostscript::init_with_args (int argc, char **argv) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_init_with_args(_inst, argc, argv);
#else
if (PFN_gsapi_init_with_args fn = (PFN_gsapi_init_with_args)loadFunction("gsapi_init_with_args"))
@@ -178,7 +178,7 @@ int Ghostscript::init_with_args (int argc, char **argv) {
/** Tells Ghostscript that several calls of run_string_continue will follow. */
int Ghostscript::run_string_begin (int user_errors, int *pexit_code) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_run_string_begin(_inst, user_errors, pexit_code);
#else
if (PFN_gsapi_run_string_begin fn = (PFN_gsapi_run_string_begin)loadFunction("gsapi_run_string_begin"))
@@ -197,7 +197,7 @@ int Ghostscript::run_string_begin (int user_errors, int *pexit_code) {
* @param[in] user_errors if non-negative, the default PS error values will be generated, otherwise this value is returned
* @param[out] pexit_code takes the PS error code */
int Ghostscript::run_string_continue (const char *str, unsigned length, int user_errors, int *pexit_code) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_run_string_continue(_inst, str, length, user_errors, pexit_code);
#else
if (PFN_gsapi_run_string_continue fn = (PFN_gsapi_run_string_continue)loadFunction("gsapi_run_string_continue"))
@@ -210,7 +210,7 @@ int Ghostscript::run_string_continue (const char *str, unsigned length, int user
/** Terminates the successive code feeding. Must be called after the last call of run_string_continue. */
int Ghostscript::run_string_end (int user_errors, int *pexit_code) {
-#if HAVE_LIBGS
+#if defined(HAVE_LIBGS)
return gsapi_run_string_end(_inst, user_errors, pexit_code);
#else
if (PFN_gsapi_run_string_end fn = (PFN_gsapi_run_string_end)loadFunction("gsapi_run_string_end"))
diff --git a/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.h b/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.h
index 3449fed26e5..bf6acbee3f6 100644
--- a/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.h
+++ b/Build/source/texk/dvisvgm/dvisvgm-0.8.7/src/Ghostscript.h
@@ -28,7 +28,7 @@
#include <string>
#if defined(DISABLE_GS)
#include "iapi.h"
-#elif HAVE_LIBGS
+#elif defined(HAVE_LIBGS)
#include <ghostscript/iapi.h>
#else
#include "DLLoader.h"
@@ -62,7 +62,7 @@ struct Ghostscript
/** Wrapper class of (a subset of) the Ghostscript API. */
class Ghostscript
-#if !HAVE_LIBGS
+#if !defined(HAVE_LIBGS)
: public DLLoader
#endif
{
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index bf7eabd007d..41500e7e35a 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * tex-file.c (kpathsea_out_name_ok): Also disallow writing files
+ in dotted directories.
+ From Akira Kakuto <kakuto@fuk.kindai.ac.jp>.
+
2009-11-17 Peter Breitenlohner <peb@mppmu.mpg.de>
* types.h (kpathsea_instance): For Win/Mingw/Cygwin declare
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index 30d7d0fca26..dcd64219c76 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -1116,11 +1116,19 @@ kpathsea_name_ok (kpathsea kpse, const_string fname, const_string check_var,
#if defined (unix) && !defined (MSDOS)
{
- const_string base = xbasename (fname);
- /* Disallow .rhosts, .login, etc. Allow .tex (for LaTeX). */
- if (base[0] == 0 ||
- (base[0] == '.' && !IS_DIR_SEP(base[1]) && !STREQ (base, ".tex")))
- goto not_ok;
+ /* Disallow .rhosts, .login, .ssh/, etc. Allow .tex (for LaTeX). */
+ string q, qq = fname;
+ while ((q = strchr (qq, '.'))) {
+ if ((q == fname || IS_DIR_SEP (*(q - 1))) &&
+ !IS_DIR_SEP (*(q + 1)) &&
+ *(q + 1) != '.' &&
+ !STREQ (q, ".tex")) {
+ goto not_ok;
+ }
+ qq = q + 1;
+ if (*(qq) == '.')
+ qq++;
+ }
}
#else
/* Other OSs don't have special names? */