Closed xantares closed 9 years ago
Installing all triples is actually a feature, but I do not mind if that is disabled by default.
I have found issues that should be fixed before a merge:
add_definitions(-DCLANG_TARGET_OPT=\"-target\")
is not correct.
Wheezy's extremely old clang (3.0) wants -ccc-host-triple
instead of -target
.-DMINGW_PATH=...
should be added to the CXXFLAGS
(i.e.: -DMINGW_PATH="\"/usr/bin:/usr/bin:/data/development/3rd/mxe/usr/bin\""
).-pedantic -Wall -Wextra -Wno-unused-parameter
).-DCMAKE_BUILD_TYPE=Release
).mingw-gcc found (${MINGW_C_COMPILER}) but is not in the same directory[...]
That problem could be automatically fixed via make install
(i.e.: ln -sf $MINGW_PATH/<triple>-* $CLANG_PATH/
).
Required for old clang versions (<= 3.3 I think).-DCMAKE_INSTALL_PREFIX=
(README).package.sh
and cleanup.sh
should be re-added (not related to autotools)
cleanup.sh
could be replaced with git clean -fdx
in package.sh.ok
Forgot one more thing: -std=gnu++0x
should be used instead of -std=c++0x
,
-std=c++0x
doesn't work with Cygwin (-std=c++0x
seems to disable some non ANSI functions).
ok
Please do me one more favor, please squash your commits into a single one.
I would like to avoid having
etc. in the commit history.
could you cherry-pick 3add3c006421e73ec8d2099c6f336104331aec7d ?
Yes, works. Thanks for fixing all the issues.
I will push it once I have re-checked Cygwin and Debian/Wheezy. Probably done by tomorrow.
Two more things:
-DMINGW_PATH=\"/opt/other/llvm-3.5/bin:/opt/other/llvm-3.5/bin:/opt/other/llvm-3.5/bin\"
should be
-DMINGW_PATH="\"/usr/bin:/usr/bin:/data/development/3rd/mxe/usr/bin\""
You are missing readlink -f <triple>-gcc
there.
Maybe CMake comes with a better equivalent, readlink -f
isn't portable
(-f
doesn't work on OS X).
make install
should symlink MINGW_PATH/<triple>-*
into the clang binary directory
(if they are in different directories).
I know this is awful, but clang uses the wrong binutils otherwise.
Please see 062e6399268b25000de271114784f8d3d63fdc2c.Another thing: make package_source
ends up with a lot of unneeded files in the resulting packages, maybe you could invoke package.sh
via make package_source
for simplicity?
ok, fixed. for the package to be clean after make package_source, please compile out of source in a build* subdir which cmake ignores:
set (CPACK_SOURCE_IGNORE_FILES "/.git;/build;.*~;${CPACK_SOURCE_IGNORE_FILES}")
Thanks again.
Sorry for being so picky, but it seems the link detection isn't working correctly:
-- Found clang: /opt/other/llvm-3.5/bin/clang
-- Found mingw-gcc: /opt/other/llvm-3.5/bin/i686-w64-mingw32-gcc
CMake Error at CMakeLists.txt:102 (message):
mingw-gcc found (/opt/other/llvm-3.5/bin/i686-w64-mingw32-gcc) but is not
in the same directory as the clang binary (/opt/other/llvm-3.5/bin/clang).
Please run 'ln -sf /usr/bin/i686-w64-mingw32-gcc-win32
/opt/other/llvm-3.5/bin' to fix this issue.
-- Found mingw-gcc: /opt/other/llvm-3.5/bin/x86_64-w64-mingw32-gcc
CMake Error at CMakeLists.txt:102 (message):
mingw-gcc found (/opt/other/llvm-3.5/bin/x86_64-w64-mingw32-gcc) but is not
in the same directory as the clang binary (/opt/other/llvm-3.5/bin/clang).
Please run 'ln -sf /usr/bin/x86_64-w64-mingw32-gcc-win32
/opt/other/llvm-3.5/bin' to fix this issue.
'/opt/other/llvm-3.5/bin/x86_64-w64-mingw32-gcc' is indeed a correct symbolic link:
$ file /opt/other/llvm-3.5/bin/x86_64-w64-mingw32-gcc
/opt/other/llvm-3.5/bin/x86_64-w64-mingw32-gcc: symbolic link to `/usr/bin/x86_64-w64-mingw32-gcc'
The ln command should be corrected too and should include a wildcard rather than just symlinking gcc, like:
ln -sf /usr/bin/x86_64-w64-mingw32-* /opt/other/llvm-3.5/bin
It would also be great if the whole ln command could be shown in a single line (cmake seems to wrap its output to 80 cols, maybe this can be switched off somehow?)
ok. I can't seem to keep the message on one line.
Merged (with a few fixes on top).
Hi,
I noticed ALL the triplets were installed, this fixes it, it only installs the symlinks triplet-clang[++] for which a triplet-gcc were found.
I did not know to write this cleanly with autotools, and I'm much conmfortable with cmake, as it remove the need for shell/m4/autoconf scripts scattered around, all the infrastructure is written in neat cmakelists.
Usage example and output:
For discussion.