diff options
| author | Richard M. Stallman | 1994-06-19 15:40:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-06-19 15:40:27 +0000 |
| commit | 3ef1da4719b6b387abc7df4c91b7cba9594bc344 (patch) | |
| tree | 918d732a753ed2bce70c3f5f549522d565e1c80a | |
| parent | 8a1cf30e6e4f6659598290f90d6c21cad94580b3 (diff) | |
| download | emacs-3ef1da4719b6b387abc7df4c91b7cba9594bc344.tar.gz emacs-3ef1da4719b6b387abc7df4c91b7cba9594bc344.zip | |
Get CFLAGS both with and without THIS_IS_CONFIGURE,
for two different uses.
| -rwxr-xr-x | configure1.in | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/configure1.in b/configure1.in index a36b34ecbc3..09793aea061 100755 --- a/configure1.in +++ b/configure1.in | |||
| @@ -1323,13 +1323,19 @@ echo "Examining the machine- and system-dependent files to find out" | |||
| 1323 | echo " - which libraries the lib-src programs will want, and" | 1323 | echo " - which libraries the lib-src programs will want, and" |
| 1324 | echo " - whether the GNU malloc routines are usable." | 1324 | echo " - whether the GNU malloc routines are usable." |
| 1325 | 1325 | ||
| 1326 | ### First figure out CFLAGS (which we use for running the compiler here) | ||
| 1327 | ### and REAL_CFLAGS (which we use for real compilation). | ||
| 1328 | ### The two are the same except on a few systems, where they are made | ||
| 1329 | ### different to work around various lossages. For example, | ||
| 1330 | ### GCC 2.5 on Linux needs them to be different because it treats -g | ||
| 1331 | ### as implying static linking. | ||
| 1332 | |||
| 1326 | ### It's not important that this name contain the PID; you can't run | 1333 | ### It's not important that this name contain the PID; you can't run |
| 1327 | ### two configures in the same directory and have anything work | 1334 | ### two configures in the same directory and have anything work |
| 1328 | ### anyway. | 1335 | ### anyway. |
| 1329 | tempcname="conftest.c" | 1336 | tempcname="conftest.c" |
| 1330 | 1337 | ||
| 1331 | echo ' | 1338 | echo ' |
| 1332 | #define THIS_IS_CONFIGURE | ||
| 1333 | #include "'${srcdir}'/src/'${opsysfile}'" | 1339 | #include "'${srcdir}'/src/'${opsysfile}'" |
| 1334 | #include "'${srcdir}'/src/'${machfile}'" | 1340 | #include "'${srcdir}'/src/'${machfile}'" |
| 1335 | #ifndef LIBS_MACHINE | 1341 | #ifndef LIBS_MACHINE |
| @@ -1381,11 +1387,25 @@ configure___ system_malloc=no | |||
| 1381 | #define C_OPTIMIZE_SWITCH -O | 1387 | #define C_OPTIMIZE_SWITCH -O |
| 1382 | #endif | 1388 | #endif |
| 1383 | 1389 | ||
| 1390 | #ifdef THIS_IS_CONFIGURE | ||
| 1391 | |||
| 1392 | /* Get the CFLAGS for tests in configure. */ | ||
| 1384 | #ifdef __GNUC__ | 1393 | #ifdef __GNUC__ |
| 1385 | configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}' | 1394 | configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}' |
| 1386 | #else | 1395 | #else |
| 1387 | configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}' | 1396 | configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}' |
| 1388 | #endif | 1397 | #endif |
| 1398 | |||
| 1399 | #else /* not THIS_IS_CONFIGURE */ | ||
| 1400 | |||
| 1401 | /* Get the CFLAGS for real compilation. */ | ||
| 1402 | #ifdef __GNUC__ | ||
| 1403 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}' | ||
| 1404 | #else | ||
| 1405 | configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${CFLAGS}' | ||
| 1406 | #endif | ||
| 1407 | |||
| 1408 | #endif /* not THIS_IS_CONFIGURE */ | ||
| 1389 | ' > ${tempcname} | 1409 | ' > ${tempcname} |
| 1390 | # The value of CPP is a quoted variable reference, so we need to do this | 1410 | # The value of CPP is a quoted variable reference, so we need to do this |
| 1391 | # to get its actual value... | 1411 | # to get its actual value... |
| @@ -1393,6 +1413,9 @@ CPP=`eval "echo $CPP"` | |||
| 1393 | eval `${CPP} -Isrc ${tempcname} \ | 1413 | eval `${CPP} -Isrc ${tempcname} \ |
| 1394 | | grep 'configure___' \ | 1414 | | grep 'configure___' \ |
| 1395 | | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` | 1415 | | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` |
| 1416 | eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \ | ||
| 1417 | | grep 'configure___' \ | ||
| 1418 | | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'` | ||
| 1396 | rm ${tempcname} | 1419 | rm ${tempcname} |
| 1397 | 1420 | ||
| 1398 | ### Compute the unexec source name from the object name. | 1421 | ### Compute the unexec source name from the object name. |
| @@ -1437,7 +1460,6 @@ fi | |||
| 1437 | 1460 | ||
| 1438 | # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used | 1461 | # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used |
| 1439 | # for the tests that follow. | 1462 | # for the tests that follow. |
| 1440 | orig_cflags="$CFLAGS" | ||
| 1441 | 1463 | ||
| 1442 | if test "${HAVE_X11}" = "yes"; then | 1464 | if test "${HAVE_X11}" = "yes"; then |
| 1443 | DEFS="$C_SWITCH_X_SITE $DEFS" | 1465 | DEFS="$C_SWITCH_X_SITE $DEFS" |
| @@ -1478,8 +1500,8 @@ if test -n "$ok_so_far"; then | |||
| 1478 | AC_DEFINE(HAVE_INET_SOCKETS) | 1500 | AC_DEFINE(HAVE_INET_SOCKETS) |
| 1479 | fi | 1501 | fi |
| 1480 | 1502 | ||
| 1481 | # Restore the original CFLAGS value. | 1503 | # Set up the CFLAGS for real compilation, so we can substitute it. |
| 1482 | CFLAGS="$orig_cflags" | 1504 | CFLAGS="$REAL_CFLAGS" |
| 1483 | 1505 | ||
| 1484 | [ | 1506 | [ |
| 1485 | #### Find out which version of Emacs this is. | 1507 | #### Find out which version of Emacs this is. |