Unverified Commit d53cd2e6 authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

eprover: fix cross compilation (#504298)

parents 6bf55cd7 a03c186e
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
--- a/CONTRIB/picosat-965/makefile.in
+++ b/CONTRIB/picosat-965/makefile.in
@@ -49,8 +49,7 @@ config.h: makefile VERSION mkconfig.sh # and actually picosat.c
 	rm -f $@; ./mkconfig.sh > $@
 
 libpicosat.a: picosat.o version.o
-	ar rc $@ picosat.o version.o
-	ranlib $@
+	$(AR) $@ picosat.o version.o
 
 SONAME=-Xlinker -soname -Xlinker libpicosat.so
 libpicosat.so: picosat.o version.o
--- a/Makefile.vars
+++ b/Makefile.vars
@@ -160,8 +160,8 @@ LD         = $(CC) $(LDFLAGS)
 
 # Generic
 #    AR         = sleep 1;ar rcs
-   AR         = ar rcs
-   CC         =  gcc
+#    AR         = ar rcs
+#    CC         =  gcc
 
 # Builds with link time optimization
 #
+13 −3
Original line number Diff line number Diff line
@@ -17,9 +17,11 @@ stdenv.mkDerivation (finalAttrs: {

  buildInputs = [ which ];

  preConfigure = ''
    sed -e 's/ *CC *= *gcc$//' -i Makefile.vars
  '';
  patches = [
    ./fix-cross-toolchains.patch
  ];

  configurePlatforms = [ ];

  configureFlags = [
    "--exec-prefix=$(out)"
@@ -29,6 +31,14 @@ stdenv.mkDerivation (finalAttrs: {
    "--enable-ho"
  ];

  # need to directly insert into makeFlagsArray as the makefile expects the binary
  # in the AR variable to already be passed the `rcs` flags, which requires us to
  # specify them. As this requires spaces, we need makeFlagsArray, as makeFlags
  # will just make the make script see the `rcs` as a target
  preBuild = ''
    makeFlagsArray+=(CC="${stdenv.cc.targetPrefix}cc" AR="${stdenv.cc.targetPrefix}ar rcs")
  '';

  meta = {
    description = "Automated theorem prover for full first-order logic with equality";
    homepage = "http://www.eprover.org/";