Skip to content

Commit

Permalink
Allow CPPFLAGS, LDLIBS and LDFLAGS additions to be specified as envir…
Browse files Browse the repository at this point in the history
…onment

variables into configure script.
  • Loading branch information
Graham.Dumpleton committed Sep 17, 2008
1 parent 6c242ba commit dbe1236
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ else
CPPFLAGS3=""
fi

CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"



Expand All @@ -1392,7 +1392,7 @@ PYTHONFRAMEWORK=`${PYTHON} -c 'from sys import stdout; \
stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORK"))'`

if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
LDFLAGS=`${PYTHON} -c 'from sys import stdout; \
LDFLAGS1=`${PYTHON} -c 'from sys import stdout; \
import distutils.sysconfig; \
stdout.write("-L" + \
distutils.sysconfig.get_python_lib(plat_specific=1, \
Expand All @@ -1402,8 +1402,6 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
LDLIBS2=`${PYTHON} -c 'from sys import stdout; \
from distutils import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBS"))'`

LDLIBS="${LDLIBS1} ${LDLIBS2}"
else
LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}"

Expand All @@ -1414,9 +1412,7 @@ else
stdout.write(sysconfig.get_config_var(\"LINKFORSHARED\").replace( \
\"${STRING}\", ''))"`

LDFLAGS="${LDFLAGS1} ${LDFLAGS2}"

LDLIBS=`${PYTHON} -c 'from sys import stdout; \
LDLIBS1=`${PYTHON} -c 'from sys import stdout; \
from distutils import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBS"))'`
fi
Expand All @@ -1429,9 +1425,11 @@ if test -x /usr/bin/lipo; then
CFLAGS="${CFLAGS} -Wc,'-arch ${ARCH}'"
LDFLAGS3="${LDFLAGS3} -arch ${ARCH}"
done
LDFLAGS="${LDFLAGS3} ${LDFLAGS}"
fi

LDFLAGS="${LDFLAGS} ${LDFLAGS1} ${LDFLAGS2} ${LDFLAGS3}"
LDLIBS="${LDLIBS} ${LDLIBS1} ${LDLIBS2}"




Expand Down
14 changes: 6 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ else
CPPFLAGS3=""
fi

CPPFLAGS="${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS1} ${CPPFLAGS2} ${CPPFLAGS3}"

AC_SUBST(CPPFLAGS)

Expand All @@ -84,7 +84,7 @@ PYTHONFRAMEWORK=`${PYTHON} -c 'from sys import stdout; \
stdout.write(sysconfig.get_config_var("PYTHONFRAMEWORK"))'`

if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
LDFLAGS=`${PYTHON} -c 'from sys import stdout; \
LDFLAGS1=`${PYTHON} -c 'from sys import stdout; \
import distutils.sysconfig; \
stdout.write("-L" + \
distutils.sysconfig.get_python_lib(plat_specific=1, \
Expand All @@ -94,8 +94,6 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
LDLIBS2=`${PYTHON} -c 'from sys import stdout; \
from distutils import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBS"))'`

LDLIBS="${LDLIBS1} ${LDLIBS2}"
else
LDFLAGS1="-Wl,-F${PYTHONFRAMEWORKPREFIX} -framework ${PYTHONFRAMEWORK}"

Expand All @@ -106,9 +104,7 @@ else
stdout.write(sysconfig.get_config_var(\"LINKFORSHARED\").replace( \
\"${STRING}\", ''))"`

LDFLAGS="${LDFLAGS1} ${LDFLAGS2}"

LDLIBS=`${PYTHON} -c 'from sys import stdout; \
LDLIBS1=`${PYTHON} -c 'from sys import stdout; \
from distutils import sysconfig; \
stdout.write(sysconfig.get_config_var("LIBS"))'`
fi
Expand All @@ -121,9 +117,11 @@ if test -x /usr/bin/lipo; then
CFLAGS="${CFLAGS} -Wc,'-arch ${ARCH}'"
LDFLAGS3="${LDFLAGS3} -arch ${ARCH}"
done
LDFLAGS="${LDFLAGS3} ${LDFLAGS}"
fi

LDFLAGS="${LDFLAGS} ${LDFLAGS1} ${LDFLAGS2} ${LDFLAGS3}"
LDLIBS="${LDLIBS} ${LDLIBS1} ${LDLIBS2}"

AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LDLIBS)
Expand Down

0 comments on commit dbe1236

Please sign in to comment.