diff options
author | Rickard Green <[email protected]> | 2010-02-03 12:56:25 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-02-03 19:04:55 +0100 |
commit | 1b78e85c9b6097f0d1940793e5fed4e08c0794f9 (patch) | |
tree | 10ede523234396673be3a77a8d5dbdee20dee696 /lib/erl_interface | |
parent | 639e0b2ac0fb85335511efcf79327d1f4dfacbc3 (diff) | |
download | otp-1b78e85c9b6097f0d1940793e5fed4e08c0794f9.tar.gz otp-1b78e85c9b6097f0d1940793e5fed4e08c0794f9.tar.bz2 otp-1b78e85c9b6097f0d1940793e5fed4e08c0794f9.zip |
OTP-8323 Cross compilation improvements and other build system
improvements.
Most notable:
Lots of cross compilation improvements. The old cross compilation
support was more or less non-existing as well as broken. Please,
note that the cross compilation support should still be
considered as experimental. Also note that old cross compilation
configurations cannot be used without modifications. For more
information on cross compiling Erlang/OTP see the
$ERL_TOP/xcomp/README file.
Support for staged install using <url
href="http://www.gnu.org/prep/standards/html_node/DESTDIR.html">D
ESTDIR</url>. The old broken INSTALL_PREFIX has also been fixed.
For more information see the $ERL_TOP/README file.
Documentation of the release target of the top Makefile. For more
information see the $ERL_TOP/README file.
make install now by default creates relative symbolic links
instead of absolute ones. For more information see the
$ERL_TOP/README file.
$ERL_TOP/configure --help=recursive now works and prints help for
all applications with configure scripts.
Doing make install, or make release directly after make all no
longer triggers miscellaneous rebuilds.
Existing bootstrap system is now used when doing make install, or
make release without a preceding make all.
The crypto and ssl applications use the same runtime library path
when dynamically linking against libssl.so and libcrypto.so. The
runtime library search path has also been extended.
The configure scripts of erl_interface and odbc now search for
thread libraries and thread library quirks the same way as erts
do.
The configure script of the odbc application now also looks for
odbc libraries in lib64 and lib/64 directories when building on a
64-bit system.
The config.h.in file in the erl_interface application is now
automatically generated in instead of statically updated which
reduces the risk of configure tests without any effect.
Diffstat (limited to 'lib/erl_interface')
-rw-r--r-- | lib/erl_interface/configure.in | 164 | ||||
-rw-r--r-- | lib/erl_interface/src/Makefile.in | 12 | ||||
-rw-r--r-- | lib/erl_interface/src/auxdir/config.h.in | 277 |
3 files changed, 50 insertions, 403 deletions
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in index 2f5b5673bb..7728cb97be 100644 --- a/lib/erl_interface/configure.in +++ b/lib/erl_interface/configure.in @@ -1,19 +1,19 @@ # -*- Autoconf -*- # %CopyrightBegin% -# -# Copyright Ericsson AB 2000-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 2000-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # # Process this file with autoconf to produce a configure script. @@ -65,18 +65,12 @@ fi TARGET=$host AC_SUBST(TARGET) -AC_CONFIG_HEADER([src/$host/config.h:src/auxdir/config.h.in]) +AC_CONFIG_HEADER([src/$host/config.h:config.h.in]) dnl ---------------------------------------------------------------------- dnl Optional features dnl ---------------------------------------------------------------------- -AC_ARG_WITH(xcomp-conf, -[ --with-xcompconf=PATH path to cross compilation configuration]) -if test "x$with_xcompconf" != "xno" -a "x$with_xcompconf" != "x" ; then - . $with_xcompconf -fi - # Use --disable-threads to force building single threaded libs even # if pthreads exists (for test purposes). AC_ARG_ENABLE(threads, @@ -95,9 +89,8 @@ AC_PROG_CC AC_PROG_CPP dnl AC_PROG_LIBTOOL AC_PROG_RANLIB -if test "x$LD" = "x"; then - AC_CHECK_TOOL([LD],[ld],[ld]) -fi +AC_CHECK_PROG(LD, ld.sh) +AC_CHECK_TOOL(LD, ld, '$(CC)') AC_SUBST(LD) AC_CHECK_SIZEOF(short) @@ -110,8 +103,8 @@ if test $ac_cv_sizeof_void_p = 8; then CFLAGS="$CFLAGS -DEI_64BIT" fi -AC_CHECK_PROG(AR, ar, ar, false) -if test "$ac_cv_prog_AR" = false; then +AC_CHECK_TOOL(AR, ar, false) +if test "$AR" = false; then AC_MSG_ERROR([No 'ar' command found in PATH]) fi @@ -164,7 +157,7 @@ AC_TRY_COMPILE([#include <sys/types.h> #include <sys/socket.h>], [socklen_t mylen;], [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_SOCKLEN_T)], + AC_DEFINE(HAVE_SOCKLEN_T, [], [Define if you have the `socklen_t' type])], [AC_MSG_RESULT(no)]) # Checks for library functions. @@ -209,7 +202,7 @@ if test "x$with_gmp" = "xyes" ;then AC_CHECK_HEADER($dir/include/gmp.h, ac_cv_gmp=yes, ac_cv_gmp=no) if test $ac_cv_gmp = yes ; then CFLAGS="$CFLAGS -I$dir/include -L$dir/lib" - AC_DEFINE(HAVE_GMP_H) + AC_DEFINE(HAVE_GMP_H, [], [Define if you have "gmp.h"]) break fi done @@ -226,7 +219,7 @@ elif test "x$with_gmp" != "xno" -a -n "$with_gmp" ;then fi AC_MSG_RESULT(yes) CFLAGS="$CFLAGS -I$with_gmp/include -L$with_gmp/lib" - AC_DEFINE(HAVE_GMP_H) + AC_DEFINE(HAVE_GMP_H, [], [Define if you have "gmp.h"]) AC_CHECK_LIB(gmp, __gmpz_export) # FIXME return ERROR if no lib fi @@ -279,110 +272,43 @@ AC_SUBST(MIXED_CYGWIN) dnl dnl Threads dnl -found_threads=no THR_LIBS= THR_DEFS= -EI_THREADS="false" AC_SUBST(THR_LIBS) AC_SUBST(THR_DEFS) AC_SUBST(EI_THREADS) case "$threads_disabled" in - no) - AC_MSG_CHECKING([for native win32 threads]) - if test "X$host_os" = "Xwin32"; then - THR_DEFS="-DWIN32_THREADS" - found_threads=yes - EI_THREADS="true" - AC_MSG_RESULT([yes]) - AC_MSG_CHECKING([for __declspec(thread) usability]) - if test "X$GCC" = "Xyes"; then - AC_MSG_RESULT([no]) - else - THR_DEFS="$THR_DEFS -DUSE_DECLSPEC_THREAD" - AC_MSG_RESULT([yes]) - fi + no) + LM_CHECK_THR_LIB + + case "$THR_LIB_NAME" in + "") + EI_THREADS="false" + ;; + win32_threads) + EI_THREADS="true" + AC_MSG_CHECKING([for __declspec(thread) usability]) + if test "X$GCC" = "Xyes"; then + AC_MSG_RESULT([no]) else - AC_MSG_RESULT(no) - - dnl Check for POSIX threads - - pthread_lib="" - AC_CHECK_LIB(pthread, - pthread_create, - [found_threads=yes - EI_THREADS="true" - THR_LIBS="-lpthread" - THR_DEFS="-D_REENTRANT -D_THREAD_SAFE -DPOSIX_THREADS" - pthread_lib=pthread]) - - # FreeBSD has pthreads in special c library, c_r - if test $found_threads = no; then - AC_CHECK_LIB(c_r, - pthread_create, - [found_threads=yes - EI_THREADS="true" - THR_LIBS="-lc_r" - THR_DEFS="-D_REENTRANT -D_THREAD_SAFE -DPOSIX_THREADS" - pthread_lib=c_r]) - fi - - if test "x$pthread_lib" != "x"; then - AC_CHECK_LIB($pthread_lib,pthread_atfork,AC_DEFINE(HAVE_PTHREAD_ATFORK)) - AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H)) - dnl Some Linuxes have <pthread/mit/pthread.h> instead of <pthread.h> - AC_CHECK_HEADER(pthread/mit/pthread.h, AC_DEFINE(HAVE_MIT_PTHREAD_H)) - case $host_os in - solaris*) - THR_DEFS="$THR_DEFS -D_POSIX_PTHREAD_SEMANTICS";; - linux*) - dnl NPTL test stolen from $ERL_TOP/erts/aclocal.m4 - AC_MSG_CHECKING(for Native POSIX Thread Library) - case `getconf GNU_LIBPTHREAD_VERSION 2>/dev/null` in - nptl*) nptl=yes;; - NPTL*) nptl=yes;; - *) nptl=no;; - esac - AC_MSG_RESULT($nptl) - if test $nptl = yes; then - need_nptl_incldir=no - AC_CHECK_HEADER(nptl/pthread.h, need_nptl_incldir=yes) - if test $need_nptl_incldir = yes; then - # Ahh... - nptl_path="$C_INCLUDE_PATH:$CPATH:/usr/local/include:/usr/include" - nptl_ws_path= - save_ifs="$IFS"; IFS=":" - for dir in $nptl_path; do - if test "x$dir" != "x"; then - nptl_ws_path="$nptl_ws_path $dir" - fi - done - IFS=$save_ifs - nptl_incldir= - for dir in $nptl_ws_path; do - AC_CHECK_HEADER($dir/nptl/pthread.h, - nptl_incldir=$dir/nptl) - if test "x$nptl_incldir" != "x"; then - THR_DEFS="$THR_DEFS -isystem $nptl_incldir" - break - fi - done - if test "x$nptl_incldir" = "x"; then - AC_MSG_ERROR(Failed to locate nptl system include directory) - fi - fi - fi - - ;; - *) - ;; - esac - fi + THR_DEFS="$THR_DEFS -DUSE_DECLSPEC_THREAD" + AC_MSG_RESULT([yes]) fi ;; - yes) - # Threads disabled - ;; + pthread) + EI_THREADS="true" + ;; + *) + EI_THREADS="true" + AC_MSG_WARN([Unexpected thread library: $THR_LIB_NAME]) + ;; + esac + ;; + yes) + # Threads disabled + EI_THREADS="false" + ;; esac # --------------------------------------------------------------------------- @@ -413,12 +339,10 @@ fi # FIXME We want to use libtool but until then.... # --------------------------------------------------------------------------- -AC_SUBST(DED_CFLAGS) -dnl AC_SUBST(DED_LD) -dnl AC_SUBST(DED_LDFLAGS) +AC_SUBST(LIB_CFLAGS) if test "X$host" = "Xwin32"; then - DED_CFLAGS="$CFLAGS" + LIB_CFLAGS="$CFLAGS" else case $host_os in darwin*) @@ -427,9 +351,9 @@ else esac if test "x$GCC" = xyes; then - DED_CFLAGS="$CFLAGS -fPIC" + LIB_CFLAGS="$CFLAGS -fPIC" else - DED_CFLAGS="$CFLAGS" + LIB_CFLAGS="$CFLAGS" fi fi diff --git a/lib/erl_interface/src/Makefile.in b/lib/erl_interface/src/Makefile.in index b8ee5c83c7..ec094789ce 100644 --- a/lib/erl_interface/src/Makefile.in +++ b/lib/erl_interface/src/Makefile.in @@ -1,19 +1,19 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 1997-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 1997-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # @@ -106,7 +106,7 @@ WARNFLAGS = @WFLAGS@ endif ifneq ($(findstring ose,$(TARGET)),ose) -CFLAGS = @DED_CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) +CFLAGS = @LIB_CFLAGS@ $(WARNFLAGS) $(INCFLAGS) $(TYPE_FLAGS) else CFLAGS = @CFLAGS@ $(INCFLAGS) endif diff --git a/lib/erl_interface/src/auxdir/config.h.in b/lib/erl_interface/src/auxdir/config.h.in deleted file mode 100644 index 523c766993..0000000000 --- a/lib/erl_interface/src/auxdir/config.h.in +++ /dev/null @@ -1,277 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* 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 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Define to 1 if you have `alloca', as a function or macro. */ -#undef HAVE_ALLOCA - -/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). - */ -#undef HAVE_ALLOCA_H - -/* Define to 1 if you have the <arpa/inet.h> header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you - don't. */ -#undef HAVE_DECL_STRERROR_R - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Define to 1 if you have the `dup2' function. */ -#undef HAVE_DUP2 - -/* Define to 1 if you have the <fcntl.h> header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fork' function. */ -#undef HAVE_FORK - -/* Define to 1 if you have the `gethostbyaddr' function. */ -#undef HAVE_GETHOSTBYADDR - -/* Define to 1 if you have the `gethostbyname' function. */ -#undef HAVE_GETHOSTBYNAME - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* Define to 1 if you have the `gethostname' function. */ -#undef HAVE_GETHOSTNAME - -/* Define to 1 if you have the `gethrtime' function. */ -#undef HAVE_GETHRTIME - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the <gmp.h> header file. */ -#undef HAVE_GMP_H - -/* Define to 1 if you have the `inet_ntoa' function. */ -#undef HAVE_INET_NTOA - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `gmp' library (-lgmp). */ -#undef HAVE_LIBGMP - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define to 1 if you have the `resolv' library (-lresolv). */ -#undef HAVE_LIBRESOLV - -/* Define to 1 if you have the `socket' library (-lsocket). */ -#undef HAVE_LIBSOCKET - -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and - to 0 otherwise. */ -#undef HAVE_MALLOC - -/* Define to 1 if you have the <malloc.h> header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the `memchr' function. */ -#undef HAVE_MEMCHR - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the <netdb.h> header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the <netinet/in.h> header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the <pthread/mit/pthread.h> header file. */ -#undef HAVE_MIT_PTHREAD_H - -/* Define to 1 if you have the <pthread.h> header file. */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if your system has a GNU libc compatible `realloc' function, - and to 0 otherwise. */ -#undef HAVE_REALLOC - -/* Define if you have the res_gethostbyname function. */ -#undef HAVE_RES_GETHOSTBYNAME - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Define to 1 if you have the <stddef.h> header file. */ -#undef HAVE_STDDEF_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strerror_r' function. */ -#undef HAVE_STRERROR_R - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strrchr' function. */ -#undef HAVE_STRRCHR - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the <sys/param.h> header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the <sys/select.h> header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the <sys/socket.h> header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/time.h> header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the `uname' function. */ -#undef HAVE_UNAME - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `vfork' function. */ -#undef HAVE_VFORK - -/* Define to 1 if you have the <vfork.h> header file. */ -#undef HAVE_VFORK_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if `fork' works. */ -#undef HAVE_WORKING_FORK - -/* Define to 1 if `vfork' works. */ -#undef HAVE_WORKING_VFORK - -/* Define if you have the writev function. */ -#undef HAVE_WRITEV - -/* Define if you have the socklen_t datatype */ -#undef HAVE_SOCKLEN_T - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* Define to the type of arg 1 for `select'. */ -#undef SELECT_TYPE_ARG1 - -/* Define to the type of args 2, 3 and 4 for `select'. */ -#undef SELECT_TYPE_ARG234 - -/* Define to the type of arg 5 for `select'. */ -#undef SELECT_TYPE_ARG5 - -/* 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 to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if strerror_r returns char *. */ -#undef STRERROR_R_CHAR_P - -/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef gid_t - -/* Define to rpl_malloc if the replacement function should be used. */ -#undef malloc - -/* Define to `int' if <sys/types.h> does not define. */ -#undef pid_t - -/* Define to rpl_realloc if the replacement function should be used. */ -#undef realloc - -/* Define to `unsigned' if <sys/types.h> does not define. */ -#undef size_t - -/* Define to `int' if <sys/types.h> doesn't define. */ -#undef uid_t - -/* Define as `fork' if `vfork' does not work. */ -#undef vfork - -/* Define to empty if the keyword `volatile' does not work. Warning: valid - code using `volatile' can become incorrect without. Disable with care. */ -#undef volatile |