From: helge Date: Fri, 26 Aug 2005 12:46:16 +0000 (+0000) Subject: added some support for precompiled headers X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f451928acbd08b0b123349605ef2dc28e634af4c;p=sope added some support for precompiled headers git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1077 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/gnustep-make/ChangeLog b/gnustep-make/ChangeLog index f9586464..6ff01541 100644 --- a/gnustep-make/ChangeLog +++ b/gnustep-make/ChangeLog @@ -1,3 +1,21 @@ +2005-08-26 Helge Hess + + * configure.ac/config.make.in: enable PRECOMPILED_HEADERS if gcc + version is >=4 + + * Instance/Shared/headers.make: added shared-instance-headers-all/clean + phony targets, added ability to compile a PCH_FILE + + * Instance/library.make: moved internal-library-clean out of the + old-dll section (but this doesn't get called?). Make + shared-instance-headers-all a dependency of internal-library-all_ + + * Master/library.make (internal-clean): delete $(DERIVED_SOURCES_DIR) + directory (which contains the precompiled header if one was created) + + * rules.make: added a rule to compile a precompiled header (.h header + to .gch) + 2005-07-21 Adam Fedor * Version 1.11.0 diff --git a/gnustep-make/Instance/Shared/headers.make b/gnustep-make/Instance/Shared/headers.make index b5bda5fc..2fa29f0e 100644 --- a/gnustep-make/Instance/Shared/headers.make +++ b/gnustep-make/Instance/Shared/headers.make @@ -43,7 +43,9 @@ HEADER_FILES = $($(GNUSTEP_INSTANCE)_HEADER_FILES) .PHONY: \ shared-instance-headers-install \ -shared-instance-headers-uninstall +shared-instance-headers-uninstall \ +shared-instance-headers-all \ +shared-instance-headers-clean # We always compute HEADER_FILES_DIR and HEADER_FILES_INSTALL_DIR. # The reason is that frameworks might have headers in subprojects (and @@ -59,7 +61,7 @@ ifeq ($(HEADER_FILES_DIR),) HEADER_FILES_DIR = . endif -HEADER_FILES_INSTALL_DIR = $($(GNUSTEP_INSTANCE)_HEADER_FILES_INSTALL_DIR) +HEADER_FILES_INSTALL_DIR = $(HEADER_FILES_DIR)/$($(GNUSTEP_INSTANCE)_HEADER_FILES_INSTALL_DIR) # Please use `.' to force it to stay empty ifeq ($(HEADER_FILES_INSTALL_DIR),) @@ -72,8 +74,48 @@ shared-instance-headers-install: shared-instance-headers-uninstall: +shared-instance-headers-all: + else # we have some HEADER_FILES + +# +# PCH file +# + +ifeq ($(PRECOMPILED_HEADERS),yes) +ifneq ($($(GNUSTEP_INSTANCE)_PCH_FILE),) +# has PCH support and PCH file + +$(GNUSTEP_INSTANCE)_GCH_FILE=$(patsubst %.h,%$(GCH_SUFFIX),$($(GNUSTEP_INSTANCE)_PCH_FILE)) + +$(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE) :: $(HEADER_FILES) + +shared-instance-headers-all: \ + $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE) + +shared-instance-headers-clean: + $(RM) $(DERIVED_SOURCES_DIR)/$($(GNUSTEP_INSTANCE)_GCH_FILE) + +else # no PCH file defined + +shared-instance-headers-all: + @(echo "no PCH file: $(GNUSTEP_INSTANCE)_PCH_FILE" ) + +shared-instance-headers-clean: + +endif + +else # no PCH in compiler + +shared-instance-headers-all: + @(echo "no PCH support in compiler .." ) + +shared-instance-headers-clean: + +endif # no PCH in compiler + + # # We provide two different algorithms of installing headers. # diff --git a/gnustep-make/Instance/library.make b/gnustep-make/Instance/library.make index 231d9611..194e0054 100644 --- a/gnustep-make/Instance/library.make +++ b/gnustep-make/Instance/library.make @@ -258,6 +258,10 @@ LIB_LINK_INSTALL_DIR = $(FINAL_LIBRARY_INSTALL_DIR) # Compilation targets # +# TODO: this action is not called? (done in Master/library.make?) +internal-library-clean:: + $(ECHO_NOTHING)rm -rf $(DERIVED_SOURCES_DIR)$(END_ECHO) + ifeq ($(OLD_DLL_SUPPORT),yes) DLL_DEF = $($(GNUSTEP_INSTANCE)_DLL_DEF) @@ -280,9 +284,6 @@ internal-library-all_:: \ $(GNUSTEP_OBJ_DIR)/$(DLL_NAME) \ $(GNUSTEP_OBJ_DIR)/$(DLL_EXP_LIB) -internal-library-clean:: - $(ECHO_NOTHING)rm -rf $(DERIVED_SOURCES_DIR)$(END_ECHO) - $(DERIVED_SOURCES_DIR): $(ECHO_CREATING)$(MKDIRS) $@$(END_ECHO) @@ -305,6 +306,7 @@ $(GNUSTEP_OBJ_DIR)/$(DLL_NAME): $(OBJ_FILES_TO_LINK) \ else # following code for anything but OLD_DLL_SUPPORT internal-library-all_:: $(GNUSTEP_OBJ_DIR) \ + shared-instance-headers-all \ $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE) $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(OBJ_FILES_TO_LINK) @@ -312,6 +314,7 @@ $(GNUSTEP_OBJ_DIR)/$(VERSION_LIBRARY_FILE): $(OBJ_FILES_TO_LINK) endif # BUILD_DLL + # # Install and uninstall targets # diff --git a/gnustep-make/Master/library.make b/gnustep-make/Master/library.make index 4cd4e67a..0036b8de 100644 --- a/gnustep-make/Master/library.make +++ b/gnustep-make/Master/library.make @@ -39,6 +39,7 @@ _PSWRAP_H_FILES = $(foreach lib,$(LIBRARY_NAME),$($(lib)_PSWRAP_FILES:.psw=.h)) internal-clean:: (cd $(GNUSTEP_BUILD_DIR); \ rm -rf $(GNUSTEP_OBJ_DIR_NAME) $(_PSWRAP_C_FILES) $(_PSWRAP_H_FILES)) + rm -rf $(DERIVED_SOURCES_DIR) internal-distclean:: (cd $(GNUSTEP_BUILD_DIR); \ diff --git a/gnustep-make/config.make.in b/gnustep-make/config.make.in index 6663c0f5..74c65f15 100644 --- a/gnustep-make/config.make.in +++ b/gnustep-make/config.make.in @@ -145,6 +145,11 @@ CONFIG_SYSTEM_LIB_DIR = @LIB_DIR@ # AUTO_DEPENDENCIES = @AUTO_DEPENDENCIES@ +# +# Whether the ObjC compiler supports precompiling headers. +# +PRECOMPILED_HEADERS = @PRECOMPILED_HEADERS@ + # # Whether the ObjC compiler supports native ObjC exceptions via # @try/@catch/@finally/@throw. diff --git a/gnustep-make/configure b/gnustep-make/configure index 0c66afb3..7089db63 100755 --- a/gnustep-make/configure +++ b/gnustep-make/configure @@ -318,7 +318,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os ac_cv_library_combo cc_cppprecomp cc_bundle CYGWIN RANLIB AR DLLTOOL ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S TAR CHOWN GNUSTEP_ROOT root_prefix MAKEFILES_SUFFIX HOST_INSTALL GNUSTEP_LOCAL_ROOT GNUSTEP_NETWORK_ROOT GNUSTEP_USER_ROOT GNUSTEP_FLATTENED GNUSTEP_MULTI_PLATFORM BACKEND_BUNDLE EGREP objc_threaded ac_cv_objc_threaded USE_OBJC_EXCEPTIONS AUTO_DEPENDENCIES INCLUDES LIB_DIR OBJCFLAGS GNUSTEP_STRIP_MAKEFILES GNUSTEP_MOVE_OBSOLETE GNUSTEP_MAKE_VERSION GNUSTEP_MAKE_MAJOR_VERSION GNUSTEP_MAKE_MINOR_VERSION GNUSTEP_MAKE_SUBMINOR_VERSION clean_target_os clean_target_cpu clean_target_vendor LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os ac_cv_library_combo cc_cppprecomp cc_bundle CYGWIN RANLIB AR DLLTOOL ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S TAR CHOWN GNUSTEP_ROOT root_prefix MAKEFILES_SUFFIX HOST_INSTALL GNUSTEP_LOCAL_ROOT GNUSTEP_NETWORK_ROOT GNUSTEP_USER_ROOT GNUSTEP_FLATTENED GNUSTEP_MULTI_PLATFORM BACKEND_BUNDLE EGREP objc_threaded ac_cv_objc_threaded USE_OBJC_EXCEPTIONS AUTO_DEPENDENCIES PRECOMPILED_HEADERS INCLUDES LIB_DIR OBJCFLAGS GNUSTEP_STRIP_MAKEFILES GNUSTEP_MOVE_OBSOLETE GNUSTEP_MAKE_VERSION GNUSTEP_MAKE_MAJOR_VERSION GNUSTEP_MAKE_MINOR_VERSION GNUSTEP_MAKE_SUBMINOR_VERSION clean_target_os clean_target_cpu clean_target_vendor LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -990,7 +990,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1914,8 +1914,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -1973,8 +1972,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2090,8 +2088,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2145,8 +2142,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2191,8 +2187,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -2236,8 +2231,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3510,8 +3504,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3583,8 +3576,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3638,8 +3630,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3710,8 +3701,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3765,8 +3755,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3849,8 +3838,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4020,8 +4008,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4099,8 +4086,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4288,8 +4274,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4828,13 +4813,14 @@ CFLAGS="$saved_CFLAGS" # Check if compiler supports -MMD -MP to generate %.d files ... #-------------------------------------------------------------------- -echo "$as_me:$LINENO: checking if the compiler supports autodependencies" >&5 -echo $ECHO_N "checking if the compiler supports autodependencies... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking if the compiler supports autodependencies/pch" >&5 +echo $ECHO_N "checking if the compiler supports autodependencies/pch... $ECHO_C" >&6 # What we want to do: set AUTO_DEPENDENCIES to yes if gcc => 3.x if test ! ${GCC} = "yes" ; then AUTO_DEPENDENCIES="" + PRECOMPILED_HEADERS="" echo "$as_me:$LINENO: result: no: it's not gcc" >&5 echo "${ECHO_T}no: it's not gcc" >&6 else @@ -4851,10 +4837,18 @@ else if test "${gs_cv_gcc_major_version}" -ge "3" ; then AUTO_DEPENDENCIES=yes - echo "$as_me:$LINENO: result: yes: gcc major version is ${gs_cv_gcc_major_version}" >&5 -echo "${ECHO_T}yes: gcc major version is ${gs_cv_gcc_major_version}" >&6 + if test "${gs_cv_gcc_major_version}" -ge "4" ; then + PRECOMPILED_HEADERS=yes + echo "$as_me:$LINENO: result: yes/yes: gcc major version is ${gs_cv_gcc_major_version}" >&5 +echo "${ECHO_T}yes/yes: gcc major version is ${gs_cv_gcc_major_version}" >&6 + else + PRECOMPILED_HEADERS="" + echo "$as_me:$LINENO: result: yes/no: gcc major version is ${gs_cv_gcc_major_version}" >&5 +echo "${ECHO_T}yes/no: gcc major version is ${gs_cv_gcc_major_version}" >&6 + fi else AUTO_DEPENDENCIES="" + PRECOMPILED_HEADERS="" echo "$as_me:$LINENO: result: no: gcc major version is ${gs_cv_gcc_major_version}" >&5 echo "${ECHO_T}no: gcc major version is ${gs_cv_gcc_major_version}" >&6 fi @@ -4865,6 +4859,7 @@ fi + #-------------------------------------------------------------------- # Shall we strip makefiles upon installation ? #-------------------------------------------------------------------- @@ -5635,6 +5630,7 @@ s,@objc_threaded@,$objc_threaded,;t t s,@ac_cv_objc_threaded@,$ac_cv_objc_threaded,;t t s,@USE_OBJC_EXCEPTIONS@,$USE_OBJC_EXCEPTIONS,;t t s,@AUTO_DEPENDENCIES@,$AUTO_DEPENDENCIES,;t t +s,@PRECOMPILED_HEADERS@,$PRECOMPILED_HEADERS,;t t s,@INCLUDES@,$INCLUDES,;t t s,@LIB_DIR@,$LIB_DIR,;t t s,@OBJCFLAGS@,$OBJCFLAGS,;t t @@ -5815,11 +5811,6 @@ esac *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -5858,6 +5849,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/gnustep-make/configure.ac b/gnustep-make/configure.ac index bec3b2f1..5c59fc23 100644 --- a/gnustep-make/configure.ac +++ b/gnustep-make/configure.ac @@ -565,12 +565,13 @@ CFLAGS="$saved_CFLAGS" # Check if compiler supports -MMD -MP to generate %.d files ... #-------------------------------------------------------------------- -AC_MSG_CHECKING(if the compiler supports autodependencies) +AC_MSG_CHECKING(if the compiler supports autodependencies/pch) # What we want to do: set AUTO_DEPENDENCIES to yes if gcc => 3.x if test ! ${GCC} = "yes" ; then AUTO_DEPENDENCIES="" + PRECOMPILED_HEADERS="" AC_MSG_RESULT(no: it's not gcc) else # Running gcc -dumpversion we get something like 2.95.4 or @@ -586,14 +587,22 @@ else if test "${gs_cv_gcc_major_version}" -ge "3" ; then AUTO_DEPENDENCIES=yes - AC_MSG_RESULT(yes: gcc major version is ${gs_cv_gcc_major_version}) + if test "${gs_cv_gcc_major_version}" -ge "4" ; then + PRECOMPILED_HEADERS=yes + AC_MSG_RESULT(yes/yes: gcc major version is ${gs_cv_gcc_major_version}) + else + PRECOMPILED_HEADERS="" + AC_MSG_RESULT(yes/no: gcc major version is ${gs_cv_gcc_major_version}) + fi else AUTO_DEPENDENCIES="" + PRECOMPILED_HEADERS="" AC_MSG_RESULT(no: gcc major version is ${gs_cv_gcc_major_version}) fi fi AC_SUBST(AUTO_DEPENDENCIES) +AC_SUBST(PRECOMPILED_HEADERS) AC_SUBST(INCLUDES) AC_SUBST(LIB_DIR) AC_SUBST(OBJCFLAGS) diff --git a/gnustep-make/rules.make b/gnustep-make/rules.make index 76b425e5..eb699ad8 100644 --- a/gnustep-make/rules.make +++ b/gnustep-make/rules.make @@ -429,6 +429,17 @@ $(GNUSTEP_OBJ_DIR)/%${OEXT} : %.cp $(ALL_CCFLAGS)) \ $($<_FILE_FLAGS) -o $@$(END_ECHO) +# precompiled header files (TODO: should go into GNUSTEP_OBJ_DIR?) +GCH_SUFFIX=.gch +$(DERIVED_SOURCES_DIR)/%$(GCH_SUFFIX): %.h + if ! test -d $(DERIVED_SOURCES_DIR); then \ + $(MKDIRS) $(DERIVED_SOURCES_DIR); \ + fi + $(ECHO_COMPILING)$(CC) -x objective-c-header $< -c \ + $(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_CPPFLAGS) \ + $(ALL_OBJCFLAGS)) \ + $($<_FILE_FLAGS) -o $@$(END_ECHO) + %.class : %.java $(ECHO_COMPILING)$(JAVAC) \ $(filter-out $($<_FILE_FILTER_OUT_FLAGS),$(ALL_JAVACFLAGS)) \