summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2006-02-22 07:28:25 +0000
committerRay Johnston <ray.johnston@artifex.com>2006-02-22 07:28:25 +0000
commit45a15f6a7e7e87b860b798431920910c99ac0868 (patch)
tree49d9891ad7f19106c67ba73f9a3acc6d1b9399a8
parentf62938ad1e7401b61183eff7bf271b8d803fcd6e (diff)
Remove CWD_PREFIX from makefiles -- mkromfs file list is reordered. Add
the %rom% device to the LIBPATH list in imain.c so that .libfile works. Also export print_resource_usage for use in non-debug builds. Thanks to Ralph Giles for the suggestions. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@6606 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/src/Makefile.in2
-rw-r--r--gs/src/bcwin32.mak2
-rw-r--r--gs/src/dvx-gcc.mak2
-rw-r--r--gs/src/iccinit1.c3
-rw-r--r--gs/src/imain.c26
-rw-r--r--gs/src/int.mak3
-rw-r--r--gs/src/macos-mcp.mak2
-rw-r--r--gs/src/macosx.mak2
-rw-r--r--gs/src/msvc32.mak2
-rw-r--r--gs/src/msvclib.mak2
-rw-r--r--gs/src/openvms.mak2
-rw-r--r--gs/src/os2.mak2
-rw-r--r--gs/src/ugcclib.mak2
-rw-r--r--gs/src/unix-gcc.mak2
-rw-r--r--gs/src/unixansi.mak2
-rw-r--r--gs/src/watclib.mak2
-rw-r--r--gs/src/watcw32.mak2
17 files changed, 23 insertions, 37 deletions
diff --git a/gs/src/Makefile.in b/gs/src/Makefile.in
index d53f66cfe..6b0bd7565 100644
--- a/gs/src/Makefile.in
+++ b/gs/src/Makefile.in
@@ -34,8 +34,6 @@ PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
include $(GLSRCDIR)/version.mak
diff --git a/gs/src/bcwin32.mak b/gs/src/bcwin32.mak
index 0aa6cebe1..150c0cb6c 100644
--- a/gs/src/bcwin32.mak
+++ b/gs/src/bcwin32.mak
@@ -37,8 +37,6 @@ PSLIBDIR=lib
PSGENDIR=obj
PSOBJDIR=obj
-CWD_PREFIX=./
-
# Define the root directory for Ghostscript installation.
!ifndef AROOTDIR
diff --git a/gs/src/dvx-gcc.mak b/gs/src/dvx-gcc.mak
index c32e3a3e7..ae9697425 100644
--- a/gs/src/dvx-gcc.mak
+++ b/gs/src/dvx-gcc.mak
@@ -40,8 +40,6 @@ PSLIBDIR=lib
PSGENDIR=obj
PSOBJDIR=obj
-CWD_PREFIX=./
-
# Define the installation commands and target directories for
# executables and files. The commands are only relevant to `make install';
# the directories also define the default search path for the
diff --git a/gs/src/iccinit1.c b/gs/src/iccinit1.c
index 43ffab68e..94e81c18d 100644
--- a/gs/src/iccinit1.c
+++ b/gs/src/iccinit1.c
@@ -26,9 +26,6 @@
*/
const byte gs_init_string[] =
"0 pop " /* required integer token. DO NOT REMOVE. */
- "systemdict /LIBPATH " /* Put %rom% as first path on list */
- "mark (%rom%) LIBPATH aload pop " /* make array with (%rom%) as first */
- "counttomark array astore exch pop put " /* element keeping other paths. */
"systemdict /GenericResourceDir known not { " /* if GenericResourceDir was */
"systemdict /GenericResourceDir (%rom%Resource/) put " /* not set on command line, */
"} if " /* set to %rom%Resource/ */
diff --git a/gs/src/imain.c b/gs/src/imain.c
index 14412d3fb..97f908858 100644
--- a/gs/src/imain.c
+++ b/gs/src/imain.c
@@ -27,6 +27,7 @@
#include "gsutil.h" /* for bytes_compare */
#include "gxdevice.h"
#include "gxalloc.h"
+#include "gxiodev.h" /* for iodev struct */
#include "gzstate.h"
#include "ierrors.h"
#include "oper.h"
@@ -91,7 +92,7 @@ gs_main_alloc_instance(gs_memory_t *mem)
/* ------ Forward references ------ */
private int gs_run_init_file(gs_main_instance *, int *, ref *);
-private void print_resource_usage(const gs_main_instance *,
+void print_resource_usage(const gs_main_instance *,
gs_dual_memory_t *, const char *);
/* ------ Initialization ------ */
@@ -425,9 +426,11 @@ gs_main_add_lib_path(gs_main_instance * minst, const char *lpath)
/* ------ Execution ------ */
+extern_gx_io_device_table();
+
/* Complete the list of library search paths. */
-/* This may involve adding or removing the current directory */
-/* as the first element. */
+/* This may involve adding the %rom% device (for COMPILE_INITS) as well */
+/* as adding or removing the current directory as the first element. */
int
gs_main_set_lib_paths(gs_main_instance * minst)
{
@@ -435,8 +438,9 @@ gs_main_set_lib_paths(gs_main_instance * minst)
int first_is_here =
(r_size(&minst->lib_path.list) != 0 &&
paths[0].value.bytes == (const byte *)gp_current_directory_name ? 1 : 0);
- int count = minst->lib_path.count;
int code = 0;
+ int count = minst->lib_path.count;
+ int i, have_rom_device = 0;
if (minst->search_here_first) {
if (!(first_is_here ||
@@ -459,6 +463,18 @@ gs_main_set_lib_paths(gs_main_instance * minst)
count + (minst->search_here_first ? 1 : 0));
if (minst->lib_path.env != 0)
code = file_path_add(&minst->lib_path, minst->lib_path.env);
+ /* now put the %rom% device before the gs_lib_default_path on the list */
+ for (i=0; i<gx_io_device_table_count; i++) {
+ gx_io_device *iodev = gx_io_device_table[i];
+ const char *dname = iodev->dname;
+
+ if (dname && strlen(dname) == 5 && !memcmp("%rom%", dname, 5)) {
+ have_rom_device = 1;
+ break;
+ }
+ }
+ if (have_rom_device && code >= 0)
+ code = file_path_add(&minst->lib_path, "%rom%");
if (minst->lib_path.final != 0 && code >= 0)
code = file_path_add(&minst->lib_path, minst->lib_path.final);
return code;
@@ -922,7 +938,7 @@ gs_abort(const gs_memory_t *mem)
/* ------ Debugging ------ */
/* Print resource usage statistics. */
-private void
+void
print_resource_usage(const gs_main_instance * minst, gs_dual_memory_t * dmem,
const char *msg)
{
diff --git a/gs/src/int.mak b/gs/src/int.mak
index 687604223..1d598587a 100644
--- a/gs/src/int.mak
+++ b/gs/src/int.mak
@@ -981,8 +981,9 @@ $(PSGEN)gs_init.ps : $(PSLIB)$(GS_INIT) $(GENINIT_XE) $(gconfig_h)
# versions.
EXTRA_INIT_FILES= Fontmap cidfmap FAPI xlatmap
+# Note: RESOURCE_LIST is first since those are CWD relative. Later files use -P prefix paths
$(GLOBJ)gsromfs.c : $(MKROMFS_XE) $(PSGEN)gs_init.ps
- $(EXP)$(MKROMFS_XE) -o $(GLOBJ)gsromfs.c -c -P $(PSGEN) gs_init.ps -P $(PSLIB) $(EXTRA_INIT_FILES) -P $(CWD_PREFIX) -X .svn $(RESOURCE_LIST)
+ $(EXP)$(MKROMFS_XE) -o $(GLOBJ)gsromfs.c -c -X .svn $(RESOURCE_LIST) -P $(PSGEN) gs_init.ps -P $(PSLIB) $(EXTRA_INIT_FILES)
# ---------------- Stochastic halftone ---------------- #
diff --git a/gs/src/macos-mcp.mak b/gs/src/macos-mcp.mak
index 0e88eb201..8691dd3a0 100644
--- a/gs/src/macos-mcp.mak
+++ b/gs/src/macos-mcp.mak
@@ -37,8 +37,6 @@ PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
include $(GLSRCDIR)/version.mak
diff --git a/gs/src/macosx.mak b/gs/src/macosx.mak
index 6fed72acb..672c1cf0e 100644
--- a/gs/src/macosx.mak
+++ b/gs/src/macosx.mak
@@ -33,8 +33,6 @@ PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
#include $(COMMONDIR)/gccdefs.mak
diff --git a/gs/src/msvc32.mak b/gs/src/msvc32.mak
index 147e8ba2f..f8e328777 100644
--- a/gs/src/msvc32.mak
+++ b/gs/src/msvc32.mak
@@ -306,8 +306,6 @@ CFLAGS=$(CFLAGS) /DGX_COLOR_INDEX_TYPE="$(GX_COLOR_INDEX_TYPE)"
WARNOPT=-W2
!endif
-CWD_PREFIX=./
-
#
# Do not edit the next group of lines.
diff --git a/gs/src/msvclib.mak b/gs/src/msvclib.mak
index ca7569b43..c5ee4dcec 100644
--- a/gs/src/msvclib.mak
+++ b/gs/src/msvclib.mak
@@ -117,8 +117,6 @@ GLGENDIR=.\obj
GLOBJDIR=.\obj
!endif
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
NUL=
DD=$(GLGENDIR)\$(NUL)
diff --git a/gs/src/openvms.mak b/gs/src/openvms.mak
index 9b82f8e96..bfed9319d 100644
--- a/gs/src/openvms.mak
+++ b/gs/src/openvms.mak
@@ -47,8 +47,6 @@ PSOBJDIR=[.obj]
BIN_DIR=BIN.DIR
OBJ_DIR=OBJ.DIR
-CWD_PREFIX=[]
-
# Do not edit the next group of lines.
#include $(COMMONDIR)/vmscdefs.mak
diff --git a/gs/src/os2.mak b/gs/src/os2.mak
index 19bc7a551..fe2aa6b14 100644
--- a/gs/src/os2.mak
+++ b/gs/src/os2.mak
@@ -39,8 +39,6 @@ PSLIBDIR=lib
PSGENDIR=obj
PSOBJDIR=obj
-CWD_PREFIX=./
-
# Define the root directory for Ghostscript installation.
AROOTDIR=c:/gs
diff --git a/gs/src/ugcclib.mak b/gs/src/ugcclib.mak
index a4de8b286..5c5220037 100644
--- a/gs/src/ugcclib.mak
+++ b/gs/src/ugcclib.mak
@@ -23,8 +23,6 @@ GLOBJDIR=./libobj
DD=$(GLGENDIR)/
GLD=$(GLGENDIR)/
-CWD_PREFIX=./
-
#include $(COMMONDIR)/gccdefs.mak
#include $(COMMONDIR)/unixdefs.mak
#include $(COMMONDIR)/generic.mak
diff --git a/gs/src/unix-gcc.mak b/gs/src/unix-gcc.mak
index 3dc73df6f..771183a8b 100644
--- a/gs/src/unix-gcc.mak
+++ b/gs/src/unix-gcc.mak
@@ -33,8 +33,6 @@ PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
#include $(COMMONDIR)/gccdefs.mak
diff --git a/gs/src/unixansi.mak b/gs/src/unixansi.mak
index 5de60e521..304afcb81 100644
--- a/gs/src/unixansi.mak
+++ b/gs/src/unixansi.mak
@@ -33,8 +33,6 @@ PSLIBDIR=./lib
PSGENDIR=./obj
PSOBJDIR=./obj
-CWD_PREFIX=./
-
# Do not edit the next group of lines.
#include $(COMMONDIR)/ansidefs.mak
diff --git a/gs/src/watclib.mak b/gs/src/watclib.mak
index ff7696ae4..a774a97f2 100644
--- a/gs/src/watclib.mak
+++ b/gs/src/watclib.mak
@@ -26,8 +26,6 @@ GS_LIB_DEFAULT=$(GSROOTDIR)/lib\;$(GSROOTDIR)/resource\;$(AROOTDIR)/fonts
SEARCH_HERE_FIRST=1
GS_INIT=gs_init.ps
-CWD_PREFIX=./
-
!ifndef DEBUG
DEBUG=1
!endif
diff --git a/gs/src/watcw32.mak b/gs/src/watcw32.mak
index 821327347..076c0e054 100644
--- a/gs/src/watcw32.mak
+++ b/gs/src/watcw32.mak
@@ -41,8 +41,6 @@ PSLIBDIR=lib
PSGENDIR=obj
PSOBJDIR=obj
-CWD_PREFIX=./
-
# Define the root directory for Ghostscript installation.
AROOTDIR=c:/gs