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

Make it workable on OpenBSD #2690

Merged
merged 1 commit into from Mar 25, 2016
Merged

Make it workable on OpenBSD #2690

merged 1 commit into from Mar 25, 2016

Conversation

devnexen
Copy link
Contributor

  • Additional LMMS_BUILD flag.
  • Disallow on plugins -Wl,-no-undefined which triggers undefined references.
  • Make sure X11 headers are found.

@tresf
Copy link
Member

tresf commented Mar 20, 2016

No objections here...

I couldn't get a compile to fire due to such and old gcc version (4.2, failed due to the -std=c++-0x). What technique did you use to get on a modern gcc version? Also, OpenBSD 5.8 or 5.9?

Command log for reference:

#////// DEPS //////
su -
export PKG_PATH=http://ftp5.usa.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(machine -a)/
 # ^-- rit mirror, closest to me; placed in /root/.profile

pkg_add git cmake qt5 fftw3-float libogg libvorbis libsndfile libsamplerate jack sdl \
 fluidsynth fltk gcc-4.9.3p0 g++-4.9.3p0
 # ^-- couldn't find stk, but easy enough to dl/compile if needed
exit # or CTRL+D leave root

#////// BUILD //////
git clone -b master https://github.com/lmms/lmms
cd lmms; mkdir build target; cd build;

# gcc 4.9
cmake .. -DCMAKE_INSTALL_PREFIX=../target/ \
 -DCMAKE_C_COMPILER=egcc \
 -DCMAKE_CXX_COMPILER=eg++ \
 -DWANT_QT5=True \
 -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake
 # ^-- pkgconfig couldn't find qt5, hence prefix

# -- OR --

# clang
cmake .. -DCMAKE_INSTALL_PREFIX=../target/ \
 -DCMAKE_C_COMPILER=clang \
 -DCMAKE_CXX_COMPILER=clang++ \
 -DWANT_QT5=True \
 -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake

@devnexen
Copy link
Contributor Author

There is either clang or gcc 4.9 (in this case compilers are egcc and eg++) port/package.

@devnexen
Copy link
Contributor Author

As from kind @tresf request, and he mentioned the base compiler is far too old to compile even c++0x code ; hence this is how to test properly on OpenBSD (tested with the current stable), here is a little update of his command log reference

  • pkg_add git cmake qt5 fftw3-float libogg libvorbis libsndfile libsamplerate jack sdl fluidsynth fltk gcc-4.9.3p0 g++-4.9.3p0 (or the two last can be replaced by llvm which installs as well the clang frontends).
  • cmake .. -DCMAKE_INSTALL_PREFIX=../target/ -DCMAKE_C_COMPILER=(egcc or clang) -DCMAKE_CXX_COMPILER=(eg++ or clang++) -DWANT_QT5=True -DCMAKE_PREFIX_PATH=/usr/local/lib/qt5/cmake

Hope it is useful.

@tresf
Copy link
Member

tresf commented Mar 21, 2016

@devnexen Much obliged. I'll try those this evening (western hemisphere) and post back. 👍

ADD_DEFINITIONS(-DOS_LINUX)
ELSE(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE)
ELSE(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD)
Copy link
Member

Choose a reason for hiding this comment

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

Not incorrect, but this can be simplified to ELSE(), ENDIF(), etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it correct with older version of cmake ?

Copy link
Member

Choose a reason for hiding this comment

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

Is it correct with older version of cmake ?

Yes, this is a readability practice. e.g. if you have many nested IF()'s.

IF(FOO)
  MESSAGE("IN FOO")
  IF(BAR)
    MESSAGE("IN BAR")
  ENDIF(FOO)
ENDIF(BAR)

It's fine to leave, but we've been slowly cleaning them up in many places as we visit them as they start to loose their effectiveness when there are too many params.

IF(FOO OR BAR OR LOREM OR IPSUM OR DOLOR OR SIT OR AMET)
  MESSAGE("HELLO FOO BAR LOREM IPSUM DOLOR SIT AMET")
ENDIF(FOO OR BAR OR LOREM OR IPSUM OR DOLOR OR SIT OR AMET)

vs.

IF(FOO OR BAR OR LOREM OR IPSUM OR DOLOR OR SIT OR AMET)
  MESSAGE("HELLO FOO BAR LOREM IPSUM DOLOR SIT AMET")
ENDIF()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fair point. updating.

@tresf
Copy link
Member

tresf commented Mar 22, 2016

No major issues with the PR. Nice work. I've left a few comments where we could do things slightly better. Feedback welcome.

Test results with GCC 4.9 pass. I've updated my snippet above to reflect your suggestions.

Next is clang... From your dragon avatar, I can only assume that's your compiler of choice? :)

image

@tresf
Copy link
Member

tresf commented Mar 22, 2016

Ok, so clang is a bit shotty at the moment... Without -stdlib=libc++:

/usr/local/include/X11/qt5/QtCore/qflags.h:43:10: fatal error: 'initializer_list' file not found
#include <initializer_list>

With -stdlib=libc++:

/usr/local/include/X11/qt5/QtCore/qcompilerdetection.h:890:11: fatal error: 'utility' file not found
# include <utility>
          ^
1 error generated.
*** Error 1 in . (plugins/flp_import/CMakeFiles/flpimport.dir/build.make:79 'plugins/flp_import/CMakeFiles/flpimport.dir/unrtf.cpp.o': cd /h...)
*** Error 2 in . (CMakeFiles/Makefile2:1189 'plugins/flp_import/CMakeFiles/flpimport.dir/all')
*** Error 2 in /home/openbsd/lmms-clang/build (Makefile:137 'all')

That's as far as I got. If you're ok leaving out support for clang for now, so are we. 👍

@devnexen
Copy link
Contributor Author

Hi and thanks for the feedback.

I admit for clang I tested with OpenBSD current which is clang 3.8, I think with OpenBSD 5.8 it is 3.5 so we can leave it for the moment.
About the ifdef I think it is because INT32_MAX was already defined if I remember well on OpenBSD.

@@ -3,12 +3,12 @@ INCLUDE(BuildPlugin)

# definitions for ZynAddSubFX
IF(LMMS_BUILD_LINUX OR LMMS_BUILD_APPLE OR LMMS_BUILD_OPENBSD)
FIND_PACKAGE(X11)
Copy link
Member

Choose a reason for hiding this comment

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

Formatting looks slightly off here.

@tresf
Copy link
Member

tresf commented Mar 25, 2016

@devnexen thanks again for this. If you could touch up the formatting and squash your commits e.g. git rebase -i HEAD~6; git push --force (where 6 is the number of commits in the PR -- there's 5 now, assuming you'll add one more) then we'll have this merged. 👍

- Additional LMMS_BUILD flag.
- Disallow on plugins -Wl,-no-undefined which triggers undefined references.
- Make sure X11 headers are found.

Lib ossaudio is needed only for OpenBSD

redundant expression removal

simplify condition for detection OS 'kind'

seems the last commit brought an issue on OSx travis test ....
@devnexen
Copy link
Contributor Author

Ok thanks for your patience :)

@tresf tresf merged commit 770c07f into LMMS:master Mar 25, 2016
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.

None yet

2 participants