Commits

Zachary Anderson  committed 1b90319

Fixes for building on Mac

  • Participants
  • Parent commits 86324f3

Comments (0)

Files changed (4)

 
 OCAMLFIND = @OCAMLFIND@
 CILINC = $(shell $(OCAMLFIND) query cil)
+GRAPHINC = $(shell $(OCAMLFIND) query ocamlgraph)
 
-COMPILEFLAGS = -w x -I $(CILINC) -I +ocamlgraph
-LINKFLAGS    = -I $(CILINC) -I +ocamlgraph
+COMPILEFLAGS = -w x -I $(CILINC) -I $(GRAPHINC)
+LINKFLAGS    = -I $(CILINC) -I $(GRAPHINC)
 
 ifeq ($(BUILD_TUT11),true)
   COMPILEFLAGS += -I +why3
 #
 
 clean:
-	rm -f $(OBJDIR)/*.* $(DEPENDDIR)/*.*
+	rm -rf $(OBJDIR)/*.* $(DEPENDDIR)/*.*
 	for i in $(SUBDIRS); do make -C $$i -f Makefile.dummy clean; done
 
 libclean:

File ciltut-lib/Makefile.dummy.in

+ifndef ARCHOS
+  ARCHOS = @ARCHOS@
+endif
+
 ifndef BUILD_TUT11
   BUILD_TUT11 = @BUILD_TUT11@
 endif
 INSTALL_DATA = ${INSTALL} -m 644
 INSTALL_PROGRAM = ${INSTALL}
 
-INSTALL_LIBS = src/libciltut.a src/libciltut.so
+ifeq ($(ARCHOS),x86_DARWIN)
+  SOEXT=dylib
+else
+  SOEXT=so
+endif
+
+INSTALL_LIBS = src/libciltut.a src/libciltut.$(SOEXT)
 
 install: $(INSTALL_FILES)
 	$(INSTALL_DATA) $(INSTALL_LIBS) $(DESTDIR)$(pkglibdir)/lib

File ciltut-lib/src/CMakeLists.txt

   DEPENDS concolic_callbacks.o
 )
 set(CONCOLIC_LIB concolic_callbacks.o)
+set(CONCOLIC_STUBS tut15.c)
 else()
 set(CONCOLIC_LIB )
+set(CONCOLIC_STUBS )
 endif()
 
-set(SHELTER_SRCS ciltut_libc.c tut4.c tut8.c tut6.c tut10.c tut15.c)
+set(SHELTER_SRCS ciltut_libc.c tut4.c tut8.c tut6.c tut10.c
+                 ${CONCOLIC_STUBS})
 
 add_library(ciltut-static ${SHELTER_SRCS} ${CONCOLIC_LIB})
 set_target_properties(ciltut-static PROPERTIES

File lib/Ciltut.pm

                            "-lm", "-lcurses", "-L$ocy" , "-locamlyices",
                            "-lstdc++", "/usr/local/lib/libyices.a";
         }
-        push @libs, "-ldl", "-lrt";
+        if ($self->{DARWIN}) {
+          push @libs, "-ldl";
+        }
+        else {
+          push @libs, "-ldl", "-lrt";
+        }
         return $self->SUPER::link_after_cil(\@srcs, $dest, $ppargs,
                                             \@cargs, \@libs);
     }