summaryrefslogtreecommitdiffstats
path: root/lib/csu
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-19 02:00:21 +0000
committerache <ache@FreeBSD.org>1994-09-19 02:00:21 +0000
commit3d1858c2f03e3e90d8a195714ce2351de4ceac9f (patch)
tree42d638df3b285883dec739843e11611d8441e56c /lib/csu
parent81f5d9ffb354a2de57e37380b00b00fa798ddd75 (diff)
downloadFreeBSD-src-3d1858c2f03e3e90d8a195714ce2351de4ceac9f.zip
FreeBSD-src-3d1858c2f03e3e90d8a195714ce2351de4ceac9f.tar.gz
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
Diffstat (limited to 'lib/csu')
-rw-r--r--lib/csu/i386/Makefile3
-rw-r--r--lib/csu/i386/crt0.c11
2 files changed, 5 insertions, 9 deletions
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 <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));
OpenPOWER on IntegriCloud