build: Don't create the lib_so folder if --build-shared is not specified 95/4895/5
authorEvan Ramos <evan@hpccharm.com>
Fri, 11 Jan 2019 21:44:33 +0000 (15:44 -0600)
committerEvan Ramos <evan@hpccharm.com>
Thu, 24 Jan 2019 02:21:38 +0000 (20:21 -0600)
Change-Id: Ic04335dff8ab7db8435217b71054a03e8e9dbe45

build
src/scripts/Makefile
src/scripts/charmc

diff --git a/build b/build
index 996d78c..2a207c1 100755 (executable)
--- a/build
+++ b/build
@@ -786,7 +786,10 @@ else
 ln -f -s \$@
 EOF
   chmod +x $DESTINATION/tmp/system_ln
-  for newdir in `echo bin lib lib_so include tmp`
+  newdirlist='bin lib'
+  [ -n "$BUILD_SHARED" ] && newdirlist="$newdirlist lib_so"
+  newdirlist="$newdirlist include tmp"
+  for newdir in $newdirlist
   do
     Echo "Soft-linking over $newdir"
     if [ -r $newdir ]
index a4bb07d..f40c064 100644 (file)
@@ -337,7 +337,9 @@ dirs+sources:
                cp -f $(SRCBASE)/arch/win/createlink.exe ../bin; \
        fi
        rm -rf ../lib ; mkdir ../lib
+ifeq (false,$(CMK_NO_BUILD_SHARED))
        rm -rf ../lib_so ; mkdir ../lib_so; touch ../lib_so/.charmso
+endif
        rm -rf ../examples
        rm -rf ../tests
        rm -rf ../doc ; ln -s ../doc ../doc
@@ -991,12 +993,16 @@ OTHER_OBJS= mpi-mainmodule.o main.o custom_partitioner.o BlueGene.o set_partitio
 install:
        @test ! -d $(DESTDIR)/include && mkdir -p $(DESTDIR)/include || true
        @test ! -d $(DESTDIR)/lib && mkdir -p $(DESTDIR)/lib || true
+ifeq (false,$(CMK_NO_BUILD_SHARED))
        @test ! -d $(DESTDIR)/lib_so && mkdir -p $(DESTDIR)/lib_so || true
+endif
        @test ! -d $(DESTDIR)/bin && mkdir -p $(DESTDIR)/bin || true
        # cp -f ../include/*   $(DESTDIR)/include
        for f in ../include/*; do if test -f $$f; then cp -f $$f $(DESTDIR)/include; fi; done
        cp -f ../lib/*       $(DESTDIR)/lib
+ifeq (false,$(CMK_NO_BUILD_SHARED))
        cp -f ../lib_so/*    $(DESTDIR)/lib_so || true
+endif
 #      cp -f ../bin/*       $(DESTDIR)/bin
        for f in ../bin/*; do if test -f $$f; then cp -f $$f $(DESTDIR)/bin; fi; done
 
index 76ef0f3..3bc5097 100755 (executable)
@@ -1103,7 +1103,8 @@ then
        # ignore BUILD_SHARE if the target is not .a or .so
        case "$OBJECT" in
        *.a|*.so|*.so.*|*.sl|*.dylib)
-               OPTS_LD="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO -L$CHARMLIBSO"
+               OPTS_LD="$OPTS_LD $CMK_LD_SHARED $OPTS_LDRO"
+               [ -n "$CHARMLIBSO" ] && OPTS_LD="$OPTS_LD -L$CHARMLIBSO"
                ;;
        *)      
                BUILD_SHARE="0"