Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* configure.in (verconf.h): separate load path specific stuff from

  config.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 61dc4a8dbc2cdc9a24ce206ad0ec911267bb6782 1 parent c2d7776
Nobuyoshi Nakada authored March 27, 2012
5  ChangeLog
... ...
@@ -1,3 +1,8 @@
  1
+Tue Mar 27 22:44:23 2012  Nobuyoshi Nakada  <nobu@ruby-lang.org>
  2
+
  3
+	* configure.in (verconf.h): separate load path specific stuff from
  4
+	  config.h.
  5
+
1 6
 Tue Mar 27 22:43:40 2012  Nobuyoshi Nakada  <nobu@ruby-lang.org>
2 7
 
3 8
 	* win32/Makefile.sub: fix config.h path to include.
3  common.mk
@@ -727,7 +727,8 @@ variable.$(OBJEXT): {$(VPATH)}variable.c $(RUBY_H_INCLUDES) \
727 727
   {$(VPATH)}node.h {$(VPATH)}util.h {$(VPATH)}encoding.h \
728 728
   {$(VPATH)}oniguruma.h {$(VPATH)}internal.h {$(VPATH)}constant.h
729 729
 version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \
730  
-  {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h
  730
+  {$(VPATH)}version.h $(srcdir)/version.h $(srcdir)/revision.h {$(VPATH)}config.h \
  731
+  verconf.h
731 732
 dmyversion.$(OBJEXT): {$(VPATH)}dmyversion.c version.$(OBJEXT)
732 733
 
733 734
 compile.$(OBJEXT): {$(VPATH)}compile.c {$(VPATH)}iseq.h \
35  configure.in
@@ -2831,10 +2831,12 @@ if test ${RUBY_LIB_VERSION_STYLE+set}; then
2831 2831
     echo "#define RUBY_LIB_VERSION_STYLE $RUBY_LIB_VERSION_STYLE"
2832 2832
     echo '#define STRINGIZE(x) x'
2833 2833
     test -f revision.h -o -f "${srcdir}/revision.h" || echo '#define RUBY_REVISION 0'
  2834
+    echo '#include "verconf.h"'
2834 2835
     echo '#include "version.h"'
2835 2836
     echo 'ruby_version=RUBY_LIB_VERSION'
2836 2837
     } > conftest.c
2837  
-    ruby_version="`$CPP -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
  2838
+    test -f verconf.h || > verconf.h
  2839
+    ruby_version="`$CPP -I. -I"${srcdir}" -I"${srcdir}/include" conftest.c | sed '/^ruby_version=/!d;s/ //g'`"
2838 2840
     eval $ruby_version
2839 2841
 else
2840 2842
     RUBY_LIB_VERSION="\"${ruby_version}\""
@@ -2896,21 +2898,21 @@ AS_CASE(["$RUBY_LIB_PREFIX"],
2896 2898
     ])
2897 2899
 
2898 2900
 if test ${RUBY_LIB_VERSION_STYLE+set}; then
2899  
-    AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE)
  2901
+    AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
2900 2902
 else
2901  
-    AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION])
  2903
+    AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
2902 2904
 fi
2903 2905
 AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, "${RUBY_EXEC_PREFIX}")
2904  
-AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX})
  2906
+AC_DEFINE_UNQUOTED(RUBY_LIB_PREFIX, ${RUBY_LIB_PREFIX} !<verconf>!)
2905 2907
 if test "x$SITE_DIR" = xno; then
2906  
-    AC_DEFINE(NO_RUBY_SITE_LIB)
  2908
+    AC_DEFINE(NO_RUBY_SITE_LIB, [] !<verconf>!)
2907 2909
 else
2908  
-    AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH})
  2910
+    AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, ${RUBY_SITE_LIB_PATH} !<verconf>!)
2909 2911
 fi
2910 2912
 if test "x$VENDOR_DIR" = xno; then
2911  
-    AC_DEFINE(NO_RUBY_VENDOR_LIB)
  2913
+    AC_DEFINE(NO_RUBY_VENDOR_LIB !<verconf>!)
2912 2914
 else
2913  
-    AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH})
  2915
+    AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, ${RUBY_VENDOR_LIB_PATH} !<verconf>!)
2914 2916
 fi
2915 2917
 
2916 2918
 AC_SUBST(arch)dnl
@@ -2928,7 +2930,7 @@ if test "${universal_binary-no}" = yes ; then
2928 2930
 	AC_TRY_COMPILE([const char arch[] = __ARCHITECTURE__;], [puts(arch);],
2929 2931
 	     [rb_cv_architecture_available=yes], [rb_cv_architecture_available=no]))
2930 2932
     if test "${rb_cv_architecture_available}" = yes; then
2931  
-	AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__)
  2933
+	AC_DEFINE_UNQUOTED(RUBY_PLATFORM_CPU, __ARCHITECTURE__ !<verconf>!)
2932 2934
     else
