more build system tweaks

This commit is contained in:
Jack Andersen 2015-06-16 14:57:06 -10:00
parent 2bb60ab152
commit 96ed8a2ce2
4 changed files with 16 additions and 13 deletions

View File

@ -19,7 +19,7 @@ pkgver() {
build() {
cd "$srcdir/$_pkgname"
qmake && make
qmake PREFIX="$pkgdir/usr" && make
}
package() {

View File

@ -1,7 +1,7 @@
# PKGBUILD for atdna
_pkgname=atdna
pkgname=$_pkgname-git
pkgver=1.1.0.17.gfb722a9
pkgver=1.1.0.18.g2bb60ab
pkgrel=1
pkgdesc="Companion DNA utility for libAthena"
arch=('i686' 'x86_64')
@ -20,7 +20,7 @@ pkgver() {
build() {
cd "$srcdir/$_pkgname/atdna"
qmake && make
qmake PREFIX="$pkgdir/usr" && make
}
package() {

View File

@ -71,3 +71,6 @@ win32 {
utilFiles.files = $$OUT_PWD/atdna
INSTALLS += utilFiles
}
DEFINES += SYSTEM_PREFIX="$$PREFIX"

View File

@ -11,6 +11,13 @@
#include "llvm/Support/Format.h"
#include "llvm/Support/CommandLine.h"
#ifndef SYSTEM_PREFIX
#define SYSTEM_PREFIX /usr/local
#endif
#define XSTR(s) STR(s)
#define STR(s) #s
static llvm::cl::opt<bool> Help("h", llvm::cl::desc("Alias for -help"), llvm::cl::Hidden);
static llvm::cl::OptionCategory ATDNAFormatCategory("atdna options");
@ -435,19 +442,12 @@ int main(int argc, const char** argv)
std::vector<std::string> args = {"clang-tool",
"-fsyntax-only",
"-std=c++11"};
llvm::IntrusiveRefCntPtr<clang::FileManager> fman(new clang::FileManager(clang::FileSystemOptions()));
const clang::FileEntry* selfEntry = fman->getFile(argv[0]);
if (selfEntry && selfEntry->isValid())
{
std::string base(selfEntry->getDir()->getName());
args.push_back("-I" + base + "/clang/" + CLANG_VERSION_STRING + "/include");
args.push_back("-I" + base);
}
args.push_back("-I" + std::string(XSTR(SYSTEM_PREFIX)) + "/lib/clang/" + CLANG_VERSION_STRING + "/include");
llvm::outs() << args.back() << "\n";
for (int a=1 ; a<argc ; ++a)
args.push_back(argv[a]);
llvm::IntrusiveRefCntPtr<clang::FileManager> fman(new clang::FileManager(clang::FileSystemOptions()));
clang::tooling::ToolInvocation TI(args, new ATDNAAction, fman.get());
if (TI.run())
return 0;