sed -e 's,@ecldir\\@,"$(ecldir)",g' \
-e 's,@libdir\\@,"$(libdir)",g' \
-e 's,@includedir\\@,"$(includedir)",g' < $(ECL_CMPDIR)/cmpdefs.pre > $@
+$(ECL_CMPDIR)/crosscmp.lsp: $(ECL_CMPDIR)/crosscmp.pre
+ sed -e 's,@ecldir\\@,$(ecldir),g' \
+ -e 's,@libdir\\@,$(libdir),g' \
+ -e 's,@includedir\\@,$(includedir),g' < $(ECL_CMPDIR)/crosscmp.pre > $@
compile.lsp: compile.pre
sed -e 's,@ecldir\\@,$(ecldir),g' \
-e 's,@libdir\\@,$(libdir),g' < compile.pre > compile.lsp
-e 's,~A,$(libdir),' bin/ecl-config.pre > bin/ecl-config
-@LIBPREFIX@eclmin.@LIBEXT@: @LIBPREFIX@eclgmp.@LIBEXT@ @LIBPREFIX@eclatomic.@LIBEXT@ @LIBPREFIX@eclgc.@LIBEXT@ @LIBPREFIX@eclffi.@LIBEXT@ lsp/config.lsp $(ECL_CMPDIR)/cmpdefs.lsp ecl/external.h $(top_srcdir)/c/*.d
+@LIBPREFIX@eclmin.@LIBEXT@: @LIBPREFIX@eclgmp.@LIBEXT@ @LIBPREFIX@eclatomic.@LIBEXT@ @LIBPREFIX@eclgc.@LIBEXT@ @LIBPREFIX@eclffi.@LIBEXT@ lsp/config.lsp $(ECL_CMPDIR)/cmpdefs.lsp $(ECL_CMPDIR)/crosscmp.lsp ecl/external.h $(top_srcdir)/c/*.d
cd c; $(MAKE)
@LIBPREFIX@eclgc.@LIBEXT@:
test -d ecl/gc || mkdir ecl/gc
$(mkinstalldirs) $(DESTDIR)$(mandir)/man$(manext)
$(INSTALL_DATA) doc/ecl.man $(DESTDIR)$(mandir)/man$(manext)/ecl.$(manext)
$(INSTALL_DATA) doc/ecl-config.man $(DESTDIR)$(mandir)/man$(manext)/ecl-config.$(manext)
+ $(INSTALL_DATA) cmp/crosscmp.lsp $(DESTDIR)$(ecldir)
flatinstall: build-stamp
$(MAKE) DESTDIR=$(DESTDIR) bindir=$(prefix) libdir=$(prefix) \
dnl compiling
dnl
AC_DEFUN(ECL_CROSS_CONFIG,[
-if test "x${cross_compiling}" = "xyes"; then
+if test "x${cross_compiling}" = "xyes" || test "x${force_cross_compiling}" = "xyes"; then
if test -n "${with_cross_config}" -a -f "${with_cross_config}"; then
. ${with_cross_config}
elif test -f ./cross_config; then
SONAME=''
SONAME_LDFLAGS=''
case "${host_os}" in
+ linux-androideabi)
+ thehost='android'
+ THREAD_CFLAGS='-D_THREAD_SAFE'
+# THREAD_LIBS='-lpthread'
+ SHARED_LDFLAGS="-shared ${LDFLAGS}"
+ BUNDLE_LDFLAGS="-shared ${LDFLAGS}"
+ ECL_GC_DIR=gc-unstable
+ ECL_LDRPATH='-Wl,--rpath,~A'
+ clibs="-ldl"
+ # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ???
+ CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DANDROID -DPLATFORM_ANDROID -DUSE_GET_STACKBASE_FOR_MAIN -DIGNORE_DYNAMIC_LOADING -DAO_REQUIRE_CAS ${CFLAGS}"
+ SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION"
+ SONAME_LDFLAGS="-Wl,-soname,SONAME"
+ ECL_ADD_FEATURE([android])
+ ;;
+
# libdir may have a dollar expression inside
linux*)
thehost='linux'
THREAD_LIBS='-lpthread'
SHARED_LDFLAGS="-shared ${LDFLAGS}"
BUNDLE_LDFLAGS="-shared ${LDFLAGS}"
+ ECL_GC_DIR=gc-unstable
ECL_LDRPATH='-Wl,--rpath,~A'
clibs="-ldl"
# Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ???
shared="no"
;;
esac
+
+case "${host}" in
+ i686*-android*)
+ THREAD_LIBS=''
+ CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DANDROID -DPLATFORM_ANDROID -DUSE_GET_STACKBASE_FOR_MAIN -DIGNORE_DYNAMIC_LOADING -DNO_GETCONTEXT -DHAVE_GETTIMEOFDAY -DHAVE_SIGPROCMASK ${CFLAGS}"
+ ECL_ADD_FEATURE([android])
+esac
+
case "${host_cpu}" in
alpha*)
CFLAGS="${CFLAGS} -mieee";;
dnl Check "char **environ" is available
AC_DEFUN([ECL_POSIX_ENVIRON],[
AC_MSG_CHECKING(working environ)
-if test -z "$ECL_WORKING_ENVIRON"; then
+if test -z "$ECL_WORKING_ENVIRON" && test "x${cross_compiling}" != "xyes"; then
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdlib.h>
extern char **environ;
exit(0);
exit(1);
}]])],[ECL_WORKING_ENVIRON=yes],[ECL_WORKING_ENVIRON=no],[])
+elif test "x${cross_compiling}" != "xyes"; then
+ECL_WORKING_ENVIRON=yes
fi
AC_MSG_RESULT([$ECL_WORKING_ENVIRON])
if test $ECL_WORKING_ENVIRON = yes ; then
EXE = @EXEEXT@
DPP = ./dpp$(EXE)
RANLIB = @RANLIB@
+AR = @AR@
# Data for installation
#
../libeclmin.a: $(OBJS) all_symbols.o all_symbols2.o
$(RM) $@
- ar cr $@ $(OBJS)
+ $(AR) cr $@ $(OBJS)
$(RANLIB) $@
clean:
#if defined(ECL_MS_WINDOWS_HOST)
#include <winsock.h>
#else
+#ifdef __ANDROID__
+#include <errno.h>
+#else
extern int errno;
+#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
--- /dev/null
+;;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: C -*-
+;;;;
+;;;; Copyright (c) 2011, Sylvain Ageneau
+;;;;
+;;;; This program is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Library General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 2 of the License, or (at your option) any later version.
+;;;;
+;;;; See file '../Copyright' for full details.
+
+;;;; CROSSCMP -- Cross compiler
+
+(in-package cross-cmp)
+
+(setf (gethash "@host@" *cross-compilers*)
+ (make-instance 'cross-compiler
+ :features @LSP_FEATURES@
+ :sys-pathname-translation '(("**;*.*.*" "@ecldir\@/**/*.*"))
+ :cmpinclude "<ecl/ecl-cmp.h>"
+ :cc "@ECL_CC@"
+ :ld "@ECL_CC@"
+ :ranlib "@RANLIB@"
+ :ar "@AR@"
+ :cc-flags "@CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@"
+ :cc-optimize #-msvc "-O2"
+ #+msvc "@CFLAGS_OPTIMIZE@"
+
+ :ld-format #-msvc "~A -o ~S -L~S ~{~S ~} ~@[~S~]~{ '~A'~} ~A"
+ #+msvc "~A -Fe~S~* ~{~S ~} ~@[~S~]~{ '~A'~} ~A"
+
+ :cc-format #-msvc "~A -I. \"-I~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -o \"~A\"~{ '~A'~}"
+ #+msvc "~A -I. -I\"~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -Fo\"~A\"~{ '~A'~}"
+
+ :ld-flags (if (member :dlopen *features*)
+ "@LDFLAGS@ -L@libdir\@ -lecl @CORE_LIBS@ @FASL_LIBS@ @LIBS@"
+ (if (member :mscv *features*)
+ "@LDFLAGS@ -L@libdir\@ -lecl @FASL_LIBS@ @LIBS@"
+ #+msvc "@LDFLAGS@ ecl.lib @CLIBS@" user-ld-flags))
+
+ :ld-shared-flags #-msvc "@SHARED_LDFLAGS@ @LDFLAGS@ -L@libdir\@ -lecl @FASL_LIBS@ @LIBS@"
+ #+msvc "@SHARED_LDFLAGS@ @LDFLAGS@ ecl.lib @CLIBS@"
+
+ :ld-bundle-flags #-msvc "@BUNDLE_LDFLAGS@ @LDFLAGS@ -L@libdir\@ -lecl @FASL_LIBS@ @LIBS@"
+ #+msvc "@BUNDLE_LDFLAGS@ @LDFLAGS@ ecl.lib @CLIBS@"
+
+ :shared-library-prefix "@SHAREDPREFIX@"
+ :shared-library-extension "@SHAREDEXT@"
+ :shared-library-format "@SHAREDPREFIX@~a.@SHAREDEXT@"
+ :static-library-prefix "@LIBPREFIX@"
+ :static-library-extension "@LIBEXT@"
+ :static-library-format "@LIBPREFIX@~a.@LIBEXT@"
+ :object-file-extension "@OBJEXT@"
+ :executable-file-format "~a@EXEEXT@"
+
+ :ecl-include-directory "@includedir\@"
+ :ecl-library-directory "@libdir\@"
+
+ :ld-rpath (let ((x "@ECL_LDRPATH@"))
+ (and (plusp (length x))
+ (format nil x ecl-library-directory)))
+ :user-cc-flags nil
+ :user-ld-flags nil))
(concatenate 'string
"sh -c 'rm -rf tmp; mkdir tmp;"
"cp @LIBPREFIX@eclmin.@LIBEXT@ @LIBPREFIX@ecl.@LIBEXT@;"
-"cd tmp; ar -x ../@LIBPREFIX@lsp.@LIBEXT@;"
+"cd tmp; @AR@ -x ../@LIBPREFIX@lsp.@LIBEXT@;"
"for i in *.@OBJEXT@; do mv $i lsp_`basename $i`; done;"
-"ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@ ../c/all_symbols2.@OBJEXT@; rm *.@OBJEXT@;"
+"@AR@ -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@ ../c/all_symbols2.@OBJEXT@; rm *.@OBJEXT@;"
"@RANLIB@ ../@LIBPREFIX@ecl.@LIBEXT@'"))
#+:wants-dlopen
fi
-if test "x${cross_compiling}" = "xyes"; then
+if test "x${cross_compiling}" = "xyes" || test "x${force_cross_compiling}" = "xyes"; then
if test -n "${with_cross_config}" -a -f "${with_cross_config}"; then
. ${with_cross_config}
elif test -f ./cross_config; then
SONAME=''
SONAME_LDFLAGS=''
case "${host_os}" in
+ linux-androideabi)
+ thehost='android'
+ THREAD_CFLAGS='-D_THREAD_SAFE'
+# THREAD_LIBS='-lpthread'
+ SHARED_LDFLAGS="-shared ${LDFLAGS}"
+ BUNDLE_LDFLAGS="-shared ${LDFLAGS}"
+ ECL_GC_DIR=gc-unstable
+ ECL_LDRPATH='-Wl,--rpath,~A'
+ clibs="-ldl"
+ # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ???
+ CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DANDROID -DPLATFORM_ANDROID -DUSE_GET_STACKBASE_FOR_MAIN -DIGNORE_DYNAMIC_LOADING -DAO_REQUIRE_CAS ${CFLAGS}"
+ SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION"
+ SONAME_LDFLAGS="-Wl,-soname,SONAME"
+
+LSP_FEATURES="(cons :android ${LSP_FEATURES})"
+
+ ;;
+
# libdir may have a dollar expression inside
linux*)
thehost='linux'
THREAD_LIBS='-lpthread'
SHARED_LDFLAGS="-shared ${LDFLAGS}"
BUNDLE_LDFLAGS="-shared ${LDFLAGS}"
+ ECL_GC_DIR=gc-unstable
ECL_LDRPATH='-Wl,--rpath,~A'
clibs="-ldl"
# Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ???
shared="no"
;;
esac
+
+case "${host}" in
+ i686*-android*)
+ THREAD_LIBS=''
+ CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DANDROID -DPLATFORM_ANDROID -DUSE_GET_STACKBASE_FOR_MAIN -DIGNORE_DYNAMIC_LOADING -DNO_GETCONTEXT -DHAVE_GETTIMEOFDAY -DHAVE_SIGPROCMASK ${CFLAGS}"
+
+LSP_FEATURES="(cons :android ${LSP_FEATURES})"
+
+esac
+
case "${host_cpu}" in
alpha*)
CFLAGS="${CFLAGS} -mieee";;
for ac_header in sys/resource.h sys/utsname.h float.h pwd.h dlfcn.h link.h \
- mach-o/dyld.h ulimit.h dirent.h sys/ioctl.h sys/select.h \
+ mach-o/dyld.h dirent.h sys/ioctl.h sys/select.h \
sys/wait.h semaphore.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+for ac_header in ulimit.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "ulimit.h" "ac_cv_header_ulimit_h" "#ifdef HAVE_ULIMIT_H
+# include <ulimit.h>
+#endif
+
+"
+if test "x$ac_cv_header_ulimit_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ULIMIT_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if ${ac_cv_c_const+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking working environ" >&5
$as_echo_n "checking working environ... " >&6; }
-if test -z "$ECL_WORKING_ENVIRON"; then
+if test -z "$ECL_WORKING_ENVIRON" && test "x${cross_compiling}" != "xyes"; then
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
+elif test "x${cross_compiling}" != "xyes"; then
+ECL_WORKING_ENVIRON=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECL_WORKING_ENVIRON" >&5
$as_echo "$ECL_WORKING_ENVIRON" >&6; }
CLX_INFO=""
fi
+if test "${with_tcp}" = "builtin"; then
+
+
+LSP_FEATURES="(cons :builtin-sockets ${LSP_FEATURES})"
+
+
+ with_tcp=yes
+fi
if test "${with_tcp}" = "yes"; then
$as_echo "#define TCP 1" >>confdefs.h
fi
-ac_config_files="$ac_config_files bare.lsp lsp/load.lsp clos/load.lsp cmp/load.lsp new-cmp/load.lsp ../Makefile Makefile c/Makefile doc/Makefile doc/ecl.man doc/ecl-config.man ecl/configpre.h:h/config.h.in bin/ecl-config.pre:util/ecl-config lsp/config.pre:lsp/config.lsp.in compile.pre:compile.lsp.in cmp/cmpdefs.pre:cmp/cmpdefs.lsp tests/config.lsp tests/Makefile"
+ac_config_files="$ac_config_files bare.lsp lsp/load.lsp clos/load.lsp cmp/load.lsp new-cmp/load.lsp ../Makefile Makefile c/Makefile doc/Makefile doc/ecl.man doc/ecl-config.man ecl/configpre.h:h/config.h.in bin/ecl-config.pre:util/ecl-config lsp/config.pre:lsp/config.lsp.in compile.pre:compile.lsp.in cmp/cmpdefs.pre:cmp/cmpdefs.lsp cmp/crosscmp.pre:cmp/crosscmp.lsp.in tests/config.lsp tests/Makefile"
ac_config_headers="$ac_config_headers ecl/config.h:ecl/configpre.h"
"lsp/config.pre") CONFIG_FILES="$CONFIG_FILES lsp/config.pre:lsp/config.lsp.in" ;;
"compile.pre") CONFIG_FILES="$CONFIG_FILES compile.pre:compile.lsp.in" ;;
"cmp/cmpdefs.pre") CONFIG_FILES="$CONFIG_FILES cmp/cmpdefs.pre:cmp/cmpdefs.lsp" ;;
+ "cmp/crosscmp.pre") CONFIG_FILES="$CONFIG_FILES cmp/crosscmp.pre:cmp/crosscmp.lsp.in" ;;
"tests/config.lsp") CONFIG_FILES="$CONFIG_FILES tests/config.lsp" ;;
"tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
"ecl/config.h") CONFIG_HEADERS="$CONFIG_HEADERS ecl/config.h:ecl/configpre.h" ;;
dnl !!! end autoscan
AC_CHECK_HEADERS( [sys/resource.h sys/utsname.h float.h pwd.h dlfcn.h link.h] \
- [mach-o/dyld.h ulimit.h dirent.h sys/ioctl.h sys/select.h] \
+ [mach-o/dyld.h dirent.h sys/ioctl.h sys/select.h] \
[sys/wait.h semaphore.h] )
+
+AC_CHECK_HEADERS([ulimit.h], [], [],
+[[#ifdef HAVE_ULIMIT_H
+# include <ulimit.h>
+#endif
+]])
+
dnl =====================================================================
dnl Checks for typedefs, structures, and compiler characteristics.
CLX_INFO=""
fi
+if test "${with_tcp}" = "builtin"; then
+ ECL_ADD_BUILTIN_MODULE([sockets])
+ with_tcp=yes
+fi
if test "${with_tcp}" = "yes"; then
AC_DEFINE(TCP, [1], [Network streams])
EXTRA_OBJS="${EXTRA_OBJS} tcp.${OBJEXT}"
ecl/configpre.h:h/config.h.in bin/ecl-config.pre:util/ecl-config
lsp/config.pre:lsp/config.lsp.in compile.pre:compile.lsp.in
cmp/cmpdefs.pre:cmp/cmpdefs.lsp
+ cmp/crosscmp.pre:cmp/crosscmp.lsp.in
tests/config.lsp tests/Makefile
])
AC_CONFIG_HEADERS([ecl/config.h:ecl/configpre.h])