From 2c46d96042618f64fd0db084bf2eea5fb4277f32 Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 12 Jan 2007 02:34:46 +0000 Subject: [PATCH] * instead of setting LDSTATIC='' for OSes which did not support it until now, set it to '@' * if LDSTATIC is '@' make it '-static' if MKSH_SMALL, '' otherwise Yep, this might break, e.g. Darwin or Cygwin. But let's test that. --- Build.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Build.sh b/Build.sh index 8fd5674..b16a305 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $MirOS: src/bin/mksh/Build.sh,v 1.103 2007/01/12 02:27:40 tg Exp $ +# $MirOS: src/bin/mksh/Build.sh,v 1.104 2007/01/12 02:34:46 tg Exp $ #- # Environment: CC, CFLAGS, CPPFLAGS, LDFLAGS, LIBS, NOWARN, NROFF # With -x (cross compile): TARGET_OS (default: uname -s) @@ -140,10 +140,10 @@ SRCS="$SRCS jobs.c lex.c main.c misc.c shf.c syn.c tree.c var.c" test $x = 0 && TARGET_OS=`uname -s 2>/dev/null || uname` case $TARGET_OS in CYGWIN*) - LDSTATIC= + LDSTATIC=@ ;; Darwin) - LDSTATIC= + LDSTATIC=@ CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" ;; Interix) @@ -152,12 +152,12 @@ Interix) Linux) CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE -D_GNU_SOURCE" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - LDSTATIC= + LDSTATIC=@ ;; SunOS) CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE -D__EXTENSIONS__" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" - LDSTATIC= + LDSTATIC=@ r=1 ;; esac @@ -396,6 +396,11 @@ addsrcs HAVE_STRCASESTR strcasestr.c addsrcs HAVE_STRLCPY strlfun.c CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H -DCONFIG_H_FILENAME=\\\"sh.h\\\"" +test x"@" = x"$LDSTATIC" && if test 0 = $HAVE_MKSH_FULL; then + LDSTATIC=-static +else + LDSTATIC= +fi (v "cd '$srcdir' && exec $CC $CFLAGS $CPPFLAGS" \ "$LDFLAGS $LDSTATIC -o '$curdir/mksh' $SRCS $LIBS") || exit 1 result=mksh