|
From: Earnie B. <ea...@us...> - 2006-08-14 17:32:36
|
Update of /cvsroot/mingw/msys/packages/gawk/3.1.5/pc In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv30392/3.1.5/pc Added Files: ChangeLog Makefile Makefile.tst config.h dlfcn.c dlfcn.h gawk.def gawkmisc.pc gawkw32.def getid.c install.awk mkinstal.sh popen.c popen.h Log Message: Update package --- NEW FILE: config.h --- /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.in by autoheader. */ /* * acconfig.h -- configuration definitions for gawk. */ /* * Copyright (C) 1995-2005 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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 2 of the License, or * (at your option) any later version. * * GAWK 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ #ifndef _ALL_SOURCE /* #undef _ALL_SOURCE */ #endif /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ /* #undef __CHAR_UNSIGNED__ */ #endif /* Define to empty if the keyword does not work. */ /* #undef const */ /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #define GETGROUPS_T gid_t /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ /* Define if you have alloca, as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have <alloca.h> and it should be used (not on Ultrix). */ /* #undef HAVE_ALLOCA_H */ /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ /* Define if you have a working `mmap' system call. */ /* #undef HAVE_MMAP */ /* Define if your struct stat has st_blksize. */ #define HAVE_ST_BLKSIZE 1 /* Define if you have the ANSI # stringizing operator in cpp. */ #define HAVE_STRINGIZE 1 /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* #undef HAVE_SYS_WAIT_H */ /* Define if your struct tm has tm_zone. */ /* #undef HAVE_TM_ZONE */ /* Define if you don't have tm_zone but do have the external array tzname. */ #define HAVE_TZNAME 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define as __inline if that's what the C compiler calls it. */ #if defined (_MSC_VER) #define inline #endif /* Define if on MINIX. */ /* #undef _MINIX */ /* Define to `long' if <sys/types.h> doesn't define. */ /* #undef off_t */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef pid_t */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define to `unsigned' if <sys/types.h> doesn't define. */ /* #undef size_t */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Define if your <sys/time.h> declares struct tm. */ /* #undef TM_IN_SYS_TIME */ /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef uid_t */ #define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */ #define SPRINTF_RET int /* return type of sprintf */ /* #undef HAVE_MKTIME */ /* we have the mktime function */ /* #undef HAVE_SOCKETS */ /* we have sockets on this system */ /* #undef HAVE_PORTALS */ /* we have portals on /p on this system */ /* #undef DYNAMIC */ /* allow dynamic addition of builtins */ /* #undef STRTOD_NOT_C89 */ /* strtod doesn't have C89 semantics */ /* Define if you have the __argz_count function. */ #define HAVE___ARGZ_COUNT 1 /* Define if you have the __argz_next function. */ #define HAVE___ARGZ_NEXT 1 /* Define if you have the __argz_stringify function. */ #define HAVE___ARGZ_STRINGIFY 1 /* Define if you have the alarm function. */ #define HAVE_ALARM 1 /* Define if you have the dcgettext function. */ /* #undef HAVE_DCGETTEXT */ /* Define if you have the fmod function. */ #define HAVE_FMOD 1 /* Define if you have the getcwd function. */ /* #undef HAVE_GETCWD */ /* Define if you have the getpagesize function. */ /* #undef HAVE_GETPAGESIZE */ /* Define if you have the memcmp function. */ #define HAVE_MEMCMP 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the munmap function. */ /* #undef HAVE_MUNMAP */ /* Define if you have the putenv function. */ /* #undef HAVE_PUTENV */ /* Define if you have the setenv function. */ /* #define HAVE_SETENV */ /* Define if you have the setlocale function. */ /* #undef HAVE_SETLOCALE */ /* Define if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ /* Define if you have the strcasecmp function. */ /* #undef HAVE_STRCASECMP */ /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 /* Define if you have the system function. */ #define HAVE_SYSTEM 1 /* Define if you have the tzset function. */ #define HAVE_TZSET 1 /* Define if you have the <argz.h> header file. */ /* #undef HAVE_ARGZ_H */ /* Define if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the <libintl.h> header file. */ /* #undef HAVE_LIBINTL_H */ /* Define if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the <locale.h> header file. */ /* #undef HAVE_LOCALE_H */ /* Define if you have the <malloc.h> header file. */ /* #undef HAVE_MALLOC_H */ /* Define if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the <netdb.h> header file. */ /* #undef HAVE_NETDB_H */ /* Define if you have the <netinet/in.h> header file. */ /* #undef HAVE_NETINET_IN_H */ /* Define if you have the <nl_types.h> header file. */ /* #undef HAVE_NL_TYPES_H */ /* Define if you have the <signum.h> header file. */ /* #undef HAVE_SIGNUM_H */ /* Define if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 /* Define if you have the <stdlib.h> header file. */ /* #undef HAVE_STDLIB_H */ /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define if you have the <strings.h> header file. */ /* #undef HAVE_STRINGS_H */ /* Define if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the <sys/socket.h> header file. */ /* #undef HAVE_SYS_SOCKET_H */ /* Define if you have the <sys/time.h> header file. */ #if defined(DJGPP) # define HAVE_SYS_TIME_H 1 #endif /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have the <unistd.h> header file. */ #if defined(DJGPP) # define HAVE_UNISTD_H 1 #endif /* Define if you have the i library (-li). */ /* #undef HAVE_LIBI */ /* Define if you have the intl library (-lintl). */ /* #undef HAVE_LIBINTL */ /* Define if you have the m library (-lm). */ #define HAVE_LIBM 1 /* Name of package */ #define PACKAGE "gawk" /* Version number of package */ #define VERSION "3.0.89" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */ /* #undef _LARGEFILE_SOURCE */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */ /* #undef _XOPEN_SOURCE */ /* Define if compiler has function prototypes */ #define PROTOTYPES 1 /* Define to 1 if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ /* Define if your locale.h file contains LC_MESSAGES. */ /* #undef HAVE_LC_MESSAGES */ /* Define to 1 if NLS is requested. */ /* #undef ENABLE_NLS */ /* Define to 1 if you have gettext and don't want to use GNU gettext. */ /* #undef HAVE_GETTEXT */ /* Define as 1 if you have catgets and don't want to use GNU gettext. */ /* #undef HAVE_CATGETS */ /* The size of `unsigned int' & `unsigned long', as computed by sizeof. */ #if defined(DJGPP) || defined(_MSC_VER) # include <limits.h> #endif #if UINT_MAX == 65536 # define SIZEOF_UNSIGNED_INT 2 #endif #if UINT_MAX == 4294967295U # define SIZEOF_UNSIGNED_INT 4 #endif #if ULONG_MAX == 4294967295UL # define SIZEOF_UNSIGNED_LONG 4 #endif /* Library search path */ #define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk" #if defined (_MSC_VER) #if !defined(__STDC__) # define __STDC__ 1 #endif #undef HAVE_UNISTD_H #undef HAVE_SYS_PARAM_H #undef HAVE_RANDOM /* msc strftime is incomplete, use supplied version */ #undef HAVE_STRFTIME /* #define HAVE_TM_ZONE */ #define altzone timezone #endif # define HAVE_POPEN_H #if defined(_MSC_VER) && defined(MSDOS) #define system(s) os_system(s) #endif #if defined(_MSC_VER) || defined(__MINGW32__) #define ssize_t long int /* DJGPP has ssize_t */ #define intmax_t long #define uintmax_t unsigned long #endif #if defined (_MSC_VER) || defined(__EMX__) #define strcasecmp stricmp #define strncasecmp strnicmp #endif #if defined(DJGPP) # define HAVE_LIMITS_H 1 # undef HAVE_POPEN_H #define intmax_t long long #define uintmax_t unsigned long long #endif #if defined(__WIN32__) && defined(__CRTRSXNT__) #include <crtrsxnt.h> #endif /* For vcWin32 */ #if defined(WIN32) && defined(_MSC_VER) #define alloca _alloca #define system(s) os_system(s) #endif #if defined(__MINGW32__) #undef HAVE_SYS_PARAM_H #endif /* #define NO_LINT 1 */ --- NEW FILE: gawk.def --- NAME gawk WINDOWCOMPAT NEWFILES DESCRIPTION 'GNU awk for OS/2' --- NEW FILE: dlfcn.h --- /* ** dlfcn.h -- limited implementation of posix dynamic loading functions */ /* * Copyright (C) 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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 2 of the License, or * (at your option) any later version. * * GAWK 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _DLFCN_H #define _DLFCN_H /* symbols required by susv3. These are not supported here (everything is * RTLD_NOW, RTLD_GLOBAL) */ #define RTLD_LAZY 0 #define RTLD_NOW 1 #define RTLD_GLOBAL 0 #define RTLD_LOCAL 2 int dlclose(void *); char *dlerror(void); void *dlopen(const char *, int); void *dlsym(void * /*restrict*/, const char * /*restrict*/); #endif --- NEW FILE: popen.c --- #include <stdio.h> #include <stdlib.h> #include <io.h> #include <string.h> #include <process.h> #ifdef OS2 #ifdef _MSC_VER #define popen(c,m) _popen(c,m) #define pclose(f) _pclose(f) #endif #endif #if defined(WIN32) && defined(_MSC_VER) #define popen _popen #define pclose _pclose #endif #ifndef _NFILE #define _NFILE 40 #endif static char template[] = "piXXXXXX"; static struct { char *command; char *name; char pmode[4]; } pipes[_NFILE]; /* * For systems where system() and popen() do not follow SHELL: * 1. Write command to temp file. Temp filename must have slashes * compatible with SHELL (if set) or COMSPEC. * 2. Convert slashes in SHELL (if present) to be compatible with COMSPEC. * Currently, only MSC (running under DOS) and MINGW versions are managed. */ #if defined(_MSC_VER) || defined(__MINGW32__) static int unixshell(char *p) { static char *shell[] = {"sh", "bash", "csh", "tcsh", "sh32", "sh16", "ksh", NULL}; char **shellp = shell, *s, *q; if (p == NULL) return (0); s = p = strdup(p); if ((q = strrchr(p, '\\')) != NULL) p = q + 1; if ((q = strrchr(p, '/')) != NULL) p = q + 1; if ((q = strchr(p, '.')) != NULL) *q = '\0'; strlwr(p); do { if (strcmp(*shellp, p) == 0) break; } while (*++shellp); free(s); return(*shellp ? 1 : 0); } static char * slashify(char *p, char *s) { if (unixshell(s)) while (s = strchr(p, '\\')) *s = '/'; else while (s = strchr(p, '/')) *s = '\\'; return(p); } static char * scriptify(char *command) { FILE *fp; char *cmd, *name, *s, *p; int i; if((name = tempnam(".", "pip")) == NULL) return(NULL); p = getenv("COMSPEC"); s = getenv("SHELL"); cmd = malloc(strlen(name) + (s ? strlen(s) : 0) + 9); *cmd = '\0'; if (s) { slashify(strcpy(cmd, s), p); p = s; } slashify(name, p); if (! (i = unixshell(p))) { char *p = (char *) realloc(name, strlen(name) + 5); if (p == NULL) return NULL; name = p; strcat(name, ".bat"); } if (s) sprintf(cmd + strlen(cmd), " %cc ", unixshell(s) ? '-' : '/'); strcpy(p = cmd + strlen(cmd), name); free(name); if ((fp = fopen(p, i ? "wb" : "w")) != NULL) { if (! i) fputs("@echo off\n", fp); i = strlen(command); if ((fwrite(command, 1, i, fp) < i) || (fputc('\n', fp) == EOF)) cmd = NULL; } else cmd = NULL; if (fp) fclose(fp); return(cmd); } static void unlink_and_free(char *cmd) { char *s; if (s = strrchr(cmd, ' ')) s++; else s = cmd; unlink(s); free(cmd); } int os_system(char *cmd) { char *s; int i; #if defined(OS2) if (_osmode == OS2_MODE) return(system(cmd)); #endif if ((cmd = scriptify(cmd)) == NULL) return(1); if (s = getenv("SHELL")) i = spawnlp(P_WAIT, s, s, cmd + strlen(s), NULL); else i = system(cmd); unlink_and_free(cmd); return(i); } #else #define os_system(cmd) system(cmd) #endif FILE * os_popen( char *command, char *mode ) { FILE *current; char *name; int cur; char curmode[4]; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(popen(command, mode)); #endif if (*mode != 'r' && *mode != 'w') return NULL; strncpy(curmode, mode, 3); curmode[3] = '\0'; #if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) current = popen(command = scriptify(command), mode); cur = fileno(current); strcpy(pipes[cur].pmode, curmode); pipes[cur].command = command; return(current); #endif /* ** get a name to use. */ if((name = tempnam(".","pip"))==NULL) return NULL; /* ** If we're reading, just call system to get a file filled with ** output. */ if (*curmode == 'r') { FILE *fp; if ((cur = dup(fileno(stdout))) == -1) return NULL; *curmode = 'w'; if ((current = freopen(name, curmode, stdout)) == NULL) return NULL; os_system(command); if (dup2(cur, fileno(stdout)) == -1) return NULL; close(cur); *curmode = 'r'; if ((current = fopen(name, curmode)) == NULL) return NULL; } else { if ((current = fopen(name, curmode)) == NULL) return NULL; } cur = fileno(current); pipes[cur].name = name; strcpy(pipes[cur].pmode, curmode); pipes[cur].command = strdup(command); return current; } int os_pclose( FILE * current) { int cur = fileno(current); int fd, rval; #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) return(pclose(current)); #endif #if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) rval = pclose(current); *pipes[cur].pmode = '\0'; unlink_and_free(pipes[cur].command); return rval; #endif /* ** check for an open file. */ switch (*pipes[cur].pmode) { case 'r': /* ** input pipes are just files we're done with. */ rval = fclose(current); unlink(pipes[cur].name); break; case 'w': /* ** output pipes are temporary files we have ** to cram down the throats of programs. */ fclose(current); rval = -1; if ((fd = dup(fileno(stdin))) != -1) { char *mode = pipes[cur].pmode; *mode = 'r'; if (current = freopen(pipes[cur].name, mode, stdin)) { rval = os_system(pipes[cur].command); fclose(current); if (dup2(fd, fileno(stdin)) == -1) rval = -1; close(fd); } } unlink(pipes[cur].name); break; default: return -1; } /* ** clean up current pipe. */ *pipes[cur].pmode = '\0'; free(pipes[cur].name); free(pipes[cur].command); return rval; } --- NEW FILE: gawkw32.def --- ;; export definitions for Windows32 gawk ;; this is to support extension libraries -- this should generate a gawk.lib ;; against which they can link ;; don't change the ordinals (the numbers after the function names) EXPORTS ;; functions related directly to adding external functions get_argument @1 set_value @2 make_builtin @3 get_curfunc_arg_count @4 ;; functions for manipulating data types mk_number @11 tmp_string @12 unref @13 r_force_string @14 r_force_number @15 nodetype2str @16 ;; incidental other functions assoc_lookup @31 assoc_clear @32 r_dupnode @33 set_loc @34 update_ERRNO @35 r_fatal @36 get_actual @37 ;; data -- note that this must be redeclared with __declspec(dllimport) in the extension ;; library since the exported symbol is actually a pointer to the data CONVFMTidx @101 lintfunc @102 do_lint @103 stack_ptr @104 --- NEW FILE: ChangeLog --- Tue Jul 26 21:46:16 2005 Arnold D. Robbins <ar...@sk...> * Release 3.1.5: Release tar file made. Sun Jun 26 09:31:35 2005 Scott Deifik <sc...@am...> * Makefile: Decrease stack size for MSC. * Makefile.tst (Maketests): Syncronized with what's happening in the main dist. Thu Apr 28 23:08:51 2005 Scott Deifik <sc...@am...> * config.h, Makefile.tst: Synced to main distribution. Wed Feb 16 10:20:18 2005 Scott Deifik <sc...@am...> * Makefile: Decrease stack size for MSC. * Makefile.tst: Syncronized with what's happening in the main dist. * config.h: Improved for DJGPP. Wed Feb 9 14:38:38 2005 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Syncronized with what's happening in the main dist. Thu Feb 3 14:57:28 2005 Scott Deifik <sc...@am...> * config.h (SIZEOF_UNSIGNED_INT, SIZEOF_UNSIGNED_LONG): Add definitions. Mon Aug 2 12:18:15 2004 Arnold D. Robbins <ar...@sk...> * Release 3.1.4: Release tar file made. Sun Jun 13 17:40:09 2004 Scott Deifik <sc...@am...> * Makefile: Reduce the stack size for MSC. * Makefile.tst: Synchronized with main distribution. Sun Jun 13 17:39:47 2004 Arnold D. Robbins <ar...@sk...> * Makefile (AWKOBJS2, PAWKOBJS2): Restore version.o. Tue Jun 1 22:31:36 2004 Arnold D. Robbins <ar...@sk...> * Makefile (AWKOBJS2, PAWKOBJS2): Remove version.o. Per Jim Meyering: * popen.c (scriptify): Check `realloc' return value. Tue Mar 2 18:10:55 2004 Arnold D. Robbins <ar...@sk...> * Makefile (LIBOJBS): Add `dfa$O' into list. (main$O rule): Removed, since patchlev.h not part of dist anymore. Tue Mar 2 18:09:54 2004 Scott Deifik <sc...@am...> * config.h (HAVE_ALLOCA_H): Undefine. * Makefile (LMSC): Adjust stack size for MSC. Mon Jul 7 11:01:43 2003 Arnold D. Robbins <ar...@sk...> * Release 3.1.3: Release tar file made. Thu Jun 26 15:00:20 2003 Scott Deifik <sc...@am...> * Makefile.tst: Synchronized to main dist. Sun Jun 15 19:27:58 2003 Patrick T.J. McPhee <pt...@in...> * config.h: Separate the ifdefs for os_system from ssize_t etc. Sun Jun 15 19:05:15 2003 Scott Deifik <sc...@am...> * Makefile.tst: Synchronized to main dist. Mon Jun 9 17:12:24 2003 Patrick T.J. McPhee <pt...@in...> * dlfcn.c, dlfcn.h, gawke32.def: New files. * Makefile: Changes to allow dynamic linking of libraries under Windows32. Sun May 11 15:19:52 2003 Scott Deifik <sc...@am...> * config.h: Update defs for ssize_t, intmax_t, uintmax_t. * Makefile: Update compile options. * gawkmisc.pc (memcpy_long, memset_long): New functions. * Makefile.tst: Synchronized with test/Makefile. Wed Mar 19 14:10:31 2003 Arnold D. Robbins <ar...@sk...> This time for sure. -- Bullwinkle * Release 3.1.2: Release tar file made. Sun Feb 23 16:25:44 2003 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Sun Feb 16 15:44:20 2003 Scott Deifik <sc...@am...> * config.h: Updated. Sun Feb 9 11:57:11 2003 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Tue Feb 4 14:28:06 2003 Arnold D. Robbins <ar...@sk...> All relevant files: Copyright year updated to 2003. Sun Nov 24 18:37:31 2002 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: Synchronized to main dist. Wed May 1 16:41:32 2002 Arnold D. Robbins <ar...@sk...> * Release 3.1.1: Release tar file made. Thu Apr 18 17:29:16 2002 Scott Deifik <sc...@am...> * Makefile.tst (strftime): Remove comment on call to $(CMP). Sun Mar 10 17:05:35 2002 Scott Deifik <sc...@am...> * Makefile.tst: More clean up and sync with ../test/Makefile. Thu Jan 3 15:20:17 2002 Scott Deifik <sc...@am...> * Makefile.tst: Minor clean up and sync with ../test/Makefile. Wed Dec 19 16:01:58 2001 Peter J. Farley III <pjf...@do...> * gawkmisc.pc: Just use single quote for `quote' for all cases. Wed Dec 19 15:59:52 2001 Eli Zaretskii <el...@is...> * install.awk: Install gawkinet.info as well. * awklib/igawk.awk: Bring in sync with awklib/eg/prog/igawk.sh. * makefile (PRSPFILE, PRSP, PLDRSP, DO_PLNK, DO_PBIND, PLDJG): New variables. (djgpp, djgpp-debug): Set PLNK and PBIND. (PBIND): Define to EMPTY as default. (PAWKOBJS1, PAWKOBJS2, PGAWKOBJS): New variables. (all): Add pgawk.exe. (pgawk.exe, $(PRSPFILE)): New rules. ($(ALLOBJS)): Add eval_p.o and profile_p.o to the list of files that are dependent on awk.h, dfa.h, regex.h, and config.h. (eval_p$O, profile_p$O): New dependencies. (clean): Add pgawk and $(PRSPFILE) to files that are to be cleaned up. Tue Dec 4 16:44:07 2001 Andreas Buening <and...@ne...> Updated OS/2 support. * gawkmisc.pc (quote): Use single quote for __EMX__. (os_arg_fixup): new OS/2 code. (os_devopen): for OS/2 return -1. (ispath): check for leading drive letter for __EMX__. (os_close_on_exec): Add check for defined __EMX__. (os_is_setuid): Add real code for __EMX__. (_os2_is_abs_path): new function. (_os2_unixroot): new function. (_os2_unixroot_path): new function. Tue Sep 25 15:19:53 2001 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_close_on_exec): If fd <= 2, return. Sun Jun 3 13:04:44 2001 Arnold D. Robbins <ar...@sk...> * Release 3.1.0: Release tar file made. And there was rejoicing. Tue Jan 30 10:56:05 2001 Arnold D. Robbins <ar...@sk...> * config.h: Per Kay Uwe Rommel, turn on HAVE_FCNTL_H for all PC platforms so that BINMODE works on all. Sun Jan 28 15:50:02 2001 Eli Zaretskii <el...@is...> * gawkmisc.pc (gawk_name): Support file names with mixed forward- and back-slashes. (orig_tty_mode): New variable. (os_setbinmode): Save the original mode of the console device. [__DJGPP__]: Allow the program to be interrupted with Ctrl-C even though the console was switched to binary mode. (os_restore_mode): New function. Wed Jan 17 10:59:32 2001 Eli Zaretskii <el...@is...> * gawkmisc.pc (os_close_on_exec) [__DJGPP__]: Don't print the warning about failure to set close-on-exec bit, unless it's DJGPP 2.04 or later. Wed Jan 3 19:11:00 2001 Darrel Hankerson <ha...@au...> * popen.c: write script files in binary only if the shell is unix-like. * Makefile: set threshold (-Gt) on MSC 16bit versions to obtain sufficient stack. 3.0.91 builtin.c compiles with optimization, in MSC[67], so remove the special compile Wed Jan 3 19:54:12 2001 Arnold D. Robbins <ar...@sk...> * config.h, gawkmisc.pc: Allow fcntl if DGJPP. From Scott. Sun Dec 3 16:53:37 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_setbinmode): new function. Sun Dec 3 14:56:38 2000 Arnold D. Robbins <ar...@sk...> * Makefile, Makefile.tst, gawkmisc.pc: updated from Scottd. * popen.c: updated from Darrell Hankerson. Wed Nov 22 11:47:00 2000 Arnold D. Robbins <ar...@sk...> * gawk.rsp, pc_popen.c, pc_popen.h, Makefile, Makefile.tst, gawkmisc.pc: Synched with diffs from Scott Deifik. * config.h: Updated from main dist, best guess by me, will probably need tweaking. Tue Nov 7 14:09:14 2000 Arnold D. Robbins <ar...@sk...> * gawkmisc.pc (os_is_setuid): new function. Thu Nov 5 16:50:09 1998 Arnold D. Robbins <ar...@gn...> * gawkmisc.pc (os_devopen): handle "/dev/null". Wed Jul 30 19:53:52 1997 Arnold D. Robbins <ar...@gn...> * Close-on-exec changes: gawkmisc.pc: (os_close_on_exec, os_isdir): new functions. Mon Aug 7 15:23:00 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.6: Release tar file made. Sun Jun 25 15:08:19 2000 Arnold D. Robbins <ar...@sk...> * Release 3.0.5: Release tar file made. Wed Jun 21 16:44:54 2000 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: synchronized with main dist, again. Thu May 18 14:07:52 2000 Scott Deifik <sc...@am...> * Makefile, Makefile.tst: synchronized with main dist. * config.h: Define HAVE_LIMITS_H as 1. Wed Jun 30 16:14:36 1999 Arnold D. Robbins <ar...@gn...> * Release 3.0.4: Release tar file made. This time for sure. Sun Jun 27 12:27:00 1999 Darrel Hankerson <ha...@ma...> * Makefile, Makefile.tst, ../README_d/README.pc: finalized. * include/process.h: new file Fri May 21 00:00:00 1999 Darrel Hankerson <ha...@ma...> * popen.c: MSC (on DOS/Windows32) and MINGW32 now honor SHELL. * io.c: MINGW32 reports errno==0 after failure in redirect(); assume close_one() in this case. * io.c: Add HAVE_POPEN_H and let pc/config.h deal with the mess. (Can't move everything to config.h because of popen define.) Sun May 9 09:12:33 1999 Darrel Hankerson <ha...@ma...> * Add 1999-04-30 changes from Eli Zaretskii <el...@is...> 1. Makefile (TAGS, tags): New targets. 2. Makefile.tst (regtes): Pass the value of $CMP to the regtest script. Thu Nov 18 03:48:32 1998 Scott Deifik <sc...@am...> * Readme.pc: More LFN-based comments. Thu Nov 12 21:01:24 1998 Darrel Hankerson <ha...@ma...> * mingw32 target added with corresponding minor changes to getid.c, io.c, and config.h. * vcWin32 needed popen defines in config.h which were inadvertently omitted from 3.0.3. * README.pc updated to clarify the procedure for building non-LFN versions on LFN systems, and to note that Windows32 gawk may require Windows32 utilities. * emxbnd target modified to accomodate older versions of emx. Thu Nov 08 09:11:44 1998 Scott Deifik <sc...@am...> * pc/Makefile: Stack reduced again for 16bit MSC versions. * pc/Makefile.tst: Updated to keep in sync with new test/Makefile.in. In addition, made to work in Windows 9x with non-LFN tools. Thu May 15 12:49:08 1997 Arnold D. Robbins <ar...@sk...> * Release 3.0.3: Release tar file made. Tue May 13 20:06:09 1997 Darrel Hankerson <ha...@ma...> * vcWin32 target added. Some new tests for WIN32 in gawkmisc.c io.c, and regex.c. Makefile changes for nmake, which can't expand $($x). * config.h updated for BITOPS and NONDECDATA (also in Makefile). Fri Apr 18 07:55:47 1997 Arnold D. Robbins <ar...@sk...> * BETA Release 3.0.34: Release tar file made. Fri Jan 17 19:20:45 1997 Darrel Hankerson <ha...@ma...> * Makefile: add KUR's emxnt target for emx+RSXNT. Create awk.exe "link" to gawk.exe for djgpp target. (Suggested by Eli Zaretskii. Should be done as part of a smarter install, since awk.exe only works with djgpp gawk.exe.) Separate djgpp-v1 into djgppv1 target. Install awk.exe if present. * install.awk: install awk.exe if present (only for djgpp) * config.h: additional include for emx+RSXNT. Wed Dec 25 11:25:22 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.2: Release tar file made. Tue Dec 10 23:09:26 1996 Arnold D. Robbins <ar...@sk...> * Release 3.0.1: Release tar file made. Thu Aug 1 19:46:00 1996 Scott Deifik <sc...@am...> * Makefile: Changes for MSC 8. Wed Jan 10 22:58:55 1996 Arnold D. Robbins <ar...@sk...> * ChangeLog created. --- NEW FILE: gawkmisc.pc --- /* * gawkmisc.c --- miscellaneous gawk routines that are OS specific. */ /* * Copyright (C) 1986, 1988, 1989, 1991 - 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Progamming Language. * * GAWK 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 2 of the License, or * (at your option) any later version. * * GAWK 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ char quote = '\''; char envsep = ';'; # ifdef DEFPATH char *defpath = DEFPATH; # else char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk"; # endif #ifdef __EMX__ #include<io.h> static int _os2_is_abs_path(const char *dirname); static char* _os2_unixroot(const char *path); static const char* _os2_unixroot_path(const char *path); #endif /* gawk_name --- pull out the "gawk" part from how the OS called us */ char * gawk_name(filespec) const char *filespec; { char *p, *q; p = (char *) filespec; /* Sloppy... */ /* OS/2 allows / for directory separator too */ if ((q = strrchr(p, '\\')) != NULL) p = q + 1; if ((q = strrchr(p, '/')) != NULL && (p == NULL || q > p)) /* support mixed d:\foo/bar\gawk.exe */ p = q + 1; if ((q = strchr(p, '.')) != NULL) *q = '\0'; return strlwr(p); } /* * memcpy_long() & memset_ulong() are 32-bit replacements for MSC which * has a 16-bit size_t. */ char * memcpy_ulong (dest, src, l) register char *dest; register const char *src; register unsigned long l; { register char *ret = dest; while (l--) *dest++ = *src++; return ret; } void * memset_ulong(dest, val, l) void *dest; register int val; register unsigned long l; { register char *ret = dest; register char *d = dest; while (l--) *d++ = val; return ((void *) ret); } /* os_arg_fixup --- fixup the command line */ void os_arg_fixup(argcp, argvp) int *argcp; char ***argvp; { #ifdef __EMX__ # ifdef initialize_main initialize_main(argcp, argvp); # else _wildcard(argcp, argvp); _response(argcp, argvp); # endif setvbuf(stdout, NULL, _IOLBF, BUFSIZ); defpath = (char*) _os2_unixroot_path(defpath); #endif /* __EMX__ */ return; } /* os_devopen --- open special per-OS devices */ int os_devopen(name, flag) const char *name; int flag; { #ifdef __EMX__ /* do not use open(name, flag) here !!! */ return -1; #else if (strcmp(name, "/dev/null") == 0) return open("NUL", flag); /* FIXME: */ /* else if (strcmp(name, "/dev/tty") == 0) * return open("???", flag); */ return -1; #endif } /* optimal_bufsize --- determine optimal buffer size */ size_t optimal_bufsize(fd, stb) int fd; struct stat *stb; { /* force all members to zero in case OS doesn't use all of them. */ memset(stb, '\0', sizeof(struct stat)); /* * DOS doesn't have the file system block size in the * stat structure. So we have to make some sort of reasonable * guess. We use stdio's BUFSIZ, since that is what it was * meant for in the first place. */ #define DEFBLKSIZE BUFSIZ if (fstat(fd, stb) == -1) fatal("can't stat fd %d (%s)", fd, strerror(errno)); if (S_ISREG(stb->st_mode) && 0 < stb->st_size && stb->st_size < DEFBLKSIZE) /* small file */ return stb->st_size; return DEFBLKSIZE; } /* ispath --- return true if path has directory components */ int ispath(file) const char *file; { #ifdef __EMX__ return (strpbrk(file, "/\\") != NULL || (toupper(file[0]) >= 'A' && toupper(file[0]) <= 'Z' && file[1] == ':')); #else for (; *file; file++) { switch (*file) { case '/': case '\\': case ':': return 1; } } return 0; #endif } /* isdirpunct --- return true if char is a directory separator */ int isdirpunct(c) int c; { return (strchr(":\\/", c) != NULL); } /* os_close_on_exec --- set close on exec flag, print warning if fails */ void os_close_on_exec(fd, name, what, dir) int fd; const char *name, *what, *dir; { #if ! defined(_MSC_VER) && ! defined(__MINGW32__) # if (defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 4)) || defined __EMX__ if (fd <= 2) /* sanity */ return; if (fcntl(fd, F_SETFD, 1) < 0) warning("%s %s `%s': could not set close-on-exec: %s", what, dir, name, strerror(errno)); # endif #endif } /* os_isdir --- is this an fd on a directory? */ #if ! defined(S_ISDIR) && defined(S_IFDIR) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif int os_isdir(fd) int fd; { struct stat sbuf; return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)); } /* os_is_setuid --- true if running setuid root */ int os_is_setuid() { #ifdef __EMX__ long uid, euid; uid = getuid(); euid = geteuid(); return (euid == 0 && euid != uid); #else return 0; #endif } /* os_setbinmode --- set binary mode on file */ #ifdef __DJGPP__ #include <sys/exceptn.h> #endif static int orig_tty_mode = -1; int os_setbinmode(fd, mode) int fd, mode; { int prev_mode = setmode(fd, mode); #ifdef __DJGPP__ if ((mode & O_BINARY) != 0) __djgpp_set_ctrl_c(1); /* allow to interrupt with Ctrl-C */ #endif /* Save the original tty mode as we found it. */ if (orig_tty_mode == -1 && fd >= 0 && fd <= 2) orig_tty_mode = prev_mode; return prev_mode; } /* os_restore_mode --- restore the original mode of the console device */ void os_restore_mode (fd) int fd; { if (orig_tty_mode != -1) { setmode(fd, orig_tty_mode); } } #ifdef __EMX__ # ifndef PATH_SEPARATOR # define PATH_SEPARATOR ';' # endif /* result is 0 if dirname is no absolute path, 1 otherwise */ static int _os2_is_abs_path(const char *dirname) { int result = 0; if (dirname != NULL && dirname[0] != '\0') { /* if dirname contains a valid drive letter like "c:" */ if (((dirname[0] >= 'A' && dirname[0] <= 'Z') || (dirname[0] >= 'a' && dirname[0] <= 'z')) && dirname[1] == ':') dirname += 2; /* remove the drive letter */ if (dirname[0] == '/' || dirname[0] == '\\') result = 1; /* asbolute path */ } return result; } /* path is assumed to be a list of directories separated by PATH_SEPARATOR. This function determines if the first directory of path is on the drive specified by the environment variable UNIXROOT. If it is the case, NULL is returned, otherwise a new directory name is allocated using the drive letter from UNIXROOT and returned as result. If the first directory is a relative path NULL is returned, too. The new directory name is allocated by malloc(). Example (UNIXROOT is set to "e:"): "c:/usr/share" -> "e:/usr/share" "e:/usr/share" -> NULL (already on the $UNIXROOT drive) "/usr/share" -> "e:/usr/share" "." -> NULL (not an absolute path) "usr/share" -> NULL (not an absolute path) "c:usr/share" -> NULL (not an absolute path) "c:/usr/share;d:/etc" -> "e:/usr/share" (only the first directory in path is used) */ static char* _os2_unixroot(const char *path) { static const char *unixroot = NULL; static int unixroot_init = 0; char *result = NULL; if (unixroot_init == 0) { /* get $UNIXROOT only one time */ unixroot = getenv("UNIXROOT"); /* check whether unixroot is valid (must be "x:") */ if (unixroot != NULL) { int drive = toupper(unixroot[0]); if (drive < 'A' || drive > 'Z' || unixroot[1] != ':' || unixroot[2] != '\0') unixroot = NULL; /* unixroot not valid */ } unixroot_init = 1; /* initialized */ } /* note: if unixroot != NULL then it contains a valid drive letter */ if (unixroot != NULL && _os2_is_abs_path(path)) { /* dirname is an absolute path and unixroot is a drive letter, "c:" for example */ size_t old_path_len = strlen(path); /* end points to the first ';' in path or to NULL */ const char *end = strchr(path, PATH_SEPARATOR); /* dir_len is the length of the first directory in path */ size_t dir_len = (end) ? end - path : old_path_len; if (toupper(unixroot[0]) != toupper(path[0]) || path[1] != ':') { /* the first directory of path does not start with the string $UNIXROOT */ if (path[1] == ':') { /* if there is a drive letter remove it */ dir_len -= 2; path += 2; } result = malloc(dir_len + 3); if (result) { /* do nothing if we are out of memory */ result[0] = unixroot[0]; result[1] = unixroot[1]; memcpy(result + 2, path, dir_len); result[dir_len + 2] = '\0'; } } } return result; } /* path is assumed to be a list of directories separated by PATH_SEPARATOR. Every directory is processed. _os2_unixroot() is used to find out whether these directories are on the drive specified by the environment variable UNIXROOT. If this is not the case the same directory on the UNIXROOT drive is added to the end of path. If path is a valid path this function returns a valid path, too. Example ($UNIXROOT is set to "e:"): ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc" -> ".;c:/usr/local;d:/usr/local;d:/etc;e:/etc;e:/usr/local;e:/usr/local;e:/etc" */ static const char* _os2_unixroot_path(const char *path) { char *result = NULL; const char *p = path; unsigned dir_count = 1; if (path == NULL || path[0] == '\0') return NULL; /* empty path */ /* save number of path components in dir_count */ while(*p) { if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) dir_count += 1; } { const char *list[dir_count]; /* list of char pointers */ size_t dir_len[dir_count]; /* the according directory length */ size_t old_path_len = strlen(path); /* the old path length */ size_t total_len; unsigned i = 0; if (path[old_path_len - 1] == PATH_SEPARATOR) /* last character is ';' */ old_path_len--; list[0] = p = path; /* first directory */ while(*p) { if (*p++ == PATH_SEPARATOR && *p != '\0' && *p != PATH_SEPARATOR) list[++i] = p; } /* now list[i] contains the ith directory of path (no 0-terminated strings!!!) */ /* determine the total length for the new path */ total_len = old_path_len; for(i = 0; i < dir_count; i++) { list[i] = _os2_unixroot(list[i]); if (list[i] != NULL) { dir_len[i] = strlen(list[i]); total_len += dir_len[i] + 1; /* one character for ';' or '\0' */ } else dir_len[i] = 0; } /* now list[] contains the according directories on the UNIXROOT drive or NULL total_len contains the total length for the new path */ result = malloc(total_len + 1); if (result) { /* copy the old path and the new directories into the new path */ char *q = result; memcpy(q, path, old_path_len); q += old_path_len; for(i = 0; i < dir_count; i++) { if (dir_len[i] != 0) { *q++ = PATH_SEPARATOR; memcpy(q, list[i], dir_len[i]); q += dir_len[i]; } } *q = '\0'; /* terminating '\0' */ } for(i = 0; i < dir_count; i++) free((void*) list[i]); } return (result) ? (const char*) result : path; } #endif /* __EMX__ */ --- NEW FILE: getid.c --- #if defined(_MSC_VER) || defined(__MINGW32__) #ifdef OS2 # define INCL_DOSPROCESS # include <os2.h> # if _MSC_VER == 510 # define DosGetPID DosGetPid # endif #else # include <process.h> #endif #ifdef OS2 int getpid(void) { PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pid); } #endif unsigned int getuid (void) { return (0); /* root! */ } unsigned int geteuid (void) { return (0); } unsigned int getgid (void) { return (0); } unsigned int getegid (void) { return (0); } #endif int getpgrp(void) { return (0); } #if defined(_MSC_VER) || defined(__GO32__) || defined(__MINGW32__) int getppid(void) { #ifdef OS2 PIDINFO PidInfo; DosGetPID(&PidInfo); return(PidInfo.pidParent); #else return(0); #endif } #endif --- NEW FILE: Makefile --- # Makefile for gawk (GNU awk) Dec 2000 # # - for GNU C (djgpp) [32bit executable for DOS] # - for GNU C (emx) [32bit executable for OS/2 or DOS or Windows32] # - for GNU C (mingw32) [Windows32 executable for Windows 9x/NT] # - for MS-Visual C/C++ 4.x [Windows32 executable for Windows 9x/NT] # - for Microsoft C 7 [16bit ececutable for DOS] # - for Microsoft C 6.00A [16bit executable for OS/2 or DOS] # Tested with GNU make and dmake-3.8 under OS/2 and DOS, and ndmake and # Microsoft nmake under DOS. Compiling with dmake under DOS may require the # DOS-only version of dmake (so that swapping works). nmake requires a # few edits in the configuration section below. default: @echo "Enter $(MAK) target " @echo " where 'target' is chosen from " @echo " djgpp ... DOS 32-bit exe [GNU C, Delorie, v2] " @echo " djgppv1 . DOS 32-bit exe [GNU C, Delorie, v1] " @echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] " @echo " emxnt ... NT exe [emx/gcc with RSXNT] " @echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] " @echo " mingw32 . Windows32 exe [Mingw32 GNU C] " @echo " msc ..... DOS exe [Microsoft C 7 & 8 (AKA 1.52)] " @echo " msc6 .... DOS exe [Microsoft C 6.00a] " @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] " @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] " @echo " vcWin32 . Windows32 exe [Microsoft Visual C] " @echo " ----------------------------------------------------- " @echo " test .... Perform tests (see README_d/README.pc) " @echo " install . Install gawk under $(prefix)/ " # Support dropped in 3.0 # - for Microsoft C 5.1 [16bit executable for OS/2 or DOS] # @echo " msc51 DOS exe [Microsoft C 5.1] " # @echo " msc51bnd OS/2 and DOS exe [Microsoft C 5.1] " #======================= Configuration ================================== RSPFILE = gawk.rsp PRSPFILE = pgawk.rsp # # Choose method for passing arguments to the linker. # # If compiling under OS/2 or if make can pass long lines #LDRSP = $(GAWKOBJS) #LNKRSP = $(LDRSP) # # else if make == dmake # Response files for linker: dmake allows the macro expansion # $(macro_name:modifier_list:modifier_list:...) # The macro mktmp creates a temporary file for the linker. # The 't' modifier is for tokenization. #LDRSP = @$(mktmp $(<:t"\n")) #LNKRSP = @$(mktmp $(<:t"+\n") ) # Space before final paren req # # else use brain-dead approach (emxbnd will need 'tr'). RSP = $(RSPFILE) PRSP = $(PRSPFILE) LDRSP = @$(RSP) PLDRSP = @$(PRSP) LNKRSP = $(LDRSP) #------------------------------------------------------------------------ # Some makes do not define MAKE (and ndmake does not allow a define). # Define MAK to be your make command. #MAKE = dmake MAK = $(MAKE) $(MAKEFILE) #MAK = $(MAKE) #MAKEFILE = -f Makefile #MAK = make45 $(MAKEFILE) #------------------------------------------------------------------------ # Define the base directory for the install. "make install" will install # in bin, lib/awk, man, and info under $(prefix)/. Most likely, you should # edit config.h so that $(prefix)/lib/awk appears as part of DEFPATH. #prefix = prefix = c:/gnu # # Define the install method. Method 1 is Unix-like (and requires cat, # cp, mkdir, sed, and sh); method 2 uses gawk and batch files. install = 1 #------------------------------------------------------------------------ # To work around command-line length problems, this makefile assumes # that $($X) can be expanded. If using a make (such as nmake) which # cannot handle such macros, define DO_LNK and DO_BIND for your target # as $(L<target>) and $(B<target>), resp.; e.g., #DO_LNK = $(LvcWin32) #DO_PLNK = $(PLvcWin32) # and then comment the following: DO_LNK = $($(LNK)) DO_BIND= $($(BIND)) DO_PLNK = $($(PLNK)) DO_PBIND= $($(PBIND)) #------------------------------------------------------------------------ # For dynamic extension support, uncomment these lines # pick the appropriate .def file entry for your compiler #DYN_FLAGS=-DDYNAMIC #DYN_EXP=gawk.exp #DYN_OBJ=dlfcn$O $(DYN_EXP) #DYN_MAKEXP=$(DMEvcWin32) #DYN_MAKEXP=$(DMEmingw32) # #======================================================================== # End of general configuration. Some platform-specific configuration # notes appear below. #======================================================================== #========================== DJGPP ======================================= #======================================================================== LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2) PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2) BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk djgpp: $(MAK) all \ CC=gcc O=.o CF=-O2 \ LNK=LDJG PLNK=PLDJG LF=-s LF2=-lm \ BIND=BDJG PBIND='' djgpp-debug: $(MAK) all \ CC=gcc O=.o CF='-O2 -g' \ LNK=LDJG PLNK=PLDJG LF2=-lm \ BIND=BDJG PBIND='' LDJGv1 = $(CC) $(LF) -o gawk $(LDRSP) $(LF2) #BDJGv1 = coff2exe -s /djgpp/bin/go32.exe gawk BDJGv1 = coff2exe gawk djgppv1: $(MAK) all \ CC=gcc O=.o CF=-O \ LNK=LDJGv1 LF=-s LF2=-lm \ BIND=BDJGv1 #======================================================================== #========================== EMX ========================================= #======================================================================== # Link command for OS/2 versions. LEMX = $(CC) $(LF) -o $@ $(GAWKOBJS) gawk.def -lbsd $(LF2) # Link and bind for DOS and OS/2 versions. # emx-09 needs '-p' emx option here or in EMXOPT environ var. # The following works with 0.9a or newer LEMXBND = $(CC) $(LF) -o gawk $(LDRSP) gawk.def -lbsd $(LF2) BEMX = emxbind -bs gawk -p # The following works with 0.9c or newer #LEMXBND = $(CC) $(LF) -o a.out $(LDRSP) gawk.def -lbsd $(LF2) #BEMX = emxbind -bs -o $@ a.out -p #BEMX = emxbind -bs /emx/bin/emx.exe a.out $@ -p BEMXD = emxbind -b -o $@ a.out -p emx: $(MAK) all \ "CC=gcc -Zomf" O=.obj "CF=-O -DOS2" \ LNK=LEMX "LF=-s -Zcrtdll -Zstack 512" RSP= emxnt: $(MAK) all \ "CC=gcc -Zwin32 -Zcrtdll=rsxntcs" O=.o "CF=-O -DOS2" \ LNK=LEMX "LF=-s -Zstack 512" RSP= emxbnd: $(MAK) all \ CC=gcc O=.o "CF=-O -DOS2 -DMSDOS" OBJ=popen.o \ LNK=LEMXBND \ BIND=BEMX "P=|tr \" \" \"\n\"" emxbnd-debug: $(MAK) all \ CC=gcc O=.o "CF=-g -DOS2 -DMSDOS" OBJ=popen.o \ LNK=LEMXBND \ BIND=BEMXD "P=|tr \" \" \"\n\"" #======================================================================== #========================== MINGW32 ===================================== #======================================================================== DMEmingw32 = dlltool -D gawk.exe -d gawkw32.def -e gawk.exp -l libgawk.a LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2) PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2) # The following might work around command-line length limitations: #LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2) mingw32: $(MAK) all \ CC=gcc O=.o CF=-O OBJ=popen.o \ LNK=LMINGW32 PLNK=PLMINGW32 LF=-s RSP= #======================================================================== #========================== MSC ========================================= #======================================================================== # stdargv, glob, and director are from Stewartson's sh. These provide # globbing and enhanced argument-passing. MSC setargv.obj is a # more limited alternative (and it will permit a bound version). #STDARGV = stdargv.obj glob.obj director.obj STDARGV = setargv.obj # Optimization and library options: # Os == optimize for size, Ot == optimize for speed, G2 == 286 or better #MSCOPT = -Gt3600 -Os -G2 # MSC seems to be more stable with -Od than with -Ot, but then regexec.c gives # "code segment too large" error when compiling. Adding -G2y fixes this and # lets us keep the -Od. MSCOPT = -Gt3600 -Od -G2y # Alternate lib, does not use math coprocessor. #MSCLIB = llibca #MSCCL = -FPa # Emulator lib, uses math coprocessor if present. MSCLIB = llibce MSCCL = -FPi #MSCCL = -FPc # If the stack gets much smaller than 3000, the "longwrds" test fails. LMSC = link $(LF) $(LNKRSP) $(STDARGV)/NOE,$@,,/NOD:llibce $(MSCLIB)$(LF2)/STACK:0x2eb0,nul # CLMSC-linking works when building under OS/2 CLMSC = $(CC) -o $@ $(LF) $(GAWKOBJS) $(STDARGV) $(LF2) -link /NOE/NOI/STACK:0x6f00 BMSC = bind $@ /n DOSMAKEPIPE DOSCWAIT # Ugly hack: config.h defines __STDC__ if not defined on command-line. # OS/2 versions can't use -Za in getid.c. MSC7 uses stub headers in pc/ # due to ANSI conflicts. MSC 5.1 defines __STDC__=0 regardless of ANSI flag. # dmake-3.8 runs out of memory under DOS. Request that dmake # swap itself out on these targets. Note that this won't have # any affect on the bound OS/2 and DOS version of dmake-3.8. .SWAP: msc msc-debug msc6 msc6os2 msc6bnd msc51 check msc: $(MAK) all \ "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC P=+ Lmsc = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc = msc-debug: $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -Ze -Ipc/include -W2 -Zi -Od" \ OBJ=popen.obj \ LNK=LMSC LF2=/CO P=+ msc6: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT) -Od" $(MAK) all \ "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -Za $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC P=+ Lmsc6 = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc6 = msc6os2: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT) -Od" $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 -UMSDOS $(MSCOPT)" \ LNK=LMSC "LF2=p,gawk.def" P=+ msc6bnd: # $(MAK) builtin.obj \ # "CC=cl -nologo $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT) -Od" $(MAK) all \ "CC=cl $(MSCCL)" O=.obj "CF=-AL -DOS2 $(MSCOPT)" \ OBJ=popen.obj \ LNK=LMSC "LF2=p,gawk.def" P=+ \ BIND=BMSC Lmsc6bnd = $(LMSC) # for broken makes (nmake) which cannot expand $($X) Bmsc6bnd = $(BMSC) # Windows '9x / NT DMEvcWin32 = lib /def:gawkw32.def /name:gawk.exe /out:gawk.lib LvcWin32 = link -nologo -subsystem:console -release -out:$@ $(LNKRSP) PLvcWin32 = link -nologo -subsystem:console -release -out:$@ $(PLDRSP) vcWin32: $(MAK) all \ "CC=cl -nologo" O=.obj "CF=-o2 -DWIN32 -D__STDC__=0" \ OBJ=popen.obj \ LNK=LvcWin32 # Support dropped in 3.0 #msc51: # $(MAK) all \ # "CC=cl $(MSCCL)" O=.obj "CF=-AL -Za -D_MSC_VER=510 $(MSCOPT)" \ # OBJ=popen.obj \ # LNK=LMSC P=+ # #msc51bnd: # $(MAK) all \ # "CC=cl -AL ($MSCCL)" O=.obj "CF=-DOS2 -D_MSC_VER=510 $(MSCOPT)" \ # OBJ=popen.obj \ # LNK=CLMSC "LF=-Lp -Fb" "LF2=gawk.def" #======================================================================== # Define BIND for BINDless compiles, otherwise $($(BIND)) may break. BIND = EMPTY PBIND = EMPTY EMPTY= # bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are # undocumented in 3.0.3. They may be enabled in config.h, or added to CFLAGS. CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS) # object files AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O $(DYN_OBJ) PAWKOBJS1 = array$O builtin$O eval_p$O field$O gawkmisc$O io$O main$O PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O $(DYN_OBJ) AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) # LIBOBJS # GNU and other stuff that gawk uses as library routines. LIBOBJS= getopt$O getopt1$O dfa$O regex$O random$O GAWKOBJS = $(ALLOBJS) $(LIBOBJS) PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ) # clear out suffixes list # .SUFFIXES: .SUFFIXES: .c $O .c$O: $(CC) -c $(CFLAGS) $< # rules to build gawk all : gawk.exe pgawk.exe gawk.exe:: $(GAWKOBJS) $(RSP) $(DO_LNK) $(DO_BIND) pgawk.exe:: $(PGAWKOBJS) $(PRSP) $(DO_PLNK) $(DO_PBIND) $(RSPFILE) : $(GAWKOBJS) echo $(AWKOBJS1)$P > $@ echo $(AWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ $(PRSPFILE) : $(PGAWKOBJS) echo $(PAWKOBJS1)$P > $@ echo $(PAWKOBJS2)$P >> $@ echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@ $(ALLOBJS) eval_p$O profile_p$O: awk.h regex.h config.h gawkmisc$O: pc/gawkmisc.pc getopt$O: getopt.h getopt1$O: getopt.h gawk.exp: gawkw32.def $(DYN_MAKEXP) eval_p$O: eval.c profile_p$O: profile.c # A bug in ndmake requires the following rule awkgram$O: awk.h awkgram.c $(CC) -c $(CFLAGS) awkgram.c awkgram.c: awkgram.y bison -o $@ awkgram.y alloca$O: alloca.c install: install$(install) install1: echo extproc sh $(prefix)/bin/igawk.cmd > igawk.cmd echo shift >> igawk.cmd cat pc/awklib/igawk >> igawk.cmd sed "s;igawk;$(prefix)/bin/igawk;" pc/awklib/igawk.bat > igawk.bat sh mkinstal.sh $(prefix)/bin sh mkinstal.sh $(prefix)/lib/awk $(prefix)/man/man1 $(prefix)/info cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin cp awklib/eg/lib/* pc/awklib/igawk.awk $(prefix)/lib/awk cp doc/*.1 $(prefix)/man/man1 cp doc/gawk.info $(prefix)/info # install2 is equivalent to install1, but doesn't require cp, sed, etc. install2: gawk -v prefix=$(prefix) -f install.awk clean: rm -rf gawk pgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DYN_EXP) # cd doc && $(MAKE) clean # cd test && $(MAKE) clean # cd awklib && $(MAKE) clean awklib/eg: doc/gawk.texi rm -fr awklib/eg sh -c "cd awklib && ../gawk -f extract.awk ../doc/gawk.texi" check: @echo "Running the tests requires several unix-like utilities. The" @echo "recommendation is to copy pc/Makefile.tst to test/Makefile. Under" @echo "DOS, it may be necessary to run make from the test directory." # The `-k' option to make should be unnecessary if using pc/Makefile.tst. sh -c "cd test && $(MAK) -k AWK=../gawk.exe" # sh -c "cd test && $(MAK) AWK=../gawk.exe bigtest extra" test: check # for those who have the necessary tools: TAGS: etags awk.h *.y custom.h *.c *.h tags: ctags awk.h *.y custom.h *.c *.h --- NEW FILE: popen.h --- /* ** popen.h -- prototypes for pipe functions */ #if defined (OS2) && !defined(MSDOS) /* OS/2, but not family mode */ # if defined (_MSC_VER) # define popen(c, m) _popen(c, m) # define pclose(f) _pclose(f) # endif #else # if !defined (__GO32__) # if defined (popen) # undef popen # undef pclose # endif # define popen(c, m) os_popen(c, m) # define pclose(f) os_pclose(f) extern FILE *os_popen( char *, const char * ); extern int os_pclose( FILE * ); # endif #endif --- NEW FILE: dlfcn.c --- /* ** dlfcn.c -- limited implementation of posix dynamic loading functions */ /* * Copyright (C) 2003 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. * * GAWK 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 2 of the License, or * (at your option) any later version. * * GAWK 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include <dlfcn.h> #include <errno.h> #include <windows.h> /* open the library file. We currently ignore flags. */ void *dlopen(const char * libname, int flags) { HMODULE libH; /* if libname is specified, we need to load a library of that name */ if (libname) { libH = LoadLibrary(libname); } /* otherwise, we're supposed to return a handle to global symbol * information, which includes the executable and all libraries loaded * with RTLD_GLOBAL. For our purposes, it doesn't really matter, so * we simply return the handle to the .exe */ else { libH = GetModuleHandle(NULL); } return (void *)libH; } /* don't need the library any more */ int dlclose(void * libH) { int rc; if (FreeLibrary((HMODULE)libH)) { rc = 0; } else { rc = -1; } return rc; } /* find the symbol */ void *dlsym(void * /*restrict*/ libH, const char * /*restrict*/ fnName) { return (void *)GetProcAddress((HMODULE)libH, fnName); } char *dlerror(void) { static char errbuf[1024]; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errbuf, sizeof(errbuf), NULL); return errbuf; } --- NEW FILE: mkinstal.sh --- #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman <fri...@pr...> # Created: 1993-05-16 # Last modified: 1994-03-25 # Public domain errstatus=0 for file in ${1+"$@"} ; do #set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` set fnord `echo "$file" | sed 's/\([^:]\)\//\1 /g'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errsta... [truncated message content] |