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
This commit is contained in:
Andrey A. Chernov 1994-09-19 02:00:21 +00:00
parent c27b58e1b6
commit 54335ac349
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=2879
2 changed files with 5 additions and 9 deletions

View File

@ -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

View File

@ -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 <sys/param.h>
#ifdef STARTUP_LOCALE
#include <locale.h>
#endif
#include <stdlib.h>
#ifdef DYNAMIC
#include <sys/types.h>
@ -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));