2933 2935
 	for archs in ${universal_archnames}; do
2934 2936
 	    cpu=`echo $archs | sed 's/.*=//'`
@@ -2940,24 +2942,24 @@ if test "${universal_binary-no}" = yes ; then
2940 2942
     test "$ac_cv_type_long_long" = yes && ints="'long long' $ints"
2941 2943
     AC_SUBST(UNIVERSAL_ARCHNAMES, "${universal_archnames}")
2942 2944
     AC_SUBST(UNIVERSAL_INTS, "${ints}")
2943  
-    AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}")
2944  
-    AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS)
2945  
-    AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS)
  2945
+    AC_DEFINE_UNQUOTED(RUBY_PLATFORM_OS, "${target_os}" !<verconf>!)
  2946
+    AC_DEFINE_UNQUOTED(RUBY_ARCH, "universal-"RUBY_PLATFORM_OS !<verconf>!)
  2947
+    AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "universal."RUBY_PLATFORM_CPU"-"RUBY_PLATFORM_OS !<verconf>!)
2946 2948
 else
2947 2949
     arch="${target_cpu}-${target_os}"
2948  
-    AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}")
  2950
+    AC_DEFINE_UNQUOTED(RUBY_PLATFORM, "${arch}" !<verconf>!)
2949 2951
 fi
2950 2952
 
2951 2953
 unset sitearch
2952 2954
 AS_CASE(["$target_os"],[mingw*],[sitearch="$target_cpu-$rb_cv_msvcrt"])
2953  
-test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}")
  2955
+test ${sitearch+set} && AC_DEFINE_UNQUOTED(RUBY_SITEARCH, "${sitearch}" !<verconf>!)
2954 2956
 : ${sitearch='${arch}'}
2955 2957
 
2956 2958
 AC_ARG_WITH(search-path,
2957 2959
 		AS_HELP_STRING([--with-search-path=DIR], [specify the additional search path]),
2958 2960
 		[search_path=$withval])
2959 2961
 if test "$search_path" != ""; then
2960  
-    AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path")
  2962
+    AC_DEFINE_UNQUOTED(RUBY_SEARCH_PATH,"$search_path" !<verconf>!)
2961 2963
 fi
2962 2964
 
2963 2965
 AC_ARG_WITH(rubyhdrdir,
@@ -3017,10 +3019,11 @@ guard=INCLUDE_RUBY_CONFIG_H
3017 3019
 {
3018 3020
   echo "#ifndef $guard"
3019 3021
   echo "#define $guard 1"
3020  
-  grep -v "^#define PACKAGE_" confdefs.h
  3022
+  grep -v "^#define PACKAGE_" confdefs.h | grep -v ' !<verconf>!$'
3021 3023
   echo "#endif /* $guard */"
3022 3024
 } | tr -d '\015' |
3023 3025
 ${srcdir}/tool/ifchange "${config_h}" -
  3026
+sed -n 's/ !<verconf>!$//p' confdefs.h | ${srcdir}/tool/ifchange verconf.h -
3024 3027
 tr -d '\015' < largefile.h > confdefs.h
3025 3028
 rm largefile.h
3026 3029
 
1  version.c
@@ -9,6 +9,7 @@
9 9
 
10 10
 **********************************************************************/
11 11
 
  12
+#include "verconf.h"
12 13
 #include "ruby/ruby.h"
13 14
 #include "version.h"
14 15
 #include <stdio.h>
11  win32/Makefile.sub
@@ -670,10 +670,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
670 670
 #define LOAD_RELATIVE 1
671 671
 #define DLEXT ".so"
672 672
 #define EXECUTABLE_EXTS $(EXECUTABLE_EXTS)
673  
-#define RUBY_LIB_VERSION_STYLE 3	/* full */
674  
-#define RUBY_LIB_PREFIX "/lib/$(RUBY_BASE_NAME)"
675  
-#define RUBY_PLATFORM "$(arch)"
676  
-#define RUBY_SITEARCH "$(sitearch)"
677 673
 #define RUBY_COREDLL "$(RT)"
678 674
 #define LIBRUBY_SO "$(LIBRUBY_SO)"
679 675
 #if 0
@@ -683,6 +679,13 @@ $(BANG)endif
683 679
 #endif
684 680
 #endif /* $(guard) */
685 681
 <<
  682
+	@echo Creating verconf.h
  683
+	@$(IFCHANGE) verconf.h <<
  684
+#define RUBY_LIB_VERSION_STYLE 3	/* full */
  685
+#define RUBY_LIB_PREFIX "/lib/$(RUBY_BASE_NAME)"
  686
+#define RUBY_PLATFORM "$(arch)"
  687
+#define RUBY_SITEARCH "$(sitearch)"
  688
+<<
686 689
 	@exit > $(@:/=\)
687 690
 
688 691
 #!if exist($(RUBY_CONFIG_H))

0 notes on commit 61dc4a8

Please sign in to comment.
Something went wrong with that request. Please try again.