configure 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. #!/bin/sh
  2. ### Automatic build configuration script for Dinit.
  3. ### This script generates an "mconfig" file suitable for building on the current system.
  4. ## Initial preparation
  5. set -eu
  6. cd "$(dirname "$0")"
  7. ## Helper functions
  8. # POSIX "echo" behaviour is unspecified behavior in some cases, for example
  9. # when the first argument is "-n" or backslash ("\").
  10. # So, replace the shell built-in echo with a printf based function.
  11. # For more info see http://www.etalabs.net/sh_tricks.html
  12. echo()
  13. {
  14. IFS=" " printf %s\\n "$*"
  15. }
  16. info()
  17. {
  18. echo "$*"
  19. }
  20. sub_info()
  21. {
  22. echo " ... $*"
  23. }
  24. error()
  25. {
  26. >&2 echo "Error: $*"
  27. exit 1
  28. }
  29. sub_error()
  30. {
  31. >&2 echo " ... Error: $*"
  32. exit 1
  33. }
  34. # warning() have a built-in extra information feild which is optional
  35. # $1: Info, $2: Extra info (Optional)
  36. # NOTE: Always quote your warning() messages
  37. warning()
  38. {
  39. >&2 echo
  40. >&2 echo "Warning: $1"
  41. [ -n "${2:-}" ] && >&2 echo " ... $2"
  42. >&2 echo
  43. }
  44. cxx_works()
  45. {
  46. info Checking whether \""$1"\" is a working C++ compiler...
  47. if $CXX -o testfile.o testfile.cc; then
  48. rm -f testfile
  49. sub_info Yes.
  50. else
  51. rm -f testfile*
  52. sub_error It seems like \""$CXX"\" is not working a working C++ compiler. Please specify compiler.
  53. fi
  54. }
  55. # Test if the compiler accepts an argument (for compilation and link); if so add it to named variable.
  56. # $1 - the name of the variable to potentially add the argument to
  57. # $2 - the argument to add
  58. # CXX - the name of the compiler
  59. # CXXFLAGS, CXXFLAGS_EXTRA, LDFLAGS, LDFLAGS_EXTRA - any predetermined flags
  60. try_cxx_argument()
  61. {
  62. info Checking whether the compiler accepts "$2"...
  63. if $CXX $CXXFLAGS $2 $CXXFLAGS_EXTRA $LDFLAGS $LDFLAGS_EXTRA testfile.cc -o testfile > /dev/null 2>&1; then
  64. rm testfile
  65. sub_info Yes.
  66. eval "$1=\"\${$1} \$2\""
  67. eval "$1=\${$1# }"
  68. return 0
  69. else
  70. sub_info No.
  71. return 1
  72. fi
  73. }
  74. try_ld_argument()
  75. {
  76. info Checking whether "$2" is accepted as a link-time option...
  77. if $CXX $CXXFLAGS $CXXFLAGS_EXTRA $LDFLAGS $LDFLAGS_EXTRA $2 testfile.cc -o testfile > /dev/null 2>&1; then
  78. sub_info Yes.
  79. eval "$1=\"\${$1} \$2\""
  80. eval "$1=\${$1# }"
  81. else
  82. sub_info No.
  83. fi
  84. }
  85. try_both_argument()
  86. {
  87. info Checking whether the compiler/linker accepts "$3"...
  88. if $CXX $CXXFLAGS $CXXFLAGS_EXTRA $LDFLAGS $LDFLAGS_EXTRA $3 testfile.cc -o testfile > /dev/null 2>&1; then
  89. sub_info Yes.
  90. eval "$1=\"\${$1} \$3\""
  91. eval "$1=\${$1# }"
  92. eval "$2=\"\${$2} \$3\""
  93. eval "$2=\${$2# }"
  94. else
  95. sub_info No.
  96. fi
  97. }
  98. usage()
  99. {
  100. cat << _EOF
  101. Usage: $0 [OPTION]...
  102. Generates build configuration for Dinit.
  103. Defaults for the options are specified in brackets.
  104. -h, --help This help message.
  105. -q, --quiet Don't print normal messages, just errors.
  106. -c, --clear Clear mconfig and configure's temporary files.
  107. Target options:
  108. --platform=PLATFORM Set the platform manually (Just for cross-platform cross-compile!) [autodetected]
  109. Note: for all cross-compiles please specify correct CXX and CXX_FOR_BUILD!
  110. Installation directories:
  111. --prefix=PREFIX Main installation prefix [/usr]
  112. --exec-prefix=EPREFIX Main executables prefix [/]
  113. --sbindir=SBINDIR Dinit executables [EPREFIX/sbin]
  114. --mandir=MANDIR Dinit man-pages location [PREFIX/share/man]
  115. --syscontrolsocket=SOCKETPATH Dinitctl socket location [/run/dinitctl] on Linux systems
  116. [/var/run/dinitctl] on other systems
  117. Optional options:
  118. --enable-strip Strip debug information in installation process [Enabled]
  119. --disable-strip Don't strip debug information in installation process
  120. --shutdown-prefix=PREFIX Name prefix for shutdown, poweroff, reboot, halt programs []
  121. --enable-shutdown Build shutdown, poweroff, reboot, halt programs [Enabled only on Linux systems]
  122. --disable-shutdown Don't build shutdown, poweroff, reboot, halt programs
  123. --enable-cgroups Enable Cgroups support [Enabled only on Linux based systems]
  124. --disable-cgroups Disable Cgroups support
  125. --enable-utmpx Enable manipulating the utmp/utmpx database via the related POSIX functions [guessed]
  126. --disable-utmpx Disable manipulating the utmp/utmpx database via the related POSIX functions
  127. --enable-initgroups Enable initialization of supplementary groups for run-as [Enabled]
  128. --disable-initgroups Disable initialization of supplementary groups for run-as
  129. --enable-auto-restart Enable auto-restart for services by default [Enabled]
  130. --disable-auto-restart Disable auto-restart for services by default
  131. --default-start-timeout=sec Default start-timeout for services [60]
  132. --default-stop-timeout=sec Default stop-timeout for services [10]
  133. Build variables:
  134. Note: build variables can be passed in the environment, or as $0 argument (as "var=VALUE").
  135. Note: CXXFLAGS, TEST_CXXFLAGS, LDFLAGS and TEST_LDFLAGS by default will be set to options considered suitable
  136. for the platform, filtered to remove any options not supported by the compiler/linker. To disable this,
  137. specify the values explicitly (an empty string is accepted). To add options without removing the defaults,
  138. set the variable with _EXTRA appended to the name (eg CXXFLAGS_EXTRA).
  139. CXX C++ compiler
  140. CXX_FOR_BUILD C++ compiler generating code for the build system (for cross-compiles).
  141. CXXFLAGS_FOR_BUILD Flags to use when generating code for the build system.
  142. Defaults to the value of CXXFLAGS.
  143. CPPFLAGS_FOR_BUILD Preprocessor flags to use when generating code for the build system.
  144. Defaults to the value of CPPFLAGS.
  145. LDFLAGS_FOR_BUILD Link flags to use when generating code for the build system.
  146. Defaults to the value of LDFLAGS.
  147. CXXFLAGS Flags to use when compiling C++ code.
  148. CXXFLAGS_EXTRA Additional flags to use when compiling C++ code.
  149. TEST_CXXFLAGS Flags to use when compiling C++ code in tests.
  150. TEST_CXXFLAGS_EXTRA Additional flags to use when compiling C++ code in tests.
  151. CPPFLAGS Preprocessor flags to use when compiling C++ code.
  152. LDFLAGS Link flags.
  153. LDFLAGS_EXTRA Additional link flags.
  154. LDFLAGS_BASE Link flags to use in addition to any link-time optimisation
  155. (LTO)-related options. Set this to control link options without
  156. disabling LTO. Ignored if LDFLAGS is set.
  157. TEST_LDFLAGS Links flags when building test executables.
  158. TEST_LDFLAGS_EXTRA Additional link flags when building test executables.
  159. TEST_LDFLAGS_BASE Link flags to use when building test executables, in addition to
  160. LTO-releated options.
  161. Note: paths specified via --prefix/--exec-prefix/--sbindir/--mandir, and build variable values, must be
  162. escaped for use in a makefile and in shell commands. If there are spaces in paths it is recommended to
  163. prepend a backslash (\) to them.
  164. For example: ./configure --prefix="/home/my\ home"
  165. See BUILD file for more information.
  166. _EOF
  167. exit 0
  168. }
  169. ## Don't take values from environment for these variables:
  170. for var in PREFIX \
  171. EPREFIX \
  172. SBINDIR \
  173. MANDIR \
  174. SHUTDOWN_PREFIX \
  175. BUILD_SHUTDOWN \
  176. SUPPORT_CGROUPS \
  177. USE_UTMPX \
  178. USE_INITGROUPS \
  179. SYSCONTROLSOCKET \
  180. STRIPOPTS
  181. do
  182. unset $var
  183. done
  184. ## Flag parser
  185. for arg in "$@"; do
  186. case "$arg" in
  187. -h|--help) usage ;;
  188. -q|--quiet)
  189. info() { true; }
  190. sub_info() { true; }
  191. warning() { true; }
  192. ;;
  193. -c|--clear) rm -f test* & rm -f mconfig && exit 0 ;;
  194. --platform=*) PLATFORM="${arg#*=}" && shift ;;
  195. --prefix=*) PREFIX="${arg#*=}" && shift ;;
  196. --exec-prefix=*) EPREFIX="${arg#*=}" && shift;;
  197. --sbindir=*) SBINDIR="${arg#*=}" && shift ;;
  198. --mandir=*) MANDIR="${arg#*=}" && shift ;;
  199. --default-start-timeout=*) DEFAULT_START_TIMEOUT="${arg#*=}" && shift ;;
  200. --default-stop-timeout=*) DEFAULT_STOP_TIMEOUT="${arg#*=}" && shift ;;
  201. --syscontrolsocket=*) SYSCONTROLSOCKET="${arg#*=}" && shift ;;
  202. --shutdown-prefix=*) SHUTDOWN_PREFIX="${arg#*=}" && shift ;;
  203. --enable-shutdown|--enable-shutdown=yes) BUILD_SHUTDOWN=yes ;;
  204. --disable-shutdown|--enable-shutdown=no) BUILD_SHUTDOWN=no ;;
  205. --enable-cgroups|--enable-cgroups=yes) SUPPORT_CGROUPS=1 ;;
  206. --disable-cgroups|--enable-cgroups=no) SUPPORT_CGROUPS=0 ;;
  207. --enable-utmpx|--enable-utmpx=yes) USE_UTMPX=1 ;;
  208. --disable-utmpx|--enable-utmpx=no) USE_UTMPX=0 ;;
  209. --enable-initgroups|--enable-initgroups=yes) USE_INITGROUPS=1 ;;
  210. --disable-initgroups|--enable-initgroups=no) USE_INITGROUPS=0 ;;
  211. --enable-auto-restart|--enable-auto-restart=yes) DEFAULT_AUTO_RESTART=true ;;
  212. --disable-auto-restart|--enable-auto-restart=no) DEFAULT_AUTO_RESTART=false ;;
  213. --enable-strip|--enable-strip=yes) STRIPOPTS="-s" ;;
  214. --disable-strip|--enable-strip=no) STRIPOPTS="" ;;
  215. CXX=*|CXX_FOR_BUILD=*|CXXFLAGS_FOR_BUILD=*|CPPFLAGS_FOR_BUILD=*\
  216. |LDFLAGS_FOR_BUILD=*|CXXFLAGS=*|CXXFLAGS_EXTRA=*|TEST_CXXFLAGS=*\
  217. |TEST_CXXFLAGS_EXTRA=*|LDFLAGS=*|LDFLAGS_EXTRA=*|TEST_LDFLAGS=*\
  218. |TEST_LDFLAGS_EXTRA=*|CPPFLAGS=*|LDFLAGS_BASE=*|TEST_LDFLAGS_BASE=*) eval "${arg%%=*}=\${arg#*=}" ;;
  219. *=*) warning "Unknown variable: ${arg%%=*}" ;;
  220. *) warning "Unknown argument: $arg" ;;
  221. esac
  222. done
  223. ## Defaults for variables not specified by user
  224. : "${PLATFORM:=$(uname)}"
  225. : "${PREFIX:="/usr"}"
  226. : "${EPREFIX:="/"}"
  227. : "${SBINDIR:="${EPREFIX%%/}/sbin"}"
  228. : "${MANDIR:="${PREFIX%%/}/share/man"}"
  229. : "${SHUTDOWN_PREFIX:=""}"
  230. : "${CXXFLAGS_EXTRA:=""}"
  231. : "${TEST_CXXFLAGS_EXTRA:=""}"
  232. : "${CPPFLAGS:=""}"
  233. : "${LDFLAGS_EXTRA:=""}"
  234. : "${TEST_LDFLAGS_EXTRA:=""}"
  235. : "${DEFAULT_AUTO_RESTART:="true"}"
  236. : "${DEFAULT_START_TIMEOUT:="60"}"
  237. : "${DEFAULT_STOP_TIMEOUT:="10"}"
  238. : "${USE_INITGROUPS:="1"}"
  239. if [ "$PLATFORM" = "Linux" ]; then
  240. : "${BUILD_SHUTDOWN:="yes"}"
  241. : "${SUPPORT_CGROUPS:="1"}"
  242. : "${SYSCONTROLSOCKET:="/run/dinitctl"}"
  243. else
  244. : "${BUILD_SHUTDOWN:="no"}"
  245. : "${SUPPORT_CGROUPS:="0"}"
  246. : "${SYSCONTROLSOCKET:="/var/run/dinitctl"}"
  247. fi
  248. HAS_LTO=""
  249. ## Finalize $CXXFLAGS, $TEST_CXXFLAGS, $LDFLAGS, $TEST_LDFLAGS, $STRIPOPTS
  250. if [ -z "${CXXFLAGS+IS_SET}" ]; then
  251. CXXFLAGS=""
  252. AUTO_CXXFLAGS="true"
  253. else
  254. AUTO_CXXFLAGS="false"
  255. fi
  256. if [ -z "${TEST_CXXFLAGS+IS_SET}" ]; then
  257. TEST_CXXFLAGS=""
  258. AUTO_TEST_CXXFLAGS="true"
  259. else
  260. AUTO_TEST_CXXFLAGS="false"
  261. fi
  262. if [ -z "${LDFLAGS+IS_SET}" ]; then
  263. LDFLAGS=""
  264. AUTO_LDFLAGS="true"
  265. else
  266. AUTO_LDFLAGS="false"
  267. fi
  268. if [ -z "${TEST_LDFLAGS+IS_SET}" ]; then
  269. TEST_LDFLAGS=""
  270. AUTO_TEST_LDFLAGS="true"
  271. else
  272. AUTO_TEST_LDFLAGS="false"
  273. fi
  274. if [ -z "${LDFLAGS_BASE+IS_SET}" ]; then
  275. LDFLAGS_BASE=""
  276. AUTO_LDFLAGS_BASE="true"
  277. else
  278. AUTO_LDFLAGS=BASE="false"
  279. fi
  280. if [ -z "${TEST_LDFLAGS_BASE+IS_SET}" ]; then
  281. TEST_LDFLAGS_BASE=""
  282. AUTO_TEST_LDFLAGS_BASE="true"
  283. else
  284. AUTO_TEST_LDFLAGS=BASE="false"
  285. fi
  286. [ -z "${STRIPOPTS+IS_SET}" ] && STRIPOPTS="-s"
  287. ## Verify PLATFORM value
  288. if [ "$PLATFORM" != "Linux" ] && [ "$PLATFORM" != "FreeBSD" ] && \
  289. [ "$PLATFORM" != "OpenBSD" ] && [ "$PLATFORM" != "Darwin" ]; then
  290. warning "$PLATFORM platform is unknown!" "Known Platforms are: Linux, FreeBSD, OpenBSD, Darwin"
  291. fi
  292. ## Create testfile.cc to test c++ compiler
  293. echo "int main(int argc, char **argv) { return 0; }" > testfile.cc || error Can\'t create temporary file
  294. ## Find and test C++ compiler
  295. if [ -z "${CXX:-}" ]; then
  296. info Checking C++ compiler...
  297. for guess in g++ clang++ c++; do
  298. if type "$guess" > /dev/null 2>&1; then
  299. CXX="$guess"
  300. sub_info "$CXX"
  301. break # Found
  302. fi
  303. done
  304. if [ -z "${CXX:-}" ]; then
  305. sub_error No C++ compiler found! # Not found
  306. fi
  307. fi
  308. cxx_works "$CXX"
  309. if [ -n "${CXX_FOR_BUILD:-}" ]; then
  310. cxx_works "$CXX_FOR_BUILD"
  311. fi
  312. ## Test compiler/linker supported arguments
  313. if [ "$AUTO_CXXFLAGS" = "true" ]; then
  314. if ! try_cxx_argument CXXFLAGS -std=c++11; then
  315. sub_error "The C++ compiler ($CXX) doesn't accept '-std=c++11' and may be too old."
  316. fi
  317. for argument in -Wall \
  318. -Os \
  319. -fno-plt
  320. do
  321. try_cxx_argument CXXFLAGS $argument || :
  322. done
  323. if [ "$PLATFORM" != "Darwin" ]; then
  324. try_cxx_argument CXXFLAGS -fno-rtti || :
  325. fi
  326. fi
  327. if [ "$AUTO_LDFLAGS" = "true" ] && [ "$AUTO_CXXFLAGS" = "true" ]; then
  328. if try_cxx_argument CXXFLAGS -flto; then
  329. HAS_LTO="true"
  330. else
  331. HAS_LTO="false"
  332. fi
  333. fi
  334. if [ "$AUTO_LDFLAGS_BASE" = true ] && [ "$PLATFORM" = FreeBSD ]; then
  335. try_ld_argument LDFLAGS_BASE -lrt
  336. fi
  337. if [ "$AUTO_TEST_LDFLAGS_BASE" = true ]; then
  338. TEST_LDFLAGS_BASE="\$(LDFLAGS_BASE)"
  339. established_TEST_LDFLAGS="$LDFLAGS_BASE"
  340. else
  341. established_TEST_LDFLAGS="$TEST_LDFLAGS_BASE"
  342. fi
  343. # Determine LDFLAGS/TEST_LDFLAGS. In the case of TEST_LDFLAGS we may still add sanitisation
  344. # options, shortly.
  345. if [ "$HAS_LTO" = true ]; then
  346. if [ "$AUTO_LDFLAGS" = true ]; then
  347. LDFLAGS="\$(LDFLAGS_BASE) \$(CXXFLAGS)"
  348. fi
  349. if [ "$AUTO_TEST_LDFLAGS" = true ]; then
  350. TEST_LDFLAGS="\$(TEST_LDFLAGS_BASE) \$(TEST_CXXFLAGS)"
  351. established_TEST_LDFLAGS="$established_TEST_LDFLAGS $TEST_CXXFLAGS"
  352. else
  353. established_TEST_LDFLAGS="$TEST_LDFLAGS"
  354. fi
  355. else
  356. # default LDFLAGS are just $(LDFLAGS_BASE)
  357. if [ "$AUTO_LDFLAGS" = true ]; then
  358. LDFLAGS="\$(LDFLAGS_BASE)"
  359. fi
  360. if [ "$AUTO_TEST_LDFLAGS" = true ]; then
  361. TEST_LDFLAGS="\$(TEST_LDFLAGS_BASE)"
  362. else
  363. established_TEST_LDFLAGS="$TEST_LDFLAGS"
  364. fi
  365. fi
  366. # Default for test flags (TEST_CXXFLAGS, TEST_LDFLAGS) is to use the build flags
  367. if [ "$AUTO_TEST_CXXFLAGS" = "true" ]; then
  368. TEST_CXXFLAGS="\$(CXXFLAGS)"
  369. established_TEST_CXXFLAGS="$CXXFLAGS"
  370. else
  371. established_TEST_CXXFLAGS="$TEST_CXXFLAGS"
  372. fi
  373. # Check whether sanitizers can be used for tests
  374. if [ "$AUTO_TEST_LDFLAGS" = "true" ] && [ "$AUTO_TEST_CXXFLAGS" = "true" ]; then
  375. if [ "$HAS_LTO" = true ]; then
  376. CXXFLAGS="$established_TEST_CXXFLAGS" CXXFLAGS_EXTRA="$TEST_CXXFLAGS_EXTRA" \
  377. LDFLAGS="$established_TEST_LDFLAGS" LDFLAGS_EXTRA="$TEST_LDFLAGS_EXTRA" \
  378. try_cxx_argument TEST_CXXFLAGS -fsanitize=address,undefined
  379. else
  380. CXXFLAGS="$established_TEST_CXXFLAGS" CXXFLAGS_EXTRA="$TEST_CXXFLAGS_EXTRA" \
  381. LDFLAGS="$established_TEST_LDFLAGS" LDFLAGS_EXTRA="$TEST_LDFLAGS_EXTRA" \
  382. try_both_argument TEST_CXXFLAGS TEST_LDFLAGS -fsanitize=address,undefined
  383. fi
  384. fi
  385. ## Create mconfig
  386. rm -f testfile*
  387. info Creating mconfig...
  388. cat << _EOF > mconfig
  389. ## Auto-generated by "$0" for "$PLATFORM"
  390. # All changes will be lost if "$0" is re-run.
  391. # See BUILD for help on all variables.
  392. # Installation path options.
  393. SBINDIR=$SBINDIR
  394. MANDIR=$MANDIR
  395. SYSCONTROLSOCKET=$SYSCONTROLSOCKET
  396. # General build options.
  397. CXX=$CXX
  398. CXXFLAGS=$CXXFLAGS
  399. CXXFLAGS_EXTRA=$CXXFLAGS_EXTRA
  400. TEST_CXXFLAGS=$TEST_CXXFLAGS
  401. TEST_CXXFLAGS_EXTRA=$TEST_CXXFLAGS_EXTRA
  402. CPPFLAGS=$CPPFLAGS
  403. LDFLAGS_BASE=$LDFLAGS_BASE
  404. LDFLAGS=$LDFLAGS
  405. LDFLAGS_EXTRA=$LDFLAGS_EXTRA
  406. TEST_LDFLAGS_BASE=$TEST_LDFLAGS_BASE
  407. TEST_LDFLAGS=$TEST_LDFLAGS
  408. TEST_LDFLAGS_EXTRA=$TEST_LDFLAGS_EXTRA
  409. BUILD_SHUTDOWN=$BUILD_SHUTDOWN
  410. STRIPOPTS=$STRIPOPTS
  411. # Feature settings
  412. SUPPORT_CGROUPS=$SUPPORT_CGROUPS
  413. USE_INITGROUPS=$USE_INITGROUPS
  414. # Optional settings
  415. SHUTDOWN_PREFIX=${SHUTDOWN_PREFIX:-}
  416. # Service defaults
  417. DEFAULT_AUTO_RESTART=$DEFAULT_AUTO_RESTART
  418. DEFAULT_START_TIMEOUT=$DEFAULT_START_TIMEOUT
  419. DEFAULT_STOP_TIMEOUT=$DEFAULT_STOP_TIMEOUT
  420. _EOF
  421. if [ -n "${USE_UTMPX:-}" ]; then
  422. echo "USE_UTMPX=$USE_UTMPX" >> mconfig
  423. fi
  424. if [ -n "${CXX_FOR_BUILD:-}" ]; then
  425. {
  426. echo ""
  427. echo "# For cross-compiling"
  428. echo "CXX_FOR_BUILD=$CXX_FOR_BUILD"
  429. } >> mconfig
  430. fi
  431. if [ -n "${CXXFLAGS_FOR_BUILD:-}" ]; then
  432. echo "CXXFLAGS_FOR_BUILD=$CXXFLAGS_FOR_BUILD" >> mconfig
  433. fi
  434. if [ -n "${CPPFLAGS_FOR_BUILD:-}" ]; then
  435. echo "CPPFLAGS_FOR_BUILD=$CPPFLAGS_FOR_BUILD" >> mconfig
  436. fi
  437. if [ -n "${LDFLAGS_FOR_BUILD:-}" ]; then
  438. echo "LDFLAGS_FOR_BUILD=$LDFLAGS_FOR_BUILD" >> mconfig
  439. fi
  440. sub_info done.
  441. info Done!
  442. exit 0