*-*-cygwin*)
ac_sys_system=Cygwin
;;
+ *-*-vxworks*)
+ ac_sys_system=VxWorks
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
*-*-cygwin*)
_host_cpu=
;;
+ *-*-vxworks*)
+ _host_cpu=$host_cpu
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
QNX/6.3.2)
define_xopen_source=no
;;
+ # On VxWorks, defining _XOPEN_SOURCE causes compile failures
+ # in network headers still using system V types.
+ VxWorks/*)
+ define_xopen_source=no
+ ;;
esac
i386-gnu
#elif defined(__APPLE__)
darwin
+#elif defined(__VXWORKS__)
+ vxworks
#else
# error unknown platform triplet
#endif
BLDSHARED="$LDSHARED"
fi
;;
- Linux*|GNU*|QNX*)
+ Linux*|GNU*|QNX*|VxWorks*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
+ VxWorks*)
+ CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5
# to 2048 kilobytes so that the stack doesn't overflow
# when running test_compile.py.
LINKFORSHARED='-Wl,-E -N 2048K';;
+ VxWorks*)
+ LINKFORSHARED='--export-dynamic';;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5
case $ac_sys_system in
- Linux*|GNU*|Darwin)
+ Linux*|GNU*|Darwin|VxWorks)
EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
*)
EXT_SUFFIX=${SHLIB_SUFFIX};;
*-*-cygwin*)
ac_sys_system=Cygwin
;;
+ *-*-vxworks*)
+ ac_sys_system=VxWorks
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
*-*-cygwin*)
_host_cpu=
;;
+ *-*-vxworks*)
+ _host_cpu=$host_cpu
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
QNX/6.3.2)
define_xopen_source=no
;;
+ # On VxWorks, defining _XOPEN_SOURCE causes compile failures
+ # in network headers still using system V types.
+ VxWorks/*)
+ define_xopen_source=no
+ ;;
esac
i386-gnu
#elif defined(__APPLE__)
darwin
+#elif defined(__VXWORKS__)
+ vxworks
#else
# error unknown platform triplet
#endif
BLDSHARED="$LDSHARED"
fi
;;
- Linux*|GNU*|QNX*)
+ Linux*|GNU*|QNX*|VxWorks*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
then CCSHARED="-fPIC"
else CCSHARED="-Kpic -belf"
fi;;
+ VxWorks*)
+ CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic"
esac
fi
AC_MSG_RESULT($CCSHARED)
# to 2048 kilobytes so that the stack doesn't overflow
# when running test_compile.py.
LINKFORSHARED='-Wl,-E -N 2048K';;
+ VxWorks*)
+ LINKFORSHARED='--export-dynamic';;
esac
fi
AC_MSG_RESULT($LINKFORSHARED)
AC_SUBST(EXT_SUFFIX)
case $ac_sys_system in
- Linux*|GNU*|Darwin)
+ Linux*|GNU*|Darwin|VxWorks)
EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX};;
*)
EXT_SUFFIX=${SHLIB_SUFFIX};;
return sys.platform
host_platform = get_platform()
+VXWORKS = ('vxworks' in host_platform)
+
# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
finally:
os.unlink(tmpfile)
- def add_gcc_paths(self):
- gcc = sysconfig.get_config_var('CC')
- tmpfile = os.path.join(self.build_temp, 'gccpaths')
+ def add_cross_compiling_paths(self):
+ cc = sysconfig.get_config_var('CC')
+ tmpfile = os.path.join(self.build_temp, 'ccpaths')
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
- ret = os.system('%s -E -v - </dev/null 2>%s 1>/dev/null' % (gcc, tmpfile))
+ ret = os.system('%s -E -v - </dev/null 2>%s 1>/dev/null' % (cc, tmpfile))
is_gcc = False
+ is_clang = False
in_incdirs = False
inc_dirs = []
lib_dirs = []
for line in fp.readlines():
if line.startswith("gcc version"):
is_gcc = True
+ elif line.startswith("clang version"):
+ is_clang = True
elif line.startswith("#include <...>"):
in_incdirs = True
elif line.startswith("End of search list"):
in_incdirs = False
- elif is_gcc and line.startswith("LIBRARY_PATH"):
+ elif (is_gcc or is_clang) and line.startswith("LIBRARY_PATH"):
for d in line.strip().split("=")[1].split(":"):
d = os.path.normpath(d)
if '/gcc/' not in d:
add_dir_to_list(self.compiler.library_dirs,
d)
- elif is_gcc and in_incdirs and '/gcc/' not in line:
+ elif (is_gcc or is_clang) and in_incdirs and '/gcc/' not in line and '/clang/' not in line:
add_dir_to_list(self.compiler.include_dirs,
line.strip())
finally:
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
# only change this for cross builds for 3.3, issues on Mageia
if cross_compiling:
- self.add_gcc_paths()
+ self.add_cross_compiling_paths()
self.add_multiarch_paths()
# Add paths specified in the environment variables LDFLAGS and
# pwd(3)
exts.append( Extension('pwd', ['pwdmodule.c']) )
# grp(3)
- exts.append( Extension('grp', ['grpmodule.c']) )
+ if not VXWORKS:
+ exts.append( Extension('grp', ['grpmodule.c']) )
# spwd, shadow passwords
if (config_h_vars.get('HAVE_GETSPNAM', False) or
config_h_vars.get('HAVE_GETSPENT', False)):
libs = ['crypt']
else:
libs = []
- exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) )
+
+ if not VXWORKS:
+ exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) )
+ elif self.compiler.find_library_file(lib_dirs, 'OPENSSL'):
+ libs = ['OPENSSL']
+ exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) )
# CSV files
exts.append( Extension('_csv', ['_csv.c']) )
exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) )
# socket(2)
- exts.append( Extension('_socket', ['socketmodule.c'],
- depends = ['socketmodule.h']) )
+ if not VXWORKS:
+ exts.append( Extension('_socket', ['socketmodule.c'],
+ depends = ['socketmodule.h']) )
+ elif self.compiler.find_library_file(lib_dirs, 'net'):
+ libs = ['net']
+ exts.append( Extension('_socket', ['socketmodule.c'],
+ depends = ['socketmodule.h'], libraries=libs) )
+
# Detect SSL support for the socket module (via _ssl)
ssl_ext, hashlib_ext = self._detect_openssl(inc_dirs, lib_dirs)
if ssl_ext is not None:
# Unix-only modules
if host_platform != 'win32':
- # Steen Lumholt's termios module
- exts.append( Extension('termios', ['termios.c']) )
- # Jeremy Hylton's rlimit interface
+ if not VXWORKS:
+ # Steen Lumholt's termios module
+ exts.append( Extension('termios', ['termios.c']) )
+ # Jeremy Hylton's rlimit interface
exts.append( Extension('resource', ['resource.c']) )
else:
missing.extend(['resource', 'termios'])