Skip to content
Browse files

Remove gcc.config, std.c.unix, x3 configuration files.

  • Loading branch information...
1 parent eefb408 commit ffed7d684e94d2b933a7d2f27403d8fb7de65314 @ibuclaw ibuclaw committed Aug 30, 2012
Showing with 379 additions and 4,348 deletions.
  1. +4 −0 gcc/d/ChangeLog
  2. +1 −1 gcc/d/Make-lang.in
  3. +2 −2 libphobos/Makefile.am
  4. +2 −15 libphobos/Makefile.in
  5. +0 −3 libphobos/acinclude.m4
  6. +0 −71 libphobos/config.h.in
  7. +235 −626 libphobos/configure
  8. +10 −148 libphobos/configure.in
  9. +1 −54 libphobos/libdruntime/Makefile.am
  10. +3 −70 libphobos/libdruntime/Makefile.in
  11. +0 −7 libphobos/libdruntime/config/errno.x3
  12. +0 −7 libphobos/libdruntime/config/fpcls.x3
  13. +0 −47 libphobos/libdruntime/config/libc.x3
  14. +0 −313 libphobos/libdruntime/config/unix.x3
  15. +0 −26 libphobos/libdruntime/config/x3
  16. +0 −1,834 libphobos/libdruntime/config/x3.c
  17. +0 −272 libphobos/libdruntime/config/x3.h
  18. +0 −77 libphobos/libdruntime/config/x3main.c
  19. +0 −23 libphobos/libdruntime/core/stdc/stdio.d
  20. +0 −4 libphobos/libdruntime/core/stdc/stdlib.d
  21. +0 −25 libphobos/libdruntime/frag-ac.in
  22. +0 −15 libphobos/libdruntime/gcc/aix_float.h
  23. +20 −8 libphobos/libdruntime/gcc/atomics.d
  24. +11 −11 libphobos/libdruntime/gcc/builtins.d
  25. +0 −42 libphobos/libdruntime/gcc/cbridge_math.c
  26. +11 −11 libphobos/libdruntime/gcc/cbridge_stdio.c
  27. +0 −23 libphobos/libdruntime/gcc/cbridge_strerror.c
  28. +0 −27 libphobos/libdruntime/gcc/cbridge_time.c
  29. +23 −24 libphobos/libdruntime/gcc/deh.d
  30. +0 −27 libphobos/libdruntime/gcc/fpcls.d
  31. +0 −63 libphobos/libdruntime/gcc/ldblcompat.d
  32. +0 −23 libphobos/libdruntime/gcc/support.d
  33. +0 −78 libphobos/libdruntime/gcc/threadsem.d
  34. +12 −14 libphobos/libdruntime/gcc/unwind.d
  35. +20 −1 libphobos/libdruntime/gcc/unwind_arm.d
  36. +11 −11 libphobos/libdruntime/gcc/unwind_generic.d
  37. +12 −11 libphobos/libdruntime/gcc/unwind_pe.d
  38. +0 −186 libphobos/libdruntime/rt/fpmath.d
  39. +0 −106 libphobos/libdruntime/rt/mars.h
  40. +1 −0 libphobos/phobos-ver-syms.in
  41. +0 −42 libphobos/std/c/unix/unix.d
