зеркало из https://github.com/mozilla/pjs.git
Shorten the compile line. Add test and support for preprocessor '-include' flag
This commit is contained in:
Родитель
ae016f7fab
Коммит
dfb2a3475f
|
@ -29,8 +29,8 @@ MOZ_DEBUG = @MOZ_DEBUG@
|
|||
MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
|
||||
MOZILLA_GPROF = @MOZILLA_GPROF@
|
||||
BUILD_PROFILE = @MOZILLA_GPROF@
|
||||
MOZ_MAIL_NEWS = @MOZ_MAIL_NEWS@
|
||||
MOZ_LDAP = @MOZ_LDAP@
|
||||
MOZ_MAIL_NEWS = @MOZ_MAIL_NEWS@
|
||||
MOZ_LDAP = @MOZ_LDAP@
|
||||
MOZ_EDITOR = @MOZ_EDITOR@
|
||||
UNIX_SKIP_ASSERTS = @UNIX_SKIP_ASSERTS@
|
||||
NO_UNIX_ASYNC_DNS = @NO_UNIX_ASYNC_DNS@
|
||||
|
@ -56,7 +56,14 @@ MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
|
|||
OS_CFLAGS = @CFLAGS@ $(DSO_CFLAGS)
|
||||
OS_INCLUDES = $(NSPR_CFLAGS) $(JPEG_CFLAGS) $(PNG_CFLAGS) $(ZLIB_CFLAGS)
|
||||
OS_LIBS = @LDFLAGS@ @LIBS@
|
||||
DEFINES = @DEFS@
|
||||
AC_DEFINES = @DEFS@
|
||||
|
||||
USE_CPP_INCLUDE_FLAG = @USE_CPP_INCLUDE_FLAG@
|
||||
ifdef USE_CPP_INCLUDE_FLAG
|
||||
AC_INCLUDE_OR_DEFINES = -include @CONFIG_DEFS_H@
|
||||
else
|
||||
AC_INCLUDE_OR_DEFINES := $(AC_DEFINES)
|
||||
endif
|
||||
|
||||
XCFLAGS = @XCFLAGS@
|
||||
XLDFLAGS = @XLDFLAGS@
|
||||
|
|
|
@ -355,8 +355,9 @@ LIBNSJAVA = $(DIST)/lib/nsjava32.$(LIB_SUFFIX)
|
|||
endif
|
||||
endif
|
||||
|
||||
CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(MDUPDATE_FLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS)
|
||||
NOMD_CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(INCLUDES) $(XCFLAGS)
|
||||
CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(MDUPDATE_FLAGS) $(DEFINES) $(AC_INCLUDE_OR_DEFINES) $(INCLUDES) $(XCFLAGS) $(PROF_FLAGS)
|
||||
|
||||
NOMD_CFLAGS = $(XP_DEFINE) $(OPTIMIZER) $(OS_CFLAGS) $(DEFINES) $(AC_INCLUDE_OR_DEFINES) $(INCLUDES) $(XCFLAGS)
|
||||
|
||||
#
|
||||
# Include the binary distrib stuff, if necessary.
|
||||
|
|
|
@ -878,7 +878,7 @@ $(MKDEPENDENCIES)::
|
|||
@$(MAKE_OBJDIR)
|
||||
touch $(MKDEPENDENCIES)
|
||||
ifdef USE_AUTOCONF
|
||||
$(MKDEPEND) -p$(OBJDIR_NAME)/ -o'.o' -f$(MKDEPENDENCIES) $(DEFINES) $(INCLUDES) $(addprefix $(srcdir)/,$(CSRCS) $(CPPSRCS)) >/dev/null 2>/dev/null
|
||||
$(MKDEPEND) -p$(OBJDIR_NAME)/ -o'.o' -f$(MKDEPENDENCIES) $(DEFINES) $(AC_DEFINES) $(INCLUDES) $(addprefix $(srcdir)/,$(CSRCS) $(CPPSRCS)) >/dev/null 2>/dev/null
|
||||
@mv depend.mk depend.mk.old && cat depend.mk.old | sed "s|^$(OBJDIR_NAME)/$(srcdir)/|$(OBJDIR_NAME)/|g" > depend.mk && rm -f depend.mk.old
|
||||
else
|
||||
$(MKDEPEND) -p$(OBJDIR_NAME)/ -o'.o' -f$(MKDEPENDENCIES) $(INCLUDES) $(CSRCS) $(CPPSRCS)
|
||||
|
|
51
configure.in
51
configure.in
|
@ -390,6 +390,41 @@ else
|
|||
fi
|
||||
CC=$_SAVE_CC
|
||||
|
||||
dnl Check for preprocesssor feature: command-line include files
|
||||
AC_MSG_CHECKING($CXX for \"-include <file>\" option)
|
||||
_tmp_header="include-test-$$.h"
|
||||
echo "char *booboo;" > $_tmp_header
|
||||
_SAVE_CFLAGS=$CFLAGS ; CFLAGS="$CFLAGS -include $_tmp_header"
|
||||
_SAVE_CC=$CC ; CC=$CXX
|
||||
AC_CACHE_VAL(ac_cv_cxx_include_flag,
|
||||
[AC_TRY_COMPILE([],
|
||||
[booboo = "yogi";],
|
||||
[ac_cv_cxx_include_flag=true],
|
||||
[ac_cv_cxx_include_flag=false])])
|
||||
if test $ac_cv_cxx_include_flag = true ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
CC=$_SAVE_CC
|
||||
AC_MSG_CHECKING($CC for \"-include <file>\" option)
|
||||
AC_CACHE_VAL(ac_cv_cc_include_flag,
|
||||
[AC_TRY_COMPILE([],
|
||||
[booboo = "yogi";],
|
||||
[ac_cv_cc_include_flag=true],
|
||||
[ac_cv_cc_include_flag=false])])
|
||||
if test $ac_cv_cc_include_flag = true ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
CFLAGS=$_SAVE_CFLAGS
|
||||
rm -r $_tmp_header
|
||||
if test $ac_cv_cc_include_flag = true -a $ac_cv_cxx_include_flag = true; then
|
||||
USE_CPP_INCLUDE_FLAG=1
|
||||
AC_SUBST(USE_CPP_INCLUDE_FLAG)
|
||||
fi
|
||||
|
||||
# Mozilla specific options
|
||||
# ========================================================
|
||||
dnl The macros used for command line options
|
||||
|
@ -1021,6 +1056,22 @@ if [ test -n "$MISSING_NSPR" ]; then
|
|||
AC_MSG_ERROR([Could not find the following nspr libraries or could not run sample program: $MISSING_NSPR]);
|
||||
fi
|
||||
|
||||
# Save the defines header file before autoconf removes it.
|
||||
# (Do not add AC_DEFINE calls after this line.)
|
||||
if test "$USE_CPP_INCLUDE_FLAG"; then
|
||||
CONFIG_DEFS_H=config-defs.h
|
||||
AC_MSG_RESULT("creating $CONFIG_DEFS_H")
|
||||
cat > $CONFIG_DEFS_H <<\EOF
|
||||
/* List of defines generated by configure. Included with preprocessor flag,
|
||||
* -include, to avoid long list of -D defines on the compile command-line.
|
||||
* Do not edit.
|
||||
*/
|
||||
EOF
|
||||
cat confdefs.h >> $CONFIG_DEFS_H
|
||||
CONFIG_DEFS_H='$(DEPTH)/'$CONFIG_DEFS_H
|
||||
AC_SUBST(CONFIG_DEFS_H)
|
||||
fi
|
||||
|
||||
dnl Need to manual make the directories to get around deficiency in AC_OUTPUT
|
||||
for d in lib modules modules/security; do
|
||||
if [ test ! -d $d ]; then rm -f $d; mkdir $d; fi
|
||||
|
|
Загрузка…
Ссылка в новой задаче