From 3d1858c2f03e3e90d8a195714ce2351de4ceac9f Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 19 Sep 1994 02:00:21 +0000 Subject: Change level of setlocale hack enabling from compile option STARTUP_LOCALE to check (via getenv) environment variable "ENABLE_STARTUP_LOCALE" at runtime. Submitted by: me per Bruce suggestion --- lib/csu/i386/Makefile | 3 --- lib/csu/i386/crt0.c | 11 +++++------ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'lib/csu') diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile index c5728fc..9b860b2 100644 --- a/lib/csu/i386/Makefile +++ b/lib/csu/i386/Makefile @@ -2,9 +2,6 @@ # $Id: Makefile,v 1.10 1994/08/22 15:13:41 bde Exp $ CFLAGS+= -DLIBC_SCCS -DDYNAMIC -.if defined(STARTUP_LOCALE) -CFLAGS+= -DSTARTUP_LOCALE -.endif OBJS= crt0.o gcrt0.o c++rt0.o CLEANFILES+= a.out diff --git a/lib/csu/i386/crt0.c b/lib/csu/i386/crt0.c index 197d612..f15b08f 100644 --- a/lib/csu/i386/crt0.c +++ b/lib/csu/i386/crt0.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: crt0.c,v 1.11 1994/08/05 17:53:07 wollman Exp $ + * $Id: crt0.c,v 1.12 1994/09/18 22:21:04 ache Exp $ */ @@ -39,9 +39,8 @@ extern void exit(); int _callmain(); #include -#ifdef STARTUP_LOCALE #include -#endif +#include #ifdef DYNAMIC #include @@ -177,9 +176,9 @@ asm("eprol:"); atexit(_mcleanup); monstartup(&eprol, &etext); #endif /* MCRT0 */ -#ifdef STARTUP_LOCALE - (void) setlocale(LC_ALL, ""); -#endif + + if (getenv("ENABLE_STARTUP_LOCALE") != NULL) + (void) setlocale(LC_ALL, ""); asm ("__callmain:"); /* Defined for the benefit of debuggers */ exit(main(kfp->kargc, argv, environ)); -- cgit v1.1