tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Shared libf95 for lang/g95
Hi all,
the attached patch builds a shared Fortran runtime library. AFAICT the
only issue I have in the Clang build is math/octave, which wants to pass
down the rpath flags directly to clang without prefixing them correctly.
That's not a regression to the before-state though. Feed back?
Joerg
Index: lang/g95/Makefile
==================================================================
--- lang/g95/Makefile
+++ lang/g95/Makefile
@@ -1,10 +1,10 @@
# $NetBSD: Makefile,v 1.18 2013/07/28 12:54:52 obache Exp $
DISTNAME= g95_source
PKGNAME= g95-0.93
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= lang
MASTER_SITES= http://ftp.g95.org/v${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tgz
DISTFILES= ${DEFAULT_DISTFILES} gcc-core-${GCC_VER}.tar.bz2
SITES.gcc-core-4.1.2.tar.bz2= ${MASTER_SITE_GNU:=gcc/gcc-${GCC_VER}/}
@@ -12,11 +12,12 @@
MAINTAINER= wennmach%NetBSD.org@localhost
HOMEPAGE= http://www.g95.org/
COMMENT= Fortran 95 compiler from g95.org
LICENSE= gnu-gpl-v2
-USE_TOOLS+= gmake gtar
+USE_TOOLS+= gmake gtar automake autoconf
+USE_LIBTOOL= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-gcc-dir=${GCC_DIR}
WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
PLIST_SUBST+= MACHINE_GNU_PLATFORM=${MACHINE_GNU_PLATFORM:Q}
@@ -42,19 +43,22 @@
post-extract:
${MKDIR} ${GCC_G95_DIR}
cd ${WRKSRC} && ${GTAR} -xzf libf95.a-${PKGVERSION_NOREV}.tar.gz
pre-configure:
+ cd ${WRKSRC}/libf95.a-${PKGVERSION_NOREV} && autoreconf -i
rm -f ${GCC_DIR}/config.sub ${GCC_DIR}/config.guess
ln -fs ${PKGSRCDIR}/mk/gnu-config/config.sub ${GCC_DIR}/config.sub
ln -fs ${PKGSRCDIR}/mk/gnu-config/config.guess ${GCC_DIR}/config.guess
- cd ${GCC_G95_DIR} && ${GCC_CONFIGURE_SCRIPT} ${GCC_CONFIGURE_ARGS} &&
${GMAKE}
+ cd ${GCC_G95_DIR} && ${SETENV} ${CONFIGURE_ENV} ${GCC_CONFIGURE_SCRIPT}
${GCC_CONFIGURE_ARGS}
+ cd ${GCC_G95_DIR} && ${SETENV} ${MAKE_ENV} ${GMAKE} -j${MAKE_JOBS:U1:Q}
post-build:
- cd ${WRKSRC}/libf95.a-${PKGVERSION_NOREV} && ${CONFIGURE_SCRIPT}
${CONFIGURE_ARGS} && ${GMAKE}
+ cd ${WRKSRC}/libf95.a-${PKGVERSION_NOREV} && ${SETENV} ${CONFIGURE_ENV}
${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}
+ cd ${WRKSRC}/libf95.a-${PKGVERSION_NOREV} && ${SETENV} ${MAKE_ENV}
${GMAKE} -j${MAKE_JOBS:U1:Q}
post-install:
cd ${WRKSRC}/libf95.a-${PKGVERSION_NOREV} && ${GMAKE} install
DESTDIR=${DESTDIR:Q}
cd ${DESTDIR}${PREFIX}/bin && ${LN} -sf ${MACHINE_GNU_PLATFORM:Q}-g95
g95
cd ${DESTDIR}${PREFIX}/bin && ${LN} -sf ${MACHINE_GNU_PLATFORM:Q}-g95
f95
.include "../../mk/bsd.pkg.mk"
Index: lang/g95/PLIST
==================================================================
--- lang/g95/PLIST
+++ lang/g95/PLIST
@@ -6,8 +6,8 @@
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/f951
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libgcc_eh.a
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libgcc_s.so
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libgcc_s.so.1
lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libgcc.a
-lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libf95.a
+lib/gcc-lib/${MACHINE_GNU_PLATFORM}/4.1.2/libf95.la
share/doc/g95/G95Manual.pdf
share/doc/g95/INSTALL
Index: lang/g95/distinfo
==================================================================
--- lang/g95/distinfo
+++ lang/g95/distinfo
@@ -4,12 +4,14 @@
RMD160 (g95_source.tgz) = 98d03e9a1835f4b3553a72a798bdf1d90a757176
Size (g95_source.tgz) = 1355198 bytes
SHA1 (gcc-core-4.1.2.tar.bz2) = d6875295f6df1bec4a6f4ab8f0da54bfb8d97306
RMD160 (gcc-core-4.1.2.tar.bz2) = 612cbd5b795f7095fb3f565e6a8eaaee82c472c5
Size (gcc-core-4.1.2.tar.bz2) = 17485561 bytes
-SHA1 (patch-ab) = 74187ee99e3e383333219cbc53676c07ca03ff19
+SHA1 (patch-ab) = 003bcad29c1b570478676c1c0c797b6b2269c2fd
SHA1 (patch-ac) = b20a90cc2f9078cf0048980b75fa6836da0f28a8
+SHA1 (patch-g95spec.c) = 4a19a78664efce4d68971d3a13b849bd86bd3300
+SHA1 (patch-gcc_Makefile.in) = cc5cc142a85612ebf2d38513e4b05db0ae795268
SHA1 (patch-gcc_config.gcc) = 9da8f32372c64b1590d97e3f26aec0d5652cc959
SHA1 (patch-gcc_config_dragonfly-spec.h) =
bf0c97caa314714542cf8cc63fdf0c73bda80511
SHA1 (patch-gcc_config_dragonfly.h) = 6d46b7b4637a20b36e19a15e1eaffdfff6638de9
SHA1 (patch-gcc_config_i386_dragonfly.h) =
7d60d29b5ae636d69650e8c412a94f7a6045f6d9
SHA1 (patch-gcc_config_i386_dragonfly64.h) =
9d2d8512a913e58055fa5c1b7d85a109117dcfba
@@ -17,13 +19,14 @@
SHA1 (patch-gcc_config_t-dragonfly-thread) =
ebdb58dacf0dc5d0bf2f1f1707a7c6ab29ee308c
SHA1 (patch-gcc_ginclude_stddef.h) = 60f51a470e03173803b5e20b1fa4d6882e8d1fe9
SHA1 (patch-gcc_toplev.h) = 4894b45bf0fd30de0610a36827ef1089e0ec6bd5
SHA1 (patch-libf95.a-0.92_configure) = e23998692b410acaabaf24f591b659d2b229bcca
SHA1 (patch-libf95.a-0.92_io_atof.c) = 0c3a209815be3a97d984cb9a15ee888f93110d1d
+SHA1 (patch-libf95.a-0.93_Makefile.am) =
3632bc0a2ee45832561f9be4bfa6b19df2983e0b
SHA1 (patch-libf95.a-0.93_intrinsics_dot__product10.c) =
a2fe19bab2a6f719f541692fd4ef7e67766a18e5
SHA1 (patch-libf95.a-0.93_intrinsics_matmul10.c) =
30609c3183a98610e4005fd4c0d12cccec0855a1
SHA1 (patch-libf95.a-0.93_intrinsics_random.c) =
5445f78b267f742a2bf711aa0f5e06683dda1a68
SHA1 (patch-libf95.a-0.93_io_read.c) = 594bcfb15e59dcaaec5a6a21a58af17e8f41eae9
SHA1 (patch-libf95.a-0.93_math_ff.c) = 353121bc08a86765d18b0e6f051ba91f7e65e9c2
SHA1 (patch-libf95.a-0.93_math_x87.S) =
d1eb02bd2358b6abb9b8dc3e32629cba540adcc4
SHA1 (patch-libf95.a-0.93_quad_power16.c) =
fc7375aa90ecf75bb8ba26d41739614040b16e09
-SHA1 (patch-libf95.a-0.93_runtime_main.c) =
8b870b363c3f0d108979fe44248632b77258eb0d
+SHA1 (patch-libf95.a-0.93_runtime_main.c) =
29f21eb78c2391af49471eacf2b17bc3a9207591
Index: lang/g95/patches/patch-ab
==================================================================
--- lang/g95/patches/patch-ab
+++ lang/g95/patches/patch-ab
@@ -2,20 +2,28 @@
Use $(host_alias) as the program prefix so it matches ${MACHINE_GNU_PLATFORM}
--- Makefile.in.orig 2010-04-22 04:23:24.000000000 +0000
+++ Makefile.in
-@@ -1418,7 +1418,7 @@ clean-local:
+@@ -15,6 +15,7 @@
+
+ @SET_MAKE@
+
++AM_CPPFLAGS=
-DFORTRAN_LIBRARY_RPATH="\"-Wl,$(LINKER_RPATH_FLAG)$(DEST_LIBDIR)\""
+
+ VPATH = @srcdir@
+ pkgdatadir = $(datadir)/@PACKAGE@
+@@ -1418,7 +1419,7 @@ clean-local:
rm -f options.tmp options.c options.h version.c
install-exec-hook:
- mv $(DESTDIR)$(bindir)/g95$(EXEEXT)
$(DESTDIR)$(bindir)/$(host)-g95$(EXEEXT)
+ mv $(DESTDIR)$(bindir)/g95$(EXEEXT)
$(DESTDIR)$(bindir)/$(host_alias)-g95$(EXEEXT)
install-data-hook:
-ln -sf f951$(EXEEXT) $(DESTDIR)@DEST_LIBDIR@/cc1
-@@ -1429,8 +1429,9 @@ install-data-hook:
+@@ -1429,8 +1430,9 @@ install-data-hook:
ranlib $(DESTDIR)@DEST_LIBDIR@/libgcc_eh.a ; \
ranlib $(DESTDIR)@DEST_LIBDIR@/libgcc.a ; \
fi
- cp INSTALL $(DESTDIR)@DEST_LIBDIR@/../../../..
- cp G95Manual.pdf $(DESTDIR)@DEST_LIBDIR@/../../../..
ADDED lang/g95/patches/patch-g95spec.c
Index: lang/g95/patches/patch-g95spec.c
==================================================================
--- lang/g95/patches/patch-g95spec.c
+++ lang/g95/patches/patch-g95spec.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- g95spec.c.orig 2008-10-15 14:41:42.000000000 +0000
++++ g95spec.c
+@@ -527,6 +527,8 @@ For more information about these matters
+ case 1:
+ if (need_math)
+ append_arg (MATH_LIBRARY);
++ case 2:
++ append_arg (FORTRAN_LIBRARY_RPATH);
+ default:
+ break;
+ }
ADDED lang/g95/patches/patch-gcc_Makefile.in
Index: lang/g95/patches/patch-gcc_Makefile.in
==================================================================
--- lang/g95/patches/patch-gcc_Makefile.in
+++ lang/g95/patches/patch-gcc_Makefile.in
@@ -0,0 +1,15 @@
+$NetBSD: patch-gcc_Makefile.in,v 1.5 2013/04/21 08:55:19 sbd Exp $
+
+Add gcc libdir to a programs rpath so that _this gcc's_ support libraries
+are found.
+
+--- ../gcc-4.1.2/gcc/Makefile.in.orig 2012-03-07 10:59:56.000000000 +0000
++++ ../gcc-4.1.2/gcc/Makefile.in
+@@ -1597,6 +1597,7 @@ c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H
+ # Language-independent files.
+
+ DRIVER_DEFINES = \
++ -DLINK_LIBGCC_SPEC="\"%D
$(LINKER_RPATH_FLAG)$(libdir)/gcc/$(target_noncanonical)/$(gcc_version) \"" \
+ -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+ -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
MISSING lang/g95/patches/patch-gcc_gcc.c
Index: lang/g95/patches/patch-gcc_gcc.c
==================================================================
ADDED lang/g95/patches/patch-libf95.a-0.93_Makefile.am
Index: lang/g95/patches/patch-libf95.a-0.93_Makefile.am
==================================================================
--- lang/g95/patches/patch-libf95.a-0.93_Makefile.am
+++ lang/g95/patches/patch-libf95.a-0.93_Makefile.am
@@ -0,0 +1,71 @@
+$NetBSD$
+
+--- libf95.a-0.93/Makefile.am.orig 2008-10-09 01:29:42.000000000 +0000
++++ libf95.a-0.93/Makefile.am
+@@ -1,11 +1,13 @@
+-
+-extra_LIBRARIES=libf95.a
+-
+ extradir = @DEST_LIBDIR@
++LIBTOOL= libtool
++AM_LIBTOOLFLAGS= --tag=CC
+
++install-exec-local:
++ ${LIBTOOL} --mode=install ${INSTALL} libf95.la ${DESTDIR}${extradir}
+
+-
+-libf95_a_SOURCES=intrinsics/adjust.c intrinsics/all.c intrinsics/any.c
\
++noinst_LTLIBRARIES = libf95.la
++libf95_la_LDFLAGS= -version 1:0:0 -rpath ${extradir}
++libf95_la_SOURCES=intrinsics/adjust.c intrinsics/all.c intrinsics/any.c
\
+ intrinsics/command.c intrinsics/count.c intrinsics/cshift.c \
+ intrinsics/dot_product.c intrinsics/dot_product10.c \
+ intrinsics/eoshift.c intrinsics/gerror.c intrinsics/get_environ.c \
+@@ -34,31 +36,31 @@ unix/exit.c unix/ftell.c unix/getarg.c u
+ unix/rename.c unix/signal.c unix/system.c unix/time.c unix/unlink.c
+
+ if HAVE_REAL_10_AM
+-libf95_a_SOURCES += math/x87.S
++libf95_la_SOURCES += math/x87.S
+ endif
+
+ if HAVE_RESUME_AM
+-libf95_a_SOURCES += runtime/resume.c
++libf95_la_SOURCES += runtime/resume.c
+ endif
+
+ if HAVE_UNIX_AM
+-libf95_a_SOURCES += unix/fpu_trap.c unix/getlog.c unix/getpid.c
+-libf95_a_SOURCES += unix/system_clock.c unix/dtime.c unix/etime.c
+-libf95_a_SOURCES += unix/cpu_time.c unix/date_and_time.c unix/fdate.c
+-libf95_a_SOURCES += unix/hostnm.c unix/getuid.c unix/idate.c unix/itime.c
+-libf95_a_SOURCES += unix/sleep.c unix/stat.c unix/unix_io.c unix/secnds.c
+-libf95_a_SOURCES += unix/second.c
++libf95_la_SOURCES += unix/fpu_trap.c unix/getlog.c unix/getpid.c
++libf95_la_SOURCES += unix/system_clock.c unix/dtime.c unix/etime.c
++libf95_la_SOURCES += unix/cpu_time.c unix/date_and_time.c unix/fdate.c
++libf95_la_SOURCES += unix/hostnm.c unix/getuid.c unix/idate.c unix/itime.c
++libf95_la_SOURCES += unix/sleep.c unix/stat.c unix/unix_io.c unix/secnds.c
++libf95_la_SOURCES += unix/second.c
+ endif
+
+ if HAVE_WINDOWS_AM
+-libf95_a_SOURCES += windows/fpu_trap_win.c windows/dtime_win.c
+-libf95_a_SOURCES += windows/etime_win.c windows/system_clock_win.c
+-libf95_a_SOURCES += windows/cpu_time_win.c windows/date_and_time_win.c
+-libf95_a_SOURCES += windows/hostnm_win.c windows/itime_win.c
+-libf95_a_SOURCES += windows/getlog_win.c windows/getpid_win.c
+-libf95_a_SOURCES += windows/fdate_win.c windows/sleep_win.c
+-libf95_a_SOURCES += windows/windows_io.c windows/secnds_win.c
+-libf95_a_SOURCES += windows/second_win.c windows/stat_win.c
windows/idate_win.c
++libf95_la_SOURCES += windows/fpu_trap_win.c windows/dtime_win.c
++libf95_la_SOURCES += windows/etime_win.c windows/system_clock_win.c
++libf95_la_SOURCES += windows/cpu_time_win.c windows/date_and_time_win.c
++libf95_la_SOURCES += windows/hostnm_win.c windows/itime_win.c
++libf95_la_SOURCES += windows/getlog_win.c windows/getpid_win.c
++libf95_la_SOURCES += windows/fdate_win.c windows/sleep_win.c
++libf95_la_SOURCES += windows/windows_io.c windows/secnds_win.c
++libf95_la_SOURCES += windows/second_win.c windows/stat_win.c
windows/idate_win.c
+ endif
+
+ EXTRA_DIST=io/power5.h io/p5.py io/p10.py
Index: lang/g95/patches/patch-libf95.a-0.93_runtime_main.c
==================================================================
--- lang/g95/patches/patch-libf95.a-0.93_runtime_main.c
+++ lang/g95/patches/patch-libf95.a-0.93_runtime_main.c
@@ -2,11 +2,28 @@
* fixes missing restore stack address. PR pkg/47906
--- libf95.a-0.93/runtime/main.c.orig 2010-04-18 15:47:28.000000000 +0000
+++ libf95.a-0.93/runtime/main.c
-@@ -50,9 +50,11 @@ int main(int argc, char *argv[]) {
+@@ -37,11 +37,12 @@
+ void __main(void) {}
+ #endif
+
+-
+-
+-
+ /* main()-- Entry point for the fortran program */
+-void MAIN_(void);
++#if __GNUC__ - 0 == 4 && __GNUC_MINOR__ < 2
++extern void weak_MAIN_(void) __attribute__((__weakref__("MAIN_")));
++#else
++static void weak_MAIN_(void) __attribute__((__weakref__("MAIN_")));
++#endif
+
+ int main(int argc, char *argv[]) {
+
+@@ -50,17 +51,25 @@ int main(int argc, char *argv[]) {
* unaligned. */
#if HAVE_REAL_10 == 1 || HAVE_REAL_10 == 2
+ int diff;
asm("mov %%esp, %%eax\n"
@@ -15,11 +32,15 @@
+ "movl %%eax, %0\n"
+ "sub %%eax, %%esp\n" : "=r"(diff) : : "%eax");
#endif
g95_runtime_start(argc, argv);
-@@ -62,5 +64,10 @@ int main(int argc, char *argv[]) {
+
+- MAIN_(); /* Call the Fortran main program. */
++ if (weak_MAIN_)
++ weak_MAIN_(); /* Call the Fortran main program. */
+
memory_done();
g95_runtime_stop();
+#if HAVE_REAL_10 == 1 || HAVE_REAL_10 == 2
+ asm("mov %0, %%eax\n"
Home |
Main Index |
Thread Index |
Old Index