Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak for compilation on cygwin #7

Open
paulotex opened this issue May 4, 2023 · 0 comments
Open

Tweak for compilation on cygwin #7

paulotex opened this issue May 4, 2023 · 0 comments

Comments

@paulotex
Copy link

paulotex commented May 4, 2023

I made a few tweaks to allow for compilation on cygwin. I don't know the official way to submit this to you guys, and actually a final tweak involved a manual compilation line. Perhaps someone else can create a proper pull request, or tell me how to do this?

>git diff
diff --git a/linutil/ufsdio.cpp b/linutil/ufsdio.cpp
index c7c6ed8..05012a9 100644
--- a/linutil/ufsdio.cpp
+++ b/linutil/ufsdio.cpp
@@ -35,6 +35,10 @@
 //#include <assert.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef __CYGWIN__
+  #define stat64 stat
+  #define fstat64 fstat
+#endif
 #include <fcntl.h>

 #ifdef _WIN32
@@ -159,9 +163,14 @@
     #include <sys/disk.h>
   #else
     #include <malloc.h>
-    #ifndef __QNX__
-      #include <linux/hdreg.h>
-      #include <linux/fs.h>
+    #ifdef __CYGWIN__
+      #include <cygwin/hdreg.h>
+      #include <cygwin/fs.h>
+    #else
+      #ifndef __QNX__
+        #include <linux/hdreg.h>
+        #include <linux/fs.h>
+      #endif
     #endif
   #endif
   #include <sys/ioctl.h>

I did not use the usual make.sh, because it is not detecting cygwin properly. I created a folder called "build" and from there I launched cmake with ">ccmake ../", and then generated the makefile.

"make" fails at the last step, because somehow cmake can't find the correct extension for libssl and libcrypt. This is the command that stops me to make a clean pull request for you guys, I don't know how to change CMakeLists.txt to make it work. The final link command (manually) is :

>/usr/bin/c++.exe -pipe [...] -lssl.dll -lcrypto.dll -ldl
Note the "-lssl.dll -lcrypto.dll".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant