| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: options.mk,v 1.2 2012/04/26 13:27:43 hans Exp $ | | 1 | # $NetBSD: options.mk,v 1.3 2012/12/31 03:20:12 dholland Exp $ |
2 | | | 2 | |
3 | PKG_OPTIONS_VAR= PKG_OPTIONS.gcc34 | | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.gcc34 |
4 | PKG_SUPPORTED_OPTIONS= nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc gcc-ada | | 4 | PKG_SUPPORTED_OPTIONS= nls gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc gcc-ada |
5 | PKG_SUGGESTED_OPTIONS= gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc | | 5 | PKG_SUGGESTED_OPTIONS= gcc-inplace-math gcc-c++ gcc-fortran gcc-java gcc-objc |
6 | .if ${OPSYS} == "NetBSD" | | 6 | .if ${OPSYS} == "NetBSD" |
7 | PKG_SUGGESTED_OPTIONS+= nls | | 7 | PKG_SUGGESTED_OPTIONS+= nls |
8 | .elif ${OPSYS} == "SunOS" | | 8 | .elif ${OPSYS} == "SunOS" |
9 | PKG_SUGGESTED_OPTIONS+= gcc-inplace-math | | 9 | PKG_SUGGESTED_OPTIONS+= gcc-inplace-math |
10 | .endif | | 10 | .endif |
11 | | | 11 | |
12 | PKG_OPTIONS_LEGACY_VARS+= BUILD_CXX:gcc-c++ | | 12 | PKG_OPTIONS_LEGACY_VARS+= BUILD_CXX:gcc-c++ |
13 | PKG_OPTIONS_LEGACY_VARS+= BUILD_F77:gcc-fortran | | 13 | PKG_OPTIONS_LEGACY_VARS+= BUILD_F77:gcc-fortran |
14 | PKG_OPTIONS_LEGACY_VARS+= BUILD_JAVA:gcc-java | | 14 | PKG_OPTIONS_LEGACY_VARS+= BUILD_JAVA:gcc-java |
| @@ -34,28 +34,26 @@ CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_ | | | @@ -34,28 +34,26 @@ CONFIGURE_ARGS+= --with-gmp=${BUILDLINK_ |
34 | .if !empty(PKG_OPTIONS:Mnls) | | 34 | .if !empty(PKG_OPTIONS:Mnls) |
35 | CONFIGURE_ARGS+= --enable-nls | | 35 | CONFIGURE_ARGS+= --enable-nls |
36 | CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv} | | 36 | CONFIGURE_ARGS+= --with-libiconv-prefix=${BUILDLINK_PREFIX.iconv} |
37 | MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv} | | 37 | MAKE_ENV+= ICONVPREFIX=${BUILDLINK_PREFIX.iconv} |
38 | USE_TOOLS+= msgfmt | | 38 | USE_TOOLS+= msgfmt |
39 | .include "../../converters/libiconv/buildlink3.mk" | | 39 | .include "../../converters/libiconv/buildlink3.mk" |
40 | .include "../../devel/gettext-lib/buildlink3.mk" | | 40 | .include "../../devel/gettext-lib/buildlink3.mk" |
41 | .else | | 41 | .else |
42 | CONFIGURE_ARGS+= --disable-nls | | 42 | CONFIGURE_ARGS+= --disable-nls |
43 | .endif | | 43 | .endif |
44 | | | 44 | |
45 | ### | | 45 | ### |
46 | ### Optional languages | | 46 | ### Optional languages |
47 | ### Ada could be added although there is a bootstrapping issue. See | | | |
48 | ### ../gcc34-ada for guidance | | | |
49 | ### | | 47 | ### |
50 | | | 48 | |
51 | LANGS= c | | 49 | LANGS= c |
52 | | | 50 | |
53 | .if !empty(PKG_OPTIONS:Mgcc-c++) | | 51 | .if !empty(PKG_OPTIONS:Mgcc-c++) |
54 | LANGS+= c++ | | 52 | LANGS+= c++ |
55 | CONFIGURE_ARGS+= --enable-__cxa_atexit | | 53 | CONFIGURE_ARGS+= --enable-__cxa_atexit |
56 | .endif | | 54 | .endif |
57 | | | 55 | |
58 | .if !empty(PKG_OPTIONS:Mgcc-fortran) | | 56 | .if !empty(PKG_OPTIONS:Mgcc-fortran) |
59 | USE_TOOLS+= chmod | | 57 | USE_TOOLS+= chmod |
60 | MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q} | | 58 | MAKE_ENV+= ac_cv_path_ac_cv_prog_chmod=${TOOLS_CHMOD:Q} |
61 | LANGS+= f77 | | 59 | LANGS+= f77 |
| @@ -70,65 +68,47 @@ CONFIGURE_ARGS+= --with-system-zlib | | | @@ -70,65 +68,47 @@ CONFIGURE_ARGS+= --with-system-zlib |
70 | | | 68 | |
71 | .include "../../devel/zlib/buildlink3.mk" | | 69 | .include "../../devel/zlib/buildlink3.mk" |
72 | .endif | | 70 | .endif |
73 | | | 71 | |
74 | .if !empty(PKG_OPTIONS:Mgcc-objc) | | 72 | .if !empty(PKG_OPTIONS:Mgcc-objc) |
75 | LANGS+= objc | | 73 | LANGS+= objc |
76 | .endif | | 74 | .endif |
77 | | | 75 | |
78 | .if !empty(PKG_OPTIONS:Mgcc-ada) | | 76 | .if !empty(PKG_OPTIONS:Mgcc-ada) |
79 | PTHREAD_OPTS+= require native | | 77 | PTHREAD_OPTS+= require native |
80 | LANGS+= ada | | 78 | LANGS+= ada |
81 | | | 79 | |
82 | # Ada bootstrap compiler section | | 80 | # Ada bootstrap compiler section |
83 | # An Ada compiler is required to build the Ada compiler. You | | 81 | # An Ada compiler is required to build the Ada compiler. |
84 | # may specify: | | 82 | # You may specify the path of any gcc/gnat Ada compiler |
85 | #USE_GCC34ADA =# Define to use gcc-3.4.x-ada | | | |
86 | # Or, you may specify the path of any gcc/gnat Ada compiler | | | |
87 | # by providing the full path of the compiler (example) below: | | 83 | # by providing the full path of the compiler (example) below: |
88 | ALT_GCC= /usr/pkg/bin/gnatgcc | | 84 | ALT_GCC= /usr/pkg/bin/gnatgcc |
89 | . if defined(ALT_GCC) | | 85 | . if defined(ALT_GCC) |
90 | . if exists(${ALT_GCC}) | | 86 | . if exists(${ALT_GCC}) |
91 | ALT_GCC_RTS!= ${ALT_GCC} --print-file-name=adalib | | 87 | ALT_GCC_RTS!= ${ALT_GCC} --print-file-name=adalib |
92 | . if !empty(ALT_GCC_RTS) | | 88 | . if !empty(ALT_GCC_RTS) |
93 | RALT_GCC_RTS= ${ALT_GCC_RTS:S%${LOCALBASE}%%:S%/%%} | | 89 | RALT_GCC_RTS= ${ALT_GCC_RTS:S%${LOCALBASE}%%:S%/%%} |
94 | . else | | 90 | . else |
95 | PKG_SKIP_REASON+= "${ALT_GCC} does not appear to be an Ada compiler" | | 91 | PKG_SKIP_REASON+= "${ALT_GCC} does not appear to be an Ada compiler" |
96 | . endif | | 92 | . endif |
97 | . else | | 93 | . else |
98 | PKG_SKIP_REASON+= "Missing bootstrap Ada compiler" | | 94 | PKG_SKIP_REASON+= "Missing bootstrap Ada compiler" |
99 | . endif | | 95 | . endif |
100 | . endif | | 96 | . endif |
101 | . if !defined(USE_GCC34ADA) && !defined(ALT_GCC) | | 97 | . if !defined(ALT_GCC) |
102 | PKG_SKIP_REASON+= "An Ada bootstrap compiler must be specified to build Ada" | | 98 | PKG_SKIP_REASON+= "An Ada bootstrap compiler must be specified to build Ada" |
103 | . endif | | 99 | . endif |
104 | | | 100 | |
105 | . if defined(USE_GCC34ADA) | | 101 | . if defined(ALT_GCC) |
106 | BUILDLINK_DEPMETHOD.gcc34-ada=build | | | |
107 | .include "../../lang/gcc34-ada/buildlink3.mk" | | | |
108 | | | | |
109 | post-patch: | | | |
110 | (cd ${FILESDIR}; \ | | | |
111 | ${CP} adasignal.c ${WRKSRC}/gcc/ada; \ | | | |
112 | ${CP} ada_lwp_self.c ${WRKSRC}/gcc/ada; \ | | | |
113 | ${CP} dummy_pthreads.c ${WRKSRC}/gcc/ada; \ | | | |
114 | for i in *.adb *.ads ; do \ | | | |
115 | ${CP} $$i ${WRKSRC}/gcc/ada; \ | | | |
116 | done ) | | | |
117 | | | | |
118 | # Overide compiler.mk setup to use gcc-3.4.x-ada | | | |
119 | pre-configure: | | | |
120 | .include "../../lang/gcc34-ada/preconfigure.mk" | | | |
121 | . elif defined(ALT_GCC) | | | |
122 | pre-configure: | | 102 | pre-configure: |
123 | (${TEST} -d ${WRKDIR}/.gcc/bin/ || ${MKDIR} ${WRKDIR}/.gcc/bin/) | | 103 | (${TEST} -d ${WRKDIR}/.gcc/bin/ || ${MKDIR} ${WRKDIR}/.gcc/bin/) |
124 | (cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \ | | 104 | (cd ${WRKDIR}/.buildlink && ${MKDIR} ${RALT_GCC_RTS} && \ |
125 | cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .) | | 105 | cd ${RALT_GCC_RTS} && ${LN} -sf ${ALT_GCC_RTS}/libgnat.a .) |
126 | (cd ${ALT_GCC:H} && \ | | 106 | (cd ${ALT_GCC:H} && \ |
127 | bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \ | | 107 | bin_files=`${FIND} . -type f \( -perm -0100 \) -print` && \ |
128 | cd ${WRKDIR}/.gcc/bin/ && \ | | 108 | cd ${WRKDIR}/.gcc/bin/ && \ |
129 | for filename in ${ALT_GCC:T} $${bin_files} ; do \ | | 109 | for filename in ${ALT_GCC:T} $${bin_files} ; do \ |
130 | ${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \ | | 110 | ${ECHO} '#!${TOOLS_SHELL}' > $${filename}; \ |
131 | ${ECHO} -n "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \ | | 111 | ${ECHO} -n "exec ${ALT_GCC:H}/$${filename} " >>$${filename}; \ |
132 | ${ECHO} '"$$@"' >>$${filename}; \ | | 112 | ${ECHO} '"$$@"' >>$${filename}; \ |
133 | ${CHMOD} +x $${filename}; \ | | 113 | ${CHMOD} +x $${filename}; \ |
134 | done ) | | 114 | done ) |