Closed michaelrsweet closed 19 years ago
CUPS.org User: pgiessel.mac
Try "gmake" then "gmake install"
CUPS.org User: mike
This STR has not been updated by the submitter for two or more weeks and has been closed as required by the CUPS Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.
Version: 7.07.1 CUPS.org User: bof.pcisys
GS 7.07.1 compiling on FreeBSD 5.3 stable:
make ran OK make install gives following
[/tmp/espgs-7.07.1]#make install gcc -I./src -o ./obj/genconf ./src/genconf.c gcc: ./src/genconf.c: No such file or directory gcc: No input files specified *\ Error code 1
Stop in /tmp/espgs-7.07.1.
I ran gcc -I[note space inserted]./src -o ./obj/genconf ./src/genconf.c and generated a file ./src/genconf.c, which is below, but the error still occurs.
/* Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000 Aladdin Enterprises. All rights reserved.
This software is provided AS-IS with no warranty, either express or implied.
This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of the license contained in the file LICENSE in this distribution.
For more information about licensing, please refer to http://www.ghostscript.com/licensing/. For information on commercial licensing, go to http://www.artifex.com/licensing/ or contact Artifex Software, Inc., 101 Lucas Valley Road #110, San Rafael, CA 94903, U.S.A., +1(415)492-9861. */
/$Id: genconf.c,v 1.3 2002/04/23 11:58:43 easysw Exp $ */ / Generate configuration files */
include "stdpre.h"
include
include
include
include /* for calloc */
include
/*
define DEFAULT_FILE_PREFIX ""
define DEFAULT_NAMEPREFIX "gs"
define MAX_STR 120
/* Structures for accumulating information. _/ typedef struct string_item_s { const char str; int fileindex; / index of file containing this item / int index; } string_item_t;
/* The values of uniqmode are bit masks. / typedef enum { uniqall = 1, / keep all occurrences (default) _/ uniqfirst = 2, / keep only first occurrence _/ uniqlast = 4 / keep only last occurrence _/ } uniq_mode_t; typedef struct string_lists { / The following are set at creation time. _/ const char listname; / only for debugging _/ int max_count; uniq_modet mode; / The following are updated dynamically. / int count; string_item_t *items; } string_list_t;
define MAX_PATTERN 60
typedef struct string_pattern_s { bool upper_case; bool drop_extn; char pattern[MAX_PATTERN + 1]; } string_pattern_t; typedef struct config_s { int debug; const char _name_prefix; const char fileprefix; / Special "resources" _/ string_list_t file_names; string_list_t file_contents; string_listt replaces; / Real resources / union ru { struct nu { / These names must parallel configlists below. / string_list_t sorted_resources; string_list_t resources; string_listt devs; / also includes devs2 / string_list_t fonts; string_list_t libs; string_list_t libpaths; string_list_t links; string_list_t objs; } named;
define NUM_RESOURCE_LISTS 8
} config_t;
/*
/* Forward definitions _/ private void mrealloc(P3(void , size_t, size_t)); int alloc_list(P1(string_list_t )); void dev_file_name(P1(char )); int process_replaces(P1(config_t )); int read_dev(P2(config_t , const char )); int read_token(P3(char , int, const char _)); int add_entry(P4(config_t , char , const char , int)); string_item_t add_item(P3(string_list_t , const char , int)); void sort_uniq(P2(string_list_t , bool)); void write_list(P3(FILE , const string_list_t , const char )); void write_list_pattern(P3(FILE , const string_list_t , const string_pattern_t )); bool var_expand(P3(char , char [MAX_STR], const config_t )); void add_definition(P4(const char , const char , string_list_t , bool)); string_item_t lookup(P2(const char , const string_list_t ));
int main(int argc, char *argv[]) { config_t conf; char escape = '&'; int i;
}
/*
if old_ptr = NULL. / private void mrealloc(void old_ptr, size_t old_size, size_t new_size) { void new_ptr = malloc(new_size);
if (newptr == NULL) return NULL; /* We have to pass in the old size, since we have no way to / /_ determine it otherwise. */ if (old_ptr) memcpy(new_ptr, old_ptr, min(old_size, new_size)); return new_ptr; }
/* Allocate and initialize a string list. / int alloc_list(string_list_t * list) { list->count = 0; list->items = (string_item_t ) calloc(list->max_count, sizeof(string_item_t)); assert(list->items != NULL); return 0; }
/* If necessary, convert a .dev name to its file name. / void dev_file_name(char str) { int len = strlen(str);
}
/* Delete any files that are named as -replace "resources". / int process_replaces(config_t \ pconf) { char bufname[MAX_STR]; int i;
}
/*
Return the file_contents item for the file. / private string_item_t read_file(config_t * pconf, const char fname) { char cname = malloc(strlen(fname) + strlen(pconf->file_prefix) + 1); int i; FILE in; int end, nread; char cont; string_item_t *item;
if (cname == 0) { fprintf(stderr, "Can't allocate space for file name %s%s.\n", pconf->file_prefix, fname); exit(1); } strcpy(cname, pconf->file_prefix); strcat(cname, fname); for (i = 0; i < pconf->file_names.count; ++i) if (!strcmp(pconf->file_names.items[i].str, cname)) { free(cname); return &pconf->filecontents.items[i]; } /* Try to open the file in binary mode, to avoid the overhead / / of unnecessary EOL conversion in the C library. / in = fopen(cname, "rb"); if (in == 0) { in = fopen(cname, "r"); if (in == 0) { fprintf(stderr, "Can't read %s.\n", cname); exit(1); } } fseek(in, 0L, 2 /_SEEKEND / ); end = ftell(in); cont = malloc(end + 1); if (cont == 0) { fprintf(stderr, "Can't allocate %d bytes to read %s.\n", end + 1, cname); exit(1); } rewind(in); nread = fread(cont, 1, end, in); fclose(in); cont[nread] = 0; if (pconf->debug) printf("File %s = %d bytes.\n", cname, nread); add_item(&pconf->file_names, cname, -1); item = add_item(&pconf->filecontents, cont, -1); item->index = 0; / union of uniq_mode_ts */ return item; }
/* Read and parse a .dev file. Return the union of all its uniq_mode_ts. / int read_dev(config_t * pconf, const char arg) { string_item_t item; const char in;
define MAX_TOKEN 256
undef MAX_TOKEN
}
/* Read a token from a string that contains the contents of a file. _/ int read_token(char token, int max_len, const char _pin) { const char in = pin; int len = 0;
}
/* Add an entry to a configuration. Return its uniq_modet. / int add_entry(config_t * pconf, char category, const char item, int fileindex) { if (item[0] == '-' && islower(item[1])) { / set category / strcpy(category, item + 1); return 0; } else { / add to current category / char str[MAX_STR]; char template[80]; const char pat = 0; string_list_t *list = &pconf->lists.named.resources;
define IS_CAT(str) !strcmp(category, str)
pre: sprintf(template, pat, pconf->name_prefix); pat = template; break; case 'e': if (ISCAT("emulator")) { sprintf(str, "emulator(\"%s\",%u)", item, (uint)strlen(item)); item = str; break; } goto err; case 'f': if (IS_CAT("font")) { list = &pconf->lists.named.fonts; break; } else if (IS_CAT("functiontype")) { pat = "functiontype(%%s,%sbuildfunction%%s)"; } else goto err; goto pre; case 'h': if (ISCAT("halftone")) { pat = "halftone(%sdht_%%s)"; } else goto err; goto pre; case 'i': if (IS_CAT("imageclass")) { list = &pconf->lists.named.sorted_resources; pat = "imageclass(%simageclass%%s)"; } else if (IS_CAT("imagetype")) { pat = "imagetype(%%s,%simagetype%%s)"; } else if (IS_CAT("include")) { strcpy(str, item); dev_file_name(str); return read_dev(pconf, str); } else if (ISCAT("init")) { pat = "init(%s%%s_init)"; } else if (IS_CAT("iodev")) { pat = "iodevice(%siodev_%%s)"; } else goto err; goto pre; case 'l': if (IS_CAT("lib")) { list = &pconf->lists.named.libs; break; } else if (IS_CAT("libpath")) { list = &pconf->lists.named.libpaths; break; } else if (IS_CAT("link")) { list = &pconf->lists.named.links; break; } goto err; case 'o': if (IS_CAT("obj")) { list = &pconf->lists.named.objs; strcpy(template, pconf->file_prefix); strcat(template, "%s"); pat = template; break; } if (ISCAT("oper")) { pat = "oper(%s_op_defs)"; break; } goto err; case 'p': if (ISCAT("ps")) { sprintf(str, "psfile(\"%s.ps\",%u)", item, (uint)(strlen(item) + 3)); item = str; break; } goto err; case 'r': if (IS_CAT("replace")) { list = &pconf->replaces; break; } goto err;
undef IS_CAT
err: fprintf(stderr, "Definition not recognized: %s %s.\n", category, item); exit(1); } if (pat) { sprintf(str, pat, item, item); assert(strlen(str) < MAX_STR); add_item(list, str, file_index); } else add_item(list, item, file_index); return list->mode; } }
/* Add an item to a list. / string_item_t add_item(string_list_t * list, const char str, int file_index) { char rstr = malloc(strlen(str) + 1); int count = list->count; string_item_t *item;
}
/*
or the latest (if last = true). / private int cmp_index(const void p1, const void p2) { const string_item_t const psi1 = (const string_item_t )p1; const string_item_t const psi2 = (const string_item_t *)p2; int cmp = psi1->index - psi2->index;
return (cmp < 0 ? -1 : cmp > 0 ? 1 : 0); } private int cmp_str(const void p1, const void p2) { const string_item_t const psi1 = (const string_item_t )p1; const string_item_t const psi2 = (const string_item_t )p2;
return strcmp(psi1->str, psi2->str); } void sort_uniq(string_list_t * list, bool by_index) { string_item_t strlist = list->items; int count = list->count; const string_item_t from; string_item_t *to; int i; bool last = list->mode == uniq_last;
if (count == 0) return; qsort((char )strlist, count, sizeof(string_item_t), cmp_str); for (from = to = strlist + 1, i = 1; i < count; from++, i++) if (strcmp(from->str, to[-1].str)) to++ = from; else if ((last ? from->index > to[-1].index : from->index < to[-1].index) ) to[-1] = from; count = to - strlist; list->count = count; if (by_index) qsort((char *)strlist, count, sizeof(string_item_t), cmp_index); }
/* Write a list of strings using a template. / void write_list(FILE * out, const string_list_t * list, const char pstr) { string_pattern_t pat;
} void write_list_pattern(FILE * out, const string_list_t * list, const string_pattern_t * pat) { int i; char macname[40]; int plen = strlen(pat->pattern);
}