summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-12 12:57:39 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-02-12 12:57:39 +0000
commit1b35617212ff97f97967393995abd4b77d0b0714 (patch)
treee5c0fedbe5e236f592a02855bad9d6dbc03b5d09 /Build/source/texk
parent48ccab09c4fc16fea0324771bbdfd3212aebabb2 (diff)
fix compilation with -DNO_DEBUG
git-svn-id: svn://tug.org/texlive/trunk@16986 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/dvipsk/ChangeLog5
-rw-r--r--Build/source/texk/dvipsk/dvips.c8
-rw-r--r--Build/source/texk/gsftopk/ChangeLog5
-rw-r--r--Build/source/texk/gsftopk/gsftopk.c14
-rw-r--r--Build/source/texk/kpathsea/ChangeLog10
-rw-r--r--Build/source/texk/kpathsea/dir.c12
-rw-r--r--Build/source/texk/kpathsea/elt-dirs.c4
-rw-r--r--Build/source/texk/kpathsea/pathsearch.c22
-rw-r--r--Build/source/texk/kpathsea/tex-file.c2
9 files changed, 63 insertions, 19 deletions
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index f4edd634c00..5d53f732b94 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dvips.c (main): Add '#if defined(KPSE_DEBUG)' to allow
+ compilation with '-DNO_DEBUG'.
+
2010-02-12 Karl Berry <karl@tug.org>
* search.c: remove non-KPATHSEA code. It just got too confusing
diff --git a/Build/source/texk/dvipsk/dvips.c b/Build/source/texk/dvipsk/dvips.c
index 77f427e72e9..43fa09f3db0 100644
--- a/Build/source/texk/dvipsk/dvips.c
+++ b/Build/source/texk/dvipsk/dvips.c
@@ -615,14 +615,14 @@ main(int argc, char **argv)
debug_flag = 0 ;
}
}
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined(KPSE_DEBUG)
if (dd(D_FILES)) KPSE_DEBUG_SET (KPSE_DEBUG_FOPEN);
if (dd(D_PATHS)) KPSE_DEBUG_SET (KPSE_DEBUG_PATHS);
if (dd(D_STAT)) KPSE_DEBUG_SET (KPSE_DEBUG_STAT);
if (dd(D_HASH)) KPSE_DEBUG_SET (KPSE_DEBUG_HASH);
if (dd(D_EXPAND)) KPSE_DEBUG_SET (KPSE_DEBUG_EXPAND);
if (dd(D_SEARCH)) KPSE_DEBUG_SET (KPSE_DEBUG_SEARCH);
-#endif /* KPATHSEA */
+#endif /* KPATHSEA && KPSE_DEBUG */
#endif /* DEBUG */
#ifdef KPATHSEA
if (argc > 1) {
@@ -1128,14 +1128,14 @@ default:
}
} while (queryoptions != 0) ;
#endif
-#if (defined(KPATHSEA) && defined(DEBUG)) /* this should really be part of a subroutine */
+#if defined(KPATHSEA) && defined(KPSE_DEBUG) && defined(DEBUG) /* this should really be part of a subroutine */
if (dd(D_FILES)) KPSE_DEBUG_SET (KPSE_DEBUG_FOPEN);
if (dd(D_PATHS)) KPSE_DEBUG_SET (KPSE_DEBUG_PATHS);
if (dd(D_STAT)) KPSE_DEBUG_SET (KPSE_DEBUG_STAT);
if (dd(D_HASH)) KPSE_DEBUG_SET (KPSE_DEBUG_HASH);
if (dd(D_EXPAND)) KPSE_DEBUG_SET (KPSE_DEBUG_EXPAND);
if (dd(D_SEARCH)) KPSE_DEBUG_SET (KPSE_DEBUG_SEARCH);
-#endif /* DEBUG */
+#endif /* KPATHSEA && KPSE_DEBUG && DEBUG */
checkenv(1) ;
#ifdef KPATHSEA
kpse_init_prog ("DVIPS", actualdpi, mfmode, "cmr10");
diff --git a/Build/source/texk/gsftopk/ChangeLog b/Build/source/texk/gsftopk/ChangeLog
index ff307586803..e3735b857a3 100644
--- a/Build/source/texk/gsftopk/ChangeLog
+++ b/Build/source/texk/gsftopk/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * gsftopk.c: Add '#if defined(KPSE_DEBUG)' to allow compilation
+ with '-DNO_DEBUG'.
+
2009-11-07 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac, gsftopk.c: Require recent kpathsea version.
diff --git a/Build/source/texk/gsftopk/gsftopk.c b/Build/source/texk/gsftopk/gsftopk.c
index 4406a84a518..96a702d4415 100644
--- a/Build/source/texk/gsftopk/gsftopk.c
+++ b/Build/source/texk/gsftopk/gsftopk.c
@@ -369,7 +369,7 @@ static const struct option options[] = {
{"interpreter", 'i', True, &gspath, 0},
{"dosnames", 0, False, &dosnames, True},
{"quiet", 'q', False, &quiet, True},
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
{"debug", OPT_DBG,True, NULL, 0},
#endif
{"version", 'v', False, NULL, 0},
@@ -1513,7 +1513,7 @@ trim_bitmap(void)
height -= skip;
voff -= skip;
#if DEBUG
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
if (KPSE_DEBUG_P (GSPK_DEBUG_PK))
#endif
if (skip < 2 || skip > 3)
@@ -1532,7 +1532,7 @@ trim_bitmap(void)
}
height -= skip;
#if DEBUG
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
if (KPSE_DEBUG_P (GSPK_DEBUG_PK))
#endif
if (skip < 2 || skip > 3)
@@ -1552,7 +1552,7 @@ trim_bitmap(void)
}
++width;
#if DEBUG
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
if (KPSE_DEBUG_P (GSPK_DEBUG_PK))
#endif
if (skip < 2 || skip > 3)
@@ -1571,7 +1571,7 @@ trim_bitmap(void)
width -= skip;
hoff -= skip;
#if DEBUG
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
if (KPSE_DEBUG_P (GSPK_DEBUG_PK))
#endif
if (skip < 2 || skip > 3)
@@ -1680,7 +1680,7 @@ pk_rll_cvt(void)
}
#if DEBUG
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
if (KPSE_DEBUG_P (GSPK_DEBUG_BITMAP))
#endif
{
@@ -2083,7 +2083,7 @@ main(int argc, char **argv)
}
switch (opt->shortname) {
-#ifdef KPATHSEA
+#if defined(KPATHSEA) && defined (KPSE_DEBUG)
case OPT_DBG:
kpathsea_debug |= atoi(arg);
break;
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index 7e26c953e29..9e56ac31d83 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dir.c (kpathsea_dir_p), elt-dirs.c (kpathsea_normalize_path),
+ pathsearch.c (log_search, search, search_list),
+ tex-file.c (kpathsea_find_file_generic):
+ Add '#ifdef KPSE_DEBUG' to allow compilation with '-DNO_DEBUG'.
+
+ * dir.c (kpathsea_dir_p): Replace kpse_normalize_path() by
+ kpathsea_normalize_path().
+
2010-02-11 Peter Breitenlohner <peb@mppmu.mpg.de>
* db.h (kpathsea_init_db, kpse_init_db, kpathsea_db_search,
diff --git a/Build/source/texk/kpathsea/dir.c b/Build/source/texk/kpathsea/dir.c
index 5f599c15260..295e4dcb75c 100644
--- a/Build/source/texk/kpathsea/dir.c
+++ b/Build/source/texk/kpathsea/dir.c
@@ -1,6 +1,6 @@
/* dir.c: directory operations.
- Copyright 1992, 1993, 1994, 1995, 2008, 2009 Karl Berry.
+ Copyright 1992, 1993, 1994, 1995, 2008, 2009, 2010 Karl Berry.
Copyright 2000, 2002, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -36,9 +36,10 @@ kpathsea_dir_p (kpathsea kpse, const_string fn)
#ifdef WIN32
int fa;
- kpse_normalize_path((string)fn);
+ kpathsea_normalize_path(kpse, (string)fn);
fa = GetFileAttributes(fn);
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_STAT)) {
if (fa == 0xFFFFFFFF) {
fprintf(stderr, "failed to get file attributes for %s (%d)\n",
@@ -49,18 +50,19 @@ kpathsea_dir_p (kpathsea kpse, const_string fn)
"is" : "is not");
}
}
+#endif /* KPSE_DEBUG */
return (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
-#else
+#else /* !WIN32 */
struct stat stats;
return stat (fn, &stats) == 0 && S_ISDIR (stats.st_mode);
-#endif
+#endif /* !WIN32 */
}
#if defined(KPSE_COMPAT_API)
boolean
dir_p (const_string fn)
{
- return kpathsea_dir_p(kpse_def,fn);
+ return kpathsea_dir_p(kpse_def, fn);
}
#endif
diff --git a/Build/source/texk/kpathsea/elt-dirs.c b/Build/source/texk/kpathsea/elt-dirs.c
index a8711cb0198..a13965db037 100644
--- a/Build/source/texk/kpathsea/elt-dirs.c
+++ b/Build/source/texk/kpathsea/elt-dirs.c
@@ -1,6 +1,6 @@
/* elt-dirs.c: Translate a path element to its corresponding director{y,ies}.
- Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009 Karl Berry.
+ Copyright 1993, 1994, 1995, 1996, 1997, 2008, 2009, 2010 Karl Berry.
Copyright 1997, 1998, 1999, 2000, 2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -377,8 +377,10 @@ kpathsea_normalize_path (kpathsea kpse, string elt)
;
}
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_STAT) && ret != 1)
DEBUGF2 ("kpse_normalize_path (%s) => %u\n", elt, ret);
+#endif /* KPSE_DEBUG */
return ret;
}
diff --git a/Build/source/texk/kpathsea/pathsearch.c b/Build/source/texk/kpathsea/pathsearch.c
index 1ea9300c464..4bc0b974d29 100644
--- a/Build/source/texk/kpathsea/pathsearch.c
+++ b/Build/source/texk/kpathsea/pathsearch.c
@@ -1,6 +1,6 @@
/* pathsearch.c: look up a filename in a path.
- Copyright 1993, 1994, 1995, 1997, 2007, 2009 Karl Berry.
+ Copyright 1993, 1994, 1995, 1997, 2007, 2009, 2010 Karl Berry.
Copyright 1997-2005 Olaf Weber.
This library is free software; you can redistribute it and/or
@@ -63,7 +63,11 @@ log_search (kpathsea kpse, str_list_type filenames)
}
}
- if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH) || kpse->log_file) {
+ if (
+#ifdef KPSE_DEBUG
+ KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH) ||
+#endif /* KPSE_DEBUG */
+ kpse->log_file) {
unsigned e;
/* FILENAMES should never be null, but safety doesn't hurt. */
@@ -76,6 +80,7 @@ log_search (kpathsea kpse, str_list_type filenames)
fprintf (kpse->log_file, "%lu %s\n", (long unsigned) time (NULL),
filename);
+#ifdef KPSE_DEBUG
/* And show them online, if debugging. We've already started
the debugging line in `search', where this is called, so
just print the filename here, don't use DEBUGF. */
@@ -83,6 +88,7 @@ log_search (kpathsea kpse, str_list_type filenames)
putc (' ', stderr);
fputs (filename, stderr);
}
+#endif /* KPSE_DEBUG */
}
}
}
@@ -352,9 +358,11 @@ search (kpathsea kpse, const_string path, const_string original_name,
consider PATH at all. */
absolute_p = kpathsea_absolute_p (kpse, name, true);
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH))
DEBUGF4 ("start search(file=%s, must_exist=%d, find_all=%d, path=%s).\n",
name, must_exist, all, path);
+#endif /* KPSE_DEBUG */
/* Find the file(s). */
ret_list = absolute_p ? absolute_search (kpse, name)
@@ -373,11 +381,15 @@ search (kpathsea kpse, const_string path, const_string original_name,
} else {
/* Record the filenames we found, if desired. And wrap them in a
debugging line if we're doing that. */
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH))
DEBUGF1 ("search(%s) =>", original_name);
+#endif /* KPSE_DEBUG */
log_search (kpse, ret_list);
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH))
putc ('\n', stderr);
+#endif /* KPSE_DEBUG */
}
#ifdef __DJGPP__
@@ -428,6 +440,7 @@ search_list (kpathsea kpse, const_string path, const_string* names,
ret_list = str_list_init();
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) {
DEBUGF1 ("start search(files=[%s", *names);
for (namep = names+1; *namep != NULL; namep++) {
@@ -437,6 +450,7 @@ search_list (kpathsea kpse, const_string path, const_string* names,
fprintf (stderr, "], must_exist=%d, find_all=%d, path=%s).\n",
must_exist, all, path);
}
+#endif /* KPSE_DEBUG */
/* FIXME: is this really true? No need to do any expansion on names. */
@@ -519,6 +533,7 @@ search_list (kpathsea kpse, const_string path, const_string* names,
} else {
/* Record the filenames we found, if desired. And wrap them in a
debugging line if we're doing that. */
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH)) {
DEBUGF1 ("search([%s", *names);
for (namep = names+1; *namep != NULL; namep++) {
@@ -527,9 +542,12 @@ search_list (kpathsea kpse, const_string path, const_string* names,
}
fputs ("]) =>", stderr);
}
+#endif /* KPSE_DEBUG */
log_search (kpse, ret_list);
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH))
putc ('\n', stderr);
+#endif /* KPSE_DEBUG */
}
#ifdef __DJGPP__
diff --git a/Build/source/texk/kpathsea/tex-file.c b/Build/source/texk/kpathsea/tex-file.c
index 75cc017d9ad..d31e55dce1f 100644
--- a/Build/source/texk/kpathsea/tex-file.c
+++ b/Build/source/texk/kpathsea/tex-file.c
@@ -984,9 +984,11 @@ kpathsea_find_file_generic (kpathsea kpse, const_string const_name,
if (FMT_INFO.path == NULL)
kpathsea_init_format (kpse, format);
+#ifdef KPSE_DEBUG
if (KPATHSEA_DEBUG_P (KPSE_DEBUG_SEARCH))
DEBUGF3 ("kpse_find_file: searching for %s of type %s (from %s)\n",
const_name, FMT_INFO.type, FMT_INFO.path_source);
+#endif /* KPSE_DEBUG */
/* Do variable and tilde expansion. */
name = kpathsea_expand (kpse, const_name);