diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2002-03-22 22:43:15 +0000 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2002-03-22 22:43:15 +0000 |
commit | f3e35ca9e844a7ee961afacde6df9ddbfb47e428 (patch) | |
tree | 2bd9a8cba1f185d8b1f270833aa7cea0656815c5 | |
parent | baa82e431ee64b46445d75e05e5d8c0043ec07d0 (diff) | |
download | gdb-f3e35ca9e844a7ee961afacde6df9ddbfb47e428.tar.gz |
* configure.in: Add mingwex as SUBDIRS and configdirs.
* configure: Regenerate.
* Makefile.in (MINGW_OBJS): Remove dirent.o.
(SRC_DIST_FILES): Remove dirent.c.
* dirent.c: Remove.
* include/stdlib.h (_Exit): Add static inline
function.
(struct lldiv_t): Define.
(lldiv): Add prototype.
(llabs): Add extern inline function.
(strtoll,strtoull): Add prototypes.
(wcstol, wcstoul, wcstod): Group together.
(strtof, wcstof): Add extern inline definitions.
(atoll,lltoa,ulltoa, wtoll, lltow ulltow): Add prototypes
and extern inline definitions.
* include/wchar.h (fwide, wcstoll,wcstoull, wmemchr
wmemcmp, wmemcpy, wmemmove, wmemset. mbsinit): Add
prototypes.
(wcstol, wcstoul,wcstod): Copy prototypes from stdlib.h.
(wcstof): Add extern inline definition.
* include/math.h (nan, nanf): Add prototypes.
(NAN, INFINITE): Define constants.
(fpclassify, isnan ,signbit): Add macros and supporting float
and double functions.
(isfinite, isinf, isnormal): Add macros.
(isgreater, isless, isgreaterequal, islessequal,islessgreater):
Add macros.
(rint, rintf, round, roundf, trunc. truncf, fmax, fmaxf,
fmin, fminf, fma, fmaf, log2, log2f): Add prototypes.
(copysign, logb, nextafter, scalb): Add prototypes and
inline stubs for underscored versions in msvcrt.dll.
* include/inttypes.h: New file.
* include/fenv.h: New file
Add new mingwex subdir and files.
* mingwex: New directory.
* mingwex/Makefile.in: New file.
* mingwex/configure.in: New file.
* mingwex/configure: Generate.
* mingwex/dirent.c: Moved here from parent dir.
* mingwex/atoll.c: New file.
* mingwex/feclearexcept.c: New file.
* mingwex/fegetenv.c: New file.
* mingwex/fegetexceptflag.c: New file.
* mingwex/fegetround.c: New file.
* mingwex/feholdexcept.c: New file.
* mingwex/feraiseexcept.c: New file.
* mingwex/fesetenv.c: New file.
* mingwex/fesetexceptflag.c: New file.
* mingwex/fesetround.o: New file.
* mingwex/fetestexcept.c: New file.
* mingwex/feupdateenv.c: New file.
* mingwex/fma.S: New file.
* mingwex/fmaf.S: New file.
* mingwex/fmax.c: New file.
* mingwex/fmaxf.c: New file.
* mingwex/fmin.c: New file.
* mingwex/fminf.c: New file.
* mingwex/fp_consts.c: New file.
* mingwex/fpclassify.c: New file.
* mingwex/fucom.c: New file.
* mingwex/fwide.c: New file.
* mingwex/imaxabs.c: New file.
* mingwex/imaxdiv.c: New file.
* mingwex/isnan.c: New file.
* mingwex/isnanf.c: New file.
* mingwex/lltoa.c: New file.
* mingwex/lltow.c: New file.
* mingwex/log2.c: New file.
* mingwex/log2f.c: New file.
* mingwex/math_stubs.c: New file.
* mingwex/mbsinit.c: New file.
* mingwex/rint.c: New file.
* mingwex/round.c: New file.
* mingwex/signbit.c: New file.
* mingwex/sitest.c: New file.
* mingwex/strtof.c: New file.
* mingwex/strtoimax.c: New file.
* mingwex/strtoumax.c: New file.
* mingwex/testwmem.c: New file.
* mingwex/trunc.c: New file.
* mingwex/ulltoa.c: New file.
* mingwex/ulltow.c: New file.
* mingwex/wcstof.c: New file.
* mingwex/wcstoimax.c: New file.
* mingwex/wcstoumax.c: New file.
* mingwex/wmemchr.c: New file.
* mingwex/wmemcmp.c: New file.
* mingwex/wmemcpy.c: New file.
* mingwex/wmemmove.c: New file.
* mingwex/wmemset.c: New file.
* mingwex/wtoll.c: New file.
60 files changed, 8068 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog new file mode 100644 index 00000000000..231aeb29d34 --- /dev/null +++ b/winsup/mingw/ChangeLog @@ -0,0 +1,908 @@ +ChangeLog 2002-03-22 Danny Smith <dannysmith@users.sourceforge> + + * configure.in: Add mingwex as SUBDIRS and configdirs. + * configure: Regenerate. + * Makefile.in (MINGW_OBJS): Remove dirent.o. + (SRC_DIST_FILES): Remove dirent.c. + * dirent.c: Remove. + * include/stdlib.h (_Exit): Add static inline + function. + (struct lldiv_t): Define. + (lldiv): Add prototype. + (llabs): Add extern inline function. + (strtoll,strtoull): Add prototypes. + (wcstol, wcstoul, wcstod): Group together. + (strtof, wcstof): Add extern inline definitions. + (atoll,lltoa,ulltoa, wtoll, lltow ulltow): Add prototypes + and extern inline definitions. + * include/wchar.h (fwide, wcstoll,wcstoull, wmemchr + wmemcmp, wmemcpy, wmemmove, wmemset. mbsinit): Add + prototypes. + (wcstol, wcstoul,wcstod): Copy prototypes from stdlib.h. + (wcstof): Add extern inline definition. + * include/math.h (nan, nanf): Add prototypes. + (NAN, INFINITE): Define constants. + (fpclassify, isnan ,signbit): Add macros and supporting float + and double functions. + (isfinite, isinf, isnormal): Add macros. + (isgreater, isless, isgreaterequal, islessequal,islessgreater): + Add macros. + (rint, rintf, round, roundf, trunc. truncf, fmax, fmaxf, + fmin, fminf, fma, fmaf, log2, log2f): Add prototypes. + (copysign, logb, nextafter, scalb): Add prototypes and + inline stubs for underscored versions in msvcrt.dll. + * include/inttypes.h: New file. + * include/fenv.h: New file + + Add new mingwex subdir and files. + * mingwex: New directory. + * mingwex/Makefile.in: New file. + * mingwex/configure.in: New file. + * mingwex/configure: Generate. + * mingwex/dirent.c: Moved here from parent dir. + * mingwex/atoll.c: New file. + * mingwex/feclearexcept.c: New file. + * mingwex/fegetenv.c: New file. + * mingwex/fegetexceptflag.c: New file. + * mingwex/fegetround.c: New file. + * mingwex/feholdexcept.c: New file. + * mingwex/feraiseexcept.c: New file. + * mingwex/fesetenv.c: New file. + * mingwex/fesetexceptflag.c: New file. + * mingwex/fesetround.o: New file. + * mingwex/fetestexcept.c: New file. + * mingwex/feupdateenv.c: New file. + * mingwex/fma.S: New file. + * mingwex/fmaf.S: New file. + * mingwex/fmax.c: New file. + * mingwex/fmaxf.c: New file. + * mingwex/fmin.c: New file. + * mingwex/fminf.c: New file. + * mingwex/fp_consts.c: New file. + * mingwex/fpclassify.c: New file. + * mingwex/fucom.c: New file. + * mingwex/fwide.c: New file. + * mingwex/imaxabs.c: New file. + * mingwex/imaxdiv.c: New file. + * mingwex/isnan.c: New file. + * mingwex/isnanf.c: New file. + * mingwex/lltoa.c: New file. + * mingwex/lltow.c: New file. + * mingwex/log2.c: New file. + * mingwex/log2f.c: New file. + * mingwex/math_stubs.c: New file. + * mingwex/mbsinit.c: New file. + * mingwex/rint.c: New file. + * mingwex/round.c: New file. + * mingwex/signbit.c: New file. + * mingwex/sitest.c: New file. + * mingwex/strtof.c: New file. + * mingwex/strtoimax.c: New file. + * mingwex/strtoumax.c: New file. + * mingwex/testwmem.c: New file. + * mingwex/trunc.c: New file. + * mingwex/ulltoa.c: New file. + * mingwex/ulltow.c: New file. + * mingwex/wcstof.c: New file. + * mingwex/wcstoimax.c: New file. + * mingwex/wcstoumax.c: New file. + * mingwex/wmemchr.c: New file. + * mingwex/wmemcmp.c: New file. + * mingwex/wmemcpy.c: New file. + * mingwex/wmemmove.c: New file. + * mingwex/wmemset.c: New file. + * mingwex/wtoll.c: New file. + +2002-01-28 Danny Smith <dannysmith@users.sourceforge.net> + + * include/malloc.h (_heapinfo): Correct structure definition. + (_USEDENTRY,_FREEENTRY): Add defines. + Add comment on platform support for _heap* functions. + (_get_sbh_threshold): Add prototype. + (_set_sbh_threshold): Likewise. + (_expand): Likewise. + +2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> + + * profile/profil.c: Update copyright info. + * profile/profil.h: Likewise. + * profile/gcrt0.c: Likewise. + +2002-01-25 Pascal Obry <obry@gnat.com> + + * profile/profil.h (PROFADDR): Cast idx to unsigned long long to + avoid overflow. + * profile/gmon.c: Define bzero as memset if mingw32. + (monstartup): Use it. + +2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> + + * include/tchar.h (_TCHAR): Add missing ;. + +2002-01-25 Danny Smith <dannysmith@users.sourceforge.net> + + * include/tchar.h (_TCHAR): Add typedefs. + +2002-01-16 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdlib.h (_onexit_t): Add typedef. + (_onexit): Add prototype. + +2002-01-12 Danny Smith <dannysmith@users.sourceforge.net> + + * msvcrt.def: Revert accidental change. + * include/stdlib.h: Ditto. + +2001-12-07 Earnie Boyd <earnie@users.sf.net> + + * Makefile.in: Increment VERSION. + * include/_mingw.h: Ditto. + +2001-12-05 Earnie Boyd <earnie@users.sf.net> + + * include/strings.h: New File. + +2001-12-02 Danny Smith <dannysmith@users.sourceforge.net> + + Apply patches from: + 2001-06-21 Mumit Khan <khan@nanotech.wisc.edu> + + * include/math.h (_FPCLASS* ): Add defines from float.h. + (IEEE recommended functions): Add declarations from float.h. + * include/float.h (_FPCLASS* ): Protect against redefinition. + +2001-11-29 Wu Yongwei <adah@netstd.com> + + * include/_mingw.h,assert.h,conio.h,ctype.h,dir.h,direct.h + dirent.h,dos.h,errno.h,excpt.h,fcntl.h,float.h,io.h, + limits.h,locale.h,malloc.h,math.h,process.h,setjmp.h, + share.h,signal.h,stdarg.h,stddef.h,stdint.h,stdio.h, + stdlib.h,string.h,tchar.h,time.h,varargs.h,wchar.h, + wctype.h,sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h: + Correct spelling of "disclaimed" in comments. + * include/excpt.h: Another spelling correction. + +2001-11-08 Robert Collins <rbtcollins@hotmail.com> + + * include/errno.h: Fix "errno is not a prototype" warning. + +2001-11-07 Danny Smith <dannysmith@users.sourceforge.net> + + * include/ctype.h (tolower, toupper,_tolower,_toupper): Comment + differences between ANSI and non-ANSI versions. + (_ctype[],_pctype): Declare vars. + (__ISCTYPE): New helper macro using _pctype. + (is* ctype functions): Use __ISCTYPE to define inline versions. + (_toupper, _tolower, __isascii, __toascii, __iscsym, __iscsymf): + Inline definitions. + (isw* ctype functions): Inline definitions. + * include/wctype.h (_ctype[],_pctype): Declare vars. + (isw* ctype functions): Inline definitions. + + +2001-11-06 Danny Smith <dannysmith@users.sourceforge.net> + + * include/float.h (_clearfp, _statusfp, _fpreset, fpreset, + __fpecode): Use __STDC__ prototypes. + + +2001-11-06 Thomas Pfaff <tpfaff@gmx.net> + + * mthr_stub.c (__mingwthr_remove_key_dtor) New. + * mthr_init.c (DllMain) Run dtors if a process terminates. + * mthr.c (__mingwthr_add_key_dtor) Removed. + (___mingwthr_add_key_dtor) New. + (___mingwthr_remove_key_dtor) New. + (__mingwthr_run_key_dtors) Complete rewrite. + (__mingwthr_remove_key_dtor) New. + +2001-11-05 Egor Duda <deo@logos-m.ru> + + * Makefile.in: Delete unused executable after creating base-files. + +2001-11-06 Danny Smith <dannysmith@users.sourceforge.net> + + * include/errno.h (_errno): Use __STDC__ prototype. + Thanks to: Jim Barton. + +2001-11-04 "stefan" <stefan@lkcc.org> + + * include/sys/locking.h (_LK_UNLCK, LK_UNLCK): Correct names. + +2001-10-30 Danny Smith <dannysmith@users.sourceforge.net> + + * include/io.h (_commit): Add declaration. + Thanks to: "stefan" <stefan@lkcc.org> + +2001-10-30 Danny Smith <dannysmith@users.sourceforge.net> + + * include/sys/stat.h: Make S_IS* macros safer. + +2001-10-27 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdlib.h (EXIT_FAILURE): Change value to 1. + +2001-10-12 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdlib.h (__p__environ, __p__wenviron): Use + __STDC__ prototypes. + +2001-09-19 Earnie Boyd <earnie@SF.net> + + * Makefile.in: Remove the /usr from the install target. + (VERSION): Increment. + include/_mingw.h: Ditto. + +2001-09-17 Earnie Boyd <earnie@SF.net> + + * Makefile.in: Increment version. + * include/_mingw.h: Ditto. + +2001-09-10 Earnie Boyd <earnie@SF.net> + + * dossh: Remove inadvertantly imported file. + +2001-09-10 Danny Smith <dannysmith@users.sourceforge.net> + + * dirent.c (opendir): Use GetFileAttributes rather than stat + to determine if input arg is dir. + +2001-08-29 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdarg.h (va_list): Typedef as __builtin_va_list if + __GNUC__ >= 3. + * include/varargs.h (va_list): Ditto. + * include/stdio.h (va_list): Ditto. + +2001-08-01 Danny Smith <dannysmith@users.sourceforge.net> + + * include/stdlib.h (_wpgmptr): Don't declare ifndef __MSVCRT__. + * include/stdio.h (_IORW): Change constant to 0x0080. + (TMP_MAX): Add new define. + (_P_tmpdir): Ditto. + (_wP_tmpdir): Ditto. + (L_tmpnam): Change constant to 16. + +2001-06-28 Danny Smith <dannysmith@users.sourceforge.net> + + * include/malloc.h: Fix non-ANSI comment after #endif. + +2001-06-11 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * profile/configure.in: Make msvcrt.dll version default. + * profile/makefile.in: Build both gcrt1.o and gcrt2.o. + * provile/configure: Regenerate. + +2001-06-11 Mattia Barbon <mbarbon@dsi.unive.it> + + * include/stdio.h (swscanf): Make first arugument const. + * include/wchar.h (swscanf): Ditto. + * include/tchar.h (_tfopen): New _UNICODE define. + (_tgetenv): Ditto. + (_tsetlocale): Ditto. + +2001-06-04 Earnie Boyd <earnie@users.sourceforge.net> + + * profile/Makefile.in (mkinstalldirs): Correct relative path. + +2001-06-04 Earnie Boyd <earnie@users.sourceforge.net> + + * include/_mingw.h: Change version to 1.0. + Makefile.in: Ditto. + +2000-02-21 Earnie Boyd <earnie@users.sourceforge.net> + + * include/tchar.h: (__TEXT): Remove undef. + (_TEXT): Ditto. + (_T): Ditto. + +Fri Feb 2 10:34:07 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/tchar.h: (__TEXT): Add private macro. + (_TEXT): Modify definition to use __TEXT. + (_T): Ditto. + This change allows the passing of a MACRO as an argument and have that + MACRO resolved first. + Thanks to: Eric PAIRE <eric.paire@ri.silicomp.com> + +Wed Jan 31 17:12:51 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * Makefile.in: Increment version to 0.5 + * include/_mingw.h: Increment minor version + +Tue Jan 30 13:01:01 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/assert.h: (assert): Remove ; from end of definition + Thanks to: AJ Reins <tbisp@qwest.net> + +Tue Jan 30 07:31:22 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/time.h: (CLOCKS_PER_SEC): Type cast the constant. + Thanks to: Cosmin Truta <cosmin@cs.toronto.edu> + +Mon Jan 29 14:03:07 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * time.h: (CLOCKS_PER_SEC) Change from FP to integer constant. + +Sun Jan 28 13:01:08 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/wchar.h: The 2001.01.18 Change was incorrect. The functions + are actually C functions. These functions are resolved via the + -lmsvcp60 library and comments were placed in the header. + +2001-01-28 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + *include/stdlib.h (__p__pgmptr): add prototype. + (__p__wpgmptr): likewise. + (_pgmptr_dll): move declaration from dos.h. + (_wpgmptr_dll): likewise. + (_pgmptr): conditional define (MSVCT/CRTDLL). + (_wpgmptr): likewise. + *include/dos.h (_base*_dll variables): declare only for CRTDLL. + (_os*_dll variables): likewise. + (_pgmptr_dll): remove declaration and associated defines to stdlib.h. + (_wpgmptr_dll): likewise. + +2001-01-22 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + + * include/stdint.h: New file. + +Thu Jan 18 10:33:01 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/wchar.h: Protect prototypes only declared in the C++ STL + from being declared unless __cplusplus is defined. + +Tue Jan 16 11:37:31 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/stdlib.h: Apply Danny Smith patch 102730 + 2000-12-09 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + (_wgetenv) Correction to return type. + +Tue Jan 16 09:41:41 2001 Earnie Boyd <earnie@users.sourceforge.net> + + * include/locale.h: Apply Danny Smith patch 101834 + 2000-11-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + (LC_MIN) Add definition. + (LC_MAX) ditto. + (_wsetlocale) Add prototype. + +2000-11-29 Earnie Boyd <earnie_boyd@yahoo.com> + + * Makefile.in: eliminate the need for RUNTIME and CRT_ID. + Always build crt1.o, dllcrt1.o, crt2.o and dllcrt2.o. + Create a libcoldname.a for the oldname library for CRTDLL. + Restrict libmoldname.a for the oldname library for MSVCRT. + * configure.in: eliminate setting RUNTIME and CRT_ID variables. + Restructure the $target_os case logic. + Always name the MinGW thread dll helper mingwm. + Change Cygwin's HEADER_SUBDIR value from mingw32 to mingw. + * configure: regenerate. + +2000-11-22 Earnie Boyd <earnie_boyd@yahoo.com> + + * Makefile.in: Fix bindist target to distribute the correct files. + Remove the use of SNAPSHOT variable and test SNAPDATE instead. + Set SNAPDATE within the snapshot target on recursive call to $(MAKE). + +2000-11-21 Earnie Boyd <earnie_boyd@yahoo.com> + + * Makefile.in: Add missing line continuation `\' for $(SUBDIRS) target. + Add variables and targets to control binary and source distributions. + Add variables and targets to control snapshot distribution. + * profile/gmon.h: Add missing #endif for #ifndef. + * profile/ChangeLog: Merge entries here and remove. + * profile/Makefile.in: Add variables and targets to control + distribution. + * README: Add. + * TODO: ditto. + * config.guess: ditto. + * config.sub: ditto. + * mkinstalldirs: ditto. + * install-sh: ditto. + * configure: regenerate. + * profile/configure: ditto. + +2000-11-20 Earnie Boyd <earnie_boyd@yahoo.com> + + * Merge in changes from + 2000-10-23 Danny Smith <danny_r_smith_2001@yahoo.co.nz> + * include/direct.h: add guard around MSVCRT-only prototytpes + * include/io.h: add __int64 struct definitions and function prototypes; + add guard for MSVCRT-only prototypes + * include/limits.h: add ISO C9x macros LLONG_MIN, LLONG_MAX, ULLONG_MAX + * include/stdio.h: add wchar function prototypes (__MSVCRT__); + put wchar functions together to make sync with wchar.h easier + * include/stdlib.h: add wide char functions (__MSVCRT__) + * include/string.h: add string collation functions ( __MSVCRT__) + * include/sys/stat.h: add __int64 struct and function ( __MSVCRT__) + * include/tchar.h: add macros and macro function definitions + * include/wchar.h: add wide char function prototypes ( __MSVCRT__ ); + enclose more functions in __MSVCRT__ guard; + some oldname wide char function prototypes #if (0)'d + * profile/gmon.h: add guard around BSD-ish typedefs + +Mon Nov 20 18:58:12 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Use a different variable name for subdirectory since the + previous one was used by the top level make. + +Sun Nov 19 20:50:51 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Install mingw stuff in a subdirectory if building under + cygwin. + +Sat Jun 17 21:48:23 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (subdirs): Eliminate for loop. + +Sat Jun 17 18:27:59 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in (subdirs): Previous change did not fix problem in + broken shells. + +Sat Jun 17 13:49:12 2000 Christopher Faylor <cgf@cygnus.com> + + * Makefile.in: Avoid installing dll if we're cross building and the + cross-host system isn't a Windows system. + * configure.in: Detect cross-hosting situation and set appropriate + variables in Makefile.in. + * configure: Regenerate. + +Wed Apr 19 13:10:54 2000 Christopher Faylor <cgf@cygnus.com> + + * configure.in: Change HEADER_SUBDIR to mingw32. + * configure: Regenerate. + +Mon Apr 10 17:24:28 2000 Christopher Faylor <cgf@cygnus.com> + + * include/string.h: Use proper prototype for _strerror. + +2000-03-30 Mumit Khan <khan@xraylith.wisc.edu> + + * Makefile.in (subdirs): Workaround for broken shells. + +2000-02-03 Mumit Khan <khan@xraylith.wisc.edu> + + * Snapshot 2000-02-03. + + * include/{assert.h, conio.h, ctype.h, direct.h, dirent.h, fcntl.h, + float.h, io.h, locale.h, malloc.h, math.h, process.h, signal.h, + stdio.h, stdlib.h, string.h, time.h, wctype.h, sys/stat.h, + sys/timeb.h, sys/utime.h}: Remove parameter names to avoid namespace + pollution. + + * Makefile.in (all): Build CRT0S first. + (libmingwthrd.a): Remove thread support DLL from dependency. + +2000-01-21 Mumit Khan <khan@xraylith.wisc.edu> + + * Snapshot 2000-01-21. + +2000-01-20 Mumit Khan <khan@xraylith.wisc.edu> + + Merge in changes from Cygwin: + * configure.in (HEADER_SUBDIRS): New variable. Substitute. + (SUBDIRS): Likewise. + * Makefile.in (HEADER_SUBDIRS): New variable. + (install): Use to install Mingw headers to a subdirectory if building + under Cygwin. + (DLL_CC_STUFF): Add DLL entry point. + * configure: Regenerate. + +2000-01-19 Mumit Khan <khan@xraylith.wisc.edu> + + * include/stdio.h (fsetpos): Fix prototype. + (fpos_t): Fix for MSVCRT. + * include/float.h (fpreset): Add prototype. + * include/limits.h: Define UINT_MAX, USHRT_MAX and ULONG_MAX with + constant values. + * include/time.h: Don't define tzname as a macro for CRTDLL, and + export using libmoldname.a. + * crtdll.def: Add DATA tags. + * msvcrt.def: Likewise. + * moldname.def.in: Likewise. Add fpreset. Export tzname for + both MSVCRT and CRTDLL. + * moldname-crtdll.def: Regenerate. + * moldname-msvcrt.def: Regenerate. + +Tue Dec 21 02:22:14 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * Snapshot 1999-12-21. + + * include/wctype.h: New file. + * include/ctype.h (MB_CUR_MAX): Define. + (wctype_t): Guard. + * include/stdlib.h (MB_CUR_MAX): Define. + * include/wchar.h: Define stat, _stat structures here as well. + * include/float.h: Add invalid subconditions (_SW) and floating + point error (_FPE) macros. + * include/time.h (_CLOCK_T): Rename macro to _CLOCK_T_DEFINED. + (_TIME_T): Rename macro to _TIME_T_DEFINED. + * include/sys/types.h: Likewise. + +Thu Nov 18 00:22:26 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * profile/profil.c (profile_on): Set the profiler thread priority to + be time critical. Thanks to Pascal Obry <pascal_obry@csi.com>. + * Snapshot 1999-11-18. + +Sun Nov 7 02:50:09 1999 Mumit Khan <khan@xraylith.wisc.edu> + + Released 1999-11-07. + + * Makefile.in (CRT0S): Add crtst.o. + (install): Install in subdirs as well. + * dirent.h (struct _stat): Rename from struct stat. + * include/tchar.h: Add some new macros. Thanks to + Eric Kohl <ekohl@abo.rhein-zeitung.de>. + * profile/Makefile.in (install): Fix target. + +Thu Nov 4 14:32:58 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * Makefile.in: Add support for profile directory. + * configure.in: Likewise. + * configure: Regenerate. + + * profile: Imported profiling sources from winsup-19991026 snapshot. + * profile/Makefile.in: New file. + * profile/configure.in: New file. + * profile/configure: Generate. + * profile/gcrt0.c (u_char, u_short, u_int, u_long): typedef for Mingw. + * profile/gmon.h (u_char, u_short, u_int, u_long): Likewise. + * profile/gmon.c (unistd.h): Include conditionally. + (sys/param.h): Likewise. + * profile/mcount.c (sys/param.h): Likewise. + * profile/profil.c (profile_on): thread id is DWORD, not int. + + +Wed Nov 3 16:26:44 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/stdlib.h: Add wide character version of argv/environ. + Formatting changes. + * include/wchar.h: More wide character prototypes. + * include/sys/stat.h: Likewise. Add struct stat as well as _stat. + + * dllcrt1.c (init.c): Don't include. + (DllMainCRTStartup): Don't call _mingw32_init_mainargs(). + * Makefile.in: Remove init.c from dllcrt{1,2}.c dependency lists. + +Sat Oct 30 03:06:26 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * moldname.def: Remove file. + * moldname.def.in: And add this. + * moldname-msvcrt.def: Generate from moldname.def.in. + * moldname-crtdll.def: Likewise. + + * mthr.c: New file for -mthread (thread-safe C++ EH) support. + * mthr_init.c: New file for -mthread (thread-safe C++ EH) support. + * mthr_stub.c: New file for -mthread (thread-safe C++ EH) support. + + * Makefile.in: Update. + * configure.in: Likewise. Also add *cygwin* target for building + under Cygwin winsup. + * configure: Regenerate. + +Fri Oct 1 11:10:30 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/_mingw.h: Add version macros. + * include/direct.h (_diskfree_t, getdiskfree, getdrives): Add. + Also add wide character versions shared with wchar.h. + * include/dos.h (_diskfree_t, getdiskfree, getdrives): Add. + * include/io.h (sopen, _sopen): Fix prototype. + Add wide character prototypes. + * include/wchar.h: Likewise. + * include/stdlib.h (beep, seterrormode, sleep): Remove non- + underscored versions. Potential incompatibility. + * include/time.h (daylight, timezone, tzname): Fix MSVCRT cases. + Add wide character prototypes. + * include/sys/timeb.h (struct _timeb): Don't use macro, but real + definition. + +Wed Aug 18 18:38:39 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * configure.in (RUNTIME, CRT_ID): Add to differentiate between + crtdll and msvcrt runtimes. Remove DLL_ENTRY and DEF_DLL_ENTRY + macros. + * configure: Rengerate. + * Makefile.in (RUNTIME, CRT_ID): Use to generate the correct + dll name and crt's. CRTDLL and MSVCRT are meant to created + separately, so remove all the *-msvcrt* targets. + (libmingwthr.a): New target. Dummy thread support archive. + (LIBS): Add libmingwthr.a. + (CRT0S): Use CRT_ID. Add crtmt.o. + (MINGW_OBJS): Add crtst.o. + * main.c (WinMain): Fix prototype. + * crtmt.c: New file. + * crtst.c: New file. + + * include/process.h (_beginthreadex): Fix prototype. + * include/_mingw.h (__int64): Define for __GNUC__. + * include/tchar.h (_ttol): Add macro. + * include/stdlib.h (_wtoi, _wtol, _i64toa, _ui64toa, _atoi64, + _i64tow, _ui64tow, _wtoi64): Add prototypes. + + Reported by Emanuele Aliberti <ea@iol.it>: + * include/tchar.h (_ttoi): Add macro. + + Reported by Ulf Moeller <3umoelle@informatik.uni-hamburg.de>: + * include/stdio.h (_snprintf): Add prototype. + (_vsnprintf): Likewise. + +Sat Aug 7 18:00:00 1999 Mumit Khan <khan@xraylith.wisc.edu> + + Reported by Tor Lillqvist <tml@iki.fi>: + * include/stdlib.h (__p___argv): Fix return type. + +Fri Jul 30 22:07:06 1999 Mumit Khan <khan@xraylith.wisc.edu> + + Add UWIN support. + * include/errno.h (errno): It's linked in from startup, not imported. + * include/stdlib.h (errno): Likewise. + * include/io.h: Guard against conflicting macros and prototypes in + system headers. + * include/stdlib.h: Likewise. + * include/string.h: Likewise. + * include/time.h: Likewise. + +Fri Jul 30 13:47:34 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/io.h (X_OK): Fix definition. Thanks to Jan Nijtmans. + * include/dos.h: Fix typo __MINGW_EXPORT->__MINGW_IMPORT. + * Makefile.in (INCLUDES): Remove old windows32 include directory. + + * crt1.c (_gnu_exception_handler): Fix prototype. + (__mingw_CRTStartup): New function based on mainCRTStartup. + (mainCRTStartup): Set the app type for MSVCRT and call + __mingw_CRTStartup. + (WinMainCRTStartup): Likewise. + * init.c (_startupinfo): Define. + (_getmainargs): Add 5th parameter. + (_mingw32_init_mainargs): Use. + + * ALL *.c files: Reformat according to GNU coding style. + +Fri Jul 16 00:46:04 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * Makefile.in (INCLUDES): Add w32api include directory. + + * include/_mingw.h: New file. + * include/{assert.h,conio.h,ctype.h,direct.h,dirent.h,dos.h, + errno.h,excpt.h,fcntl.h,float.h,io.h,limits.h,locale.h,malloc.h, + math.h,process.h,setjmp.h,share.h,signal.h,stdarg.h,stdio.h, + stdlib.h,string.h,tchar.h,time.h,varargs.h,sys/locking.h, + sys/stat.h,sys/timeb.h,sys/types.h,sys/utime.h}: Include and + use the macros __DECLSPEC_SUPPORTED and __MINGW_IMPORT. + + * include/stdlib.h (atexit): Fix prototype. + +Mon Jun 14 18:38:49 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/stdio.h (_tempnam): Fix prototype. + (tempnam): Likewise. + * include/stdlib.h: Replace with GCC's version, and guard + with RC_INVOKED. + + From Anders Norlander <anorland@hem2.passagen.se>: + * include/stdlib.h (__argc): Declare. + (__argv): Likewise. + +Mon Apr 5 13:49:17 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * crt1.c (_gnu_exception_handler): Acknowledge Jacob Navia's + contribution. + * Makefile.in (_libm_dummy.o): New target. + (libm.a): Use. + +Tue Mar 16 18:15:26 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * Released 1999-03-16 along with egcs-1.1.2. + +Wed Feb 17 17:15:56 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * Makefile.in (LIBS): Add libm.a. + (libm.a): Dummy libm.a. + + * Makefile.in: Update from winsup 1999-02-08 snapshot. + Preserve local changes. + (mkinstalldirs): In ../, not ../../. + (INCLUDES): Point to local windows32api headers and use -nostdinc. + (LIBGCC): Delete. + (LIBS): Add libmoldname-msvc.a. + (libmoldname-msvc.a): Add target. + (distclean): Add target. + +Tue Feb 9 00:26:05 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/dir.h: Reintroduce as an obsolescent header. + * crt1.c (signal.h): Include. + (_gnu_exception_handler): New function to properly handle win32 + asynchronous signals. + (mainCRTStartup): Use. + +Sun Jan 3 23:52:25 1999 Mumit Khan <khan@xraylith.wisc.edu> + + * include/direct.h: Include io.h instead of dir.h + * include/dirent.h: Likewise. + * include/dos.h: Likewise. + * include/stdio.h: Replace reference to dir.h with io.h. + +Thu Dec 31 16:04:55 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * 1999-01-01 release bundled with egcs-1.1.1. + + * include/io.h: Incorporate dir.h. + * include/dir.h: Remove. + * include/signal.h: Move RC_INVOKED up a bit. + +Tue Dec 29 15:04:38 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * include/signal.h (sig_atomic_t): Define. + (NSIG): Define. + * include/malloc.h: Import defs from deprecated alloc.h. + * include/alloc.h: Remove. + + From "Daniel J. Rodriksson" <djr@dit.upm.es>: + * include/sys/types.h (_dev_t): Should be unsigned int for MSVCRT. + * include/sys/stat.h (struct stat): st_uid is of type short. Use + _off_t instead of long for st_size. + +Thu Sep 10 22:28:49 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * include/errno.h (sys_errlist, sys_nerr): Move from here ... + * include/stdlib.h: Here. + + * include/netdb.h: Remove. + * include/arpa/inet.h: Remove. + * include/netinet/in.h: Remove. + * include/sys/socket.h: Remove. + +Fri Sep 4 15:09:11 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * Release egcs-1.1. + + * include/{ctype.h,dos.h,io.h,string.h,time.h,sys/types.h, + sys/utime.h}: Protect stddef.h in RC_INVOKED macro. + +Thu Sep 3 10:43:29 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * setjmp.h (_JBTYPE, _JBLEN): Define correctly. + (jmpbuf): typedef using above. + (setjmp, longjmp): Prototype using jmpbuf. + + Merge with Colin Peters' 980701 snapshot. I've ignored changes to + obsolescent imported names, ie., from __imp__ to _imp___. + + Also ignored empty include/sys/param.h and incorrect + include/sys/times.h. + + * CRTinit.c: New file. + * include/{errno.h,fcntl.h,math.h,process.h} (__MSVCRT__): Use #ifdef + instead of #if. + * include/io.h (umask): Fix prototype. + * include/stdlib.h (OS constants): Replace with Colin's. + * include/time.h (tzset, daylight, timezone): Replace with Colin's. + * include/sys/state.h: Merge. + +Thu Sep 3 09:49:07 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * include/assert.h (assert): Lose the trailing semicolon. + +Thu Jul 30 21:18:49 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * include/math.h (matherr): Declare. + * include/stdio.h (fileno, _fileno): Declare. + * include/stdlib.h (environ, _environ): Fix to use runtime DLL. + + From Earnie Boyd: + * include/stdio.h (fdopen, _fdopen): Add const. + (getw, putw): Declare. + * include/stdlib.h (MAX_{DRIVE,DIR,FNAME,EXT}): Fix. + +Sat Jun 13 18:19:41 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * include/time.h (_timezone): Undefine. + * include/sys/timeb.h (struct timeb): Rename _timezone to timezone. + + * include/time.h (_daylight, _timezone, _tzname, _tzset): Remove + __cdecl for MSVCRT. + * include/stdlib.h (environ): Use DLL version. + * init.c (environ): Undefine it before use. + +Sun Mar 22 19:59:30 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * Update to 980309 snapshot from Colin Peters. + + * include/utime.h: remove + * include/stdlib.h (__imp__osver_dll, __imp__winver_dll, + __imp__winmajor_dll, __imp__winminor_dll): Apply Jan-Jaap's + patches to define these. + * include/time.h (CLK_TCK): Renamed from CLK_TICK. + (_daylight, _timezone, _tzname, _tzset): Define. + + * include/netdb.h: Add from Colin's windows32api changes. + * include/sys/socket.h: Likewise. + * include/arpa/inet.h: Likewise. + * include/netinet/in.h: Likewise. + +Wed Feb 4 14:16:44 1998 Mumit Khan <khan@xraylith.wisc.edu> + + * Update to 980128 snapshot from Colin Peters. + +Sat Dec 6 21:30:35 1997 Mumit Khan <khan@xraylith.wisc.edu> + + * configure.in (AC_INIT): Use dllmain.c instead of defunct + oldnames.c + * configure: Regenerate. + +Fri Dec 5 15:57:36 1997 Mumit Khan <khan@xraylith.wisc.edu> + + * Update to 971205 snapshot from Colin Peters. Lots of changes. + Files renamed and include hierarchy loses directories named + nonansi. + + * include/dos.h: from Jan-Jaap. + +Thu Dec 4 21:48:13 1997 Mumit Khan <khan@xraylith.wisc.edu> + + Changes to conform to FSF tree. + + * crt1.c: Renamed from mcrt0.c. + * dllcrt1.c: Renamed from dllcrt0.c. + * Makefile.in: Update above. Also renamed libmoldnames.a to + libmoldname.a. + +Mon Dec 1 16:51:30 1997 Mumit Khan <khan@xraylith.wisc.edu> + + * crtdll.def: Export all functions but the ones with funny names. + * moldnames.def: Add fdopen since fileno is already there. + * include/nonansi/dos.h: New file from Jan-Jaap. + * include/errno.h: Add extern decl + various additions from JJ. + * include/stdio.h: Likewise. + * include/stdlib.h: Likewise. + * include/nonansi/io.h: Likewise. + * include/nonansi/process.h: Likewise. + * include/sys/types.h: Likewise. + +Tue Nov 4 14:51:01 1997 Mumit Khan <khan@xraylith.wisc.edu> + + * include/time.h (CLK_TCK): Renamed from CLK_TICK. + (CLK_TICK): Delete. + * include/stdlib.h (free): Fix prototype to return void, not void*. + * include/nonansi/process.h: Add P_* and WAIT_* defs. + + * dllcrt0.c: Delete now-unneeded '.section .idata$3' asm hack. + * mcrt0.c: Likewise. + + * Makefile.in (LIBS): Delete moldnames.dll from target libs. + (libmoldnames.a): Add explicit rule to create it. + +Fri Aug 15 18:23:43 1997 Rob Savoye <rob@cygnus.com> + + New directory for the minimalist cygwin environment. + + * crtglob.c: New file. Turn on file globbing support. + * crt_noglob.c: New file. Turn off file globbing support. + * ctype_old.c: New file. Wrappers for functions that don't + have an underscore. + * dirent.c: New file. Directory routines readdir, opendir, closedir. + * dllcrt0.c: New file. Initialization code to use crtdll.dll. + * dllmain.c: New file. A stub DllMain function. + * hugeval.c: New file. A gross hack to define HUGE_VAL. + * init.c: New file. Common code to initialize standard file + handles and command line arguments. + * main.c: New file. A main for programs that only call WinMain. + * mcrt0.c: New file. Default crt0 for mingw32. + * oldnames.c: New File. Wrappers for functions that don't + have an underscore. + * string_old.c: New File. + * include/{assert.h,ctype.h,errno.h,float.h,limits.h,locale.h + math.h,nonansi,setjmp.h,signal.h,stdarg.h,stddef.h,stdio.h,stdlib.h + string.h,tchar.h,time.h,wchar.h}: New header files for mingw. + * include/sys/types.h: New header file for mingw. + * include/nonansi/{alloc.h,conio.h,dir.h,direct.h,dirent.h + fcntl.h,io.h,malloc.h,mem.h,memory.h,process.h,share.h,unistd.h + utime.h,values.h,varargs.h}: New header files for mingw. + * include/nonansi/sys/{fcntl.h,locking.h,stat.h,time.h + timeb.h,unistd.h}: New header files for mingw. + * Makefile.in,configure.in: Build and configure support. + * configure: Generated from autoconf 2.12 with Cygnus patches. diff --git a/winsup/mingw/Makefile.in b/winsup/mingw/Makefile.in new file mode 100644 index 00000000000..558c6ebe6a8 --- /dev/null +++ b/winsup/mingw/Makefile.in @@ -0,0 +1,389 @@ +# Makefile.in for the winsup/mingw directory. +# Copyright (c) 1995, 1996, 1997, 1998 Cygnus Solutions + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# This makefile requires GNU make. + +PACKAGE = mingw-runtime +VERSION = 1.3 +CYGRELEASE = 1 + +VPATH = @srcdir@ +srcdir = @srcdir@ +objdir = . + +host_alias = @host_alias@ +build_alias = @build_alias@ +target_alias = @target_alias@ +prefix = @prefix@ + +program_transform_name = @program_transform_name@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +ifeq ($(target_alias),$(host_alias)) +ifeq ($(build_alias),$(host_alias)) +tooldir:=$(exec_prefix) +else +tooldir:=$(exec_prefix)/$(target_alias) +endif +else +tooldir:=$(exec_prefix)/$(target_alias) +endif +datadir = @datadir@ +infodir = @infodir@ +includedir = @includedir@ +ifneq (,$(findstring cygwin,$(target_alias))) +inst_bindir:=$(tooldir)/bin +inst_includedir:=$(tooldir)/include/mingw +inst_libdir:=$(tooldir)/lib/mingw +else +inst_bindir:=$(bindir) +inst_includedir:=$(includedir) +inst_libdir:=$(libdir) +endif + +# The Mingw headers are installed under a subdirectory of +# $(tooldir)/include when configuring in Cygwin. +HEADER_SUBDIR = @HEADER_SUBDIR@ + +SHELL = /bin/sh + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ + +CC = @CC@ +# FIXME: Which is it, CC or CC_FOR_TARGET? +CC_FOR_TARGET = $(CC) +AS_FOR_TARGET = $(AS) +CFLAGS = @CFLAGS@ +CXXFLAGS = @CXXFLAGS@ + +# compiling with Cygwin? +MNO_CYGWIN = @MNO_CYGWIN@ +ifdef MNO_CYGWIN + subdirforlib=/mingw +else + libdir= +endif + +# Either crtdll (CRT_ID 1) or msvcrt (CRT_ID 2). +RUNTIME = @RUNTIME@ +CRT_ID = @CRT_ID@ + +# Needed for threading dll. +THREAD_DLL = @THREAD_DLL@ +THREAD_DLL_VERSION = 10 +THREAD_DLL_NAME = $(THREAD_DLL)$(THREAD_DLL_VERSION).dll + +# Various libraries. +LIBM_A=@LIBM_A@ + +INCLUDES = -I$(srcdir)/include -I$(srcdir)/../w32api/include \ + -I$(srcdir)/../include \ + -nostdinc -nostdinc++ +ALL_CFLAGS = $(CFLAGS) $(INCLUDES) $(MNO_CYGWIN) +ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) $(MNO_CYGWIN) + +AS = @AS@ +AR = @AR@ +LD = @LD@ +AR_FLAGS = rcv +RANLIB = @RANLIB@ +DLLTOOL = @DLLTOOL@ +DLLTOOLFLAGS = +DLLTOOL_FOR_TARGET = $(DLLTOOL) +DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) +DLLWRAP = @DLLWRAP@ +DLLWRAP_FOR_TARGET = $(DLLWRAP) +DLLWRAP_FLAGS = --dlltool $(DLLTOOL) --as $(AS) --driver-name $(CC) +TAR = tar + +SUBDIRS := @SUBDIRS@ + +FLAGS_TO_PASS:=\ + AS="$(AS)" \ + CC="$(CC)" \ + CFLAGS="$(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \ + CXXFLAGS="$(CXXFLAGS) $(CFLAGS_COMMON) $(CFLAGS_CONFIG)" \ + EXE_LDFLAGS="$(EXE_LDFLAGS)" \ + AR="$(AR)" \ + RANLIB="$(RANLIB)" \ + LD="$(LD)" \ + DLLTOOL="$(DLLTOOL)" \ + exec_prefix="$(exec_prefix)" \ + bindir="$(bindir)" \ + libdir="$(libdir)" \ + tooldir="$(tooldir)" \ + datadir="$(datadir)" \ + infodir="$(infodir)" \ + includedir="$(includedir)" \ + inst_bindir="$(inst_bindir)" \ + inst_includedir="$(inst_includedir)" \ + inst_libdir="$(inst_libdir)" \ + prefix="$(prefix)" \ + target_alias="$(target_alias)" + +CRT0S = crt1.o dllcrt1.o crt2.o dllcrt2.o CRT_noglob.o crtmt.o crtst.o +MINGW_OBJS = CRTglob.o CRTfmode.o CRTinit.o dllmain.o gccmain.o \ + main.o crtst.o mthr_stub.o +MOLD_OBJS = ctype_old.o string_old.o + +LIBS = libcrtdll.a libmsvcrt.a libmsvcrt20.a libmsvcrt40.a libmingw32.a \ + libcoldname.a libmoldname.a $(LIBM_A) libmingwthrd.a + +DLLS = $(THREAD_DLL_NAME) + +SRCDIST_FILES = CRT_noglob.c CRTfmode.c CRTglob.c CRTinit.c ChangeLog \ +Makefile.in README TODO config.guess config.sub configure configure.in \ +crt1.c crtdll.def crtmt.c crtst.c ctype_old.c dllcrt1.c dllmain.c \ +gccmain.c init.c install-sh jamfile main.c mkinstalldirs moldname-crtdll.def \ +moldname-msvcrt.def moldname.def moldname.def.in msvcrt.def msvcrt20.def \ +msvcrt40.def mthr.c mthr_init.c mthr_stub.c readme.txt string_old.c + +all_dlls_host = @all_dlls_host@ +install_dlls_host = @install_dlls_host@ + +all: $(CRT0S) $(LIBS) $(all_dlls_host) + @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) + +all_dlls_host: $(DLLS) + +install_dlls_host: + for i in $(DLLS); do \ + $(INSTALL_PROGRAM) $$i $(inst_bindir)/$$i ; \ + done + +_libm_dummy.o: + rm -f _libm_dummy.c + echo "static int __mingw_libm_dummy;" > _libm_dummy.c + $(CC) -c $(ALL_CFLAGS) _libm_dummy.c + rm -f _libm_dummy.c + +libm.a: _libm_dummy.o + $(AR) rc $@ _libm_dummy.o + $(RANLIB) $@ + +libmingwthrd.a: crtmt.o mingwthrd.def + $(DLLTOOL) $(DLLTOOL_FLAGS) --dllname $(THREAD_DLL_NAME) \ + --def mingwthrd.def --output-lib $@ + $(AR) $(ARFLAGS) $@ crtmt.o + $(RANLIB) $@ + +# Using dllwrap would be so much easier, but Cygnus top-level configure +# Makefile.in etc don't pass the right variables yet. +xx_$(THREAD_DLL_NAME) xx_mingwthrd.def: mthr.o mthr_init.o + $(DLLWRAP) $(DLLWRAP_FLAGS) -o $(THREAD_DLL_NAME) \ + --output-def mingwthrd.def \ + mthr.o mthr_init.o + +DLL_OFILES = mthr.o mthr_init.o +DLL_CC_STUFF = -B./ -mdll $(MNO_CYGWIN) -Wl,--image-base,0x6FBC0000 \ + -Wl,--entry,_DllMainCRTStartup@12 \ + $(DLL_OFILES) +DLL_DLLTOOL_STUFF = --as=$(AS) --dllname $(THREAD_DLL_NAME) \ + --def mingwthrd.def \ + --base-file mingwthrd.base --output-exp mingwthrd.exp + +$(THREAD_DLL_NAME) mingwthrd.def: $(DLL_OFILES) Makefile + $(DLLTOOL) --as $(AS) --output-def mingwthrd.def $(DLL_OFILES) + $(CC) -Wl,--base-file=mingwthrd.base $(DLL_CC_STUFF) \ + -o mingwthrd_dummy.exe + $(DLLTOOL) $(DLL_DLLTOOL_STUFF) + $(CC) -Wl,--base-file=mingwthrd.base mingwthrd.exp $(DLL_CC_STUFF) \ + -o mingwthrd_dummy.exe + $(DLLTOOL) $(DLL_DLLTOOL_STUFF) + $(CC) mingwthrd.exp -o $(THREAD_DLL_NAME) $(DLL_CC_STUFF) + rm -f mingwthrd_dummy.exe + +libmingw32.a: $(MINGW_OBJS) + $(AR) rc $@ $(MINGW_OBJS) + $(RANLIB) $@ + +$(srcdir)/moldname-crtdll.def: moldname.def.in + $(CC) -DRUNTIME=crtdll \ + -D__FILENAME__=moldname-crtdll.def \ + -D__CRTDLL__ -c -E -P \ + -xc-header $? > $@ + +$(srcdir)/moldname-msvcrt.def: moldname.def.in + $(CC) -DRUNTIME=msvcrt \ + -D__FILENAME__=moldname-msvcrt.def \ + -D__MSVCRT__ -c -E -P \ + -xc-header $? > $@ + +libcoldname.a: $(srcdir)/moldname-crtdll.def $(MOLD_OBJS) + $(DLLTOOL) --as $(AS) -k -U \ + --dllname crtdll.dll \ + --def $(srcdir)/moldname-crtdll.def \ + --output-lib $@ + $(AR) rc $@ $(MOLD_OBJS) + $(RANLIB) $@ + +libmoldname.a: $(srcdir)/moldname-msvcrt.def $(MOLD_OBJS) + $(DLLTOOL) --as $(AS) -k -U \ + --dllname msvcrt.dll \ + --def $(srcdir)/moldname-msvcrt.def \ + --output-lib $@ + $(AR) rc $@ $(MOLD_OBJS) + $(RANLIB) $@ + +# The special rules are necessary. +crt1.o dllcrt1.o: + $(CC) -c -D__CRTDLL__ -U__MSVCRT__ $(ALL_CFLAGS) $< -o $@ + +crt2.o dllcrt2.o: + $(CC) -c -D__MSVCRT__ -U__CRTDLL__ $(ALL_CFLAGS) $< -o $@ + +clean: + -rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp + -rm -f $(THREAD_DLL_NAME) mingwthrd_dummy.exe + @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) + +distclean: + @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) + -rm -f *.o *.a *~ core a.out mingwthrd.def mingwthrd.base mingwthrd.exp + -rm -f $(THREAD_DLL_NAME) + -rm -f config.cache config.status config.log + -rm -f Makefile + +ifdef SNAPDATE + distdir=$(PACKAGE)-$(VERSION)-$(SNAPDATE) +else + ifneq (,$(findstring cygwin, $(target_alias))) + distdir=$(PACKAGE)-$(VERSION)-$(CYGRELEASE) + else + distdir=$(PACKAGE)-$(VERSION) + endif +endif + +dist: srcdist bindist + +srcdist: + rm -rf $(distdir) + mkdir $(distdir) + chmod 755 $(distdir) + for i in $(SRCDIST_FILES); do \ + cp -p $(srcdir)/$$i $(distdir)/$$i ; \ + done + for i in $(SUBDIRS); do \ + (cd $$i; $(MAKE) distdir=../$(distdir) dist); \ + done +#FIXME this needs to be done with SUBDIRS and Makefiles. + mkdir $(distdir)/include + mkdir $(distdir)/include/sys + cp $(srcdir)/include/*.h $(distdir)/include/ + cp $(srcdir)/include/sys/*.h $(distdir)/include/sys/ +#end FIXME + rm -f $(distdir)-src.tar.gz + $(TAR) czf $(distdir)-src.tar.gz $(distdir) + + +bindist: + rm -rf $(distdir) + mkdir $(distdir) + chmod 755 $(distdir) + $(MAKE) install prefix=$(shell pwd)/$(distdir) + rm -f $(distdir).tar.gz + cd $(distdir); \ + $(TAR) czf ../$(distdir).tar.gz * + +snapshot: + make dist SNAPDATE=$(shell date '+%Y%m%d') + +info: + +info-html: + +install-info: info + +install-dirs: + $(mkinstalldirs) $(inst_bindir) + $(mkinstalldirs) $(inst_includedir) + $(mkinstalldirs) $(inst_libdir) + +install: all install-dirs $(install_dlls_host) + for i in $(LIBS); do \ + $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + done + for i in $(CRT0S); do \ + $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + done + for sub in . sys ; do \ + dstdir=$(inst_includedir)/$$sub ; \ + $(mkinstalldirs) $$dstdir ; \ + for i in $(srcdir)/include/$$sub/*.h ; do \ + $(INSTALL_DATA) $$i $$dstdir/`basename $$i` ; \ + done ; \ + done + @$(MAKE) subdirs DO=$@ $(FLAGS_TO_PASS) + +subdirs: $(SUBDIRS) + @true + +# The . is here because SUBDIRS may be empty + +. $(SUBDIRS): force + @if [ -d ./$@ ]; then \ + echo "Making $(DO) in $@..." ; \ + if (rootme=`pwd`/ ; export rootme ; \ + rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ + cd ./$@; \ + $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \ + else exit 1 ; fi ; \ + else true ; fi ; \ + +force: + +# +# Dependancies +# +libcrtdll.a: $(srcdir)/crtdll.def +libmsvcrt.a: $(srcdir)/msvcrt.def +libmsvcrt20.a: $(srcdir)/msvcrt20.def +libmsvcrt40.a: $(srcdir)/msvcrt40.def +CRT_noglob.o: $(srcdir)/CRT_noglob.c +CRTfmode.o: $(srcdir)/CRTfmode.c +CRTglob.o: $(srcdir)/CRTglob.c +CRTinit.o: $(srcdir)/CRTinit.c +crt1.o: $(srcdir)/crt1.c $(srcdir)/init.c +crt2.o: $(srcdir)/crt1.c $(srcdir)/init.c +crtmt.o: $(srcdir)/crtmt.c +crtst.o: $(srcdir)/crtst.c +ctype_old.o: $(srcdir)/ctype_old.c +dllcrt1.o: $(srcdir)/dllcrt1.c +dllcrt2.o: $(srcdir)/dllcrt1.c +dllmain.o: $(srcdir)/dllmain.c +main.o: $(srcdir)/main.c +oldnames.o: $(srcdir)/oldnames.c +string_old.o: $(srcdir)/string_old.c + +Makefile: Makefile.in config.status configure + $(SHELL) config.status + +config.status: configure + $(SHELL) config.status --recheck + +.SUFFIXES: .y $(SUFFIXES) .cc .def .a + +lib%.a:%.def + $(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib lib$*.a --def $< + +.c.o: + $(CC) -c $(ALL_CFLAGS) $< -o $@ + diff --git a/winsup/mingw/configure b/winsup/mingw/configure new file mode 100755 index 00000000000..cf50ebd7c3e --- /dev/null +++ b/winsup/mingw/configure @@ -0,0 +1,2166 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=dllmain.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:555: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:576: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:602: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_CC"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:634: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + CC="gcc" +fi +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:670: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:719: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:743: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS='$(CFLAGS)' + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi + + +case "$with_cross_host" in + ""|*cygwin*) all_dlls_host='all_dlls_host' + install_dlls_host='install_dlls_host';; +esac + + + +# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:784: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_AR"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:816: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AR="ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + AR="ar" +fi +fi + + + +# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:853: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="${ac_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_AS"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:885: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_AS="as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + AS="as" +fi +fi + + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:921: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:953: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="ranlib" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB="ranlib" +fi +fi + + +# Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. +set dummy ${ac_tool_prefix}ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:989: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LD="${ac_tool_prefix}ld" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LD="$ac_cv_prog_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_LD"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1021: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_LD="ld" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_LD" && ac_cv_prog_LD="ld" +fi +fi +LD="$ac_cv_prog_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + LD="ld" +fi +fi + + +# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1057: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +DLLTOOL="$ac_cv_prog_DLLTOOL" +if test -n "$DLLTOOL"; then + echo "$ac_t""$DLLTOOL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_DLLTOOL"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1089: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_DLLTOOL="dlltool" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool" +fi +fi +DLLTOOL="$ac_cv_prog_DLLTOOL" +if test -n "$DLLTOOL"; then + echo "$ac_t""$DLLTOOL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + DLLTOOL="dlltool" +fi +fi + + +# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1125: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLWRAP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLWRAP"; then + ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_DLLWRAP="${ac_tool_prefix}dlltool" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +DLLWRAP="$ac_cv_prog_DLLWRAP" +if test -n "$DLLWRAP"; then + echo "$ac_t""$DLLWRAP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_DLLWRAP"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1157: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLWRAP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLWRAP"; then + ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_DLLWRAP="dlltool" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_DLLWRAP" && ac_cv_prog_DLLWRAP="dlltool" +fi +fi +DLLWRAP="$ac_cv_prog_DLLWRAP" +if test -n "$DLLWRAP"; then + echo "$ac_t""$DLLWRAP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + DLLWRAP="dlltool" +fi +fi + + +# Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. +set dummy ${ac_tool_prefix}windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1193: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_WINDRES="${ac_tool_prefix}windres" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +WINDRES="$ac_cv_prog_WINDRES" +if test -n "$WINDRES"; then + echo "$ac_t""$WINDRES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_WINDRES"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1225: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_WINDRES="windres" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_WINDRES" && ac_cv_prog_WINDRES="windres" +fi +fi +WINDRES="$ac_cv_prog_WINDRES" +if test -n "$WINDRES"; then + echo "$ac_t""$WINDRES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + WINDRES="windres" +fi +fi + + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1260: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 1275 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 1292 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1298: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1309 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +echo "configure:1342: checking for working alloca.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1347 "configure" +#include "confdefs.h" +#include <alloca.h> +int main() { +char *p = alloca(2 * sizeof(int)); +; return 0; } +EOF +if { (eval echo configure:1354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_header_alloca_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_alloca_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 +if test $ac_cv_header_alloca_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA_H 1 +EOF + +fi + +echo $ac_n "checking for alloca""... $ac_c" 1>&6 +echo "configure:1375: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1380 "configure" +#include "confdefs.h" + +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int main() { +char *p = (char *) alloca(1); +; return 0; } +EOF +if { (eval echo configure:1408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_alloca_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_alloca_works=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +if test $ac_cv_func_alloca_works = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA 1 +EOF + +fi + +if test $ac_cv_func_alloca_works = no; then + # The SVR3 libPW and SVR4 libucb both contain incompatible functions + # that cause trouble. Some versions do not even contain alloca or + # contain a buggy version. If you still want to use their alloca, + # use ar to extract alloca.o from them instead of compiling alloca.c. + ALLOCA=alloca.${ac_objext} + cat >> confdefs.h <<\EOF +#define C_ALLOCA 1 +EOF + + +echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +echo "configure:1440: checking whether alloca needs Cray hooks" >&5 +if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1445 "configure" +#include "confdefs.h" +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "webecray" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_os_cray=yes +else + rm -rf conftest* + ac_cv_os_cray=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_os_cray" 1>&6 +if test $ac_cv_os_cray = yes; then +for ac_func in _getb67 GETB67 getb67; do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1470: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1475 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<EOF +#define CRAY_STACKSEG_END $ac_func +EOF + + break +else + echo "$ac_t""no" 1>&6 +fi + +done +fi + +echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +echo "configure:1525: checking stack direction for C alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat > conftest.$ac_ext <<EOF +#line 1533 "configure" +#include "confdefs.h" +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} +main () +{ + exit (find_stack_direction() < 0); +} +EOF +if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_stack_direction=1 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_stack_direction=-1 +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 +cat >> confdefs.h <<EOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +EOF + +fi + + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1602: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:1623: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1641: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +configdirs="" +SUBDIRS="" +HEADER_SUBDIR="" + +case "$target_os" in +*cygwin*) + MNO_CYGWIN=-mno-cygwin + configdirs="$configdirs" + # FIXME MinGW versions of libm.a and libgmon.a needed for -mno-cygwin + # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll + # overwrite Cygwin's one. Likewise for libgmon.a. + LIBM_A= + LIBGMON_A= + # Install mingw headers in mingw subdirectory. + HEADER_SUBDIR="mingw" + ;; +*) + # Build it for MSVCRT by default. + MNO_CYGWIN= + LIBM_A=libm.a + LIBGMON_A=libgmon.a + SUBDIRS="profile mingwex" + configdirs="$configdirs profile mingwex" + ;; +esac + +# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL. +# I can find no reason to do this. +# +# FIXME: In the future I would like to change the dll name to mingwthrd to +# to match the libmingwthrd.a name. +THREAD_DLL=mingwm + +if test -n "$configdirs"; then + subdirs="$configdirs" + +fi + +MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs + + + + + + + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1723: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@CC@%$CC%g +s%@all_dlls_host@%$all_dlls_host%g +s%@install_dlls_host@%$install_dlls_host%g +s%@AR@%$AR%g +s%@AS@%$AS%g +s%@RANLIB@%$RANLIB%g +s%@LD@%$LD%g +s%@DLLTOOL@%$DLLTOOL%g +s%@DLLWRAP@%$DLLWRAP%g +s%@WINDRES@%$WINDRES%g +s%@CPP@%$CPP%g +s%@ALLOCA@%$ALLOCA%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@subdirs@%$subdirs%g +s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g +s%@MNO_CYGWIN@%$MNO_CYGWIN%g +s%@THREAD_DLL@%$THREAD_DLL%g +s%@LIBM_A@%$LIBM_A%g +s%@LIBGMON_A@%$LIBGMON_A%g +s%@SUBDIRS@%$SUBDIRS%g +s%@HEADER_SUBDIR@%$HEADER_SUBDIR%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in $configdirs; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + + diff --git a/winsup/mingw/configure.in b/winsup/mingw/configure.in new file mode 100644 index 00000000000..6f46741171b --- /dev/null +++ b/winsup/mingw/configure.in @@ -0,0 +1,140 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl This file is part of winsup/mingw +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +AC_PREREQ(2.12) +AC_INIT(dllmain.c) + +dnl FIXME: We temporarily define our own version of AC_PROG_CC. This is +dnl copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We +dnl are probably using a cross compiler, which will not be able to fully +dnl link an executable. This should really be fixed in autoconf +dnl itself. + +AC_DEFUN(LIB_AC_PROG_CC, +[AC_BEFORE([$0], [AC_PROG_CPP])dnl +AC_CHECK_TOOL(CC, gcc, gcc) +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) + test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) +fi + +AC_PROG_CC_GNU + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +dnl Check whether -g works, even if CFLAGS is set, in case the package +dnl plays around with CFLAGS (such as to build both debugging and +dnl normal versions of a library), tasteless as that idea is. + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + AC_PROG_CC_G + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" + fi + if test "$ac_test_CXXFLAGS" != set; then + CXXFLAGS='$(CFLAGS)' + fi +else + GCC= + test "${CFLAGS+set}" = set || CFLAGS="-g" +fi +]) + +LIB_AC_PROG_CC + +case "$with_cross_host" in + ""|*cygwin*) all_dlls_host='all_dlls_host' + install_dlls_host='install_dlls_host';; +esac +AC_SUBST(all_dlls_host) +AC_SUBST(install_dlls_host) + +AC_CHECK_TOOL(AR, ar, ar) + +AC_SUBST(AR) +AC_CHECK_TOOL(AS, as, as) +AC_SUBST(AS) +AC_CHECK_TOOL(RANLIB, ranlib, ranlib) +AC_SUBST(RANLIB) +AC_CHECK_TOOL(LD, ld, ld) +AC_SUBST(LD) +AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool) +AC_SUBST(DLLTOOL) +AC_CHECK_TOOL(DLLWRAP, dlltool, dlltool) +AC_SUBST(DLLWRAP) +AC_CHECK_TOOL(WINDRES, windres, windres) +AC_SUBST(WINDRES) + +AC_ALLOCA + +AC_CANONICAL_SYSTEM + +configdirs="" +SUBDIRS="" +HEADER_SUBDIR="" + +case "$target_os" in +*cygwin*) + MNO_CYGWIN=-mno-cygwin + configdirs="$configdirs" + # FIXME MinGW versions of libm.a and libgmon.a needed for -mno-cygwin + # Do not build libm.a when building under Cygwin winsup. Otherwise, it'll + # overwrite Cygwin's one. Likewise for libgmon.a. + LIBM_A= + LIBGMON_A= + # Install mingw headers in mingw subdirectory. + HEADER_SUBDIR="mingw" + ;; +*) + # Build it for MSVCRT by default. + MNO_CYGWIN= + LIBM_A=libm.a + LIBGMON_A=libgmon.a + SUBDIRS="profile mingwex" + configdirs="$configdirs profile mingwex" + ;; +esac + +# THREAD_DLL used to be set within the above case and was mingwc for CRTDLL. +# I can find no reason to do this. +# +# FIXME: In the future I would like to change the dll name to mingwthrd to +# to match the libmingwthrd.a name. +THREAD_DLL=mingwm + +if test -n "$configdirs"; then + AC_CONFIG_SUBDIRS($configdirs) +fi + +MKINSTALLDIRS=$ac_aux_dir/mkinstalldirs +AC_SUBST(MKINSTALLDIRS) +AC_SUBST(MNO_CYGWIN) +AC_SUBST(THREAD_DLL) +AC_SUBST(LIBM_A) +AC_SUBST(LIBGMON_A) +AC_SUBST(SUBDIRS) +AC_SUBST(HEADER_SUBDIR) + +AC_PROG_INSTALL +AC_OUTPUT(Makefile) + diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in new file mode 100644 index 00000000000..40e44e28943 --- /dev/null +++ b/winsup/mingw/mingwex/Makefile.in @@ -0,0 +1,187 @@ +# +# mingw/mingwex/Makefile.in: This file is part of Mingw runtime. +# +# This makefile requires GNU make. + +VPATH = @srcdir@ +srcdir = @srcdir@ +objdir = . + +target_alias = @target_alias@ +prefix = @prefix@ + +program_transform_name = @program_transform_name@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +tooldir = $(exec_prefix)/$(target_alias) +datadir = @datadir@ +infodir = @infodir@ +includedir = @includedir@ + +SHELL = /bin/sh + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +mkinstalldirs = $(SHELL) $(srcdir)/../mkinstalldirs +DISTFILES = Makefile.in configure configure.in \ + atoll.c \ + dirent.c \ + feclearexcept.c \ + fegetenv.c \ + fegetexceptflag.c \ + fegetround.c \ + feholdexcept.c \ + feraiseexcept.c \ + fesetenv.c \ + fesetround.c \ + fetestexcept.c \ + fesetexceptflag.c \ + feupdateenv.c \ + fmax.c \ + fmaxf.c \ + fmin.c \ + fminf.c \ + fp_consts.c \ + fpclassify.c \ + fucom.c \ + fwide.c \ + imaxabs.c \ + imaxdiv.c \ + isnan.c \ + isnanf.c \ + lltoa.c \ + lltow.c \ + log2.c \ + log2f.c \ + math_stubs.c \ + mbsinit.c \ + rint.c \ + round.c \ + signbit.c \ + sitest.c \ + strtof.c \ + strtoimax.c \ + strtoumax.c \ + testwmem.c \ + trunc.c \ + ulltoa.c \ + ulltow.c \ + wcstof \ + wcstoimax.c \ + wcstoumax.c \ + wmemchr.c \ + wmemcmp.c \ + wmemcpy.c \ + wmemmove.c \ + wmemset.c \ + wtoll.c \ + fma.S \ + fmaf.S + +CC = @CC@ +# FIXME: Which is it, CC or CC_FOR_TARGET? +CC_FOR_TARGET = $(CC) +AS_FOR_TARGET = $(AS) +CFLAGS = @CFLAGS@ -fomit-frame-pointer -Wall +CXXFLAGS = @CXXFLAGS@ + +# compiling with Cygwin? +MNO_CYGWIN = @MNO_CYGWIN@ + + +INCLUDES = -I$(srcdir) -I$(srcdir)/../include \ + -I$(srcdir)/../../w32api/include \ + -nostdinc -nostdinc++ +ALL_CFLAGS = $(CFLAGS) $(INCLUDES) $(MNO_CYGWIN) +ALL_CXXFLAGS = $(CXXFLAGS) $(INCLUDES) $(MNO_CYGWIN) + +AS = @AS@ +AR = @AR@ +LD = @LD@ +AR_FLAGS = rcv +RANLIB = @RANLIB@ +DLLTOOL = @DLLTOOL@ +DLLTOOLFLAGS = +DLLTOOL_FOR_TARGET = $(DLLTOOL) +DLLTOOL_FLAGS = --as $(AS_FOR_TARGET) + +LIBMINGWEX_A = libmingwex.a + +Q8_OBJS = \ + fwide.o imaxabs.o imaxdiv.o mbsinit.o \ + strtoimax.o strtoumax.o wcstoimax.o wcstoumax.o \ + wmemchr.o wmemcmp.o wmemcpy.o wmemmove.o wmemset.o +STDLIB_STUB_OBJS = \ + lltoa.o ulltoa.o \ + lltow.o ulltow.o \ + atoll.o wtoll.o \ + strtof.o wcstof.o +MATH_OBJS = \ + fpclassify.o fucom.o round.o \ + rint.o signbit.o trunc.o \ + isnan.o isnanf.o fp_consts.o \ + fmax.o fmin.o fmaxf.o fminf.o \ + fma.o fmaf.o log2.o log2f.o +MATH_STUB_OBJS = \ + math_stubs.o +FENV_OBJS = fesetround.o fegetround.o \ + fegetenv.o fesetenv.o feupdateenv.o \ + feclearexcept.o feholdexcept.o fegetexceptflag.o \ + feraiseexcept.o fetestexcept.o fesetexceptflag.o +POSIX_OBJS = \ + dirent.o + +LIB_OBJS = $(Q8_OBJS) $(STDLIB_STUB_OBJS) $(MATH_OBJS) $(MATH_STUB_OBJS) \ + $(FENV_OBJS) $(POSIX_OBJS) + +LIBS = $(LIBMINGWEX_A) +DLLS = + +all: $(LIBMINGWEX_A) + +$(LIBMINGWEX_A): $(LIB_OBJS) + $(AR) $(ARFLAGS) $@ $(LIB_OBJS) + $(RANLIB) $@ + + +Makefile: Makefile.in config.status configure + $(SHELL) config.status + +config.status: configure + $(SHELL) config.status --recheck + +info: + +info-html: + +install-info: info + +install: all + $(mkinstalldirs) $(inst_libdir) + for i in $(LIBS); do \ + $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + done + +clean: + -rm -f $(LIB_OBJS) $(LIBMINGWEX_A) + +distclean: + -rm -f *.o *.a *~ core a.out + -rm -f config.cache config.status config.log + -rm -f Makefile +.c.o: + $(CC) -c $(ALL_CXXFLAGS) $(ALL_CFLAGS) $< -o $@ +.S.o: + $(CC) -c $< -o $@ +.s.o: + $(CC) -c $< -o $@ + + +dist: + mkdir $(distdir)/mingwex + chmod 755 $(distdir)/mingwex + @for i in $(DISTFILES); do\ + cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \ + done diff --git a/winsup/mingw/mingwex/atoll.c b/winsup/mingw/mingwex/atoll.c new file mode 100644 index 00000000000..97920b4ee54 --- /dev/null +++ b/winsup/mingw/mingwex/atoll.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +long long atoll (const char * _c) + { return _atoi64 (_c); } diff --git a/winsup/mingw/mingwex/configure b/winsup/mingw/mingwex/configure new file mode 100755 index 00000000000..746c6fedc1a --- /dev/null +++ b/winsup/mingw/mingwex/configure @@ -0,0 +1,1007 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=imaxabs.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +CC=${CC-cc} + +AS=${AS-as} + +AR=${AR-ar} + +LD=${LD-ld} + +RANLIB=${RANLIB-ranlib} + +DLLTOOL=${DLLTOOL-dlltool} + +DLLWRAP=${DLLWRAP-dllwrap} + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:587: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:608: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:626: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +case "$target_os" in +*cygwin*) + MNO_CYGWIN=-mno-cygwin + ;; +*) + # Build it for MSVCRT by default. + MNO_CYGWIN= + ;; +esac + + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:673: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@AS@%$AS%g +s%@AR@%$AR%g +s%@LD@%$LD%g +s%@RANLIB@%$RANLIB%g +s%@DLLTOOL@%$DLLTOOL%g +s%@DLLWRAP@%$DLLWRAP%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@MNO_CYGWIN@%$MNO_CYGWIN%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + diff --git a/winsup/mingw/mingwex/configure.in b/winsup/mingw/mingwex/configure.in new file mode 100644 index 00000000000..4c0ed42074f --- /dev/null +++ b/winsup/mingw/mingwex/configure.in @@ -0,0 +1,52 @@ +dnl Process this file with autoconf to produce a configure script. + +dnl This file is part of Mingw runtime. +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +AC_PREREQ(2.13) +AC_INIT(imaxabs.c) + +CC=${CC-cc} +AC_SUBST(CC) +AS=${AS-as} +AC_SUBST(AS) +AR=${AR-ar} +AC_SUBST(AR) +LD=${LD-ld} +AC_SUBST(LD) +RANLIB=${RANLIB-ranlib} +AC_SUBST(RANLIB) +DLLTOOL=${DLLTOOL-dlltool} +AC_SUBST(DLLTOOL) +DLLWRAP=${DLLWRAP-dllwrap} +AC_SUBST(DLLWRAP) +AC_CANONICAL_SYSTEM + +case "$target_os" in +*cygwin*) + MNO_CYGWIN=-mno-cygwin + ;; +*) + # Build it for MSVCRT by default. + MNO_CYGWIN= + ;; +esac + +AC_SUBST(MNO_CYGWIN) + +AC_PROG_INSTALL +AC_OUTPUT(Makefile) + diff --git a/winsup/mingw/mingwex/dirent.c b/winsup/mingw/mingwex/dirent.c new file mode 100644 index 00000000000..e3885f0eac1 --- /dev/null +++ b/winsup/mingw/mingwex/dirent.c @@ -0,0 +1,316 @@ +/* + * dirent.c + * + * Derived from DIRLIB.C by Matt J. Weinstein + * This note appears in the DIRLIB.H + * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 + * + * Updated by Jeremy Bettis <jeremy@hksys.com> + * Significantly revised and rewinddir, seekdir and telldir added by Colin + * Peters <colin@fu.is.saga-u.ac.jp> + * + * $Revision$ + * $Author$ + * $Date$ + * + */ + +#include <stdlib.h> +#include <errno.h> +#include <string.h> +#include <io.h> +#include <direct.h> + +#include <dirent.h> + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> /* for GetFileAttributes */ + +#define SUFFIX "*" +#define SLASH "\\" + +/* + * opendir + * + * Returns a pointer to a DIR structure appropriately filled in to begin + * searching a directory. + */ +DIR * +opendir (const char *szPath) +{ + DIR *nd; + unsigned int rc; + + errno = 0; + + if (!szPath) + { + errno = EFAULT; + return (DIR *) 0; + } + + if (szPath[0] == '\0') + { + errno = ENOTDIR; + return (DIR *) 0; + } + + /* Attempt to determine if the given path really is a directory. */ + rc = GetFileAttributes(szPath); + if (rc == -1) + { + /* call GetLastError for more error info */ + errno = ENOENT; + return (DIR *) 0; + } + if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) + { + /* Error, entry exists but not a directory. */ + errno = ENOTDIR; + return (DIR *) 0; + } + + /* Allocate enough space to store DIR structure and the complete + * directory path given. */ + nd = (DIR *) malloc (sizeof (DIR) + strlen (szPath) + strlen (SLASH) + + strlen (SUFFIX)); + + if (!nd) + { + /* Error, out of memory. */ + errno = ENOMEM; + return (DIR *) 0; + } + + /* Create the search expression. */ + strcpy (nd->dd_name, szPath); + + /* Add on a slash if the path does not end with one. */ + if (nd->dd_name[0] != '\0' && + nd->dd_name[strlen (nd->dd_name) - 1] != '/' && + nd->dd_name[strlen (nd->dd_name) - 1] != '\\') + { + strcat (nd->dd_name, SLASH); + } + + /* Add on the search pattern */ + strcat (nd->dd_name, SUFFIX); + + /* Initialize handle to -1 so that a premature closedir doesn't try + * to call _findclose on it. */ + nd->dd_handle = -1; + + /* Initialize the status. */ + nd->dd_stat = 0; + + /* Initialize the dirent structure. ino and reclen are invalid under + * Win32, and name simply points at the appropriate part of the + * findfirst_t structure. */ + nd->dd_dir.d_ino = 0; + nd->dd_dir.d_reclen = 0; + nd->dd_dir.d_namlen = 0; + nd->dd_dir.d_name = nd->dd_dta.name; + + return nd; +} + + +/* + * readdir + * + * Return a pointer to a dirent structure filled with the information on the + * next entry in the directory. + */ +struct dirent * +readdir (DIR * dirp) +{ + errno = 0; + + /* Check for valid DIR struct. */ + if (!dirp) + { + errno = EFAULT; + return (struct dirent *) 0; + } + + if (dirp->dd_dir.d_name != dirp->dd_dta.name) + { + /* The structure does not seem to be set up correctly. */ + errno = EINVAL; + return (struct dirent *) 0; + } + + if (dirp->dd_stat < 0) + { + /* We have already returned all files in the directory + * (or the structure has an invalid dd_stat). */ + return (struct dirent *) 0; + } + else if (dirp->dd_stat == 0) + { + /* We haven't started the search yet. */ + /* Start the search */ + dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta)); + + if (dirp->dd_handle == -1) + { + /* Whoops! Seems there are no files in that + * directory. */ + dirp->dd_stat = -1; + } + else + { + dirp->dd_stat = 1; + } + } + else + { + /* Get the next search entry. */ + if (_findnext (dirp->dd_handle, &(dirp->dd_dta))) + { + /* We are off the end or otherwise error. */ + _findclose (dirp->dd_handle); + dirp->dd_handle = -1; + dirp->dd_stat = -1; + } + else + { + /* Update the status to indicate the correct + * number. */ + dirp->dd_stat++; + } + } + + if (dirp->dd_stat > 0) + { + /* Successfully got an entry. Everything about the file is + * already appropriately filled in except the length of the + * file name. */ + dirp->dd_dir.d_namlen = strlen (dirp->dd_dir.d_name); + return &dirp->dd_dir; + } + + return (struct dirent *) 0; +} + + +/* + * closedir + * + * Frees up resources allocated by opendir. + */ +int +closedir (DIR * dirp) +{ + int rc; + + errno = 0; + rc = 0; + + if (!dirp) + { + errno = EFAULT; + return -1; + } + + if (dirp->dd_handle != -1) + { + rc = _findclose (dirp->dd_handle); + } + + /* Delete the dir structure. */ + free (dirp); + + return rc; +} + +/* + * rewinddir + * + * Return to the beginning of the directory "stream". We simply call findclose + * and then reset things like an opendir. + */ +void +rewinddir (DIR * dirp) +{ + errno = 0; + + if (!dirp) + { + errno = EFAULT; + return; + } + + if (dirp->dd_handle != -1) + { + _findclose (dirp->dd_handle); + } + + dirp->dd_handle = -1; + dirp->dd_stat = 0; +} + +/* + * telldir + * + * Returns the "position" in the "directory stream" which can be used with + * seekdir to go back to an old entry. We simply return the value in stat. + */ +long +telldir (DIR * dirp) +{ + errno = 0; + + if (!dirp) + { + errno = EFAULT; + return -1; + } + return dirp->dd_stat; +} + +/* + * seekdir + * + * Seek to an entry previously returned by telldir. We rewind the directory + * and call readdir repeatedly until either dd_stat is the position number + * or -1 (off the end). This is not perfect, in that the directory may + * have changed while we weren't looking. But that is probably the case with + * any such system. + */ +void +seekdir (DIR * dirp, long lPos) +{ + errno = 0; + + if (!dirp) + { + errno = EFAULT; + return; + } + + if (lPos < -1) + { + /* Seeking to an invalid position. */ + errno = EINVAL; + return; + } + else if (lPos == -1) + { + /* Seek past end. */ + if (dirp->dd_handle != -1) + { + _findclose (dirp->dd_handle); + } + dirp->dd_handle = -1; + dirp->dd_stat = -1; + } + else + { + /* Rewind and read forward to the appropriate index. */ + rewinddir (dirp); + + while ((dirp->dd_stat < lPos) && readdir (dirp)) + ; + } +} diff --git a/winsup/mingw/mingwex/feclearexcept.c b/winsup/mingw/mingwex/feclearexcept.c new file mode 100644 index 00000000000..e6017fc9d89 --- /dev/null +++ b/winsup/mingw/mingwex/feclearexcept.c @@ -0,0 +1,14 @@ +#include <fenv.h> + +/* 7.6.2.1 + The feclearexcept function clears the supported exceptions + represented by its argument. */ + +int feclearexcept (int excepts) +{ + fenv_t _env; + __asm__ volatile ("fnstenv %0;" : "=m" (_env)); /* get the env */ + _env.__status_word &= ~(excepts & FE_ALL_EXCEPT); /* clear the except */ + __asm__ volatile ("fldenv %0;" :: "m" (_env)); /*set the env */ + return 0; +} diff --git a/winsup/mingw/mingwex/fegetenv.c b/winsup/mingw/mingwex/fegetenv.c new file mode 100644 index 00000000000..8af5103377a --- /dev/null +++ b/winsup/mingw/mingwex/fegetenv.c @@ -0,0 +1,12 @@ +#include <fenv.h>
+
+/* 7.6.4.1
+ The fegetenv function stores the current floating-point environment
+ in the object pointed to by envp. */
+
+int fegetenv (fenv_t * envp)
+{
+ __asm__ ("fnstenv %0;": "=m" (*envp));
+ return 0;
+}
+
diff --git a/winsup/mingw/mingwex/fegetexceptflag.c b/winsup/mingw/mingwex/fegetexceptflag.c new file mode 100644 index 00000000000..353e90dfae6 --- /dev/null +++ b/winsup/mingw/mingwex/fegetexceptflag.c @@ -0,0 +1,15 @@ +#include <fenv.h> + + +/* 7.6.2.2 + The fegetexceptflag function stores an implementation-defined + representation of the exception flags indicated by the argument + excepts in the object pointed to by the argument flagp. */ + +int fegetexceptflag (fexcept_t * flagp, int excepts) +{ + unsigned short _sw; + __asm__ ("fnstsw %%ax;": "=a" (_sw)); + *flagp = _sw & excepts & FE_ALL_EXCEPT; + return 0; +} diff --git a/winsup/mingw/mingwex/fegetround.c b/winsup/mingw/mingwex/fegetround.c new file mode 100644 index 00000000000..076b1068cbd --- /dev/null +++ b/winsup/mingw/mingwex/fegetround.c @@ -0,0 +1,14 @@ +#include <fenv.h> + +/* 7.6.3.1 + The fegetround function returns the value of the rounding direction + macro representing the current rounding direction. */ + +int +fegetround (void) +{ + unsigned short _cw; + __asm__ ("fnstcw %0;" : "=m" (_cw)); + return _cw + & (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); +} diff --git a/winsup/mingw/mingwex/feholdexcept.c b/winsup/mingw/mingwex/feholdexcept.c new file mode 100644 index 00000000000..df486afb3a7 --- /dev/null +++ b/winsup/mingw/mingwex/feholdexcept.c @@ -0,0 +1,18 @@ +#include <fenv.h> + +/* 7.6.4.2 + The feholdexcept function saves the current floating-point + environment in the object pointed to by envp, clears the exception + flags, and then installs a non-stop (continue on exceptions) mode, + if available, for all exceptions. */ + +int feholdexcept (fenv_t * envp) +{ + fenv_t tmp_env; + __asm__ ("fnstenv %0;" : "=m" (* envp)); /* save current into envp */ + tmp_env = * envp; + tmp_env.__status_word &= ~FE_ALL_EXCEPT; /* clear exception flags */ + tmp_env.__control_word |= FE_ALL_EXCEPT; /* set cw to non-stop */ + __asm__ volatile ("fldenv %0;" : : "m" (tmp_env)); /* install the copy */ + return 0; +} diff --git a/winsup/mingw/mingwex/feraiseexcept.c b/winsup/mingw/mingwex/feraiseexcept.c new file mode 100644 index 00000000000..b1ba870068d --- /dev/null +++ b/winsup/mingw/mingwex/feraiseexcept.c @@ -0,0 +1,19 @@ +#include <fenv.h> + +/* 7.6.2.3 + The feraiseexcept function raises the supported exceptions + represented by its argument The order in which these exceptions + are raised is unspecified, except as stated in F.7.6. + Whether the feraiseexcept function additionally raises + the inexact exception whenever it raises the overflow + or underflow exception is implementation-defined. */ + +int feraiseexcept (int excepts) +{ + fenv_t _env; + __asm__ volatile ("fnstenv %0;" : "=m" (_env)); + _env.__status_word |= excepts & FE_ALL_EXCEPT; + __asm__ volatile ("fldenv %0;" + "fwait;" : : "m" (_env)); + return 0; +} diff --git a/winsup/mingw/mingwex/fesetenv.c b/winsup/mingw/mingwex/fesetenv.c new file mode 100644 index 00000000000..3fd7f32a40d --- /dev/null +++ b/winsup/mingw/mingwex/fesetenv.c @@ -0,0 +1,22 @@ +#include <fenv.h>
+
+/* 7.6.4.3
+ The fesetenv function establishes the floating-point environment
+ represented by the object pointed to by envp. The argument envp
+ shall point to an object set by a call to fegetenv or feholdexcept,
+ or equal the macro FE_DFL_ENV or an implementation-defined environment
+ macro. Note that fesetenv merely installs the state of the exception
+ flags represented through its argument, and does not raise these
+ exceptions. */
+
+int fesetenv (const fenv_t * envp)
+{
+ if (envp == FE_DFL_ENV)
+/* fninit initializes the control register to 0x37f,
+ the status register to zero and the tag word to 0FFFFh.
+ The other registers are unaffected */
+ __asm__("fninit"); /* is _fpreset () safer? */
+ else
+ __asm__ ("fldenv %0;" : : "m" (*envp));
+ return 0;
+}
diff --git a/winsup/mingw/mingwex/fesetexceptflag.c b/winsup/mingw/mingwex/fesetexceptflag.c new file mode 100644 index 00000000000..7f4b8e56252 --- /dev/null +++ b/winsup/mingw/mingwex/fesetexceptflag.c @@ -0,0 +1,22 @@ +#include <fenv.h> + +/* 7.6.2.4 + The fesetexceptflag function sets the complete status for those + exception flags indicated by the argument excepts, according to the + representation in the object pointed to by flagp. The value of + *flagp shall have been set by a previous call to fegetexceptflag + whose second argument represented at least those exceptions + represented by the argument excepts. This function does not raise + exceptions, but only sets the state of the flags. */ + +int fesetexceptflag (const fexcept_t * flagp, int excepts) +{ + fenv_t _env; + + excepts &= FE_ALL_EXCEPT; + __asm__ volatile ("fnstenv %0;" : "=m" (_env)); + _env.__status_word &= ~excepts; + _env.__status_word |= (*flagp & excepts); + __asm__ volatile ("fldenv %0;" : : "m" (_env)); + return 0; +} diff --git a/winsup/mingw/mingwex/fesetround.c b/winsup/mingw/mingwex/fesetround.c new file mode 100644 index 00000000000..a8cef86a4cd --- /dev/null +++ b/winsup/mingw/mingwex/fesetround.c @@ -0,0 +1,19 @@ +#include <fenv.h> + /* 7.6.3.2 + The fesetround function establishes the rounding direction + represented by its argument round. If the argument is not equal + to the value of a rounding direction macro, the rounding direction + is not changed. */ + +int fesetround (int mode) +{ + unsigned short _cw; + if ((mode & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)) + != 0) + return -1; + __asm__ volatile ("fnstcw %0;": "=m" (_cw)); + _cw &= ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO); + _cw |= mode; + __asm__ volatile ("fldcw %0;" : : "m" (_cw)); + return 0; +} diff --git a/winsup/mingw/mingwex/fetestexcept.c b/winsup/mingw/mingwex/fetestexcept.c new file mode 100644 index 00000000000..6934ed92593 --- /dev/null +++ b/winsup/mingw/mingwex/fetestexcept.c @@ -0,0 +1,15 @@ +#include <fenv.h> +/* 7.6.2.5 + The fetestexcept function determines which of a specified subset of + the exception flags are currently set. The excepts argument + specifies the exception flags to be queried. + The fetestexcept function returns the value of the bitwise OR of the + exception macros corresponding to the currently set exceptions + included in excepts. */ + +int fetestexcept (int excepts) +{ + unsigned short _sw; + __asm__ ("fnstsw %%ax" : "=a" (_sw)); + return _sw & excepts & FE_ALL_EXCEPT; +} diff --git a/winsup/mingw/mingwex/feupdateenv.c b/winsup/mingw/mingwex/feupdateenv.c new file mode 100644 index 00000000000..f414837f5fc --- /dev/null +++ b/winsup/mingw/mingwex/feupdateenv.c @@ -0,0 +1,20 @@ +#include <fenv.h> + +/* 7.6.4.4 + The feupdateenv function saves the currently raised exceptions in + its automatic storage, installs the floating-point environment + represented by the object pointed to by envp, and then raises the + saved exceptions. The argument envp shall point to an object + set by a call to feholdexcept or fegetenv, or equal the macro + FE_DFL_ENV or an implementation-defined environment macro. */ + +/* FIXME: this works but surely there must be a better way. */ + +int feupdateenv (const fenv_t * envp) +{ + unsigned int _fexcept = fetestexcept (FE_ALL_EXCEPT); /*save excepts */ + fesetenv (envp); /* install the env */ + feraiseexcept (_fexcept); /* raise the execept */ + return 0; +} + diff --git a/winsup/mingw/mingwex/fma.S b/winsup/mingw/mingwex/fma.S new file mode 100644 index 00000000000..d6226653c32 --- /dev/null +++ b/winsup/mingw/mingwex/fma.S @@ -0,0 +1,12 @@ + .file "fma.S" + .text + .align 2 + .p2align 4,,15 +.globl _fma + .def _fma; .scl 2; .type 32; .endef +_fma: + fldl 4(%esp) + fmull 12(%esp) + fldl 20(%esp) + faddp + ret diff --git a/winsup/mingw/mingwex/fmaf.S b/winsup/mingw/mingwex/fmaf.S new file mode 100644 index 00000000000..0d64ac2f107 --- /dev/null +++ b/winsup/mingw/mingwex/fmaf.S @@ -0,0 +1,12 @@ + .file "fmaf.S" + .text + .align 2 + .p2align 4,,15 +.globl _fmaf + .def _fmaf; .scl 2; .type 32; .endef +_fmaf: + flds 4(%esp) + fmuls 8(%esp) + flds 12(%esp) + faddp + ret diff --git a/winsup/mingw/mingwex/fmax.c b/winsup/mingw/mingwex/fmax.c new file mode 100644 index 00000000000..b62174d3db9 --- /dev/null +++ b/winsup/mingw/mingwex/fmax.c @@ -0,0 +1,8 @@ +#include <math.h> + + +double +fmax (double _x, double _y) +{ + return ( isgreaterequal (_x, _y)|| _isnan (_y) ? _x : _y ); +} diff --git a/winsup/mingw/mingwex/fmaxf.c b/winsup/mingw/mingwex/fmaxf.c new file mode 100644 index 00000000000..8a3c5f43441 --- /dev/null +++ b/winsup/mingw/mingwex/fmaxf.c @@ -0,0 +1,7 @@ +#include <math.h> + +float +fmaxf (float _x, float _y) +{ + return (( isgreaterequal(_x, _y) || isnan (_y)) ? _x : _y ); +} diff --git a/winsup/mingw/mingwex/fmin.c b/winsup/mingw/mingwex/fmin.c new file mode 100644 index 00000000000..7355a53836e --- /dev/null +++ b/winsup/mingw/mingwex/fmin.c @@ -0,0 +1,7 @@ +#include <math.h> + +double +fmin (double _x, double _y) +{ + return ((islessequal(_x, _y) || _isnan (_y)) ? _x : _y ); +} diff --git a/winsup/mingw/mingwex/fminf.c b/winsup/mingw/mingwex/fminf.c new file mode 100644 index 00000000000..f3d71480df1 --- /dev/null +++ b/winsup/mingw/mingwex/fminf.c @@ -0,0 +1,7 @@ +#include <math.h> + +float +fminf (float _x, float _y) +{ + return ((islessequal(_x, _y) || _isnan (_y)) ? _x : _y ); +} diff --git a/winsup/mingw/mingwex/fp_consts.c b/winsup/mingw/mingwex/fp_consts.c new file mode 100644 index 00000000000..b0f2d7c4592 --- /dev/null +++ b/winsup/mingw/mingwex/fp_consts.c @@ -0,0 +1,72 @@ +/* Floating point consts needed by STL class mumeric_limits<float> + and numeric_limits<double>. Also used as return values by nan, inf */ + + + +#include <math.h> +/* +According to IEEE 754 a QNaN has exponent bits of all 1 values and +initial significand bit of 1. A SNaN has has an exponent of all 1 +values and initial significand bit of 0 (with one or more other +significand bits of 1). An Inf has significand of 0 and +exponent of all 1 values. A denormal value has all exponent bits of 0. + +The following does _not_ follow those rules, but uses values +equal to those exported from MS C++ runtime lib, msvcprt.dll + +*/ + + +#define __DOUBLE_INF_REP { 0, 0, 0, 0x7ff0 } +#define __DOUBLE_QNAN_REP { 0, 0, 0, 0xfff8 } /* { 0, 0, 0, 0x7ff8 } */ +#define __DOUBLE_SNAN_REP { 0, 0, 0, 0xfff0 } /* { 1, 0, 0, 0x7ff0 } */ +#define __DOUBLE_DENORM_REP {1, 0, 0, 0} + +#define D_NAN_MASK 0x7ff0000000000000LL /* this will mask NaN's and Inf's */ + + +#define __FLOAT_INF_REP { 0, 0x7f80 } +#define __FLOAT_QNAN_REP { 0, 0xffc0 } /* { 0, 0x7fc0 } */ +#define __FLOAT_SNAN_REP { 0, 0xff80 } /* { 1, 0x7f80 } */ +#define __FLOAT_DENORM_REP {1,0} + +#define F_NAN_MASK 0x7f800000 + + +union _ieee_rep +{ + unsigned short rep[4] /* should this be [5] for 80-bit LD ? */; + float float_val; + double double_val; +} ; + +const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP }; +const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP }; +const union _ieee_rep __INF = { __DOUBLE_INF_REP }; +const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP }; + + +/* ISO C99 */ + +#undef nan +/* FIXME */ +double nan (const char * tagp __attribute__((unused)) ) + { return __QNAN.double_val; } + +#define __FLOAT_INF_REP { 0, 0x7f80 } +#define __FLOAT_QNAN_REP { 0, 0xffc0 } /* { 0, 0x7fc0 } */ +#define __FLOAT_SNAN_REP { 0, 0xff80 } /* { 1, 0x7f80 } */ +#define __FLOAT_DENORM_REP {1,0} + +#define F_NAN_MASK 0x7f800000 + + +const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP }; +const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP }; +const union _ieee_rep __INFF = { __FLOAT_INF_REP }; +const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP }; + +#undef nanf +/* FIXME */ +float nanf(const char * tagp __attribute__((unused)) ) + { return __QNANF.float_val;} diff --git a/winsup/mingw/mingwex/fpclassify.c b/winsup/mingw/mingwex/fpclassify.c new file mode 100644 index 00000000000..0d683f85085 --- /dev/null +++ b/winsup/mingw/mingwex/fpclassify.c @@ -0,0 +1,31 @@ +#include <math.h> + +/* 'fxam' sets FPU flags C3,C2,C0 'fstsw' stores: + FP_NAN 001 0x0100 + FP_NORMAL 010 0x0400 + FP_INFINITE 011 0x0500 + FP_ZERO 100 0x4000 + FP_SUBNORMAL 110 0x4400 + +and sets C1 flag (signbit) if neg */ + +int __fpclassify (double _x){ + unsigned short sw; + __asm__ ( + "fxam; fstsw %%ax;" + : "=a" (sw) + : "t" (_x) + ); + return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); +} + +int __fpclassifyf (float _x){ + unsigned short sw; + __asm__ ( + "fxam; fstsw %%ax;" + : "=a" (sw) + : "t" (_x) + ); + return sw & (FP_NAN | FP_NORMAL | FP_ZERO ); +} + diff --git a/winsup/mingw/mingwex/fucom.c b/winsup/mingw/mingwex/fucom.c new file mode 100644 index 00000000000..66eef58e871 --- /dev/null +++ b/winsup/mingw/mingwex/fucom.c @@ -0,0 +1,11 @@ +int +__fp_unordered_compare (double x, double y){ + unsigned short retval; + __asm__ ( + "fucom %%st(1);" + "fnstsw;" + : "=a" (retval) + : "t" (x), "u" (y) + ); + return retval; +} diff --git a/winsup/mingw/mingwex/fwide.c b/winsup/mingw/mingwex/fwide.c new file mode 100644 index 00000000000..fc8bf5bf57b --- /dev/null +++ b/winsup/mingw/mingwex/fwide.c @@ -0,0 +1,25 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + This is a minimal implementation for environments where + internationalization is not considered important. + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + +int +fwide(stream, mode) + FILE *stream; + int mode; + { + return -1; /* limited to byte orientation */ + } + diff --git a/winsup/mingw/mingwex/imaxabs.c b/winsup/mingw/mingwex/imaxabs.c new file mode 100644 index 00000000000..b643ceab6c6 --- /dev/null +++ b/winsup/mingw/mingwex/imaxabs.c @@ -0,0 +1,17 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + + This particular implementation requires the matching <inttypes.h>. +*/ + +#include <inttypes.h> + +intmax_t +imaxabs (intmax_t _j) + { return _j >= 0 ? _j : -_j; } + +long long __attribute__ ((alias ("imaxabs"))) llabs (long long); diff --git a/winsup/mingw/mingwex/imaxdiv.c b/winsup/mingw/mingwex/imaxdiv.c new file mode 100644 index 00000000000..6acfcf6cbec --- /dev/null +++ b/winsup/mingw/mingwex/imaxdiv.c @@ -0,0 +1,25 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + +*/ + +#include <inttypes.h> + +imaxdiv_t +imaxdiv(intmax_t numer, intmax_t denom) +{ + imaxdiv_t result; + result.quot = numer / denom; + result.rem = numer % denom; + return result; +} + +long long __attribute__ ((alias ("imaxdiv"))) +lldiv (long long, long long); diff --git a/winsup/mingw/mingwex/isnan.c b/winsup/mingw/mingwex/isnan.c new file mode 100644 index 00000000000..b38bc290e20 --- /dev/null +++ b/winsup/mingw/mingwex/isnan.c @@ -0,0 +1,14 @@ +#include <math.h> + +int +__isnan (double _x) +{ + unsigned short _sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (_sw) : "t" (_x)); + return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +#undef isnan +int __attribute__ ((alias ("__isnan"))) isnan (double); diff --git a/winsup/mingw/mingwex/isnanf.c b/winsup/mingw/mingwex/isnanf.c new file mode 100644 index 00000000000..73fe0eb0207 --- /dev/null +++ b/winsup/mingw/mingwex/isnanf.c @@ -0,0 +1,12 @@ +#include <math.h> +int +__isnanf (float _x) +{ + unsigned short _sw; + __asm__ ("fxam;" + "fstsw %%ax": "=a" (_sw) : "t" (_x) ); + return (_sw & (FP_NAN | FP_NORMAL | FP_INFINITE | FP_ZERO | FP_SUBNORMAL)) + == FP_NAN; +} + +int __attribute__ ((alias ("__isnanf"))) isnanf (float); diff --git a/winsup/mingw/mingwex/lltoa.c b/winsup/mingw/mingwex/lltoa.c new file mode 100644 index 00000000000..28248a834a1 --- /dev/null +++ b/winsup/mingw/mingwex/lltoa.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +char* lltoa(long long _n, char * _c, int _i) + { return _i64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/lltow.c b/winsup/mingw/mingwex/lltow.c new file mode 100644 index 00000000000..cdf45b742d2 --- /dev/null +++ b/winsup/mingw/mingwex/lltow.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +wchar_t* lltow(long long _n, wchar_t * _w, int _i) + { return _i64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/log2.c b/winsup/mingw/mingwex/log2.c new file mode 100644 index 00000000000..4f14f2614f2 --- /dev/null +++ b/winsup/mingw/mingwex/log2.c @@ -0,0 +1,8 @@ +#include <math.h> +double +log2 (double _x) +{ + double retval; + __asm__ ("fyl2x;" : "=t" (retval) : "0" (_x), "u" (1.0L) : "st(1)"); + return retval; +} diff --git a/winsup/mingw/mingwex/log2f.c b/winsup/mingw/mingwex/log2f.c new file mode 100644 index 00000000000..576396c5963 --- /dev/null +++ b/winsup/mingw/mingwex/log2f.c @@ -0,0 +1,8 @@ +#include <math.h> +float +log2f (float _x) +{ + float retval; + __asm__ ("fyl2x;" : "=t" (retval) : "0" (_x), "u" (1.0L) : "st(1)"); + return retval; +} diff --git a/winsup/mingw/mingwex/math_stubs.c b/winsup/mingw/mingwex/math_stubs.c new file mode 100644 index 00000000000..225439846fd --- /dev/null +++ b/winsup/mingw/mingwex/math_stubs.c @@ -0,0 +1,12 @@ +
+#include <math.h>
+
+double copysign (double x, double y) {return _copysign(x, y);}
+float copysignf (float x, float y) {return _copysign(x, y);}
+double logb (double x) {return _logb(x);}
+float logbf (float x) {return _logb( x );}
+double nextafter(double x, double y) {return _nextafter(x, y);}
+float nextafterf(float x, float y) {return _nextafter(x, y);}
+double scalb (double x, long i) {return _scalb (x, i);}
+float scalbf (float x, long i) {return _scalb(x, i);}
+
diff --git a/winsup/mingw/mingwex/mbsinit.c b/winsup/mingw/mingwex/mbsinit.c new file mode 100644 index 00000000000..c130afebdce --- /dev/null +++ b/winsup/mingw/mingwex/mbsinit.c @@ -0,0 +1,21 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + +int +mbsinit(ps) + const mbstate_t *ps; + { + return 1; /* don't have shift states */ + } + diff --git a/winsup/mingw/mingwex/rint.c b/winsup/mingw/mingwex/rint.c new file mode 100644 index 00000000000..a0305e18ca7 --- /dev/null +++ b/winsup/mingw/mingwex/rint.c @@ -0,0 +1,12 @@ +#include <math.h> +double rint (double x){ + double retval; + __asm__ ("frndint;" : "=t" (retval) : "0" (x)); + return retval; +} + +float rintf (float x){ + float retval; + __asm__ ("frndint;": "=t" (retval) : "0" (x)); + return retval; +} diff --git a/winsup/mingw/mingwex/round.c b/winsup/mingw/mingwex/round.c new file mode 100644 index 00000000000..2c0058394fb --- /dev/null +++ b/winsup/mingw/mingwex/round.c @@ -0,0 +1,58 @@ +#include <fenv.h>
+
+
+double
+round (double x) {
+ double retval;
+ unsigned short saved_cw, _cw;
+ __asm__ (
+ "fnstcw %0;"
+ : "=m" (saved_cw)
+ ); /* save control word */
+ _cw = ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+ | (x > 0.0 ? FE_UPWARD : FE_DOWNWARD); /* round away from zero */
+ __asm__ (
+ "fldcw %0;"
+ :
+ : "m" (_cw)
+ ); /* load the rounding control */
+ __asm__ (
+ "frndint;"
+ : "=t" (retval)
+ : "0" (x)
+ ); /* do the rounding */
+ __asm__ (
+ "fldcw %0;"
+ :
+ : "m" (saved_cw)
+ ); /* restore control word */
+ return retval;
+}
+
+float
+roundf (float x) {
+ double retval;
+ unsigned short saved_cw, _cw;
+ __asm__ (
+ "fnstcw %0;"
+ : "=m" (saved_cw)
+ ); /* save control word */
+ _cw = ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+ | (x > 0.0 ? FE_UPWARD : FE_DOWNWARD); /* round away from zero */
+ __asm__ (
+ "fldcw %0;"
+ :
+ : "m" (_cw)
+ ); /* load the rounding control */
+ __asm__ (
+ "frndint;"
+ : "=t" (retval)
+ : "0" (x)
+ ); /* do the rounding */
+ __asm__ (
+ "fldcw %0;"
+ :
+ : "m" (saved_cw)
+ ); /* restore control word */
+ return retval;
+}
diff --git a/winsup/mingw/mingwex/signbit.c b/winsup/mingw/mingwex/signbit.c new file mode 100644 index 00000000000..d22dfb677e5 --- /dev/null +++ b/winsup/mingw/mingwex/signbit.c @@ -0,0 +1,23 @@ +#define __FP_SIGNBIT 0x0200
+
+int __signbit (double x) {
+ unsigned short sw;
+ __asm__ ("fxam; fstsw %%ax;"
+ : "=a" (sw)
+ : "t" (x) );
+ return sw & __FP_SIGNBIT;
+}
+
+
+int __signbitf (float x) {
+ unsigned short sw;
+ __asm__ ("fxam; fstsw %%ax;"
+ : "=a" (sw)
+ : "t" (x) );
+ return sw & __FP_SIGNBIT;
+}
+
+
+#undef signbit
+int __attribute__ ((alias ("__signbit"))) signbit (double);
+int __attribute__ ((alias ("__signbitf"))) signbitf (float);
diff --git a/winsup/mingw/mingwex/sitest.c b/winsup/mingw/mingwex/sitest.c new file mode 100644 index 00000000000..9e06bf16464 --- /dev/null +++ b/winsup/mingw/mingwex/sitest.c @@ -0,0 +1,1527 @@ +/* + sitest -- exercise features of C99 <stdint.h> and <inttypes.h> + + This source code has been placed into the PUBLIC DOMAIN by its author. + + last edit: 1999/11/05 gwyn@arl.mil + + Tries to accommodate pre-C99 versions of <inttypes.h>. + + Takes advantage of __Q8_* symbols defined by a particular + implementation of <stdint.h>, but doesn't require them. + + NOTE: This is not a thorough validation test of the facilities. +*/ + +#include <errno.h> +#include <limits.h> /* for CHAR_BIT */ +#include <stdio.h> +#include <stddef.h> /* for ptrdiff_t */ +#include <stdlib.h> +#include <string.h> + +#include <inttypes.h> /* embeds <stdint.h> */ +#include <signal.h> /* for sig_atomic_t */ +#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ +#include <wchar.h> +#endif + +#include <inttypes.h> /* test idempotency */ + +#if 1 /* __STDC_VERSION__ >= 199901 */ +#ifndef __Q8_QT +#define __Q8_QT long long +#endif +#endif + +#ifdef PRIdMAX +#define HAVE_PRIdMAX +#ifndef __Q8_MT +#define __Q8_MT intmax_t +#endif +#else +#ifdef PRIdLEAST64 +#ifndef __Q8_MT +#define __Q8_MT int_least64_t +#endif +#define PRIdMAX PRIdLEAST64 +#else +#ifndef __Q8_MT +#define __Q8_MT long +#endif +#define PRIdMAX "ld" +#endif +#endif + +#ifdef PRIuMAX +#define HAVE_PRIuMAX +#define U__Q8_MT uintmax_t +#else +#ifdef PRIuLEAST64 +#define U__Q8_MT uint_least64_t +#define PRIuMAX PRIuLEAST64 +#else +#define U__Q8_MT unsigned long +#define PRIuMAX "lu" +#endif +#endif + +#define STR_SUB(s) #s +#define STRINGIZE(s) STR_SUB(s) /* extra level to expand argument */ + +#if defined(SCNo32) || defined(PRIo32) +static int32_t int32; +#endif +static int_least16_t intl16; +static uint_least16_t uintl16; +static uint_fast16_t uintf16; +static intmax_t intmax; +static uintmax_t uintmax; + +int +main() { + int status = 0; /* exit status to be returned */ + + /* <stdint.h> features: */ + + printf("CHAR_BIT=%u\n", (unsigned)CHAR_BIT ); + printf("sizeof(char)=%u\n", (unsigned)sizeof(char)); /* s.b. 1 */ + printf("sizeof(short)=%u\n", (unsigned)sizeof(short)); + printf("sizeof(int)=%u\n", (unsigned)sizeof(int)); + printf("sizeof(long)=%u\n", (unsigned)sizeof(long)); +#ifdef __Q8_QT + printf("sizeof(long long)=%u\n", (unsigned)sizeof(__Q8_QT)); +#endif + printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); + printf("sizeof(ptrdiff_t)=%u\n", (unsigned)sizeof(ptrdiff_t)); + printf("sizeof(size_t)=%u\n", (unsigned)sizeof(size_t)); + printf("sizeof(sig_atomic_t)=%u\n", (unsigned)sizeof(sig_atomic_t)); + printf("sizeof(wchar_t)=%u\n", (unsigned)sizeof(wchar_t)); +#if defined(WINT_MAX) || __STDC_VERSION__ >= 199901 + printf("sizeof(wint_t)=%u\n", (unsigned)sizeof(wint_t)); +#else + printf("*** wint_t isn't defined ***\n"); + status = EXIT_FAILURE; +#endif +#ifdef INT8_MAX + printf("sizeof(int8_t)=%u\n", (unsigned)sizeof(int8_t)); + printf("sizeof(uint8_t)=%u\n", (unsigned)sizeof(uint8_t)); +#endif +#ifdef INT9_MAX + printf("sizeof(int9_t)=%u\n", (unsigned)sizeof(int9_t)); + printf("sizeof(uint9_t)=%u\n", (unsigned)sizeof(uint9_t)); +#endif +#ifdef INT12_MAX + printf("sizeof(int12_t)=%u\n", (unsigned)sizeof(int12_t)); + printf("sizeof(uint12_t)=%u\n", (unsigned)sizeof(uint12_t)); +#endif +#ifdef INT16_MAX + printf("sizeof(int16_t)=%u\n", (unsigned)sizeof(int16_t)); + printf("sizeof(uint16_t)=%u\n", (unsigned)sizeof(uint16_t)); +#endif +#ifdef INT18_MAX + printf("sizeof(int18_t)=%u\n", (unsigned)sizeof(int18_t)); + printf("sizeof(uint18_t)=%u\n", (unsigned)sizeof(uint18_t)); +#endif +#ifdef INT24_MAX + printf("sizeof(int24_t)=%u\n", (unsigned)sizeof(int24_t)); + printf("sizeof(uint24_t)=%u\n", (unsigned)sizeof(uint24_t)); +#endif +#ifdef INT32_MAX + printf("sizeof(int32_t)=%u\n", (unsigned)sizeof(int32_t)); + printf("sizeof(uint32_t)=%u\n", (unsigned)sizeof(uint32_t)); +#endif +#ifdef INT36_MAX + printf("sizeof(int36_t)=%u\n", (unsigned)sizeof(int36_t)); + printf("sizeof(uint36_t)=%u\n", (unsigned)sizeof(uint36_t)); +#endif +#ifdef INT40_MAX + printf("sizeof(int40_t)=%u\n", (unsigned)sizeof(int40_t)); + printf("sizeof(uint40_t)=%u\n", (unsigned)sizeof(uint40_t)); +#endif +#ifdef INT48_MAX + printf("sizeof(int48_t)=%u\n", (unsigned)sizeof(int48_t)); + printf("sizeof(uint48_t)=%u\n", (unsigned)sizeof(uint48_t)); +#endif +#ifdef INT60_MAX + printf("sizeof(int60_t)=%u\n", (unsigned)sizeof(int60_t)); + printf("sizeof(uint60_t)=%u\n", (unsigned)sizeof(uint60_t)); +#endif +#ifdef INT64_MAX + printf("sizeof(int64_t)=%u\n", (unsigned)sizeof(int64_t)); + printf("sizeof(uint64_t)=%u\n", (unsigned)sizeof(uint64_t)); +#endif +#ifdef INT72_MAX + printf("sizeof(int72_t)=%u\n", (unsigned)sizeof(int72_t)); + printf("sizeof(uint72_t)=%u\n", (unsigned)sizeof(uint72_t)); +#endif +#ifdef INT128_MAX + printf("sizeof(int128_t)=%u\n", (unsigned)sizeof(int128_t)); + printf("sizeof(uint128_t)=%u\n", (unsigned)sizeof(uint128_t)); +#endif + printf("sizeof(int_least8_t)=%u\n", (unsigned)sizeof(int_least8_t)); + printf("sizeof(uint_least8_t)=%u\n", (unsigned)sizeof(uint_least8_t)); + printf("sizeof(int_least16_t)=%u\n", (unsigned)sizeof(int_least16_t)); + printf("sizeof(uint_least16_t)=%u\n", (unsigned)sizeof(uint_least16_t)); + printf("sizeof(int_least32_t)=%u\n", (unsigned)sizeof(int_least32_t)); + printf("sizeof(uint_least32_t)=%u\n", (unsigned)sizeof(uint_least32_t)); +#ifdef INT_LEAST64_MAX + printf("sizeof(int_least64_t)=%u\n", (unsigned)sizeof(int_least64_t)); + printf("sizeof(uint_least64_t)=%u\n", (unsigned)sizeof(uint_least64_t)); +#else + printf("*** uint_least64_t isn't defined ***\n"); + status = EXIT_FAILURE; +#endif +#ifdef INT_LEAST128_MAX + printf("sizeof(int_least128_t)=%u\n", (unsigned)sizeof(int_least128_t)); + printf("sizeof(uint_least128_t)=%u\n", + (unsigned)sizeof(uint_least128_t)); +#endif + printf("sizeof(int_fast8_t)=%u\n", (unsigned)sizeof(int_fast8_t)); + printf("sizeof(uint_fast8_t)=%u\n", (unsigned)sizeof(uint_fast8_t)); + printf("sizeof(int_fast16_t)=%u\n", (unsigned)sizeof(int_fast16_t)); + printf("sizeof(uint_fast16_t)=%u\n", (unsigned)sizeof(uint_fast16_t)); + printf("sizeof(int_fast32_t)=%u\n", (unsigned)sizeof(int_fast32_t)); + printf("sizeof(uint_fast32_t)=%u\n", (unsigned)sizeof(uint_fast32_t)); +#ifdef INT_FAST64_MAX + printf("sizeof(int_fast64_t)=%u\n", (unsigned)sizeof(int_fast64_t)); + printf("sizeof(uint_fast64_t)=%u\n", (unsigned)sizeof(uint_fast64_t)); +#else + printf("*** int_fast64_t isn't defined ***\n"); + status = EXIT_FAILURE; +#endif +#ifdef INT_FAST128_MAX + printf("sizeof(int_fast128_t)=%u\n", (unsigned)sizeof(int_fast128_t)); + printf("sizeof(uint_fast128_t)=%u\n", (unsigned)sizeof(uint_fast128_t)); +#endif +#if defined(INTPTR_MAX) + printf("sizeof(intptr_t)=%u\n", (unsigned)sizeof(intptr_t)); +#if defined(UINTPTR_MAX) + printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); +#else + printf("*** intptr_t is defined but uintptr_t isn't ***\n"); + status = EXIT_FAILURE; +#endif +#elif defined(UINTPTR_MAX) + printf("sizeof(uintptr_t)=%u\n", (unsigned)sizeof(uintptr_t)); + printf("*** uintptr_t is defined but intptr_t isn't ***\n"); + status = EXIT_FAILURE; +#else + printf("*** neither intptr_t nor uintptr_t is defined ***\n"); + status = EXIT_FAILURE; +#endif +#ifdef INTMAX_MAX + printf("sizeof(intmax_t)=%u\n", (unsigned)sizeof(intmax_t)); + printf("sizeof(uintmax_t)=%u\n", (unsigned)sizeof(uintmax_t)); +#else + printf("*** intmax_t isn't defined ***\n"); + status = EXIT_FAILURE; +#endif + +#ifdef INT8_MAX + printf("INT8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT8_MIN); + printf("INT8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT8_MAX); + printf("UINT8_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT8_MAX); +#endif +#ifdef INT9_MAX + printf("INT9_MIN=%"PRIdMAX"\n", (__Q8_MT)INT9_MIN); + printf("INT9_MAX=%"PRIdMAX"\n", (__Q8_MT)INT9_MAX); + printf("UINT9_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT9_MAX); +#endif +#ifdef INT12_MAX + printf("INT12_MIN=%"PRIdMAX"\n", (__Q8_MT)INT12_MIN); + printf("INT12_MAX=%"PRIdMAX"\n", (__Q8_MT)INT12_MAX); + printf("UINT12_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT12_MAX); +#endif +#ifdef INT16_MAX + printf("INT16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT16_MIN); + printf("INT16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT16_MAX); + printf("UINT16_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT16_MAX); +#endif +#ifdef INT18_MAX + printf("INT18_MIN=%"PRIdMAX"\n", (__Q8_MT)INT18_MIN); + printf("INT18_MAX=%"PRIdMAX"\n", (__Q8_MT)INT18_MAX); + printf("UINT18_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT18_MAX); +#endif +#ifdef INT24_MAX + printf("INT24_MIN=%"PRIdMAX"\n", (__Q8_MT)INT24_MIN); + printf("INT24_MAX=%"PRIdMAX"\n", (__Q8_MT)INT24_MAX); + printf("UINT24_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT24_MAX); +#endif +#ifdef INT32_MAX + printf("INT32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT32_MIN); + printf("INT32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT32_MAX); + printf("UINT32_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT32_MAX); +#endif +#ifdef INT36_MAX + printf("INT36_MIN=%"PRIdMAX"\n", (__Q8_MT)INT36_MIN); + printf("INT36_MAX=%"PRIdMAX"\n", (__Q8_MT)INT36_MAX); + printf("UINT36_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT36_MAX); +#endif +#ifdef INT40_MAX + printf("INT40_MIN=%"PRIdMAX"\n", (__Q8_MT)INT40_MIN); + printf("INT40_MAX=%"PRIdMAX"\n", (__Q8_MT)INT40_MAX); + printf("UINT40_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT40_MAX); +#endif +#ifdef INT48_MAX + printf("INT48_MIN=%"PRIdMAX"\n", (__Q8_MT)INT48_MIN); + printf("INT48_MAX=%"PRIdMAX"\n", (__Q8_MT)INT48_MAX); + printf("UINT48_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT48_MAX); +#endif +#ifdef INT60_MAX + printf("INT60_MIN=%"PRIdMAX"\n", (__Q8_MT)INT60_MIN); + printf("INT60_MAX=%"PRIdMAX"\n", (__Q8_MT)INT60_MAX); + printf("UINT60_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT60_MAX); +#endif +#ifdef INT64_MAX + printf("INT64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT64_MIN); + printf("INT64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT64_MAX); + printf("UINT64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT64_MAX); +#endif +#ifdef INT72_MAX + printf("INT72_MIN=%"PRIdMAX"\n", (__Q8_MT)INT72_MIN); + printf("INT72_MAX=%"PRIdMAX"\n", (__Q8_MT)INT72_MAX); + printf("UINT72_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT72_MAX); +#endif +#ifdef INT128_MAX + printf("INT128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT128_MIN); + printf("INT128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT128_MAX); + printf("UINT128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT128_MAX); +#endif + printf("INT_LEAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MIN); + printf("INT_LEAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST8_MAX); + printf("UINT_LEAST8_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_LEAST8_MAX); + printf("INT_LEAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MIN); + printf("INT_LEAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST16_MAX); + printf("UINT_LEAST16_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_LEAST16_MAX); + printf("INT_LEAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MIN); + printf("INT_LEAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST32_MAX); + printf("UINT_LEAST32_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_LEAST32_MAX); +#ifdef INT_LEAST64_MAX + printf("INT_LEAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MIN); + printf("INT_LEAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST64_MAX); + printf("UINT_LEAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST64_MAX); +#endif +#ifdef INT_LEAST128_MAX + printf("INT_LEAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MIN); + printf("INT_LEAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_LEAST128_MAX); + printf("UINT_LEAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_LEAST128_MAX); +#endif + printf("INT_FAST8_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MIN); + printf("INT_FAST8_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST8_MAX); + printf("UINT_FAST8_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_FAST8_MAX); + printf("INT_FAST16_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MIN); + printf("INT_FAST16_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST16_MAX); + printf("UINT_FAST16_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_FAST16_MAX); + printf("INT_FAST32_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MIN); + printf("INT_FAST32_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST32_MAX); + printf("UINT_FAST32_MAX=%"PRIuMAX"\n", + (U__Q8_MT)UINT_FAST32_MAX); +#ifdef INT_FAST64_MAX + printf("INT_FAST64_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MIN); + printf("INT_FAST64_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST64_MAX); + printf("UINT_FAST64_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST64_MAX); +#endif +#ifdef INT_FAST128_MAX + printf("INT_FAST128_MIN=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MIN); + printf("INT_FAST128_MAX=%"PRIdMAX"\n", (__Q8_MT)INT_FAST128_MAX); + printf("UINT_FAST128_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINT_FAST128_MAX); +#endif +#ifdef INTPTR_MAX + printf("INTPTR_MIN=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MIN); + printf("INTPTR_MAX=%"PRIdMAX"\n", (__Q8_MT)INTPTR_MAX); +#endif +#ifdef UINTPTR_MAX + printf("UINTPTR_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTPTR_MAX); +#endif +#ifdef INTMAX_MAX + printf("INTMAX_MIN=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MIN); + printf("INTMAX_MAX=%"PRIdMAX"\n", (__Q8_MT)INTMAX_MAX); + printf("UINTMAX_MAX=%"PRIuMAX"\n", (U__Q8_MT)UINTMAX_MAX); +#endif +#ifdef PTRDIFF_MAX + printf("PTRDIFF_MIN=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MIN); + printf("PTRDIFF_MAX=%"PRIdMAX"\n", (__Q8_MT)PTRDIFF_MAX); +#endif +#ifdef SIG_ATOMIC_MAX +#if SIG_ATOMIC_MIN < 0 + printf("SIG_ATOMIC_MIN=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MIN); + printf("SIG_ATOMIC_MAX=%"PRIdMAX"\n", (__Q8_MT)SIG_ATOMIC_MAX); +#else + printf("SIG_ATOMIC_MIN=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MIN); + printf("SIG_ATOMIC_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIG_ATOMIC_MAX); +#endif +#endif +#ifdef SIZE_MAX + printf("SIZE_MAX=%"PRIuMAX"\n", (U__Q8_MT)SIZE_MAX); +#endif + +#ifdef WCHAR_MAX +#if WCHAR_MIN < 0 + printf("WCHAR_MIN=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MIN); + printf("WCHAR_MAX=%"PRIdMAX"\n", (__Q8_MT)WCHAR_MAX); +#else + printf("WCHAR_MIN=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MIN); + printf("WCHAR_MAX=%"PRIuMAX"\n", (U__Q8_MT)WCHAR_MAX); +#endif +#endif +#ifdef WINT_MAX +#if WINT_MIN < 0 + printf("WINT_MIN=%"PRIdMAX"\n", (__Q8_MT)WINT_MIN); + printf("WINT_MAX=%"PRIdMAX"\n", (__Q8_MT)WINT_MAX); +#else + printf("WINT_MIN=%"PRIuMAX"\n", (U__Q8_MT)WINT_MIN); + printf("WINT_MAX=%"PRIuMAX"\n", (U__Q8_MT)WINT_MAX); +#endif +#endif + + /* + 7.18.4 Macros for integer constants + */ + + /* INTn_C for n=8 and 16 were at one point unimplementable + on most platforms, so they're treated as "optional": */ +#ifdef INT8_C + if ( INT8_C(-123) != -123 ) + printf("*** INT8_C(-123) produced %"PRIdMAX" ***\n", + (__Q8_MT)INT8_C(-123) + ); + if ( UINT8_C(123) != 123 ) + printf("*** UINT8_C(123) produced %"PRIuMAX" ***\n", + (U__Q8_MT)UINT8_C(123) + ); +#endif +#ifdef INT16_C + if ( INT16_C(-12345) != -12345 ) + printf("*** INT16_C(-12345) produced %"PRIdMAX" ***\n", + (__Q8_MT)INT16_C(-12345) + ); + if ( UINT16_C(12345) != 12345 ) + printf("*** UINT16_C(12345) produced %"PRIuMAX" ***\n", + (U__Q8_MT)UINT16_C(12345) + ); +#endif + if ( INT32_C(-123456789) != -123456789 ) + printf("*** INT32_C(-123456789) produced %"PRIdMAX" ***\n", + (__Q8_MT)INT32_C(-123456789) + ); + if ( UINT32_C(123456789) != 123456789 ) + printf("*** UINT32_C(123456789) produced %"PRIuMAX" ***\n", + (U__Q8_MT)UINT32_C(123456789) + ); +#ifdef INT_LEAST64_MAX + if ( INT64_C(-1234567890123456789) != -1234567890123456789 ) + printf("*** INT64_C(-1234567890123456789) produced %"PRIdMAX + " ***\n", + (__Q8_MT)INT64_C(-1234567890123456789) + ); + if ( UINT64_C(1234567890123456789) != 1234567890123456789 ) + printf("*** UINT64_C(1234567890123456789) produced %"PRIuMAX + " ***\n", + (U__Q8_MT)UINT64_C(1234567890123456789) + ); +#endif +#ifdef INTMAX_MAX + if ( INTMAX_C(-1234567890123456789) != -1234567890123456789 ) + printf("*** INTMAX_C(-1234567890123456789) produced %"PRIdMAX + " ***\n", + (__Q8_MT)INTMAX_C(-1234567890123456789) + ); + if ( UINTMAX_C(1234567890123456789) != 1234567890123456789 ) + printf("*** UINTMAX_C(1234567890123456789) produced %"PRIuMAX + " ***\n", + (U__Q8_MT)UINTMAX_C(1234567890123456789) + ); +#endif + + /* <inttypes.h> features: */ + +#if __STDC_VERSION__ >= 199901 + printf("sizeof(imaxdiv_t)=%u\n", (unsigned)sizeof(imaxdiv_t)); +#endif + + /* + 7.8.1 Macros for format specifiers + */ + + { + /* scanf these strings */ + static const char in_dn[] = "Z119bZ"; + static const char in_dmo[] = "Z-0119bZ"; + static const char in_dspx[] = "Z \t\n +0X119bZ"; + static const char in_dsmx[] = "Z \t\n -0x119bZ"; + static const char in_dsn[] = "Z \t\n 119bZ"; + static const char in_dp[] = "Z+119bZ"; + static const char in_dpx[] = "Z+0X119bz"; + + /* sprintf into this */ + static char buffer[1024]; + +#define SCAN(buf,fs,var,exp) if ( sscanf(buf, "Z%" fs, &var) != 1 ) \ + { \ + printf("*** " #fs "=" STR_SUB(fs) \ + " failed ***\n" \ + ); \ + status = EXIT_FAILURE; \ + } \ + else if ( var != (exp) ) \ + { \ + printf("*** " #fs "=" STR_SUB(fs) \ + " should be: " STR_SUB(exp) \ + ", was: %" fs " ***\n", var \ + ); \ + status = EXIT_FAILURE; \ + } \ + else + +#define PRINT(fs,var,exp) if ( sprintf(buffer, "%" fs, var ) <= 0 ) \ + { \ + printf("*** " #fs "=" STR_SUB(fs) \ + " failed ***\n" \ + ); \ + status = EXIT_FAILURE; \ + } \ + else if ( strcmp(buffer, STR_SUB(exp)) != 0 ) \ + { \ + printf("*** " #fs "=" STR_SUB(fs) \ + " should be: " STR_SUB(exp) \ + ", was: %s ***\n", buffer \ + ); \ + status = EXIT_FAILURE; \ + } \ + else + +#ifdef SCNo32 + SCAN(in_dn, SCNo32, int32, 9); +#endif +#ifdef PRIo32 + PRINT(PRIo32, int32, 11); +#endif + SCAN(in_dmo, SCNiLEAST16, intl16, -9); + SCAN(in_dspx, SCNdLEAST16, intl16, 0); + SCAN(in_dsmx, SCNiLEAST16, intl16, -4507); + PRINT(PRIdLEAST16, intl16, -4507); + PRINT(PRIiLEAST16, intl16, -4507); + SCAN(in_dsn, SCNxLEAST16, uintl16, 4507); + PRINT(PRIoLEAST16, uintl16, 10633); + PRINT(PRIuLEAST16, uintl16, 4507); + PRINT(PRIxLEAST16, uintl16, 119b); + PRINT(PRIXLEAST16, uintl16, 119B); + SCAN(in_dp, SCNxFAST16, uintf16, 4507); + PRINT(PRIxFAST16, uintf16, 119b); +#ifdef SCNdMAX + SCAN(in_dp, SCNdMAX, intmax, 119); +#endif +#ifdef PRIiMAX + PRINT(PRIiMAX, intmax, 119); +#endif +#ifdef SCNoMAX + SCAN(in_dpx, SCNoMAX, uintmax, 0); +#endif +#ifdef PRIxMAX + PRINT(PRIxMAX, uintmax, 0); +#endif + /* Obviously there should be a much larger battery of such tests. */ + } + +#if defined(INTMAX_MAX) /* <inttypes.h> has C99 features */ + /* + 7.8.2 Functions for greatest-width integer types + */ + + { + static struct + { + intmax_t input; + intmax_t expect; + } abs_data[] = + { +#ifdef INT8_MAX + {INT8_MAX, INT8_MAX}, + {-INT8_MAX, INT8_MAX}, + {UINT8_MAX, UINT8_MAX}, +#endif + +#ifdef INT16_MAX + { INT16_MAX, INT16_MAX}, + { -INT16_MAX, INT16_MAX}, + { UINT16_MAX, UINT16_MAX}, +#endif +#ifdef INT32_MAX + { INT32_MAX, INT32_MAX}, + { -INT32_MAX, INT32_MAX}, +#ifdef INT_LEAST64_MAX + { UINT32_MAX, UINT32_MAX}, +#endif +#endif +#ifdef INT64_MAX + { INT64_MAX, INT64_MAX}, + { -INT64_MAX, INT64_MAX}, +#endif + { INT_LEAST8_MAX, INT_LEAST8_MAX}, + { -INT_LEAST8_MAX, INT_LEAST8_MAX}, + { UINT_LEAST8_MAX, UINT_LEAST8_MAX}, + { INT_LEAST16_MAX, INT_LEAST16_MAX}, + { -INT_LEAST16_MAX, INT_LEAST16_MAX}, + { UINT_LEAST16_MAX, UINT_LEAST16_MAX}, + { INT_LEAST32_MAX, INT_LEAST32_MAX}, + { -INT_LEAST32_MAX, INT_LEAST32_MAX}, +#ifdef INT_LEAST64_MAX + { UINT_LEAST32_MAX, UINT_LEAST32_MAX}, + { INT_LEAST64_MAX, INT_LEAST64_MAX}, + { -INT_LEAST64_MAX, INT_LEAST64_MAX}, +#endif + { INT_FAST8_MAX, INT_FAST8_MAX}, + { -INT_FAST8_MAX, INT_FAST8_MAX}, + { UINT_FAST8_MAX, UINT_FAST8_MAX}, + { INT_FAST16_MAX, INT_FAST16_MAX}, + { -INT_FAST16_MAX, INT_FAST16_MAX}, + { UINT_FAST16_MAX, UINT_FAST16_MAX}, + { INT_FAST32_MAX, INT_FAST32_MAX}, + { -INT_FAST32_MAX, INT_FAST32_MAX}, +#ifdef INT_FAST64_MAX + { UINT_FAST32_MAX, UINT_FAST32_MAX}, + { INT_FAST64_MAX, INT_FAST64_MAX}, + { -INT_FAST64_MAX, INT_FAST64_MAX}, +#endif +#ifdef INTPTR_MAX + { INTPTR_MAX, INTPTR_MAX}, + { -INTPTR_MAX, INTPTR_MAX}, +#endif +#ifdef UINTPTR_MAX + { UINTPTR_MAX, UINTPTR_MAX}, +#endif + { INTMAX_MAX, INTMAX_MAX}, +#ifdef PTRDIFF_MAX + { PTRDIFF_MAX, PTRDIFF_MAX}, +#endif +#ifdef SIG_ATOMIC_MAX + { SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, +#if SIG_ATOMIC_MIN < 0 + { -SIG_ATOMIC_MAX, SIG_ATOMIC_MAX}, +#endif +#endif +#ifdef SIZE_MAX + { SIZE_MAX, SIZE_MAX}, +#endif +#ifdef WCHAR_MAX + { WCHAR_MAX, WCHAR_MAX}, +#if WCHAR_MIN < 0 + { -WCHAR_MAX, WCHAR_MAX}, +#endif +#endif +#ifdef WINT_MAX + { WINT_MAX, WINT_MAX}, +#if WINT_MIN < 0 + { -WINT_MAX, WINT_MAX}, +#endif +#endif + { 127, 127}, + { -127, 127}, + { 128, 128}, + { -127-1, 128}, + { 255, 255}, + { -256+1, 255}, + { 256, 256}, + { -256, 256}, + { 32767, 32767}, + { -32767, 32767}, + { 32768, 32768}, + { -32767-1, 32768}, + { 65535, 65535}, + { -65536+1, 65535}, + { 65536, 65536}, + { -65536, 65536}, + { 2147483647, 2147483647}, + { -2147483647, 2147483647}, + { 2147483648LL, 2147483648LL}, + { -2147483647LL-1, 2147483648LL}, +#ifdef INT_LEAST64_MAX + { 4294967295LL, 4294967295LL}, + { -4294967296LL+1, 4294967295LL}, + { 4294967296LL, 4294967296LL}, + { -4294967296LL, 4294967296LL}, + { 9223372036854775807LL, 9223372036854775807LL}, + { -9223372036854775807LL, 9223372036854775807LL}, + { 1234567890123456789LL, 1234567890123456789LL}, + { -1234567890123456789LL, 1234567890123456789LL}, +#endif + { 1, 1}, + { -1, 1}, + { 2, 2}, + { -2, 2}, + { 10, 10}, + { -10, 10}, + { 16, 16}, + { -16, 16}, + /* Other test cases can be added here. */ + {0, 0} /* terminates the list */ + }, *adp=abs_data; + int count=0; + do{ + intmax = imaxabs(adp->input); + count++; + if (intmax != adp->expect ) + { + + printf("*** imaxabs(%"PRIdMAX") failed; should be: %" + PRIdMAX", was: %"PRIdMAX" ***\n", + adp->input, adp->expect, intmax + ); + status = EXIT_FAILURE; + } + } + while ( adp++->input != 0 ); + } + + { + imaxdiv_t result; + static struct + { + intmax_t numer; + intmax_t denom; + intmax_t exp_quot; + intmax_t exp_rem; + } div_data[] = + { + { 0, 1, 0, 0}, + { 0, -1, 0, 0}, + { 0, 2, 0, 0}, + { 0, -2, 0, 0}, + { 0, 5, 0, 0}, + { 0, -5, 0, 0}, + { 1, 1, 1, 0}, + { 1, -1, -1, 0}, + { 1, 2, 0, 1}, + { 1, -2, 0, 1}, + { 1, 5, 0, 1}, + { 1, -5, 0, 1}, + { -1, 1, -1, 0}, + { -1, -1, 1, 0}, + { -1, 2, 0, -1}, + { -1, -2, 0, -1}, + { -1, 5, 0, -1}, + { -1, -5, 0, -1}, + { 2, 1, 2, 0}, + { 2, -1, -2, 0}, + { 2, 2, 1, 0}, + { 2, -2, -1, 0}, + { 2, 5, 0, 2}, + { 2, -5, 0, 2}, + { -2, 1, -2, 0}, + { -2, -1, 2, 0}, + { -2, 2, -1, 0}, + { -2, -2, 1, 0}, + { -2, 5, 0, -2}, + { -2, -5, 0, -2}, + { 17, 5, 3, 2}, + { -17, -5, 3, -2}, + { 17, -5, -3, 2}, + { -17, 5, -3, -2}, + { 2147483647, 1, 2147483647, 0}, + { -2147483647LL, 1, -2147483647LL, 0}, + { 2147483648LL, 1LL, 2147483648LL, 0LL}, + { -2147483647-1LL, 1LL, -2147483647-1LL, 0LL}, + { 2147483647LL, 2LL, 1073741823LL, 1LL}, + { -2147483647LL, 2LL, -1073741823LL, -1LL}, + { 2147483648LL, 2LL, 1073741824LL, 0LL}, + { -2147483647-1LL, 2LL, -1073741824LL, 0LL}, +#ifdef INT_LEAST64_MAX /* else might support only 32 bits */ + { 4294967295LL, 1LL, 4294967295LL, 0LL}, + { -4294967296LL+1LL, 1LL, -4294967296LL+1, 0}, + { 4294967296LL, 1, 4294967296LL, 0}, + { -4294967296LL, 1LL, -4294967296LL, 0LL}, + { 4294967295LL, -1LL, -4294967296+1LL, 0LL}, + { -4294967296+1LL, -1LL, 4294967295LL, 0LL}, + { 4294967296LL, -1LL, -4294967296LL, 0LL}, + { -4294967296LL, -1LL, 4294967296LL, 0LL}, + { 4294967295LL, 2LL, 2147483647LL, 1LL}, + { -4294967296+1LL, 2LL, -2147483647LL, -1LL}, + { 4294967296LL, 2LL, 2147483648LL, 0LL}, + { -4294967296LL, 2LL, -2147483647-1LL, 0LL}, + { 4294967295LL, 2147483647LL, 2LL, 1LL}, + { -4294967296+1LL, 2147483647LL, -2LL, -1LL}, + { 4294967296LL, 2147483647LL, 2LL, 2LL}, + { -4294967296LL, 2147483647LL, -2LL, -2LL}, + { 4294967295LL, -2147483647LL, -2LL, 1LL}, + { -4294967296+1LL, -2147483647LL, 2LL, -1LL}, + { 4294967296LL, -2147483647LL, -2LL, 2LL}, + { -4294967296LL, -2147483647LL, 2LL, -2LL}, + { 4294967295LL, 2147483648LL, 1LL, 2147483647LL}, + { -4294967296+1LL, 2147483648LL, -1LL, -2147483647LL}, + { 4294967296LL, 2147483648LL, 2LL, 0LL}, + { -4294967296LL, 2147483648LL, -2LL, 0LL}, + { 4294967295LL, -2147483647-1LL, -1LL, 2147483647LL}, + { -4294967296+1LL, -2147483647-1LL, 1LL, -2147483647LL}, + { 4294967296LL, -2147483647-1LL, -2LL, 0LL}, + { -4294967296LL, -2147483647-1LL, 2LL, 0LL}, + { 9223372036854775807LL, 1LL, 9223372036854775807LL, 0LL}, + { -9223372036854775807LL, 1LL, -9223372036854775807LL, 0LL}, + { 9223372036854775807LL, 2LL, 4611686018427387903LL, 1LL}, + { -9223372036854775807LL, 2LL, -4611686018427387903LL, -1LL}, +#endif + /* There should be a much larger battery of such tests. */ + { 0, 0, 0, 0} /* 0 denom terminates the list */ + }, *ddp; + + for ( ddp = div_data; ddp->denom != 0; ++ddp ) + if ( (result = imaxdiv(ddp->numer, ddp->denom)).quot + != ddp->exp_quot || result.rem != ddp->exp_rem + ) { + printf("*** imaxdiv(%"PRIdMAX",%"PRIdMAX + ") failed; should be: (%"PRIdMAX",%"PRIdMAX + "), was: (%"PRIdMAX",%"PRIdMAX") ***\n", + ddp->numer, ddp->denom, ddp->exp_quot, + ddp->exp_rem, result.quot, result.rem + ); + status = EXIT_FAILURE; + } + } + + { + char *endptr; + wchar_t *wendptr; + static char saved[64]; /* holds copy of input string */ + static wchar_t wnptr[64]; /* holds wide copy of test string */ + static int warned; /* "warned for null endptr" flag */ + register int i; + static struct + { + char * nptr; + int base; + intmax_t exp_val; + int exp_len; + } str_data[] = + { + { "", 0, 0, 0}, + { "", 2, 0, 0}, + { "", 8, 0, 0}, + { "", 9, 0, 0}, + { "", 10, 0, 0}, + { "", 16, 0, 0}, + { "", 36, 0, 0}, + { "0", 0, 0, 1}, + { "0", 2, 0, 1}, + { "0", 8, 0, 1}, + { "0", 9, 0, 1}, + { "0", 10, 0, 1}, + { "0", 16, 0, 1}, + { "0", 36, 0, 1}, + { "+0", 0, 0, 2}, + { "+0", 2, 0, 2}, + { "+0", 8, 0, 2}, + { "+0", 9, 0, 2}, + { "+0", 10, 0, 2}, + { "+0", 16, 0, 2}, + { "+0", 36, 0, 2}, + { "-0", 0, 0, 2}, + { "-0", 2, 0, 2}, + { "-0", 8, 0, 2}, + { "-0", 9, 0, 2}, + { "-0", 10, 0, 2}, + { "-0", 16, 0, 2}, + { "-0", 36, 0, 2}, + { "Inf", 0, 0, 0}, + { "Inf", 2, 0, 0}, + { "Inf", 8, 0, 0}, + { "Inf", 9, 0, 0}, + { "Inf", 10, 0, 0}, + { "Inf", 16, 0, 0}, + { "Inf", 36, 24171, 3}, + { "+Inf", 0, 0, 0}, + { "+Inf", 2, 0, 0}, + { "+Inf", 8, 0, 0}, + { "+Inf", 9, 0, 0}, + { "+Inf", 10, 0, 0}, + { "+Inf", 16, 0, 0}, + { "+Inf", 36, 24171, 4}, + { "-Inf", 0, 0, 0}, + { "-Inf", 2, 0, 0}, + { "-Inf", 8, 0, 0}, + { "-Inf", 9, 0, 0}, + { "-Inf", 10, 0, 0}, + { "-Inf", 16, 0, 0}, + { "-Inf", 36, -24171, 4}, + { "inf", 0, 0, 0}, + { "inf", 2, 0, 0}, + { "inf", 8, 0, 0}, + { "inf", 9, 0, 0}, + { "inf", 10, 0, 0}, + { "inf", 16, 0, 0}, + { "inf", 36, 24171, 3}, + { "+inf", 0, 0, 0}, + { "+inf", 2, 0, 0}, + { "+inf", 8, 0, 0}, + { "+inf", 9, 0, 0}, + { "+inf", 10, 0, 0}, + { "+inf", 16, 0, 0}, + { "+inf", 36, 24171, 4}, + { "-inf", 0, 0, 0}, + { "-inf", 2, 0, 0}, + { "-inf", 8, 0, 0}, + { "-inf", 9, 0, 0}, + { "-inf", 10, 0, 0}, + { "-inf", 16, 0, 0}, + { "-inf", 36, -24171, 4}, + { "119b8Z", 0, 119, 3}, + { "119bZ", 0, 119, 3}, + { "-0119bZ", 0, -9, 4}, + { " \t\n 0X119bZ", 0, 4507, 10}, + { " \t\n +0X119bZ", 0, 4507, 11}, + { " \t\n -0x119bZ", 0, -4507, 11}, + { " \t\n 119bZ", 0, 119, 7}, + { "+119bZ", 0, 119, 4}, + { "+0X119bz", 0, 4507, 7}, + { "119b8Z", 2, 3, 2}, + { "119bZ", 2, 3, 2}, + { "-0119bZ", 2, -3, 4}, + { " \t\n 0X119bZ", 2, 0, 5}, + { " \t\n +0X119bZ", 2, 0, 6}, + { " \t\n -0x119bZ", 2, 0, 6}, + { " \t\n 119bZ", 2, 3, 6}, + { "+119bZ", 2, 3, 3}, + { "+0X119bz", 2, 0, 2}, + { "119b8Z", 8, 9, 2}, + { "119bZ", 8, 9, 2}, + { "-0119bZ", 8, -9, 4}, + { " \t\n 0X119bZ", 8, 0, 5}, + { " \t\n +0X119bZ", 8, 0, 6}, + { " \t\n -0x119bZ", 8, 0, 6}, + { " \t\n 119bZ", 8, 9, 6}, + { "+119bZ", 8, 9, 3}, + { "+0X119bz", 8, 0, 2}, + { "119b8Z", 9, 10, 2}, + { "119bZ", 9, 10, 2}, + { "-0119bZ", 9, -10, 4}, + { " \t\n 0X119bZ", 9, 0, 5}, + { " \t\n +0X119bZ", 9, 0, 6}, + { " \t\n -0x119bZ", 9, 0, 6}, + { " \t\n 119bZ", 9, 10, 6}, + { "+119bZ", 9, 10, 3}, + { "+0X119bz", 9, 0, 2}, + { "119b8Z", 10, 119, 3}, + { "119bZ", 10, 119, 3}, + { "-0119bZ", 10, -119, 5}, + { " \t\n 0X119bZ", 10, 0, 5}, + { " \t\n +0X119bZ", 10, 0, 6}, + { " \t\n -0x119bZ", 10, 0, 6}, + { " \t\n 119bZ", 10, 119, 7}, + { "+119bZ", 10, 119, 4}, + { "+0X119bz", 10, 0, 2}, + { "119b8Z", 16, 72120, 5}, + { "119bZ", 16, 4507, 4}, + { "-0119bZ", 16, -4507, 6}, + { " \t\n 0X119bZ", 16, 4507, 10}, + { " \t\n +0X119bZ", 16, 4507, 11}, + { " \t\n -0x119bZ", 16, -4507, 11}, + { " \t\n 119bZ", 16, 4507,8}, + { "+119bZ", 16, 4507, 5}, + { "+0X119bz", 16, 4507, 7}, + { "119b8Z", 36, 62580275, 6}, + { "119bZ", 36, 1738367, 5}, + { "-0119bZ", 36, -1738367, 7}, + { " \t\n 0X119bZ", 36, 1997122175, 11}, + { " \t\n +0X119bZ", 36, 1997122175, 12}, + { " \t\n -0x119bZ", 36, -1997122175, 12}, + { " \t\n 119bZ", 36, 1738367, 9}, + { "+119bZ", 36, 1738367, 6}, + { "+0X119bz", 36, 1997122175, 8}, + /* There should be a much larger battery of such tests. */ + { "127", 0, 127, 3}, + { "-127", 0, -127, 4}, + { "128", 0, 128, 3}, + { "-128", 0, -127-1, 4}, + { "255", 0, 255, 3}, + { "-255", 0, -255, 4}, + { "256", 0, 256, 3}, + { "-256", 0, -255-1, 4}, + { "32767", 0, 32767, 5}, + { "-32767", 0, -32767, 6}, + { "32768", 0, 32768, 5}, + { "-32768", 0, -32767-1, 6}, + { "65535", 0, 65535, 5}, + { "-65535", 0, -65536+1, 6}, + { "65536", 0, 65536, 5}, + { "-65536", 0, -65536, 6}, + { "2147483647", 0, 2147483647, 10}, + { "-2147483647", 0, -2147483647, 11}, + { "2147483648", 0, 2147483648LL, 10}, + { "-2147483648", 0, -2147483647LL-1, 11}, + { "4294967295", 0, 4294967295LL, 10}, + { "-4294967295", 0, -4294967296LL+1, 11}, + { "4294967296", 0, 4294967296LL, 10}, + { "-4294967296", 0, -4294967296L, 11}, + { "9223372036854775807", 0, 9223372036854775807LL, 19}, + { "-9223372036854775807", 0, -9223372036854775807LL, 20}, + { "1234567890123456789", 0, 1234567890123456789LL, 19}, + { "-1234567890123456789", 0, -1234567890123456789LL, 20}, + { "1", 0, 1, 1}, + { "-1", 0, -1, 2}, + { "2", 0, 2, 1}, + { "-2", 0, -2, 2}, + { "10", 0, 10, 2}, + { "-10", 0, -10, 3}, + { "16", 0, 16, 2}, + { "-16", 0, -16, 3}, + /* Other test cases can be added here. */ + { NULL, 0, 0, 0 } /* terminates the list */ + }, *sdp; + + for ( sdp = str_data; sdp->nptr != NULL ; ++sdp ) + { + /* + 7.8.2.3 The strtoimax and strtoumax functions + */ + + strcpy(saved, sdp->nptr); + + errno = 0; /* shouldn't be changed */ + + if ( (intmax = strtoimax(sdp->nptr, &endptr, sdp->base)) + != sdp->exp_val + ) { + int save = errno; + + printf("*** strtoimax(%s,,%d) failed; should be: %" + PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, + sdp->base, sdp->exp_val, intmax + ); + status = EXIT_FAILURE; + errno = save; + } + else if ( endptr != sdp->nptr + sdp->exp_len ) + { + int save = errno; + + printf("*** strtoimax(%s,,%d) returned wrong endptr" + " ***\n", sdp->nptr, sdp->base + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + printf("*** strtoimax modified errno ***\n"); + status = EXIT_FAILURE; + } + + if ( strcmp(sdp->nptr, saved) != 0 ) + { + printf("*** strtoimax modified its input ***\n"); + status = EXIT_FAILURE; + strcpy(saved, sdp->nptr); + } + + if ( sdp->exp_val >= 0 ) /* else some sign extension */ + { + errno = 0; /* shouldn't be changed */ + + if ( (uintmax = strtoumax(sdp->nptr, &endptr, sdp->base + ) + ) != sdp->exp_val + ) { + int save = errno; + + printf("*** strtoumax(%s,,%d) failed; " + "should be: %"PRIuMAX", was: %"PRIuMAX + " ***\n", sdp->nptr, sdp->base, + sdp->exp_val, uintmax + ); + status = EXIT_FAILURE; + errno = save; + } + else if ( endptr != sdp->nptr + sdp->exp_len ) + { + int save = errno; + + printf("*** strtoumax(%s,,%d) returned wrong " + "endptr ***\n", sdp->nptr, sdp->base + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + printf("*** strtoumax modified errno ***\n"); + status = EXIT_FAILURE; + } + + if ( strcmp(sdp->nptr, saved) != 0 ) + { + printf("*** strtoumax" + " modified its input ***\n" + ); + status = EXIT_FAILURE; + strcpy(saved, sdp->nptr); + } + } + + /* tests for null endptr */ + +#define WARN() if (!warned) warned = 1, printf("*** Using null endptr: ***\n") + + warned = 0; + errno = 0; /* shouldn't be changed */ + + if ( (intmax = strtoimax(sdp->nptr, (char **)NULL, sdp->base)) + != sdp->exp_val + ) { + int save = errno; + + WARN(); + printf("*** strtoimax(%s,NULL,%d) failed; " + "should be: %"PRIdMAX", was: %"PRIdMAX" ***\n", + sdp->nptr, sdp->base, sdp->exp_val, intmax + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + WARN(); + printf("*** strtoimax modified errno ***\n"); + status = EXIT_FAILURE; + } + + if ( strcmp(sdp->nptr, saved) != 0 ) + { + WARN(); + printf("*** strtoimax modified its input ***\n"); + status = EXIT_FAILURE; + strcpy(saved, sdp->nptr); + } + + if ( sdp->exp_val >= 0 ) /* else some sign extension */ + { + errno = 0; /* shouldn't be changed */ + + if ( (uintmax = strtoumax(sdp->nptr, (char **)NULL, + sdp->base + ) + ) != sdp->exp_val + ) { + int save = errno; + + WARN(); + printf("*** strtoumax(%s,NULL,%d) failed; " + "should be: %"PRIuMAX", was: %"PRIuMAX + " ***\n", sdp->nptr, sdp->base, + sdp->exp_val, uintmax + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + WARN(); + printf("*** strtoumax modified errno ***\n"); + status = EXIT_FAILURE; + } + + if ( strcmp(sdp->nptr, saved) != 0 ) + { + WARN(); + printf("*** strtoumax" + " modified its input ***\n" + ); + status = EXIT_FAILURE; + strcpy(saved, sdp->nptr); + } + } + + /* + 7.8.2.4 The wcstoimax and wcstoumax functions + */ + + for ( i = 0; i < 64; ++i ) + if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) + break; + + errno = 0; /* shouldn't be changed */ + + if ( (intmax = wcstoimax(wnptr, &wendptr, sdp->base)) + != sdp->exp_val + ) { + int save = errno; + + printf("*** wcstoimax(%s,,%d) failed; should be: %" + PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, + sdp->base, sdp->exp_val, intmax + ); + status = EXIT_FAILURE; + errno = save; + } + else if ( wendptr != wnptr + sdp->exp_len ) + { + int save = errno; + + printf("*** wcstoimax(%s,,%d) returned wrong endptr" + " ***\n", sdp->nptr, sdp->base + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + printf("*** wcstoimax modified errno ***\n"); + status = EXIT_FAILURE; + } + + for ( i = 0; i < 64; ++i ) + if ( wnptr[i] != sdp->nptr[i] ) + { + printf("*** wcstoimax modified its input ***\n" + ); + status = EXIT_FAILURE; + + for ( ; i < 64; ++i ) + if ( (wnptr[i] = sdp->nptr[i]) == '\0' ) + break; + + break; + } + else if ( wnptr[i] == '\0' ) + break; + + if ( sdp->exp_val >= 0 ) /* else some sign extension */ + { + errno = 0; /* shouldn't be changed */ + + if ( (uintmax = wcstoumax(wnptr, &wendptr, sdp->base) + ) != sdp->exp_val + ) { + int save = errno; + + printf("*** wcstoumax(%s,,%d) failed; " + "should be: %"PRIuMAX", was: %"PRIuMAX + " ***\n", sdp->nptr, sdp->base, + sdp->exp_val, uintmax + ); + status = EXIT_FAILURE; + errno = save; + } + else if ( wendptr != wnptr + sdp->exp_len ) + { + int save = errno; + + printf("*** wcstoumax(%s,,%d) returned wrong " + "endptr ***\n", sdp->nptr, sdp->base + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + printf("*** wcstoumax modified errno ***\n"); + status = EXIT_FAILURE; + } + + for ( i = 0; i < 64; ++i ) + if ( wnptr[i] != sdp->nptr[i] ) + { + printf("*** wcstoumax" + " modified its input ***\n" + ); + status = EXIT_FAILURE; + + for ( ; i < 64; ++i ) + if ( (wnptr[i] = sdp->nptr[i]) + == '\0' + ) + break; + + break; + } + else if ( wnptr[i] == '\0' ) + break; + } + + /* tests for null endptr */ + + warned = 0; + errno = 0; /* shouldn't be changed */ + + if ( (intmax = wcstoimax(wnptr, (wchar_t **)NULL, sdp->base)) + != sdp->exp_val + ) { + int save = errno; + + WARN(); + printf("*** wcstoimax(%s,NULL,%d) failed; should be: %" + PRIdMAX", was: %"PRIdMAX" ***\n", sdp->nptr, + sdp->base, sdp->exp_val, intmax + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + WARN(); + printf("*** wcstoimax modified errno ***\n"); + status = EXIT_FAILURE; + } + + for ( i = 0; i < 64; ++i ) + if ( wnptr[i] != sdp->nptr[i] ) + { + WARN(); + printf("*** wcstoimax modified its input ***\n" + ); + status = EXIT_FAILURE; + + for ( ; i < 64; ++i ) + if ( (wnptr[i] = sdp->nptr[i]) + == '\0' + ) + break; + + break; + } + else if ( wnptr[i] == '\0' ) + break; + + if ( sdp->exp_val >= 0 ) /* else some sign extension */ + { + errno = 0; /* shouldn't be changed */ + + if ( (uintmax = wcstoumax(wnptr, (wchar_t **)NULL, + sdp->base + ) + ) != sdp->exp_val + ) { + int save = errno; + + WARN(); + printf("*** wcstoumax(%s,NULL,%d) failed; " + "should be: %"PRIuMAX", was: %"PRIuMAX + " ***\n", sdp->nptr, sdp->base, + sdp->exp_val, uintmax + ); + status = EXIT_FAILURE; + errno = save; + } + + if ( errno != 0 ) + { + WARN(); + printf("*** wcstoumax modified errno ***\n"); + status = EXIT_FAILURE; + } + + for ( i = 0; i < 64; ++i ) + if ( wnptr[i] != sdp->nptr[i] ) + { + WARN(); + printf("*** wcstoumax" + " modified its input ***\n" + ); + status = EXIT_FAILURE; + + for ( ; i < 64; ++i ) + if ( (wnptr[i] = sdp->nptr[i]) + == '\0' + ) + break; + + break; + } + else if ( wnptr[i] == '\0' ) + break; + } + } + + /* + 7.8.2.3 The strtoimax and strtoumax functions (continued) + */ + + if ( (intmax = strtoimax("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != INTMAX_MAX || errno != ERANGE + ) { + printf("*** strtoimax failed overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (intmax = strtoimax("+1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != INTMAX_MAX || errno != ERANGE + ) { + printf("*** strtoimax failed +overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (intmax = strtoimax("-1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != INTMAX_MIN || errno != ERANGE + ) { + printf("*** strtoimax failed -overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = strtoumax("1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** strtoumax failed overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = strtoumax("+1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** strtoumax failed +overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = strtoumax("-1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890", + &endptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** strtoumax failed -overflow test ***\n"); + status = EXIT_FAILURE; + } + + /* + 7.8.2.4 The wcstoimax and wcstoumax functions (continued) + */ + + if ( (intmax = wcstoimax(L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != INTMAX_MAX || errno != ERANGE + ) { + printf("*** wcstoimax failed overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (intmax = wcstoimax(L"+1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != INTMAX_MAX || errno != ERANGE + ) { + printf("*** wcstoimax failed +overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (intmax = wcstoimax(L"-1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != INTMAX_MIN || errno != ERANGE + ) { + printf("*** wcstoimax failed -overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = wcstoumax(L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** wcstoumax failed overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = wcstoumax(L"+1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** wcstoumax failed +overflow test ***\n"); + status = EXIT_FAILURE; + } + + if ( (uintmax = wcstoumax(L"-1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890" + L"1234567890123456789012345678901234567890", + &wendptr, 0 + ) + ) != UINTMAX_MAX || errno != ERANGE + ) { + printf("*** wcstoumax failed -overflow test ***\n"); + status = EXIT_FAILURE; + } + } +#endif /* defined(INTMAX_MAX) */ + + if ( status != 0 ) + fprintf(stderr, "sitest failed; see stdout for details\n"); + + return status; + } diff --git a/winsup/mingw/mingwex/strtof.c b/winsup/mingw/mingwex/strtof.c new file mode 100644 index 00000000000..62907cb198b --- /dev/null +++ b/winsup/mingw/mingwex/strtof.c @@ -0,0 +1,6 @@ +#include <stdlib.h> + +float strtof( const char *nptr, char **endptr) +{ + return (strtod(nptr, endptr)); +} diff --git a/winsup/mingw/mingwex/strtoimax.c b/winsup/mingw/mingwex/strtoimax.c new file mode 100644 index 00000000000..0cf2c01edc3 --- /dev/null +++ b/winsup/mingw/mingwex/strtoimax.c @@ -0,0 +1,112 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + + This particular implementation requires the matching <inttypes.h>. + It also assumes that character codes for A..Z and a..z are in + contiguous ascending order; this is true for ASCII but not EBCDIC. +*/ +#include <stdlib.h> +#include <errno.h> +#include <ctype.h> +#include <inttypes.h> + +/* Helper macros */ + +/* convert digit character to number, in any base */ +#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ + isupper(c) ? (c) - 'A' + 10 : \ + islower(c) ? (c) - 'a' + 10 : \ + -1 /* "invalid" flag */ \ + ) +/* validate converted digit character for specific base */ +#define valid(n, b) ((n) >= 0 && (n) < (b)) + +intmax_t +strtoimax(nptr, endptr, base) + register const char * __restrict__ nptr; + char ** __restrict__ endptr; + register int base; + { + register uintmax_t accum; /* accumulates converted value */ + register int n; /* numeral from digit character */ + int minus; /* set iff minus sign seen */ + int toobig; /* set iff value overflows */ + + if ( endptr != NULL ) + *endptr = (char *)nptr; /* in case no conversion's performed */ + + if ( base < 0 || base == 1 || base > 36 ) + { + errno = EDOM; + return 0; /* unspecified behavior */ + } + + /* skip initial, possibly empty sequence of white-space characters */ + + while ( isspace(*nptr) ) + ++nptr; + + /* process subject sequence: */ + + /* optional sign */ + if ( (minus = *nptr == '-') || *nptr == '+' ) + ++nptr; + + if ( base == 0 ) { + if ( *nptr == '0' ) { + if ( nptr[1] == 'X' || nptr[1] == 'x' ) + base = 16; + else + base = 8; + } + else + base = 10; + } + /* optional "0x" or "0X" for base 16 */ + + if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) + nptr += 2; /* skip past this prefix */ + + /* check whether there is at least one valid digit */ + + n = ToNumber(*nptr); + ++nptr; + + if ( !valid(n, base) ) + return 0; /* subject seq. not of expected form */ + + accum = n; + + for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) + if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */ + toobig = 1; /* but keep scanning */ + else + accum = base * accum + n; + + if ( endptr != NULL ) + *endptr = (char *)nptr; /* points to first not-valid-digit */ + + if ( minus ) + { + if ( accum > (uintmax_t)INTMAX_MAX + 1 ) + toobig = 1; + } + else + if ( accum > (uintmax_t)INTMAX_MAX ) + toobig = 1; + + if ( toobig ) + { + errno = ERANGE; + return minus ? INTMAX_MIN : INTMAX_MAX; + } + else + return (intmax_t)(minus ? -accum : accum); + } + +long long __attribute__ ((alias ("strtoimax"))) +strtoll (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/strtoumax.c b/winsup/mingw/mingwex/strtoumax.c new file mode 100644 index 00000000000..2c052ac06e6 --- /dev/null +++ b/winsup/mingw/mingwex/strtoumax.c @@ -0,0 +1,110 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + + This particular implementation requires the matching <inttypes.h>. + It also assumes that character codes for A..Z and a..z are in + contiguous ascending order; this is true for ASCII but not EBCDIC. +*/ +#include <stdlib.h> +#include <errno.h> +#include <ctype.h> +#include <inttypes.h> + +/* Helper macros */ + +/* convert digit character to number, in any base */ +#define ToNumber(c) (isdigit(c) ? (c) - '0' : \ + isupper(c) ? (c) - 'A' + 10 : \ + islower(c) ? (c) - 'a' + 10 : \ + -1 /* "invalid" flag */ \ + ) +/* validate converted digit character for specific base */ +#define valid(n, b) ((n) >= 0 && (n) < (b)) + +uintmax_t +strtoumax(nptr, endptr, base) + register const char * __restrict__ nptr; + char ** __restrict__ endptr; + register int base; + { + register uintmax_t accum; /* accumulates converted value */ + register uintmax_t next; /* for computing next value of accum */ + register int n; /* numeral from digit character */ + int minus; /* set iff minus sign seen (yes!) */ + int toobig; /* set iff value overflows */ + + if ( endptr != NULL ) + *endptr = (char *)nptr; /* in case no conversion's performed */ + + if ( base < 0 || base == 1 || base > 36 ) + { + errno = EDOM; + return 0; /* unspecified behavior */ + } + + /* skip initial, possibly empty sequence of white-space characters */ + + while ( isspace(*nptr) ) + ++nptr; + + /* process subject sequence: */ + + /* optional sign (yes!) */ + + if ( (minus = *nptr == '-') || *nptr == '+' ) + ++nptr; + + if ( base == 0 ) + { + if ( *nptr == '0' ) + { + if ( nptr[1] == 'X' || nptr[1] == 'x' ) + base = 16; + else + base = 8; + } + else + base = 10; + } + + /* optional "0x" or "0X" for base 16 */ + + if ( base == 16 && *nptr == '0' && (nptr[1] == 'X' || nptr[1] == 'x') ) + nptr += 2; /* skip past this prefix */ + + /* check whether there is at least one valid digit */ + + n = ToNumber(*nptr); + ++nptr; + + if ( !valid(n, base) ) + return 0; /* subject seq. not of expected form */ + + accum = n; + + for ( toobig = 0; n = ToNumber(*nptr), valid(n, base); ++nptr ) + if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ + || (next = base * accum + n) < accum /* minor wrap-around */ + ) + toobig = 1; /* but keep scanning */ + else + accum = next; + + if ( endptr != NULL ) + *endptr = (char *)nptr; /* points to first not-valid-digit */ + + if ( toobig ) + { + errno = ERANGE; + return UINTMAX_MAX; + } + else + return minus ? -accum : accum; /* (yes!) */ + } + +unsigned long long __attribute__ ((alias ("strtoumax"))) +strtoull (const char* __restrict__ nptr, char ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/testwmem.c b/winsup/mingw/mingwex/testwmem.c new file mode 100644 index 00000000000..1310718c9fc --- /dev/null +++ b/winsup/mingw/mingwex/testwmem.c @@ -0,0 +1,104 @@ +#include <memory.h> +#include <wchar.h> +#include <stdio.h> + +wchar_t fmt1[] = L" 1 2 3 4 5"; +wchar_t fmt2[] = L"12345678901234567890123456789012345678901234567890"; + +void test_wmemchr( void ) +{ + wchar_t* dest; + wint_t result; + wint_t ch = L'r'; + wchar_t str[] = L"lazy"; + wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; + + wprintf( L"Wmemchr\n" ); + wprintf( L"String to be searched:\n\t\t%s\n", string1 ); + wprintf( L"\t\t%s\n\t\t%s\n\n", fmt1, fmt2 ); + + wprintf( L"Search char:\t%c\n", ch ); + dest = wmemchr( string1, ch, sizeof( string1 ) ); + result = dest - string1 + 1; + if( dest != NULL ) + wprintf( L"Result:\t\t%c found at position %d\n\n", ch, result ); + else + wprintf( L"Result:\t\t%c not found\n\n" ); +return; +} +void test_wmemset( void ) +{/* 1 2 + 0123456789012345678901234567890 */ + wchar_t buffer[] = L"This is a test of the wmemset function"; + wprintf( L"Before: %s\n", buffer ); + wmemset( buffer+22, L'*', 7 ); + wprintf( L"After: %s\n\n", buffer ); +return; +} + +void test_wmemmove( void ) +{ + wchar_t string1[60] = L"The quick brown dog jumps over the lazy fox"; + wchar_t string2[60] = L"The quick brown fox jumps over the lazy dog"; + + wprintf( L"Wmemcpy without overlap\n" ); + wprintf( L"Source:\t\t%s\n", string1 + 40 ); + wprintf( L"Destination:\t%s\n", string1 + 16 ); + wmemcpy( string1 + 16, string1 + 40, 3 ); + wprintf( L"Result:\t\t%s\n", string1 ); + wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); + wmemcpy( string1 + 16, string2 + 40, 3 ); + + wprintf( L"Wmemmove with overlap\n" ); + wprintf( L"Source:\t\t%s\n", string2 + 4 ); + wprintf( L"Destination:\t%s\n", string2 + 10 ); + wmemmove( string2 + 10, string2 + 4, 40 ); + wprintf( L"Result:\t\t%s\n", string2 ); + wprintf( L"Length:\t\t%d characters\n\n", wcslen( string2 ) ); + + wprintf( L"Wmemcpy with overlap\n" ); + wprintf( L"Source:\t\t%s\n", string1 + 4 ); + wprintf( L"Destination:\t%s\n", string1 + 10 ); + wmemcpy( string1 + 10, string1 + 4, 40 ); + wprintf( L"Result:\t\t%s\n", string1 ); + wprintf( L"Length:\t\t%d characters\n\n", wcslen( string1 ) ); +} + + +void test_wmemcmp( void ) +{ + wchar_t first[] = L"12345678901234567890"; + wchar_t second[] = L"12345678901234567891"; + wint_t result; + wprintf(L"Wmemcmp\n"); + wprintf( L"Compare '%.19s' to '%.19s':\n", first, second ); + result = wmemcmp( first, second, 19 ); + if( result < 0 ) + wprintf( L"First is less than second.\n" ); + else if( result == 0 ) + wprintf( L"First is equal to second.\n" ); + else if( result > 0 ) + wprintf( L"First is greater than second.\n" ); + wprintf( L"\nCompare '%.20s' to '%.20s':\n", first, second ); + result = wmemcmp( first, second, 20 ); + if( result < 0 ) + wprintf( L"First is less than second.\n\n" ); + else if( result == 0 ) + wprintf( L"First is equal to second.\n\n" ); + else if( result > 0 ) + wprintf( L"First is greater than second.\n\n" ); +} + + + +int main(){ +test_wmemset(); +test_wmemmove(); +test_wmemchr(); +test_wmemcmp(); +return 0; +} + + + + diff --git a/winsup/mingw/mingwex/trunc.c b/winsup/mingw/mingwex/trunc.c new file mode 100644 index 00000000000..fac43dafb07 --- /dev/null +++ b/winsup/mingw/mingwex/trunc.c @@ -0,0 +1,31 @@ +#include <fenv.h> +#include <math.h> +double +trunc (double _x){ + double retval; + unsigned short saved_cw; + __asm__ ("fnstcw %0;": "=m" (saved_cw)); /* save FPU control word */ + __asm__ ("fldcw %0;" + : + : "m" ((saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD + | FE_TOWARDZERO)) | FE_TOWARDZERO) + ); + __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ + __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ + return retval; +} + +float +truncf (float _x){ + float retval; + unsigned short saved_cw; + __asm__ ("fnstcw %0;": "=m" (saved_cw)); /* save FPU control word */ + __asm__ ("fldcw %0;" + : + : "m" ((saved_cw & ~(FE_TONEAREST | FE_DOWNWARD | FE_UPWARD + | FE_TOWARDZERO)) | FE_TOWARDZERO) + ); + __asm__ ("frndint;" : "=t" (retval) : "0" (_x)); /* round towards zero */ + __asm__ ("fldcw %0;" : : "m" (saved_cw) ); /* restore saved control word */ + return retval; +} diff --git a/winsup/mingw/mingwex/ulltoa.c b/winsup/mingw/mingwex/ulltoa.c new file mode 100644 index 00000000000..8e90de7645a --- /dev/null +++ b/winsup/mingw/mingwex/ulltoa.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +char* ulltoa(unsigned long long _n, char * _c, int _i) + { return _ui64toa (_n, _c, _i); } diff --git a/winsup/mingw/mingwex/ulltow.c b/winsup/mingw/mingwex/ulltow.c new file mode 100644 index 00000000000..8e4f228f1df --- /dev/null +++ b/winsup/mingw/mingwex/ulltow.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +wchar_t* ulltow(unsigned long long _n, wchar_t * _w, int _i) + { return _ui64tow (_n, _w, _i); } diff --git a/winsup/mingw/mingwex/wcstof.c b/winsup/mingw/mingwex/wcstof.c new file mode 100644 index 00000000000..830f79416a5 --- /dev/null +++ b/winsup/mingw/mingwex/wcstof.c @@ -0,0 +1,6 @@ +#include <wchar.h> + +float wcstof( const wchar_t *nptr, wchar_t **endptr) +{ + return (wcstod(nptr, endptr)); +} diff --git a/winsup/mingw/mingwex/wcstoimax.c b/winsup/mingw/mingwex/wcstoimax.c new file mode 100644 index 00000000000..4b82b14a2cc --- /dev/null +++ b/winsup/mingw/mingwex/wcstoimax.c @@ -0,0 +1,119 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + + This particular implementation requires the matching <inttypes.h>. + It also assumes that character codes for A..Z and a..z are in + contiguous ascending order; this is true for ASCII but not EBCDIC. +*/ + +#include <wchar.h> +#include <errno.h> +#include <ctype.h> +#include <inttypes.h> + +/* convert digit wide character to number, in any base */ + +#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ + iswupper(c) ? (c) - L'A' + 10 : \ + iswlower(c) ? (c) - L'a' + 10 : \ + -1 /* "invalid" flag */ \ + ) + +/* validate converted digit character for specific base */ +#define valid(n, b) ((n) >= 0 && (n) < (b)) + +intmax_t +wcstoimax(nptr, endptr, base) + register const wchar_t * __restrict__ nptr; + wchar_t ** __restrict__ endptr; + register int base; + { + register uintmax_t accum; /* accumulates converted value */ + register int n; /* numeral from digit character */ + int minus; /* set iff minus sign seen */ + int toobig; /* set iff value overflows */ + + if ( endptr != NULL ) + *endptr = (wchar_t *)nptr; /* in case no conv performed */ + + if ( base < 0 || base == 1 || base > 36 ) + { + errno = EDOM; + return 0; /* unspecified behavior */ + } + + /* skip initial, possibly empty sequence of white-space w.characters */ + + while ( iswspace(*nptr) ) + ++nptr; + + /* process subject sequence: */ + + /* optional sign */ + + if ( (minus = *nptr == L'-') || *nptr == L'+' ) + ++nptr; + + if ( base == 0 ) + { + if ( *nptr == L'0' ) + { + if ( nptr[1] == L'X' || nptr[1] == L'x' ) + base = 16; + else + base = 8; + } + else + base = 10; + } + /* optional "0x" or "0X" for base 16 */ + + if ( base == 16 && *nptr == L'0' + && (nptr[1] == L'X' || nptr[1] == L'x') + ) + nptr += 2; /* skip past this prefix */ + + /* check whether there is at least one valid digit */ + + n = ToWNumber(*nptr); + ++nptr; + + if ( !valid(n, base) ) + return 0; /* subject seq. not of expected form */ + + accum = n; + + for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) + if ( accum > INTMAX_MAX / base + 2 ) /* major wrap-around */ + toobig = 1; /* but keep scanning */ + else + accum = base * accum + n; + + if ( endptr != NULL ) + *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ + + if ( minus ) + { + if ( accum > (uintmax_t)INTMAX_MAX + 1 ) + toobig = 1; + } + else + if ( accum > (uintmax_t)INTMAX_MAX ) + toobig = 1; + + if ( toobig ) + { + errno = ERANGE; + return minus ? INTMAX_MIN : INTMAX_MAX; + } + else + return (intmax_t)(minus ? -accum : accum); + } + +long long __attribute__ ((alias ("wcstoimax"))) +wcstoll (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wcstoumax.c b/winsup/mingw/mingwex/wcstoumax.c new file mode 100644 index 00000000000..9bd6cd704eb --- /dev/null +++ b/winsup/mingw/mingwex/wcstoumax.c @@ -0,0 +1,113 @@ +/* + This source code was extracted from the Q8 package created and + placed in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E). + + This particular implementation requires the matching <inttypes.h>. + It also assumes that character codes for A..Z and a..z are in + contiguous ascending order; this is true for ASCII but not EBCDIC. +*/ + +#include <wchar.h> +#include <errno.h> +#include <ctype.h> +#include <inttypes.h> + +/* convert digit wide character to number, in any base */ + +#define ToWNumber(c) (iswdigit(c) ? (c) - L'0' : \ + iswupper(c) ? (c) - L'A' + 10 : \ + iswlower(c) ? (c) - L'a' + 10 : \ + -1 /* "invalid" flag */ \ + ) + +/* validate converted digit character for specific base */ +#define valid(n, b) ((n) >= 0 && (n) < (b)) + +uintmax_t +wcstoumax(nptr, endptr, base) + register const wchar_t * __restrict__ nptr; + wchar_t ** __restrict__ endptr; + register int base; + { + register uintmax_t accum; /* accumulates converted value */ + register uintmax_t next; /* for computing next value of accum */ + register int n; /* numeral from digit character */ + int minus; /* set iff minus sign seen (yes!) */ + int toobig; /* set iff value overflows */ + + if ( endptr != NULL ) + *endptr = (wchar_t *)nptr; /* in case no conv performed */ + + if ( base < 0 || base == 1 || base > 36 ) + { + errno = EDOM; + return 0; /* unspecified behavior */ + } + + /* skip initial, possibly empty sequence of white-space w.characters */ + + while ( iswspace(*nptr) ) + ++nptr; + + /* process subject sequence: */ + + /* optional sign */ + + if ( (minus = *nptr == L'-') || *nptr == L'+' ) + ++nptr; + + if ( base == 0 ) + { + if ( *nptr == L'0' ) + { + if ( nptr[1] == L'X' || nptr[1] == L'x' ) + base = 16; + else + base = 8; + } + else + base = 10; + } + /* optional "0x" or "0X" for base 16 */ + + if ( base == 16 && *nptr == L'0' + && (nptr[1] == L'X' || nptr[1] == L'x') + ) + nptr += 2; /* skip past this prefix */ + + /* check whether there is at least one valid digit */ + + n = ToWNumber(*nptr); + ++nptr; + + if ( !valid(n, base) ) + return 0; /* subject seq. not of expected form */ + + accum = n; + + for ( toobig = 0; n = ToWNumber(*nptr), valid(n, base); ++nptr ) + if ( accum > UINTMAX_MAX / base + 1 /* major wrap-around */ + || (next = base * accum + n) < accum /* minor wrap-around */ + ) + toobig = 1; /* but keep scanning */ + else + accum = next; + + if ( endptr != NULL ) + *endptr = (wchar_t *)nptr; /* -> first not-valid-digit */ + + if ( toobig ) + { + errno = ERANGE; + return UINTMAX_MAX; + } + else + return minus ? -accum : accum; /* (yes!) */ + } + +unsigned long long __attribute__ ((alias ("wcstoumax"))) +wcstoull (const wchar_t* __restrict__ nptr, wchar_t ** __restrict__ endptr, int base); diff --git a/winsup/mingw/mingwex/wmemchr.c b/winsup/mingw/mingwex/wmemchr.c new file mode 100644 index 00000000000..dc5cedd239f --- /dev/null +++ b/winsup/mingw/mingwex/wmemchr.c @@ -0,0 +1,28 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + +wchar_t* +wmemchr(s, c, n) + register const wchar_t *s; + register wchar_t c; + register size_t n; + { + if ( s != NULL ) + for ( ; n > 0; ++s, --n ) + if ( *s == c ) + return (wchar_t *)s; + + return NULL; + } + diff --git a/winsup/mingw/mingwex/wmemcmp.c b/winsup/mingw/mingwex/wmemcmp.c new file mode 100644 index 00000000000..e1e034c7ba2 --- /dev/null +++ b/winsup/mingw/mingwex/wmemcmp.c @@ -0,0 +1,32 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + +int +wmemcmp(s1, s2, n) + register const wchar_t *s1; + register const wchar_t *s2; + size_t n; + { + if ( n == 0 || s1 == s2 ) + return 0; /* even for NULL pointers */ + + if ( (s1 != NULL) != (s2 != NULL) ) + return s2 == NULL ? 1 : -1; /* robust */ + + for ( ; n > 0; ++s1, ++s2, --n ) + if ( *s1 != *s2 ) + return *s1 - *s2; + + return 0; + } diff --git a/winsup/mingw/mingwex/wmemcpy.c b/winsup/mingw/mingwex/wmemcpy.c new file mode 100644 index 00000000000..d7e7b4cb3e9 --- /dev/null +++ b/winsup/mingw/mingwex/wmemcpy.c @@ -0,0 +1,32 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + + +wchar_t * +wmemcpy(s1, s2, n) + register wchar_t * __restrict__ s1; + register const wchar_t * __restrict__ s2; + register size_t n; + { + wchar_t *orig_s1 = s1; + + if ( s1 == NULL || s2 == NULL || n == 0 ) + return orig_s1; /* robust */ + + for ( ; n > 0; --n ) + *s1++ = *s2++; + + return orig_s1; + } + diff --git a/winsup/mingw/mingwex/wmemmove.c b/winsup/mingw/mingwex/wmemmove.c new file mode 100644 index 00000000000..3c545ac3206 --- /dev/null +++ b/winsup/mingw/mingwex/wmemmove.c @@ -0,0 +1,43 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <wchar.h> + +wchar_t * +wmemmove(s1, s2, n) + register wchar_t *s1; + register const wchar_t *s2; + register size_t n; + { + wchar_t *orig_s1 = s1; + + if ( s1 == NULL || s2 == NULL || n == 0 ) + return orig_s1; /* robust */ + + /* XXX -- The following test works only within a flat address space! */ + if ( s2 >= s1 ) + for ( ; n > 0; --n ) + *s1++ = *s2++; + else { + s1 += n; + s2 += n; + + for ( ; n > 0; --n ) + *--s1 = *--s2; + } + + return orig_s1; + } + diff --git a/winsup/mingw/mingwex/wmemset.c b/winsup/mingw/mingwex/wmemset.c new file mode 100644 index 00000000000..dadd9fb072f --- /dev/null +++ b/winsup/mingw/mingwex/wmemset.c @@ -0,0 +1,30 @@ +/* This source code was extracted from the Q8 package created and placed + in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil> + last edit: 1999/11/05 gwyn@arl.mil + + Implements subclause 7.24 of ISO/IEC 9899:1999 (E). + + It supports an encoding where all char codes are mapped + to the *same* code values within a wchar_t or wint_t, + so long as no other wchar_t codes are used by the program. + +*/ + +#include <wchar.h> + + +wchar_t * +wmemset(s, c, n) + register wchar_t *s; + register wchar_t c; + register size_t n; + { + wchar_t *orig_s = s; + + if ( s != NULL ) + for ( ; n > 0; --n ) + *s++ = c; + + return orig_s; + } + diff --git a/winsup/mingw/mingwex/wtoll.c b/winsup/mingw/mingwex/wtoll.c new file mode 100644 index 00000000000..48f856245f8 --- /dev/null +++ b/winsup/mingw/mingwex/wtoll.c @@ -0,0 +1,3 @@ +#include <stdlib.h> +long long wtoll(const wchar_t * _w) + { return _wtoi64 (_w); }; |