1 # BSD makefiles should be able to detect this
2 # but without they end up using gcc on Darwin stdenv
21 export _GCC_CRTBEGINS
=
24 export _GCC_LIBGCCDIR
=
29 # Definitions passed to share/mk/*.mk. Should be pretty simple -
30 # eventually maybe move it to a configure script.
32 export NOCLANGERROR
=yes
36 export EXTERNAL_TOOLCHAIN
=yes
38 makeFlags
="MACHINE=$MACHINE $makeFlags"
39 makeFlags
="MACHINE_ARCH=$MACHINE_ARCH $makeFlags"
40 makeFlags
="AR=$AR $makeFlags"
41 makeFlags
="CC=$CC $makeFlags"
42 makeFlags
="CPP=$CPP $makeFlags"
43 makeFlags
="CXX=$CXX $makeFlags"
44 makeFlags
="LD=$LD $makeFlags"
45 makeFlags
="STRIP=$STRIP $makeFlags"
47 makeFlags
="BINDIR=${!outputBin}/bin $makeFlags"
48 makeFlags
="LIBDIR=${!outputLib}/lib $makeFlags"
49 makeFlags
="SHLIBDIR=${!outputLib}/lib $makeFlags"
50 makeFlags
="SHAREDIR=${!outputLib}/share $makeFlags"
51 makeFlags
="INFODIR=${!outputInfo}/share/info $makeFlags"
52 makeFlags
="DOCDIR=${!outputDoc}/share/doc $makeFlags"
53 makeFlags
="LOCALEDIR=${!outputLib}/share/locale $makeFlags"
55 # Parallel building. Needs the space.
56 makeFlags
="-j $NIX_BUILD_CORES $makeFlags"
60 sourceRoot
=$PWD/$sourceRoot
61 export BSDSRCDIR
=$sourceRoot
62 export _SRC_TOP_
=$BSDSRCDIR
67 if [ -d "$COMPONENT_PATH" ]
68 then sourceRoot
=$sourceRoot/$COMPONENT_PATH
74 if [ -z "${skipIncludesPhase:-}" ]; then
78 $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
82 echoCmd
'includes flags' "${flagsArray[@]}"
83 make ${makefile:+-f $makefile} "${flagsArray[@]}"
92 if [ -d $prefix ]; then
93 # Remove lingering /usr references
94 if [ -d $prefix/usr
]; then
95 # Didn't try using rsync yet because per
96 # https://unix.stackexchange.com/questions/127712/merging-folders-with-mv,
97 # it's not neessarily better.
99 find .
-type d
-exec mkdir
-p $out/\
{} \
;
100 find . \
( -type f
-o -type l \
) -exec mv \
{} $out/\
{} \
;
104 find $prefix -type d
-empty -delete
108 postUnpackHooks
+=(setBSDSourceDir
)
109 postPatchHooks
+=(cdBSDPath
)
110 preConfigureHooks
+=(addMakeFlags
)
111 preInstallHooks
+=(includesPhase
)
112 fixupOutputHooks
+=(moveUsrDir
)