View
4 gcc/d/ChangeLog
@@ -1,3 +1,7 @@
+2012-08-30 Iain Buclaw <ibuclaw@ubuntu.com>
+
+ * Make-lang.in: Fix issue with cross-compiler configuration.
+
2012-08-29 Iain Buclaw <ibuclaw@ubuntu.com>
* lang-specs.h: Remove special case for handled D source files.
View
2 gcc/d/Make-lang.in
@@ -45,7 +45,7 @@ ifeq ($(host), $(target))
D_include_dir = `echo $(exec_prefix) | sed -e 's|^$(prefix)||' -e 's|/[^/]*|/..|g'`/include/d/$(version)
gcc_d_include_dir = $(libsubdir)/$(unlibsubdir)/..$(D_include_dir)
else
- gcc_d_include_dir = $(libsubdir)/include/d)
+ gcc_d_include_dir = $(libsubdir)/include/d
endif
View
4 libphobos/Makefile.am
@@ -22,7 +22,7 @@ ACLOCAL_AMFLAGS = -I . -I ..
SUBDIRS = libdruntime
OUR_CFLAGS=@DEFS@ -I . -I $(srcdir)/gcc -I$(top_srcdir)/../zlib
-D_EXTRA_DFLAGS=-nostdinc -pipe -fdeprecated -I $(srcdir) -I $(srcdir)/libdruntime -I ./libdruntime/$(host_alias)
+D_EXTRA_DFLAGS=-nostdinc -pipe -fdeprecated -fproperty -I $(srcdir) -I $(srcdir)/libdruntime -I ./libdruntime/$(host_alias)
ALL_DFLAGS=$(DFLAGS) $(D_GC_FLAGS) $(D_EXTRA_DFLAGS) $(MULTIFLAGS)
toolexecdir = $(phobos_toolexecdir)
@@ -138,7 +138,7 @@ install-exec-local: libgphobos2.a
install-data-local: libgphobos2.a
for i in etc/c \
std std/c std/c/freebsd \
- std/c/linux std/c/osx std/c/unix std/c/windows \
+ std/c/linux std/c/osx std/c/windows \
std/internal std/internal/math std/internal/windows \
std/net std/windows; do \
$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$$i; \
View
17 libphobos/Makefile.in
@@ -119,29 +119,16 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DCFG_ARM_EABI_UNWINDER = @DCFG_ARM_EABI_UNWINDER@
DCFG_CBRIDGE_STDIO = @DCFG_CBRIDGE_STDIO@
-DCFG_EXECVPE = @DCFG_EXECVPE@
DCFG_EXP2 = @DCFG_EXP2@
-DCFG_FWIDE = @DCFG_FWIDE@
DCFG_GETPWNAM_R = @DCFG_GETPWNAM_R@
-DCFG_HAVE_FGETLINE = @DCFG_HAVE_FGETLINE@
-DCFG_HAVE_FGETLN = @DCFG_HAVE_FGETLN@
-DCFG_HAVE_GETDELIM = @DCFG_HAVE_GETDELIM@
-DCFG_HAVE_UNLOCKED_STDIO = @DCFG_HAVE_UNLOCKED_STDIO@
-DCFG_HAVE_UNLOCKED_WIDE_STDIO = @DCFG_HAVE_UNLOCKED_WIDE_STDIO@
DCFG_LOG2 = @DCFG_LOG2@
DCFG_MMAP = @DCFG_MMAP@
-DCFG_NAN = @DCFG_NAN@
-DCFG_NEARBYINT = @DCFG_NEARBYINT@
DCFG_POSIX = @DCFG_POSIX@
DCFG_PTHREAD_SUSPEND = @DCFG_PTHREAD_SUSPEND@
DCFG_ROUND = @DCFG_ROUND@
DCFG_SEMAPHORE_IMPL = @DCFG_SEMAPHORE_IMPL@
-DCFG_SPAWNVP = @DCFG_SPAWNVP@
-DCFG_STRTOLD = @DCFG_STRTOLD@
-DCFG_TGAMMA = @DCFG_TGAMMA@
DCFG_TRUNC = @DCFG_TRUNC@
DCFG_UNIX = @DCFG_UNIX@
-DCFG_USE_IEEE_FPSB = @DCFG_USE_IEEE_FPSB@
DEFS = @DEFS@
DFLAGS = @DFLAGS@
DRUNTIME_OBJS = @DRUNTIME_OBJS@
@@ -233,7 +220,7 @@ AUTOMAKE_OPTIONS = 1.9.4 foreign no-dependencies
ACLOCAL_AMFLAGS = -I . -I ..
SUBDIRS = libdruntime
OUR_CFLAGS = @DEFS@ -I . -I $(srcdir)/gcc -I$(top_srcdir)/../zlib
-D_EXTRA_DFLAGS = -nostdinc -pipe -fdeprecated -I $(srcdir) -I $(srcdir)/libdruntime -I ./libdruntime/$(host_alias)
+D_EXTRA_DFLAGS = -nostdinc -pipe -fdeprecated -fproperty -I $(srcdir) -I $(srcdir)/libdruntime -I ./libdruntime/$(host_alias)
ALL_DFLAGS = $(DFLAGS) $(D_GC_FLAGS) $(D_EXTRA_DFLAGS) $(MULTIFLAGS)
toolexecdir = $(phobos_toolexecdir)
toolexeclibdir = $(phobos_toolexeclibdir)
@@ -832,7 +819,7 @@ install-exec-local: libgphobos2.a
install-data-local: libgphobos2.a
for i in etc/c \
std std/c std/c/freebsd \
- std/c/linux std/c/osx std/c/unix std/c/windows \
+ std/c/linux std/c/osx std/c/windows \
std/internal std/internal/math std/internal/windows \
std/net std/windows; do \
$(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$$i; \
View
3 libphobos/acinclude.m4
@@ -79,11 +79,8 @@ AC_CHECK_FUNC(mmap,DCFG_MMAP="GNU_Unix_Have_MMap",[])
AC_CHECK_FUNC(getpwnam_r,DCFG_GETPWNAM_R="GNU_Unix_Have_getpwnam_r",[])
-D_EXTRA_OBJS="std/c/unix/unix.o $D_EXTRA_OBJS"
-DRUNTIME_OBJS="gcc/config/unix.o $DRUNTIME_OBJS"
# Add "linux" module for compatibility even if not Linux
D_EXTRA_OBJS="std/c/linux/linux.o $D_EXTRA_OBJS"
-D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_unix_d_src)'
DCFG_UNIX="Unix"
DCFG_POSIX="Posix"
View
71 libphobos/config.h.in
@@ -3,24 +3,6 @@
/* Define to 1 if the system has the type `clockid_t'. */
#undef HAVE_CLOCKID_T
-/* Define to 1 if you have the `flockfile' function. */
-#undef HAVE_FLOCKFILE
-
-/* Define to 1 fpclassify and signbit are available */
-#undef HAVE_FP_CLASSIFY_SIGNBIT
-
-/* Define to 1 if you have the `funlockfile' function. */
-#undef HAVE_FUNLOCKFILE
-
-/* Define to 1 if you have the `getc_unlocked' function. */
-#undef HAVE_GETC_UNLOCKED
-
-/* Define to 1 if you have the `getwc_unlocked' function. */
-#undef HAVE_GETWC_UNLOCKED
-
-/* Have glibc strerror_r */
-#undef HAVE_GLIBC_STRERROR_R
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -54,21 +36,9 @@
/* Define to 1 if the system has the type `pthread_spinlock_t'. */
#undef HAVE_PTHREAD_SPINLOCK_T
-/* Define to 1 if you have the `putc_unlocked' function. */
-#undef HAVE_PUTC_UNLOCKED
-
-/* Define to 1 if you have the `putwc_unlocked' function. */
-#undef HAVE_PUTWC_UNLOCKED
-
/* Define to 1 if you have the <semaphore.h> header file. */
#undef HAVE_SEMAPHORE_H
-/* Define to 1 if it is possible to determine the size of the DIR struct */
-#undef HAVE_SIZEOF_DIR
-
-/* Define to 1 if it is possible to determine the size of the FILE struct */
-#undef HAVE_SIZEOF_FILE
-
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
@@ -78,9 +48,6 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* 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
@@ -135,49 +102,11 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Define if there is no file system, synchronization services, etc. */
-#undef PHOBOS_NO_SYSTEM
-
/* Define if using pthreads */
#undef PHOBOS_USE_PTHREADS
-/* Define if mutexes are recursive by default */
-#undef PTHREAD_MUTEX_ALREADY_RECURSIVE
-
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# undef _ALL_SOURCE
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# undef _GNU_SOURCE
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-
-
/* Version number of package */
#undef VERSION
-
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-#undef _POSIX_SOURCE
View
861 libphobos/configure
@@ -615,26 +615,16 @@ DCFG_SEMAPHORE_IMPL
DCFG_PTHREAD_SUSPEND
DCFG_CBRIDGE_STDIO
DCFG_ARM_EABI_UNWINDER
-DCFG_STRTOLD
-DCFG_HAVE_UNLOCKED_WIDE_STDIO
-DCFG_HAVE_UNLOCKED_STDIO
-DCFG_HAVE_FGETLINE
-DCFG_HAVE_FGETLN
-DCFG_HAVE_GETDELIM
-DCFG_FWIDE
-DCFG_SPAWNVP
-DCFG_EXECVPE
DCFG_LOG2
DCFG_EXP2
-DCFG_NAN
-DCFG_TGAMMA
DCFG_ROUND
-DCFG_NEARBYINT
DCFG_TRUNC
-DCFG_USE_IEEE_FPSB
D_PREREQ_SRCS
DRUNTIME_OBJS
D_EXTRA_OBJS
+EGREP
+GREP
+CPP
phobos_toolexeclibdir
phobos_toolexecdir
gdc_include_dir
@@ -643,9 +633,6 @@ BUILD_LIBIBERTY
CFLAGS_FOR_BUILD
CC_FOR_BUILD
GDC
-EGREP
-GREP
-CPP
RANLIB
AR
ac_ct_CXX
@@ -4116,6 +4103,177 @@ $as_echo "no" >&6; }
fi
+# Check whether --enable-thread-lib was given.
+if test "${enable_thread_lib+set}" = set; then :
+ enableval=$enable_thread_lib; d_thread_lib=$enableval
+else
+ d_thread_lib=""
+fi
+
+
+# Check whether --enable-unix was given.
+if test "${enable_unix+set}" = set; then :
+ enableval=$enable_unix; :
+else
+ enable_unix=auto
+fi
+
+
+# Check whether --enable-druntime-gc was given.
+if test "${enable_druntime_gc+set}" = set; then :
+ enableval=$enable_druntime_gc; :
+else
+ enable_druntime_gc=yes
+fi
+
+
+
+# Check whether --with-system-zlib was given.
+if test "${with_system_zlib+set}" = set; then :
+ withval=$with_system_zlib; :
+else
+ system_zlib=no
+fi
+
+
+# Check whether --enable-proc-maps was given.
+if test "${enable_proc_maps+set}" = set; then :
+ enableval=$enable_proc_maps; case "${enableval}" in
+yes) echo 'TODO: If cross, warn that there is no check that this works'
+ ;;
+auto|no)
+ ;;
+*) as_fn_error $? "--enable-proc-maps argument must be \"yes\", \"no\", or \"auto\"" "$LINENO" 5
+ ;;
+esac
+else
+ enable_proc_maps=auto
+fi
+
+
+# Check whether --enable-phobos-config-dir was given.
+if test "${enable_phobos_config_dir+set}" = set; then :
+ enableval=$enable_phobos_config_dir; if test -z "${enableval}"; then
+ as_fn_error $? "must specify a value for --enable-phobos-config-dir" "$LINENO" 5
+fi
+else
+ :
+fi
+
+
+if test ${multilib} = yes; then
+ multilib_arg="--enable-multilib"
+else
+ multilib_arg=
+fi
+
+d_target_os=`echo $target_os | sed 's/^\(A-Za-z_+\)/\1/'`
+
+# SkyOS uses i386-skyos-pe
+case "$target" in
+*-skyos*-pe*) d_target_os=skyos ;;
+esac
+
+GDC=$CC
+GDC=`echo $CC | sed s/xgcc/gdc/`
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If $GDC can compile D sources" >&5
+$as_echo_n "checking If $GDC can compile D sources... " >&6; }
+echo "int function(int) test;" > actest.d
+$GDC -c -x d -I "$srcdir/libdruntime" actest.d
+r=$?
+rm -f actest.do
+if test $r -eq 0; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "can't compile D sources!" "$LINENO" 5
+ fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking D GCC version" >&5
+$as_echo_n "checking D GCC version... " >&6; }
+d_gcc_ver=`$GDC -dumpversion`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $d_gcc_ver" >&5
+$as_echo "$d_gcc_ver" >&6; }
+
+# Need to export this variables for multilib
+export CC_FOR_BUILD
+export CFLAGS_FOR_BUILD
+
+
+
+# Find build libiberty which is needed by x3
+# Should not have to go up too many directories
+
+d_libiberty_dir=../..
+while test "$d_count" != 'xxx'; do
+ BUILD_LIBIBERTY=$d_libiberty_dir/build-${build_alias}/libiberty/libiberty.a
+ if test -f $BUILD_LIBIBERTY; then
+ break
+ fi
+ # GCC 3.x does not use the 'build-' dir, so we have so search
+ # for plain 'libiberty' with some kind of check it is not a target dir
+ BUILD_LIBIBERTY=$d_libiberty_dir/libiberty/libiberty.a
+ if test -f $BUILD_LIBIBERTY && test -d $d_libiberty_dir/gcc; then
+ break
+ fi
+
+ d_libiberty_dir=../$d_libiberty_dir
+ d_count="x$d_count"
+done
+
+if test ! -f "$BUILD_LIBIBERTY"; then
+ as_fn_error $? "cannot find libiberty.a for build" "$LINENO" 5
+fi
+
+#used in druntime, so srcdir is 'libphobos/libdruntime'
+LIBIBERTY_H_PATH='$(srcdir)/../../include'
+BUILD_LIBIBERTY="../$BUILD_LIBIBERTY"
+
+
+
+
+
+
+# include dir .. need to support --enable-version-specific.. but
+# will have to modify gcc/configure.ac ..
+# For now, basic workaround for cross compilers ..
+if test "${host}" != "${build}"; then
+ gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d
+else
+ gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
+fi
+
+
+# Check whether --with-cross-host was given.
+if test "${with_cross_host+set}" = set; then :
+ withval=$with_cross_host;
+fi
+
+if test -n "$with_cross_host" &&
+ test x"$with_cross_host" != x"no"; then
+ phobos_toolexecdir='${exec_prefix}/${host_alias}'
+ phobos_toolexeclibdir='${toolexecdir}/lib'
+else
+ phobos_toolexecdir='${libdir}/gcc/${host_alias}'
+ phobos_toolexeclibdir='${libdir}'
+fi
+# The norm would be to use $GDC -print-multi-os-directory, but
+# that would require modifying config-ml.in
+multi_os_directory=`$CC -print-multi-os-directory`
+case $multi_os_directory in
+ .) ;; # Avoid trailing /.
+ *) phobos_toolexeclibdir=$phobos_toolexeclibdir/$multi_os_directory ;;
+esac
+
+
+
+# Sanity check for the cross-compilation case:
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4513,411 +4671,91 @@ fi
done
-
- ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
- MINIX=yes
+ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdio_h" = xyes; then :
+ :
else
- MINIX=
+ as_fn_error $? "cannot find stdio.h." "$LINENO" 5
fi
- if test "$MINIX" = yes; then
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+# TODO...
+
+D_EXTRA_OBJS=
+DRUNTIME_OBJS=
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+D_PREREQ_SRCS='$(config_d_src)'
-$as_echo "#define _MINIX 1" >>confdefs.h
- fi
+if test "$with_newlib" = yes; then
+ # TODO: newlib has trunc and exp2, but not log2 -- so configure all separately
+ DCFG_TRUNC=""
+ DCFG_ROUND=""
+ DCFG_EXP2="GNU_Need_exp2"
+ DCFG_LOG2="GNU_Need_log2"
+ # TODO: exec stuff
+else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
+$as_echo_n "checking for cos in -lm... " >&6; }
+if ${ac_cv_lib_m_cos+:} false; then :
$as_echo_n "(cached) " >&6
else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-# define __EXTENSIONS__ 1
- $ac_includes_default
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
int
main ()
{
-
+return cos ();
;
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_safe_to_define___extensions__=yes
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_m_cos=yes
else
- ac_cv_safe_to_define___extensions__=no
+ ac_cv_lib_m_cos=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
- test $ac_cv_safe_to_define___extensions__ = yes &&
- $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
- $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-
- $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
- $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
-
- $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
+$as_echo "$ac_cv_lib_m_cos" >&6; }
+if test "x$ac_cv_lib_m_cos" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+ LIBS="-lm $LIBS"
-# Check whether --enable-thread-lib was given.
-if test "${enable_thread_lib+set}" = set; then :
- enableval=$enable_thread_lib; d_thread_lib=$enableval
-else
- d_thread_lib=""
fi
-# Check whether --enable-unix was given.
-if test "${enable_unix+set}" = set; then :
- enableval=$enable_unix; :
+case "$d_target_os" in
+ aix*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf in -lC" >&5
+$as_echo_n "checking for sqrtf in -lC... " >&6; }
+if ${ac_cv_lib_C_sqrtf+:} false; then :
+ $as_echo_n "(cached) " >&6
else
- enable_unix=auto
-fi
-
-
-# Check whether --enable-druntime-gc was given.
-if test "${enable_druntime_gc+set}" = set; then :
- enableval=$enable_druntime_gc; :
-else
- enable_druntime_gc=yes
-fi
-
-
-
-# Check whether --with-system-zlib was given.
-if test "${with_system_zlib+set}" = set; then :
- withval=$with_system_zlib; :
-else
- system_zlib=no
-fi
-
-
-# Check whether --enable-proc-maps was given.
-if test "${enable_proc_maps+set}" = set; then :
- enableval=$enable_proc_maps; case "${enableval}" in
-yes) echo 'TODO: If cross, warn that there is no check that this works'
- ;;
-auto|no)
- ;;
-*) as_fn_error $? "--enable-proc-maps argument must be \"yes\", \"no\", or \"auto\"" "$LINENO" 5
- ;;
-esac
-else
- enable_proc_maps=auto
-fi
-
-
-# Check whether --enable-phobos-config-dir was given.
-if test "${enable_phobos_config_dir+set}" = set; then :
- enableval=$enable_phobos_config_dir; if test -z "${enableval}"; then
- as_fn_error $? "must specify a value for --enable-phobos-config-dir" "$LINENO" 5
-fi
-else
- :
-fi
-
-
-if test ${multilib} = yes; then
- multilib_arg="--enable-multilib"
-else
- multilib_arg=
-fi
-
-d_target_os=`echo $target_os | sed 's/^\(A-Za-z_+\)/\1/'`
-
-# SkyOS uses i386-skyos-pe
-case "$target" in
-*-skyos*-pe*) d_target_os=skyos ;;
-esac
-
-GDC=$CC
-GDC=`echo $CC | sed s/xgcc/gdc/`
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If $GDC can compile D sources" >&5
-$as_echo_n "checking If $GDC can compile D sources... " >&6; }
-echo "int function(int) test;" > actest.d
-$GDC -c -x d -I "$srcdir/libdruntime" actest.d
-r=$?
-rm -f actest.do
-if test $r -eq 0; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- as_fn_error $? "can't compile D sources!" "$LINENO" 5
- fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking D GCC version" >&5
-$as_echo_n "checking D GCC version... " >&6; }
-d_gcc_ver=`$GDC -dumpversion`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $d_gcc_ver" >&5
-$as_echo "$d_gcc_ver" >&6; }
-
-# Need to export this variables for multilib
-export CC_FOR_BUILD
-export CFLAGS_FOR_BUILD
-
-
-
-# Find build libiberty which is needed by x3
-# Should not have to go up too many directories
-
-d_libiberty_dir=../..
-while test "$d_count" != 'xxx'; do
- BUILD_LIBIBERTY=$d_libiberty_dir/build-${build_alias}/libiberty/libiberty.a
- if test -f $BUILD_LIBIBERTY; then
- break
- fi
- # GCC 3.x does not use the 'build-' dir, so we have so search
- # for plain 'libiberty' with some kind of check it is not a target dir
- BUILD_LIBIBERTY=$d_libiberty_dir/libiberty/libiberty.a
- if test -f $BUILD_LIBIBERTY && test -d $d_libiberty_dir/gcc; then
- break
- fi
-
- d_libiberty_dir=../$d_libiberty_dir
- d_count="x$d_count"
-done
-
-if test ! -f "$BUILD_LIBIBERTY"; then
- as_fn_error $? "cannot find libiberty.a for build" "$LINENO" 5
-fi
-
-#used in druntime, so srcdir is 'libphobos/libdruntime'
-LIBIBERTY_H_PATH='$(srcdir)/../../include'
-BUILD_LIBIBERTY="../$BUILD_LIBIBERTY"
-
-
-
-
-
-
-# include dir .. need to support --enable-version-specific.. but
-# will have to modify gcc/configure.ac ..
-# For now, basic workaround for cross compilers ..
-if test "${host}" != "${build}"; then
- gdc_include_dir='${libdir}/gcc/${host_alias}'/${d_gcc_ver}/include/d
-else
- gdc_include_dir='${prefix}'/include/d/${d_gcc_ver}
-fi
-
-
-# Check whether --with-cross-host was given.
-if test "${with_cross_host+set}" = set; then :
- withval=$with_cross_host;
-fi
-
-if test -n "$with_cross_host" &&
- test x"$with_cross_host" != x"no"; then
- phobos_toolexecdir='${exec_prefix}/${host_alias}'
- phobos_toolexeclibdir='${toolexecdir}/lib'
-else
- phobos_toolexecdir='${libdir}/gcc/${host_alias}'
- phobos_toolexeclibdir='${libdir}'
-fi
-# The norm would be to use $GDC -print-multi-os-directory, but
-# that would require modifying config-ml.in
-multi_os_directory=`$CC -print-multi-os-directory`
-case $multi_os_directory in
- .) ;; # Avoid trailing /.
- *) phobos_toolexeclibdir=$phobos_toolexeclibdir/$multi_os_directory ;;
-esac
-
-
-
-# Sanity check for the cross-compilation case:
-ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdio_h" = xyes; then :
- :
-else
- as_fn_error $? "can't find stdio.h." "$LINENO" 5
-fi
-
-
-
-# TODO...
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sizeof(FILE)" >&5
-$as_echo_n "checking for sizeof(FILE)... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-
-struct Test { int x: sizeof(FILE)>4; };
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_SIZEOF_FILE 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sizeof(DIR)" >&5
-$as_echo_n "checking for sizeof(DIR)... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <dirent.h>
-int
-main ()
-{
-
-struct Test { int x: sizeof(DIR)>4; };
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_SIZEOF_DIR 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-D_EXTRA_OBJS=
-
-DRUNTIME_OBJS=
-
-
-D_PREREQ_SRCS='$(config_d_src) $(config_errno_d_src) $(config_libc_d_src) $(config_mathfuncs_d_src)'
-
-
-case "$target_cpu" in
- i*86|powerpc*|ppc*|x86_64 ) d_use_ieee_fpsb=1 ;;
- *) d_use_ieee_fpsb=0 ;;
-esac
-
-if test $d_use_ieee_fpsb -gt 0; then
- DRUNTIME_OBJS="$DRUNTIME_OBJS rt/fpmath.o"
-fi
-
-DCFG_USE_IEEE_FPSB=$d_use_ieee_fpsb
-
-
-if test "$with_newlib" = yes; then
- # TODO: newlib has trunc and exp2, but not log2 -- so configure all separately
- DCFG_TRUNC=""
- DCFG_NEARBYINT=""
- DCFG_ROUND=""
- DCFG_TGAMMA=""
- DCFG_NAN=""
- DCFG_EXP2="GNU_Need_exp2"
- DCFG_LOG2="GNU_Need_log2"
-
-
-$as_echo "#define HAVE_FP_CLASSIFY_SIGNBIT 1" >>confdefs.h
-
- DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_math.o"
- D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_fpcls_d_src)'
-
- # TODO: exec stuff
-
- DCFG_FWIDE=0
- # Have getdelim, but it may not be unix (need ssize_t)... TODO
- DCFG_HAVE_GETDELIM=0
- DCFG_HAVE_FGETLN=0
- DCFG_HAVE_FGETLINE=0
- DCFG_HAVE_UNLOCKED_STDIO=0
- DCFG_HAVE_UNLOCKED_WIDE_STDIO=$DCFG_HAVE_UNLOCKED_STDIO
- DCFG_STRTOLD="0"
- # NO HAVE_TM_GMTOFF_AND_ZONE
- # NO HAVE_TIMEZONE
-
-$as_echo "#define HAVE__TIMEZONE 1" >>confdefs.h
-
-else
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
-$as_echo_n "checking for cos in -lm... " >&6; }
-if ${ac_cv_lib_m_cos+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char cos ();
-int
-main ()
-{
-return cos ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_m_cos=yes
-else
- ac_cv_lib_m_cos=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
-$as_echo "$ac_cv_lib_m_cos" >&6; }
-if test "x$ac_cv_lib_m_cos" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
-_ACEOF
-
- LIBS="-lm $LIBS"
-
-fi
-
-
-case "$d_target_os" in
- aix*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtf in -lC" >&5
-$as_echo_n "checking for sqrtf in -lC... " >&6; }
-if ${ac_cv_lib_C_sqrtf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lC $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lC $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
@@ -4987,15 +4825,6 @@ fi
-ac_fn_c_check_func "$LINENO" "nearbyint" "ac_cv_func_nearbyint"
-if test "x$ac_cv_func_nearbyint" = xyes; then :
- DCFG_NEARBYINT=""
-else
- DCFG_NEARBYINT="GNU_Need_nearbyint"
-fi
-
-
-
ac_fn_c_check_func "$LINENO" "round" "ac_cv_func_round"
if test "x$ac_cv_func_round" = xyes; then :
DCFG_ROUND=""
@@ -5005,24 +4834,6 @@ fi
-ac_fn_c_check_func "$LINENO" "tgamma" "ac_cv_func_tgamma"
-if test "x$ac_cv_func_tgamma" = xyes; then :
- DCFG_TGAMMA=""
-else
- DCFG_TGAMMA="GNU_Need_tgamma"
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "nan" "ac_cv_func_nan"
-if test "x$ac_cv_func_nan" = xyes; then :
- DCFG_NAN=""
-else
- DCFG_NAN="GNU_Need_nan"
-fi
-
-
-
ac_fn_c_check_func "$LINENO" "exp2" "ac_cv_func_exp2"
if test "x$ac_cv_func_exp2" = xyes; then :
DCFG_EXP2=""
@@ -5041,194 +4852,7 @@ fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fpclassify and signbit" >&5
-$as_echo_n "checking for fpclassify and signbit... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
- #ifndef fpclassify
- static void fpclassify(int x, int y) { }
- #endif
- #ifndef signbit
- static void signbit(int x, int y) { }
- #endif
- #include <math.h>
-int
-main ()
-{
-int x = fpclassify(4.2);
- int y = signbit(1.1);
- int z = FP_NAN + FP_INFINITE + FP_ZERO + FP_SUBNORMAL + FP_NORMAL;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- d_have_fpsb=1
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Currently can only have either internal/fpmath or gcc/cbridge_math
-if test $d_use_ieee_fpsb -eq 0; then
- if test -n "$d_have_fpsb"; then
-
-$as_echo "#define HAVE_FP_CLASSIFY_SIGNBIT 1" >>confdefs.h
-
- DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_math.o"
- D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_fpcls_d_src)'
- fi
-fi
-
-# no expm1 on mingw (msvcrt)
-# AC_CHECK_FUNCS(expm1,DCFG_EXPM1="",DCFG_EXPM1="GNU_Need_expm1")
-# AC_SUBST(DCFG_EXPM1)
-# also erf, erfc
-
-ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe"
-if test "x$ac_cv_func_execvpe" = xyes; then :
- DCFG_EXECVPE=""
-else
- DCFG_EXECVPE="GNU_Need_execvpe"
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "spawnvp" "ac_cv_func_spawnvp"
-if test "x$ac_cv_func_spawnvp" = xyes; then :
- DCFG_SPAWNVP=""
-else
- DCFG_SPAWNVP="GNU_Need_spawnvp"
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "fwide" "ac_cv_func_fwide"
-if test "x$ac_cv_func_fwide" = xyes; then :
- DCFG_FWIDE=1
-else
- DCFG_FWIDE=0
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "getdelim" "ac_cv_func_getdelim"
-if test "x$ac_cv_func_getdelim" = xyes; then :
- DCFG_HAVE_GETDELIM=1
-else
- DCFG_HAVE_GETDELIM=0
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "fgetln" "ac_cv_func_fgetln"
-if test "x$ac_cv_func_fgetln" = xyes; then :
- DCFG_HAVE_FGETLN=1
-else
- DCFG_HAVE_FGETLN=0
-fi
-
-
-
-ac_fn_c_check_func "$LINENO" "fgetline" "ac_cv_func_fgetline"
-if test "x$ac_cv_func_fgetline" = xyes; then :
- DCFG_HAVE_FGETLINE=1
-else
- DCFG_HAVE_FGETLINE=0
-fi
-
-
-
-DCFG_HAVE_UNLOCKED_STDIO=1
-for ac_func in flockfile funlockfile putc_unlocked getc_unlocked
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
- DCFG_HAVE_UNLOCKED_STDIO=0
-fi
-done
-
-
-
-DCFG_HAVE_UNLOCKED_WIDE_STDIO=$DCFG_HAVE_UNLOCKED_STDIO
-for ac_func in putwc_unlocked getwc_unlocked
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
- DCFG_HAVE_UNLOCKED_WIDE_STDIO=0
-fi
-done
-
-
-
-ac_fn_c_check_func "$LINENO" "strtold" "ac_cv_func_strtold"
-if test "x$ac_cv_func_strtold" = xyes; then :
- DCFG_STRTOLD="1"
-else
- DCFG_STRTOLD="0"
-fi
-
-
-
save_CFLAGS=$CFLAGS
-# Check for the glibc version of strerror_r
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc strerror_r" >&5
-$as_echo_n "checking for glibc strerror_r... " >&6; }
-CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-int
-main ()
-{
-
-char c = * strerror_r(0, NULL, 0);
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_GLIBC_STRERROR_R 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS=$save_CFLAGS
-
-for ac_func in strerror_r
-do :
- ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
-if test "x$ac_cv_func_strerror_r" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR_R 1
-_ACEOF
-
-fi
-done
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_gmtoff" >&5
$as_echo_n "checking for tm_gmtoff... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -5361,12 +4985,12 @@ _ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- DCFG_ARM_EABI_UNWINDER=0
+ DCFG_ARM_EABI_UNWINDER=""
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/unwind_generic.o"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- DCFG_ARM_EABI_UNWINDER=1
+ DCFG_ARM_EABI_UNWINDER="GNU_ARM_EABI_Unwinder"
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/unwind_arm.o"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
@@ -5408,46 +5032,35 @@ case "$d_target_os" in
freebsd*|k*bsd*-gnu)
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(FREEBSD_OBJS)"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
linux*) #D_EXTRA_OBJS="$D_EXTRA_OBJS std/c/linux/linux.o"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(LINUX_OBJS)"
d_sem_impl="posix"
;;
cygwin*) DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
mingw*) #DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_STDC_OBJS)"
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_WINDOWS_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(WINDOWS_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(OS_OBJS)"
- #DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ #DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
DCFG_UNIX=Windows
;;
skyos*) d_sem_impl="skyos"
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
-
-$as_echo "#define PTHREAD_MUTEX_ALREADY_RECURSIVE 1" >>confdefs.h
-
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
*) if test "$enable_unix" != "yes"; then
DCFG_UNIX=NoSystem
-
-$as_echo "#define PHOBOS_NO_SYSTEM 1" >>confdefs.h
-
fi
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
esac
-# = D_EXTRA_OBJS="$D_EXTRA_OBJS \$(WINDOWS_OBJS)"
-# for cygw: WINDOWS_DFLAGS=-mno-cygwin
-#
-# in Make: .win.o maybe... to get a separate rule
-
if test -n "$d_module_mach"; then
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_OSX_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(OSX_OBJS)"
@@ -5719,11 +5332,8 @@ fi
-D_EXTRA_OBJS="std/c/unix/unix.o $D_EXTRA_OBJS"
-DRUNTIME_OBJS="gcc/config/unix.o $DRUNTIME_OBJS"
# Add "linux" module for compatibility even if not Linux
D_EXTRA_OBJS="std/c/linux/linux.o $D_EXTRA_OBJS"
-D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_unix_d_src)'
DCFG_UNIX="Unix"
DCFG_POSIX="Posix"
@@ -5978,7 +5588,7 @@ ac_config_files="$ac_config_files libdruntime/Makefile"
#TODO: Should be possible to get rid of libdruntime/phobos-ver-syms
-ac_config_files="$ac_config_files Makefile phobos-ver-syms libdruntime/phobos-ver-syms libdruntime/frag-ac"
+ac_config_files="$ac_config_files Makefile phobos-ver-syms libdruntime/phobos-ver-syms"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -6708,7 +6318,6 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"phobos-ver-syms") CONFIG_FILES="$CONFIG_FILES phobos-ver-syms" ;;
"libdruntime/phobos-ver-syms") CONFIG_FILES="$CONFIG_FILES libdruntime/phobos-ver-syms" ;;
- "libdruntime/frag-ac") CONFIG_FILES="$CONFIG_FILES libdruntime/frag-ac" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
View
158 libphobos/configure.in
@@ -107,8 +107,6 @@ else
fi
AC_PROG_INSTALL
AC_PROG_MAKE_SET
-dnl GNU_SOURCE needed for fpclassify on Linux
-AC_GNU_SOURCE
dnl AC_PROG_LIBTOOL
AC_ARG_ENABLE(thread-lib,
@@ -262,74 +260,27 @@ AC_SUBST(phobos_toolexeclibdir)
dnl Checks for header files.
# Sanity check for the cross-compilation case:
AC_CHECK_HEADER(stdio.h,:,
- [AC_MSG_ERROR([can't find stdio.h.])])
+ [AC_MSG_ERROR([cannot find stdio.h.])])
dnl AC_HEADER_STDC
# TODO...
-dnl There was some target on sizeof(FILE) didn't work.
-dnl Also, anything less than 4 bytes is probably a lie.
-AC_MSG_CHECKING([for sizeof(FILE)])
-AC_TRY_COMPILE([#include <stdio.h>],[
-struct Test { int x: sizeof(FILE)>4; };],
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SIZEOF_FILE,1,[Define to 1 if it is possible to determine the size of the FILE struct])],
- [AC_MSG_RESULT([no])])
-
-AC_MSG_CHECKING([for sizeof(DIR)])
-AC_TRY_COMPILE([#include <dirent.h>],[
-struct Test { int x: sizeof(DIR)>4; };],
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_SIZEOF_DIR,1,[Define to 1 if it is possible to determine the size of the DIR struct])],
- [AC_MSG_RESULT([no])])
-
D_EXTRA_OBJS=
AC_SUBST(D_EXTRA_OBJS)
DRUNTIME_OBJS=
AC_SUBST(DRUNTIME_OBJS)
-D_PREREQ_SRCS='$(config_d_src) $(config_errno_d_src) $(config_libc_d_src) $(config_mathfuncs_d_src)'
+D_PREREQ_SRCS='$(config_d_src)'
AC_SUBST(D_PREREQ_SRCS)
-case "$target_cpu" in
- i*86|powerpc*|ppc*|x86_64 ) d_use_ieee_fpsb=1 ;;
- *) d_use_ieee_fpsb=0 ;;
-esac
-
-if test $d_use_ieee_fpsb -gt 0; then
- DRUNTIME_OBJS="$DRUNTIME_OBJS rt/fpmath.o"
-fi
-
-DCFG_USE_IEEE_FPSB=$d_use_ieee_fpsb
-AC_SUBST(DCFG_USE_IEEE_FPSB)
-
if test "$with_newlib" = yes; then
# TODO: newlib has trunc and exp2, but not log2 -- so configure all separately
DCFG_TRUNC=""
- DCFG_NEARBYINT=""
DCFG_ROUND=""
- DCFG_TGAMMA=""
- DCFG_NAN=""
DCFG_EXP2="GNU_Need_exp2"
DCFG_LOG2="GNU_Need_log2"
- AC_DEFINE(HAVE_FP_CLASSIFY_SIGNBIT,1,[Define to 1 fpclassify and signbit are available])
- DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_math.o"
- D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_fpcls_d_src)'
-
# TODO: exec stuff
-
- DCFG_FWIDE=0
- # Have getdelim, but it may not be unix (need ssize_t)... TODO
- DCFG_HAVE_GETDELIM=0
- DCFG_HAVE_FGETLN=0
- DCFG_HAVE_FGETLINE=0
- DCFG_HAVE_UNLOCKED_STDIO=0
- DCFG_HAVE_UNLOCKED_WIDE_STDIO=$DCFG_HAVE_UNLOCKED_STDIO
- DCFG_STRTOLD="0"
- # NO HAVE_TM_GMTOFF_AND_ZONE
- # NO HAVE_TIMEZONE
- AC_DEFINE(HAVE__TIMEZONE,1,[Another global timezone variable])
else
AC_CHECK_LIB(m,cos)
@@ -357,98 +308,16 @@ esac
AC_CHECK_FUNC(trunc,DCFG_TRUNC="",DCFG_TRUNC="GNU_Need_trunc")
AC_SUBST(DCFG_TRUNC)
-AC_CHECK_FUNC(nearbyint,DCFG_NEARBYINT="",DCFG_NEARBYINT="GNU_Need_nearbyint")
-AC_SUBST(DCFG_NEARBYINT)
-
AC_CHECK_FUNC(round,DCFG_ROUND="",DCFG_ROUND="GNU_Need_round")
AC_SUBST(DCFG_ROUND)
-AC_CHECK_FUNC(tgamma,DCFG_TGAMMA="",DCFG_TGAMMA="GNU_Need_tgamma")
-AC_SUBST(DCFG_TGAMMA)
-
-AC_CHECK_FUNC(nan,DCFG_NAN="",DCFG_NAN="GNU_Need_nan")
-AC_SUBST(DCFG_NAN)
-
AC_CHECK_FUNC(exp2, DCFG_EXP2="", DCFG_EXP2="GNU_Need_exp2")
AC_SUBST(DCFG_EXP2)
AC_CHECK_FUNC(log2, DCFG_LOG2="", DCFG_LOG2="GNU_Need_log2")
AC_SUBST(DCFG_LOG2)
-AC_MSG_CHECKING([for fpclassify and signbit])
-AC_TRY_COMPILE([
- #ifndef fpclassify
- static void fpclassify(int x, int y) { }
- #endif
- #ifndef signbit
- static void signbit(int x, int y) { }
- #endif
- #include <math.h>],
- [int x = fpclassify(4.2);
- int y = signbit(1.1);
- int z = FP_NAN + FP_INFINITE + FP_ZERO + FP_SUBNORMAL + FP_NORMAL;],
- [AC_MSG_RESULT([yes])
- d_have_fpsb=1],
- [AC_MSG_RESULT([no])])
-
-# Currently can only have either internal/fpmath or gcc/cbridge_math
-if test $d_use_ieee_fpsb -eq 0; then
- if test -n "$d_have_fpsb"; then
- AC_DEFINE(HAVE_FP_CLASSIFY_SIGNBIT,1,[Define to 1 fpclassify and signbit are available])
- DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_math.o"
- D_PREREQ_SRCS="$D_PREREQ_SRCS "'$(config_fpcls_d_src)'
- fi
-fi
-
-# no expm1 on mingw (msvcrt)
-# AC_CHECK_FUNCS(expm1,DCFG_EXPM1="",DCFG_EXPM1="GNU_Need_expm1")
-# AC_SUBST(DCFG_EXPM1)
-# also erf, erfc
-
-AC_CHECK_FUNC(execvpe,DCFG_EXECVPE="",DCFG_EXECVPE="GNU_Need_execvpe")
-AC_SUBST(DCFG_EXECVPE)
-
-AC_CHECK_FUNC(spawnvp,DCFG_SPAWNVP="",DCFG_SPAWNVP="GNU_Need_spawnvp")
-AC_SUBST(DCFG_SPAWNVP)
-
-AC_CHECK_FUNC(fwide,[DCFG_FWIDE=1],[DCFG_FWIDE=0])
-AC_SUBST(DCFG_FWIDE)
-
-AC_CHECK_FUNC(getdelim,[DCFG_HAVE_GETDELIM=1],[DCFG_HAVE_GETDELIM=0])
-AC_SUBST(DCFG_HAVE_GETDELIM)
-
-AC_CHECK_FUNC(fgetln,[DCFG_HAVE_FGETLN=1],[DCFG_HAVE_FGETLN=0])
-AC_SUBST(DCFG_HAVE_FGETLN)
-
-AC_CHECK_FUNC(fgetline,[DCFG_HAVE_FGETLINE=1],[DCFG_HAVE_FGETLINE=0])
-AC_SUBST(DCFG_HAVE_FGETLINE)
-
-DCFG_HAVE_UNLOCKED_STDIO=1
-AC_CHECK_FUNCS([flockfile funlockfile putc_unlocked getc_unlocked],
- [],[DCFG_HAVE_UNLOCKED_STDIO=0])
-AC_SUBST(DCFG_HAVE_UNLOCKED_STDIO)
-
-DCFG_HAVE_UNLOCKED_WIDE_STDIO=$DCFG_HAVE_UNLOCKED_STDIO
-AC_CHECK_FUNCS([putwc_unlocked getwc_unlocked], [],[DCFG_HAVE_UNLOCKED_WIDE_STDIO=0])
-AC_SUBST(DCFG_HAVE_UNLOCKED_WIDE_STDIO)
-
-AC_CHECK_FUNC(strtold,DCFG_STRTOLD="1",DCFG_STRTOLD="0")
-AC_SUBST(DCFG_STRTOLD)
-
save_CFLAGS=$CFLAGS
-# Check for the glibc version of strerror_r
-AC_MSG_CHECKING([for glibc strerror_r])
-CFLAGS="$CFLAGS -D_GNU_SOURCE=1"
-AC_TRY_COMPILE([#include <string.h>],[
-char c = * strerror_r(0, NULL, 0);
-],
- [AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_GLIBC_STRERROR_R,1,[Have glibc strerror_r])],
- [AC_MSG_RESULT([no])])
-CFLAGS=$save_CFLAGS
-
-AC_CHECK_FUNCS([strerror_r],[],[])
-
dnl Check for BSD(?) specific fields in struct tm
dnl Maybe test fields separately
AC_MSG_CHECKING([for tm_gmtoff])
@@ -489,10 +358,10 @@ AC_TRY_COMPILE([#include <unwind.h>],[
#endif
],
[AC_MSG_RESULT([no])
- DCFG_ARM_EABI_UNWINDER=0
+ DCFG_ARM_EABI_UNWINDER=""
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/unwind_generic.o"],
[AC_MSG_RESULT([yes])
- DCFG_ARM_EABI_UNWINDER=1
+ DCFG_ARM_EABI_UNWINDER="GNU_ARM_EABI_Unwinder"
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/unwind_arm.o"])
AC_SUBST(DCFG_ARM_EABI_UNWINDER)
@@ -529,42 +398,35 @@ case "$d_target_os" in
freebsd*|k*bsd*-gnu)
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(FREEBSD_OBJS)"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
linux*) #D_EXTRA_OBJS="$D_EXTRA_OBJS std/c/linux/linux.o"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(LINUX_OBJS)"
d_sem_impl="posix"
;;
cygwin*) DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
mingw*) #DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_STDC_OBJS)"
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_WINDOWS_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(WINDOWS_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(OS_OBJS)"
- #DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ #DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
DCFG_UNIX=Windows
;;
skyos*) d_sem_impl="skyos"
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
- AC_DEFINE(PTHREAD_MUTEX_ALREADY_RECURSIVE,1,[Define if mutexes are recursive by default])
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
*) if test "$enable_unix" != "yes"; then
DCFG_UNIX=NoSystem
- AC_DEFINE(PHOBOS_NO_SYSTEM,1,[Define if there is no file system, synchronization services, etc.])
fi
DRUNTIME_OBJS="$DRUNTIME_OBJS gcc/cbridge_stdio.o"
- DCFG_CBRIDGE_STDIO=GNU_CBridge_Stdio
+ DCFG_CBRIDGE_STDIO="GNU_CBridge_Stdio"
;;
esac
-# = D_EXTRA_OBJS="$D_EXTRA_OBJS \$(WINDOWS_OBJS)"
-# for cygw: WINDOWS_DFLAGS=-mno-cygwin
-#
-# in Make: .win.o maybe... to get a separate rule
-
if test -n "$d_module_mach"; then
DRUNTIME_OBJS="$DRUNTIME_OBJS \$(RT_OSX_OBJS)"
D_EXTRA_OBJS="$D_EXTRA_OBJS \$(OSX_OBJS)"
@@ -673,4 +535,4 @@ _EOF
])
#TODO: Should be possible to get rid of libdruntime/phobos-ver-syms
-AC_OUTPUT([Makefile phobos-ver-syms libdruntime/phobos-ver-syms libdruntime/frag-ac])
+AC_OUTPUT([Makefile phobos-ver-syms libdruntime/phobos-ver-syms])
View
55 libphobos/libdruntime/Makefile.am
@@ -48,51 +48,6 @@ $(IMPORT)/%.di: %.d $(D_PREREQ_SRCS) $(IMPORT)
.S.o:
$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
-#--------------------------------------#
-# X3 Config
-
-config_d_src =$(host_alias)/gcc/config/config.d
-config_libc_d_src =$(host_alias)/gcc/config/libc.d
-config_errno_d_src =$(host_alias)/gcc/config/errno.d
-config_fpcls_d_src =$(host_alias)/gcc/config/fpcls.d
-config_unix_d_src =$(host_alias)/gcc/config/unix.d
-
-X3=CC_FOR_BUILD="$(CC_FOR_BUILD) -I $(srcdir)/config" BUILD_LIBIBERTY=$(BUILD_LIBIBERTY) $(srcdir)/config/x3
-X3_GCC_COMMAND=$(CC) $(OUR_CFLAGS) $(MULTIFLAGS)
-X3_DEPS=config/x3.o config/x3main.o
-
-config/x3.o: config/x3.c config/x3.h
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -g -Wall -I $(LIBIBERTY_H_PATH) -c -o $@ $<
-
-config/x3main.o: config/x3main.c config/x3.h
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -g -Wall -c -o $@ $<
-
-$(config_d_src): frag-ac stamp-tgtdir
- cp $< $@
-
-$(config_libc_d_src): config/libc.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_errno_d_src): config/errno.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_fpcls_d_src): config/fpcls.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_unix_d_src): config/unix.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-# because these are in the $(host_alias) subdir, pattern match rules will not work
-gcc/config/unix.o: $(config_unix_d_src) $(config_d_src) $(config_libc_d_src)
- $(GDC) -o $@ $(ALL_DFLAGS) -c $<
-
-# This has to be an empty file because it is included in the prerequisites of rules
-# that use "cat $^" to generate their targets.
-stamp-tgtdir:
- mkdir -p gcc/config
- mkdir -p $(host_alias)/gcc/config
- touch $@
-
#--------------------------------------#
# GDC Runtime
@@ -115,9 +70,7 @@ CORE_OBJS=core/atomic.o core/cpuid.o core/demangle.o core/exception.o \
core/sync/condition.o core/sync/config.o core/sync/exception.o \
core/sync/mutex.o core/sync/rwmutex.o core/sync/semaphore.o
-GCC_OBJS=gcc/unwind_pe.o gcc/deh.o gcc/threadsem.o \
- gcc/builtins.o gcc/support.o gcc/cbridge_time.o \
- gcc/cbridge_strerror.o gcc/atomics.o
+GCC_OBJS=gcc/atomics.o gcc/builtins.o gcc/deh.o gcc/unwind_pe.o
UTIL_OBJS=rt/util/console.o rt/util/hash.o rt/util/string.o \
rt/util/utf.o
@@ -245,10 +198,6 @@ install-data-local: $(D_PREREQ_SRCS) libgdruntime.a
for i in object.di; do \
$(INSTALL_HEADER) $(srcdir)/$$i $(DESTDIR)$(gdc_include_dir); \
done
- $(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/gcc/config
- for i in $(host_alias)/gcc/config/*.d; do \
- $(INSTALL_HEADER) $$i $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/gcc/config; \
- done
$(INSTALL) phobos-ver-syms $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)
clean-local:
@@ -257,8 +206,6 @@ clean-local:
rm -f $(CORE_IMPORTS)
rm -rf $(IMPORT)
rm -f testgc$(EXEEXT)
- rm -f $(config_d_src) $(config_errno_d_src) $(config_libc_d_src)
- rm -f $(config_unix_d_src)
rm -f libgdruntime.a
View
73 libphobos/libdruntime/Makefile.in
@@ -54,15 +54,15 @@ host_triplet = @host@
target_triplet = @target@
subdir = libdruntime
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/frag-ac.in $(srcdir)/phobos-ver-syms.in
+ $(srcdir)/phobos-ver-syms.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES = phobos-ver-syms frag-ac
+CONFIG_CLEAN_FILES = phobos-ver-syms
depcomp =
am__depfiles_maybe =
SOURCES =
@@ -88,29 +88,16 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DCFG_ARM_EABI_UNWINDER = @DCFG_ARM_EABI_UNWINDER@
DCFG_CBRIDGE_STDIO = @DCFG_CBRIDGE_STDIO@
-DCFG_EXECVPE = @DCFG_EXECVPE@
DCFG_EXP2 = @DCFG_EXP2@
-DCFG_FWIDE = @DCFG_FWIDE@
DCFG_GETPWNAM_R = @DCFG_GETPWNAM_R@
-DCFG_HAVE_FGETLINE = @DCFG_HAVE_FGETLINE@
-DCFG_HAVE_FGETLN = @DCFG_HAVE_FGETLN@
-DCFG_HAVE_GETDELIM = @DCFG_HAVE_GETDELIM@
-DCFG_HAVE_UNLOCKED_STDIO = @DCFG_HAVE_UNLOCKED_STDIO@
-DCFG_HAVE_UNLOCKED_WIDE_STDIO = @DCFG_HAVE_UNLOCKED_WIDE_STDIO@
DCFG_LOG2 = @DCFG_LOG2@
DCFG_MMAP = @DCFG_MMAP@
-DCFG_NAN = @DCFG_NAN@
-DCFG_NEARBYINT = @DCFG_NEARBYINT@
DCFG_POSIX = @DCFG_POSIX@
DCFG_PTHREAD_SUSPEND = @DCFG_PTHREAD_SUSPEND@
DCFG_ROUND = @DCFG_ROUND@
DCFG_SEMAPHORE_IMPL = @DCFG_SEMAPHORE_IMPL@
-DCFG_SPAWNVP = @DCFG_SPAWNVP@
-DCFG_STRTOLD = @DCFG_STRTOLD@
-DCFG_TGAMMA = @DCFG_TGAMMA@
DCFG_TRUNC = @DCFG_TRUNC@
DCFG_UNIX = @DCFG_UNIX@
-DCFG_USE_IEEE_FPSB = @DCFG_USE_IEEE_FPSB@
DEFS = @DEFS@
DFLAGS = @DFLAGS@
DRUNTIME_OBJS = @DRUNTIME_OBJS@ $(BASE_OBJS) $(RUNTIME_OBJS) \
@@ -208,17 +195,6 @@ toolexecdir = $(phobos_toolexecdir)
toolexeclibdir = $(phobos_toolexeclibdir)
SUFFIXES = .d
IMPORT = import
-
-#--------------------------------------#
-# X3 Config
-config_d_src = $(host_alias)/gcc/config/config.d
-config_libc_d_src = $(host_alias)/gcc/config/libc.d
-config_errno_d_src = $(host_alias)/gcc/config/errno.d
-config_fpcls_d_src = $(host_alias)/gcc/config/fpcls.d
-config_unix_d_src = $(host_alias)/gcc/config/unix.d
-X3 = CC_FOR_BUILD="$(CC_FOR_BUILD) -I $(srcdir)/config" BUILD_LIBIBERTY=$(BUILD_LIBIBERTY) $(srcdir)/config/x3
-X3_GCC_COMMAND = $(CC) $(OUR_CFLAGS) $(MULTIFLAGS)
-X3_DEPS = config/x3.o config/x3main.o
BASE_OBJS = object_.o
RUNTIME_OBJS = rt/aaA.o rt/aApply.o rt/aApplyR.o rt/adi.o rt/arrayassign.o \
rt/arraybyte.o rt/arraycast.o rt/arraycat.o rt/arraydouble.o \
@@ -233,10 +209,7 @@ CORE_OBJS = core/atomic.o core/cpuid.o core/demangle.o core/exception.o \
core/sync/condition.o core/sync/config.o core/sync/exception.o \
core/sync/mutex.o core/sync/rwmutex.o core/sync/semaphore.o
-GCC_OBJS = gcc/unwind_pe.o gcc/deh.o gcc/threadsem.o \
- gcc/builtins.o gcc/support.o gcc/cbridge_time.o \
- gcc/cbridge_strerror.o gcc/atomics.o
-
+GCC_OBJS = gcc/atomics.o gcc/builtins.o gcc/deh.o gcc/unwind_pe.o
UTIL_OBJS = rt/util/console.o rt/util/hash.o rt/util/string.o \
rt/util/utf.o
@@ -400,8 +373,6 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
phobos-ver-syms: $(top_builddir)/config.status $(srcdir)/phobos-ver-syms.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-frag-ac: $(top_builddir)/config.status $(srcdir)/frag-ac.in
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
uninstall-info-am:
tags: TAGS
TAGS:
@@ -540,38 +511,6 @@ $(IMPORT)/%.di: %.d $(D_PREREQ_SRCS) $(IMPORT)
.S.o:
$(CC) -o $@ $(OUR_CFLAGS) $(CFLAGS) -c $<
-config/x3.o: config/x3.c config/x3.h
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -g -Wall -I $(LIBIBERTY_H_PATH) -c -o $@ $<
-
-config/x3main.o: config/x3main.c config/x3.h
- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -g -Wall -c -o $@ $<
-
-$(config_d_src): frag-ac stamp-tgtdir
- cp $< $@
-
-$(config_libc_d_src): config/libc.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_errno_d_src): config/errno.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_fpcls_d_src): config/fpcls.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-$(config_unix_d_src): config/unix.x3 $(X3_DEPS) stamp-tgtdir
- $(X3) $< -o $@ $(X3_GCC_COMMAND)
-
-# because these are in the $(host_alias) subdir, pattern match rules will not work
-gcc/config/unix.o: $(config_unix_d_src) $(config_d_src) $(config_libc_d_src)
- $(GDC) -o $@ $(ALL_DFLAGS) -c $<
-
-# This has to be an empty file because it is included in the prerequisites of rules
-# that use "cat $^" to generate their targets.
-stamp-tgtdir:
- mkdir -p gcc/config
- mkdir -p $(host_alias)/gcc/config
- touch $@
-
#--------------------------------------#
# GDC Runtime
@@ -614,10 +553,6 @@ install-data-local: $(D_PREREQ_SRCS) libgdruntime.a
for i in object.di; do \
$(INSTALL_HEADER) $(srcdir)/$$i $(DESTDIR)$(gdc_include_dir); \
done
- $(mkinstalldirs) $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/gcc/config
- for i in $(host_alias)/gcc/config/*.d; do \
- $(INSTALL_HEADER) $$i $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)/gcc/config; \
- done
$(INSTALL) phobos-ver-syms $(DESTDIR)$(gdc_include_dir)/$(host_alias)/$(MULTISUBDIR)
clean-local:
@@ -626,8 +561,6 @@ clean-local:
rm -f $(CORE_IMPORTS)
rm -rf $(IMPORT)
rm -f testgc$(EXEEXT)
- rm -f $(config_d_src) $(config_errno_d_src) $(config_libc_d_src)
- rm -f $(config_unix_d_src)
rm -f libgdruntime.a
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
View
7 libphobos/libdruntime/config/errno.x3
@@ -1,7 +0,0 @@
-// this is not really unix, is it?
-x3_out_text(""
- "module gcc.config.errno;\n");
-
-x3_gi_push_header("<errno.h>");
-x3_out_enum(NULL, NULL, "^E[^_].*", NULL);
-x3_gi_pop_header();
View
7 libphobos/libdruntime/config/fpcls.x3
@@ -1,7 +0,0 @@
-x3_out_text(""
- "module gcc.config.fpcls;\n");
-
-x3_gi_push_header("\"config.h\"");
-x3_gi_push_header("<math.h>");
-x3_out_enum(NULL, NULL, "^FP_[^_].*", "-^FP_ILOG.*", NULL);
-x3_gi_pop_header();
View
47 libphobos/libdruntime/config/libc.x3
@@ -1,47 +0,0 @@
-x3_out_text(""
- "module gcc.config.libc;\n"
- "private import gcc.builtins;\n"
- "\n"
- "//alias __builtin_clong clong_t;\n"
- "//alias __builtin_culong culong_t;\n");
-
-x3_gi_push_header("\"config.h\"");
-x3_gi_push_header("<sys/types.h>");
-x3_out_int_type("off_t");
-
-
-x3_gi_push_header("<stddef.h>");
-x3_out_char_type("wchar_t");
-x3_gi_pop_header();
-
-x3_gi_push_header("<time.h>");
-//x3_gi_push_header("<sys/time.h>");//?
-x3_out_int_type("time_t");
-x3_out_int_type("clock_t");
-x3_out_int_value_ex("CLOCKS_PER_SEC", NULL, "unsigned int", "uint", 0, NULL);
-x3_out_struct("struct tm", NULL, "i:tm_sec", "i:tm_min", "i:tm_hour",
- "i:tm_mday", "i:tm_mon", "i:tm_year", "i:tm_wday", "i:tm_yday",
- "i:tm_isdst", "oi:tm_gmtoff", "otchar *;:tm_zone", NULL);
-x3_gi_pop_header();
-
-x3_gi_push_header("<stdlib.h>");
-x3_out_int_value("RAND_MAX");
-x3_gi_pop_header();
-
-x3_gi_push_header("<stdio.h>");
-x3_gi_push_header("<limits.h>");
-x3_out_int_value("EOF");
-x3_out_int_value("FILENAME_MAX"); // find the deps.. aare these really needed?
-x3_out_int_value("TMP_MAX");
-x3_push_optional(1);
-x3_out_int_value("FOPEN_MAX");
-x3_out_int_value("L_tmpnam");
-x3_out_int_value("BUFSIZ");
-x3_pop_optional(1);
-
-// want to get rid of this...
-x3_out_int_value_ex("FILE_struct_size", "sizeof(FILE)", "size_t", NULL, 0, "0");
-
-x3_out_type("fpos_t");
-
-x3_gi_pop_headers(2);
View
313 libphobos/libdruntime/config/unix.x3
@@ -1,313 +0,0 @@
-x3_out_text(""
- "module gcc.config.unix;\n"
- "private import gcc.config.config;\n");
-
-x3_gi_push_header("\"config.h\"");
-x3_gi_push_header("<sys/types.h>"); // pretty much need this..
-
-int pop_count = 0;
-X3_Int dummy_int;
-X3_Type dummy_type;
-
-
-x3_gi_push_header("<dirent.h>");
-x3_gi_push_header("<sys/types.h>");
-x3_out_struct("struct dirent", NULL, "c:d_name", "o:d_type", NULL);
-x3_out_type_ex("DIR", NULL, "void");
-
-x3_push_optional(1);
-x3_out_enum(NULL, NULL, "^DT_[^_].*", NULL);
-x3_pop_optional();
-
-x3_gi_pop_headers(2);
-
-x3_gi_push_header("<unistd.h>");
-
-x3_gi_push_header("<limits.h>");
-x3_out_int_value("PATH_MAX");
-x3_gi_pop_header();
-
-x3_gi_push_header("<sys/types.h>");
-{
- if (! x3_query_int_value("NFDBITS", "int", & dummy_int, & dummy_type)) {
- /* for AIX */
- ++pop_count;
- x3_gi_push_header("<sys/select.h>");
- }
- x3_out_int_value("NFDBITS");
- x3_out_int_value("FD_SETSIZE");
-
- //x3_out_int_value_ex("__FD_SET_SIZEOF", "sizeof(fd_set)", "int", "int", 0);
- x3_out_type("fd_set");
- x3_out_int_type("mode_t");
- x3_out_int_type("pid_t");
- x3_out_int_type("uid_t");
- x3_out_int_type("gid_t");
- x3_out_int_type("off_t");
- x3_out_int_type("ssize_t");
-}
-x3_gi_pop_headers(pop_count);
-
-x3_gi_push_header("<fcntl.h>");
-x3_out_enum(NULL, NULL, "^O_[^_].*", NULL);
-x3_out_enum(NULL, NULL, "^F_[^_].*", "-^F_OK$", NULL);
-x3_out_enum(NULL, NULL, "^[FWRX]_OK$", NULL);
-x3_gi_pop_header();
-
-{
- x3_gi_push_header("<time.h>");
-
- pop_count = 0;
- x3_gi_push_header("<sys/time.h>");
- if (x3_compile_test())
- ++pop_count;
- else
- x3_gi_pop_header();
-
- x3_gi_push_header("<sys/time.h>");
-
- x3_out_struct("struct timespec", NULL, "i:tv_sec", "i:tv_nsec", NULL);
- x3_out_struct("struct timeval", NULL, "i:tv_sec", "i:tv_usec", NULL);
- x3_out_struct("struct timezone", "struct_timezone", "i:tz_minuteswest", "i:tz_dsttime", NULL);
- x3_out_type_ex("clockid_t",NULL, "int");
-
- x3_gi_pop_headers(pop_count); // sys/time.h
- x3_gi_pop_header();
-}
-
-x3_gi_push_header("<utime.h>");
-x3_out_struct("struct utimbuf", NULL, "i:actime", "i:modtime", NULL);
-x3_gi_pop_header();
-
-x3_gi_push_header("<sys/stat.h>");
-x3_out_enum(NULL, NULL, "^S_I.*", NULL);
-x3_out_struct("struct stat", "struct_stat", "i:st_dev", "i:st_ino",
- "i:st_mode", "i:st_nlink", "i:st_uid", "i:st_gid", "i:st_rdev",
- "i:st_size", "i:st_blksize", "i:st_blocks", "i:st_atime", "i:st_mtime",
- "i:st_ctime", NULL);
-x3_gi_pop_header();
-
-x3_gi_push_header("<signal.h>");
-x3_out_enum(NULL, NULL, "^SIG[^_].*", "-^SIGRT.*", NULL);
-x3_out_enum(NULL, NULL, "^SA_[^_].*", NULL);
-x3_out_type("sigset_t");
-x3_out_text("alias extern(C) void function(int) __sighandler_t;\n");
-{
- static const char * nm[3] = {"SIG_DFL","SIG_IGN","SIG_ERR"};
- int i;
- for (i = 0; i < 3; i++) {
- x3_out_int_value_ex(nm[i], nm[i], "void *", "__sighandler_t", 1, NULL);
- }
-}
-
-x3_out_struct_ex("siginfo_t", NULL, 1, "i:si_signo", "i:si_errno", "i:si_code", NULL);
-
-{
- X3_Struct * s = x3_struct_new_c_name("struct sigaction");
- X3_Field * f;
-
- s->struct_type.out_name = "sigaction_t";
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sa_handler";
- f->field_type.kind = X3_TYPE_KIND_NAME;
- f->field_type.out_name = "extern(C) void function(int)";
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sa_sigaction";
- f->field_type.kind = X3_TYPE_KIND_NAME;
- f->field_type.out_name = "extern(C) void function(int, siginfo_t *, void *)";
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sa_mask";
- f->field_type.kind = X3_TYPE_KIND_NAME;
- f->field_type.out_name = "sigset_t";
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sa_flags";
- f->flags |= X3_FLAG_INT_TYPE;
-
- x3_struct_finish(s);
- x3_struct_out(s);
-}
-x3_gi_pop_header();
-
-//if (x3_query_cpp_if("HAVE_SYS_MMAN"))// why bother?
-x3_gi_push_header("<sys/mman.h>");
-if (x3_compile_test()) {
- // need a new fuc for expl cast... MAP_FAILED
- //x3_gi_push_optional(1);//? instead of optoelvl?
- x3_out_int_value_ex("MAP_FAILED", NULL, "void *", NULL, 1, NULL);
- x3_out_enum(NULL, NULL, "^PROT_[^_].*", NULL);
- x3_out_enum(NULL, NULL, "^MAP_[^_].*", "-^MAP_FAILED$", NULL);
- if (! x3_query_int_value("MAP_ANONYMOUS", "int", & dummy_int, & dummy_type))
- x3_out_int_value_ex("MAP_ANONYMOUS", "MAP_ANON", "int", "int", 0, NULL);
- if (! x3_query_int_value("MAP_ANON", "int", & dummy_int, & dummy_type))
- x3_out_int_value_ex("MAP_ANON", "MAP_ANONYMOUS", "int", "int", 0, NULL);
-
- x3_push_optional(1);
- x3_out_enum(NULL, NULL, "^MS_[^_].*", NULL);
- x3_out_enum(NULL, NULL, "^MCL_[^_].*", NULL);
- x3_out_enum(NULL, NULL, "^MREMAP_[^_].*", NULL);
- x3_out_enum(NULL, NULL, "^MADV_[^_].*", NULL);
- x3_out_enum(NULL, NULL, "^MINCORE_[^_].*", NULL);
- x3_pop_optional();
-
-}
-x3_gi_pop_header();
-
-x3_gi_push_header("<semaphore.h>");
-if (x3_compile_test())
- x3_out_type("sem_t");
-x3_gi_pop_header();
-
-x3_gi_push_header("<pthread.h>");
-if (x3_compile_test())
-{
- x3_out_type("pthread_t");
- x3_out_type("pthread_attr_t");
- x3_out_type("pthread_cond_t");
- x3_out_type("pthread_condattr_t");
- x3_out_type("pthread_mutex_t");
- x3_out_type("pthread_mutexattr_t");
- // other fields?
- x3_out_struct("struct sched_param", NULL, "i:sched_priority", NULL);
- //x3_push_optional(1);
- x3_out_type_ex("pthread_barrier_t", NULL, X3_STRUCT_FALLBACK);
- x3_out_type_ex("pthread_barrierattr_t", NULL, X3_STRUCT_FALLBACK);
- x3_out_type_ex("pthread_rwlock_t", NULL, X3_STRUCT_FALLBACK);
- x3_out_type_ex("pthread_rwlockattr_t", NULL, X3_STRUCT_FALLBACK);
- x3_out_type_ex("pthread_spinlock_t", NULL, X3_STRUCT_FALLBACK);
- //x3_pop_optional();
- x3_out_enum(NULL, NULL, "^PTHREAD_CANCEL_.*", NULL);
-
-}
-x3_gi_pop_header();
-
-x3_gi_push_header("<sys/socket.h>");
-x3_gi_push_header("<netinet/in.h>");
-x3_gi_push_header("<netinet/tcp.h>");
-
-pop_count = 0;
-x3_gi_push_header("<netinet6/in6.h>");
-if (x3_compile_test())
- pop_count = 1;
-else
- x3_gi_pop_header();
-
-x3_gi_push_header("<netdb.h>");
-
-x3_out_type_ex("socklen_t", NULL, "int"); // uint?
-x3_out_enum(NULL, NULL, "^SOL_[^_].*", NULL);
-x3_out_enum(NULL, NULL, "^SO_[^_].*", NULL);
-x3_out_enum(NULL, NULL, "^SOCK_[^_].*", NULL);
-x3_out_enum(NULL, NULL, "^MSG_[^_].*", NULL);
-x3_out_text("static if (!is(typeof(MSG_NOSIGNAL))) enum { MSG_NOSIGNAL = 0 } // for std/socket.d\n");
-x3_gi_push_default_enum("AF_UNSPEC", "AF_IPX", "AF_APPLETALK", "AF_INET6", NULL);
-x3_out_enum(NULL, NULL, "^AF_[^_].*", NULL);
-x3_gi_pop_items(1);
-x3_gi_push_default_enum("PF_UNSPEC", "PF_IPX", "PF_APPLETALK", "PF_INET6", NULL);
-x3_out_enum(NULL, NULL, "^PF_[^_].*", NULL);
-x3_gi_pop_items(1);
-x3_out_struct("struct linger", NULL, "i:l_onoff", "i:l_linger", NULL);
-
-x3_gi_push_default_enum("3", "IPPROTO_GGP", NULL);
-x3_gi_push_default_enum("-1", "IPPROTO_IPV6", NULL);
-x3_out_enum(NULL, NULL, "^IPPROTO_.*", NULL);
-x3_gi_pop_items(2);
-
-x3_gi_push_default_enum("0",
- "IPV6_UNICAST_HOPS", "IPV6_MULTICAST_IF", "IPV6_MULTICAST_HOPS",
- "IPV6_MULTICAST_LOOP", "IPV6_JOIN_GROUP", "IPV6_LEAVE_GROUP", NULL);
-x3_out_enum(NULL, NULL, "^IPV6_.*", NULL);
-x3_gi_pop_items(1);
-
-x3_out_enum(NULL, "uint", "^INADDR_.*", NULL);
-x3_out_text("enum { ADDR_ANY = INADDR_ANY }\n"); // why does Phobos need this?
-x3_out_enum(NULL, NULL, "^TCP_.*", NULL);
-// or push text ifndef...
-//x3_out_enum("f-1;:", NULL,
-
-x3_out_struct("struct in_addr", NULL, "i:s_addr", NULL);
-x3_out_struct("struct sockaddr", NULL, "oib:sa_len", "ib:sa_family", "ob:sa_data", NULL);
-
-{
- X3_Struct * s = x3_struct_new_c_name("struct sockaddr_in");
- X3_Field * f;
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sin_len";
- f->flags = X3_FLAG_OPTIONAL|X3_FLAG_INT_TYPE|X3_FLAG_USE_BYTE;
- f->init_expr = "sockaddr_in.sizeof";
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sin_family";
- f->flags = X3_FLAG_INT_TYPE|X3_FLAG_USE_BYTE;
- f->init_expr = "AF_INET";
-
- x3_struct_add_fields(s, "i:sin_port", "ob:sin_zero", NULL);
-
- f = x3_struct_new_field(s);
- f->c_name = f->out_name = "sin_addr";
- f->field_type.kind = X3_TYPE_KIND_NAME;
- f->field_type.out_name = "in_addr";
-
- x3_struct_finish(s);
- x3_struct_out(s);
-}
-
-
-x3_out_struct("struct protoent", NULL, "p_name", "p_aliases", "i:p_proto", NULL);
-x3_out_struct("struct servent", NULL, "s_name", "s_aliases", "i:s_port", "s_proto", NULL);
-{
- X3_Struct * s = x3_struct_new_c_name("struct hostent");
- x3_struct_add_fields(s, "h_name", "h_aliases", "h_addrtype", "h_length",
- "h_addr_list", NULL);
- x3_struct_add_extra(s, "\n"
- " char* h_addr()\n"
- " {\n"
- " return h_addr_list[0];\n"
- " }\n");
- x3_struct_out(s);
-}
-/*//not required for std/socket.d yet
-{
- FieldInfo fi[8];
- struct addrinfo rec;
- INT_FIELD(fi[0], ai_flags);
- INT_FIELD(fi[1], ai_family);
- INT_FIELD(fi[2], ai_socktype);
- INT_FIELD(fi[3], ai_protocol);
- INT_FIELD(fi[4], ai_addrlen);
- ADD_FIELD(fi[5], "sockaddr *", ai_addr);
- ADD_FIELD(fi[6], "char *", ai_canonname);
- ADD_FIELD(fi[7], "addrinfo *", ai_next);
- finish_struct(fi, 8, "addrinfo");
-}
-*/
-x3_out_text("struct addrinfo { }\n");
-
-x3_gi_pop_headers(4);
-x3_gi_pop_headers(pop_count);
-
-x3_gi_push_header("<pwd.h>");
-x3_out_struct("struct passwd", NULL, "pw_name", "pw_passwd", "i:pw_uid", "i:pw_gid",
- "pw_gecos", "pw_dir", "pw_shell",
- "o:pw_change", "o:pw_class", "o:pw_expire", NULL);
-x3_gi_pop_header();
-
-x3_gi_push_header("<termios.h>");
-
-x3_out_int_type("cc_t");
-x3_out_int_type("speed_t");
-x3_out_int_type("tcflag_t");
-
-x3_out_int_value("NCCS");
-
-x3_out_enum(NULL, NULL, "^TC[IOS].*", NULL);
-
-x3_out_struct("struct termios", NULL,
- "i:c_iflag", "i:c_oflag", "i:c_cflag", "i:c_lflag",
- "oc:c_line", "c:c_cc",
- "oi:c_ispeed", "oi:c_ospeed");
-x3_gi_pop_header();
View
26 libphobos/libdruntime/config/x3
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-base=`basename $1`
-src=$base.c
-exe=$base.exe
-
-echo '#include "x3.h"' > $src
-echo 'void x3_go() {' >> $src
-cat "$1" >> $src
-echo '}' >> $src
-
-shift
-
-if $CC_FOR_BUILD -g -o $exe $src config/x3.o config/x3main.o $BUILD_LIBIBERTY; then
- echo "** x3: running ./$exe" "$@"
- ./$exe -v -t tmp$base "$@"
- result=$?
-else
- result=1
-fi
-
-if test $result -eq 0; then
- rm -f $exe $src
-fi
-
-exit $result
View
1,834 libphobos/libdruntime/config/x3.c
@@ -1,1834 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-#include <libiberty.h>
-#include <errno.h>
-
-/* TODO: need to use autoconf to figure out which header to
- include for unlink -- but need to do it for the *build*
- system. Also, before linking disabled due to cross
- compilation... */
-
-extern int unlink(const char *fn);
-
-#include "x3.h"
-#include "xregex.h"
-
-#define x3_assert(cond) {if(cond){}else{x3_error("assert failed: %s:%d: %s", \
- __FILE__,__LINE__,#cond);exit(1);}}
-
-#define x3_new(T) ((T*)malloc(sizeof(T)))
-#define x3_new0(T) ((T*)calloc(1, sizeof(T)))
-
-#define diag(x) fprintf(stderr, x);
-
-static void _x3_write_d_int(FILE * f, X3_Int value, X3_Type *type);
-static void _x3_write_d_int_2(FILE * f, X3_Int value, unsigned size, int is_signed);
-
-char *
-x3f(const char * fmt, ...)
-{
- char * result = NULL;
- va_list va;
-
- va_start(va, fmt);
- vasprintf(& result, fmt, va);
-
- return result;
-}
-
-X3_Global * global;
-
-void
-x3_array_init(X3_Array *ma)
-{
- memset(ma, 0, sizeof(*ma));
-}
-
-void
-x3_array_fini(X3_Array *ma)
-{
- free(ma->data);
- memset(ma, 0, sizeof(*ma));
-}
-
-void
-x3_array_push(X3_Array *ma, void *data)
-{
- if (ma->length >= ma->alloc) {
- if (ma->alloc)
- ma->alloc *= 2;
- else
- ma->alloc = 4;
- ma->data = realloc(ma->data, sizeof(void*) * ma->alloc);
- }
- ma->data[ma->length++] = data;
-}
-
-void
-x3_array_pop(X3_Array *ma, X3_Size count)
-{
- if (count <= ma->length)
- ma->length -= count;
- else
- ma->length = 0;
-}
-
-void*
-x3_array_first(X3_Array *ma)
-{
- if (ma->length)
- return ma->data[0];
- else
- return NULL;
-}
-
-void*
-x3_array_last(X3_Array *ma)
-{
- if (ma->length)
- return ma->data[ma->length - 1];
- else
- return NULL;
-}
-
-X3_Result *
-x3_result_new()
-{
- X3_Result * r = x3_new(X3_Result);
- x3_result_init(r);
- return r;
-}
-