ce50734cf0
- gcc/ld-wrappers have been factored out into a separate derivation. This allows a working gcc to be installed in the user environment. (Previously the Nix gcc didn't work because it needed a whole bunch of flags to point to glibc.) - Better modularity: packages can specify hooks into the setup scripts. For instance, setup no longer knows about the PKG_CONFIG_PATH variable; pkgconfig can set it up instead. - gcc not longer depends on binutils. This simplifies the bootstrap process. svn path=/nixpkgs/trunk/; revision=816
41 lines
No EOL
550 B
Bash
Executable file
41 lines
No EOL
550 B
Bash
Executable file
#! /bin/sh
|
|
|
|
export NIX_DEBUG=1
|
|
|
|
. $stdenv/setup
|
|
|
|
export NIX_CFLAGS_COMPILE="-v $NIX_CFLAGS_COMPILE"
|
|
|
|
mkdir $out
|
|
mkdir $out/bin
|
|
|
|
cat > hello.c <<EOF
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char * * argv)
|
|
{
|
|
printf("Hello World!\n");
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
gcc hello.c -o $out/bin/hello
|
|
|
|
$out/bin/hello
|
|
|
|
cat > hello2.cc <<EOF
|
|
#include <iostream>
|
|
|
|
int main(int argc, char * * argv)
|
|
{
|
|
std::cout << "Hello World!\n";
|
|
std::cout << VALUE << std::endl;
|
|
return 0;
|
|
}
|
|
EOF
|
|
|
|
g++ hello2.cc -o $out/bin/hello2 -DVALUE="1 + 2 * 3"
|
|
|
|
$out/bin/hello2
|
|
|
|
ld -v |