diff options
author | wtchang%redhat.com <devnull@localhost> | 2006-02-07 19:12:33 +0000 |
---|---|---|
committer | wtchang%redhat.com <devnull@localhost> | 2006-02-07 19:12:33 +0000 |
commit | 63cdd8434c973f26a52fb6110b9d653ddc1cc64b (patch) | |
tree | fbd091296dc53fa7492f27ea1a8d619687594f41 | |
parent | 1e3d017363114f720bffbe5deb3a126351aec384 (diff) | |
download | nspr-hg-63cdd8434c973f26a52fb6110b9d653ddc1cc64b.tar.gz |
Bugzilla bug 322427: do not compile NSPR with -ansi and with _POSIX_SOURCE,
_BSD_SOURCE, _SVID_SOURCE, _LARGEFILE64_SOURCE, and _XOPEN_SOURCE defined.
Instead, just define _GNU_SOURCE. Removed an ancient workaround in
prinet.h for a zero-size array in <sys/socket.h> on Linux. r=kengert.
Modified files: configure configure.in prinet.h
pr/src/linking/Makefile.in pr/src/pthreads/Makefile.in
Tag: NSPR_4_6_BRANCH
-rwxr-xr-x | configure | 62 | ||||
-rw-r--r-- | configure.in | 77 | ||||
-rw-r--r-- | pr/include/prinet.h | 4 | ||||
-rw-r--r-- | pr/src/linking/Makefile.in | 5 | ||||
-rw-r--r-- | pr/src/pthreads/Makefile.in | 5 |
5 files changed, 64 insertions, 89 deletions
@@ -3809,19 +3809,7 @@ EOF EOF cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _BSD_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _SVID_SOURCE 1 -EOF - - cat >> confdefs.h <<\EOF -#define _LARGEFILE64_SOURCE 1 +#define _GNU_SOURCE 1 EOF cat >> confdefs.h <<\EOF @@ -3832,8 +3820,8 @@ EOF #define LINUX 1 EOF - CFLAGS="$CFLAGS -ansi -Wall" - CXXFLAGS="$CXXFLAGS -ansi -Wall" + CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" MDCPUCFG_H=_linux.cfg PR_MD_CSRCS=linux.c MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' @@ -4371,17 +4359,17 @@ EOF _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000" ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6 -echo "configure:4375: checking for machine/builtins.h" >&5 +echo "configure:4363: checking for machine/builtins.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4380 "configure" +#line 4368 "configure" #include "confdefs.h" #include <machine/builtins.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4373: \"$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 rm -rf conftest* @@ -4943,7 +4931,7 @@ case $target in ;; *) echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4947: checking for dlopen in -ldl" >&5 +echo "configure:4935: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4951,7 +4939,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4955 "configure" +#line 4943 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4962,7 +4950,7 @@ int main() { dlopen() ; return 0; } EOF -if { (eval echo configure:4966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4979,17 +4967,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:4983: checking for dlfcn.h" >&5 +echo "configure:4971: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4988 "configure" +#line 4976 "configure" #include "confdefs.h" #include <dlfcn.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4981: \"$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 rm -rf conftest* @@ -5022,13 +5010,13 @@ esac if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:5026: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:5014: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 5032 "configure" +#line 5020 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -5046,7 +5034,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 5050 "configure" +#line 5038 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -5070,12 +5058,12 @@ fi for ac_func in lchown strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5074: checking for $ac_func" >&5 +echo "configure:5062: 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 5079 "configure" +#line 5067 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -5098,7 +5086,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:5102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5090: \"$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 @@ -5139,7 +5127,7 @@ hpux*) if test -z "$GNU_CC"; then echo $ac_n "checking for +Olit support""... $ac_c" 1>&6 -echo "configure:5143: checking for +Olit support" >&5 +echo "configure:5131: checking for +Olit support" >&5 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5178,7 +5166,7 @@ darwin*) *) echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:5182: checking for pthread_create in -lpthreads" >&5 +echo "configure:5170: checking for pthread_create in -lpthreads" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5200,7 +5188,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:5204: checking for pthread_create in -lpthread" >&5 +echo "configure:5192: checking for pthread_create in -lpthread" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5222,7 +5210,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:5226: checking for pthread_create in -lc_r" >&5 +echo "configure:5214: checking for pthread_create in -lc_r" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5244,7 +5232,7 @@ echo " echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 -echo "configure:5248: checking for pthread_create in -lc" >&5 +echo "configure:5236: checking for pthread_create in -lc" >&5 echo " #include <pthread.h> void *foo(void *v) { return v; } @@ -5398,7 +5386,7 @@ if test -n "$USE_PTHREADS"; then rm -f conftest* ac_cv_have_dash_pthread=no echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6 -echo "configure:5402: checking whether ${CC-cc} accepts -pthread" >&5 +echo "configure:5390: checking whether ${CC-cc} accepts -pthread" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then @@ -5421,7 +5409,7 @@ echo "configure:5402: checking whether ${CC-cc} accepts -pthread" >&5 ac_cv_have_dash_pthreads=no if test "$ac_cv_have_dash_pthread" = "no"; then echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6 -echo "configure:5425: checking whether ${CC-cc} accepts -pthreads" >&5 +echo "configure:5413: checking whether ${CC-cc} accepts -pthreads" >&5 echo 'int main() { return 0; }' | cat > conftest.c ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1 if test $? -eq 0; then diff --git a/configure.in b/configure.in index ba6c495c..bfd58160 100644 --- a/configure.in +++ b/configure.in @@ -1,39 +1,43 @@ dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*- dnl -dnl The contents of this file are subject to the Mozilla Public -dnl License Version 1.1 (the "License"); you may not use this file -dnl except in compliance with the License. You may obtain a copy of -dnl the License at http://www.mozilla.org/MPL/ -dnl -dnl Software distributed under the License is distributed on an "AS -dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -dnl implied. See the License for the specific language governing -dnl rights and limitations under the License. -dnl +dnl ***** BEGIN LICENSE BLOCK ***** +dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1 +dnl +dnl The contents of this file are subject to the Mozilla Public License Version +dnl 1.1 (the "License"); you may not use this file except in compliance with +dnl the License. You may obtain a copy of the License at +dnl http://www.mozilla.org/MPL/ +dnl +dnl Software distributed under the License is distributed on an "AS IS" basis, +dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +dnl for the specific language governing rights and limitations under the +dnl License. +dnl dnl The Original Code is the Netscape Portable Runtime (NSPR). -dnl -dnl The Initial Developer of the Original Code is Netscape -dnl Communications Corporation. Portions created by Netscape are -dnl Copyright (C) 1998o-2000 Netscape Communications Corporation. All -dnl Rights Reserved. -dnl +dnl +dnl The Initial Developer of the Original Code is +dnl Netscape Communications Corporation. +dnl Portions created by the Initial Developer are Copyright (C) 1998 +dnl the Initial Developer. All Rights Reserved. +dnl dnl Contributor(s): -dnl Christopher Seawood <cls@seawood.org> -dnl Howard Chu <hyc@symas.com> -dnl Mark Mentovai <mark@moxienet.com> -dnl -dnl Alternatively, the contents of this file may be used under the -dnl terms of the GNU General Public License Version 2 or later (the -dnl "GPL"), in which case the provisions of the GPL are applicable -dnl instead of those above. If you wish to allow use of your -dnl version of this file only under the terms of the GPL and not to -dnl allow others to use your version of this file under the MPL, -dnl indicate your decision by deleting the provisions above and -dnl replace them with the notice and other provisions required by -dnl the GPL. If you do not delete the provisions above, a recipient -dnl may use your version of this file under either the MPL or the -dnl GPL. -dnl +dnl Christopher Seawood <cls@seawood.org> +dnl Howard Chu <hyc@symas.com> +dnl Mark Mentovai <mark@moxienet.com> +dnl +dnl Alternatively, the contents of this file may be used under the terms of +dnl either the GNU General Public License Version 2 or later (the "GPL"), or +dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +dnl in which case the provisions of the GPL or the LGPL are applicable instead +dnl of those above. If you wish to allow use of your version of this file only +dnl under the terms of either the GPL or the LGPL, and not to allow others to +dnl use your version of this file under the terms of the MPL, indicate your +dnl decision by deleting the provisions above and replace them with the notice +dnl and other provisions required by the GPL or the LGPL. If you do not delete +dnl the provisions above, a recipient may use your version of this file under +dnl the terms of any one of the MPL, the GPL or the LGPL. +dnl +dnl ***** END LICENSE BLOCK ***** AC_PREREQ(2.12) AC_INIT(config/libc_r.h) @@ -1341,14 +1345,11 @@ tools are selected during the Xcode/Developer Tools installation.]) IMPL_STRATEGY=_PTH fi AC_DEFINE(XP_UNIX) - AC_DEFINE(_POSIX_SOURCE) - AC_DEFINE(_BSD_SOURCE) - AC_DEFINE(_SVID_SOURCE) - AC_DEFINE(_LARGEFILE64_SOURCE) + AC_DEFINE(_GNU_SOURCE) AC_DEFINE(HAVE_FCNTL_FILE_LOCKING) AC_DEFINE(LINUX) - CFLAGS="$CFLAGS -ansi -Wall" - CXXFLAGS="$CXXFLAGS -ansi -Wall" + CFLAGS="$CFLAGS -Wall" + CXXFLAGS="$CXXFLAGS -Wall" MDCPUCFG_H=_linux.cfg PR_MD_CSRCS=linux.c MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@' diff --git a/pr/include/prinet.h b/pr/include/prinet.h index 2c733b0b..02dfef6f 100644 --- a/pr/include/prinet.h +++ b/pr/include/prinet.h @@ -60,10 +60,6 @@ #define prinet_h__ #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS) -#ifdef LINUX -#undef __STRICT_ANSI__ -#define __STRICT_ANSI__ -#endif #include <sys/types.h> #include <sys/socket.h> /* AF_INET */ #include <netinet/in.h> /* INADDR_ANY, ..., ntohl(), ... */ diff --git a/pr/src/linking/Makefile.in b/pr/src/linking/Makefile.in index ee418453..9b82aca2 100644 --- a/pr/src/linking/Makefile.in +++ b/pr/src/linking/Makefile.in @@ -62,11 +62,6 @@ TARGETS = $(OBJS) INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private -# For Dl_info and dladdr. -ifeq ($(OS_TARGET),Linux) -DEFINES += -D_GNU_SOURCE -endif - # On Mac OS X use flat #includes. ifeq ($(OS_TARGET),MacOSX) INCLUDES += -I$(MACOS_SDK_DIR)/Developer/Headers/FlatCarbon diff --git a/pr/src/pthreads/Makefile.in b/pr/src/pthreads/Makefile.in index ddda7091..006a3e8c 100644 --- a/pr/src/pthreads/Makefile.in +++ b/pr/src/pthreads/Makefile.in @@ -67,11 +67,6 @@ INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/incl DEFINES += -D_NSPR_BUILD_ -ifeq ($(OS_ARCH),Linux) -# for pthread_mutexattr_settype -DEFINES += -D_XOPEN_SOURCE=500 -endif - include $(topsrcdir)/config/rules.mk export:: $(TARGETS) |