diff options
Diffstat (limited to 'libc')
55 files changed, 135 insertions, 154 deletions
diff --git a/libc/inet/Makefile b/libc/inet/Makefile index 67699506a..efc8cb621 100644 --- a/libc/inet/Makefile +++ b/libc/inet/Makefile @@ -24,7 +24,7 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak -ifeq ($(strip $(INCLUDE_RPC)),true) +ifeq ($(strip $(UCLIBC_HAS_RPC)),y) DIRS=rpc else DIRS= diff --git a/libc/inet/rpc/Makefile b/libc/inet/rpc/Makefile index 67691e4b6..0cfa64d8d 100644 --- a/libc/inet/rpc/Makefile +++ b/libc/inet/rpc/Makefile @@ -25,20 +25,7 @@ TOPDIR=../../../ include $(TOPDIR)Rules.mak CFLAGS+=-I$(TOPDIR)libpthread/linuxthreads/sysdeps/pthread -# If INCLUDE_FULL_RPC is not defined, default to `false' if shared -# libraries are enabled, and `true' otherwise (because the main -# advantage of not including everything is that it reduces the size of -# shared libraries; the size of static libraries doesn't typically -# matter as much, since they need not be present at runtime). -ifeq ($(strip $(INCLUDE_FULL_RPC)),) - ifeq ($(strip $(HAVE_SHARED)),false) - INCLUDE_FULL_RPC = true - else - INCLUDE_FULL_RPC = false - endif -endif - -ifeq ($(strip $(INCLUDE_FULL_RPC)),true) +ifeq ($(strip $(UCLIBC_HAS_FULL_RPC)),y) CSRC :=auth_none.c auth_unix.c authunix_prot.c bindresvport.c \ clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c clnt_tcp.c \ clnt_udp.c rpc_dtablesize.c get_myaddress.c getrpcent.c getrpcport.c \ diff --git a/libc/misc/Makefile b/libc/misc/Makefile index 8278a5767..2a74a4e54 100644 --- a/libc/misc/Makefile +++ b/libc/misc/Makefile @@ -28,13 +28,13 @@ include $(TOPDIR)Rules.mak DIRS = assert ctype dirent file fnmatch glob internals lsearch \ mntent syslog time utmp tsearch locale sysvipc statfs \ error insremque ttyent gnu -ifeq ($(strip $(INCLUDE_REGEX)),true) +ifeq ($(strip $(UCLIBC_HAS_REGEX)),y) DIRS += regex endif -ifeq ($(strip $(INCLUDE_THREADS)),true) +ifeq ($(strip $(UCLIBC_HAS_THREADS)),y) DIRS += pthread endif -ifeq ($(strip $(HAS_WCHAR)),true) +ifeq ($(strip $(UCLIBC_HAS_WCHAR)),y) DIRS += wctype wchar endif diff --git a/libc/misc/dirent/alphasort64.c b/libc/misc/dirent/alphasort64.c index e98d7138a..bcae8108f 100644 --- a/libc/misc/dirent/alphasort64.c +++ b/libc/misc/dirent/alphasort64.c @@ -1,5 +1,5 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 @@ -22,5 +22,5 @@ int alphasort64(const void * a, const void * b) return strcmp ((*(const struct dirent64 **) a)->d_name, (*(const struct dirent64 **) b)->d_name); } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/misc/dirent/readdir64.c b/libc/misc/dirent/readdir64.c index b845b8139..d30a4398f 100644 --- a/libc/misc/dirent/readdir64.c +++ b/libc/misc/dirent/readdir64.c @@ -1,5 +1,5 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 @@ -68,4 +68,4 @@ all_done: return de; } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/misc/dirent/readdir64_r.c b/libc/misc/dirent/readdir64_r.c index 6735db8d8..f4aeb7869 100644 --- a/libc/misc/dirent/readdir64_r.c +++ b/libc/misc/dirent/readdir64_r.c @@ -1,5 +1,5 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 @@ -75,5 +75,5 @@ all_done: #endif return((de != NULL)? 0 : ret); } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c index 476193c94..d7543a61e 100644 --- a/libc/misc/dirent/scandir64.c +++ b/libc/misc/dirent/scandir64.c @@ -24,7 +24,7 @@ */ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 @@ -99,5 +99,5 @@ int scandir64(const char *dir, struct dirent64 ***namelist, return pos; } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c index 56d48444d..c053de4f0 100644 --- a/libc/misc/glob/glob64.c +++ b/libc/misc/glob/glob64.c @@ -1,6 +1,6 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index a33afef60..1e772ce60 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -43,7 +43,7 @@ ar-target: $(OBJS) interp.c: Makefile echo "/* Force shared libraries to know about the correct library loader */" > interp.c echo "#include <features.h>" >> interp.c - echo "#ifdef HAVE_ELF" >> interp.c + echo "#ifdef __HAVE_ELF__" >> interp.c echo "const char __dl_ldso__[] __attribute__ ((section " \ "(\".interp\"))) =\""$(DYNAMIC_LINKER)"\";" >> interp.c echo "#endif" >> interp.c diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c index 31b16c18a..236a62e85 100644 --- a/libc/misc/internals/tempname.c +++ b/libc/misc/internals/tempname.c @@ -189,7 +189,7 @@ int __gen_tempname (char *tmpl, int kind) case __GT_FILE: fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); break; -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ case __GT_BIGFILE: fd = open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); break; diff --git a/libc/misc/locale/Makefile b/libc/misc/locale/Makefile index 881b0c0e5..29c8cd5a0 100644 --- a/libc/misc/locale/Makefile +++ b/libc/misc/locale/Makefile @@ -29,7 +29,7 @@ MOBJ= setlocale.o localeconv.o _locale_init.o nl_langinfo.o OBJS= $(MOBJ) -ifeq ($(HAS_LOCALE),true) +ifeq ($(UCLIBC_HAS_LOCALE),y) OBJS += locale_data.o endif @@ -47,7 +47,7 @@ $(MOBJ): $(MSRC) $(OBJS): Makefile data: -ifeq ($(HAS_LOCALE),true) +ifeq ($(UCLIBC_HAS_LOCALE),y) make -C $(TOPDIR)/extra/locale endif diff --git a/libc/misc/statfs/Makefile b/libc/misc/statfs/Makefile index e8fcf21e4..89eb7fd89 100644 --- a/libc/misc/statfs/Makefile +++ b/libc/misc/statfs/Makefile @@ -22,7 +22,7 @@ TOPDIR=../../../ include $(TOPDIR)Rules.mak -ifeq ($(strip $(DOLFS)),true) +ifeq ($(strip $(UCLIBC_HAS_LFS)),y) CSRC = fstatfs64.c statfs64.c statvfs.c statvfs64.c fstatvfs.c fstatvfs64.c else CSRC = statvfs.c fstatvfs.c diff --git a/libc/misc/statfs/fstatfs64.c b/libc/misc/statfs/fstatfs64.c index acc25d2e0..1040e1fe1 100644 --- a/libc/misc/statfs/fstatfs64.c +++ b/libc/misc/statfs/fstatfs64.c @@ -19,7 +19,7 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS @@ -62,5 +62,5 @@ int fstatfs64 (int fd, struct statfs64 *buf) return 0; } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/misc/statfs/fstatvfs64.c b/libc/misc/statfs/fstatvfs64.c index 84f68ae9b..ed4b63234 100644 --- a/libc/misc/statfs/fstatvfs64.c +++ b/libc/misc/statfs/fstatvfs64.c @@ -19,7 +19,7 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 diff --git a/libc/misc/statfs/statfs64.c b/libc/misc/statfs/statfs64.c index b237624c3..0b954c675 100644 --- a/libc/misc/statfs/statfs64.c +++ b/libc/misc/statfs/statfs64.c @@ -36,7 +36,7 @@ #include <stddef.h> #include <sys/statfs.h> -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ /* Return information about the filesystem on which FILE resides. */ int statfs64 (const char *file, struct statfs64 *buf) diff --git a/libc/misc/statfs/statvfs64.c b/libc/misc/statfs/statvfs64.c index 1e3ec0a36..78d1a4c3f 100644 --- a/libc/misc/statfs/statvfs64.c +++ b/libc/misc/statfs/statvfs64.c @@ -19,7 +19,7 @@ #include <features.h> -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 diff --git a/libc/misc/time/Makefile b/libc/misc/time/Makefile index 841c19600..b187e5555 100644 --- a/libc/misc/time/Makefile +++ b/libc/misc/time/Makefile @@ -29,7 +29,7 @@ MOBJ= asctime.o asctime_r.o clock.o ctime.o ctime_r.o gmtime.o gmtime_r.o \ localtime.o localtime_r.o mktime.o strftime.o strptime.o tzset.o \ _time_t2tm.o __time_tm.o _time_mktime.o -ifeq ($(HAS_FLOATING_POINT),true) +ifeq ($(UCLIBC_HAS_FLOATS),y) MOBJ += difftime.o endif diff --git a/libc/pwd_grp/Makefile b/libc/pwd_grp/Makefile index 5efa1414e..c34142d6b 100644 --- a/libc/pwd_grp/Makefile +++ b/libc/pwd_grp/Makefile @@ -28,7 +28,7 @@ CSRC= pwent.c getpwnam.c getpwuid.c putpwent.c getpw.c fgetpwent.c \ __getgrent.c grent.c getgrnam.c getgrgid.c fgetgrent.c \ initgroups.c __getpwent_r.c -ifeq ($(HAS_SHADOW),true) +ifeq ($(HAS_SHADOW),y) CSRC+= lckpwdf.c spent.c getspnam.c getspuid.c putspent.c sgetspent.c \ fgetspent.c __getspent_r.c __sgetspent_r.c endif diff --git a/libc/stdio/Makefile b/libc/stdio/Makefile index 011f3a7f8..09cb0710a 100644 --- a/libc/stdio/Makefile +++ b/libc/stdio/Makefile @@ -24,21 +24,8 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak -# Set to true to use the old vfprintf instead of the new. The old is roughly -# C89 compliant, but doesn't deal with qualifiers on %n and doesn't deal with -# %h correctly or %hh at all on the interger conversions. But on i386 it is -# over 1.5k smaller than the new code. Of course, the new code fixes the -# above mentioned deficiencies and adds custom specifier support similar to -# glibc, as well as handling positional args. This option is here temporarily -# until the configuration system gets rewritten. Note also that the old -# vfprintf code will be rewritten at some point to bring it into at least C89 -# standards compliance. - -USE_OLD_VFPRINTF = false - # Note: The *64.o objects are empty when compiled without large file support. -# To not build them at all, remove the appropriate line from the MOBJ -# definition and uncomment the DOLFS test below. +# # Note: Use the libpthreads of: flockfile.o ftrylockfile.o funlockfile.o # Also, maybe move __fsetlocking.o as well? @@ -60,15 +47,11 @@ MOBJ = fclose.o fflush.o fopen.o freopen.o perror.o remove.o \ _stdio_fsfopen.o _stdio_fdout.o _uintmaxtostr.o _stdio_strerror_r.o \ getdelim.o getline.o ctermid.o -# ifeq ($(DOLFS),true) -# MOBJ += fopen64.o freopen64.o ftello64.o fseeko64.o fsetpos64.o fgetpos64.o -# endif - MSRC2= printf.c MOBJ2= vsnprintf.o vdprintf.o vasprintf.o vprintf.o vsprintf.o \ fprintf.o snprintf.o dprintf.o asprintf.o printf.o sprintf.o -ifneq ($(USE_OLD_VFPRINTF),true) +ifneq ($(USE_OLD_VFPRINTF),y) MOBJ2 += _ppfs_init.o _ppfs_prepargs.o _ppfs_setargs.o \ _ppfs_parsespec.o _do_one_spec.o vfprintf.o \ _store_inttype.o _load_inttype.o \ @@ -77,7 +60,7 @@ endif -ifeq ($(HAS_FLOATING_POINT),true) +ifeq ($(UCLIBC_HAS_FLOATS),y) MOBJ2 += _dtostr.o endif @@ -85,7 +68,7 @@ MSRC3=scanf.c MOBJ3=scanf.o sscanf.o fscanf.o vscanf.o vsscanf.o vfscanf.o CSRC=popen.c tmpfile.c tmpnam.c tmpnam_r.c tempnam.c -ifeq ($(USE_OLD_VFPRINTF),true) +ifeq ($(USE_OLD_VFPRINTF),y) CSRC += old_vfprintf.c endif COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/stdio/tmpfile.c b/libc/stdio/tmpfile.c index d7940b139..5484d5d6c 100644 --- a/libc/stdio/tmpfile.c +++ b/libc/stdio/tmpfile.c @@ -46,6 +46,6 @@ FILE * tmpfile (void) return f; } -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ weak_alias(tmpfile, tmpfile64); #endif diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile index aa311afcb..5bf12b322 100644 --- a/libc/stdlib/Makefile +++ b/libc/stdlib/Makefile @@ -24,15 +24,21 @@ TOPDIR=../../ include $(TOPDIR)Rules.mak -DIRS = $(MALLOC) -ALL_SUBDIRS = malloc malloc-930716 +DIRS:= +ifeq ($(MALLOC),y) + DIRS+=malloc +endif +ifeq ($(MALLOC_930716),y) + DIRS+=malloc-930716 +endif + MSRC = stdlib.c MOBJ = abs.o labs.o atoi.o atol.o strtol.o strtoul.o _stdlib_strto_l.o \ qsort.o bsearch.o MOBJ += llabs.o atoll.o strtoll.o strtoull.o _stdlib_strto_ll.o -ifeq ($(HAS_WCHAR),true) +ifeq ($(UCLIBC_HAS_WCHAR),y) MOBJ += mblen.o mbtowc.o wctomb.o mbstowcs.o wcstombs.o \ _stdlib_mb_cur_max.o endif @@ -46,7 +52,7 @@ CSRC = abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c mkstemp64.c \ drand48_r.c erand48.c erand48_r.c jrand48.c jrand48_r.c lrand48.c \ lrand48_r.c mrand48.c mrand48_r.c nrand48.c nrand48_r.c rand_r.c \ srand48.c srand48_r.c calloc.c valloc.c -ifeq ($(HAS_FLOATING_POINT),true) +ifeq ($(UCLIBC_HAS_FLOATS),y) CSRC += strtod.c strtof.c strtold.c endif COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/stdlib/getpt.c b/libc/stdlib/getpt.c index f4e52f672..71d7d6c5f 100644 --- a/libc/stdlib/getpt.c +++ b/libc/stdlib/getpt.c @@ -23,7 +23,7 @@ #include <unistd.h> #include <paths.h> -#if !defined ASSUME_DEVPTS +#if !defined __ASSUME_DEVPTS__ # include <sys/statfs.h> /* Constant that identifies the `devpts' filesystem. */ @@ -37,7 +37,7 @@ /* Directory containing the UNIX98 pseudo terminals. */ #define _PATH_DEVPTS _PATH_DEV "pts" -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ /* Prototype for function that opens BSD-style master pseudo-terminals. */ int __bsd_getpt (void); #endif @@ -46,19 +46,19 @@ int __bsd_getpt (void); int getpt (void) { -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ static int have_no_dev_ptmx; #endif int fd; -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ if (!have_no_dev_ptmx) #endif { fd = open (_PATH_DEVPTMX, O_RDWR); if (fd != -1) { -#if defined ASSUME_DEVPTS +#if defined __ASSUME_DEVPTS__ return fd; #else struct statfs fsbuf; @@ -80,14 +80,14 @@ getpt (void) /* If /dev/pts is not mounted then the UNIX98 pseudo terminals are not usable. */ close (fd); -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ have_no_dev_ptmx = 1; #endif #endif } else { -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ if (errno == ENOENT || errno == ENODEV) have_no_dev_ptmx = 1; else @@ -96,12 +96,12 @@ getpt (void) } } -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ return __bsd_getpt (); #endif } -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ # define PTYNAME1 "pqrstuvwxyzabcde"; # define PTYNAME2 "0123456789abcdef"; diff --git a/libc/stdlib/grantpt.c b/libc/stdlib/grantpt.c index d49f0af4f..5b4427a0c 100644 --- a/libc/stdlib/grantpt.c +++ b/libc/stdlib/grantpt.c @@ -19,10 +19,10 @@ #include <limits.h> #include <stdlib.h> -/* If ASSUME_DEVPTS is defined, grantpt() reduces to a stub since we +/* If __ASSUME_DEVPTS__ is defined, grantpt() reduces to a stub since we assume that the devfs/devpts filesystem automatically manages the permissions. */ -#if !defined ASSUME_DEVPTS +#if !defined __ASSUME_DEVPTS__ #include <sys/statfs.h> /* Constant that identifies the `devpts' filesystem. */ @@ -47,7 +47,7 @@ static int pts_name (int fd, char **pts, size_t buf_len); int grantpt (int fd) { -#if !defined ASSUME_DEVPTS +#if !defined __ASSUME_DEVPTS__ struct statfs fsbuf; # ifdef PATH_MAX char _buf[PATH_MAX]; @@ -70,7 +70,7 @@ grantpt (int fd) return 0; } -#if !defined ASSUME_DEVPTS +#if !defined __ASSUME_DEVPTS__ # define grantpt __unix_grantpt # include "unix_grantpt.c" #endif diff --git a/libc/stdlib/ptsname.c b/libc/stdlib/ptsname.c index 7f9b04e93..2472edb3f 100644 --- a/libc/stdlib/ptsname.c +++ b/libc/stdlib/ptsname.c @@ -30,7 +30,7 @@ #include <unistd.h> -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ /* Check if DEV corresponds to a master pseudo terminal device. */ #define MASTER_P(Dev) \ @@ -64,7 +64,7 @@ extern const char _ptyname2[]; int ptsname_r (int fd, char *buf, size_t buflen) { int save_errno = errno; -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ struct stat st; #endif int ptyno; @@ -75,14 +75,14 @@ int ptsname_r (int fd, char *buf, size_t buflen) return EINVAL; } -#if !defined UNIX98PTY_ONLY +#if !defined __UNIX98PTY_ONLY__ if (!isatty (fd)) { errno = ENOTTY; return ENOTTY; } #elif !defined TIOCGPTN -# error "UNIX98PTY_ONLY enabled but TIOCGPTN ioctl not supported by your kernel." +# error "__UNIX98PTY_ONLY__ enabled but TIOCGPTN ioctl not supported by your kernel." #endif #ifdef TIOCGPTN if (ioctl (fd, TIOCGPTN, &ptyno) == 0) @@ -113,7 +113,7 @@ int ptsname_r (int fd, char *buf, size_t buflen) return 0; } #endif -#if defined UNIX98PTY_ONLY +#if defined __UNIX98PTY_ONLY__ else { /* If the ioctl fails it wasn't a Unix 98 master PTY */ diff --git a/libc/string/Makefile b/libc/string/Makefile index 6c29bb9ec..7bd2ea3dd 100644 --- a/libc/string/Makefile +++ b/libc/string/Makefile @@ -46,7 +46,7 @@ CSRC=strxfrm.c COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(MOBJ) $(MOBJ1) $(MOBJ2) $(COBJS) $(MOBJW) -ifeq ($(HAS_WCHAR),true) +ifeq ($(UCLIBC_HAS_WCHAR),y) OBJS += $(MOBJW2) endif diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile index 6e6f716a2..5139b52f5 100644 --- a/libc/sysdeps/linux/common/Makefile +++ b/libc/sysdeps/linux/common/Makefile @@ -25,7 +25,7 @@ TOPDIR=../../../../ include $(TOPDIR)Rules.mak SAFECFLAGS=$(WARNINGS) $(OPTIMIZATION) -fno-builtin -ifeq ($(strip $(DOPIC)),true) +ifeq ($(strip $(DOPIC)),y) SAFECFLAGS+=-fPIC endif @@ -35,7 +35,7 @@ CSRC= waitpid.c getdnnm.c gethstnm.c getcwd.c \ cmsg_nxthdr.c longjmp.c open64.c ftruncate64.c \ truncate64.c getrlimit64.c setrlimit64.c creat64.c mmap64.c \ llseek.c pread_write.c _exit.c setuid.c sync.c getdirname.c -ifneq ($(strip $(EXCLUDE_BRK)),true) +ifneq ($(strip $(EXCLUDE_BRK)),y) CSRC+=sbrk.c endif COBJS=$(patsubst %.c,%.o, $(CSRC)) diff --git a/libc/sysdeps/linux/common/bits/posix_opt.h b/libc/sysdeps/linux/common/bits/posix_opt.h index 4f7d78eb9..73fa007d2 100644 --- a/libc/sysdeps/linux/common/bits/posix_opt.h +++ b/libc/sysdeps/linux/common/bits/posix_opt.h @@ -130,14 +130,14 @@ #define _LFS_ASYNCHRONOUS_IO 1 /* The LFS support in asynchronous I/O is also available. */ -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ # define _LFS64_ASYNCHRONOUS_IO 1 #else # undef _LFS64_ASYNCHRONOUS_IO #endif /* The rest of the LFS is also available. */ -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ # define _LFS_LARGEFILE 1 # define _LFS64_LARGEFILE 1 # define _LFS64_STDIO 1 diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h index 24f2ec39e..83c082f75 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h +++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h @@ -36,9 +36,9 @@ #define __STDIO_THREADSAFE #endif -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #define __STDIO_LARGE_FILES -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #ifdef __UCLIBC_HAS_WCHAR__ #define __STDIO_WIDE @@ -47,22 +47,22 @@ /* Make sure defines related to large files are consistent. */ #ifdef _LIBC -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 /* if we're actually building uClibc with large file support, only define... */ #define __USE_LARGEFILE64 1 -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #else /* not _LIBC */ -#ifndef __UCLIBC_HAVE_LFS__ +#ifndef __UCLIBC_HAS_LFS__ #if defined(__LARGEFILE64_SOURCE) || defined(__USE_LARGEFILE64) \ || defined(__USE_FILE_OFFSET64) #error Sorry... uClibc was built without large file support! #endif -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* _LIBC */ diff --git a/libc/sysdeps/linux/common/creat64.c b/libc/sysdeps/linux/common/creat64.c index 28b897384..deeda3892 100644 --- a/libc/sysdeps/linux/common/creat64.c +++ b/libc/sysdeps/linux/common/creat64.c @@ -20,7 +20,7 @@ #include <fcntl.h> #include <sys/types.h> -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS @@ -42,5 +42,5 @@ int creat64 (const char *file, mode_t mode) { return open64 (file, O_WRONLY|O_CREAT|O_TRUNC, mode); } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/ftruncate64.c b/libc/sysdeps/linux/common/ftruncate64.c index fb95450c1..703ba490b 100644 --- a/libc/sysdeps/linux/common/ftruncate64.c +++ b/libc/sysdeps/linux/common/ftruncate64.c @@ -19,7 +19,7 @@ #include <stdint.h> #include <sys/syscall.h> -#if defined __UCLIBC_HAVE_LFS__ && defined __NR_ftruncate64 +#if defined __UCLIBC_HAS_LFS__ && defined __NR_ftruncate64 #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_ftruncate64 (args) #define __NR___syscall_ftruncate64 __NR_ftruncate64 @@ -41,4 +41,4 @@ int ftruncate64 (int fd, __off64_t length) #else #error Your machine is not 64 bit or 32 bit, I am dazed and confused. #endif -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/getdirname.c b/libc/sysdeps/linux/common/getdirname.c index 6ea76cca9..4cc528fc7 100644 --- a/libc/sysdeps/linux/common/getdirname.c +++ b/libc/sysdeps/linux/common/getdirname.c @@ -31,7 +31,7 @@ char * get_current_dir_name (void) { char *pwd; -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ struct stat64 dotstat, pwdstat; #else struct stat dotstat, pwdstat; @@ -39,7 +39,7 @@ get_current_dir_name (void) pwd = getenv ("PWD"); if (pwd != NULL -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ && stat64 (".", &dotstat) == 0 && stat64 (pwd, &pwdstat) == 0 #else diff --git a/libc/sysdeps/linux/common/getrlimit64.c b/libc/sysdeps/linux/common/getrlimit64.c index 2d423f5f3..1af7870af 100644 --- a/libc/sysdeps/linux/common/getrlimit64.c +++ b/libc/sysdeps/linux/common/getrlimit64.c @@ -34,7 +34,7 @@ #include <sys/types.h> #include <sys/resource.h> -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ /* Put the soft and hard limits for RESOURCE in *RLIMITS. Returns 0 if successful, -1 if not (and sets errno). */ diff --git a/libc/sysdeps/linux/common/initfini.c b/libc/sysdeps/linux/common/initfini.c index 4a6ebee75..4ff7c8218 100644 --- a/libc/sysdeps/linux/common/initfini.c +++ b/libc/sysdeps/linux/common/initfini.c @@ -46,7 +46,7 @@ /* Declare symbols as hidden. Hidden symbols are only seen by * the link editor and not by the dynamic loader. */ -#ifdef HAVE_DOT_HIDDEN +#ifdef __HAVE_DOT_HIDDEN__ # define HIDDEN(func) asm (".hidden " #func ); #else # define HIDDEN(func) diff --git a/libc/sysdeps/linux/common/llseek.c b/libc/sysdeps/linux/common/llseek.c index 63534fa71..8683157b9 100644 --- a/libc/sysdeps/linux/common/llseek.c +++ b/libc/sysdeps/linux/common/llseek.c @@ -34,7 +34,7 @@ #include <sys/syscall.h> -#if defined __NR__llseek && defined __UCLIBC_HAVE_LFS__ +#if defined __NR__llseek && defined __UCLIBC_HAS_LFS__ #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_llseek (args) diff --git a/libc/sysdeps/linux/common/mmap64.c b/libc/sysdeps/linux/common/mmap64.c index 33a4f404a..73407c4cf 100644 --- a/libc/sysdeps/linux/common/mmap64.c +++ b/libc/sysdeps/linux/common/mmap64.c @@ -22,7 +22,7 @@ #include <sysdep.h> #include <sys/mman.h> -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 #undef _FILE_OFFSET_BITS @@ -48,5 +48,5 @@ __ptr_t mmap64(__ptr_t addr, size_t len, int prot, int flags, int fd, __off64_t return mmap (addr, len, prot, flags, fd, (off_t) offset); } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c index 840ec6938..543aa138f 100644 --- a/libc/sysdeps/linux/common/open64.c +++ b/libc/sysdeps/linux/common/open64.c @@ -25,7 +25,7 @@ #define O_LARGEFILE 0100000 #endif -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ extern int __libc_open (__const char *file, int oflag, mode_t mode); /* Open FILE with access OFLAG. If OFLAG includes O_CREAT, @@ -45,4 +45,4 @@ int __libc_open64 (const char *file, int oflag, ...) return __libc_open(file, oflag | O_LARGEFILE, mode); } weak_alias (__libc_open64, open64); -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/common/pread_write.c b/libc/sysdeps/linux/common/pread_write.c index 801359276..98a059416 100644 --- a/libc/sysdeps/linux/common/pread_write.c +++ b/libc/sysdeps/linux/common/pread_write.c @@ -53,14 +53,14 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) } weak_alias (__libc_pread, pread) -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) { return(__syscall_pread(fd, buf, count, __LONG_LONG_PAIR((off_t)(offset>>32),(off_t)(offset&0xffffffff)))); } weak_alias (__libc_pread64, pread64) -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* __NR_pread */ @@ -78,14 +78,14 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) } weak_alias (__libc_pwrite, pwrite) -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) { return(__syscall_pwrite(fd, buf, count, __LONG_LONG_PAIR((off_t)(offset>>32),(off_t)(offset&0xffffffff)))); } weak_alias (__libc_pwrite64, pwrite64) -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* __NR_pwrite */ @@ -128,7 +128,7 @@ static ssize_t __fake_pread_write(int fd, void *buf, return(result); } -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ static ssize_t __fake_pread_write64(int fd, void *buf, size_t count, off64_t offset, int do_pwrite) { @@ -163,7 +163,7 @@ static ssize_t __fake_pread_write64(int fd, void *buf, __set_errno (save_errno); return result; } -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* ! defined __NR_pread || ! defined __NR_pwrite */ #ifndef __NR_pread @@ -173,13 +173,13 @@ ssize_t __libc_pread(int fd, void *buf, size_t count, off_t offset) } weak_alias (__libc_pread, pread) -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pread64(int fd, void *buf, size_t count, off64_t offset) { return(__fake_pread_write64(fd, buf, count, offset, 0)); } weak_alias (__libc_pread64, pread64) -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* ! __NR_pread */ @@ -190,12 +190,12 @@ ssize_t __libc_pwrite(int fd, const void *buf, size_t count, off_t offset) } weak_alias (__libc_pwrite, pwrite) -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ ssize_t __libc_pwrite64(int fd, const void *buf, size_t count, off64_t offset) { return(__fake_pread_write64(fd, (void*)buf, count, offset, 1)); } weak_alias (__libc_pwrite64, pwrite64) -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif /* ! __NR_pwrite */ diff --git a/libc/sysdeps/linux/common/setrlimit64.c b/libc/sysdeps/linux/common/setrlimit64.c index 29fad3e36..8d190f573 100644 --- a/libc/sysdeps/linux/common/setrlimit64.c +++ b/libc/sysdeps/linux/common/setrlimit64.c @@ -35,7 +35,7 @@ #include <sys/types.h> #include <sys/resource.h> -#if defined __UCLIBC_HAVE_LFS__ +#if defined __UCLIBC_HAS_LFS__ /* Set the soft and hard limits for RESOURCE to *RLIMITS. Only the super-user can increase hard limits. diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c index 0229880a6..e0dbdf39d 100644 --- a/libc/sysdeps/linux/common/syscalls.c +++ b/libc/sysdeps/linux/common/syscalls.c @@ -962,7 +962,7 @@ _syscall2(int, getitimer, __itimer_which_t, which, struct itimerval *, value); #include <unistd.h> #include <sys/stat.h> _syscall2(int, stat, const char *, file_name, struct stat *, buf); -#if ! defined __NR_stat64 && defined __UCLIBC_HAVE_LFS__ +#if ! defined __NR_stat64 && defined __UCLIBC_HAS_LFS__ weak_alias(stat, stat64); #endif #endif @@ -972,7 +972,7 @@ weak_alias(stat, stat64); #include <unistd.h> #include <sys/stat.h> _syscall2(int, lstat, const char *, file_name, struct stat *, buf); -#if ! defined __NR_lstat64 && defined __UCLIBC_HAVE_LFS__ +#if ! defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__ weak_alias(lstat, lstat64); #endif #endif @@ -982,7 +982,7 @@ weak_alias(lstat, lstat64); #include <unistd.h> #include <sys/stat.h> _syscall2(int, fstat, int, filedes, struct stat *, buf); -#if ! defined __NR_fstat64 && defined __UCLIBC_HAVE_LFS__ +#if ! defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ weak_alias(fstat, fstat64); #endif #endif @@ -1621,29 +1621,29 @@ int getrlimit (__rlimit_resource_t resource, struct rlimit *rlimits) //#define __NR_stat64 195 #ifdef L_stat64 -#if defined __NR_stat64 && defined __UCLIBC_HAVE_LFS__ +#if defined __NR_stat64 && defined __UCLIBC_HAS_LFS__ #include <unistd.h> #include <sys/stat.h> _syscall2(int, stat64, const char *, file_name, struct stat64 *, buf); -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif //#define __NR_lstat64 196 #ifdef L_lstat64 -#if defined __NR_lstat64 && defined __UCLIBC_HAVE_LFS__ +#if defined __NR_lstat64 && defined __UCLIBC_HAS_LFS__ #include <unistd.h> #include <sys/stat.h> _syscall2(int, lstat64, const char *, file_name, struct stat64 *, buf); -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif //#define __NR_fstat64 197 #ifdef L_fstat64 -#if defined __NR_fstat64 && defined __UCLIBC_HAVE_LFS__ +#if defined __NR_fstat64 && defined __UCLIBC_HAS_LFS__ #include <unistd.h> #include <sys/stat.h> _syscall2(int, fstat64, int, filedes, struct stat64 *, buf); -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif @@ -1679,16 +1679,16 @@ _syscall2(int, pivot_root, const char *, new_root, const char *, put_old) //#define __NR_getdents64 220 #ifdef L_getdents64 -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #include <unistd.h> #include <dirent.h> _syscall3(int, getdents64, int, fd, char *, dirp, size_t, count); -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ #endif //#define __NR_fcntl64 221 #ifdef L__fcntl64 -#ifdef __UCLIBC_HAVE_LFS__ +#ifdef __UCLIBC_HAS_LFS__ #ifdef __NR_fcntl64 #define __NR__fcntl64 __NR_fcntl64 #include <stdarg.h> diff --git a/libc/sysdeps/linux/common/truncate64.c b/libc/sysdeps/linux/common/truncate64.c index 3205f748d..fa5000107 100644 --- a/libc/sysdeps/linux/common/truncate64.c +++ b/libc/sysdeps/linux/common/truncate64.c @@ -19,7 +19,7 @@ #include <stdint.h> #include <sys/syscall.h> -#if defined __UCLIBC_HAVE_LFS__ && defined __NR_truncate64 +#if defined __UCLIBC_HAS_LFS__ && defined __NR_truncate64 #ifndef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) __syscall_truncate64 (args) #define __NR___syscall_truncate64 __NR_truncate64 @@ -40,4 +40,4 @@ int truncate64 (const char * path, __off64_t length) #else #error Your machine is not 64 bit or 32 bit, I am dazed and confused. #endif -#endif /* __UCLIBC_HAVE_LFS__ */ +#endif /* __UCLIBC_HAS_LFS__ */ diff --git a/libc/sysdeps/linux/cris/Makefile b/libc/sysdeps/linux/cris/Makefile index 737ca1f9e..6b9931ebb 100644 --- a/libc/sysdeps/linux/cris/Makefile +++ b/libc/sysdeps/linux/cris/Makefile @@ -20,7 +20,7 @@ CRT0=crt0.c CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0)) SSRC= setjmp.S __longjmp.S clone.S sysdep.S syscall.S -ifeq ($(UNIFIED_SYSCALL),true) +ifeq ($(UNIFIED_SYSCALL),y) SSRC += __uClibc_syscall.S endif SOBJS=$(patsubst %.S,%.o, $(SSRC)) diff --git a/libc/sysdeps/linux/h8300/Makefile b/libc/sysdeps/linux/h8300/Makefile index 68093e132..d6d0b7c2a 100644 --- a/libc/sysdeps/linux/h8300/Makefile +++ b/libc/sysdeps/linux/h8300/Makefile @@ -63,7 +63,7 @@ headers: clean: rm -f *.[oa] *~ core -ifeq ($(strip $(HAVE_ELF)),false) +ifeq ($(strip $(HAVE_ELF)),n) rm -f $(TOPDIR)/include/float.h endif diff --git a/libc/sysdeps/linux/h8300/crt0.S b/libc/sysdeps/linux/h8300/crt0.S index cbd40f317..2fe9d0d53 100644 --- a/libc/sysdeps/linux/h8300/crt0.S +++ b/libc/sysdeps/linux/h8300/crt0.S @@ -46,7 +46,7 @@ __exit: */ empty_func: rts -#if defined(HAVE_ELF) +#if defined(__HAVE_ELF__) .weak atexit atexit = empty_func #else diff --git a/libc/sysdeps/linux/h8300/vfork.S b/libc/sysdeps/linux/h8300/vfork.S index 889b43ace..aa8520d89 100644 --- a/libc/sysdeps/linux/h8300/vfork.S +++ b/libc/sysdeps/linux/h8300/vfork.S @@ -10,7 +10,7 @@ .align 2 .globl _errno .globl _vfork -#if defined HAVE_ELF +#if defined __HAVE_ELF__ .type vfork,@function #endif _vfork: diff --git a/libc/sysdeps/linux/i960/README b/libc/sysdeps/linux/i960/README index db4567a55..0ec5bb63a 100644 --- a/libc/sysdeps/linux/i960/README +++ b/libc/sysdeps/linux/i960/README @@ -16,8 +16,8 @@ prepended underscore -------------------- As the i960 compiler prepends an underscore to symbols, it is critical that -the Config file define C_SYMBOL_PREFIX as - C_SYMBOL_PREFIX = _ +the Config file define __C_SYMBOL_PREFIX__ as + __C_SYMBOL_PREFIX__ = _ to make sure that underscores are applied to symbol names when needed. diff --git a/libc/sysdeps/linux/m68k/Makefile b/libc/sysdeps/linux/m68k/Makefile index 751f7072c..7130c58d6 100644 --- a/libc/sysdeps/linux/m68k/Makefile +++ b/libc/sysdeps/linux/m68k/Makefile @@ -28,7 +28,7 @@ ASFLAGS=$(CFLAGS) # If you're looking for vfork(), it is defined in include/unistd.h -ifeq ($(HAS_MMU),true) +ifeq ($(UCLIBC_HAS_MMU),y) CRT0=crt0.c CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0)) else @@ -54,7 +54,7 @@ ar-target: $(OBJS) $(CRT0_OBJ) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ) -ifeq ($(HAS_MMU),true) +ifeq ($(UCLIBC_HAS_MMU),y) $(CRT0_OBJ): %.o : %.c else $(CRT0_OBJ): %.o : %.S @@ -71,7 +71,7 @@ $(COBJS): %.o : %.c $(STRIPTOOL) -x -R .note -R .comment $*.o headers: -ifeq ($(strip $(HAVE_ELF)),false) +ifeq ($(strip $(HAVE_ELF)),n) echo "Working around compiler bug in the m68k-pic-coff toolchain" cd $(TOPDIR)/include && ln -fs ../libc/sysdeps/linux/m68k/float.h . endif @@ -80,7 +80,7 @@ endif clean: rm -f *.[oa] *~ core rm -f bits/sysnum.h -ifeq ($(strip $(HAVE_ELF)),false) +ifeq ($(strip $(HAVE_ELF)),n) rm -f $(TOPDIR)/include/float.h endif diff --git a/libc/sysdeps/linux/m68k/clone.S b/libc/sysdeps/linux/m68k/clone.S index d1e4fd850..731587db4 100644 --- a/libc/sysdeps/linux/m68k/clone.S +++ b/libc/sysdeps/linux/m68k/clone.S @@ -76,7 +76,7 @@ thread_start: trap #0 /*jsr exit*/ -#if defined(HAVE_ELF) +#if defined(__HAVE_ELF__) .weak clone clone = __clone #else diff --git a/libc/sysdeps/linux/m68k/crt0.S b/libc/sysdeps/linux/m68k/crt0.S index c09146fa5..8d7f6802d 100644 --- a/libc/sysdeps/linux/m68k/crt0.S +++ b/libc/sysdeps/linux/m68k/crt0.S @@ -53,7 +53,7 @@ __exit: */ empty_func: rts -#if defined(HAVE_ELF) +#if defined(__HAVE_ELF__) .weak atexit atexit = empty_func #else diff --git a/libc/sysdeps/linux/m68k/vfork.S b/libc/sysdeps/linux/m68k/vfork.S index 9aacf5916..5db163bf5 100644 --- a/libc/sysdeps/linux/m68k/vfork.S +++ b/libc/sysdeps/linux/m68k/vfork.S @@ -11,7 +11,7 @@ .align 2 .globl errno .globl vfork -#if defined HAVE_ELF +#if defined __HAVE_ELF__ .type vfork,@function #endif vfork: diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile index da11f940c..2cf67849d 100644 --- a/libc/sysdeps/linux/powerpc/Makefile +++ b/libc/sysdeps/linux/powerpc/Makefile @@ -21,7 +21,7 @@ # other sundry sources. Files within this library are copyright by their # respective copyright holders. -USE_CRT0_C=y +USE_CRT0_C=true TOPDIR=../../../../ include $(TOPDIR)Rules.mak @@ -29,7 +29,7 @@ ASFLAGS=$(CFLAGS) TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine) -ifeq ($(USE_CRT0_C),y) +ifeq ($(USE_CRT0_C),true) CRT0=crt0.c CRT0_OBJ=$(patsubst %.c,%.o, $(CRT0)) else @@ -55,7 +55,7 @@ ar-target: $(OBJS) $(CRT0_OBJ) cp $(CRT0_OBJ) $(TOPDIR)lib/ -ifeq ($(USE_CRT0_C),y) +ifeq ($(USE_CRT0_C),true) $(CRT0_OBJ): %.o : %.c else $(CRT0_OBJ): %.o : %.S diff --git a/libc/sysdeps/linux/sh/sysdep.h b/libc/sysdeps/linux/sh/sysdep.h index 759753415..f88cedefb 100644 --- a/libc/sysdeps/linux/sh/sysdep.h +++ b/libc/sysdeps/linux/sh/sysdep.h @@ -21,7 +21,7 @@ #include <bits/uClibc_config.h> /* Define a macro we can use to construct the asm name for a C symbol. */ -#ifdef NO_UNDERSCORES +#ifdef __NO_UNDERSCORES__ #ifdef __STDC__ #define C_LABEL(name) name##: #else @@ -53,7 +53,7 @@ /* Syntactic details of assembler. */ -#ifdef HAVE_ELF +#ifdef __HAVE_ELF__ #define ALIGNARG(log2) log2 /* For ELF we need the `.type' directive to make shared libs work right. */ @@ -95,7 +95,7 @@ #define CALL_MCOUNT /* Do nothing. */ #endif -#ifdef NO_UNDERSCORES +#ifdef __NO_UNDERSCORES__ /* Since C identifiers are not normally prefixed with an underscore on this system, the asm identifier `syscall_error' intrudes on the C name space. Make sure we use an innocuous name. */ diff --git a/libc/unistd/Makefile b/libc/unistd/Makefile index 11a33cecf..0d05e6d49 100644 --- a/libc/unistd/Makefile +++ b/libc/unistd/Makefile @@ -29,7 +29,7 @@ CSRC=execl.c execlp.c execv.c execvep.c execvp.c execle.c \ sleep.c usleep.c getpass.c sysconf_src.c getlogin.c \ fpathconf.c confstr.c pathconf.c swab.c usershell.c \ getopt.c getsubopt.c -ifeq ($(strip $(HAS_MMU)),true) +ifeq ($(strip $(UCLIBC_HAS_MMU)),y) CSRC+=daemon.c endif diff --git a/libc/unistd/daemon.c b/libc/unistd/daemon.c index bfad7a363..d4c2e0448 100644 --- a/libc/unistd/daemon.c +++ b/libc/unistd/daemon.c @@ -48,6 +48,11 @@ int daemon( int nochdir, int noclose ) if (setsid() == -1) return(-1); + /* Make certain we are not a session leader, or else we + * might reacquire a controlling terminal */ + if (fork()) + _exit(0); + if (!nochdir) chdir("/"); diff --git a/libc/unistd/fpathconf.c b/libc/unistd/fpathconf.c index f896e934b..2f6cf7214 100644 --- a/libc/unistd/fpathconf.c +++ b/libc/unistd/fpathconf.c @@ -196,7 +196,7 @@ long int fpathconf(int fd, int name) #endif case _PC_ASYNC_IO: -#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAVE_LFS__ +#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAS_LFS__ { /* AIO is only allowed on regular files and block devices. */ struct stat st; diff --git a/libc/unistd/pathconf.c b/libc/unistd/pathconf.c index d7fa99f50..affec4e69 100644 --- a/libc/unistd/pathconf.c +++ b/libc/unistd/pathconf.c @@ -200,7 +200,7 @@ long int pathconf(const char *path, int name) #endif case _PC_ASYNC_IO: -#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAVE_LFS__ +#if defined _POSIX_ASYNC_IO && defined __UCLIBC_HAS_LFS__ { /* AIO is only allowed on regular files and block devices. */ struct stat st; |