Chris Herborth's first pass at making config and install

for BeOS better.
This commit is contained in:
Guido van Rossum 1999-01-12 20:30:23 +00:00
parent 0039d7b4e6
commit 7a5f420e67
6 changed files with 387 additions and 278 deletions

View File

@ -8,6 +8,9 @@ What's Here?
ar-fake - A shell script used by the build process to emulate a "real"
POSIX ar command; helps to build the Python shared library.
dl_export.h - A header defining the evil magic declaration decorations
required for dynamic loading.
linkcc - A shell script used by the build process to build the Python
shared library.
@ -35,21 +38,7 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
2) Configure with:
AR=$(pwd)/BeOS/ar-fake RANLIB=: ./configure --verbose \
--prefix=/boot/home/config --with-thread
When configure is done, add this anywhere in config.h:
#ifndef DL_EXPORT
# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
#endif
#ifndef DL_IMPORT
# ifdef USE_DL_EXPORT
# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
# else
# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
# endif
#endif
./configure --verbose --prefix=/boot/home/config --with-thread
3) Copy Modules/Setup.in to Modules/Setup.
@ -69,21 +58,18 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
audioop imageop rgbimg md5 timing rotor syslog curses new gdbm soundex
binascii parser cStringIO cPickle zlib
5) Make sure Modules/Makefile.pre has REALLIBRARY set to:
Note that some of these (readline, curses, gdbm, and zlib) require extra
libraries that aren't supplied with Python. If you don't have the extra
libs (you can probably get them from GeekGadgets), don't try to use
these modules; they won't compile.
REALLIBRARY=../libpython$(VERSION).so
5) Make:
6) Make:
make
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos
6) Test:
On PowerPC systems, you'll see lots of warnings about duplicate
symbols when things get linked; don't worry about this, it's
harmless (and should disappear soon).
7) Test:
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos test
make test
Expect the following errors:
@ -97,16 +83,11 @@ Python 1.5.2 and later will compile "out of the box" on BeOS), try this:
NOTE: On R4/x86, the pause() function is broken; expect the signal
module test to crash Python!
8) Install:
7) Install:
make OPT=-DUSE_DL_EXPORT CCSHARED=-UUSE_DL_EXPORT MACHDEP=beos nstall
make install
This will fail trying to copy libpython1.5.a; at that point in the
install, everything you "normally" need is installed (all the Python
bits), and the stuff you need for compiling C-based modules is half-
installed. This will be fixed before the 1.5.2 release.
8) Enjoy!
9) Enjoy!
- Chris Herborth (chrish@qnx.com)
December 22, 1998
- Chris Herborth (chrish@beoscentral.com)
January 12, 1999

50
BeOS/dl_export.h Normal file
View File

@ -0,0 +1,50 @@
#ifndef BEOS_DL_EXPORT_H
#define BEOS_DL_EXPORT_H
/* There are no declarations here, so no #ifdef __cplusplus...
*
* This is the nasty declaration decorations required by certain systems
* (in our case, BeOS) for dynamic object loading.
*
* This trivial header is released under the same license as the rest of
* Python:
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the names of Stichting Mathematisch
* Centrum or CWI or Corporation for National Research Initiatives or
* CNRI not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission.
*
* While CWI is the initial source for this software, a modified version
* is made available by the Corporation for National Research Initiatives
* (CNRI) at the Internet address ftp://ftp.python.org.
*
* STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
* CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* - Chris Herborth (chrish@beoscentral.com)
* January 11, 1999
*/
#ifndef DL_EXPORT
# define DL_EXPORT(RTYPE) __declspec(dllexport) RTYPE
#endif
#ifndef DL_IMPORT
# ifdef USE_DL_EXPORT
# define DL_IMPORT(RTYPE) __declspec(dllexport) RTYPE
# else
# define DL_IMPORT(RTYPE) __declspec(dllimport) RTYPE
# endif
#endif
#endif

View File

@ -382,8 +382,10 @@ libainstall: all
else true; \
fi; \
done
$(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY)
$(RANLIB) $(LIBPL)/$(LIBRARY)
@if [ "$(MACHDEP)" != "beos" ] ; then \
$(INSTALL_DATA) $(LIBRARY) $(LIBPL)/$(LIBRARY) ; \
$(RANLIB) $(LIBPL)/$(LIBRARY) ; \
fi
$(INSTALL_DATA) Modules/config.c $(LIBPL)/config.c
$(INSTALL_DATA) Modules/python.o $(LIBPL)/python.o
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in

View File

@ -453,3 +453,9 @@
/* Define if you have the m library (-lm). */
#undef HAVE_LIBM
/* Define if you have special dynamic linkage requirements in declarations. */
#undef DL_EXPORT_HEADER
#ifdef DL_EXPORT_HEADER
#include DL_EXPORT_HEADER
#endif

512
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -107,8 +107,40 @@ AC_ARG_WITH(gcc, [--without-gcc never use gcc], [
case $ac_sys_system in
OSF1) CC=cc
without_gcc=;;
BeOS*) CC=cc
without_gcc=;;
BeOS*)
# Dunno if it's a good idea to get this over with all at once, or
# to handle it in with the other goodies.
MACHDEP=beos
case $BE_HOST_CPU in
ppc)
CC="mwcc -I$PWD/BeOS"
without_gcc=yes
OPT="-DUSE_DL_EXPORT -O7 -opt schedule604"
CCSHARED=-UUSE_DL_EXPORT
LDFLAGS="$LDFLAGS -nodup"
AR="$PWD/BeOS/ar-fake"
RANLIB=:
AC_DEFINE(DL_EXPORT_HEADER,"dl_export.h")
;;
x86)
CC="gcc -I$PWD/BeOS"
without_gcc=no
OPT="-DUSE_DL_EXPORT -O3 -mpentiumpro"
CCSHARED=-UUSE_DL_EXPORT
AR="$PWD/BeOS/ar-fake"
RANLIB=:
AC_DEFINE(DL_EXPORT_HEADER,"dl_export.h")
;;
*)
AC_ERROR(Your BeOS system isn't PowerPC or x86... neat, but this won't work...)
;;
esac
;;
*) without_gcc=no;;
esac])
AC_MSG_RESULT($without_gcc)