# HG changeset patch # User John Donoghue # Date 1374968998 14400 # Node ID 23a5b6df30611c69b2f732d026bb0eea9b6efe04 # Parent b89f8cfeff8ef7ddf4566f42891d59229cabca5a Update cfitsio for mingw build * src/cfitsio.mk: Add build rule for non msvc targets * src/mingw-cfitsio-1-fixes.patch: New file diff -r b89f8cfeff8e -r 23a5b6df3061 src/cfitsio.mk --- a/src/cfitsio.mk Sat Jul 27 09:00:51 2013 -0400 +++ b/src/cfitsio.mk Sat Jul 27 19:49:58 2013 -0400 @@ -9,6 +9,11 @@ $(PKG)_URL := ftp://heasarc.gsfc.nasa.gov/software/$(PKG)/c/$($(PKG)_FILE) $(PKG)_DEPS := +$(PKG)_MAKE_FLAGS := +ifeq ($(BUILD_SHARED),yes) + $(PKG)_MAKE_FLAGS += shared +endif + define $(PKG)_UPDATE echo 'Warning: Updates are temporarily disabled for package cfitsio.' >&2; echo $(cfitsio_VERSION) @@ -40,7 +45,12 @@ endef else define $(PKG)_BUILD - echo "Building of package cfitsio not implemented yet." - false + cd '$(1)' && '$(1)/configure' \ + $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \ + $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \ + --prefix='$(HOST_PREFIX)' + $(MAKE) -C '$(1)' -j '$(JOBS)' $($(PKG)_MAKE_FLAGS) + $(MAKE) -C '$(1)' -j 1 install + endef endif diff -r b89f8cfeff8e -r 23a5b6df3061 src/mingw-cfitsio-1-fixes.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mingw-cfitsio-1-fixes.patch Sat Jul 27 19:49:58 2013 -0400 @@ -0,0 +1,226 @@ +diff -ur cfitsio.orig/configure cfitsio/configure +--- cfitsio.orig/configure 2013-07-27 18:39:53 -0400 ++++ cfitsio/configure 2013-07-27 19:01:46 -0400 +@@ -1960,7 +1960,7 @@ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "failed to load site script $ac_site_file +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + fi + done + +@@ -2101,7 +2101,7 @@ + $as_echo "$ac_cv_build" >&6; } + case $ac_cv_build in + *-*-*) ;; +-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; ++*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; + esac + build=$ac_cv_build + ac_save_IFS=$IFS; IFS='-' +@@ -2134,7 +2134,7 @@ + $as_echo "$ac_cv_host" >&6; } + case $ac_cv_host in + *-*-*) ;; +-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; ++*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; + esac + host=$ac_cv_host + ac_save_IFS=$IFS; IFS='-' +@@ -2167,7 +2167,7 @@ + $as_echo "$ac_cv_target" >&6; } + case $ac_cv_target in + *-*-*) ;; +-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; ++*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; + esac + target=$ac_cv_target + ac_save_IFS=$IFS; IFS='-' +@@ -2337,7 +2337,7 @@ + EXT="dec" + ;; + *) +- echo "cfitsio: == Don't know what do do with $host" ++ echo "cfitsio: == X Don't know what do do with $host" + ;; + esac + +@@ -2691,7 +2691,7 @@ + test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "no acceptable C compiler found in \$PATH +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + + # Provide some information about the compiler. + $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +@@ -2806,7 +2806,7 @@ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error 77 "C compiler cannot create executables +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } +@@ -2849,7 +2849,7 @@ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot compute suffix of executables: cannot compile and link +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + fi + rm -f conftest conftest$ac_cv_exeext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +@@ -2908,7 +2908,7 @@ + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot run C compiled programs. + If you meant to cross compile, use \`--host'. +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + fi + fi + fi +@@ -2960,7 +2960,7 @@ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "cannot compute suffix of object files: cannot compile +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext + fi +@@ -3529,7 +3529,7 @@ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details" "$LINENO" 5; } ++See \`config.log' for more details" "$LINENO" 5 ; } + fi + + ac_ext=c +@@ -3968,6 +3968,8 @@ + $as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h + + ;; ++ *mingw*) ++ ;; + *solaris*) + if test "x$CFORTRANFLAGS" = x ; then + CFORTRANFLAGS="-Dsolaris" +@@ -4081,6 +4083,10 @@ + CFITSIO_SHLIB_SONAME="" + lhea_shlib_cflags= + case $EXT in ++ mingw32) ++ SHLIB_LD="$CC -shared" ++ SHLIB_SUFFIX=".dll" ++ ;; + cygwin) + SHLIB_LD="$CC -shared" + SHLIB_SUFFIX=".dll" +@@ -5255,7 +5261,7 @@ + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + +- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; ++ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + esac + done + +@@ -5463,7 +5469,7 @@ + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; +- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; ++ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac +@@ -5491,7 +5497,7 @@ + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || +- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; ++ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" +@@ -5518,7 +5524,7 @@ + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac +@@ -6425,7 +6431,7 @@ + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "cfitsio.pc") CONFIG_FILES="$CONFIG_FILES cfitsio.pc" ;; + +- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; ++ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; + esac + done + +@@ -6633,7 +6639,7 @@ + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; +- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; ++ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac +@@ -6661,7 +6667,7 @@ + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || +- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; ++ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" +@@ -6688,7 +6694,7 @@ + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ +- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac +diff -ur cfitsio.orig/configure.in cfitsio/configure.in +--- cfitsio.orig/configure.in 2013-07-27 18:39:53 -0400 ++++ cfitsio/configure.in 2013-07-27 19:01:32 -0400 +@@ -141,7 +141,7 @@ + EXT="dec" + ;; + *) +- echo "cfitsio: == Don't know what do do with $host" ++ echo "cfitsio: == X Don't know what do do with $host" + ;; + esac + +@@ -286,6 +286,8 @@ + AC_DEFINE(_LARGEFILE_SOURCE) + AC_DEFINE(_FILE_OFFSET_BITS,64) + ;; ++ *mingw*) ++ ;; + *solaris*) + if test "x$CFORTRANFLAGS" = x ; then + CFORTRANFLAGS="-Dsolaris" +@@ -352,6 +354,10 @@ + CFITSIO_SHLIB_SONAME="" + lhea_shlib_cflags= + case $EXT in ++ mingw32) ++ SHLIB_LD="$CC -shared" ++ SHLIB_SUFFIX=".dll" ++ ;; + cygwin) + SHLIB_LD="$CC -shared" + SHLIB_SUFFIX=".dll"