Skip to content

Linux port hdd cp1 #3

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

Closed
wants to merge 17 commits into from
Closed

Linux port hdd cp1 #3

wants to merge 17 commits into from

Conversation

dgrove-oss
Copy link
Contributor

Some progress towards building libdispatch on Linux.

With this set of changes, libdispatch.so builds successfully and a test program can be linked against it. However, execution of the test program fails during initialization of work queue data structures (called from dispatch_init)

The existing code was clearly wrong, but this might not be
the right way to fix it either...
with an unknown error message (despite the fact that ld won't actually
understand the argument, so linking will actually fail in the end).

This is a hack to generate workable makefiles; it may not be the right fix...
Move stubs.h to stubs_internal.h and include it from internal.h
(so we don't need to install stubs to get a complete set of header files).
@@ -0,0 +1,10 @@
// Stub out Apple internal header file to redirect to linux_base.h.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is problematic, OSX and iOS already have a public header with this name from a different project and this will conflict

Either we have to conditionalize the install of this header based on platform (and fully replicate its contents from OSX), or we have to conditionalize its inclusion.

an AC_CHECK_HEADERS([os/base.h]) test in configure.ac would be the standard way to do the latter, but since most of the #include <os/base.h> are in API headers, that is not really an option either (since we don't want to install config.h on OSX)

the best option for now may be to move the various #include <os/base.h> into #ifdef __APPLE__ conditionals and in the #else case do the #include <os/linux_base.h> (or possibly include an intermediate header that does non-APPLE platform disambiguation, though based on what ?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking about it more, something like this may make the most sense (e.g. in a new os/target.h header ?)

#ifdef __APPLE__
#include <TargetConditionals.h>
#else
#define TARGET_OS_UNIX 1
#endif

and then conditionalize with #if TARGET_OS_MAC resp. #if TARGET_OS_UNIX ?

@dgrove-oss
Copy link
Contributor Author

I've reworked the changes and submitted a new pull request: #5. Therefore closing this one.

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

Successfully merging this pull request may close these issues.

2 participants