GeezerVison is showing github.com — Patches by William Lewis for Nextstep descendants. · python/cpython@54ecc3d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Makefile.in +8-4Lines changed: 8 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -161,6 +161,7 @@ DIST= $(DISTFILES) $(DISTDIRS) | 161 | 161 | CFLAGS= $(OPT) -I. $(DEFS) | 162 | 162 |
| 163 | 163 | LIBRARY= libpython$(VERSION).a | | 164 | +LDLIBRARY= @LDLIBRARY@ | 164 | 165 |
| 165 | 166 | # Default target | 166 | 167 | all: $(LIBRARY) python sharedmods | @@ -173,10 +174,10 @@ python: $(LIBRARY) buildno Modules/python.o | 173 | 174 | $(srcdir)/Modules/getbuildinfo.c | 174 | 175 | $(AR) cr $(LIBRARY) getbuildinfo.o | 175 | 176 | $(RANLIB) $(LIBRARY) | 176 | | - @DGUX_IS_BROKEN@ | | 177 | + @MAKE_LDLIBRARY@ | 177 | 178 | cd Modules; $(MAKE) OPT="$(OPT)" VERSION="$(VERSION)" \ | 178 | 179 | prefix="$(prefix)" exec_prefix="$(exec_prefix)" \ | 179 | | - LIBRARY=../$(LIBRARY) link | | 180 | + LIBRARY=../$(LDLIBRARY) link | 180 | 181 |
| 181 | 182 | Modules/python.o: $(srcdir)/Modules/python.c | 182 | 183 | cd Modules; $(MAKE) OPT="$(OPT)" python.o | @@ -204,6 +205,10 @@ libpython$(VERSION).so: $(LIBRARY) | 204 | 205 | (cd dgux;ar x ../$^;ld -G -o ../$@ * ) | 205 | 206 | /bin/rm -rf ./dgux | 206 | 207 |
| | 208 | +# This rule is here for OPENSTEP/Rhapsody/MacOSX | | 209 | +libpython$(VERSION).dylib: $(LIBRARY) | | 210 | + libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) -framework System @LIBTOOL_CRUFT@ | | 211 | + | 207 | 212 | $(SUBDIRS): Makefiles | 208 | 213 |
| 209 | 214 | Parser: | @@ -258,7 +263,6 @@ altbininstall: python | 258 | 263 | fi; \ | 259 | 264 | done | 260 | 265 | $(INSTALL_PROGRAM) python$(EXE) $(BINDIR)/python$(VERSION)$(EXE) | 261 | | - @DGUX_IS_BROKEN@ | 262 | 266 | if test -f libpython$(VERSION).so; then \ | 263 | 267 | $(INSTALL_DATA) libpython$(VERSION).so $(LIBDIR); \ | 264 | 268 | else true; \ | @@ -504,7 +508,7 @@ clean: localclean | 504 | 508 | done | 505 | 509 |
| 506 | 510 | localclobber: localclean | 507 | | - -rm -f tags TAGS python $(LIBRARY) *.o | | 511 | + -rm -f tags TAGS python $(LIBRARY) $(LDLIBRARY) *.o | 508 | 512 | -rm -f config.log config.cache config.h | 509 | 513 |
| 510 | 514 | clobber: localclobber | |
Collapse file Copy file name to clipboardExpand all lines: Modules/Makefile.pre.in +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -100,7 +100,7 @@ MAINOBJ= python.o | 100 | 100 | SYSLIBS= $(LIBM) $(LIBC) | 101 | 101 |
| 102 | 102 | LIBRARY= ../libpython$(VERSION).a | 103 | | -REALLIBRARY= ../@REALLIBRARY@ | | 103 | +LDLIBRARY= ../@LDLIBRARY@ | 104 | 104 |
| 105 | 105 | # === Rules === | 106 | 106 |
| | 123 | 123 | # This target is used by the master Makefile to link the final binary. | 124 | 124 | link: $(MAINOBJ) | 125 | 125 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ | 126 | | - $(LIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) | | 126 | + $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python $(LDLAST) | 127 | 127 | mv python$(EXE) ../python$(EXE) | 128 | 128 |
| 129 | 129 | clean: | |
Collapse file Copy file name to clipboardExpand all lines: Modules/getbuildinfo.c +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 30 | 30 | const char * | 31 | 31 | Py_GetBuildInfo() | 32 | 32 | { | 33 | | - static char buildinfo[40]; | 34 | | - sprintf(buildinfo, "#%d, %.12s, %.8s", BUILD, DATE, TIME); | | 33 | + static char buildinfo[50]; | | 34 | + sprintf(buildinfo, "#%d, %.20s, %.9s", BUILD, DATE, TIME); | 35 | 35 | return buildinfo; | 36 | 36 | } |
Collapse file Copy file name to clipboardExpand all lines: Modules/getpath.c +25-1Lines changed: 25 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -42,6 +42,10 @@ PERFORMANCE OF THIS SOFTWARE. | 42 | 42 | #include <unistd.h> | 43 | 43 | #endif /* HAVE_UNISTD_H */ | 44 | 44 |
| | 45 | +#ifdef WITH_NEXT_FRAMEWORK | | 46 | +#include <mach-o/dyld.h> | | 47 | +#endif | | 48 | + | 45 | 49 | /* Search in some common locations for the associated Python libraries. | 46 | 50 | * | 47 | 51 | * Two directories must be found, the platform independent directory | @@ -394,7 +398,24 @@ calculate_path() | 394 | 398 | int bufsz; | 395 | 399 | int prefixsz; | 396 | 400 | char *defpath = pythonpath; | 397 | | - | | 401 | +#ifdef WITH_NEXT_FRAMEWORK | | 402 | + NSModule pythonModule; | | 403 | +#endif | | 404 | + | | 405 | +#ifdef WITH_NEXT_FRAMEWORK | | 406 | + pythonModule = NSModuleForSymbol(NSLookupAndBindSymbol("_Py_Initialize")); | | 407 | + /* Use dylib functions to find out where the framework was loaded from */ | | 408 | + buf = NSLibraryNameForModule(pythonModule); | | 409 | + if (buf != NULL) { | | 410 | + /* We're in a framework. */ | | 411 | + strcpy(progpath, buf); | | 412 | + | | 413 | + /* Frameworks have support for versioning */ | | 414 | + strcpy(lib_python, "lib"); | | 415 | + } else { | | 416 | + /* If we're not in a framework, fall back to the old way (even though NSNameOfModule() probably does the same thing.) */ | | 417 | +#endif | | 418 | + | 398 | 419 | /* Initialize this dynamically for K&R C */ | 399 | 420 | sprintf(lib_python, "lib/python%s", VERSION); | 400 | 421 |
| @@ -430,6 +451,9 @@ calculate_path() | 430 | 451 | } | 431 | 452 | else | 432 | 453 | progpath[0] = '\0'; | | 454 | +#ifdef WITH_NEXT_FRAMEWORK | | 455 | + } | | 456 | +#endif | 433 | 457 |
| 434 | 458 | strcpy(argv0_path, progpath); | 435 | 459 |
| |
Collapse file Copy file name to clipboardExpand all lines: Modules/posixmodule.c +94-25Lines changed: 94 additions & 25 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -146,6 +146,7 @@ corresponding Unix manual entries for more information on calls."; | 146 | 146 | #undef HAVE_UTIME_H | 147 | 147 | #define HAVE_WAITPID | 148 | 148 | /* #undef HAVE_GETCWD */ | | 149 | +#define UNION_WAIT /* This should really be checked for by autoconf */ | 149 | 150 | #endif | 150 | 151 |
| 151 | 152 | #ifdef HAVE_UNISTD_H | @@ -255,6 +256,23 @@ extern int lstat Py_PROTO((const char *, struct stat *)); | 255 | 256 | #include <io.h> | 256 | 257 | #endif /* OS2 */ | 257 | 258 |
| | 259 | +#ifdef UNION_WAIT | | 260 | +/* Emulate some macros on systems that have a union instead of macros */ | | 261 | + | | 262 | +#ifndef WIFEXITED | | 263 | +#define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump) | | 264 | +#endif | | 265 | + | | 266 | +#ifndef WEXITSTATUS | | 267 | +#define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1) | | 268 | +#endif | | 269 | + | | 270 | +#ifndef WTERMSIG | | 271 | +#define WTERMSIG(u_wait) ((u_wait).w_termsig) | | 272 | +#endif | | 273 | + | | 274 | +#endif /* UNION_WAIT */ | | 275 | + | 258 | 276 | /* Return a dictionary corresponding to the POSIX environment table */ | 259 | 277 |
| 260 | 278 | #if !defined(_MSC_VER) && ( !defined(__WATCOMC__) || defined(__QNX__) ) | @@ -1986,20 +2004,25 @@ posix_waitpid(self, args) | 1986 | 2004 | PyObject *self; | 1987 | 2005 | PyObject *args; | 1988 | 2006 | { | 1989 | | - int pid, options, sts = 0; | | 2007 | + int pid, options; | | 2008 | +#ifdef UNION_WAIT | | 2009 | + union wait status; | | 2010 | +#define status_i (status.w_status) | | 2011 | +#else | | 2012 | + int status; | | 2013 | +#define status_i status | | 2014 | +#endif | | 2015 | + status_i = 0; | | 2016 | + | 1990 | 2017 | if (!PyArg_Parse(args, "(ii)", &pid, &options)) | 1991 | 2018 | return NULL; | 1992 | 2019 | Py_BEGIN_ALLOW_THREADS | 1993 | | -#ifdef NeXT | 1994 | | - pid = wait4(pid, (union wait *)&sts, options, NULL); | 1995 | | -#else | 1996 | | - pid = waitpid(pid, &sts, options); | 1997 | | -#endif | | 2020 | + pid = wait4(pid, &status, options, NULL); | 1998 | 2021 | Py_END_ALLOW_THREADS | 1999 | 2022 | if (pid == -1) | 2000 | 2023 | return posix_error(); | 2001 | 2024 | else | 2002 | | - return Py_BuildValue("ii", pid, sts); | | 2025 | + return Py_BuildValue("ii", pid, status_i); | 2003 | 2026 | } | 2004 | 2027 | #endif /* HAVE_WAITPID */ | 2005 | 2028 |
| @@ -2015,17 +2038,21 @@ posix_wait(self, args) | 2015 | 2038 | PyObject *args; | 2016 | 2039 | { | 2017 | 2040 | int pid, sts; | 2018 | | - Py_BEGIN_ALLOW_THREADS | 2019 | | -#ifdef NeXT | 2020 | | - pid = wait((union wait *)&sts); | | 2041 | +#ifdef UNION_WAIT | | 2042 | + union wait status; | | 2043 | +#define status_i (status.w_status) | 2021 | 2044 | #else | 2022 | | - pid = wait(&sts); | | 2045 | + int status; | | 2046 | +#define status_i status | 2023 | 2047 | #endif | | 2048 | + status_i = 0; | | 2049 | + Py_BEGIN_ALLOW_THREADS | | 2050 | + pid = wait(&status); | 2024 | 2051 | Py_END_ALLOW_THREADS | 2025 | 2052 | if (pid == -1) | 2026 | 2053 | return posix_error(); | 2027 | 2054 | else | 2028 | | - return Py_BuildValue("ii", pid, sts); | | 2055 | + return Py_BuildValue("ii", pid, status_i); | 2029 | 2056 | } | 2030 | 2057 | #endif | 2031 | 2058 |
| @@ -2821,9 +2848,16 @@ posix_WIFSTOPPED(self, args) | 2821 | 2848 | PyObject *self; | 2822 | 2849 | PyObject *args; | 2823 | 2850 | { | 2824 | | - int status = 0; | | 2851 | +#ifdef UNION_WAIT | | 2852 | + union wait status; | | 2853 | +#define status_i (status.w_status) | | 2854 | +#else | | 2855 | + int status; | | 2856 | +#define status_i status | | 2857 | +#endif | | 2858 | + status_i = 0; | 2825 | 2859 |
| 2826 | | - if (!PyArg_Parse(args, "i", &status)) | | 2860 | + if (!PyArg_Parse(args, "i", &status_i)) | 2827 | 2861 | { | 2828 | 2862 | return NULL; | 2829 | 2863 | } | @@ -2842,9 +2876,16 @@ posix_WIFSIGNALED(self, args) | 2842 | 2876 | PyObject *self; | 2843 | 2877 | PyObject *args; | 2844 | 2878 | { | 2845 | | - int status = 0; | | 2879 | +#ifdef UNION_WAIT | | 2880 | + union wait status; | | 2881 | +#define status_i (status.w_status) | | 2882 | +#else | | 2883 | + int status; | | 2884 | +#define status_i status | | 2885 | +#endif | | 2886 | + status_i = 0; | 2846 | 2887 |
| 2847 | | - if (!PyArg_Parse(args, "i", &status)) | | 2888 | + if (!PyArg_Parse(args, "i", &status_i)) | 2848 | 2889 | { | 2849 | 2890 | return NULL; | 2850 | 2891 | } | @@ -2863,9 +2904,16 @@ posix_WIFEXITED(self, args) | 2863 | 2904 | PyObject *self; | 2864 | 2905 | PyObject *args; | 2865 | 2906 | { | 2866 | | - int status = 0; | | 2907 | +#ifdef UNION_WAIT | | 2908 | + union wait status; | | 2909 | +#define status_i (status.w_status) | | 2910 | +#else | | 2911 | + int status; | | 2912 | +#define status_i status | | 2913 | +#endif | | 2914 | + status_i = 0; | 2867 | 2915 |
| 2868 | | - if (!PyArg_Parse(args, "i", &status)) | | 2916 | + if (!PyArg_Parse(args, "i", &status_i)) | 2869 | 2917 | { | 2870 | 2918 | return NULL; | 2871 | 2919 | } | @@ -2874,7 +2922,7 @@ posix_WIFEXITED(self, args) | 2874 | 2922 | } | 2875 | 2923 | #endif /* WIFEXITED */ | 2876 | 2924 |
| 2877 | | -#ifdef WIFSTOPPED | | 2925 | +#ifdef WEXITSTATUS | 2878 | 2926 | static char posix_WEXITSTATUS__doc__[] = | 2879 | 2927 | "WEXITSTATUS(status) -> integer\n\ | 2880 | 2928 | See Unix documentation."; | @@ -2884,9 +2932,16 @@ posix_WEXITSTATUS(self, args) | 2884 | 2932 | PyObject *self; | 2885 | 2933 | PyObject *args; | 2886 | 2934 | { | 2887 | | - int status = 0; | | 2935 | +#ifdef UNION_WAIT | | 2936 | + union wait status; | | 2937 | +#define status_i (status.w_status) | | 2938 | +#else | | 2939 | + int status; | | 2940 | +#define status_i status | | 2941 | +#endif | | 2942 | + status_i = 0; | 2888 | 2943 |
| 2889 | | - if (!PyArg_Parse(args, "i", &status)) | | 2944 | + if (!PyArg_Parse(args, "i", &status_i)) | 2890 | 2945 | { | 2891 | 2946 | return NULL; | 2892 | 2947 | } | @@ -2905,9 +2960,16 @@ posix_WTERMSIG(self, args) | 2905 | 2960 | PyObject *self; | 2906 | 2961 | PyObject *args; | 2907 | 2962 | { | 2908 | | - int status = 0; | | 2963 | +#ifdef UNION_WAIT | | 2964 | + union wait status; | | 2965 | +#define status_i (status.w_status) | | 2966 | +#else | | 2967 | + int status; | | 2968 | +#define status_i status | | 2969 | +#endif | | 2970 | + status_i = 0; | 2909 | 2971 |
| 2910 | | - if (!PyArg_Parse(args, "i", &status)) | | 2972 | + if (!PyArg_Parse(args, "i", &status_i)) | 2911 | 2973 | { | 2912 | 2974 | return NULL; | 2913 | 2975 | } | @@ -2926,9 +2988,16 @@ posix_WSTOPSIG(self, args) | 2926 | 2988 | PyObject *self; | 2927 | 2989 | PyObject *args; | 2928 | 2990 | { | 2929 | | - int status = 0; | | 2991 | +#ifdef UNION_WAIT | | 2992 | + union wait status; | | 2993 | +#define status_i (status.w_status) | | 2994 | +#else | | 2995 | + int status; | | 2996 | +#define status_i status | | 2997 | +#endif | | 2998 | + status_i = 0; | 2930 | 2999 |
| 2931 | | - if (!PyArg_Parse(args, "i", &status)) | | 3000 | + if (!PyArg_Parse(args, "i", &status_i)) | 2932 | 3001 | { | 2933 | 3002 | return NULL; | 2934 | 3003 | } | |
Collapse file Copy file name to clipboardExpand all lines: Modules/readline.c +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,7 @@ extern int rl_bind_key(); | 34 | 34 | extern int rl_bind_key_in_map(); | 35 | 35 | extern int rl_initialize(); | 36 | 36 | extern int add_history(); | | 37 | +extern Function *rl_event_hook; | 37 | 38 | #endif | 38 | 39 |
| 39 | 40 | /* Pointers needed from outside (but not declared in a header file). */ | |
Collapse file Copy file name to clipboardExpand all lines: Python/getversion.c +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -38,8 +38,8 @@ PERFORMANCE OF THIS SOFTWARE. | 38 | 38 | const char * | 39 | 39 | Py_GetVersion() | 40 | 40 | { | 41 | | - static char version[80]; | 42 | | - sprintf(version, "%.10s (%.30s) %.30s", PY_VERSION, | | 41 | + static char version[100]; | | 42 | + sprintf(version, "%.10s (%.40s) %.40s", PY_VERSION, | 43 | 43 | Py_GetBuildInfo(), Py_GetCompiler()); | 44 | 44 | return version; | 45 | 45 | } |
|